@syntrologie/runtime-sdk 2.0.0 → 2.0.1-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CAPABILITIES.md +232 -138
- package/README.md +76 -57
- package/dist/RuntimeProvider.d.ts +6 -6
- package/dist/RuntimeProvider.js +2 -3
- package/dist/RuntimeProvider.js.map +1 -1
- package/dist/SmartCanvasApp.d.ts +8 -8
- package/dist/SmartCanvasApp.js +16 -18
- package/dist/SmartCanvasApp.js.map +1 -1
- package/dist/SmartCanvasElement.d.ts +5 -5
- package/dist/SmartCanvasElement.js +13 -13
- package/dist/SmartCanvasElement.js.map +1 -1
- package/dist/SmartCanvasPortal.d.ts +2 -2
- package/dist/SmartCanvasPortal.js +2 -2
- package/dist/actions/ActionEngine.d.ts +1 -1
- package/dist/actions/ActionEngine.js +24 -24
- package/dist/actions/ActionEngine.js.map +1 -1
- package/dist/actions/executors/index.d.ts +6 -6
- package/dist/actions/executors/index.js +22 -22
- package/dist/actions/executors/index.js.map +1 -1
- package/dist/actions/executors/tour.d.ts +1 -1
- package/dist/actions/executors/tour.js +19 -19
- package/dist/actions/executors/tour.js.map +1 -1
- package/dist/actions/index.d.ts +5 -5
- package/dist/actions/index.js +3 -3
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/types.d.ts +37 -37
- package/dist/actions/validation.d.ts +1 -1
- package/dist/actions/validation.js +195 -196
- package/dist/actions/validation.js.map +1 -1
- package/dist/antiFlicker.js +1 -1
- package/dist/api.d.ts +10 -10
- package/dist/api.js +11 -11
- package/dist/api.js.map +1 -1
- package/dist/apps/AppContext.d.ts +2 -2
- package/dist/apps/AppContext.js +1 -1
- package/dist/apps/AppContext.js.map +1 -1
- package/dist/apps/AppLoader.d.ts +2 -2
- package/dist/apps/AppLoader.js +24 -24
- package/dist/apps/AppLoader.js.map +1 -1
- package/dist/apps/AppRegistry.d.ts +2 -2
- package/dist/apps/AppRegistry.js +28 -28
- package/dist/apps/AppRegistry.js.map +1 -1
- package/dist/apps/adaptive-chatbot/index.js +7 -0
- package/dist/apps/adaptive-chatbot/index.js.map +7 -0
- package/dist/apps/examples/gamification-app.example.d.ts +3 -3
- package/dist/apps/examples/gamification-app.example.js +94 -94
- package/dist/apps/examples/gamification-app.example.js.map +1 -1
- package/dist/apps/faq/index.js.map +3 -3
- package/dist/apps/gamification/index.js.map +3 -3
- package/dist/apps/index.d.ts +10 -10
- package/dist/apps/index.js +6 -6
- package/dist/apps/nav/index.js.map +3 -3
- package/dist/apps/types.d.ts +10 -10
- package/dist/blocks/data/ComparisonBlock.d.ts +1 -1
- package/dist/blocks/data/ComparisonBlock.js +40 -40
- package/dist/blocks/data/ComparisonBlock.js.map +1 -1
- package/dist/blocks/data/StatsBlock.d.ts +1 -1
- package/dist/blocks/data/StatsBlock.js +41 -41
- package/dist/blocks/data/StatsBlock.js.map +1 -1
- package/dist/blocks/data/index.d.ts +2 -2
- package/dist/blocks/data/index.js +2 -2
- package/dist/blocks/index.d.ts +5 -5
- package/dist/blocks/index.js +29 -29
- package/dist/blocks/index.js.map +1 -1
- package/dist/blocks/interactive/ChecklistBlock.d.ts +1 -1
- package/dist/blocks/interactive/ChecklistBlock.js +60 -60
- package/dist/blocks/interactive/ChecklistBlock.js.map +1 -1
- package/dist/blocks/interactive/RatingBlock.d.ts +1 -1
- package/dist/blocks/interactive/RatingBlock.js +75 -65
- package/dist/blocks/interactive/RatingBlock.js.map +1 -1
- package/dist/blocks/interactive/index.d.ts +2 -2
- package/dist/blocks/interactive/index.js +2 -2
- package/dist/blocks/notification/NotificationBlock.d.ts +2 -2
- package/dist/blocks/notification/NotificationBlock.js +67 -63
- package/dist/blocks/notification/NotificationBlock.js.map +1 -1
- package/dist/blocks/notification/index.d.ts +1 -1
- package/dist/blocks/notification/index.js +1 -1
- package/dist/bootstrap.d.ts +10 -10
- package/dist/bootstrap.js +54 -40
- package/dist/bootstrap.js.map +1 -1
- package/dist/components/ShadowCanvasOverlay.d.ts +6 -6
- package/dist/components/ShadowCanvasOverlay.js +117 -107
- package/dist/components/ShadowCanvasOverlay.js.map +1 -1
- package/dist/components/TileCard.d.ts +5 -5
- package/dist/components/TileCard.js +174 -143
- package/dist/components/TileCard.js.map +1 -1
- package/dist/components/TileWheel.d.ts +3 -3
- package/dist/components/TileWheel.js +7 -7
- package/dist/components/TileWheel.js.map +1 -1
- package/dist/configFetcher.d.ts +2 -2
- package/dist/configFetcher.js +10 -7
- package/dist/configFetcher.js.map +1 -1
- package/dist/context/ContextManager.d.ts +3 -3
- package/dist/context/ContextManager.js +15 -15
- package/dist/context/ContextManager.js.map +1 -1
- package/dist/context/index.d.ts +4 -4
- package/dist/context/index.js +3 -3
- package/dist/context/schema.d.ts +1 -1
- package/dist/context/schema.js +1 -1
- package/dist/decisions/engine.d.ts +5 -5
- package/dist/decisions/engine.js +13 -13
- package/dist/decisions/index.d.ts +6 -6
- package/dist/decisions/index.js +5 -5
- package/dist/decisions/schema.d.ts +1 -1
- package/dist/decisions/schema.js +20 -20
- package/dist/decisions/strategies/rules.d.ts +1 -1
- package/dist/decisions/strategies/rules.js +24 -24
- package/dist/decisions/strategies/rules.js.map +1 -1
- package/dist/decisions/strategies/score.d.ts +1 -1
- package/dist/decisions/strategies/score.js +3 -3
- package/dist/decisions/types.d.ts +19 -19
- package/dist/editorLoader.js +20 -20
- package/dist/editorLoader.js.map +1 -1
- package/dist/events/EventBus.d.ts +3 -3
- package/dist/events/EventBus.js +5 -7
- package/dist/events/EventBus.js.map +1 -1
- package/dist/events/index.d.ts +6 -6
- package/dist/events/index.js +5 -5
- package/dist/events/normalizers/canvas.d.ts +2 -2
- package/dist/events/normalizers/canvas.js +3 -3
- package/dist/events/normalizers/canvas.js.map +1 -1
- package/dist/events/normalizers/posthog.d.ts +1 -1
- package/dist/events/normalizers/posthog.js +34 -27
- package/dist/events/normalizers/posthog.js.map +1 -1
- package/dist/events/schema.d.ts +1 -1
- package/dist/events/schema.js +2 -2
- package/dist/events/types.d.ts +1 -1
- package/dist/events/types.js +27 -27
- package/dist/experiments/adapters/growthbook.d.ts +4 -4
- package/dist/experiments/adapters/growthbook.js +5 -5
- package/dist/experiments/adapters/growthbook.js.map +1 -1
- package/dist/experiments/index.d.ts +3 -3
- package/dist/experiments/index.js +1 -1
- package/dist/experiments/registry.d.ts +2 -2
- package/dist/experiments/registry.js +2 -2
- package/dist/experiments/types.d.ts +5 -1
- package/dist/fetchers/cdnFetcher.d.ts +1 -1
- package/dist/fetchers/cdnFetcher.js +4 -8
- package/dist/fetchers/cdnFetcher.js.map +1 -1
- package/dist/fetchers/experimentsFetcher.d.ts +2 -2
- package/dist/fetchers/experimentsFetcher.js +7 -7
- package/dist/fetchers/experimentsFetcher.js.map +1 -1
- package/dist/fetchers/index.d.ts +3 -3
- package/dist/fetchers/index.js +2 -2
- package/dist/fetchers/index.js.map +1 -1
- package/dist/fetchers/registry.d.ts +1 -1
- package/dist/fetchers/registry.js +4 -4
- package/dist/fetchers/types.d.ts +1 -1
- package/dist/hooks/useCanvasOverlays.d.ts +5 -5
- package/dist/hooks/useCanvasOverlays.js +15 -13
- package/dist/hooks/useCanvasOverlays.js.map +1 -1
- package/dist/hooks/useHostPatches.d.ts +2 -2
- package/dist/hooks/useHostPatches.js +8 -8
- package/dist/hooks/useHostPatches.js.map +1 -1
- package/dist/hooks/useShadowCanvasConfig.d.ts +3 -3
- package/dist/hooks/useShadowCanvasConfig.js +5 -2
- package/dist/hooks/useShadowCanvasConfig.js.map +1 -1
- package/dist/hostPatcher/core/patcher.d.ts +1 -1
- package/dist/hostPatcher/core/patcher.js +18 -9
- package/dist/hostPatcher/core/patcher.js.map +1 -1
- package/dist/hostPatcher/core/sanitizer.js +24 -3
- package/dist/hostPatcher/core/sanitizer.js.map +1 -1
- package/dist/hostPatcher/policy/defaultPolicy.js +15 -5
- package/dist/hostPatcher/policy/defaultPolicy.js.map +1 -1
- package/dist/hostPatcher/utils/anchors.js +4 -6
- package/dist/hostPatcher/utils/anchors.js.map +1 -1
- package/dist/index.d.ts +32 -32
- package/dist/index.js +29 -29
- package/dist/index.js.map +1 -1
- package/dist/metrics/index.d.ts +1 -1
- package/dist/metrics/index.js +1 -1
- package/dist/metrics/sessionMetrics.d.ts +1 -1
- package/dist/metrics/sessionMetrics.js +6 -6
- package/dist/overlays/fetcher.d.ts +2 -2
- package/dist/overlays/fetcher.js +4 -4
- package/dist/overlays/recipeRegistry.js +2 -2
- package/dist/overlays/recipeRegistry.js.map +1 -1
- package/dist/overlays/runtime/anchor/resolve.js +1 -1
- package/dist/overlays/runtime/anchor/resolve.js.map +1 -1
- package/dist/overlays/runtime/index.d.ts +7 -7
- package/dist/overlays/runtime/index.js +7 -7
- package/dist/overlays/runtime/overlay/highlight.js +39 -39
- package/dist/overlays/runtime/overlay/highlight.js.map +1 -1
- package/dist/overlays/runtime/overlay/modal.js +5 -5
- package/dist/overlays/runtime/overlay/modal.js.map +1 -1
- package/dist/overlays/runtime/overlay/root.js +1 -1
- package/dist/overlays/runtime/overlay/runner.js +70 -23
- package/dist/overlays/runtime/overlay/runner.js.map +1 -1
- package/dist/overlays/runtime/overlay/tooltip.d.ts +1 -1
- package/dist/overlays/runtime/overlay/tooltip.js +10 -10
- package/dist/overlays/runtime/overlay/tooltip.js.map +1 -1
- package/dist/overlays/runtime/utils/dom.js +4 -1
- package/dist/overlays/runtime/utils/dom.js.map +1 -1
- package/dist/overlays/schema.js +12 -8
- package/dist/overlays/schema.js.map +1 -1
- package/dist/react.d.ts +7 -7
- package/dist/react.js +4 -4
- package/dist/react.js.map +1 -1
- package/dist/render/RenderContext.d.ts +2 -2
- package/dist/render/RenderContext.js +5 -5
- package/dist/render/RenderContext.js.map +1 -1
- package/dist/render/index.d.ts +3 -3
- package/dist/render/index.js +1 -1
- package/dist/render/types.d.ts +4 -4
- package/dist/runtime.d.ts +12 -12
- package/dist/runtime.js +20 -20
- package/dist/runtime.js.map +1 -1
- package/dist/smart-canvas.esm.js +16 -16
- package/dist/smart-canvas.esm.js.map +4 -4
- package/dist/smart-canvas.js +644 -491
- package/dist/smart-canvas.js.map +4 -4
- package/dist/smart-canvas.min.js +15 -15
- package/dist/smart-canvas.min.js.map +4 -4
- package/dist/state/StateStore.d.ts +1 -1
- package/dist/state/StateStore.js +9 -9
- package/dist/state/StateStore.js.map +1 -1
- package/dist/state/helpers/cooldowns.d.ts +1 -1
- package/dist/state/helpers/cooldowns.js +1 -1
- package/dist/state/helpers/dismissals.d.ts +1 -1
- package/dist/state/helpers/dismissals.js +1 -1
- package/dist/state/helpers/frequency.d.ts +1 -1
- package/dist/state/helpers/frequency.js +1 -1
- package/dist/state/index.d.ts +4 -4
- package/dist/state/index.js +3 -3
- package/dist/state/schema.d.ts +1 -1
- package/dist/state/schema.js +1 -1
- package/dist/store/example.js +13 -13
- package/dist/store/example.js.map +1 -1
- package/dist/store/mini-effector.js +6 -8
- package/dist/store/mini-effector.js.map +1 -1
- package/dist/surfaces/Surfaces.d.ts +1 -1
- package/dist/surfaces/Surfaces.js +25 -25
- package/dist/surfaces/Surfaces.js.map +1 -1
- package/dist/surfaces/index.d.ts +4 -4
- package/dist/surfaces/index.js +3 -3
- package/dist/surfaces/positioning.d.ts +2 -2
- package/dist/surfaces/positioning.js +74 -77
- package/dist/surfaces/positioning.js.map +1 -1
- package/dist/surfaces/types.d.ts +9 -9
- package/dist/surfaces/types.js +7 -7
- package/dist/surfaces/types.js.map +1 -1
- package/dist/telemetry/adapters/noop.d.ts +12 -0
- package/dist/telemetry/adapters/noop.js +42 -0
- package/dist/telemetry/adapters/noop.js.map +1 -0
- package/dist/telemetry/adapters/posthog.d.ts +2 -2
- package/dist/telemetry/adapters/posthog.js +29 -16
- package/dist/telemetry/adapters/posthog.js.map +1 -1
- package/dist/telemetry/index.d.ts +4 -3
- package/dist/telemetry/index.js +3 -2
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/registry.d.ts +2 -2
- package/dist/telemetry/registry.js +4 -2
- package/dist/telemetry/registry.js.map +1 -1
- package/dist/telemetry/types.d.ts +1 -1
- package/dist/theme/ThemeProvider.d.ts +2 -2
- package/dist/theme/ThemeProvider.js +21 -21
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/defaultTheme.d.ts +2 -2
- package/dist/theme/defaultTheme.js +111 -111
- package/dist/theme/defaultTheme.js.map +1 -1
- package/dist/theme/extractHostTheme.d.ts +1 -1
- package/dist/theme/extractHostTheme.js +42 -44
- package/dist/theme/extractHostTheme.js.map +1 -1
- package/dist/theme/index.d.ts +5 -5
- package/dist/theme/index.js +3 -3
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/types.d.ts +2 -2
- package/dist/token.js +3 -6
- package/dist/token.js.map +1 -1
- package/dist/types-only.d.ts +1 -1
- package/dist/types.d.ts +43 -43
- package/dist/widgets/WidgetRegistry.d.ts +2 -2
- package/dist/widgets/WidgetRegistry.js +11 -11
- package/dist/widgets/WidgetRegistry.js.map +1 -1
- package/dist/widgets/index.d.ts +2 -2
- package/dist/widgets/index.js +1 -1
- package/dist/widgets/index.js.map +1 -1
- package/package.json +4 -2
- package/schema/canvas-config.schema.json +51 -7
- package/schema/runtime-context.schema.json +1 -5
package/dist/smart-canvas.min.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var SyntrologieSDK=(()=>{var R1=Object.create;var ys=Object.defineProperty;var T1=Object.getOwnPropertyDescriptor;var P1=Object.getOwnPropertyNames;var I1=Object.getPrototypeOf,O1=Object.prototype.hasOwnProperty;var pv=t=>{throw TypeError(t)};var N1=(t,e,n)=>e in t?ys(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var zn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hv=(t,e)=>{for(var n in e)ys(t,n,{get:e[n],enumerable:!0})},gv=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of P1(e))!O1.call(t,i)&&i!==n&&ys(t,i,{get:()=>e[i],enumerable:!(r=T1(e,i))||r.enumerable});return t};var ee=(t,e,n)=>(n=t!=null?R1(I1(t)):{},gv(e||!t||!t.__esModule?ys(n,"default",{value:t,enumerable:!0}):n,t)),L1=t=>gv(ys({},"__esModule",{value:!0}),t);var j=(t,e,n)=>N1(t,typeof e!="symbol"?e+"":e,n),mv=(t,e,n)=>e.has(t)||pv("Cannot "+n);var xe=(t,e,n)=>(mv(t,e,"read from private field"),n?n.call(t):e.get(t)),_r=(t,e,n)=>e.has(t)?pv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),vn=(t,e,n,r)=>(mv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var d0=zn(ne=>{"use strict";var Qs=Symbol.for("react.element"),fA=Symbol.for("react.portal"),pA=Symbol.for("react.fragment"),hA=Symbol.for("react.strict_mode"),gA=Symbol.for("react.profiler"),mA=Symbol.for("react.provider"),vA=Symbol.for("react.context"),yA=Symbol.for("react.forward_ref"),_A=Symbol.for("react.suspense"),wA=Symbol.for("react.memo"),xA=Symbol.for("react.lazy"),e0=Symbol.iterator;function SA(t){return t===null||typeof t!="object"?null:(t=e0&&t[e0]||t["@@iterator"],typeof t=="function"?t:null)}var r0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},i0=Object.assign,o0={};function ko(t,e,n){this.props=t,this.context=e,this.refs=o0,this.updater=n||r0}ko.prototype.isReactComponent={};ko.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};ko.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function s0(){}s0.prototype=ko.prototype;function Dp(t,e,n){this.props=t,this.context=e,this.refs=o0,this.updater=n||r0}var Bp=Dp.prototype=new s0;Bp.constructor=Dp;i0(Bp,ko.prototype);Bp.isPureReactComponent=!0;var t0=Array.isArray,a0=Object.prototype.hasOwnProperty,Vp={current:null},l0={key:!0,ref:!0,__self:!0,__source:!0};function c0(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)a0.call(e,r)&&!l0.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Qs,type:t,key:o,ref:s,props:i,_owner:Vp.current}}function bA(t,e){return{$$typeof:Qs,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function zp(t){return typeof t=="object"&&t!==null&&t.$$typeof===Qs}function kA(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var n0=/\/+/g;function $p(t,e){return typeof t=="object"&&t!==null&&t.key!=null?kA(""+t.key):e.toString(36)}function fc(t,e,n,r,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case Qs:case fA:s=!0}}if(s)return s=t,i=i(s),t=r===""?"."+$p(s,0):r,t0(i)?(n="",t!=null&&(n=t.replace(n0,"$&/")+"/"),fc(i,e,n,"",function(c){return c})):i!=null&&(zp(i)&&(i=bA(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(n0,"$&/")+"/")+t)),e.push(i)),1;if(s=0,r=r===""?".":r+":",t0(t))for(var a=0;a<t.length;a++){o=t[a];var l=r+$p(o,a);s+=fc(o,e,n,l,i)}else if(l=SA(t),typeof l=="function")for(t=l.call(t),a=0;!(o=t.next()).done;)o=o.value,l=r+$p(o,a++),s+=fc(o,e,n,l,i);else if(o==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function dc(t,e,n){if(t==null)return t;var r=[],i=0;return fc(t,r,"","",function(o){return e.call(n,o,i++)}),r}function EA(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var ft={current:null},pc={transition:null},CA={ReactCurrentDispatcher:ft,ReactCurrentBatchConfig:pc,ReactCurrentOwner:Vp};function u0(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:dc,forEach:function(t,e,n){dc(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return dc(t,function(){e++}),e},toArray:function(t){return dc(t,function(e){return e})||[]},only:function(t){if(!zp(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ne.Component=ko;ne.Fragment=pA;ne.Profiler=gA;ne.PureComponent=Dp;ne.StrictMode=hA;ne.Suspense=_A;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=CA;ne.act=u0;ne.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=i0({},t.props),i=t.key,o=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,s=Vp.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)a0.call(e,l)&&!l0.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Qs,type:t.type,key:i,ref:o,props:r,_owner:s}};ne.createContext=function(t){return t={$$typeof:vA,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:mA,_context:t},t.Consumer=t};ne.createElement=c0;ne.createFactory=function(t){var e=c0.bind(null,t);return e.type=t,e};ne.createRef=function(){return{current:null}};ne.forwardRef=function(t){return{$$typeof:yA,render:t}};ne.isValidElement=zp;ne.lazy=function(t){return{$$typeof:xA,_payload:{_status:-1,_result:t},_init:EA}};ne.memo=function(t,e){return{$$typeof:wA,type:t,compare:e===void 0?null:e}};ne.startTransition=function(t){var e=pc.transition;pc.transition={};try{t()}finally{pc.transition=e}};ne.unstable_act=u0;ne.useCallback=function(t,e){return ft.current.useCallback(t,e)};ne.useContext=function(t){return ft.current.useContext(t)};ne.useDebugValue=function(){};ne.useDeferredValue=function(t){return ft.current.useDeferredValue(t)};ne.useEffect=function(t,e){return ft.current.useEffect(t,e)};ne.useId=function(){return ft.current.useId()};ne.useImperativeHandle=function(t,e,n){return ft.current.useImperativeHandle(t,e,n)};ne.useInsertionEffect=function(t,e){return ft.current.useInsertionEffect(t,e)};ne.useLayoutEffect=function(t,e){return ft.current.useLayoutEffect(t,e)};ne.useMemo=function(t,e){return ft.current.useMemo(t,e)};ne.useReducer=function(t,e,n){return ft.current.useReducer(t,e,n)};ne.useRef=function(t){return ft.current.useRef(t)};ne.useState=function(t){return ft.current.useState(t)};ne.useSyncExternalStore=function(t,e,n){return ft.current.useSyncExternalStore(t,e,n)};ne.useTransition=function(){return ft.current.useTransition()};ne.version="18.3.1"});var wt=zn((dN,f0)=>{"use strict";f0.exports=d0()});var h0=zn(gc=>{"use strict";var IA=wt(),OA=Symbol.for("react.element"),NA=Symbol.for("react.fragment"),LA=Object.prototype.hasOwnProperty,MA=IA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,FA={key:!0,ref:!0,__self:!0,__source:!0};function p0(t,e,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)LA.call(e,r)&&!FA.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:OA,type:t,key:o,ref:s,props:i,_owner:MA.current}}gc.Fragment=NA;gc.jsx=p0;gc.jsxs=p0});var ye=zn((RN,g0)=>{"use strict";g0.exports=h0()});var L0=zn(ge=>{"use strict";function eh(t,e){var n=t.length;t.push(e);e:for(;0<n;){var r=n-1>>>1,i=t[r];if(0<_c(i,e))t[r]=e,t[n]=i,n=r;else break e}}function sn(t){return t.length===0?null:t[0]}function xc(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var r=0,i=t.length,o=i>>>1;r<o;){var s=2*(r+1)-1,a=t[s],l=s+1,c=t[l];if(0>_c(a,n))l<i&&0>_c(c,a)?(t[r]=c,t[l]=n,r=l):(t[r]=a,t[s]=n,r=s);else if(l<i&&0>_c(c,n))t[r]=c,t[l]=n,r=l;else break e}}return e}function _c(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}typeof performance=="object"&&typeof performance.now=="function"?(E0=performance,ge.unstable_now=function(){return E0.now()}):(Xp=Date,C0=Xp.now(),ge.unstable_now=function(){return Xp.now()-C0});var E0,Xp,C0,En=[],Or=[],dR=1,Ut=null,rt=3,Sc=!1,wi=!1,na=!1,T0=typeof setTimeout=="function"?setTimeout:null,P0=typeof clearTimeout=="function"?clearTimeout:null,A0=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function th(t){for(var e=sn(Or);e!==null;){if(e.callback===null)xc(Or);else if(e.startTime<=t)xc(Or),e.sortIndex=e.expirationTime,eh(En,e);else break;e=sn(Or)}}function nh(t){if(na=!1,th(t),!wi)if(sn(En)!==null)wi=!0,ih(rh);else{var e=sn(Or);e!==null&&oh(nh,e.startTime-t)}}function rh(t,e){wi=!1,na&&(na=!1,P0(ra),ra=-1),Sc=!0;var n=rt;try{for(th(e),Ut=sn(En);Ut!==null&&(!(Ut.expirationTime>e)||t&&!N0());){var r=Ut.callback;if(typeof r=="function"){Ut.callback=null,rt=Ut.priorityLevel;var i=r(Ut.expirationTime<=e);e=ge.unstable_now(),typeof i=="function"?Ut.callback=i:Ut===sn(En)&&xc(En),th(e)}else xc(En);Ut=sn(En)}if(Ut!==null)var o=!0;else{var s=sn(Or);s!==null&&oh(nh,s.startTime-e),o=!1}return o}finally{Ut=null,rt=n,Sc=!1}}var bc=!1,wc=null,ra=-1,I0=5,O0=-1;function N0(){return!(ge.unstable_now()-O0<I0)}function Qp(){if(wc!==null){var t=ge.unstable_now();O0=t;var e=!0;try{e=wc(!0,t)}finally{e?ta():(bc=!1,wc=null)}}else bc=!1}var ta;typeof A0=="function"?ta=function(){A0(Qp)}:typeof MessageChannel<"u"?(Jp=new MessageChannel,R0=Jp.port2,Jp.port1.onmessage=Qp,ta=function(){R0.postMessage(null)}):ta=function(){T0(Qp,0)};var Jp,R0;function ih(t){wc=t,bc||(bc=!0,ta())}function oh(t,e){ra=T0(function(){t(ge.unstable_now())},e)}ge.unstable_IdlePriority=5;ge.unstable_ImmediatePriority=1;ge.unstable_LowPriority=4;ge.unstable_NormalPriority=3;ge.unstable_Profiling=null;ge.unstable_UserBlockingPriority=2;ge.unstable_cancelCallback=function(t){t.callback=null};ge.unstable_continueExecution=function(){wi||Sc||(wi=!0,ih(rh))};ge.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I0=0<t?Math.floor(1e3/t):5};ge.unstable_getCurrentPriorityLevel=function(){return rt};ge.unstable_getFirstCallbackNode=function(){return sn(En)};ge.unstable_next=function(t){switch(rt){case 1:case 2:case 3:var e=3;break;default:e=rt}var n=rt;rt=e;try{return t()}finally{rt=n}};ge.unstable_pauseExecution=function(){};ge.unstable_requestPaint=function(){};ge.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=rt;rt=t;try{return e()}finally{rt=n}};ge.unstable_scheduleCallback=function(t,e,n){var r=ge.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,t){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=n+i,t={id:dR++,callback:e,priorityLevel:t,startTime:n,expirationTime:i,sortIndex:-1},n>r?(t.sortIndex=n,eh(Or,t),sn(En)===null&&t===sn(Or)&&(na?(P0(ra),ra=-1):na=!0,oh(nh,n-r))):(t.sortIndex=i,eh(En,t),wi||Sc||(wi=!0,ih(rh))),t};ge.unstable_shouldYield=N0;ge.unstable_wrapCallback=function(t){var e=rt;return function(){var n=rt;rt=e;try{return t.apply(this,arguments)}finally{rt=n}}}});var F0=zn((mL,M0)=>{"use strict";M0.exports=L0()});var VS=zn(Dt=>{"use strict";var fR=wt(),Ft=F0();function T(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var jw=new Set,Ea={};function Ni(t,e){Ko(t,e),Ko(t+"Capture",e)}function Ko(t,e){for(Ea[t]=e,t=0;t<e.length;t++)jw.add(e[t])}var tr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rh=Object.prototype.hasOwnProperty,pR=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,$0={},D0={};function hR(t){return Rh.call(D0,t)?!0:Rh.call($0,t)?!1:pR.test(t)?D0[t]=!0:($0[t]=!0,!1)}function gR(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function mR(t,e,n,r){if(e===null||typeof e>"u"||gR(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function gt(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var et={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){et[t]=new gt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];et[e]=new gt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){et[t]=new gt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){et[t]=new gt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){et[t]=new gt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){et[t]=new gt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){et[t]=new gt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){et[t]=new gt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){et[t]=new gt(t,5,!1,t.toLowerCase(),null,!1,!1)});var wg=/[\-:]([a-z])/g;function xg(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(wg,xg);et[e]=new gt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(wg,xg);et[e]=new gt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(wg,xg);et[e]=new gt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){et[t]=new gt(t,1,!1,t.toLowerCase(),null,!1,!1)});et.xlinkHref=new gt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){et[t]=new gt(t,1,!1,t.toLowerCase(),null,!0,!0)});function Sg(t,e,n,r){var i=et.hasOwnProperty(e)?et[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(mR(e,n,i,r)&&(n=null),r||i===null?hR(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var or=fR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,kc=Symbol.for("react.element"),To=Symbol.for("react.portal"),Po=Symbol.for("react.fragment"),bg=Symbol.for("react.strict_mode"),Th=Symbol.for("react.profiler"),Uw=Symbol.for("react.provider"),Ww=Symbol.for("react.context"),kg=Symbol.for("react.forward_ref"),Ph=Symbol.for("react.suspense"),Ih=Symbol.for("react.suspense_list"),Eg=Symbol.for("react.memo"),Lr=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var qw=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var B0=Symbol.iterator;function ia(t){return t===null||typeof t!="object"?null:(t=B0&&t[B0]||t["@@iterator"],typeof t=="function"?t:null)}var Te=Object.assign,sh;function fa(t){if(sh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);sh=e&&e[1]||""}return`
|
|
1
|
+
var SyntrologieSDK=(()=>{var T1=Object.create;var ms=Object.defineProperty;var R1=Object.getOwnPropertyDescriptor;var I1=Object.getOwnPropertyNames;var P1=Object.getPrototypeOf,O1=Object.prototype.hasOwnProperty;var dv=t=>{throw TypeError(t)};var N1=(t,e,n)=>e in t?ms(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Vn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),fv=(t,e)=>{for(var n in e)ms(t,n,{get:e[n],enumerable:!0})},pv=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of I1(e))!O1.call(t,i)&&i!==n&&ms(t,i,{get:()=>e[i],enumerable:!(r=R1(e,i))||r.enumerable});return t};var ee=(t,e,n)=>(n=t!=null?T1(P1(t)):{},pv(e||!t||!t.__esModule?ms(n,"default",{value:t,enumerable:!0}):n,t)),L1=t=>pv(ms({},"__esModule",{value:!0}),t);var j=(t,e,n)=>N1(t,typeof e!="symbol"?e+"":e,n),hv=(t,e,n)=>e.has(t)||dv("Cannot "+n);var xe=(t,e,n)=>(hv(t,e,"read from private field"),n?n.call(t):e.get(t)),yr=(t,e,n)=>e.has(t)?dv("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),vn=(t,e,n,r)=>(hv(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);var d0=Vn(ne=>{"use strict";var Xs=Symbol.for("react.element"),pA=Symbol.for("react.portal"),hA=Symbol.for("react.fragment"),gA=Symbol.for("react.strict_mode"),mA=Symbol.for("react.profiler"),vA=Symbol.for("react.provider"),yA=Symbol.for("react.context"),_A=Symbol.for("react.forward_ref"),wA=Symbol.for("react.suspense"),xA=Symbol.for("react.memo"),SA=Symbol.for("react.lazy"),e0=Symbol.iterator;function bA(t){return t===null||typeof t!="object"?null:(t=e0&&t[e0]||t["@@iterator"],typeof t=="function"?t:null)}var r0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},i0=Object.assign,o0={};function So(t,e,n){this.props=t,this.context=e,this.refs=o0,this.updater=n||r0}So.prototype.isReactComponent={};So.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};So.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function s0(){}s0.prototype=So.prototype;function Dp(t,e,n){this.props=t,this.context=e,this.refs=o0,this.updater=n||r0}var Bp=Dp.prototype=new s0;Bp.constructor=Dp;i0(Bp,So.prototype);Bp.isPureReactComponent=!0;var t0=Array.isArray,a0=Object.prototype.hasOwnProperty,Vp={current:null},l0={key:!0,ref:!0,__self:!0,__source:!0};function c0(t,e,n){var r,i={},o=null,s=null;if(e!=null)for(r in e.ref!==void 0&&(s=e.ref),e.key!==void 0&&(o=""+e.key),e)a0.call(e,r)&&!l0.hasOwnProperty(r)&&(i[r]=e[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];i.children=l}if(t&&t.defaultProps)for(r in a=t.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:Xs,type:t,key:o,ref:s,props:i,_owner:Vp.current}}function kA(t,e){return{$$typeof:Xs,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function zp(t){return typeof t=="object"&&t!==null&&t.$$typeof===Xs}function EA(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(n){return e[n]})}var n0=/\/+/g;function $p(t,e){return typeof t=="object"&&t!==null&&t.key!=null?EA(""+t.key):e.toString(36)}function pc(t,e,n,r,i){var o=typeof t;(o==="undefined"||o==="boolean")&&(t=null);var s=!1;if(t===null)s=!0;else switch(o){case"string":case"number":s=!0;break;case"object":switch(t.$$typeof){case Xs:case pA:s=!0}}if(s)return s=t,i=i(s),t=r===""?"."+$p(s,0):r,t0(i)?(n="",t!=null&&(n=t.replace(n0,"$&/")+"/"),pc(i,e,n,"",function(c){return c})):i!=null&&(zp(i)&&(i=kA(i,n+(!i.key||s&&s.key===i.key?"":(""+i.key).replace(n0,"$&/")+"/")+t)),e.push(i)),1;if(s=0,r=r===""?".":r+":",t0(t))for(var a=0;a<t.length;a++){o=t[a];var l=r+$p(o,a);s+=pc(o,e,n,l,i)}else if(l=bA(t),typeof l=="function")for(t=l.call(t),a=0;!(o=t.next()).done;)o=o.value,l=r+$p(o,a++),s+=pc(o,e,n,l,i);else if(o==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return s}function fc(t,e,n){if(t==null)return t;var r=[],i=0;return pc(t,r,"","",function(o){return e.call(n,o,i++)}),r}function CA(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(n){(t._status===0||t._status===-1)&&(t._status=1,t._result=n)},function(n){(t._status===0||t._status===-1)&&(t._status=2,t._result=n)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var ft={current:null},hc={transition:null},AA={ReactCurrentDispatcher:ft,ReactCurrentBatchConfig:hc,ReactCurrentOwner:Vp};function u0(){throw Error("act(...) is not supported in production builds of React.")}ne.Children={map:fc,forEach:function(t,e,n){fc(t,function(){e.apply(this,arguments)},n)},count:function(t){var e=0;return fc(t,function(){e++}),e},toArray:function(t){return fc(t,function(e){return e})||[]},only:function(t){if(!zp(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};ne.Component=So;ne.Fragment=hA;ne.Profiler=mA;ne.PureComponent=Dp;ne.StrictMode=gA;ne.Suspense=wA;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=AA;ne.act=u0;ne.cloneElement=function(t,e,n){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var r=i0({},t.props),i=t.key,o=t.ref,s=t._owner;if(e!=null){if(e.ref!==void 0&&(o=e.ref,s=Vp.current),e.key!==void 0&&(i=""+e.key),t.type&&t.type.defaultProps)var a=t.type.defaultProps;for(l in e)a0.call(e,l)&&!l0.hasOwnProperty(l)&&(r[l]=e[l]===void 0&&a!==void 0?a[l]:e[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Xs,type:t.type,key:i,ref:o,props:r,_owner:s}};ne.createContext=function(t){return t={$$typeof:yA,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:vA,_context:t},t.Consumer=t};ne.createElement=c0;ne.createFactory=function(t){var e=c0.bind(null,t);return e.type=t,e};ne.createRef=function(){return{current:null}};ne.forwardRef=function(t){return{$$typeof:_A,render:t}};ne.isValidElement=zp;ne.lazy=function(t){return{$$typeof:SA,_payload:{_status:-1,_result:t},_init:CA}};ne.memo=function(t,e){return{$$typeof:xA,type:t,compare:e===void 0?null:e}};ne.startTransition=function(t){var e=hc.transition;hc.transition={};try{t()}finally{hc.transition=e}};ne.unstable_act=u0;ne.useCallback=function(t,e){return ft.current.useCallback(t,e)};ne.useContext=function(t){return ft.current.useContext(t)};ne.useDebugValue=function(){};ne.useDeferredValue=function(t){return ft.current.useDeferredValue(t)};ne.useEffect=function(t,e){return ft.current.useEffect(t,e)};ne.useId=function(){return ft.current.useId()};ne.useImperativeHandle=function(t,e,n){return ft.current.useImperativeHandle(t,e,n)};ne.useInsertionEffect=function(t,e){return ft.current.useInsertionEffect(t,e)};ne.useLayoutEffect=function(t,e){return ft.current.useLayoutEffect(t,e)};ne.useMemo=function(t,e){return ft.current.useMemo(t,e)};ne.useReducer=function(t,e,n){return ft.current.useReducer(t,e,n)};ne.useRef=function(t){return ft.current.useRef(t)};ne.useState=function(t){return ft.current.useState(t)};ne.useSyncExternalStore=function(t,e,n){return ft.current.useSyncExternalStore(t,e,n)};ne.useTransition=function(){return ft.current.useTransition()};ne.version="18.3.1"});var Nt=Vn((yN,f0)=>{"use strict";f0.exports=d0()});var g0=Vn(mc=>{"use strict";var IA=Nt(),PA=Symbol.for("react.element"),OA=Symbol.for("react.fragment"),NA=Object.prototype.hasOwnProperty,LA=IA.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,MA={key:!0,ref:!0,__self:!0,__source:!0};function h0(t,e,n){var r,i={},o=null,s=null;n!==void 0&&(o=""+n),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(s=e.ref);for(r in e)NA.call(e,r)&&!MA.hasOwnProperty(r)&&(i[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)i[r]===void 0&&(i[r]=e[r]);return{$$typeof:PA,type:t,key:o,ref:s,props:i,_owner:LA.current}}mc.Fragment=OA;mc.jsx=h0;mc.jsxs=h0});var ve=Vn((bN,m0)=>{"use strict";m0.exports=g0()});var M0=Vn(ge=>{"use strict";function eh(t,e){var n=t.length;t.push(e);e:for(;0<n;){var r=n-1>>>1,i=t[r];if(0<wc(i,e))t[r]=e,t[n]=i,n=r;else break e}}function sn(t){return t.length===0?null:t[0]}function Sc(t){if(t.length===0)return null;var e=t[0],n=t.pop();if(n!==e){t[0]=n;e:for(var r=0,i=t.length,o=i>>>1;r<o;){var s=2*(r+1)-1,a=t[s],l=s+1,c=t[l];if(0>wc(a,n))l<i&&0>wc(c,a)?(t[r]=c,t[l]=n,r=l):(t[r]=a,t[s]=n,r=s);else if(l<i&&0>wc(c,n))t[r]=c,t[l]=n,r=l;else break e}}return e}function wc(t,e){var n=t.sortIndex-e.sortIndex;return n!==0?n:t.id-e.id}typeof performance=="object"&&typeof performance.now=="function"?(C0=performance,ge.unstable_now=function(){return C0.now()}):(Xp=Date,A0=Xp.now(),ge.unstable_now=function(){return Xp.now()-A0});var C0,Xp,A0,kn=[],Pr=[],uT=1,Ut=null,rt=3,bc=!1,yi=!1,ta=!1,I0=typeof setTimeout=="function"?setTimeout:null,P0=typeof clearTimeout=="function"?clearTimeout:null,T0=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function th(t){for(var e=sn(Pr);e!==null;){if(e.callback===null)Sc(Pr);else if(e.startTime<=t)Sc(Pr),e.sortIndex=e.expirationTime,eh(kn,e);else break;e=sn(Pr)}}function nh(t){if(ta=!1,th(t),!yi)if(sn(kn)!==null)yi=!0,ih(rh);else{var e=sn(Pr);e!==null&&oh(nh,e.startTime-t)}}function rh(t,e){yi=!1,ta&&(ta=!1,P0(na),na=-1),bc=!0;var n=rt;try{for(th(e),Ut=sn(kn);Ut!==null&&(!(Ut.expirationTime>e)||t&&!L0());){var r=Ut.callback;if(typeof r=="function"){Ut.callback=null,rt=Ut.priorityLevel;var i=r(Ut.expirationTime<=e);e=ge.unstable_now(),typeof i=="function"?Ut.callback=i:Ut===sn(kn)&&Sc(kn),th(e)}else Sc(kn);Ut=sn(kn)}if(Ut!==null)var o=!0;else{var s=sn(Pr);s!==null&&oh(nh,s.startTime-e),o=!1}return o}finally{Ut=null,rt=n,bc=!1}}var kc=!1,xc=null,na=-1,O0=5,N0=-1;function L0(){return!(ge.unstable_now()-N0<O0)}function Qp(){if(xc!==null){var t=ge.unstable_now();N0=t;var e=!0;try{e=xc(!0,t)}finally{e?ea():(kc=!1,xc=null)}}else kc=!1}var ea;typeof T0=="function"?ea=function(){T0(Qp)}:typeof MessageChannel<"u"?(Jp=new MessageChannel,R0=Jp.port2,Jp.port1.onmessage=Qp,ea=function(){R0.postMessage(null)}):ea=function(){I0(Qp,0)};var Jp,R0;function ih(t){xc=t,kc||(kc=!0,ea())}function oh(t,e){na=I0(function(){t(ge.unstable_now())},e)}ge.unstable_IdlePriority=5;ge.unstable_ImmediatePriority=1;ge.unstable_LowPriority=4;ge.unstable_NormalPriority=3;ge.unstable_Profiling=null;ge.unstable_UserBlockingPriority=2;ge.unstable_cancelCallback=function(t){t.callback=null};ge.unstable_continueExecution=function(){yi||bc||(yi=!0,ih(rh))};ge.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O0=0<t?Math.floor(1e3/t):5};ge.unstable_getCurrentPriorityLevel=function(){return rt};ge.unstable_getFirstCallbackNode=function(){return sn(kn)};ge.unstable_next=function(t){switch(rt){case 1:case 2:case 3:var e=3;break;default:e=rt}var n=rt;rt=e;try{return t()}finally{rt=n}};ge.unstable_pauseExecution=function(){};ge.unstable_requestPaint=function(){};ge.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var n=rt;rt=t;try{return e()}finally{rt=n}};ge.unstable_scheduleCallback=function(t,e,n){var r=ge.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,t){case 1:var i=-1;break;case 2:i=250;break;case 5:i=1073741823;break;case 4:i=1e4;break;default:i=5e3}return i=n+i,t={id:uT++,callback:e,priorityLevel:t,startTime:n,expirationTime:i,sortIndex:-1},n>r?(t.sortIndex=n,eh(Pr,t),sn(kn)===null&&t===sn(Pr)&&(ta?(P0(na),na=-1):ta=!0,oh(nh,n-r))):(t.sortIndex=i,eh(kn,t),yi||bc||(yi=!0,ih(rh))),t};ge.unstable_shouldYield=L0;ge.unstable_wrapCallback=function(t){var e=rt;return function(){var n=rt;rt=e;try{return t.apply(this,arguments)}finally{rt=n}}}});var $0=Vn((uL,F0)=>{"use strict";F0.exports=M0()});var zS=Vn(Bt=>{"use strict";var dT=Nt(),$t=$0();function R(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Uw=new Set,ka={};function Pi(t,e){Wo(t,e),Wo(t+"Capture",e)}function Wo(t,e){for(ka[t]=e,t=0;t<e.length;t++)Uw.add(e[t])}var er=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Th=Object.prototype.hasOwnProperty,fT=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,D0={},B0={};function pT(t){return Th.call(B0,t)?!0:Th.call(D0,t)?!1:fT.test(t)?B0[t]=!0:(D0[t]=!0,!1)}function hT(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function gT(t,e,n,r){if(e===null||typeof e>"u"||hT(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function gt(t,e,n,r,i,o,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=o,this.removeEmptyString=s}var et={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){et[t]=new gt(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];et[e]=new gt(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){et[t]=new gt(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){et[t]=new gt(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){et[t]=new gt(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){et[t]=new gt(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){et[t]=new gt(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){et[t]=new gt(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){et[t]=new gt(t,5,!1,t.toLowerCase(),null,!1,!1)});var wg=/[\-:]([a-z])/g;function xg(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(wg,xg);et[e]=new gt(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(wg,xg);et[e]=new gt(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(wg,xg);et[e]=new gt(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){et[t]=new gt(t,1,!1,t.toLowerCase(),null,!1,!1)});et.xlinkHref=new gt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){et[t]=new gt(t,1,!1,t.toLowerCase(),null,!0,!0)});function Sg(t,e,n,r){var i=et.hasOwnProperty(e)?et[e]:null;(i!==null?i.type!==0:r||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(gT(e,n,i,r)&&(n=null),r||i===null?pT(e)&&(n===null?t.removeAttribute(e):t.setAttribute(e,""+n)):i.mustUseProperty?t[i.propertyName]=n===null?i.type===3?!1:"":n:(e=i.attributeName,r=i.attributeNamespace,n===null?t.removeAttribute(e):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?t.setAttributeNS(r,e,n):t.setAttribute(e,n))))}var ir=dT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ec=Symbol.for("react.element"),Ao=Symbol.for("react.portal"),To=Symbol.for("react.fragment"),bg=Symbol.for("react.strict_mode"),Rh=Symbol.for("react.profiler"),Ww=Symbol.for("react.provider"),qw=Symbol.for("react.context"),kg=Symbol.for("react.forward_ref"),Ih=Symbol.for("react.suspense"),Ph=Symbol.for("react.suspense_list"),Eg=Symbol.for("react.memo"),Nr=Symbol.for("react.lazy");Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var Kw=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden");Symbol.for("react.cache");Symbol.for("react.tracing_marker");var V0=Symbol.iterator;function ra(t){return t===null||typeof t!="object"?null:(t=V0&&t[V0]||t["@@iterator"],typeof t=="function"?t:null)}var Re=Object.assign,sh;function da(t){if(sh===void 0)try{throw Error()}catch(n){var e=n.stack.trim().match(/\n( *(at )?)/);sh=e&&e[1]||""}return`
|
|
2
2
|
`+sh+t}var ah=!1;function lh(t,e){if(!t||ah)return"";ah=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(c){var r=c}Reflect.construct(t,[],e)}else{try{e.call()}catch(c){r=c}t.call(e.prototype)}else{try{throw Error()}catch(c){r=c}t()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var i=c.stack.split(`
|
|
3
3
|
`),o=r.stack.split(`
|
|
4
4
|
`),s=i.length-1,a=o.length-1;1<=s&&0<=a&&i[s]!==o[a];)a--;for(;1<=s&&0<=a;s--,a--)if(i[s]!==o[a]){if(s!==1||a!==1)do if(s--,a--,0>a||i[s]!==o[a]){var l=`
|
|
5
|
-
`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{ah=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?fa(t):""}function vR(t){switch(t.tag){case 5:return fa(t.type);case 16:return fa("Lazy");case 13:return fa("Suspense");case 19:return fa("SuspenseList");case 0:case 2:case 15:return t=lh(t.type,!1),t;case 11:return t=lh(t.type.render,!1),t;case 1:return t=lh(t.type,!0),t;default:return""}}function Oh(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Po:return"Fragment";case To:return"Portal";case Th:return"Profiler";case bg:return"StrictMode";case Ph:return"Suspense";case Ih:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Ww:return(t.displayName||"Context")+".Consumer";case Uw:return(t._context.displayName||"Context")+".Provider";case kg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Eg:return e=t.displayName||null,e!==null?e:Oh(t.type)||"Memo";case Lr:e=t._payload,t=t._init;try{return Oh(t(e))}catch{}}return null}function yR(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Oh(e);case 8:return e===bg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Gr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Kw(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function _R(t){var e=Kw(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ec(t){t._valueTracker||(t._valueTracker=_R(t))}function Gw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Kw(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function Jc(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Nh(t,e){var n=e.checked;return Te({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function V0(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Gr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Zw(t,e){e=e.checked,e!=null&&Sg(t,"checked",e,!1)}function Lh(t,e){Zw(t,e);var n=Gr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Mh(t,e.type,n):e.hasOwnProperty("defaultValue")&&Mh(t,e.type,Gr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function z0(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Mh(t,e,n){(e!=="number"||Jc(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var pa=Array.isArray;function zo(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Gr(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function Fh(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(T(91));return Te({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function H0(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(T(92));if(pa(n)){if(1<n.length)throw Error(T(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Gr(n)}}function Yw(t,e){var n=Gr(e.value),r=Gr(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function j0(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Xw(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $h(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Xw(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Cc,Qw=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t})(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Cc=Cc||document.createElement("div"),Cc.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Cc.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ca(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ma={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},wR=["Webkit","ms","Moz","O"];Object.keys(ma).forEach(function(t){wR.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ma[e]=ma[t]})});function Jw(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ma.hasOwnProperty(t)&&ma[t]?(""+e).trim():e+"px"}function ex(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Jw(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var xR=Te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Dh(t,e){if(e){if(xR[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(T(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(T(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(T(61))}if(e.style!=null&&typeof e.style!="object")throw Error(T(62))}}function Bh(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Vh=null;function Cg(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var zh=null,Ho=null,jo=null;function U0(t){if(t=Ua(t)){if(typeof zh!="function")throw Error(T(280));var e=t.stateNode;e&&(e=Au(e),zh(t.stateNode,t.type,e))}}function tx(t){Ho?jo?jo.push(t):jo=[t]:Ho=t}function nx(){if(Ho){var t=Ho,e=jo;if(jo=Ho=null,U0(t),e)for(t=0;t<e.length;t++)U0(e[t])}}function rx(t,e){return t(e)}function ix(){}var ch=!1;function ox(t,e,n){if(ch)return t(e,n);ch=!0;try{return rx(t,e,n)}finally{ch=!1,(Ho!==null||jo!==null)&&(ix(),nx())}}function Aa(t,e){var n=t.stateNode;if(n===null)return null;var r=Au(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(T(231,e,typeof n));return n}var Hh=!1;if(tr)try{Ao={},Object.defineProperty(Ao,"passive",{get:function(){Hh=!0}}),window.addEventListener("test",Ao,Ao),window.removeEventListener("test",Ao,Ao)}catch{Hh=!1}var Ao;function SR(t,e,n,r,i,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(u){this.onError(u)}}var va=!1,eu=null,tu=!1,jh=null,bR={onError:function(t){va=!0,eu=t}};function kR(t,e,n,r,i,o,s,a,l){va=!1,eu=null,SR.apply(bR,arguments)}function ER(t,e,n,r,i,o,s,a,l){if(kR.apply(this,arguments),va){if(va){var c=eu;va=!1,eu=null}else throw Error(T(198));tu||(tu=!0,jh=c)}}function Li(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function sx(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function W0(t){if(Li(t)!==t)throw Error(T(188))}function CR(t){var e=t.alternate;if(!e){if(e=Li(t),e===null)throw Error(T(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return W0(i),t;if(o===r)return W0(i),e;o=o.sibling}throw Error(T(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s)throw Error(T(189))}}if(n.alternate!==r)throw Error(T(190))}if(n.tag!==3)throw Error(T(188));return n.stateNode.current===n?t:e}function ax(t){return t=CR(t),t!==null?lx(t):null}function lx(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=lx(t);if(e!==null)return e;t=t.sibling}return null}var cx=Ft.unstable_scheduleCallback,q0=Ft.unstable_cancelCallback,AR=Ft.unstable_shouldYield,RR=Ft.unstable_requestPaint,Fe=Ft.unstable_now,TR=Ft.unstable_getCurrentPriorityLevel,Ag=Ft.unstable_ImmediatePriority,ux=Ft.unstable_UserBlockingPriority,nu=Ft.unstable_NormalPriority,PR=Ft.unstable_LowPriority,dx=Ft.unstable_IdlePriority,bu=null,Tn=null;function IR(t){if(Tn&&typeof Tn.onCommitFiberRoot=="function")try{Tn.onCommitFiberRoot(bu,t,void 0,(t.current.flags&128)===128)}catch{}}var dn=Math.clz32?Math.clz32:LR,OR=Math.log,NR=Math.LN2;function LR(t){return t>>>=0,t===0?32:31-(OR(t)/NR|0)|0}var Ac=64,Rc=4194304;function ha(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function ru(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=ha(a):(o&=s,o!==0&&(r=ha(o)))}else s=n&~i,s!==0?r=ha(s):o!==0&&(r=ha(o));if(r===0)return 0;if(e!==0&&e!==r&&(e&i)===0&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if((r&4)!==0&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-dn(e),i=1<<n,r|=t[n],e&=~i;return r}function MR(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function FR(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var s=31-dn(o),a=1<<s,l=i[s];l===-1?((a&n)===0||(a&r)!==0)&&(i[s]=MR(a,e)):l<=e&&(t.expiredLanes|=a),o&=~a}}function Uh(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function fx(){var t=Ac;return Ac<<=1,(Ac&4194240)===0&&(Ac=64),t}function uh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function Ha(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-dn(e),t[e]=n}function $R(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-dn(n),o=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~o}}function Rg(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-dn(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var ue=0;function px(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var hx,Tg,gx,mx,vx,Wh=!1,Tc=[],Vr=null,zr=null,Hr=null,Ra=new Map,Ta=new Map,Fr=[],DR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function K0(t,e){switch(t){case"focusin":case"focusout":Vr=null;break;case"dragenter":case"dragleave":zr=null;break;case"mouseover":case"mouseout":Hr=null;break;case"pointerover":case"pointerout":Ra.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ta.delete(e.pointerId)}}function oa(t,e,n,r,i,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},e!==null&&(e=Ua(e),e!==null&&Tg(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function BR(t,e,n,r,i){switch(e){case"focusin":return Vr=oa(Vr,t,e,n,r,i),!0;case"dragenter":return zr=oa(zr,t,e,n,r,i),!0;case"mouseover":return Hr=oa(Hr,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return Ra.set(o,oa(Ra.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Ta.set(o,oa(Ta.get(o)||null,t,e,n,r,i)),!0}return!1}function yx(t){var e=bi(t.target);if(e!==null){var n=Li(e);if(n!==null){if(e=n.tag,e===13){if(e=sx(n),e!==null){t.blockedOn=e,vx(t.priority,function(){gx(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function jc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=qh(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Vh=r,n.target.dispatchEvent(r),Vh=null}else return e=Ua(n),e!==null&&Tg(e),t.blockedOn=n,!1;e.shift()}return!0}function G0(t,e,n){jc(t)&&n.delete(e)}function VR(){Wh=!1,Vr!==null&&jc(Vr)&&(Vr=null),zr!==null&&jc(zr)&&(zr=null),Hr!==null&&jc(Hr)&&(Hr=null),Ra.forEach(G0),Ta.forEach(G0)}function sa(t,e){t.blockedOn===e&&(t.blockedOn=null,Wh||(Wh=!0,Ft.unstable_scheduleCallback(Ft.unstable_NormalPriority,VR)))}function Pa(t){function e(i){return sa(i,t)}if(0<Tc.length){sa(Tc[0],t);for(var n=1;n<Tc.length;n++){var r=Tc[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Vr!==null&&sa(Vr,t),zr!==null&&sa(zr,t),Hr!==null&&sa(Hr,t),Ra.forEach(e),Ta.forEach(e),n=0;n<Fr.length;n++)r=Fr[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Fr.length&&(n=Fr[0],n.blockedOn===null);)yx(n),n.blockedOn===null&&Fr.shift()}var Uo=or.ReactCurrentBatchConfig,iu=!0;function zR(t,e,n,r){var i=ue,o=Uo.transition;Uo.transition=null;try{ue=1,Pg(t,e,n,r)}finally{ue=i,Uo.transition=o}}function HR(t,e,n,r){var i=ue,o=Uo.transition;Uo.transition=null;try{ue=4,Pg(t,e,n,r)}finally{ue=i,Uo.transition=o}}function Pg(t,e,n,r){if(iu){var i=qh(t,e,n,r);if(i===null)vh(t,e,r,ou,n),K0(t,r);else if(BR(i,t,e,n,r))r.stopPropagation();else if(K0(t,r),e&4&&-1<DR.indexOf(t)){for(;i!==null;){var o=Ua(i);if(o!==null&&hx(o),o=qh(t,e,n,r),o===null&&vh(t,e,r,ou,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else vh(t,e,r,null,n)}}var ou=null;function qh(t,e,n,r){if(ou=null,t=Cg(r),t=bi(t),t!==null)if(e=Li(t),e===null)t=null;else if(n=e.tag,n===13){if(t=sx(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return ou=t,null}function _x(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(TR()){case Ag:return 1;case ux:return 4;case nu:case PR:return 16;case dx:return 536870912;default:return 16}default:return 16}}var Dr=null,Ig=null,Uc=null;function wx(){if(Uc)return Uc;var t,e=Ig,n=e.length,r,i="value"in Dr?Dr.value:Dr.textContent,o=i.length;for(t=0;t<n&&e[t]===i[t];t++);var s=n-t;for(r=1;r<=s&&e[n-r]===i[o-r];r++);return Uc=i.slice(t,1<r?1-r:void 0)}function Wc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Pc(){return!0}function Z0(){return!1}function $t(t){function e(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Pc:Z0,this.isPropagationStopped=Z0,this}return Te(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Pc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Pc)},persist:function(){},isPersistent:Pc}),e}var es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Og=$t(es),ja=Te({},es,{view:0,detail:0}),jR=$t(ja),dh,fh,aa,ku=Te({},ja,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ng,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==aa&&(aa&&t.type==="mousemove"?(dh=t.screenX-aa.screenX,fh=t.screenY-aa.screenY):fh=dh=0,aa=t),dh)},movementY:function(t){return"movementY"in t?t.movementY:fh}}),Y0=$t(ku),UR=Te({},ku,{dataTransfer:0}),WR=$t(UR),qR=Te({},ja,{relatedTarget:0}),ph=$t(qR),KR=Te({},es,{animationName:0,elapsedTime:0,pseudoElement:0}),GR=$t(KR),ZR=Te({},es,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),YR=$t(ZR),XR=Te({},es,{data:0}),X0=$t(XR),QR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JR={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},eT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function tT(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=eT[t])?!!e[t]:!1}function Ng(){return tT}var nT=Te({},ja,{key:function(t){if(t.key){var e=QR[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Wc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?JR[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ng,charCode:function(t){return t.type==="keypress"?Wc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Wc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),rT=$t(nT),iT=Te({},ku,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Q0=$t(iT),oT=Te({},ja,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ng}),sT=$t(oT),aT=Te({},es,{propertyName:0,elapsedTime:0,pseudoElement:0}),lT=$t(aT),cT=Te({},ku,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),uT=$t(cT),dT=[9,13,27,32],Lg=tr&&"CompositionEvent"in window,ya=null;tr&&"documentMode"in document&&(ya=document.documentMode);var fT=tr&&"TextEvent"in window&&!ya,xx=tr&&(!Lg||ya&&8<ya&&11>=ya),J0=" ",ew=!1;function Sx(t,e){switch(t){case"keyup":return dT.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Io=!1;function pT(t,e){switch(t){case"compositionend":return bx(e);case"keypress":return e.which!==32?null:(ew=!0,J0);case"textInput":return t=e.data,t===J0&&ew?null:t;default:return null}}function hT(t,e){if(Io)return t==="compositionend"||!Lg&&Sx(t,e)?(t=wx(),Uc=Ig=Dr=null,Io=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return xx&&e.locale!=="ko"?null:e.data;default:return null}}var gT={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tw(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!gT[t.type]:e==="textarea"}function kx(t,e,n,r){tx(r),e=su(e,"onChange"),0<e.length&&(n=new Og("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var _a=null,Ia=null;function mT(t){Mx(t,0)}function Eu(t){var e=Lo(t);if(Gw(e))return t}function vT(t,e){if(t==="change")return e}var Ex=!1;tr&&(tr?(Oc="oninput"in document,Oc||(hh=document.createElement("div"),hh.setAttribute("oninput","return;"),Oc=typeof hh.oninput=="function"),Ic=Oc):Ic=!1,Ex=Ic&&(!document.documentMode||9<document.documentMode));var Ic,Oc,hh;function nw(){_a&&(_a.detachEvent("onpropertychange",Cx),Ia=_a=null)}function Cx(t){if(t.propertyName==="value"&&Eu(Ia)){var e=[];kx(e,Ia,t,Cg(t)),ox(mT,e)}}function yT(t,e,n){t==="focusin"?(nw(),_a=e,Ia=n,_a.attachEvent("onpropertychange",Cx)):t==="focusout"&&nw()}function _T(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Eu(Ia)}function wT(t,e){if(t==="click")return Eu(e)}function xT(t,e){if(t==="input"||t==="change")return Eu(e)}function ST(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var pn=typeof Object.is=="function"?Object.is:ST;function Oa(t,e){if(pn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Rh.call(e,i)||!pn(t[i],e[i]))return!1}return!0}function rw(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function iw(t,e){var n=rw(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=rw(n)}}function Ax(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ax(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Rx(){for(var t=window,e=Jc();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=Jc(t.document)}return e}function Mg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function bT(t){var e=Rx(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Ax(n.ownerDocument.documentElement,n)){if(r!==null&&Mg(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=iw(n,o);var s=iw(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var kT=tr&&"documentMode"in document&&11>=document.documentMode,Oo=null,Kh=null,wa=null,Gh=!1;function ow(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gh||Oo==null||Oo!==Jc(r)||(r=Oo,"selectionStart"in r&&Mg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),wa&&Oa(wa,r)||(wa=r,r=su(Kh,"onSelect"),0<r.length&&(e=new Og("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Oo)))}function Nc(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var No={animationend:Nc("Animation","AnimationEnd"),animationiteration:Nc("Animation","AnimationIteration"),animationstart:Nc("Animation","AnimationStart"),transitionend:Nc("Transition","TransitionEnd")},gh={},Tx={};tr&&(Tx=document.createElement("div").style,"AnimationEvent"in window||(delete No.animationend.animation,delete No.animationiteration.animation,delete No.animationstart.animation),"TransitionEvent"in window||delete No.transitionend.transition);function Cu(t){if(gh[t])return gh[t];if(!No[t])return t;var e=No[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Tx)return gh[t]=e[n];return t}var Px=Cu("animationend"),Ix=Cu("animationiteration"),Ox=Cu("animationstart"),Nx=Cu("transitionend"),Lx=new Map,sw="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Yr(t,e){Lx.set(t,e),Ni(e,[t])}for(Lc=0;Lc<sw.length;Lc++)Mc=sw[Lc],aw=Mc.toLowerCase(),lw=Mc[0].toUpperCase()+Mc.slice(1),Yr(aw,"on"+lw);var Mc,aw,lw,Lc;Yr(Px,"onAnimationEnd");Yr(Ix,"onAnimationIteration");Yr(Ox,"onAnimationStart");Yr("dblclick","onDoubleClick");Yr("focusin","onFocus");Yr("focusout","onBlur");Yr(Nx,"onTransitionEnd");Ko("onMouseEnter",["mouseout","mouseover"]);Ko("onMouseLeave",["mouseout","mouseover"]);Ko("onPointerEnter",["pointerout","pointerover"]);Ko("onPointerLeave",["pointerout","pointerover"]);Ni("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ni("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ni("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ni("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ni("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ni("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ga="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ET=new Set("cancel close invalid load scroll toggle".split(" ").concat(ga));function cw(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,ER(r,e,void 0,t),t.currentTarget=null}function Mx(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;cw(i,a,c),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;cw(i,a,c),o=l}}}if(tu)throw t=jh,tu=!1,jh=null,t}function _e(t,e){var n=e[Jh];n===void 0&&(n=e[Jh]=new Set);var r=t+"__bubble";n.has(r)||(Fx(e,t,2,!1),n.add(r))}function mh(t,e,n){var r=0;e&&(r|=4),Fx(n,t,r,e)}var Fc="_reactListening"+Math.random().toString(36).slice(2);function Na(t){if(!t[Fc]){t[Fc]=!0,jw.forEach(function(n){n!=="selectionchange"&&(ET.has(n)||mh(n,!1,t),mh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Fc]||(e[Fc]=!0,mh("selectionchange",!1,e))}}function Fx(t,e,n,r){switch(_x(e)){case 1:var i=zR;break;case 4:i=HR;break;default:i=Pg}n=i.bind(null,e,n,t),i=void 0,!Hh||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function vh(t,e,n,r,i){var o=r;if((e&1)===0&&(e&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;s=s.return}for(;a!==null;){if(s=bi(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}ox(function(){var c=o,u=Cg(n),f=[];e:{var h=Lx.get(t);if(h!==void 0){var g=Og,v=t;switch(t){case"keypress":if(Wc(n)===0)break e;case"keydown":case"keyup":g=rT;break;case"focusin":v="focus",g=ph;break;case"focusout":v="blur",g=ph;break;case"beforeblur":case"afterblur":g=ph;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=Y0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=WR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=sT;break;case Px:case Ix:case Ox:g=GR;break;case Nx:g=lT;break;case"scroll":g=jR;break;case"wheel":g=uT;break;case"copy":case"cut":case"paste":g=YR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Q0}var _=(e&4)!==0,x=!_&&t==="scroll",d=_?h!==null?h+"Capture":null:h;_=[];for(var p=c,m;p!==null;){m=p;var y=m.stateNode;if(m.tag===5&&y!==null&&(m=y,d!==null&&(y=Aa(p,d),y!=null&&_.push(La(p,y,m)))),x)break;p=p.return}0<_.length&&(h=new g(h,v,null,n,u),f.push({event:h,listeners:_}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",g=t==="mouseout"||t==="pointerout",h&&n!==Vh&&(v=n.relatedTarget||n.fromElement)&&(bi(v)||v[nr]))break e;if((g||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,g?(v=n.relatedTarget||n.toElement,g=c,v=v?bi(v):null,v!==null&&(x=Li(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(g=null,v=c),g!==v)){if(_=Y0,y="onMouseLeave",d="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(_=Q0,y="onPointerLeave",d="onPointerEnter",p="pointer"),x=g==null?h:Lo(g),m=v==null?h:Lo(v),h=new _(y,p+"leave",g,n,u),h.target=x,h.relatedTarget=m,y=null,bi(u)===c&&(_=new _(d,p+"enter",v,n,u),_.target=m,_.relatedTarget=x,y=_),x=y,g&&v)t:{for(_=g,d=v,p=0,m=_;m;m=Ro(m))p++;for(m=0,y=d;y;y=Ro(y))m++;for(;0<p-m;)_=Ro(_),p--;for(;0<m-p;)d=Ro(d),m--;for(;p--;){if(_===d||d!==null&&_===d.alternate)break t;_=Ro(_),d=Ro(d)}_=null}else _=null;g!==null&&uw(f,h,g,_,!1),v!==null&&x!==null&&uw(f,x,v,_,!0)}}e:{if(h=c?Lo(c):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var w=vT;else if(tw(h))if(Ex)w=xT;else{w=_T;var k=yT}else(g=h.nodeName)&&g.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(w=wT);if(w&&(w=w(t,c))){kx(f,w,n,u);break e}k&&k(t,h,c),t==="focusout"&&(k=h._wrapperState)&&k.controlled&&h.type==="number"&&Mh(h,"number",h.value)}switch(k=c?Lo(c):window,t){case"focusin":(tw(k)||k.contentEditable==="true")&&(Oo=k,Kh=c,wa=null);break;case"focusout":wa=Kh=Oo=null;break;case"mousedown":Gh=!0;break;case"contextmenu":case"mouseup":case"dragend":Gh=!1,ow(f,n,u);break;case"selectionchange":if(kT)break;case"keydown":case"keyup":ow(f,n,u)}var b;if(Lg)e:{switch(t){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Io?Sx(t,n)&&(E="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(xx&&n.locale!=="ko"&&(Io||E!=="onCompositionStart"?E==="onCompositionEnd"&&Io&&(b=wx()):(Dr=u,Ig="value"in Dr?Dr.value:Dr.textContent,Io=!0)),k=su(c,E),0<k.length&&(E=new X0(E,t,null,n,u),f.push({event:E,listeners:k}),b?E.data=b:(b=bx(n),b!==null&&(E.data=b)))),(b=fT?pT(t,n):hT(t,n))&&(c=su(c,"onBeforeInput"),0<c.length&&(u=new X0("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=b))}Mx(f,e)})}function La(t,e,n){return{instance:t,listener:e,currentTarget:n}}function su(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Aa(t,n),o!=null&&r.unshift(La(t,o,i)),o=Aa(t,e),o!=null&&r.push(La(t,o,i))),t=t.return}return r}function Ro(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function uw(t,e,n,r,i){for(var o=e._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=Aa(n,o),l!=null&&s.unshift(La(n,l,a))):i||(l=Aa(n,o),l!=null&&s.push(La(n,l,a)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var CT=/\r\n?/g,AT=/\u0000|\uFFFD/g;function dw(t){return(typeof t=="string"?t:""+t).replace(CT,`
|
|
6
|
-
`).replace(AT,"")}function $c(t,e,n){if(e=dw(e),dw(t)!==e&&n)throw Error(T(425))}function au(){}var Zh=null,Yh=null;function Xh(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Qh=typeof setTimeout=="function"?setTimeout:void 0,RT=typeof clearTimeout=="function"?clearTimeout:void 0,fw=typeof Promise=="function"?Promise:void 0,TT=typeof queueMicrotask=="function"?queueMicrotask:typeof fw<"u"?function(t){return fw.resolve(null).then(t).catch(PT)}:Qh;function PT(t){setTimeout(function(){throw t})}function yh(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Pa(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Pa(e)}function jr(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function pw(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var ts=Math.random().toString(36).slice(2),Rn="__reactFiber$"+ts,Ma="__reactProps$"+ts,nr="__reactContainer$"+ts,Jh="__reactEvents$"+ts,IT="__reactListeners$"+ts,OT="__reactHandles$"+ts;function bi(t){var e=t[Rn];if(e)return e;for(var n=t.parentNode;n;){if(e=n[nr]||n[Rn]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=pw(t);t!==null;){if(n=t[Rn])return n;t=pw(t)}return e}t=n,n=t.parentNode}return null}function Ua(t){return t=t[Rn]||t[nr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Lo(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(T(33))}function Au(t){return t[Ma]||null}var eg=[],Mo=-1;function Xr(t){return{current:t}}function we(t){0>Mo||(t.current=eg[Mo],eg[Mo]=null,Mo--)}function me(t,e){Mo++,eg[Mo]=t.current,t.current=e}var Zr={},at=Xr(Zr),Et=Xr(!1),Ri=Zr;function Go(t,e){var n=t.type.contextTypes;if(!n)return Zr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ct(t){return t=t.childContextTypes,t!=null}function lu(){we(Et),we(at)}function hw(t,e,n){if(at.current!==Zr)throw Error(T(168));me(at,e),me(Et,n)}function $x(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(T(108,yR(t)||"Unknown",i));return Te({},n,r)}function cu(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Zr,Ri=at.current,me(at,t),me(Et,Et.current),!0}function gw(t,e,n){var r=t.stateNode;if(!r)throw Error(T(169));n?(t=$x(t,e,Ri),r.__reactInternalMemoizedMergedChildContext=t,we(Et),we(at),me(at,t)):we(Et),me(Et,n)}var Xn=null,Ru=!1,_h=!1;function Dx(t){Xn===null?Xn=[t]:Xn.push(t)}function NT(t){Ru=!0,Dx(t)}function Qr(){if(!_h&&Xn!==null){_h=!0;var t=0,e=ue;try{var n=Xn;for(ue=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Xn=null,Ru=!1}catch(i){throw Xn!==null&&(Xn=Xn.slice(t+1)),cx(Ag,Qr),i}finally{ue=e,_h=!1}}return null}var Fo=[],$o=0,uu=null,du=0,Wt=[],qt=0,Ti=null,Qn=1,Jn="";function xi(t,e){Fo[$o++]=du,Fo[$o++]=uu,uu=t,du=e}function Bx(t,e,n){Wt[qt++]=Qn,Wt[qt++]=Jn,Wt[qt++]=Ti,Ti=t;var r=Qn;t=Jn;var i=32-dn(r)-1;r&=~(1<<i),n+=1;var o=32-dn(e)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Qn=1<<32-dn(e)+i|n<<i|r,Jn=o+t}else Qn=1<<o|n<<i|r,Jn=t}function Fg(t){t.return!==null&&(xi(t,1),Bx(t,1,0))}function $g(t){for(;t===uu;)uu=Fo[--$o],Fo[$o]=null,du=Fo[--$o],Fo[$o]=null;for(;t===Ti;)Ti=Wt[--qt],Wt[qt]=null,Jn=Wt[--qt],Wt[qt]=null,Qn=Wt[--qt],Wt[qt]=null}var Mt=null,Lt=null,ke=!1,un=null;function Vx(t,e){var n=Kt(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function mw(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Mt=t,Lt=jr(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Mt=t,Lt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ti!==null?{id:Qn,overflow:Jn}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Kt(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Mt=t,Lt=null,!0):!1;default:return!1}}function tg(t){return(t.mode&1)!==0&&(t.flags&128)===0}function ng(t){if(ke){var e=Lt;if(e){var n=e;if(!mw(t,e)){if(tg(t))throw Error(T(418));e=jr(n.nextSibling);var r=Mt;e&&mw(t,e)?Vx(r,n):(t.flags=t.flags&-4097|2,ke=!1,Mt=t)}}else{if(tg(t))throw Error(T(418));t.flags=t.flags&-4097|2,ke=!1,Mt=t}}}function vw(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Mt=t}function Dc(t){if(t!==Mt)return!1;if(!ke)return vw(t),ke=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Xh(t.type,t.memoizedProps)),e&&(e=Lt)){if(tg(t))throw zx(),Error(T(418));for(;e;)Vx(t,e),e=jr(e.nextSibling)}if(vw(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(T(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Lt=jr(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Lt=null}}else Lt=Mt?jr(t.stateNode.nextSibling):null;return!0}function zx(){for(var t=Lt;t;)t=jr(t.nextSibling)}function Zo(){Lt=Mt=null,ke=!1}function Dg(t){un===null?un=[t]:un.push(t)}var LT=or.ReactCurrentBatchConfig;function la(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(T(309));var r=n.stateNode}if(!r)throw Error(T(147,t));var i=r,o=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(s){var a=i.refs;s===null?delete a[o]:a[o]=s},e._stringRef=o,e)}if(typeof t!="string")throw Error(T(284));if(!n._owner)throw Error(T(290,t))}return t}function Bc(t,e){throw t=Object.prototype.toString.call(e),Error(T(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function yw(t){var e=t._init;return e(t._payload)}function Hx(t){function e(d,p){if(t){var m=d.deletions;m===null?(d.deletions=[p],d.flags|=16):m.push(p)}}function n(d,p){if(!t)return null;for(;p!==null;)e(d,p),p=p.sibling;return null}function r(d,p){for(d=new Map;p!==null;)p.key!==null?d.set(p.key,p):d.set(p.index,p),p=p.sibling;return d}function i(d,p){return d=Kr(d,p),d.index=0,d.sibling=null,d}function o(d,p,m){return d.index=m,t?(m=d.alternate,m!==null?(m=m.index,m<p?(d.flags|=2,p):m):(d.flags|=2,p)):(d.flags|=1048576,p)}function s(d){return t&&d.alternate===null&&(d.flags|=2),d}function a(d,p,m,y){return p===null||p.tag!==6?(p=Ch(m,d.mode,y),p.return=d,p):(p=i(p,m),p.return=d,p)}function l(d,p,m,y){var w=m.type;return w===Po?u(d,p,m.props.children,y,m.key):p!==null&&(p.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Lr&&yw(w)===p.type)?(y=i(p,m.props),y.ref=la(d,p,m),y.return=d,y):(y=Qc(m.type,m.key,m.props,null,d.mode,y),y.ref=la(d,p,m),y.return=d,y)}function c(d,p,m,y){return p===null||p.tag!==4||p.stateNode.containerInfo!==m.containerInfo||p.stateNode.implementation!==m.implementation?(p=Ah(m,d.mode,y),p.return=d,p):(p=i(p,m.children||[]),p.return=d,p)}function u(d,p,m,y,w){return p===null||p.tag!==7?(p=Ai(m,d.mode,y,w),p.return=d,p):(p=i(p,m),p.return=d,p)}function f(d,p,m){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Ch(""+p,d.mode,m),p.return=d,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case kc:return m=Qc(p.type,p.key,p.props,null,d.mode,m),m.ref=la(d,null,p),m.return=d,m;case To:return p=Ah(p,d.mode,m),p.return=d,p;case Lr:var y=p._init;return f(d,y(p._payload),m)}if(pa(p)||ia(p))return p=Ai(p,d.mode,m,null),p.return=d,p;Bc(d,p)}return null}function h(d,p,m,y){var w=p!==null?p.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return w!==null?null:a(d,p,""+m,y);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case kc:return m.key===w?l(d,p,m,y):null;case To:return m.key===w?c(d,p,m,y):null;case Lr:return w=m._init,h(d,p,w(m._payload),y)}if(pa(m)||ia(m))return w!==null?null:u(d,p,m,y,null);Bc(d,m)}return null}function g(d,p,m,y,w){if(typeof y=="string"&&y!==""||typeof y=="number")return d=d.get(m)||null,a(p,d,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case kc:return d=d.get(y.key===null?m:y.key)||null,l(p,d,y,w);case To:return d=d.get(y.key===null?m:y.key)||null,c(p,d,y,w);case Lr:var k=y._init;return g(d,p,m,k(y._payload),w)}if(pa(y)||ia(y))return d=d.get(m)||null,u(p,d,y,w,null);Bc(p,y)}return null}function v(d,p,m,y){for(var w=null,k=null,b=p,E=p=0,P=null;b!==null&&E<m.length;E++){b.index>E?(P=b,b=null):P=b.sibling;var A=h(d,b,m[E],y);if(A===null){b===null&&(b=P);break}t&&b&&A.alternate===null&&e(d,b),p=o(A,p,E),k===null?w=A:k.sibling=A,k=A,b=P}if(E===m.length)return n(d,b),ke&&xi(d,E),w;if(b===null){for(;E<m.length;E++)b=f(d,m[E],y),b!==null&&(p=o(b,p,E),k===null?w=b:k.sibling=b,k=b);return ke&&xi(d,E),w}for(b=r(d,b);E<m.length;E++)P=g(b,d,E,m[E],y),P!==null&&(t&&P.alternate!==null&&b.delete(P.key===null?E:P.key),p=o(P,p,E),k===null?w=P:k.sibling=P,k=P);return t&&b.forEach(function(H){return e(d,H)}),ke&&xi(d,E),w}function _(d,p,m,y){var w=ia(m);if(typeof w!="function")throw Error(T(150));if(m=w.call(m),m==null)throw Error(T(151));for(var k=w=null,b=p,E=p=0,P=null,A=m.next();b!==null&&!A.done;E++,A=m.next()){b.index>E?(P=b,b=null):P=b.sibling;var H=h(d,b,A.value,y);if(H===null){b===null&&(b=P);break}t&&b&&H.alternate===null&&e(d,b),p=o(H,p,E),k===null?w=H:k.sibling=H,k=H,b=P}if(A.done)return n(d,b),ke&&xi(d,E),w;if(b===null){for(;!A.done;E++,A=m.next())A=f(d,A.value,y),A!==null&&(p=o(A,p,E),k===null?w=A:k.sibling=A,k=A);return ke&&xi(d,E),w}for(b=r(d,b);!A.done;E++,A=m.next())A=g(b,d,E,A.value,y),A!==null&&(t&&A.alternate!==null&&b.delete(A.key===null?E:A.key),p=o(A,p,E),k===null?w=A:k.sibling=A,k=A);return t&&b.forEach(function(K){return e(d,K)}),ke&&xi(d,E),w}function x(d,p,m,y){if(typeof m=="object"&&m!==null&&m.type===Po&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case kc:e:{for(var w=m.key,k=p;k!==null;){if(k.key===w){if(w=m.type,w===Po){if(k.tag===7){n(d,k.sibling),p=i(k,m.props.children),p.return=d,d=p;break e}}else if(k.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Lr&&yw(w)===k.type){n(d,k.sibling),p=i(k,m.props),p.ref=la(d,k,m),p.return=d,d=p;break e}n(d,k);break}else e(d,k);k=k.sibling}m.type===Po?(p=Ai(m.props.children,d.mode,y,m.key),p.return=d,d=p):(y=Qc(m.type,m.key,m.props,null,d.mode,y),y.ref=la(d,p,m),y.return=d,d=y)}return s(d);case To:e:{for(k=m.key;p!==null;){if(p.key===k)if(p.tag===4&&p.stateNode.containerInfo===m.containerInfo&&p.stateNode.implementation===m.implementation){n(d,p.sibling),p=i(p,m.children||[]),p.return=d,d=p;break e}else{n(d,p);break}else e(d,p);p=p.sibling}p=Ah(m,d.mode,y),p.return=d,d=p}return s(d);case Lr:return k=m._init,x(d,p,k(m._payload),y)}if(pa(m))return v(d,p,m,y);if(ia(m))return _(d,p,m,y);Bc(d,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,p!==null&&p.tag===6?(n(d,p.sibling),p=i(p,m),p.return=d,d=p):(n(d,p),p=Ch(m,d.mode,y),p.return=d,d=p),s(d)):n(d,p)}return x}var Yo=Hx(!0),jx=Hx(!1),fu=Xr(null),pu=null,Do=null,Bg=null;function Vg(){Bg=Do=pu=null}function zg(t){var e=fu.current;we(fu),t._currentValue=e}function rg(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function Wo(t,e){pu=t,Bg=Do=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&e)!==0&&(kt=!0),t.firstContext=null)}function Zt(t){var e=t._currentValue;if(Bg!==t)if(t={context:t,memoizedValue:e,next:null},Do===null){if(pu===null)throw Error(T(308));Do=t,pu.dependencies={lanes:0,firstContext:t}}else Do=Do.next=t;return e}var ki=null;function Hg(t){ki===null?ki=[t]:ki.push(t)}function Ux(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Hg(e)):(n.next=i.next,i.next=n),e.interleaved=n,rr(t,r)}function rr(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Mr=!1;function jg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wx(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function er(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Ur(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(se&2)!==0){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,rr(t,n)}return i=r.interleaved,i===null?(e.next=e,Hg(r)):(e.next=i.next,i.next=e),r.interleaved=e,rr(t,n)}function qc(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Rg(t,n)}}function _w(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function hu(t,e,n,r){var i=t.updateQueue;Mr=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,u=c=l=null,a=o;do{var h=a.lane,g=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=t,_=a;switch(h=e,g=n,_.tag){case 1:if(v=_.payload,typeof v=="function"){f=v.call(g,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=_.payload,h=typeof v=="function"?v.call(g,f,h):v,h==null)break e;f=Te({},f,h);break e;case 2:Mr=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=g,l=f):u=u.next=g,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Ii|=s,t.lanes=s,t.memoizedState=f}}function ww(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(T(191,i));i.call(r)}}}var Wa={},Pn=Xr(Wa),Fa=Xr(Wa),$a=Xr(Wa);function Ei(t){if(t===Wa)throw Error(T(174));return t}function Ug(t,e){switch(me($a,e),me(Fa,t),me(Pn,Wa),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:$h(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=$h(e,t)}we(Pn),me(Pn,e)}function Xo(){we(Pn),we(Fa),we($a)}function qx(t){Ei($a.current);var e=Ei(Pn.current),n=$h(e,t.type);e!==n&&(me(Fa,t),me(Pn,n))}function Wg(t){Fa.current===t&&(we(Pn),we(Fa))}var Ae=Xr(0);function gu(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var wh=[];function qg(){for(var t=0;t<wh.length;t++)wh[t]._workInProgressVersionPrimary=null;wh.length=0}var Kc=or.ReactCurrentDispatcher,xh=or.ReactCurrentBatchConfig,Pi=0,Re=null,je=null,qe=null,mu=!1,xa=!1,Da=0,MT=0;function it(){throw Error(T(321))}function Kg(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!pn(t[n],e[n]))return!1;return!0}function Gg(t,e,n,r,i,o){if(Pi=o,Re=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Kc.current=t===null||t.memoizedState===null?BT:VT,t=n(r,i),xa){o=0;do{if(xa=!1,Da=0,25<=o)throw Error(T(301));o+=1,qe=je=null,e.updateQueue=null,Kc.current=zT,t=n(r,i)}while(xa)}if(Kc.current=vu,e=je!==null&&je.next!==null,Pi=0,qe=je=Re=null,mu=!1,e)throw Error(T(300));return t}function Zg(){var t=Da!==0;return Da=0,t}function An(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qe===null?Re.memoizedState=qe=t:qe=qe.next=t,qe}function Yt(){if(je===null){var t=Re.alternate;t=t!==null?t.memoizedState:null}else t=je.next;var e=qe===null?Re.memoizedState:qe.next;if(e!==null)qe=e,je=t;else{if(t===null)throw Error(T(310));je=t,t={memoizedState:je.memoizedState,baseState:je.baseState,baseQueue:je.baseQueue,queue:je.queue,next:null},qe===null?Re.memoizedState=qe=t:qe=qe.next=t}return qe}function Ba(t,e){return typeof e=="function"?e(t):e}function Sh(t){var e=Yt(),n=e.queue;if(n===null)throw Error(T(311));n.lastRenderedReducer=t;var r=je,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,l=null,c=o;do{var u=c.lane;if((Pi&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,Re.lanes|=u,Ii|=u}c=c.next}while(c!==null&&c!==o);l===null?s=r:l.next=a,pn(r,e.memoizedState)||(kt=!0),e.memoizedState=r,e.baseState=s,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do o=i.lane,Re.lanes|=o,Ii|=o,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function bh(t){var e=Yt(),n=e.queue;if(n===null)throw Error(T(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=t(o,s.action),s=s.next;while(s!==i);pn(o,e.memoizedState)||(kt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function Kx(){}function Gx(t,e){var n=Re,r=Yt(),i=e(),o=!pn(r.memoizedState,i);if(o&&(r.memoizedState=i,kt=!0),r=r.queue,Yg(Xx.bind(null,n,r,t),[t]),r.getSnapshot!==e||o||qe!==null&&qe.memoizedState.tag&1){if(n.flags|=2048,Va(9,Yx.bind(null,n,r,i,e),void 0,null),Ke===null)throw Error(T(349));(Pi&30)!==0||Zx(n,e,i)}return i}function Zx(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Re.updateQueue,e===null?(e={lastEffect:null,stores:null},Re.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function Yx(t,e,n,r){e.value=n,e.getSnapshot=r,Qx(e)&&Jx(t)}function Xx(t,e,n){return n(function(){Qx(e)&&Jx(t)})}function Qx(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!pn(t,n)}catch{return!0}}function Jx(t){var e=rr(t,1);e!==null&&fn(e,t,1,-1)}function xw(t){var e=An();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:t},e.queue=t,t=t.dispatch=DT.bind(null,Re,t),[e.memoizedState,t]}function Va(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Re.updateQueue,e===null?(e={lastEffect:null,stores:null},Re.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function eS(){return Yt().memoizedState}function Gc(t,e,n,r){var i=An();Re.flags|=t,i.memoizedState=Va(1|e,n,void 0,r===void 0?null:r)}function Tu(t,e,n,r){var i=Yt();r=r===void 0?null:r;var o=void 0;if(je!==null){var s=je.memoizedState;if(o=s.destroy,r!==null&&Kg(r,s.deps)){i.memoizedState=Va(e,n,o,r);return}}Re.flags|=t,i.memoizedState=Va(1|e,n,o,r)}function Sw(t,e){return Gc(8390656,8,t,e)}function Yg(t,e){return Tu(2048,8,t,e)}function tS(t,e){return Tu(4,2,t,e)}function nS(t,e){return Tu(4,4,t,e)}function rS(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function iS(t,e,n){return n=n!=null?n.concat([t]):null,Tu(4,4,rS.bind(null,e,t),n)}function Xg(){}function oS(t,e){var n=Yt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Kg(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function sS(t,e){var n=Yt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Kg(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function aS(t,e,n){return(Pi&21)===0?(t.baseState&&(t.baseState=!1,kt=!0),t.memoizedState=n):(pn(n,e)||(n=fx(),Re.lanes|=n,Ii|=n,t.baseState=!0),e)}function FT(t,e){var n=ue;ue=n!==0&&4>n?n:4,t(!0);var r=xh.transition;xh.transition={};try{t(!1),e()}finally{ue=n,xh.transition=r}}function lS(){return Yt().memoizedState}function $T(t,e,n){var r=qr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},cS(t))uS(e,n);else if(n=Ux(t,e,n,r),n!==null){var i=ht();fn(n,t,r,i),dS(n,e,r)}}function DT(t,e,n){var r=qr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(cS(t))uS(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,pn(a,s)){var l=e.interleaved;l===null?(i.next=i,Hg(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=Ux(t,e,i,r),n!==null&&(i=ht(),fn(n,t,r,i),dS(n,e,r))}}function cS(t){var e=t.alternate;return t===Re||e!==null&&e===Re}function uS(t,e){xa=mu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function dS(t,e,n){if((n&4194240)!==0){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Rg(t,n)}}var vu={readContext:Zt,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},BT={readContext:Zt,useCallback:function(t,e){return An().memoizedState=[t,e===void 0?null:e],t},useContext:Zt,useEffect:Sw,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Gc(4194308,4,rS.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Gc(4194308,4,t,e)},useInsertionEffect:function(t,e){return Gc(4,2,t,e)},useMemo:function(t,e){var n=An();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=An();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=$T.bind(null,Re,t),[r.memoizedState,t]},useRef:function(t){var e=An();return t={current:t},e.memoizedState=t},useState:xw,useDebugValue:Xg,useDeferredValue:function(t){return An().memoizedState=t},useTransition:function(){var t=xw(!1),e=t[0];return t=FT.bind(null,t[1]),An().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Re,i=An();if(ke){if(n===void 0)throw Error(T(407));n=n()}else{if(n=e(),Ke===null)throw Error(T(349));(Pi&30)!==0||Zx(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,Sw(Xx.bind(null,r,o,t),[t]),r.flags|=2048,Va(9,Yx.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=An(),e=Ke.identifierPrefix;if(ke){var n=Jn,r=Qn;n=(r&~(1<<32-dn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Da++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=MT++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},VT={readContext:Zt,useCallback:oS,useContext:Zt,useEffect:Yg,useImperativeHandle:iS,useInsertionEffect:tS,useLayoutEffect:nS,useMemo:sS,useReducer:Sh,useRef:eS,useState:function(){return Sh(Ba)},useDebugValue:Xg,useDeferredValue:function(t){var e=Yt();return aS(e,je.memoizedState,t)},useTransition:function(){var t=Sh(Ba)[0],e=Yt().memoizedState;return[t,e]},useMutableSource:Kx,useSyncExternalStore:Gx,useId:lS,unstable_isNewReconciler:!1},zT={readContext:Zt,useCallback:oS,useContext:Zt,useEffect:Yg,useImperativeHandle:iS,useInsertionEffect:tS,useLayoutEffect:nS,useMemo:sS,useReducer:bh,useRef:eS,useState:function(){return bh(Ba)},useDebugValue:Xg,useDeferredValue:function(t){var e=Yt();return je===null?e.memoizedState=t:aS(e,je.memoizedState,t)},useTransition:function(){var t=bh(Ba)[0],e=Yt().memoizedState;return[t,e]},useMutableSource:Kx,useSyncExternalStore:Gx,useId:lS,unstable_isNewReconciler:!1};function ln(t,e){if(t&&t.defaultProps){e=Te({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function ig(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Te({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Pu={isMounted:function(t){return(t=t._reactInternals)?Li(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=ht(),i=qr(t),o=er(r,i);o.payload=e,n!=null&&(o.callback=n),e=Ur(t,o,i),e!==null&&(fn(e,t,i,r),qc(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=ht(),i=qr(t),o=er(r,i);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=Ur(t,o,i),e!==null&&(fn(e,t,i,r),qc(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=ht(),r=qr(t),i=er(n,r);i.tag=2,e!=null&&(i.callback=e),e=Ur(t,i,r),e!==null&&(fn(e,t,r,n),qc(e,t,r))}};function bw(t,e,n,r,i,o,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,s):e.prototype&&e.prototype.isPureReactComponent?!Oa(n,r)||!Oa(i,o):!0}function fS(t,e,n){var r=!1,i=Zr,o=e.contextType;return typeof o=="object"&&o!==null?o=Zt(o):(i=Ct(e)?Ri:at.current,r=e.contextTypes,o=(r=r!=null)?Go(t,i):Zr),e=new e(n,o),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Pu,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function kw(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Pu.enqueueReplaceState(e,e.state,null)}function og(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},jg(t);var o=e.contextType;typeof o=="object"&&o!==null?i.context=Zt(o):(o=Ct(e)?Ri:at.current,i.context=Go(t,o)),i.state=t.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(ig(t,e,o,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Pu.enqueueReplaceState(i,i.state,null),hu(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Qo(t,e){try{var n="",r=e;do n+=vR(r),r=r.return;while(r);var i=n}catch(o){i=`
|
|
5
|
+
`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=s&&0<=a);break}}}finally{ah=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?da(t):""}function mT(t){switch(t.tag){case 5:return da(t.type);case 16:return da("Lazy");case 13:return da("Suspense");case 19:return da("SuspenseList");case 0:case 2:case 15:return t=lh(t.type,!1),t;case 11:return t=lh(t.type.render,!1),t;case 1:return t=lh(t.type,!0),t;default:return""}}function Oh(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case To:return"Fragment";case Ao:return"Portal";case Rh:return"Profiler";case bg:return"StrictMode";case Ih:return"Suspense";case Ph:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case qw:return(t.displayName||"Context")+".Consumer";case Ww:return(t._context.displayName||"Context")+".Provider";case kg:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Eg:return e=t.displayName||null,e!==null?e:Oh(t.type)||"Memo";case Nr:e=t._payload,t=t._init;try{return Oh(t(e))}catch{}}return null}function vT(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Oh(e);case 8:return e===bg?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Kr(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Gw(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function yT(t){var e=Gw(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Cc(t){t._valueTracker||(t._valueTracker=yT(t))}function Zw(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=Gw(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function eu(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Nh(t,e){var n=e.checked;return Re({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function z0(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Kr(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function Yw(t,e){e=e.checked,e!=null&&Sg(t,"checked",e,!1)}function Lh(t,e){Yw(t,e);var n=Kr(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Mh(t,e.type,n):e.hasOwnProperty("defaultValue")&&Mh(t,e.type,Kr(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function H0(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Mh(t,e,n){(e!=="number"||eu(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var fa=Array.isArray;function Bo(t,e,n,r){if(t=t.options,e){e={};for(var i=0;i<n.length;i++)e["$"+n[i]]=!0;for(n=0;n<t.length;n++)i=e.hasOwnProperty("$"+t[n].value),t[n].selected!==i&&(t[n].selected=i),i&&r&&(t[n].defaultSelected=!0)}else{for(n=""+Kr(n),e=null,i=0;i<t.length;i++){if(t[i].value===n){t[i].selected=!0,r&&(t[i].defaultSelected=!0);return}e!==null||t[i].disabled||(e=t[i])}e!==null&&(e.selected=!0)}}function Fh(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(R(91));return Re({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function j0(t,e){var n=e.value;if(n==null){if(n=e.children,e=e.defaultValue,n!=null){if(e!=null)throw Error(R(92));if(fa(n)){if(1<n.length)throw Error(R(93));n=n[0]}e=n}e==null&&(e=""),n=e}t._wrapperState={initialValue:Kr(n)}}function Xw(t,e){var n=Kr(e.value),r=Kr(e.defaultValue);n!=null&&(n=""+n,n!==t.value&&(t.value=n),e.defaultValue==null&&t.defaultValue!==n&&(t.defaultValue=n)),r!=null&&(t.defaultValue=""+r)}function U0(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function Qw(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function $h(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?Qw(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Ac,Jw=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,n,r,i){MSApp.execUnsafeLocalFunction(function(){return t(e,n,r,i)})}:t})(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Ac=Ac||document.createElement("div"),Ac.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Ac.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Ea(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var ga={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},_T=["Webkit","ms","Moz","O"];Object.keys(ga).forEach(function(t){_T.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),ga[e]=ga[t]})});function ex(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||ga.hasOwnProperty(t)&&ga[t]?(""+e).trim():e+"px"}function tx(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=ex(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,i):t[n]=i}}var wT=Re({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Dh(t,e){if(e){if(wT[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(R(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(R(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(R(61))}if(e.style!=null&&typeof e.style!="object")throw Error(R(62))}}function Bh(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Vh=null;function Cg(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var zh=null,Vo=null,zo=null;function W0(t){if(t=ja(t)){if(typeof zh!="function")throw Error(R(280));var e=t.stateNode;e&&(e=Tu(e),zh(t.stateNode,t.type,e))}}function nx(t){Vo?zo?zo.push(t):zo=[t]:Vo=t}function rx(){if(Vo){var t=Vo,e=zo;if(zo=Vo=null,W0(t),e)for(t=0;t<e.length;t++)W0(e[t])}}function ix(t,e){return t(e)}function ox(){}var ch=!1;function sx(t,e,n){if(ch)return t(e,n);ch=!0;try{return ix(t,e,n)}finally{ch=!1,(Vo!==null||zo!==null)&&(ox(),rx())}}function Ca(t,e){var n=t.stateNode;if(n===null)return null;var r=Tu(n);if(r===null)return null;n=r[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(n&&typeof n!="function")throw Error(R(231,e,typeof n));return n}var Hh=!1;if(er)try{Eo={},Object.defineProperty(Eo,"passive",{get:function(){Hh=!0}}),window.addEventListener("test",Eo,Eo),window.removeEventListener("test",Eo,Eo)}catch{Hh=!1}var Eo;function xT(t,e,n,r,i,o,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{e.apply(n,c)}catch(u){this.onError(u)}}var ma=!1,tu=null,nu=!1,jh=null,ST={onError:function(t){ma=!0,tu=t}};function bT(t,e,n,r,i,o,s,a,l){ma=!1,tu=null,xT.apply(ST,arguments)}function kT(t,e,n,r,i,o,s,a,l){if(bT.apply(this,arguments),ma){if(ma){var c=tu;ma=!1,tu=null}else throw Error(R(198));nu||(nu=!0,jh=c)}}function Oi(t){var e=t,n=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(n=e.return),t=e.return;while(t)}return e.tag===3?n:null}function ax(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function q0(t){if(Oi(t)!==t)throw Error(R(188))}function ET(t){var e=t.alternate;if(!e){if(e=Oi(t),e===null)throw Error(R(188));return e!==t?null:t}for(var n=t,r=e;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return q0(i),t;if(o===r)return q0(i),e;o=o.sibling}throw Error(R(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s){for(a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s)throw Error(R(189))}}if(n.alternate!==r)throw Error(R(190))}if(n.tag!==3)throw Error(R(188));return n.stateNode.current===n?t:e}function lx(t){return t=ET(t),t!==null?cx(t):null}function cx(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=cx(t);if(e!==null)return e;t=t.sibling}return null}var ux=$t.unstable_scheduleCallback,K0=$t.unstable_cancelCallback,CT=$t.unstable_shouldYield,AT=$t.unstable_requestPaint,Fe=$t.unstable_now,TT=$t.unstable_getCurrentPriorityLevel,Ag=$t.unstable_ImmediatePriority,dx=$t.unstable_UserBlockingPriority,ru=$t.unstable_NormalPriority,RT=$t.unstable_LowPriority,fx=$t.unstable_IdlePriority,ku=null,Tn=null;function IT(t){if(Tn&&typeof Tn.onCommitFiberRoot=="function")try{Tn.onCommitFiberRoot(ku,t,void 0,(t.current.flags&128)===128)}catch{}}var dn=Math.clz32?Math.clz32:NT,PT=Math.log,OT=Math.LN2;function NT(t){return t>>>=0,t===0?32:31-(PT(t)/OT|0)|0}var Tc=64,Rc=4194304;function pa(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function iu(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,i=t.suspendedLanes,o=t.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=pa(a):(o&=s,o!==0&&(r=pa(o)))}else s=n&~i,s!==0?r=pa(s):o!==0&&(r=pa(o));if(r===0)return 0;if(e!==0&&e!==r&&(e&i)===0&&(i=r&-r,o=e&-e,i>=o||i===16&&(o&4194240)!==0))return e;if((r&4)!==0&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0<e;)n=31-dn(e),i=1<<n,r|=t[n],e&=~i;return r}function LT(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function MT(t,e){for(var n=t.suspendedLanes,r=t.pingedLanes,i=t.expirationTimes,o=t.pendingLanes;0<o;){var s=31-dn(o),a=1<<s,l=i[s];l===-1?((a&n)===0||(a&r)!==0)&&(i[s]=LT(a,e)):l<=e&&(t.expiredLanes|=a),o&=~a}}function Uh(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function px(){var t=Tc;return Tc<<=1,(Tc&4194240)===0&&(Tc=64),t}function uh(t){for(var e=[],n=0;31>n;n++)e.push(t);return e}function za(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-dn(e),t[e]=n}function FT(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0<n;){var i=31-dn(n),o=1<<i;e[i]=0,r[i]=-1,t[i]=-1,n&=~o}}function Tg(t,e){var n=t.entangledLanes|=e;for(t=t.entanglements;n;){var r=31-dn(n),i=1<<r;i&e|t[r]&e&&(t[r]|=e),n&=~i}}var ue=0;function hx(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var gx,Rg,mx,vx,yx,Wh=!1,Ic=[],Br=null,Vr=null,zr=null,Aa=new Map,Ta=new Map,Mr=[],$T="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function G0(t,e){switch(t){case"focusin":case"focusout":Br=null;break;case"dragenter":case"dragleave":Vr=null;break;case"mouseover":case"mouseout":zr=null;break;case"pointerover":case"pointerout":Aa.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ta.delete(e.pointerId)}}function ia(t,e,n,r,i,o){return t===null||t.nativeEvent!==o?(t={blockedOn:e,domEventName:n,eventSystemFlags:r,nativeEvent:o,targetContainers:[i]},e!==null&&(e=ja(e),e!==null&&Rg(e)),t):(t.eventSystemFlags|=r,e=t.targetContainers,i!==null&&e.indexOf(i)===-1&&e.push(i),t)}function DT(t,e,n,r,i){switch(e){case"focusin":return Br=ia(Br,t,e,n,r,i),!0;case"dragenter":return Vr=ia(Vr,t,e,n,r,i),!0;case"mouseover":return zr=ia(zr,t,e,n,r,i),!0;case"pointerover":var o=i.pointerId;return Aa.set(o,ia(Aa.get(o)||null,t,e,n,r,i)),!0;case"gotpointercapture":return o=i.pointerId,Ta.set(o,ia(Ta.get(o)||null,t,e,n,r,i)),!0}return!1}function _x(t){var e=xi(t.target);if(e!==null){var n=Oi(e);if(n!==null){if(e=n.tag,e===13){if(e=ax(n),e!==null){t.blockedOn=e,yx(t.priority,function(){mx(n)});return}}else if(e===3&&n.stateNode.current.memoizedState.isDehydrated){t.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Uc(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var n=qh(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(n===null){n=t.nativeEvent;var r=new n.constructor(n.type,n);Vh=r,n.target.dispatchEvent(r),Vh=null}else return e=ja(n),e!==null&&Rg(e),t.blockedOn=n,!1;e.shift()}return!0}function Z0(t,e,n){Uc(t)&&n.delete(e)}function BT(){Wh=!1,Br!==null&&Uc(Br)&&(Br=null),Vr!==null&&Uc(Vr)&&(Vr=null),zr!==null&&Uc(zr)&&(zr=null),Aa.forEach(Z0),Ta.forEach(Z0)}function oa(t,e){t.blockedOn===e&&(t.blockedOn=null,Wh||(Wh=!0,$t.unstable_scheduleCallback($t.unstable_NormalPriority,BT)))}function Ra(t){function e(i){return oa(i,t)}if(0<Ic.length){oa(Ic[0],t);for(var n=1;n<Ic.length;n++){var r=Ic[n];r.blockedOn===t&&(r.blockedOn=null)}}for(Br!==null&&oa(Br,t),Vr!==null&&oa(Vr,t),zr!==null&&oa(zr,t),Aa.forEach(e),Ta.forEach(e),n=0;n<Mr.length;n++)r=Mr[n],r.blockedOn===t&&(r.blockedOn=null);for(;0<Mr.length&&(n=Mr[0],n.blockedOn===null);)_x(n),n.blockedOn===null&&Mr.shift()}var Ho=ir.ReactCurrentBatchConfig,ou=!0;function VT(t,e,n,r){var i=ue,o=Ho.transition;Ho.transition=null;try{ue=1,Ig(t,e,n,r)}finally{ue=i,Ho.transition=o}}function zT(t,e,n,r){var i=ue,o=Ho.transition;Ho.transition=null;try{ue=4,Ig(t,e,n,r)}finally{ue=i,Ho.transition=o}}function Ig(t,e,n,r){if(ou){var i=qh(t,e,n,r);if(i===null)vh(t,e,r,su,n),G0(t,r);else if(DT(i,t,e,n,r))r.stopPropagation();else if(G0(t,r),e&4&&-1<$T.indexOf(t)){for(;i!==null;){var o=ja(i);if(o!==null&&gx(o),o=qh(t,e,n,r),o===null&&vh(t,e,r,su,n),o===i)break;i=o}i!==null&&r.stopPropagation()}else vh(t,e,r,null,n)}}var su=null;function qh(t,e,n,r){if(su=null,t=Cg(r),t=xi(t),t!==null)if(e=Oi(t),e===null)t=null;else if(n=e.tag,n===13){if(t=ax(e),t!==null)return t;t=null}else if(n===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return su=t,null}function wx(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(TT()){case Ag:return 1;case dx:return 4;case ru:case RT:return 16;case fx:return 536870912;default:return 16}default:return 16}}var $r=null,Pg=null,Wc=null;function xx(){if(Wc)return Wc;var t,e=Pg,n=e.length,r,i="value"in $r?$r.value:$r.textContent,o=i.length;for(t=0;t<n&&e[t]===i[t];t++);var s=n-t;for(r=1;r<=s&&e[n-r]===i[o-r];r++);return Wc=i.slice(t,1<r?1-r:void 0)}function qc(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Pc(){return!0}function Y0(){return!1}function Dt(t){function e(n,r,i,o,s){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=o,this.target=s,this.currentTarget=null;for(var a in t)t.hasOwnProperty(a)&&(n=t[a],this[a]=n?n(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Pc:Y0,this.isPropagationStopped=Y0,this}return Re(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Pc)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Pc)},persist:function(){},isPersistent:Pc}),e}var Qo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Og=Dt(Qo),Ha=Re({},Qo,{view:0,detail:0}),HT=Dt(Ha),dh,fh,sa,Eu=Re({},Ha,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ng,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==sa&&(sa&&t.type==="mousemove"?(dh=t.screenX-sa.screenX,fh=t.screenY-sa.screenY):fh=dh=0,sa=t),dh)},movementY:function(t){return"movementY"in t?t.movementY:fh}}),X0=Dt(Eu),jT=Re({},Eu,{dataTransfer:0}),UT=Dt(jT),WT=Re({},Ha,{relatedTarget:0}),ph=Dt(WT),qT=Re({},Qo,{animationName:0,elapsedTime:0,pseudoElement:0}),KT=Dt(qT),GT=Re({},Qo,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),ZT=Dt(GT),YT=Re({},Qo,{data:0}),Q0=Dt(YT),XT={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},QT={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},JT={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eR(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=JT[t])?!!e[t]:!1}function Ng(){return eR}var tR=Re({},Ha,{key:function(t){if(t.key){var e=XT[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=qc(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?QT[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ng,charCode:function(t){return t.type==="keypress"?qc(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?qc(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),nR=Dt(tR),rR=Re({},Eu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),J0=Dt(rR),iR=Re({},Ha,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ng}),oR=Dt(iR),sR=Re({},Qo,{propertyName:0,elapsedTime:0,pseudoElement:0}),aR=Dt(sR),lR=Re({},Eu,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),cR=Dt(lR),uR=[9,13,27,32],Lg=er&&"CompositionEvent"in window,va=null;er&&"documentMode"in document&&(va=document.documentMode);var dR=er&&"TextEvent"in window&&!va,Sx=er&&(!Lg||va&&8<va&&11>=va),ew=" ",tw=!1;function bx(t,e){switch(t){case"keyup":return uR.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kx(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ro=!1;function fR(t,e){switch(t){case"compositionend":return kx(e);case"keypress":return e.which!==32?null:(tw=!0,ew);case"textInput":return t=e.data,t===ew&&tw?null:t;default:return null}}function pR(t,e){if(Ro)return t==="compositionend"||!Lg&&bx(t,e)?(t=xx(),Wc=Pg=$r=null,Ro=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return Sx&&e.locale!=="ko"?null:e.data;default:return null}}var hR={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function nw(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!hR[t.type]:e==="textarea"}function Ex(t,e,n,r){nx(r),e=au(e,"onChange"),0<e.length&&(n=new Og("onChange","change",null,n,r),t.push({event:n,listeners:e}))}var ya=null,Ia=null;function gR(t){Fx(t,0)}function Cu(t){var e=Oo(t);if(Zw(e))return t}function mR(t,e){if(t==="change")return e}var Cx=!1;er&&(er?(Nc="oninput"in document,Nc||(hh=document.createElement("div"),hh.setAttribute("oninput","return;"),Nc=typeof hh.oninput=="function"),Oc=Nc):Oc=!1,Cx=Oc&&(!document.documentMode||9<document.documentMode));var Oc,Nc,hh;function rw(){ya&&(ya.detachEvent("onpropertychange",Ax),Ia=ya=null)}function Ax(t){if(t.propertyName==="value"&&Cu(Ia)){var e=[];Ex(e,Ia,t,Cg(t)),sx(gR,e)}}function vR(t,e,n){t==="focusin"?(rw(),ya=e,Ia=n,ya.attachEvent("onpropertychange",Ax)):t==="focusout"&&rw()}function yR(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Cu(Ia)}function _R(t,e){if(t==="click")return Cu(e)}function wR(t,e){if(t==="input"||t==="change")return Cu(e)}function xR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var pn=typeof Object.is=="function"?Object.is:xR;function Pa(t,e){if(pn(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Th.call(e,i)||!pn(t[i],e[i]))return!1}return!0}function iw(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function ow(t,e){var n=iw(t);t=0;for(var r;n;){if(n.nodeType===3){if(r=t+n.textContent.length,t<=e&&r>=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=iw(n)}}function Tx(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Tx(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function Rx(){for(var t=window,e=eu();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=eu(t.document)}return e}function Mg(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function SR(t){var e=Rx(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&Tx(n.ownerDocument.documentElement,n)){if(r!==null&&Mg(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!t.extend&&o>r&&(i=r,r=o,o=i),i=ow(n,o);var s=ow(n,r);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),o>r?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<e.length;n++)t=e[n],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var bR=er&&"documentMode"in document&&11>=document.documentMode,Io=null,Kh=null,_a=null,Gh=!1;function sw(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Gh||Io==null||Io!==eu(r)||(r=Io,"selectionStart"in r&&Mg(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),_a&&Pa(_a,r)||(_a=r,r=au(Kh,"onSelect"),0<r.length&&(e=new Og("onSelect","select",null,e,n),t.push({event:e,listeners:r}),e.target=Io)))}function Lc(t,e){var n={};return n[t.toLowerCase()]=e.toLowerCase(),n["Webkit"+t]="webkit"+e,n["Moz"+t]="moz"+e,n}var Po={animationend:Lc("Animation","AnimationEnd"),animationiteration:Lc("Animation","AnimationIteration"),animationstart:Lc("Animation","AnimationStart"),transitionend:Lc("Transition","TransitionEnd")},gh={},Ix={};er&&(Ix=document.createElement("div").style,"AnimationEvent"in window||(delete Po.animationend.animation,delete Po.animationiteration.animation,delete Po.animationstart.animation),"TransitionEvent"in window||delete Po.transitionend.transition);function Au(t){if(gh[t])return gh[t];if(!Po[t])return t;var e=Po[t],n;for(n in e)if(e.hasOwnProperty(n)&&n in Ix)return gh[t]=e[n];return t}var Px=Au("animationend"),Ox=Au("animationiteration"),Nx=Au("animationstart"),Lx=Au("transitionend"),Mx=new Map,aw="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Zr(t,e){Mx.set(t,e),Pi(e,[t])}for(Mc=0;Mc<aw.length;Mc++)Fc=aw[Mc],lw=Fc.toLowerCase(),cw=Fc[0].toUpperCase()+Fc.slice(1),Zr(lw,"on"+cw);var Fc,lw,cw,Mc;Zr(Px,"onAnimationEnd");Zr(Ox,"onAnimationIteration");Zr(Nx,"onAnimationStart");Zr("dblclick","onDoubleClick");Zr("focusin","onFocus");Zr("focusout","onBlur");Zr(Lx,"onTransitionEnd");Wo("onMouseEnter",["mouseout","mouseover"]);Wo("onMouseLeave",["mouseout","mouseover"]);Wo("onPointerEnter",["pointerout","pointerover"]);Wo("onPointerLeave",["pointerout","pointerover"]);Pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Pi("onBeforeInput",["compositionend","keypress","textInput","paste"]);Pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ha="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),kR=new Set("cancel close invalid load scroll toggle".split(" ").concat(ha));function uw(t,e,n){var r=t.type||"unknown-event";t.currentTarget=n,kT(r,e,void 0,t),t.currentTarget=null}function Fx(t,e){e=(e&4)!==0;for(var n=0;n<t.length;n++){var r=t[n],i=r.event;r=r.listeners;e:{var o=void 0;if(e)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&i.isPropagationStopped())break e;uw(i,a,c),o=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==o&&i.isPropagationStopped())break e;uw(i,a,c),o=l}}}if(nu)throw t=jh,nu=!1,jh=null,t}function ye(t,e){var n=e[Jh];n===void 0&&(n=e[Jh]=new Set);var r=t+"__bubble";n.has(r)||($x(e,t,2,!1),n.add(r))}function mh(t,e,n){var r=0;e&&(r|=4),$x(n,t,r,e)}var $c="_reactListening"+Math.random().toString(36).slice(2);function Oa(t){if(!t[$c]){t[$c]=!0,Uw.forEach(function(n){n!=="selectionchange"&&(kR.has(n)||mh(n,!1,t),mh(n,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[$c]||(e[$c]=!0,mh("selectionchange",!1,e))}}function $x(t,e,n,r){switch(wx(e)){case 1:var i=VT;break;case 4:i=zT;break;default:i=Ig}n=i.bind(null,e,n,t),i=void 0,!Hh||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(i=!0),r?i!==void 0?t.addEventListener(e,n,{capture:!0,passive:i}):t.addEventListener(e,n,!0):i!==void 0?t.addEventListener(e,n,{passive:i}):t.addEventListener(e,n,!1)}function vh(t,e,n,r,i){var o=r;if((e&1)===0&&(e&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===i||l.nodeType===8&&l.parentNode===i))return;s=s.return}for(;a!==null;){if(s=xi(a),s===null)return;if(l=s.tag,l===5||l===6){r=o=s;continue e}a=a.parentNode}}r=r.return}sx(function(){var c=o,u=Cg(n),f=[];e:{var h=Mx.get(t);if(h!==void 0){var g=Og,v=t;switch(t){case"keypress":if(qc(n)===0)break e;case"keydown":case"keyup":g=nR;break;case"focusin":v="focus",g=ph;break;case"focusout":v="blur",g=ph;break;case"beforeblur":case"afterblur":g=ph;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=X0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=UT;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=oR;break;case Px:case Ox:case Nx:g=KT;break;case Lx:g=aR;break;case"scroll":g=HT;break;case"wheel":g=cR;break;case"copy":case"cut":case"paste":g=ZT;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=J0}var _=(e&4)!==0,x=!_&&t==="scroll",d=_?h!==null?h+"Capture":null:h;_=[];for(var p=c,m;p!==null;){m=p;var y=m.stateNode;if(m.tag===5&&y!==null&&(m=y,d!==null&&(y=Ca(p,d),y!=null&&_.push(Na(p,y,m)))),x)break;p=p.return}0<_.length&&(h=new g(h,v,null,n,u),f.push({event:h,listeners:_}))}}if((e&7)===0){e:{if(h=t==="mouseover"||t==="pointerover",g=t==="mouseout"||t==="pointerout",h&&n!==Vh&&(v=n.relatedTarget||n.fromElement)&&(xi(v)||v[tr]))break e;if((g||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,g?(v=n.relatedTarget||n.toElement,g=c,v=v?xi(v):null,v!==null&&(x=Oi(v),v!==x||v.tag!==5&&v.tag!==6)&&(v=null)):(g=null,v=c),g!==v)){if(_=X0,y="onMouseLeave",d="onMouseEnter",p="mouse",(t==="pointerout"||t==="pointerover")&&(_=J0,y="onPointerLeave",d="onPointerEnter",p="pointer"),x=g==null?h:Oo(g),m=v==null?h:Oo(v),h=new _(y,p+"leave",g,n,u),h.target=x,h.relatedTarget=m,y=null,xi(u)===c&&(_=new _(d,p+"enter",v,n,u),_.target=m,_.relatedTarget=x,y=_),x=y,g&&v)t:{for(_=g,d=v,p=0,m=_;m;m=Co(m))p++;for(m=0,y=d;y;y=Co(y))m++;for(;0<p-m;)_=Co(_),p--;for(;0<m-p;)d=Co(d),m--;for(;p--;){if(_===d||d!==null&&_===d.alternate)break t;_=Co(_),d=Co(d)}_=null}else _=null;g!==null&&dw(f,h,g,_,!1),v!==null&&x!==null&&dw(f,x,v,_,!0)}}e:{if(h=c?Oo(c):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var w=mR;else if(nw(h))if(Cx)w=wR;else{w=yR;var b=vR}else(g=h.nodeName)&&g.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(w=_R);if(w&&(w=w(t,c))){Ex(f,w,n,u);break e}b&&b(t,h,c),t==="focusout"&&(b=h._wrapperState)&&b.controlled&&h.type==="number"&&Mh(h,"number",h.value)}switch(b=c?Oo(c):window,t){case"focusin":(nw(b)||b.contentEditable==="true")&&(Io=b,Kh=c,_a=null);break;case"focusout":_a=Kh=Io=null;break;case"mousedown":Gh=!0;break;case"contextmenu":case"mouseup":case"dragend":Gh=!1,sw(f,n,u);break;case"selectionchange":if(bR)break;case"keydown":case"keyup":sw(f,n,u)}var k;if(Lg)e:{switch(t){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Ro?bx(t,n)&&(E="onCompositionEnd"):t==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Sx&&n.locale!=="ko"&&(Ro||E!=="onCompositionStart"?E==="onCompositionEnd"&&Ro&&(k=xx()):($r=u,Pg="value"in $r?$r.value:$r.textContent,Ro=!0)),b=au(c,E),0<b.length&&(E=new Q0(E,t,null,n,u),f.push({event:E,listeners:b}),k?E.data=k:(k=kx(n),k!==null&&(E.data=k)))),(k=dR?fR(t,n):pR(t,n))&&(c=au(c,"onBeforeInput"),0<c.length&&(u=new Q0("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=k))}Fx(f,e)})}function Na(t,e,n){return{instance:t,listener:e,currentTarget:n}}function au(t,e){for(var n=e+"Capture",r=[];t!==null;){var i=t,o=i.stateNode;i.tag===5&&o!==null&&(i=o,o=Ca(t,n),o!=null&&r.unshift(Na(t,o,i)),o=Ca(t,e),o!=null&&r.push(Na(t,o,i))),t=t.return}return r}function Co(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function dw(t,e,n,r,i){for(var o=e._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,i?(l=Ca(n,o),l!=null&&s.unshift(Na(n,l,a))):i||(l=Ca(n,o),l!=null&&s.push(Na(n,l,a)))),n=n.return}s.length!==0&&t.push({event:e,listeners:s})}var ER=/\r\n?/g,CR=/\u0000|\uFFFD/g;function fw(t){return(typeof t=="string"?t:""+t).replace(ER,`
|
|
6
|
+
`).replace(CR,"")}function Dc(t,e,n){if(e=fw(e),fw(t)!==e&&n)throw Error(R(425))}function lu(){}var Zh=null,Yh=null;function Xh(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Qh=typeof setTimeout=="function"?setTimeout:void 0,AR=typeof clearTimeout=="function"?clearTimeout:void 0,pw=typeof Promise=="function"?Promise:void 0,TR=typeof queueMicrotask=="function"?queueMicrotask:typeof pw<"u"?function(t){return pw.resolve(null).then(t).catch(RR)}:Qh;function RR(t){setTimeout(function(){throw t})}function yh(t,e){var n=e,r=0;do{var i=n.nextSibling;if(t.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){t.removeChild(i),Ra(e);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);Ra(e)}function Hr(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function hw(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="$"||n==="$!"||n==="$?"){if(e===0)return t;e--}else n==="/$"&&e++}t=t.previousSibling}return null}var Jo=Math.random().toString(36).slice(2),An="__reactFiber$"+Jo,La="__reactProps$"+Jo,tr="__reactContainer$"+Jo,Jh="__reactEvents$"+Jo,IR="__reactListeners$"+Jo,PR="__reactHandles$"+Jo;function xi(t){var e=t[An];if(e)return e;for(var n=t.parentNode;n;){if(e=n[tr]||n[An]){if(n=e.alternate,e.child!==null||n!==null&&n.child!==null)for(t=hw(t);t!==null;){if(n=t[An])return n;t=hw(t)}return e}t=n,n=t.parentNode}return null}function ja(t){return t=t[An]||t[tr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Oo(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(R(33))}function Tu(t){return t[La]||null}var eg=[],No=-1;function Yr(t){return{current:t}}function _e(t){0>No||(t.current=eg[No],eg[No]=null,No--)}function me(t,e){No++,eg[No]=t.current,t.current=e}var Gr={},at=Yr(Gr),Et=Yr(!1),Ci=Gr;function qo(t,e){var n=t.type.contextTypes;if(!n)return Gr;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=e[o];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Ct(t){return t=t.childContextTypes,t!=null}function cu(){_e(Et),_e(at)}function gw(t,e,n){if(at.current!==Gr)throw Error(R(168));me(at,e),me(Et,n)}function Dx(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in e))throw Error(R(108,vT(t)||"Unknown",i));return Re({},n,r)}function uu(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Gr,Ci=at.current,me(at,t),me(Et,Et.current),!0}function mw(t,e,n){var r=t.stateNode;if(!r)throw Error(R(169));n?(t=Dx(t,e,Ci),r.__reactInternalMemoizedMergedChildContext=t,_e(Et),_e(at),me(at,t)):_e(Et),me(Et,n)}var Yn=null,Ru=!1,_h=!1;function Bx(t){Yn===null?Yn=[t]:Yn.push(t)}function OR(t){Ru=!0,Bx(t)}function Xr(){if(!_h&&Yn!==null){_h=!0;var t=0,e=ue;try{var n=Yn;for(ue=1;t<n.length;t++){var r=n[t];do r=r(!0);while(r!==null)}Yn=null,Ru=!1}catch(i){throw Yn!==null&&(Yn=Yn.slice(t+1)),ux(Ag,Xr),i}finally{ue=e,_h=!1}}return null}var Lo=[],Mo=0,du=null,fu=0,Wt=[],qt=0,Ai=null,Xn=1,Qn="";function _i(t,e){Lo[Mo++]=fu,Lo[Mo++]=du,du=t,fu=e}function Vx(t,e,n){Wt[qt++]=Xn,Wt[qt++]=Qn,Wt[qt++]=Ai,Ai=t;var r=Xn;t=Qn;var i=32-dn(r)-1;r&=~(1<<i),n+=1;var o=32-dn(e)+i;if(30<o){var s=i-i%5;o=(r&(1<<s)-1).toString(32),r>>=s,i-=s,Xn=1<<32-dn(e)+i|n<<i|r,Qn=o+t}else Xn=1<<o|n<<i|r,Qn=t}function Fg(t){t.return!==null&&(_i(t,1),Vx(t,1,0))}function $g(t){for(;t===du;)du=Lo[--Mo],Lo[Mo]=null,fu=Lo[--Mo],Lo[Mo]=null;for(;t===Ai;)Ai=Wt[--qt],Wt[qt]=null,Qn=Wt[--qt],Wt[qt]=null,Xn=Wt[--qt],Wt[qt]=null}var Ft=null,Mt=null,ke=!1,un=null;function zx(t,e){var n=Kt(5,null,null,0);n.elementType="DELETED",n.stateNode=e,n.return=t,e=t.deletions,e===null?(t.deletions=[n],t.flags|=16):e.push(n)}function vw(t,e){switch(t.tag){case 5:var n=t.type;return e=e.nodeType!==1||n.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,Ft=t,Mt=Hr(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Ft=t,Mt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(n=Ai!==null?{id:Xn,overflow:Qn}:null,t.memoizedState={dehydrated:e,treeContext:n,retryLane:1073741824},n=Kt(18,null,null,0),n.stateNode=e,n.return=t,t.child=n,Ft=t,Mt=null,!0):!1;default:return!1}}function tg(t){return(t.mode&1)!==0&&(t.flags&128)===0}function ng(t){if(ke){var e=Mt;if(e){var n=e;if(!vw(t,e)){if(tg(t))throw Error(R(418));e=Hr(n.nextSibling);var r=Ft;e&&vw(t,e)?zx(r,n):(t.flags=t.flags&-4097|2,ke=!1,Ft=t)}}else{if(tg(t))throw Error(R(418));t.flags=t.flags&-4097|2,ke=!1,Ft=t}}}function yw(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Ft=t}function Bc(t){if(t!==Ft)return!1;if(!ke)return yw(t),ke=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Xh(t.type,t.memoizedProps)),e&&(e=Mt)){if(tg(t))throw Hx(),Error(R(418));for(;e;)zx(t,e),e=Hr(e.nextSibling)}if(yw(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(R(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var n=t.data;if(n==="/$"){if(e===0){Mt=Hr(t.nextSibling);break e}e--}else n!=="$"&&n!=="$!"&&n!=="$?"||e++}t=t.nextSibling}Mt=null}}else Mt=Ft?Hr(t.stateNode.nextSibling):null;return!0}function Hx(){for(var t=Mt;t;)t=Hr(t.nextSibling)}function Ko(){Mt=Ft=null,ke=!1}function Dg(t){un===null?un=[t]:un.push(t)}var NR=ir.ReactCurrentBatchConfig;function aa(t,e,n){if(t=n.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(R(309));var r=n.stateNode}if(!r)throw Error(R(147,t));var i=r,o=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===o?e.ref:(e=function(s){var a=i.refs;s===null?delete a[o]:a[o]=s},e._stringRef=o,e)}if(typeof t!="string")throw Error(R(284));if(!n._owner)throw Error(R(290,t))}return t}function Vc(t,e){throw t=Object.prototype.toString.call(e),Error(R(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function _w(t){var e=t._init;return e(t._payload)}function jx(t){function e(d,p){if(t){var m=d.deletions;m===null?(d.deletions=[p],d.flags|=16):m.push(p)}}function n(d,p){if(!t)return null;for(;p!==null;)e(d,p),p=p.sibling;return null}function r(d,p){for(d=new Map;p!==null;)p.key!==null?d.set(p.key,p):d.set(p.index,p),p=p.sibling;return d}function i(d,p){return d=qr(d,p),d.index=0,d.sibling=null,d}function o(d,p,m){return d.index=m,t?(m=d.alternate,m!==null?(m=m.index,m<p?(d.flags|=2,p):m):(d.flags|=2,p)):(d.flags|=1048576,p)}function s(d){return t&&d.alternate===null&&(d.flags|=2),d}function a(d,p,m,y){return p===null||p.tag!==6?(p=Ch(m,d.mode,y),p.return=d,p):(p=i(p,m),p.return=d,p)}function l(d,p,m,y){var w=m.type;return w===To?u(d,p,m.props.children,y,m.key):p!==null&&(p.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Nr&&_w(w)===p.type)?(y=i(p,m.props),y.ref=aa(d,p,m),y.return=d,y):(y=Jc(m.type,m.key,m.props,null,d.mode,y),y.ref=aa(d,p,m),y.return=d,y)}function c(d,p,m,y){return p===null||p.tag!==4||p.stateNode.containerInfo!==m.containerInfo||p.stateNode.implementation!==m.implementation?(p=Ah(m,d.mode,y),p.return=d,p):(p=i(p,m.children||[]),p.return=d,p)}function u(d,p,m,y,w){return p===null||p.tag!==7?(p=Ei(m,d.mode,y,w),p.return=d,p):(p=i(p,m),p.return=d,p)}function f(d,p,m){if(typeof p=="string"&&p!==""||typeof p=="number")return p=Ch(""+p,d.mode,m),p.return=d,p;if(typeof p=="object"&&p!==null){switch(p.$$typeof){case Ec:return m=Jc(p.type,p.key,p.props,null,d.mode,m),m.ref=aa(d,null,p),m.return=d,m;case Ao:return p=Ah(p,d.mode,m),p.return=d,p;case Nr:var y=p._init;return f(d,y(p._payload),m)}if(fa(p)||ra(p))return p=Ei(p,d.mode,m,null),p.return=d,p;Vc(d,p)}return null}function h(d,p,m,y){var w=p!==null?p.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return w!==null?null:a(d,p,""+m,y);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Ec:return m.key===w?l(d,p,m,y):null;case Ao:return m.key===w?c(d,p,m,y):null;case Nr:return w=m._init,h(d,p,w(m._payload),y)}if(fa(m)||ra(m))return w!==null?null:u(d,p,m,y,null);Vc(d,m)}return null}function g(d,p,m,y,w){if(typeof y=="string"&&y!==""||typeof y=="number")return d=d.get(m)||null,a(p,d,""+y,w);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ec:return d=d.get(y.key===null?m:y.key)||null,l(p,d,y,w);case Ao:return d=d.get(y.key===null?m:y.key)||null,c(p,d,y,w);case Nr:var b=y._init;return g(d,p,m,b(y._payload),w)}if(fa(y)||ra(y))return d=d.get(m)||null,u(p,d,y,w,null);Vc(p,y)}return null}function v(d,p,m,y){for(var w=null,b=null,k=p,E=p=0,I=null;k!==null&&E<m.length;E++){k.index>E?(I=k,k=null):I=k.sibling;var A=h(d,k,m[E],y);if(A===null){k===null&&(k=I);break}t&&k&&A.alternate===null&&e(d,k),p=o(A,p,E),b===null?w=A:b.sibling=A,b=A,k=I}if(E===m.length)return n(d,k),ke&&_i(d,E),w;if(k===null){for(;E<m.length;E++)k=f(d,m[E],y),k!==null&&(p=o(k,p,E),b===null?w=k:b.sibling=k,b=k);return ke&&_i(d,E),w}for(k=r(d,k);E<m.length;E++)I=g(k,d,E,m[E],y),I!==null&&(t&&I.alternate!==null&&k.delete(I.key===null?E:I.key),p=o(I,p,E),b===null?w=I:b.sibling=I,b=I);return t&&k.forEach(function(H){return e(d,H)}),ke&&_i(d,E),w}function _(d,p,m,y){var w=ra(m);if(typeof w!="function")throw Error(R(150));if(m=w.call(m),m==null)throw Error(R(151));for(var b=w=null,k=p,E=p=0,I=null,A=m.next();k!==null&&!A.done;E++,A=m.next()){k.index>E?(I=k,k=null):I=k.sibling;var H=h(d,k,A.value,y);if(H===null){k===null&&(k=I);break}t&&k&&H.alternate===null&&e(d,k),p=o(H,p,E),b===null?w=H:b.sibling=H,b=H,k=I}if(A.done)return n(d,k),ke&&_i(d,E),w;if(k===null){for(;!A.done;E++,A=m.next())A=f(d,A.value,y),A!==null&&(p=o(A,p,E),b===null?w=A:b.sibling=A,b=A);return ke&&_i(d,E),w}for(k=r(d,k);!A.done;E++,A=m.next())A=g(k,d,E,A.value,y),A!==null&&(t&&A.alternate!==null&&k.delete(A.key===null?E:A.key),p=o(A,p,E),b===null?w=A:b.sibling=A,b=A);return t&&k.forEach(function(K){return e(d,K)}),ke&&_i(d,E),w}function x(d,p,m,y){if(typeof m=="object"&&m!==null&&m.type===To&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Ec:e:{for(var w=m.key,b=p;b!==null;){if(b.key===w){if(w=m.type,w===To){if(b.tag===7){n(d,b.sibling),p=i(b,m.props.children),p.return=d,d=p;break e}}else if(b.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Nr&&_w(w)===b.type){n(d,b.sibling),p=i(b,m.props),p.ref=aa(d,b,m),p.return=d,d=p;break e}n(d,b);break}else e(d,b);b=b.sibling}m.type===To?(p=Ei(m.props.children,d.mode,y,m.key),p.return=d,d=p):(y=Jc(m.type,m.key,m.props,null,d.mode,y),y.ref=aa(d,p,m),y.return=d,d=y)}return s(d);case Ao:e:{for(b=m.key;p!==null;){if(p.key===b)if(p.tag===4&&p.stateNode.containerInfo===m.containerInfo&&p.stateNode.implementation===m.implementation){n(d,p.sibling),p=i(p,m.children||[]),p.return=d,d=p;break e}else{n(d,p);break}else e(d,p);p=p.sibling}p=Ah(m,d.mode,y),p.return=d,d=p}return s(d);case Nr:return b=m._init,x(d,p,b(m._payload),y)}if(fa(m))return v(d,p,m,y);if(ra(m))return _(d,p,m,y);Vc(d,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,p!==null&&p.tag===6?(n(d,p.sibling),p=i(p,m),p.return=d,d=p):(n(d,p),p=Ch(m,d.mode,y),p.return=d,d=p),s(d)):n(d,p)}return x}var Go=jx(!0),Ux=jx(!1),pu=Yr(null),hu=null,Fo=null,Bg=null;function Vg(){Bg=Fo=hu=null}function zg(t){var e=pu.current;_e(pu),t._currentValue=e}function rg(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function jo(t,e){hu=t,Bg=Fo=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&e)!==0&&(kt=!0),t.firstContext=null)}function Zt(t){var e=t._currentValue;if(Bg!==t)if(t={context:t,memoizedValue:e,next:null},Fo===null){if(hu===null)throw Error(R(308));Fo=t,hu.dependencies={lanes:0,firstContext:t}}else Fo=Fo.next=t;return e}var Si=null;function Hg(t){Si===null?Si=[t]:Si.push(t)}function Wx(t,e,n,r){var i=e.interleaved;return i===null?(n.next=n,Hg(e)):(n.next=i.next,i.next=n),e.interleaved=n,nr(t,r)}function nr(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Lr=!1;function jg(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qx(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Jn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function jr(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(se&2)!==0){var i=r.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),r.pending=e,nr(t,n)}return i=r.interleaved,i===null?(e.next=e,Hg(r)):(e.next=i.next,i.next=e),r.interleaved=e,nr(t,n)}function Kc(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Tg(t,n)}}function ww(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=s:o=o.next=s,n=n.next}while(n!==null);o===null?i=o=e:o=o.next=e}else i=o=e;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function gu(t,e,n,r){var i=t.updateQueue;Lr=!1;var o=i.firstBaseUpdate,s=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?o=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var f=i.baseState;s=0,u=c=l=null,a=o;do{var h=a.lane,g=a.eventTime;if((r&h)===h){u!==null&&(u=u.next={eventTime:g,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=t,_=a;switch(h=e,g=n,_.tag){case 1:if(v=_.payload,typeof v=="function"){f=v.call(g,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=_.payload,h=typeof v=="function"?v.call(g,f,h):v,h==null)break e;f=Re({},f,h);break e;case 2:Lr=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else g={eventTime:g,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=g,l=f):u=u.next=g,s|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else o===null&&(i.shared.lanes=0);Ri|=s,t.lanes=s,t.memoizedState=f}}function xw(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var r=t[e],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(R(191,i));i.call(r)}}}var Ua={},Rn=Yr(Ua),Ma=Yr(Ua),Fa=Yr(Ua);function bi(t){if(t===Ua)throw Error(R(174));return t}function Ug(t,e){switch(me(Fa,e),me(Ma,t),me(Rn,Ua),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:$h(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=$h(e,t)}_e(Rn),me(Rn,e)}function Zo(){_e(Rn),_e(Ma),_e(Fa)}function Kx(t){bi(Fa.current);var e=bi(Rn.current),n=$h(e,t.type);e!==n&&(me(Ma,t),me(Rn,n))}function Wg(t){Ma.current===t&&(_e(Rn),_e(Ma))}var Ae=Yr(0);function mu(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var wh=[];function qg(){for(var t=0;t<wh.length;t++)wh[t]._workInProgressVersionPrimary=null;wh.length=0}var Gc=ir.ReactCurrentDispatcher,xh=ir.ReactCurrentBatchConfig,Ti=0,Te=null,je=null,qe=null,vu=!1,wa=!1,$a=0,LR=0;function it(){throw Error(R(321))}function Kg(t,e){if(e===null)return!1;for(var n=0;n<e.length&&n<t.length;n++)if(!pn(t[n],e[n]))return!1;return!0}function Gg(t,e,n,r,i,o){if(Ti=o,Te=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Gc.current=t===null||t.memoizedState===null?DR:BR,t=n(r,i),wa){o=0;do{if(wa=!1,$a=0,25<=o)throw Error(R(301));o+=1,qe=je=null,e.updateQueue=null,Gc.current=VR,t=n(r,i)}while(wa)}if(Gc.current=yu,e=je!==null&&je.next!==null,Ti=0,qe=je=Te=null,vu=!1,e)throw Error(R(300));return t}function Zg(){var t=$a!==0;return $a=0,t}function Cn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qe===null?Te.memoizedState=qe=t:qe=qe.next=t,qe}function Yt(){if(je===null){var t=Te.alternate;t=t!==null?t.memoizedState:null}else t=je.next;var e=qe===null?Te.memoizedState:qe.next;if(e!==null)qe=e,je=t;else{if(t===null)throw Error(R(310));je=t,t={memoizedState:je.memoizedState,baseState:je.baseState,baseQueue:je.baseQueue,queue:je.queue,next:null},qe===null?Te.memoizedState=qe=t:qe=qe.next=t}return qe}function Da(t,e){return typeof e=="function"?e(t):e}function Sh(t){var e=Yt(),n=e.queue;if(n===null)throw Error(R(311));n.lastRenderedReducer=t;var r=je,i=r.baseQueue,o=n.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}r.baseQueue=i=o,n.pending=null}if(i!==null){o=i.next,r=r.baseState;var a=s=null,l=null,c=o;do{var u=c.lane;if((Ti&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:t(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,Te.lanes|=u,Ri|=u}c=c.next}while(c!==null&&c!==o);l===null?s=r:l.next=a,pn(r,e.memoizedState)||(kt=!0),e.memoizedState=r,e.baseState=s,e.baseQueue=l,n.lastRenderedState=r}if(t=n.interleaved,t!==null){i=t;do o=i.lane,Te.lanes|=o,Ri|=o,i=i.next;while(i!==t)}else i===null&&(n.lanes=0);return[e.memoizedState,n.dispatch]}function bh(t){var e=Yt(),n=e.queue;if(n===null)throw Error(R(311));n.lastRenderedReducer=t;var r=n.dispatch,i=n.pending,o=e.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=t(o,s.action),s=s.next;while(s!==i);pn(o,e.memoizedState)||(kt=!0),e.memoizedState=o,e.baseQueue===null&&(e.baseState=o),n.lastRenderedState=o}return[o,r]}function Gx(){}function Zx(t,e){var n=Te,r=Yt(),i=e(),o=!pn(r.memoizedState,i);if(o&&(r.memoizedState=i,kt=!0),r=r.queue,Yg(Qx.bind(null,n,r,t),[t]),r.getSnapshot!==e||o||qe!==null&&qe.memoizedState.tag&1){if(n.flags|=2048,Ba(9,Xx.bind(null,n,r,i,e),void 0,null),Ke===null)throw Error(R(349));(Ti&30)!==0||Yx(n,e,i)}return i}function Yx(t,e,n){t.flags|=16384,t={getSnapshot:e,value:n},e=Te.updateQueue,e===null?(e={lastEffect:null,stores:null},Te.updateQueue=e,e.stores=[t]):(n=e.stores,n===null?e.stores=[t]:n.push(t))}function Xx(t,e,n,r){e.value=n,e.getSnapshot=r,Jx(e)&&eS(t)}function Qx(t,e,n){return n(function(){Jx(e)&&eS(t)})}function Jx(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!pn(t,n)}catch{return!0}}function eS(t){var e=nr(t,1);e!==null&&fn(e,t,1,-1)}function Sw(t){var e=Cn();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:t},e.queue=t,t=t.dispatch=$R.bind(null,Te,t),[e.memoizedState,t]}function Ba(t,e,n,r){return t={tag:t,create:e,destroy:n,deps:r,next:null},e=Te.updateQueue,e===null?(e={lastEffect:null,stores:null},Te.updateQueue=e,e.lastEffect=t.next=t):(n=e.lastEffect,n===null?e.lastEffect=t.next=t:(r=n.next,n.next=t,t.next=r,e.lastEffect=t)),t}function tS(){return Yt().memoizedState}function Zc(t,e,n,r){var i=Cn();Te.flags|=t,i.memoizedState=Ba(1|e,n,void 0,r===void 0?null:r)}function Iu(t,e,n,r){var i=Yt();r=r===void 0?null:r;var o=void 0;if(je!==null){var s=je.memoizedState;if(o=s.destroy,r!==null&&Kg(r,s.deps)){i.memoizedState=Ba(e,n,o,r);return}}Te.flags|=t,i.memoizedState=Ba(1|e,n,o,r)}function bw(t,e){return Zc(8390656,8,t,e)}function Yg(t,e){return Iu(2048,8,t,e)}function nS(t,e){return Iu(4,2,t,e)}function rS(t,e){return Iu(4,4,t,e)}function iS(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function oS(t,e,n){return n=n!=null?n.concat([t]):null,Iu(4,4,iS.bind(null,e,t),n)}function Xg(){}function sS(t,e){var n=Yt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Kg(e,r[1])?r[0]:(n.memoizedState=[t,e],t)}function aS(t,e){var n=Yt();e=e===void 0?null:e;var r=n.memoizedState;return r!==null&&e!==null&&Kg(e,r[1])?r[0]:(t=t(),n.memoizedState=[t,e],t)}function lS(t,e,n){return(Ti&21)===0?(t.baseState&&(t.baseState=!1,kt=!0),t.memoizedState=n):(pn(n,e)||(n=px(),Te.lanes|=n,Ri|=n,t.baseState=!0),e)}function MR(t,e){var n=ue;ue=n!==0&&4>n?n:4,t(!0);var r=xh.transition;xh.transition={};try{t(!1),e()}finally{ue=n,xh.transition=r}}function cS(){return Yt().memoizedState}function FR(t,e,n){var r=Wr(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},uS(t))dS(e,n);else if(n=Wx(t,e,n,r),n!==null){var i=ht();fn(n,t,r,i),fS(n,e,r)}}function $R(t,e,n){var r=Wr(t),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(uS(t))dS(e,i);else{var o=t.alternate;if(t.lanes===0&&(o===null||o.lanes===0)&&(o=e.lastRenderedReducer,o!==null))try{var s=e.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,pn(a,s)){var l=e.interleaved;l===null?(i.next=i,Hg(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}n=Wx(t,e,i,r),n!==null&&(i=ht(),fn(n,t,r,i),fS(n,e,r))}}function uS(t){var e=t.alternate;return t===Te||e!==null&&e===Te}function dS(t,e){wa=vu=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function fS(t,e,n){if((n&4194240)!==0){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Tg(t,n)}}var yu={readContext:Zt,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useInsertionEffect:it,useLayoutEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useMutableSource:it,useSyncExternalStore:it,useId:it,unstable_isNewReconciler:!1},DR={readContext:Zt,useCallback:function(t,e){return Cn().memoizedState=[t,e===void 0?null:e],t},useContext:Zt,useEffect:bw,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Zc(4194308,4,iS.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Zc(4194308,4,t,e)},useInsertionEffect:function(t,e){return Zc(4,2,t,e)},useMemo:function(t,e){var n=Cn();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Cn();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=FR.bind(null,Te,t),[r.memoizedState,t]},useRef:function(t){var e=Cn();return t={current:t},e.memoizedState=t},useState:Sw,useDebugValue:Xg,useDeferredValue:function(t){return Cn().memoizedState=t},useTransition:function(){var t=Sw(!1),e=t[0];return t=MR.bind(null,t[1]),Cn().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=Te,i=Cn();if(ke){if(n===void 0)throw Error(R(407));n=n()}else{if(n=e(),Ke===null)throw Error(R(349));(Ti&30)!==0||Yx(r,e,n)}i.memoizedState=n;var o={value:n,getSnapshot:e};return i.queue=o,bw(Qx.bind(null,r,o,t),[t]),r.flags|=2048,Ba(9,Xx.bind(null,r,o,n,e),void 0,null),n},useId:function(){var t=Cn(),e=Ke.identifierPrefix;if(ke){var n=Qn,r=Xn;n=(r&~(1<<32-dn(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=$a++,0<n&&(e+="H"+n.toString(32)),e+=":"}else n=LR++,e=":"+e+"r"+n.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},BR={readContext:Zt,useCallback:sS,useContext:Zt,useEffect:Yg,useImperativeHandle:oS,useInsertionEffect:nS,useLayoutEffect:rS,useMemo:aS,useReducer:Sh,useRef:tS,useState:function(){return Sh(Da)},useDebugValue:Xg,useDeferredValue:function(t){var e=Yt();return lS(e,je.memoizedState,t)},useTransition:function(){var t=Sh(Da)[0],e=Yt().memoizedState;return[t,e]},useMutableSource:Gx,useSyncExternalStore:Zx,useId:cS,unstable_isNewReconciler:!1},VR={readContext:Zt,useCallback:sS,useContext:Zt,useEffect:Yg,useImperativeHandle:oS,useInsertionEffect:nS,useLayoutEffect:rS,useMemo:aS,useReducer:bh,useRef:tS,useState:function(){return bh(Da)},useDebugValue:Xg,useDeferredValue:function(t){var e=Yt();return je===null?e.memoizedState=t:lS(e,je.memoizedState,t)},useTransition:function(){var t=bh(Da)[0],e=Yt().memoizedState;return[t,e]},useMutableSource:Gx,useSyncExternalStore:Zx,useId:cS,unstable_isNewReconciler:!1};function ln(t,e){if(t&&t.defaultProps){e=Re({},e),t=t.defaultProps;for(var n in t)e[n]===void 0&&(e[n]=t[n]);return e}return e}function ig(t,e,n,r){e=t.memoizedState,n=n(r,e),n=n==null?e:Re({},e,n),t.memoizedState=n,t.lanes===0&&(t.updateQueue.baseState=n)}var Pu={isMounted:function(t){return(t=t._reactInternals)?Oi(t)===t:!1},enqueueSetState:function(t,e,n){t=t._reactInternals;var r=ht(),i=Wr(t),o=Jn(r,i);o.payload=e,n!=null&&(o.callback=n),e=jr(t,o,i),e!==null&&(fn(e,t,i,r),Kc(e,t,i))},enqueueReplaceState:function(t,e,n){t=t._reactInternals;var r=ht(),i=Wr(t),o=Jn(r,i);o.tag=1,o.payload=e,n!=null&&(o.callback=n),e=jr(t,o,i),e!==null&&(fn(e,t,i,r),Kc(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var n=ht(),r=Wr(t),i=Jn(n,r);i.tag=2,e!=null&&(i.callback=e),e=jr(t,i,r),e!==null&&(fn(e,t,r,n),Kc(e,t,r))}};function kw(t,e,n,r,i,o,s){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,o,s):e.prototype&&e.prototype.isPureReactComponent?!Pa(n,r)||!Pa(i,o):!0}function pS(t,e,n){var r=!1,i=Gr,o=e.contextType;return typeof o=="object"&&o!==null?o=Zt(o):(i=Ct(e)?Ci:at.current,r=e.contextTypes,o=(r=r!=null)?qo(t,i):Gr),e=new e(n,o),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Pu,t.stateNode=e,e._reactInternals=t,r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=o),e}function Ew(t,e,n,r){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(n,r),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(n,r),e.state!==t&&Pu.enqueueReplaceState(e,e.state,null)}function og(t,e,n,r){var i=t.stateNode;i.props=n,i.state=t.memoizedState,i.refs={},jg(t);var o=e.contextType;typeof o=="object"&&o!==null?i.context=Zt(o):(o=Ct(e)?Ci:at.current,i.context=qo(t,o)),i.state=t.memoizedState,o=e.getDerivedStateFromProps,typeof o=="function"&&(ig(t,e,o,n),i.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(e=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),e!==i.state&&Pu.enqueueReplaceState(i,i.state,null),gu(t,n,i,r),i.state=t.memoizedState),typeof i.componentDidMount=="function"&&(t.flags|=4194308)}function Yo(t,e){try{var n="",r=e;do n+=mT(r),r=r.return;while(r);var i=n}catch(o){i=`
|
|
7
7
|
Error generating stack: `+o.message+`
|
|
8
|
-
`+o.stack}return{value:t,source:e,stack:i,digest:null}}function kh(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function sg(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var HT=typeof WeakMap=="function"?WeakMap:Map;function pS(t,e,n){n=er(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){_u||(_u=!0,mg=r),sg(t,e)},n}function hS(t,e,n){n=er(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){sg(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){sg(t,e),typeof r!="function"&&(Wr===null?Wr=new Set([this]):Wr.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function Ew(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new HT;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=nP.bind(null,t,e,n),e.then(t,t))}function Cw(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Aw(t,e,n,r,i){return(t.mode&1)===0?(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=er(-1,1),e.tag=2,Ur(n,e,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=i,t)}var jT=or.ReactCurrentOwner,kt=!1;function pt(t,e,n,r){e.child=t===null?jx(e,null,n,r):Yo(e,t.child,n,r)}function Rw(t,e,n,r,i){n=n.render;var o=e.ref;return Wo(e,i),r=Gg(t,e,n,r,o,i),n=Zg(),t!==null&&!kt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ir(t,e,i)):(ke&&n&&Fg(e),e.flags|=1,pt(t,e,r,i),e.child)}function Tw(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!om(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,gS(t,e,o,r,i)):(t=Qc(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,(t.lanes&i)===0){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:Oa,n(s,r)&&t.ref===e.ref)return ir(t,e,i)}return e.flags|=1,t=Kr(o,r),t.ref=e.ref,t.return=e,e.child=t}function gS(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(Oa(o,r)&&t.ref===e.ref)if(kt=!1,e.pendingProps=r=o,(t.lanes&i)!==0)(t.flags&131072)!==0&&(kt=!0);else return e.lanes=t.lanes,ir(t,e,i)}return ag(t,e,n,r,i)}function mS(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if((e.mode&1)===0)e.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(Vo,Nt),Nt|=n;else{if((n&1073741824)===0)return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,me(Vo,Nt),Nt|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,me(Vo,Nt),Nt|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,me(Vo,Nt),Nt|=r;return pt(t,e,i,n),e.child}function vS(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function ag(t,e,n,r,i){var o=Ct(n)?Ri:at.current;return o=Go(e,o),Wo(e,i),n=Gg(t,e,n,r,o,i),r=Zg(),t!==null&&!kt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,ir(t,e,i)):(ke&&r&&Fg(e),e.flags|=1,pt(t,e,n,i),e.child)}function Pw(t,e,n,r,i){if(Ct(n)){var o=!0;cu(e)}else o=!1;if(Wo(e,i),e.stateNode===null)Zc(t,e),fS(e,n,r),og(e,n,r,i),r=!0;else if(t===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Zt(c):(c=Ct(n)?Ri:at.current,c=Go(e,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&kw(e,s,r,c),Mr=!1;var h=e.memoizedState;s.state=h,hu(e,r,s,i),l=e.memoizedState,a!==r||h!==l||Et.current||Mr?(typeof u=="function"&&(ig(e,n,u,r),l=e.memoizedState),(a=Mr||bw(e,n,a,r,h,l,c))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,Wx(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:ln(e.type,a),s.props=c,f=e.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Zt(l):(l=Ct(n)?Ri:at.current,l=Go(e,l));var g=n.getDerivedStateFromProps;(u=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||h!==l)&&kw(e,s,r,l),Mr=!1,h=e.memoizedState,s.state=h,hu(e,r,s,i);var v=e.memoizedState;a!==f||h!==v||Et.current||Mr?(typeof g=="function"&&(ig(e,n,g,r),v=e.memoizedState),(c=Mr||bw(e,n,c,r,h,v,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=v),s.props=r,s.state=v,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return lg(t,e,n,r,o,i)}function lg(t,e,n,r,i,o){vS(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return i&&gw(e,n,!1),ir(t,e,o);r=e.stateNode,jT.current=e;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=Yo(e,t.child,null,o),e.child=Yo(e,null,a,o)):pt(t,e,a,o),e.memoizedState=r.state,i&&gw(e,n,!0),e.child}function yS(t){var e=t.stateNode;e.pendingContext?hw(t,e.pendingContext,e.pendingContext!==e.context):e.context&&hw(t,e.context,!1),Ug(t,e.containerInfo)}function Iw(t,e,n,r,i){return Zo(),Dg(i),e.flags|=256,pt(t,e,n,r),e.child}var cg={dehydrated:null,treeContext:null,retryLane:0};function ug(t){return{baseLanes:t,cachePool:null,transitions:null}}function _S(t,e,n){var r=e.pendingProps,i=Ae.current,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),me(Ae,i&1),t===null)return ng(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((e.mode&1)===0?e.lanes=1:t.data==="$!"?e.lanes=8:e.lanes=1073741824,null):(s=r.children,t=r.fallback,o?(r=e.mode,o=e.child,s={mode:"hidden",children:s},(r&1)===0&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Nu(s,r,0,null),t=Ai(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=ug(n),e.memoizedState=cg,t):Qg(e,s));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return UT(t,e,s,r,a,i,n);if(o){o=r.fallback,s=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=Kr(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=Kr(a,o):(o=Ai(o,s,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,s=t.child.memoizedState,s=s===null?ug(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=t.childLanes&~n,e.memoizedState=cg,r}return o=t.child,t=o.sibling,r=Kr(o,{mode:"visible",children:r.children}),(e.mode&1)===0&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Qg(t,e){return e=Nu({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Vc(t,e,n,r){return r!==null&&Dg(r),Yo(e,t.child,null,n),t=Qg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function UT(t,e,n,r,i,o,s){if(n)return e.flags&256?(e.flags&=-257,r=kh(Error(T(422))),Vc(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=Nu({mode:"visible",children:r.children},i,0,null),o=Ai(o,i,s,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,(e.mode&1)!==0&&Yo(e,t.child,null,s),e.child.memoizedState=ug(s),e.memoizedState=cg,o);if((e.mode&1)===0)return Vc(t,e,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(T(419)),r=kh(o,r,void 0),Vc(t,e,s,r)}if(a=(s&t.childLanes)!==0,kt||a){if(r=Ke,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=(i&(r.suspendedLanes|s))!==0?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,rr(t,i),fn(r,t,i,-1))}return im(),r=kh(Error(T(421))),Vc(t,e,s,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=rP.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Lt=jr(i.nextSibling),Mt=e,ke=!0,un=null,t!==null&&(Wt[qt++]=Qn,Wt[qt++]=Jn,Wt[qt++]=Ti,Qn=t.id,Jn=t.overflow,Ti=e),e=Qg(e,r.children),e.flags|=4096,e)}function Ow(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),rg(t.return,e,n)}function Eh(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function wS(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(pt(t,e,r.children,n),r=Ae.current,(r&2)!==0)r=r&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Ow(t,n,e);else if(t.tag===19)Ow(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(me(Ae,r),(e.mode&1)===0)e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&gu(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Eh(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&gu(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Eh(e,!0,n,null,o);break;case"together":Eh(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Zc(t,e){(e.mode&1)===0&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function ir(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Ii|=e.lanes,(n&e.childLanes)===0)return null;if(t!==null&&e.child!==t.child)throw Error(T(153));if(e.child!==null){for(t=e.child,n=Kr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=Kr(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function WT(t,e,n){switch(e.tag){case 3:yS(e),Zo();break;case 5:qx(e);break;case 1:Ct(e.type)&&cu(e);break;case 4:Ug(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;me(fu,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(me(Ae,Ae.current&1),e.flags|=128,null):(n&e.child.childLanes)!==0?_S(t,e,n):(me(Ae,Ae.current&1),t=ir(t,e,n),t!==null?t.sibling:null);me(Ae,Ae.current&1);break;case 19:if(r=(n&e.childLanes)!==0,(t.flags&128)!==0){if(r)return wS(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),me(Ae,Ae.current),r)break;return null;case 22:case 23:return e.lanes=0,mS(t,e,n)}return ir(t,e,n)}var xS,dg,SS,bS;xS=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};dg=function(){};SS=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,Ei(Pn.current);var o=null;switch(n){case"input":i=Nh(t,i),r=Nh(t,r),o=[];break;case"select":i=Te({},i,{value:void 0}),r=Te({},r,{value:void 0}),o=[];break;case"textarea":i=Fh(t,i),r=Fh(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=au)}Dh(n,r);var s;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Ea.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(a=i?.[c],r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Ea.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&_e("scroll",t),o||a===l||(o=[])):(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};bS=function(t,e,n,r){n!==r&&(e.flags|=4)};function ca(t,e){if(!ke)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function ot(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function qT(t,e,n){var r=e.pendingProps;switch($g(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(e),null;case 1:return Ct(e.type)&&lu(),ot(e),null;case 3:return r=e.stateNode,Xo(),we(Et),we(at),qg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Dc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,un!==null&&(_g(un),un=null))),dg(t,e),ot(e),null;case 5:Wg(e);var i=Ei($a.current);if(n=e.type,t!==null&&e.stateNode!=null)SS(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(T(166));return ot(e),null}if(t=Ei(Pn.current),Dc(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[Rn]=e,r[Ma]=o,t=(e.mode&1)!==0,n){case"dialog":_e("cancel",r),_e("close",r);break;case"iframe":case"object":case"embed":_e("load",r);break;case"video":case"audio":for(i=0;i<ga.length;i++)_e(ga[i],r);break;case"source":_e("error",r);break;case"img":case"image":case"link":_e("error",r),_e("load",r);break;case"details":_e("toggle",r);break;case"input":V0(r,o),_e("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},_e("invalid",r);break;case"textarea":H0(r,o),_e("invalid",r)}Dh(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&$c(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&$c(r.textContent,a,t),i=["children",""+a]):Ea.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&_e("scroll",r)}switch(n){case"input":Ec(r),z0(r,o,!0);break;case"textarea":Ec(r),j0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=au)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Xw(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[Rn]=e,t[Ma]=r,xS(t,e,!1,!1),e.stateNode=t;e:{switch(s=Bh(n,r),n){case"dialog":_e("cancel",t),_e("close",t),i=r;break;case"iframe":case"object":case"embed":_e("load",t),i=r;break;case"video":case"audio":for(i=0;i<ga.length;i++)_e(ga[i],t);i=r;break;case"source":_e("error",t),i=r;break;case"img":case"image":case"link":_e("error",t),_e("load",t),i=r;break;case"details":_e("toggle",t),i=r;break;case"input":V0(t,r),i=Nh(t,r),_e("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Te({},r,{value:void 0}),_e("invalid",t);break;case"textarea":H0(t,r),i=Fh(t,r),_e("invalid",t);break;default:i=r}Dh(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?ex(t,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Qw(t,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ca(t,l):typeof l=="number"&&Ca(t,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(Ea.hasOwnProperty(o)?l!=null&&o==="onScroll"&&_e("scroll",t):l!=null&&Sg(t,o,l,s))}switch(n){case"input":Ec(t),z0(t,r,!1);break;case"textarea":Ec(t),j0(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Gr(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?zo(t,!!r.multiple,o,!1):r.defaultValue!=null&&zo(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=au)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return ot(e),null;case 6:if(t&&e.stateNode!=null)bS(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(T(166));if(n=Ei($a.current),Ei(Pn.current),Dc(e)){if(r=e.stateNode,n=e.memoizedProps,r[Rn]=e,(o=r.nodeValue!==n)&&(t=Mt,t!==null))switch(t.tag){case 3:$c(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&$c(r.nodeValue,n,(t.mode&1)!==0)}o&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Rn]=e,e.stateNode=r}return ot(e),null;case 13:if(we(Ae),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ke&&Lt!==null&&(e.mode&1)!==0&&(e.flags&128)===0)zx(),Zo(),e.flags|=98560,o=!1;else if(o=Dc(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(T(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(T(317));o[Rn]=e}else Zo(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;ot(e),o=!1}else un!==null&&(_g(un),un=null),o=!0;if(!o)return e.flags&65536?e:null}return(e.flags&128)!==0?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,(e.mode&1)!==0&&(t===null||(Ae.current&1)!==0?Ue===0&&(Ue=3):im())),e.updateQueue!==null&&(e.flags|=4),ot(e),null);case 4:return Xo(),dg(t,e),t===null&&Na(e.stateNode.containerInfo),ot(e),null;case 10:return zg(e.type._context),ot(e),null;case 17:return Ct(e.type)&&lu(),ot(e),null;case 19:if(we(Ae),o=e.memoizedState,o===null)return ot(e),null;if(r=(e.flags&128)!==0,s=o.rendering,s===null)if(r)ca(o,!1);else{if(Ue!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=gu(t),s!==null){for(e.flags|=128,ca(o,!1),r=s.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,t=s.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return me(Ae,Ae.current&1|2),e.child}t=t.sibling}o.tail!==null&&Fe()>Jo&&(e.flags|=128,r=!0,ca(o,!1),e.lanes=4194304)}else{if(!r)if(t=gu(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),ca(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ke)return ot(e),null}else 2*Fe()-o.renderingStartTime>Jo&&n!==1073741824&&(e.flags|=128,r=!0,ca(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Fe(),e.sibling=null,n=Ae.current,me(Ae,r?n&1|2:n&1),e):(ot(e),null);case 22:case 23:return rm(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&(e.mode&1)!==0?(Nt&1073741824)!==0&&(ot(e),e.subtreeFlags&6&&(e.flags|=8192)):ot(e),null;case 24:return null;case 25:return null}throw Error(T(156,e.tag))}function KT(t,e){switch($g(e),e.tag){case 1:return Ct(e.type)&&lu(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Xo(),we(Et),we(at),qg(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 5:return Wg(e),null;case 13:if(we(Ae),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(T(340));Zo()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return we(Ae),null;case 4:return Xo(),null;case 10:return zg(e.type._context),null;case 22:case 23:return rm(),null;case 24:return null;default:return null}}var zc=!1,st=!1,GT=typeof WeakSet=="function"?WeakSet:Set,$=null;function Bo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Pe(t,e,r)}else n.current=null}function fg(t,e,n){try{n()}catch(r){Pe(t,e,r)}}var Nw=!1;function ZT(t,e){if(Zh=iu,t=Rx(),Mg(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var g;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===t)break t;if(h===n&&++c===i&&(a=s),h===o&&++u===r&&(l=s),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yh={focusedElem:t,selectionRange:n},iu=!1,$=e;$!==null;)if(e=$,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,$=t;else for(;$!==null;){e=$;try{var v=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var _=v.memoizedProps,x=v.memoizedState,d=e.stateNode,p=d.getSnapshotBeforeUpdate(e.elementType===e.type?_:ln(e.type,_),x);d.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var m=e.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(T(163))}}catch(y){Pe(e,e.return,y)}if(t=e.sibling,t!==null){t.return=e.return,$=t;break}$=e.return}return v=Nw,Nw=!1,v}function Sa(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&fg(e,n,o)}i=i.next}while(i!==r)}}function Iu(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function pg(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function kS(t){var e=t.alternate;e!==null&&(t.alternate=null,kS(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Rn],delete e[Ma],delete e[Jh],delete e[IT],delete e[OT])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function ES(t){return t.tag===5||t.tag===3||t.tag===4}function Lw(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||ES(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function hg(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=au));else if(r!==4&&(t=t.child,t!==null))for(hg(t,e,n),t=t.sibling;t!==null;)hg(t,e,n),t=t.sibling}function gg(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(gg(t,e,n),t=t.sibling;t!==null;)gg(t,e,n),t=t.sibling}var Qe=null,cn=!1;function Nr(t,e,n){for(n=n.child;n!==null;)CS(t,e,n),n=n.sibling}function CS(t,e,n){if(Tn&&typeof Tn.onCommitFiberUnmount=="function")try{Tn.onCommitFiberUnmount(bu,n)}catch{}switch(n.tag){case 5:st||Bo(n,e);case 6:var r=Qe,i=cn;Qe=null,Nr(t,e,n),Qe=r,cn=i,Qe!==null&&(cn?(t=Qe,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Qe.removeChild(n.stateNode));break;case 18:Qe!==null&&(cn?(t=Qe,n=n.stateNode,t.nodeType===8?yh(t.parentNode,n):t.nodeType===1&&yh(t,n),Pa(t)):yh(Qe,n.stateNode));break;case 4:r=Qe,i=cn,Qe=n.stateNode.containerInfo,cn=!0,Nr(t,e,n),Qe=r,cn=i;break;case 0:case 11:case 14:case 15:if(!st&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&((o&2)!==0||(o&4)!==0)&&fg(n,e,s),i=i.next}while(i!==r)}Nr(t,e,n);break;case 1:if(!st&&(Bo(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Pe(n,e,a)}Nr(t,e,n);break;case 21:Nr(t,e,n);break;case 22:n.mode&1?(st=(r=st)||n.memoizedState!==null,Nr(t,e,n),st=r):Nr(t,e,n);break;default:Nr(t,e,n)}}function Mw(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new GT),e.forEach(function(r){var i=iP.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function an(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=t,s=e,a=s;e:for(;a!==null;){switch(a.tag){case 5:Qe=a.stateNode,cn=!1;break e;case 3:Qe=a.stateNode.containerInfo,cn=!0;break e;case 4:Qe=a.stateNode.containerInfo,cn=!0;break e}a=a.return}if(Qe===null)throw Error(T(160));CS(o,s,i),Qe=null,cn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Pe(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)AS(e,t),e=e.sibling}function AS(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(an(e,t),Cn(t),r&4){try{Sa(3,t,t.return),Iu(3,t)}catch(_){Pe(t,t.return,_)}try{Sa(5,t,t.return)}catch(_){Pe(t,t.return,_)}}break;case 1:an(e,t),Cn(t),r&512&&n!==null&&Bo(n,n.return);break;case 5:if(an(e,t),Cn(t),r&512&&n!==null&&Bo(n,n.return),t.flags&32){var i=t.stateNode;try{Ca(i,"")}catch(_){Pe(t,t.return,_)}}if(r&4&&(i=t.stateNode,i!=null)){var o=t.memoizedProps,s=n!==null?n.memoizedProps:o,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&Zw(i,o),Bh(a,s);var c=Bh(a,o);for(s=0;s<l.length;s+=2){var u=l[s],f=l[s+1];u==="style"?ex(i,f):u==="dangerouslySetInnerHTML"?Qw(i,f):u==="children"?Ca(i,f):Sg(i,u,f,c)}switch(a){case"input":Lh(i,o);break;case"textarea":Yw(i,o);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var g=o.value;g!=null?zo(i,!!o.multiple,g,!1):h!==!!o.multiple&&(o.defaultValue!=null?zo(i,!!o.multiple,o.defaultValue,!0):zo(i,!!o.multiple,o.multiple?[]:"",!1))}i[Ma]=o}catch(_){Pe(t,t.return,_)}}break;case 6:if(an(e,t),Cn(t),r&4){if(t.stateNode===null)throw Error(T(162));i=t.stateNode,o=t.memoizedProps;try{i.nodeValue=o}catch(_){Pe(t,t.return,_)}}break;case 3:if(an(e,t),Cn(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Pa(e.containerInfo)}catch(_){Pe(t,t.return,_)}break;case 4:an(e,t),Cn(t);break;case 13:an(e,t),Cn(t),i=t.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(tm=Fe())),r&4&&Mw(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(st=(c=st)||u,an(e,t),st=c):an(e,t),Cn(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!u&&(t.mode&1)!==0)for($=t,u=t.child;u!==null;){for(f=$=u;$!==null;){switch(h=$,g=h.child,h.tag){case 0:case 11:case 14:case 15:Sa(4,h,h.return);break;case 1:Bo(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{e=r,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(_){Pe(r,n,_)}}break;case 5:Bo(h,h.return);break;case 22:if(h.memoizedState!==null){$w(f);continue}}g!==null?(g.return=h,$=g):$w(f)}u=u.sibling}e:for(u=null,f=t;;){if(f.tag===5){if(u===null){u=f;try{i=f.stateNode,c?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Jw("display",s))}catch(_){Pe(t,t.return,_)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(_){Pe(t,t.return,_)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:an(e,t),Cn(t),r&4&&Mw(t);break;case 21:break;default:an(e,t),Cn(t)}}function Cn(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(ES(n)){var r=n;break e}n=n.return}throw Error(T(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ca(i,""),r.flags&=-33);var o=Lw(t);gg(t,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=Lw(t);hg(t,a,s);break;default:throw Error(T(161))}}catch(l){Pe(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function YT(t,e,n){$=t,RS(t,e,n)}function RS(t,e,n){for(var r=(t.mode&1)!==0;$!==null;){var i=$,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||zc;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||st;a=zc;var c=st;if(zc=s,(st=l)&&!c)for($=i;$!==null;)s=$,l=s.child,s.tag===22&&s.memoizedState!==null?Dw(i):l!==null?(l.return=s,$=l):Dw(i);for(;o!==null;)$=o,RS(o,e,n),o=o.sibling;$=i,zc=a,st=c}Fw(t,e,n)}else(i.subtreeFlags&8772)!==0&&o!==null?(o.return=i,$=o):Fw(t,e,n)}}function Fw(t){for(;$!==null;){var e=$;if((e.flags&8772)!==0){var n=e.alternate;try{if((e.flags&8772)!==0)switch(e.tag){case 0:case 11:case 15:st||Iu(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!st)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:ln(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&ww(e,o,r);break;case 3:var s=e.updateQueue;if(s!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}ww(e,s,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Pa(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(T(163))}st||e.flags&512&&pg(e)}catch(h){Pe(e,e.return,h)}}if(e===t){$=null;break}if(n=e.sibling,n!==null){n.return=e.return,$=n;break}$=e.return}}function $w(t){for(;$!==null;){var e=$;if(e===t){$=null;break}var n=e.sibling;if(n!==null){n.return=e.return,$=n;break}$=e.return}}function Dw(t){for(;$!==null;){var e=$;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Iu(4,e)}catch(l){Pe(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){Pe(e,i,l)}}var o=e.return;try{pg(e)}catch(l){Pe(e,o,l)}break;case 5:var s=e.return;try{pg(e)}catch(l){Pe(e,s,l)}}}catch(l){Pe(e,e.return,l)}if(e===t){$=null;break}var a=e.sibling;if(a!==null){a.return=e.return,$=a;break}$=e.return}}var XT=Math.ceil,yu=or.ReactCurrentDispatcher,Jg=or.ReactCurrentOwner,Gt=or.ReactCurrentBatchConfig,se=0,Ke=null,Be=null,Je=0,Nt=0,Vo=Xr(0),Ue=0,za=null,Ii=0,Ou=0,em=0,ba=null,bt=null,tm=0,Jo=1/0,Yn=null,_u=!1,mg=null,Wr=null,Hc=!1,Br=null,wu=0,ka=0,vg=null,Yc=-1,Xc=0;function ht(){return(se&6)!==0?Fe():Yc!==-1?Yc:Yc=Fe()}function qr(t){return(t.mode&1)===0?1:(se&2)!==0&&Je!==0?Je&-Je:LT.transition!==null?(Xc===0&&(Xc=fx()),Xc):(t=ue,t!==0||(t=window.event,t=t===void 0?16:_x(t.type)),t)}function fn(t,e,n,r){if(50<ka)throw ka=0,vg=null,Error(T(185));Ha(t,n,r),((se&2)===0||t!==Ke)&&(t===Ke&&((se&2)===0&&(Ou|=n),Ue===4&&$r(t,Je)),At(t,r),n===1&&se===0&&(e.mode&1)===0&&(Jo=Fe()+500,Ru&&Qr()))}function At(t,e){var n=t.callbackNode;FR(t,e);var r=ru(t,t===Ke?Je:0);if(r===0)n!==null&&q0(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&q0(n),e===1)t.tag===0?NT(Bw.bind(null,t)):Dx(Bw.bind(null,t)),TT(function(){(se&6)===0&&Qr()}),n=null;else{switch(px(r)){case 1:n=Ag;break;case 4:n=ux;break;case 16:n=nu;break;case 536870912:n=dx;break;default:n=nu}n=FS(n,TS.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function TS(t,e){if(Yc=-1,Xc=0,(se&6)!==0)throw Error(T(327));var n=t.callbackNode;if(qo()&&t.callbackNode!==n)return null;var r=ru(t,t===Ke?Je:0);if(r===0)return null;if((r&30)!==0||(r&t.expiredLanes)!==0||e)e=xu(t,r);else{e=r;var i=se;se|=2;var o=IS();(Ke!==t||Je!==e)&&(Yn=null,Jo=Fe()+500,Ci(t,e));do try{eP();break}catch(a){PS(t,a)}while(!0);Vg(),yu.current=o,se=i,Be!==null?e=0:(Ke=null,Je=0,e=Ue)}if(e!==0){if(e===2&&(i=Uh(t),i!==0&&(r=i,e=yg(t,i))),e===1)throw n=za,Ci(t,0),$r(t,r),At(t,Fe()),n;if(e===6)$r(t,r);else{if(i=t.current.alternate,(r&30)===0&&!QT(i)&&(e=xu(t,r),e===2&&(o=Uh(t),o!==0&&(r=o,e=yg(t,o))),e===1))throw n=za,Ci(t,0),$r(t,r),At(t,Fe()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(T(345));case 2:Si(t,bt,Yn);break;case 3:if($r(t,r),(r&130023424)===r&&(e=tm+500-Fe(),10<e)){if(ru(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){ht(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Qh(Si.bind(null,t,bt,Yn),e);break}Si(t,bt,Yn);break;case 4:if($r(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var s=31-dn(r);o=1<<s,s=e[s],s>i&&(i=s),r&=~o}if(r=i,r=Fe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*XT(r/1960))-r,10<r){t.timeoutHandle=Qh(Si.bind(null,t,bt,Yn),r);break}Si(t,bt,Yn);break;case 5:Si(t,bt,Yn);break;default:throw Error(T(329))}}}return At(t,Fe()),t.callbackNode===n?TS.bind(null,t):null}function yg(t,e){var n=ba;return t.current.memoizedState.isDehydrated&&(Ci(t,e).flags|=256),t=xu(t,e),t!==2&&(e=bt,bt=n,e!==null&&_g(e)),t}function _g(t){bt===null?bt=t:bt.push.apply(bt,t)}function QT(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!pn(o(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function $r(t,e){for(e&=~em,e&=~Ou,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-dn(e),r=1<<n;t[n]=-1,e&=~r}}function Bw(t){if((se&6)!==0)throw Error(T(327));qo();var e=ru(t,0);if((e&1)===0)return At(t,Fe()),null;var n=xu(t,e);if(t.tag!==0&&n===2){var r=Uh(t);r!==0&&(e=r,n=yg(t,r))}if(n===1)throw n=za,Ci(t,0),$r(t,e),At(t,Fe()),n;if(n===6)throw Error(T(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,Si(t,bt,Yn),At(t,Fe()),null}function nm(t,e){var n=se;se|=1;try{return t(e)}finally{se=n,se===0&&(Jo=Fe()+500,Ru&&Qr())}}function Oi(t){Br!==null&&Br.tag===0&&(se&6)===0&&qo();var e=se;se|=1;var n=Gt.transition,r=ue;try{if(Gt.transition=null,ue=1,t)return t()}finally{ue=r,Gt.transition=n,se=e,(se&6)===0&&Qr()}}function rm(){Nt=Vo.current,we(Vo)}function Ci(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,RT(n)),Be!==null)for(n=Be.return;n!==null;){var r=n;switch($g(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&lu();break;case 3:Xo(),we(Et),we(at),qg();break;case 5:Wg(r);break;case 4:Xo();break;case 13:we(Ae);break;case 19:we(Ae);break;case 10:zg(r.type._context);break;case 22:case 23:rm()}n=n.return}if(Ke=t,Be=t=Kr(t.current,null),Je=Nt=e,Ue=0,za=null,em=Ou=Ii=0,bt=ba=null,ki!==null){for(e=0;e<ki.length;e++)if(n=ki[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}ki=null}return t}function PS(t,e){do{var n=Be;try{if(Vg(),Kc.current=vu,mu){for(var r=Re.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}mu=!1}if(Pi=0,qe=je=Re=null,xa=!1,Da=0,Jg.current=null,n===null||n.return===null){Ue=1,za=e,Be=null;break}e:{var o=t,s=n.return,a=n,l=e;if(e=Je,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if((u.mode&1)===0&&(f===0||f===11||f===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var g=Cw(s);if(g!==null){g.flags&=-257,Aw(g,s,a,o,e),g.mode&1&&Ew(o,c,e),e=g,l=c;var v=e.updateQueue;if(v===null){var _=new Set;_.add(l),e.updateQueue=_}else v.add(l);break e}else{if((e&1)===0){Ew(o,c,e),im();break e}l=Error(T(426))}}else if(ke&&a.mode&1){var x=Cw(s);if(x!==null){(x.flags&65536)===0&&(x.flags|=256),Aw(x,s,a,o,e),Dg(Qo(l,a));break e}}o=l=Qo(l,a),Ue!==4&&(Ue=2),ba===null?ba=[o]:ba.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var d=pS(o,l,e);_w(o,d);break e;case 1:a=l;var p=o.type,m=o.stateNode;if((o.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Wr===null||!Wr.has(m)))){o.flags|=65536,e&=-e,o.lanes|=e;var y=hS(o,a,e);_w(o,y);break e}}o=o.return}while(o!==null)}NS(n)}catch(w){e=w,Be===n&&n!==null&&(Be=n=n.return);continue}break}while(!0)}function IS(){var t=yu.current;return yu.current=vu,t===null?vu:t}function im(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Ke===null||(Ii&268435455)===0&&(Ou&268435455)===0||$r(Ke,Je)}function xu(t,e){var n=se;se|=2;var r=IS();(Ke!==t||Je!==e)&&(Yn=null,Ci(t,e));do try{JT();break}catch(i){PS(t,i)}while(!0);if(Vg(),se=n,yu.current=r,Be!==null)throw Error(T(261));return Ke=null,Je=0,Ue}function JT(){for(;Be!==null;)OS(Be)}function eP(){for(;Be!==null&&!AR();)OS(Be)}function OS(t){var e=MS(t.alternate,t,Nt);t.memoizedProps=t.pendingProps,e===null?NS(t):Be=e,Jg.current=null}function NS(t){var e=t;do{var n=e.alternate;if(t=e.return,(e.flags&32768)===0){if(n=qT(n,e,Nt),n!==null){Be=n;return}}else{if(n=KT(n,e),n!==null){n.flags&=32767,Be=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ue=6,Be=null;return}}if(e=e.sibling,e!==null){Be=e;return}Be=e=t}while(e!==null);Ue===0&&(Ue=5)}function Si(t,e,n){var r=ue,i=Gt.transition;try{Gt.transition=null,ue=1,tP(t,e,n,r)}finally{Gt.transition=i,ue=r}return null}function tP(t,e,n,r){do qo();while(Br!==null);if((se&6)!==0)throw Error(T(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(T(177));t.callbackNode=null,t.callbackPriority=0;var o=n.lanes|n.childLanes;if($R(t,o),t===Ke&&(Be=Ke=null,Je=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Hc||(Hc=!0,FS(nu,function(){return qo(),null})),o=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||o){o=Gt.transition,Gt.transition=null;var s=ue;ue=1;var a=se;se|=4,Jg.current=null,ZT(t,n),AS(n,t),bT(Yh),iu=!!Zh,Yh=Zh=null,t.current=n,YT(n,t,i),RR(),se=a,ue=s,Gt.transition=o}else t.current=n;if(Hc&&(Hc=!1,Br=t,wu=i),o=t.pendingLanes,o===0&&(Wr=null),IR(n.stateNode,r),At(t,Fe()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(_u)throw _u=!1,t=mg,mg=null,t;return(wu&1)!==0&&t.tag!==0&&qo(),o=t.pendingLanes,(o&1)!==0?t===vg?ka++:(ka=0,vg=t):ka=0,Qr(),null}function qo(){if(Br!==null){var t=px(wu),e=Gt.transition,n=ue;try{if(Gt.transition=null,ue=16>t?16:t,Br===null)var r=!1;else{if(t=Br,Br=null,wu=0,(se&6)!==0)throw Error(T(331));var i=se;for(se|=4,$=t.current;$!==null;){var o=$,s=o.child;if(($.flags&16)!==0){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for($=c;$!==null;){var u=$;switch(u.tag){case 0:case 11:case 15:Sa(8,u,o)}var f=u.child;if(f!==null)f.return=u,$=f;else for(;$!==null;){u=$;var h=u.sibling,g=u.return;if(kS(u),u===c){$=null;break}if(h!==null){h.return=g,$=h;break}$=g}}}var v=o.alternate;if(v!==null){var _=v.child;if(_!==null){v.child=null;do{var x=_.sibling;_.sibling=null,_=x}while(_!==null)}}$=o}}if((o.subtreeFlags&2064)!==0&&s!==null)s.return=o,$=s;else e:for(;$!==null;){if(o=$,(o.flags&2048)!==0)switch(o.tag){case 0:case 11:case 15:Sa(9,o,o.return)}var d=o.sibling;if(d!==null){d.return=o.return,$=d;break e}$=o.return}}var p=t.current;for($=p;$!==null;){s=$;var m=s.child;if((s.subtreeFlags&2064)!==0&&m!==null)m.return=s,$=m;else e:for(s=p;$!==null;){if(a=$,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:Iu(9,a)}}catch(w){Pe(a,a.return,w)}if(a===s){$=null;break e}var y=a.sibling;if(y!==null){y.return=a.return,$=y;break e}$=a.return}}if(se=i,Qr(),Tn&&typeof Tn.onPostCommitFiberRoot=="function")try{Tn.onPostCommitFiberRoot(bu,t)}catch{}r=!0}return r}finally{ue=n,Gt.transition=e}}return!1}function Vw(t,e,n){e=Qo(n,e),e=pS(t,e,1),t=Ur(t,e,1),e=ht(),t!==null&&(Ha(t,1,e),At(t,e))}function Pe(t,e,n){if(t.tag===3)Vw(t,t,n);else for(;e!==null;){if(e.tag===3){Vw(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Wr===null||!Wr.has(r))){t=Qo(n,t),t=hS(e,t,1),e=Ur(e,t,1),t=ht(),e!==null&&(Ha(e,1,t),At(e,t));break}}e=e.return}}function nP(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=ht(),t.pingedLanes|=t.suspendedLanes&n,Ke===t&&(Je&n)===n&&(Ue===4||Ue===3&&(Je&130023424)===Je&&500>Fe()-tm?Ci(t,0):em|=n),At(t,e)}function LS(t,e){e===0&&((t.mode&1)===0?e=1:(e=Rc,Rc<<=1,(Rc&130023424)===0&&(Rc=4194304)));var n=ht();t=rr(t,e),t!==null&&(Ha(t,e,n),At(t,n))}function rP(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),LS(t,n)}function iP(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(T(314))}r!==null&&r.delete(e),LS(t,n)}var MS;MS=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Et.current)kt=!0;else{if((t.lanes&n)===0&&(e.flags&128)===0)return kt=!1,WT(t,e,n);kt=(t.flags&131072)!==0}else kt=!1,ke&&(e.flags&1048576)!==0&&Bx(e,du,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Zc(t,e),t=e.pendingProps;var i=Go(e,at.current);Wo(e,n),i=Gg(null,e,r,t,i,n);var o=Zg();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ct(r)?(o=!0,cu(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,jg(e),i.updater=Pu,e.stateNode=i,i._reactInternals=e,og(e,r,t,n),e=lg(null,e,r,!0,o,n)):(e.tag=0,ke&&o&&Fg(e),pt(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Zc(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=sP(r),t=ln(r,t),i){case 0:e=ag(null,e,r,t,n);break e;case 1:e=Pw(null,e,r,t,n);break e;case 11:e=Rw(null,e,r,t,n);break e;case 14:e=Tw(null,e,r,ln(r.type,t),n);break e}throw Error(T(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ln(r,i),ag(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ln(r,i),Pw(t,e,r,i,n);case 3:e:{if(yS(e),t===null)throw Error(T(387));r=e.pendingProps,o=e.memoizedState,i=o.element,Wx(t,e),hu(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Qo(Error(T(423)),e),e=Iw(t,e,r,n,i);break e}else if(r!==i){i=Qo(Error(T(424)),e),e=Iw(t,e,r,n,i);break e}else for(Lt=jr(e.stateNode.containerInfo.firstChild),Mt=e,ke=!0,un=null,n=jx(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Zo(),r===i){e=ir(t,e,n);break e}pt(t,e,r,n)}e=e.child}return e;case 5:return qx(e),t===null&&ng(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,Xh(r,i)?s=null:o!==null&&Xh(r,o)&&(e.flags|=32),vS(t,e),pt(t,e,s,n),e.child;case 6:return t===null&&ng(e),null;case 13:return _S(t,e,n);case 4:return Ug(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Yo(e,null,r,n):pt(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ln(r,i),Rw(t,e,r,i,n);case 7:return pt(t,e,e.pendingProps,n),e.child;case 8:return pt(t,e,e.pendingProps.children,n),e.child;case 12:return pt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,me(fu,r._currentValue),r._currentValue=s,o!==null)if(pn(o.value,s)){if(o.children===i.children&&!Et.current){e=ir(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=er(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),rg(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(T(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),rg(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}pt(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,Wo(e,n),i=Zt(i),r=r(i),e.flags|=1,pt(t,e,r,n),e.child;case 14:return r=e.type,i=ln(r,e.pendingProps),i=ln(r.type,i),Tw(t,e,r,i,n);case 15:return gS(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ln(r,i),Zc(t,e),e.tag=1,Ct(r)?(t=!0,cu(e)):t=!1,Wo(e,n),fS(e,r,i),og(e,r,i,n),lg(null,e,r,!0,t,n);case 19:return wS(t,e,n);case 22:return mS(t,e,n)}throw Error(T(156,e.tag))};function FS(t,e){return cx(t,e)}function oP(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(t,e,n,r){return new oP(t,e,n,r)}function om(t){return t=t.prototype,!(!t||!t.isReactComponent)}function sP(t){if(typeof t=="function")return om(t)?1:0;if(t!=null){if(t=t.$$typeof,t===kg)return 11;if(t===Eg)return 14}return 2}function Kr(t,e){var n=t.alternate;return n===null?(n=Kt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Qc(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")om(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Po:return Ai(n.children,i,o,e);case bg:s=8,i|=8;break;case Th:return t=Kt(12,n,e,i|2),t.elementType=Th,t.lanes=o,t;case Ph:return t=Kt(13,n,e,i),t.elementType=Ph,t.lanes=o,t;case Ih:return t=Kt(19,n,e,i),t.elementType=Ih,t.lanes=o,t;case qw:return Nu(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Uw:s=10;break e;case Ww:s=9;break e;case kg:s=11;break e;case Eg:s=14;break e;case Lr:s=16,r=null;break e}throw Error(T(130,t==null?t:typeof t,""))}return e=Kt(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Ai(t,e,n,r){return t=Kt(7,t,r,e),t.lanes=n,t}function Nu(t,e,n,r){return t=Kt(22,t,r,e),t.elementType=qw,t.lanes=n,t.stateNode={isHidden:!1},t}function Ch(t,e,n){return t=Kt(6,t,null,e),t.lanes=n,t}function Ah(t,e,n){return e=Kt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function aP(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=uh(0),this.expirationTimes=uh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function sm(t,e,n,r,i,o,s,a,l){return t=new aP(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Kt(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jg(o),t}function lP(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:To,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function $S(t){if(!t)return Zr;t=t._reactInternals;e:{if(Li(t)!==t||t.tag!==1)throw Error(T(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Ct(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(T(171))}if(t.tag===1){var n=t.type;if(Ct(n))return $x(t,n,e)}return e}function DS(t,e,n,r,i,o,s,a,l){return t=sm(n,r,!0,t,i,o,s,a,l),t.context=$S(null),n=t.current,r=ht(),i=qr(n),o=er(r,i),o.callback=e??null,Ur(n,o,i),t.current.lanes=i,Ha(t,i,r),At(t,r),t}function Lu(t,e,n,r){var i=e.current,o=ht(),s=qr(i);return n=$S(n),e.context===null?e.context=n:e.pendingContext=n,e=er(o,s),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=Ur(i,e,s),t!==null&&(fn(t,i,s,o),qc(t,i,s)),s}function Su(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function zw(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function am(t,e){zw(t,e),(t=t.alternate)&&zw(t,e)}function cP(){return null}var BS=typeof reportError=="function"?reportError:function(t){console.error(t)};function lm(t){this._internalRoot=t}Mu.prototype.render=lm.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(T(409));Lu(t,e,null,null)};Mu.prototype.unmount=lm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Oi(function(){Lu(null,t,null,null)}),e[nr]=null}};function Mu(t){this._internalRoot=t}Mu.prototype.unstable_scheduleHydration=function(t){if(t){var e=mx();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Fr.length&&e!==0&&e<Fr[n].priority;n++);Fr.splice(n,0,t),n===0&&yx(t)}};function cm(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Fu(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Hw(){}function uP(t,e,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var c=Su(s);o.call(c)}}var s=DS(e,r,t,0,null,!1,!1,"",Hw);return t._reactRootContainer=s,t[nr]=s.current,Na(t.nodeType===8?t.parentNode:t),Oi(),s}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=Su(l);a.call(c)}}var l=sm(t,0,!1,null,null,!1,!1,"",Hw);return t._reactRootContainer=l,t[nr]=l.current,Na(t.nodeType===8?t.parentNode:t),Oi(function(){Lu(e,l,n,r)}),l}function $u(t,e,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=Su(s);a.call(l)}}Lu(e,s,t,i)}else s=uP(n,e,t,i,r);return Su(s)}hx=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=ha(e.pendingLanes);n!==0&&(Rg(e,n|1),At(e,Fe()),(se&6)===0&&(Jo=Fe()+500,Qr()))}break;case 13:Oi(function(){var r=rr(t,1);if(r!==null){var i=ht();fn(r,t,1,i)}}),am(t,1)}};Tg=function(t){if(t.tag===13){var e=rr(t,134217728);if(e!==null){var n=ht();fn(e,t,134217728,n)}am(t,134217728)}};gx=function(t){if(t.tag===13){var e=qr(t),n=rr(t,e);if(n!==null){var r=ht();fn(n,t,e,r)}am(t,e)}};mx=function(){return ue};vx=function(t,e){var n=ue;try{return ue=t,e()}finally{ue=n}};zh=function(t,e,n){switch(e){case"input":if(Lh(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=Au(r);if(!i)throw Error(T(90));Gw(r),Lh(r,i)}}}break;case"textarea":Yw(t,n);break;case"select":e=n.value,e!=null&&zo(t,!!n.multiple,e,!1)}};rx=nm;ix=Oi;var dP={usingClientEntryPoint:!1,Events:[Ua,Lo,Au,tx,nx,nm]},ua={findFiberByHostInstance:bi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},fP={bundleType:ua.bundleType,version:ua.version,rendererPackageName:ua.rendererPackageName,rendererConfig:ua.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:or.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=ax(t),t===null?null:t.stateNode},findFiberByHostInstance:ua.findFiberByHostInstance||cP,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(da=__REACT_DEVTOOLS_GLOBAL_HOOK__,!da.isDisabled&&da.supportsFiber))try{bu=da.inject(fP),Tn=da}catch{}var da;Dt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dP;Dt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cm(e))throw Error(T(200));return lP(t,e,null,n)};Dt.createRoot=function(t,e){if(!cm(t))throw Error(T(299));var n=!1,r="",i=BS;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=sm(t,1,!1,null,null,n,!1,r,i),t[nr]=e.current,Na(t.nodeType===8?t.parentNode:t),new lm(e)};Dt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(T(188)):(t=Object.keys(t).join(","),Error(T(268,t)));return t=ax(e),t=t===null?null:t.stateNode,t};Dt.flushSync=function(t){return Oi(t)};Dt.hydrate=function(t,e,n){if(!Fu(e))throw Error(T(200));return $u(null,t,e,!0,n)};Dt.hydrateRoot=function(t,e,n){if(!cm(t))throw Error(T(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=BS;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),e=DS(e,null,t,1,n??null,i,!1,o,s),t[nr]=e.current,Na(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new Mu(e)};Dt.render=function(t,e,n){if(!Fu(e))throw Error(T(200));return $u(null,t,e,!1,n)};Dt.unmountComponentAtNode=function(t){if(!Fu(t))throw Error(T(40));return t._reactRootContainer?(Oi(function(){$u(null,null,t,!1,function(){t._reactRootContainer=null,t[nr]=null})}),!0):!1};Dt.unstable_batchedUpdates=nm;Dt.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!Fu(n))throw Error(T(200));if(t==null||t._reactInternals===void 0)throw Error(T(38));return $u(t,e,n,!1,r)};Dt.version="18.3.1-next-f1338f8080-20240426"});var Du=zn((yL,HS)=>{"use strict";function zS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(zS)}catch(t){console.error(t)}}zS(),HS.exports=VS()});var KS=zn(hm=>{"use strict";var qS=Du();hm.createRoot=qS.createRoot,hm.hydrateRoot=qS.hydrateRoot;var FL});var LO={};hv(LO,{ANIMATION_KEYFRAMES:()=>vs,ActivationConfigZ:()=>ek,AnchorStateZ:()=>Cb,AnchorVisibleConditionZ:()=>Vb,AppRegistry:()=>cl,AugmentationZ:()=>Ab,BoundingBoxZ:()=>Eb,CanvasEvents:()=>on,CanvasRecipeZ:()=>Yu,ConditionZ:()=>Im,ContextManager:()=>Qa,CooldownActiveConditionZ:()=>qb,DecisionStrategyZ:()=>Om,DismissedConditionZ:()=>Wb,EVENT_SCHEMA_VERSION:()=>_i,EventBus:()=>Ja,EventFilterZ:()=>Ib,EventOccurredConditionZ:()=>zb,EventSourceZ:()=>bm,ExecutorRegistry:()=>sl,ExternalStrategyZ:()=>Qb,FrequencyEntryZ:()=>Lb,FrequencyLimitConditionZ:()=>Kb,HighlightStepZ:()=>_b,ModelStrategyZ:()=>Xb,NormalizedEventZ:()=>Pb,PageContextZ:()=>xb,PageHistoryEntryZ:()=>Sb,PageUrlConditionZ:()=>Db,RUNTIME_VERSION:()=>iv,RouteConditionZ:()=>Bb,RouteFilterZ:()=>Jb,RuleStrategyZ:()=>Zb,RuleZ:()=>Gb,RuntimeContextZ:()=>Rb,RuntimeProvider:()=>vc,STATIC_SLOT_STYLES:()=>ev,ScoreStrategyZ:()=>Yb,SelectorZ:()=>xm,SessionContextZ:()=>bb,SessionMetricConditionZ:()=>Ub,SessionMetricTracker:()=>Xa,ShadowCanvasOverlay:()=>dm,SmartCanvasApp:()=>pm,SmartCanvasController:()=>Bu,SmartCanvasElement:()=>zu,SmartCanvasPortal:()=>xP,StandardEvents:()=>be,StateEqualsConditionZ:()=>Hb,StateStore:()=>tl,StoredValueZ:()=>Nb,Syntro:()=>lv,TileCard:()=>Co,TileWheel:()=>gP,TooltipStepZ:()=>yb,ViewportConditionZ:()=>jb,ViewportContextZ:()=>kb,WidgetRegistry:()=>ll,appRegistry:()=>Td,applyStaticSlotStyles:()=>yd,cleanupAppContext:()=>Rd,contentRuntime:()=>lk,createActionEngine:()=>vd,createAppContext:()=>Ad,createAppLoader:()=>Pd,createCanvasConfigFetcher:()=>Mi,createContextManager:()=>Qu,createDecisionEngine:()=>td,createEventBus:()=>ds,createGrowthBookClient:()=>hc,createOverlayRecipeFetcher:()=>DI,createPostHogClient:()=>ql,createPostHogNormalizer:()=>Ju,createSessionMetricTracker:()=>Xu,createSmartCanvas:()=>Uu,createSmartCanvasController:()=>fm,createSmartCanvasRuntime:()=>Id,createStateStore:()=>ed,createSurfaceContainer:()=>bd,createSurfaces:()=>Ed,decodeToken:()=>dl,encodeToken:()=>Od,evaluate:()=>Mm,evaluateCondition:()=>Nm,evaluateRule:()=>Lm,evaluateRuleStrategy:()=>nl,evaluateScoreStrategy:()=>rl,evaluateSync:()=>Fm,executorRegistry:()=>ci,getAntiFlickerSnippet:()=>tb,getAppIdFromActionKind:()=>nv,getAppIdFromWidgetId:()=>rv,getExecutor:()=>Gk,getSlotAnchorId:()=>al,getSlotType:()=>gs,getSlotZIndex:()=>kd,hasExecutor:()=>gd,isCoreActionKind:()=>tv,navigationRuntime:()=>Kk,normalizePostHogEvent:()=>Em,overlaysRuntime:()=>Uk,playEnterAnimation:()=>xd,playExitAnimation:()=>Sd,registerSmartCanvasElement:()=>gm,resolveConfigUri:()=>Vu,setupAdjacentPositioning:()=>_d,setupInlinePositioning:()=>wd,shouldNormalizeEvent:()=>Cm,useDecision:()=>b0,usePageContext:()=>yc,useRuntime:()=>kn,useRuntimeContext:()=>ea,useRuntimeEvents:()=>x0,useRuntimeState:()=>S0,useSessionContext:()=>_0,useShadowCanvasConfig:()=>Up,useViewportContext:()=>w0,validateAction:()=>gr,validateActions:()=>md,validateActivationConfig:()=>YI,validateCondition:()=>GI,validateEventFilter:()=>HI,validateFrequencyEntry:()=>qI,validateNormalizedEvent:()=>zI,validateRecipe:()=>$I,validateRuntimeContext:()=>BI,validateStoredValue:()=>WI,validateStrategy:()=>ZI,widgetRegistry:()=>Cd});var C=typeof window<"u"?window:void 0,Ye=typeof globalThis<"u"?globalThis:C;typeof self>"u"&&(Ye.self=Ye),typeof File>"u"&&(Ye.File=function(){});var fy=Array.prototype,vv=fy.forEach,yv=fy.indexOf,It=Ye?.navigator,N=Ye?.document,_t=Ye?.location,Yd=Ye?.fetch,Xd=Ye!=null&&Ye.XMLHttpRequest&&"withCredentials"in new Ye.XMLHttpRequest?Ye.XMLHttpRequest:void 0,_v=Ye?.AbortController,yt=It?.userAgent,G=C??{},jn={DEBUG:!1,LIB_VERSION:"1.302.2"};function wv(t,e,n,r,i,o,s){try{var a=t[o](s),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(r,i)}function xv(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(l){wv(o,r,i,s,a,"next",l)}function a(l){wv(o,r,i,s,a,"throw",l)}s(void 0)}))}}function F(){return F=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},F.apply(null,arguments)}function py(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var M1=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Sv=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return M1.concat(e).some((r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1}))},F1=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function te(t,e){return t.indexOf(e)!==-1}var jl=function(t){return t.trim()},Qd=function(t){return t.replace(/^\$/,"")},$1=Array.isArray,hy=Object.prototype,gy=hy.hasOwnProperty,Ul=hy.toString,fe=$1||function(t){return Ul.call(t)==="[object Array]"},Er=t=>typeof t=="function",We=t=>t===Object(t)&&!fe(t),lo=t=>{if(We(t)){for(var e in t)if(gy.call(t,e))return!1;return!0}return!1},O=t=>t===void 0,ze=t=>Ul.call(t)=="[object String]",Jd=t=>ze(t)&&t.trim().length===0,Kn=t=>t===null,de=t=>O(t)||Kn(t),xn=t=>Ul.call(t)=="[object Number]",Cr=t=>Ul.call(t)==="[object Boolean]",D1=t=>t instanceof FormData,B1=t=>te(F1,t);function ef(t){return t===null||typeof t!="object"}function Sl(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function my(t){return!O(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var V1=[!0,"true",1,"1","yes"],Md=t=>te(V1,t),z1=[!1,"false",0,"0","no"];function yn(t,e,n,r,i){return e>n&&(r.warn("min cannot be greater than max."),e=n),xn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),yn(i||n,e,n,r))}var tf=class{constructor(e){this.t={},this.i=e.i,this.o=yn(e.bucketSize,0,100,e.h),this.m=yn(e.refillRate,0,this.o,e.h),this.S=yn(e.refillInterval,0,864e5,e.h)}$(e,n){var r=n-e.lastAccess,i=Math.floor(r/this.S);if(i>0){var o=i*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+i*this.S}}consumeRateLimit(e){var n,r=Date.now(),i=String(e),o=this.t[i];return o?this.$(o,r):(o={tokens:this.o,lastAccess:r},this.t[i]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.i)==null||n.call(this,e)),o.tokens===0)}stop(){this.t={}}},fl,bv,Fd,H1=t=>t instanceof Error;function j1(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Fd&&n.length===bv||(bv=n.length,Fd=n.reduce(((r,i)=>{fl||(fl={});var o=fl[i];if(o)r[o[0]]=o[1];else for(var s=t(i),a=s.length-1;a>=0;a--){var l=s[a],c=l?.filename,u=e[i];if(c&&u){r[c]=u,fl[i]=[c,u];break}}return r}),{})),Fd}}var nf=class{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(e),o=this.buildParsingContext(),s=this.parseStacktrace(i,o);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var n=this;return xv((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&fe(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,i;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),F({},e,{cause:r,stack:i})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return xv((function*(){var r=e;for(var i of n.modifiers)r=yield i(r);return r}))()}convertToExceptionList(e,n){var r,i,o,s={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(i=n.handled)===null||i===void 0||i,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var a=[s];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,F({},n,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:j1(this.stackParser)}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var i=(o,s)=>{if(s<=4){var a=this.buildCoercingContext(e,n,s);return this.applyCoercers(o,a)}};return F({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:o=>i(o,r),next:o=>i(o,r+1)})}},po="?";function rf(t,e,n,r,i){var o={platform:t,filename:e,function:n==="<anonymous>"?po:n,in_app:!0};return O(r)||(o.lineno=r),O(i)||(o.colno=i),o}var vy=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:po,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},U1=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,W1=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,q1=/\((\S*)(?::(\d+))(?::(\d+))\)/,K1=(t,e)=>{var n=U1.exec(t);if(n){var[,r,i,o]=n;return rf(e,r,po,+i,+o)}var s=W1.exec(t);if(s){if(s[2]&&s[2].indexOf("eval")===0){var a=q1.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var[l,c]=vy(s[1]||po,s[2]);return rf(e,c,l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},G1=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Z1=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Y1=(t,e)=>{var n=G1.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Z1.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],o=n[1]||po;return[o,i]=vy(o,i),rf(e,i,o,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},kv=/\(error: (.*)\)/,Ev=50;function X1(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(i,o){o===void 0&&(o=0);for(var s=[],a=i.split(`
|
|
9
|
-
`),l=o;l<a.length;l++){var c=a[l];if(!(c.length>1024)){var u=kv.test(c)?c.replace(kv,"$1"):c;if(!u.match(/\S*Error: /)){for(var f of n){var h=f(u,t);if(h){s.push(h);break}}if(s.length>=Ev)break}}}return(function(g){if(!g.length)return[];var v=Array.from(g);return v.reverse(),v.slice(0,Ev).map((_=>{return F({},_,{filename:_.filename||(x=v,x[x.length-1]||{}).filename,function:_.function||po});var x}))})(s)}}var of=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=ze(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return Sl(e,"DOMException")}isDOMError(e){return Sl(e,"DOMError")}},sf=class{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}},af=class{constructor(){}match(e){return Sl(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r,i=n.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},Q1=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,lf=class{match(e){return typeof e=="string"}coerce(e,n){var r,[i,o]=this.getInfos(e);return{type:i??"Error",value:o??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,i=e.match(Q1);return i&&(n=i[1],r=i[2]),[n,r]}},J1=["fatal","error","warning","log","info","debug"];function yy(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length||i.length<=e?i:i.slice(0,e)+"..."}return""}var cf=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return my(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+yy(e)}isSeverityLevel(e){return ze(e)&&!Jd(e)&&J1.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(H1(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},uf=class{match(e){return my(e)}coerce(e,n){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+yy(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},df=class{match(e){return ef(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},ff=class{match(e){return Sl(e,"PromiseRejectionEvent")}coerce(e,n){var r,i=this.getUnhandledRejectionReason(e);return ef(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(e){if(ef(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}},_y=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,r={k:function(i){if(C&&(jn.DEBUG||G.POSTHOG_DEBUG||n)&&!O(C.console)&&C.console){for(var o=("__rrweb_original__"in C.console[i])?C.console[i].__rrweb_original__:C.console[i],s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];o(t,...a)}},info:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("log",...o)},warn:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("warn",...o)},error:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("error",...o)},critical:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];console.error(t,...o)},uninitializedWarning:i=>{r.error("You must initialize PostHog before calling "+i)},createLogger:(i,o)=>_y(t+" "+i,o)};return r},L=_y("[PostHog.js]"),He=L.createLogger,eE=He("[ExternalScriptsLoader]"),Cv=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return eE.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=N?.querySelectorAll("script");if(r){for(var i,o=function(){if(r[s].src===e){var l=r[s];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)})),l.onerror=c=>n(c),{v:void 0})}},s=0;s<r.length;s++)if(i=o())return i.v}var a=()=>{if(!N)return n("document not found");var l=N.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=f=>{l.__posthog_loading_callback_fired=!0,n(void 0,f)},l.onerror=f=>n(f),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var c,u=N.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):N.body.appendChild(l)};N!=null&&N.body?a():N?.addEventListener("DOMContentLoaded",a)};G.__PosthogExtensions__=G.__PosthogExtensions__||{},G.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var i=3e5;r=r+"&t="+Math.floor(Date.now()/i)*i}var o=t.requestRouter.endpointFor("assets",r);Cv(t,o,n)},G.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);Cv(t,r,n)};var bl={};function Ar(t,e,n){if(fe(t)){if(vv&&t.forEach===vv)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===bl)return}}}function pe(t,e,n){if(!de(t)){if(fe(t))return Ar(t,e,n);if(D1(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===bl)return}else for(var i in t)if(gy.call(t,i)&&e.call(n,t[i],i)===bl)return}}var Me=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Ar(n,(function(i){for(var o in i)i[o]!==void 0&&(t[o]=i[o])})),t},mo=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Ar(n,(function(i){Ar(i,(function(o){t.push(o)}))})),t};function _l(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var Av=function(t){try{return t()}catch{return}},tE=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}catch(i){L.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),L.critical(i)}}},ap=function(t){var e={};return pe(t,(function(n,r){(ze(n)&&n.length>0||xn(n))&&(e[r]=n)})),e};function nE(t,e){return n=t,r=o=>ze(o)&&!Kn(e)?o.slice(0,e):o,i=new Set,(function o(s,a){return s!==Object(s)?r?r(s,a):s:i.has(s)?void 0:(i.add(s),fe(s)?(l=[],Ar(s,(c=>{l.push(o(c))}))):(l={},pe(s,((c,u)=>{i.has(c)||(l[u]=o(c,u))}))),l);var l})(n);var n,r,i}var rE=["herokuapp.com","vercel.app","netlify.app"];function iE(t){var e=t?.hostname;if(!ze(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of rE)if(n===r)return!1;return!0}function wy(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function De(t,e,n,r){var{capture:i=!1,passive:o=!0}=r??{};t?.addEventListener(e,n,{capture:i,passive:o})}var xy="$people_distinct_id",Rs="__alias",Ts="__timers",Rv="$autocapture_disabled_server_side",pf="$heatmaps_enabled_server_side",Tv="$exception_capture_enabled_server_side",hf="$error_tracking_suppression_rules",Pv="$error_tracking_capture_extension_exceptions",Iv="$web_vitals_enabled_server_side",Sy="$dead_clicks_enabled_server_side",Ov="$web_vitals_allowed_metrics",$d="$session_recording_remote_config",kl="$sesid",by="$session_is_sampled",co="$enabled_feature_flags",Ps="$early_access_features",gf="$feature_flag_details",Is="$stored_person_properties",pi="$stored_group_properties",mf="$surveys",pl="$surveys_activated",El="$flag_call_reported",Un="$user_state",vf="$client_session_props",yf="$capture_rate_limit",_f="$initial_campaign_params",wf="$initial_referrer_info",Cl="$initial_person_info",Al="$epp",ky="__POSTHOG_TOOLBAR__",_s="$posthog_cookieless",oE=[xy,Rs,"__cmpns",Ts,"$session_recording_enabled_server_side",pf,kl,co,hf,Un,Ps,gf,pi,Is,mf,El,vf,yf,_f,wf,Al,Cl];function Nv(t){return t instanceof Element&&(t.id===ky||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Wl(t){return!!t&&t.nodeType===1}function Rr(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Ey(t){return!!t&&t.nodeType===3}function Cy(t){return!!t&&t.nodeType===11}function lp(t){return t?jl(t).split(/\s+/):[]}function Lv(t){var e=C?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function Rl(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return lp(e)}function Ay(t){return de(t)?null:jl(t).split(/(\s+)/).filter((e=>Ds(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Us(t){var e="";return xf(t)&&!Oy(t)&&t.childNodes&&t.childNodes.length&&pe(t.childNodes,(function(n){var r;Ey(n)&&n.textContent&&(e+=(r=Ay(n.textContent))!==null&&r!==void 0?r:"")})),jl(e)}function Ry(t){return O(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var cp=["a","button","form","input","select","textarea","label"];function Ty(t,e){if(O(e))return!0;var n,r=function(o){if(e.some((s=>o.matches(s))))return{v:!0}};for(var i of t)if(n=r(i))return n.v;return!1}function Py(t){var e=t.parentNode;return!(!e||!Wl(e))&&e}var sE=["next","previous","prev",">","<"],Mv=10,Fv=[".ph-no-rageclick",".ph-no-capture"];function aE(t,e){if(!C||up(t))return!1;var n,r,i;if(Cr(e)?(n=!!e&&Fv,r=void 0):(n=(i=e?.css_selector_ignorelist)!==null&&i!==void 0?i:Fv,r=e?.content_ignorelist),n===!1)return!1;var{targetElementList:o}=Iy(t,!1);return!(function(s,a){if(s===!1||O(s))return!1;var l;if(s===!0)l=sE;else{if(!fe(s))return!1;if(s.length>Mv)return L.error("[PostHog] content_ignorelist array cannot exceed "+Mv+" items. Use css_selector_ignorelist for more complex matching."),!1;l=s.map((c=>c.toLowerCase()))}return a.some((c=>{var{safeText:u,ariaLabel:f}=c;return l.some((h=>u.includes(h)||f.includes(h)))}))})(r,o.map((s=>{var a;return{safeText:Us(s).toLowerCase(),ariaLabel:((a=s.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}})))&&!Ty(o,n)}var up=t=>!t||Rr(t,"html")||!Wl(t),Iy=(t,e)=>{if(!C||up(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],i=t;i.parentNode&&!Rr(i,"body");)if(Cy(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var o=Py(i);if(!o)break;if(e||cp.indexOf(o.tagName.toLowerCase())>-1)n=!0;else{var s=C.getComputedStyle(o);s&&s.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(o),i=o}return{parentIsUsefulElement:n,targetElementList:r}};function lE(t,e,n,r,i){var o,s,a,l;if(n===void 0&&(n=void 0),!C||up(t)||(o=n)!=null&&o.url_allowlist&&!Lv(n.url_allowlist)||(s=n)!=null&&s.url_ignorelist&&Lv(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((v=>e.type===v)))return!1}var{parentIsUsefulElement:u,targetElementList:f}=Iy(t,r);if(!(function(v,_){var x=_?.element_allowlist;if(O(x))return!0;var d,p=function(y){if(x.some((w=>y.tagName.toLowerCase()===w)))return{v:!0}};for(var m of v)if(d=p(m))return d.v;return!1})(f,n)||!Ty(f,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var h=C.getComputedStyle(t);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=t.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(i||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(e.type)>=0;default:return u?(i||["click"]).indexOf(e.type)>=0:(i||["click"]).indexOf(e.type)>=0&&(cp.indexOf(g)>-1||t.getAttribute("contenteditable")==="true")}}function xf(t){for(var e=t;e.parentNode&&!Rr(e,"body");e=e.parentNode){var n=Rl(e);if(te(n,"ph-sensitive")||te(n,"ph-no-capture"))return!1}if(te(Rl(t),"ph-include"))return!0;var r=t.type||"";if(ze(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";return!(ze(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function Oy(t){return!!(Rr(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Rr(t,"select")||Rr(t,"textarea")||t.getAttribute("contenteditable")==="true")}var Ny="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",cE=new RegExp("^(?:"+Ny+")$"),uE=new RegExp(Ny),Ly="\\d{3}-?\\d{2}-?\\d{4}",dE=new RegExp("^("+Ly+")$"),fE=new RegExp("("+Ly+")");function Ds(t,e){return e===void 0&&(e=!0),!(de(t)||ze(t)&&(t=jl(t),(e?cE:uE).test((t||"").replace(/[- ]/g,""))||(e?dE:fE).test(t)))}function My(t){var e=Us(t);return Ds(e=(e+" "+Fy(t)).trim())?e:""}function Fy(t){var e="";return t&&t.childNodes&&t.childNodes.length&&pe(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=Us(n);e=(e+" "+i).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+Fy(n)).trim())}catch(o){L.error("[AutoCapture]",o)}})),e}function pE(t){return(function(e){var n=e.map((r=>{var i,o,s="";if(r.tag_name&&(s+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))s+="."+a.replace(/"/g,"");var l=F({},r.text?{text:r.text}:{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(o=r.nth_of_type)!==null&&o!==void 0?o:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),c={};return _l(l).sort(((u,f)=>{var[h]=u,[g]=f;return h.localeCompare(g)})).forEach((u=>{var[f,h]=u;return c[$v(f.toString())]=$v(h.toString())})),s+=":",s+=_l(c).map((u=>{var[f,h]=u;return f+'="'+h+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var r,i,o={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(i=n.attr__href)==null?void 0:i.slice(0,2048),attr_class:hE(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return _l(n).filter((s=>{var[a]=s;return a.indexOf("attr__")===0})).forEach((s=>{var[a,l]=s;return o.attributes[a]=l})),o}))})(t))}function $v(t){return t.replace(/"|\\"/g,'\\"')}function hE(t){var e=t.attr__class;return e?fe(e)?e:lp(e):void 0}var Tl=class{constructor(e){this.disabled=e===!1;var n=We(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}},Dd="$copy_autocapture",qn=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var Pl=t=>{var e=N?.createElement("a");return O(e)?null:(e.href=t,e)},gE=function(t,e){var n,r;e===void 0&&(e="&");var i=[];return pe(t,(function(o,s){O(o)||O(s)||s==="undefined"||(n=encodeURIComponent((a=>a instanceof File)(o)?o.name:o.toString()),r=encodeURIComponent(s),i[i.length]=r+"="+n)})),i.join(e)},Il=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===e){n=o;break}}if(!fe(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch{L.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},Ws=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[0]||"",o=r[1],s=i.split("?"),a=s[1],l=s[0],c=(a||"").split("&"),u=[],f=0;f<c.length;f++){var h=c[f].split("=");fe(h)&&(e.includes(h[0])?u.push(h[0]+"="+n):u.push(c[f]))}var g=l;return a!=null&&(g+="?"+u.join("&")),o!=null&&(g+="#"+o),g},Ol=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},Dv=He("[AutoCapture]");function Bd(t,e){return e.length>t?e.slice(0,t)+"...":e}function mE(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Wl(e));return e}function vE(t,e,n,r){var i=t.tagName.toLowerCase(),o={tag_name:i};cp.indexOf(i)>-1&&!n&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?o.$el_text=Bd(1024,My(t)):o.$el_text=Bd(1024,Us(t)));var s=Rl(t);s.length>0&&(o.classes=s.filter((function(u){return u!==""}))),pe(t.attributes,(function(u){var f;if((!Oy(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(r==null||!r.includes(u.name))&&!e&&Ds(u.value)&&(f=u.name,!ze(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var h=u.value;u.name==="class"&&(h=lp(h).join(" ")),o["attr__"+u.name]=Bd(1024,h)}}));for(var a=1,l=1,c=t;c=mE(c);)a++,c.tagName===t.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function yE(t,e){for(var n,r,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!Rr(u,"body");)Cy(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var f,h=[],g={},v=!1,_=!1;if(pe(c,(y=>{var w=xf(y);y.tagName.toLowerCase()==="a"&&(v=y.getAttribute("href"),v=w&&v&&Ds(v)&&v),te(Rl(y),"ph-no-capture")&&(_=!0),h.push(vE(y,o,s,a));var k=(function(b){if(!xf(b))return{};var E={};return pe(b.attributes,(function(P){if(P.name&&P.name.indexOf("data-ph-capture-attribute")===0){var A=P.name.replace("data-ph-capture-attribute-",""),H=P.value;A&&H&&Ds(H)&&(E[A]=H)}})),E})(y);Me(g,k)})),_)return{props:{},explicitNoCapture:_};if(s||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=My(t):h[0].$el_text=Us(t)),v){var x,d;h[0].attr__href=v;var p=(x=Pl(v))==null?void 0:x.host,m=C==null||(d=C.location)==null?void 0:d.host;p&&m&&p!==m&&(f=v)}return{props:Me({$event_type:i.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:pE(h)},(n=h[0])!=null&&n.$el_text?{$el_text:(r=h[0])==null?void 0:r.$el_text}:{},f&&i.type==="click"?{$external_click_url:f}:{},g)}}var Sf=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new Tl(e.config.rageclick),this.I=null}get F(){var e,n,r=We(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((i=>new RegExp(i))),r.url_ignorelist=(n=r.url_ignorelist)==null?void 0:n.map((i=>new RegExp(i))),r}C(){if(this.isBrowserSupported()){if(C&&N){var e=r=>{r=r||C?.event;try{this.M(r)}catch(i){Dv.error("Failed to capture event",i)}};if(De(N,"submit",e,{capture:!0}),De(N,"change",e,{capture:!0}),De(N,"click",e,{capture:!0}),this.F.capture_copied_text){var n=r=>{r=r||C?.event,this.M(r,Dd)};De(N,"copy",n,{capture:!0}),De(N,"cut",n,{capture:!0})}}}else Dv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.C(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Rv]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var n,r=[];return(n=this.I)==null||n.forEach((i=>{var o=N?.querySelectorAll(i);o?.forEach((s=>{e===s&&r.push(i)}))})),r}get isEnabled(){var e,n,r=(e=this.instance.persistence)==null?void 0:e.props[Rv],i=this.T;if(Kn(i)&&!Cr(r)&&!this.instance.O())return!1;var o=(n=this.T)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!o}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r,i=Ry(e);Ey(i)&&(i=i.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&aE(i,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=n===Dd;if(i&&lE(i,e,this.F,o,o?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:a}=yE(i,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(a)return!1;var l=this.getElementSelectors(i);if(l&&l.length>0&&(s.$element_selectors=l),n===Dd){var c,u=Ay(C==null||(c=C.getSelection())==null?void 0:c.toString()),f=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=f}return this.instance.capture(n,s),!0}}}isBrowserSupported(){return Er(N?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return xn(t)&&isFinite(t)&&Math.floor(t)===t});var Bv="0123456789abcdef",bf=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,i){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||n<0||r<0||i<0||e>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new t(o)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+Bv.charAt(this.bytes[n]>>>4)+Bv.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},kf=class{constructor(){this.A=0,this.D=0,this.j=new Ef}generate(){var e=this.generateOrAbort();if(O(e)){this.A=0;var n=this.generateOrAbort();if(O(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return bf.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}},Vv,$y=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};C&&!O(C.crypto)&&crypto.getRandomValues&&($y=t=>crypto.getRandomValues(t));var Ef=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&($y(this.N),this.U=0),this.N[this.U++]}},kr=()=>_E().toString(),_E=()=>(Vv||(Vv=new kf)).generate(),ws="",wE=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function xE(t,e){if(e){var n=(function(i,o){if(o===void 0&&(o=N),ws)return ws;if(!o||["localhost","127.0.0.1"].includes(i))return"";for(var s=i.split("."),a=Math.min(s.length,8),l="dmn_chk_"+kr();!ws&&a--;){var c=s.slice(a).join("."),u=l+"=1;domain=."+c+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(l)&&(o.cookie=u+";max-age=0",ws=c)}return ws})(t);if(!n){var r=(i=>{var o=i.match(wE);return o?o[0]:""})(t);r!==n&&L.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var wn={H:()=>!!N,B:function(t){L.error("cookieStore error: "+t)},q:function(t){if(N){try{for(var e=t+"=",n=N.cookie.split(";").filter((o=>o.length)),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(wn.q(t))||{}}catch{}return e},G:function(t,e,n,r,i){if(N)try{var o="",s="",a=xE(N.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}i&&(s="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return c.length>3686.4&&L.warn("cookieStore warning: large cookie, len="+c.length),N.cookie=c,c}catch{return}},V:function(t,e){if(N!=null&&N.cookie)try{wn.G(t,"",-1,e)}catch{return}}},Vd=null,Ee={H:function(){if(!Kn(Vd))return Vd;var t=!0;if(O(C))t=!1;else try{var e="__mplssupport__";Ee.G(e,"xyz"),Ee.q(e)!=='"xyz"'&&(t=!1),Ee.V(e)}catch{t=!1}return t||L.error("localStorage unsupported; falling back to cookie store"),Vd=t,t},B:function(t){L.error("localStorage error: "+t)},q:function(t){try{return C?.localStorage.getItem(t)}catch(e){Ee.B(e)}return null},W:function(t){try{return JSON.parse(Ee.q(t))||{}}catch{}return null},G:function(t,e){try{C?.localStorage.setItem(t,JSON.stringify(e))}catch(n){Ee.B(n)}},V:function(t){try{C?.localStorage.removeItem(t)}catch(e){Ee.B(e)}}},SE=["distinct_id",kl,by,Al,Cl],hl=F({},Ee,{W:function(t){try{var e={};try{e=wn.W(t)||{}}catch{}var n=Me(e,JSON.parse(Ee.q(t)||"{}"));return Ee.G(t,n),n}catch{}return null},G:function(t,e,n,r,i,o){try{Ee.G(t,e,void 0,void 0,o);var s={};SE.forEach((a=>{e[a]&&(s[a]=e[a])})),Object.keys(s).length&&wn.G(t,s,n,r,i,o)}catch(a){Ee.B(a)}},V:function(t,e){try{C?.localStorage.removeItem(t),wn.V(t,e)}catch(n){Ee.B(n)}}}),gl={},bE={H:function(){return!0},B:function(t){L.error("memoryStorage error: "+t)},q:function(t){return gl[t]||null},W:function(t){return gl[t]||null},G:function(t,e){gl[t]=e},V:function(t){delete gl[t]}},di=null,Ze={H:function(){if(!Kn(di))return di;if(di=!0,O(C))di=!1;else try{var t="__support__";Ze.G(t,"xyz"),Ze.q(t)!=='"xyz"'&&(di=!1),Ze.V(t)}catch{di=!1}return di},B:function(t){L.error("sessionStorage error: ",t)},q:function(t){try{return C?.sessionStorage.getItem(t)}catch(e){Ze.B(e)}return null},W:function(t){try{return JSON.parse(Ze.q(t))||null}catch{}return null},G:function(t,e){try{C?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Ze.B(n)}},V:function(t){try{C?.sessionStorage.removeItem(t)}catch(e){Ze.B(e)}}},Wn=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Cf=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?Wn.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===Wn.DENIED||this.consent===Wn.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Wn.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Md(e)?Wn.GRANTED:te(z1,e)?Wn.DENIED:Wn.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Ee:wn;var n=e==="localStorage"?wn:Ee;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Md(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!wy([It?.doNotTrack,It?.msDoNotTrack,G.doNotTrack],(e=>Md(e)))}},ml=He("[Dead Clicks]"),kE=()=>!0,EE=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(Sy)),r=t.instance.config.capture_dead_clicks;return Cr(r)?r:!!We(r)||n},Nl=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Sy]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(i=>{i?ml.error("failed to load script",i):e()}))}et(){var e;if(N){if(!this.tt&&(e=G.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=We(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=G.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(N),ml.info("starting...")}}else ml.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,ml.info("stopping..."))}},xs=He("[ExceptionAutocapture]"),Af=class{constructor(e){var n,r,i;this.rt=()=>{var o;if(C&&this.isEnabled&&(o=G.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var s=G.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=G.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=G.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=s(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=a(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){xs.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[Tv]),this.F=this.ht(),this.vt=new tf({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10,refillInterval:1e4,h:xs}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return We(e)?n=F({},n,e):(O(e)?this.ut:e)&&(n=F({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(xs.info("enabled"),this.it(this.rt))}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(i=>{if(i)return xs.error("failed to load script",i);e()}))}lt(){var e,n,r;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ut=!!n||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[Tv]:this.ut}),this.startIfEnabled()}captureException(e){var n,r,i=(n=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&n!==void 0?n:"Exception";this.vt.consumeRateLimit(i)?xs.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}};function zv(t,e,n){try{if(!(e in t))return()=>{};var r=t[e],i=n(r);return Er(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}var Rf=class{constructor(e){var n;this._instance=e,this.dt=(C==null||(n=C.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(L.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,L.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(C&&C.history){var r=this;(e=C.history.pushState)!=null&&e.__posthog_wrapped__||zv(C.history,"pushState",(i=>function(o,s,a){i.call(this,o,s,a),r.ft("pushState")})),(n=C.history.replaceState)!=null&&n.__posthog_wrapped__||zv(C.history,"replaceState",(i=>function(o,s,a){i.call(this,o,s,a),r.ft("replaceState")})),this.gt()}}ft(e){try{var n,r=C==null||(n=C.location)==null?void 0:n.pathname;if(!r)return;r!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=r}catch(i){L.error("Error capturing "+e+" pageview",i)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};De(C,"popstate",e),this.ct=()=>{C&&C.removeEventListener("popstate",e)}}}},zd=He("[SegmentIntegration]");function CE(t,e){var n=t.config.segment;if(!n)return e();(function(r,i){var o=r.config.segment;if(!o)return i();var s=l=>{var c=()=>l.anonymousId()||kr();r.config.get_device_id=c,l.id()&&(r.register({distinct_id:l.id(),$device_id:c()}),r.persistence.set_property(Un,"identified")),i()},a=o.user();"then"in a&&Er(a.then)?a.then((l=>s(l))):s(a)})(t,(()=>{n.register((r=>{Promise&&Promise.resolve||zd.warn("This browser does not have Promise support, and can not use the segment integration");var i=(o,s)=>{if(!s)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(zd.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(zd.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var a=r.calculateEventProperties(s,o.event.properties);return o.event.properties=Object.assign({},a,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>i(o,o.event.event),page:o=>i(o,"$pageview"),identify:o=>i(o,"$identify"),screen:o=>i(o,"$screen")}})(t)).then((()=>{e()}))}))}var Dy="posthog-js";function By(t,e){var{organization:n,projectId:r,prefix:i,severityAllowList:o=["error"],sendExceptionsToPostHog:s=!0}=e===void 0?{}:e;return a=>{var l,c,u,f,h;if(!(o==="*"||o.includes(a.level))||!t.__loaded)return a;a.tags||(a.tags={});var g=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());a.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var v=((l=a.exception)==null?void 0:l.values)||[],_=v.map((d=>F({},d,{stacktrace:d.stacktrace?F({},d.stacktrace,{type:"raw",frames:(d.stacktrace.frames||[]).map((p=>F({},p,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((c=v[0])==null?void 0:c.value)||a.message,$exception_type:(u=v[0])==null?void 0:u.type,$exception_level:a.level,$exception_list:_,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((f=v[0])==null?void 0:f.value)||a.message,$sentry_exception_type:(h=v[0])==null?void 0:h.type,$sentry_tags:a.tags};return n&&r&&(x.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),s&&t.exceptions.sendExceptionEvent(x),a}}var Tf=class{constructor(e,n,r,i,o,s){this.name=Dy,this.setupOnce=function(a){a(By(e,{organization:n,projectId:r,prefix:i,severityAllowList:o,sendExceptionsToPostHog:s==null||s}))}}},AE=C!=null&&C.location?Ol(C.location.hash,"__posthog")||Ol(location.hash,"state"):null,Hv="_postHogToolbarParams",jv=He("[Toolbar]"),br=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(br||{}),Pf=class{constructor(e){this.instance=e}_t(e){G.ph_toolbar_state=e}yt(){var e;return(e=G.ph_toolbar_state)!==null&&e!==void 0?e:br.UNINITIALIZED}maybeLoadToolbar(e,n,r){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),!C||!N)return!1;e=e??C.location,r=r??C.history;try{if(!n){try{C.localStorage.setItem("test","test"),C.localStorage.removeItem("test")}catch{return!1}n=C?.localStorage}var i,o=AE||Ol(e.hash,"__posthog")||Ol(e.hash,"state"),s=o?Av((()=>JSON.parse(atob(decodeURIComponent(o)))))||Av((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action==="ph_authorize"?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(n.getItem(Hv)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}bt(e){var n=G.ph_load_toolbar||G.ph_load_editor;!de(n)&&Er(n)?n(e,this.instance):jv.warn("No toolbar load function found")}loadToolbar(e){var n=!(N==null||!N.getElementById(ky));if(!C||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=F({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(C.localStorage.setItem(Hv,JSON.stringify(F({},i,{source:void 0}))),this.yt()===br.LOADED)this.bt(i);else if(this.yt()===br.UNINITIALIZED){var o;this._t(br.LOADING),(o=G.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return jv.error("[Toolbar] Failed to load",s),void this._t(br.UNINITIALIZED);this._t(br.LOADED),this.bt(i)})),De(C,"turbolinks:load",(()=>{this._t(br.UNINITIALIZED),this.loadToolbar(i)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,r){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,n,r)}},RE=He("[TracingHeaders]"),If=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,r;O(this.xt)&&((n=G.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),O(this.St)&&((r=G.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(i=>{if(i)return RE.error("failed to load script",i);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(n=this.St)==null||n.call(this),this.xt=void 0,this.St=void 0)}},Ht="Mobile",Ll="iOS",_n="Android",Bs="Tablet",Vy=_n+" "+Bs,zy="iPad",Hy="Apple",jy=Hy+" Watch",Vs="Safari",ho="BlackBerry",Uy="Samsung",Wy=Uy+"Browser",qy=Uy+" Internet",hi="Chrome",TE=hi+" OS",Ky=hi+" "+Ll,dp="Internet Explorer",Gy=dp+" "+Ht,fp="Opera",PE=fp+" Mini",pp="Edge",Zy="Microsoft "+pp,uo="Firefox",Yy=uo+" "+Ll,zs="Nintendo",Hs="PlayStation",fo="Xbox",Xy=_n+" "+Ht,Qy=Ht+" "+Vs,Os="Windows",Of=Os+" Phone",Uv="Nokia",Nf="Ouya",Jy="Generic",IE=Jy+" "+Ht.toLowerCase(),e_=Jy+" "+Bs.toLowerCase(),Lf="Konqueror",ut="(\\d+(\\.\\d+)?)",Hd=new RegExp("Version/"+ut),OE=new RegExp(fo,"i"),NE=new RegExp(Hs+" \\w+","i"),LE=new RegExp(zs+" \\w+","i"),hp=new RegExp(ho+"|PlayBook|BB10","i"),ME={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},FE=(t,e)=>e&&te(e,Hy)||(function(n){return te(n,Vs)&&!te(n,hi)&&!te(n,_n)})(t),t_=function(t,e){return e=e||"",te(t," OPR/")&&te(t,"Mini")?PE:te(t," OPR/")?fp:hp.test(t)?ho:te(t,"IE"+Ht)||te(t,"WPDesktop")?Gy:te(t,Wy)?qy:te(t,pp)||te(t,"Edg/")?Zy:te(t,"FBIOS")?"Facebook "+Ht:te(t,"UCWEB")||te(t,"UCBrowser")?"UC Browser":te(t,"CriOS")?Ky:te(t,"CrMo")||te(t,hi)?hi:te(t,_n)&&te(t,Vs)?Xy:te(t,"FxiOS")?Yy:te(t.toLowerCase(),Lf.toLowerCase())?Lf:FE(t,e)?te(t,Ht)?Qy:Vs:te(t,uo)?uo:te(t,"MSIE")||te(t,"Trident/")?dp:te(t,"Gecko")?uo:""},$E={[Gy]:[new RegExp("rv:"+ut)],[Zy]:[new RegExp(pp+"?\\/"+ut)],[hi]:[new RegExp("("+hi+"|CrMo)\\/"+ut)],[Ky]:[new RegExp("CriOS\\/"+ut)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ut)],[Vs]:[Hd],[Qy]:[Hd],[fp]:[new RegExp("(Opera|OPR)\\/"+ut)],[uo]:[new RegExp(uo+"\\/"+ut)],[Yy]:[new RegExp("FxiOS\\/"+ut)],[Lf]:[new RegExp("Konqueror[:/]?"+ut,"i")],[ho]:[new RegExp(ho+" "+ut),Hd],[Xy]:[new RegExp("android\\s"+ut,"i")],[qy]:[new RegExp(Wy+"\\/"+ut)],[dp]:[new RegExp("(rv:|MSIE )"+ut)],Mozilla:[new RegExp("rv:"+ut)]},DE=function(t,e){var n=t_(t,e),r=$E[n];if(O(r))return null;for(var i=0;i<r.length;i++){var o=r[i],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},Wv=[[new RegExp(fo+"; "+fo+" (.*?)[);]","i"),t=>[fo,t&&t[1]||""]],[new RegExp(zs,"i"),[zs,""]],[new RegExp(Hs,"i"),[Hs,""]],[hp,[ho,""]],[new RegExp(Os,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Of,""];if(new RegExp(Ht).test(e)&&!/IEMobile\b/.test(e))return[Os+" "+Ht,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=n[1],i=ME[r]||"";return/arm/i.test(e)&&(i="RT"),[Os,i]}return[Os,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Ll,e.join(".")]}return[Ll,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=O(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+_n+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_n+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[_n,e.join(".")]}return[_n,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[TE,""]],[/Linux|debian/i,["Linux",""]]],qv=function(t){return LE.test(t)?zs:NE.test(t)?Hs:OE.test(t)?fo:new RegExp(Nf,"i").test(t)?Nf:new RegExp("("+Of+"|WPDesktop)","i").test(t)?Of:/iPad/.test(t)?zy:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?jy:hp.test(t)?ho:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Uv,"i").test(t)?Uv:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(Ht).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?_n:Vy:_n:new RegExp("(pda|"+Ht+")","i").test(t)?IE:new RegExp(Bs,"i").test(t)&&!new RegExp(Bs+" pc","i").test(t)?e_:""},vl="https?://(.*)",vo=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],BE=mo(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],vo),qs="<masked>",VE=["li_fat_id"];function n_(t,e,n){if(!N)return{};var r,i=e?mo([],vo,n||[]):[],o=r_(Ws(N.URL,i,qs),t),s=(r={},pe(VE,(function(a){var l=wn.q(a);r[a]=l||null})),r);return Me(s,o)}function r_(t,e){var n=BE.concat(e||[]),r={};return pe(n,(function(i){var o=Il(t,i);r[i]=o||null})),r}function i_(t){var e=(function(o){return o?o.search(vl+"google.([^/?]*)")===0?"google":o.search(vl+"bing.com")===0?"bing":o.search(vl+"yahoo.com")===0?"yahoo":o.search(vl+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!Kn(e)){r.$search_engine=e;var i=N?Il(N.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function Kv(){return navigator.language||navigator.userLanguage}function o_(){return N?.referrer||"$direct"}function s_(t,e){var n=t?mo([],vo,e||[]):[],r=_t?.href.substring(0,1e3);return{r:o_().substring(0,1e3),u:r?Ws(r,n,qs):void 0}}function a_(t){var e,{r:n,u:r}=t,i={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=Pl(n))==null?void 0:e.host};if(r){i.$current_url=r;var o=Pl(r);i.$host=o?.host,i.$pathname=o?.pathname;var s=r_(r);Me(i,s)}if(n){var a=i_(n);Me(i,a)}return i}function l_(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function zE(){try{return new Date().getTimezoneOffset()}catch{return}}function HE(t,e){if(!yt)return{};var n,r,i,o=t?mo([],vo,e||[]):[],[s,a]=(function(l){for(var c=0;c<Wv.length;c++){var[u,f]=Wv[c],h=u.exec(l),g=h&&(Er(f)?f(h,l):f);if(g)return g}return["",""]})(yt);return Me(ap({$os:s,$os_version:a,$browser:t_(yt,navigator.vendor),$device:qv(yt),$device_type:(r=yt,i=qv(r),i===zy||i===Vy||i==="Kobo"||i==="Kindle Fire"||i===e_?Bs:i===zs||i===fo||i===Hs||i===Nf?"Console":i===jy?"Wearable":i?Ht:"Desktop"),$timezone:l_(),$timezone_offset:zE()}),{$current_url:Ws(_t?.href,o,qs),$host:_t?.host,$pathname:_t?.pathname,$raw_user_agent:yt.length>1e3?yt.substring(0,997)+"...":yt,$browser_version:DE(yt,navigator.vendor),$browser_language:Kv(),$browser_language_prefix:(n=Kv(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:C?.screen.height,$screen_width:C?.screen.width,$viewport_height:C?.innerHeight,$viewport_width:C?.innerWidth,$lib:"web",$lib_version:jn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var wr=He("[Web Vitals]"),Gv=9e5,Mf=class{constructor(e){var n;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((r,i)=>F({},r,{["$web_vitals_"+i.name+"_event"]:F({},i),["$web_vitals_"+i.name+"_value"]:i.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=r=>{var i,o=(i=this._instance.sessionManager)==null?void 0:i.checkAndGetSessionAndWindowId(!0);if(O(o))wr.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Tt();O(s)||(de(r?.name)||de(r?.value)?wr.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?wr.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==s&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),O(this.N.url)&&(this.N.url=s),this.N.firstMetricTimestamp=O(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push(F({},r,{$current_url:s,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var r,i,o,s,a=G.__PosthogExtensions__;O(a)||O(a.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:i,onFCP:o,onINP:s}=a.postHogWebVitalsCallbacks),r&&i&&o&&s?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Pt.bind(this)),this.P=!0):wr.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[Iv]),this.startIfEnabled()}get allowedMetrics(){var e,n,r=We(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return O(r)?((n=this._instance.persistence)==null?void 0:n.props[Ov])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(We(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=We(this._instance.config.capture_performance)&&xn(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Gv;return 0<e&&e<=6e4?Gv:e}get isEnabled(){var e=_t?.protocol;if(e!=="http:"&&e!=="https:")return wr.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=We(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Cr(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Cr(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(wr.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=We(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=We(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Iv]:n}),this._instance.persistence.register({[Ov]:r})),this.Et=n,this.startIfEnabled()}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",(i=>{i?wr.error("failed to load script",i):e()}))}Tt(){var e=C?C.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=n?mo([],vo,r||[]):[];return Ws(e,i,qs)}wr.error("Could not determine current URL")}},jE=He("[Heatmaps]");function Zv(t){return We(t)&&"clientX"in t&&"clientY"in t&&xn(t.clientX)&&xn(t.clientY)}var Ff=class{constructor(e){var n;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((n=this.instance.persistence)==null||!n.props[pf]),this.rageclicks=new Tl(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return We(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return O(this.instance.config.capture_heatmaps)?O(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;jE.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[pf]:n}),this.Et=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})(N)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){C&&N&&(this.jt=this.Dt.bind(this),De(C,"beforeunload",this.jt),this.Lt=e=>this.At(e||C?.event),De(N,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||C?.event),De(N,"mousemove",this.Nt,{capture:!0}),this.zt=new Nl(this.instance,kE,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),De(N,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;C&&N&&(this.jt&&C.removeEventListener("beforeunload",this.jt),this.Lt&&N.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&N.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&N.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=(function(a,l,c){for(var u=a;u&&Wl(u)&&!Rr(u,"body");){if(u===c)return!1;if(te(l,C?.getComputedStyle(u).position))return!0;u=Py(u)}return!1})(Ry(e),["fixed","sticky"],o);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:n}}At(e,n){var r;if(n===void 0&&(n="click"),!Nv(e.target)&&Zv(e)){var i=this.qt(e,n);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(F({},i,{type:"rageclick"})),this.Wt(i)}}Ut(e){!Nv(e.target)&&Zv(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(C){var n=C.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,o=r?mo([],vo,i||[]):[],s=Ws(n,o,qs);this.N=this.N||{},this.N[s]||(this.N[s]=[]),this.N[s].push(e)}}Dt(){this.N&&!lo(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},$f=class{constructor(e){this._instance=e}doPageView(e,n){var r,i=this.Gt(e,n);return this.Vt={pathname:(r=C?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var n;return this.Gt(e,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,n){var r=this.Vt;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:a,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:f}=o;if(!(O(s)||O(a)||O(l)||O(c)||O(u)||O(f))){s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),f=Math.ceil(f);var h=s<=1?1:yn(a/s,0,1,L),g=s<=1?1:yn(l/s,0,1,L),v=c<=1?1:yn(u/c,0,1,L),_=c<=1?1:yn(f/c,0,1,L);i=Me(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}},jt=Uint8Array,dt=Uint16Array,go=Uint32Array,gp=new jt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mp=new jt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Yv=new jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),c_=function(t,e){for(var n=new dt(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new go(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},u_=c_(gp,2),UE=u_[0],Df=u_[1];UE[28]=258,Df[258]=28;for(Bf=c_(mp,0)[1],Ml=new dt(32768),he=0;he<32768;++he)xr=(43690&he)>>>1|(21845&he)<<1,xr=(61680&(xr=(52428&xr)>>>2|(13107&xr)<<2))>>>4|(3855&xr)<<4,Ml[he]=((65280&xr)>>>8|(255&xr)<<8)>>>1;var xr,Bf,Ml,he,Ms=function(t,e,n){for(var r=t.length,i=0,o=new dt(e);i<r;++i)++o[t[i]-1];var s,a=new dt(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new dt(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var c=i<<4|t[i],u=e-t[i],f=a[t[i]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)s[Ml[f]>>>l]=c}else for(s=new dt(r),i=0;i<r;++i)s[i]=Ml[a[t[i]-1]++]>>>15-t[i];return s},gi=new jt(288);for(he=0;he<144;++he)gi[he]=8;for(he=144;he<256;++he)gi[he]=9;for(he=256;he<280;++he)gi[he]=7;for(he=280;he<288;++he)gi[he]=8;var Fl=new jt(32);for(he=0;he<32;++he)Fl[he]=5;var WE=Ms(gi,9,0),qE=Ms(Fl,5,0),d_=function(t){return(t/8>>0)+(7&t&&1)},f_=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof dt?dt:t instanceof go?go:jt)(n-e);return r.set(t.subarray(e,n)),r},Hn=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},Ss=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},jd=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,o=n.slice();if(!i)return[new jt(0),0];if(i==1){var s=new jt(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(w,k){return w.f-k.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var g=new dt(h+1),v=Vf(n[u-1],g,0);if(v>e){r=0;var _=0,x=v-e,d=1<<x;for(o.sort((function(w,k){return g[k.s]-g[w.s]||w.f-k.f}));r<i;++r){var p=o[r].s;if(!(g[p]>e))break;_+=d-(1<<v-g[p]),g[p]=e}for(_>>>=x;_>0;){var m=o[r].s;g[m]<e?_-=1<<e-g[m]++-1:++r}for(;r>=0&&_;--r){var y=o[r].s;g[y]==e&&(--g[y],++_)}v=e}return[new jt(g),v]},Vf=function(t,e,n){return t.s==-1?Math.max(Vf(t.l,e,n+1),Vf(t.r,e,n+1)):e[t.s]=n},Xv=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new dt(++e),r=0,i=t[0],o=1,s=function(l){n[r++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[n.subarray(0,r),e]},bs=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},zf=function(t,e,n){var r=n.length,i=d_(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<r;++o)t[i+o+4]=n[o];return 8*(i+4+r)},Qv=function(t,e,n,r,i,o,s,a,l,c,u){Hn(e,u++,n),++i[256];for(var f=jd(i,15),h=f[0],g=f[1],v=jd(o,15),_=v[0],x=v[1],d=Xv(h),p=d[0],m=d[1],y=Xv(_),w=y[0],k=y[1],b=new dt(19),E=0;E<p.length;++E)b[31&p[E]]++;for(E=0;E<w.length;++E)b[31&w[E]]++;for(var P=jd(b,7),A=P[0],H=P[1],K=19;K>4&&!A[Yv[K-1]];--K);var Y,W,le,B,X=c+5<<3,D=bs(i,gi)+bs(o,Fl)+s,Z=bs(i,h)+bs(o,_)+s+14+3*K+bs(b,A)+(2*b[16]+3*b[17]+7*b[18]);if(X<=D&&X<=Z)return zf(e,u,t.subarray(l,l+c));if(Hn(e,u,1+(Z<D)),u+=2,Z<D){Y=Ms(h,g,0),W=h,le=Ms(_,x,0),B=_;var vt=Ms(A,H,0);for(Hn(e,u,m-257),Hn(e,u+5,k-1),Hn(e,u+10,K-4),u+=14,E=0;E<K;++E)Hn(e,u+3*E,A[Yv[E]]);u+=3*K;for(var Vn=[p,w],Ge=0;Ge<2;++Ge){var zt=Vn[Ge];for(E=0;E<zt.length;++E){var Pt=31&zt[E];Hn(e,u,vt[Pt]),u+=A[Pt],Pt>15&&(Hn(e,u,zt[E]>>>5&127),u+=zt[E]>>>12)}}}else Y=WE,W=gi,le=qE,B=Fl;for(E=0;E<a;++E)if(r[E]>255){Pt=r[E]>>>18&31,Ss(e,u,Y[Pt+257]),u+=W[Pt+257],Pt>7&&(Hn(e,u,r[E]>>>23&31),u+=gp[Pt]);var io=31&r[E];Ss(e,u,le[io]),u+=B[io],io>3&&(Ss(e,u,r[E]>>>5&8191),u+=mp[io])}else Ss(e,u,Y[r[E]]),u+=W[r[E]];return Ss(e,u,Y[256]),u+W[256]},KE=new go([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),GE=(function(){for(var t=new go(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),ZE=function(t,e,n,r,i){return(function(o,s,a,l,c,u){var f=o.length,h=new jt(l+f+5*(1+Math.floor(f/7e3))+c),g=h.subarray(l,h.length-c),v=0;if(!s||f<8)for(var _=0;_<=f;_+=65535){var x=_+65535;x<f?v=zf(g,v,o.subarray(_,x)):(g[_]=u,v=zf(g,v,o.subarray(_,f)))}else{for(var d=KE[s-1],p=d>>>13,m=8191&d,y=(1<<a)-1,w=new dt(32768),k=new dt(y+1),b=Math.ceil(a/3),E=2*b,P=function(Ld){return(o[Ld]^o[Ld+1]<<b^o[Ld+2]<<E)&y},A=new go(25e3),H=new dt(288),K=new dt(32),Y=0,W=0,le=(_=0,0),B=0,X=0;_<f;++_){var D=P(_),Z=32767&_,vt=k[D];if(w[Z]=vt,k[D]=Z,B<=_){var Vn=f-_;if((Y>7e3||le>24576)&&Vn>423){v=Qv(o,g,0,A,H,K,W,le,X,_-X,v),le=Y=W=0,X=_;for(var Ge=0;Ge<286;++Ge)H[Ge]=0;for(Ge=0;Ge<30;++Ge)K[Ge]=0}var zt=2,Pt=0,io=m,vr=Z-vt&32767;if(Vn>2&&D==P(_-vr))for(var k1=Math.min(p,Vn)-1,E1=Math.min(32767,_),C1=Math.min(258,Vn);vr<=E1&&--io&&Z!=vt;){if(o[_+zt]==o[_+zt-vr]){for(var yr=0;yr<C1&&o[_+yr]==o[_+yr-vr];++yr);if(yr>zt){if(zt=yr,Pt=vr,yr>k1)break;var A1=Math.min(vr,yr-2),cv=0;for(Ge=0;Ge<A1;++Ge){var Nd=_-vr+Ge+32768&32767,uv=Nd-w[Nd]+32768&32767;uv>cv&&(cv=uv,vt=Nd)}}}vr+=(Z=vt)-(vt=w[Z])+32768&32767}if(Pt){A[le++]=268435456|Df[zt]<<18|Bf[Pt];var dv=31&Df[zt],fv=31&Bf[Pt];W+=gp[dv]+mp[fv],++H[257+dv],++K[fv],B=_+zt,++Y}else A[le++]=o[_],++H[o[_]]}}v=Qv(o,g,u,A,H,K,W,le,X,_-X,v)}return f_(h,0,l+d_(v)+c)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!0)},Ud=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function YE(t,e){e===void 0&&(e={});var n=(function(){var a=4294967295;return{p:function(l){for(var c=a,u=0;u<l.length;++u)c=GE[255&c^l[u]]^c>>>8;a=c},d:function(){return 4294967295^a}}})(),r=t.length;n.p(t);var i,o=ZE(t,e,10+((i=e).filename&&i.filename.length+1||0),8),s=o.length;return(function(a,l){var c=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&Ud(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){a[3]=8;for(var u=0;u<=c.length;++u)a[u+10]=c.charCodeAt(u)}})(o,e),Ud(o,s-8,n.d()),Ud(o,s-4,r),o}var XE=function(t){var e,n,r,i,o="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
|
|
8
|
+
`+o.stack}return{value:t,source:e,stack:i,digest:null}}function kh(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function sg(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var zR=typeof WeakMap=="function"?WeakMap:Map;function hS(t,e,n){n=Jn(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){wu||(wu=!0,mg=r),sg(t,e)},n}function gS(t,e,n){n=Jn(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var i=e.value;n.payload=function(){return r(i)},n.callback=function(){sg(t,e)}}var o=t.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){sg(t,e),typeof r!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),n}function Cw(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new zR;var i=new Set;r.set(e,i)}else i=r.get(e),i===void 0&&(i=new Set,r.set(e,i));i.has(n)||(i.add(n),t=tI.bind(null,t,e,n),e.then(t,t))}function Aw(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function Tw(t,e,n,r,i){return(t.mode&1)===0?(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=Jn(-1,1),e.tag=2,jr(n,e,1))),n.lanes|=1),t):(t.flags|=65536,t.lanes=i,t)}var HR=ir.ReactCurrentOwner,kt=!1;function pt(t,e,n,r){e.child=t===null?Ux(e,null,n,r):Go(e,t.child,n,r)}function Rw(t,e,n,r,i){n=n.render;var o=e.ref;return jo(e,i),r=Gg(t,e,n,r,o,i),n=Zg(),t!==null&&!kt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,rr(t,e,i)):(ke&&n&&Fg(e),e.flags|=1,pt(t,e,r,i),e.child)}function Iw(t,e,n,r,i){if(t===null){var o=n.type;return typeof o=="function"&&!om(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=o,mS(t,e,o,r,i)):(t=Jc(n.type,null,r,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(o=t.child,(t.lanes&i)===0){var s=o.memoizedProps;if(n=n.compare,n=n!==null?n:Pa,n(s,r)&&t.ref===e.ref)return rr(t,e,i)}return e.flags|=1,t=qr(o,r),t.ref=e.ref,t.return=e,e.child=t}function mS(t,e,n,r,i){if(t!==null){var o=t.memoizedProps;if(Pa(o,r)&&t.ref===e.ref)if(kt=!1,e.pendingProps=r=o,(t.lanes&i)!==0)(t.flags&131072)!==0&&(kt=!0);else return e.lanes=t.lanes,rr(t,e,i)}return ag(t,e,n,r,i)}function vS(t,e,n){var r=e.pendingProps,i=r.children,o=t!==null?t.memoizedState:null;if(r.mode==="hidden")if((e.mode&1)===0)e.memoizedState={baseLanes:0,cachePool:null,transitions:null},me(Do,Lt),Lt|=n;else{if((n&1073741824)===0)return t=o!==null?o.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,me(Do,Lt),Lt|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,me(Do,Lt),Lt|=r}else o!==null?(r=o.baseLanes|n,e.memoizedState=null):r=n,me(Do,Lt),Lt|=r;return pt(t,e,i,n),e.child}function yS(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function ag(t,e,n,r,i){var o=Ct(n)?Ci:at.current;return o=qo(e,o),jo(e,i),n=Gg(t,e,n,r,o,i),r=Zg(),t!==null&&!kt?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,rr(t,e,i)):(ke&&r&&Fg(e),e.flags|=1,pt(t,e,n,i),e.child)}function Pw(t,e,n,r,i){if(Ct(n)){var o=!0;uu(e)}else o=!1;if(jo(e,i),e.stateNode===null)Yc(t,e),pS(e,n,r),og(e,n,r,i),r=!0;else if(t===null){var s=e.stateNode,a=e.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Zt(c):(c=Ct(n)?Ci:at.current,c=qo(e,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Ew(e,s,r,c),Lr=!1;var h=e.memoizedState;s.state=h,gu(e,r,s,i),l=e.memoizedState,a!==r||h!==l||Et.current||Lr?(typeof u=="function"&&(ig(e,n,u,r),l=e.memoizedState),(a=Lr||kw(e,n,a,r,h,l,c))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{s=e.stateNode,qx(t,e),a=e.memoizedProps,c=e.type===e.elementType?a:ln(e.type,a),s.props=c,f=e.pendingProps,h=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Zt(l):(l=Ct(n)?Ci:at.current,l=qo(e,l));var g=n.getDerivedStateFromProps;(u=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||h!==l)&&Ew(e,s,r,l),Lr=!1,h=e.memoizedState,s.state=h,gu(e,r,s,i);var v=e.memoizedState;a!==f||h!==v||Et.current||Lr?(typeof g=="function"&&(ig(e,n,g,r),v=e.memoizedState),(c=Lr||kw(e,n,c,r,h,v,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,v,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,v,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=v),s.props=r,s.state=v,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),r=!1)}return lg(t,e,n,r,o,i)}function lg(t,e,n,r,i,o){yS(t,e);var s=(e.flags&128)!==0;if(!r&&!s)return i&&mw(e,n,!1),rr(t,e,o);r=e.stateNode,HR.current=e;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&s?(e.child=Go(e,t.child,null,o),e.child=Go(e,null,a,o)):pt(t,e,a,o),e.memoizedState=r.state,i&&mw(e,n,!0),e.child}function _S(t){var e=t.stateNode;e.pendingContext?gw(t,e.pendingContext,e.pendingContext!==e.context):e.context&&gw(t,e.context,!1),Ug(t,e.containerInfo)}function Ow(t,e,n,r,i){return Ko(),Dg(i),e.flags|=256,pt(t,e,n,r),e.child}var cg={dehydrated:null,treeContext:null,retryLane:0};function ug(t){return{baseLanes:t,cachePool:null,transitions:null}}function wS(t,e,n){var r=e.pendingProps,i=Ae.current,o=!1,s=(e.flags&128)!==0,a;if((a=s)||(a=t!==null&&t.memoizedState===null?!1:(i&2)!==0),a?(o=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),me(Ae,i&1),t===null)return ng(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((e.mode&1)===0?e.lanes=1:t.data==="$!"?e.lanes=8:e.lanes=1073741824,null):(s=r.children,t=r.fallback,o?(r=e.mode,o=e.child,s={mode:"hidden",children:s},(r&1)===0&&o!==null?(o.childLanes=0,o.pendingProps=s):o=Lu(s,r,0,null),t=Ei(t,r,n,null),o.return=e,t.return=e,o.sibling=t,e.child=o,e.child.memoizedState=ug(n),e.memoizedState=cg,t):Qg(e,s));if(i=t.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return jR(t,e,s,r,a,i,n);if(o){o=r.fallback,s=e.mode,i=t.child,a=i.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&e.child!==i?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=qr(i,l),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?o=qr(a,o):(o=Ei(o,s,n,null),o.flags|=2),o.return=e,r.return=e,r.sibling=o,e.child=r,r=o,o=e.child,s=t.child.memoizedState,s=s===null?ug(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},o.memoizedState=s,o.childLanes=t.childLanes&~n,e.memoizedState=cg,r}return o=t.child,t=o.sibling,r=qr(o,{mode:"visible",children:r.children}),(e.mode&1)===0&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function Qg(t,e){return e=Lu({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function zc(t,e,n,r){return r!==null&&Dg(r),Go(e,t.child,null,n),t=Qg(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function jR(t,e,n,r,i,o,s){if(n)return e.flags&256?(e.flags&=-257,r=kh(Error(R(422))),zc(t,e,s,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(o=r.fallback,i=e.mode,r=Lu({mode:"visible",children:r.children},i,0,null),o=Ei(o,i,s,null),o.flags|=2,r.return=e,o.return=e,r.sibling=o,e.child=r,(e.mode&1)!==0&&Go(e,t.child,null,s),e.child.memoizedState=ug(s),e.memoizedState=cg,o);if((e.mode&1)===0)return zc(t,e,s,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,o=Error(R(419)),r=kh(o,r,void 0),zc(t,e,s,r)}if(a=(s&t.childLanes)!==0,kt||a){if(r=Ke,r!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=(i&(r.suspendedLanes|s))!==0?0:i,i!==0&&i!==o.retryLane&&(o.retryLane=i,nr(t,i),fn(r,t,i,-1))}return im(),r=kh(Error(R(421))),zc(t,e,s,r)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=nI.bind(null,t),i._reactRetry=e,null):(t=o.treeContext,Mt=Hr(i.nextSibling),Ft=e,ke=!0,un=null,t!==null&&(Wt[qt++]=Xn,Wt[qt++]=Qn,Wt[qt++]=Ai,Xn=t.id,Qn=t.overflow,Ai=e),e=Qg(e,r.children),e.flags|=4096,e)}function Nw(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),rg(t.return,e,n)}function Eh(t,e,n,r,i){var o=t.memoizedState;o===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i)}function xS(t,e,n){var r=e.pendingProps,i=r.revealOrder,o=r.tail;if(pt(t,e,r.children,n),r=Ae.current,(r&2)!==0)r=r&1|2,e.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Nw(t,n,e);else if(t.tag===19)Nw(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(me(Ae,r),(e.mode&1)===0)e.memoizedState=null;else switch(i){case"forwards":for(n=e.child,i=null;n!==null;)t=n.alternate,t!==null&&mu(t)===null&&(i=n),n=n.sibling;n=i,n===null?(i=e.child,e.child=null):(i=n.sibling,n.sibling=null),Eh(e,!1,i,n,o);break;case"backwards":for(n=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&mu(t)===null){e.child=i;break}t=i.sibling,i.sibling=n,n=i,i=t}Eh(e,!0,n,null,o);break;case"together":Eh(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Yc(t,e){(e.mode&1)===0&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function rr(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Ri|=e.lanes,(n&e.childLanes)===0)return null;if(t!==null&&e.child!==t.child)throw Error(R(153));if(e.child!==null){for(t=e.child,n=qr(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=qr(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function UR(t,e,n){switch(e.tag){case 3:_S(e),Ko();break;case 5:Kx(e);break;case 1:Ct(e.type)&&uu(e);break;case 4:Ug(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,i=e.memoizedProps.value;me(pu,r._currentValue),r._currentValue=i;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(me(Ae,Ae.current&1),e.flags|=128,null):(n&e.child.childLanes)!==0?wS(t,e,n):(me(Ae,Ae.current&1),t=rr(t,e,n),t!==null?t.sibling:null);me(Ae,Ae.current&1);break;case 19:if(r=(n&e.childLanes)!==0,(t.flags&128)!==0){if(r)return xS(t,e,n);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),me(Ae,Ae.current),r)break;return null;case 22:case 23:return e.lanes=0,vS(t,e,n)}return rr(t,e,n)}var SS,dg,bS,kS;SS=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};dg=function(){};bS=function(t,e,n,r){var i=t.memoizedProps;if(i!==r){t=e.stateNode,bi(Rn.current);var o=null;switch(n){case"input":i=Nh(t,i),r=Nh(t,r),o=[];break;case"select":i=Re({},i,{value:void 0}),r=Re({},r,{value:void 0}),o=[];break;case"textarea":i=Fh(t,i),r=Fh(t,r),o=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=lu)}Dh(n,r);var s;n=null;for(c in i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var a=i[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(ka.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var l=r[c];if(a=i?.[c],r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(o||(o=[]),o.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(ka.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ye("scroll",t),o||a===l||(o=[])):(o=o||[]).push(c,l))}n&&(o=o||[]).push("style",n);var c=o;(e.updateQueue=c)&&(e.flags|=4)}};kS=function(t,e,n,r){n!==r&&(e.flags|=4)};function la(t,e){if(!ke)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function ot(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function WR(t,e,n){var r=e.pendingProps;switch($g(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(e),null;case 1:return Ct(e.type)&&cu(),ot(e),null;case 3:return r=e.stateNode,Zo(),_e(Et),_e(at),qg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(Bc(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,un!==null&&(_g(un),un=null))),dg(t,e),ot(e),null;case 5:Wg(e);var i=bi(Fa.current);if(n=e.type,t!==null&&e.stateNode!=null)bS(t,e,n,r,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(R(166));return ot(e),null}if(t=bi(Rn.current),Bc(e)){r=e.stateNode,n=e.type;var o=e.memoizedProps;switch(r[An]=e,r[La]=o,t=(e.mode&1)!==0,n){case"dialog":ye("cancel",r),ye("close",r);break;case"iframe":case"object":case"embed":ye("load",r);break;case"video":case"audio":for(i=0;i<ha.length;i++)ye(ha[i],r);break;case"source":ye("error",r);break;case"img":case"image":case"link":ye("error",r),ye("load",r);break;case"details":ye("toggle",r);break;case"input":z0(r,o),ye("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!o.multiple},ye("invalid",r);break;case"textarea":j0(r,o),ye("invalid",r)}Dh(n,o),i=null;for(var s in o)if(o.hasOwnProperty(s)){var a=o[s];s==="children"?typeof a=="string"?r.textContent!==a&&(o.suppressHydrationWarning!==!0&&Dc(r.textContent,a,t),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Dc(r.textContent,a,t),i=["children",""+a]):ka.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&ye("scroll",r)}switch(n){case"input":Cc(r),H0(r,o,!0);break;case"textarea":Cc(r),U0(r);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(r.onclick=lu)}r=i,e.updateQueue=r,r!==null&&(e.flags|=4)}else{s=i.nodeType===9?i:i.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=Qw(n)),t==="http://www.w3.org/1999/xhtml"?n==="script"?(t=s.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=s.createElement(n,{is:r.is}):(t=s.createElement(n),n==="select"&&(s=t,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):t=s.createElementNS(t,n),t[An]=e,t[La]=r,SS(t,e,!1,!1),e.stateNode=t;e:{switch(s=Bh(n,r),n){case"dialog":ye("cancel",t),ye("close",t),i=r;break;case"iframe":case"object":case"embed":ye("load",t),i=r;break;case"video":case"audio":for(i=0;i<ha.length;i++)ye(ha[i],t);i=r;break;case"source":ye("error",t),i=r;break;case"img":case"image":case"link":ye("error",t),ye("load",t),i=r;break;case"details":ye("toggle",t),i=r;break;case"input":z0(t,r),i=Nh(t,r),ye("invalid",t);break;case"option":i=r;break;case"select":t._wrapperState={wasMultiple:!!r.multiple},i=Re({},r,{value:void 0}),ye("invalid",t);break;case"textarea":j0(t,r),i=Fh(t,r),ye("invalid",t);break;default:i=r}Dh(n,i),a=i;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?tx(t,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Jw(t,l)):o==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Ea(t,l):typeof l=="number"&&Ea(t,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(ka.hasOwnProperty(o)?l!=null&&o==="onScroll"&&ye("scroll",t):l!=null&&Sg(t,o,l,s))}switch(n){case"input":Cc(t),H0(t,r,!1);break;case"textarea":Cc(t),U0(t);break;case"option":r.value!=null&&t.setAttribute("value",""+Kr(r.value));break;case"select":t.multiple=!!r.multiple,o=r.value,o!=null?Bo(t,!!r.multiple,o,!1):r.defaultValue!=null&&Bo(t,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(t.onclick=lu)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return ot(e),null;case 6:if(t&&e.stateNode!=null)kS(t,e,t.memoizedProps,r);else{if(typeof r!="string"&&e.stateNode===null)throw Error(R(166));if(n=bi(Fa.current),bi(Rn.current),Bc(e)){if(r=e.stateNode,n=e.memoizedProps,r[An]=e,(o=r.nodeValue!==n)&&(t=Ft,t!==null))switch(t.tag){case 3:Dc(r.nodeValue,n,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Dc(r.nodeValue,n,(t.mode&1)!==0)}o&&(e.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[An]=e,e.stateNode=r}return ot(e),null;case 13:if(_e(Ae),r=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ke&&Mt!==null&&(e.mode&1)!==0&&(e.flags&128)===0)Hx(),Ko(),e.flags|=98560,o=!1;else if(o=Bc(e),r!==null&&r.dehydrated!==null){if(t===null){if(!o)throw Error(R(318));if(o=e.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(R(317));o[An]=e}else Ko(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;ot(e),o=!1}else un!==null&&(_g(un),un=null),o=!0;if(!o)return e.flags&65536?e:null}return(e.flags&128)!==0?(e.lanes=n,e):(r=r!==null,r!==(t!==null&&t.memoizedState!==null)&&r&&(e.child.flags|=8192,(e.mode&1)!==0&&(t===null||(Ae.current&1)!==0?Ue===0&&(Ue=3):im())),e.updateQueue!==null&&(e.flags|=4),ot(e),null);case 4:return Zo(),dg(t,e),t===null&&Oa(e.stateNode.containerInfo),ot(e),null;case 10:return zg(e.type._context),ot(e),null;case 17:return Ct(e.type)&&cu(),ot(e),null;case 19:if(_e(Ae),o=e.memoizedState,o===null)return ot(e),null;if(r=(e.flags&128)!==0,s=o.rendering,s===null)if(r)la(o,!1);else{if(Ue!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(s=mu(t),s!==null){for(e.flags|=128,la(o,!1),r=s.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),e.subtreeFlags=0,r=n,n=e.child;n!==null;)o=n,t=r,o.flags&=14680066,s=o.alternate,s===null?(o.childLanes=0,o.lanes=t,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=s.childLanes,o.lanes=s.lanes,o.child=s.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=s.memoizedProps,o.memoizedState=s.memoizedState,o.updateQueue=s.updateQueue,o.type=s.type,t=s.dependencies,o.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),n=n.sibling;return me(Ae,Ae.current&1|2),e.child}t=t.sibling}o.tail!==null&&Fe()>Xo&&(e.flags|=128,r=!0,la(o,!1),e.lanes=4194304)}else{if(!r)if(t=mu(s),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),la(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!ke)return ot(e),null}else 2*Fe()-o.renderingStartTime>Xo&&n!==1073741824&&(e.flags|=128,r=!0,la(o,!1),e.lanes=4194304);o.isBackwards?(s.sibling=e.child,e.child=s):(n=o.last,n!==null?n.sibling=s:e.child=s,o.last=s)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=Fe(),e.sibling=null,n=Ae.current,me(Ae,r?n&1|2:n&1),e):(ot(e),null);case 22:case 23:return rm(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&(e.mode&1)!==0?(Lt&1073741824)!==0&&(ot(e),e.subtreeFlags&6&&(e.flags|=8192)):ot(e),null;case 24:return null;case 25:return null}throw Error(R(156,e.tag))}function qR(t,e){switch($g(e),e.tag){case 1:return Ct(e.type)&&cu(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Zo(),_e(Et),_e(at),qg(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 5:return Wg(e),null;case 13:if(_e(Ae),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(R(340));Ko()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return _e(Ae),null;case 4:return Zo(),null;case 10:return zg(e.type._context),null;case 22:case 23:return rm(),null;case 24:return null;default:return null}}var Hc=!1,st=!1,KR=typeof WeakSet=="function"?WeakSet:Set,D=null;function $o(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ie(t,e,r)}else n.current=null}function fg(t,e,n){try{n()}catch(r){Ie(t,e,r)}}var Lw=!1;function GR(t,e){if(Zh=ou,t=Rx(),Mg(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var g;f!==n||i!==0&&f.nodeType!==3||(a=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===t)break t;if(h===n&&++c===i&&(a=s),h===o&&++u===r&&(l=s),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Yh={focusedElem:t,selectionRange:n},ou=!1,D=e;D!==null;)if(e=D,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,D=t;else for(;D!==null;){e=D;try{var v=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var _=v.memoizedProps,x=v.memoizedState,d=e.stateNode,p=d.getSnapshotBeforeUpdate(e.elementType===e.type?_:ln(e.type,_),x);d.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var m=e.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(R(163))}}catch(y){Ie(e,e.return,y)}if(t=e.sibling,t!==null){t.return=e.return,D=t;break}D=e.return}return v=Lw,Lw=!1,v}function xa(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&t)===t){var o=i.destroy;i.destroy=void 0,o!==void 0&&fg(e,n,o)}i=i.next}while(i!==r)}}function Ou(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function pg(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function ES(t){var e=t.alternate;e!==null&&(t.alternate=null,ES(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[An],delete e[La],delete e[Jh],delete e[IR],delete e[PR])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function CS(t){return t.tag===5||t.tag===3||t.tag===4}function Mw(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||CS(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function hg(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=lu));else if(r!==4&&(t=t.child,t!==null))for(hg(t,e,n),t=t.sibling;t!==null;)hg(t,e,n),t=t.sibling}function gg(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(gg(t,e,n),t=t.sibling;t!==null;)gg(t,e,n),t=t.sibling}var Qe=null,cn=!1;function Or(t,e,n){for(n=n.child;n!==null;)AS(t,e,n),n=n.sibling}function AS(t,e,n){if(Tn&&typeof Tn.onCommitFiberUnmount=="function")try{Tn.onCommitFiberUnmount(ku,n)}catch{}switch(n.tag){case 5:st||$o(n,e);case 6:var r=Qe,i=cn;Qe=null,Or(t,e,n),Qe=r,cn=i,Qe!==null&&(cn?(t=Qe,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Qe.removeChild(n.stateNode));break;case 18:Qe!==null&&(cn?(t=Qe,n=n.stateNode,t.nodeType===8?yh(t.parentNode,n):t.nodeType===1&&yh(t,n),Ra(t)):yh(Qe,n.stateNode));break;case 4:r=Qe,i=cn,Qe=n.stateNode.containerInfo,cn=!0,Or(t,e,n),Qe=r,cn=i;break;case 0:case 11:case 14:case 15:if(!st&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&((o&2)!==0||(o&4)!==0)&&fg(n,e,s),i=i.next}while(i!==r)}Or(t,e,n);break;case 1:if(!st&&($o(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ie(n,e,a)}Or(t,e,n);break;case 21:Or(t,e,n);break;case 22:n.mode&1?(st=(r=st)||n.memoizedState!==null,Or(t,e,n),st=r):Or(t,e,n);break;default:Or(t,e,n)}}function Fw(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new KR),e.forEach(function(r){var i=rI.bind(null,t,r);n.has(r)||(n.add(r),r.then(i,i))})}}function an(t,e){var n=e.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var o=t,s=e,a=s;e:for(;a!==null;){switch(a.tag){case 5:Qe=a.stateNode,cn=!1;break e;case 3:Qe=a.stateNode.containerInfo,cn=!0;break e;case 4:Qe=a.stateNode.containerInfo,cn=!0;break e}a=a.return}if(Qe===null)throw Error(R(160));AS(o,s,i),Qe=null,cn=!1;var l=i.alternate;l!==null&&(l.return=null),i.return=null}catch(c){Ie(i,e,c)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)TS(e,t),e=e.sibling}function TS(t,e){var n=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(an(e,t),En(t),r&4){try{xa(3,t,t.return),Ou(3,t)}catch(_){Ie(t,t.return,_)}try{xa(5,t,t.return)}catch(_){Ie(t,t.return,_)}}break;case 1:an(e,t),En(t),r&512&&n!==null&&$o(n,n.return);break;case 5:if(an(e,t),En(t),r&512&&n!==null&&$o(n,n.return),t.flags&32){var i=t.stateNode;try{Ea(i,"")}catch(_){Ie(t,t.return,_)}}if(r&4&&(i=t.stateNode,i!=null)){var o=t.memoizedProps,s=n!==null?n.memoizedProps:o,a=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&Yw(i,o),Bh(a,s);var c=Bh(a,o);for(s=0;s<l.length;s+=2){var u=l[s],f=l[s+1];u==="style"?tx(i,f):u==="dangerouslySetInnerHTML"?Jw(i,f):u==="children"?Ea(i,f):Sg(i,u,f,c)}switch(a){case"input":Lh(i,o);break;case"textarea":Xw(i,o);break;case"select":var h=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!o.multiple;var g=o.value;g!=null?Bo(i,!!o.multiple,g,!1):h!==!!o.multiple&&(o.defaultValue!=null?Bo(i,!!o.multiple,o.defaultValue,!0):Bo(i,!!o.multiple,o.multiple?[]:"",!1))}i[La]=o}catch(_){Ie(t,t.return,_)}}break;case 6:if(an(e,t),En(t),r&4){if(t.stateNode===null)throw Error(R(162));i=t.stateNode,o=t.memoizedProps;try{i.nodeValue=o}catch(_){Ie(t,t.return,_)}}break;case 3:if(an(e,t),En(t),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ra(e.containerInfo)}catch(_){Ie(t,t.return,_)}break;case 4:an(e,t),En(t);break;case 13:an(e,t),En(t),i=t.child,i.flags&8192&&(o=i.memoizedState!==null,i.stateNode.isHidden=o,!o||i.alternate!==null&&i.alternate.memoizedState!==null||(tm=Fe())),r&4&&Fw(t);break;case 22:if(u=n!==null&&n.memoizedState!==null,t.mode&1?(st=(c=st)||u,an(e,t),st=c):an(e,t),En(t),r&8192){if(c=t.memoizedState!==null,(t.stateNode.isHidden=c)&&!u&&(t.mode&1)!==0)for(D=t,u=t.child;u!==null;){for(f=D=u;D!==null;){switch(h=D,g=h.child,h.tag){case 0:case 11:case 14:case 15:xa(4,h,h.return);break;case 1:$o(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{e=r,v.props=e.memoizedProps,v.state=e.memoizedState,v.componentWillUnmount()}catch(_){Ie(r,n,_)}}break;case 5:$o(h,h.return);break;case 22:if(h.memoizedState!==null){Dw(f);continue}}g!==null?(g.return=h,D=g):Dw(f)}u=u.sibling}e:for(u=null,f=t;;){if(f.tag===5){if(u===null){u=f;try{i=f.stateNode,c?(o=i.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=ex("display",s))}catch(_){Ie(t,t.return,_)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(_){Ie(t,t.return,_)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===t)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:an(e,t),En(t),r&4&&Fw(t);break;case 21:break;default:an(e,t),En(t)}}function En(t){var e=t.flags;if(e&2){try{e:{for(var n=t.return;n!==null;){if(CS(n)){var r=n;break e}n=n.return}throw Error(R(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(Ea(i,""),r.flags&=-33);var o=Mw(t);gg(t,o,i);break;case 3:case 4:var s=r.stateNode.containerInfo,a=Mw(t);hg(t,a,s);break;default:throw Error(R(161))}}catch(l){Ie(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function ZR(t,e,n){D=t,RS(t,e,n)}function RS(t,e,n){for(var r=(t.mode&1)!==0;D!==null;){var i=D,o=i.child;if(i.tag===22&&r){var s=i.memoizedState!==null||Hc;if(!s){var a=i.alternate,l=a!==null&&a.memoizedState!==null||st;a=Hc;var c=st;if(Hc=s,(st=l)&&!c)for(D=i;D!==null;)s=D,l=s.child,s.tag===22&&s.memoizedState!==null?Bw(i):l!==null?(l.return=s,D=l):Bw(i);for(;o!==null;)D=o,RS(o,e,n),o=o.sibling;D=i,Hc=a,st=c}$w(t,e,n)}else(i.subtreeFlags&8772)!==0&&o!==null?(o.return=i,D=o):$w(t,e,n)}}function $w(t){for(;D!==null;){var e=D;if((e.flags&8772)!==0){var n=e.alternate;try{if((e.flags&8772)!==0)switch(e.tag){case 0:case 11:case 15:st||Ou(5,e);break;case 1:var r=e.stateNode;if(e.flags&4&&!st)if(n===null)r.componentDidMount();else{var i=e.elementType===e.type?n.memoizedProps:ln(e.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=e.updateQueue;o!==null&&xw(e,o,r);break;case 3:var s=e.updateQueue;if(s!==null){if(n=null,e.child!==null)switch(e.child.tag){case 5:n=e.child.stateNode;break;case 1:n=e.child.stateNode}xw(e,s,n)}break;case 5:var a=e.stateNode;if(n===null&&e.flags&4){n=a;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var c=e.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&Ra(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(R(163))}st||e.flags&512&&pg(e)}catch(h){Ie(e,e.return,h)}}if(e===t){D=null;break}if(n=e.sibling,n!==null){n.return=e.return,D=n;break}D=e.return}}function Dw(t){for(;D!==null;){var e=D;if(e===t){D=null;break}var n=e.sibling;if(n!==null){n.return=e.return,D=n;break}D=e.return}}function Bw(t){for(;D!==null;){var e=D;try{switch(e.tag){case 0:case 11:case 15:var n=e.return;try{Ou(4,e)}catch(l){Ie(e,n,l)}break;case 1:var r=e.stateNode;if(typeof r.componentDidMount=="function"){var i=e.return;try{r.componentDidMount()}catch(l){Ie(e,i,l)}}var o=e.return;try{pg(e)}catch(l){Ie(e,o,l)}break;case 5:var s=e.return;try{pg(e)}catch(l){Ie(e,s,l)}}}catch(l){Ie(e,e.return,l)}if(e===t){D=null;break}var a=e.sibling;if(a!==null){a.return=e.return,D=a;break}D=e.return}}var YR=Math.ceil,_u=ir.ReactCurrentDispatcher,Jg=ir.ReactCurrentOwner,Gt=ir.ReactCurrentBatchConfig,se=0,Ke=null,Be=null,Je=0,Lt=0,Do=Yr(0),Ue=0,Va=null,Ri=0,Nu=0,em=0,Sa=null,bt=null,tm=0,Xo=1/0,Zn=null,wu=!1,mg=null,Ur=null,jc=!1,Dr=null,xu=0,ba=0,vg=null,Xc=-1,Qc=0;function ht(){return(se&6)!==0?Fe():Xc!==-1?Xc:Xc=Fe()}function Wr(t){return(t.mode&1)===0?1:(se&2)!==0&&Je!==0?Je&-Je:NR.transition!==null?(Qc===0&&(Qc=px()),Qc):(t=ue,t!==0||(t=window.event,t=t===void 0?16:wx(t.type)),t)}function fn(t,e,n,r){if(50<ba)throw ba=0,vg=null,Error(R(185));za(t,n,r),((se&2)===0||t!==Ke)&&(t===Ke&&((se&2)===0&&(Nu|=n),Ue===4&&Fr(t,Je)),At(t,r),n===1&&se===0&&(e.mode&1)===0&&(Xo=Fe()+500,Ru&&Xr()))}function At(t,e){var n=t.callbackNode;MT(t,e);var r=iu(t,t===Ke?Je:0);if(r===0)n!==null&&K0(n),t.callbackNode=null,t.callbackPriority=0;else if(e=r&-r,t.callbackPriority!==e){if(n!=null&&K0(n),e===1)t.tag===0?OR(Vw.bind(null,t)):Bx(Vw.bind(null,t)),TR(function(){(se&6)===0&&Xr()}),n=null;else{switch(hx(r)){case 1:n=Ag;break;case 4:n=dx;break;case 16:n=ru;break;case 536870912:n=fx;break;default:n=ru}n=$S(n,IS.bind(null,t))}t.callbackPriority=e,t.callbackNode=n}}function IS(t,e){if(Xc=-1,Qc=0,(se&6)!==0)throw Error(R(327));var n=t.callbackNode;if(Uo()&&t.callbackNode!==n)return null;var r=iu(t,t===Ke?Je:0);if(r===0)return null;if((r&30)!==0||(r&t.expiredLanes)!==0||e)e=Su(t,r);else{e=r;var i=se;se|=2;var o=OS();(Ke!==t||Je!==e)&&(Zn=null,Xo=Fe()+500,ki(t,e));do try{JR();break}catch(a){PS(t,a)}while(!0);Vg(),_u.current=o,se=i,Be!==null?e=0:(Ke=null,Je=0,e=Ue)}if(e!==0){if(e===2&&(i=Uh(t),i!==0&&(r=i,e=yg(t,i))),e===1)throw n=Va,ki(t,0),Fr(t,r),At(t,Fe()),n;if(e===6)Fr(t,r);else{if(i=t.current.alternate,(r&30)===0&&!XR(i)&&(e=Su(t,r),e===2&&(o=Uh(t),o!==0&&(r=o,e=yg(t,o))),e===1))throw n=Va,ki(t,0),Fr(t,r),At(t,Fe()),n;switch(t.finishedWork=i,t.finishedLanes=r,e){case 0:case 1:throw Error(R(345));case 2:wi(t,bt,Zn);break;case 3:if(Fr(t,r),(r&130023424)===r&&(e=tm+500-Fe(),10<e)){if(iu(t,0)!==0)break;if(i=t.suspendedLanes,(i&r)!==r){ht(),t.pingedLanes|=t.suspendedLanes&i;break}t.timeoutHandle=Qh(wi.bind(null,t,bt,Zn),e);break}wi(t,bt,Zn);break;case 4:if(Fr(t,r),(r&4194240)===r)break;for(e=t.eventTimes,i=-1;0<r;){var s=31-dn(r);o=1<<s,s=e[s],s>i&&(i=s),r&=~o}if(r=i,r=Fe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*YR(r/1960))-r,10<r){t.timeoutHandle=Qh(wi.bind(null,t,bt,Zn),r);break}wi(t,bt,Zn);break;case 5:wi(t,bt,Zn);break;default:throw Error(R(329))}}}return At(t,Fe()),t.callbackNode===n?IS.bind(null,t):null}function yg(t,e){var n=Sa;return t.current.memoizedState.isDehydrated&&(ki(t,e).flags|=256),t=Su(t,e),t!==2&&(e=bt,bt=n,e!==null&&_g(e)),t}function _g(t){bt===null?bt=t:bt.push.apply(bt,t)}function XR(t){for(var e=t;;){if(e.flags&16384){var n=e.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],o=i.getSnapshot;i=i.value;try{if(!pn(o(),i))return!1}catch{return!1}}}if(n=e.child,e.subtreeFlags&16384&&n!==null)n.return=e,e=n;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function Fr(t,e){for(e&=~em,e&=~Nu,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var n=31-dn(e),r=1<<n;t[n]=-1,e&=~r}}function Vw(t){if((se&6)!==0)throw Error(R(327));Uo();var e=iu(t,0);if((e&1)===0)return At(t,Fe()),null;var n=Su(t,e);if(t.tag!==0&&n===2){var r=Uh(t);r!==0&&(e=r,n=yg(t,r))}if(n===1)throw n=Va,ki(t,0),Fr(t,e),At(t,Fe()),n;if(n===6)throw Error(R(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,wi(t,bt,Zn),At(t,Fe()),null}function nm(t,e){var n=se;se|=1;try{return t(e)}finally{se=n,se===0&&(Xo=Fe()+500,Ru&&Xr())}}function Ii(t){Dr!==null&&Dr.tag===0&&(se&6)===0&&Uo();var e=se;se|=1;var n=Gt.transition,r=ue;try{if(Gt.transition=null,ue=1,t)return t()}finally{ue=r,Gt.transition=n,se=e,(se&6)===0&&Xr()}}function rm(){Lt=Do.current,_e(Do)}function ki(t,e){t.finishedWork=null,t.finishedLanes=0;var n=t.timeoutHandle;if(n!==-1&&(t.timeoutHandle=-1,AR(n)),Be!==null)for(n=Be.return;n!==null;){var r=n;switch($g(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&cu();break;case 3:Zo(),_e(Et),_e(at),qg();break;case 5:Wg(r);break;case 4:Zo();break;case 13:_e(Ae);break;case 19:_e(Ae);break;case 10:zg(r.type._context);break;case 22:case 23:rm()}n=n.return}if(Ke=t,Be=t=qr(t.current,null),Je=Lt=e,Ue=0,Va=null,em=Nu=Ri=0,bt=Sa=null,Si!==null){for(e=0;e<Si.length;e++)if(n=Si[e],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,o=n.pending;if(o!==null){var s=o.next;o.next=i,r.next=s}n.pending=r}Si=null}return t}function PS(t,e){do{var n=Be;try{if(Vg(),Gc.current=yu,vu){for(var r=Te.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}vu=!1}if(Ti=0,qe=je=Te=null,wa=!1,$a=0,Jg.current=null,n===null||n.return===null){Ue=1,Va=e,Be=null;break}e:{var o=t,s=n.return,a=n,l=e;if(e=Je,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if((u.mode&1)===0&&(f===0||f===11||f===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var g=Aw(s);if(g!==null){g.flags&=-257,Tw(g,s,a,o,e),g.mode&1&&Cw(o,c,e),e=g,l=c;var v=e.updateQueue;if(v===null){var _=new Set;_.add(l),e.updateQueue=_}else v.add(l);break e}else{if((e&1)===0){Cw(o,c,e),im();break e}l=Error(R(426))}}else if(ke&&a.mode&1){var x=Aw(s);if(x!==null){(x.flags&65536)===0&&(x.flags|=256),Tw(x,s,a,o,e),Dg(Yo(l,a));break e}}o=l=Yo(l,a),Ue!==4&&(Ue=2),Sa===null?Sa=[o]:Sa.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,e&=-e,o.lanes|=e;var d=hS(o,l,e);ww(o,d);break e;case 1:a=l;var p=o.type,m=o.stateNode;if((o.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Ur===null||!Ur.has(m)))){o.flags|=65536,e&=-e,o.lanes|=e;var y=gS(o,a,e);ww(o,y);break e}}o=o.return}while(o!==null)}LS(n)}catch(w){e=w,Be===n&&n!==null&&(Be=n=n.return);continue}break}while(!0)}function OS(){var t=_u.current;return _u.current=yu,t===null?yu:t}function im(){(Ue===0||Ue===3||Ue===2)&&(Ue=4),Ke===null||(Ri&268435455)===0&&(Nu&268435455)===0||Fr(Ke,Je)}function Su(t,e){var n=se;se|=2;var r=OS();(Ke!==t||Je!==e)&&(Zn=null,ki(t,e));do try{QR();break}catch(i){PS(t,i)}while(!0);if(Vg(),se=n,_u.current=r,Be!==null)throw Error(R(261));return Ke=null,Je=0,Ue}function QR(){for(;Be!==null;)NS(Be)}function JR(){for(;Be!==null&&!CT();)NS(Be)}function NS(t){var e=FS(t.alternate,t,Lt);t.memoizedProps=t.pendingProps,e===null?LS(t):Be=e,Jg.current=null}function LS(t){var e=t;do{var n=e.alternate;if(t=e.return,(e.flags&32768)===0){if(n=WR(n,e,Lt),n!==null){Be=n;return}}else{if(n=qR(n,e),n!==null){n.flags&=32767,Be=n;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Ue=6,Be=null;return}}if(e=e.sibling,e!==null){Be=e;return}Be=e=t}while(e!==null);Ue===0&&(Ue=5)}function wi(t,e,n){var r=ue,i=Gt.transition;try{Gt.transition=null,ue=1,eI(t,e,n,r)}finally{Gt.transition=i,ue=r}return null}function eI(t,e,n,r){do Uo();while(Dr!==null);if((se&6)!==0)throw Error(R(327));n=t.finishedWork;var i=t.finishedLanes;if(n===null)return null;if(t.finishedWork=null,t.finishedLanes=0,n===t.current)throw Error(R(177));t.callbackNode=null,t.callbackPriority=0;var o=n.lanes|n.childLanes;if(FT(t,o),t===Ke&&(Be=Ke=null,Je=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||jc||(jc=!0,$S(ru,function(){return Uo(),null})),o=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||o){o=Gt.transition,Gt.transition=null;var s=ue;ue=1;var a=se;se|=4,Jg.current=null,GR(t,n),TS(n,t),SR(Yh),ou=!!Zh,Yh=Zh=null,t.current=n,ZR(n,t,i),AT(),se=a,ue=s,Gt.transition=o}else t.current=n;if(jc&&(jc=!1,Dr=t,xu=i),o=t.pendingLanes,o===0&&(Ur=null),IT(n.stateNode,r),At(t,Fe()),e!==null)for(r=t.onRecoverableError,n=0;n<e.length;n++)i=e[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(wu)throw wu=!1,t=mg,mg=null,t;return(xu&1)!==0&&t.tag!==0&&Uo(),o=t.pendingLanes,(o&1)!==0?t===vg?ba++:(ba=0,vg=t):ba=0,Xr(),null}function Uo(){if(Dr!==null){var t=hx(xu),e=Gt.transition,n=ue;try{if(Gt.transition=null,ue=16>t?16:t,Dr===null)var r=!1;else{if(t=Dr,Dr=null,xu=0,(se&6)!==0)throw Error(R(331));var i=se;for(se|=4,D=t.current;D!==null;){var o=D,s=o.child;if((D.flags&16)!==0){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(D=c;D!==null;){var u=D;switch(u.tag){case 0:case 11:case 15:xa(8,u,o)}var f=u.child;if(f!==null)f.return=u,D=f;else for(;D!==null;){u=D;var h=u.sibling,g=u.return;if(ES(u),u===c){D=null;break}if(h!==null){h.return=g,D=h;break}D=g}}}var v=o.alternate;if(v!==null){var _=v.child;if(_!==null){v.child=null;do{var x=_.sibling;_.sibling=null,_=x}while(_!==null)}}D=o}}if((o.subtreeFlags&2064)!==0&&s!==null)s.return=o,D=s;else e:for(;D!==null;){if(o=D,(o.flags&2048)!==0)switch(o.tag){case 0:case 11:case 15:xa(9,o,o.return)}var d=o.sibling;if(d!==null){d.return=o.return,D=d;break e}D=o.return}}var p=t.current;for(D=p;D!==null;){s=D;var m=s.child;if((s.subtreeFlags&2064)!==0&&m!==null)m.return=s,D=m;else e:for(s=p;D!==null;){if(a=D,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:Ou(9,a)}}catch(w){Ie(a,a.return,w)}if(a===s){D=null;break e}var y=a.sibling;if(y!==null){y.return=a.return,D=y;break e}D=a.return}}if(se=i,Xr(),Tn&&typeof Tn.onPostCommitFiberRoot=="function")try{Tn.onPostCommitFiberRoot(ku,t)}catch{}r=!0}return r}finally{ue=n,Gt.transition=e}}return!1}function zw(t,e,n){e=Yo(n,e),e=hS(t,e,1),t=jr(t,e,1),e=ht(),t!==null&&(za(t,1,e),At(t,e))}function Ie(t,e,n){if(t.tag===3)zw(t,t,n);else for(;e!==null;){if(e.tag===3){zw(e,t,n);break}else if(e.tag===1){var r=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ur===null||!Ur.has(r))){t=Yo(n,t),t=gS(e,t,1),e=jr(e,t,1),t=ht(),e!==null&&(za(e,1,t),At(e,t));break}}e=e.return}}function tI(t,e,n){var r=t.pingCache;r!==null&&r.delete(e),e=ht(),t.pingedLanes|=t.suspendedLanes&n,Ke===t&&(Je&n)===n&&(Ue===4||Ue===3&&(Je&130023424)===Je&&500>Fe()-tm?ki(t,0):em|=n),At(t,e)}function MS(t,e){e===0&&((t.mode&1)===0?e=1:(e=Rc,Rc<<=1,(Rc&130023424)===0&&(Rc=4194304)));var n=ht();t=nr(t,e),t!==null&&(za(t,e,n),At(t,n))}function nI(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),MS(t,n)}function rI(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,i=t.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(R(314))}r!==null&&r.delete(e),MS(t,n)}var FS;FS=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Et.current)kt=!0;else{if((t.lanes&n)===0&&(e.flags&128)===0)return kt=!1,UR(t,e,n);kt=(t.flags&131072)!==0}else kt=!1,ke&&(e.flags&1048576)!==0&&Vx(e,fu,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Yc(t,e),t=e.pendingProps;var i=qo(e,at.current);jo(e,n),i=Gg(null,e,r,t,i,n);var o=Zg();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ct(r)?(o=!0,uu(e)):o=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,jg(e),i.updater=Pu,e.stateNode=i,i._reactInternals=e,og(e,r,t,n),e=lg(null,e,r,!0,o,n)):(e.tag=0,ke&&o&&Fg(e),pt(null,e,i,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Yc(t,e),t=e.pendingProps,i=r._init,r=i(r._payload),e.type=r,i=e.tag=oI(r),t=ln(r,t),i){case 0:e=ag(null,e,r,t,n);break e;case 1:e=Pw(null,e,r,t,n);break e;case 11:e=Rw(null,e,r,t,n);break e;case 14:e=Iw(null,e,r,ln(r.type,t),n);break e}throw Error(R(306,r,""))}return e;case 0:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ln(r,i),ag(t,e,r,i,n);case 1:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ln(r,i),Pw(t,e,r,i,n);case 3:e:{if(_S(e),t===null)throw Error(R(387));r=e.pendingProps,o=e.memoizedState,i=o.element,qx(t,e),gu(e,r,null,n);var s=e.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=o,e.memoizedState=o,e.flags&256){i=Yo(Error(R(423)),e),e=Ow(t,e,r,n,i);break e}else if(r!==i){i=Yo(Error(R(424)),e),e=Ow(t,e,r,n,i);break e}else for(Mt=Hr(e.stateNode.containerInfo.firstChild),Ft=e,ke=!0,un=null,n=Ux(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ko(),r===i){e=rr(t,e,n);break e}pt(t,e,r,n)}e=e.child}return e;case 5:return Kx(e),t===null&&ng(e),r=e.type,i=e.pendingProps,o=t!==null?t.memoizedProps:null,s=i.children,Xh(r,i)?s=null:o!==null&&Xh(r,o)&&(e.flags|=32),yS(t,e),pt(t,e,s,n),e.child;case 6:return t===null&&ng(e),null;case 13:return wS(t,e,n);case 4:return Ug(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Go(e,null,r,n):pt(t,e,r,n),e.child;case 11:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ln(r,i),Rw(t,e,r,i,n);case 7:return pt(t,e,e.pendingProps,n),e.child;case 8:return pt(t,e,e.pendingProps.children,n),e.child;case 12:return pt(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,i=e.pendingProps,o=e.memoizedProps,s=i.value,me(pu,r._currentValue),r._currentValue=s,o!==null)if(pn(o.value,s)){if(o.children===i.children&&!Et.current){e=rr(t,e,n);break e}}else for(o=e.child,o!==null&&(o.return=e);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=Jn(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),rg(o.return,n,e),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===e.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(R(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),rg(s,n,e),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===e){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}pt(t,e,i.children,n),e=e.child}return e;case 9:return i=e.type,r=e.pendingProps.children,jo(e,n),i=Zt(i),r=r(i),e.flags|=1,pt(t,e,r,n),e.child;case 14:return r=e.type,i=ln(r,e.pendingProps),i=ln(r.type,i),Iw(t,e,r,i,n);case 15:return mS(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,i=e.pendingProps,i=e.elementType===r?i:ln(r,i),Yc(t,e),e.tag=1,Ct(r)?(t=!0,uu(e)):t=!1,jo(e,n),pS(e,r,i),og(e,r,i,n),lg(null,e,r,!0,t,n);case 19:return xS(t,e,n);case 22:return vS(t,e,n)}throw Error(R(156,e.tag))};function $S(t,e){return ux(t,e)}function iI(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kt(t,e,n,r){return new iI(t,e,n,r)}function om(t){return t=t.prototype,!(!t||!t.isReactComponent)}function oI(t){if(typeof t=="function")return om(t)?1:0;if(t!=null){if(t=t.$$typeof,t===kg)return 11;if(t===Eg)return 14}return 2}function qr(t,e){var n=t.alternate;return n===null?(n=Kt(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function Jc(t,e,n,r,i,o){var s=2;if(r=t,typeof t=="function")om(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case To:return Ei(n.children,i,o,e);case bg:s=8,i|=8;break;case Rh:return t=Kt(12,n,e,i|2),t.elementType=Rh,t.lanes=o,t;case Ih:return t=Kt(13,n,e,i),t.elementType=Ih,t.lanes=o,t;case Ph:return t=Kt(19,n,e,i),t.elementType=Ph,t.lanes=o,t;case Kw:return Lu(n,i,o,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Ww:s=10;break e;case qw:s=9;break e;case kg:s=11;break e;case Eg:s=14;break e;case Nr:s=16,r=null;break e}throw Error(R(130,t==null?t:typeof t,""))}return e=Kt(s,n,e,i),e.elementType=t,e.type=r,e.lanes=o,e}function Ei(t,e,n,r){return t=Kt(7,t,r,e),t.lanes=n,t}function Lu(t,e,n,r){return t=Kt(22,t,r,e),t.elementType=Kw,t.lanes=n,t.stateNode={isHidden:!1},t}function Ch(t,e,n){return t=Kt(6,t,null,e),t.lanes=n,t}function Ah(t,e,n){return e=Kt(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function sI(t,e,n,r,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=uh(0),this.expirationTimes=uh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=uh(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function sm(t,e,n,r,i,o,s,a,l){return t=new sI(t,e,n,a,l),e===1?(e=1,o===!0&&(e|=8)):e=0,o=Kt(3,null,null,e),t.current=o,o.stateNode=t,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jg(o),t}function aI(t,e,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ao,key:r==null?null:""+r,children:t,containerInfo:e,implementation:n}}function DS(t){if(!t)return Gr;t=t._reactInternals;e:{if(Oi(t)!==t||t.tag!==1)throw Error(R(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Ct(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(R(171))}if(t.tag===1){var n=t.type;if(Ct(n))return Dx(t,n,e)}return e}function BS(t,e,n,r,i,o,s,a,l){return t=sm(n,r,!0,t,i,o,s,a,l),t.context=DS(null),n=t.current,r=ht(),i=Wr(n),o=Jn(r,i),o.callback=e??null,jr(n,o,i),t.current.lanes=i,za(t,i,r),At(t,r),t}function Mu(t,e,n,r){var i=e.current,o=ht(),s=Wr(i);return n=DS(n),e.context===null?e.context=n:e.pendingContext=n,e=Jn(o,s),e.payload={element:t},r=r===void 0?null:r,r!==null&&(e.callback=r),t=jr(i,e,s),t!==null&&(fn(t,i,s,o),Kc(t,i,s)),s}function bu(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function Hw(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var n=t.retryLane;t.retryLane=n!==0&&n<e?n:e}}function am(t,e){Hw(t,e),(t=t.alternate)&&Hw(t,e)}function lI(){return null}var VS=typeof reportError=="function"?reportError:function(t){console.error(t)};function lm(t){this._internalRoot=t}Fu.prototype.render=lm.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(R(409));Mu(t,e,null,null)};Fu.prototype.unmount=lm.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Ii(function(){Mu(null,t,null,null)}),e[tr]=null}};function Fu(t){this._internalRoot=t}Fu.prototype.unstable_scheduleHydration=function(t){if(t){var e=vx();t={blockedOn:null,target:t,priority:e};for(var n=0;n<Mr.length&&e!==0&&e<Mr[n].priority;n++);Mr.splice(n,0,t),n===0&&_x(t)}};function cm(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function $u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function jw(){}function cI(t,e,n,r,i){if(i){if(typeof r=="function"){var o=r;r=function(){var c=bu(s);o.call(c)}}var s=BS(e,r,t,0,null,!1,!1,"",jw);return t._reactRootContainer=s,t[tr]=s.current,Oa(t.nodeType===8?t.parentNode:t),Ii(),s}for(;i=t.lastChild;)t.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var c=bu(l);a.call(c)}}var l=sm(t,0,!1,null,null,!1,!1,"",jw);return t._reactRootContainer=l,t[tr]=l.current,Oa(t.nodeType===8?t.parentNode:t),Ii(function(){Mu(e,l,n,r)}),l}function Du(t,e,n,r,i){var o=n._reactRootContainer;if(o){var s=o;if(typeof i=="function"){var a=i;i=function(){var l=bu(s);a.call(l)}}Mu(e,s,t,i)}else s=cI(n,e,t,i,r);return bu(s)}gx=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var n=pa(e.pendingLanes);n!==0&&(Tg(e,n|1),At(e,Fe()),(se&6)===0&&(Xo=Fe()+500,Xr()))}break;case 13:Ii(function(){var r=nr(t,1);if(r!==null){var i=ht();fn(r,t,1,i)}}),am(t,1)}};Rg=function(t){if(t.tag===13){var e=nr(t,134217728);if(e!==null){var n=ht();fn(e,t,134217728,n)}am(t,134217728)}};mx=function(t){if(t.tag===13){var e=Wr(t),n=nr(t,e);if(n!==null){var r=ht();fn(n,t,e,r)}am(t,e)}};vx=function(){return ue};yx=function(t,e){var n=ue;try{return ue=t,e()}finally{ue=n}};zh=function(t,e,n){switch(e){case"input":if(Lh(t,n),e=n.name,n.type==="radio"&&e!=null){for(n=t;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<n.length;e++){var r=n[e];if(r!==t&&r.form===t.form){var i=Tu(r);if(!i)throw Error(R(90));Zw(r),Lh(r,i)}}}break;case"textarea":Xw(t,n);break;case"select":e=n.value,e!=null&&Bo(t,!!n.multiple,e,!1)}};ix=nm;ox=Ii;var uI={usingClientEntryPoint:!1,Events:[ja,Oo,Tu,nx,rx,nm]},ca={findFiberByHostInstance:xi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dI={bundleType:ca.bundleType,version:ca.version,rendererPackageName:ca.rendererPackageName,rendererConfig:ca.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ir.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=lx(t),t===null?null:t.stateNode},findFiberByHostInstance:ca.findFiberByHostInstance||lI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(ua=__REACT_DEVTOOLS_GLOBAL_HOOK__,!ua.isDisabled&&ua.supportsFiber))try{ku=ua.inject(dI),Tn=ua}catch{}var ua;Bt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=uI;Bt.createPortal=function(t,e){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!cm(e))throw Error(R(200));return aI(t,e,null,n)};Bt.createRoot=function(t,e){if(!cm(t))throw Error(R(299));var n=!1,r="",i=VS;return e!=null&&(e.unstable_strictMode===!0&&(n=!0),e.identifierPrefix!==void 0&&(r=e.identifierPrefix),e.onRecoverableError!==void 0&&(i=e.onRecoverableError)),e=sm(t,1,!1,null,null,n,!1,r,i),t[tr]=e.current,Oa(t.nodeType===8?t.parentNode:t),new lm(e)};Bt.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(R(188)):(t=Object.keys(t).join(","),Error(R(268,t)));return t=lx(e),t=t===null?null:t.stateNode,t};Bt.flushSync=function(t){return Ii(t)};Bt.hydrate=function(t,e,n){if(!$u(e))throw Error(R(200));return Du(null,t,e,!0,n)};Bt.hydrateRoot=function(t,e,n){if(!cm(t))throw Error(R(405));var r=n!=null&&n.hydratedSources||null,i=!1,o="",s=VS;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),e=BS(e,null,t,1,n??null,i,!1,o,s),t[tr]=e.current,Oa(t),r)for(t=0;t<r.length;t++)n=r[t],i=n._getVersion,i=i(n._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[n,i]:e.mutableSourceEagerHydrationData.push(n,i);return new Fu(e)};Bt.render=function(t,e,n){if(!$u(e))throw Error(R(200));return Du(null,t,e,!1,n)};Bt.unmountComponentAtNode=function(t){if(!$u(t))throw Error(R(40));return t._reactRootContainer?(Ii(function(){Du(null,null,t,!1,function(){t._reactRootContainer=null,t[tr]=null})}),!0):!1};Bt.unstable_batchedUpdates=nm;Bt.unstable_renderSubtreeIntoContainer=function(t,e,n,r){if(!$u(n))throw Error(R(200));if(t==null||t._reactInternals===void 0)throw Error(R(38));return Du(t,e,n,!1,r)};Bt.version="18.3.1-next-f1338f8080-20240426"});var Bu=Vn((fL,jS)=>{"use strict";function HS(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(HS)}catch(t){console.error(t)}}HS(),jS.exports=zS()});var GS=Vn(hm=>{"use strict";var KS=Bu();hm.createRoot=KS.createRoot,hm.hydrateRoot=KS.hydrateRoot;var IL});var OO={};fv(OO,{ANIMATION_KEYFRAMES:()=>gs,ActivationConfigZ:()=>ek,AnchorStateZ:()=>Cb,AnchorVisibleConditionZ:()=>Vb,AppRegistry:()=>ll,AugmentationZ:()=>Ab,BoundingBoxZ:()=>Eb,CanvasEvents:()=>on,CanvasRecipeZ:()=>Yu,ConditionZ:()=>Rm,ContextManager:()=>Xa,CooldownActiveConditionZ:()=>qb,DecisionStrategyZ:()=>Im,DismissedConditionZ:()=>Wb,EVENT_SCHEMA_VERSION:()=>vi,EventBus:()=>Qa,EventFilterZ:()=>Pb,EventOccurredConditionZ:()=>zb,EventSourceZ:()=>xm,ExecutorRegistry:()=>ol,ExternalStrategyZ:()=>Qb,FrequencyEntryZ:()=>Lb,FrequencyLimitConditionZ:()=>Kb,HighlightStepZ:()=>_b,ModelStrategyZ:()=>Xb,NormalizedEventZ:()=>Ib,PageContextZ:()=>xb,PageHistoryEntryZ:()=>Sb,PageUrlConditionZ:()=>Db,RUNTIME_VERSION:()=>nv,RouteConditionZ:()=>Bb,RouteFilterZ:()=>Jb,RuleStrategyZ:()=>Zb,RuleZ:()=>Gb,RuntimeContextZ:()=>Tb,RuntimeProvider:()=>yc,STATIC_SLOT_STYLES:()=>Qm,ScoreStrategyZ:()=>Yb,SelectorZ:()=>_m,SessionContextZ:()=>bb,SessionMetricConditionZ:()=>Ub,SessionMetricTracker:()=>Ya,ShadowCanvasOverlay:()=>dm,SmartCanvasApp:()=>pm,SmartCanvasController:()=>Vu,SmartCanvasElement:()=>Hu,SmartCanvasPortal:()=>wI,StandardEvents:()=>be,StateEqualsConditionZ:()=>Hb,StateStore:()=>el,StoredValueZ:()=>Nb,Syntro:()=>sv,TileCard:()=>ko,TileWheel:()=>hI,TooltipStepZ:()=>yb,ViewportConditionZ:()=>jb,ViewportContextZ:()=>kb,WidgetRegistry:()=>al,appRegistry:()=>Rd,applyStaticSlotStyles:()=>yd,cleanupAppContext:()=>Td,contentRuntime:()=>lk,createActionEngine:()=>vd,createAppContext:()=>Ad,createAppLoader:()=>Id,createCanvasConfigFetcher:()=>Ni,createContextManager:()=>Qu,createDecisionEngine:()=>td,createEventBus:()=>cs,createGrowthBookClient:()=>dc,createNoopClient:()=>ql,createOverlayRecipeFetcher:()=>FP,createPostHogClient:()=>Wl,createPostHogNormalizer:()=>Ju,createSessionMetricTracker:()=>Xu,createSmartCanvas:()=>Uu,createSmartCanvasController:()=>fm,createSmartCanvasRuntime:()=>Pd,createStateStore:()=>ed,createSurfaceContainer:()=>bd,createSurfaces:()=>Ed,decodeToken:()=>ul,encodeToken:()=>Od,evaluate:()=>Nm,evaluateCondition:()=>Pm,evaluateRule:()=>Om,evaluateRuleStrategy:()=>tl,evaluateScoreStrategy:()=>nl,evaluateSync:()=>Lm,executorRegistry:()=>li,getAntiFlickerSnippet:()=>nb,getAppIdFromActionKind:()=>ev,getAppIdFromWidgetId:()=>tv,getExecutor:()=>Gk,getSlotAnchorId:()=>sl,getSlotType:()=>ps,getSlotZIndex:()=>kd,hasExecutor:()=>gd,isCoreActionKind:()=>Jm,navigationRuntime:()=>Kk,normalizePostHogEvent:()=>bm,overlaysRuntime:()=>Uk,playEnterAnimation:()=>xd,playExitAnimation:()=>Sd,registerSmartCanvasElement:()=>gm,resolveConfigUri:()=>zu,setupAdjacentPositioning:()=>_d,setupInlinePositioning:()=>wd,shouldNormalizeEvent:()=>km,useDecision:()=>k0,usePageContext:()=>_c,useRuntime:()=>bn,useRuntimeContext:()=>Js,useRuntimeEvents:()=>S0,useRuntimeState:()=>b0,useSessionContext:()=>w0,useShadowCanvasConfig:()=>Up,useViewportContext:()=>x0,validateAction:()=>hr,validateActions:()=>md,validateActivationConfig:()=>GP,validateCondition:()=>qP,validateEventFilter:()=>VP,validateFrequencyEntry:()=>UP,validateNormalizedEvent:()=>BP,validateRecipe:()=>MP,validateRuntimeContext:()=>$P,validateStoredValue:()=>jP,validateStrategy:()=>KP,widgetRegistry:()=>Cd});var C=typeof window<"u"?window:void 0,Ye=typeof globalThis<"u"?globalThis:C;typeof self>"u"&&(Ye.self=Ye),typeof File>"u"&&(Ye.File=function(){});var uy=Array.prototype,gv=uy.forEach,mv=uy.indexOf,Pt=Ye?.navigator,N=Ye?.document,_t=Ye?.location,Yd=Ye?.fetch,Xd=Ye!=null&&Ye.XMLHttpRequest&&"withCredentials"in new Ye.XMLHttpRequest?Ye.XMLHttpRequest:void 0,vv=Ye?.AbortController,yt=Pt?.userAgent,G=C??{},Hn={DEBUG:!1,LIB_VERSION:"1.302.2"};function yv(t,e,n,r,i,o,s){try{var a=t[o](s),l=a.value}catch(c){return void n(c)}a.done?e(l):Promise.resolve(l).then(r,i)}function _v(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(l){yv(o,r,i,s,a,"next",l)}function a(l){yv(o,r,i,s,a,"throw",l)}s(void 0)}))}}function $(){return $=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$.apply(null,arguments)}function dy(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}var M1=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],wv=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return M1.concat(e).some((r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1}))},F1=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function te(t,e){return t.indexOf(e)!==-1}var Hl=function(t){return t.trim()},Qd=function(t){return t.replace(/^\$/,"")},$1=Array.isArray,fy=Object.prototype,py=fy.hasOwnProperty,jl=fy.toString,fe=$1||function(t){return jl.call(t)==="[object Array]"},kr=t=>typeof t=="function",We=t=>t===Object(t)&&!fe(t),so=t=>{if(We(t)){for(var e in t)if(py.call(t,e))return!1;return!0}return!1},O=t=>t===void 0,ze=t=>jl.call(t)=="[object String]",Jd=t=>ze(t)&&t.trim().length===0,qn=t=>t===null,de=t=>O(t)||qn(t),xn=t=>jl.call(t)=="[object Number]",Er=t=>jl.call(t)==="[object Boolean]",D1=t=>t instanceof FormData,B1=t=>te(F1,t);function ef(t){return t===null||typeof t!="object"}function xl(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function hy(t){return!O(Event)&&(function(e,n){try{return e instanceof n}catch{return!1}})(t,Event)}var V1=[!0,"true",1,"1","yes"],Md=t=>te(V1,t),z1=[!1,"false",0,"0","no"];function yn(t,e,n,r,i){return e>n&&(r.warn("min cannot be greater than max."),e=n),xn(t)?t>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+i),yn(i||n,e,n,r))}var tf=class{constructor(e){this.t={},this.i=e.i,this.o=yn(e.bucketSize,0,100,e.h),this.m=yn(e.refillRate,0,this.o,e.h),this.S=yn(e.refillInterval,0,864e5,e.h)}$(e,n){var r=n-e.lastAccess,i=Math.floor(r/this.S);if(i>0){var o=i*this.m;e.tokens=Math.min(e.tokens+o,this.o),e.lastAccess=e.lastAccess+i*this.S}}consumeRateLimit(e){var n,r=Date.now(),i=String(e),o=this.t[i];return o?this.$(o,r):(o={tokens:this.o,lastAccess:r},this.t[i]=o),o.tokens===0||(o.tokens--,o.tokens===0&&((n=this.i)==null||n.call(this,e)),o.tokens===0)}stop(){this.t={}}},dl,xv,Fd,H1=t=>t instanceof Error;function j1(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return Fd&&n.length===xv||(xv=n.length,Fd=n.reduce(((r,i)=>{dl||(dl={});var o=dl[i];if(o)r[o[0]]=o[1];else for(var s=t(i),a=s.length-1;a>=0;a--){var l=s[a],c=l?.filename,u=e[i];if(c&&u){r[c]=u,dl[i]=[c,u];break}}return r}),{})),Fd}}var nf=class{constructor(e,n,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=n,this.modifiers=r}buildFromUnknown(e,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(r,n,0).apply(e),o=this.buildParsingContext(),s=this.parseStacktrace(i,o);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var n=this;return _v((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&fe(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var r,i;return e.cause!=null&&(r=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),n.chunkIdMap)),$({},e,{cause:r,stack:i})}applyChunkIds(e,n){return e.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(e,n){for(var r of this.coercers)if(r.match(e))return r.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return _v((function*(){var r=e;for(var i of n.modifiers)r=yield i(r);return r}))()}convertToExceptionList(e,n){var r,i,o,s={type:e.type,value:e.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(i=n.handled)===null||i===void 0||i,synthetic:(o=e.synthetic)!==null&&o!==void 0&&o}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var a=[s];return e.cause!=null&&a.push(...this.convertToExceptionList(e.cause,$({},n,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:j1(this.stackParser)}}buildCoercingContext(e,n,r){r===void 0&&(r=0);var i=(o,s)=>{if(s<=4){var a=this.buildCoercingContext(e,n,s);return this.applyCoercers(o,a)}};return $({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:e,apply:o=>i(o,r),next:o=>i(o,r+1)})}},uo="?";function rf(t,e,n,r,i){var o={platform:t,filename:e,function:n==="<anonymous>"?uo:n,in_app:!0};return O(r)||(o.lineno=r),O(i)||(o.colno=i),o}var gy=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:uo,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},U1=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,W1=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,q1=/\((\S*)(?::(\d+))(?::(\d+))\)/,K1=(t,e)=>{var n=U1.exec(t);if(n){var[,r,i,o]=n;return rf(e,r,uo,+i,+o)}var s=W1.exec(t);if(s){if(s[2]&&s[2].indexOf("eval")===0){var a=q1.exec(s[2]);a&&(s[2]=a[1],s[3]=a[2],s[4]=a[3])}var[l,c]=gy(s[1]||uo,s[2]);return rf(e,c,l,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},G1=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Z1=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Y1=(t,e)=>{var n=G1.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=Z1.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var i=n[3],o=n[1]||uo;return[o,i]=gy(o,i),rf(e,i,o,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Sv=/\(error: (.*)\)/,bv=50;function X1(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return function(i,o){o===void 0&&(o=0);for(var s=[],a=i.split(`
|
|
9
|
+
`),l=o;l<a.length;l++){var c=a[l];if(!(c.length>1024)){var u=Sv.test(c)?c.replace(Sv,"$1"):c;if(!u.match(/\S*Error: /)){for(var f of n){var h=f(u,t);if(h){s.push(h);break}}if(s.length>=bv)break}}}return(function(g){if(!g.length)return[];var v=Array.from(g);return v.reverse(),v.slice(0,bv).map((_=>{return $({},_,{filename:_.filename||(x=v,x[x.length-1]||{}).filename,function:_.function||uo});var x}))})(s)}}var of=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var r=ze(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return xl(e,"DOMException")}isDOMError(e){return xl(e,"DOMError")}},sf=class{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var r=e.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(e){return e.stacktrace||e.stack||void 0}},af=class{constructor(){}match(e){return xl(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var r,i=n.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},Q1=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,lf=class{match(e){return typeof e=="string"}coerce(e,n){var r,[i,o]=this.getInfos(e);return{type:i??"Error",value:o??e,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var n="Error",r=e,i=e.match(Q1);return i&&(n=i[1],r=i[2]),[n,r]}},J1=["fatal","error","warning","log","info","debug"];function my(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>e))return r===n.length||i.length<=e?i:i.slice(0,e)+"..."}return""}var cf=class{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var r,i=this.getErrorPropertyFromObject(e);return i?n.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return hy(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+my(e)}isSeverityLevel(e){return ze(e)&&!Jd(e)&&J1.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];if(H1(r))return r}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}},uf=class{match(e){return hy(e)}coerce(e,n){var r,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+my(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},df=class{match(e){return ef(e)}coerce(e,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}},ff=class{match(e){return xl(e,"PromiseRejectionEvent")}coerce(e,n){var r,i=this.getUnhandledRejectionReason(e);return ef(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(i)}getUnhandledRejectionReason(e){if(ef(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}},vy=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,r={k:function(i){if(C&&(Hn.DEBUG||G.POSTHOG_DEBUG||n)&&!O(C.console)&&C.console){for(var o=("__rrweb_original__"in C.console[i])?C.console[i].__rrweb_original__:C.console[i],s=arguments.length,a=new Array(s>1?s-1:0),l=1;l<s;l++)a[l-1]=arguments[l];o(t,...a)}},info:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("log",...o)},warn:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("warn",...o)},error:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];r.k("error",...o)},critical:function(){for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];console.error(t,...o)},uninitializedWarning:i=>{r.error("You must initialize PostHog before calling "+i)},createLogger:(i,o)=>vy(t+" "+i,o)};return r},L=vy("[PostHog.js]"),He=L.createLogger,eE=He("[ExternalScriptsLoader]"),kv=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return eE.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=N?.querySelectorAll("script");if(r){for(var i,o=function(){if(r[s].src===e){var l=r[s];return l.__posthog_loading_callback_fired?{v:n()}:(l.addEventListener("load",(c=>{l.__posthog_loading_callback_fired=!0,n(void 0,c)})),l.onerror=c=>n(c),{v:void 0})}},s=0;s<r.length;s++)if(i=o())return i.v}var a=()=>{if(!N)return n("document not found");var l=N.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=f=>{l.__posthog_loading_callback_fired=!0,n(void 0,f)},l.onerror=f=>n(f),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return n("prepare_external_dependency_script returned null");var c,u=N.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):N.body.appendChild(l)};N!=null&&N.body?a():N?.addEventListener("DOMContentLoaded",a)};G.__PosthogExtensions__=G.__PosthogExtensions__||{},G.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var r="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(r="/array/"+t.config.token+"/config.js"),e==="toolbar"){var i=3e5;r=r+"&t="+Math.floor(Date.now()/i)*i}var o=t.requestRouter.endpointFor("assets",r);kv(t,o,n)},G.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var r=t.requestRouter.endpointFor("api",e);kv(t,r,n)};var Sl={};function Cr(t,e,n){if(fe(t)){if(gv&&t.forEach===gv)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===Sl)return}}}function pe(t,e,n){if(!de(t)){if(fe(t))return Cr(t,e,n);if(D1(t)){for(var r of t.entries())if(e.call(n,r[1],r[0])===Sl)return}else for(var i in t)if(py.call(t,i)&&e.call(n,t[i],i)===Sl)return}}var Me=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Cr(n,(function(i){for(var o in i)i[o]!==void 0&&(t[o]=i[o])})),t},ho=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return Cr(n,(function(i){Cr(i,(function(o){t.push(o)}))})),t};function yl(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var Ev=function(t){try{return t()}catch{return}},tE=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}catch(i){L.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),L.critical(i)}}},ap=function(t){var e={};return pe(t,(function(n,r){(ze(n)&&n.length>0||xn(n))&&(e[r]=n)})),e};function nE(t,e){return n=t,r=o=>ze(o)&&!qn(e)?o.slice(0,e):o,i=new Set,(function o(s,a){return s!==Object(s)?r?r(s,a):s:i.has(s)?void 0:(i.add(s),fe(s)?(l=[],Cr(s,(c=>{l.push(o(c))}))):(l={},pe(s,((c,u)=>{i.has(c)||(l[u]=o(c,u))}))),l);var l})(n);var n,r,i}var rE=["herokuapp.com","vercel.app","netlify.app"];function iE(t){var e=t?.hostname;if(!ze(e))return!1;var n=e.split(".").slice(-2).join(".");for(var r of rE)if(n===r)return!1;return!0}function yy(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function De(t,e,n,r){var{capture:i=!1,passive:o=!0}=r??{};t?.addEventListener(e,n,{capture:i,passive:o})}var _y="$people_distinct_id",Cs="__alias",As="__timers",Cv="$autocapture_disabled_server_side",pf="$heatmaps_enabled_server_side",Av="$exception_capture_enabled_server_side",hf="$error_tracking_suppression_rules",Tv="$error_tracking_capture_extension_exceptions",Rv="$web_vitals_enabled_server_side",wy="$dead_clicks_enabled_server_side",Iv="$web_vitals_allowed_metrics",$d="$session_recording_remote_config",bl="$sesid",xy="$session_is_sampled",ao="$enabled_feature_flags",Ts="$early_access_features",gf="$feature_flag_details",Rs="$stored_person_properties",fi="$stored_group_properties",mf="$surveys",fl="$surveys_activated",kl="$flag_call_reported",jn="$user_state",vf="$client_session_props",yf="$capture_rate_limit",_f="$initial_campaign_params",wf="$initial_referrer_info",El="$initial_person_info",Cl="$epp",Sy="__POSTHOG_TOOLBAR__",vs="$posthog_cookieless",oE=[_y,Cs,"__cmpns",As,"$session_recording_enabled_server_side",pf,bl,ao,hf,jn,Ts,gf,fi,Rs,mf,kl,vf,yf,_f,wf,Cl,El];function Pv(t){return t instanceof Element&&(t.id===Sy||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Ul(t){return!!t&&t.nodeType===1}function Ar(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function by(t){return!!t&&t.nodeType===3}function ky(t){return!!t&&t.nodeType===11}function lp(t){return t?Hl(t).split(/\s+/):[]}function Ov(t){var e=C?.location.href;return!!(e&&t&&t.some((n=>e.match(n))))}function Al(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return lp(e)}function Ey(t){return de(t)?null:Hl(t).split(/(\s+)/).filter((e=>Fs(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Hs(t){var e="";return xf(t)&&!Iy(t)&&t.childNodes&&t.childNodes.length&&pe(t.childNodes,(function(n){var r;by(n)&&n.textContent&&(e+=(r=Ey(n.textContent))!==null&&r!==void 0?r:"")})),Hl(e)}function Cy(t){return O(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var cp=["a","button","form","input","select","textarea","label"];function Ay(t,e){if(O(e))return!0;var n,r=function(o){if(e.some((s=>o.matches(s))))return{v:!0}};for(var i of t)if(n=r(i))return n.v;return!1}function Ty(t){var e=t.parentNode;return!(!e||!Ul(e))&&e}var sE=["next","previous","prev",">","<"],Nv=10,Lv=[".ph-no-rageclick",".ph-no-capture"];function aE(t,e){if(!C||up(t))return!1;var n,r,i;if(Er(e)?(n=!!e&&Lv,r=void 0):(n=(i=e?.css_selector_ignorelist)!==null&&i!==void 0?i:Lv,r=e?.content_ignorelist),n===!1)return!1;var{targetElementList:o}=Ry(t,!1);return!(function(s,a){if(s===!1||O(s))return!1;var l;if(s===!0)l=sE;else{if(!fe(s))return!1;if(s.length>Nv)return L.error("[PostHog] content_ignorelist array cannot exceed "+Nv+" items. Use css_selector_ignorelist for more complex matching."),!1;l=s.map((c=>c.toLowerCase()))}return a.some((c=>{var{safeText:u,ariaLabel:f}=c;return l.some((h=>u.includes(h)||f.includes(h)))}))})(r,o.map((s=>{var a;return{safeText:Hs(s).toLowerCase(),ariaLabel:((a=s.getAttribute("aria-label"))==null?void 0:a.toLowerCase().trim())||""}})))&&!Ay(o,n)}var up=t=>!t||Ar(t,"html")||!Ul(t),Ry=(t,e)=>{if(!C||up(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[t],i=t;i.parentNode&&!Ar(i,"body");)if(ky(i.parentNode))r.push(i.parentNode.host),i=i.parentNode.host;else{var o=Ty(i);if(!o)break;if(e||cp.indexOf(o.tagName.toLowerCase())>-1)n=!0;else{var s=C.getComputedStyle(o);s&&s.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(o),i=o}return{parentIsUsefulElement:n,targetElementList:r}};function lE(t,e,n,r,i){var o,s,a,l;if(n===void 0&&(n=void 0),!C||up(t)||(o=n)!=null&&o.url_allowlist&&!Ov(n.url_allowlist)||(s=n)!=null&&s.url_ignorelist&&Ov(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var c=n.dom_event_allowlist;if(c&&!c.some((v=>e.type===v)))return!1}var{parentIsUsefulElement:u,targetElementList:f}=Ry(t,r);if(!(function(v,_){var x=_?.element_allowlist;if(O(x))return!0;var d,p=function(y){if(x.some((w=>y.tagName.toLowerCase()===w)))return{v:!0}};for(var m of v)if(d=p(m))return d.v;return!1})(f,n)||!Ay(f,(l=n)==null?void 0:l.css_selector_allowlist))return!1;var h=C.getComputedStyle(t);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=t.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(i||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(e.type)>=0;default:return u?(i||["click"]).indexOf(e.type)>=0:(i||["click"]).indexOf(e.type)>=0&&(cp.indexOf(g)>-1||t.getAttribute("contenteditable")==="true")}}function xf(t){for(var e=t;e.parentNode&&!Ar(e,"body");e=e.parentNode){var n=Al(e);if(te(n,"ph-sensitive")||te(n,"ph-no-capture"))return!1}if(te(Al(t),"ph-include"))return!0;var r=t.type||"";if(ze(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";return!(ze(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function Iy(t){return!!(Ar(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Ar(t,"select")||Ar(t,"textarea")||t.getAttribute("contenteditable")==="true")}var Py="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",cE=new RegExp("^(?:"+Py+")$"),uE=new RegExp(Py),Oy="\\d{3}-?\\d{2}-?\\d{4}",dE=new RegExp("^("+Oy+")$"),fE=new RegExp("("+Oy+")");function Fs(t,e){return e===void 0&&(e=!0),!(de(t)||ze(t)&&(t=Hl(t),(e?cE:uE).test((t||"").replace(/[- ]/g,""))||(e?dE:fE).test(t)))}function Ny(t){var e=Hs(t);return Fs(e=(e+" "+Ly(t)).trim())?e:""}function Ly(t){var e="";return t&&t.childNodes&&t.childNodes.length&&pe(t.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var i=Hs(n);e=(e+" "+i).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+Ly(n)).trim())}catch(o){L.error("[AutoCapture]",o)}})),e}function pE(t){return(function(e){var n=e.map((r=>{var i,o,s="";if(r.tag_name&&(s+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))s+="."+a.replace(/"/g,"");var l=$({},r.text?{text:r.text}:{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(o=r.nth_of_type)!==null&&o!==void 0?o:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),c={};return yl(l).sort(((u,f)=>{var[h]=u,[g]=f;return h.localeCompare(g)})).forEach((u=>{var[f,h]=u;return c[Mv(f.toString())]=Mv(h.toString())})),s+=":",s+=yl(c).map((u=>{var[f,h]=u;return f+'="'+h+'"'})).join("")}));return n.join(";")})((function(e){return e.map((n=>{var r,i,o={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(i=n.attr__href)==null?void 0:i.slice(0,2048),attr_class:hE(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return yl(n).filter((s=>{var[a]=s;return a.indexOf("attr__")===0})).forEach((s=>{var[a,l]=s;return o.attributes[a]=l})),o}))})(t))}function Mv(t){return t.replace(/"|\\"/g,'\\"')}function hE(t){var e=t.attr__class;return e?fe(e)?e:lp(e):void 0}var Tl=class{constructor(e){this.disabled=e===!1;var n=We(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,r){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(n-i.y)<this.thresholdPx&&r-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:r}];return!1}},Dd="$copy_autocapture",Wn=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({});var Rl=t=>{var e=N?.createElement("a");return O(e)?null:(e.href=t,e)},gE=function(t,e){var n,r;e===void 0&&(e="&");var i=[];return pe(t,(function(o,s){O(o)||O(s)||s==="undefined"||(n=encodeURIComponent((a=>a instanceof File)(o)?o.name:o.toString()),r=encodeURIComponent(s),i[i.length]=r+"="+n)})),i.join(e)},Il=function(t,e){for(var n,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===e){n=o;break}}if(!fe(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch{L.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},js=function(t,e,n){if(!t||!e||!e.length)return t;for(var r=t.split("#"),i=r[0]||"",o=r[1],s=i.split("?"),a=s[1],l=s[0],c=(a||"").split("&"),u=[],f=0;f<c.length;f++){var h=c[f].split("=");fe(h)&&(e.includes(h[0])?u.push(h[0]+"="+n):u.push(c[f]))}var g=l;return a!=null&&(g+="?"+u.join("&")),o!=null&&(g+="#"+o),g},Pl=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},Fv=He("[AutoCapture]");function Bd(t,e){return e.length>t?e.slice(0,t)+"...":e}function mE(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Ul(e));return e}function vE(t,e,n,r){var i=t.tagName.toLowerCase(),o={tag_name:i};cp.indexOf(i)>-1&&!n&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?o.$el_text=Bd(1024,Ny(t)):o.$el_text=Bd(1024,Hs(t)));var s=Al(t);s.length>0&&(o.classes=s.filter((function(u){return u!==""}))),pe(t.attributes,(function(u){var f;if((!Iy(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(r==null||!r.includes(u.name))&&!e&&Fs(u.value)&&(f=u.name,!ze(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var h=u.value;u.name==="class"&&(h=lp(h).join(" ")),o["attr__"+u.name]=Bd(1024,h)}}));for(var a=1,l=1,c=t;c=mE(c);)a++,c.tagName===t.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function yE(t,e){for(var n,r,{e:i,maskAllElementAttributes:o,maskAllText:s,elementAttributeIgnoreList:a,elementsChainAsString:l}=e,c=[t],u=t;u.parentNode&&!Ar(u,"body");)ky(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var f,h=[],g={},v=!1,_=!1;if(pe(c,(y=>{var w=xf(y);y.tagName.toLowerCase()==="a"&&(v=y.getAttribute("href"),v=w&&v&&Fs(v)&&v),te(Al(y),"ph-no-capture")&&(_=!0),h.push(vE(y,o,s,a));var b=(function(k){if(!xf(k))return{};var E={};return pe(k.attributes,(function(I){if(I.name&&I.name.indexOf("data-ph-capture-attribute")===0){var A=I.name.replace("data-ph-capture-attribute-",""),H=I.value;A&&H&&Fs(H)&&(E[A]=H)}})),E})(y);Me(g,b)})),_)return{props:{},explicitNoCapture:_};if(s||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?h[0].$el_text=Ny(t):h[0].$el_text=Hs(t)),v){var x,d;h[0].attr__href=v;var p=(x=Rl(v))==null?void 0:x.host,m=C==null||(d=C.location)==null?void 0:d.host;p&&m&&p!==m&&(f=v)}return{props:Me({$event_type:i.type,$ce_version:1},l?{}:{$elements:h},{$elements_chain:pE(h)},(n=h[0])!=null&&n.$el_text?{$el_text:(r=h[0])==null?void 0:r.$el_text}:{},f&&i.type==="click"?{$external_click_url:f}:{},g)}}var Sf=class{constructor(e){this.P=!1,this.T=null,this.R=!1,this.instance=e,this.rageclicks=new Tl(e.config.rageclick),this.I=null}get F(){var e,n,r=We(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((i=>new RegExp(i))),r.url_ignorelist=(n=r.url_ignorelist)==null?void 0:n.map((i=>new RegExp(i))),r}C(){if(this.isBrowserSupported()){if(C&&N){var e=r=>{r=r||C?.event;try{this.M(r)}catch(i){Fv.error("Failed to capture event",i)}};if(De(N,"submit",e,{capture:!0}),De(N,"change",e,{capture:!0}),De(N,"click",e,{capture:!0}),this.F.capture_copied_text){var n=r=>{r=r||C?.event,this.M(r,Dd)};De(N,"copy",n,{capture:!0}),De(N,"cut",n,{capture:!0})}}}else Fv.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.C(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Cv]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var n,r=[];return(n=this.I)==null||n.forEach((i=>{var o=N?.querySelectorAll(i);o?.forEach((s=>{e===s&&r.push(i)}))})),r}get isEnabled(){var e,n,r=(e=this.instance.persistence)==null?void 0:e.props[Cv],i=this.T;if(qn(i)&&!Er(r)&&!this.instance.O())return!1;var o=(n=this.T)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!o}M(e,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r,i=Cy(e);by(i)&&(i=i.parentNode||null),n==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&aE(i,this.instance.config.rageclick)&&this.M(e,"$rageclick");var o=n===Dd;if(i&&lE(i,e,this.F,o,o?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:a}=yE(i,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.F.element_attribute_ignorelist,elementsChainAsString:this.R});if(a)return!1;var l=this.getElementSelectors(i);if(l&&l.length>0&&(s.$element_selectors=l),n===Dd){var c,u=Ey(C==null||(c=C.getSelection())==null?void 0:c.toString()),f=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=f}return this.instance.capture(n,s),!0}}}isBrowserSupported(){return kr(N?.querySelectorAll)}};Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return xn(t)&&isFinite(t)&&Math.floor(t)===t});var $v="0123456789abcdef",bf=class t{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,r,i){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||e<0||n<0||r<0||i<0||e>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=e/Math.pow(2,40),o[1]=e/Math.pow(2,32),o[2]=e/Math.pow(2,24),o[3]=e/Math.pow(2,16),o[4]=e/Math.pow(2,8),o[5]=e,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new t(o)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+$v.charAt(this.bytes[n]>>>4)+$v.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new t(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var r=this.bytes[n]-e.bytes[n];if(r!==0)return Math.sign(r)}return 0}},kf=class{constructor(){this.A=0,this.D=0,this.j=new Ef}generate(){var e=this.generateOrAbort();if(O(e)){this.A=0;var n=this.generateOrAbort();if(O(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return bf.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}},Dv,My=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};C&&!O(C.crypto)&&crypto.getRandomValues&&(My=t=>crypto.getRandomValues(t));var Ef=class{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(My(this.N),this.U=0),this.N[this.U++]}},br=()=>_E().toString(),_E=()=>(Dv||(Dv=new kf)).generate(),ys="",wE=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function xE(t,e){if(e){var n=(function(i,o){if(o===void 0&&(o=N),ys)return ys;if(!o||["localhost","127.0.0.1"].includes(i))return"";for(var s=i.split("."),a=Math.min(s.length,8),l="dmn_chk_"+br();!ys&&a--;){var c=s.slice(a).join("."),u=l+"=1;domain=."+c+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(l)&&(o.cookie=u+";max-age=0",ys=c)}return ys})(t);if(!n){var r=(i=>{var o=i.match(wE);return o?o[0]:""})(t);r!==n&&L.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var wn={H:()=>!!N,B:function(t){L.error("cookieStore error: "+t)},q:function(t){if(N){try{for(var e=t+"=",n=N.cookie.split(";").filter((o=>o.length)),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}},W:function(t){var e;try{e=JSON.parse(wn.q(t))||{}}catch{}return e},G:function(t,e,n,r,i){if(N)try{var o="",s="",a=xE(N.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}i&&(s="; secure");var c=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+a+s;return c.length>3686.4&&L.warn("cookieStore warning: large cookie, len="+c.length),N.cookie=c,c}catch{return}},V:function(t,e){if(N!=null&&N.cookie)try{wn.G(t,"",-1,e)}catch{return}}},Vd=null,Ee={H:function(){if(!qn(Vd))return Vd;var t=!0;if(O(C))t=!1;else try{var e="__mplssupport__";Ee.G(e,"xyz"),Ee.q(e)!=='"xyz"'&&(t=!1),Ee.V(e)}catch{t=!1}return t||L.error("localStorage unsupported; falling back to cookie store"),Vd=t,t},B:function(t){L.error("localStorage error: "+t)},q:function(t){try{return C?.localStorage.getItem(t)}catch(e){Ee.B(e)}return null},W:function(t){try{return JSON.parse(Ee.q(t))||{}}catch{}return null},G:function(t,e){try{C?.localStorage.setItem(t,JSON.stringify(e))}catch(n){Ee.B(n)}},V:function(t){try{C?.localStorage.removeItem(t)}catch(e){Ee.B(e)}}},SE=["distinct_id",bl,xy,Cl,El],pl=$({},Ee,{W:function(t){try{var e={};try{e=wn.W(t)||{}}catch{}var n=Me(e,JSON.parse(Ee.q(t)||"{}"));return Ee.G(t,n),n}catch{}return null},G:function(t,e,n,r,i,o){try{Ee.G(t,e,void 0,void 0,o);var s={};SE.forEach((a=>{e[a]&&(s[a]=e[a])})),Object.keys(s).length&&wn.G(t,s,n,r,i,o)}catch(a){Ee.B(a)}},V:function(t,e){try{C?.localStorage.removeItem(t),wn.V(t,e)}catch(n){Ee.B(n)}}}),hl={},bE={H:function(){return!0},B:function(t){L.error("memoryStorage error: "+t)},q:function(t){return hl[t]||null},W:function(t){return hl[t]||null},G:function(t,e){hl[t]=e},V:function(t){delete hl[t]}},ui=null,Ze={H:function(){if(!qn(ui))return ui;if(ui=!0,O(C))ui=!1;else try{var t="__support__";Ze.G(t,"xyz"),Ze.q(t)!=='"xyz"'&&(ui=!1),Ze.V(t)}catch{ui=!1}return ui},B:function(t){L.error("sessionStorage error: ",t)},q:function(t){try{return C?.sessionStorage.getItem(t)}catch(e){Ze.B(e)}return null},W:function(t){try{return JSON.parse(Ze.q(t))||null}catch{}return null},G:function(t,e){try{C?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Ze.B(n)}},V:function(t){try{C?.sessionStorage.removeItem(t)}catch(e){Ze.B(e)}}},Un=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({}),Cf=class{constructor(e){this._instance=e}get F(){return this._instance.config}get consent(){return this.J()?Un.DENIED:this.K}isOptedOut(){return this.F.cookieless_mode==="always"||this.consent===Un.DENIED||this.consent===Un.PENDING&&(this.F.opt_out_capturing_by_default||this.F.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Un.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.F.cookie_expiration,this.F.cross_subdomain_cookie,this.F.secure_cookie)}reset(){this.Y.V(this.X,this.F.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return Md(e)?Un.GRANTED:te(z1,e)?Un.DENIED:Un.PENDING}get Y(){if(!this.Z){var e=this.F.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?Ee:wn;var n=e==="localStorage"?wn:Ee;n.q(this.X)&&(this.Z.q(this.X)||this.optInOut(Md(n.q(this.X))),n.V(this.X,this.F.cross_subdomain_cookie))}return this.Z}J(){return!!this.F.respect_dnt&&!!yy([Pt?.doNotTrack,Pt?.msDoNotTrack,G.doNotTrack],(e=>Md(e)))}},gl=He("[Dead Clicks]"),kE=()=>!0,EE=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(wy)),r=t.instance.config.capture_dead_clicks;return Er(r)?r:!!We(r)||n},Ol=class{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,n,r){this.instance=e,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[wy]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it((()=>{this.et()}))}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(i=>{i?gl.error("failed to load script",i):e()}))}et(){var e;if(N){if(!this.tt&&(e=G.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=We(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.tt=G.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.tt.start(N),gl.info("starting...")}}else gl.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,gl.info("stopping..."))}},_s=He("[ExceptionAutocapture]"),Af=class{constructor(e){var n,r,i;this.rt=()=>{var o;if(C&&this.isEnabled&&(o=G.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var s=G.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=G.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=G.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.F.capture_unhandled_errors&&(this.st=s(this.captureException.bind(this))),!this.nt&&this.F.capture_unhandled_rejections&&(this.nt=a(this.captureException.bind(this))),!this.ot&&this.F.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(c){_s.error("failed to start",c),this.lt()}}},this._instance=e,this.ut=!((n=this._instance.persistence)==null||!n.props[Av]),this.F=this.ht(),this.vt=new tf({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10,refillInterval:1e4,h:_s}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return We(e)?n=$({},n,e):(O(e)?this.ut:e)&&(n=$({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.F.capture_console_errors||this.F.capture_unhandled_errors||this.F.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(_s.info("enabled"),this.it(this.rt))}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(i=>{if(i)return _s.error("failed to load script",i);e()}))}lt(){var e,n,r;(e=this.st)==null||e.call(this),this.st=void 0,(n=this.nt)==null||n.call(this),this.nt=void 0,(r=this.ot)==null||r.call(this),this.ot=void 0}onRemoteConfig(e){var n=e.autocaptureExceptions;this.ut=!!n||!1,this.F=this.ht(),this._instance.persistence&&this._instance.persistence.register({[Av]:this.ut}),this.startIfEnabled()}captureException(e){var n,r,i=(n=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&n!==void 0?n:"Exception";this.vt.consumeRateLimit(i)?_s.info("Skipping exception capture because of client rate limiting.",{exception:i}):this._instance.exceptions.sendExceptionEvent(e)}};function Bv(t,e,n){try{if(!(e in t))return()=>{};var r=t[e],i=n(r);return kr(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=r}}catch{return()=>{}}}var Tf=class{constructor(e){var n;this._instance=e,this.dt=(C==null||(n=C.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(L.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,L.info("History API monitoring stopped")}monitorHistoryChanges(){var e,n;if(C&&C.history){var r=this;(e=C.history.pushState)!=null&&e.__posthog_wrapped__||Bv(C.history,"pushState",(i=>function(o,s,a){i.call(this,o,s,a),r.ft("pushState")})),(n=C.history.replaceState)!=null&&n.__posthog_wrapped__||Bv(C.history,"replaceState",(i=>function(o,s,a){i.call(this,o,s,a),r.ft("replaceState")})),this.gt()}}ft(e){try{var n,r=C==null||(n=C.location)==null?void 0:n.pathname;if(!r)return;r!==this.dt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.dt=r}catch(i){L.error("Error capturing "+e+" pageview",i)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};De(C,"popstate",e),this.ct=()=>{C&&C.removeEventListener("popstate",e)}}}},zd=He("[SegmentIntegration]");function CE(t,e){var n=t.config.segment;if(!n)return e();(function(r,i){var o=r.config.segment;if(!o)return i();var s=l=>{var c=()=>l.anonymousId()||br();r.config.get_device_id=c,l.id()&&(r.register({distinct_id:l.id(),$device_id:c()}),r.persistence.set_property(jn,"identified")),i()},a=o.user();"then"in a&&kr(a.then)?a.then((l=>s(l))):s(a)})(t,(()=>{n.register((r=>{Promise&&Promise.resolve||zd.warn("This browser does not have Promise support, and can not use the segment integration");var i=(o,s)=>{if(!s)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(zd.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(zd.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var a=r.calculateEventProperties(s,o.event.properties);return o.event.properties=Object.assign({},a,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>i(o,o.event.event),page:o=>i(o,"$pageview"),identify:o=>i(o,"$identify"),screen:o=>i(o,"$screen")}})(t)).then((()=>{e()}))}))}var Fy="posthog-js";function $y(t,e){var{organization:n,projectId:r,prefix:i,severityAllowList:o=["error"],sendExceptionsToPostHog:s=!0}=e===void 0?{}:e;return a=>{var l,c,u,f,h;if(!(o==="*"||o.includes(a.level))||!t.__loaded)return a;a.tags||(a.tags={});var g=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());a.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var v=((l=a.exception)==null?void 0:l.values)||[],_=v.map((d=>$({},d,{stacktrace:d.stacktrace?$({},d.stacktrace,{type:"raw",frames:(d.stacktrace.frames||[]).map((p=>$({},p,{platform:"web:javascript"})))}):void 0}))),x={$exception_message:((c=v[0])==null?void 0:c.value)||a.message,$exception_type:(u=v[0])==null?void 0:u.type,$exception_level:a.level,$exception_list:_,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((f=v[0])==null?void 0:f.value)||a.message,$sentry_exception_type:(h=v[0])==null?void 0:h.type,$sentry_tags:a.tags};return n&&r&&(x.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+a.event_id),s&&t.exceptions.sendExceptionEvent(x),a}}var Rf=class{constructor(e,n,r,i,o,s){this.name=Fy,this.setupOnce=function(a){a($y(e,{organization:n,projectId:r,prefix:i,severityAllowList:o,sendExceptionsToPostHog:s==null||s}))}}},AE=C!=null&&C.location?Pl(C.location.hash,"__posthog")||Pl(location.hash,"state"):null,Vv="_postHogToolbarParams",zv=He("[Toolbar]"),Sr=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Sr||{}),If=class{constructor(e){this.instance=e}_t(e){G.ph_toolbar_state=e}yt(){var e;return(e=G.ph_toolbar_state)!==null&&e!==void 0?e:Sr.UNINITIALIZED}maybeLoadToolbar(e,n,r){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),!C||!N)return!1;e=e??C.location,r=r??C.history;try{if(!n){try{C.localStorage.setItem("test","test"),C.localStorage.removeItem("test")}catch{return!1}n=C?.localStorage}var i,o=AE||Pl(e.hash,"__posthog")||Pl(e.hash,"state"),s=o?Ev((()=>JSON.parse(atob(decodeURIComponent(o)))))||Ev((()=>JSON.parse(decodeURIComponent(o)))):null;return s&&s.action==="ph_authorize"?((i=s).source="url",i&&Object.keys(i).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((i=JSON.parse(n.getItem(Vv)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token)&&(this.loadToolbar(i),!0)}catch{return!1}}bt(e){var n=G.ph_load_toolbar||G.ph_load_editor;!de(n)&&kr(n)?n(e,this.instance):zv.warn("No toolbar load function found")}loadToolbar(e){var n=!(N==null||!N.getElementById(Sy));if(!C||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=$({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(C.localStorage.setItem(Vv,JSON.stringify($({},i,{source:void 0}))),this.yt()===Sr.LOADED)this.bt(i);else if(this.yt()===Sr.UNINITIALIZED){var o;this._t(Sr.LOADING),(o=G.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return zv.error("[Toolbar] Failed to load",s),void this._t(Sr.UNINITIALIZED);this._t(Sr.LOADED),this.bt(i)})),De(C,"turbolinks:load",(()=>{this._t(Sr.UNINITIALIZED),this.loadToolbar(i)}))}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,r){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,n,r)}},TE=He("[TracingHeaders]"),Pf=class{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var n,r;O(this.xt)&&((n=G.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),O(this.St)&&((r=G.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(i=>{if(i)return TE.error("failed to load script",i);e()}))}startIfEnabledOrStop(){var e,n;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(n=this.St)==null||n.call(this),this.xt=void 0,this.St=void 0)}},Ht="Mobile",Nl="iOS",_n="Android",$s="Tablet",Dy=_n+" "+$s,By="iPad",Vy="Apple",zy=Vy+" Watch",Ds="Safari",fo="BlackBerry",Hy="Samsung",jy=Hy+"Browser",Uy=Hy+" Internet",pi="Chrome",RE=pi+" OS",Wy=pi+" "+Nl,dp="Internet Explorer",qy=dp+" "+Ht,fp="Opera",IE=fp+" Mini",pp="Edge",Ky="Microsoft "+pp,lo="Firefox",Gy=lo+" "+Nl,Bs="Nintendo",Vs="PlayStation",co="Xbox",Zy=_n+" "+Ht,Yy=Ht+" "+Ds,Is="Windows",Of=Is+" Phone",Hv="Nokia",Nf="Ouya",Xy="Generic",PE=Xy+" "+Ht.toLowerCase(),Qy=Xy+" "+$s.toLowerCase(),Lf="Konqueror",ut="(\\d+(\\.\\d+)?)",Hd=new RegExp("Version/"+ut),OE=new RegExp(co,"i"),NE=new RegExp(Vs+" \\w+","i"),LE=new RegExp(Bs+" \\w+","i"),hp=new RegExp(fo+"|PlayBook|BB10","i"),ME={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},FE=(t,e)=>e&&te(e,Vy)||(function(n){return te(n,Ds)&&!te(n,pi)&&!te(n,_n)})(t),Jy=function(t,e){return e=e||"",te(t," OPR/")&&te(t,"Mini")?IE:te(t," OPR/")?fp:hp.test(t)?fo:te(t,"IE"+Ht)||te(t,"WPDesktop")?qy:te(t,jy)?Uy:te(t,pp)||te(t,"Edg/")?Ky:te(t,"FBIOS")?"Facebook "+Ht:te(t,"UCWEB")||te(t,"UCBrowser")?"UC Browser":te(t,"CriOS")?Wy:te(t,"CrMo")||te(t,pi)?pi:te(t,_n)&&te(t,Ds)?Zy:te(t,"FxiOS")?Gy:te(t.toLowerCase(),Lf.toLowerCase())?Lf:FE(t,e)?te(t,Ht)?Yy:Ds:te(t,lo)?lo:te(t,"MSIE")||te(t,"Trident/")?dp:te(t,"Gecko")?lo:""},$E={[qy]:[new RegExp("rv:"+ut)],[Ky]:[new RegExp(pp+"?\\/"+ut)],[pi]:[new RegExp("("+pi+"|CrMo)\\/"+ut)],[Wy]:[new RegExp("CriOS\\/"+ut)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ut)],[Ds]:[Hd],[Yy]:[Hd],[fp]:[new RegExp("(Opera|OPR)\\/"+ut)],[lo]:[new RegExp(lo+"\\/"+ut)],[Gy]:[new RegExp("FxiOS\\/"+ut)],[Lf]:[new RegExp("Konqueror[:/]?"+ut,"i")],[fo]:[new RegExp(fo+" "+ut),Hd],[Zy]:[new RegExp("android\\s"+ut,"i")],[Uy]:[new RegExp(jy+"\\/"+ut)],[dp]:[new RegExp("(rv:|MSIE )"+ut)],Mozilla:[new RegExp("rv:"+ut)]},DE=function(t,e){var n=Jy(t,e),r=$E[n];if(O(r))return null;for(var i=0;i<r.length;i++){var o=r[i],s=t.match(o);if(s)return parseFloat(s[s.length-2])}return null},jv=[[new RegExp(co+"; "+co+" (.*?)[);]","i"),t=>[co,t&&t[1]||""]],[new RegExp(Bs,"i"),[Bs,""]],[new RegExp(Vs,"i"),[Vs,""]],[hp,[fo,""]],[new RegExp(Is,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Of,""];if(new RegExp(Ht).test(e)&&!/IEMobile\b/.test(e))return[Is+" "+Ht,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var r=n[1],i=ME[r]||"";return/arm/i.test(e)&&(i="RT"),[Is,i]}return[Is,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[Nl,e.join(".")]}return[Nl,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=O(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+_n+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+_n+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[_n,e.join(".")]}return[_n,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[RE,""]],[/Linux|debian/i,["Linux",""]]],Uv=function(t){return LE.test(t)?Bs:NE.test(t)?Vs:OE.test(t)?co:new RegExp(Nf,"i").test(t)?Nf:new RegExp("("+Of+"|WPDesktop)","i").test(t)?Of:/iPad/.test(t)?By:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?zy:hp.test(t)?fo:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Hv,"i").test(t)?Hv:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?!new RegExp(Ht).test(t)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)?/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?_n:Dy:_n:new RegExp("(pda|"+Ht+")","i").test(t)?PE:new RegExp($s,"i").test(t)&&!new RegExp($s+" pc","i").test(t)?Qy:""},ml="https?://(.*)",go=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],BE=ho(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],go),Us="<masked>",VE=["li_fat_id"];function e_(t,e,n){if(!N)return{};var r,i=e?ho([],go,n||[]):[],o=t_(js(N.URL,i,Us),t),s=(r={},pe(VE,(function(a){var l=wn.q(a);r[a]=l||null})),r);return Me(s,o)}function t_(t,e){var n=BE.concat(e||[]),r={};return pe(n,(function(i){var o=Il(t,i);r[i]=o||null})),r}function n_(t){var e=(function(o){return o?o.search(ml+"google.([^/?]*)")===0?"google":o.search(ml+"bing.com")===0?"bing":o.search(ml+"yahoo.com")===0?"yahoo":o.search(ml+"duckduckgo.com")===0?"duckduckgo":null:null})(t),n=e!="yahoo"?"q":"p",r={};if(!qn(e)){r.$search_engine=e;var i=N?Il(N.referrer,n):"";i.length&&(r.ph_keyword=i)}return r}function Wv(){return navigator.language||navigator.userLanguage}function r_(){return N?.referrer||"$direct"}function i_(t,e){var n=t?ho([],go,e||[]):[],r=_t?.href.substring(0,1e3);return{r:r_().substring(0,1e3),u:r?js(r,n,Us):void 0}}function o_(t){var e,{r:n,u:r}=t,i={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=Rl(n))==null?void 0:e.host};if(r){i.$current_url=r;var o=Rl(r);i.$host=o?.host,i.$pathname=o?.pathname;var s=t_(r);Me(i,s)}if(n){var a=n_(n);Me(i,a)}return i}function s_(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function zE(){try{return new Date().getTimezoneOffset()}catch{return}}function HE(t,e){if(!yt)return{};var n,r,i,o=t?ho([],go,e||[]):[],[s,a]=(function(l){for(var c=0;c<jv.length;c++){var[u,f]=jv[c],h=u.exec(l),g=h&&(kr(f)?f(h,l):f);if(g)return g}return["",""]})(yt);return Me(ap({$os:s,$os_version:a,$browser:Jy(yt,navigator.vendor),$device:Uv(yt),$device_type:(r=yt,i=Uv(r),i===By||i===Dy||i==="Kobo"||i==="Kindle Fire"||i===Qy?$s:i===Bs||i===co||i===Vs||i===Nf?"Console":i===zy?"Wearable":i?Ht:"Desktop"),$timezone:s_(),$timezone_offset:zE()}),{$current_url:js(_t?.href,o,Us),$host:_t?.host,$pathname:_t?.pathname,$raw_user_agent:yt.length>1e3?yt.substring(0,997)+"...":yt,$browser_version:DE(yt,navigator.vendor),$browser_language:Wv(),$browser_language_prefix:(n=Wv(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:C?.screen.height,$screen_width:C?.screen.width,$viewport_height:C?.innerHeight,$viewport_width:C?.innerWidth,$lib:"web",$lib_version:Hn.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var _r=He("[Web Vitals]"),qv=9e5,Mf=class{constructor(e){var n;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce(((r,i)=>$({},r,{["$web_vitals_"+i.name+"_event"]:$({},i),["$web_vitals_"+i.name+"_value"]:i.value})),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=r=>{var i,o=(i=this._instance.sessionManager)==null?void 0:i.checkAndGetSessionAndWindowId(!0);if(O(o))_r.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Tt();O(s)||(de(r?.name)||de(r?.value)?_r.error("Invalid metric received",r):this.Rt&&r.value>=this.Rt?_r.error("Ignoring metric with value >= "+this.Rt,r):(this.N.url!==s&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),O(this.N.url)&&(this.N.url=s),this.N.firstMetricTimestamp=O(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.N.metrics.push($({},r,{$current_url:s,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var r,i,o,s,a=G.__PosthogExtensions__;O(a)||O(a.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:i,onFCP:o,onINP:s}=a.postHogWebVitalsCallbacks),r&&i&&o&&s?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.Pt.bind(this)),this.P=!0):_r.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((n=this._instance.persistence)==null||!n.props[Rv]),this.startIfEnabled()}get allowedMetrics(){var e,n,r=We(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return O(r)?((n=this._instance.persistence)==null?void 0:n.props[Iv])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(We(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=We(this._instance.config.capture_performance)&&xn(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:qv;return 0<e&&e<=6e4?qv:e}get isEnabled(){var e=_t?.protocol;if(e!=="http:"&&e!=="https:")return _r.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=We(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Er(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Er(n)?n:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(_r.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var n=We(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=We(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Rv]:n}),this._instance.persistence.register({[Iv]:r})),this.Et=n,this.startIfEnabled()}it(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&e(),(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",(i=>{i?_r.error("failed to load script",i):e()}))}Tt(){var e=C?C.location.href:void 0;if(e){var n=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,i=n?ho([],go,r||[]):[];return js(e,i,Us)}_r.error("Could not determine current URL")}},jE=He("[Heatmaps]");function Kv(t){return We(t)&&"clientX"in t&&"clientY"in t&&xn(t.clientX)&&xn(t.clientY)}var Ff=class{constructor(e){var n;this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((n=this.instance.persistence)==null||!n.props[pf]),this.rageclicks=new Tl(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return We(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return O(this.instance.config.capture_heatmaps)?O(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;jE.info("starting..."),this.Ft(),this.Ct()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Mt(),this.getAndClearBuffer()}}onRemoteConfig(e){var n=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[pf]:n}),this.Et=n,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Ot(e){this.At(e.originalEvent,"deadclick")}Ct(){this.It&&clearInterval(this.It),this.It=(function(e){return e?.visibilityState==="visible"})(N)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ft(){C&&N&&(this.jt=this.Dt.bind(this),De(C,"beforeunload",this.jt),this.Lt=e=>this.At(e||C?.event),De(N,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||C?.event),De(N,"mousemove",this.Nt,{capture:!0}),this.zt=new Ol(this.instance,kE,this.Ot.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ct.bind(this),De(N,"visibilitychange",this.Ht),this.P=!0)}Mt(){var e;C&&N&&(this.jt&&C.removeEventListener("beforeunload",this.jt),this.Lt&&N.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&N.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&N.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),s=(function(a,l,c){for(var u=a;u&&Ul(u)&&!Ar(u,"body");){if(u===c)return!1;if(te(l,C?.getComputedStyle(u).position))return!0;u=Ty(u)}return!1})(Cy(e),["fixed","sticky"],o);return{x:e.clientX+(s?0:i),y:e.clientY+(s?0:r),target_fixed:s,type:n}}At(e,n){var r;if(n===void 0&&(n="click"),!Pv(e.target)&&Kv(e)){var i=this.qt(e,n);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt($({},i,{type:"rageclick"})),this.Wt(i)}}Ut(e){!Pv(e.target)&&Kv(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout((()=>{this.Wt(this.qt(e,"mousemove"))}),500))}Wt(e){if(C){var n=C.location.href,r=this.instance.config.mask_personal_data_properties,i=this.instance.config.custom_personal_data_properties,o=r?ho([],go,i||[]):[],s=js(n,o,Us);this.N=this.N||{},this.N[s]||(this.N[s]=[]),this.N[s].push(e)}}Dt(){this.N&&!so(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},$f=class{constructor(e){this._instance=e}doPageView(e,n){var r,i=this.Gt(e,n);return this.Vt={pathname:(r=C?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var n;return this.Gt(e,(n=this.Vt)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,n){var r=this.Vt;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:a,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:f}=o;if(!(O(s)||O(a)||O(l)||O(c)||O(u)||O(f))){s=Math.ceil(s),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),f=Math.ceil(f);var h=s<=1?1:yn(a/s,0,1,L),g=s<=1?1:yn(l/s,0,1,L),v=c<=1?1:yn(u/c,0,1,L),_=c<=1?1:yn(f/c,0,1,L);i=Me(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),i}},jt=Uint8Array,dt=Uint16Array,po=Uint32Array,gp=new jt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mp=new jt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Gv=new jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a_=function(t,e){for(var n=new dt(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var i=new po(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},l_=a_(gp,2),UE=l_[0],Df=l_[1];UE[28]=258,Df[258]=28;for(Bf=a_(mp,0)[1],Ll=new dt(32768),he=0;he<32768;++he)wr=(43690&he)>>>1|(21845&he)<<1,wr=(61680&(wr=(52428&wr)>>>2|(13107&wr)<<2))>>>4|(3855&wr)<<4,Ll[he]=((65280&wr)>>>8|(255&wr)<<8)>>>1;var wr,Bf,Ll,he,Ns=function(t,e,n){for(var r=t.length,i=0,o=new dt(e);i<r;++i)++o[t[i]-1];var s,a=new dt(e);for(i=0;i<e;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new dt(1<<e);var l=15-e;for(i=0;i<r;++i)if(t[i])for(var c=i<<4|t[i],u=e-t[i],f=a[t[i]-1]++<<u,h=f|(1<<u)-1;f<=h;++f)s[Ll[f]>>>l]=c}else for(s=new dt(r),i=0;i<r;++i)s[i]=Ll[a[t[i]-1]++]>>>15-t[i];return s},hi=new jt(288);for(he=0;he<144;++he)hi[he]=8;for(he=144;he<256;++he)hi[he]=9;for(he=256;he<280;++he)hi[he]=7;for(he=280;he<288;++he)hi[he]=8;var Ml=new jt(32);for(he=0;he<32;++he)Ml[he]=5;var WE=Ns(hi,9,0),qE=Ns(Ml,5,0),c_=function(t){return(t/8>>0)+(7&t&&1)},u_=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var r=new(t instanceof dt?dt:t instanceof po?po:jt)(n-e);return r.set(t.subarray(e,n)),r},zn=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8},ws=function(t,e,n){n<<=7&e;var r=e/8>>0;t[r]|=n,t[r+1]|=n>>>8,t[r+2]|=n>>>16},jd=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var i=n.length,o=n.slice();if(!i)return[new jt(0),0];if(i==1){var s=new jt(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort((function(w,b){return w.f-b.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=i-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var h=o[0].s;for(r=1;r<i;++r)o[r].s>h&&(h=o[r].s);var g=new dt(h+1),v=Vf(n[u-1],g,0);if(v>e){r=0;var _=0,x=v-e,d=1<<x;for(o.sort((function(w,b){return g[b.s]-g[w.s]||w.f-b.f}));r<i;++r){var p=o[r].s;if(!(g[p]>e))break;_+=d-(1<<v-g[p]),g[p]=e}for(_>>>=x;_>0;){var m=o[r].s;g[m]<e?_-=1<<e-g[m]++-1:++r}for(;r>=0&&_;--r){var y=o[r].s;g[y]==e&&(--g[y],++_)}v=e}return[new jt(g),v]},Vf=function(t,e,n){return t.s==-1?Math.max(Vf(t.l,e,n+1),Vf(t.r,e,n+1)):e[t.s]=n},Zv=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new dt(++e),r=0,i=t[0],o=1,s=function(l){n[r++]=l},a=1;a<=e;++a)if(t[a]==i&&a!=e)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=t[a]}return[n.subarray(0,r),e]},xs=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},zf=function(t,e,n){var r=n.length,i=c_(e+2);t[i]=255&r,t[i+1]=r>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var o=0;o<r;++o)t[i+o+4]=n[o];return 8*(i+4+r)},Yv=function(t,e,n,r,i,o,s,a,l,c,u){zn(e,u++,n),++i[256];for(var f=jd(i,15),h=f[0],g=f[1],v=jd(o,15),_=v[0],x=v[1],d=Zv(h),p=d[0],m=d[1],y=Zv(_),w=y[0],b=y[1],k=new dt(19),E=0;E<p.length;++E)k[31&p[E]]++;for(E=0;E<w.length;++E)k[31&w[E]]++;for(var I=jd(k,7),A=I[0],H=I[1],K=19;K>4&&!A[Gv[K-1]];--K);var Y,W,le,B,X=c+5<<3,V=xs(i,hi)+xs(o,Ml)+s,Z=xs(i,h)+xs(o,_)+s+14+3*K+xs(k,A)+(2*k[16]+3*k[17]+7*k[18]);if(X<=V&&X<=Z)return zf(e,u,t.subarray(l,l+c));if(zn(e,u,1+(Z<V)),u+=2,Z<V){Y=Ns(h,g,0),W=h,le=Ns(_,x,0),B=_;var vt=Ns(A,H,0);for(zn(e,u,m-257),zn(e,u+5,b-1),zn(e,u+10,K-4),u+=14,E=0;E<K;++E)zn(e,u+3*E,A[Gv[E]]);u+=3*K;for(var Bn=[p,w],Ge=0;Ge<2;++Ge){var zt=Bn[Ge];for(E=0;E<zt.length;++E){var It=31&zt[E];zn(e,u,vt[It]),u+=A[It],It>15&&(zn(e,u,zt[E]>>>5&127),u+=zt[E]>>>12)}}}else Y=WE,W=hi,le=qE,B=Ml;for(E=0;E<a;++E)if(r[E]>255){It=r[E]>>>18&31,ws(e,u,Y[It+257]),u+=W[It+257],It>7&&(zn(e,u,r[E]>>>23&31),u+=gp[It]);var no=31&r[E];ws(e,u,le[no]),u+=B[no],no>3&&(ws(e,u,r[E]>>>5&8191),u+=mp[no])}else ws(e,u,Y[r[E]]),u+=W[r[E]];return ws(e,u,Y[256]),u+W[256]},KE=new po([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),GE=(function(){for(var t=new po(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t})(),ZE=function(t,e,n,r,i){return(function(o,s,a,l,c,u){var f=o.length,h=new jt(l+f+5*(1+Math.floor(f/7e3))+c),g=h.subarray(l,h.length-c),v=0;if(!s||f<8)for(var _=0;_<=f;_+=65535){var x=_+65535;x<f?v=zf(g,v,o.subarray(_,x)):(g[_]=u,v=zf(g,v,o.subarray(_,f)))}else{for(var d=KE[s-1],p=d>>>13,m=8191&d,y=(1<<a)-1,w=new dt(32768),b=new dt(y+1),k=Math.ceil(a/3),E=2*k,I=function(Ld){return(o[Ld]^o[Ld+1]<<k^o[Ld+2]<<E)&y},A=new po(25e3),H=new dt(288),K=new dt(32),Y=0,W=0,le=(_=0,0),B=0,X=0;_<f;++_){var V=I(_),Z=32767&_,vt=b[V];if(w[Z]=vt,b[V]=Z,B<=_){var Bn=f-_;if((Y>7e3||le>24576)&&Bn>423){v=Yv(o,g,0,A,H,K,W,le,X,_-X,v),le=Y=W=0,X=_;for(var Ge=0;Ge<286;++Ge)H[Ge]=0;for(Ge=0;Ge<30;++Ge)K[Ge]=0}var zt=2,It=0,no=m,mr=Z-vt&32767;if(Bn>2&&V==I(_-mr))for(var k1=Math.min(p,Bn)-1,E1=Math.min(32767,_),C1=Math.min(258,Bn);mr<=E1&&--no&&Z!=vt;){if(o[_+zt]==o[_+zt-mr]){for(var vr=0;vr<C1&&o[_+vr]==o[_+vr-mr];++vr);if(vr>zt){if(zt=vr,It=mr,vr>k1)break;var A1=Math.min(mr,vr-2),av=0;for(Ge=0;Ge<A1;++Ge){var Nd=_-mr+Ge+32768&32767,lv=Nd-w[Nd]+32768&32767;lv>av&&(av=lv,vt=Nd)}}}mr+=(Z=vt)-(vt=w[Z])+32768&32767}if(It){A[le++]=268435456|Df[zt]<<18|Bf[It];var cv=31&Df[zt],uv=31&Bf[It];W+=gp[cv]+mp[uv],++H[257+cv],++K[uv],B=_+zt,++Y}else A[le++]=o[_],++H[o[_]]}}v=Yv(o,g,u,A,H,K,W,le,X,_-X,v)}return u_(h,0,l+c_(v)+c)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,r,!0)},Ud=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function YE(t,e){e===void 0&&(e={});var n=(function(){var a=4294967295;return{p:function(l){for(var c=a,u=0;u<l.length;++u)c=GE[255&c^l[u]]^c>>>8;a=c},d:function(){return 4294967295^a}}})(),r=t.length;n.p(t);var i,o=ZE(t,e,10+((i=e).filename&&i.filename.length+1||0),8),s=o.length;return(function(a,l){var c=l.filename;if(a[0]=31,a[1]=139,a[2]=8,a[8]=l.level<2?4:l.level==9?2:0,a[9]=3,l.mtime!=0&&Ud(a,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){a[3]=8;for(var u=0;u<=c.length;++u)a[u+10]=c.charCodeAt(u)}})(o,e),Ud(o,s-8,n.d()),Ud(o,s-4,r),o}var XE=function(t){var e,n,r,i,o="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
|
|
10
10
|
`).replace(/\r/g,`
|
|
11
|
-
`)).length,i=0;i<r;i++){var s=t.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),Kn(a)||(n>e&&(o+=t.substring(e,n)),o+=a,e=n=i+1)}return n>e&&(o+=t.substring(e,t.length)),o},QE=!!Xd||!!Yd,Jv="text/plain",$l=function(t,e,n){var r;n===void 0&&(n=!0);var[i,o]=t.split("?"),s=F({},e),a=(r=o?.split("&").map((c=>{var u,[f,h]=c.split("="),g=n&&(u=s[f])!==null&&u!==void 0?u:h;return delete s[f],f+"="+g})))!==null&&r!==void 0?r:[],l=gE(s);return l&&a.push(l),i+"?"+a.join("&")},Ns=(t,e)=>JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e),Wd=t=>{var{data:e,compression:n}=t;if(e){if(n===qn.GZipJS){var r=YE((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new jt(l.length+(l.length>>>1)),h=0,g=function(d){f[h++]=d},v=0;v<u;++v){if(h+5>f.length){var _=new jt(h+8+(u-v<<1));_.set(f),f=_}var x=l.charCodeAt(v);x<128||c?g(x):x<2048?(g(192|x>>>6),g(128|63&x)):x>55295&&x<57344?(g(240|(x=65536+(1047552&x)|1023&l.charCodeAt(++v))>>>18),g(128|x>>>12&63),g(128|x>>>6&63),g(128|63&x)):(g(224|x>>>12),g(128|x>>>6&63),g(128|63&x))}return f_(f,0,h)})(Ns(e)),{mtime:0}),i=new Blob([r],{type:Jv});return{contentType:Jv,body:i,estimatedSize:i.size}}if(n===qn.Base64){var o=(function(l){var c,u,f,h,g,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,x=0,d="",p=[];if(!l)return l;l=XE(l);do c=(g=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=g>>12&63,f=g>>6&63,h=63&g,p[x++]=v.charAt(c)+v.charAt(u)+v.charAt(f)+v.charAt(h);while(_<l.length);switch(d=p.join(""),l.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"="}return d})(Ns(e)),s=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Ns(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Ns(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},wl=[];Yd&&wl.push({transport:"fetch",method:t=>{var e,n,{contentType:r,body:i,estimatedSize:o}=(e=Wd(t))!==null&&e!==void 0?e:{},s=new Headers;pe(t.headers,(function(u,f){s.append(f,u)})),r&&s.append("Content-Type",r);var a=t.url,l=null;if(_v){var c=new _v;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}Yd(a,F({method:t?.method||"GET",headers:s,keepalive:t.method==="POST"&&(o||0)<52428.8,body:i,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((u=>u.text().then((f=>{var h={statusCode:u.status,text:f};if(u.status===200)try{h.json=JSON.parse(f)}catch(g){L.error(g)}t.callback==null||t.callback(h)})))).catch((u=>{L.error(u),t.callback==null||t.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Xd&&wl.push({transport:"XHR",method:t=>{var e,n=new Xd;n.open(t.method||"GET",t.url,!0);var{contentType:r,body:i}=(e=Wd(t))!==null&&e!==void 0?e:{};pe(t.headers,(function(o,s){n.setRequestHeader(s,o)})),r&&n.setRequestHeader("Content-Type",r),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var o={statusCode:n.status,text:n.responseText};if(n.status===200)try{o.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(o)}},n.send(i)}}),It!=null&&It.sendBeacon&&wl.push({transport:"sendBeacon",method:t=>{var e=$l(t.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=Wd(t))!==null&&n!==void 0?n:{},o=typeof i=="string"?new Blob([i],{type:r}):i;It.sendBeacon(e,o)}catch{}}});var Dl=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function ey(t,e,n){return Ns({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var p_={exact:(t,e)=>e.some((n=>t.some((r=>n===r)))),is_not:(t,e)=>e.every((n=>t.every((r=>n!==r)))),regex:(t,e)=>e.some((n=>t.some((r=>Dl(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!Dl(n,r))))),icontains:(t,e)=>e.map(yl).some((n=>t.map(yl).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(yl).every((n=>t.map(yl).every((r=>!n.includes(r)))))},yl=t=>t.toLowerCase();function h_(t,e){return!t||Object.entries(t).every((n=>{var[r,i]=n,o=e?.[r];if(O(o)||Kn(o))return!1;var s=[String(o)],a=p_[i.operator];return!!a&&a(i.values,s)}))}var qd=He("[Error tracking]"),Hf=class{constructor(e){var n,r;this.Jt=[],this.Kt=new nf([new of,new ff,new af,new sf,new uf,new cf,new lf,new df],X1("web:javascript",K1,Y1)),this._instance=e,this.Jt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(hf))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,r,i,o=(n=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],s=(i=e.errorTracking)==null?void 0:i.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[hf]:this.Jt,[Pv]:s})}get Yt(){var e,n=!!this._instance.get_property(Pv),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.Kt.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.Xt(n)){if(this.Qt(n))return void qd.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void qd.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void qd.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var n=e.reduce(((r,i)=>{var{type:o,value:s}=i;return ze(o)&&o.length>0&&r.$exception_types.push(o),ze(s)&&s.length>0&&r.$exception_values.push(s),r}),{$exception_types:[],$exception_values:[]});return this.Jt.some((r=>{var i=r.values.map((o=>{var s,a=p_[o.operator],l=fe(o.value)?o.value:[o.value],c=(s=n[o.key])!==null&&s!==void 0?s:[];return l.length>0&&a(l,c)}));return r.type==="OR"?i.some(Boolean):i.every(Boolean)}))}Zt(e){return e.flatMap((n=>{var r,i;return(r=(i=n.stacktrace)==null?void 0:i.frames)!==null&&r!==void 0?r:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var n,r,i,o,s=(n=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],a=s[s.length-1];return(i=a==null||(o=a.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&i!==void 0&&i}return!1}Xt(e){return!de(e)&&fe(e)}},nn=He("[FeatureFlags]"),ks=He("[FeatureFlags]",{debugEnabled:!0}),Kd="$active_feature_flags",oo="$override_feature_flags",ty="$feature_flag_payloads",Es="$override_feature_flag_payloads",ny="$feature_flag_request_id",ry="$feature_flag_evaluated_at",iy=t=>{var e={};for(var[n,r]of _l(t||{}))r&&(e[n]=r);return e},JE=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var r;return[n,(r=e[n].variant)!==null&&r!==void 0?r:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var r;return(r=e[n].metadata)==null?void 0:r.payload})).map((n=>{var r;return[n,(r=e[n].metadata)==null?void 0:r.payload]})))):nn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},eC=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),jf=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||nn.error("Invalid evaluation environment found:",n,"Expected non-empty string"),r})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(gf),n=this._instance.get_property(oo),r=this._instance.get_property(Es);if(!r&&!n)return e||{};var i=Me({},e||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var s of o){var a,l,c=i[s],u=n?.[s],f=O(u)?(a=c?.enabled)!==null&&a!==void 0&&a:!!u,h=O(u)?c.variant:typeof u=="string"?u:void 0,g=r?.[s],v=F({},c,{enabled:f,variant:f?h??c?.variant:void 0});f!==c?.enabled&&(v.original_enabled=c?.enabled),h!==c?.variant&&(v.original_variant=c?.variant),g&&(v.metadata=F({},c?.metadata,{payload:g,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),i[s]=v}return this.ii||(nn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:i}),this.ii=!0),i}getFlagVariants(){var e=this._instance.get_property(co),n=this._instance.get_property(oo);if(!n)return e||{};for(var r=Me({},e),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this.ii||(nn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var e=this._instance.get_property(ty),n=this._instance.get_property(Es);if(!n)return e||{};for(var r=Me({},e||{}),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this.ii||(nn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:r}),this.ii=!0),r}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var n;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var r={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:F({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(Is)||{}),group_properties:this._instance.get_property(pi)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ui()&&(r.evaluation_environments=this.li());var i=this._instance.config.__preview_remote_config,o=i?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags",o+s);i&&(r.timezone=l_()),this.ri=!0,this._instance.ci({method:"POST",url:a,data:r,compression:this._instance.config.disable_compression?void 0:qn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,f=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),f=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!r.disable_flags||this.ni)if(this.ai=!f,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(eC.FeatureFlags))nn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;r.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},f),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],i=""+r,o=this._instance.get_property(ny)||void 0,s=this._instance.get_property(ry)||void 0,a=this._instance.get_property(El)||{};if((n.send_event||!("send_event"in n))&&(!(e in a)||!a[e].includes(i))){var l,c,u,f,h,g,v,_,x;fe(a[e])?a[e].push(i):a[e]=[i],(l=this._instance.persistence)==null||l.register({[El]:a});var d=this.getFeatureFlagDetails(e),p={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:s,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.ai};O(d==null||(f=d.metadata)==null?void 0:f.version)||(p.$feature_flag_version=d.metadata.version);var m,y=(h=d==null||(g=d.reason)==null?void 0:g.description)!==null&&h!==void 0?h:d==null||(v=d.reason)==null?void 0:v.code;y&&(p.$feature_flag_reason=y),d!=null&&(_=d.metadata)!=null&&_.id&&(p.$feature_flag_id=d.metadata.id),O(d?.original_variant)&&O(d?.original_enabled)||(p.$feature_flag_original_response=O(d.original_variant)?d.original_enabled:d.original_variant),d!=null&&(x=d.metadata)!=null&&x.original_payload&&(p.$feature_flag_original_payload=d==null||(m=d.metadata)==null?void 0:m.original_payload),this._instance.capture("$feature_flag_called",p)}return r}nn.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,n){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.ui()&&(i.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:qn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var s,a=(s=o.json)==null?void 0:s.featureFlagPayloads;n(a?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,n);return O(r)?void 0:!!r}nn.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(s,a,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var f=JE(s),h=f.flags,g=f.featureFlags,v=f.featureFlagPayloads;if(g){var _=s.requestId,x=s.evaluatedAt;if(fe(g)){nn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(g)for(var p=0;p<g.length;p++)d[g[p]]=!0;a&&a.register({[Kd]:g,[co]:d})}else{var m=g,y=v,w=h;s.errorsWhileComputingFlags&&(m=F({},l,m),y=F({},c,y),w=F({},u,w)),a&&a.register(F({[Kd]:Object.keys(iy(m)),[co]:m||{},[ty]:y||{},[gf]:w||{}},_?{[ny]:_}:{},x?{[ry]:x}:{}))}}})(e,this._instance.persistence,r,i,o),this.pi(n)}}override(e,n){n===void 0&&(n=!1),nn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return nn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(oo),this._instance.persistence.unregister(Es),this.pi(),ks.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.ii=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(oo),ks.info("Flag overrides cleared");else if(r.flags){if(fe(r.flags)){for(var i={},o=0;o<r.flags.length;o++)i[r.flags[o]]=!0;this._instance.persistence.register({[oo]:i})}else this._instance.persistence.register({[oo]:r.flags});ks.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(Es),ks.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Es]:r.payloads}),ks.info("Payload overrides set",{payloads:r.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:r}=this.gi();e(n,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,r){var i,o=(this._instance.get_property(Ps)||[]).find((c=>c.flagKey===e)),s={["$feature_enrollment/"+e]:n},a={$feature_flag:e,$feature_enrollment:n,$set:s};o&&(a.$early_access_feature_name=o.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var l=F({},this.getFlagVariants(),{[e]:n});(i=this._instance.persistence)==null||i.register({[Kd]:Object.keys(iy(l)),[co]:l}),this.pi()}getEarlyAccessFeatures(e,n,r){n===void 0&&(n=!1);var i=this._instance.get_property(Ps),o=r?"&"+r.map((s=>"stage="+s)).join("&"):"";if(i&&!n)return e(i);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:s=>{var a,l;if(s.json){var c=s.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(Ps),(l=this._instance.persistence)==null||l.register({[Ps]:c}),e(c)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((r=>n[r])),flagVariants:Object.keys(n).filter((r=>n[r])).reduce(((r,i)=>(r[i]=n[i],r)),{})}}pi(e){var{flags:n,flagVariants:r}=this.gi();this.featureFlagEventHandlers.forEach((i=>i(n,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(Is)||{};this._instance.register({[Is]:F({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Is)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(pi)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((i=>{r[i]=F({},r[i],e[i]),delete e[i]})),this._instance.register({[pi]:F({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(pi)||{};this._instance.register({[pi]:F({},n,{[e]:{}})})}else this._instance.unregister(pi)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.di(),this.ii=!1}},tC=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Fs=class{constructor(e,n){this.F=e,this.props={},this.mi=!1,this.yi=(r=>{var i="";return r.token&&(i=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+i+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&L.info("Persistence loaded",e.persistence,F({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){tC.indexOf(e.persistence.toLowerCase())===-1&&(L.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&Ee.H()?Ee:n==="localstorage+cookie"&&hl.H()?hl:n==="sessionstorage"&&Ze.H()?Ze:n==="memory"?bE:n==="cookie"?wn:hl.H()?hl:wn}properties(){var e={};return pe(this.props,(function(n,r){if(r===co&&We(n))for(var i=Object.keys(n),o=0;o<i.length;o++)e["$feature/"+i[o]]=n[i[o]];else a=r,l=!1,(Kn(s=oE)?l:yv&&s.indexOf===yv?s.indexOf(a)!=-1:(pe(s,(function(c){if(l||(l=c===a))return bl})),l))||(e[r]=n);var s,a,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Me({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,n,r){if(We(e)){O(n)&&(n="None"),this.xi=O(r)?this.$i:r;var i=!1;if(pe(e,((o,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==n||(this.props[s]=o,i=!0)})),i)return this.save(),!0}return!1}register(e,n){if(We(e)){this.xi=O(n)?this.$i:n;var r=!1;if(pe(e,((i,o)=>{e.hasOwnProperty(o)&&this.props[o]!==i&&(this.props[o]=i,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=n_(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);lo(ap(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=N?.referrer)?i_(e):{})}update_referrer_info(){var e;this.register_once({$referrer:o_(),$referring_domain:N!=null&&N.referrer&&((e=Pl(N.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[_f]||this.props[wf]||this.register_once({[Cl]:s_(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};pe([wf,_f],(s=>{var a=this.props[s];a&&pe(a,(function(l,c){e["$initial_"+Qd(c)]=l}))}));var n,r,i=this.props[Cl];if(i){var o=(n=a_(i),r={},pe(n,(function(s,a){r["$initial_"+Qd(a)]=s})),r);Me(e,o)}return e}safe_merge(e){return pe(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence){var i=this.bi(e),o=this.props;this.clear(),this.Y=i,this.props=o,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,n){var r=this.props[Ts]||{};r[e]=n,this.props[Ts]=r,this.save()}remove_event_timer(e){var n=(this.props[Ts]||{})[e];return O(n)||(delete this.props[Ts][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},Cs=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),FO=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),$O=(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({}),DO=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),Gd=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),BO=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),VO=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),zO=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),xl=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),oy=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t})({}),g_=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),js=class{constructor(){this.ki={},this.ki={}}on(e,n){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(n),()=>{this.ki[e]=this.ki[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.ki[e]||[])r(n);for(var i of this.ki["*"]||[])i(e,n)}};function so(t,e,n){if(de(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Uf=class{constructor(e){this.Pi=new js,this.Ti=(n,r)=>this.Ri(n,r)&&this.Ii(n,r)&&this.Fi(n,r)&&this.Ci(n,r),this.Ri=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!O((e=this._instance)==null?void 0:e.Ai)){var n;(n=this._instance)==null||n.Ai(((r,i)=>{this.on(r,i)}))}}register(e){var n,r;if(!O((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((s=>{var a,l;(a=this.Oi)==null||a.add(s),(l=s.steps)==null||l.forEach((c=>{var u;(u=this.Mi)==null||u.add(c?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var i,o=new Set;e.forEach((s=>{var a;(a=s.steps)==null||a.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(i=this._instance)==null||i.autocapture.setElementSelectors(o)}}on(e,n){var r;n!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(n?.event))&&this.Oi&&((r=this.Oi)==null?void 0:r.size)>0&&this.Oi.forEach((i=>{this.Di(n,i)&&this.Pi.emit("actionCaptured",i.name)}))}ji(e){this.onAction("actionCaptured",(n=>e(n)))}Di(e,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.Ti(e,r))return!0;return!1}onAction(e,n){return this.Pi.on(e,n)}Ii(e,n){if(n!=null&&n.url){var r,i=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!i||typeof i!="string"||!so(i,n.url,n.url_matching||"contains"))return!1}return!0}Fi(e,n){return!!this.Li(e,n)&&!!this.Ni(e,n)&&!!this.Ui(e,n)}Li(e,n){var r;if(n==null||!n.href)return!0;var i=this.zi(e);if(i.length>0)return i.some((a=>so(a.href,n.href,n.href_matching||"exact")));var o,s=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!s&&so((o=s.match(/(?::|")href="(.*?)"/))?o[1]:"",n.href,n.href_matching||"exact")}Ni(e,n){var r;if(n==null||!n.text)return!0;var i=this.zi(e);if(i.length>0)return i.some((c=>so(c.text,n.text,n.text_matching||"exact")||so(c.$el_text,n.text,n.text_matching||"exact")));var o,s,a,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(o=(function(c){for(var u,f=[],h=/(?::|")text="(.*?)"/g;!de(u=h.exec(c));)f.includes(u[1])||f.push(u[1]);return f})(l),s=n.text,a=n.text_matching||"exact",o.some((c=>so(c,s,a))))}Ui(e,n){var r,i;if(n==null||!n.selector)return!0;var o=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(o!=null&&o.includes(n.selector))return!0;var s=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(n.selector_regex&&s)try{return new RegExp(n.selector_regex).test(s)}catch{return!1}return!1}zi(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Ci(e,n){return n==null||!n.properties||n.properties.length===0||h_(n.properties.reduce(((r,i)=>{var o=fe(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:o,operator:i.operator||"exact"},r}),{}),e?.properties)}},ce=He("[Surveys]"),Wf="seenSurvey_",nC=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},sy=t=>{var e=""+Wf+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Wf+t.id+"_"+t.current_iteration),e},rC=[Gd.Popover,Gd.Widget,Gd.API],iC={ignoreConditions:!1,ignoreDelay:!1,displayType:g_.Popover},qf=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&h_(e.propertyFilters,n?.properties)}Gi(e,n){var r=new Map;return e.forEach((i=>{var o;(o=i.conditions)==null||(o=o[n])==null||(o=o.values)==null||o.forEach((s=>{if(s!=null&&s.name){var a=r.get(s.name)||[];a.push(i.id),r.set(s.name,a)}}))})),r}Vi(e,n,r){var i,o=(r===Cs.Activation?this.Hi:this.Bi).get(e),s=[];return(i=this._instance)==null||i.getSurveys((a=>{s=a.filter((l=>o?.includes(l.id)))})),s.filter((a=>{var l,c=(l=a.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((u=>u.name===e));return this.Wi(c,n)}))}register(e){var n;O((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((r=>{var i,o;return((i=r.conditions)==null?void 0:i.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new Uf(this._instance),this.Yi.init(),this.Yi.ji((r=>{this.onAction(r)}))),n.forEach((r=>{var i,o,s,a,l;r.conditions&&(i=r.conditions)!=null&&i.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0&&((a=this.Yi)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.qi.get(c.name);u&&u.push(r.id),this.qi.set(c.name,u||[r.id])}})))})))}Ji(e){var n,r=e.filter((o=>{var s,a;return((s=o.conditions)==null?void 0:s.events)&&((a=o.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0})),i=e.filter((o=>{var s,a;return((s=o.conditions)==null?void 0:s.cancelEvents)&&((a=o.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0}));(r.length!==0||i.length!==0)&&((n=this._instance)==null||n.Ai(((o,s)=>{this.onEvent(o,s)})),this.Hi=this.Gi(e,Cs.Activation),this.Bi=this.Gi(e,Cs.Cancellation))}onEvent(e,n){var r,i=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[pl])||[];if(xl.SHOWN===e&&n&&i.length>0){var o;ce.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:i});var s=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(s){var a=i.indexOf(s);a>=0&&(i.splice(a,1),this.Xi(i))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,Cs.Cancellation);l.length>0&&(ce.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var f,h=i.indexOf(u.id);h>=0&&i.splice(h,1),(f=this._instance)==null||f.cancelPendingSurvey(u.id)})),this.Xi(i))}if(this.Hi.has(e)){ce.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var c=this.Vi(e,n,Cs.Activation);this.Xi(i.concat(c.map((u=>u.id))||[]))}}}onAction(e){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[pl])||[];this.qi.has(e)&&this.Xi(r.concat(this.qi.get(e)||[]))}Xi(e){var n;ce.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[pl]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[pl];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Kf=class{constructor(e){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(de(n))return ce.warn("Flags not loaded yet. Not loading surveys.");var r=fe(n);this.Zi=r?n.length>0:n,ce.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(Wf)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((i=>localStorage.removeItem(i)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)ce.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ce.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ce.info("Not loading surveys in cookieless mode without consent.");else{var e=G?.__PosthogExtensions__;if(e){if(!O(this.Zi)||this._instance.config.advanced_enable_surveys){var n=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var r=e.generateSurveys;if(r)return void this.re(r,n);var i=e.loadExternalDependency;if(!i)return void this.se("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,n)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else ce.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new qf(this._instance),ce.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){ce.error(e,n),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return ce.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(mf);if(r&&!n)return e(r,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var o;this.te=!1;var s=i.statusCode;if(s!==200||!i.json){var a="Surveys API could not be loaded, status: "+s;return ce.error(a),e([],{isLoaded:!1,error:a})}var l,c=i.json.surveys||[],u=c.filter((f=>(function(h){return!(!h.start_date||h.end_date)})(f)&&((function(h){var g;return!((g=h.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(f)||(function(h){var g;return!((g=h.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(f))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[mf]:c}),e(c,{isLoaded:!0})}})}catch(i){throw this.te=!1,i}}ne(e){for(var n of this.ee)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){ce.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!de(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);ce.warn("init was not called")}oe(e){var n=null;return this.getSurveys((r=>{var i;n=(i=r.find((o=>o.id===e)))!==null&&i!==void 0?i:null})),n}ae(e){if(de(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.oe(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(de(this._surveyManager))return ce.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ae(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return de(this._surveyManager)?(ce.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((i=>{var o,s=(o=i.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(s){var a=this.ae(s);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var r;if(de(this._surveyManager))ce.warn("init was not called");else{var i=typeof e=="string"?this.oe(e):e;if(i!=null&&i.id)if(rC.includes(i.type)){var o=N?.querySelector(n);if(o)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(ce.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var s,a;ce.info("Rendering survey "+i.id+" with delay of "+((s=i.appearance)==null?void 0:s.surveyPopupDelaySeconds)+" seconds"),(a=this._surveyManager)==null||a.renderSurvey(i,o),ce.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,o);ce.warn("Survey element not found")}else ce.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ce.warn("Survey not found")}}displaySurvey(e,n){var r;if(de(this._surveyManager))ce.warn("init was not called");else{var i=this.oe(e);if(i){var o=i;if((r=i.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(o=F({},i,{appearance:F({},i.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var s=this.canRenderSurvey(i);if(!s.visible)return void ce.warn("Survey is not eligible to be displayed: ",s.disabledReason)}n.displayType!==g_.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,n.selector)}else ce.warn("Survey not found")}}cancelPendingSurvey(e){de(this._surveyManager)?ce.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},ay=He("[RateLimiter]"),Gf=class{constructor(e){var n,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=i=>{var o=i.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((s=>{ay.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void ay.warn('could not rate limit - continuing. Error: "'+s?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=e.config.rate_limiting)==null?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var n,r,i;e===void 0&&(e=!1);var o=new Date().getTime(),s=(n=(r=this.instance.persistence)==null?void 0:r.get_property(yf))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:o};s.tokens+=(o-s.last)/1e3*this.captureEventsPerSecond,s.last=o,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var a=s.tokens<1;return a||e||(s.tokens=Math.max(0,s.tokens-1)),!a||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,(i=this.instance.persistence)==null||i.set_property(yf,s),{isRateLimited:a,remainingTokens:s.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},fi=He("[RemoteConfig]"),Zf=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=G._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(fi.error("PostHog Extensions not found. Cannot load remote config."),e())}ue(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return fi.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void fi.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return fi.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((n=>{this.fi(n)}));this.fi(e)}))}catch(e){fi.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):fi.info("__preview_remote_config is disabled. Logging config instead",e):fi.error("Failed to fetch remote config from PostHog.")}},Yf=3e3,Xf=class{constructor(e,n){this.he=!0,this.ve=[],this.de=yn(n?.flush_interval_ms||Yf,250,5e3,L.createLogger("flush interval"),Yf),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ce(F({},r,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var n=this._e(),r=function(){var o=n[i],s=new Date().getTime();o.data&&fe(o.data)&&pe(o.data,(a=>{a.offset=Math.abs(a.timestamp-s),delete a.timestamp})),e.ce(o)};for(var i in n)r()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return pe(this.ve,(n=>{var r,i=n,o=(i?i.batchKey:null)||i.url;O(e[o])&&(e[o]=F({},i,{data:[]})),(r=e[o].data)==null||r.push(i.data)})),this.ve=[],e}},oC=["retriesPerformedSoFar"],Qf=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!O(C)&&"onLine"in C.navigator&&(this.be=C.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},De(C,"online",this.we),De(C,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=py(e,oC);xn(n)&&n>0&&(r.url=$l(r.url,{retry_count:n})),this._instance.ci(F({},r,{callback:i=>{i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(n??0)<10?this.Se(F({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(i)}}))}Se(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(s){var a=3e3*Math.pow(2,s),l=a/2,c=Math.min(18e5,a),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(n),i=Date.now()+r;this.ve.push({retryAt:i,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),L.warn(o),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var e=Date.now(),n=[],r=this.ve.filter((o=>o.retryAt<e||(n.push(o),!1)));if(this.ve=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,O(C)||(this.we&&(C.removeEventListener("online",this.we),this.we=void 0),this.xe&&(C.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci(F({},e,{transport:"sendBeacon"}))}catch(n){L.error(n)}this.ve=[]}},Jf=class{constructor(e){this.ke=()=>{var n,r,i,o;this.Pe||(this.Pe={});var s=this.scrollElement(),a=this.scrollY(),l=s?Math.max(0,s.scrollHeight-s.clientHeight):0,c=a+(s?.clientHeight||0),u=s?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(a),this.Pe.maxScrollY=Math.max(a,(n=this.Pe.maxScrollY)!==null&&n!==void 0?n:0),this.Pe.maxScrollHeight=Math.max(l,(r=this.Pe.maxScrollHeight)!==null&&r!==void 0?r:0),this.Pe.lastContentY=c,this.Pe.maxContentY=Math.max(c,(i=this.Pe.maxContentY)!==null&&i!==void 0?i:0),this.Pe.maxContentHeight=Math.max(u,(o=this.Pe.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){De(C,"scroll",this.ke,{capture:!0}),De(C,"scrollend",this.ke,{capture:!0}),De(C,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return C?.document.documentElement;var e=fe(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var r=C?.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return C&&(C.scrollY||C.pageYOffset||C.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return C&&(C.scrollX||C.pageXOffset||C.document.documentElement.scrollLeft)||0}},sC=t=>s_(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Bl=class{constructor(e,n,r,i){this.Te=o=>{var s=this.Re();if(!s||s.sessionId!==o){var a={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[vf]:a})}},this._instance=e,this.Ce=n,this.Fe=r,this.Ie=i||sC,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[vf]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?a_(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return pe(ap(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Qd(r)]=n})),e}},Zd=He("[SessionId]"),Vl=class{on(e,n){return this.Me.on(e,n)}constructor(e,n,r){var i;if(this.Oe=[],this.Ae=void 0,this.Me=new js,this.De=(u,f)=>Math.abs(u-f)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=n||kr,this.Ue=r||kr;var o=this.F.persistence_name||this.F.token,s=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*yn(s,60,36e3,Zd.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+o+"_window_id",this.Be="ph_"+o+"_primary_window_exists",this.qe()){var a=Ze.W(this.He),l=Ze.W(this.Be);a&&!l?this.je=a:Ze.V(this.He),Ze.G(this.Be,!0)}if((i=this.F.bootstrap)!=null&&i.sessionID)try{var c=(u=>{var f=u.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),c)}catch(u){Zd.error("Invalid sessionID in bootstrap",u)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return O(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((n=>n!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Ze.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Ze.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Ze.W(this.He):null}We(e,n,r){e===this.Le&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Le=e,this.Fe.register({[kl]:[n,e,r]}))}Ke(){var e=this.Fe.props[kl];return fe(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.We(null,null,null)}destroy(){clearTimeout(this.Ye),this.Ye=void 0,this.Ae&&C&&(C.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Ze.V(this.Be)},De(C,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[i,o,s]=this.Ke(),a=this.Je(),l=xn(s)&&s>0&&Math.abs(r-s)>864e5,c=!1,u=!o,f=!u&&!e&&this.De(r,i);u||f||l?(o=this.Ne(),a=this.Ue(),Zd.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}}),s=r,c=!0):a||(a=this.Ue(),c=!0);var h=i===0||!e||l?r:i,g=s===0?new Date().getTime():s;return this.Ve(a),this.We(o,h,g),e||this.ze(),c&&this.Oe.forEach((v=>v(o,a,c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:a,sessionStartTimestamp:g,changeReason:c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:i}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var n=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}},aC=["$set_once","$set"],Sr=He("[SiteApps]"),ep=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,n){if(n){var r=this.globalsForEvent(n);this.Xe.push(r),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=G._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var n,r,i,o,s,a,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(f))c[h]={id:u[h],type:h,properties:g};var{$set_once:v,$set:_}=e;return{event:F({},py(e,aC),{properties:F({},e.properties,_?{$set:F({},(n=(r=e.properties)==null?void 0:r.$set)!==null&&n!==void 0?n:{},_)}:{},v?{$set_once:F({},(i=(o=e.properties)==null?void 0:o.$set_once)!==null&&i!==void 0?i:{},v)}:{}),elements_chain:(s=(a=e.properties)==null?void 0:a.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var n=this.apps[e.id],r=()=>{var a;!n.errored&&this.Xe.length&&(Sr.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>n.processEvent==null?void 0:n.processEvent(l))),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((a=this.Ze)==null||a.call(this))},i=!1,o=a=>{n.errored=!a,n.loaded=!0,Sr.info("Site app with id "+e.id+" "+(a?"loaded":"errored")),i&&r()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:a=>{o(a)}});s&&(n.processEvent=s),i=!0}catch(a){Sr.error("Error while initializing PostHog app with config id "+e.id,a),o(!1)}if(i&&n.loaded)try{r()}catch(a){Sr.error("Error while processing buffered events PostHog app with config id "+e.id,a),n.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}ir(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(n)}catch(i){Sr.error("Error while processing event "+e.event+" for site app "+r.id,i)}}}onRemoteConfig(e){var n,r,i,o=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(c=>this.ir(c)))):void Sr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Ze)==null||r.call(this),(i=e.siteApps)!=null&&i.length)if(this.isEnabled){var s=function(c){var u;G["__$$ph_site_app_"+c]=o._instance,(u=G.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,(f=>{if(f)return Sr.error("Error while initializing PostHog app with config id "+c,f)}))};for(var{id:a,url:l}of e.siteApps)s(a)}else Sr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},m_=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&Sv(n,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((i=>Sv(i?.brand,e))))return!0}catch{}return!!t.webdriver},Ls=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),ly="i.posthog.com",tp=class{constructor(e){this.er={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+ly,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Ls.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Ls.EU:this.er[this.apiHost]=Ls.CUSTOM),this.er[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Ls.CUSTOM)return this.apiHost+n;var r=ly+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},lC={icontains:(t,e)=>!!C&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!C&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!C&&Dl(e.href,t),not_regex:(t,e)=>!!C&&!Dl(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},np=class t{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((i=>{t.rr("retrieved web experiments from the server"),n.sr=new Map,i.forEach((o=>{if(o.feature_flag_key){var s;n.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(s=n.sr)==null||s.set(o.feature_flag_key,o));var a=n._instance.getFeatureFlag(o.feature_flag_key);ze(a)&&o.variants[a]&&n.nr(o.name,a,o.variants[a].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];t.ar(c)&&n.nr(o.name,l,c.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(de(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((n=>{var r;if(this.sr&&(r=this.sr)!=null&&r.has(n)){var i,o=this._instance.getFeatureFlag(n),s=(i=this.sr)==null?void 0:i.get(n);o&&s!=null&&s.variants[o]&&this.nr(s.name,o,s.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=Il(e?.search,"__experiment_id"),r=Il(e?.search,"__experiment_variant");n&&r&&(t.rr("previewing web experiments "+n+" && "+r),this.getWebExperiments((i=>{this.lr(parseInt(n),r,i)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!n)return e(i);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var s=o.json.experiments||[];return e(s)}})}lr(e,n,r){var i=r.filter((o=>o.id===e));i&&i.length>0&&(t.rr("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.nr(i[0].name,n,i[0].variants[n].transforms))}static ar(e){return!de(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(de(e.conditions)||de((n=e.conditions)==null?void 0:n.url))return!0;var r,i,o,s=t.getWindowLocation();return!!s&&((r=e.conditions)==null||!r.url||lC[(i=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&i!==void 0?i:"icontains"](e.conditions.url,s))}static getWindowLocation(){return C?.location}static hr(e){var n;if(de(e.conditions)||de((n=e.conditions)==null?void 0:n.utm))return!0;var r=n_();if(r.utm_source){var i,o,s,a,l,c,u,f,h=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,g=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,v=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==r.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==r.utm_term;return h&&v&&_&&g}return!1}static rr(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];L.info("[WebExperiments] "+e,r)}nr(e,n,r){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((i=>{if(i.selector){var o;t.rr("applying transform of variant "+n+" for experiment "+e+" ",i);var s=(o=document)==null?void 0:o.querySelectorAll(i.selector);s?.forEach((a=>{var l=a;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return It&&this._instance?m_(It,this._instance.config.custom_blocked_useragents):void 0}},cC=He("[PostHog ExternalIntegrations]"),uC={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},rp=class{constructor(e){this._instance=e}it(e,n){var r;(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(i=>{if(i)return cC.error("failed to load script",i);n()}))}startIfEnabledOrStop(){var e=this,n=function(s){var a,l,c;!i||(a=G.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[s]||e.it(uC[s],(()=>{var u;(u=G.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[s])==null||u.start(e._instance)})),!i&&(l=G.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[s]&&((c=G.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[s])==null||c.stop())};for(var[r,i]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;n(r)}}},ip="[SessionRecording]",As=He(ip),zl=class{get started(){var e;return!((e=this.vr)==null||!e.isStarted)}get status(){return this.vr?this.vr.status:this.dr&&!this.cr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.dr=!1,this.pr=void 0,this._instance=e,!this._instance.sessionManager)throw As.error("started without valid sessionManager"),new Error(ip+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(ip+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property($d))==null||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return C&&n&&r&&!i}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var r=!O(Object.assign)&&!O(Array.from);this.cr&&r?(this.gr(e),As.info("starting")):this.stopRecording()}}gr(e){var n,r,i;this.cr&&(G!=null&&(n=G.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(r=G.__PosthogExtensions__)!=null&&r.initSessionRecording?this._r(e):(i=G.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return As.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,n;(e=this.pr)==null||e.call(this),this.pr=void 0,(n=this.vr)==null||n.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(by)}br(e){if(this._instance.persistence){var n,r,i=this._instance.persistence,o=()=>{var s=e.sessionRecording===!1?void 0:e.sessionRecording,a=s?.sampleRate,l=de(a)?null:parseFloat(a);de(l)&&this.yr();var c=s?.minimumDurationMilliseconds;i.register({[$d]:F({enabled:!!s},s,{networkPayloadCapture:F({capturePerformance:e.capturePerformance},s?.networkPayloadCapture),canvasRecording:{enabled:s?.recordCanvas,fps:s?.canvasFps,quality:s?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:O(c)?null:c,endpoint:s?.endpoint,triggerMatchType:s?.triggerMatchType,masking:s?.masking,urlTriggers:s?.urlTriggers})})};o(),(n=this.pr)==null||n.call(this),this.pr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:As.info("skipping remote config with no sessionRecording",e)}log(e,n){var r;n===void 0&&(n="log"),(r=this.vr)!=null&&r.log?this.vr.log(e,n):As.warn("log called before recorder was ready")}get mr(){var e,n,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property($d);return(r==null||(n=r.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,r;if((n=G.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(r=G.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var n;(n=this.vr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var n,r;this.vr||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.vr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var r;return!((r=this.vr)==null||!r.tryAddCustomEvent(e,n))}},$s={},op=()=>{},ao="posthog",v_=!QE&&yt?.indexOf("MSIE")===-1&&yt?.indexOf("Mozilla")===-1,cy=t=>{var e;return F({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:iE(N?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:op,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:_t&&ze(_t?.search)&&_t.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(C==null||(e=C.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;L.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Yf},error_tracking:{},_onCapture:op,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},uy=t=>{var e={};O(t.process_person)||(e.person_profiles=t.process_person),O(t.xhr_headers)||(e.request_headers=t.xhr_headers),O(t.cookie_name)||(e.persistence_name=t.cookie_name),O(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),O(t.store_google)||(e.save_campaign_params=t.store_google),O(t.verbose)||(e.debug=t.verbose);var n=Me({},e,t);return fe(t.property_blacklist)&&(O(t.property_denylist)?n.property_denylist=t.property_blacklist:fe(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:L.error("Invalid value for property_denylist config: "+t.property_denylist)),n},sp=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){L.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},Hl=class t{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new sp,this.Sr=!1,this.version=jn.LIB_VERSION,this.Er=new js,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=cy(),this.SentryIntegration=Tf,this.sentryIntegration=e=>(function(n,r){var i=By(n,r);return{name:Dy,processEvent:o=>i(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new jf(this),this.toolbar=new Pf(this),this.scrollManager=new Jf(this),this.pageViewManager=new $f(this),this.surveys=new Kf(this),this.experiments=new np(this),this.exceptions=new Hf(this),this.rateLimiter=new Gf(this),this.requestRouter=new tp(this),this.consent=new Cf(this),this.externalIntegrations=new rp(this),this.people={set:(e,n,r)=>{var i=ze(e)?{[e]:n}:e;this.setPersonProperties(i),r?.({})},set_once:(e,n,r)=>{var i=ze(e)?{[e]:n}:e;this.setPersonProperties(void 0,i),r?.({})}},this.on("eventCaptured",(e=>L.info('send "'+e?.event+'"',e)))}init(e,n,r){if(r&&r!==ao){var i,o=(i=$s[r])!==null&&i!==void 0?i:new t;return o._init(e,n,r),$s[r]=o,$s[ao][r]=o,o}return this._init(e,n,r)}_init(e,n,r){var i;if(n===void 0&&(n={}),O(e)||Jd(e))return L.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Rr(n.debug),this.Ir=n,this.Fr=[],n.person_profiles&&(this.Pr=n.person_profiles),this.set_config(Me({},cy(n.defaults),uy(n),{name:r,token:e})),this.config.on_xhr_error&&L.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:qn.GZipJS;var o=this.Cr();this.persistence=new Fs(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Fs(F({},this.config,{persistence:"sessionStorage"}),o);var s=F({},this.persistence.props),a=F({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Xf((p=>this.Or(p)),this.config.request_queue_config),this.Ar=new Qf(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new Vl(this),this.sessionPropsManager=new Bl(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(L.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(L.info("Initializing extensions synchronously"),this.Dr(l)),jn.DEBUG=jn.DEBUG||this.config.debug,jn.DEBUG&&L.info("Starting in debug mode",{this:this,config:n,thisC:F({},this.config),p:s,s:a}),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var c,u,f=this.config.get_device_id(kr()),h=(c=n.bootstrap)!=null&&c.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(Un,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:h})}if(this.jr()){var g,v,_=Object.keys(((g=n.bootstrap)==null?void 0:g.featureFlags)||{}).filter((p=>{var m;return!((m=n.bootstrap)==null||(m=m.featureFlags)==null||!m[p])})).reduce(((p,m)=>{var y;return p[m]=((y=n.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[m])||!1,p}),{}),x=Object.keys(((v=n.bootstrap)==null?void 0:v.featureFlagPayloads)||{}).filter((p=>_[p])).reduce(((p,m)=>{var y,w;return(y=n.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[m]&&(p[m]=(w=n.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[m]),p}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:x})}if(l)this.register_once({distinct_id:_s,$device_id:null},"");else if(!this.get_distinct_id()){var d=this.config.get_device_id(kr());this.register_once({distinct_id:d,$device_id:d},""),this.persistence.set_property(Un,"anonymous")}return De(C,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?CE(this,(()=>this.Lr())):this.Lr(),Er(this.config._onCapture)&&this.config._onCapture!==op&&(L.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(p=>this.config._onCapture(p.event,p)))),this.config.ip&&L.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(e){var n=performance.now();this.historyAutocapture=new Rf(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new If(this).startIfEnabledOrStop()})),r.push((()=>{var i;this.siteApps=new ep(this),(i=this.siteApps)==null||i.init()})),e||r.push((()=>{this.sessionRecording=new zl(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Sf(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Ff(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Mf(this)})),r.push((()=>{this.exceptionObserver=new Af(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new Nl(this,EE),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.Nr){var i=this.Nr;this.Nr=void 0,this.fi(i)}})),this.Ur(r,n)}Ur(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,n)}),0);var r=e.shift();if(r)try{r()}catch(o){L.error("Error initializing extension:",o)}}var i=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&L.info("PostHog extensions initialized ("+i+"ms)")}fi(e){var n,r,i,o,s,a,l,c;if(!N||!N.body)return L.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=te(e.supportedCompression,qn.GZipJS)?qn.GZipJS:te(e.supportedCompression,qn.Base64)?qn.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(i=this.sessionRecording)==null||i.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(s=this.heatmaps)==null||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(a=this.webVitalsAutocapture)==null||a.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){L.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Zf(this).load(),this.featureFlags.flags()}zr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Mr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Ar(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,n;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(n=this.Ar)==null||n.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(v_?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=$l(e.url,{ip:this.config.ip?1:0}),e.headers=F({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,i,o,s=F({},n);s.timeout=s.timeout||6e4,s.url=$l(s.url,{_:new Date().getTime().toString(),ver:jn.LIB_VERSION,compression:s.compression});var a=(r=s.transport)!==null&&r!==void 0?r:"fetch",l=wl.filter((u=>!s.disableTransport||!u.transport||!s.disableTransport.includes(u.transport))),c=(i=(o=wy(l,(u=>u.transport===a)))==null?void 0:o.method)!==null&&i!==void 0?i:l[0].method;if(!c)throw new Error("No available transport method");c(s)})(F({},e,{callback:n=>{var r,i;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(i=this.config).on_request_error)==null||r.call(i,n)),e.callback==null||e.callback(n)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var n,r=[],i=[],o=[];Ar(e,(a=>{a&&(n=a[0],fe(n)?o.push(a):Er(a)?a.call(this):fe(a)&&n==="alias"?r.push(a):fe(a)&&n.indexOf("capture")!==-1&&Er(this[n])?o.push(a):i.push(a))}));var s=function(a,l){Ar(a,(function(c){if(fe(c[0])){var u=l;pe(c,(function(f){u=u[f[0]].apply(u,f.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};s(r,this),s(i,this),s(o,this)}jr(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!O(e)&&ze(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var s=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){n!=null&&n.$current_url&&!ze(n?.$current_url)&&(L.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,l=r?.timestamp||a,c=kr(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,n||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),s&&(u.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),r?.$set&&(u.$set=r?.$set);var f,h=this.qr(r?.$set_once);if(h&&(u.$set_once=h),(u=nE(u,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,O(r?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=a),e===xl.DISMISSED||e===xl.SENT){var g=n?.[oy.SURVEY_ID],v=n?.[oy.SURVEY_ITERATION];f={id:g,current_iteration:v},localStorage.getItem(sy(f))||localStorage.setItem(sy(f),"true"),u.$set=F({},u.$set,{[nC({id:g,current_iteration:v},e===xl.SENT?"responded":"dismissed")]:!0})}var _=F({},u.properties.$set,u.$set);if(lo(_)||this.setPersonPropertiesForFlags(_),!de(this.config.before_send)){var x=this.Wr(u);if(!x)return;u=x}this.Er.emit("eventCaptured",u);var d={method:"POST",url:(i=r?._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Or(d):this.Mr.enqueue(d),u}L.critical("This capture call is ignored due to client rate limiting.")}}else L.error("No event name provided to posthog.capture")}else L.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,i,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var s=o?void 0:this.persistence.remove_event_timer(e),a=F({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),e==="$snapshot"){var l=F({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ze(a.distinct_id)&&!xn(a.distinct_id)||Jd(a.distinct_id))&&L.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,u=HE(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());a.$session_id=f,a.$window_id=h}this.sessionPropsManager&&Me(a,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Me(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(g=this.Ar)==null?void 0:g.length}catch(d){a.$sdk_debug_error_capturing_properties=String(d)}if(this.requestRouter.region===Ls.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),a=Me(a,c),e==="$pageview"&&N&&(a.title=N.title),!O(s)){var v=r.getTime()-s;a.$duration=parseFloat((v/1e3).toFixed(3))}yt&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Me({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),fe(this.config.property_denylist)?pe(this.config.property_denylist,(function(d){delete a[d]})):L.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(L.error("sanitize_properties is deprecated. Use before_send instead"),a=_(a,e));var x=this.Gr();return a.$process_person_profile=x,x&&!o&&this.Vr("_calculate_event_properties"),a}qr(e){var n;if(!this.persistence||!this.Gr()||this.Sr)return e;var r=this.persistence.get_initial_props(),i=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),o=Me({},r,i||{},e||{}),s=this.config.sanitize_properties;return s&&(L.error("sanitize_properties is deprecated. Use before_send instead"),o=s(o,"$set_once")),this.Sr=!0,lo(o)?void 0:o}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var i;(i=this.persistence)==null||i.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Jr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Er.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=iC),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,r){if(!this.__loaded||!this.persistence)return L.uninitializedWarning("posthog.identify");if(xn(e)&&(e=e.toString(),L.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))L.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==_s){if(this.Vr("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==i&&e!==this.get_property(Rs)&&(this.unregister(Rs),this.register({distinct_id:e}));var s=(this.persistence.get_property(Un)||"anonymous")==="anonymous";e!==i&&s?(this.persistence.set_property(Un,"identified"),this.setPersonPropertiesForFlags(F({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.Tr=ey(e,n,r),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(El))}}else L.critical('The string "'+_s+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else L.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var r=ey(this.get_distinct_id(),e,n);this.Tr!==r?(this.setPersonPropertiesForFlags(F({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=r):L.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,r){if(e&&n){if(this.Vr("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:F({},i,{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),i[e]===n||r||this.reloadFeatureFlags()}}else L.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,r,i,o;if(L.info("reset"),!this.__loaded)return L.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(Un,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:_s,$device_id:null},"");else{var a=this.config.get_device_id(kr());this.register_once({distinct_id:a,$device_id:e?a:s},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&r){var o,s=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-s,0)}return i}alias(e,n){return e===this.get_property(xy)?(L.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(O(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(Rs,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(L.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=F({},this.config);if(We(e)){var r,i,o,s,a;Me(this.config,uy(e));var l=this.Cr();(r=this.persistence)==null||r.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Fs(F({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);Cr(c)&&(this.config.debug=c),Cr(this.config.debug)&&(this.config.debug?(jn.DEBUG=!0,Ee.H()&&Ee.G("ph_debug","true"),L.info("set_config",{config:e,oldConfig:n,newConfig:F({},this.config)})):(jn.DEBUG=!1,Ee.H()&&Ee.V("ph_debug"))),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(a=this.externalIntegrations)==null||a.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,r={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var i,o,s,a,l;(i=this.sessionManager)==null||i.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),r.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var r=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(F({},i,n))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:ao;return n!==ao&&(n=ao+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Un))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Un))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&lo(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Rs])&&((n=this.persistence)==null||(n=n.props)==null||!n[Al]))}Br(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Vr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Vr(e){return this.config.person_profiles==="never"?(L.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(Al,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}Kr(){var e,n,r,i,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.wi)!==o&&((i=this.sessionPersistence)==null||i.set_disabled(o)),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var r,i;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),this.sessionManager=new Vl(this),this.persistence&&(this.sessionPropsManager=new Bl(this,this.sessionManager,this.persistence)),this.sessionRecording=new zl(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(O(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((i=e?.captureEventName)!==null&&i!==void 0?i:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else L.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:_s,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Hr())):L.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Wn.GRANTED?"granted":e===Wn.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return It?m_(It,this.config.custom_blocked_useragents):void 0}Hr(){N&&(N.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:N.title},{send_instantly:!0}),this.kr&&(N.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),De(N,"visibilitychange",this.kr)))}debug(e){e===!1?(C?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(C?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,n,r,i,o,s,a,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(L.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,o=L,s=(n="advanced_disable_flags")in(e=l)&&!O(e[n]),a=r in e&&!O(e[r]),s?e[n]:a?(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]):i)}Wr(e){if(de(this.config.before_send))return e;var n=fe(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),de(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return B1(e.event)?L.warn(o+". This can cause unexpected behavior."):L.info(o),null}r.properties&&!lo(r.properties)||L.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Rr(e){var n=Cr(e)&&!e,r=Ee.H()&&Ee.q("ph_debug")==="true";return!n&&(!!r||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=tE(t.prototype[e[n]])})(Hl,["identify"]);var dy,y_=(dy=$s[ao]=new Hl,(function(){function t(){t.done||(t.done=!0,v_=!1,pe($s,(function(e){e._dom_loaded()})))}N!=null&&N.addEventListener?N.readyState==="complete"?t():De(N,"DOMContentLoaded",t,{capture:!1}):C&&L.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),dy);var vp=class{constructor(e={}){this.options=e;j(this,"client");j(this,"featureFlagsCallback");j(this,"captureCallback");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&typeof window<"u"&&e.apiKey){this.client=y_;let n=e.enableFeatureFlags??!0;this.client.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!n,advanced_disable_feature_flags_on_first_load:!n,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:r=>{n&&this.featureFlagsCallback&&r.onFeatureFlags(()=>{let i=this.getAllFeatureFlags();i&&this.featureFlagsCallback&&this.featureFlagsCallback(i)}),this.captureCallback&&r.on("eventCaptured",(i,o)=>{this.captureCallback?.(i,o)})}})}}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let n={};for(let[r,i]of Object.entries(e))r.startsWith("in_segment_")&&(n[r]=i===!0);return n}identify(e,n){this.client?.identify(e,n)}alias(e,n){this.client?.alias(e,n)}track(e,n){this.client?.capture(e,n)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,n){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:n})}trackAction(e,n,r){this.track("shadow_canvas_action",{action:e,rectangleId:n,surface:r})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,n,r){let i=`$experiment_${e}`;this.register({[i]:r??`variation_${n}`,[`${i}_id`]:n}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:n,$experiment_variation_name:r??`variation_${n}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function ql(t={}){return new vp(t)}var w_={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function wp(){return w_}function yp(t){let e=2166136261,n=t.length;for(let r=0;r<n;r++)e^=t.charCodeAt(r),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function Ks(t,e,n){return n===2?yp(yp(t+e)+"")%1e4/1e4:n===1?yp(e+t)%1e3/1e3:null}function dC(t){return t<=0?[]:new Array(t).fill(1/t)}function Kl(t,e){return t>=e[0]&&t<e[1]}function x_(t,e){let n=Ks("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function S_(t,e){for(let n=0;n<e.length;n++)if(Kl(t,e[n]))return n;return-1}function xp(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Gl(t,e){if(!e.length)return!1;let n=!1,r=!1;for(let i=0;i<e.length;i++){let o=hC(t,e[i].type,e[i].pattern);if(e[i].include===!1){if(o)return!1}else n=!0,o&&(r=!0)}return r||!n}function fC(t,e,n){try{let r=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(r="\\/?"+r.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+r+"$","i").test(t)}catch{return!1}}function pC(t,e){try{let n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),r=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&r.push([t.hash,n.hash,!1]),n.searchParams.forEach((i,o)=>{r.push([t.searchParams.get(o)||"",i,!1])}),!r.some(i=>!fC(i[0],i[1],i[2]))}catch{return!1}}function hC(t,e,n){try{let r=new URL(t,"https://_");if(e==="regex"){let i=xp(n);return i?i.test(r.href)||i.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return pC(r,n);return!1}catch{return!1}}function b_(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=dC(t);n=n||r,n.length!==t&&(n=r);let i=n.reduce((s,a)=>a+s,0);(i<.99||i>1.01)&&(n=r);let o=0;return n.map(s=>{let a=o;return o+=s,[a,a+e*s]})}function k_(t,e,n){if(!e)return null;let r=e.split("?")[1];if(!r)return null;let i=r.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return i.length>0&&i[0]>=0&&i[0]<n?i[0]:null}function E_(t){try{return t()}catch(e){return console.error(e),!1}}var _p=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function mi(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||w_.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let r=await n.importKey("raw",_p(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[i,o]=t.split("."),s=await n.decrypt({name:"AES-CBC",iv:_p(i)},r,_p(o));return new TextDecoder().decode(s)}catch{throw new Error("Failed to decrypt")}}function Gs(t){return typeof t=="string"?t:JSON.stringify(t)}function Ot(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(n=>n.match(/^[0-9]+$/)?n.padStart(5," "):n).join("-")}function C_(){let t;try{t="1.6.3"}catch{t=""}return t}function A_(t,e){let n,r;try{n=new URL(t),r=new URL(e)}catch(i){return console.error(`Unable to merge query strings: ${i}`),e}return n.searchParams.forEach((i,o)=>{r.searchParams.has(o)||r.searchParams.set(o,i)}),r.toString()}function __(t){return typeof t=="object"&&t!==null}function Zl(t){return t.urlPatterns&&t.variations.some(e=>__(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>__(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function Yl(t,e){return new Promise(n=>{let r=!1,i,o=s=>{r||(r=!0,i&&clearTimeout(i),n(s||null))};e&&(i=setTimeout(()=>o(),e)),t.then(s=>o(s)).catch(()=>o())})}var nt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},Sn=wp(),vi={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>Sn.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:r})=>{let i={method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(n)};return Sn.fetch(`${t}/api/eval/${e}`,i)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new Sn.EventSource(`${t}/sub/${e}`,{headers:n}):new Sn.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),vC()):document.visibilityState==="hidden"&&(t=window.setTimeout(mC,nt.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(Sn.localStorage=globalThis.localStorage)}catch{}var yo=new Map,R_=!1,Gn=new Map,Xl=new Map,_o=new Map,wo=new Set;function bp(t){Object.assign(nt,t),nt.backgroundSync||Rp()}async function P_({instance:t,timeout:e,skipCache:n,allowStale:r,backgroundSync:i}){return i||(nt.backgroundSync=!1),yC({instance:t,allowStale:r,timeout:e,skipCache:n})}function gC(t){let e=Zs(t),n=yo.get(e)||new Set;n.add(t),yo.set(e,n)}function I_(t){yo.forEach(e=>e.delete(t))}function mC(){_o.forEach(t=>{t&&(t.state="idle",Cp(t))})}function vC(){_o.forEach(t=>{t&&t.state==="idle"&&Ap(t)})}async function T_(){try{if(!Sn.localStorage)return;await Sn.localStorage.setItem(nt.cacheKey,JSON.stringify(Array.from(Gn.entries())))}catch{}}async function yC({instance:t,allowStale:e,timeout:n,skipCache:r}){let i=Zs(t),o=kp(t),s=new Date,a=new Date(s.getTime()-nt.maxAge+nt.staleTTL);await _C();let l=!nt.disableCache&&!r?Gn.get(o):void 0;return l&&(e||l.staleAt>s)&&l.staleAt>a?(l.sse&&wo.add(i),l.staleAt<s?Sp(t):Ep(t),{data:l.data,success:!0,source:"cache"}):await Yl(Sp(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function Zs(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function kp(t){let e=Zs(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),r=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),i={};r.forEach(a=>{i[a]=n[a]});let o=t.getForcedVariations(),s=t.getUrl();return`${e}||${JSON.stringify({ca:i,fv:o,url:s})}`}async function _C(){if(!R_){R_=!0;try{if(Sn.localStorage){let t=await Sn.localStorage.getItem(nt.cacheKey);if(!nt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,r])=>{Gn.set(n,{...r,staleAt:new Date(r.staleAt)})}),O_()}}}catch{}if(!nt.disableIdleStreams){let t=vi.startIdleListener();t&&(vi.stopIdleListener=t)}}}function O_(){let t=Array.from(Gn.entries()).map(([n,r])=>({key:n,staleAt:r.staleAt.getTime()})).sort((n,r)=>n.staleAt-r.staleAt),e=Math.min(Math.max(0,Gn.size-nt.maxEntries),Gn.size);for(let n=0;n<e;n++)Gn.delete(t[n].key)}function N_(t,e,n){let r=n.dateUpdated||"",i=new Date(Date.now()+nt.staleTTL),o=nt.disableCache?void 0:Gn.get(e);if(o&&r&&o.version===r){o.staleAt=i,T_();return}nt.disableCache||(Gn.set(e,{data:n,version:r,staleAt:i,sse:wo.has(t)}),O_()),T_();let s=yo.get(t);s&&s.forEach(a=>wC(a,n))}async function wC(t,e){await t.setPayload(e||t.getPayload())}async function Sp(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),r=t.getClientKey(),i="isRemoteEval"in t&&t.isRemoteEval(),o=Zs(t),s=kp(t),a=Xl.get(s);return a||(a=(i?vi.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):vi.fetchFeaturesCall({host:e,clientKey:r,headers:n})).then(c=>{if(!c.ok)throw new Error(`HTTP error: ${c.status}`);return c.headers.get("x-sse-support")==="enabled"&&wo.add(o),c.json()}).then(c=>(N_(o,s,c),Ep(t),Xl.delete(s),{data:c,success:!0,source:"network"})).catch(c=>(Xl.delete(s),{data:null,source:"error",success:!1,error:c})),Xl.set(s,a)),a}function Ep(t,e=!1){let n=Zs(t),r=kp(t),{streamingHost:i,streamingHostRequestHeaders:o}=t.getApiHosts(),s=t.getClientKey();if(e&&wo.add(n),nt.backgroundSync&&wo.has(n)&&Sn.EventSource){if(_o.has(n))return;let a={src:null,host:i,clientKey:s,headers:o,cb:l=>{try{if(l.type==="features-updated"){let c=yo.get(n);c&&c.forEach(u=>{Sp(u)})}else if(l.type==="features"){let c=JSON.parse(l.data);N_(n,r,c)}a.errors=0}catch{L_(a)}},errors:0,state:"active"};_o.set(n,a),Ap(a)}}function L_(t){if(t.state!=="idle"&&(t.errors++,t.errors>3||t.src&&t.src.readyState===2)){let e=Math.pow(3,t.errors-3)*(1e3+Math.random()*1e3);Cp(t),setTimeout(()=>{["idle","active"].includes(t.state)||Ap(t)},Math.min(e,3e5))}}function Cp(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function Ap(t){t.src=vi.eventSourceCall({host:t.host,clientKey:t.clientKey,headers:t.headers}),t.state="active",t.src.addEventListener("features",t.cb),t.src.addEventListener("features-updated",t.cb),t.src.onerror=()=>L_(t),t.src.onopen=()=>{t.errors=0}}function xC(t,e){Cp(t),_o.delete(e)}function Rp(){wo.clear(),_o.forEach(xC),yo.clear(),vi.stopIdleListener()}function Ql(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&Ep(t,!0),gC(t)}}var SC=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Ip={revert:function(){}},nc=new Map,Op=new Set;function bC(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function rc(t){var e=nc.get(t);return e||(e={element:t,attributes:{}},nc.set(t,e)),e}function ic(t,e,n,r,i){var o=n(t),s={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&s._positionTimeout)){e==="position"&&(s._positionTimeout=setTimeout(function(){s._positionTimeout=null},1e3));var a=n(t);e==="position"&&a.parentNode===s.virtualValue.parentNode&&a.insertBeforeNode===s.virtualValue.insertBeforeNode||a!==s.virtualValue&&(s.originalValue=a,i(s))}}),mutationRunner:i,setValue:r,getCurrentValue:n};return e==="position"&&t.parentNode?s.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):s.observer.observe(t,bC(e)),s}function oc(t,e){var n=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!n||t.parentNode!==n.parentNode||t.insertBeforeNode!==n.insertBeforeNode)&&(e.isDirty=!0,M_()):t!==n&&(e.isDirty=!0,M_())}function kC(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),oc(DC(e),t)}function EC(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),oc(Array.from(e).filter(Boolean).join(" "),t)}function CC(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),oc(e,t)}function AC(t){var e=t.parentSelector,n=t.insertBeforeSelector,r=document.querySelector(e);if(!r)return null;var i=n?document.querySelector(n):null;return n&&!i?null:{parentNode:r,insertBeforeNode:i}}function RC(t){var e=t.originalValue;t.mutations.forEach(function(n){var r=n.mutate(),i=AC(r);e=i||e}),oc(e,t)}var TC=function(e){return e.innerHTML},PC=function(e,n){return e.innerHTML=n};function $_(t){var e=rc(t);return e.html||(e.html=ic(t,"html",TC,PC,kC)),e.html}var IC=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},OC=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function D_(t){var e=rc(t);return e.position||(e.position=ic(t,"position",IC,OC,RC)),e.position}var NC=function(e,n){return n?e.className=n:e.removeAttribute("class")},LC=function(e){return e.className};function B_(t){var e=rc(t);return e.classes||(e.classes=ic(t,"class",LC,NC,EC)),e.classes}var MC=function(e){return function(n){var r;return(r=n.getAttribute(e))!=null?r:null}},FC=function(e){return function(n,r){return r!==null?n.setAttribute(e,r):n.removeAttribute(e)}};function V_(t,e){var n=rc(t);return n.attributes[e]||(n.attributes[e]=ic(t,e,MC(e),FC(e),CC)),n.attributes[e]}function $C(t,e){var n=nc.get(t);if(n)if(e==="html"){var r,i;(r=n.html)==null||(i=r.observer)==null||i.disconnect(),delete n.html}else if(e==="class"){var o,s;(o=n.classes)==null||(s=o.observer)==null||s.disconnect(),delete n.classes}else if(e==="position"){var a,l;(a=n.position)==null||(l=a.observer)==null||l.disconnect(),delete n.position}else{var c,u,f;(c=n.attributes)==null||(u=c[e])==null||(f=u.observer)==null||f.disconnect(),delete n.attributes[e]}}var Jl;function DC(t){return Jl||(Jl=document.createElement("div")),Jl.innerHTML=t,Jl.innerHTML}function ec(t,e,n){if(n.isDirty){n.isDirty=!1;var r=n.virtualValue;n.mutations.length||$C(t,e),n.setValue(t,r)}}function BC(t,e){t.html&&ec(e,"html",t.html),t.classes&&ec(e,"class",t.classes),t.position&&ec(e,"position",t.position),Object.keys(t.attributes).forEach(function(n){ec(e,n,t.attributes[n])})}function M_(){nc.forEach(BC)}function VC(t,e){var n=null;t.kind==="html"?n=$_(e):t.kind==="class"?n=B_(e):t.kind==="attribute"?n=V_(e,t.attribute):t.kind==="position"&&(n=D_(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function zC(t,e){var n=null;if(t.kind==="html"?n=$_(e):t.kind==="class"?n=B_(e):t.kind==="attribute"?n=V_(e,t.attribute):t.kind==="position"&&(n=D_(e)),!!n){var r=n.mutations.indexOf(t);r!==-1&&n.mutations.splice(r,1),n.mutationRunner(n)}}function z_(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),n=document.querySelectorAll(t.selector);n.forEach(function(r){e.has(r)||(t.elements.add(r),VC(t,r))})}}function HC(t){t.elements.forEach(function(e){return zC(t,e)}),t.elements.clear(),Op.delete(t)}function F_(){Op.forEach(z_)}var Tp;function jC(){typeof document>"u"||(Tp||(Tp=new MutationObserver(function(){F_()})),F_(),Tp.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}jC();function sc(t){return typeof document>"u"?Ip:(Op.add(t),z_(t),{revert:function(){HC(t)}})}function Pp(t,e){return sc({kind:"html",elements:new Set,mutate:e,selector:t})}function H_(t,e){return sc({kind:"position",elements:new Set,mutate:e,selector:t})}function Ys(t,e){return sc({kind:"class",elements:new Set,mutate:e,selector:t})}function tc(t,e,n){return SC.test(e)?e==="class"||e==="className"?Ys(t,function(r){var i=n(Array.from(r).join(" "));r.clear(),i&&i.split(/\s+/g).filter(Boolean).forEach(function(o){return r.add(o)})}):sc({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):Ip}function UC(t){var e=t.selector,n=t.action,r=t.value,i=t.attribute,o=t.parentSelector,s=t.insertBeforeSelector;if(i==="html"){if(n==="append")return Pp(e,function(a){return a+(r??"")});if(n==="set")return Pp(e,function(){return r??""})}else if(i==="class"){if(n==="append")return Ys(e,function(a){r&&a.add(r)});if(n==="remove")return Ys(e,function(a){r&&a.delete(r)});if(n==="set")return Ys(e,function(a){a.clear(),r&&a.add(r)})}else if(i==="position"){if(n==="set"&&o)return H_(e,function(){return{insertBeforeSelector:s,parentSelector:o}})}else{if(n==="append")return tc(e,i,function(a){return a!==null?a+(r??""):r??""});if(n==="set")return tc(e,i,function(){return r??""});if(n==="remove")return tc(e,i,function(){return null})}return Ip}var WC={html:Pp,classes:Ys,attribute:tc,position:H_,declarative:UC},j_=WC;var Np={};function Tr(t,e,n){n=n||{};for(let[r,i]of Object.entries(e))switch(r){case"$or":if(!W_(t,i,n))return!1;break;case"$nor":if(W_(t,i,n))return!1;break;case"$and":if(!YC(t,i,n))return!1;break;case"$not":if(Tr(t,i,n))return!1;break;default:if(!Xs(i,qC(t,r),n))return!1}return!0}function qC(t,e){let n=e.split("."),r=t;for(let i=0;i<n.length;i++)if(r&&typeof r=="object"&&n[i]in r)r=r[n[i]];else return null;return r}function U_(t,e=!1){let n=`${t}${e?"/i":""}`;return Np[n]||(Np[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Np[n]}function Xs(t,e,n){if(typeof t=="string")return e+""===t;if(typeof t=="number")return e*1===t;if(typeof t=="boolean")return e!==null&&!!e===t;if(t===null)return e===null;if(Array.isArray(t)||!q_(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!ZC(r,e,t[r],n))return!1;return!0}function q_(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function KC(t){if(t===null)return"null";if(Array.isArray(t))return"array";let e=typeof t;return["string","number","boolean","object","undefined"].includes(e)?e:"unknown"}function GC(t,e,n){if(!Array.isArray(t))return!1;let r=q_(e)?i=>Xs(e,i,n):i=>Tr(i,e,n);for(let i=0;i<t.length;i++)if(t[i]&&r(t[i]))return!0;return!1}function ac(t,e){return Array.isArray(t)?t.some(n=>e.includes(n)):e.includes(t)}function ZC(t,e,n,r){switch(t){case"$veq":return Ot(e)===Ot(n);case"$vne":return Ot(e)!==Ot(n);case"$vgt":return Ot(e)>Ot(n);case"$vgte":return Ot(e)>=Ot(n);case"$vlt":return Ot(e)<Ot(n);case"$vlte":return Ot(e)<=Ot(n);case"$eq":return e===n;case"$ne":return e!==n;case"$lt":return e<n;case"$lte":return e<=n;case"$gt":return e>n;case"$gte":return e>=n;case"$exists":return n?e!=null:e==null;case"$in":return Array.isArray(n)?ac(e,n):!1;case"$inGroup":return ac(e,r[n]||[]);case"$notInGroup":return!ac(e,r[n]||[]);case"$nin":return Array.isArray(n)?!ac(e,n):!1;case"$not":return!Xs(n,e,r);case"$size":return Array.isArray(e)?Xs(n,e.length,r):!1;case"$elemMatch":return GC(e,n,r);case"$all":if(!Array.isArray(e))return!1;for(let i=0;i<n.length;i++){let o=!1;for(let s=0;s<e.length;s++)if(Xs(n[i],e[s],r)){o=!0;break}if(!o)return!1}return!0;case"$regex":try{return U_(n).test(e)}catch{return!1}case"$regexi":try{return U_(n,!0).test(e)}catch{return!1}case"$type":return KC(e)===n;default:return console.error("Unknown operator: "+t),!1}}function W_(t,e,n){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(Tr(t,e[r],n))return!0;return!1}function YC(t,e,n){for(let r=0;r<e.length;r++)if(!Tr(t,e[r],n))return!1;return!0}var XC="Feature Evaluated",QC="Experiment Viewed";function JC(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((n,r)=>e.set(r,n)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((n,r)=>e.set(r,n)),e}function eA(t){return t.global.forcedVariations&&t.user.forcedVariations?{...t.global.forcedVariations,...t.user.forcedVariations}:t.global.forcedVariations?t.global.forcedVariations:t.user.forcedVariations?t.user.forcedVariations:{}}async function xo(t){try{await t()}catch{}}function K_(t,e,n){if(t.user.trackedExperiments){let i=uc(e,n);if(t.user.trackedExperiments.has(i))return[];t.user.trackedExperiments.add(i)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});let r=[];if(t.global.trackingCallback){let i=t.global.trackingCallback;r.push(xo(()=>i(e,n,t.user)))}if(t.user.trackingCallback){let i=t.user.trackingCallback;r.push(xo(()=>i(e,n)))}if(t.global.eventLogger){let i=t.global.eventLogger;r.push(xo(()=>i(QC,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return r}function tA(t,e,n){if(t.user.trackedFeatureUsage){let r=JSON.stringify(n.value);if(t.user.trackedFeatureUsage[e]===r)return;t.user.trackedFeatureUsage[e]=r,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:n,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let r=t.global.onFeatureUsage;xo(()=>r(e,n,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;xo(()=>r(e,n))}if(t.global.eventLogger){let r=t.global.eventLogger;xo(()=>r(XC,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function lc(t,e){if(e.stack.evaluatedFeatures.has(t))return Pr(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=JC(e);if(n.has(t))return Pr(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return Pr(e,t,null,"unknownFeature");let r=e.global.features[t];if(r.rules){let i=new Set(e.stack.evaluatedFeatures);e:for(let o of r.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(i);let c=lc(l.id,e);if(c.source==="cyclicPrerequisite")return Pr(e,t,null,"cyclicPrerequisite");let u={value:c.value};if(!Tr(u,l.condition||{})){if(l.gate)return Pr(e,t,null,"prerequisite");continue e}}if(o.filters&&Y_(o.filters,e))continue;if("force"in o){if(o.condition&&!Z_(o.condition,e)||!nA(e,o.seed||t,o.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!o.disableStickyBucketing?o.fallbackAttribute:void 0,o.range,o.coverage,o.hashVersion))continue;return o.tracks&&o.tracks.forEach(l=>{!K_(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),Pr(e,t,o.force,"force",o.id)}if(!o.variations)continue;let s={variations:o.variations,key:o.key||t};"coverage"in o&&(s.coverage=o.coverage),o.weights&&(s.weights=o.weights),o.hashAttribute&&(s.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(s.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(s.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(s.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(s.minBucketVersion=o.minBucketVersion),o.namespace&&(s.namespace=o.namespace),o.meta&&(s.meta=o.meta),o.ranges&&(s.ranges=o.ranges),o.name&&(s.name=o.name),o.phase&&(s.phase=o.phase),o.seed&&(s.seed=o.seed),o.hashVersion&&(s.hashVersion=o.hashVersion),o.filters&&(s.filters=o.filters),o.condition&&(s.condition=o.condition);let{result:a}=cc(s,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(s,a),a.inExperiment&&!a.passthrough)return Pr(e,t,a.value,"experiment",o.id,s,a)}}return Pr(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function cc(t,e,n){let r=t.key,i=t.variations.length;if(i<2)return{result:Se(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:Se(n,t,-1,!1,e)};if(t=rA(t,n),t.urlPatterns&&!Gl(n.user.url||"",t.urlPatterns))return{result:Se(n,t,-1,!1,e)};let o=k_(r,n.user.url||"",i);if(o!==null)return{result:Se(n,t,o,!1,e)};let s=eA(n);if(r in s){let x=s[r];return{result:Se(n,t,x,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:Se(n,t,-1,!1,e)};let{hashAttribute:a,hashValue:l}=yi(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:Se(n,t,-1,!1,e)};let c=-1,u=!1,f=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:x,versionIsBlocked:d}=sA({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});u=x>=0,c=x,f=!!d}if(!u){if(t.filters){if(Y_(t.filters,n))return{result:Se(n,t,-1,!1,e)}}else if(t.namespace&&!x_(l,t.namespace))return{result:Se(n,t,-1,!1,e)};if(t.include&&!E_(t.include))return{result:Se(n,t,-1,!1,e)};if(t.condition&&!Z_(t.condition,n))return{result:Se(n,t,-1,!1,e)};if(t.parentConditions){let x=new Set(n.stack.evaluatedFeatures);for(let d of t.parentConditions){n.stack.evaluatedFeatures=new Set(x);let p=lc(d.id,n);if(p.source==="cyclicPrerequisite")return{result:Se(n,t,-1,!1,e)};let m={value:p.value};if(!Tr(m,d.condition||{}))return{result:Se(n,t,-1,!1,e)}}}if(t.groups&&!oA(t.groups,n))return{result:Se(n,t,-1,!1,e)}}if(t.url&&!iA(t.url,n))return{result:Se(n,t,-1,!1,e)};let h=Ks(t.seed||r,l,t.hashVersion||1);if(h===null)return{result:Se(n,t,-1,!1,e)};if(!u){let x=t.ranges||b_(i,t.coverage===void 0?1:t.coverage,t.weights);c=S_(h,x)}if(f)return{result:Se(n,t,-1,!1,e,void 0,!0)};if(c<0)return{result:Se(n,t,-1,!1,e)};if("force"in t)return{result:Se(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:Se(n,t,-1,!1,e)};if(t.status==="stopped")return{result:Se(n,t,-1,!1,e)};let g=Se(n,t,c,!0,e,h,u);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:x,key:d,doc:p}=lA(n,a,Gs(l),{[Lp(t.key,t.bucketVersion)]:g.key});x&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[d]=p,n.user.saveStickyBucketAssignmentDoc(p))}let v=K_(n,t,g);v.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:g});let _=v.length?v.length===1?v[0]:Promise.all(v).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:g,trackingCall:_}}function Pr(t,e,n,r,i,o,s){let a={value:n,on:!!n,off:!n,source:r,ruleId:i||""};return o&&(a.experiment=o),s&&(a.experimentResult=s),r!=="override"&&tA(t,e,a),a}function G_(t){return{...t.user.attributes,...t.user.attributeOverrides}}function Z_(t,e){return Tr(G_(e),t,e.global.savedGroups||{})}function Y_(t,e){return t.some(n=>{let{hashValue:r}=yi(e,n.attribute);if(!r)return!0;let i=Ks(n.seed,r,n.hashVersion||2);return i===null?!0:!n.ranges.some(o=>Kl(i,o))})}function nA(t,e,n,r,i,o,s){if(!i&&o===void 0)return!0;if(!i&&o===0)return!1;let{hashValue:a}=yi(t,n,r);if(!a)return!1;let l=Ks(e,a,s||1);return l===null?!1:i?Kl(l,i):o!==void 0?l<=o:!0}function Se(t,e,n,r,i,o,s){let a=!0;(n<0||n>=e.variations.length)&&(n=0,a=!1);let{hashAttribute:l,hashValue:c}=yi(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),u=e.meta?e.meta[n]:{},f={key:u.key||""+n,featureId:i,inExperiment:a,hashUsed:r,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:c,stickyBucketUsed:!!s};return u.name&&(f.name=u.name),o!==void 0&&(f.bucket=o),u.passthrough&&(f.passthrough=u.passthrough),f}function rA(t,e){let n=t.key,r=e.global.overrides;return r&&r[n]&&(t=Object.assign({},t,r[n]),typeof t.url=="string"&&(t.url=xp(t.url))),t}function yi(t,e,n){let r=e||"id",i="",o=G_(t);return o[r]&&(i=o[r]),!i&&n&&(o[n]&&(i=o[n]),i&&(r=n)),{hashAttribute:r,hashValue:i}}function iA(t,e){let n=e.user.url;if(!n)return!1;let r=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(n)||t.test(r))}function oA(t,e){let n=e.global.groups||{};for(let r=0;r<t.length;r++)if(n[t[r]])return!0;return!1}function sA({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:r,expFallbackAttribute:i,expMinBucketVersion:o,expMeta:s}){n=n||0,o=o||0,r=r||"id",s=s||[];let a=Lp(e,n),l=aA(t,r,i);if(o>0)for(let f=0;f<o;f++){let h=Lp(e,f);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let c=l[a];if(c===void 0)return{variation:-1};let u=s.findIndex(f=>f.key===c);return u<0?{variation:-1}:{variation:u}}function Lp(t,e){return e=e||0,`${t}__${e}`}function Mp(t,e){return`${t}||${e}`}function aA(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:i}=yi(t,e),o=Mp(r,Gs(i)),{hashAttribute:s,hashValue:a}=yi(t,n),l=a?Mp(s,Gs(a)):null,c={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[o].assignments||{}),c}function lA(t,e,n,r){let i=Mp(e,n),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[i]?t.user.stickyBucketAssignmentDocs[i].assignments||{}:{},s={...o,...r},a=JSON.stringify(o)!==JSON.stringify(s);return{key:i,doc:{attributeName:e,attributeValue:n,assignments:s},changed:a}}function cA(t,e){let n=new Set,r=e&&e.features?e.features:t.global.features||{},i=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(r).forEach(o=>{let s=r[o];if(s.rules)for(let a of s.rules)a.variations&&(n.add(a.hashAttribute||"id"),a.fallbackAttribute&&n.add(a.fallbackAttribute))}),i.map(o=>{n.add(o.hashAttribute||"id"),o.fallbackAttribute&&n.add(o.fallbackAttribute)}),Array.from(n)}async function X_(t,e,n){let r=Fp(t,n);return e.getAllAssignments(r)}function Fp(t,e){let n={};return cA(t,e).forEach(i=>{let{hashValue:o}=yi(t,i);n[i]=Gs(o)}),n}async function Q_(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await mi(t.encryptedFeatures,e,n))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await mi(t.encryptedExperiments,e,n))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await mi(t.encryptedSavedGroups,e,n))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function J_(t){let e=t.apiHost||"https://cdn.growthbook.io";return{apiHost:e.replace(/\/*$/,""),streamingHost:(t.streamingHost||e).replace(/\/*$/,""),apiRequestHeaders:t.apiHostRequestHeaders,streamingHostRequestHeaders:t.streamingHostRequestHeaders}}function uc(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var So=typeof window<"u"&&typeof document<"u",uA=C_(),bo=class{constructor(e){if(e=e||{},this.version=uA,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!e.clientKey)throw new Error("Missing clientKey");let n=!1;try{n=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(n)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(e.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(e.stickyBucketService){let n=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=r=>n.saveAssignments(r)}if(e.plugins)for(let n of e.plugins)n(this);if(e.features&&(this.ready=!0),So&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let n in this._options.stickyBucketAssignmentDocs){let r=this._options.stickyBucketAssignmentDocs[n];r&&this._options.stickyBucketService.saveAssignments(r).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let n=await Q_(e,this._options.decryptionKey);this._decryptedPayload=n,await this.refreshStickyBuckets(n),n.features&&(this._options.features=n.features),n.savedGroups&&(this._options.savedGroups=n.savedGroups),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let n=e.payload;if(n.encryptedExperiments||n.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,n)),this._payload=n,this._decryptedPayload=n,n.features&&(this._options.features=n.features),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,Ql(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&bp(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Ql(this,e),{success:!0,source:"init"};{let{data:n,...r}=await this._refresh({...e,allowStale:!0});return Ql(this,e),await this.setPayload(n||{}),r}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let n=await this._refresh({...e||{},allowStale:!1});n.data&&await this.setPayload(n.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return J_(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:n,allowStale:r,streaming:i}){if(!this._options.clientKey)throw new Error("Missing clientKey");return P_({instance:this,timeout:e,skipCache:n||this._options.disableCache,allowStale:r,backgroundSync:i??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,n,r){let i=await mi(e,n||this._options.decryptionKey,r);this.setFeatures(JSON.parse(i))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,n,r){let i=await mi(e,n||this._options.decryptionKey,r);this.setExperiments(JSON.parse(i))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(n=>{try{n()}catch(r){console.error(r)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,I_(this),e.destroyAllStreams&&Rp(),this.logs=[],So&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(n=>{n.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,n){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=n,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:n}=cc(e,null,this._getEvalContext());return this._onExperimentEval(e,n),n}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(r=>r.key===e).map(r=>this._runAutoExperiment(r)).filter(r=>r!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,n){let r=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!r)return null;let i=this._isAutoExperimentBlockedByContext(e),o,s;i?o=Se(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:s}=cc(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let a=JSON.stringify(o.value);if(!n&&o.inExperiment&&r&&r.valueHash===a)return o;if(r&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=Zl(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let c=e.persistQueryString?A_(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Gl(c,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=c;let{navigate:u,delay:f}=this._getNavigateFunction();if(u)if(So)Promise.all([...s?[Yl(s,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??f))]).then(()=>{try{u(c)}catch(h){console.error(h)}});else try{u(c)}catch(h){console.error(h)}}else if(l==="visual"){let c=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);c&&this._activeAutoExperiments.set(e,{undo:c,valueHash:a})}}return o}_undoActiveAutoExperiment(e){let n=this._activeAutoExperiments.get(e);n&&(n.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let n=this._options.experiments||[],r=new Set(n);this._activeAutoExperiments.forEach((i,o)=>{r.has(o)||(i.undo(),this._activeAutoExperiments.delete(o))});for(let i of n){let o=this._runAutoExperiment(i,e);if(o&&o.inExperiment&&Zl(i)==="redirect")break}}_onExperimentEval(e,n){let r=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:n}),this._subscriptions.size>0&&this._fireSubscriptions(e,n,r)}_fireSubscriptions(e,n,r){(!r||r.result.inExperiment!==n.inExperiment||r.result.variationId!==n.variationId)&&this._subscriptions.forEach(i=>{try{i(e,n)}catch(o){console.error(o)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,n){let r=this.evalFeature(e).value;return r===null?n:r}feature(e){return this.evalFeature(e)}evalFeature(e){return lc(e,this._getEvalContext())}log(e,n){this.debug&&(this._options.log?this._options.log(e,n):console.log(e,n))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(n=>n&&n.experiment&&n.result).map(n=>[uc(n.experiment,n.result),n]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(n=>{!n||!n.experiment||!n.result?console.error("Invalid deferred tracking call",{call:n}):e.push(this._options.trackingCallback(n.experiment,n.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,n){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:n,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,n||{},this._getUserContext())}catch(r){console.error(r)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(uc(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(So?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=Zl(e);if(n==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(r=>r.js))return!0}else if(n==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let r=new URL(this._getContextUrl());for(let i of e.variations){if(!i||!i.urlRedirect)continue;let o=new URL(i.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==r.protocol||o.host!==r.host))return!0}}catch(r){return this.log("Error parsing current or redirect URL",{id:e.key,error:r}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:So?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!So)return;let n=[];if(e.css){let r=document.createElement("style");r.innerHTML=e.css,document.head.appendChild(r),n.push(()=>r.remove())}if(e.js){let r=document.createElement("script");r.innerHTML=e.js,this._options.jsInjectionNonce&&(r.nonce=this._options.jsInjectionNonce),document.head.appendChild(r),n.push(()=>r.remove())}return e.domMutations&&e.domMutations.forEach(r=>{n.push(j_.declarative(r).revert)}),()=>{n.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),r=await X_(n,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=r}}generateStickyBucketAssignmentDocsSync(e,n){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let r=this._getEvalContext(),i=Fp(r,n);return e.getAllAssignmentsSync(i)}inDevMode(){return!!this._options.enableDevMode}};var bn=ee(wt());function Hp(){return Hp=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Hp.apply(null,arguments)}var AA=bn.createContext({});var RA=t=>n=>bn.createElement(AA.Consumer,null,({growthbook:r})=>bn.createElement(t,Hp({},n,{runExperiment:i=>r.run(i)})));RA.displayName="WithRunExperiment";var TA="https://experiment.syntrologie.com",jp=class{constructor(e={}){j(this,"gb");if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(r,i)=>{e.onExperimentViewed(r.key,i.variationId,typeof i.value=="string"?i.value:`variation_${i.variationId}`)}:void 0;this.gb=new bo({...e,apiHost:e.apiHost??TA,enableDevMode:e.enableDevMode??!0,trackingCallback:n}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,n){return this.gb.getFeatureValue(e,n)}shouldRenderRectangle(e){let n=e.experiment;if(!n||!n.featureKey)return!0;let r=this.gb.getFeatureValue(n.featureKey,null);if(r==null)return!1;if(typeof n.variationId=="number")return Number(r)===n.variationId;if(typeof n.variationValue<"u")return r===n.variationValue;if(n.predicate)try{return n.predicate(r)}catch{return!1}return!!r}};function hc(t={}){return new jp(t)}var Ir=ee(wt(),1),PA=t=>[...t].sort((e,n)=>(e.order??0)-(n.order??0));function Up({fetcher:t,pollIntervalMs:e=3e4,experiments:n,runtime:r}){let[i,o]=(0,Ir.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Ir.useCallback)(async()=>{try{o(c=>({...c,isLoading:!0,error:void 0}));let a=await t(),l=a.tiles||[];r&&a.routes&&r.setRoutes(a.routes),r?(l=await r.filterTiles(l),n&&(l=l.filter(c=>n.shouldRenderRectangle(c)))):n&&(l=l.filter(c=>n.shouldRenderRectangle(c))),o({tiles:PA(l),actions:a.actions||[],isLoading:!1,fetchedAt:a.fetchedAt,canvasTitle:a.canvasTitle,configVersion:a.configVersion,theme:a.theme,launcher:a.launcher,routes:a.routes})}catch(a){o(l=>({...l,isLoading:!1,error:a instanceof Error?a.message:"Unknown error"}))}},[n,t,r]);return(0,Ir.useEffect)(()=>{if(s(),!e)return;let a=setInterval(s,e);return()=>clearInterval(a)},[s,e]),(0,Ir.useMemo)(()=>i,[i])}var Zn=ee(wt(),1);var Js=ee(wt(),1),ie=ee(ye(),1),$A={success:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M6 10l2.5 2.5L14 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),warning:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("path",{d:"M10 2L18 17H2L10 2Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,ie.jsx)("path",{d:"M10 8v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]}),error:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),info:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M10 9v5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"6",r:"0.75",fill:"currentColor"})]}),alert:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M10 5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]})};function DA({onClick:t,color:e}){return(0,ie.jsx)("button",{onClick:n=>{n.stopPropagation(),t()},style:{position:"absolute",top:"8px",right:"8px",width:"20px",height:"20px",padding:0,border:"none",background:"rgba(255, 255, 255, 0.1)",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:e,opacity:.6,transition:"opacity 0.15s ease"},onMouseEnter:n=>{n.currentTarget.style.opacity="1"},onMouseLeave:n=>{n.currentTarget.style.opacity="0.6"},"aria-label":"Dismiss",children:(0,ie.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,ie.jsx)("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})}function BA(t){let e={success:{bg:"var(--sc-color-success-muted, rgba(52, 199, 89, 0.15))",border:"var(--sc-color-success, #34c759)",icon:"var(--sc-color-success, #34c759)",text:"var(--sc-color-text, #f5f5f7)"},warning:{bg:"var(--sc-color-warning-muted, rgba(255, 159, 10, 0.15))",border:"var(--sc-color-warning, #ff9f0a)",icon:"var(--sc-color-warning, #ff9f0a)",text:"var(--sc-color-text, #f5f5f7)"},error:{bg:"var(--sc-color-error-muted, rgba(255, 69, 58, 0.15))",border:"var(--sc-color-error, #ff453a)",icon:"var(--sc-color-error, #ff453a)",text:"var(--sc-color-text, #f5f5f7)"},info:{bg:"var(--sc-color-info-muted, rgba(10, 132, 255, 0.15))",border:"var(--sc-color-info, #0a84ff)",icon:"var(--sc-color-info, #0a84ff)",text:"var(--sc-color-text, #f5f5f7)"},alert:{bg:"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))",border:"var(--sc-color-primary, #6366f1)",icon:"var(--sc-color-primary, #6366f1)",text:"var(--sc-color-text, #f5f5f7)"}};return e[t]||e.info}function Wp({content:t,onDismiss:e,accentColor:n}){let[r,i]=(0,Js.useState)(!1),[o,s]=(0,Js.useState)(t.type==="warning"?t.countdown??null:null);(0,Js.useEffect)(()=>{if(o===null||o<=0)return;let d=setInterval(()=>{s(p=>p!==null&&p>0?p-1:null)},1e3);return()=>clearInterval(d)},[o]);let a=()=>{i(!0),setTimeout(()=>e?.(),200)},l=BA(t.type),c=$A[t.type],u={position:"relative",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-md, 10px)",background:l.bg,borderLeft:`3px solid ${l.border}`,opacity:r?0:1,transform:r?"translateX(10px)":"translateX(0)",transition:"opacity 0.2s ease, transform 0.2s ease"},f={display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-sm, 0.5rem)"},h={color:l.icon,flexShrink:0,marginTop:"1px"},g={flex:1,minWidth:0,paddingRight:t.dismissible?"24px":0},v={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:l.text,margin:0,lineHeight:"var(--sc-line-height-tight, 1.25)"},_={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:"var(--sc-line-height-normal, 1.5)"},x={fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)",marginTop:"var(--sc-spacing-sm, 0.5rem)"};return(0,ie.jsxs)("div",{style:u,children:[(0,ie.jsxs)("div",{style:f,children:[(0,ie.jsx)("div",{style:h,children:(0,ie.jsx)(c,{})}),(0,ie.jsxs)("div",{style:g,children:[(0,ie.jsx)("h4",{style:v,children:t.title}),t.body&&(0,ie.jsx)("p",{style:_,children:t.body}),t.type==="error"&&t.errorCode&&(0,ie.jsxs)("p",{style:{..._,fontFamily:"var(--sc-font-family-mono, monospace)"},children:["Code: ",t.errorCode]}),t.type==="info"&&t.learnMoreUrl&&(0,ie.jsx)("a",{href:t.learnMoreUrl,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-sm, 0.8rem)",color:l.icon,textDecoration:"none"},onClick:d=>d.stopPropagation(),children:"Learn more \u2192"}),o!==null&&o>0&&(0,ie.jsxs)("p",{style:{..._,color:l.icon},children:["Action required in ",o,"s"]}),t.timestamp&&(0,ie.jsx)("p",{style:x,children:t.timestamp})]})]}),t.dismissible&&(0,ie.jsx)(DA,{onClick:a,color:l.text})]})}var m0=ee(wt(),1),Ce=ee(ye(),1);function VA({trend:t}){let e=t.direction==="up",n=t.direction==="down";return(0,Ce.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"var(--sc-border-radius-full, 9999px)",background:e?"var(--sc-color-success-muted, rgba(52, 199, 89, 0.15))":n?"var(--sc-color-error-muted, rgba(255, 69, 58, 0.15))":"rgba(142, 142, 147, 0.15)",color:e?"var(--sc-color-success, #34c759)":n?"var(--sc-color-error, #ff453a)":"var(--sc-color-text-muted, #8e8e93)",fontSize:"var(--sc-font-size-xs, 0.7rem)",fontWeight:"var(--sc-font-weight-medium, 500)"},children:[(0,Ce.jsx)(()=>(0,Ce.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{transform:e?"rotate(0deg)":n?"rotate(180deg)":"rotate(90deg)"},children:(0,Ce.jsx)("path",{d:"M5 1v8M5 1L2 4M5 1l3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),{}),t.value,t.timeframe&&(0,Ce.jsx)("span",{style:{color:"var(--sc-color-text-muted, #8e8e93)"},children:t.timeframe})]})}function zA({data:t,color:e}){let{path:n,width:r,height:i}=(0,m0.useMemo)(()=>{if(t.length<2)return{path:"",width:60,height:24};let l=Math.min(...t),u=Math.max(...t)-l||1;return{path:t.map((g,v)=>{let _=2+v/(t.length-1)*56,x=22-(g-l)/u*20;return{x:_,y:x}}).reduce((g,v,_)=>g+(_===0?`M ${v.x} ${v.y}`:` L ${v.x} ${v.y}`),""),width:60,height:24}},[t]);return n?(0,Ce.jsxs)("svg",{width:r,height:i,viewBox:`0 0 ${r} ${i}`,style:{overflow:"visible"},children:[(0,Ce.jsx)("path",{d:n,stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),(0,Ce.jsx)("defs",{children:(0,Ce.jsxs)("linearGradient",{id:"sparkline-gradient",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,Ce.jsx)("stop",{offset:"0%",stopColor:e,stopOpacity:"0.3"}),(0,Ce.jsx)("stop",{offset:"100%",stopColor:e,stopOpacity:"0"})]})}),(0,Ce.jsx)("path",{d:`${n} L ${r-2} ${i} L 2 ${i} Z`,fill:"url(#sparkline-gradient)"})]}):null}function qp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"},i={display:"flex",alignItems:"baseline",gap:"var(--sc-spacing-xs, 0.25rem)"},o={fontSize:"var(--sc-font-size-xxl, 1.5rem)",fontWeight:"var(--sc-font-weight-bold, 700)",color:n,letterSpacing:"-0.02em",lineHeight:1},s={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-normal, 400)",color:"var(--sc-color-text-muted, #8e8e93)"},a={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",margin:0},l={display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"var(--sc-spacing-xs, 0.25rem)"};return(0,Ce.jsxs)("div",{style:r,children:[(0,Ce.jsxs)("div",{style:i,children:[t.prefix&&(0,Ce.jsx)("span",{style:s,children:t.prefix}),(0,Ce.jsx)("span",{style:o,children:t.value}),t.suffix&&(0,Ce.jsx)("span",{style:s,children:t.suffix})]}),(0,Ce.jsx)("p",{style:a,children:t.label}),(t.trend||t.sparkline)&&(0,Ce.jsxs)("div",{style:l,children:[t.trend&&(0,Ce.jsx)(VA,{trend:t.trend}),t.sparkline&&t.sparkline.length>1&&(0,Ce.jsx)(zA,{data:t.sparkline,color:n})]})]})}var xt=ee(ye(),1);function HA({item:t,accentColor:e,layout:n}){let r=t.highlight,i={display:"flex",flexDirection:n==="list"?"row":"column",alignItems:n==="list"?"center":"flex-start",gap:n==="list"?"var(--sc-spacing-md, 0.75rem)":"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",background:r?"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))":"var(--sc-color-background-subtle, rgba(0, 0, 0, 0.2))",border:r?`1px solid ${e}`:"1px solid var(--sc-color-border-subtle, rgba(255, 255, 255, 0.06))",transition:"all 0.15s ease"},o={fontSize:"1.25rem",marginBottom:n==="list"?0:"var(--sc-spacing-xs, 0.25rem)"},s={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",flex:n==="list"?1:void 0},a={fontSize:"var(--sc-font-size-lg, 1rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:r?e:"var(--sc-color-text, #f5f5f7)"};return(0,xt.jsxs)("div",{style:i,children:[t.icon&&(0,xt.jsx)("span",{style:o,children:t.icon}),(0,xt.jsx)("span",{style:s,children:t.label}),(0,xt.jsx)("span",{style:a,children:t.value})]})}function Kp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r=t.layout||"grid",i=t.columns||2,o=t.items;if(t.highlightBest&&!t.items.some(a=>a.highlight)){let a=t.items.map(c=>({...c,numericValue:typeof c.value=="number"?c.value:parseFloat(String(c.value))})),l=Math.max(...a.map(c=>c.numericValue||0));o=a.map(c=>({...c,highlight:c.numericValue===l}))}let s={display:r==="table"?"block":r==="list"?"flex":"grid",flexDirection:r==="list"?"column":void 0,gridTemplateColumns:r==="grid"?`repeat(${i}, 1fr)`:void 0,gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"};return r==="table"?(0,xt.jsx)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--sc-font-size-sm, 0.8rem)"},children:(0,xt.jsx)("tbody",{children:o.map((a,l)=>(0,xt.jsxs)("tr",{style:{borderBottom:l<o.length-1?"1px solid var(--sc-color-border-subtle, rgba(255, 255, 255, 0.06))":void 0},children:[(0,xt.jsxs)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",color:"var(--sc-color-text-secondary, #a1a1a6)",display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[a.icon&&(0,xt.jsx)("span",{children:a.icon}),a.label]}),(0,xt.jsx)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",textAlign:"right",fontWeight:"var(--sc-font-weight-semibold, 600)",color:a.highlight?n:"var(--sc-color-text, #f5f5f7)"},children:a.value})]},l))})}):(0,xt.jsx)("div",{style:s,children:o.map((a,l)=>(0,xt.jsx)(HA,{item:a,accentColor:n,layout:r},l))})}var mc=ee(wt(),1),ae=ee(ye(),1);function jA({value:t,maxValue:e,onChange:n,color:r}){let[i,o]=(0,mc.useState)(null);return(0,ae.jsx)("div",{style:{display:"flex",gap:"4px"},children:Array.from({length:e},(s,a)=>{let l=a+1,c=(i??t??0)>=l;return(0,ae.jsx)("button",{onClick:()=>n(l),onMouseEnter:()=>o(l),onMouseLeave:()=>o(null),style:{width:"28px",height:"28px",padding:0,border:"none",background:"none",cursor:"pointer",color:c?r:"var(--sc-color-text-muted, #8e8e93)",transition:"color 0.15s ease, transform 0.1s ease",transform:i===l?"scale(1.15)":"scale(1)"},"aria-label":`Rate ${l} out of ${e}`,children:(0,ae.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:c?"currentColor":"none",children:(0,ae.jsx)("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})},a)})})}function UA({value:t,onChange:e,color:n}){let r=i=>({width:"48px",height:"48px",padding:"8px",border:"none",borderRadius:"var(--sc-border-radius-md, 10px)",background:i?n:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",cursor:"pointer",color:i?"white":"var(--sc-color-text-muted, #8e8e93)",transition:"all 0.15s ease"});return(0,ae.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[(0,ae.jsx)("button",{onClick:()=>e(1),style:r(t===1),"aria-label":"Thumbs up",children:(0,ae.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:(0,ae.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===1?"currentColor":"none"})})}),(0,ae.jsx)("button",{onClick:()=>e(0),style:r(t===0),"aria-label":"Thumbs down",children:(0,ae.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",style:{transform:"rotate(180deg)"},children:(0,ae.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===0?"currentColor":"none"})})})]})}function WA({value:t,maxValue:e,onChange:n,color:r}){return(0,ae.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[(0,ae.jsx)("div",{style:{display:"flex",gap:"4px",justifyContent:"center"},children:Array.from({length:e+1},(i,o)=>{let s=t===o;return(0,ae.jsx)("button",{onClick:()=>n(o),style:{width:"28px",height:"32px",padding:0,border:s?`2px solid ${r}`:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.12))",borderRadius:"var(--sc-border-radius-sm, 6px)",background:s?r:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",cursor:"pointer",color:s?"white":"var(--sc-color-text, #f5f5f7)",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-medium, 500)",transition:"all 0.15s ease"},"aria-label":`Rate ${o}`,children:o},o)})}),(0,ae.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"0 2px"},children:[(0,ae.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)"},children:"Not likely"}),(0,ae.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)"},children:"Very likely"})]})]})}function qA({value:t,onChange:e,color:n}){return(0,ae.jsx)("div",{style:{display:"flex",gap:"8px",justifyContent:"center"},children:["\u{1F622}","\u{1F615}","\u{1F610}","\u{1F642}","\u{1F604}"].map((i,o)=>{let s=t===o;return(0,ae.jsx)("button",{onClick:()=>e(o),style:{width:"44px",height:"44px",padding:0,border:s?`2px solid ${n}`:"1px solid transparent",borderRadius:"var(--sc-border-radius-md, 10px)",background:s?"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))":"transparent",cursor:"pointer",fontSize:"1.75rem",transition:"all 0.15s ease",transform:s?"scale(1.1)":"scale(1)"},"aria-label":`Rate ${o+1} out of 5`,children:i},o)})})}function Gp({content:t,onSubmit:e,accentColor:n}){let[r,i]=(0,mc.useState)(null),[o,s]=(0,mc.useState)(!1),a=n||"var(--sc-color-primary, #6366f1)",l=t.maxValue??(t.variant==="nps"?10:5),c=g=>{i(g)},u=()=>{r!==null&&(s(!0),e?.(r))},f={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0",alignItems:"center"},h={fontSize:"var(--sc-font-size-md, 0.9rem)",color:"var(--sc-color-text, #f5f5f7)",textAlign:"center",margin:0};return o?(0,ae.jsxs)("div",{style:{...f,padding:"var(--sc-spacing-lg, 1rem)"},children:[(0,ae.jsx)("span",{style:{fontSize:"2rem"},children:"\u2713"}),(0,ae.jsx)("p",{style:{...h,color:"var(--sc-color-success, #34c759)"},children:"Thanks for your feedback!"})]}):(0,ae.jsxs)("div",{style:f,children:[t.question&&(0,ae.jsx)("p",{style:h,children:t.question}),t.variant==="stars"&&(0,ae.jsx)(jA,{value:r,maxValue:l,onChange:c,color:a}),t.variant==="thumbs"&&(0,ae.jsx)(UA,{value:r,onChange:c,color:a}),t.variant==="nps"&&(0,ae.jsx)(WA,{value:r,maxValue:l,onChange:c,color:a}),t.variant==="emoji"&&(0,ae.jsx)(qA,{value:r,onChange:c,color:a}),r!==null&&t.submitActionId&&(0,ae.jsx)("button",{onClick:u,style:{marginTop:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) var(--sc-spacing-lg, 1rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"none",background:a,color:"white",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",cursor:"pointer",transition:"opacity 0.15s ease"},children:"Submit"})]})}var Xe=ee(ye(),1);function Zp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r=t.items.filter(x=>x.completed).length,i=t.items.length,o={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},s={display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)",marginBottom:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #8e8e93)"},a={flex:1,height:"4px",background:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",borderRadius:"2px",overflow:"hidden"},l={height:"100%",width:`${i>0?r/i*100:0}%`,background:n,borderRadius:"2px",transition:"width 0.3s ease"},c=x=>({display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-md, 0.75rem)",background:"var(--sc-color-surface, rgba(58, 58, 60, 0.5))",borderRadius:"var(--sc-border-radius-md, 10px)",border:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.08))",opacity:x?.6:1,transition:"all 0.15s ease"}),u=x=>({width:"20px",height:"20px",borderRadius:"50%",border:x?"none":"2px solid var(--sc-color-border, rgba(255, 255, 255, 0.2))",background:x?"#34c759":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"2px"}),f={flex:1,minWidth:0},h=x=>({fontSize:"var(--sc-font-size-sm, 0.85rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:"var(--sc-color-text, #f5f5f7)",margin:0,textDecoration:x?"line-through":"none"}),g={fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #8e8e93)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:1.4},v={display:"inline-flex",alignItems:"center",gap:"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-xs, 0.25rem) var(--sc-spacing-sm, 0.5rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.15))",background:"transparent",color:"var(--sc-color-text, #f5f5f7)",fontSize:"var(--sc-font-size-xs, 0.75rem)",fontWeight:"var(--sc-font-weight-medium, 500)",cursor:"pointer",textDecoration:"none",transition:"all 0.15s ease",flexShrink:0},_=x=>{x&&typeof window<"u"&&(window.location.href=x)};return(0,Xe.jsxs)("div",{style:o,children:[t.showProgress!==!1&&i>0&&(0,Xe.jsxs)("div",{style:s,children:[(0,Xe.jsxs)("span",{children:[r," of ",i]}),(0,Xe.jsx)("div",{style:a,children:(0,Xe.jsx)("div",{style:l})})]}),t.items.map(x=>(0,Xe.jsxs)("div",{style:c(x.completed??!1),children:[(0,Xe.jsx)("div",{style:u(x.completed??!1),children:x.completed&&(0,Xe.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,Xe.jsx)("path",{d:"M20 6L9 17l-5-5",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,Xe.jsxs)("div",{style:f,children:[(0,Xe.jsx)("p",{style:h(x.completed??!1),children:x.title}),x.description&&(0,Xe.jsx)("p",{style:g,children:x.description})]}),x.href&&!x.completed&&(0,Xe.jsxs)("button",{style:v,onClick:d=>{d.stopPropagation(),_(x.href)},onMouseEnter:d=>{d.currentTarget.style.background="var(--sc-color-surface, rgba(58, 58, 60, 0.8))"},onMouseLeave:d=>{d.currentTarget.style.background="transparent"},children:[x.linkLabel||"Go",(0,Xe.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,Xe.jsx)("path",{d:"M5 12h14M12 5l7 7-7 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]},x.id))]})}var Eo=ee(ye(),1);function KA(t){return["alert","success","warning","info","error"].includes(t.type)}function GA(t){return t.type==="stats"}function ZA(t){return t.type==="comparison"}function YA(t){return t.type==="rating"}function XA(t){return t.type==="checklist"}function v0(t,e={}){return KA(t)?(0,Eo.jsx)(Wp,{content:t,accentColor:e.accentColor,onDismiss:e.onDismiss}):GA(t)?(0,Eo.jsx)(qp,{content:t,accentColor:e.accentColor}):ZA(t)?(0,Eo.jsx)(Kp,{content:t,accentColor:e.accentColor}):YA(t)?(0,Eo.jsx)(Gp,{content:t,accentColor:e.accentColor,onSubmit:e.onRatingSubmit}):XA(t)?(0,Eo.jsx)(Zp,{content:t,accentColor:e.accentColor}):null}function y0(t){return["alert","success","warning","info","error","stats","comparison","chart","table","form","rating","progress","survey","checklist","video","gallery","code"].includes(t)}var St=ee(wt(),1),k0=ee(ye(),1),Yp=(0,St.createContext)({runtime:null,context:null});function vc({runtime:t,children:e}){let[n,r]=(0,St.useState)(t?t.context.get():null);(0,St.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(s=>{r(s)})):void 0,[t]);let i=(0,St.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,k0.jsx)(Yp.Provider,{value:i,children:e})}function kn(){let{runtime:t}=(0,St.useContext)(Yp);return t}function ea(){let{context:t}=(0,St.useContext)(Yp);return t}function yc(){return ea()?.page??null}function _0(){return ea()?.session??null}function w0(){return ea()?.viewport??null}function x0(t,e,n=[]){let r=kn();(0,St.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...n])}function S0(){return kn()?.state??null}function b0(t,e){let n=kn(),[r,i]=(0,St.useState)({value:e,isFallback:!0,isLoading:!0});return(0,St.useEffect)(()=>{if(!n||!t){i({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return n.evaluate(t).then(s=>{o||i({value:s.value,isFallback:s.isFallback,isLoading:!1})}),()=>{o=!0}},[n,t,e]),r}var be={UI_CLICK:"ui.click",UI_SCROLL:"ui.scroll",UI_INPUT:"ui.input",UI_CHANGE:"ui.change",UI_SUBMIT:"ui.submit",NAV_PAGE_VIEW:"nav.page_view",NAV_PAGE_LEAVE:"nav.page_leave",CANVAS_OPENED:"canvas.opened",CANVAS_CLOSED:"canvas.closed",TILE_VIEWED:"tile.viewed",TILE_EXPANDED:"tile.expanded",TILE_COLLAPSED:"tile.collapsed",TILE_ACTION:"tile.action",OVERLAY_STARTED:"overlay.started",OVERLAY_COMPLETED:"overlay.completed",OVERLAY_DISMISSED:"overlay.dismissed",OVERLAY_STEP_VIEWED:"overlay.step_viewed",BEHAVIOR_RAGE_CLICK:"behavior.rage_click",BEHAVIOR_HESITATION:"behavior.hesitation",BEHAVIOR_CONFUSION:"behavior.confusion",ACTION_APPLIED:"action.applied",ACTION_REVERTED:"action.reverted",ACTION_FAILED:"action.failed",ACTION_CTA_CLICKED:"action.cta_clicked",SURFACE_MOUNTED:"surface.mounted",SURFACE_UNMOUNTED:"surface.unmounted"},_i="1.0.0";function rn(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:_i}}function QA(t){return rn(be.CANVAS_OPENED,{surface:t})}function JA(t){return rn(be.CANVAS_CLOSED,{surface:t})}function eR(t,e){return rn(be.TILE_VIEWED,{tileId:t,surface:e})}function tR(t,e){return rn(be.TILE_EXPANDED,{tileId:t,surface:e})}function nR(t,e){return rn(be.TILE_COLLAPSED,{tileId:t,surface:e})}function rR(t,e,n){return rn(be.TILE_ACTION,{tileId:t,actionId:e,surface:n})}function iR(t,e){return rn(be.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function oR(t,e){return rn(be.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function sR(t,e,n){return rn(be.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:n})}function aR(t,e,n){return rn(be.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:n})}function lR(t,e){let n=t.startsWith("canvas.")?t:`canvas.${t}`;return rn(n,e)}var on={canvasOpened:QA,canvasClosed:JA,tileViewed:eR,tileExpanded:tR,tileCollapsed:nR,tileAction:rR,overlayStarted:iR,overlayCompleted:oR,overlayDismissed:sR,overlayStepViewed:aR,custom:lR};var oe=ee(ye(),1);function cR({config:t,telemetry:e,surface:n}){let[r,i]=(0,Zn.useState)([{author:"Lumi",text:"Hi! Need clarity on a deduction?"}]),[o,s]=(0,Zn.useState)(""),a=kn(),l=c=>{if(c.preventDefault(),!!o.trim()){if(i(u=>[...u,{author:"You",text:o.trim()}]),setTimeout(()=>{i(u=>[...u,{author:"Lumi",text:"I will route that to the experimentation server stub for now."}])},600),e?.trackAction("chatbot_message",t.id,n),a){let u=on.tileAction(t.id,"chatbot_message",n);a.events.publish(u.name,u.props,u.source)}s("")}};return(0,oe.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",height:"100%"},children:[(0,oe.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"0.75rem",background:"rgba(0, 0, 0, 0.2)",borderRadius:"8px",fontSize:"0.85rem"},children:r.map((c,u)=>(0,oe.jsxs)("p",{style:{margin:"0 0 0.5rem"},children:[(0,oe.jsxs)("span",{style:{fontWeight:600,color:"#94a3b8"},children:[c.author,":"]})," ",(0,oe.jsx)("span",{style:{color:"#e2e8f0"},children:c.text})]},`${c.author}-${u}`))}),(0,oe.jsxs)("form",{onSubmit:l,style:{display:"flex",gap:"0.5rem"},children:[(0,oe.jsx)("input",{style:{flex:1,padding:"0.5rem 0.75rem",borderRadius:"6px",border:"1px solid rgba(255, 255, 255, 0.1)",background:"rgba(0, 0, 0, 0.3)",color:"#f1f5f9",fontSize:"0.85rem",outline:"none"},value:o,onChange:c=>s(c.target.value),placeholder:"Ask anything..."}),(0,oe.jsx)("button",{style:{padding:"0.5rem 0.75rem",borderRadius:"6px",border:"none",background:"#6366f1",color:"white",fontWeight:600,fontSize:"0.8rem",cursor:"pointer"},type:"submit",children:"Send"})]})]})}function uR({renderer:t,config:e,surface:n,telemetry:r,isExpanded:i}){let o=(0,Zn.useRef)(null);return(0,Zn.useEffect)(()=>{if(!o.current)return;let s=t.mount(o.current,{config:e,surface:n,telemetry:r,isExpanded:i});return()=>{s&&s()}},[t,e,n,r,i]),(0,oe.jsx)("div",{ref:o,style:{width:"100%",height:"100%"}})}function Co({config:t,surface:e,telemetry:n,style:r,customRenderers:i,isExpanded:o=!1,onToggleExpand:s}){let{title:a,subtitle:l,content:c,style:u}=t,f=kn(),h=(0,Zn.useCallback)(w=>{if(n?.trackAction(w,t.id,e),f){let k=on.tileAction(t.id,w,e);f.events.publish(k.name,k.props,k.source)}},[n,f,t.id,e]),g=u?.accentColor??"#6366f1",v="72px",_={display:"flex",flexDirection:"column",borderRadius:"14px",background:u?.background??"rgba(28, 28, 30, 0.95)",border:"1px solid rgba(255, 255, 255, 0.08)",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.3)",color:u?.textColor??"#f5f5f7",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif",overflow:"hidden",cursor:s?"pointer":"default",transition:"all 0.25s ease",...r},x={display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.875rem 1rem",minHeight:v},d={width:"40px",height:"40px",borderRadius:"10px",background:`linear-gradient(135deg, ${g} 0%, ${g}cc 100%)`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",flexShrink:0,boxShadow:`0 2px 8px ${g}40`},p=()=>{switch(c.type){case"chatbot":return"\u{1F4AC}";case"metric":return"\u{1F4CA}";case"embed":return"\u{1F517}";case"custom":return"\u2699\uFE0F";case"checklist":return"\u{1F4CB}";default:return"\u{1F4C4}"}},m=()=>{switch(c.type){case"metric":return`${c.metricValue}${c.metricUnit?` ${c.metricUnit}`:""}`;case"text":return c.headline||c.body?.slice(0,50)||"";case"chatbot":return"Tap to chat";case"embed":return"Tap to view";case"custom":return"Tap to expand";case"checklist":{let w=c.items||[];return`${w.filter(b=>b.completed).length} of ${w.length} complete`}default:return""}},y=()=>{if(y0(c.type)){let w=v0(c,{accentColor:g,onDismiss:()=>{h("block_dismissed")},onRatingSubmit:k=>{h("rating_submitted")}});if(w)return w}switch(c.type){case"chatbot":return(0,oe.jsx)("div",{style:{height:"200px"},children:(0,oe.jsx)(cR,{config:t,surface:e,telemetry:n})});case"metric":return(0,oe.jsxs)("div",{style:{textAlign:"center",padding:"0.5rem 0"},children:[(0,oe.jsxs)("p",{style:{fontSize:"3rem",fontWeight:700,color:g,margin:0,letterSpacing:"-0.02em"},children:[c.metricValue,c.metricUnit&&(0,oe.jsx)("span",{style:{fontSize:"1.25rem",fontWeight:400,color:"#8e8e93",marginLeft:"0.5rem"},children:c.metricUnit})]}),c.headline&&(0,oe.jsx)("p",{style:{fontSize:"0.85rem",color:"#8e8e93",margin:"0.5rem 0 0"},children:c.headline})]});case"embed":return c.embedUrl?(0,oe.jsx)("iframe",{src:c.embedUrl,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",style:{width:"100%",height:"200px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",background:"rgba(0, 0, 0, 0.2)"},title:c.headline??t.title}):null;case"custom":{let w=c.component||c.customRendererKey;return!w||!i||!i[w]?(0,oe.jsxs)("div",{style:{color:"#ff6b6b",fontSize:"0.85rem",padding:"0.5rem 0"},children:["Unknown component: ",w]}):(0,oe.jsx)(uR,{renderer:i[w],config:t,surface:e,telemetry:n,isExpanded:o})}case"text":default:{let w=c;return(0,oe.jsxs)("div",{style:{padding:"0.25rem 0"},children:[w.headline&&(0,oe.jsx)("p",{style:{fontSize:"1rem",fontWeight:600,color:"#f5f5f7",margin:"0 0 0.5rem"},children:w.headline}),w.body&&(0,oe.jsx)("p",{style:{fontSize:"0.9rem",color:"#8e8e93",margin:0,lineHeight:1.5},children:w.body})]})}}};return(0,oe.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:_,onClick:w=>{o&&w.target.closest("[data-expanded-content]")||s?.()},children:[(0,oe.jsxs)("div",{style:x,children:[(0,oe.jsx)("div",{style:d,children:p()}),(0,oe.jsxs)("div",{style:{flex:1,minWidth:0},children:[l&&(0,oe.jsx)("p",{style:{fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.05em",color:"#8e8e93",margin:0},children:l}),(0,oe.jsx)("h3",{style:{fontSize:"0.95rem",fontWeight:600,color:"#f5f5f7",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a}),!o&&(0,oe.jsx)("p",{style:{fontSize:"0.8rem",color:"#8e8e93",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m()})]}),(0,oe.jsx)("div",{style:{color:"#8e8e93",fontSize:"0.85rem",transform:o?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"},children:"\u25BC"})]}),o&&(0,oe.jsxs)("div",{"data-expanded-content":!0,style:{padding:"0 1rem 1rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},onClick:w=>w.stopPropagation(),children:[(0,oe.jsx)("div",{style:{paddingTop:"0.875rem"},children:y()}),"actions"in c&&c.actions&&c.actions.length>0&&(0,oe.jsx)("div",{style:{marginTop:"1rem",paddingTop:"0.75rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)",display:"flex",gap:"0.5rem"},children:c.actions.map((w,k)=>(0,oe.jsx)("button",{onClick:b=>{if(b.stopPropagation(),w.href&&typeof window<"u"&&window.open(w.href,"_blank","noreferrer"),w.onClickId&&(h(w.onClickId),w.onClickId.startsWith("syntro:restart-tour:")||w.onClickId.startsWith("syntro:start-tour:"))){let E=w.onClickId.replace("syntro:restart-tour:","").replace("syntro:start-tour:","");try{localStorage.removeItem("syntro_active_tour"),localStorage.setItem("syntro_active_tour",JSON.stringify({tourId:E,currentStepId:"",startedAt:Date.now()})),console.log(`[SmartCanvas] Starting tour "${E}"...`),window.location.reload()}catch(P){console.warn("[SmartCanvas] Failed to start tour:",P)}}},style:{flex:1,padding:"0.625rem 1rem",borderRadius:"8px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",border:"none",background:k===0?g:"rgba(255, 255, 255, 0.1)",color:"#fff",transition:"opacity 0.15s ease"},onMouseEnter:b=>{b.currentTarget.style.opacity="0.85"},onMouseLeave:b=>{b.currentTarget.style.opacity="1"},children:w.label},w.label))})]})]})}var sr=ee(wt(),1),um=ee(Du(),1);var ve=ee(ye(),1),jS="syntro-launcher-styles";function pP(){if(typeof document>"u"||document.getElementById(jS))return;let t=document.createElement("style");t.id=jS,t.textContent=`
|
|
11
|
+
`)).length,i=0;i<r;i++){var s=t.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),qn(a)||(n>e&&(o+=t.substring(e,n)),o+=a,e=n=i+1)}return n>e&&(o+=t.substring(e,t.length)),o},QE=!!Xd||!!Yd,Xv="text/plain",Fl=function(t,e,n){var r;n===void 0&&(n=!0);var[i,o]=t.split("?"),s=$({},e),a=(r=o?.split("&").map((c=>{var u,[f,h]=c.split("="),g=n&&(u=s[f])!==null&&u!==void 0?u:h;return delete s[f],f+"="+g})))!==null&&r!==void 0?r:[],l=gE(s);return l&&a.push(l),i+"?"+a.join("&")},Ps=(t,e)=>JSON.stringify(t,((n,r)=>typeof r=="bigint"?r.toString():r),e),Wd=t=>{var{data:e,compression:n}=t;if(e){if(n===Wn.GZipJS){var r=YE((function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new jt(l.length+(l.length>>>1)),h=0,g=function(d){f[h++]=d},v=0;v<u;++v){if(h+5>f.length){var _=new jt(h+8+(u-v<<1));_.set(f),f=_}var x=l.charCodeAt(v);x<128||c?g(x):x<2048?(g(192|x>>>6),g(128|63&x)):x>55295&&x<57344?(g(240|(x=65536+(1047552&x)|1023&l.charCodeAt(++v))>>>18),g(128|x>>>12&63),g(128|x>>>6&63),g(128|63&x)):(g(224|x>>>12),g(128|x>>>6&63),g(128|63&x))}return u_(f,0,h)})(Ps(e)),{mtime:0}),i=new Blob([r],{type:Xv});return{contentType:Xv,body:i,estimatedSize:i.size}}if(n===Wn.Base64){var o=(function(l){var c,u,f,h,g,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,x=0,d="",p=[];if(!l)return l;l=XE(l);do c=(g=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=g>>12&63,f=g>>6&63,h=63&g,p[x++]=v.charAt(c)+v.charAt(u)+v.charAt(f)+v.charAt(h);while(_<l.length);switch(d=p.join(""),l.length%3){case 1:d=d.slice(0,-2)+"==";break;case 2:d=d.slice(0,-1)+"="}return d})(Ps(e)),s=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Ps(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var a=Ps(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},_l=[];Yd&&_l.push({transport:"fetch",method:t=>{var e,n,{contentType:r,body:i,estimatedSize:o}=(e=Wd(t))!==null&&e!==void 0?e:{},s=new Headers;pe(t.headers,(function(u,f){s.append(f,u)})),r&&s.append("Content-Type",r);var a=t.url,l=null;if(vv){var c=new vv;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),t.timeout)}}Yd(a,$({method:t?.method||"GET",headers:s,keepalive:t.method==="POST"&&(o||0)<52428.8,body:i,signal:(n=l)==null?void 0:n.signal},t.fetchOptions)).then((u=>u.text().then((f=>{var h={statusCode:u.status,text:f};if(u.status===200)try{h.json=JSON.parse(f)}catch(g){L.error(g)}t.callback==null||t.callback(h)})))).catch((u=>{L.error(u),t.callback==null||t.callback({statusCode:0,text:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Xd&&_l.push({transport:"XHR",method:t=>{var e,n=new Xd;n.open(t.method||"GET",t.url,!0);var{contentType:r,body:i}=(e=Wd(t))!==null&&e!==void 0?e:{};pe(t.headers,(function(o,s){n.setRequestHeader(s,o)})),r&&n.setRequestHeader("Content-Type",r),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var o={statusCode:n.status,text:n.responseText};if(n.status===200)try{o.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(o)}},n.send(i)}}),Pt!=null&&Pt.sendBeacon&&_l.push({transport:"sendBeacon",method:t=>{var e=Fl(t.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=Wd(t))!==null&&n!==void 0?n:{},o=typeof i=="string"?new Blob([i],{type:r}):i;Pt.sendBeacon(e,o)}catch{}}});var $l=function(t,e){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function Qv(t,e,n){return Ps({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var d_={exact:(t,e)=>e.some((n=>t.some((r=>n===r)))),is_not:(t,e)=>e.every((n=>t.every((r=>n!==r)))),regex:(t,e)=>e.some((n=>t.some((r=>$l(n,r))))),not_regex:(t,e)=>e.every((n=>t.every((r=>!$l(n,r))))),icontains:(t,e)=>e.map(vl).some((n=>t.map(vl).some((r=>n.includes(r))))),not_icontains:(t,e)=>e.map(vl).every((n=>t.map(vl).every((r=>!n.includes(r)))))},vl=t=>t.toLowerCase();function f_(t,e){return!t||Object.entries(t).every((n=>{var[r,i]=n,o=e?.[r];if(O(o)||qn(o))return!1;var s=[String(o)],a=d_[i.operator];return!!a&&a(i.values,s)}))}var qd=He("[Error tracking]"),Hf=class{constructor(e){var n,r;this.Jt=[],this.Kt=new nf([new of,new ff,new af,new sf,new uf,new cf,new lf,new df],X1("web:javascript",K1,Y1)),this._instance=e,this.Jt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(hf))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,r,i,o=(n=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],s=(i=e.errorTracking)==null?void 0:i.captureExtensionExceptions;this.Jt=o,this._instance.persistence&&this._instance.persistence.register({[hf]:this.Jt,[Tv]:s})}get Yt(){var e,n=!!this._instance.get_property(Tv),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.Kt.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.Xt(n)){if(this.Qt(n))return void qd.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(n))return void qd.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(n))return void qd.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var n=e.reduce(((r,i)=>{var{type:o,value:s}=i;return ze(o)&&o.length>0&&r.$exception_types.push(o),ze(s)&&s.length>0&&r.$exception_values.push(s),r}),{$exception_types:[],$exception_values:[]});return this.Jt.some((r=>{var i=r.values.map((o=>{var s,a=d_[o.operator],l=fe(o.value)?o.value:[o.value],c=(s=n[o.key])!==null&&s!==void 0?s:[];return l.length>0&&a(l,c)}));return r.type==="OR"?i.some(Boolean):i.every(Boolean)}))}Zt(e){return e.flatMap((n=>{var r,i;return(r=(i=n.stacktrace)==null?void 0:i.frames)!==null&&r!==void 0?r:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ti(e){if(e.length>0){var n,r,i,o,s=(n=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],a=s[s.length-1];return(i=a==null||(o=a.filename)==null?void 0:o.includes("posthog.com/static"))!==null&&i!==void 0&&i}return!1}Xt(e){return!de(e)&&fe(e)}},nn=He("[FeatureFlags]"),Ss=He("[FeatureFlags]",{debugEnabled:!0}),Kd="$active_feature_flags",ro="$override_feature_flags",Jv="$feature_flag_payloads",bs="$override_feature_flag_payloads",ey="$feature_flag_request_id",ty="$feature_flag_evaluated_at",ny=t=>{var e={};for(var[n,r]of yl(t||{}))r&&(e[n]=r);return e},JE=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((n=>{var r;return[n,(r=e[n].variant)!==null&&r!==void 0?r:e[n].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((n=>e[n].enabled)).filter((n=>{var r;return(r=e[n].metadata)==null?void 0:r.payload})).map((n=>{var r;return[n,(r=e[n].metadata)==null?void 0:r.payload]})))):nn.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},eC=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),jf=class{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter((n=>{var r=n&&typeof n=="string"&&n.trim().length>0;return r||nn.error("Invalid evaluation environment found:",n,"Expected non-empty string"),r})):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.vi({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(gf),n=this._instance.get_property(ro),r=this._instance.get_property(bs);if(!r&&!n)return e||{};var i=Me({},e||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var s of o){var a,l,c=i[s],u=n?.[s],f=O(u)?(a=c?.enabled)!==null&&a!==void 0&&a:!!u,h=O(u)?c.variant:typeof u=="string"?u:void 0,g=r?.[s],v=$({},c,{enabled:f,variant:f?h??c?.variant:void 0});f!==c?.enabled&&(v.original_enabled=c?.enabled),h!==c?.variant&&(v.original_variant=c?.variant),g&&(v.metadata=$({},c?.metadata,{payload:g,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),i[s]=v}return this.ii||(nn.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:i}),this.ii=!0),i}getFlagVariants(){var e=this._instance.get_property(ao),n=this._instance.get_property(ro);if(!n)return e||{};for(var r=Me({},e),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this.ii||(nn.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:r}),this.ii=!0),r}getFlagPayloads(){var e=this._instance.get_property(Jv),n=this._instance.get_property(bs);if(!n)return e||{};for(var r=Me({},e||{}),i=Object.keys(n),o=0;o<i.length;o++)r[i[o]]=n[i[o]];return this.ii||(nn.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:r}),this.ii=!0),r}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout((()=>{this.vi()}),5))}di(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}vi(e){var n;if(this.di(),!this._instance.O())if(this.ri)this.ni=!0;else{var r={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:$({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(Rs)||{}),group_properties:this._instance.get_property(fi)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.ui()&&(r.evaluation_environments=this.li());var i=this._instance.config.__preview_remote_config,o=i?"/flags/?v=2":"/flags/?v=2&config=true",s=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags",o+s);i&&(r.timezone=s_()),this.ri=!0,this._instance.ci({method:"POST",url:a,data:r,compression:this._instance.config.disable_compression?void 0:Wn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,f=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),f=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((u=l.json)!==null&&u!==void 0?u:{})),!r.disable_flags||this.ni)if(this.ai=!f,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(eC.FeatureFlags))nn.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var h;r.disable_flags||this.receivedFeatureFlags((h=l.json)!==null&&h!==void 0?h:{},f),this.ni&&(this.ni=!1,this.vi())}}})}}getFeatureFlag(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[e],i=""+r,o=this._instance.get_property(ey)||void 0,s=this._instance.get_property(ty)||void 0,a=this._instance.get_property(kl)||{};if((n.send_event||!("send_event"in n))&&(!(e in a)||!a[e].includes(i))){var l,c,u,f,h,g,v,_,x;fe(a[e])?a[e].push(i):a[e]=[i],(l=this._instance.persistence)==null||l.register({[kl]:a});var d=this.getFeatureFlagDetails(e),p={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:s,$feature_flag_bootstrapped_response:((c=this._instance.config.bootstrap)==null||(c=c.featureFlags)==null?void 0:c[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.ai};O(d==null||(f=d.metadata)==null?void 0:f.version)||(p.$feature_flag_version=d.metadata.version);var m,y=(h=d==null||(g=d.reason)==null?void 0:g.description)!==null&&h!==void 0?h:d==null||(v=d.reason)==null?void 0:v.code;y&&(p.$feature_flag_reason=y),d!=null&&(_=d.metadata)!=null&&_.id&&(p.$feature_flag_id=d.metadata.id),O(d?.original_variant)&&O(d?.original_enabled)||(p.$feature_flag_original_response=O(d.original_variant)?d.original_enabled:d.original_variant),d!=null&&(x=d.metadata)!=null&&x.original_payload&&(p.$feature_flag_original_payload=d==null||(m=d.metadata)==null?void 0:m.original_payload),this._instance.capture("$feature_flag_called",p)}return r}nn.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,n){var r=this._instance.config.token,i={distinct_id:this._instance.get_distinct_id(),token:r};this.ui()&&(i.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:i,compression:this._instance.config.disable_compression?void 0:Wn.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var s,a=(s=o.json)==null?void 0:s.featureFlagPayloads;n(a?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),this.ei||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,n);return O(r)?void 0:!!r}nn.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==e))}receivedFeatureFlags(e,n){if(this._instance.persistence){this.ei=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(s,a,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var f=JE(s),h=f.flags,g=f.featureFlags,v=f.featureFlagPayloads;if(g){var _=s.requestId,x=s.evaluatedAt;if(fe(g)){nn.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(g)for(var p=0;p<g.length;p++)d[g[p]]=!0;a&&a.register({[Kd]:g,[ao]:d})}else{var m=g,y=v,w=h;s.errorsWhileComputingFlags&&(m=$({},l,m),y=$({},c,y),w=$({},u,w)),a&&a.register($({[Kd]:Object.keys(ny(m)),[ao]:m||{},[Jv]:y||{},[gf]:w||{}},_?{[ey]:_}:{},x?{[ty]:x}:{}))}}})(e,this._instance.persistence,r,i,o),this.pi(n)}}override(e,n){n===void 0&&(n=!1),nn.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return nn.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(ro),this._instance.persistence.unregister(bs),this.pi(),Ss.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,r=e;if(this.ii=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(ro),Ss.info("Flag overrides cleared");else if(r.flags){if(fe(r.flags)){for(var i={},o=0;o<r.flags.length;o++)i[r.flags[o]]=!0;this._instance.persistence.register({[ro]:i})}else this._instance.persistence.register({[ro]:r.flags});Ss.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(bs),Ss.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[bs]:r.payloads}),Ss.info("Payload overrides set",{payloads:r.payloads}))),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:n,flagVariants:r}=this.gi();e(n,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,r){var i,o=(this._instance.get_property(Ts)||[]).find((c=>c.flagKey===e)),s={["$feature_enrollment/"+e]:n},a={$feature_flag:e,$feature_enrollment:n,$set:s};o&&(a.$early_access_feature_name=o.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(s,!1);var l=$({},this.getFlagVariants(),{[e]:n});(i=this._instance.persistence)==null||i.register({[Kd]:Object.keys(ny(l)),[ao]:l}),this.pi()}getEarlyAccessFeatures(e,n,r){n===void 0&&(n=!1);var i=this._instance.get_property(Ts),o=r?"&"+r.map((s=>"stage="+s)).join("&"):"";if(i&&!n)return e(i);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:s=>{var a,l;if(s.json){var c=s.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(Ts),(l=this._instance.persistence)==null||l.register({[Ts]:c}),e(c)}}})}gi(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter((r=>n[r])),flagVariants:Object.keys(n).filter((r=>n[r])).reduce(((r,i)=>(r[i]=n[i],r)),{})}}pi(e){var{flags:n,flagVariants:r}=this.gi();this.featureFlagEventHandlers.forEach((i=>i(n,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(Rs)||{};this._instance.register({[Rs]:$({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Rs)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var r=this._instance.get_property(fi)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((i=>{r[i]=$({},r[i],e[i]),delete e[i]})),this._instance.register({[fi]:$({},r,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(fi)||{};this._instance.register({[fi]:$({},n,{[e]:{}})})}else this._instance.unregister(fi)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.di(),this.ii=!1}},tC=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Ls=class{constructor(e,n){this.F=e,this.props={},this.mi=!1,this.yi=(r=>{var i="";return r.token&&(i=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+i+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&L.info("Persistence loaded",e.persistence,$({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.wi}bi(e){tC.indexOf(e.persistence.toLowerCase())===-1&&(L.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=e.persistence.toLowerCase();return n==="localstorage"&&Ee.H()?Ee:n==="localstorage+cookie"&&pl.H()?pl:n==="sessionstorage"&&Ze.H()?Ze:n==="memory"?bE:n==="cookie"?wn:pl.H()?pl:wn}properties(){var e={};return pe(this.props,(function(n,r){if(r===ao&&We(n))for(var i=Object.keys(n),o=0;o<i.length;o++)e["$feature/"+i[o]]=n[i[o]];else a=r,l=!1,(qn(s=oE)?l:mv&&s.indexOf===mv?s.indexOf(a)!=-1:(pe(s,(function(c){if(l||(l=c===a))return Sl})),l))||(e[r]=n);var s,a,l})),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=Me({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.F.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,n,r){if(We(e)){O(n)&&(n="None"),this.xi=O(r)?this.$i:r;var i=!1;if(pe(e,((o,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==n||(this.props[s]=o,i=!0)})),i)return this.save(),!0}return!1}register(e,n){if(We(e)){this.xi=O(n)?this.$i:n;var r=!1;if(pe(e,((i,o)=>{e.hasOwnProperty(o)&&this.props[o]!==i&&(this.props[o]=i,r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=e_(this.F.custom_campaign_params,this.F.mask_personal_data_properties,this.F.custom_personal_data_properties);so(ap(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=N?.referrer)?n_(e):{})}update_referrer_info(){var e;this.register_once({$referrer:r_(),$referring_domain:N!=null&&N.referrer&&((e=Rl(N.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[_f]||this.props[wf]||this.register_once({[El]:i_(this.F.mask_personal_data_properties,this.F.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};pe([wf,_f],(s=>{var a=this.props[s];a&&pe(a,(function(l,c){e["$initial_"+Qd(c)]=l}))}));var n,r,i=this.props[El];if(i){var o=(n=o_(i),r={},pe(n,(function(s,a){r["$initial_"+Qd(a)]=s})),r);Me(e,o)}return e}safe_merge(e){return pe(this.props,(function(n,r){r in e||(e[r]=n)})),e}update_config(e,n,r){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence){var i=this.bi(e),o=this.props;this.clear(),this.Y=i,this.props=o,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,n){var r=this.props[As]||{};r[e]=n,this.props[As]=r,this.save()}remove_event_timer(e){var n=(this.props[As]||{})[e];return O(n)||(delete this.props[As][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}},ks=(function(t){return t.Activation="events",t.Cancellation="cancelEvents",t})({}),LO=(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({}),MO=(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({}),FO=(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({}),Gd=(function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t})({}),$O=(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({}),DO=(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({}),BO=(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({}),wl=(function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t})({}),ry=(function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t})({}),p_=(function(t){return t.Popover="popover",t.Inline="inline",t})({}),zs=class{constructor(){this.ki={},this.ki={}}on(e,n){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(n),()=>{this.ki[e]=this.ki[e].filter((r=>r!==n))}}emit(e,n){for(var r of this.ki[e]||[])r(n);for(var i of this.ki["*"]||[])i(e,n)}};function io(t,e,n){if(de(t))return!1;switch(n){case"exact":return t===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}var Uf=class{constructor(e){this.Pi=new zs,this.Ti=(n,r)=>this.Ri(n,r)&&this.Ii(n,r)&&this.Fi(n,r)&&this.Ci(n,r),this.Ri=(n,r)=>r==null||!r.event||n?.event===r?.event,this._instance=e,this.Mi=new Set,this.Oi=new Set}init(){var e;if(!O((e=this._instance)==null?void 0:e.Ai)){var n;(n=this._instance)==null||n.Ai(((r,i)=>{this.on(r,i)}))}}register(e){var n,r;if(!O((n=this._instance)==null?void 0:n.Ai)&&(e.forEach((s=>{var a,l;(a=this.Oi)==null||a.add(s),(l=s.steps)==null||l.forEach((c=>{var u;(u=this.Mi)==null||u.add(c?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var i,o=new Set;e.forEach((s=>{var a;(a=s.steps)==null||a.forEach((l=>{l!=null&&l.selector&&o.add(l?.selector)}))})),(i=this._instance)==null||i.autocapture.setElementSelectors(o)}}on(e,n){var r;n!=null&&e.length!=0&&(this.Mi.has(e)||this.Mi.has(n?.event))&&this.Oi&&((r=this.Oi)==null?void 0:r.size)>0&&this.Oi.forEach((i=>{this.Di(n,i)&&this.Pi.emit("actionCaptured",i.name)}))}ji(e){this.onAction("actionCaptured",(n=>e(n)))}Di(e,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.Ti(e,r))return!0;return!1}onAction(e,n){return this.Pi.on(e,n)}Ii(e,n){if(n!=null&&n.url){var r,i=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!i||typeof i!="string"||!io(i,n.url,n.url_matching||"contains"))return!1}return!0}Fi(e,n){return!!this.Li(e,n)&&!!this.Ni(e,n)&&!!this.Ui(e,n)}Li(e,n){var r;if(n==null||!n.href)return!0;var i=this.zi(e);if(i.length>0)return i.some((a=>io(a.href,n.href,n.href_matching||"exact")));var o,s=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!s&&io((o=s.match(/(?::|")href="(.*?)"/))?o[1]:"",n.href,n.href_matching||"exact")}Ni(e,n){var r;if(n==null||!n.text)return!0;var i=this.zi(e);if(i.length>0)return i.some((c=>io(c.text,n.text,n.text_matching||"exact")||io(c.$el_text,n.text,n.text_matching||"exact")));var o,s,a,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(o=(function(c){for(var u,f=[],h=/(?::|")text="(.*?)"/g;!de(u=h.exec(c));)f.includes(u[1])||f.push(u[1]);return f})(l),s=n.text,a=n.text_matching||"exact",o.some((c=>io(c,s,a))))}Ui(e,n){var r,i;if(n==null||!n.selector)return!0;var o=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(o!=null&&o.includes(n.selector))return!0;var s=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(n.selector_regex&&s)try{return new RegExp(n.selector_regex).test(s)}catch{return!1}return!1}zi(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Ci(e,n){return n==null||!n.properties||n.properties.length===0||f_(n.properties.reduce(((r,i)=>{var o=fe(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return r[i.key]={values:o,operator:i.operator||"exact"},r}),{}),e?.properties)}},ce=He("[Surveys]"),Wf="seenSurvey_",nC=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},iy=t=>{var e=""+Wf+t.id;return t.current_iteration&&t.current_iteration>0&&(e=""+Wf+t.id+"_"+t.current_iteration),e},rC=[Gd.Popover,Gd.Widget,Gd.API],iC={ignoreConditions:!1,ignoreDelay:!1,displayType:p_.Popover},qf=class{constructor(e){this._instance=e,this.Hi=new Map,this.Bi=new Map,this.qi=new Map}Wi(e,n){return!!e&&f_(e.propertyFilters,n?.properties)}Gi(e,n){var r=new Map;return e.forEach((i=>{var o;(o=i.conditions)==null||(o=o[n])==null||(o=o.values)==null||o.forEach((s=>{if(s!=null&&s.name){var a=r.get(s.name)||[];a.push(i.id),r.set(s.name,a)}}))})),r}Vi(e,n,r){var i,o=(r===ks.Activation?this.Hi:this.Bi).get(e),s=[];return(i=this._instance)==null||i.getSurveys((a=>{s=a.filter((l=>o?.includes(l.id)))})),s.filter((a=>{var l,c=(l=a.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((u=>u.name===e));return this.Wi(c,n)}))}register(e){var n;O((n=this._instance)==null?void 0:n.Ai)||(this.Ji(e),this.Ki(e))}Ki(e){var n=e.filter((r=>{var i,o;return((i=r.conditions)==null?void 0:i.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0}));n.length!==0&&(this.Yi==null&&(this.Yi=new Uf(this._instance),this.Yi.init(),this.Yi.ji((r=>{this.onAction(r)}))),n.forEach((r=>{var i,o,s,a,l;r.conditions&&(i=r.conditions)!=null&&i.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0&&((a=this.Yi)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((c=>{if(c&&c.name){var u=this.qi.get(c.name);u&&u.push(r.id),this.qi.set(c.name,u||[r.id])}})))})))}Ji(e){var n,r=e.filter((o=>{var s,a;return((s=o.conditions)==null?void 0:s.events)&&((a=o.conditions)==null||(a=a.events)==null||(a=a.values)==null?void 0:a.length)>0})),i=e.filter((o=>{var s,a;return((s=o.conditions)==null?void 0:s.cancelEvents)&&((a=o.conditions)==null||(a=a.cancelEvents)==null||(a=a.values)==null?void 0:a.length)>0}));(r.length!==0||i.length!==0)&&((n=this._instance)==null||n.Ai(((o,s)=>{this.onEvent(o,s)})),this.Hi=this.Gi(e,ks.Activation),this.Bi=this.Gi(e,ks.Cancellation))}onEvent(e,n){var r,i=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[fl])||[];if(wl.SHOWN===e&&n&&i.length>0){var o;ce.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:n,existingActivatedSurveys:i});var s=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(s){var a=i.indexOf(s);a>=0&&(i.splice(a,1),this.Xi(i))}}else{if(this.Bi.has(e)){var l=this.Vi(e,n,ks.Cancellation);l.length>0&&(ce.info("cancel event matched, cancelling surveys",{event:e,surveysToCancel:l.map((u=>u.id))}),l.forEach((u=>{var f,h=i.indexOf(u.id);h>=0&&i.splice(h,1),(f=this._instance)==null||f.cancelPendingSurvey(u.id)})),this.Xi(i))}if(this.Hi.has(e)){ce.info("survey event name matched",{event:e,eventPayload:n,surveys:this.Hi.get(e)});var c=this.Vi(e,n,ks.Activation);this.Xi(i.concat(c.map((u=>u.id))||[]))}}}onAction(e){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[fl])||[];this.qi.has(e)&&this.Xi(r.concat(this.qi.get(e)||[]))}Xi(e){var n;ce.info("updating activated surveys",{activatedSurveys:e}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[fl]:[...new Set(e)]})}getSurveys(){var e,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[fl];return n||[]}getEventToSurveys(){return this.Hi}Qi(){return this.Yi}},Kf=class{constructor(e){this.Zi=void 0,this._surveyManager=null,this.te=!1,this.ie=!1,this.ee=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(de(n))return ce.warn("Flags not loaded yet. Not loading surveys.");var r=fe(n);this.Zi=r?n.length>0:n,ce.info("flags response received, isSurveysEnabled: "+this.Zi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(Wf)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((i=>localStorage.removeItem(i)))}loadIfEnabled(){if(!this._surveyManager)if(this.ie)ce.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)ce.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())ce.info("Not loading surveys in cookieless mode without consent.");else{var e=G?.__PosthogExtensions__;if(e){if(!O(this.Zi)||this._instance.config.advanced_enable_surveys){var n=this.Zi||this._instance.config.advanced_enable_surveys;this.ie=!0;try{var r=e.generateSurveys;if(r)return void this.re(r,n);var i=e.loadExternalDependency;if(!i)return void this.se("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",(o=>{o||!e.generateSurveys?this.se("Could not load surveys script",o):this.re(e.generateSurveys,n)}))}catch(o){throw this.se("Error initializing surveys",o),o}finally{this.ie=!1}}}else ce.error("PostHog Extensions not found.")}}re(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new qf(this._instance),ce.info("Surveys loaded successfully"),this.ne({isLoaded:!0})}se(e,n){ce.error(e,n),this.ne({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ee.push(e),this._surveyManager&&this.ne({isLoaded:!0}),()=>{this.ee=this.ee.filter((n=>n!==e))}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return ce.info("Disabled. Not loading surveys."),e([]);var r=this._instance.get_property(mf);if(r&&!n)return e(r,{isLoaded:!0});if(this.te)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.te=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var o;this.te=!1;var s=i.statusCode;if(s!==200||!i.json){var a="Surveys API could not be loaded, status: "+s;return ce.error(a),e([],{isLoaded:!1,error:a})}var l,c=i.json.surveys||[],u=c.filter((f=>(function(h){return!(!h.start_date||h.end_date)})(f)&&((function(h){var g;return!((g=h.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(f)||(function(h){var g;return!((g=h.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(f))));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[mf]:c}),e(c,{isLoaded:!0})}})}catch(i){throw this.te=!1,i}}ne(e){for(var n of this.ee)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(r){ce.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!de(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);ce.warn("init was not called")}oe(e){var n=null;return this.getSurveys((r=>{var i;n=(i=r.find((o=>o.id===e)))!==null&&i!==void 0?i:null})),n}ae(e){if(de(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.oe(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(de(this._surveyManager))return ce.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.ae(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return de(this._surveyManager)?(ce.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((i=>{var o,s=(o=i.find((l=>l.id===e)))!==null&&o!==void 0?o:null;if(s){var a=this.ae(s);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(e,n){var r;if(de(this._surveyManager))ce.warn("init was not called");else{var i=typeof e=="string"?this.oe(e):e;if(i!=null&&i.id)if(rC.includes(i.type)){var o=N?.querySelector(n);if(o)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(ce.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var s,a;ce.info("Rendering survey "+i.id+" with delay of "+((s=i.appearance)==null?void 0:s.surveyPopupDelaySeconds)+" seconds"),(a=this._surveyManager)==null||a.renderSurvey(i,o),ce.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,o);ce.warn("Survey element not found")}else ce.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ce.warn("Survey not found")}}displaySurvey(e,n){var r;if(de(this._surveyManager))ce.warn("init was not called");else{var i=this.oe(e);if(i){var o=i;if((r=i.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(o=$({},i,{appearance:$({},i.appearance,{surveyPopupDelaySeconds:0})})),n.ignoreConditions===!1){var s=this.canRenderSurvey(i);if(!s.visible)return void ce.warn("Survey is not eligible to be displayed: ",s.disabledReason)}n.displayType!==p_.Inline?this._surveyManager.handlePopoverSurvey(o):this.renderSurvey(o,n.selector)}else ce.warn("Survey not found")}}cancelPendingSurvey(e){de(this._surveyManager)?ce.warn("init was not called"):this._surveyManager.cancelSurvey(e)}},oy=He("[RateLimiter]"),Gf=class{constructor(e){var n,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=i=>{var o=i.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach((s=>{oy.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4}))}catch(s){return void oy.warn('could not rate limit - continuing. Error: "'+s?.message+'"',{text:o})}},this.instance=e,this.captureEventsPerSecond=((n=e.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=e.config.rate_limiting)==null?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var n,r,i;e===void 0&&(e=!1);var o=new Date().getTime(),s=(n=(r=this.instance.persistence)==null?void 0:r.get_property(yf))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:o};s.tokens+=(o-s.last)/1e3*this.captureEventsPerSecond,s.last=o,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var a=s.tokens<1;return a||e||(s.tokens=Math.max(0,s.tokens-1)),!a||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,(i=this.instance.persistence)==null||i.set_property(yf,s),{isRateLimited:a,remainingTokens:s.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}},di=He("[RemoteConfig]"),Zf=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=G._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}le(e){var n,r;(n=G.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):(di.error("PostHog Extensions not found. Cannot load remote config."),e())}ue(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return di.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.O())return void di.warn("Remote config is disabled. Falling back to local config.");this.le((e=>{if(!e)return di.info("No config found after loading remote JS config. Falling back to JSON."),void this.ue((n=>{this.fi(n)}));this.fi(e)}))}catch(e){di.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):di.info("__preview_remote_config is disabled. Logging config instead",e):di.error("Failed to fetch remote config from PostHog.")}},Yf=3e3,Xf=class{constructor(e,n){this.he=!0,this.ve=[],this.de=yn(n?.flush_interval_ms||Yf,250,5e3,L.createLogger("flush interval"),Yf),this.ce=e}enqueue(e){this.ve.push(e),this.fe||this.pe()}unload(){this.ge();var e=this.ve.length>0?this._e():{},n=Object.values(e);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.ce($({},r,{transport:"sendBeacon"}))}))}enable(){this.he=!1,this.pe()}pe(){var e=this;this.he||(this.fe=setTimeout((()=>{if(this.ge(),this.ve.length>0){var n=this._e(),r=function(){var o=n[i],s=new Date().getTime();o.data&&fe(o.data)&&pe(o.data,(a=>{a.offset=Math.abs(a.timestamp-s),delete a.timestamp})),e.ce(o)};for(var i in n)r()}}),this.de))}ge(){clearTimeout(this.fe),this.fe=void 0}_e(){var e={};return pe(this.ve,(n=>{var r,i=n,o=(i?i.batchKey:null)||i.url;O(e[o])&&(e[o]=$({},i,{data:[]})),(r=e[o].data)==null||r.push(i.data)})),this.ve=[],e}},oC=["retriesPerformedSoFar"],Qf=class{constructor(e){this.me=!1,this.ye=3e3,this.ve=[],this._instance=e,this.ve=[],this.be=!0,!O(C)&&"onLine"in C.navigator&&(this.be=C.navigator.onLine,this.we=()=>{this.be=!0,this.Dt()},this.xe=()=>{this.be=!1},De(C,"online",this.we),De(C,"offline",this.xe))}get length(){return this.ve.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,r=dy(e,oC);xn(n)&&n>0&&(r.url=Fl(r.url,{retry_count:n})),this._instance.ci($({},r,{callback:i=>{i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(n??0)<10?this.Se($({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(i)}}))}Se(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var r=(function(s){var a=3e3*Math.pow(2,s),l=a/2,c=Math.min(18e5,a),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)})(n),i=Date.now()+r;this.ve.push({retryAt:i,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),L.warn(o),this.me||(this.me=!0,this.Ee())}Ee(){if(this.$e&&clearTimeout(this.$e),this.ve.length===0)return this.me=!1,void(this.$e=void 0);this.$e=setTimeout((()=>{this.be&&this.ve.length>0&&this.Dt(),this.Ee()}),this.ye)}Dt(){var e=Date.now(),n=[],r=this.ve.filter((o=>o.retryAt<e||(n.push(o),!1)));if(this.ve=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.$e&&(clearTimeout(this.$e),this.$e=void 0),this.me=!1,O(C)||(this.we&&(C.removeEventListener("online",this.we),this.we=void 0),this.xe&&(C.removeEventListener("offline",this.xe),this.xe=void 0)),this.ve))try{this._instance.ci($({},e,{transport:"sendBeacon"}))}catch(n){L.error(n)}this.ve=[]}},Jf=class{constructor(e){this.ke=()=>{var n,r,i,o;this.Pe||(this.Pe={});var s=this.scrollElement(),a=this.scrollY(),l=s?Math.max(0,s.scrollHeight-s.clientHeight):0,c=a+(s?.clientHeight||0),u=s?.scrollHeight||0;this.Pe.lastScrollY=Math.ceil(a),this.Pe.maxScrollY=Math.max(a,(n=this.Pe.maxScrollY)!==null&&n!==void 0?n:0),this.Pe.maxScrollHeight=Math.max(l,(r=this.Pe.maxScrollHeight)!==null&&r!==void 0?r:0),this.Pe.lastContentY=c,this.Pe.maxContentY=Math.max(c,(i=this.Pe.maxContentY)!==null&&i!==void 0?i:0),this.Pe.maxContentHeight=Math.max(u,(o=this.Pe.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=e}getContext(){return this.Pe}resetContext(){var e=this.Pe;return setTimeout(this.ke,0),e}startMeasuringScrollPosition(){De(C,"scroll",this.ke,{capture:!0}),De(C,"scrollend",this.ke,{capture:!0}),De(C,"resize",this.ke)}scrollElement(){if(!this._instance.config.scroll_root_selector)return C?.document.documentElement;var e=fe(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var r=C?.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return C&&(C.scrollY||C.pageYOffset||C.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return C&&(C.scrollX||C.pageXOffset||C.document.documentElement.scrollLeft)||0}},sC=t=>i_(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties),Dl=class{constructor(e,n,r,i){this.Te=o=>{var s=this.Re();if(!s||s.sessionId!==o){var a={sessionId:o,props:this.Ie(this._instance)};this.Fe.register({[vf]:a})}},this._instance=e,this.Ce=n,this.Fe=r,this.Ie=i||sC,this.Ce.onSessionId(this.Te)}Re(){return this.Fe.props[vf]}getSetOnceProps(){var e,n=(e=this.Re())==null?void 0:e.props;return n?"r"in n?o_(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return pe(ap(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Qd(r)]=n})),e}},Zd=He("[SessionId]"),Bl=class{on(e,n){return this.Me.on(e,n)}constructor(e,n,r){var i;if(this.Oe=[],this.Ae=void 0,this.Me=new zs,this.De=(u,f)=>Math.abs(u-f)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.F=e.config,this.Fe=e.persistence,this.je=void 0,this.Le=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ne=n||br,this.Ue=r||br;var o=this.F.persistence_name||this.F.token,s=this.F.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*yn(s,60,36e3,Zd.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ze(),this.He="ph_"+o+"_window_id",this.Be="ph_"+o+"_primary_window_exists",this.qe()){var a=Ze.W(this.He),l=Ze.W(this.Be);a&&!l?this.je=a:Ze.V(this.He),Ze.G(this.Be,!0)}if((i=this.F.bootstrap)!=null&&i.sessionID)try{var c=(u=>{var f=u.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.F.bootstrap.sessionID);this.We(this.F.bootstrap.sessionID,new Date().getTime(),c)}catch(u){Zd.error("Invalid sessionID in bootstrap",u)}this.Ge()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return O(this.Oe)&&(this.Oe=[]),this.Oe.push(e),this.Le&&e(this.Le,this.je),()=>{this.Oe=this.Oe.filter((n=>n!==e))}}qe(){return this.F.persistence!=="memory"&&!this.Fe.wi&&Ze.H()}Ve(e){e!==this.je&&(this.je=e,this.qe()&&Ze.G(this.He,e))}Je(){return this.je?this.je:this.qe()?Ze.W(this.He):null}We(e,n,r){e===this.Le&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Le=e,this.Fe.register({[bl]:[n,e,r]}))}Ke(){var e=this.Fe.props[bl];return fe(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.We(null,null,null)}destroy(){clearTimeout(this.Ye),this.Ye=void 0,this.Ae&&C&&(C.removeEventListener("beforeunload",this.Ae,{capture:!1}),this.Ae=void 0),this.Oe=[]}Ge(){this.Ae=()=>{this.qe()&&Ze.V(this.Be)},De(C,"beforeunload",this.Ae,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.F.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[i,o,s]=this.Ke(),a=this.Je(),l=xn(s)&&s>0&&Math.abs(r-s)>864e5,c=!1,u=!o,f=!u&&!e&&this.De(r,i);u||f||l?(o=this.Ne(),a=this.Ue(),Zd.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}}),s=r,c=!0):a||(a=this.Ue(),c=!0);var h=i===0||!e||l?r:i,g=s===0?new Date().getTime():s;return this.Ve(a),this.We(o,h,g),e||this.ze(),c&&this.Oe.forEach((v=>v(o,a,c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0))),{sessionId:o,windowId:a,sessionStartTimestamp:g,changeReason:c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:i}}ze(){clearTimeout(this.Ye),this.Ye=setTimeout((()=>{var[e]=this.Ke();if(this.De(new Date().getTime(),e)){var n=this.Le;this.resetSessionId(),this.Me.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}},aC=["$set_once","$set"],xr=He("[SiteApps]"),ep=class{constructor(e){this._instance=e,this.Xe=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qe(e,n){if(n){var r=this.globalsForEvent(n);this.Xe.push(r),this.Xe.length>1e3&&(this.Xe=this.Xe.slice(10))}}get siteAppLoaders(){var e;return(e=G._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ai(this.Qe.bind(this));this.Ze=()=>{e(),this.Xe=[],this.Ze=void 0}}}globalsForEvent(e){var n,r,i,o,s,a,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var[h,g]of Object.entries(f))c[h]={id:u[h],type:h,properties:g};var{$set_once:v,$set:_}=e;return{event:$({},dy(e,aC),{properties:$({},e.properties,_?{$set:$({},(n=(r=e.properties)==null?void 0:r.$set)!==null&&n!==void 0?n:{},_)}:{},v?{$set_once:$({},(i=(o=e.properties)==null?void 0:o.$set_once)!==null&&i!==void 0?i:{},v)}:{}),elements_chain:(s=(a=e.properties)==null?void 0:a.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var n=this.apps[e.id],r=()=>{var a;!n.errored&&this.Xe.length&&(xr.info("Processing "+this.Xe.length+" events for site app with id "+e.id),this.Xe.forEach((l=>n.processEvent==null?void 0:n.processEvent(l))),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((a=this.Ze)==null||a.call(this))},i=!1,o=a=>{n.errored=!a,n.loaded=!0,xr.info("Site app with id "+e.id+" "+(a?"loaded":"errored")),i&&r()};try{var{processEvent:s}=e.init({posthog:this._instance,callback:a=>{o(a)}});s&&(n.processEvent=s),i=!0}catch(a){xr.error("Error while initializing PostHog app with config id "+e.id,a),o(!1)}if(i&&n.loaded)try{r()}catch(a){xr.error("Error while processing buffered events PostHog app with config id "+e.id,a),n.errored=!0}}tr(){var e=this.siteAppLoaders||[];for(var n of e)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}ir(e){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(n)}catch(i){xr.error("Error while processing event "+e.event+" for site app "+r.id,i)}}}onRemoteConfig(e){var n,r,i,o=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.tr(),void this._instance.on("eventCaptured",(c=>this.ir(c)))):void xr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Ze)==null||r.call(this),(i=e.siteApps)!=null&&i.length)if(this.isEnabled){var s=function(c){var u;G["__$$ph_site_app_"+c]=o._instance,(u=G.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,(f=>{if(f)return xr.error("Error while initializing PostHog app with config id "+c,f)}))};for(var{id:a,url:l}of e.siteApps)s(a)}else xr.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}},h_=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&wv(n,e))return!0;try{var r=t?.userAgentData;if(r!=null&&r.brands&&r.brands.some((i=>wv(i?.brand,e))))return!0}catch{}return!!t.webdriver},Os=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),sy="i.posthog.com",tp=class{constructor(e){this.er={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+sy,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.er[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Os.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.er[this.apiHost]=Os.EU:this.er[this.apiHost]=Os.CUSTOM),this.er[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Os.CUSTOM)return this.apiHost+n;var r=sy+n;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}},lC={icontains:(t,e)=>!!C&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!C&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!C&&$l(e.href,t),not_regex:(t,e)=>!!C&&!$l(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t},np=class t{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((i=>{t.rr("retrieved web experiments from the server"),n.sr=new Map,i.forEach((o=>{if(o.feature_flag_key){var s;n.sr&&(t.rr("setting flag key ",o.feature_flag_key," to web experiment ",o),(s=n.sr)==null||s.set(o.feature_flag_key,o));var a=n._instance.getFeatureFlag(o.feature_flag_key);ze(a)&&o.variants[a]&&n.nr(o.name,a,o.variants[a].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];t.ar(c)&&n.nr(o.name,l,c.transforms)}}))}),r)},this._instance=e,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(e){if(this._is_bot())t.rr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(de(this.sr))return this.sr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();t.rr("applying feature flags",e),e.forEach((n=>{var r;if(this.sr&&(r=this.sr)!=null&&r.has(n)){var i,o=this._instance.getFeatureFlag(n),s=(i=this.sr)==null?void 0:i.get(n);o&&s!=null&&s.variants[o]&&this.nr(s.name,o,s.variants[o].transforms)}}))}}previewWebExperiment(){var e=t.getWindowLocation();if(e!=null&&e.search){var n=Il(e?.search,"__experiment_id"),r=Il(e?.search,"__experiment_variant");n&&r&&(t.rr("previewing web experiments "+n+" && "+r),this.getWebExperiments((i=>{this.lr(parseInt(n),r,i)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,r){if(this._instance.config.disable_web_experiments&&!r)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!n)return e(i);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return e([]);var s=o.json.experiments||[];return e(s)}})}lr(e,n,r){var i=r.filter((o=>o.id===e));i&&i.length>0&&(t.rr("Previewing web experiment ["+i[0].name+"] with variant ["+n+"]"),this.nr(i[0].name,n,i[0].variants[n].transforms))}static ar(e){return!de(e.conditions)&&t.ur(e)&&t.hr(e)}static ur(e){var n;if(de(e.conditions)||de((n=e.conditions)==null?void 0:n.url))return!0;var r,i,o,s=t.getWindowLocation();return!!s&&((r=e.conditions)==null||!r.url||lC[(i=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&i!==void 0?i:"icontains"](e.conditions.url,s))}static getWindowLocation(){return C?.location}static hr(e){var n;if(de(e.conditions)||de((n=e.conditions)==null?void 0:n.utm))return!0;var r=e_();if(r.utm_source){var i,o,s,a,l,c,u,f,h=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,g=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_source||((a=e.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,v=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==r.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((f=e.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==r.utm_term;return h&&v&&_&&g}return!1}static rr(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];L.info("[WebExperiments] "+e,r)}nr(e,n,r){this._is_bot()?t.rr("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((i=>{if(i.selector){var o;t.rr("applying transform of variant "+n+" for experiment "+e+" ",i);var s=(o=document)==null?void 0:o.querySelectorAll(i.selector);s?.forEach((a=>{var l=a;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)}))}})):t.rr("Control variants leave the page unmodified.")}_is_bot(){return Pt&&this._instance?h_(Pt,this._instance.config.custom_blocked_useragents):void 0}},cC=He("[PostHog ExternalIntegrations]"),uC={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},rp=class{constructor(e){this._instance=e}it(e,n){var r;(r=G.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(i=>{if(i)return cC.error("failed to load script",i);n()}))}startIfEnabledOrStop(){var e=this,n=function(s){var a,l,c;!i||(a=G.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[s]||e.it(uC[s],(()=>{var u;(u=G.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[s])==null||u.start(e._instance)})),!i&&(l=G.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[s]&&((c=G.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[s])==null||c.stop())};for(var[r,i]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;n(r)}}},ip="[SessionRecording]",Es=He(ip),Vl=class{get started(){var e;return!((e=this.vr)==null||!e.isStarted)}get status(){return this.vr?this.vr.status:this.dr&&!this.cr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.dr=!1,this.pr=void 0,this._instance=e,!this._instance.sessionManager)throw Es.error("started without valid sessionManager"),new Error(ip+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(ip+' cannot be used with cookieless_mode="always"')}get cr(){var e,n=!((e=this._instance.get_property($d))==null||!e.enabled),r=!this._instance.config.disable_session_recording,i=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return C&&n&&r&&!i}startIfEnabledOrStop(e){var n;if(!this.cr||(n=this.vr)==null||!n.isStarted){var r=!O(Object.assign)&&!O(Array.from);this.cr&&r?(this.gr(e),Es.info("starting")):this.stopRecording()}}gr(e){var n,r,i;this.cr&&(G!=null&&(n=G.__PosthogExtensions__)!=null&&(n=n.rrweb)!=null&&n.record&&(r=G.__PosthogExtensions__)!=null&&r.initSessionRecording?this._r(e):(i=G.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,this.mr,(o=>{if(o)return Es.error("could not load recorder",o);this._r(e)})))}stopRecording(){var e,n;(e=this.pr)==null||e.call(this),this.pr=void 0,(n=this.vr)==null||n.stop()}yr(){var e;(e=this._instance.persistence)==null||e.unregister(xy)}br(e){if(this._instance.persistence){var n,r,i=this._instance.persistence,o=()=>{var s=e.sessionRecording===!1?void 0:e.sessionRecording,a=s?.sampleRate,l=de(a)?null:parseFloat(a);de(l)&&this.yr();var c=s?.minimumDurationMilliseconds;i.register({[$d]:$({enabled:!!s},s,{networkPayloadCapture:$({capturePerformance:e.capturePerformance},s?.networkPayloadCapture),canvasRecording:{enabled:s?.recordCanvas,fps:s?.canvasFps,quality:s?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:O(c)?null:c,endpoint:s?.endpoint,triggerMatchType:s?.triggerMatchType,masking:s?.masking,urlTriggers:s?.urlTriggers})})};o(),(n=this.pr)==null||n.call(this),this.pr=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(o)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.br(e),this.dr=!0,this.startIfEnabledOrStop()):this.dr=!0:Es.info("skipping remote config with no sessionRecording",e)}log(e,n){var r;n===void 0&&(n="log"),(r=this.vr)!=null&&r.log?this.vr.log(e,n):Es.warn("log called before recorder was ready")}get mr(){var e,n,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property($d);return(r==null||(n=r.scriptConfig)==null?void 0:n.script)||"lazy-recorder"}_r(e){var n,r;if((n=G.__PosthogExtensions__)==null||!n.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.vr||(this.vr=(r=G.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.vr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.vr.start(e)}onRRwebEmit(e){var n;(n=this.vr)==null||n.onRRwebEmit==null||n.onRRwebEmit(e)}overrideLinkedFlag(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_linked_flag:!0}),(e=this.vr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,n;this.vr||(n=this._instance.persistence)==null||n.register({$replay_override_sampling:!0}),(e=this.vr)==null||e.overrideSampling()}overrideTrigger(e){var n,r;this.vr||(r=this._instance.persistence)==null||r.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(n=this.vr)==null||n.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.vr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,n){var r;return!((r=this.vr)==null||!r.tryAddCustomEvent(e,n))}},Ms={},op=()=>{},oo="posthog",g_=!QE&&yt?.indexOf("MSIE")===-1&&yt?.indexOf("Mozilla")===-1,ay=t=>{var e;return $({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:iE(N?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:op,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:_t&&ze(_t?.search)&&_t.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(C==null||(e=C.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;L.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Yf},error_tracking:{},_onCapture:op,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{}}))(t))},ly=t=>{var e={};O(t.process_person)||(e.person_profiles=t.process_person),O(t.xhr_headers)||(e.request_headers=t.xhr_headers),O(t.cookie_name)||(e.persistence_name=t.cookie_name),O(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),O(t.store_google)||(e.save_campaign_params=t.store_google),O(t.verbose)||(e.debug=t.verbose);var n=Me({},e,t);return fe(t.property_blacklist)&&(O(t.property_denylist)?n.property_denylist=t.property_blacklist:fe(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:L.error("Invalid value for property_denylist config: "+t.property_denylist)),n},sp=class{constructor(){this.__forceAllowLocalhost=!1}get wr(){return this.__forceAllowLocalhost}set wr(e){L.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},zl=class t{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new sp,this.Sr=!1,this.version=Hn.LIB_VERSION,this.Er=new zs,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ay(),this.SentryIntegration=Rf,this.sentryIntegration=e=>(function(n,r){var i=$y(n,r);return{name:Fy,processEvent:o=>i(o)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.$r=!1,this.kr=null,this.Pr=null,this.Tr=null,this.featureFlags=new jf(this),this.toolbar=new If(this),this.scrollManager=new Jf(this),this.pageViewManager=new $f(this),this.surveys=new Kf(this),this.experiments=new np(this),this.exceptions=new Hf(this),this.rateLimiter=new Gf(this),this.requestRouter=new tp(this),this.consent=new Cf(this),this.externalIntegrations=new rp(this),this.people={set:(e,n,r)=>{var i=ze(e)?{[e]:n}:e;this.setPersonProperties(i),r?.({})},set_once:(e,n,r)=>{var i=ze(e)?{[e]:n}:e;this.setPersonProperties(void 0,i),r?.({})}},this.on("eventCaptured",(e=>L.info('send "'+e?.event+'"',e)))}init(e,n,r){if(r&&r!==oo){var i,o=(i=Ms[r])!==null&&i!==void 0?i:new t;return o._init(e,n,r),Ms[r]=o,Ms[oo][r]=o,o}return this._init(e,n,r)}_init(e,n,r){var i;if(n===void 0&&(n={}),O(e)||Jd(e))return L.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Rr(n.debug),this.Ir=n,this.Fr=[],n.person_profiles&&(this.Pr=n.person_profiles),this.set_config(Me({},ay(n.defaults),ly(n),{name:r,token:e})),this.config.on_xhr_error&&L.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Wn.GZipJS;var o=this.Cr();this.persistence=new Ls(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ls($({},this.config,{persistence:"sessionStorage"}),o);var s=$({},this.persistence.props),a=$({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Mr=new Xf((p=>this.Or(p)),this.config.request_queue_config),this.Ar=new Qf(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new Bl(this),this.sessionPropsManager=new Dl(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(L.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Dr(l)}),0)):(L.info("Initializing extensions synchronously"),this.Dr(l)),Hn.DEBUG=Hn.DEBUG||this.config.debug,Hn.DEBUG&&L.info("Starting in debug mode",{this:this,config:n,thisC:$({},this.config),p:s,s:a}),((i=n.bootstrap)==null?void 0:i.distinctID)!==void 0){var c,u,f=this.config.get_device_id(br()),h=(c=n.bootstrap)!=null&&c.isIdentifiedID?f:n.bootstrap.distinctID;this.persistence.set_property(jn,(u=n.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:h})}if(this.jr()){var g,v,_=Object.keys(((g=n.bootstrap)==null?void 0:g.featureFlags)||{}).filter((p=>{var m;return!((m=n.bootstrap)==null||(m=m.featureFlags)==null||!m[p])})).reduce(((p,m)=>{var y;return p[m]=((y=n.bootstrap)==null||(y=y.featureFlags)==null?void 0:y[m])||!1,p}),{}),x=Object.keys(((v=n.bootstrap)==null?void 0:v.featureFlagPayloads)||{}).filter((p=>_[p])).reduce(((p,m)=>{var y,w;return(y=n.bootstrap)!=null&&(y=y.featureFlagPayloads)!=null&&y[m]&&(p[m]=(w=n.bootstrap)==null||(w=w.featureFlagPayloads)==null?void 0:w[m]),p}),{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:x})}if(l)this.register_once({distinct_id:vs,$device_id:null},"");else if(!this.get_distinct_id()){var d=this.config.get_device_id(br());this.register_once({distinct_id:d,$device_id:d},""),this.persistence.set_property(jn,"anonymous")}return De(C,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?CE(this,(()=>this.Lr())):this.Lr(),kr(this.config._onCapture)&&this.config._onCapture!==op&&(L.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(p=>this.config._onCapture(p.event,p)))),this.config.ip&&L.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Dr(e){var n=performance.now();this.historyAutocapture=new Tf(this),this.historyAutocapture.startIfEnabled();var r=[];r.push((()=>{new Pf(this).startIfEnabledOrStop()})),r.push((()=>{var i;this.siteApps=new ep(this),(i=this.siteApps)==null||i.init()})),e||r.push((()=>{this.sessionRecording=new Vl(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||r.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.push((()=>{this.autocapture=new Sf(this),this.autocapture.startIfEnabled()})),r.push((()=>{this.surveys.loadIfEnabled()})),r.push((()=>{this.heatmaps=new Ff(this),this.heatmaps.startIfEnabled()})),r.push((()=>{this.webVitalsAutocapture=new Mf(this)})),r.push((()=>{this.exceptionObserver=new Af(this),this.exceptionObserver.startIfEnabled()})),r.push((()=>{this.deadClicksAutocapture=new Ol(this,EE),this.deadClicksAutocapture.startIfEnabled()})),r.push((()=>{if(this.Nr){var i=this.Nr;this.Nr=void 0,this.fi(i)}})),this.Ur(r,n)}Ur(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout((()=>{this.Ur(e,n)}),0);var r=e.shift();if(r)try{r()}catch(o){L.error("Error initializing extension:",o)}}var i=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&L.info("PostHog extensions initialized ("+i+"ms)")}fi(e){var n,r,i,o,s,a,l,c;if(!N||!N.body)return L.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.fi(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Nr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=te(e.supportedCompression,Wn.GZipJS)?Wn.GZipJS:te(e.supportedCompression,Wn.Base64)?Wn.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pr?this.Pr:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(e),(i=this.sessionRecording)==null||i.onRemoteConfig(e),(o=this.autocapture)==null||o.onRemoteConfig(e),(s=this.heatmaps)==null||s.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(a=this.webVitalsAutocapture)==null||a.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}Lr(){try{this.config.loaded(this)}catch(e){L.critical("`loaded` function failed",e)}this.zr(),this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Hr()}),1),new Zf(this).load(),this.featureFlags.flags()}zr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Mr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Cr(this.__request_queue,(e=>this.Or(e))),this.__request_queue=[],this.zr()}_handle_unload(){var e,n;this.config.request_batching?(this.Br()&&this.capture("$pageleave"),(e=this.Mr)==null||e.unload(),(n=this.Ar)==null||n.unload()):this.Br()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(g_?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Fl(e.url,{ip:this.config.ip?1:0}),e.headers=$({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var r,i,o,s=$({},n);s.timeout=s.timeout||6e4,s.url=Fl(s.url,{_:new Date().getTime().toString(),ver:Hn.LIB_VERSION,compression:s.compression});var a=(r=s.transport)!==null&&r!==void 0?r:"fetch",l=_l.filter((u=>!s.disableTransport||!u.transport||!s.disableTransport.includes(u.transport))),c=(i=(o=yy(l,(u=>u.transport===a)))==null?void 0:o.method)!==null&&i!==void 0?i:l[0].method;if(!c)throw new Error("No available transport method");c(s)})($({},e,{callback:n=>{var r,i;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(i=this.config).on_request_error)==null||r.call(i,n)),e.callback==null||e.callback(n)}}))))}Or(e){this.Ar?this.Ar.retriableRequest(e):this.ci(e)}_execute_array(e){var n,r=[],i=[],o=[];Cr(e,(a=>{a&&(n=a[0],fe(n)?o.push(a):kr(a)?a.call(this):fe(a)&&n==="alias"?r.push(a):fe(a)&&n.indexOf("capture")!==-1&&kr(this[n])?o.push(a):i.push(a))}));var s=function(a,l){Cr(a,(function(c){if(fe(c[0])){var u=l;pe(c,(function(f){u=u[f[0]].apply(u,f.slice(1))}))}else this[c[0]].apply(this,c.slice(1))}),l)};s(r,this),s(i,this),s(o,this)}jr(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Mr){if(this.is_capturing())if(!O(e)&&ze(e)){var o=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(o&&!this.config.__preview_capture_bot_pageviews)){var s=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){n!=null&&n.$current_url&&!ze(n?.$current_url)&&(L.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,l=r?.timestamp||a,c=br(),u={uuid:c,event:e,properties:this.calculateEventProperties(e,n||{},l,c)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&o&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),s&&(u.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),r?.$set&&(u.$set=r?.$set);var f,h=this.qr(r?.$set_once);if(h&&(u.$set_once=h),(u=nE(u,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,O(r?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=a),e===wl.DISMISSED||e===wl.SENT){var g=n?.[ry.SURVEY_ID],v=n?.[ry.SURVEY_ITERATION];f={id:g,current_iteration:v},localStorage.getItem(iy(f))||localStorage.setItem(iy(f),"true"),u.$set=$({},u.$set,{[nC({id:g,current_iteration:v},e===wl.SENT?"responded":"dismissed")]:!0})}var _=$({},u.properties.$set,u.$set);if(so(_)||this.setPersonPropertiesForFlags(_),!de(this.config.before_send)){var x=this.Wr(u);if(!x)return;u=x}this.Er.emit("eventCaptured",u);var d={method:"POST",url:(i=r?._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Or(d):this.Mr.enqueue(d),u}L.critical("This capture call is ignored due to client rate limiting.")}}else L.error("No event name provided to posthog.capture")}else L.uninitializedWarning("posthog.capture")}Ai(e){return this.on("eventCaptured",(n=>e(n.event,n)))}calculateEventProperties(e,n,r,i,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var s=o?void 0:this.persistence.remove_event_timer(e),a=$({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(a.$cookieless_mode=!0),e==="$snapshot"){var l=$({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!ze(a.distinct_id)&&!xn(a.distinct_id)||Jd(a.distinct_id))&&L.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,u=HE(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:h}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());a.$session_id=f,a.$window_id=h}this.sessionPropsManager&&Me(a,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Me(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(g=this.Ar)==null?void 0:g.length}catch(d){a.$sdk_debug_error_capturing_properties=String(d)}if(this.requestRouter.region===Os.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||o?e!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,i),a=Me(a,c),e==="$pageview"&&N&&(a.title=N.title),!O(s)){var v=r.getTime()-s;a.$duration=parseFloat((v/1e3).toFixed(3))}yt&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Me({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),fe(this.config.property_denylist)?pe(this.config.property_denylist,(function(d){delete a[d]})):L.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(L.error("sanitize_properties is deprecated. Use before_send instead"),a=_(a,e));var x=this.Gr();return a.$process_person_profile=x,x&&!o&&this.Vr("_calculate_event_properties"),a}qr(e){var n;if(!this.persistence||!this.Gr()||this.Sr)return e;var r=this.persistence.get_initial_props(),i=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),o=Me({},r,i||{},e||{}),s=this.config.sanitize_properties;return s&&(L.error("sanitize_properties is deprecated. Use before_send instead"),o=s(o,"$set_once")),this.Sr=!0,so(o)?void 0:o}register(e,n){var r;(r=this.persistence)==null||r.register(e,n)}register_once(e,n,r){var i;(i=this.persistence)==null||i.register_once(e,n,r)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}Jr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){var n=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,r)}getEarlyAccessFeatures(e,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,r)}on(e,n){return this.Er.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=iC),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,r){if(!this.__loaded||!this.persistence)return L.uninitializedWarning("posthog.identify");if(xn(e)&&(e=e.toString(),L.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))L.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==vs){if(this.Vr("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var o=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}e!==i&&e!==this.get_property(Cs)&&(this.unregister(Cs),this.register({distinct_id:e}));var s=(this.persistence.get_property(jn)||"anonymous")==="anonymous";e!==i&&s?(this.persistence.set_property(jn,"identified"),this.setPersonPropertiesForFlags($({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.Tr=Qv(e,n,r),this.featureFlags.setAnonymousDistinctId(i)):(n||r)&&this.setPersonProperties(n,r),e!==i&&(this.reloadFeatureFlags(),this.unregister(kl))}}else L.critical('The string "'+vs+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else L.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.Vr("posthog.setPersonProperties")){var r=Qv(this.get_distinct_id(),e,n);this.Tr!==r?(this.setPersonPropertiesForFlags($({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Tr=r):L.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,r){if(e&&n){if(this.Vr("posthog.group")){var i=this.getGroups();i[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:$({},i,{[e]:n})}),r&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[e]:r})),i[e]===n||r||this.reloadFeatureFlags()}}else L.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.Vr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,r,i,o;if(L.info("reset"),!this.__loaded)return L.uninitializedWarning("posthog.reset");var s=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(jn,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Tr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:vs,$device_id:null},"");else{var a=this.config.get_device_id(br());this.register_once({distinct_id:a,$device_id:e?a:s},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&r){var o,s=(o=e.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-s,0)}return i}alias(e,n){return e===this.get_property(_y)?(L.critical("Attempting to create alias for existing People user - aborting."),-2):this.Vr("posthog.alias")?(O(n)&&(n=this.get_distinct_id()),e!==n?(this.Jr(Cs,e),this.capture("$create_alias",{alias:e,distinct_id:n})):(L.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=$({},this.config);if(We(e)){var r,i,o,s,a;Me(this.config,ly(e));var l=this.Cr();(r=this.persistence)==null||r.update_config(this.config,n,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ls($({},this.config,{persistence:"sessionStorage"}),l);var c=this.Rr(this.config.debug);Er(c)&&(this.config.debug=c),Er(this.config.debug)&&(this.config.debug?(Hn.DEBUG=!0,Ee.H()&&Ee.G("ph_debug","true"),L.info("set_config",{config:e,oldConfig:n,newConfig:$({},this.config)})):(Hn.DEBUG=!1,Ee.H()&&Ee.V("ph_debug"))),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(s=this.heatmaps)==null||s.startIfEnabled(),this.surveys.loadIfEnabled(),this.Kr(),(a=this.externalIntegrations)==null||a.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,r={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(r).some(Boolean)){var i,o,s,a,l;(i=this.sessionManager)==null||i.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),r.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var r=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent($({},i,n))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:oo;return n!==oo&&(n=oo+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(jn))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(jn))==="identified"}Gr(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&so(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Cs])&&((n=this.persistence)==null||(n=n.props)==null||!n[Cl]))}Br(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Gr()||this.Vr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Vr(e){return this.config.person_profiles==="never"?(L.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Jr(Cl,!0),!0)}Cr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}Kr(){var e,n,r,i,o=this.Cr();return((e=this.persistence)==null?void 0:e.wi)!==o&&((r=this.persistence)==null||r.set_disabled(o)),((n=this.sessionPersistence)==null?void 0:n.wi)!==o&&((i=this.sessionPersistence)==null||i.set_disabled(o)),o}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){var r,i;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(r=this.sessionManager)==null||r.destroy(),this.sessionManager=new Bl(this),this.persistence&&(this.sessionPropsManager=new Dl(this,this.sessionManager,this.persistence)),this.sessionRecording=new Vl(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Kr(),this.zr(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(O(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((i=e?.captureEventName)!==null&&i!==void 0?i:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Hr()}else L.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Kr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:vs,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(n=this.sessionRecording)==null||n.stopRecording(),this.sessionRecording=void 0,this.Hr())):L.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Un.GRANTED?"granted":e===Un.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Kr()}_is_bot(){return Pt?h_(Pt,this.config.custom_blocked_useragents):void 0}Hr(){N&&(N.visibilityState==="visible"?this.$r||(this.$r=!0,this.capture("$pageview",{title:N.title},{send_instantly:!0}),this.kr&&(N.removeEventListener("visibilitychange",this.kr),this.kr=null)):this.kr||(this.kr=this.Hr.bind(this),De(N,"visibilitychange",this.kr)))}debug(e){e===!1?(C?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(C?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}O(){var e,n,r,i,o,s,a,l=this.Ir||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(L.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",i=!1,o=L,s=(n="advanced_disable_flags")in(e=l)&&!O(e[n]),a=r in e&&!O(e[r]),s?e[n]:a?(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[r]):i)}Wr(e){if(de(this.config.before_send))return e;var n=fe(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var i of n){if(r=i(r),de(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return B1(e.event)?L.warn(o+". This can cause unexpected behavior."):L.info(o),null}r.properties&&!so(r.properties)||L.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(r)})}Rr(e){var n=Er(e)&&!e,r=Ee.H()&&Ee.q("ph_debug")==="true";return!n&&(!!r||e)}};(function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=tE(t.prototype[e[n]])})(zl,["identify"]);var cy,m_=(cy=Ms[oo]=new zl,(function(){function t(){t.done||(t.done=!0,g_=!1,pe(Ms,(function(e){e._dom_loaded()})))}N!=null&&N.addEventListener?N.readyState==="complete"?t():De(N,"DOMContentLoaded",t,{capture:!1}):C&&L.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),cy);var vp=class{constructor(e={}){this.options=e;j(this,"client");j(this,"featureFlagsCallback");j(this,"captureCallback");if(this.client=e.client,this.featureFlagsCallback=e.onFeatureFlagsLoaded,this.captureCallback=e.onCapture,!this.client&&typeof window<"u"&&e.apiKey){let n=e.enableFeatureFlags??!0,r="syntro_"+(e.apiKey.slice(-6)||"sdk");this.client=m_.init(e.apiKey,{api_host:e.apiHost??"https://telemetry.syntrologie.com",advanced_disable_feature_flags:!n,advanced_disable_feature_flags_on_first_load:!n,autocapture:e.autocapture??!0,capture_pageview:e.capturePageview??!0,capture_pageleave:e.capturePageleave??!0,disable_session_recording:!(e.sessionRecording??!0),opt_out_useragent_filter:!0,session_recording:{recordCrossDomainIFrames:!0},capture_performance:!0,enable_recording_console_log:!0,loaded:i=>{if(n&&this.featureFlagsCallback){i.onFeatureFlags(()=>{let s=this.getAllFeatureFlags();s&&this.featureFlagsCallback&&this.featureFlagsCallback(s)});let o=this.getAllFeatureFlags();o&&Object.keys(o).length>0&&this.featureFlagsCallback(o)}this.captureCallback&&i.on("eventCaptured",o=>{let s=typeof o=="string"?o:o?.event,a=typeof o=="string"?void 0:o?.properties;typeof s=="string"&&this.captureCallback?.(s,a)})}},r)}}getAllFeatureFlags(){return this.client?.featureFlags?.getFlagVariants?.()}getSegmentFlags(){let e=this.getAllFeatureFlags();if(!e)return{};let n={};for(let[r,i]of Object.entries(e))r.startsWith("in_segment_")&&(n[r]=i===!0);return n}identify(e,n){this.client?.identify(e,n)}alias(e,n){this.client?.alias(e,n)}track(e,n){this.client?.capture(e,n)}trackCanvasOpened(e){this.track("shadow_canvas_opened",{surface:e})}trackCanvasClosed(e){this.track("shadow_canvas_closed",{surface:e})}trackRectangleViewed(e,n){this.track("shadow_canvas_rectangle_viewed",{rectangleId:e,surface:n})}trackAction(e,n,r){this.track("shadow_canvas_action",{action:e,rectangleId:n,surface:r})}register(e){this.client?.register?.(e)}getSessionId(){return this.client?.get_session_id?.()}startSessionRecording(){this.client?.startSessionRecording?.()}trackExperiment(e,n,r){let i=`$experiment_${e}`;this.register({[i]:r??`variation_${n}`,[`${i}_id`]:n}),this.track("$experiment_started",{$experiment_key:e,$experiment_variation_id:n,$experiment_variation_name:r??`variation_${n}`})}setPersonProperties(e){this.client?.capture("$set",{$set:e})}setPersonPropertiesOnce(e){this.client?.capture("$set",{$set_once:e})}getDistinctId(){return this.client?.get_distinct_id?.()}};function Wl(t={}){return new vp(t)}function dC(){let t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",e="";for(let n=0;n<16;n++)e+=t[Math.floor(Math.random()*t.length)];return e}var yp=class{constructor(){j(this,"sessionId");this.sessionId=dC(),console.log(`[Syntro Telemetry] Using noop adapter (no telemetry configured). sessionId=${this.sessionId}`)}trackCanvasOpened(e){}trackCanvasClosed(e){}trackRectangleViewed(e,n){}trackAction(e,n,r){}register(e){}getSessionId(){return this.sessionId}startSessionRecording(){}trackExperiment(e,n,r){}setPersonProperties(e){}setPersonPropertiesOnce(e){}getDistinctId(){return"demo-user"}getAllFeatureFlags(){return{}}getSegmentFlags(){return{}}};function ql(){return new yp}var y_={fetch:globalThis.fetch?globalThis.fetch.bind(globalThis):void 0,SubtleCrypto:globalThis.crypto?globalThis.crypto.subtle:void 0,EventSource:globalThis.EventSource};function __(){return y_}function _p(t){let e=2166136261,n=t.length;for(let r=0;r<n;r++)e^=t.charCodeAt(r),e+=(e<<1)+(e<<4)+(e<<7)+(e<<8)+(e<<24);return e>>>0}function Ws(t,e,n){return n===2?_p(_p(t+e)+"")%1e4/1e4:n===1?_p(e+t)%1e3/1e3:null}function fC(t){return t<=0?[]:new Array(t).fill(1/t)}function Kl(t,e){return t>=e[0]&&t<e[1]}function w_(t,e){let n=Ws("__"+e[0],t,1);return n===null?!1:n>=e[1]&&n<e[2]}function x_(t,e){for(let n=0;n<e.length;n++)if(Kl(t,e[n]))return n;return-1}function xp(t){try{let e=t.replace(/([^\\])\//g,"$1\\/");return new RegExp(e)}catch(e){console.error(e);return}}function Gl(t,e){if(!e.length)return!1;let n=!1,r=!1;for(let i=0;i<e.length;i++){let o=gC(t,e[i].type,e[i].pattern);if(e[i].include===!1){if(o)return!1}else n=!0,o&&(r=!0)}return r||!n}function pC(t,e,n){try{let r=e.replace(/[*.+?^${}()|[\]\\]/g,"\\$&").replace(/_____/g,".*");return n&&(r="\\/?"+r.replace(/(^\/|\/$)/g,"")+"\\/?"),new RegExp("^"+r+"$","i").test(t)}catch{return!1}}function hC(t,e){try{let n=new URL(e.replace(/^([^:/?]*)\./i,"https://$1.").replace(/\*/g,"_____"),"https://_____"),r=[[t.host,n.host,!1],[t.pathname,n.pathname,!0]];return n.hash&&r.push([t.hash,n.hash,!1]),n.searchParams.forEach((i,o)=>{r.push([t.searchParams.get(o)||"",i,!1])}),!r.some(i=>!pC(i[0],i[1],i[2]))}catch{return!1}}function gC(t,e,n){try{let r=new URL(t,"https://_");if(e==="regex"){let i=xp(n);return i?i.test(r.href)||i.test(r.href.substring(r.origin.length)):!1}else if(e==="simple")return hC(r,n);return!1}catch{return!1}}function S_(t,e,n){e=e===void 0?1:e,e<0?e=0:e>1&&(e=1);let r=fC(t);n=n||r,n.length!==t&&(n=r);let i=n.reduce((s,a)=>a+s,0);(i<.99||i>1.01)&&(n=r);let o=0;return n.map(s=>{let a=o;return o+=s,[a,a+e*s]})}function b_(t,e,n){if(!e)return null;let r=e.split("?")[1];if(!r)return null;let i=r.replace(/#.*/,"").split("&").map(o=>o.split("=",2)).filter(([o])=>o===t).map(([,o])=>parseInt(o));return i.length>0&&i[0]>=0&&i[0]<n?i[0]:null}function k_(t){try{return t()}catch(e){return console.error(e),!1}}var wp=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));async function gi(t,e,n){if(e=e||"",n=n||globalThis.crypto&&globalThis.crypto.subtle||y_.SubtleCrypto,!n)throw new Error("No SubtleCrypto implementation found");try{let r=await n.importKey("raw",wp(e),{name:"AES-CBC",length:128},!0,["encrypt","decrypt"]),[i,o]=t.split("."),s=await n.decrypt({name:"AES-CBC",iv:wp(i)},r,wp(o));return new TextDecoder().decode(s)}catch{throw new Error("Failed to decrypt")}}function qs(t){return typeof t=="string"?t:JSON.stringify(t)}function Ot(t){typeof t=="number"&&(t=t+""),(!t||typeof t!="string")&&(t="0");let e=t.replace(/(^v|\+.*$)/g,"").split(/[-.]/);return e.length===3&&e.push("~"),e.map(n=>n.match(/^[0-9]+$/)?n.padStart(5," "):n).join("-")}function E_(){let t;try{t="1.6.3"}catch{t=""}return t}function C_(t,e){let n,r;try{n=new URL(t),r=new URL(e)}catch(i){return console.error(`Unable to merge query strings: ${i}`),e}return n.searchParams.forEach((i,o)=>{r.searchParams.has(o)||r.searchParams.set(o,i)}),r.toString()}function v_(t){return typeof t=="object"&&t!==null}function Zl(t){return t.urlPatterns&&t.variations.some(e=>v_(e)&&"urlRedirect"in e)?"redirect":t.variations.some(e=>v_(e)&&(e.domMutations||"js"in e||"css"in e))?"visual":"unknown"}async function Yl(t,e){return new Promise(n=>{let r=!1,i,o=s=>{r||(r=!0,i&&clearTimeout(i),n(s||null))};e&&(i=setTimeout(()=>o(),e)),t.then(s=>o(s)).catch(()=>o())})}var nt={staleTTL:1e3*60,maxAge:1e3*60*60*4,cacheKey:"gbFeaturesCache",backgroundSync:!0,maxEntries:10,disableIdleStreams:!1,idleStreamInterval:2e4,disableCache:!1},Sn=__(),mo={fetchFeaturesCall:({host:t,clientKey:e,headers:n})=>Sn.fetch(`${t}/api/features/${e}`,{headers:n}),fetchRemoteEvalCall:({host:t,clientKey:e,payload:n,headers:r})=>{let i={method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(n)};return Sn.fetch(`${t}/api/eval/${e}`,i)},eventSourceCall:({host:t,clientKey:e,headers:n})=>n?new Sn.EventSource(`${t}/sub/${e}`,{headers:n}):new Sn.EventSource(`${t}/sub/${e}`),startIdleListener:()=>{let t;if(!(typeof window<"u"&&typeof document<"u"))return;let n=()=>{document.visibilityState==="visible"?(window.clearTimeout(t),yC()):document.visibilityState==="hidden"&&(t=window.setTimeout(vC,nt.idleStreamInterval))};return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},stopIdleListener:()=>{}};try{globalThis.localStorage&&(Sn.localStorage=globalThis.localStorage)}catch{}var vo=new Map,A_=!1,Kn=new Map,Xl=new Map,yo=new Map,_o=new Set;function R_(t){Object.assign(nt,t),nt.backgroundSync||Ap()}async function I_({instance:t,timeout:e,skipCache:n,allowStale:r,backgroundSync:i}){return i||(nt.backgroundSync=!1),_C({instance:t,allowStale:r,timeout:e,skipCache:n})}function mC(t){let e=Ks(t),n=vo.get(e)||new Set;n.add(t),vo.set(e,n)}function P_(t){vo.forEach(e=>e.delete(t))}function vC(){yo.forEach(t=>{t&&(t.state="idle",Ep(t))})}function yC(){yo.forEach(t=>{t&&t.state==="idle"&&Cp(t)})}async function T_(){try{if(!Sn.localStorage)return;await Sn.localStorage.setItem(nt.cacheKey,JSON.stringify(Array.from(Kn.entries())))}catch{}}async function _C({instance:t,allowStale:e,timeout:n,skipCache:r}){let i=Ks(t),o=bp(t),s=new Date,a=new Date(s.getTime()-nt.maxAge+nt.staleTTL);await wC();let l=!nt.disableCache&&!r?Kn.get(o):void 0;return l&&(e||l.staleAt>s)&&l.staleAt>a?(l.sse&&_o.add(i),l.staleAt<s?Sp(t):kp(t),{data:l.data,success:!0,source:"cache"}):await Yl(Sp(t),n)||{data:null,success:!1,source:"timeout",error:new Error("Timeout")}}function Ks(t){let[e,n]=t.getApiInfo();return`${e}||${n}`}function bp(t){let e=Ks(t);if(!("isRemoteEval"in t)||!t.isRemoteEval())return e;let n=t.getAttributes(),r=t.getCacheKeyAttributes()||Object.keys(t.getAttributes()),i={};r.forEach(a=>{i[a]=n[a]});let o=t.getForcedVariations(),s=t.getUrl();return`${e}||${JSON.stringify({ca:i,fv:o,url:s})}`}async function wC(){if(!A_){A_=!0;try{if(Sn.localStorage){let t=await Sn.localStorage.getItem(nt.cacheKey);if(!nt.disableCache&&t){let e=JSON.parse(t);e&&Array.isArray(e)&&e.forEach(([n,r])=>{Kn.set(n,{...r,staleAt:new Date(r.staleAt)})}),O_()}}}catch{}if(!nt.disableIdleStreams){let t=mo.startIdleListener();t&&(mo.stopIdleListener=t)}}}function O_(){let t=Array.from(Kn.entries()).map(([n,r])=>({key:n,staleAt:r.staleAt.getTime()})).sort((n,r)=>n.staleAt-r.staleAt),e=Math.min(Math.max(0,Kn.size-nt.maxEntries),Kn.size);for(let n=0;n<e;n++)Kn.delete(t[n].key)}function N_(t,e,n){let r=n.dateUpdated||"",i=new Date(Date.now()+nt.staleTTL),o=nt.disableCache?void 0:Kn.get(e);if(o&&r&&o.version===r){o.staleAt=i,T_();return}nt.disableCache||(Kn.set(e,{data:n,version:r,staleAt:i,sse:_o.has(t)}),O_()),T_();let s=vo.get(t);s&&s.forEach(a=>xC(a,n))}async function xC(t,e){await t.setPayload(e||t.getPayload())}async function Sp(t){let{apiHost:e,apiRequestHeaders:n}=t.getApiHosts(),r=t.getClientKey(),i="isRemoteEval"in t&&t.isRemoteEval(),o=Ks(t),s=bp(t),a=Xl.get(s);return a||(a=(i?mo.fetchRemoteEvalCall({host:e,clientKey:r,payload:{attributes:t.getAttributes(),forcedVariations:t.getForcedVariations(),forcedFeatures:Array.from(t.getForcedFeatures().entries()),url:t.getUrl()},headers:n}):mo.fetchFeaturesCall({host:e,clientKey:r,headers:n})).then(c=>{if(!c.ok)throw new Error(`HTTP error: ${c.status}`);return c.headers.get("x-sse-support")==="enabled"&&_o.add(o),c.json()}).then(c=>(N_(o,s,c),kp(t),Xl.delete(s),{data:c,success:!0,source:"network"})).catch(c=>(Xl.delete(s),{data:null,source:"error",success:!1,error:c})),Xl.set(s,a)),a}function kp(t,e=!1){let n=Ks(t),r=bp(t),{streamingHost:i,streamingHostRequestHeaders:o}=t.getApiHosts(),s=t.getClientKey();if(e&&_o.add(n),nt.backgroundSync&&_o.has(n)&&Sn.EventSource){if(yo.has(n))return;let a={src:null,host:i,clientKey:s,headers:o,cb:l=>{try{if(l.type==="features-updated"){let c=vo.get(n);c&&c.forEach(u=>{Sp(u)})}else if(l.type==="features"){let c=JSON.parse(l.data);N_(n,r,c)}a.errors=0}catch{L_(a)}},errors:0,state:"active"};yo.set(n,a),Cp(a)}}function L_(t){if(t.state!=="idle"&&(t.errors++,t.errors>3||t.src&&t.src.readyState===2)){let e=Math.pow(3,t.errors-3)*(1e3+Math.random()*1e3);Ep(t),setTimeout(()=>{["idle","active"].includes(t.state)||Cp(t)},Math.min(e,3e5))}}function Ep(t){t.src&&(t.src.onopen=null,t.src.onerror=null,t.src.close(),t.src=null,t.state==="active"&&(t.state="disabled"))}function Cp(t){t.src=mo.eventSourceCall({host:t.host,clientKey:t.clientKey,headers:t.headers}),t.state="active",t.src.addEventListener("features",t.cb),t.src.addEventListener("features-updated",t.cb),t.src.onerror=()=>L_(t),t.src.onopen=()=>{t.errors=0}}function SC(t,e){Ep(t),yo.delete(e)}function Ap(){_o.clear(),yo.forEach(SC),vo.clear(),mo.stopIdleListener()}function Ql(t,e){if(e.streaming){if(!t.getClientKey())throw new Error("Must specify clientKey to enable streaming");e.payload&&kp(t,!0),mC(t)}}var bC=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Ip={revert:function(){}},nc=new Map,Pp=new Set;function kC(t){return t==="html"?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}function rc(t){var e=nc.get(t);return e||(e={element:t,attributes:{}},nc.set(t,e)),e}function ic(t,e,n,r,i){var o=n(t),s={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,observer:new MutationObserver(function(){if(!(e==="position"&&s._positionTimeout)){e==="position"&&(s._positionTimeout=setTimeout(function(){s._positionTimeout=null},1e3));var a=n(t);e==="position"&&a.parentNode===s.virtualValue.parentNode&&a.insertBeforeNode===s.virtualValue.insertBeforeNode||a!==s.virtualValue&&(s.originalValue=a,i(s))}}),mutationRunner:i,setValue:r,getCurrentValue:n};return e==="position"&&t.parentNode?s.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):s.observer.observe(t,kC(e)),s}function oc(t,e){var n=e.getCurrentValue(e.el);e.virtualValue=t,t&&typeof t!="string"?(!n||t.parentNode!==n.parentNode||t.insertBeforeNode!==n.insertBeforeNode)&&(e.isDirty=!0,M_()):t!==n&&(e.isDirty=!0,M_())}function EC(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),oc(BC(e),t)}function CC(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach(function(n){return n.mutate(e)}),oc(Array.from(e).filter(Boolean).join(" "),t)}function AC(t){var e=t.originalValue;t.mutations.forEach(function(n){return e=n.mutate(e)}),oc(e,t)}function TC(t){var e=t.parentSelector,n=t.insertBeforeSelector,r=document.querySelector(e);if(!r)return null;var i=n?document.querySelector(n):null;return n&&!i?null:{parentNode:r,insertBeforeNode:i}}function RC(t){var e=t.originalValue;t.mutations.forEach(function(n){var r=n.mutate(),i=TC(r);e=i||e}),oc(e,t)}var IC=function(e){return e.innerHTML},PC=function(e,n){return e.innerHTML=n};function $_(t){var e=rc(t);return e.html||(e.html=ic(t,"html",IC,PC,EC)),e.html}var OC=function(e){return{parentNode:e.parentElement,insertBeforeNode:e.nextElementSibling}},NC=function(e,n){n.insertBeforeNode&&!n.parentNode.contains(n.insertBeforeNode)||n.parentNode.insertBefore(e,n.insertBeforeNode)};function D_(t){var e=rc(t);return e.position||(e.position=ic(t,"position",OC,NC,RC)),e.position}var LC=function(e,n){return n?e.className=n:e.removeAttribute("class")},MC=function(e){return e.className};function B_(t){var e=rc(t);return e.classes||(e.classes=ic(t,"class",MC,LC,CC)),e.classes}var FC=function(e){return function(n){var r;return(r=n.getAttribute(e))!=null?r:null}},$C=function(e){return function(n,r){return r!==null?n.setAttribute(e,r):n.removeAttribute(e)}};function V_(t,e){var n=rc(t);return n.attributes[e]||(n.attributes[e]=ic(t,e,FC(e),$C(e),AC)),n.attributes[e]}function DC(t,e){var n=nc.get(t);if(n)if(e==="html"){var r,i;(r=n.html)==null||(i=r.observer)==null||i.disconnect(),delete n.html}else if(e==="class"){var o,s;(o=n.classes)==null||(s=o.observer)==null||s.disconnect(),delete n.classes}else if(e==="position"){var a,l;(a=n.position)==null||(l=a.observer)==null||l.disconnect(),delete n.position}else{var c,u,f;(c=n.attributes)==null||(u=c[e])==null||(f=u.observer)==null||f.disconnect(),delete n.attributes[e]}}var Jl;function BC(t){return Jl||(Jl=document.createElement("div")),Jl.innerHTML=t,Jl.innerHTML}function ec(t,e,n){if(n.isDirty){n.isDirty=!1;var r=n.virtualValue;n.mutations.length||DC(t,e),n.setValue(t,r)}}function VC(t,e){t.html&&ec(e,"html",t.html),t.classes&&ec(e,"class",t.classes),t.position&&ec(e,"position",t.position),Object.keys(t.attributes).forEach(function(n){ec(e,n,t.attributes[n])})}function M_(){nc.forEach(VC)}function zC(t,e){var n=null;t.kind==="html"?n=$_(e):t.kind==="class"?n=B_(e):t.kind==="attribute"?n=V_(e,t.attribute):t.kind==="position"&&(n=D_(e)),n&&(n.mutations.push(t),n.mutationRunner(n))}function HC(t,e){var n=null;if(t.kind==="html"?n=$_(e):t.kind==="class"?n=B_(e):t.kind==="attribute"?n=V_(e,t.attribute):t.kind==="position"&&(n=D_(e)),!!n){var r=n.mutations.indexOf(t);r!==-1&&n.mutations.splice(r,1),n.mutationRunner(n)}}function z_(t){if(!(t.kind==="position"&&t.elements.size===1)){var e=new Set(t.elements),n=document.querySelectorAll(t.selector);n.forEach(function(r){e.has(r)||(t.elements.add(r),zC(t,r))})}}function jC(t){t.elements.forEach(function(e){return HC(t,e)}),t.elements.clear(),Pp.delete(t)}function F_(){Pp.forEach(z_)}var Tp;function UC(){typeof document>"u"||(Tp||(Tp=new MutationObserver(function(){F_()})),F_(),Tp.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}))}UC();function sc(t){return typeof document>"u"?Ip:(Pp.add(t),z_(t),{revert:function(){jC(t)}})}function Rp(t,e){return sc({kind:"html",elements:new Set,mutate:e,selector:t})}function H_(t,e){return sc({kind:"position",elements:new Set,mutate:e,selector:t})}function Gs(t,e){return sc({kind:"class",elements:new Set,mutate:e,selector:t})}function tc(t,e,n){return bC.test(e)?e==="class"||e==="className"?Gs(t,function(r){var i=n(Array.from(r).join(" "));r.clear(),i&&i.split(/\s+/g).filter(Boolean).forEach(function(o){return r.add(o)})}):sc({kind:"attribute",attribute:e,elements:new Set,mutate:n,selector:t}):Ip}function WC(t){var e=t.selector,n=t.action,r=t.value,i=t.attribute,o=t.parentSelector,s=t.insertBeforeSelector;if(i==="html"){if(n==="append")return Rp(e,function(a){return a+(r??"")});if(n==="set")return Rp(e,function(){return r??""})}else if(i==="class"){if(n==="append")return Gs(e,function(a){r&&a.add(r)});if(n==="remove")return Gs(e,function(a){r&&a.delete(r)});if(n==="set")return Gs(e,function(a){a.clear(),r&&a.add(r)})}else if(i==="position"){if(n==="set"&&o)return H_(e,function(){return{insertBeforeSelector:s,parentSelector:o}})}else{if(n==="append")return tc(e,i,function(a){return a!==null?a+(r??""):r??""});if(n==="set")return tc(e,i,function(){return r??""});if(n==="remove")return tc(e,i,function(){return null})}return Ip}var qC={html:Rp,classes:Gs,attribute:tc,position:H_,declarative:WC},j_=qC;var Op={};function Tr(t,e,n){n=n||{};for(let[r,i]of Object.entries(e))switch(r){case"$or":if(!W_(t,i,n))return!1;break;case"$nor":if(W_(t,i,n))return!1;break;case"$and":if(!XC(t,i,n))return!1;break;case"$not":if(Tr(t,i,n))return!1;break;default:if(!Zs(i,KC(t,r),n))return!1}return!0}function KC(t,e){let n=e.split("."),r=t;for(let i=0;i<n.length;i++)if(r&&typeof r=="object"&&n[i]in r)r=r[n[i]];else return null;return r}function U_(t,e=!1){let n=`${t}${e?"/i":""}`;return Op[n]||(Op[n]=new RegExp(t.replace(/([^\\])\//g,"$1\\/"),e?"i":void 0)),Op[n]}function Zs(t,e,n){if(typeof t=="string")return e+""===t;if(typeof t=="number")return e*1===t;if(typeof t=="boolean")return e!==null&&!!e===t;if(t===null)return e===null;if(Array.isArray(t)||!q_(t))return JSON.stringify(e)===JSON.stringify(t);for(let r in t)if(!YC(r,e,t[r],n))return!1;return!0}function q_(t){let e=Object.keys(t);return e.length>0&&e.filter(n=>n[0]==="$").length===e.length}function GC(t){if(t===null)return"null";if(Array.isArray(t))return"array";let e=typeof t;return["string","number","boolean","object","undefined"].includes(e)?e:"unknown"}function ZC(t,e,n){if(!Array.isArray(t))return!1;let r=q_(e)?i=>Zs(e,i,n):i=>Tr(i,e,n);for(let i=0;i<t.length;i++)if(t[i]&&r(t[i]))return!0;return!1}function ac(t,e){return Array.isArray(t)?t.some(n=>e.includes(n)):e.includes(t)}function YC(t,e,n,r){switch(t){case"$veq":return Ot(e)===Ot(n);case"$vne":return Ot(e)!==Ot(n);case"$vgt":return Ot(e)>Ot(n);case"$vgte":return Ot(e)>=Ot(n);case"$vlt":return Ot(e)<Ot(n);case"$vlte":return Ot(e)<=Ot(n);case"$eq":return e===n;case"$ne":return e!==n;case"$lt":return e<n;case"$lte":return e<=n;case"$gt":return e>n;case"$gte":return e>=n;case"$exists":return n?e!=null:e==null;case"$in":return Array.isArray(n)?ac(e,n):!1;case"$inGroup":return ac(e,r[n]||[]);case"$notInGroup":return!ac(e,r[n]||[]);case"$nin":return Array.isArray(n)?!ac(e,n):!1;case"$not":return!Zs(n,e,r);case"$size":return Array.isArray(e)?Zs(n,e.length,r):!1;case"$elemMatch":return ZC(e,n,r);case"$all":if(!Array.isArray(e))return!1;for(let i=0;i<n.length;i++){let o=!1;for(let s=0;s<e.length;s++)if(Zs(n[i],e[s],r)){o=!0;break}if(!o)return!1}return!0;case"$regex":try{return U_(n).test(e)}catch{return!1}case"$regexi":try{return U_(n,!0).test(e)}catch{return!1}case"$type":return GC(e)===n;default:return console.error("Unknown operator: "+t),!1}}function W_(t,e,n){if(!e.length)return!0;for(let r=0;r<e.length;r++)if(Tr(t,e[r],n))return!0;return!1}function XC(t,e,n){for(let r=0;r<e.length;r++)if(!Tr(t,e[r],n))return!1;return!0}var QC="Feature Evaluated",JC="Experiment Viewed";function eA(t){let e=new Map;return t.global.forcedFeatureValues&&t.global.forcedFeatureValues.forEach((n,r)=>e.set(r,n)),t.user.forcedFeatureValues&&t.user.forcedFeatureValues.forEach((n,r)=>e.set(r,n)),e}function tA(t){return t.global.forcedVariations&&t.user.forcedVariations?{...t.global.forcedVariations,...t.user.forcedVariations}:t.global.forcedVariations?t.global.forcedVariations:t.user.forcedVariations?t.user.forcedVariations:{}}async function wo(t){try{await t()}catch{}}function K_(t,e,n){if(t.user.trackedExperiments){let i=uc(e,n);if(t.user.trackedExperiments.has(i))return[];t.user.trackedExperiments.add(i)}t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({experiment:e,result:n,timestamp:Date.now().toString(),logType:"experiment"});let r=[];if(t.global.trackingCallback){let i=t.global.trackingCallback;r.push(wo(()=>i(e,n,t.user)))}if(t.user.trackingCallback){let i=t.user.trackingCallback;r.push(wo(()=>i(e,n)))}if(t.global.eventLogger){let i=t.global.eventLogger;r.push(wo(()=>i(JC,{experimentId:e.key,variationId:n.key,hashAttribute:n.hashAttribute,hashValue:n.hashValue},t.user)))}return r}function nA(t,e,n){if(t.user.trackedFeatureUsage){let r=JSON.stringify(n.value);if(t.user.trackedFeatureUsage[e]===r)return;t.user.trackedFeatureUsage[e]=r,t.user.enableDevMode&&t.user.devLogs&&t.user.devLogs.push({featureKey:e,result:n,timestamp:Date.now().toString(),logType:"feature"})}if(t.global.onFeatureUsage){let r=t.global.onFeatureUsage;wo(()=>r(e,n,t.user))}if(t.user.onFeatureUsage){let r=t.user.onFeatureUsage;wo(()=>r(e,n))}if(t.global.eventLogger){let r=t.global.eventLogger;wo(()=>r(QC,{feature:e,source:n.source,value:n.value,ruleId:n.source==="defaultValue"?"$default":n.ruleId||"",variationId:n.experimentResult?n.experimentResult.key:""},t.user))}}function lc(t,e){if(e.stack.evaluatedFeatures.has(t))return Rr(e,t,null,"cyclicPrerequisite");e.stack.evaluatedFeatures.add(t),e.stack.id=t;let n=eA(e);if(n.has(t))return Rr(e,t,n.get(t),"override");if(!e.global.features||!e.global.features[t])return Rr(e,t,null,"unknownFeature");let r=e.global.features[t];if(r.rules){let i=new Set(e.stack.evaluatedFeatures);e:for(let o of r.rules){if(o.parentConditions)for(let l of o.parentConditions){e.stack.evaluatedFeatures=new Set(i);let c=lc(l.id,e);if(c.source==="cyclicPrerequisite")return Rr(e,t,null,"cyclicPrerequisite");let u={value:c.value};if(!Tr(u,l.condition||{})){if(l.gate)return Rr(e,t,null,"prerequisite");continue e}}if(o.filters&&Y_(o.filters,e))continue;if("force"in o){if(o.condition&&!Z_(o.condition,e)||!rA(e,o.seed||t,o.hashAttribute,e.user.saveStickyBucketAssignmentDoc&&!o.disableStickyBucketing?o.fallbackAttribute:void 0,o.range,o.coverage,o.hashVersion))continue;return o.tracks&&o.tracks.forEach(l=>{!K_(e,l.experiment,l.result).length&&e.global.saveDeferredTrack&&e.global.saveDeferredTrack({experiment:l.experiment,result:l.result})}),Rr(e,t,o.force,"force",o.id)}if(!o.variations)continue;let s={variations:o.variations,key:o.key||t};"coverage"in o&&(s.coverage=o.coverage),o.weights&&(s.weights=o.weights),o.hashAttribute&&(s.hashAttribute=o.hashAttribute),o.fallbackAttribute&&(s.fallbackAttribute=o.fallbackAttribute),o.disableStickyBucketing&&(s.disableStickyBucketing=o.disableStickyBucketing),o.bucketVersion!==void 0&&(s.bucketVersion=o.bucketVersion),o.minBucketVersion!==void 0&&(s.minBucketVersion=o.minBucketVersion),o.namespace&&(s.namespace=o.namespace),o.meta&&(s.meta=o.meta),o.ranges&&(s.ranges=o.ranges),o.name&&(s.name=o.name),o.phase&&(s.phase=o.phase),o.seed&&(s.seed=o.seed),o.hashVersion&&(s.hashVersion=o.hashVersion),o.filters&&(s.filters=o.filters),o.condition&&(s.condition=o.condition);let{result:a}=cc(s,t,e);if(e.global.onExperimentEval&&e.global.onExperimentEval(s,a),a.inExperiment&&!a.passthrough)return Rr(e,t,a.value,"experiment",o.id,s,a)}}return Rr(e,t,r.defaultValue===void 0?null:r.defaultValue,"defaultValue")}function cc(t,e,n){let r=t.key,i=t.variations.length;if(i<2)return{result:Se(n,t,-1,!1,e)};if(n.global.enabled===!1||n.user.enabled===!1)return{result:Se(n,t,-1,!1,e)};if(t=iA(t,n),t.urlPatterns&&!Gl(n.user.url||"",t.urlPatterns))return{result:Se(n,t,-1,!1,e)};let o=b_(r,n.user.url||"",i);if(o!==null)return{result:Se(n,t,o,!1,e)};let s=tA(n);if(r in s){let x=s[r];return{result:Se(n,t,x,!1,e)}}if(t.status==="draft"||t.active===!1)return{result:Se(n,t,-1,!1,e)};let{hashAttribute:a,hashValue:l}=mi(n,t.hashAttribute,n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing?t.fallbackAttribute:void 0);if(!l)return{result:Se(n,t,-1,!1,e)};let c=-1,u=!1,f=!1;if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{variation:x,versionIsBlocked:d}=aA({ctx:n,expKey:t.key,expBucketVersion:t.bucketVersion,expHashAttribute:t.hashAttribute,expFallbackAttribute:t.fallbackAttribute,expMinBucketVersion:t.minBucketVersion,expMeta:t.meta});u=x>=0,c=x,f=!!d}if(!u){if(t.filters){if(Y_(t.filters,n))return{result:Se(n,t,-1,!1,e)}}else if(t.namespace&&!w_(l,t.namespace))return{result:Se(n,t,-1,!1,e)};if(t.include&&!k_(t.include))return{result:Se(n,t,-1,!1,e)};if(t.condition&&!Z_(t.condition,n))return{result:Se(n,t,-1,!1,e)};if(t.parentConditions){let x=new Set(n.stack.evaluatedFeatures);for(let d of t.parentConditions){n.stack.evaluatedFeatures=new Set(x);let p=lc(d.id,n);if(p.source==="cyclicPrerequisite")return{result:Se(n,t,-1,!1,e)};let m={value:p.value};if(!Tr(m,d.condition||{}))return{result:Se(n,t,-1,!1,e)}}}if(t.groups&&!sA(t.groups,n))return{result:Se(n,t,-1,!1,e)}}if(t.url&&!oA(t.url,n))return{result:Se(n,t,-1,!1,e)};let h=Ws(t.seed||r,l,t.hashVersion||1);if(h===null)return{result:Se(n,t,-1,!1,e)};if(!u){let x=t.ranges||S_(i,t.coverage===void 0?1:t.coverage,t.weights);c=x_(h,x)}if(f)return{result:Se(n,t,-1,!1,e,void 0,!0)};if(c<0)return{result:Se(n,t,-1,!1,e)};if("force"in t)return{result:Se(n,t,t.force===void 0?-1:t.force,!1,e)};if(n.global.qaMode||n.user.qaMode)return{result:Se(n,t,-1,!1,e)};if(t.status==="stopped")return{result:Se(n,t,-1,!1,e)};let g=Se(n,t,c,!0,e,h,u);if(n.user.saveStickyBucketAssignmentDoc&&!t.disableStickyBucketing){let{changed:x,key:d,doc:p}=cA(n,a,qs(l),{[Np(t.key,t.bucketVersion)]:g.key});x&&(n.user.stickyBucketAssignmentDocs=n.user.stickyBucketAssignmentDocs||{},n.user.stickyBucketAssignmentDocs[d]=p,n.user.saveStickyBucketAssignmentDoc(p))}let v=K_(n,t,g);v.length===0&&n.global.saveDeferredTrack&&n.global.saveDeferredTrack({experiment:t,result:g});let _=v.length?v.length===1?v[0]:Promise.all(v).then(()=>{}):void 0;return"changeId"in t&&t.changeId&&n.global.recordChangeId&&n.global.recordChangeId(t.changeId),{result:g,trackingCall:_}}function Rr(t,e,n,r,i,o,s){let a={value:n,on:!!n,off:!n,source:r,ruleId:i||""};return o&&(a.experiment=o),s&&(a.experimentResult=s),r!=="override"&&nA(t,e,a),a}function G_(t){return{...t.user.attributes,...t.user.attributeOverrides}}function Z_(t,e){return Tr(G_(e),t,e.global.savedGroups||{})}function Y_(t,e){return t.some(n=>{let{hashValue:r}=mi(e,n.attribute);if(!r)return!0;let i=Ws(n.seed,r,n.hashVersion||2);return i===null?!0:!n.ranges.some(o=>Kl(i,o))})}function rA(t,e,n,r,i,o,s){if(!i&&o===void 0)return!0;if(!i&&o===0)return!1;let{hashValue:a}=mi(t,n,r);if(!a)return!1;let l=Ws(e,a,s||1);return l===null?!1:i?Kl(l,i):o!==void 0?l<=o:!0}function Se(t,e,n,r,i,o,s){let a=!0;(n<0||n>=e.variations.length)&&(n=0,a=!1);let{hashAttribute:l,hashValue:c}=mi(t,e.hashAttribute,t.user.saveStickyBucketAssignmentDoc&&!e.disableStickyBucketing?e.fallbackAttribute:void 0),u=e.meta?e.meta[n]:{},f={key:u.key||""+n,featureId:i,inExperiment:a,hashUsed:r,variationId:n,value:e.variations[n],hashAttribute:l,hashValue:c,stickyBucketUsed:!!s};return u.name&&(f.name=u.name),o!==void 0&&(f.bucket=o),u.passthrough&&(f.passthrough=u.passthrough),f}function iA(t,e){let n=t.key,r=e.global.overrides;return r&&r[n]&&(t=Object.assign({},t,r[n]),typeof t.url=="string"&&(t.url=xp(t.url))),t}function mi(t,e,n){let r=e||"id",i="",o=G_(t);return o[r]&&(i=o[r]),!i&&n&&(o[n]&&(i=o[n]),i&&(r=n)),{hashAttribute:r,hashValue:i}}function oA(t,e){let n=e.user.url;if(!n)return!1;let r=n.replace(/^https?:\/\//,"").replace(/^[^/]*\//,"/");return!!(t.test(n)||t.test(r))}function sA(t,e){let n=e.global.groups||{};for(let r=0;r<t.length;r++)if(n[t[r]])return!0;return!1}function aA({ctx:t,expKey:e,expBucketVersion:n,expHashAttribute:r,expFallbackAttribute:i,expMinBucketVersion:o,expMeta:s}){n=n||0,o=o||0,r=r||"id",s=s||[];let a=Np(e,n),l=lA(t,r,i);if(o>0)for(let f=0;f<o;f++){let h=Np(e,f);if(l[h]!==void 0)return{variation:-1,versionIsBlocked:!0}}let c=l[a];if(c===void 0)return{variation:-1};let u=s.findIndex(f=>f.key===c);return u<0?{variation:-1}:{variation:u}}function Np(t,e){return e=e||0,`${t}__${e}`}function Lp(t,e){return`${t}||${e}`}function lA(t,e,n){if(!t.user.stickyBucketAssignmentDocs)return{};let{hashAttribute:r,hashValue:i}=mi(t,e),o=Lp(r,qs(i)),{hashAttribute:s,hashValue:a}=mi(t,n),l=a?Lp(s,qs(a)):null,c={};return l&&t.user.stickyBucketAssignmentDocs[l]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[l].assignments||{}),t.user.stickyBucketAssignmentDocs[o]&&Object.assign(c,t.user.stickyBucketAssignmentDocs[o].assignments||{}),c}function cA(t,e,n,r){let i=Lp(e,n),o=t.user.stickyBucketAssignmentDocs&&t.user.stickyBucketAssignmentDocs[i]?t.user.stickyBucketAssignmentDocs[i].assignments||{}:{},s={...o,...r},a=JSON.stringify(o)!==JSON.stringify(s);return{key:i,doc:{attributeName:e,attributeValue:n,assignments:s},changed:a}}function uA(t,e){let n=new Set,r=e&&e.features?e.features:t.global.features||{},i=e&&e.experiments?e.experiments:t.global.experiments||[];return Object.keys(r).forEach(o=>{let s=r[o];if(s.rules)for(let a of s.rules)a.variations&&(n.add(a.hashAttribute||"id"),a.fallbackAttribute&&n.add(a.fallbackAttribute))}),i.map(o=>{n.add(o.hashAttribute||"id"),o.fallbackAttribute&&n.add(o.fallbackAttribute)}),Array.from(n)}async function X_(t,e,n){let r=Mp(t,n);return e.getAllAssignments(r)}function Mp(t,e){let n={};return uA(t,e).forEach(i=>{let{hashValue:o}=mi(t,i);n[i]=qs(o)}),n}async function Q_(t,e,n){if(t={...t},t.encryptedFeatures){try{t.features=JSON.parse(await gi(t.encryptedFeatures,e,n))}catch(r){console.error(r)}delete t.encryptedFeatures}if(t.encryptedExperiments){try{t.experiments=JSON.parse(await gi(t.encryptedExperiments,e,n))}catch(r){console.error(r)}delete t.encryptedExperiments}if(t.encryptedSavedGroups){try{t.savedGroups=JSON.parse(await gi(t.encryptedSavedGroups,e,n))}catch(r){console.error(r)}delete t.encryptedSavedGroups}return t}function J_(t){let e=t.apiHost||"https://cdn.growthbook.io";return{apiHost:e.replace(/\/*$/,""),streamingHost:(t.streamingHost||e).replace(/\/*$/,""),apiRequestHeaders:t.apiHostRequestHeaders,streamingHostRequestHeaders:t.streamingHostRequestHeaders}}function uc(t,e){return e.hashAttribute+e.hashValue+t.key+e.variationId}var xo=typeof window<"u"&&typeof document<"u",dA=E_(),Ys=class{constructor(e){if(e=e||{},this.version=dA,this._options=this.context=e,this._renderer=e.renderer||null,this._trackedExperiments=new Set,this._completedChangeIds=new Set,this._trackedFeatures={},this.debug=!!e.debug,this._subscriptions=new Set,this.ready=!1,this._assigned=new Map,this._activeAutoExperiments=new Map,this._triggeredExpKeys=new Set,this._initialized=!1,this._redirectedUrl="",this._deferredTrackingCalls=new Map,this._autoExperimentsAllowed=!e.disableExperimentsOnLoad,this._destroyCallbacks=[],this.logs=[],this.log=this.log.bind(this),this._saveDeferredTrack=this._saveDeferredTrack.bind(this),this._onExperimentEval=this._onExperimentEval.bind(this),this._fireSubscriptions=this._fireSubscriptions.bind(this),this._recordChangedId=this._recordChangedId.bind(this),e.remoteEval){if(e.decryptionKey)throw new Error("Encryption is not available for remoteEval");if(!e.clientKey)throw new Error("Missing clientKey");let n=!1;try{n=!!new URL(e.apiHost||"").hostname.match(/growthbook\.io$/i)}catch{}if(n)throw new Error("Cannot use remoteEval on GrowthBook Cloud")}else if(e.cacheKeyAttributes)throw new Error("cacheKeyAttributes are only used for remoteEval");if(e.stickyBucketService){let n=e.stickyBucketService;this._saveStickyBucketAssignmentDoc=r=>n.saveAssignments(r)}if(e.plugins)for(let n of e.plugins)n(this);if(e.features&&(this.ready=!0),xo&&e.enableDevMode&&(window._growthbook=this,document.dispatchEvent(new Event("gbloaded"))),e.experiments&&(this.ready=!0,this._updateAllAutoExperiments()),this._options.stickyBucketService&&this._options.stickyBucketAssignmentDocs)for(let n in this._options.stickyBucketAssignmentDocs){let r=this._options.stickyBucketAssignmentDocs[n];r&&this._options.stickyBucketService.saveAssignments(r).catch(()=>{})}this.ready&&this.refreshStickyBuckets(this.getPayload())}async setPayload(e){this._payload=e;let n=await Q_(e,this._options.decryptionKey);this._decryptedPayload=n,await this.refreshStickyBuckets(n),n.features&&(this._options.features=n.features),n.savedGroups&&(this._options.savedGroups=n.savedGroups),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,this._render()}initSync(e){this._initialized=!0;let n=e.payload;if(n.encryptedExperiments||n.encryptedFeatures)throw new Error("initSync does not support encrypted payloads");return this._options.stickyBucketService&&!this._options.stickyBucketAssignmentDocs&&(this._options.stickyBucketAssignmentDocs=this.generateStickyBucketAssignmentDocsSync(this._options.stickyBucketService,n)),this._payload=n,this._decryptedPayload=n,n.features&&(this._options.features=n.features),n.experiments&&(this._options.experiments=n.experiments,this._updateAllAutoExperiments()),this.ready=!0,Ql(this,e),this}async init(e){if(this._initialized=!0,e=e||{},e.cacheSettings&&R_(e.cacheSettings),e.payload)return await this.setPayload(e.payload),Ql(this,e),{success:!0,source:"init"};{let{data:n,...r}=await this._refresh({...e,allowStale:!0});return Ql(this,e),await this.setPayload(n||{}),r}}async loadFeatures(e){e=e||{},await this.init({skipCache:e.skipCache,timeout:e.timeout,streaming:(this._options.backgroundSync??!0)&&(e.autoRefresh||this._options.subscribeToChanges)})}async refreshFeatures(e){let n=await this._refresh({...e||{},allowStale:!1});n.data&&await this.setPayload(n.data)}getApiInfo(){return[this.getApiHosts().apiHost,this.getClientKey()]}getApiHosts(){return J_(this._options)}getClientKey(){return this._options.clientKey||""}getPayload(){return this._payload||{features:this.getFeatures(),experiments:this.getExperiments()}}getDecryptedPayload(){return this._decryptedPayload||this.getPayload()}isRemoteEval(){return this._options.remoteEval||!1}getCacheKeyAttributes(){return this._options.cacheKeyAttributes}async _refresh({timeout:e,skipCache:n,allowStale:r,streaming:i}){if(!this._options.clientKey)throw new Error("Missing clientKey");return I_({instance:this,timeout:e,skipCache:n||this._options.disableCache,allowStale:r,backgroundSync:i??this._options.backgroundSync??!0})}_render(){if(this._renderer)try{this._renderer()}catch(e){console.error("Failed to render",e)}}setFeatures(e){this._options.features=e,this.ready=!0,this._render()}async setEncryptedFeatures(e,n,r){let i=await gi(e,n||this._options.decryptionKey,r);this.setFeatures(JSON.parse(i))}setExperiments(e){this._options.experiments=e,this.ready=!0,this._updateAllAutoExperiments()}async setEncryptedExperiments(e,n,r){let i=await gi(e,n||this._options.decryptionKey,r);this.setExperiments(JSON.parse(i))}async setAttributes(e){if(this._options.attributes=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async updateAttributes(e){return this.setAttributes({...this._options.attributes,...e})}async setAttributeOverrides(e){if(this._options.attributeOverrides=e,this._options.stickyBucketService&&await this.refreshStickyBuckets(),this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}async setForcedVariations(e){if(this._options.forcedVariations=e||{},this._options.remoteEval){await this._refreshForRemoteEval();return}this._render(),this._updateAllAutoExperiments()}setForcedFeatures(e){this._options.forcedFeatureValues=e,this._render()}async setURL(e){if(e!==this._options.url){if(this._options.url=e,this._redirectedUrl="",this._options.remoteEval){await this._refreshForRemoteEval(),this._updateAllAutoExperiments(!0);return}this._updateAllAutoExperiments(!0)}}getAttributes(){return{...this._options.attributes,...this._options.attributeOverrides}}getForcedVariations(){return this._options.forcedVariations||{}}getForcedFeatures(){return this._options.forcedFeatureValues||new Map}getStickyBucketAssignmentDocs(){return this._options.stickyBucketAssignmentDocs||{}}getUrl(){return this._options.url||""}getFeatures(){return this._options.features||{}}getExperiments(){return this._options.experiments||[]}getCompletedChangeIds(){return Array.from(this._completedChangeIds)}subscribe(e){return this._subscriptions.add(e),()=>{this._subscriptions.delete(e)}}async _refreshForRemoteEval(){if(!this._options.remoteEval||!this._initialized)return;let e=await this._refresh({allowStale:!1});e.data&&await this.setPayload(e.data)}getAllResults(){return new Map(this._assigned)}onDestroy(e){this._destroyCallbacks.push(e)}isDestroyed(){return!!this._destroyed}destroy(e){e=e||{},this._destroyed=!0,this._destroyCallbacks.forEach(n=>{try{n()}catch(r){console.error(r)}}),this._subscriptions.clear(),this._assigned.clear(),this._trackedExperiments.clear(),this._completedChangeIds.clear(),this._deferredTrackingCalls.clear(),this._trackedFeatures={},this._destroyCallbacks=[],this._payload=void 0,this._saveStickyBucketAssignmentDoc=void 0,P_(this),e.destroyAllStreams&&Ap(),this.logs=[],xo&&window._growthbook===this&&delete window._growthbook,this._activeAutoExperiments.forEach(n=>{n.undo()}),this._activeAutoExperiments.clear(),this._triggeredExpKeys.clear()}setRenderer(e){this._renderer=e}forceVariation(e,n){if(this._options.forcedVariations=this._options.forcedVariations||{},this._options.forcedVariations[e]=n,this._options.remoteEval){this._refreshForRemoteEval();return}this._updateAllAutoExperiments(),this._render()}run(e){let{result:n}=cc(e,null,this._getEvalContext());return this._onExperimentEval(e,n),n}triggerExperiment(e){return this._triggeredExpKeys.add(e),this._options.experiments?this._options.experiments.filter(r=>r.key===e).map(r=>this._runAutoExperiment(r)).filter(r=>r!==null):null}triggerAutoExperiments(){this._autoExperimentsAllowed=!0,this._updateAllAutoExperiments(!0)}_getEvalContext(){return{user:this._getUserContext(),global:this._getGlobalContext(),stack:{evaluatedFeatures:new Set}}}_getUserContext(){return{attributes:this._options.user?{...this._options.user,...this._options.attributes}:this._options.attributes,enableDevMode:this._options.enableDevMode,blockedChangeIds:this._options.blockedChangeIds,stickyBucketAssignmentDocs:this._options.stickyBucketAssignmentDocs,url:this._getContextUrl(),forcedVariations:this._options.forcedVariations,forcedFeatureValues:this._options.forcedFeatureValues,attributeOverrides:this._options.attributeOverrides,saveStickyBucketAssignmentDoc:this._saveStickyBucketAssignmentDoc,trackingCallback:this._options.trackingCallback,onFeatureUsage:this._options.onFeatureUsage,devLogs:this.logs,trackedExperiments:this._trackedExperiments,trackedFeatureUsage:this._trackedFeatures}}_getGlobalContext(){return{features:this._options.features,experiments:this._options.experiments,log:this.log,enabled:this._options.enabled,qaMode:this._options.qaMode,savedGroups:this._options.savedGroups,groups:this._options.groups,overrides:this._options.overrides,onExperimentEval:this._onExperimentEval,recordChangeId:this._recordChangedId,saveDeferredTrack:this._saveDeferredTrack,eventLogger:this._options.eventLogger}}_runAutoExperiment(e,n){let r=this._activeAutoExperiments.get(e);if(e.manual&&!this._triggeredExpKeys.has(e.key)&&!r)return null;let i=this._isAutoExperimentBlockedByContext(e),o,s;i?o=Se(this._getEvalContext(),e,-1,!1,""):({result:o,trackingCall:s}=cc(e,null,this._getEvalContext()),this._onExperimentEval(e,o));let a=JSON.stringify(o.value);if(!n&&o.inExperiment&&r&&r.valueHash===a)return o;if(r&&this._undoActiveAutoExperiment(e),o.inExperiment){let l=Zl(e);if(l==="redirect"&&o.value.urlRedirect&&e.urlPatterns){let c=e.persistQueryString?C_(this._getContextUrl(),o.value.urlRedirect):o.value.urlRedirect;if(Gl(c,e.urlPatterns))return this.log("Skipping redirect because original URL matches redirect URL",{id:e.key}),o;this._redirectedUrl=c;let{navigate:u,delay:f}=this._getNavigateFunction();if(u)if(xo)Promise.all([...s?[Yl(s,this._options.maxNavigateDelay??1e3)]:[],new Promise(h=>window.setTimeout(h,this._options.navigateDelay??f))]).then(()=>{try{u(c)}catch(h){console.error(h)}});else try{u(c)}catch(h){console.error(h)}}else if(l==="visual"){let c=this._options.applyDomChangesCallback?this._options.applyDomChangesCallback(o.value):this._applyDOMChanges(o.value);c&&this._activeAutoExperiments.set(e,{undo:c,valueHash:a})}}return o}_undoActiveAutoExperiment(e){let n=this._activeAutoExperiments.get(e);n&&(n.undo(),this._activeAutoExperiments.delete(e))}_updateAllAutoExperiments(e){if(!this._autoExperimentsAllowed)return;let n=this._options.experiments||[],r=new Set(n);this._activeAutoExperiments.forEach((i,o)=>{r.has(o)||(i.undo(),this._activeAutoExperiments.delete(o))});for(let i of n){let o=this._runAutoExperiment(i,e);if(o&&o.inExperiment&&Zl(i)==="redirect")break}}_onExperimentEval(e,n){let r=this._assigned.get(e.key);this._assigned.set(e.key,{experiment:e,result:n}),this._subscriptions.size>0&&this._fireSubscriptions(e,n,r)}_fireSubscriptions(e,n,r){(!r||r.result.inExperiment!==n.inExperiment||r.result.variationId!==n.variationId)&&this._subscriptions.forEach(i=>{try{i(e,n)}catch(o){console.error(o)}})}_recordChangedId(e){this._completedChangeIds.add(e)}isOn(e){return this.evalFeature(e).on}isOff(e){return this.evalFeature(e).off}getFeatureValue(e,n){let r=this.evalFeature(e).value;return r===null?n:r}feature(e){return this.evalFeature(e)}evalFeature(e){return lc(e,this._getEvalContext())}log(e,n){this.debug&&(this._options.log?this._options.log(e,n):console.log(e,n))}getDeferredTrackingCalls(){return Array.from(this._deferredTrackingCalls.values())}setDeferredTrackingCalls(e){this._deferredTrackingCalls=new Map(e.filter(n=>n&&n.experiment&&n.result).map(n=>[uc(n.experiment,n.result),n]))}async fireDeferredTrackingCalls(){if(!this._options.trackingCallback)return;let e=[];this._deferredTrackingCalls.forEach(n=>{!n||!n.experiment||!n.result?console.error("Invalid deferred tracking call",{call:n}):e.push(this._options.trackingCallback(n.experiment,n.result))}),this._deferredTrackingCalls.clear(),await Promise.all(e)}setTrackingCallback(e){this._options.trackingCallback=e,this.fireDeferredTrackingCalls()}setEventLogger(e){this._options.eventLogger=e}async logEvent(e,n){if(this._destroyed){console.error("Cannot log event to destroyed GrowthBook instance");return}if(this._options.enableDevMode&&this.logs.push({eventName:e,properties:n,timestamp:Date.now().toString(),logType:"event"}),this._options.eventLogger)try{await this._options.eventLogger(e,n||{},this._getUserContext())}catch(r){console.error(r)}else console.error("No event logger configured")}_saveDeferredTrack(e){this._deferredTrackingCalls.set(uc(e.experiment,e.result),e)}_getContextUrl(){return this._options.url||(xo?window.location.href:"")}_isAutoExperimentBlockedByContext(e){let n=Zl(e);if(n==="visual"){if(this._options.disableVisualExperiments||this._options.disableJsInjection&&e.variations.some(r=>r.js))return!0}else if(n==="redirect"){if(this._options.disableUrlRedirectExperiments)return!0;try{let r=new URL(this._getContextUrl());for(let i of e.variations){if(!i||!i.urlRedirect)continue;let o=new URL(i.urlRedirect);if(this._options.disableCrossOriginUrlRedirectExperiments&&(o.protocol!==r.protocol||o.host!==r.host))return!0}}catch(r){return this.log("Error parsing current or redirect URL",{id:e.key,error:r}),!0}}else return!0;return!!(e.changeId&&(this._options.blockedChangeIds||[]).includes(e.changeId))}getRedirectUrl(){return this._redirectedUrl}_getNavigateFunction(){return this._options.navigate?{navigate:this._options.navigate,delay:0}:xo?{navigate:e=>{window.location.replace(e)},delay:100}:{navigate:null,delay:0}}_applyDOMChanges(e){if(!xo)return;let n=[];if(e.css){let r=document.createElement("style");r.innerHTML=e.css,document.head.appendChild(r),n.push(()=>r.remove())}if(e.js){let r=document.createElement("script");r.innerHTML=e.js,this._options.jsInjectionNonce&&(r.nonce=this._options.jsInjectionNonce),document.head.appendChild(r),n.push(()=>r.remove())}return e.domMutations&&e.domMutations.forEach(r=>{n.push(j_.declarative(r).revert)}),()=>{n.forEach(r=>r())}}async refreshStickyBuckets(e){if(this._options.stickyBucketService){let n=this._getEvalContext(),r=await X_(n,this._options.stickyBucketService,e);this._options.stickyBucketAssignmentDocs=r}}generateStickyBucketAssignmentDocsSync(e,n){if(!("getAllAssignmentsSync"in e)){console.error("generating StickyBucketAssignmentDocs docs requires StickyBucketServiceSync");return}let r=this._getEvalContext(),i=Mp(r,n);return e.getAllAssignmentsSync(i)}inDevMode(){return!!this._options.enableDevMode}};var fA="https://experiment.syntrologie.com",Fp=class{constructor(e={}){j(this,"gb");if(e.client)this.gb=e.client;else{let n=e.onExperimentViewed?(r,i)=>{e.onExperimentViewed(r.key,i.variationId,typeof i.value=="string"?i.value:`variation_${i.variationId}`)}:void 0;this.gb=new Ys({...e,apiHost:e.apiHost??fA,enableDevMode:e.enableDevMode??!0,trackingCallback:n}),e.autoInit&&this.gb.init({streaming:!0})}}get _internal(){return this.gb}async refreshFeatures(){await this.gb.loadFeatures()}setAttributes(e){this.gb.setAttributes(e)}setForcedVariations(e){this.gb.setForcedVariations(e)}getFeatureValue(e,n){return this.gb.getFeatureValue(e,n)}shouldRenderRectangle(e){let n=e.experiment;if(!n||!n.featureKey)return!0;let r=this.gb.getFeatureValue(n.featureKey,null);if(r==null)return!1;if(typeof n.variationId=="number")return Number(r)===n.variationId;if(typeof n.variationValue<"u")return r===n.variationValue;if(n.predicate)try{return n.predicate(r)}catch{return!1}return!!r}};function dc(t={}){return new Fp(t)}var Ir=ee(Nt(),1);var Hp=!1;function p0(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function jp(t){if(p0()){Hp=!0;return}Hp=t??!1}function TA(){return p0()?!0:Hp}function F(t,e,n){TA()&&(n!==void 0?console.log(`[${t}]`,e,n):console.log(`[${t}]`,e))}function wt(t,e,n){n!==void 0?console.warn(`[${t}]`,e,n):console.warn(`[${t}]`,e)}function gc(t,e,n){n!==void 0?console.error(`[${t}]`,e,n):console.error(`[${t}]`,e)}var RA=t=>[...t].sort((e,n)=>(e.order??0)-(n.order??0));function Up({fetcher:t,pollIntervalMs:e=3e4,experiments:n,runtime:r}){let[i,o]=(0,Ir.useState)({tiles:[],actions:[],isLoading:!0}),s=(0,Ir.useCallback)(async()=>{try{o(c=>({...c,isLoading:!0,error:void 0}));let a=await t();F("SmartCanvas Config","Raw config response",a);let l=a.tiles||[];r&&a.routes&&r.setRoutes(a.routes),r?(l=await r.filterTiles(l),n&&(l=l.filter(c=>n.shouldRenderRectangle(c)))):n&&(l=l.filter(c=>n.shouldRenderRectangle(c))),F("SmartCanvas Config",`Tile count after filtering: ${l.length}`),o({tiles:RA(l),actions:a.actions||[],isLoading:!1,fetchedAt:a.fetchedAt,canvasTitle:a.canvasTitle,configVersion:a.configVersion,theme:a.theme,launcher:a.launcher,routes:a.routes})}catch(a){o(l=>({...l,isLoading:!1,error:a instanceof Error?a.message:"Unknown error"}))}},[n,t,r]);return(0,Ir.useEffect)(()=>{if(s(),!e)return;let a=setInterval(s,e);return()=>clearInterval(a)},[s,e]),(0,Ir.useMemo)(()=>i,[i])}var Gn=ee(Nt(),1);var Qs=ee(Nt(),1),ie=ee(ve(),1),FA={success:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M6 10l2.5 2.5L14 7",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),warning:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("path",{d:"M10 2L18 17H2L10 2Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),(0,ie.jsx)("path",{d:"M10 8v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]}),error:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M7 7l6 6M13 7l-6 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),info:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M10 9v5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"6",r:"0.75",fill:"currentColor"})]}),alert:()=>(0,ie.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,ie.jsx)("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"1.5"}),(0,ie.jsx)("path",{d:"M10 5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,ie.jsx)("circle",{cx:"10",cy:"14",r:"0.75",fill:"currentColor"})]})};function $A({onClick:t,color:e}){return(0,ie.jsx)("button",{onClick:n=>{n.stopPropagation(),t()},style:{position:"absolute",top:"8px",right:"8px",width:"20px",height:"20px",padding:0,border:"none",background:"rgba(255, 255, 255, 0.1)",borderRadius:"50%",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",color:e,opacity:.6,transition:"opacity 0.15s ease"},onMouseEnter:n=>{n.currentTarget.style.opacity="1"},onMouseLeave:n=>{n.currentTarget.style.opacity="0.6"},"aria-label":"Dismiss",children:(0,ie.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:(0,ie.jsx)("path",{d:"M1 1l8 8M9 1l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})}function DA(t){let e={success:{bg:"var(--sc-color-success-muted, rgba(52, 199, 89, 0.15))",border:"var(--sc-color-success, #34c759)",icon:"var(--sc-color-success, #34c759)",text:"var(--sc-color-text, #f5f5f7)"},warning:{bg:"var(--sc-color-warning-muted, rgba(255, 159, 10, 0.15))",border:"var(--sc-color-warning, #ff9f0a)",icon:"var(--sc-color-warning, #ff9f0a)",text:"var(--sc-color-text, #f5f5f7)"},error:{bg:"var(--sc-color-error-muted, rgba(255, 69, 58, 0.15))",border:"var(--sc-color-error, #ff453a)",icon:"var(--sc-color-error, #ff453a)",text:"var(--sc-color-text, #f5f5f7)"},info:{bg:"var(--sc-color-info-muted, rgba(10, 132, 255, 0.15))",border:"var(--sc-color-info, #0a84ff)",icon:"var(--sc-color-info, #0a84ff)",text:"var(--sc-color-text, #f5f5f7)"},alert:{bg:"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))",border:"var(--sc-color-primary, #6366f1)",icon:"var(--sc-color-primary, #6366f1)",text:"var(--sc-color-text, #f5f5f7)"}};return e[t]||e.info}function Wp({content:t,onDismiss:e,accentColor:n}){let[r,i]=(0,Qs.useState)(!1),[o,s]=(0,Qs.useState)(t.type==="warning"?t.countdown??null:null);(0,Qs.useEffect)(()=>{if(o===null||o<=0)return;let d=setInterval(()=>{s(p=>p!==null&&p>0?p-1:null)},1e3);return()=>clearInterval(d)},[o]);let a=()=>{i(!0),setTimeout(()=>e?.(),200)},l=DA(t.type),c=FA[t.type],u={position:"relative",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-md, 10px)",background:l.bg,borderLeft:`3px solid ${l.border}`,opacity:r?0:1,transform:r?"translateX(10px)":"translateX(0)",transition:"opacity 0.2s ease, transform 0.2s ease"},f={display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-sm, 0.5rem)"},h={color:l.icon,flexShrink:0,marginTop:"1px"},g={flex:1,minWidth:0,paddingRight:t.dismissible?"24px":0},v={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:l.text,margin:0,lineHeight:"var(--sc-line-height-tight, 1.25)"},_={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:"var(--sc-line-height-normal, 1.5)"},x={fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)",marginTop:"var(--sc-spacing-sm, 0.5rem)"};return(0,ie.jsxs)("div",{style:u,children:[(0,ie.jsxs)("div",{style:f,children:[(0,ie.jsx)("div",{style:h,children:(0,ie.jsx)(c,{})}),(0,ie.jsxs)("div",{style:g,children:[(0,ie.jsx)("h4",{style:v,children:t.title}),t.body&&(0,ie.jsx)("p",{style:_,children:t.body}),t.type==="error"&&t.errorCode&&(0,ie.jsxs)("p",{style:{..._,fontFamily:"var(--sc-font-family-mono, monospace)"},children:["Code: ",t.errorCode]}),t.type==="info"&&t.learnMoreUrl&&(0,ie.jsx)("a",{href:t.learnMoreUrl,target:"_blank",rel:"noopener noreferrer",style:{display:"inline-block",marginTop:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-sm, 0.8rem)",color:l.icon,textDecoration:"none"},onClick:d=>d.stopPropagation(),children:"Learn more \u2192"}),o!==null&&o>0&&(0,ie.jsxs)("p",{style:{..._,color:l.icon},children:["Action required in ",o,"s"]}),t.timestamp&&(0,ie.jsx)("p",{style:x,children:t.timestamp})]})]}),t.dismissible&&(0,ie.jsx)($A,{onClick:a,color:l.text})]})}var v0=ee(Nt(),1),Ce=ee(ve(),1);function BA({trend:t}){let e=t.direction==="up",n=t.direction==="down";return(0,Ce.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"2px 8px",borderRadius:"var(--sc-border-radius-full, 9999px)",background:e?"var(--sc-color-success-muted, rgba(52, 199, 89, 0.15))":n?"var(--sc-color-error-muted, rgba(255, 69, 58, 0.15))":"rgba(142, 142, 147, 0.15)",color:e?"var(--sc-color-success, #34c759)":n?"var(--sc-color-error, #ff453a)":"var(--sc-color-text-muted, #8e8e93)",fontSize:"var(--sc-font-size-xs, 0.7rem)",fontWeight:"var(--sc-font-weight-medium, 500)"},children:[(0,Ce.jsx)(()=>(0,Ce.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{transform:e?"rotate(0deg)":n?"rotate(180deg)":"rotate(90deg)"},children:(0,Ce.jsx)("path",{d:"M5 1v8M5 1L2 4M5 1l3 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),{}),t.value,t.timeframe&&(0,Ce.jsx)("span",{style:{color:"var(--sc-color-text-muted, #8e8e93)"},children:t.timeframe})]})}function VA({data:t,color:e}){let{path:n,width:r,height:i}=(0,v0.useMemo)(()=>{if(t.length<2)return{path:"",width:60,height:24};let l=Math.min(...t),u=Math.max(...t)-l||1;return{path:t.map((g,v)=>{let _=2+v/(t.length-1)*56,x=22-(g-l)/u*20;return{x:_,y:x}}).reduce((g,v,_)=>g+(_===0?`M ${v.x} ${v.y}`:` L ${v.x} ${v.y}`),""),width:60,height:24}},[t]);return n?(0,Ce.jsxs)("svg",{width:r,height:i,viewBox:`0 0 ${r} ${i}`,style:{overflow:"visible"},children:[(0,Ce.jsx)("path",{d:n,stroke:e,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),(0,Ce.jsx)("defs",{children:(0,Ce.jsxs)("linearGradient",{id:"sparkline-gradient",x1:"0",x2:"0",y1:"0",y2:"1",children:[(0,Ce.jsx)("stop",{offset:"0%",stopColor:e,stopOpacity:"0.3"}),(0,Ce.jsx)("stop",{offset:"100%",stopColor:e,stopOpacity:"0"})]})}),(0,Ce.jsx)("path",{d:`${n} L ${r-2} ${i} L 2 ${i} Z`,fill:"url(#sparkline-gradient)"})]}):null}function qp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"},i={display:"flex",alignItems:"baseline",gap:"var(--sc-spacing-xs, 0.25rem)"},o={fontSize:"var(--sc-font-size-xxl, 1.5rem)",fontWeight:"var(--sc-font-weight-bold, 700)",color:n,letterSpacing:"-0.02em",lineHeight:1},s={fontSize:"var(--sc-font-size-md, 0.9rem)",fontWeight:"var(--sc-font-weight-normal, 400)",color:"var(--sc-color-text-muted, #8e8e93)"},a={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",margin:0},l={display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"var(--sc-spacing-xs, 0.25rem)"};return(0,Ce.jsxs)("div",{style:r,children:[(0,Ce.jsxs)("div",{style:i,children:[t.prefix&&(0,Ce.jsx)("span",{style:s,children:t.prefix}),(0,Ce.jsx)("span",{style:o,children:t.value}),t.suffix&&(0,Ce.jsx)("span",{style:s,children:t.suffix})]}),(0,Ce.jsx)("p",{style:a,children:t.label}),(t.trend||t.sparkline)&&(0,Ce.jsxs)("div",{style:l,children:[t.trend&&(0,Ce.jsx)(BA,{trend:t.trend}),t.sparkline&&t.sparkline.length>1&&(0,Ce.jsx)(VA,{data:t.sparkline,color:n})]})]})}var xt=ee(ve(),1);function zA({item:t,accentColor:e,layout:n}){let r=t.highlight,i={display:"flex",flexDirection:n==="list"?"row":"column",alignItems:n==="list"?"center":"flex-start",gap:n==="list"?"var(--sc-spacing-md, 0.75rem)":"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-md, 0.75rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",background:r?"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))":"var(--sc-color-background-subtle, rgba(0, 0, 0, 0.2))",border:r?`1px solid ${e}`:"1px solid var(--sc-color-border-subtle, rgba(255, 255, 255, 0.06))",transition:"all 0.15s ease"},o={fontSize:"1.25rem",marginBottom:n==="list"?0:"var(--sc-spacing-xs, 0.25rem)"},s={fontSize:"var(--sc-font-size-sm, 0.8rem)",color:"var(--sc-color-text-secondary, #a1a1a6)",flex:n==="list"?1:void 0},a={fontSize:"var(--sc-font-size-lg, 1rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:r?e:"var(--sc-color-text, #f5f5f7)"};return(0,xt.jsxs)("div",{style:i,children:[t.icon&&(0,xt.jsx)("span",{style:o,children:t.icon}),(0,xt.jsx)("span",{style:s,children:t.label}),(0,xt.jsx)("span",{style:a,children:t.value})]})}function Kp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r=t.layout||"grid",i=t.columns||2,o=t.items;if(t.highlightBest&&!t.items.some(a=>a.highlight)){let a=t.items.map(c=>({...c,numericValue:typeof c.value=="number"?c.value:parseFloat(String(c.value))})),l=Math.max(...a.map(c=>c.numericValue||0));o=a.map(c=>({...c,highlight:c.numericValue===l}))}let s={display:r==="table"?"block":r==="list"?"flex":"grid",flexDirection:r==="list"?"column":void 0,gridTemplateColumns:r==="grid"?`repeat(${i}, 1fr)`:void 0,gap:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0"};return r==="table"?(0,xt.jsx)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"var(--sc-font-size-sm, 0.8rem)"},children:(0,xt.jsx)("tbody",{children:o.map((a,l)=>(0,xt.jsxs)("tr",{style:{borderBottom:l<o.length-1?"1px solid var(--sc-color-border-subtle, rgba(255, 255, 255, 0.06))":void 0},children:[(0,xt.jsxs)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",color:"var(--sc-color-text-secondary, #a1a1a6)",display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[a.icon&&(0,xt.jsx)("span",{children:a.icon}),a.label]}),(0,xt.jsx)("td",{style:{padding:"var(--sc-spacing-sm, 0.5rem) 0",textAlign:"right",fontWeight:"var(--sc-font-weight-semibold, 600)",color:a.highlight?n:"var(--sc-color-text, #f5f5f7)"},children:a.value})]},l))})}):(0,xt.jsx)("div",{style:s,children:o.map((a,l)=>(0,xt.jsx)(zA,{item:a,accentColor:n,layout:r},l))})}var vc=ee(Nt(),1),ae=ee(ve(),1);function HA({value:t,maxValue:e,onChange:n,color:r}){let[i,o]=(0,vc.useState)(null);return(0,ae.jsx)("div",{style:{display:"flex",gap:"4px"},children:Array.from({length:e},(s,a)=>{let l=a+1,c=(i??t??0)>=l;return(0,ae.jsx)("button",{onClick:()=>n(l),onMouseEnter:()=>o(l),onMouseLeave:()=>o(null),style:{width:"28px",height:"28px",padding:0,border:"none",background:"none",cursor:"pointer",color:c?r:"var(--sc-color-text-muted, #8e8e93)",transition:"color 0.15s ease, transform 0.1s ease",transform:i===l?"scale(1.15)":"scale(1)"},"aria-label":`Rate ${l} out of ${e}`,children:(0,ae.jsx)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:c?"currentColor":"none",children:(0,ae.jsx)("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})})},a)})})}function jA({value:t,onChange:e,color:n}){let r=i=>({width:"48px",height:"48px",padding:"8px",border:"none",borderRadius:"var(--sc-border-radius-md, 10px)",background:i?n:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",cursor:"pointer",color:i?"white":"var(--sc-color-text-muted, #8e8e93)",transition:"all 0.15s ease"});return(0,ae.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[(0,ae.jsx)("button",{onClick:()=>e(1),style:r(t===1),"aria-label":"Thumbs up",children:(0,ae.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:(0,ae.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===1?"currentColor":"none"})})}),(0,ae.jsx)("button",{onClick:()=>e(0),style:r(t===0),"aria-label":"Thumbs down",children:(0,ae.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",style:{transform:"rotate(180deg)"},children:(0,ae.jsx)("path",{d:"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3H14zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:t===0?"currentColor":"none"})})})]})}function UA({value:t,maxValue:e,onChange:n,color:r}){return(0,ae.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},children:[(0,ae.jsx)("div",{style:{display:"flex",gap:"4px",justifyContent:"center"},children:Array.from({length:e+1},(i,o)=>{let s=t===o;return(0,ae.jsx)("button",{onClick:()=>n(o),style:{width:"28px",height:"32px",padding:0,border:s?`2px solid ${r}`:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.12))",borderRadius:"var(--sc-border-radius-sm, 6px)",background:s?r:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",cursor:"pointer",color:s?"white":"var(--sc-color-text, #f5f5f7)",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-medium, 500)",transition:"all 0.15s ease"},"aria-label":`Rate ${o}`,children:o},o)})}),(0,ae.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",padding:"0 2px"},children:[(0,ae.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)"},children:"Not likely"}),(0,ae.jsx)("span",{style:{fontSize:"var(--sc-font-size-xs, 0.7rem)",color:"var(--sc-color-text-muted, #8e8e93)"},children:"Very likely"})]})]})}function WA({value:t,onChange:e,color:n}){return(0,ae.jsx)("div",{style:{display:"flex",gap:"8px",justifyContent:"center"},children:["\u{1F622}","\u{1F615}","\u{1F610}","\u{1F642}","\u{1F604}"].map((i,o)=>{let s=t===o;return(0,ae.jsx)("button",{onClick:()=>e(o),style:{width:"44px",height:"44px",padding:0,border:s?`2px solid ${n}`:"1px solid transparent",borderRadius:"var(--sc-border-radius-md, 10px)",background:s?"var(--sc-color-primary-muted, rgba(99, 102, 241, 0.15))":"transparent",cursor:"pointer",fontSize:"1.75rem",transition:"all 0.15s ease",transform:s?"scale(1.1)":"scale(1)"},"aria-label":`Rate ${o+1} out of 5`,children:i},o)})})}function Gp({content:t,onSubmit:e,accentColor:n}){let[r,i]=(0,vc.useState)(null),[o,s]=(0,vc.useState)(!1),a=n||"var(--sc-color-primary, #6366f1)",l=t.maxValue??(t.variant==="nps"?10:5),c=g=>{i(g)},u=()=>{r!==null&&(s(!0),e?.(r))},f={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-sm, 0.5rem) 0",alignItems:"center"},h={fontSize:"var(--sc-font-size-md, 0.9rem)",color:"var(--sc-color-text, #f5f5f7)",textAlign:"center",margin:0};return o?(0,ae.jsxs)("div",{style:{...f,padding:"var(--sc-spacing-lg, 1rem)"},children:[(0,ae.jsx)("span",{style:{fontSize:"2rem"},children:"\u2713"}),(0,ae.jsx)("p",{style:{...h,color:"var(--sc-color-success, #34c759)"},children:"Thanks for your feedback!"})]}):(0,ae.jsxs)("div",{style:f,children:[t.question&&(0,ae.jsx)("p",{style:h,children:t.question}),t.variant==="stars"&&(0,ae.jsx)(HA,{value:r,maxValue:l,onChange:c,color:a}),t.variant==="thumbs"&&(0,ae.jsx)(jA,{value:r,onChange:c,color:a}),t.variant==="nps"&&(0,ae.jsx)(UA,{value:r,maxValue:l,onChange:c,color:a}),t.variant==="emoji"&&(0,ae.jsx)(WA,{value:r,onChange:c,color:a}),r!==null&&t.submitActionId&&(0,ae.jsx)("button",{onClick:u,style:{marginTop:"var(--sc-spacing-sm, 0.5rem)",padding:"var(--sc-spacing-sm, 0.5rem) var(--sc-spacing-lg, 1rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"none",background:a,color:"white",fontSize:"var(--sc-font-size-sm, 0.8rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",cursor:"pointer",transition:"opacity 0.15s ease"},children:"Submit"})]})}var Xe=ee(ve(),1);function Zp({content:t,accentColor:e}){let n=e||"var(--sc-color-primary, #6366f1)",r=t.items.filter(x=>x.completed).length,i=t.items.length,o={display:"flex",flexDirection:"column",gap:"var(--sc-spacing-sm, 0.5rem)"},s={display:"flex",alignItems:"center",gap:"var(--sc-spacing-sm, 0.5rem)",marginBottom:"var(--sc-spacing-sm, 0.5rem)",fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #8e8e93)"},a={flex:1,height:"4px",background:"var(--sc-color-surface, rgba(58, 58, 60, 0.8))",borderRadius:"2px",overflow:"hidden"},l={height:"100%",width:`${i>0?r/i*100:0}%`,background:n,borderRadius:"2px",transition:"width 0.3s ease"},c=x=>({display:"flex",alignItems:"flex-start",gap:"var(--sc-spacing-md, 0.75rem)",padding:"var(--sc-spacing-md, 0.75rem)",background:"var(--sc-color-surface, rgba(58, 58, 60, 0.5))",borderRadius:"var(--sc-border-radius-md, 10px)",border:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.08))",opacity:x?.6:1,transition:"all 0.15s ease"}),u=x=>({width:"20px",height:"20px",borderRadius:"50%",border:x?"none":"2px solid var(--sc-color-border, rgba(255, 255, 255, 0.2))",background:x?"#34c759":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,marginTop:"2px"}),f={flex:1,minWidth:0},h=x=>({fontSize:"var(--sc-font-size-sm, 0.85rem)",fontWeight:"var(--sc-font-weight-semibold, 600)",color:"var(--sc-color-text, #f5f5f7)",margin:0,textDecoration:x?"line-through":"none"}),g={fontSize:"var(--sc-font-size-xs, 0.75rem)",color:"var(--sc-color-text-muted, #8e8e93)",margin:"var(--sc-spacing-xs, 0.25rem) 0 0",lineHeight:1.4},v={display:"inline-flex",alignItems:"center",gap:"var(--sc-spacing-xs, 0.25rem)",padding:"var(--sc-spacing-xs, 0.25rem) var(--sc-spacing-sm, 0.5rem)",borderRadius:"var(--sc-border-radius-sm, 6px)",border:"1px solid var(--sc-color-border, rgba(255, 255, 255, 0.15))",background:"transparent",color:"var(--sc-color-text, #f5f5f7)",fontSize:"var(--sc-font-size-xs, 0.75rem)",fontWeight:"var(--sc-font-weight-medium, 500)",cursor:"pointer",textDecoration:"none",transition:"all 0.15s ease",flexShrink:0},_=x=>{x&&typeof window<"u"&&(window.location.href=x)};return(0,Xe.jsxs)("div",{style:o,children:[t.showProgress!==!1&&i>0&&(0,Xe.jsxs)("div",{style:s,children:[(0,Xe.jsxs)("span",{children:[r," of ",i]}),(0,Xe.jsx)("div",{style:a,children:(0,Xe.jsx)("div",{style:l})})]}),t.items.map(x=>(0,Xe.jsxs)("div",{style:c(x.completed??!1),children:[(0,Xe.jsx)("div",{style:u(x.completed??!1),children:x.completed&&(0,Xe.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,Xe.jsx)("path",{d:"M20 6L9 17l-5-5",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,Xe.jsxs)("div",{style:f,children:[(0,Xe.jsx)("p",{style:h(x.completed??!1),children:x.title}),x.description&&(0,Xe.jsx)("p",{style:g,children:x.description})]}),x.href&&!x.completed&&(0,Xe.jsxs)("button",{style:v,onClick:d=>{d.stopPropagation(),_(x.href)},onMouseEnter:d=>{d.currentTarget.style.background="var(--sc-color-surface, rgba(58, 58, 60, 0.8))"},onMouseLeave:d=>{d.currentTarget.style.background="transparent"},children:[x.linkLabel||"Go",(0,Xe.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:(0,Xe.jsx)("path",{d:"M5 12h14M12 5l7 7-7 7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]},x.id))]})}var bo=ee(ve(),1);function qA(t){return["alert","success","warning","info","error"].includes(t.type)}function KA(t){return t.type==="stats"}function GA(t){return t.type==="comparison"}function ZA(t){return t.type==="rating"}function YA(t){return t.type==="checklist"}function y0(t,e={}){return qA(t)?(0,bo.jsx)(Wp,{content:t,accentColor:e.accentColor,onDismiss:e.onDismiss}):KA(t)?(0,bo.jsx)(qp,{content:t,accentColor:e.accentColor}):GA(t)?(0,bo.jsx)(Kp,{content:t,accentColor:e.accentColor}):ZA(t)?(0,bo.jsx)(Gp,{content:t,accentColor:e.accentColor,onSubmit:e.onRatingSubmit}):YA(t)?(0,bo.jsx)(Zp,{content:t,accentColor:e.accentColor}):null}function _0(t){return["alert","success","warning","info","error","stats","comparison","chart","table","form","rating","progress","survey","checklist","video","gallery","code"].includes(t)}var St=ee(Nt(),1),E0=ee(ve(),1),Yp=(0,St.createContext)({runtime:null,context:null});function yc({runtime:t,children:e}){let[n,r]=(0,St.useState)(t?t.context.get():null);(0,St.useEffect)(()=>t?(r(t.context.get()),t.context.subscribe(s=>{r(s)})):void 0,[t]);let i=(0,St.useMemo)(()=>({runtime:t,context:n}),[t,n]);return(0,E0.jsx)(Yp.Provider,{value:i,children:e})}function bn(){let{runtime:t}=(0,St.useContext)(Yp);return t}function Js(){let{context:t}=(0,St.useContext)(Yp);return t}function _c(){return Js()?.page??null}function w0(){return Js()?.session??null}function x0(){return Js()?.viewport??null}function S0(t,e,n=[]){let r=bn();(0,St.useEffect)(()=>r?t?r.events.subscribe(t,e):r.events.subscribe(e):void 0,[r,...n])}function b0(){return bn()?.state??null}function k0(t,e){let n=bn(),[r,i]=(0,St.useState)({value:e,isFallback:!0,isLoading:!0});return(0,St.useEffect)(()=>{if(!n||!t){i({value:e,isFallback:!0,isLoading:!1});return}let o=!1;return n.evaluate(t).then(s=>{o||i({value:s.value,isFallback:s.isFallback,isLoading:!1})}),()=>{o=!0}},[n,t,e]),r}var be={UI_CLICK:"ui.click",UI_SCROLL:"ui.scroll",UI_INPUT:"ui.input",UI_CHANGE:"ui.change",UI_SUBMIT:"ui.submit",NAV_PAGE_VIEW:"nav.page_view",NAV_PAGE_LEAVE:"nav.page_leave",CANVAS_OPENED:"canvas.opened",CANVAS_CLOSED:"canvas.closed",TILE_VIEWED:"tile.viewed",TILE_EXPANDED:"tile.expanded",TILE_COLLAPSED:"tile.collapsed",TILE_ACTION:"tile.action",OVERLAY_STARTED:"overlay.started",OVERLAY_COMPLETED:"overlay.completed",OVERLAY_DISMISSED:"overlay.dismissed",OVERLAY_STEP_VIEWED:"overlay.step_viewed",BEHAVIOR_RAGE_CLICK:"behavior.rage_click",BEHAVIOR_HESITATION:"behavior.hesitation",BEHAVIOR_CONFUSION:"behavior.confusion",ACTION_APPLIED:"action.applied",ACTION_REVERTED:"action.reverted",ACTION_FAILED:"action.failed",ACTION_CTA_CLICKED:"action.cta_clicked",SURFACE_MOUNTED:"surface.mounted",SURFACE_UNMOUNTED:"surface.unmounted"},vi="1.0.0";function rn(t,e){return{ts:Date.now(),name:t,source:"canvas",props:e,schemaVersion:vi}}function XA(t){return rn(be.CANVAS_OPENED,{surface:t})}function QA(t){return rn(be.CANVAS_CLOSED,{surface:t})}function JA(t,e){return rn(be.TILE_VIEWED,{tileId:t,surface:e})}function eT(t,e){return rn(be.TILE_EXPANDED,{tileId:t,surface:e})}function tT(t,e){return rn(be.TILE_COLLAPSED,{tileId:t,surface:e})}function nT(t,e,n){return rn(be.TILE_ACTION,{tileId:t,actionId:e,surface:n})}function rT(t,e){return rn(be.OVERLAY_STARTED,{recipeId:t,recipeName:e})}function iT(t,e){return rn(be.OVERLAY_COMPLETED,{recipeId:t,recipeName:e})}function oT(t,e,n){return rn(be.OVERLAY_DISMISSED,{recipeId:t,recipeName:e,stepIndex:n})}function sT(t,e,n){return rn(be.OVERLAY_STEP_VIEWED,{recipeId:t,stepIndex:e,stepTitle:n})}function aT(t,e){let n=t.startsWith("canvas.")?t:`canvas.${t}`;return rn(n,e)}var on={canvasOpened:XA,canvasClosed:QA,tileViewed:JA,tileExpanded:eT,tileCollapsed:tT,tileAction:nT,overlayStarted:rT,overlayCompleted:iT,overlayDismissed:oT,overlayStepViewed:sT,custom:aT};var oe=ee(ve(),1);function lT({config:t,telemetry:e,surface:n}){let[r,i]=(0,Gn.useState)([{author:"Lumi",text:"Hi! Need clarity on a deduction?"}]),[o,s]=(0,Gn.useState)(""),a=bn(),l=c=>{if(c.preventDefault(),!!o.trim()){if(i(u=>[...u,{author:"You",text:o.trim()}]),setTimeout(()=>{i(u=>[...u,{author:"Lumi",text:"I will route that to the experimentation server stub for now."}])},600),e?.trackAction("chatbot_message",t.id,n),a){let u=on.tileAction(t.id,"chatbot_message",n);a.events.publish(u.name,u.props,u.source)}s("")}};return(0,oe.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",height:"100%"},children:[(0,oe.jsx)("div",{style:{flex:1,overflowY:"auto",padding:"0.75rem",background:"rgba(0, 0, 0, 0.2)",borderRadius:"8px",fontSize:"0.85rem"},children:r.map((c,u)=>(0,oe.jsxs)("p",{style:{margin:"0 0 0.5rem"},children:[(0,oe.jsxs)("span",{style:{fontWeight:600,color:"#94a3b8"},children:[c.author,":"]})," ",(0,oe.jsx)("span",{style:{color:"#e2e8f0"},children:c.text})]},`${c.author}-${u}`))}),(0,oe.jsxs)("form",{onSubmit:l,style:{display:"flex",gap:"0.5rem"},children:[(0,oe.jsx)("input",{style:{flex:1,padding:"0.5rem 0.75rem",borderRadius:"6px",border:"1px solid rgba(255, 255, 255, 0.1)",background:"rgba(0, 0, 0, 0.3)",color:"#f1f5f9",fontSize:"0.85rem",outline:"none"},value:o,onChange:c=>s(c.target.value),placeholder:"Ask anything..."}),(0,oe.jsx)("button",{style:{padding:"0.5rem 0.75rem",borderRadius:"6px",border:"none",background:"#6366f1",color:"white",fontWeight:600,fontSize:"0.8rem",cursor:"pointer"},type:"submit",children:"Send"})]})]})}function cT({renderer:t,config:e,surface:n,telemetry:r,isExpanded:i,runtime:o}){let s=(0,Gn.useRef)(null);return(0,Gn.useEffect)(()=>{if(!s.current)return;let a=t.mount(s.current,{config:e,surface:n,telemetry:r,isExpanded:i,runtime:o});return()=>{a&&a()}},[t,e,n,r,i,o]),(0,oe.jsx)("div",{ref:s,style:{width:"100%",height:"100%"}})}function ko({config:t,surface:e,telemetry:n,style:r,customRenderers:i,isExpanded:o=!1,onToggleExpand:s}){let{title:a,subtitle:l,content:c,style:u}=t,f=bn(),h=(0,Gn.useCallback)(w=>{if(n?.trackAction(w,t.id,e),f){let b=on.tileAction(t.id,w,e);f.events.publish(b.name,b.props,b.source)}},[n,f,t.id,e]),g=u?.accentColor??"#6366f1",v="72px",_={display:"flex",flexDirection:"column",borderRadius:"14px",background:u?.background??"rgba(28, 28, 30, 0.95)",border:"1px solid rgba(255, 255, 255, 0.08)",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.3)",color:u?.textColor??"#f5f5f7",fontFamily:"-apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif",overflow:"hidden",cursor:s?"pointer":"default",transition:"all 0.25s ease",...r},x={display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.875rem 1rem",minHeight:v},d={width:"40px",height:"40px",borderRadius:"10px",background:`linear-gradient(135deg, ${g} 0%, ${g}cc 100%)`,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.25rem",flexShrink:0,boxShadow:`0 2px 8px ${g}40`},p=()=>{switch(c.type){case"chatbot":return"\u{1F4AC}";case"metric":return"\u{1F4CA}";case"embed":return"\u{1F517}";case"custom":return"\u2699\uFE0F";case"checklist":return"\u{1F4CB}";default:return"\u{1F4C4}"}},m=()=>{switch(c.type){case"metric":return`${c.metricValue}${c.metricUnit?` ${c.metricUnit}`:""}`;case"text":return c.headline||c.body?.slice(0,50)||"";case"chatbot":return"Tap to chat";case"embed":return"Tap to view";case"custom":return"Tap to expand";case"checklist":{let w=c.items||[];return`${w.filter(k=>k.completed).length} of ${w.length} complete`}default:return""}},y=()=>{if(_0(c.type)){let w=y0(c,{accentColor:g,onDismiss:()=>{h("block_dismissed")},onRatingSubmit:b=>{h("rating_submitted")}});if(w)return w}switch(c.type){case"chatbot":return(0,oe.jsx)("div",{style:{height:"200px"},children:(0,oe.jsx)(lT,{config:t,surface:e,telemetry:n})});case"metric":return(0,oe.jsxs)("div",{style:{textAlign:"center",padding:"0.5rem 0"},children:[(0,oe.jsxs)("p",{style:{fontSize:"3rem",fontWeight:700,color:g,margin:0,letterSpacing:"-0.02em"},children:[c.metricValue,c.metricUnit&&(0,oe.jsx)("span",{style:{fontSize:"1.25rem",fontWeight:400,color:"#8e8e93",marginLeft:"0.5rem"},children:c.metricUnit})]}),c.headline&&(0,oe.jsx)("p",{style:{fontSize:"0.85rem",color:"#8e8e93",margin:"0.5rem 0 0"},children:c.headline})]});case"embed":return c.embedUrl?(0,oe.jsx)("iframe",{src:c.embedUrl,sandbox:"allow-scripts allow-same-origin",referrerPolicy:"no-referrer",style:{width:"100%",height:"200px",borderRadius:"8px",border:"1px solid rgba(255, 255, 255, 0.1)",background:"rgba(0, 0, 0, 0.2)"},title:c.headline??t.title}):null;case"custom":{let w=c.component||c.customRendererKey;return!w||!i||!i[w]?(0,oe.jsxs)("div",{style:{color:"#ff6b6b",fontSize:"0.85rem",padding:"0.5rem 0"},children:["Unknown component: ",w]}):(0,oe.jsx)(cT,{renderer:i[w],config:t,surface:e,telemetry:n,isExpanded:o,runtime:f})}case"text":default:{let w=c;return(0,oe.jsxs)("div",{style:{padding:"0.25rem 0"},children:[w.headline&&(0,oe.jsx)("p",{style:{fontSize:"1rem",fontWeight:600,color:"#f5f5f7",margin:"0 0 0.5rem"},children:w.headline}),w.body&&(0,oe.jsx)("p",{style:{fontSize:"0.9rem",color:"#8e8e93",margin:0,lineHeight:1.5},children:w.body})]})}}};return(0,oe.jsxs)("article",{"data-shadow-canvas-id":`tile-${t.id}`,style:_,onClick:w=>{o&&w.target.closest("[data-expanded-content]")||s?.()},children:[(0,oe.jsxs)("div",{style:x,children:[(0,oe.jsx)("div",{style:d,children:p()}),(0,oe.jsxs)("div",{style:{flex:1,minWidth:0},children:[l&&(0,oe.jsx)("p",{style:{fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.05em",color:"#8e8e93",margin:0},children:l}),(0,oe.jsx)("h3",{style:{fontSize:"0.95rem",fontWeight:600,color:"#f5f5f7",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a}),!o&&(0,oe.jsx)("p",{style:{fontSize:"0.8rem",color:"#8e8e93",margin:"0.125rem 0 0",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m()})]}),(0,oe.jsx)("div",{style:{color:"#8e8e93",fontSize:"0.85rem",transform:o?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease"},children:"\u25BC"})]}),o&&(0,oe.jsxs)("div",{"data-expanded-content":!0,style:{padding:"0 1rem 1rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)"},onClick:w=>w.stopPropagation(),children:[(0,oe.jsx)("div",{style:{paddingTop:"0.875rem"},children:y()}),"actions"in c&&c.actions&&c.actions.length>0&&(0,oe.jsx)("div",{style:{marginTop:"1rem",paddingTop:"0.75rem",borderTop:"1px solid rgba(255, 255, 255, 0.06)",display:"flex",gap:"0.5rem"},children:c.actions.map((w,b)=>(0,oe.jsx)("button",{onClick:k=>{if(k.stopPropagation(),w.href&&typeof window<"u"&&window.open(w.href,"_blank","noreferrer"),w.onClickId&&(h(w.onClickId),w.onClickId.startsWith("syntro:restart-tour:")||w.onClickId.startsWith("syntro:start-tour:"))){let E=w.onClickId.replace("syntro:restart-tour:","").replace("syntro:start-tour:","");try{localStorage.removeItem("syntro_active_tour"),localStorage.setItem("syntro_active_tour",JSON.stringify({tourId:E,currentStepId:"",startedAt:Date.now()})),console.log(`[SmartCanvas] Starting tour "${E}"...`),window.location.reload()}catch(I){console.warn("[SmartCanvas] Failed to start tour:",I)}}},style:{flex:1,padding:"0.625rem 1rem",borderRadius:"8px",fontSize:"0.85rem",fontWeight:600,cursor:"pointer",border:"none",background:b===0?g:"rgba(255, 255, 255, 0.1)",color:"#fff",transition:"opacity 0.15s ease"},onMouseEnter:k=>{k.currentTarget.style.opacity="0.85"},onMouseLeave:k=>{k.currentTarget.style.opacity="1"},children:w.label},w.label))})]})]})}var or=ee(Nt(),1),um=ee(Bu(),1);var we=ee(ve(),1),US="syntro-launcher-styles";function fI(){if(typeof document>"u"||document.getElementById(US))return;let t=document.createElement("style");t.id=US,t.textContent=`
|
|
12
12
|
@keyframes syntro-launcher-pulse {
|
|
13
13
|
0%, 100% {
|
|
14
14
|
box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35), 0 0 0 0 rgba(99, 102, 241, 0.4);
|
|
@@ -31,7 +31,7 @@ Error generating stack: `+o.message+`
|
|
|
31
31
|
.syntro-launcher-animate:hover {
|
|
32
32
|
animation: none;
|
|
33
33
|
}
|
|
34
|
-
`,document.head.appendChild(t)}var hP={position:"right",baseWidth:"clamp(320px, 16.666vw, 420px)",expandedWidth:"40vw",zIndex:2147483600,backdropBlur:"18px",mode:"dark",colorPrimary:"#6366f1",colorBackground:"#1c1c1e",colorText:"#f5f5f7",colorTextSecondary:"#a1a1a6",borderRadius:"12px"};function dm({isOpen:t,onToggle:e,telemetry:n,launcherLabel:r="Adaptives",launcherAnimate:i=!1,launcherAnimationStyle:o="pulse",footerSlot:s,tiles:a,isLoading:l,error:c,canvasTitle:u,displayMode:f="standard",theme:h,customRenderers:g}){let[v,_]=(0,sr.useState)(!1),[x,d]=(0,sr.useState)(null),p=kn(),m={...hP,...h},y=(0,sr.useCallback)(B=>{let X=x===B;if(d(X?null:B),p){let D=X?on.tileCollapsed(B,"overlay"):on.tileExpanded(B,"overlay");p.events.publish(D.name,D.props,D.source)}},[x,p]);(0,sr.useEffect)(()=>{t&&a.forEach(B=>{if(n?.trackRectangleViewed(B.id,"overlay"),p){let X=on.tileViewed(B.id,"overlay");p.events.publish(X.name,X.props,X.source)}})},[n,p,t,a]),(0,sr.useEffect)(()=>{_(!0),pP()},[]);let w=(0,sr.useCallback)(()=>{let B=!t;if(B?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),p){let X=B?on.canvasOpened("overlay"):on.canvasClosed("overlay");p.events.publish(X.name,X.props,X.source)}e()},[t,n,p,e]),k=f==="focused",b=m.position==="right",E=m.colorBackground||"#1c1c1e",P=m.mode==="light",A=m.colorPrimary||"#6366f1",H=k?`linear-gradient(to top right, ${A}22 0%, ${E}fa 50%, ${E}fc 100%)`:`linear-gradient(to top right, ${A}33 0%, ${E}f2 45%, ${E}f7 100%)`,K=k?`linear-gradient(to top right, ${A}11 0%, ${E}fa 50%, ${E}fc 100%)`:`linear-gradient(to top right, ${A}15 0%, ${E}f2 45%, ${E}f7 100%)`,Y={display:"flex",flexDirection:"column",width:k?m.expandedWidth:m.baseWidth,minWidth:"320px",height:"100%",maxHeight:"100%",background:P?K:H,backdropFilter:`blur(${m.backdropBlur})`,WebkitBackdropFilter:`blur(${m.backdropBlur})`,pointerEvents:"auto",opacity:t?1:.8,transition:"all 340ms cubic-bezier(0.16, 1, 0.3, 1)",color:m.colorText||"#f5f5f7",border:k?b?void 0:`1px solid ${P?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.06)"}`:`1px solid ${A}66`,borderLeft:k&&b?`1px solid ${P?"rgba(0, 0, 0, 0.08)":"rgba(255, 255, 255, 0.08)"}`:void 0,borderRight:k&&!b?`1px solid ${P?"rgba(0, 0, 0, 0.08)":"rgba(255, 255, 255, 0.08)"}`:void 0,borderRadius:k?"0":m.borderRadius||"24px",boxShadow:k?"none":`0 25px 80px rgba(0, 0, 0, ${P?"0.3":"0.7"}), inset 0 0 80px ${A}15`,transform:t?"translateX(0)":b?"translateX(120%)":"translateX(-120%)"},W={position:"absolute",inset:0,display:"flex",flexDirection:b?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:k?"0":"1rem"},le=(0,ve.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:m.zIndex},children:(0,ve.jsxs)("div",{style:W,children:[(0,ve.jsxs)("div",{style:Y,children:[!k&&(0,ve.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,ve.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"rgba(255, 255, 255, 0.6)"},children:u??"Smart Canvas"})}),(0,ve.jsx)("div",{style:{flex:1,overflowY:"auto",padding:k?"0":"1.5rem"},children:l?(0,ve.jsx)("div",{style:{color:"rgba(255, 255, 255, 0.85)",padding:k?"1rem":"0"},children:"Loading..."}):c?(0,ve.jsxs)("div",{style:{color:"#fecdd3",padding:k?"1rem":"0"},children:["Failed to load: ",c]}):k?a.length>0?(0,ve.jsx)(Co,{config:a[0],surface:"overlay",telemetry:n,customRenderers:g,isExpanded:!0,onToggleExpand:()=>{},style:{width:"100%",height:"100%"}}):null:(0,ve.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:"0.625rem",width:"100%"},children:a.map(B=>{let X=B.size==="half",D=x===B.id;return(0,ve.jsx)("div",{style:{gridColumn:X&&!D?"span 1":"span 2",transition:"all 0.25s ease"},children:(0,ve.jsx)(Co,{config:B,surface:"overlay",telemetry:n,customRenderers:g,isExpanded:D,onToggleExpand:()=>y(B.id),style:{width:"100%"}})},B.id)})})}),s]}),(0,ve.jsx)("div",{onClick:w,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return v?(0,ve.jsxs)(ve.Fragment,{children:[(0,um.createPortal)((0,ve.jsx)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:m.zIndex+47},children:(0,ve.jsxs)("button",{onClick:w,"aria-label":"Toggle shadow canvas",className:i&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",bottom:"2.5rem",right:b?"2.5rem":void 0,left:b?void 0:"2.5rem",pointerEvents:"auto",display:"flex",alignItems:"center",gap:"0.75rem",borderRadius:"18px",color:"white",boxShadow:"0 20px 45px rgba(15, 23, 42, 0.35)",transition:"transform 0.2s ease",outline:"none",padding:"0.65rem 1.25rem",border:"2px solid rgba(255, 255, 255, 0.25)",backgroundColor:"rgba(2, 6, 23, 0.8)",backdropFilter:"blur(12px)",cursor:"pointer"},onMouseEnter:B=>B.currentTarget.style.transform="translateY(-2px)",onMouseLeave:B=>B.currentTarget.style.transform="translateY(0)",children:[(0,ve.jsx)("div",{style:{width:"36px",height:"36px",borderRadius:"12px",background:t?"linear-gradient(135deg, #f472b6, #ec4899)":"linear-gradient(135deg, #94a3b8, #0f172a)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,ve.jsx)("span",{style:{width:"14px",height:"2px",backgroundColor:"#fff",display:"block",transform:t?"rotate(45deg)":"rotate(0)",position:"relative",transition:"transform 200ms ease"},children:t?null:(0,ve.jsx)("span",{style:{position:"absolute",top:0,left:0,width:"14px",height:"2px",backgroundColor:"#fff",transform:"rotate(90deg)"}})})}),(0,ve.jsxs)("div",{style:{display:"flex",flexDirection:"column",textAlign:"left"},children:[(0,ve.jsx)("span",{style:{fontSize:"0.55rem",letterSpacing:"0.35em",color:"rgba(255,255,255,0.7)"},children:t?"Hide":"Open"}),(0,ve.jsx)("span",{style:{fontSize:"0.85rem",letterSpacing:"0.25em"},children:r})]})]})}),document.body),t?(0,um.createPortal)(le,document.body):null]}):null}var ei=ee(wt(),1);var Jr=ee(ye(),1);function gP({tiles:t,intervalMs:e=7e3,telemetry:n}){let[r,i]=(0,ei.useState)(0),o=(0,ei.useMemo)(()=>[...t].filter(s=>s.size!=="half").sort((s,a)=>(s.order??0)-(a.order??0)),[t]);return(0,ei.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,ei.useEffect)(()=>{if(o.length<=1)return;let s=setInterval(()=>{i(a=>(a+1)%o.length)},e);return()=>clearInterval(s)},[o,e]),(0,ei.useEffect)(()=>{let s=o[r];s&&n?.trackRectangleViewed(s.id,"wheel")},[r,o,n]),o.length?(0,Jr.jsxs)("div",{className:"relative overflow-hidden rounded-3xl border border-slate-200 bg-gradient-to-br from-white to-slate-50 p-6 shadow-2xl","data-shadow-canvas-id":"wheel",children:[(0,Jr.jsx)("div",{className:"flex transition-transform duration-700 ease-out",style:{transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(s=>(0,Jr.jsx)("div",{className:"w-full shrink-0 px-4",children:(0,Jr.jsx)(Co,{config:{...s,size:"half"},surface:"wheel",telemetry:n})},s.id))}),(0,Jr.jsx)("div",{className:"mt-4 flex justify-center gap-2",children:o.map((s,a)=>(0,Jr.jsx)("button",{className:`h-2 w-6 rounded-full ${a===r?"bg-slate-800":"bg-slate-300"}`,onClick:()=>i(a)},s.id))})]}):null}var Bu=class{constructor(e){j(this,"state");j(this,"listeners",new Set);this.state={open:e?.open??!1}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){this.state.open!==e&&(this.state={...this.state,open:e},this.emit())}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},fm=t=>new Bu(t);var hn=ee(wt(),1);var mP=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function vP(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):mP.some(i=>e.hostname===i)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function yP(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var Vu=({configUri:t,experiments:e,featureKey:n="smart-canvas-config-uri"})=>{if(t)return t;let r=e?.getFeatureValue?.(n,null);if(r)return r},Mi=({configUri:t,experiments:e,featureKey:n,credentials:r,configFeatureKey:i="smart-canvas-config"})=>async()=>{if(e&&i){let l=e.getFeatureValue?.(i,null);if(l&&typeof l=="object")return l}let o=Vu({configUri:t,experiments:e,featureKey:n});if(!o)return{tiles:[],overlays:[]};if(!vP(o))throw new Error(`SmartCanvas: config URI not allowed: ${o}`);let s=r??(yP(o)?"include":"omit"),a=await fetch(o,{credentials:s});if(!a.ok)throw new Error(`SmartCanvas: failed to fetch config (${a.status})`);return await a.json()};var qa=ee(ye(),1);function _P(t,e){return t?t.include?.length?t.include.some(n=>US(n,e)):t.exclude?.length?!t.exclude.some(n=>US(n,e)):!0:!0}function US(t,e){if(t.endsWith("/*")){let n=t.slice(0,-2);return e===n||e.startsWith(n+"/")}return e===t}function pm({controller:t,fetcher:e,configUri:n,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:i="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:s,experiments:a,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p}){return c?(0,qa.jsx)(vc,{runtime:c,children:(0,qa.jsx)(WS,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:r,configFeatureKey:i,fetchCredentials:o,pollIntervalMs:s,experiments:a,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p})}):(0,qa.jsx)(WS,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:r,configFeatureKey:i,fetchCredentials:o,pollIntervalMs:s,experiments:a,telemetry:l,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p})}function WS({controller:t,fetcher:e,configUri:n,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:i="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:s,experiments:a,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p}){let[m,y]=(0,hn.useState)(t.getState().open),w=yc(),[k,b]=(0,hn.useState)(()=>typeof window<"u"?window.location.pathname:"/"),E=w?.url?new URL(w.url).pathname:k;(0,hn.useEffect)(()=>{if(c||typeof window>"u")return;let W=()=>b(window.location.pathname);window.addEventListener("popstate",W);let le=history.pushState,B=history.replaceState;return history.pushState=function(...X){le.apply(this,X),W()},history.replaceState=function(...X){B.apply(this,X),W()},()=>{window.removeEventListener("popstate",W),history.pushState=le,history.replaceState=B}},[c]);let P=(0,hn.useMemo)(()=>e||Mi({configUri:n,experiments:a,featureKey:r,configFeatureKey:i,credentials:o}),[e,n,a,r,i,o]),A=Up({fetcher:P,pollIntervalMs:s,experiments:a,runtime:c}),H=A.tiles.length>0&&!A.error;(0,hn.useEffect)(()=>t.subscribe(W=>y(W.open)),[t]),(0,hn.useEffect)(()=>{!H&&t.getState().open&&t.setOpen(!1)},[t,H]),(0,hn.useEffect)(()=>{c?.actions&&A.actions.length>0&&c.actions.applyBatch(A.actions).catch(W=>{console.error("[SmartCanvas] Failed to apply actions:",W)})},[c,A.actions]);let K=(0,hn.useMemo)(()=>{let W=A.theme;return W?{...W,...p}:p},[A.theme,p]),Y=_P(A.routes,E);return!A.isLoading&&(!H||!Y)?null:(0,qa.jsx)(dm,{tiles:A.tiles,isLoading:A.isLoading,error:A.error,canvasTitle:A.canvasTitle,telemetry:l,launcherLabel:_??A.launcher?.label,launcherAnimate:A.launcher?.animate,launcherAnimationStyle:A.launcher?.animationStyle,footerSlot:v,isOpen:m,onToggle:()=>t.toggle(),customRenderers:d,displayMode:A.displayMode,theme:K})}var YS=ee(KS(),1);var XS=ee(ye(),1),GS="smart-canvas",ZS=`
|
|
34
|
+
`,document.head.appendChild(t)}var pI={position:"right",baseWidth:"clamp(320px, 16.666vw, 420px)",expandedWidth:"40vw",zIndex:2147483600,backdropBlur:"18px",mode:"dark",colorPrimary:"#6366f1",colorBackground:"#1c1c1e",colorText:"#f5f5f7",colorTextSecondary:"#a1a1a6",borderRadius:"12px"};function dm({isOpen:t,onToggle:e,telemetry:n,launcherLabel:r="Adaptives",launcherAnimate:i=!1,launcherAnimationStyle:o="pulse",footerSlot:s,tiles:a,isLoading:l,error:c,canvasTitle:u,displayMode:f="standard",theme:h,customRenderers:g}){let[v,_]=(0,or.useState)(!1),[x,d]=(0,or.useState)(null),p=bn(),m={...pI,...h},y=(0,or.useCallback)(B=>{let X=x===B;if(d(X?null:B),p){let V=X?on.tileCollapsed(B,"overlay"):on.tileExpanded(B,"overlay");p.events.publish(V.name,V.props,V.source)}},[x,p]);(0,or.useEffect)(()=>{t&&a.forEach(B=>{if(n?.trackRectangleViewed(B.id,"overlay"),p){let X=on.tileViewed(B.id,"overlay");p.events.publish(X.name,X.props,X.source)}})},[n,p,t,a]),(0,or.useEffect)(()=>{_(!0),fI()},[]);let w=(0,or.useCallback)(()=>{let B=!t;if(B?n?.trackCanvasOpened("overlay"):n?.trackCanvasClosed("overlay"),p){let X=B?on.canvasOpened("overlay"):on.canvasClosed("overlay");p.events.publish(X.name,X.props,X.source)}e()},[t,n,p,e]),b=f==="focused",k=m.position==="right",E=m.colorBackground||"#1c1c1e",I=m.mode==="light",A=m.colorPrimary||"#6366f1",H=b?`linear-gradient(to top right, ${A}22 0%, ${E}fa 50%, ${E}fc 100%)`:`linear-gradient(to top right, ${A}33 0%, ${E}f2 45%, ${E}f7 100%)`,K=b?`linear-gradient(to top right, ${A}11 0%, ${E}fa 50%, ${E}fc 100%)`:`linear-gradient(to top right, ${A}15 0%, ${E}f2 45%, ${E}f7 100%)`,Y={display:"flex",flexDirection:"column",width:b?m.expandedWidth:m.baseWidth,minWidth:"320px",height:"100%",maxHeight:"100%",pointerEvents:"auto",opacity:t?1:.8,transition:"all 340ms cubic-bezier(0.16, 1, 0.3, 1)",color:m.colorText||"#f5f5f7",background:b?I?K:H:"transparent",backdropFilter:b?`blur(${m.backdropBlur})`:void 0,WebkitBackdropFilter:b?`blur(${m.backdropBlur})`:void 0,border:b?k?void 0:`1px solid ${I?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.06)"}`:"none",borderLeft:b&&k?`1px solid ${I?"rgba(0, 0, 0, 0.08)":"rgba(255, 255, 255, 0.08)"}`:void 0,borderRight:b&&!k?`1px solid ${I?"rgba(0, 0, 0, 0.08)":"rgba(255, 255, 255, 0.08)"}`:void 0,borderRadius:b?"0":void 0,boxShadow:b?"none":void 0,transform:t?"translateX(0)":k?"translateX(120%)":"translateX(-120%)"},W={position:"absolute",inset:0,display:"flex",flexDirection:k?"row-reverse":"row",alignItems:"stretch",pointerEvents:"none",padding:b?"0":"1rem"},le=(0,we.jsx)("div",{"data-shadow-canvas-id":"overlay-root",style:{position:"fixed",inset:0,pointerEvents:t?"auto":"none",zIndex:m.zIndex},children:(0,we.jsxs)("div",{style:W,children:[(0,we.jsxs)("div",{style:Y,children:[b&&u&&(0,we.jsx)("header",{style:{color:"white",padding:"1.5rem 1.5rem 0"},children:(0,we.jsx)("p",{style:{margin:0,fontSize:"0.7rem",textTransform:"uppercase",letterSpacing:"0.5em",color:"rgba(255, 255, 255, 0.6)"},children:u})}),(0,we.jsx)("div",{style:{flex:1,overflowY:"auto",padding:b?"0":"1rem"},children:l?(0,we.jsx)("div",{style:{color:"rgba(255, 255, 255, 0.85)",padding:b?"1rem":"0"},children:"Loading..."}):c?(0,we.jsxs)("div",{style:{color:"#fecdd3",padding:b?"1rem":"0"},children:["Failed to load: ",c]}):b?a.length>0?(0,we.jsx)(ko,{config:a[0],surface:"overlay",telemetry:n,customRenderers:g,isExpanded:!0,onToggleExpand:()=>{},style:{width:"100%",height:"100%"}}):null:(0,we.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"0.75rem",width:"100%"},children:a.map(B=>{let X=x===B.id;return(0,we.jsx)(ko,{config:B,surface:"overlay",telemetry:n,customRenderers:g,isExpanded:X,onToggleExpand:()=>y(B.id),style:{width:"100%"}},B.id)})})}),s]}),(0,we.jsx)("div",{onClick:w,style:{flex:"1 1 auto",pointerEvents:t?"auto":"none",cursor:"default"}})]})});return v?(0,we.jsxs)(we.Fragment,{children:[(0,um.createPortal)((0,we.jsx)("div",{"data-shadow-canvas-id":"overlay-launcher",style:{position:"fixed",inset:0,pointerEvents:"none",zIndex:m.zIndex+47},children:(0,we.jsxs)("button",{onClick:w,"aria-label":"Toggle shadow canvas",className:i&&!t?"syntro-launcher-animate":void 0,style:{position:"fixed",bottom:"2.5rem",right:k?"2.5rem":void 0,left:k?void 0:"2.5rem",pointerEvents:"auto",display:"flex",alignItems:"center",gap:"0.75rem",borderRadius:"18px",color:"white",boxShadow:"0 20px 45px rgba(15, 23, 42, 0.35)",transition:"transform 0.2s ease",outline:"none",padding:"0.65rem 1.25rem",border:"2px solid rgba(255, 255, 255, 0.25)",backgroundColor:"rgba(2, 6, 23, 0.8)",backdropFilter:"blur(12px)",cursor:"pointer"},onMouseEnter:B=>B.currentTarget.style.transform="translateY(-2px)",onMouseLeave:B=>B.currentTarget.style.transform="translateY(0)",children:[(0,we.jsx)("div",{style:{width:"36px",height:"36px",borderRadius:"12px",background:t?"linear-gradient(135deg, #f472b6, #ec4899)":"linear-gradient(135deg, #94a3b8, #0f172a)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,we.jsx)("span",{style:{width:"14px",height:"2px",backgroundColor:"#fff",display:"block",transform:t?"rotate(45deg)":"rotate(0)",position:"relative",transition:"transform 200ms ease"},children:t?null:(0,we.jsx)("span",{style:{position:"absolute",top:0,left:0,width:"14px",height:"2px",backgroundColor:"#fff",transform:"rotate(90deg)"}})})}),(0,we.jsxs)("div",{style:{display:"flex",flexDirection:"column",textAlign:"left"},children:[(0,we.jsx)("span",{style:{fontSize:"0.55rem",letterSpacing:"0.35em",color:"rgba(255,255,255,0.7)"},children:t?"Hide":"Open"}),(0,we.jsx)("span",{style:{fontSize:"0.85rem",letterSpacing:"0.25em"},children:r})]})]})}),document.body),t?(0,um.createPortal)(le,document.body):null]}):null}var Jr=ee(Nt(),1);var Qr=ee(ve(),1);function hI({tiles:t,intervalMs:e=7e3,telemetry:n}){let[r,i]=(0,Jr.useState)(0),o=(0,Jr.useMemo)(()=>[...t].filter(s=>s.size!=="half").sort((s,a)=>(s.order??0)-(a.order??0)),[t]);return(0,Jr.useEffect)(()=>{n?.trackCanvasOpened("wheel")},[n]),(0,Jr.useEffect)(()=>{if(o.length<=1)return;let s=setInterval(()=>{i(a=>(a+1)%o.length)},e);return()=>clearInterval(s)},[o,e]),(0,Jr.useEffect)(()=>{let s=o[r];s&&n?.trackRectangleViewed(s.id,"wheel")},[r,o,n]),o.length?(0,Qr.jsxs)("div",{className:"relative overflow-hidden rounded-3xl border border-slate-200 bg-gradient-to-br from-white to-slate-50 p-6 shadow-2xl","data-shadow-canvas-id":"wheel",children:[(0,Qr.jsx)("div",{className:"flex transition-transform duration-700 ease-out",style:{transform:`translateX(-${r*100}%)`,width:`${o.length*100}%`},children:o.map(s=>(0,Qr.jsx)("div",{className:"w-full shrink-0 px-4",children:(0,Qr.jsx)(ko,{config:{...s,size:"half"},surface:"wheel",telemetry:n})},s.id))}),(0,Qr.jsx)("div",{className:"mt-4 flex justify-center gap-2",children:o.map((s,a)=>(0,Qr.jsx)("button",{className:`h-2 w-6 rounded-full ${a===r?"bg-slate-800":"bg-slate-300"}`,onClick:()=>i(a)},s.id))})]}):null}var Vu=class{constructor(e){j(this,"state");j(this,"listeners",new Set);this.state={open:e?.open??!1}}getState(){return this.state}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOpen(e){this.state.open!==e&&(this.state={...this.state,open:e},this.emit())}toggle(){this.setOpen(!this.state.open)}emit(){for(let e of this.listeners)e(this.state)}},fm=t=>new Vu(t);var hn=ee(Nt(),1);var gI=["api.syntrologie.com","cdn.syntrologie.com","localhost","127.0.0.1"];function mI(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] Config URI must use HTTPS:",t),!1):gI.some(i=>e.hostname===i)?!0:(console.warn("[SmartCanvas] Config URI host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid config URI:",t),!1}}function vI(t){if(typeof window>"u")return!1;try{return new URL(t).origin===window.location.origin}catch{return!1}}var zu=({configUri:t,experiments:e,featureKey:n="smart-canvas-config-uri"})=>{if(t)return t;let r=e?.getFeatureValue?.(n,null);if(r)return r},Ni=({configUri:t,experiments:e,featureKey:n,credentials:r,configFeatureKey:i="smart-canvas-config"})=>async()=>{if(e&&i){let c=e.getFeatureValue?.(i,null);if(c&&typeof c=="object")return F("SmartCanvas Config","Resolved config directly from feature flag",c),c}let o=zu({configUri:t,experiments:e,featureKey:n});if(!o)return F("SmartCanvas Config","No config available \u2014 returning empty config"),{tiles:[],overlays:[]};if(!mI(o))throw new Error(`SmartCanvas: config URI not allowed: ${o}`);let s=r??(vI(o)?"include":"omit"),a=await fetch(o,{credentials:s});if(!a.ok)throw new Error(`SmartCanvas: failed to fetch config (${a.status})`);let l=await a.json();return F("SmartCanvas Config","Fetched config from URI",l),l};var Wa=ee(ve(),1);function yI(t,e){return t?t.include?.length?t.include.some(n=>WS(n,e)):t.exclude?.length?!t.exclude.some(n=>WS(n,e)):!0:!0}function WS(t,e){if(t.endsWith("/*")){let n=t.slice(0,-2);return e===n||e.startsWith(n+"/")}return e===t}function pm({controller:t,fetcher:e,configUri:n,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:i="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:s,experiments:a,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p}){return c?(0,Wa.jsx)(yc,{runtime:c,children:(0,Wa.jsx)(qS,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:r,configFeatureKey:i,fetchCredentials:o,pollIntervalMs:s,experiments:a,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p})}):(0,Wa.jsx)(qS,{controller:t,fetcher:e,configUri:n,configUriFeatureKey:r,configFeatureKey:i,fetchCredentials:o,pollIntervalMs:s,experiments:a,telemetry:l,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h,overlayFetchCredentials:g,footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p})}function qS({controller:t,fetcher:e,configUri:n,configUriFeatureKey:r="smart-canvas-config-uri",configFeatureKey:i="smart-canvas-config",fetchCredentials:o="include",pollIntervalMs:s,experiments:a,telemetry:l,runtime:c,overlayFetcher:u,overlayConfigUri:f,overlayConfigFeatureKey:h="smart-canvas-overlay-uri",overlayFetchCredentials:g="include",footerSlot:v,launcherLabel:_,canvasHost:x,customRenderers:d,theme:p}){let[m,y]=(0,hn.useState)(t.getState().open),w=_c(),[b,k]=(0,hn.useState)(()=>typeof window<"u"?window.location.pathname:"/"),E=w?.url?new URL(w.url).pathname:b;(0,hn.useEffect)(()=>{if(c||typeof window>"u")return;let W=()=>k(window.location.pathname);window.addEventListener("popstate",W);let le=history.pushState,B=history.replaceState;return history.pushState=function(...X){le.apply(this,X),W()},history.replaceState=function(...X){B.apply(this,X),W()},()=>{window.removeEventListener("popstate",W),history.pushState=le,history.replaceState=B}},[c]);let I=(0,hn.useMemo)(()=>e||Ni({configUri:n,experiments:a,featureKey:r,configFeatureKey:i,credentials:o}),[e,n,a,r,i,o]),A=Up({fetcher:I,pollIntervalMs:s,experiments:a,runtime:c}),H=A.tiles.length>0&&!A.error;(0,hn.useEffect)(()=>t.subscribe(W=>y(W.open)),[t]),(0,hn.useEffect)(()=>{!H&&t.getState().open&&t.setOpen(!1)},[t,H]),(0,hn.useEffect)(()=>{c?.actions&&A.actions.length>0&&c.actions.applyBatch(A.actions).catch(W=>{console.error("[SmartCanvas] Failed to apply actions:",W)})},[c,A.actions]);let K=(0,hn.useMemo)(()=>{let W=A.theme;return W?{...W,...p}:p},[A.theme,p]),Y=yI(A.routes,E);return!A.isLoading&&(!H||!Y)?null:(0,Wa.jsx)(dm,{tiles:A.tiles,isLoading:A.isLoading,error:A.error,canvasTitle:A.canvasTitle,telemetry:l,launcherLabel:_??A.launcher?.label,launcherAnimate:A.launcher?.animate,launcherAnimationStyle:A.launcher?.animationStyle,footerSlot:v,isOpen:m,onToggle:()=>t.toggle(),customRenderers:d,displayMode:A.displayMode,theme:K})}var XS=ee(GS(),1);var QS=ee(ve(),1),ZS="smart-canvas",YS=`
|
|
35
35
|
:host {
|
|
36
36
|
font: inherit;
|
|
37
37
|
color: inherit;
|
|
@@ -44,13 +44,13 @@ Error generating stack: `+o.message+`
|
|
|
44
44
|
*, *::before, *::after {
|
|
45
45
|
box-sizing: border-box;
|
|
46
46
|
}
|
|
47
|
-
`,
|
|
47
|
+
`,_I=()=>{let t="smartcanvas-overlays",e=document.getElementById(t);return e||(e=document.createElement("div"),e.id=t,e.setAttribute("data-smart-canvas-overlay","true"),document.body?document.body.appendChild(e):document.addEventListener("DOMContentLoaded",()=>{e.parentNode||document.body.appendChild(e)},{once:!0})),e},ei,ti,qa,sr,ni,ar,es,Hu=class extends HTMLElement{constructor(){super();yr(this,ei);yr(this,ti);yr(this,qa);yr(this,sr);yr(this,ni,null);yr(this,ar,null);yr(this,es,{});vn(this,ei,this.attachShadow({mode:"open",delegatesFocus:!0})),vn(this,ti,document.createElement("div")),xe(this,ti).setAttribute("part","mount"),xe(this,ei).appendChild(xe(this,ti)),vn(this,qa,_I()),vn(this,sr,fm()),this.applyBaseStyles()}connectedCallback(){this.style.setProperty("font-family","inherit")}disconnectedCallback(){xe(this,ni)?.unmount(),vn(this,ni,null)}getMountNode(){return xe(this,ti)}getController(){return xe(this,sr)}getOverlayRoot(){return xe(this,qa)}open(){xe(this,sr).setOpen(!0)}close(){xe(this,sr).setOpen(!1)}toggle(){xe(this,sr).toggle()}registerComponent(n,r){vn(this,es,{...xe(this,es),[n]:r}),this.render()}setOverrideFetcher(n){xe(this,ar)&&(vn(this,ar,{...xe(this,ar),fetcher:n}),this.render())}mountReactApp(n){vn(this,ar,n),this.render()}render(){!this.isConnected||!xe(this,ar)||(xe(this,ni)||vn(this,ni,(0,XS.createRoot)(xe(this,ti))),xe(this,ni).render((0,QS.jsx)(pm,{...xe(this,ar),controller:xe(this,sr),canvasHost:this,customRenderers:xe(this,es)})))}applyBaseStyles(){if(xe(this,ei).adoptedStyleSheets!==void 0){let n=new CSSStyleSheet;n.replaceSync(YS),xe(this,ei).adoptedStyleSheets=[n]}else{let n=document.createElement("style");n.textContent=YS,xe(this,ei).appendChild(n)}}};ei=new WeakMap,ti=new WeakMap,qa=new WeakMap,sr=new WeakMap,ni=new WeakMap,ar=new WeakMap,es=new WeakMap;var gm=()=>{typeof window>"u"||customElements.get(ZS)||customElements.define(ZS,Hu)};var ju=ee(Nt(),1),JS=ee(Bu(),1);function wI({element:t,children:e}){let[n,r]=(0,ju.useState)(null);return(0,ju.useLayoutEffect)(()=>{if(!t){r(null);return}return r(t.getMountNode()),()=>r(null)},[t]),n?(0,JS.createPortal)(e,n):null}var eb={timeout:300,className:"sc-anti-flicker",style:"opacity: 0 !important"};function tb(t={}){let{timeout:e,className:n,style:r}={...eb,...t},i=document.createElement("style");i.textContent=`.${n} { ${r} }`,document.head.appendChild(i),document.documentElement.classList.add(n);let o=setTimeout(()=>{document.documentElement.classList.remove(n)},e);return()=>{clearTimeout(o),document.documentElement.classList.remove(n),i.remove()}}function nb(t={}){let{className:e,style:n}={...eb,...t};return`
|
|
48
48
|
(function() {
|
|
49
49
|
var s = document.createElement('style');
|
|
50
50
|
s.textContent = '.${e} { ${n} }';
|
|
51
51
|
document.head.appendChild(s);
|
|
52
52
|
document.documentElement.className += ' ${e}';
|
|
53
|
-
})();`}var mm=!1;function nb(){if(typeof window>"u")return!1;try{return new URLSearchParams(window.location.search).get("syntro_debug")==="true"}catch{return!1}}function vm(t){if(nb()){mm=!0;return}mm=t??!1}function SP(){return nb()?!0:mm}function V(t,e,n){SP()&&(n!==void 0?console.log(`[${t}]`,e,n):console.log(`[${t}]`,e))}function Bt(t,e,n){n!==void 0?console.warn(`[${t}]`,e,n):console.warn(`[${t}]`,e)}function ju(t,e,n){n!==void 0?console.error(`[${t}]`,e,n):console.error(`[${t}]`,e)}var rb="https://cdn.syntrologie.com/editor-sdk/latest/editor-sdk.js",ib=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function bP(t){V("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return V("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);if(V("Syntro Runtime","Parsed URL:",{hostname:e.hostname,protocol:e.protocol,isLocalhost:n}),e.protocol!=="https:"&&!n)return Bt("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1;let r=ib.some(i=>i.startsWith(".")?e.hostname.endsWith(i)||e.hostname===i.slice(1):e.hostname===i);return V("Syntro Runtime","Host allowlist check:",{hostname:e.hostname,allowedHosts:ib,isAllowed:r}),r?(V("Syntro Runtime","\u2713 Editor URL validated"),!0):(Bt("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return Bt("Syntro Runtime","\u274C Invalid editor URL: "+t,e),!1}}var kP=()=>{if(V("Syntro Runtime","====== EDITOR LOAD CHECK ======"),typeof window>"u")return V("Syntro Runtime","Not in browser - skipping editor"),!1;let t=new URLSearchParams(window.location.search);V("Syntro Runtime","URL:",window.location.href),V("Syntro Runtime","Search params:",window.location.search);let e=t.has("syntro_editor")||t.has("syntro-editor"),n=t.has("editor_token");if(V("Syntro Runtime","Editor flags:",{hasEditorFlag:e,hasEditorToken:n,syntro_editor:t.get("syntro_editor"),"syntro-editor":t.get("syntro-editor"),editor_token:n?`${t.get("editor_token")?.slice(0,10)}...`:"none"}),e&&!n)return Bt("Syntro Runtime","\u274C Editor activation requires editor_token parameter"),V("Syntro Runtime","================================"),!1;let r=e&&n;return V("Syntro Runtime","Should load editor:",r),V("Syntro Runtime","================================"),r},EP=()=>{if(V("Syntro Runtime","====== AUDIT MODE CHECK ======"),typeof window>"u")return V("Syntro Runtime","Not in browser - skipping audit"),!1;let t=new URLSearchParams(window.location.search),e=t.has("syntro_audit"),n=t.has("audit_token"),r=t.get("audit_session_id");return V("Syntro Runtime","Audit flags:",{hasAuditFlag:e,hasAuditToken:n,auditSessionId:r?`${r.slice(0,8)}...`:"none",audit_token:n?`${t.get("audit_token")?.slice(0,10)}...`:"none"}),e?n?(V("Syntro Runtime","\u2713 Audit mode active"),V("Syntro Runtime","================================"),!0):(Bt("Syntro Runtime","\u274C Audit activation requires audit_token parameter"),V("Syntro Runtime","================================"),!1):(V("Syntro Runtime","No syntro_audit param - not in audit mode"),V("Syntro Runtime","================================"),!1)},ob=()=>kP()?"editor":EP()?"audit":null;function CP(){if(typeof window>"u")return null;let t=new URLSearchParams(window.location.search);return t.get("editor_token")||t.get("audit_token")}var sb=async t=>{if(V("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){V("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){V("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}let e=typeof t=="string"?{editorUrl:t}:t??{},n=new URLSearchParams(window.location.search),r=n.get("syntro_editor_sdk_url"),i=n.get("api_base"),o=i?`${i}/api/editor/sdk/editor-sdk.js`:null,s=r||o||e.editorUrl||rb,a=CP();if(!a){Bt("Syntro Runtime","\u274C No token found in URL params. SDK requires editor_token or audit_token."),V("Syntro Runtime","================================");return}let l=`${s}?token=${encodeURIComponent(a)}`;if(V("Syntro Runtime","Editor URL:",l),V("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,isDefault:s===rb,hasApiBase:!!i,tokenPrefix:a.slice(0,10)+"..."}),!bP(s)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",s),V("Syntro Runtime","================================");return}return V("Syntro Runtime","\u2713 URL validated, injecting script tag..."),new Promise((c,u)=>{let f=document.createElement("script");f.src=l,f.async=!0,e.integrity&&(f.integrity=e.integrity,f.crossOrigin="anonymous",V("Syntro Runtime","SRI integrity check enabled")),f.onload=()=>{V("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),V("Syntro Runtime","window.SyntroEditor:",!!window.SyntroEditor),V("Syntro Runtime","================================"),c()},f.onerror=h=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",h),console.error("[Syntro Runtime] URL attempted:",l),console.error("[Syntro Runtime] Check: Is the URL accessible? CORS? Network? Token valid?"),V("Syntro Runtime","================================"),u(h)},document.head.appendChild(f),V("Syntro Runtime","Script tag appended to <head>")})};var Uu=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let d=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=eb(d)}let n=null,r=null,i=null,o=!0,s=t.runtime;async function a(d){!s?.actions||d.length===0||(i?.isApplied()&&await i.revertAll(),i=await s.actions.applyBatch(d))}async function l(){i?.isApplied()&&(await i.revertAll(),i=null)}if(t.fetcher)try{r=t.fetcher;let d=await t.fetcher();n=d,d.actions&&d.actions.length>0&&s?.actions&&await a(d.actions)}catch(d){console.error("[SmartCanvas] Error fetching/applying initial config:",d)}e&&e();let c=ob();c&&(console.log(`[SmartCanvas] Loading editor SDK for ${c} mode`),sb(t.editorUrl).catch(console.error)),gm();let u=document.createElement("smart-canvas");if(t.tokens)for(let[d,p]of Object.entries(t.tokens))u.style.setProperty(d,p);let f=()=>{let d=t.target??document.body;d&&d.appendChild(u)};document.body?f():document.addEventListener("DOMContentLoaded",f,{once:!0});let h=t.integrations?.experiments,g=t.integrations?.telemetry,v=t.fetcher??Mi({configUri:t.configUri,experiments:h,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=v);let _={fetcher:v,pollIntervalMs:t.pollIntervalMs,experiments:h,telemetry:g,runtime:s,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,theme:t.theme};u.mountReactApp(_),t.defaultOpen&&u.open();let x={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{l(),u.remove()},setTokens:d=>{for(let[p,m]of Object.entries(d))u.style.setProperty(p,m)},getConfig:async()=>{if(r)try{let d=await r();return n=d,d}catch(d){console.error("[SmartCanvas] Error fetching config:",d)}return n},updateConfig:async d=>{n=d,o&&await a(d.actions)},setEnabled:async d=>{o=d,d?n&&await a(n.actions):await l()},registerComponent:(d,p)=>u.registerComponent(d,p),setOverrideFetcher:d=>{r=d,u.setOverrideFetcher(d)},registerTelemetryProperties:d=>{g?.register?.(d)},getSessionId:()=>g?.getSessionId?.(),startSessionRecording:()=>{g?.startSessionRecording?.()},runtime:s};return typeof window<"u"&&c&&(window.__smartCanvasHandle=x),x};typeof window<"u"&&(window.SmartCanvas={async create(t){return Uu(t)}});var S={};hv(S,{BRAND:()=>QP,DIRTY:()=>Fi,EMPTY_PATH:()=>PP,INVALID:()=>U,NEVER:()=>FI,OK:()=>lt,ParseStatus:()=>tt,Schema:()=>J,ZodAny:()=>si,ZodArray:()=>fr,ZodBigInt:()=>Di,ZodBoolean:()=>Bi,ZodBranded:()=>Za,ZodCatch:()=>Yi,ZodDate:()=>Vi,ZodDefault:()=>Zi,ZodDiscriminatedUnion:()=>Ku,ZodEffects:()=>Jt,ZodEnum:()=>Ki,ZodError:()=>Rt,ZodFirstPartyTypeKind:()=>q,ZodFunction:()=>Zu,ZodIntersection:()=>Ui,ZodIssueCode:()=>R,ZodLazy:()=>Wi,ZodLiteral:()=>qi,ZodMap:()=>ls,ZodNaN:()=>us,ZodNativeEnum:()=>Gi,ZodNever:()=>gn,ZodNull:()=>Hi,ZodNullable:()=>Nn,ZodNumber:()=>$i,ZodObject:()=>Tt,ZodOptional:()=>Xt,ZodParsedType:()=>M,ZodPipeline:()=>Ya,ZodPromise:()=>ai,ZodReadonly:()=>Xi,ZodRecord:()=>Gu,ZodSchema:()=>J,ZodSet:()=>cs,ZodString:()=>oi,ZodSymbol:()=>ss,ZodTransformer:()=>Jt,ZodTuple:()=>On,ZodType:()=>J,ZodUndefined:()=>zi,ZodUnion:()=>ji,ZodUnknown:()=>dr,ZodVoid:()=>as,addIssueToContext:()=>I,any:()=>aI,array:()=>dI,bigint:()=>nI,boolean:()=>vb,coerce:()=>MI,custom:()=>hb,date:()=>rI,datetimeRegex:()=>fb,defaultErrorMap:()=>cr,discriminatedUnion:()=>gI,effect:()=>AI,enum:()=>kI,function:()=>xI,getErrorMap:()=>rs,getParsedType:()=>In,instanceof:()=>eI,intersection:()=>mI,isAborted:()=>Wu,isAsync:()=>is,isDirty:()=>qu,isValid:()=>ii,late:()=>JP,lazy:()=>SI,literal:()=>bI,makeIssue:()=>Ga,map:()=>_I,nan:()=>tI,nativeEnum:()=>EI,never:()=>cI,null:()=>sI,nullable:()=>TI,number:()=>mb,object:()=>fI,objectUtil:()=>ym,oboolean:()=>LI,onumber:()=>NI,optional:()=>RI,ostring:()=>OI,pipeline:()=>II,preprocess:()=>PI,promise:()=>CI,quotelessJson:()=>AP,record:()=>yI,set:()=>wI,setErrorMap:()=>TP,strictObject:()=>pI,string:()=>gb,symbol:()=>iI,transformer:()=>AI,tuple:()=>vI,undefined:()=>oI,union:()=>hI,unknown:()=>lI,util:()=>re,void:()=>uI});var re;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var ym;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(ym||(ym={}));var M=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),In=t=>{switch(typeof t){case"undefined":return M.undefined;case"string":return M.string;case"number":return Number.isNaN(t)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(t)?M.array:t===null?M.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?M.promise:typeof Map<"u"&&t instanceof Map?M.map:typeof Set<"u"&&t instanceof Set?M.set:typeof Date<"u"&&t instanceof Date?M.date:M.object;default:return M.unknown}};var R=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),AP=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Rt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){let c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];n[o]=n[o]||[],n[o].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Rt.create=t=>new Rt(t);var RP=(t,e)=>{let n;switch(t.code){case R.invalid_type:t.received===M.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case R.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,re.jsonStringifyReplacer)}`;break;case R.unrecognized_keys:n=`Unrecognized key(s) in object: ${re.joinValues(t.keys,", ")}`;break;case R.invalid_union:n="Invalid input";break;case R.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${re.joinValues(t.options)}`;break;case R.invalid_enum_value:n=`Invalid enum value. Expected ${re.joinValues(t.options)}, received '${t.received}'`;break;case R.invalid_arguments:n="Invalid function arguments";break;case R.invalid_return_type:n="Invalid function return type";break;case R.invalid_date:n="Invalid date";break;case R.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:re.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case R.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case R.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case R.custom:n="Invalid input";break;case R.invalid_intersection_types:n="Intersection results could not be merged";break;case R.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case R.not_finite:n="Number must be finite";break;default:n=e.defaultError,re.assertNever(t)}return{message:n}},cr=RP;var ab=cr;function TP(t){ab=t}function rs(){return ab}var Ga=t=>{let{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",l=r.filter(c=>!!c).slice().reverse();for(let c of l)a=c(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},PP=[];function I(t,e){let n=rs(),r=Ga({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===cr?void 0:cr].filter(i=>!!i)});t.common.issues.push(r)}var tt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let i of n){if(i.status==="aborted")return U;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let i of n){let o=await i.key,s=await i.value;r.push({key:o,value:s})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let i of n){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return U;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}},U=Object.freeze({status:"aborted"}),Fi=t=>({status:"dirty",value:t}),lt=t=>({status:"valid",value:t}),Wu=t=>t.status==="aborted",qu=t=>t.status==="dirty",ii=t=>t.status==="valid",is=t=>typeof Promise<"u"&&t instanceof Promise;var z;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(z||(z={}));var Qt=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},lb=(t,e)=>{if(ii(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Rt(t.common.issues);return this._error=n,this._error}}};function Q(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:i}}var J=class{get description(){return this._def.description}_getType(e){return In(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:In(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new tt,ctx:{common:e.parent.common,data:e.data,parsedType:In(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(is(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:In(e)},i=this._parseSync({data:e,path:r.path,parent:r});return lb(r,i)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:In(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return ii(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>ii(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:In(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(is(i)?i:Promise.resolve(i));return lb(r,o)}refine(e,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:R.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Jt({schema:this,typeName:q.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Xt.create(this,this._def)}nullable(){return Nn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fr.create(this)}promise(){return ai.create(this,this._def)}or(e){return ji.create([this,e],this._def)}and(e){return Ui.create(this,e,this._def)}transform(e){return new Jt({...Q(this._def),schema:this,typeName:q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Zi({...Q(this._def),innerType:this,defaultValue:n,typeName:q.ZodDefault})}brand(){return new Za({typeName:q.ZodBranded,type:this,...Q(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Yi({...Q(this._def),innerType:this,catchValue:n,typeName:q.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Ya.create(this,e)}readonly(){return Xi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},IP=/^c[^\s-]{8,}$/i,OP=/^[0-9a-z]+$/,NP=/^[0-9A-HJKMNP-TV-Z]{26}$/i,LP=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,MP=/^[a-z0-9_-]{21}$/i,FP=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,$P=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,DP=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,BP="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_m,VP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zP=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,HP=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,jP=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,UP=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,WP=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ub="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",qP=new RegExp(`^${ub}$`);function db(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function KP(t){return new RegExp(`^${db(t)}$`)}function fb(t){let e=`${ub}T${db(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function GP(t,e){return!!((e==="v4"||!e)&&VP.test(t)||(e==="v6"||!e)&&HP.test(t))}function ZP(t,e){if(!FP.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function YP(t,e){return!!((e==="v4"||!e)&&zP.test(t)||(e==="v6"||!e)&&jP.test(t))}var oi=class t extends J{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==M.string){let o=this._getOrReturnCtx(e);return I(o,{code:R.invalid_type,expected:M.string,received:o.parsedType}),U}let r=new tt,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),I(i,{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),I(i,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?I(i,{code:R.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&I(i,{code:R.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")DP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"email",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")_m||(_m=new RegExp(BP,"u")),_m.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"emoji",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")LP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"uuid",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")MP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"nanoid",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")IP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"cuid",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")OP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"cuid2",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")NP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"ulid",code:R.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),I(i,{validation:"url",code:R.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"regex",code:R.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?fb(o).test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?qP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?KP(o).test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{code:R.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?$P.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"duration",code:R.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?GP(e.data,o.version)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"ip",code:R.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?ZP(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"jwt",code:R.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?YP(e.data,o.version)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"cidr",code:R.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?UP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"base64",code:R.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?WP.test(e.data)||(i=this._getOrReturnCtx(e,i),I(i,{validation:"base64url",code:R.invalid_string,message:o.message}),r.dirty()):re.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:R.invalid_string,...z.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...z.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...z.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...z.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...z.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...z.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...z.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...z.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...z.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...z.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...z.errToObj(n)})}nonempty(e){return this.min(1,z.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};oi.create=t=>new oi({checks:[],typeName:q.ZodString,coerce:t?.coerce??!1,...Q(t)});function XP(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}var $i=class t extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==M.number){let o=this._getOrReturnCtx(e);return I(o,{code:R.invalid_type,expected:M.number,received:o.parsedType}),U}let r,i=new tt;for(let o of this._def.checks)o.kind==="int"?re.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{code:R.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),I(r,{code:R.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),I(r,{code:R.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?XP(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),I(r,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),I(r,{code:R.not_finite,message:o.message}),i.dirty()):re.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,z.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:z.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:z.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:z.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&re.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};$i.create=t=>new $i({checks:[],typeName:q.ZodNumber,coerce:t?.coerce||!1,...Q(t)});var Di=class t extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==M.bigint)return this._getInvalidInput(e);let r,i=new tt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),I(r,{code:R.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),I(r,{code:R.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),I(r,{code:R.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):re.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return I(n,{code:R.invalid_type,expected:M.bigint,received:n.parsedType}),U}gte(e,n){return this.setLimit("min",e,!0,z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,z.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:z.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:z.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Di.create=t=>new Di({checks:[],typeName:q.ZodBigInt,coerce:t?.coerce??!1,...Q(t)});var Bi=class extends J{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==M.boolean){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.boolean,received:r.parsedType}),U}return lt(e.data)}};Bi.create=t=>new Bi({typeName:q.ZodBoolean,coerce:t?.coerce||!1,...Q(t)});var Vi=class t extends J{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==M.date){let o=this._getOrReturnCtx(e);return I(o,{code:R.invalid_type,expected:M.date,received:o.parsedType}),U}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return I(o,{code:R.invalid_date}),U}let r=new tt,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),I(i,{code:R.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),I(i,{code:R.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):re.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:z.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:z.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Vi.create=t=>new Vi({checks:[],coerce:t?.coerce||!1,typeName:q.ZodDate,...Q(t)});var ss=class extends J{_parse(e){if(this._getType(e)!==M.symbol){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.symbol,received:r.parsedType}),U}return lt(e.data)}};ss.create=t=>new ss({typeName:q.ZodSymbol,...Q(t)});var zi=class extends J{_parse(e){if(this._getType(e)!==M.undefined){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.undefined,received:r.parsedType}),U}return lt(e.data)}};zi.create=t=>new zi({typeName:q.ZodUndefined,...Q(t)});var Hi=class extends J{_parse(e){if(this._getType(e)!==M.null){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.null,received:r.parsedType}),U}return lt(e.data)}};Hi.create=t=>new Hi({typeName:q.ZodNull,...Q(t)});var si=class extends J{constructor(){super(...arguments),this._any=!0}_parse(e){return lt(e.data)}};si.create=t=>new si({typeName:q.ZodAny,...Q(t)});var dr=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(e){return lt(e.data)}};dr.create=t=>new dr({typeName:q.ZodUnknown,...Q(t)});var gn=class extends J{_parse(e){let n=this._getOrReturnCtx(e);return I(n,{code:R.invalid_type,expected:M.never,received:n.parsedType}),U}};gn.create=t=>new gn({typeName:q.ZodNever,...Q(t)});var as=class extends J{_parse(e){if(this._getType(e)!==M.undefined){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.void,received:r.parsedType}),U}return lt(e.data)}};as.create=t=>new as({typeName:q.ZodVoid,...Q(t)});var fr=class t extends J{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==M.array)return I(n,{code:R.invalid_type,expected:M.array,received:n.parsedType}),U;if(i.exactLength!==null){let s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(I(n,{code:s?R.too_big:R.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(I(n,{code:R.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(I(n,{code:R.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Qt(n,s,n.path,a)))).then(s=>tt.mergeArray(r,s));let o=[...n.data].map((s,a)=>i.type._parseSync(new Qt(n,s,n.path,a)));return tt.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:z.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:z.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:z.toString(n)}})}nonempty(e){return this.min(1,e)}};fr.create=(t,e)=>new fr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...Q(e)});function os(t){if(t instanceof Tt){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Xt.create(os(r))}return new Tt({...t._def,shape:()=>e})}else return t instanceof fr?new fr({...t._def,type:os(t.element)}):t instanceof Xt?Xt.create(os(t.unwrap())):t instanceof Nn?Nn.create(os(t.unwrap())):t instanceof On?On.create(t.items.map(e=>os(e))):t}var Tt=class t extends J{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=re.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==M.object){let c=this._getOrReturnCtx(e);return I(c,{code:R.invalid_type,expected:M.object,received:c.parsedType}),U}let{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof gn&&this._def.unknownKeys==="strip"))for(let c in i.data)s.includes(c)||a.push(c);let l=[];for(let c of s){let u=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Qt(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof gn){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(I(i,{code:R.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of a){let f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Qt(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let f=await u.key,h=await u.value;c.push({key:f,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>tt.mergeObjectSync(r,c)):tt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:z.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:q.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of re.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of re.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return os(this)}partial(e){let n={};for(let r of re.objectKeys(this.shape)){let i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of re.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Xt;)o=o._def.innerType;n[r]=o}return new t({...this._def,shape:()=>n})}keyof(){return pb(re.objectKeys(this.shape))}};Tt.create=(t,e)=>new Tt({shape:()=>t,unknownKeys:"strip",catchall:gn.create(),typeName:q.ZodObject,...Q(e)});Tt.strictCreate=(t,e)=>new Tt({shape:()=>t,unknownKeys:"strict",catchall:gn.create(),typeName:q.ZodObject,...Q(e)});Tt.lazycreate=(t,e)=>new Tt({shape:t,unknownKeys:"strip",catchall:gn.create(),typeName:q.ZodObject,...Q(e)});var ji=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new Rt(a.ctx.common.issues));return I(n,{code:R.invalid_union,unionErrors:s}),U}if(n.common.async)return Promise.all(r.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let l of r){let c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(l=>new Rt(l));return I(n,{code:R.invalid_union,unionErrors:a}),U}}get options(){return this._def.options}};ji.create=(t,e)=>new ji({options:t,typeName:q.ZodUnion,...Q(e)});var ur=t=>t instanceof Wi?ur(t.schema):t instanceof Jt?ur(t.innerType()):t instanceof qi?[t.value]:t instanceof Ki?t.options:t instanceof Gi?re.objectValues(t.enum):t instanceof Zi?ur(t._def.innerType):t instanceof zi?[void 0]:t instanceof Hi?[null]:t instanceof Xt?[void 0,...ur(t.unwrap())]:t instanceof Nn?[null,...ur(t.unwrap())]:t instanceof Za||t instanceof Xi?ur(t.unwrap()):t instanceof Yi?ur(t._def.innerType):[],Ku=class t extends J{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.object)return I(n,{code:R.invalid_type,expected:M.object,received:n.parsedType}),U;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(I(n,{code:R.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),U)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let i=new Map;for(let o of n){let s=ur(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:q.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Q(r)})}};function wm(t,e){let n=In(t),r=In(e);if(t===e)return{valid:!0,data:t};if(n===M.object&&r===M.object){let i=re.objectKeys(e),o=re.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let l=wm(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===M.array&&r===M.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],l=wm(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===M.date&&r===M.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Ui=class extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=(o,s)=>{if(Wu(o)||Wu(s))return U;let a=wm(o.value,s.value);return a.valid?((qu(o)||qu(s))&&n.dirty(),{status:n.value,value:a.data}):(I(r,{code:R.invalid_intersection_types}),U)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Ui.create=(t,e,n)=>new Ui({left:t,right:e,typeName:q.ZodIntersection,...Q(n)});var On=class t extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.array)return I(r,{code:R.invalid_type,expected:M.array,received:r.parsedType}),U;if(r.data.length<this._def.items.length)return I(r,{code:R.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),U;!this._def.rest&&r.data.length>this._def.items.length&&(I(r,{code:R.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...r.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new Qt(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>tt.mergeArray(n,s)):tt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};On.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new On({items:t,typeName:q.ZodTuple,rest:null,...Q(e)})};var Gu=class t extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.object)return I(r,{code:R.invalid_type,expected:M.object,received:r.parsedType}),U;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in r.data)i.push({key:o._parse(new Qt(r,a,r.path,a)),value:s._parse(new Qt(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?tt.mergeObjectAsync(n,i):tt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof J?new t({keyType:e,valueType:n,typeName:q.ZodRecord,...Q(r)}):new t({keyType:oi.create(),valueType:e,typeName:q.ZodRecord,...Q(n)})}},ls=class extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.map)return I(r,{code:R.invalid_type,expected:M.map,received:r.parsedType}),U;let i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new Qt(r,a,r.path,[c,"key"])),value:o._parse(new Qt(r,l,r.path,[c,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return U;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let l of s){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return U;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}};ls.create=(t,e,n)=>new ls({valueType:e,keyType:t,typeName:q.ZodMap,...Q(n)});var cs=class t extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.set)return I(r,{code:R.invalid_type,expected:M.set,received:r.parsedType}),U;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(I(r,{code:R.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(I(r,{code:R.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function s(l){let c=new Set;for(let u of l){if(u.status==="aborted")return U;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let a=[...r.data.values()].map((l,c)=>o._parse(new Qt(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:z.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:z.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};cs.create=(t,e)=>new cs({valueType:t,minSize:null,maxSize:null,typeName:q.ZodSet,...Q(e)});var Zu=class t extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.function)return I(n,{code:R.invalid_type,expected:M.function,received:n.parsedType}),U;function r(a,l){return Ga({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,rs(),cr].filter(c=>!!c),issueData:{code:R.invalid_arguments,argumentsError:l}})}function i(a,l){return Ga({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,rs(),cr].filter(c=>!!c),issueData:{code:R.invalid_return_type,returnTypeError:l}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof ai){let a=this;return lt(async function(...l){let c=new Rt([]),u=await a._def.args.parseAsync(l,o).catch(g=>{throw c.addIssue(r(l,g)),c}),f=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(f,o).catch(g=>{throw c.addIssue(i(f,g)),c})})}else{let a=this;return lt(function(...l){let c=a._def.args.safeParse(l,o);if(!c.success)throw new Rt([r(l,c.error)]);let u=Reflect.apply(s,this,c.data),f=a._def.returns.safeParse(u,o);if(!f.success)throw new Rt([i(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:On.create(e).rest(dr.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||On.create([]).rest(dr.create()),returns:n||dr.create(),typeName:q.ZodFunction,...Q(r)})}},Wi=class extends J{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};Wi.create=(t,e)=>new Wi({getter:t,typeName:q.ZodLazy,...Q(e)});var qi=class extends J{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return I(n,{received:n.data,code:R.invalid_literal,expected:this._def.value}),U}return{status:"valid",value:e.data}}get value(){return this._def.value}};qi.create=(t,e)=>new qi({value:t,typeName:q.ZodLiteral,...Q(e)});function pb(t,e){return new Ki({values:t,typeName:q.ZodEnum,...Q(e)})}var Ki=class t extends J{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return I(n,{expected:re.joinValues(r),received:n.parsedType,code:R.invalid_type}),U}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return I(n,{received:n.data,code:R.invalid_enum_value,options:r}),U}return lt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Ki.create=pb;var Gi=class extends J{_parse(e){let n=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==M.string&&r.parsedType!==M.number){let i=re.objectValues(n);return I(r,{expected:re.joinValues(i),received:r.parsedType,code:R.invalid_type}),U}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=re.objectValues(n);return I(r,{received:r.data,code:R.invalid_enum_value,options:i}),U}return lt(e.data)}get enum(){return this._def.values}};Gi.create=(t,e)=>new Gi({values:t,typeName:q.ZodNativeEnum,...Q(e)});var ai=class extends J{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.promise&&n.common.async===!1)return I(n,{code:R.invalid_type,expected:M.promise,received:n.parsedType}),U;let r=n.parsedType===M.promise?n.data:Promise.resolve(n.data);return lt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};ai.create=(t,e)=>new ai({type:t,typeName:q.ZodPromise,...Q(e)});var Jt=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{I(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return U;let l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?U:l.status==="dirty"?Fi(l.value):n.value==="dirty"?Fi(l.value):l});{if(n.value==="aborted")return U;let a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?U:a.status==="dirty"?Fi(a.value):n.value==="dirty"?Fi(a.value):a}}if(i.type==="refinement"){let s=a=>{let l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?U:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?U:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ii(s))return U;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>ii(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):U);re.assertNever(i)}};Jt.create=(t,e,n)=>new Jt({schema:t,typeName:q.ZodEffects,effect:e,...Q(n)});Jt.createWithPreprocess=(t,e,n)=>new Jt({schema:e,effect:{type:"preprocess",transform:t},typeName:q.ZodEffects,...Q(n)});var Xt=class extends J{_parse(e){return this._getType(e)===M.undefined?lt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Xt.create=(t,e)=>new Xt({innerType:t,typeName:q.ZodOptional,...Q(e)});var Nn=class extends J{_parse(e){return this._getType(e)===M.null?lt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Nn.create=(t,e)=>new Nn({innerType:t,typeName:q.ZodNullable,...Q(e)});var Zi=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===M.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Zi.create=(t,e)=>new Zi({innerType:t,typeName:q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Q(e)});var Yi=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return is(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Rt(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Rt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Yi.create=(t,e)=>new Yi({innerType:t,typeName:q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Q(e)});var us=class extends J{_parse(e){if(this._getType(e)!==M.nan){let r=this._getOrReturnCtx(e);return I(r,{code:R.invalid_type,expected:M.nan,received:r.parsedType}),U}return{status:"valid",value:e.data}}};us.create=t=>new us({typeName:q.ZodNaN,...Q(t)});var QP=Symbol("zod_brand"),Za=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Ya=class t extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?U:o.status==="dirty"?(n.dirty(),Fi(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?U:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:q.ZodPipeline})}},Xi=class extends J{_parse(e){let n=this._def.innerType._parse(e),r=i=>(ii(i)&&(i.value=Object.freeze(i.value)),i);return is(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Xi.create=(t,e)=>new Xi({innerType:t,typeName:q.ZodReadonly,...Q(e)});function cb(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function hb(t,e={},n){return t?si.create().superRefine((r,i)=>{let o=t(r);if(o instanceof Promise)return o.then(s=>{if(!s){let a=cb(e,r),l=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:l})}});if(!o){let s=cb(e,r),a=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:a})}}):si.create()}var JP={object:Tt.lazycreate},q;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(q||(q={}));var eI=(t,e={message:`Input not instance of ${t.name}`})=>hb(n=>n instanceof t,e),gb=oi.create,mb=$i.create,tI=us.create,nI=Di.create,vb=Bi.create,rI=Vi.create,iI=ss.create,oI=zi.create,sI=Hi.create,aI=si.create,lI=dr.create,cI=gn.create,uI=as.create,dI=fr.create,fI=Tt.create,pI=Tt.strictCreate,hI=ji.create,gI=Ku.create,mI=Ui.create,vI=On.create,yI=Gu.create,_I=ls.create,wI=cs.create,xI=Zu.create,SI=Wi.create,bI=qi.create,kI=Ki.create,EI=Gi.create,CI=ai.create,AI=Jt.create,RI=Xt.create,TI=Nn.create,PI=Jt.createWithPreprocess,II=Ya.create,OI=()=>gb().optional(),NI=()=>mb().optional(),LI=()=>vb().optional(),MI={string:(t=>oi.create({...t,coerce:!0})),number:(t=>$i.create({...t,coerce:!0})),boolean:(t=>Bi.create({...t,coerce:!0})),bigint:(t=>Di.create({...t,coerce:!0})),date:(t=>Vi.create({...t,coerce:!0}))};var FI=U;var xm=S.union([S.object({type:S.literal("data"),key:S.string(),value:S.string().optional()}),S.object({type:S.literal("css"),value:S.string()}),S.object({type:S.literal("aria"),role:S.string().optional(),label:S.string().optional()}),S.object({type:S.literal("shadow-css"),value:S.string()}),S.object({type:S.literal("ref"),el:S.any()})]),yb=S.object({kind:S.literal("tooltip"),id:S.string(),anchor:xm,content:S.object({title:S.string().optional(),body:S.string()}),placement:S.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:S.number().optional(),blocking:S.boolean().optional(),trigger:S.enum(["immediate","hover","click"]).optional(),dismiss:S.object({onEsc:S.boolean().optional(),closeButton:S.boolean().optional(),timeoutMs:S.number().optional()}).optional()}),_b=S.object({kind:S.literal("highlight"),id:S.string(),anchor:xm,copy:S.string().optional(),ring:S.object({paddingPx:S.number().optional(),radiusPx:S.number().optional()}).optional(),scrim:S.object({opacity:S.number().optional()}).optional(),ringColor:S.string().optional(),blocking:S.boolean().optional(),dismiss:S.object({onClickOutside:S.boolean().optional(),onEsc:S.boolean().optional(),timeoutMs:S.number().optional()}).optional()}),Yu=S.object({id:S.string(),version:S.number(),routes:S.array(S.string()).optional(),steps:S.array(S.union([yb,_b]))});function $I(t){return Yu.parse(t)}var DI=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let i=Vu({configUri:t,experiments:e,featureKey:n});if(!i)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(i,{credentials:r});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let s=await o.json();return Yu.parse(s)};var wb="syntro_session_metrics",Xa=class{constructor(e={}){j(this,"metrics",new Map);j(this,"experiments");j(this,"attributePrefix");j(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,n=1){let i=(this.metrics.get(e)??0)+n;return this.metrics.set(e,i),this.saveToStorage(),this.updateExperimentAttributes(e,i),this.onMetricChange?.(e,i),i}set(e,n){this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,n){return this.get(e)>=n}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let n={};for(let r of e)n[`${this.attributePrefix}${r}`]=0,this.onMetricChange?.(r,0);this.experiments?.setAttributes?.(n)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,n){if(!this.experiments?.setAttributes)return;let r=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[r]:n})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[n,r]of this.metrics)e[`${this.attributePrefix}${n}`]=r;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(wb);if(e){let n=JSON.parse(e);for(let[r,i]of Object.entries(n))this.metrics.set(r,i.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[n,r]of this.metrics)e[n]={count:r,lastUpdated:Date.now()};sessionStorage.setItem(wb,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Xu(t={}){return new Xa(t)}var xb=S.object({url:S.string(),routeId:S.string().optional(),title:S.string().optional(),locale:S.string().optional()}),Sb=S.object({url:S.string(),ts:S.number()}),bb=S.object({sessionId:S.string(),startTs:S.number(),pageHistory:S.array(Sb).optional()}),kb=S.object({width:S.number(),height:S.number()}),Eb=S.object({x:S.number(),y:S.number(),w:S.number(),h:S.number()}),Cb=S.object({anchorId:S.string(),present:S.boolean(),visible:S.boolean().optional(),boundingBox:Eb.optional()}),Ab=S.record(S.union([S.number(),S.string(),S.boolean(),S.undefined()])),Rb=S.object({page:xb,session:bb,viewport:kb,anchors:S.array(Cb).optional(),augmented:Ab.optional()});function BI(t){return Rb.safeParse(t)}function VI(){let t=Date.now();return{page:{url:typeof window<"u"?window.location.href:"",title:typeof document<"u"?document.title:void 0},session:{sessionId:"",startTs:t,pageHistory:[]},viewport:{width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0}}}function Sm(t,e){if(!e)return;let n;try{n=new URL(t).pathname}catch{n=t}if(e.exclude){for(let r of e.exclude)if(Tb(n,r))return}if(e.include){for(let r of e.include)if(Tb(n,r))return r;return}return n}function Tb(t,e){let n=t.replace(/\/$/,"")||"/",r=e.replace(/\/$/,"")||"/";if(n===r)return!0;let i=r.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(n)}var Qa=class{constructor(e={}){j(this,"context");j(this,"previousContext");j(this,"listeners",new Set);j(this,"telemetry");j(this,"routes");j(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.context=VI(),this.previousContext={...this.context},e.telemetry?.getSessionId){let n=e.telemetry.getSessionId();n&&(this.context.session.sessionId=n)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=Sm(this.context.page.url,this.routes),this.addPageToHistory(this.context.page.url),typeof window<"u"&&this.setupBrowserListeners()}get(){return{...this.context}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setRoutes(e){this.routes=e;let n=Sm(this.context.page.url,this.routes);n!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:n}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,n=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n));let r=()=>{this.updatePage()};window.addEventListener("popstate",r),this.cleanupFns.push(()=>window.removeEventListener("popstate",r));let i=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...s)=>{i(...s),this.updatePage()},history.replaceState=(...s)=>{o(...s),this.updatePage()},this.cleanupFns.push(()=>{history.pushState=i,history.replaceState=o})}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,n=document.title,r=Sm(e,this.routes),i={url:e,title:n,routeId:r};(i.url!==this.context.page.url||i.title!==this.context.page.title||i.routeId!==this.context.page.routeId)&&(i.url!==this.context.page.url&&this.addPageToHistory(i.url),this.updateContext({page:i}))}addPageToHistory(e){let n={url:e,ts:Date.now()},r=[...this.context.session.pageHistory||[],n];r.length>50&&r.shift(),this.context.session.pageHistory=r}updateContext(e){this.previousContext={...this.context},this.context={...this.context,...e},this.notifyListeners()}notifyListeners(){for(let e of this.listeners)try{e(this.context,this.previousContext)}catch(n){console.error("[ContextManager] Listener error:",n)}}};function Qu(t={}){return new Qa(t)}var bm=S.enum(["posthog","canvas","derived"]),Pb=S.object({ts:S.number(),name:S.string(),source:bm,props:S.record(S.unknown()).optional(),schemaVersion:S.string()}),Ib=S.object({names:S.array(S.string()).optional(),patterns:S.array(S.string()).optional(),sources:S.array(bm).optional()});function zI(t){return Pb.safeParse(t)}function HI(t){return Ib.safeParse(t)}function km(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(r=>{try{return new RegExp(r).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var Ja=class{constructor(e={}){j(this,"subscriptions",new Set);j(this,"history",[]);j(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,n){let r,i;typeof e=="function"?(r=void 0,i=e):(r=e,i=n);let o={filter:r,callback:i};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,n,r="canvas"){let i={ts:Date.now(),name:e,source:r,props:n,schemaVersion:_i};this.publishEvent(i)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(km(e,n.filter))try{n.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}getRecent(e,n){let r=this.history;return e&&(r=r.filter(i=>km(i,e))),n&&n>0&&(r=r.slice(-n)),r}hasRecentEvent(e,n,r){let i=Date.now()-n;return this.history.some(o=>o.name===e&&o.ts>=i&&(r===void 0||o.source===r))}countRecentEvents(e,n){let r=this.history.filter(i=>km(i,e));if(n!==void 0){let i=Date.now()-n;r=r.filter(o=>o.ts>=i)}return r.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function ds(t={}){return new Ja(t)}var Ob={$autocapture:"ui.click",$click:be.UI_CLICK,$scroll:be.UI_SCROLL,$input:be.UI_INPUT,$change:be.UI_CHANGE,$submit:be.UI_SUBMIT,$pageview:be.NAV_PAGE_VIEW,$pageleave:be.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function jI(t){let e=t.event;if(Ob[e])return Ob[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?be.UI_SUBMIT:r==="change"?be.UI_CHANGE:n==="input"||n==="textarea"?be.UI_INPUT:be.UI_CLICK}return e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function UI(t){let e={},n=t.properties||{};return n.$tag_name&&(e.tagName=n.$tag_name),n.$el_text&&(e.elementText=n.$el_text),n.$elements&&(e.elements=n.$elements),n.$current_url&&(e.url=n.$current_url),n.$pathname&&(e.pathname=n.$pathname),n.$host&&(e.host=n.$host),n.$viewport_width&&(e.viewportWidth=n.$viewport_width),n.$viewport_height&&(e.viewportHeight=n.$viewport_height),n.$session_id&&(e.sessionId=n.$session_id),n.$scroll_depth&&(e.scrollDepth=n.$scroll_depth),n.$scroll_percentage&&(e.scrollPercentage=n.$scroll_percentage),e.originalEvent=t.event,e}function Em(t){let e;return typeof t.timestamp=="number"?e=t.timestamp:typeof t.timestamp=="string"?e=new Date(t.timestamp).getTime():e=Date.now(),{ts:e,name:jI(t),source:"posthog",props:UI(t),schemaVersion:_i}}function Cm(t){let e=t.event;return!["$feature_flag_called","$feature_flags","$groups","$groupidentify","$set","$set_once","$unset","$create_alias","$capture_metrics","$performance_event","$web_vitals","$exception","$dead_click","$heatmap"].includes(e)}function Ju(t){return(e,n)=>{let r={event:e,properties:n,timestamp:Date.now()};if(Cm(r)){let i=Em(r);t(i)}}}var Nb=S.object({value:S.unknown(),expiresAt:S.number().optional()}),Lb=S.object({count:S.number(),resetAt:S.number().optional()});function WI(t){return Nb.safeParse(t)}function qI(t){return Lb.safeParse(t)}var el="dismissed:";function Mb(t,e){return{mark(n,r=!1){let i=el+n;(r?e:t).set(i,!0)},isDismissed(n){let r=el+n;return t.has(r)||e.has(r)},clear(n){let r=el+n;t.remove(r),e.remove(r)},clearAll(){for(let n of t.keys())n.startsWith(el)&&t.remove(n);for(let n of e.keys())n.startsWith(el)&&e.remove(n)}}}var Am="cooldown:";function Fb(t){return{set(e,n){let r=Am+e,i=Date.now()+n;t.set(r,i)},isActive(e){return this.remaining(e)>0},remaining(e){let n=Am+e,r=t.get(n);if(r===void 0)return 0;let i=r-Date.now();return i<=0?(t.remove(n),0):i},clear(e){let n=Am+e;t.remove(n)}}}var Rm="freq:";function $b(t){function e(n){let r=Rm+n,i=t.get(r);if(i){if(i.resetAt&&Date.now()>=i.resetAt){t.remove(r);return}return i}}return{increment(n,r){let i=Rm+n,o=e(n),s=(o?.count??0)+1,a={count:s,resetAt:o?.resetAt??(r?Date.now()+r:void 0)};return t.set(i,a),s},count(n){return e(n)?.count??0},reset(n){let r=Rm+n;t.remove(r)},hasReachedLimit(n,r){return this.count(n)>=r}}}var KI="syntro";function Tm(t,e){let n=`${e}:`;return{get(r){if(t)try{let i=t.getItem(n+r);if(!i)return;let o=JSON.parse(i);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(n+r);return}return o.value}catch{return}},set(r,i,o){if(t)try{let s={value:i,expiresAt:o?Date.now()+o:void 0};t.setItem(n+r,JSON.stringify(s))}catch(s){console.warn("[StateStore] Failed to save:",s)}},remove(r){t&&t.removeItem(n+r)},has(r){return t?this.get(r)!==void 0:!1},keys(){if(!t)return[];let r=[];for(let i=0;i<t.length;i++){let o=t.key(i);o?.startsWith(n)&&r.push(o.slice(n.length))}return r},clear(){if(!t)return;let r=this.keys();for(let i of r)t.removeItem(n+i)}}}function Pm(t){let e=new Map,n=`${t}:`;return{get(r){let i=e.get(n+r);if(i){if(i.expiresAt&&Date.now()>=i.expiresAt){e.delete(n+r);return}return i.value}},set(r,i,o){e.set(n+r,{value:i,expiresAt:o?Date.now()+o:void 0})},remove(r){e.delete(n+r)},has(r){return this.get(r)!==void 0},keys(){let r=[];for(let i of e.keys())i.startsWith(n)&&r.push(i.slice(n.length));return r},clear(){for(let r of e.keys())r.startsWith(n)&&e.delete(r)}}}var tl=class{constructor(e={}){j(this,"session");j(this,"user");j(this,"dismissals");j(this,"cooldowns");j(this,"frequency");j(this,"namespace");j(this,"namespacedStorages",new Map);this.namespace=e.namespace??KI,typeof window<"u"?(this.session=Tm(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=Tm(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=Pm(this.namespace),this.user=Pm(this.namespace)),this.dismissals=Mb(this.session,this.user),this.cooldowns=Fb(this.user),this.frequency=$b(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let r=typeof window<"u"&&typeof sessionStorage<"u"?Tm(sessionStorage,n):Pm(n);this.namespacedStorages.set(n,r)}return this.namespacedStorages.get(n)}};function ed(t={}){return new tl(t)}var Db=S.object({type:S.literal("page_url"),url:S.string()}),Bb=S.object({type:S.literal("route"),routeId:S.string()}),Vb=S.object({type:S.literal("anchor_visible"),anchorId:S.string(),state:S.enum(["visible","present","absent"])}),zb=S.object({type:S.literal("event_occurred"),eventName:S.string(),withinMs:S.number().optional()}),Hb=S.object({type:S.literal("state_equals"),key:S.string(),value:S.unknown()}),jb=S.object({type:S.literal("viewport"),minWidth:S.number().optional(),maxWidth:S.number().optional(),minHeight:S.number().optional(),maxHeight:S.number().optional()}),Ub=S.object({type:S.literal("session_metric"),key:S.string(),operator:S.enum(["gte","lte","eq","gt","lt"]),threshold:S.number()}),Wb=S.object({type:S.literal("dismissed"),key:S.string(),inverted:S.boolean().optional()}),qb=S.object({type:S.literal("cooldown_active"),key:S.string(),inverted:S.boolean().optional()}),Kb=S.object({type:S.literal("frequency_limit"),key:S.string(),limit:S.number(),inverted:S.boolean().optional()}),Im=S.discriminatedUnion("type",[Db,Bb,Vb,zb,Hb,jb,Ub,Wb,qb,Kb]),Gb=S.object({conditions:S.array(Im),value:S.unknown()}),Zb=S.object({type:S.literal("rules"),rules:S.array(Gb),default:S.unknown()}),Yb=S.object({type:S.literal("score"),field:S.string(),threshold:S.number(),above:S.unknown(),below:S.unknown()}),Xb=S.object({type:S.literal("model"),modelId:S.string(),inputs:S.array(S.string()),outputMapping:S.record(S.unknown()),default:S.unknown()}),Qb=S.object({type:S.literal("external"),endpoint:S.string(),method:S.enum(["GET","POST"]).optional(),default:S.unknown(),timeoutMs:S.number().optional()}),Om=S.discriminatedUnion("type",[Zb,Yb,Xb,Qb]),Jb=S.object({include:S.array(S.string()).optional(),exclude:S.array(S.string()).optional()}),ek=S.object({routes:Jb.optional(),strategy:Om.optional()});function GI(t){return Im.safeParse(t)}function ZI(t){return Om.safeParse(t)}function YI(t){return ek.safeParse(t)}function Nm(t,e){let{context:n,state:r,events:i}=e;switch(t.type){case"page_url":{let{url:o}=t,s=n.page.url,a=o.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${a}$`).test(s)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let o=n.anchors?.find(s=>s.anchorId===t.anchorId);switch(t.state){case"visible":return o?.visible===!0;case"present":return o?.present===!0;case"absent":return!o?.present;default:return!1}}case"event_occurred":{if(!i)return!1;let o=t.withinMs??6e4;return i.hasRecentEvent(t.eventName,o)}case"state_equals":return!1;case"viewport":{let{width:o,height:s}=n.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&s<t.minHeight||t.maxHeight!==void 0&&s>t.maxHeight)}case"session_metric":{if(!r)return!1;let o=r.getSessionMetric(t.key),{operator:s,threshold:a}=t;switch(s){case"gte":return o>=a;case"lte":return o<=a;case"eq":return o===a;case"gt":return o>a;case"lt":return o<a;default:return!1}}case"dismissed":{if(!r)return t.inverted??!1;let o=r.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!r)return t.inverted??!1;let o=r.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!r)return t.inverted??!1;let s=r.getFrequencyCount(t.key)>=t.limit;return t.inverted?!s:s}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function Lm(t,e){let n=[];for(let r of t.conditions){let i=Nm(r,e);if(n.push({condition:r,result:i}),!i)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function nl(t,e){for(let n=0;n<t.rules.length;n++){let r=t.rules[n],{matched:i,conditionResults:o}=Lm(r,e);if(i)return{value:r.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function rl(t,e){let{context:n}=e,r=n.augmented?.[t.field];return r===void 0||typeof r!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:r>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function tk(t,e){let{state:n,events:r,sessionMetrics:i}=e;return{context:t,state:n?{isDismissed:o=>n.dismissals.isDismissed(o),isCooldownActive:o=>n.cooldowns.isActive(o),getFrequencyCount:o=>n.frequency.count(o),getSessionMetric:o=>i?.get(o)??0}:void 0,events:r?{hasRecentEvent:(o,s)=>r.hasRecentEvent(o,s)}:void 0}}async function Mm(t,e,n={}){let r=tk(e,n);switch(t.type){case"rules":return nl(t,r);case"score":return rl(t,r);case"model":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"model"}};case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"external"}};default:return console.warn("[DecisionEngine] Unknown strategy type:",t.type),{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function Fm(t,e,n={}){let r=tk(e,n);switch(t.type){case"rules":return nl(t,r);case"score":return rl(t,r);case"model":case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:t.type}};default:return{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function td(t){return{evaluate:(e,n)=>Mm(e,n,t),evaluateSync:(e,n)=>Fm(e,n,t)}}var XI=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function $m(t){if(typeof window.Sanitizer=="function")try{let a=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(a),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let r=n.content,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;i.nextNode();){let s=i.currentNode,a=s.tagName.toLowerCase();if(!XI.has(a)){o.push(s);continue}for(let l of Array.from(s.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(f||h)&&s.removeAttribute(l.name)}}for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML}var nk=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=$m(t.html),i=document.createElement("div");i.setAttribute("data-syntro-action-id",e.generateId()),i.innerHTML=r;let o=null;switch(t.position){case"before":n.insertAdjacentElement("beforebegin",i);break;case"after":n.insertAdjacentElement("afterend",i);break;case"prepend":n.insertBefore(i,n.firstChild);break;case"append":n.appendChild(i);break;case"replace":o=n.innerHTML,n.replaceWith(i);break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position}),{cleanup:()=>{if(t.position==="replace"&&o!==null){let s=document.createElement(n.tagName);s.innerHTML=o,Array.from(n.attributes).forEach(a=>{s.setAttribute(a.name,a.value)}),i.replaceWith(s)}else i.remove()},updateFn:s=>{"html"in s&&typeof s.html=="string"&&(i.innerHTML=$m(s.html))}}},rk=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=r},updateFn:i=>{"text"in i&&typeof i.text=="string"&&(n.textContent=i.text)}}},ik=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);if(["onclick","onerror","onload","onmouseover","onfocus","onblur"].includes(t.attr.toLowerCase())||t.attr.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);let i=n.getAttribute(t.attr),o=n.hasAttribute(t.attr);return n.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{o&&i!==null?n.setAttribute(t.attr,i):n.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&n.setAttribute(t.attr,s.value)}}},ok=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=n.classList.contains(t.className);return n.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r||n.classList.remove(t.className)}}},sk=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=n.classList.contains(t.className);return n.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r&&n.classList.add(t.className)}}},ak=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=new Map;for(let i of Object.keys(t.styles)){let o=n.style.getPropertyValue(i);r.set(i,o)}for(let[i,o]of Object.entries(t.styles))n.style.setProperty(i,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[i,o]of r)o?n.style.setProperty(i,o):n.style.removeProperty(i)},updateFn:i=>{if("styles"in i&&typeof i.styles=="object"&&i.styles)for(let[o,s]of Object.entries(i.styles))n.style.setProperty(o,s)}}},Dm=[{kind:"content:insertHtml",executor:nk},{kind:"content:setText",executor:rk},{kind:"content:setAttr",executor:ik},{kind:"content:addClass",executor:ok},{kind:"content:removeClass",executor:sk},{kind:"content:setStyle",executor:ak}],lk={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:Dm};var ck=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function uk(t,e,n){let r=n?.paddingPx??12,i=n?.radiusPx??12,o=Math.min(Math.max(n?.scrimOpacity??.55,0),1),s=n?.ringColor??"var(--syntro-ring, #5b8cff)",a=n?.blocking??!1,l=n?.onClickOutside??!0,c=n?.onEsc??!0,u=getComputedStyle(document.documentElement),f=u.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=u.getPropertyValue("--syntro-ring").trim(),g=document.createElement("div");g.className="syntro-spotlight-scrim";let v=a||l;Object.assign(g.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:v?"auto":"none",background:f||`rgba(2, 6, 23, ${o})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(g),requestAnimationFrame(()=>g.style.opacity="1");let _=document.createElement("div");_.className="syntro-spotlight-ring",Object.assign(_.style,{position:"fixed",pointerEvents:"none",borderRadius:`${i}px`,border:`2px solid ${s||h||"#5b8cff"}`,boxShadow:"0 0 0 4px rgba(255,255,255,0.35)",zIndex:"2147483647",transition:"all 220ms cubic-bezier(0.16,1,0.3,1)"}),e.appendChild(_);let x=[];if(!ck)for(let P=0;P<4;P++){let A=document.createElement("div");A.style.position="fixed",A.style.background="inherit",x.push(A),g.appendChild(A)}let d=P=>{g.style.clipPath=P,g.style.webkitClipPath=P},p=()=>{let P=t.getBoundingClientRect(),A=Math.max(0,P.left-r),H=Math.max(0,P.top-r),K=Math.min(window.innerWidth,P.width+r*2),Y=Math.min(window.innerHeight,P.height+r*2);if(Object.assign(_.style,{left:`${A}px`,top:`${H}px`,width:`${K}px`,height:`${Y}px`}),ck){let W=window.innerWidth,le=window.innerHeight,B=Math.min(i,K/2,Y/2),X=`M 0 0 L ${W} 0 L ${W} ${le} L 0 ${le} Z`,D=`M ${A+B} ${H} A ${B} ${B} 0 0 0 ${A} ${H+B} L ${A} ${H+Y-B} A ${B} ${B} 0 0 0 ${A+B} ${H+Y} L ${A+K-B} ${H+Y} A ${B} ${B} 0 0 0 ${A+K} ${H+Y-B} L ${A+K} ${H+B} A ${B} ${B} 0 0 0 ${A+K-B} ${H} L ${A+B} ${H} Z`;d(`path('${X} ${D}')`)}else{let[W,le,B,X]=x;Object.assign(W.style,{left:"0px",top:"0px",width:"100vw",height:`${H}px`}),Object.assign(B.style,{left:"0px",top:`${H+Y}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(H+Y))}px`}),Object.assign(X.style,{left:"0px",top:`${H}px`,width:`${A}px`,height:`${Y}px`}),Object.assign(le.style,{left:`${A+K}px`,top:`${H}px`,width:`${Math.max(0,window.innerWidth-(A+K))}px`,height:`${Y}px`})}},m=new ResizeObserver(()=>requestAnimationFrame(p));m.observe(t);let y=()=>requestAnimationFrame(p),w=()=>requestAnimationFrame(p);window.addEventListener("scroll",y,!0),window.addEventListener("resize",w);let k=P=>{P.key==="Escape"&&c&&E.destroy()};c&&window.addEventListener("keydown",k);let b=P=>{a?(P.preventDefault(),P.stopPropagation()):l&&E.destroy()};g.addEventListener("click",b);let E={destroy(){m.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",w),c&&window.removeEventListener("keydown",k),g.removeEventListener("click",b),g.style.opacity="0",setTimeout(()=>{g.remove(),_.remove()},220)}};return p(),E}var pk=["top","right","bottom","left"];var en=Math.min,ct=Math.max,Ln=Math.round,Mn=Math.floor,Ie=t=>({x:t,y:t}),QI={left:"right",right:"left",bottom:"top",top:"bottom"},JI={start:"end",end:"start"};function rd(t,e,n){return ct(t,en(e,n))}function Qi(t,e){return typeof t=="function"?t(e):t}function li(t){return t.split("-")[0]}function fs(t){return t.split("-")[1]}function Bm(t){return t==="x"?"y":"x"}function id(t){return t==="y"?"height":"width"}var e2=new Set(["top","bottom"]);function pr(t){return e2.has(li(t))?"y":"x"}function od(t){return Bm(pr(t))}function hk(t,e,n){n===void 0&&(n=!1);let r=fs(t),i=od(t),o=id(i),s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=il(s)),[s,il(s)]}function gk(t){let e=il(t);return[nd(t),e,nd(e)]}function nd(t){return t.replace(/start|end/g,e=>JI[e])}var dk=["left","right"],fk=["right","left"],t2=["top","bottom"],n2=["bottom","top"];function r2(t,e,n){switch(t){case"top":case"bottom":return n?e?fk:dk:e?dk:fk;case"left":case"right":return e?t2:n2;default:return[]}}function mk(t,e,n,r){let i=fs(t),o=r2(li(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(nd)))),o}function il(t){return t.replace(/left|right|bottom|top/g,e=>QI[e])}function i2(t){return{top:0,right:0,bottom:0,left:0,...t}}function Vm(t){return typeof t!="number"?i2(t):{top:t,right:t,bottom:t,left:t}}function Fn(t){let{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function vk(t,e,n){let{reference:r,floating:i}=t,o=pr(e),s=od(e),a=id(s),l=li(e),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2,g;switch(l){case"top":g={x:u,y:r.y-i.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-i.width,y:f};break;default:g={x:r.x,y:r.y}}switch(fs(e)){case"start":g[s]-=h*(n&&c?-1:1);break;case"end":g[s]+=h*(n&&c?-1:1);break}return g}var sd=async(t,e,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=vk(c,r,l),h=r,g={},v=0;for(let _=0;_<a.length;_++){let{name:x,fn:d}=a[_],{x:p,y:m,data:y,reset:w}=await d({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:g,rects:c,platform:s,elements:{reference:t,floating:e}});u=p??u,f=m??f,g={...g,[x]:{...g[x],...y}},w&&v<=50&&(v++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:u,y:f}=vk(c,h,l)),_=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:g}};async function ps(t,e){var n;e===void 0&&(e={});let{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=Qi(e,t),v=Vm(g),x=a[h?f==="floating"?"reference":"floating":f],d=Fn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),p=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),y=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},w=Fn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:m,strategy:l}):p);return{top:(d.top-w.top+v.top)/y.y,bottom:(w.bottom-d.bottom+v.bottom)/y.y,left:(d.left-w.left+v.left)/y.x,right:(w.right-d.right+v.right)/y.x}}var zm=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=Qi(t,e)||{};if(c==null)return{};let f=Vm(u),h={x:n,y:r},g=od(i),v=id(g),_=await s.getDimensions(c),x=g==="y",d=x?"top":"left",p=x?"bottom":"right",m=x?"clientHeight":"clientWidth",y=o.reference[v]+o.reference[g]-h[g]-o.floating[v],w=h[g]-o.reference[g],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c)),b=k?k[m]:0;(!b||!await(s.isElement==null?void 0:s.isElement(k)))&&(b=a.floating[m]||o.floating[v]);let E=y/2-w/2,P=b/2-_[v]/2-1,A=en(f[d],P),H=en(f[p],P),K=A,Y=b-_[v]-H,W=b/2-_[v]/2+E,le=rd(K,W,Y),B=!l.arrow&&fs(i)!=null&&W!==le&&o.reference[v]/2-(W<K?A:H)-_[v]/2<0,X=B?W<K?W-K:W-Y:0;return{[g]:h[g]+X,data:{[g]:le,centerOffset:W-le-X,...B&&{alignmentOffset:X}},reset:B}}});var ad=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;let{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:_=!0,...x}=Qi(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let d=li(i),p=pr(a),m=li(a)===a,y=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(m||!_?[il(a)]:gk(a)),k=v!=="none";!h&&k&&w.push(...mk(a,_,v,y));let b=[a,...w],E=await ps(e,x),P=[],A=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&P.push(E[d]),f){let W=hk(i,s,y);P.push(E[W[0]],E[W[1]])}if(A=[...A,{placement:i,overflows:P}],!P.every(W=>W<=0)){var H,K;let W=(((H=o.flip)==null?void 0:H.index)||0)+1,le=b[W];if(le&&(!(f==="alignment"?p!==pr(le):!1)||A.every(D=>pr(D.placement)===p?D.overflows[0]>0:!0)))return{data:{index:W,overflows:A},reset:{placement:le}};let B=(K=A.filter(X=>X.overflows[0]<=0).sort((X,D)=>X.overflows[1]-D.overflows[1])[0])==null?void 0:K.placement;if(!B)switch(g){case"bestFit":{var Y;let X=(Y=A.filter(D=>{if(k){let Z=pr(D.placement);return Z===p||Z==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(Z=>Z>0).reduce((Z,vt)=>Z+vt,0)]).sort((D,Z)=>D[1]-Z[1])[0])==null?void 0:Y[0];X&&(B=X);break}case"initialPlacement":B=a;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function yk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function _k(t){return pk.some(e=>t[e]>=0)}var Hm=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n}=e,{strategy:r="referenceHidden",...i}=Qi(t,e);switch(r){case"referenceHidden":{let o=await ps(e,{...i,elementContext:"reference"}),s=yk(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:_k(s)}}}case"escaped":{let o=await ps(e,{...i,altBoundary:!0}),s=yk(o,n.floating);return{data:{escapedOffsets:s,escaped:_k(s)}}}default:return{}}}}};var o2=new Set(["left","top"]);async function s2(t,e){let{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=li(n),a=fs(n),l=pr(n)==="y",c=o2.has(s)?-1:1,u=o&&l?-1:1,f=Qi(e,t),{mainAxis:h,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*u,y:h*c}:{x:h*c,y:g*u}}var ld=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;let{x:i,y:o,placement:s,middlewareData:a}=e,l=await s2(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},cd=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:d,y:p}=x;return{x:d,y:p}}},...l}=Qi(t,e),c={x:n,y:r},u=await ps(e,l),f=pr(li(i)),h=Bm(f),g=c[h],v=c[f];if(o){let x=h==="y"?"top":"left",d=h==="y"?"bottom":"right",p=g+u[x],m=g-u[d];g=rd(p,g,m)}if(s){let x=f==="y"?"top":"left",d=f==="y"?"bottom":"right",p=v+u[x],m=v-u[d];v=rd(p,v,m)}let _=a.fn({...e,[h]:g,[f]:v});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[h]:o,[f]:s}}}}}};function ud(){return typeof window<"u"}function mn(t){return xk(t)?(t.nodeName||"").toLowerCase():"#document"}function Oe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $e(t){var e;return(e=(xk(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function xk(t){return ud()?t instanceof Node||t instanceof Oe(t).Node:!1}function Ne(t){return ud()?t instanceof Element||t instanceof Oe(t).Element:!1}function Ve(t){return ud()?t instanceof HTMLElement||t instanceof Oe(t).HTMLElement:!1}function wk(t){return!ud()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Oe(t).ShadowRoot}var a2=new Set(["inline","contents"]);function Dn(t){let{overflow:e,overflowX:n,overflowY:r,display:i}=Le(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!a2.has(i)}var l2=new Set(["table","td","th"]);function dd(t){return l2.has(mn(t))}var c2=[":popover-open",":modal"];function hr(t){return c2.some(e=>{try{return t.matches(e)}catch{return!1}})}var u2=["transform","translate","scale","rotate","perspective"],d2=["transform","translate","scale","rotate","perspective","filter"],f2=["paint","layout","strict","content"];function Ji(t){let e=eo(),n=Ne(t)?Le(t):t;return u2.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||d2.some(r=>(n.willChange||"").includes(r))||f2.some(r=>(n.contain||"").includes(r))}function fd(t){let e=mt(t);for(;Ve(e)&&!tn(e);){if(Ji(e))return e;if(hr(e))return null;e=mt(e)}return null}function eo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var p2=new Set(["html","body","#document"]);function tn(t){return p2.has(mn(t))}function Le(t){return Oe(t).getComputedStyle(t)}function Bn(t){return Ne(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function mt(t){if(mn(t)==="html")return t;let e=t.assignedSlot||t.parentNode||wk(t)&&t.host||$e(t);return wk(e)?e.host:e}function Sk(t){let e=mt(t);return tn(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ve(e)&&Dn(e)?e:Sk(e)}function $n(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Sk(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Oe(i);if(o){let a=to(s);return e.concat(s,s.visualViewport||[],Dn(i)?i:[],a&&n?$n(a):[])}return e.concat(i,$n(i,[],n))}function to(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ck(t){let e=Le(t),n=parseFloat(e.width)||0,r=parseFloat(e.height)||0,i=Ve(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Ln(n)!==o||Ln(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Um(t){return Ne(t)?t:t.contextElement}function hs(t){let e=Um(t);if(!Ve(e))return Ie(1);let n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Ck(e),s=(o?Ln(n.width):n.width)/r,a=(o?Ln(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var y2=Ie(0);function Ak(t){let e=Oe(t);return!eo()||!e.visualViewport?y2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function _2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Oe(t)?!1:e}function no(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=Um(t),s=Ie(1);e&&(r?Ne(r)&&(s=hs(r)):s=hs(t));let a=_2(o,n,r)?Ak(o):Ie(0),l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){let h=Oe(o),g=r&&Ne(r)?Oe(r):r,v=h,_=to(v);for(;_&&r&&g!==v;){let x=hs(_),d=_.getBoundingClientRect(),p=Le(_),m=d.left+(_.clientLeft+parseFloat(p.paddingLeft))*x.x,y=d.top+(_.clientTop+parseFloat(p.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,f*=x.y,l+=m,c+=y,v=Oe(_),_=to(v)}}return Fn({width:u,height:f,x:l,y:c})}function pd(t,e){let n=Bn(t).scrollLeft;return e?e.left+n:no($e(t)).left+n}function Rk(t,e){let n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-pd(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function w2(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t,o=i==="fixed",s=$e(r),a=e?hr(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Ie(1),u=Ie(0),f=Ve(r);if((f||!f&&!o)&&((mn(r)!=="body"||Dn(s))&&(l=Bn(r)),Ve(r))){let g=no(r);c=hs(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}let h=s&&!f&&!o?Rk(s,l):Ie(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function x2(t){return Array.from(t.getClientRects())}function S2(t){let e=$e(t),n=Bn(t),r=t.ownerDocument.body,i=ct(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ct(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+pd(t),a=-n.scrollTop;return Le(r).direction==="rtl"&&(s+=ct(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}var bk=25;function b2(t,e){let n=Oe(t),r=$e(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;let u=eo();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}let c=pd(r);if(c<=0){let u=r.ownerDocument,f=u.body,h=getComputedStyle(f),g=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-g);v<=bk&&(o-=v)}else c<=bk&&(o+=c);return{width:o,height:s,x:a,y:l}}var k2=new Set(["absolute","fixed"]);function E2(t,e){let n=no(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Ve(t)?hs(t):Ie(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function kk(t,e,n){let r;if(e==="viewport")r=b2(t,n);else if(e==="document")r=S2($e(t));else if(Ne(e))r=E2(e,n);else{let i=Ak(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Fn(r)}function Tk(t,e){let n=mt(t);return n===e||!Ne(n)||tn(n)?!1:Le(n).position==="fixed"||Tk(n,e)}function C2(t,e){let n=e.get(t);if(n)return n;let r=$n(t,[],!1).filter(a=>Ne(a)&&mn(a)!=="body"),i=null,o=Le(t).position==="fixed",s=o?mt(t):t;for(;Ne(s)&&!tn(s);){let a=Le(s),l=Ji(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&k2.has(i.position)||Dn(s)&&!l&&Tk(t,s))?r=r.filter(u=>u!==s):i=a,s=mt(s)}return e.set(t,r),r}function A2(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t,s=[...n==="clippingAncestors"?hr(e)?[]:C2(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{let f=kk(e,u,i);return c.top=ct(f.top,c.top),c.right=en(f.right,c.right),c.bottom=en(f.bottom,c.bottom),c.left=ct(f.left,c.left),c},kk(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function R2(t){let{width:e,height:n}=Ck(t);return{width:e,height:n}}function T2(t,e,n){let r=Ve(e),i=$e(e),o=n==="fixed",s=no(t,!0,o,e),a={scrollLeft:0,scrollTop:0},l=Ie(0);function c(){l.x=pd(i)}if(r||!r&&!o)if((mn(e)!=="body"||Dn(i))&&(a=Bn(e)),r){let g=no(e,!0,o,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else i&&c();o&&!r&&i&&c();let u=i&&!r&&!o?Rk(i,a):Ie(0),f=s.left+a.scrollLeft-l.x-u.x,h=s.top+a.scrollTop-l.y-u.y;return{x:f,y:h,width:s.width,height:s.height}}function jm(t){return Le(t).position==="static"}function Ek(t,e){if(!Ve(t)||Le(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $e(t)===n&&(n=n.ownerDocument.body),n}function Pk(t,e){let n=Oe(t);if(hr(t))return n;if(!Ve(t)){let i=mt(t);for(;i&&!tn(i);){if(Ne(i)&&!jm(i))return i;i=mt(i)}return n}let r=Ek(t,e);for(;r&&dd(r)&&jm(r);)r=Ek(r,e);return r&&tn(r)&&jm(r)&&!Ji(r)?n:r||fd(t)||n}var P2=async function(t){let e=this.getOffsetParent||Pk,n=this.getDimensions,r=await n(t.floating);return{reference:T2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function I2(t){return Le(t).direction==="rtl"}var O2={convertOffsetParentRelativeRectToViewportRelativeRect:w2,getDocumentElement:$e,getClippingRect:A2,getOffsetParent:Pk,getElementRects:P2,getClientRects:x2,getDimensions:R2,getScale:hs,isElement:Ne,isRTL:I2};function Ik(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function N2(t,e){let n=null,r,i=$e(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();let c=t.getBoundingClientRect(),{left:u,top:f,width:h,height:g}=c;if(a||e(),!h||!g)return;let v=Mn(f),_=Mn(i.clientWidth-(u+h)),x=Mn(i.clientHeight-(f+g)),d=Mn(u),m={rootMargin:-v+"px "+-_+"px "+-x+"px "+-d+"px",threshold:ct(0,en(1,l))||1},y=!0;function w(k){let b=k[0].intersectionRatio;if(b!==l){if(!y)return s();b?s(!1,b):r=setTimeout(()=>{s(!1,1e-7)},1e3)}b===1&&!Ik(c,t.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(w,{...m,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,m)}n.observe(t)}return s(!0),o}function Ok(t,e,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Um(t),u=i||o?[...c?$n(c):[],...$n(e)]:[];u.forEach(d=>{i&&d.addEventListener("scroll",n,{passive:!0}),o&&d.addEventListener("resize",n)});let f=c&&a?N2(c,n):null,h=-1,g=null;s&&(g=new ResizeObserver(d=>{let[p]=d;p&&p.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var m;(m=g)==null||m.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let v,_=l?no(t):null;l&&x();function x(){let d=no(t);_&&!Ik(_,d)&&n(),_=d,v=requestAnimationFrame(x)}return n(),()=>{var d;u.forEach(p=>{i&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),f?.(),(d=g)==null||d.disconnect(),g=null,l&&cancelAnimationFrame(v)}}var Nk=ld;var Lk=cd,Mk=ad;var Fk=Hm,$k=zm;var Dk=(t,e,n)=>{let r=new Map,i={platform:O2,...n},o={...i.platform,_c:r};return sd(t,e,{...i,platform:o})};var L2=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function Vt(t){if(typeof window.Sanitizer=="function")try{let a=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(a),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let r=n.content,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;i.nextNode();){let s=i.currentNode,a=s.tagName.toLowerCase();if(!L2.has(a)){o.push(s);continue}for(let l of Array.from(s.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(f||h)&&s.removeAttribute(l.name)}}for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML}function M2(t){let e=t.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight;if(!(e.width>n*.8||e.height>r*.8))return t;let o=Math.max(e.left,0),s=Math.max(e.top,0),a=Math.min(e.right,n),l=Math.min(e.bottom,r),c=(o+a)/2,u=(s+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:c,y:u,top:u,left:c,right:c,bottom:u}}}}function Bk(t,e,n){let r=t.getBoundingClientRect();r.width>window.innerWidth*.8||r.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let o=document.createElement("div");o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=Vt(n.html);let s=o.querySelectorAll("[data-syntro-action]"),a=d=>{let m=d.currentTarget.getAttribute("data-syntro-action");m&&n.onAction&&n.onAction(m)};s.forEach(d=>d.addEventListener("click",a));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let c=[Nk(n.offsetPx??8),Mk(),Lk({padding:8}),Fk(),$k({element:l})],u=n.placement&&n.placement!=="auto"?n.placement:"top",f=Ok(t,o,async()=>{let d=M2(t),p=await Dk(d,o,{placement:u,middleware:c}),{x:m,y,strategy:w,middlewareData:k,placement:b}=p;if(Object.assign(o.style,{left:`${m}px`,top:`${y}px`,position:w}),k.arrow){let{x:E,y:P}=k.arrow,A=b.split("-")[0],H={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:E!=null?`${E}px`:"",top:P!=null?`${P}px`:"",right:"",bottom:"",[H[A]]:"-4px"});let K={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${K[A]||"0deg"})`}}),h=d=>{d.key==="Escape"&&x.destroy()};window.addEventListener("keydown",h);let g=[];if(n.blocking){Array.from(document.body.children).forEach(p=>{p!==e&&p.getAttribute("inert")===null&&(p.setAttribute("inert",""),g.push(p.id||p.tagName))});let d=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(d.length>0){let p=d[0],m=d[d.length-1],y=w=>{w.key==="Tab"&&(w.shiftKey?document.activeElement===p&&(m.focus(),w.preventDefault()):document.activeElement===m&&(p.focus(),w.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>p.focus())}}let _=(()=>{if(n.trigger==="hover"){let d=()=>{o.style.visibility="visible",o.style.opacity="1"},p=()=>{o.style.visibility="hidden",o.style.opacity="0"};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",d),t.addEventListener("mouseleave",p),t.addEventListener("focus",d),t.addEventListener("blur",p),()=>{t.removeEventListener("mouseenter",d),t.removeEventListener("mouseleave",p),t.removeEventListener("focus",d),t.removeEventListener("blur",p)}}if(n.trigger==="click"){let d=()=>{o.style.visibility==="visible"?x.destroy():(o.style.visibility="visible",o.style.opacity="1")};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",d),()=>t.removeEventListener("click",d)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),x={el:o,destroy(){f(),_(),window.removeEventListener("keydown",h),s.forEach(d=>d.removeEventListener("click",a)),n.blocking&&Array.from(document.body.children).forEach(d=>{d!==e&&d.removeAttribute("inert")}),o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return x}var Wm=async(t,e)=>{let{content:n,size:r="md",blocking:i=!1,scrim:o,dismiss:s,ctaButtons:a}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
|
|
53
|
+
})();`}var rb="https://cdn.syntrologie.com/editor-sdk/latest/editor-sdk.js",ib=["cdn.syntrologie.com","api.syntrologie.com","dev-api.syntrologie.com","localhost","127.0.0.1",".syntrologie.com"];function xI(t){F("Syntro Runtime","Validating editor URL:",t);try{if(t.startsWith("/"))return F("Syntro Runtime","\u2713 Relative URL allowed (same-origin):",t),!0;let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);if(F("Syntro Runtime","Parsed URL:",{hostname:e.hostname,protocol:e.protocol,isLocalhost:n}),e.protocol!=="https:"&&!n)return wt("Syntro Runtime","\u274C Editor URL must use HTTPS:",t),!1;let r=ib.some(i=>i.startsWith(".")?e.hostname.endsWith(i)||e.hostname===i.slice(1):e.hostname===i);return F("Syntro Runtime","Host allowlist check:",{hostname:e.hostname,allowedHosts:ib,isAllowed:r}),r?(F("Syntro Runtime","\u2713 Editor URL validated"),!0):(wt("Syntro Runtime","\u274C Editor URL host not in allowlist:",e.hostname),!1)}catch(e){return wt("Syntro Runtime","\u274C Invalid editor URL: "+t,e),!1}}var SI=()=>{if(F("Syntro Runtime","====== EDITOR LOAD CHECK ======"),typeof window>"u")return F("Syntro Runtime","Not in browser - skipping editor"),!1;let t=new URLSearchParams(window.location.search);F("Syntro Runtime","URL:",window.location.href),F("Syntro Runtime","Search params:",window.location.search);let e=t.has("syntro_editor")||t.has("syntro-editor"),n=t.has("editor_token");if(F("Syntro Runtime","Editor flags:",{hasEditorFlag:e,hasEditorToken:n,syntro_editor:t.get("syntro_editor"),"syntro-editor":t.get("syntro-editor"),editor_token:n?`${t.get("editor_token")?.slice(0,10)}...`:"none"}),e&&!n)return wt("Syntro Runtime","\u274C Editor activation requires editor_token parameter"),F("Syntro Runtime","================================"),!1;let r=e&&n;return F("Syntro Runtime","Should load editor:",r),F("Syntro Runtime","================================"),r},bI=()=>{if(F("Syntro Runtime","====== AUDIT MODE CHECK ======"),typeof window>"u")return F("Syntro Runtime","Not in browser - skipping audit"),!1;let t=new URLSearchParams(window.location.search),e=t.has("syntro_audit"),n=t.has("audit_token"),r=t.get("audit_session_id");return F("Syntro Runtime","Audit flags:",{hasAuditFlag:e,hasAuditToken:n,auditSessionId:r?`${r.slice(0,8)}...`:"none",audit_token:n?`${t.get("audit_token")?.slice(0,10)}...`:"none"}),e?n?(F("Syntro Runtime","\u2713 Audit mode active"),F("Syntro Runtime","================================"),!0):(wt("Syntro Runtime","\u274C Audit activation requires audit_token parameter"),F("Syntro Runtime","================================"),!1):(F("Syntro Runtime","No syntro_audit param - not in audit mode"),F("Syntro Runtime","================================"),!1)},ob=()=>SI()?"editor":bI()?"audit":null;function kI(){if(typeof window>"u")return null;let t=new URLSearchParams(window.location.search);return t.get("editor_token")||t.get("audit_token")}var sb=async t=>{if(F("Syntro Runtime","====== LOAD EDITOR SDK ======"),typeof window>"u"){F("Syntro Runtime","Not in browser - skipping editor SDK load");return}if(window.SyntroEditor){F("Syntro Runtime","Editor SDK already loaded (window.SyntroEditor exists)");return}let e=typeof t=="string"?{editorUrl:t}:t??{},n=new URLSearchParams(window.location.search),r=n.get("syntro_editor_sdk_url"),i=n.get("api_base"),o=i?`${i}/api/editor/sdk/editor-sdk.js`:null,s=r||o||e.editorUrl||rb,a=kI();if(!a){wt("Syntro Runtime","\u274C No token found in URL params. SDK requires editor_token or audit_token."),F("Syntro Runtime","================================");return}let l=`${s}?token=${encodeURIComponent(a)}`;if(F("Syntro Runtime","Editor URL:",l),F("Syntro Runtime","Options:",{hasIntegrity:!!e.integrity,isDefault:s===rb,hasApiBase:!!i,tokenPrefix:a.slice(0,10)+"..."}),!xI(s)){console.error("[Syntro Runtime] \u274C BLOCKED: Editor from untrusted URL:",s),F("Syntro Runtime","================================");return}return F("Syntro Runtime","\u2713 URL validated, injecting script tag..."),new Promise((c,u)=>{let f=document.createElement("script");f.src=l,f.async=!0,e.integrity&&(f.integrity=e.integrity,f.crossOrigin="anonymous",F("Syntro Runtime","SRI integrity check enabled")),f.onload=()=>{F("Syntro Runtime","\u2713 Editor SDK script loaded successfully"),F("Syntro Runtime","window.SyntroEditor:",!!window.SyntroEditor),F("Syntro Runtime","================================"),c()},f.onerror=h=>{console.error("[Syntro Runtime] \u274C Failed to load Editor SDK:",h),console.error("[Syntro Runtime] URL attempted:",l),console.error("[Syntro Runtime] Check: Is the URL accessible? CORS? Network? Token valid?"),F("Syntro Runtime","================================"),u(h)},document.head.appendChild(f),F("Syntro Runtime","Script tag appended to <head>")})};var Uu=async(t={})=>{if(typeof window>"u"||typeof document>"u")throw new Error("SmartCanvas can only be created in a browser-like environment");let e=null;if(t.antiFlicker){let d=typeof t.antiFlicker=="object"?t.antiFlicker:{};e=tb(d)}let n=null,r=null,i=null,o=!0,s=t.runtime;async function a(d){!s?.actions||d.length===0||(i?.isApplied()&&await i.revertAll(),i=await s.actions.applyBatch(d))}async function l(){i?.isApplied()&&(await i.revertAll(),i=null)}if(t.fetcher)try{r=t.fetcher;let d=await t.fetcher();n=d,d.actions&&d.actions.length>0&&s?.actions&&await a(d.actions)}catch(d){console.error("[SmartCanvas] Error fetching/applying initial config:",d)}e&&e();let c=ob();c&&(console.log(`[SmartCanvas] Loading editor SDK for ${c} mode`),sb(t.editorUrl).catch(console.error)),gm();let u=document.createElement("smart-canvas");if(t.tokens)for(let[d,p]of Object.entries(t.tokens))u.style.setProperty(d,p);let f=()=>{let d=t.target??document.body;d&&d.appendChild(u)};document.body?f():document.addEventListener("DOMContentLoaded",f,{once:!0});let h=t.integrations?.experiments,g=t.integrations?.telemetry,v=t.fetcher??Ni({configUri:t.configUri,experiments:h,featureKey:t.configUriFeatureKey,credentials:t.fetchCredentials});r||(r=v);let _={fetcher:v,pollIntervalMs:t.pollIntervalMs,experiments:h,telemetry:g,runtime:s,overlayFetcher:t.overlayFetcher,overlayConfigUri:t.overlayConfigUri,overlayConfigFeatureKey:t.overlayConfigFeatureKey,overlayFetchCredentials:t.overlayFetchCredentials,configUri:t.configUri,configUriFeatureKey:t.configUriFeatureKey,fetchCredentials:t.fetchCredentials,theme:t.theme};u.mountReactApp(_),t.defaultOpen&&u.open();let x={el:u,open:()=>u.open(),close:()=>u.close(),destroy:()=>{l(),u.remove()},setTokens:d=>{for(let[p,m]of Object.entries(d))u.style.setProperty(p,m)},getConfig:async()=>{if(r)try{let d=await r();return n=d,d}catch(d){console.error("[SmartCanvas] Error fetching config:",d)}return n??{tiles:[],actions:[],fetchedAt:""}},updateConfig:async d=>{n=d,o&&await a(d.actions)},setEnabled:async d=>{o=d,d?n&&await a(n.actions):await l()},registerComponent:(d,p)=>u.registerComponent(d,p),setOverrideFetcher:d=>{r=d,u.setOverrideFetcher(d)},registerTelemetryProperties:d=>{g?.register?.(d)},getSessionId:()=>g?.getSessionId?.(),startSessionRecording:()=>{g?.startSessionRecording?.()},runtime:s};return typeof window<"u"&&c&&(window.__smartCanvasHandle=x),x};typeof window<"u"&&(window.SmartCanvas={async create(t){return Uu(t)}});var S={};fv(S,{BRAND:()=>YI,DIRTY:()=>Li,EMPTY_PATH:()=>TI,INVALID:()=>U,NEVER:()=>LP,OK:()=>lt,ParseStatus:()=>tt,Schema:()=>J,ZodAny:()=>oi,ZodArray:()=>dr,ZodBigInt:()=>Fi,ZodBoolean:()=>$i,ZodBranded:()=>Ga,ZodCatch:()=>Gi,ZodDate:()=>Di,ZodDefault:()=>Ki,ZodDiscriminatedUnion:()=>Ku,ZodEffects:()=>Jt,ZodEnum:()=>Wi,ZodError:()=>Tt,ZodFirstPartyTypeKind:()=>q,ZodFunction:()=>Zu,ZodIntersection:()=>Hi,ZodIssueCode:()=>T,ZodLazy:()=>ji,ZodLiteral:()=>Ui,ZodMap:()=>ss,ZodNaN:()=>ls,ZodNativeEnum:()=>qi,ZodNever:()=>gn,ZodNull:()=>Vi,ZodNullable:()=>On,ZodNumber:()=>Mi,ZodObject:()=>Rt,ZodOptional:()=>Xt,ZodParsedType:()=>M,ZodPipeline:()=>Za,ZodPromise:()=>si,ZodReadonly:()=>Zi,ZodRecord:()=>Gu,ZodSchema:()=>J,ZodSet:()=>as,ZodString:()=>ii,ZodSymbol:()=>is,ZodTransformer:()=>Jt,ZodTuple:()=>Pn,ZodType:()=>J,ZodUndefined:()=>Bi,ZodUnion:()=>zi,ZodUnknown:()=>ur,ZodVoid:()=>os,addIssueToContext:()=>P,any:()=>oP,array:()=>cP,bigint:()=>eP,boolean:()=>vb,coerce:()=>NP,custom:()=>hb,date:()=>tP,datetimeRegex:()=>fb,defaultErrorMap:()=>lr,discriminatedUnion:()=>pP,effect:()=>EP,enum:()=>SP,function:()=>_P,getErrorMap:()=>ts,getParsedType:()=>In,instanceof:()=>QI,intersection:()=>hP,isAborted:()=>Wu,isAsync:()=>ns,isDirty:()=>qu,isValid:()=>ri,late:()=>XI,lazy:()=>wP,literal:()=>xP,makeIssue:()=>Ka,map:()=>vP,nan:()=>JI,nativeEnum:()=>bP,never:()=>aP,null:()=>iP,nullable:()=>AP,number:()=>mb,object:()=>uP,objectUtil:()=>mm,oboolean:()=>OP,onumber:()=>PP,optional:()=>CP,ostring:()=>IP,pipeline:()=>RP,preprocess:()=>TP,promise:()=>kP,quotelessJson:()=>EI,record:()=>mP,set:()=>yP,setErrorMap:()=>AI,strictObject:()=>dP,string:()=>gb,symbol:()=>nP,transformer:()=>EP,tuple:()=>gP,undefined:()=>rP,union:()=>fP,unknown:()=>sP,util:()=>re,void:()=>lP});var re;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=r,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(re||(re={}));var mm;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(mm||(mm={}));var M=re.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),In=t=>{switch(typeof t){case"undefined":return M.undefined;case"string":return M.string;case"number":return Number.isNaN(t)?M.nan:M.number;case"boolean":return M.boolean;case"function":return M.function;case"bigint":return M.bigint;case"symbol":return M.symbol;case"object":return Array.isArray(t)?M.array:t===null?M.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?M.promise:typeof Map<"u"&&t instanceof Map?M.map:typeof Set<"u"&&t instanceof Set?M.set:typeof Date<"u"&&t instanceof Date?M.date:M.object;default:return M.unknown}};var T=re.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),EI=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Tt=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(o){return o.message},r={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){let c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,re.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];n[o]=n[o]||[],n[o].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Tt.create=t=>new Tt(t);var CI=(t,e)=>{let n;switch(t.code){case T.invalid_type:t.received===M.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case T.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,re.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:n=`Unrecognized key(s) in object: ${re.joinValues(t.keys,", ")}`;break;case T.invalid_union:n="Invalid input";break;case T.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${re.joinValues(t.options)}`;break;case T.invalid_enum_value:n=`Invalid enum value. Expected ${re.joinValues(t.options)}, received '${t.received}'`;break;case T.invalid_arguments:n="Invalid function arguments";break;case T.invalid_return_type:n="Invalid function return type";break;case T.invalid_date:n="Invalid date";break;case T.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:re.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case T.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case T.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case T.custom:n="Invalid input";break;case T.invalid_intersection_types:n="Intersection results could not be merged";break;case T.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case T.not_finite:n="Number must be finite";break;default:n=e.defaultError,re.assertNever(t)}return{message:n}},lr=CI;var ab=lr;function AI(t){ab=t}function ts(){return ab}var Ka=t=>{let{data:e,path:n,errorMaps:r,issueData:i}=t,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",l=r.filter(c=>!!c).slice().reverse();for(let c of l)a=c(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},TI=[];function P(t,e){let n=ts(),r=Ka({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===lr?void 0:lr].filter(i=>!!i)});t.common.issues.push(r)}var tt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let i of n){if(i.status==="aborted")return U;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let i of n){let o=await i.key,s=await i.value;r.push({key:o,value:s})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let i of n){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return U;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:e.value,value:r}}},U=Object.freeze({status:"aborted"}),Li=t=>({status:"dirty",value:t}),lt=t=>({status:"valid",value:t}),Wu=t=>t.status==="aborted",qu=t=>t.status==="dirty",ri=t=>t.status==="valid",ns=t=>typeof Promise<"u"&&t instanceof Promise;var z;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(z||(z={}));var Qt=class{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},lb=(t,e)=>{if(ri(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Tt(t.common.issues);return this._error=n,this._error}}};function Q(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{let{message:l}=t;return s.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:i}}var J=class{get description(){return this._def.description}_getType(e){return In(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:In(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new tt,ctx:{common:e.parent.common,data:e.data,parsedType:In(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(ns(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:In(e)},i=this._parseSync({data:e,path:r.path,parent:r});return lb(r,i)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:In(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return ri(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>ri(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:In(e)},i=this._parse({data:e,path:r.path,parent:r}),o=await(ns(i)?i:Promise.resolve(i));return lb(r,o)}refine(e,n){let r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:T.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Jt({schema:this,typeName:q.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Xt.create(this,this._def)}nullable(){return On.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dr.create(this)}promise(){return si.create(this,this._def)}or(e){return zi.create([this,e],this._def)}and(e){return Hi.create(this,e,this._def)}transform(e){return new Jt({...Q(this._def),schema:this,typeName:q.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Ki({...Q(this._def),innerType:this,defaultValue:n,typeName:q.ZodDefault})}brand(){return new Ga({typeName:q.ZodBranded,type:this,...Q(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Gi({...Q(this._def),innerType:this,catchValue:n,typeName:q.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Za.create(this,e)}readonly(){return Zi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},RI=/^c[^\s-]{8,}$/i,II=/^[0-9a-z]+$/,PI=/^[0-9A-HJKMNP-TV-Z]{26}$/i,OI=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,NI=/^[a-z0-9_-]{21}$/i,LI=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,MI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,FI=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$I="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",vm,DI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,BI=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,VI=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,zI=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,HI=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jI=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ub="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",UI=new RegExp(`^${ub}$`);function db(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function WI(t){return new RegExp(`^${db(t)}$`)}function fb(t){let e=`${ub}T${db(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function qI(t,e){return!!((e==="v4"||!e)&&DI.test(t)||(e==="v6"||!e)&&VI.test(t))}function KI(t,e){if(!LI.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function GI(t,e){return!!((e==="v4"||!e)&&BI.test(t)||(e==="v6"||!e)&&zI.test(t))}var ii=class t extends J{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==M.string){let o=this._getOrReturnCtx(e);return P(o,{code:T.invalid_type,expected:M.string,received:o.parsedType}),U}let r=new tt,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:T.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:T.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?P(i,{code:T.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&P(i,{code:T.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")FI.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"email",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")vm||(vm=new RegExp($I,"u")),vm.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"emoji",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")OI.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"uuid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")NI.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"nanoid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")RI.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cuid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")II.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cuid2",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")PI.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"ulid",code:T.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),P(i,{validation:"url",code:T.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"regex",code:T.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?fb(o).test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?UI.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?WI(o).test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{code:T.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?MI.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"duration",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?qI(e.data,o.version)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"ip",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?KI(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"jwt",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?GI(e.data,o.version)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"cidr",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?HI.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"base64",code:T.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?jI.test(e.data)||(i=this._getOrReturnCtx(e,i),P(i,{validation:"base64url",code:T.invalid_string,message:o.message}),r.dirty()):re.assertNever(o);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:T.invalid_string,...z.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...z.errToObj(e)})}url(e){return this._addCheck({kind:"url",...z.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...z.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...z.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...z.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...z.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...z.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...z.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...z.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...z.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...z.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...z.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...z.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...z.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...z.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...z.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...z.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...z.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...z.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...z.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...z.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...z.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...z.errToObj(n)})}nonempty(e){return this.min(1,z.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ii.create=t=>new ii({checks:[],typeName:q.ZodString,coerce:t?.coerce??!1,...Q(t)});function ZI(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}var Mi=class t extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==M.number){let o=this._getOrReturnCtx(e);return P(o,{code:T.invalid_type,expected:M.number,received:o.parsedType}),U}let r,i=new tt;for(let o of this._def.checks)o.kind==="int"?re.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:T.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?ZI(e.data,o.value)!==0&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),P(r,{code:T.not_finite,message:o.message}),i.dirty()):re.assertNever(o);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,z.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:z.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:z.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:z.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:z.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:z.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:z.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&re.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};Mi.create=t=>new Mi({checks:[],typeName:q.ZodNumber,coerce:t?.coerce||!1,...Q(t)});var Fi=class t extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==M.bigint)return this._getInvalidInput(e);let r,i=new tt;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),P(r,{code:T.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):re.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return P(n,{code:T.invalid_type,expected:M.bigint,received:n.parsedType}),U}gte(e,n){return this.setLimit("min",e,!0,z.toString(n))}gt(e,n){return this.setLimit("min",e,!1,z.toString(n))}lte(e,n){return this.setLimit("max",e,!0,z.toString(n))}lt(e,n){return this.setLimit("max",e,!1,z.toString(n))}setLimit(e,n,r,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:z.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:z.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:z.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:z.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:z.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:z.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};Fi.create=t=>new Fi({checks:[],typeName:q.ZodBigInt,coerce:t?.coerce??!1,...Q(t)});var $i=class extends J{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==M.boolean){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.boolean,received:r.parsedType}),U}return lt(e.data)}};$i.create=t=>new $i({typeName:q.ZodBoolean,coerce:t?.coerce||!1,...Q(t)});var Di=class t extends J{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==M.date){let o=this._getOrReturnCtx(e);return P(o,{code:T.invalid_type,expected:M.date,received:o.parsedType}),U}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return P(o,{code:T.invalid_date}),U}let r=new tt,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:T.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),P(i,{code:T.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):re.assertNever(o);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:z.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:z.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};Di.create=t=>new Di({checks:[],coerce:t?.coerce||!1,typeName:q.ZodDate,...Q(t)});var is=class extends J{_parse(e){if(this._getType(e)!==M.symbol){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.symbol,received:r.parsedType}),U}return lt(e.data)}};is.create=t=>new is({typeName:q.ZodSymbol,...Q(t)});var Bi=class extends J{_parse(e){if(this._getType(e)!==M.undefined){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.undefined,received:r.parsedType}),U}return lt(e.data)}};Bi.create=t=>new Bi({typeName:q.ZodUndefined,...Q(t)});var Vi=class extends J{_parse(e){if(this._getType(e)!==M.null){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.null,received:r.parsedType}),U}return lt(e.data)}};Vi.create=t=>new Vi({typeName:q.ZodNull,...Q(t)});var oi=class extends J{constructor(){super(...arguments),this._any=!0}_parse(e){return lt(e.data)}};oi.create=t=>new oi({typeName:q.ZodAny,...Q(t)});var ur=class extends J{constructor(){super(...arguments),this._unknown=!0}_parse(e){return lt(e.data)}};ur.create=t=>new ur({typeName:q.ZodUnknown,...Q(t)});var gn=class extends J{_parse(e){let n=this._getOrReturnCtx(e);return P(n,{code:T.invalid_type,expected:M.never,received:n.parsedType}),U}};gn.create=t=>new gn({typeName:q.ZodNever,...Q(t)});var os=class extends J{_parse(e){if(this._getType(e)!==M.undefined){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.void,received:r.parsedType}),U}return lt(e.data)}};os.create=t=>new os({typeName:q.ZodVoid,...Q(t)});var dr=class t extends J{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==M.array)return P(n,{code:T.invalid_type,expected:M.array,received:n.parsedType}),U;if(i.exactLength!==null){let s=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(s||a)&&(P(n,{code:s?T.too_big:T.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(P(n,{code:T.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(P(n,{code:T.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,a)=>i.type._parseAsync(new Qt(n,s,n.path,a)))).then(s=>tt.mergeArray(r,s));let o=[...n.data].map((s,a)=>i.type._parseSync(new Qt(n,s,n.path,a)));return tt.mergeArray(r,o)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:z.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:z.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:z.toString(n)}})}nonempty(e){return this.min(1,e)}};dr.create=(t,e)=>new dr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...Q(e)});function rs(t){if(t instanceof Rt){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Xt.create(rs(r))}return new Rt({...t._def,shape:()=>e})}else return t instanceof dr?new dr({...t._def,type:rs(t.element)}):t instanceof Xt?Xt.create(rs(t.unwrap())):t instanceof On?On.create(rs(t.unwrap())):t instanceof Pn?Pn.create(t.items.map(e=>rs(e))):t}var Rt=class t extends J{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=re.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==M.object){let c=this._getOrReturnCtx(e);return P(c,{code:T.invalid_type,expected:M.object,received:c.parsedType}),U}let{status:r,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof gn&&this._def.unknownKeys==="strip"))for(let c in i.data)s.includes(c)||a.push(c);let l=[];for(let c of s){let u=o[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Qt(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof gn){let c=this._def.unknownKeys;if(c==="passthrough")for(let u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(P(i,{code:T.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let u of a){let f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Qt(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let c=[];for(let u of l){let f=await u.key,h=await u.value;c.push({key:f,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>tt.mergeObjectSync(r,c)):tt.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return z.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:z.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:q.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of re.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of re.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return rs(this)}partial(e){let n={};for(let r of re.objectKeys(this.shape)){let i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of re.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof Xt;)o=o._def.innerType;n[r]=o}return new t({...this._def,shape:()=>n})}keyof(){return pb(re.objectKeys(this.shape))}};Rt.create=(t,e)=>new Rt({shape:()=>t,unknownKeys:"strip",catchall:gn.create(),typeName:q.ZodObject,...Q(e)});Rt.strictCreate=(t,e)=>new Rt({shape:()=>t,unknownKeys:"strict",catchall:gn.create(),typeName:q.ZodObject,...Q(e)});Rt.lazycreate=(t,e)=>new Rt({shape:t,unknownKeys:"strip",catchall:gn.create(),typeName:q.ZodObject,...Q(e)});var zi=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new Tt(a.ctx.common.issues));return P(n,{code:T.invalid_union,unionErrors:s}),U}if(n.common.async)return Promise.all(r.map(async o=>{let s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let l of r){let c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&s.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(l=>new Tt(l));return P(n,{code:T.invalid_union,unionErrors:a}),U}}get options(){return this._def.options}};zi.create=(t,e)=>new zi({options:t,typeName:q.ZodUnion,...Q(e)});var cr=t=>t instanceof ji?cr(t.schema):t instanceof Jt?cr(t.innerType()):t instanceof Ui?[t.value]:t instanceof Wi?t.options:t instanceof qi?re.objectValues(t.enum):t instanceof Ki?cr(t._def.innerType):t instanceof Bi?[void 0]:t instanceof Vi?[null]:t instanceof Xt?[void 0,...cr(t.unwrap())]:t instanceof On?[null,...cr(t.unwrap())]:t instanceof Ga||t instanceof Zi?cr(t.unwrap()):t instanceof Gi?cr(t._def.innerType):[],Ku=class t extends J{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.object)return P(n,{code:T.invalid_type,expected:M.object,received:n.parsedType}),U;let r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(P(n,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),U)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let i=new Map;for(let o of n){let s=cr(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:q.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:i,...Q(r)})}};function ym(t,e){let n=In(t),r=In(e);if(t===e)return{valid:!0,data:t};if(n===M.object&&r===M.object){let i=re.objectKeys(e),o=re.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let l=ym(t[a],e[a]);if(!l.valid)return{valid:!1};s[a]=l.data}return{valid:!0,data:s}}else if(n===M.array&&r===M.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],l=ym(s,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===M.date&&r===M.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var Hi=class extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=(o,s)=>{if(Wu(o)||Wu(s))return U;let a=ym(o.value,s.value);return a.valid?((qu(o)||qu(s))&&n.dirty(),{status:n.value,value:a.data}):(P(r,{code:T.invalid_intersection_types}),U)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};Hi.create=(t,e,n)=>new Hi({left:t,right:e,typeName:q.ZodIntersection,...Q(n)});var Pn=class t extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.array)return P(r,{code:T.invalid_type,expected:M.array,received:r.parsedType}),U;if(r.data.length<this._def.items.length)return P(r,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),U;!this._def.rest&&r.data.length>this._def.items.length&&(P(r,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let o=[...r.data].map((s,a)=>{let l=this._def.items[a]||this._def.rest;return l?l._parse(new Qt(r,s,r.path,a)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>tt.mergeArray(n,s)):tt.mergeArray(n,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Pn.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pn({items:t,typeName:q.ZodTuple,rest:null,...Q(e)})};var Gu=class t extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.object)return P(r,{code:T.invalid_type,expected:M.object,received:r.parsedType}),U;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in r.data)i.push({key:o._parse(new Qt(r,a,r.path,a)),value:s._parse(new Qt(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?tt.mergeObjectAsync(n,i):tt.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof J?new t({keyType:e,valueType:n,typeName:q.ZodRecord,...Q(r)}):new t({keyType:ii.create(),valueType:e,typeName:q.ZodRecord,...Q(n)})}},ss=class extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.map)return P(r,{code:T.invalid_type,expected:M.map,received:r.parsedType}),U;let i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new Qt(r,a,r.path,[c,"key"])),value:o._parse(new Qt(r,l,r.path,[c,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let l of s){let c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return U;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let l of s){let c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return U;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}};ss.create=(t,e,n)=>new ss({valueType:e,keyType:t,typeName:q.ZodMap,...Q(n)});var as=class t extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==M.set)return P(r,{code:T.invalid_type,expected:M.set,received:r.parsedType}),U;let i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(P(r,{code:T.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(P(r,{code:T.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());let o=this._def.valueType;function s(l){let c=new Set;for(let u of l){if(u.status==="aborted")return U;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}let a=[...r.data.values()].map((l,c)=>o._parse(new Qt(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>s(l)):s(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:z.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:z.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};as.create=(t,e)=>new as({valueType:t,minSize:null,maxSize:null,typeName:q.ZodSet,...Q(e)});var Zu=class t extends J{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.function)return P(n,{code:T.invalid_type,expected:M.function,received:n.parsedType}),U;function r(a,l){return Ka({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ts(),lr].filter(c=>!!c),issueData:{code:T.invalid_arguments,argumentsError:l}})}function i(a,l){return Ka({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ts(),lr].filter(c=>!!c),issueData:{code:T.invalid_return_type,returnTypeError:l}})}let o={errorMap:n.common.contextualErrorMap},s=n.data;if(this._def.returns instanceof si){let a=this;return lt(async function(...l){let c=new Tt([]),u=await a._def.args.parseAsync(l,o).catch(g=>{throw c.addIssue(r(l,g)),c}),f=await Reflect.apply(s,this,u);return await a._def.returns._def.type.parseAsync(f,o).catch(g=>{throw c.addIssue(i(f,g)),c})})}else{let a=this;return lt(function(...l){let c=a._def.args.safeParse(l,o);if(!c.success)throw new Tt([r(l,c.error)]);let u=Reflect.apply(s,this,c.data),f=a._def.returns.safeParse(u,o);if(!f.success)throw new Tt([i(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Pn.create(e).rest(ur.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||Pn.create([]).rest(ur.create()),returns:n||ur.create(),typeName:q.ZodFunction,...Q(r)})}},ji=class extends J{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};ji.create=(t,e)=>new ji({getter:t,typeName:q.ZodLazy,...Q(e)});var Ui=class extends J{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return P(n,{received:n.data,code:T.invalid_literal,expected:this._def.value}),U}return{status:"valid",value:e.data}}get value(){return this._def.value}};Ui.create=(t,e)=>new Ui({value:t,typeName:q.ZodLiteral,...Q(e)});function pb(t,e){return new Wi({values:t,typeName:q.ZodEnum,...Q(e)})}var Wi=class t extends J{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return P(n,{expected:re.joinValues(r),received:n.parsedType,code:T.invalid_type}),U}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return P(n,{received:n.data,code:T.invalid_enum_value,options:r}),U}return lt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};Wi.create=pb;var qi=class extends J{_parse(e){let n=re.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==M.string&&r.parsedType!==M.number){let i=re.objectValues(n);return P(r,{expected:re.joinValues(i),received:r.parsedType,code:T.invalid_type}),U}if(this._cache||(this._cache=new Set(re.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=re.objectValues(n);return P(r,{received:r.data,code:T.invalid_enum_value,options:i}),U}return lt(e.data)}get enum(){return this._def.values}};qi.create=(t,e)=>new qi({values:t,typeName:q.ZodNativeEnum,...Q(e)});var si=class extends J{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==M.promise&&n.common.async===!1)return P(n,{code:T.invalid_type,expected:M.promise,received:n.parsedType}),U;let r=n.parsedType===M.promise?n.data:Promise.resolve(n.data);return lt(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}};si.create=(t,e)=>new si({type:t,typeName:q.ZodPromise,...Q(e)});var Jt=class extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{P(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async a=>{if(n.value==="aborted")return U;let l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?U:l.status==="dirty"?Li(l.value):n.value==="dirty"?Li(l.value):l});{if(n.value==="aborted")return U;let a=this._def.schema._parseSync({data:s,path:r.path,parent:r});return a.status==="aborted"?U:a.status==="dirty"?Li(a.value):n.value==="dirty"?Li(a.value):a}}if(i.type==="refinement"){let s=a=>{let l=i.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?U:(a.status==="dirty"&&n.dirty(),s(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?U:(a.status==="dirty"&&n.dirty(),s(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ri(s))return U;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>ri(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:n.value,value:a})):U);re.assertNever(i)}};Jt.create=(t,e,n)=>new Jt({schema:t,typeName:q.ZodEffects,effect:e,...Q(n)});Jt.createWithPreprocess=(t,e,n)=>new Jt({schema:e,effect:{type:"preprocess",transform:t},typeName:q.ZodEffects,...Q(n)});var Xt=class extends J{_parse(e){return this._getType(e)===M.undefined?lt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Xt.create=(t,e)=>new Xt({innerType:t,typeName:q.ZodOptional,...Q(e)});var On=class extends J{_parse(e){return this._getType(e)===M.null?lt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};On.create=(t,e)=>new On({innerType:t,typeName:q.ZodNullable,...Q(e)});var Ki=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===M.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Ki.create=(t,e)=>new Ki({innerType:t,typeName:q.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Q(e)});var Gi=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ns(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Tt(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Tt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Gi.create=(t,e)=>new Gi({innerType:t,typeName:q.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Q(e)});var ls=class extends J{_parse(e){if(this._getType(e)!==M.nan){let r=this._getOrReturnCtx(e);return P(r,{code:T.invalid_type,expected:M.nan,received:r.parsedType}),U}return{status:"valid",value:e.data}}};ls.create=t=>new ls({typeName:q.ZodNaN,...Q(t)});var YI=Symbol("zod_brand"),Ga=class extends J{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},Za=class t extends J{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?U:o.status==="dirty"?(n.dirty(),Li(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?U:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:q.ZodPipeline})}},Zi=class extends J{_parse(e){let n=this._def.innerType._parse(e),r=i=>(ri(i)&&(i.value=Object.freeze(i.value)),i);return ns(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}};Zi.create=(t,e)=>new Zi({innerType:t,typeName:q.ZodReadonly,...Q(e)});function cb(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function hb(t,e={},n){return t?oi.create().superRefine((r,i)=>{let o=t(r);if(o instanceof Promise)return o.then(s=>{if(!s){let a=cb(e,r),l=a.fatal??n??!0;i.addIssue({code:"custom",...a,fatal:l})}});if(!o){let s=cb(e,r),a=s.fatal??n??!0;i.addIssue({code:"custom",...s,fatal:a})}}):oi.create()}var XI={object:Rt.lazycreate},q;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(q||(q={}));var QI=(t,e={message:`Input not instance of ${t.name}`})=>hb(n=>n instanceof t,e),gb=ii.create,mb=Mi.create,JI=ls.create,eP=Fi.create,vb=$i.create,tP=Di.create,nP=is.create,rP=Bi.create,iP=Vi.create,oP=oi.create,sP=ur.create,aP=gn.create,lP=os.create,cP=dr.create,uP=Rt.create,dP=Rt.strictCreate,fP=zi.create,pP=Ku.create,hP=Hi.create,gP=Pn.create,mP=Gu.create,vP=ss.create,yP=as.create,_P=Zu.create,wP=ji.create,xP=Ui.create,SP=Wi.create,bP=qi.create,kP=si.create,EP=Jt.create,CP=Xt.create,AP=On.create,TP=Jt.createWithPreprocess,RP=Za.create,IP=()=>gb().optional(),PP=()=>mb().optional(),OP=()=>vb().optional(),NP={string:(t=>ii.create({...t,coerce:!0})),number:(t=>Mi.create({...t,coerce:!0})),boolean:(t=>$i.create({...t,coerce:!0})),bigint:(t=>Fi.create({...t,coerce:!0})),date:(t=>Di.create({...t,coerce:!0}))};var LP=U;var _m=S.union([S.object({type:S.literal("data"),key:S.string(),value:S.string().optional()}),S.object({type:S.literal("css"),value:S.string()}),S.object({type:S.literal("aria"),role:S.string().optional(),label:S.string().optional()}),S.object({type:S.literal("shadow-css"),value:S.string()}),S.object({type:S.literal("ref"),el:S.any()})]),yb=S.object({kind:S.literal("tooltip"),id:S.string(),anchor:_m,content:S.object({title:S.string().optional(),body:S.string()}),placement:S.enum(["top","bottom","left","right","auto"]).optional(),offsetPx:S.number().optional(),blocking:S.boolean().optional(),trigger:S.enum(["immediate","hover","click"]).optional(),dismiss:S.object({onEsc:S.boolean().optional(),closeButton:S.boolean().optional(),timeoutMs:S.number().optional()}).optional()}),_b=S.object({kind:S.literal("highlight"),id:S.string(),anchor:_m,copy:S.string().optional(),ring:S.object({paddingPx:S.number().optional(),radiusPx:S.number().optional()}).optional(),scrim:S.object({opacity:S.number().optional()}).optional(),ringColor:S.string().optional(),blocking:S.boolean().optional(),dismiss:S.object({onClickOutside:S.boolean().optional(),onEsc:S.boolean().optional(),timeoutMs:S.number().optional()}).optional()}),Yu=S.object({id:S.string(),version:S.number(),routes:S.array(S.string()).optional(),steps:S.array(S.union([yb,_b]))});function MP(t){return Yu.parse(t)}var FP=({configUri:t,experiments:e,featureKey:n="smart-canvas-overlay-uri",credentials:r="include"}={})=>async()=>{let i=zu({configUri:t,experiments:e,featureKey:n});if(!i)throw new Error("SmartCanvas overlays: recipe URI missing (env + feature unset).");let o=await fetch(i,{credentials:r});if(!o.ok)throw new Error(`SmartCanvas overlays: failed to fetch recipe (${o.status})`);let s=await o.json();return Yu.parse(s)};var wb="syntro_session_metrics",Ya=class{constructor(e={}){j(this,"metrics",new Map);j(this,"experiments");j(this,"attributePrefix");j(this,"onMetricChange");this.experiments=e.experiments,this.attributePrefix=e.attributePrefix??"session_",this.onMetricChange=e.onMetricChange,this.loadFromStorage()}increment(e,n=1){let i=(this.metrics.get(e)??0)+n;return this.metrics.set(e,i),this.saveToStorage(),this.updateExperimentAttributes(e,i),this.onMetricChange?.(e,i),i}set(e,n){this.metrics.set(e,n),this.saveToStorage(),this.updateExperimentAttributes(e,n),this.onMetricChange?.(e,n)}get(e){return this.metrics.get(e)??0}meetsThreshold(e,n){return this.get(e)>=n}getAll(){return Object.fromEntries(this.metrics)}reset(e){this.metrics.delete(e),this.saveToStorage(),this.updateExperimentAttributes(e,0),this.onMetricChange?.(e,0)}resetAll(){let e=Array.from(this.metrics.keys());this.metrics.clear(),this.saveToStorage();let n={};for(let r of e)n[`${this.attributePrefix}${r}`]=0,this.onMetricChange?.(r,0);this.experiments?.setAttributes?.(n)}setExperiments(e){this.experiments=e,this.syncAllToExperiments()}updateExperimentAttributes(e,n){if(!this.experiments?.setAttributes)return;let r=`${this.attributePrefix}${e}`;this.experiments.setAttributes({[r]:n})}syncAllToExperiments(){if(!this.experiments?.setAttributes)return;let e={};for(let[n,r]of this.metrics)e[`${this.attributePrefix}${n}`]=r;this.experiments.setAttributes(e)}loadFromStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e=sessionStorage.getItem(wb);if(e){let n=JSON.parse(e);for(let[r,i]of Object.entries(n))this.metrics.set(r,i.count)}}catch(e){console.warn("[SessionMetricTracker] Failed to load from sessionStorage:",e)}}saveToStorage(){if(!(typeof window>"u"||typeof sessionStorage>"u"))try{let e={};for(let[n,r]of this.metrics)e[n]={count:r,lastUpdated:Date.now()};sessionStorage.setItem(wb,JSON.stringify(e))}catch(e){console.warn("[SessionMetricTracker] Failed to save to sessionStorage:",e)}}};function Xu(t={}){return new Ya(t)}var xb=S.object({url:S.string(),routeId:S.string().optional(),title:S.string().optional(),locale:S.string().optional()}),Sb=S.object({url:S.string(),ts:S.number()}),bb=S.object({sessionId:S.string(),startTs:S.number(),pageHistory:S.array(Sb).optional()}),kb=S.object({width:S.number(),height:S.number()}),Eb=S.object({x:S.number(),y:S.number(),w:S.number(),h:S.number()}),Cb=S.object({anchorId:S.string(),present:S.boolean(),visible:S.boolean().optional(),boundingBox:Eb.optional()}),Ab=S.record(S.union([S.number(),S.string(),S.boolean(),S.undefined()])),Tb=S.object({page:xb,session:bb,viewport:kb,anchors:S.array(Cb).optional(),augmented:Ab.optional()});function $P(t){return Tb.safeParse(t)}function DP(){let t=Date.now();return{page:{url:typeof window<"u"?window.location.href:"",title:typeof document<"u"?document.title:void 0},session:{sessionId:"",startTs:t,pageHistory:[]},viewport:{width:typeof window<"u"?window.innerWidth:0,height:typeof window<"u"?window.innerHeight:0}}}function wm(t,e){if(!e)return;let n;try{n=new URL(t).pathname}catch{n=t}if(e.exclude){for(let r of e.exclude)if(Rb(n,r))return}if(e.include){for(let r of e.include)if(Rb(n,r))return r;return}return n}function Rb(t,e){let n=t.replace(/\/$/,"")||"/",r=e.replace(/\/$/,"")||"/";if(n===r)return!0;let i=r.replace(/:[^/]+/g,"[^/]+").replace(/\*/g,".*");return new RegExp(`^${i}$`).test(n)}var Xa=class{constructor(e={}){j(this,"context");j(this,"previousContext");j(this,"listeners",new Set);j(this,"telemetry");j(this,"routes");j(this,"cleanupFns",[]);if(this.telemetry=e.telemetry,this.routes=e.routes,this.context=DP(),this.previousContext={...this.context},e.telemetry?.getSessionId){let n=e.telemetry.getSessionId();n&&(this.context.session.sessionId=n)}e.initialPageHistory&&(this.context.session.pageHistory=e.initialPageHistory),this.context.page.routeId=wm(this.context.page.url,this.routes),this.addPageToHistory(this.context.page.url),typeof window<"u"&&this.setupBrowserListeners()}get(){return{...this.context}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setRoutes(e){this.routes=e;let n=wm(this.context.page.url,this.routes);n!==this.context.page.routeId&&this.updateContext({page:{...this.context.page,routeId:n}})}setAnchors(e){this.updateContext({anchors:e})}setSessionId(e){e!==this.context.session.sessionId&&this.updateContext({session:{...this.context.session,sessionId:e}})}destroy(){for(let e of this.cleanupFns)e();this.cleanupFns=[],this.listeners.clear()}setupBrowserListeners(){let e,n=()=>{clearTimeout(e),e=setTimeout(()=>{this.updateViewport()},100)};window.addEventListener("resize",n),this.cleanupFns.push(()=>window.removeEventListener("resize",n));let r=()=>{this.updatePage()};window.addEventListener("popstate",r),this.cleanupFns.push(()=>window.removeEventListener("popstate",r));let i=history.pushState.bind(history),o=history.replaceState.bind(history);history.pushState=(...s)=>{i(...s),this.updatePage()},history.replaceState=(...s)=>{o(...s),this.updatePage()},this.cleanupFns.push(()=>{history.pushState=i,history.replaceState=o})}updateViewport(){let e={width:window.innerWidth,height:window.innerHeight};(e.width!==this.context.viewport.width||e.height!==this.context.viewport.height)&&this.updateContext({viewport:e})}updatePage(){let e=window.location.href,n=document.title,r=wm(e,this.routes),i={url:e,title:n,routeId:r};(i.url!==this.context.page.url||i.title!==this.context.page.title||i.routeId!==this.context.page.routeId)&&(i.url!==this.context.page.url&&this.addPageToHistory(i.url),this.updateContext({page:i}))}addPageToHistory(e){let n={url:e,ts:Date.now()},r=[...this.context.session.pageHistory||[],n];r.length>50&&r.shift(),this.context.session.pageHistory=r}updateContext(e){this.previousContext={...this.context},this.context={...this.context,...e},this.notifyListeners()}notifyListeners(){for(let e of this.listeners)try{e(this.context,this.previousContext)}catch(n){console.error("[ContextManager] Listener error:",n)}}};function Qu(t={}){return new Xa(t)}var xm=S.enum(["posthog","canvas","derived"]),Ib=S.object({ts:S.number(),name:S.string(),source:xm,props:S.record(S.unknown()).optional(),schemaVersion:S.string()}),Pb=S.object({names:S.array(S.string()).optional(),patterns:S.array(S.string()).optional(),sources:S.array(xm).optional()});function BP(t){return Ib.safeParse(t)}function VP(t){return Pb.safeParse(t)}function Sm(t,e){return e?!(e.names&&e.names.length>0&&!e.names.includes(t.name)||e.patterns&&e.patterns.length>0&&!e.patterns.some(r=>{try{return new RegExp(r).test(t.name)}catch{return!1}})||e.sources&&e.sources.length>0&&!e.sources.includes(t.source)):!0}var Qa=class{constructor(e={}){j(this,"subscriptions",new Set);j(this,"history",[]);j(this,"maxHistorySize");this.maxHistorySize=e.maxHistorySize??100}subscribe(e,n){let r,i;typeof e=="function"?(r=void 0,i=e):(r=e,i=n);let o={filter:r,callback:i};return this.subscriptions.add(o),()=>{this.subscriptions.delete(o)}}publish(e,n,r="canvas"){let i={ts:Date.now(),name:e,source:r,props:n,schemaVersion:vi};this.publishEvent(i)}publishEvent(e){this.history.push(e),this.history.length>this.maxHistorySize&&this.history.shift();for(let n of this.subscriptions)if(Sm(e,n.filter))try{n.callback(e)}catch(r){console.error("[EventBus] Subscriber error:",r)}}getRecent(e,n){let r=this.history;return e&&(r=r.filter(i=>Sm(i,e))),n&&n>0&&(r=r.slice(-n)),r}hasRecentEvent(e,n,r){let i=Date.now()-n;return this.history.some(o=>o.name===e&&o.ts>=i&&(r===void 0||o.source===r))}countRecentEvents(e,n){let r=this.history.filter(i=>Sm(i,e));if(n!==void 0){let i=Date.now()-n;r=r.filter(o=>o.ts>=i)}return r.length}clearHistory(){this.history=[]}getSubscriberCount(){return this.subscriptions.size}};function cs(t={}){return new Qa(t)}var Ob={$autocapture:"ui.click",$click:be.UI_CLICK,$scroll:be.UI_SCROLL,$input:be.UI_INPUT,$change:be.UI_CHANGE,$submit:be.UI_SUBMIT,$pageview:be.NAV_PAGE_VIEW,$pageleave:be.NAV_PAGE_LEAVE,$session_start:"session.start",$identify:"user.identify"};function zP(t){let e=t.event;if(Ob[e])return Ob[e];if(e==="$autocapture"){let n=t.properties?.$tag_name,r=t.properties?.$event_type;return r==="submit"?be.UI_SUBMIT:r==="change"?be.UI_CHANGE:n==="input"||n==="textarea"?be.UI_INPUT:be.UI_CLICK}return typeof e!="string"?"posthog.unknown":e.startsWith("$")?e.replace("$","posthog."):`posthog.${e}`}function HP(t){let e={},n=t.properties||{};return n.$tag_name&&(e.tagName=n.$tag_name),n.$el_text&&(e.elementText=n.$el_text),n.$elements&&(e.elements=n.$elements),n.$current_url&&(e.url=n.$current_url),n.$pathname&&(e.pathname=n.$pathname),n.$host&&(e.host=n.$host),n.$viewport_width&&(e.viewportWidth=n.$viewport_width),n.$viewport_height&&(e.viewportHeight=n.$viewport_height),n.$session_id&&(e.sessionId=n.$session_id),n.$scroll_depth&&(e.scrollDepth=n.$scroll_depth),n.$scroll_percentage&&(e.scrollPercentage=n.$scroll_percentage),e.originalEvent=t.event,e}function bm(t){let e;return typeof t.timestamp=="number"?e=t.timestamp:typeof t.timestamp=="string"?e=new Date(t.timestamp).getTime():e=Date.now(),{ts:e,name:zP(t),source:"posthog",props:HP(t),schemaVersion:vi}}function km(t){let e=t.event;return!(typeof e!="string"||["$feature_flag_called","$feature_flags","$groups","$groupidentify","$set","$set_once","$unset","$create_alias","$capture_metrics","$performance_event","$web_vitals","$exception","$dead_click","$heatmap"].includes(e))}function Ju(t){return(e,n)=>{if(typeof e!="string")return;let r={event:e,properties:n,timestamp:Date.now()};if(km(r)){let i=bm(r);t(i)}}}var Nb=S.object({value:S.unknown(),expiresAt:S.number().optional()}),Lb=S.object({count:S.number(),resetAt:S.number().optional()});function jP(t){return Nb.safeParse(t)}function UP(t){return Lb.safeParse(t)}var Ja="dismissed:";function Mb(t,e){return{mark(n,r=!1){let i=Ja+n;(r?e:t).set(i,!0)},isDismissed(n){let r=Ja+n;return t.has(r)||e.has(r)},clear(n){let r=Ja+n;t.remove(r),e.remove(r)},clearAll(){for(let n of t.keys())n.startsWith(Ja)&&t.remove(n);for(let n of e.keys())n.startsWith(Ja)&&e.remove(n)}}}var Em="cooldown:";function Fb(t){return{set(e,n){let r=Em+e,i=Date.now()+n;t.set(r,i)},isActive(e){return this.remaining(e)>0},remaining(e){let n=Em+e,r=t.get(n);if(r===void 0)return 0;let i=r-Date.now();return i<=0?(t.remove(n),0):i},clear(e){let n=Em+e;t.remove(n)}}}var Cm="freq:";function $b(t){function e(n){let r=Cm+n,i=t.get(r);if(i){if(i.resetAt&&Date.now()>=i.resetAt){t.remove(r);return}return i}}return{increment(n,r){let i=Cm+n,o=e(n),s=(o?.count??0)+1,a={count:s,resetAt:o?.resetAt??(r?Date.now()+r:void 0)};return t.set(i,a),s},count(n){return e(n)?.count??0},reset(n){let r=Cm+n;t.remove(r)},hasReachedLimit(n,r){return this.count(n)>=r}}}var WP="syntro";function Am(t,e){let n=`${e}:`;return{get(r){if(t)try{let i=t.getItem(n+r);if(!i)return;let o=JSON.parse(i);if(o.expiresAt&&Date.now()>=o.expiresAt){t.removeItem(n+r);return}return o.value}catch{return}},set(r,i,o){if(t)try{let s={value:i,expiresAt:o?Date.now()+o:void 0};t.setItem(n+r,JSON.stringify(s))}catch(s){console.warn("[StateStore] Failed to save:",s)}},remove(r){t&&t.removeItem(n+r)},has(r){return t?this.get(r)!==void 0:!1},keys(){if(!t)return[];let r=[];for(let i=0;i<t.length;i++){let o=t.key(i);o?.startsWith(n)&&r.push(o.slice(n.length))}return r},clear(){if(!t)return;let r=this.keys();for(let i of r)t.removeItem(n+i)}}}function Tm(t){let e=new Map,n=`${t}:`;return{get(r){let i=e.get(n+r);if(i){if(i.expiresAt&&Date.now()>=i.expiresAt){e.delete(n+r);return}return i.value}},set(r,i,o){e.set(n+r,{value:i,expiresAt:o?Date.now()+o:void 0})},remove(r){e.delete(n+r)},has(r){return this.get(r)!==void 0},keys(){let r=[];for(let i of e.keys())i.startsWith(n)&&r.push(i.slice(n.length));return r},clear(){for(let r of e.keys())r.startsWith(n)&&e.delete(r)}}}var el=class{constructor(e={}){j(this,"session");j(this,"user");j(this,"dismissals");j(this,"cooldowns");j(this,"frequency");j(this,"namespace");j(this,"namespacedStorages",new Map);this.namespace=e.namespace??WP,typeof window<"u"?(this.session=Am(typeof sessionStorage<"u"?sessionStorage:void 0,this.namespace),this.user=Am(typeof localStorage<"u"?localStorage:void 0,this.namespace)):(this.session=Tm(this.namespace),this.user=Tm(this.namespace)),this.dismissals=Mb(this.session,this.user),this.cooldowns=Fb(this.user),this.frequency=$b(this.session)}ns(e){let n=`${this.namespace}:${e}`;if(!this.namespacedStorages.has(n)){let r=typeof window<"u"&&typeof sessionStorage<"u"?Am(sessionStorage,n):Tm(n);this.namespacedStorages.set(n,r)}return this.namespacedStorages.get(n)}};function ed(t={}){return new el(t)}var Db=S.object({type:S.literal("page_url"),url:S.string()}),Bb=S.object({type:S.literal("route"),routeId:S.string()}),Vb=S.object({type:S.literal("anchor_visible"),anchorId:S.string(),state:S.enum(["visible","present","absent"])}),zb=S.object({type:S.literal("event_occurred"),eventName:S.string(),withinMs:S.number().optional()}),Hb=S.object({type:S.literal("state_equals"),key:S.string(),value:S.unknown()}),jb=S.object({type:S.literal("viewport"),minWidth:S.number().optional(),maxWidth:S.number().optional(),minHeight:S.number().optional(),maxHeight:S.number().optional()}),Ub=S.object({type:S.literal("session_metric"),key:S.string(),operator:S.enum(["gte","lte","eq","gt","lt"]),threshold:S.number()}),Wb=S.object({type:S.literal("dismissed"),key:S.string(),inverted:S.boolean().optional()}),qb=S.object({type:S.literal("cooldown_active"),key:S.string(),inverted:S.boolean().optional()}),Kb=S.object({type:S.literal("frequency_limit"),key:S.string(),limit:S.number(),inverted:S.boolean().optional()}),Rm=S.discriminatedUnion("type",[Db,Bb,Vb,zb,Hb,jb,Ub,Wb,qb,Kb]),Gb=S.object({conditions:S.array(Rm),value:S.unknown()}),Zb=S.object({type:S.literal("rules"),rules:S.array(Gb),default:S.unknown()}),Yb=S.object({type:S.literal("score"),field:S.string(),threshold:S.number(),above:S.unknown(),below:S.unknown()}),Xb=S.object({type:S.literal("model"),modelId:S.string(),inputs:S.array(S.string()),outputMapping:S.record(S.unknown()),default:S.unknown()}),Qb=S.object({type:S.literal("external"),endpoint:S.string(),method:S.enum(["GET","POST"]).optional(),default:S.unknown(),timeoutMs:S.number().optional()}),Im=S.discriminatedUnion("type",[Zb,Yb,Xb,Qb]),Jb=S.object({include:S.array(S.string()).optional(),exclude:S.array(S.string()).optional()}),ek=S.object({routes:Jb.optional(),strategy:Im.optional()});function qP(t){return Rm.safeParse(t)}function KP(t){return Im.safeParse(t)}function GP(t){return ek.safeParse(t)}function Pm(t,e){let{context:n,state:r,events:i}=e;switch(t.type){case"page_url":{let{url:o}=t,s=n.page.url,a=o.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*");return new RegExp(`^${a}$`).test(s)}case"route":return n.page.routeId===t.routeId;case"anchor_visible":{let o=n.anchors?.find(s=>s.anchorId===t.anchorId);switch(t.state){case"visible":return o?.visible===!0;case"present":return o?.present===!0;case"absent":return!o?.present;default:return!1}}case"event_occurred":{if(!i)return!1;let o=t.withinMs??6e4;return i.hasRecentEvent(t.eventName,o)}case"state_equals":return!1;case"viewport":{let{width:o,height:s}=n.viewport;return!(t.minWidth!==void 0&&o<t.minWidth||t.maxWidth!==void 0&&o>t.maxWidth||t.minHeight!==void 0&&s<t.minHeight||t.maxHeight!==void 0&&s>t.maxHeight)}case"session_metric":{if(!r)return!1;let o=r.getSessionMetric(t.key),{operator:s,threshold:a}=t;switch(s){case"gte":return o>=a;case"lte":return o<=a;case"eq":return o===a;case"gt":return o>a;case"lt":return o<a;default:return!1}}case"dismissed":{if(!r)return t.inverted??!1;let o=r.isDismissed(t.key);return t.inverted?!o:o}case"cooldown_active":{if(!r)return t.inverted??!1;let o=r.isCooldownActive(t.key);return t.inverted?!o:o}case"frequency_limit":{if(!r)return t.inverted??!1;let s=r.getFrequencyCount(t.key)>=t.limit;return t.inverted?!s:s}default:return console.warn("[RuleStrategy] Unknown condition type:",t.type),!1}}function Om(t,e){let n=[];for(let r of t.conditions){let i=Pm(r,e);if(n.push({condition:r,result:i}),!i)return{matched:!1,conditionResults:n}}return{matched:!0,conditionResults:n}}function tl(t,e){for(let n=0;n<t.rules.length;n++){let r=t.rules[n],{matched:i,conditionResults:o}=Om(r,e);if(i)return{value:r.value,isFallback:!1,matchInfo:{strategyType:"rules",matchedRuleIndex:n,evaluatedConditions:o}}}return{value:t.default,isFallback:!0,matchInfo:{strategyType:"rules"}}}function nl(t,e){let{context:n}=e,r=n.augmented?.[t.field];return r===void 0||typeof r!="number"?{value:t.below,isFallback:!0,matchInfo:{strategyType:"score"}}:{value:r>=t.threshold?t.above:t.below,isFallback:!1,matchInfo:{strategyType:"score"}}}function tk(t,e){let{state:n,events:r,sessionMetrics:i}=e;return{context:t,state:n?{isDismissed:o=>n.dismissals.isDismissed(o),isCooldownActive:o=>n.cooldowns.isActive(o),getFrequencyCount:o=>n.frequency.count(o),getSessionMetric:o=>i?.get(o)??0}:void 0,events:r?{hasRecentEvent:(o,s)=>r.hasRecentEvent(o,s)}:void 0}}async function Nm(t,e,n={}){let r=tk(e,n);switch(t.type){case"rules":return tl(t,r);case"score":return nl(t,r);case"model":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"model"}};case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:"external"}};default:return console.warn("[DecisionEngine] Unknown strategy type:",t.type),{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function Lm(t,e,n={}){let r=tk(e,n);switch(t.type){case"rules":return tl(t,r);case"score":return nl(t,r);case"model":case"external":return{value:t.default,isFallback:!0,matchInfo:{strategyType:t.type}};default:return{value:void 0,isFallback:!0,matchInfo:{strategyType:t.type}}}}function td(t){return{evaluate:(e,n)=>Nm(e,n,t),evaluateSync:(e,n)=>Lm(e,n,t)}}var ZP=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function Mm(t){if(typeof window.Sanitizer=="function")try{let a=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(a),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let r=n.content,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;i.nextNode();){let s=i.currentNode,a=s.tagName.toLowerCase();if(!ZP.has(a)){o.push(s);continue}for(let l of Array.from(s.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(f||h)&&s.removeAttribute(l.name)}}for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML}var nk=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=Mm(t.html),i=document.createElement("div");i.setAttribute("data-syntro-action-id",e.generateId()),i.innerHTML=r;let o=null;switch(t.position){case"before":n.insertAdjacentElement("beforebegin",i);break;case"after":n.insertAdjacentElement("afterend",i);break;case"prepend":n.insertBefore(i,n.firstChild);break;case"append":n.appendChild(i);break;case"replace":o=n.innerHTML,n.replaceWith(i);break}return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:insertHtml",anchorId:t.anchorId,position:t.position}),{cleanup:()=>{if(t.position==="replace"&&o!==null){let s=document.createElement(n.tagName);s.innerHTML=o,Array.from(n.attributes).forEach(a=>{s.setAttribute(a.name,a.value)}),i.replaceWith(s)}else i.remove()},updateFn:s=>{"html"in s&&typeof s.html=="string"&&(i.innerHTML=Mm(s.html))}}},rk=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=n.textContent??"";return n.textContent=t.text,e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setText",anchorId:t.anchorId}),{cleanup:()=>{n.textContent=r},updateFn:i=>{"text"in i&&typeof i.text=="string"&&(n.textContent=i.text)}}},ik=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);if(["onclick","onerror","onload","onmouseover","onfocus","onblur"].includes(t.attr.toLowerCase())||t.attr.startsWith("on"))throw new Error(`Dangerous attribute not allowed: ${t.attr}`);let i=n.getAttribute(t.attr),o=n.hasAttribute(t.attr);return n.setAttribute(t.attr,t.value),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setAttr",anchorId:t.anchorId,attr:t.attr}),{cleanup:()=>{o&&i!==null?n.setAttribute(t.attr,i):n.removeAttribute(t.attr)},updateFn:s=>{"value"in s&&typeof s.value=="string"&&n.setAttribute(t.attr,s.value)}}},ok=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=n.classList.contains(t.className);return n.classList.add(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:addClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r||n.classList.remove(t.className)}}},sk=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=n.classList.contains(t.className);return n.classList.remove(t.className),e.publishEvent("action.applied",{id:e.generateId(),kind:"content:removeClass",anchorId:t.anchorId,className:t.className}),{cleanup:()=>{r&&n.classList.add(t.className)}}},ak=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=new Map;for(let i of Object.keys(t.styles)){let o=n.style.getPropertyValue(i);r.set(i,o)}for(let[i,o]of Object.entries(t.styles))n.style.setProperty(i,o);return e.publishEvent("action.applied",{id:e.generateId(),kind:"content:setStyle",anchorId:t.anchorId,styles:Object.keys(t.styles)}),{cleanup:()=>{for(let[i,o]of r)o?n.style.setProperty(i,o):n.style.removeProperty(i)},updateFn:i=>{if("styles"in i&&typeof i.styles=="object"&&i.styles)for(let[o,s]of Object.entries(i.styles))n.style.setProperty(o,s)}}},Fm=[{kind:"content:insertHtml",executor:nk},{kind:"content:setText",executor:rk},{kind:"content:setAttr",executor:ik},{kind:"content:addClass",executor:ok},{kind:"content:removeClass",executor:sk},{kind:"content:setStyle",executor:ak}],lk={id:"adaptive-content",version:"1.0.0",name:"Content",description:"DOM manipulation for text, attributes, and styles",executors:Fm};var ck=typeof CSS<"u"&&CSS.supports?.("clip-path","path('M0 0 H1 V1 Z')");function uk(t,e,n){let r=n?.paddingPx??12,i=n?.radiusPx??12,o=Math.min(Math.max(n?.scrimOpacity??.55,0),1),s=n?.ringColor??"var(--syntro-ring, #5b8cff)",a=n?.blocking??!1,l=n?.onClickOutside??!0,c=n?.onEsc??!0,u=getComputedStyle(document.documentElement),f=u.getPropertyValue("--syntro-spotlight-backdrop").trim(),h=u.getPropertyValue("--syntro-ring").trim(),g=document.createElement("div");g.className="syntro-spotlight-scrim";let v=a||l;Object.assign(g.style,{position:"fixed",inset:"0",zIndex:"2147483646",pointerEvents:v?"auto":"none",background:f||`rgba(2, 6, 23, ${o})`,transition:"opacity 220ms ease",opacity:"0"}),e.appendChild(g),requestAnimationFrame(()=>g.style.opacity="1");let _=document.createElement("div");_.className="syntro-spotlight-ring",Object.assign(_.style,{position:"fixed",pointerEvents:"none",borderRadius:`${i}px`,border:`2px solid ${s||h||"#5b8cff"}`,boxShadow:"0 0 0 4px rgba(255,255,255,0.35)",zIndex:"2147483647",transition:"all 220ms cubic-bezier(0.16,1,0.3,1)"}),e.appendChild(_);let x=[];if(!ck)for(let I=0;I<4;I++){let A=document.createElement("div");A.style.position="fixed",A.style.background="inherit",x.push(A),g.appendChild(A)}let d=I=>{g.style.clipPath=I,g.style.webkitClipPath=I},p=()=>{let I=t.getBoundingClientRect(),A=Math.max(0,I.left-r),H=Math.max(0,I.top-r),K=Math.min(window.innerWidth,I.width+r*2),Y=Math.min(window.innerHeight,I.height+r*2);if(Object.assign(_.style,{left:`${A}px`,top:`${H}px`,width:`${K}px`,height:`${Y}px`}),ck){let W=window.innerWidth,le=window.innerHeight,B=Math.min(i,K/2,Y/2),X=`M 0 0 L ${W} 0 L ${W} ${le} L 0 ${le} Z`,V=`M ${A+B} ${H} A ${B} ${B} 0 0 0 ${A} ${H+B} L ${A} ${H+Y-B} A ${B} ${B} 0 0 0 ${A+B} ${H+Y} L ${A+K-B} ${H+Y} A ${B} ${B} 0 0 0 ${A+K} ${H+Y-B} L ${A+K} ${H+B} A ${B} ${B} 0 0 0 ${A+K-B} ${H} L ${A+B} ${H} Z`;d(`path('${X} ${V}')`)}else{let[W,le,B,X]=x;Object.assign(W.style,{left:"0px",top:"0px",width:"100vw",height:`${H}px`}),Object.assign(B.style,{left:"0px",top:`${H+Y}px`,width:"100vw",height:`${Math.max(0,window.innerHeight-(H+Y))}px`}),Object.assign(X.style,{left:"0px",top:`${H}px`,width:`${A}px`,height:`${Y}px`}),Object.assign(le.style,{left:`${A+K}px`,top:`${H}px`,width:`${Math.max(0,window.innerWidth-(A+K))}px`,height:`${Y}px`})}},m=new ResizeObserver(()=>requestAnimationFrame(p));m.observe(t);let y=()=>requestAnimationFrame(p),w=()=>requestAnimationFrame(p);window.addEventListener("scroll",y,!0),window.addEventListener("resize",w);let b=I=>{I.key==="Escape"&&c&&E.destroy()};c&&window.addEventListener("keydown",b);let k=I=>{a?(I.preventDefault(),I.stopPropagation()):l&&E.destroy()};g.addEventListener("click",k);let E={destroy(){m.disconnect(),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",w),c&&window.removeEventListener("keydown",b),g.removeEventListener("click",k),g.style.opacity="0",setTimeout(()=>{g.remove(),_.remove()},220)}};return p(),E}var pk=["top","right","bottom","left"];var en=Math.min,ct=Math.max,Nn=Math.round,Ln=Math.floor,Pe=t=>({x:t,y:t}),YP={left:"right",right:"left",bottom:"top",top:"bottom"},XP={start:"end",end:"start"};function rd(t,e,n){return ct(t,en(e,n))}function Yi(t,e){return typeof t=="function"?t(e):t}function ai(t){return t.split("-")[0]}function us(t){return t.split("-")[1]}function $m(t){return t==="x"?"y":"x"}function id(t){return t==="y"?"height":"width"}var QP=new Set(["top","bottom"]);function fr(t){return QP.has(ai(t))?"y":"x"}function od(t){return $m(fr(t))}function hk(t,e,n){n===void 0&&(n=!1);let r=us(t),i=od(t),o=id(i),s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=rl(s)),[s,rl(s)]}function gk(t){let e=rl(t);return[nd(t),e,nd(e)]}function nd(t){return t.replace(/start|end/g,e=>XP[e])}var dk=["left","right"],fk=["right","left"],JP=["top","bottom"],e2=["bottom","top"];function t2(t,e,n){switch(t){case"top":case"bottom":return n?e?fk:dk:e?dk:fk;case"left":case"right":return e?JP:e2;default:return[]}}function mk(t,e,n,r){let i=us(t),o=t2(ai(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(nd)))),o}function rl(t){return t.replace(/left|right|bottom|top/g,e=>YP[e])}function n2(t){return{top:0,right:0,bottom:0,left:0,...t}}function Dm(t){return typeof t!="number"?n2(t):{top:t,right:t,bottom:t,left:t}}function Mn(t){let{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function vk(t,e,n){let{reference:r,floating:i}=t,o=fr(e),s=od(e),a=id(s),l=ai(e),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2,g;switch(l){case"top":g={x:u,y:r.y-i.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-i.width,y:f};break;default:g={x:r.x,y:r.y}}switch(us(e)){case"start":g[s]-=h*(n&&c?-1:1);break;case"end":g[s]+=h*(n&&c?-1:1);break}return g}var sd=async(t,e,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=vk(c,r,l),h=r,g={},v=0;for(let _=0;_<a.length;_++){let{name:x,fn:d}=a[_],{x:p,y:m,data:y,reset:w}=await d({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:g,rects:c,platform:s,elements:{reference:t,floating:e}});u=p??u,f=m??f,g={...g,[x]:{...g[x],...y}},w&&v<=50&&(v++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(c=w.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):w.rects),{x:u,y:f}=vk(c,h,l)),_=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:g}};async function ds(t,e){var n;e===void 0&&(e={});let{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:g=0}=Yi(e,t),v=Dm(g),x=a[h?f==="floating"?"reference":"floating":f],d=Mn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(x)))==null||n?x:x.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),p=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,m=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),y=await(o.isElement==null?void 0:o.isElement(m))?await(o.getScale==null?void 0:o.getScale(m))||{x:1,y:1}:{x:1,y:1},w=Mn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:p,offsetParent:m,strategy:l}):p);return{top:(d.top-w.top+v.top)/y.y,bottom:(w.bottom-d.bottom+v.bottom)/y.y,left:(d.left-w.left+v.left)/y.x,right:(w.right-d.right+v.right)/y.x}}var Bm=t=>({name:"arrow",options:t,async fn(e){let{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=Yi(t,e)||{};if(c==null)return{};let f=Dm(u),h={x:n,y:r},g=od(i),v=id(g),_=await s.getDimensions(c),x=g==="y",d=x?"top":"left",p=x?"bottom":"right",m=x?"clientHeight":"clientWidth",y=o.reference[v]+o.reference[g]-h[g]-o.floating[v],w=h[g]-o.reference[g],b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c)),k=b?b[m]:0;(!k||!await(s.isElement==null?void 0:s.isElement(b)))&&(k=a.floating[m]||o.floating[v]);let E=y/2-w/2,I=k/2-_[v]/2-1,A=en(f[d],I),H=en(f[p],I),K=A,Y=k-_[v]-H,W=k/2-_[v]/2+E,le=rd(K,W,Y),B=!l.arrow&&us(i)!=null&&W!==le&&o.reference[v]/2-(W<K?A:H)-_[v]/2<0,X=B?W<K?W-K:W-Y:0;return{[g]:h[g]+X,data:{[g]:le,centerOffset:W-le-X,...B&&{alignmentOffset:X}},reset:B}}});var ad=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;let{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:_=!0,...x}=Yi(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};let d=ai(i),p=fr(a),m=ai(a)===a,y=await(l.isRTL==null?void 0:l.isRTL(c.floating)),w=h||(m||!_?[rl(a)]:gk(a)),b=v!=="none";!h&&b&&w.push(...mk(a,_,v,y));let k=[a,...w],E=await ds(e,x),I=[],A=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&I.push(E[d]),f){let W=hk(i,s,y);I.push(E[W[0]],E[W[1]])}if(A=[...A,{placement:i,overflows:I}],!I.every(W=>W<=0)){var H,K;let W=(((H=o.flip)==null?void 0:H.index)||0)+1,le=k[W];if(le&&(!(f==="alignment"?p!==fr(le):!1)||A.every(V=>fr(V.placement)===p?V.overflows[0]>0:!0)))return{data:{index:W,overflows:A},reset:{placement:le}};let B=(K=A.filter(X=>X.overflows[0]<=0).sort((X,V)=>X.overflows[1]-V.overflows[1])[0])==null?void 0:K.placement;if(!B)switch(g){case"bestFit":{var Y;let X=(Y=A.filter(V=>{if(b){let Z=fr(V.placement);return Z===p||Z==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(Z=>Z>0).reduce((Z,vt)=>Z+vt,0)]).sort((V,Z)=>V[1]-Z[1])[0])==null?void 0:Y[0];X&&(B=X);break}case"initialPlacement":B=a;break}if(i!==B)return{reset:{placement:B}}}return{}}}};function yk(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function _k(t){return pk.some(e=>t[e]>=0)}var Vm=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){let{rects:n}=e,{strategy:r="referenceHidden",...i}=Yi(t,e);switch(r){case"referenceHidden":{let o=await ds(e,{...i,elementContext:"reference"}),s=yk(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:_k(s)}}}case"escaped":{let o=await ds(e,{...i,altBoundary:!0}),s=yk(o,n.floating);return{data:{escapedOffsets:s,escaped:_k(s)}}}default:return{}}}}};var r2=new Set(["left","top"]);async function i2(t,e){let{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=ai(n),a=us(n),l=fr(n)==="y",c=r2.has(s)?-1:1,u=o&&l?-1:1,f=Yi(e,t),{mainAxis:h,crossAxis:g,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(g=a==="end"?v*-1:v),l?{x:g*u,y:h*c}:{x:h*c,y:g*u}}var ld=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;let{x:i,y:o,placement:s,middlewareData:a}=e,l=await i2(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},cd=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:d,y:p}=x;return{x:d,y:p}}},...l}=Yi(t,e),c={x:n,y:r},u=await ds(e,l),f=fr(ai(i)),h=$m(f),g=c[h],v=c[f];if(o){let x=h==="y"?"top":"left",d=h==="y"?"bottom":"right",p=g+u[x],m=g-u[d];g=rd(p,g,m)}if(s){let x=f==="y"?"top":"left",d=f==="y"?"bottom":"right",p=v+u[x],m=v-u[d];v=rd(p,v,m)}let _=a.fn({...e,[h]:g,[f]:v});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[h]:o,[f]:s}}}}}};function ud(){return typeof window<"u"}function mn(t){return xk(t)?(t.nodeName||"").toLowerCase():"#document"}function Oe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function $e(t){var e;return(e=(xk(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function xk(t){return ud()?t instanceof Node||t instanceof Oe(t).Node:!1}function Ne(t){return ud()?t instanceof Element||t instanceof Oe(t).Element:!1}function Ve(t){return ud()?t instanceof HTMLElement||t instanceof Oe(t).HTMLElement:!1}function wk(t){return!ud()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Oe(t).ShadowRoot}var o2=new Set(["inline","contents"]);function $n(t){let{overflow:e,overflowX:n,overflowY:r,display:i}=Le(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!o2.has(i)}var s2=new Set(["table","td","th"]);function dd(t){return s2.has(mn(t))}var a2=[":popover-open",":modal"];function pr(t){return a2.some(e=>{try{return t.matches(e)}catch{return!1}})}var l2=["transform","translate","scale","rotate","perspective"],c2=["transform","translate","scale","rotate","perspective","filter"],u2=["paint","layout","strict","content"];function Xi(t){let e=Qi(),n=Ne(t)?Le(t):t;return l2.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||c2.some(r=>(n.willChange||"").includes(r))||u2.some(r=>(n.contain||"").includes(r))}function fd(t){let e=mt(t);for(;Ve(e)&&!tn(e);){if(Xi(e))return e;if(pr(e))return null;e=mt(e)}return null}function Qi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var d2=new Set(["html","body","#document"]);function tn(t){return d2.has(mn(t))}function Le(t){return Oe(t).getComputedStyle(t)}function Dn(t){return Ne(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function mt(t){if(mn(t)==="html")return t;let e=t.assignedSlot||t.parentNode||wk(t)&&t.host||$e(t);return wk(e)?e.host:e}function Sk(t){let e=mt(t);return tn(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ve(e)&&$n(e)?e:Sk(e)}function Fn(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Sk(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=Oe(i);if(o){let a=Ji(s);return e.concat(s,s.visualViewport||[],$n(i)?i:[],a&&n?Fn(a):[])}return e.concat(i,Fn(i,[],n))}function Ji(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Ck(t){let e=Le(t),n=parseFloat(e.width)||0,r=parseFloat(e.height)||0,i=Ve(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Nn(n)!==o||Nn(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Hm(t){return Ne(t)?t:t.contextElement}function fs(t){let e=Hm(t);if(!Ve(e))return Pe(1);let n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Ck(e),s=(o?Nn(n.width):n.width)/r,a=(o?Nn(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var m2=Pe(0);function Ak(t){let e=Oe(t);return!Qi()||!e.visualViewport?m2:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function v2(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Oe(t)?!1:e}function eo(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=Hm(t),s=Pe(1);e&&(r?Ne(r)&&(s=fs(r)):s=fs(t));let a=v2(o,n,r)?Ak(o):Pe(0),l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){let h=Oe(o),g=r&&Ne(r)?Oe(r):r,v=h,_=Ji(v);for(;_&&r&&g!==v;){let x=fs(_),d=_.getBoundingClientRect(),p=Le(_),m=d.left+(_.clientLeft+parseFloat(p.paddingLeft))*x.x,y=d.top+(_.clientTop+parseFloat(p.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,f*=x.y,l+=m,c+=y,v=Oe(_),_=Ji(v)}}return Mn({width:u,height:f,x:l,y:c})}function pd(t,e){let n=Dn(t).scrollLeft;return e?e.left+n:eo($e(t)).left+n}function Tk(t,e){let n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-pd(t,n),i=n.top+e.scrollTop;return{x:r,y:i}}function y2(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t,o=i==="fixed",s=$e(r),a=e?pr(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Pe(1),u=Pe(0),f=Ve(r);if((f||!f&&!o)&&((mn(r)!=="body"||$n(s))&&(l=Dn(r)),Ve(r))){let g=eo(r);c=fs(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}let h=s&&!f&&!o?Tk(s,l):Pe(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function _2(t){return Array.from(t.getClientRects())}function w2(t){let e=$e(t),n=Dn(t),r=t.ownerDocument.body,i=ct(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ct(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+pd(t),a=-n.scrollTop;return Le(r).direction==="rtl"&&(s+=ct(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}var bk=25;function x2(t,e){let n=Oe(t),r=$e(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;let u=Qi();(!u||u&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}let c=pd(r);if(c<=0){let u=r.ownerDocument,f=u.body,h=getComputedStyle(f),g=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-g);v<=bk&&(o-=v)}else c<=bk&&(o+=c);return{width:o,height:s,x:a,y:l}}var S2=new Set(["absolute","fixed"]);function b2(t,e){let n=eo(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Ve(t)?fs(t):Pe(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function kk(t,e,n){let r;if(e==="viewport")r=x2(t,n);else if(e==="document")r=w2($e(t));else if(Ne(e))r=b2(e,n);else{let i=Ak(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Mn(r)}function Rk(t,e){let n=mt(t);return n===e||!Ne(n)||tn(n)?!1:Le(n).position==="fixed"||Rk(n,e)}function k2(t,e){let n=e.get(t);if(n)return n;let r=Fn(t,[],!1).filter(a=>Ne(a)&&mn(a)!=="body"),i=null,o=Le(t).position==="fixed",s=o?mt(t):t;for(;Ne(s)&&!tn(s);){let a=Le(s),l=Xi(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&S2.has(i.position)||$n(s)&&!l&&Rk(t,s))?r=r.filter(u=>u!==s):i=a,s=mt(s)}return e.set(t,r),r}function E2(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t,s=[...n==="clippingAncestors"?pr(e)?[]:k2(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{let f=kk(e,u,i);return c.top=ct(f.top,c.top),c.right=en(f.right,c.right),c.bottom=en(f.bottom,c.bottom),c.left=ct(f.left,c.left),c},kk(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function C2(t){let{width:e,height:n}=Ck(t);return{width:e,height:n}}function A2(t,e,n){let r=Ve(e),i=$e(e),o=n==="fixed",s=eo(t,!0,o,e),a={scrollLeft:0,scrollTop:0},l=Pe(0);function c(){l.x=pd(i)}if(r||!r&&!o)if((mn(e)!=="body"||$n(i))&&(a=Dn(e)),r){let g=eo(e,!0,o,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else i&&c();o&&!r&&i&&c();let u=i&&!r&&!o?Tk(i,a):Pe(0),f=s.left+a.scrollLeft-l.x-u.x,h=s.top+a.scrollTop-l.y-u.y;return{x:f,y:h,width:s.width,height:s.height}}function zm(t){return Le(t).position==="static"}function Ek(t,e){if(!Ve(t)||Le(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $e(t)===n&&(n=n.ownerDocument.body),n}function Ik(t,e){let n=Oe(t);if(pr(t))return n;if(!Ve(t)){let i=mt(t);for(;i&&!tn(i);){if(Ne(i)&&!zm(i))return i;i=mt(i)}return n}let r=Ek(t,e);for(;r&&dd(r)&&zm(r);)r=Ek(r,e);return r&&tn(r)&&zm(r)&&!Xi(r)?n:r||fd(t)||n}var T2=async function(t){let e=this.getOffsetParent||Ik,n=this.getDimensions,r=await n(t.floating);return{reference:A2(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function R2(t){return Le(t).direction==="rtl"}var I2={convertOffsetParentRelativeRectToViewportRelativeRect:y2,getDocumentElement:$e,getClippingRect:E2,getOffsetParent:Ik,getElementRects:T2,getClientRects:_2,getDimensions:C2,getScale:fs,isElement:Ne,isRTL:R2};function Pk(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function P2(t,e){let n=null,r,i=$e(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();let c=t.getBoundingClientRect(),{left:u,top:f,width:h,height:g}=c;if(a||e(),!h||!g)return;let v=Ln(f),_=Ln(i.clientWidth-(u+h)),x=Ln(i.clientHeight-(f+g)),d=Ln(u),m={rootMargin:-v+"px "+-_+"px "+-x+"px "+-d+"px",threshold:ct(0,en(1,l))||1},y=!0;function w(b){let k=b[0].intersectionRatio;if(k!==l){if(!y)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!Pk(c,t.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(w,{...m,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,m)}n.observe(t)}return s(!0),o}function Ok(t,e,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Hm(t),u=i||o?[...c?Fn(c):[],...Fn(e)]:[];u.forEach(d=>{i&&d.addEventListener("scroll",n,{passive:!0}),o&&d.addEventListener("resize",n)});let f=c&&a?P2(c,n):null,h=-1,g=null;s&&(g=new ResizeObserver(d=>{let[p]=d;p&&p.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var m;(m=g)==null||m.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let v,_=l?eo(t):null;l&&x();function x(){let d=eo(t);_&&!Pk(_,d)&&n(),_=d,v=requestAnimationFrame(x)}return n(),()=>{var d;u.forEach(p=>{i&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),f?.(),(d=g)==null||d.disconnect(),g=null,l&&cancelAnimationFrame(v)}}var Nk=ld;var Lk=cd,Mk=ad;var Fk=Vm,$k=Bm;var Dk=(t,e,n)=>{let r=new Map,i={platform:I2,...n},o={...i.platform,_c:r};return sd(t,e,{...i,platform:o})};var O2=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]);function Vt(t){if(typeof window.Sanitizer=="function")try{let a=new window.Sanitizer({}).sanitizeToFragment(t),l=document.createElement("div");return l.append(a),l.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let r=n.content,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=[];for(;i.nextNode();){let s=i.currentNode,a=s.tagName.toLowerCase();if(!O2.has(a)){o.push(s);continue}for(let l of Array.from(s.attributes)){let c=l.name.toLowerCase(),u=l.value.trim().toLowerCase(),f=c.startsWith("on"),h=(c==="href"||c==="src")&&u.startsWith("javascript:");(f||h)&&s.removeAttribute(l.name)}}for(let s of o){for(;s.firstChild;)s.parentNode?.insertBefore(s.firstChild,s);s.remove()}return n.innerHTML}function N2(t){let e=t.getBoundingClientRect(),n=window.innerWidth,r=window.innerHeight;if(!(e.width>n*.8||e.height>r*.8))return t;let o=Math.max(e.left,0),s=Math.max(e.top,0),a=Math.min(e.right,n),l=Math.min(e.bottom,r),c=(o+a)/2,u=(s+l)/2;return{getBoundingClientRect(){return{width:0,height:0,x:c,y:u,top:u,left:c,right:c,bottom:u}}}}function Bk(t,e,n){let r=t.getBoundingClientRect();r.width>window.innerWidth*.8||r.height>window.innerHeight*.8||t.scrollIntoView({behavior:"smooth",block:"center",inline:"center"});let o=document.createElement("div");o.className="syntro-tooltip",o.setAttribute("role","tooltip"),o.innerHTML=Vt(n.html);let s=o.querySelectorAll("[data-syntro-action]"),a=d=>{let m=d.currentTarget.getAttribute("data-syntro-action");m&&n.onAction&&n.onAction(m)};s.forEach(d=>d.addEventListener("click",a));let l=document.createElement("div");l.className="syntro-tooltip-arrow",o.appendChild(l),e.appendChild(o);let c=[Nk(n.offsetPx??8),Mk(),Lk({padding:8}),Fk(),$k({element:l})],u=n.placement&&n.placement!=="auto"?n.placement:"top",f=Ok(t,o,async()=>{let d=N2(t),p=await Dk(d,o,{placement:u,middleware:c}),{x:m,y,strategy:w,middlewareData:b,placement:k}=p;if(Object.assign(o.style,{left:`${m}px`,top:`${y}px`,position:w}),b.arrow){let{x:E,y:I}=b.arrow,A=k.split("-")[0],H={top:"bottom",right:"left",bottom:"top",left:"right"};Object.assign(l.style,{left:E!=null?`${E}px`:"",top:I!=null?`${I}px`:"",right:"",bottom:"",[H[A]]:"-4px"});let K={top:"0deg",right:"90deg",bottom:"180deg",left:"270deg"};l.style.transform=`rotate(${K[A]||"0deg"})`}}),h=d=>{d.key==="Escape"&&x.destroy()};window.addEventListener("keydown",h);let g=[];if(n.blocking){Array.from(document.body.children).forEach(p=>{p!==e&&p.getAttribute("inert")===null&&(p.setAttribute("inert",""),g.push(p.id||p.tagName))});let d=Array.from(o.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'));if(d.length>0){let p=d[0],m=d[d.length-1],y=w=>{w.key==="Tab"&&(w.shiftKey?document.activeElement===p&&(m.focus(),w.preventDefault()):document.activeElement===m&&(p.focus(),w.preventDefault()))};o.addEventListener("keydown",y),requestAnimationFrame(()=>p.focus())}}let _=(()=>{if(n.trigger==="hover"){let d=()=>{o.style.visibility="visible",o.style.opacity="1"},p=()=>{o.style.visibility="hidden",o.style.opacity="0"};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("mouseenter",d),t.addEventListener("mouseleave",p),t.addEventListener("focus",d),t.addEventListener("blur",p),()=>{t.removeEventListener("mouseenter",d),t.removeEventListener("mouseleave",p),t.removeEventListener("focus",d),t.removeEventListener("blur",p)}}if(n.trigger==="click"){let d=()=>{o.style.visibility==="visible"?x.destroy():(o.style.visibility="visible",o.style.opacity="1")};return o.style.visibility="hidden",o.style.opacity="0",o.style.transition="opacity 200ms ease, visibility 200ms",t.addEventListener("click",d),()=>t.removeEventListener("click",d)}return o.style.opacity="0",o.style.transition="opacity 200ms ease",requestAnimationFrame(()=>{o.style.opacity="1"}),()=>{}})(),x={el:o,destroy(){f(),_(),window.removeEventListener("keydown",h),s.forEach(d=>d.removeEventListener("click",a)),n.blocking&&Array.from(document.body.children).forEach(d=>{d!==e&&d.removeAttribute("inert")}),o.style.opacity="0",setTimeout(()=>o.remove(),200)}};return x}var jm=async(t,e)=>{let{content:n,size:r="md",blocking:i=!1,scrim:o,dismiss:s,ctaButtons:a}=t,l=document.createElement("div");l.className="syntro-modal-scrim",l.style.cssText=`
|
|
54
54
|
position: fixed;
|
|
55
55
|
inset: 0;
|
|
56
56
|
background: rgba(0, 0, 0, ${o?.opacity??.6});
|
|
@@ -86,9 +86,9 @@ Error generating stack: `+o.message+`
|
|
|
86
86
|
<path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"/>
|
|
87
87
|
</svg>
|
|
88
88
|
</button>
|
|
89
|
-
`),a&&a.length>0){f+='<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">';for(let w of a){let
|
|
89
|
+
`),a&&a.length>0){f+='<div class="syntro-modal-actions" style="display: flex; gap: 12px; margin-top: 24px; justify-content: flex-end;">';for(let w of a){let b=w.primary??!1;f+=`
|
|
90
90
|
<button
|
|
91
|
-
class="syntro-modal-btn ${
|
|
91
|
+
class="syntro-modal-btn ${b?"syntro-modal-btn-primary":""}"
|
|
92
92
|
data-syntro-action="${Vt(w.actionId)}"
|
|
93
93
|
style="
|
|
94
94
|
padding: 10px 20px;
|
|
@@ -97,12 +97,12 @@ Error generating stack: `+o.message+`
|
|
|
97
97
|
font-weight: 500;
|
|
98
98
|
cursor: pointer;
|
|
99
99
|
transition: background 150ms ease;
|
|
100
|
-
${
|
|
100
|
+
${b?"background: #4f46e5; color: white; border: none;":"background: white; color: #374151; border: 1px solid #d1d5db;"}
|
|
101
101
|
"
|
|
102
102
|
>
|
|
103
103
|
${Vt(w.label)}
|
|
104
104
|
</button>
|
|
105
|
-
`}f+="</div>"}c.innerHTML=f,e.overlayRoot.appendChild(c);let h=null,g=c.querySelectorAll("[data-syntro-action]"),v=w=>{let
|
|
105
|
+
`}f+="</div>"}c.innerHTML=f,e.overlayRoot.appendChild(c);let h=null,g=c.querySelectorAll("[data-syntro-action]"),v=w=>{let k=w.currentTarget.getAttribute("data-syntro-action");k&&(h=k,e.publishEvent("action.modal_cta_clicked",{actionId:k}),k==="dismiss"&&y.destroy())};g.forEach(w=>w.addEventListener("click",v));let _=w=>{w.key==="Escape"&&s?.onEsc!==!1&&y.destroy()};window.addEventListener("keydown",_);let x=()=>{i||y.destroy()};l.addEventListener("click",x);let d=[];i&&Array.from(document.body.children).forEach(w=>{w!==e.overlayRoot&&w.getAttribute("inert")===null&&(w.setAttribute("inert",""),d.push(w))});let p;s?.timeoutMs&&(p=setTimeout(()=>{y.destroy()},s.timeoutMs));let m=c.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');m.length>0&&requestAnimationFrame(()=>m[0].focus()),requestAnimationFrame(()=>{l.style.opacity="1",c.style.opacity="1",c.style.transform="translate(-50%, -50%) scale(1)"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:modal",size:r,blocking:i});let y={destroy(){p&&clearTimeout(p),window.removeEventListener("keydown",_),l.removeEventListener("click",x),g.forEach(w=>w.removeEventListener("click",v)),d.forEach(w=>w.removeAttribute("inert")),c.style.opacity="0",c.style.transform="translate(-50%, -50%) scale(0.95)",l.style.opacity="0",setTimeout(()=>{c.remove(),l.remove()},200),e.publishEvent("action.modal_dismissed",{actionClicked:h})}};return{cleanup:()=>{y.destroy()}}};var Vk=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=uk(n,e.overlayRoot,{paddingPx:t.style?.paddingPx??12,radiusPx:t.style?.radiusPx??12,scrimOpacity:t.style?.scrimOpacity??.55,ringColor:t.style?.color,blocking:!1,onClickOutside:!1,onEsc:!1});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:highlight",anchorId:t.anchorId}),{cleanup:()=>{r.destroy()}}},zk=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=t.duration??2e3,i="syntro-pulse-effect";if(!document.querySelector("[data-syntro-pulse-styles]")){let s=document.createElement("style");s.setAttribute("data-syntro-pulse-styles",""),s.textContent=`
|
|
106
106
|
@keyframes syntro-pulse {
|
|
107
107
|
0%, 100% {
|
|
108
108
|
box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4);
|
|
@@ -139,7 +139,7 @@ Error generating stack: `+o.message+`
|
|
|
139
139
|
<button class="syntro-tt-btn syntro-tt-btn-primary" data-syntro-action="cta">
|
|
140
140
|
${Vt(r.cta.label)}
|
|
141
141
|
</button>
|
|
142
|
-
</div>`);let o=Bk(n,e.overlayRoot,{html:i,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:s=>{if(s==="cta"&&r.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:r.cta.label});else if(r.ctaButtons){let a=r.ctaButtons.find(l=>l.actionId===s);a&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:s,label:a.label})}}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{o.destroy()}}},qm=[{kind:"overlays:highlight",executor:Vk},{kind:"overlays:pulse",executor:zk},{kind:"overlays:badge",executor:Hk},{kind:"overlays:tooltip",executor:jk},{kind:"overlays:modal",executor:Wm}],Uk={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, and visual overlays",executors:qm};var Wk=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=window.scrollX,i=window.scrollY;return n.scrollIntoView({behavior:t.behavior??"smooth",block:t.block??"center",inline:t.inline??"nearest"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:scrollTo",anchorId:t.anchorId,behavior:t.behavior??"smooth"}),{cleanup:()=>{}}},qk=async(t,e)=>{let n=t.url.trim();if(n.toLowerCase().startsWith("javascript:"))throw new Error("javascript: URLs are not allowed");let r=t.target??"_self";return e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:navigate",url:t.url,target:r}),r==="_blank"?window.open(n,"_blank","noopener,noreferrer"):window.location.href=n,{cleanup:()=>{}}},Km=[{kind:"navigation:scrollTo",executor:Wk},{kind:"navigation:navigate",executor:qk}],Kk={id:"adaptive-navigation",version:"1.0.0",name:"Navigation",description:"Scroll and page navigation actions",executors:Km};var Zm="syntro_active_tour",hd=new Map;function F2(t){try{let e=localStorage.getItem(Zm);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function Gm(t){try{localStorage.setItem(Zm,JSON.stringify(t))}catch{}}function $2(){try{localStorage.removeItem(Zm)}catch{}}function ol(){return window.location.pathname}function D2(t){if(!t.route)return!0;let e=ol();return t.route.includes("*")?new RegExp("^"+t.route.replace(/\*/g,".*")+"$").test(e):e===t.route}var Ym=async(t,e)=>{let{tourId:n,steps:r,startStep:i,autoStart:o=!0}=t;if(r.length===0)throw new Error(`Tour "${n}" has no steps`);if(hd.has(n))return{cleanup:async()=>{let m=hd.get(n);m&&await m.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let s=F2(n),a=!!s;if(!a&&!o)return{cleanup:()=>{}};s||(s={tourId:n,currentStepId:i||r[0].id,startedAt:Date.now()},Gm(s));let l=r.findIndex(m=>m.id===s.currentStepId);if(l===-1){let m=i||r[0].id;l=r.findIndex(y=>y.id===m),l===-1&&(l=0),s.currentStepId=r[l].id,Gm(s)}let c=r[l];if(!D2(c))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:c.id,expectedRoute:c.route,currentRoute:ol()}),{cleanup:()=>{}};let u=!1,f=null,h=null,g=null,v=async()=>{h&&(h(),h=null),f&&f.isApplied()&&(await f.revert(),f=null)},_=async m=>{if(u)return;if(await v(),m==="end"){$2(),e.publishEvent("tour.completed",{tourId:n,totalSteps:r.length}),u=!0;return}let y=r.find(w=>w.id===m);if(!y){console.error(`[Tour] Step "${m}" not found`);return}if(s.currentStepId=m,Gm(s),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:c.id,nextStepId:m}),y.route&&y.route!==ol()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:m,targetRoute:y.route});return}await x(y)},x=async m=>{if(!u){e.publishEvent("tour.step_started",{tourId:n,stepId:m.id,stepIndex:r.findIndex(y=>y.id===m.id),totalSteps:r.length});try{f=await e.applyAction(m.action)}catch(y){console.error(`[Tour] Failed to execute step "${m.id}":`,y),e.publishEvent("tour.step_failed",{tourId:n,stepId:m.id,error:String(y)});return}if(m.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",k=>{let b=k?.actionId;if(b&&m.onAction){let E=m.onAction[b];E&&_(E)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",k=>{let b=k?.actionId;if(b&&m.onAction){let E=m.onAction[b];E&&_(E)}}),w=h;h=()=>{w(),y()}}}};g=(()=>{let m=ol(),y=()=>{let b=ol();b!==m&&(m=b,e.publishEvent("tour.route_changed",{tourId:n,newRoute:b}))};window.addEventListener("popstate",y);let w=history.pushState.bind(history),k=history.replaceState.bind(history);return history.pushState=(...b)=>{w(...b),y()},history.replaceState=(...b)=>{k(...b),y()},()=>{window.removeEventListener("popstate",y),history.pushState=w,history.replaceState=k}})(),a?e.publishEvent("tour.resumed",{tourId:n,stepId:s.currentStepId}):e.publishEvent("tour.started",{tourId:n,totalSteps:r.length,startStepId:s.currentStepId}),await x(c);let p=async()=>{u=!0,hd.delete(n),await v(),g&&g(),e.publishEvent("tour.paused",{tourId:n,stepId:s.currentStepId})};return hd.set(n,{cleanup:p}),{cleanup:p}};var sl=class{constructor(){j(this,"executors",new Map);for(let{kind:e,executor:n}of Dm)this.registerCore(e,n);for(let{kind:e,executor:n}of qm)this.registerCore(e,n);for(let{kind:e,executor:n}of Km)this.registerCore(e,n);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:tour",Ym)}registerCore(e,n,r){this.executors.set(e,{kind:e,executor:n,schema:r,source:"core",isBuiltIn:!0})}register(e,n,r,i="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)throw new Error(`Cannot override built-in executor: ${e}`);console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e}`)}this.executors.set(e,{kind:e,executor:n,schema:r,source:i,isBuiltIn:o})}unregister(e){let n=this.executors.get(e);return n?n.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[n,r]of this.executors.entries())r.source===e&&this.executors.delete(n)}get(e){return this.executors.get(e)?.executor}getRegistration(e){return this.executors.get(e)}has(e){return this.executors.has(e)}validate(e){let n=[];if(!e||typeof e!="object")return n.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:n,warnings:[]};let r=e.kind;if(!r||typeof r!="string")return n.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:n,warnings:[]};let i=this.executors.get(r);if(!i)return n.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:n,warnings:[]};if(i.schema){let o=i.schema.safeParse(e);if(!o.success){for(let s of o.error.issues)n.push({code:"SCHEMA_VALIDATION_ERROR",message:s.message,field:s.path.join(".")});return{valid:!1,errors:n,warnings:[]}}}return{valid:!0,errors:[],warnings:[]}}list(){return Array.from(this.executors.keys())}listRegistrations(){return Array.from(this.executors.values())}getBuiltInKinds(){return Array.from(this.executors.entries()).filter(([,e])=>e.isBuiltIn).map(([e])=>e)}getCustomKinds(){return Array.from(this.executors.entries()).filter(([,e])=>!e.isBuiltIn).map(([e])=>e)}},ci=new sl;function Gk(t){return ci.get(t)}function gd(t){return ci.has(t)}var B2=["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","overlays:modal","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","core:mountWidget","core:wait","core:sequence","core:parallel","core:tour","navigation:scrollTo","navigation:navigate"],V2=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),Zk=5e4,Yk=50;function gr(t){let e=[],n=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:n};let r=t.kind;if(!r||typeof r!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:n};if(!B2.includes(r))return e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:e,warnings:n};switch(!gd(r)&&r!=="core:mountWidget"&&e.push({code:"NO_EXECUTOR",message:`No executor registered for action kind: ${r}`,field:"kind"}),r){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":ui(t,e,n);break;case"overlays:badge":ui(t,e,n),z2(t,e,n);break;case"overlays:tooltip":ui(t,e,n),H2(t,e,n);break;case"overlays:modal":J2(t,e,n);break;case"content:insertHtml":ui(t,e,n),j2(t,e,n);break;case"content:setText":ui(t,e,n),U2(t,e,n);break;case"content:setAttr":ui(t,e,n),W2(t,e,n);break;case"content:addClass":case"content:removeClass":ui(t,e,n),q2(t,e,n);break;case"content:setStyle":ui(t,e,n),K2(t,e,n);break;case"core:mountWidget":G2(t,e,n);break;case"core:wait":Z2(t,e,n);break;case"core:sequence":Y2(t,e,n);break;case"core:parallel":X2(t,e,n);break;case"core:tour":eO(t,e,n);break;case"navigation:navigate":Q2(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function ui(t,e,n){!t.anchorId||typeof t.anchorId!="string"?e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' property",field:"anchorId"}):t.anchorId.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor ID is unusually long",suggestion:"Consider using a shorter, more descriptive ID"})}function z2(t,e,n){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&n.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function H2(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Tooltip action requires 'content' object",field:"content"});return}(!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Tooltip content requires 'body' property",field:"content.body"})}function j2(t,e,n){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>Zk&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${Zk}`,field:"html"});let r=["before","after","prepend","append","replace"];(!t.position||!r.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${r.join(", ")}`,field:"position"})}function U2(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function W2(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(V2.has(t.attr.toLowerCase())||t.attr.toLowerCase().startsWith("on"))&&e.push({code:"DANGEROUS_ATTR",message:`Event handler attributes are not allowed: ${t.attr}`,field:"attr"}),(t.value===void 0||t.value===null)&&e.push({code:"MISSING_VALUE",message:"setAttr action requires 'value' property",field:"value"})}function q2(t,e,n){!t.className||typeof t.className!="string"?e.push({code:"MISSING_CLASS_NAME",message:"Class action requires 'className' property",field:"className"}):/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t.className)||n.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function K2(t,e,n){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let r=Object.keys(t.styles).length;r>Yk&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${Yk}`,field:"styles"});for(let[i,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${i}`,field:`styles.${i}`})}}function G2(t,e,n){(!t.slot||typeof t.slot!="string")&&e.push({code:"MISSING_SLOT",message:"mountWidget action requires 'slot' property",field:"slot"}),!t.widget||typeof t.widget!="object"?e.push({code:"MISSING_WIDGET",message:"mountWidget action requires 'widget' object",field:"widget"}):(!t.widget.widgetId||typeof t.widget.widgetId!="string")&&e.push({code:"MISSING_WIDGET_ID",message:"Widget must have a 'widgetId' property",field:"widget.widgetId"})}function Z2(t,e,n){t.durationMs===void 0&&!t.event&&e.push({code:"MISSING_WAIT_CONFIG",message:"wait action requires either 'durationMs' or 'event' property"}),t.durationMs!==void 0&&t.durationMs<0&&e.push({code:"INVALID_DURATION",message:"durationMs must be a positive number",field:"durationMs"}),t.event!==void 0&&typeof t.event!="string"&&e.push({code:"INVALID_EVENT",message:"event must be a string",field:"event"})}function Y2(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"sequence action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let r=0;r<t.actions.length;r++){let i=gr(t.actions[r]);for(let o of i.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of i.warnings)n.push(o)}}function X2(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"parallel action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_PARALLEL",message:"parallel has no actions",suggestion:"Add at least one action to the parallel group"}),t.waitFor&&!["all","any"].includes(t.waitFor)&&e.push({code:"INVALID_WAIT_FOR",message:"waitFor must be 'all' or 'any'",field:"waitFor"});for(let r=0;r<t.actions.length;r++){let i=gr(t.actions[r]);for(let o of i.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of i.warnings)n.push(o)}}function Q2(t,e,n){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let r=t.url.trim().toLowerCase();r.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),r.startsWith("data:")&&n.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function J2(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let r=0;r<t.ctaButtons.length;r++){let i=t.ctaButtons[r];(!i.label||typeof i.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${r} requires 'label' property`,field:`ctaButtons[${r}].label`}),(!i.actionId||typeof i.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${r} requires 'actionId' property`,field:`ctaButtons[${r}].actionId`})}}function eO(t,e,n){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let r=new Set;for(let i=0;i<t.steps.length;i++){let o=t.steps[i];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${i} requires 'id' property`,field:`steps[${i}].id`}):(r.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${i}].id`}),r.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${i} requires 'action' property`,field:`steps[${i}].action`});else{let s=gr(o.action);for(let a of s.errors)e.push({...a,field:`steps[${i}].action${a.field?`.${a.field}`:""}`});for(let a of s.warnings)n.push(a)}if(o.onAction)for(let[s,a]of Object.entries(o.onAction))a!=="end"&&!t.steps.some(l=>l.id===a)&&n.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${a}`,suggestion:`Make sure step "${a}" exists in the tour`})}}function md(t){let e=[],n=[];if(!Array.isArray(t))return e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:n};for(let r=0;r<t.length;r++){let i=gr(t[r]);for(let o of i.errors)e.push({...o,field:o.field?`[${r}].${o.field}`:`[${r}]`});for(let o of i.warnings)n.push({...o,suggestion:o.suggestion?`Action ${r}: ${o.suggestion}`:void 0})}return{valid:e.length===0,errors:e,warnings:n}}var tO=0;function vd(t){let{overlayRoot:e,eventBus:n,surfaces:r,anchorResolver:i,adaptiveId:o,executorRegistry:s=ci}=t,a=new Map;function l(){return`action-${++tO}`}function c(d,p){n&&n.publish(d,p)}function u(){return{overlayRoot:e,resolveAnchor:i,generateId:l,publishEvent:c,adaptiveId:o,applyAction:h,subscribeEvent:n?(d,p)=>n.subscribe({names:[d]},m=>p(m.props)):void 0}}async function f(d,p){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let m=r.mount(d.slot,{type:"widget",widgetId:d.widget.widgetId,config:d.widget.props},{priority:d.widget.priority});return p.publishEvent("action.applied",{id:p.generateId(),kind:"core:mountWidget",slot:d.slot,widgetId:d.widget.widgetId}),{cleanup:()=>{m.unmount()},updateFn:y=>{if("widget"in y&&y.widget){let w=y.widget;w.props&&m.update({type:"widget",widgetId:d.widget.widgetId,config:w.props})}}}}async function h(d){let p=gr(d);if(!p.valid){let E=p.errors.map(P=>P.message).join("; ");throw new Error(`Action validation failed: ${E}`)}let m=l(),y=u(),w;if(d.kind==="core:mountWidget")w=await f(d,y);else{let E=s.get(d.kind);if(!E)throw new Error(`No executor for action kind: ${d.kind}`);w=await E(d,y)}let k={id:m,action:d,adaptiveId:o,appliedTs:Date.now(),state:"applied",cleanup:w.cleanup,updateFn:w.updateFn};return a.set(m,k),c("action.applied",{id:m,kind:d.kind,anchorId:"anchorId"in d?d.anchorId:void 0}),{id:m,action:d,async revert(){let E=a.get(m);if(!(!E||E.state!=="applied"))try{await E.cleanup(),E.state="reverted",c("action.reverted",{id:m,kind:d.kind})}catch(P){throw E.state="failed",c("action.failed",{id:m,kind:d.kind,error:String(P)}),P}finally{a.delete(m)}},isApplied(){return a.get(m)?.state==="applied"},async update(E){let P=a.get(m);if(!P||P.state!=="applied")throw new Error("Cannot update action that is not applied");if(P.updateFn)await P.updateFn(E);else throw new Error(`Action kind ${d.kind} does not support updates`)},getState(){return a.get(m)?.state??"reverted"}}}async function g(d){let p=md(d);if(!p.valid){let b=p.errors.map(E=>E.message).join("; ");throw new Error(`Batch validation failed: ${b}`)}let m=l(),y=[],w=[];try{for(let b of d){let E=await h(b);y.push(E),w.push(E)}}catch(b){for(let E of w)try{await E.revert()}catch{}throw b}return{id:m,handles:y,async revertAll(){for(let b=y.length-1;b>=0;b--)try{await y[b].revert()}catch(E){console.error(`[ActionEngine] Error reverting action ${y[b].id}:`,E)}},isApplied(){return y.every(b=>b.isApplied())}}}function v(d){return gr(d)}function _(){return Array.from(a.values()).map(d=>({id:d.id,action:d.action,adaptiveId:d.adaptiveId,appliedTs:d.appliedTs,state:d.state}))}function x(){for(let d of a.values())if(d.state==="applied")try{d.cleanup()}catch(p){console.error("[ActionEngine] Error during cleanup:",p)}a.clear()}return{apply:h,applyBatch:g,validate:v,getActive:_,destroy:x}}function gs(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function al(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}function Xk(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),c=document.createElement("div");return c.append(l),c.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let r=n.content,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),s=[];for(;i.nextNode();){let a=i.currentNode,l=a.tagName.toLowerCase();if(!o.has(l)){s.push(a);continue}for(let c of Array.from(a.attributes)){let u=c.name.toLowerCase(),f=c.value.trim().toLowerCase(),h=u.startsWith("on"),g=(u==="href"||u==="src")&&f.startsWith("javascript:");(h||g)&&a.removeAttribute(c.name)}}for(let a of s){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML=(r.firstChild,n.innerHTML)}function e1(t){let e=Le(t),n=parseFloat(e.width)||0,r=parseFloat(e.height)||0,i=Ve(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Ln(n)!==o||Ln(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Qm(t){return Ne(t)?t:t.contextElement}function ms(t){let e=Qm(t);if(!Ve(e))return Ie(1);let n=e.getBoundingClientRect(),{width:r,height:i,$:o}=e1(e),s=(o?Ln(n.width):n.width)/r,a=(o?Ln(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var nO=Ie(0);function t1(t){let e=Oe(t);return!eo()||!e.visualViewport?nO:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function rO(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Oe(t)?!1:e}function ro(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=Qm(t),s=Ie(1);e&&(r?Ne(r)&&(s=ms(r)):s=ms(t));let a=rO(o,n,r)?t1(o):Ie(0),l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){let h=Oe(o),g=r&&Ne(r)?Oe(r):r,v=h,_=to(v);for(;_&&r&&g!==v;){let x=ms(_),d=_.getBoundingClientRect(),p=Le(_),m=d.left+(_.clientLeft+parseFloat(p.paddingLeft))*x.x,y=d.top+(_.clientTop+parseFloat(p.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,f*=x.y,l+=m,c+=y,v=Oe(_),_=to(v)}}return Fn({width:u,height:f,x:l,y:c})}function Jm(t,e){let n=Bn(t).scrollLeft;return e?e.left+n:ro($e(t)).left+n}function n1(t,e,n){n===void 0&&(n=!1);let r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:Jm(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function iO(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t,o=i==="fixed",s=$e(r),a=e?hr(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Ie(1),u=Ie(0),f=Ve(r);if((f||!f&&!o)&&((mn(r)!=="body"||Dn(s))&&(l=Bn(r)),Ve(r))){let g=ro(r);c=ms(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}let h=s&&!f&&!o?n1(s,l,!0):Ie(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function oO(t){return Array.from(t.getClientRects())}function sO(t){let e=$e(t),n=Bn(t),r=t.ownerDocument.body,i=ct(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ct(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+Jm(t),a=-n.scrollTop;return Le(r).direction==="rtl"&&(s+=ct(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function aO(t,e){let n=Oe(t),r=$e(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;let c=eo();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function lO(t,e){let n=ro(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Ve(t)?ms(t):Ie(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function Qk(t,e,n){let r;if(e==="viewport")r=aO(t,n);else if(e==="document")r=sO($e(t));else if(Ne(e))r=lO(e,n);else{let i=t1(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Fn(r)}function r1(t,e){let n=mt(t);return n===e||!Ne(n)||tn(n)?!1:Le(n).position==="fixed"||r1(n,e)}function cO(t,e){let n=e.get(t);if(n)return n;let r=$n(t,[],!1).filter(a=>Ne(a)&&mn(a)!=="body"),i=null,o=Le(t).position==="fixed",s=o?mt(t):t;for(;Ne(s)&&!tn(s);){let a=Le(s),l=Ji(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Dn(s)&&!l&&r1(t,s))?r=r.filter(u=>u!==s):i=a,s=mt(s)}return e.set(t,r),r}function uO(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t,s=[...n==="clippingAncestors"?hr(e)?[]:cO(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{let f=Qk(e,u,i);return c.top=ct(f.top,c.top),c.right=en(f.right,c.right),c.bottom=en(f.bottom,c.bottom),c.left=ct(f.left,c.left),c},Qk(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function dO(t){let{width:e,height:n}=e1(t);return{width:e,height:n}}function fO(t,e,n){let r=Ve(e),i=$e(e),o=n==="fixed",s=ro(t,!0,o,e),a={scrollLeft:0,scrollTop:0},l=Ie(0);if(r||!r&&!o)if((mn(e)!=="body"||Dn(i))&&(a=Bn(e)),r){let h=ro(e,!0,o,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&(l.x=Jm(i));let c=i&&!r&&!o?n1(i,a):Ie(0),u=s.left+a.scrollLeft-l.x-c.x,f=s.top+a.scrollTop-l.y-c.y;return{x:u,y:f,width:s.width,height:s.height}}function Xm(t){return Le(t).position==="static"}function Jk(t,e){if(!Ve(t)||Le(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $e(t)===n&&(n=n.ownerDocument.body),n}function i1(t,e){let n=Oe(t);if(hr(t))return n;if(!Ve(t)){let i=mt(t);for(;i&&!tn(i);){if(Ne(i)&&!Xm(i))return i;i=mt(i)}return n}let r=Jk(t,e);for(;r&&dd(r)&&Xm(r);)r=Jk(r,e);return r&&tn(r)&&Xm(r)&&!Ji(r)?n:r||fd(t)||n}var pO=async function(t){let e=this.getOffsetParent||i1,n=this.getDimensions,r=await n(t.floating);return{reference:fO(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function hO(t){return Le(t).direction==="rtl"}var gO={convertOffsetParentRelativeRectToViewportRelativeRect:iO,getDocumentElement:$e,getClippingRect:uO,getOffsetParent:i1,getElementRects:pO,getClientRects:oO,getDimensions:dO,getScale:ms,isElement:Ne,isRTL:hO};function o1(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function mO(t,e){let n=null,r,i=$e(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();let c=t.getBoundingClientRect(),{left:u,top:f,width:h,height:g}=c;if(a||e(),!h||!g)return;let v=Mn(f),_=Mn(i.clientWidth-(u+h)),x=Mn(i.clientHeight-(f+g)),d=Mn(u),m={rootMargin:-v+"px "+-_+"px "+-x+"px "+-d+"px",threshold:ct(0,en(1,l))||1},y=!0;function w(k){let b=k[0].intersectionRatio;if(b!==l){if(!y)return s();b?s(!1,b):r=setTimeout(()=>{s(!1,1e-7)},1e3)}b===1&&!o1(c,t.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(w,{...m,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,m)}n.observe(t)}return s(!0),o}function s1(t,e,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Qm(t),u=i||o?[...c?$n(c):[],...$n(e)]:[];u.forEach(d=>{i&&d.addEventListener("scroll",n,{passive:!0}),o&&d.addEventListener("resize",n)});let f=c&&a?mO(c,n):null,h=-1,g=null;s&&(g=new ResizeObserver(d=>{let[p]=d;p&&p.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var m;(m=g)==null||m.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let v,_=l?ro(t):null;l&&x();function x(){let d=ro(t);_&&!o1(_,d)&&n(),_=d,v=requestAnimationFrame(x)}return n(),()=>{var d;u.forEach(p=>{i&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),f?.(),(d=g)==null||d.disconnect(),g=null,l&&cancelAnimationFrame(v)}}var a1=ld;var l1=cd,c1=ad;var u1=(t,e,n)=>{let r=new Map,i={platform:gO,...n},o={...i.platform,_c:r};return sd(t,e,{...i,platform:o})};var ev={drawer_right:{position:"fixed",top:"0",right:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_left:{position:"fixed",top:"0",left:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_bottom:{position:"fixed",left:"0",right:"0",bottom:"0",maxHeight:"50vh"},overlay_center:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:"90vw",maxHeight:"90vh"},overlay_corner_br:{position:"fixed",bottom:"16px",right:"16px",maxWidth:"400px",maxHeight:"80vh"},overlay_corner_bl:{position:"fixed",bottom:"16px",left:"16px",maxWidth:"400px",maxHeight:"80vh"},toast_top:{position:"fixed",top:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"},toast_bottom:{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"}},vs={fade:[{opacity:0},{opacity:1}],slide:[{opacity:0,transform:"translateY(10px)"},{opacity:1,transform:"translateY(0)"}],scale:[{opacity:0,transform:"scale(0.95)"},{opacity:1,transform:"scale(1)"}],none:[]},d1={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function yd(t,e,n){let r=ev[e];Object.assign(t.style,r),n&&(n.maxWidth&&(t.style.maxWidth=n.maxWidth),n.maxHeight&&(t.style.maxHeight=n.maxHeight),n.minWidth&&(t.style.minWidth=n.minWidth),n.minHeight&&(t.style.minHeight=n.minHeight))}function _d(t,e,n){let r=n.placement==="auto"?"bottom":n.placement,i=[a1(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&i.push(c1()),n.shift!==!1&&i.push(l1({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",s1(e,t,async()=>{let{x:s,y:a,strategy:l}=await u1(e,t,{placement:r,middleware:i});Object.assign(t.style,{position:l,left:`${s}px`,top:`${a}px`})})}function wd(t,e,n="append"){return t.style.position="relative",t.style.display="inline-block",n==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function xd(t,e){return e==="none"||vs[e].length===0?null:t.animate(vs[e],d1)}function Sd(t,e){if(e==="none"||vs[e].length===0)return Promise.resolve();let n=[...vs[e]].reverse(),r=t.animate(n,d1);return new Promise(i=>{r.onfinish=()=>i(),r.oncancel=()=>i()})}function bd(t,e){let n=document.createElement("div");return n.setAttribute("data-syntro-surface",t),n.setAttribute("data-syntro-mount-id",e),n.className="syntro-surface",Object.assign(n.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),n}function kd(t){switch(gs(t)){case"static":return t.startsWith("drawer")?2147483640:t.startsWith("overlay")?2147483642:t.startsWith("toast")?2147483644:2147483640;case"inline":return 1;case"adjacent":return 2147483638;default:return 2147483640}}var vO=0;function Ed(t){let{overlayRoot:e,eventBus:n,anchorResolver:r,defaultAnimation:i="fade",widgetRegistry:o}=t,s=new Map,a=new Map,l=new Map;function c(){return`mount-${++vO}`}function u(y,w){n&&n.publish(y,w)}function f(y){let w=l.get(y);if(w){let k=x(y);for(let b of w)try{b(k)}catch(E){console.error("[Surfaces] State callback error:",E)}}}let h=new Map;function g(y,w,k){switch(w.type){case"html":y.innerHTML=Xk(w.content);return;case"widget":{if(o&&o.has(w.widgetId)){let b=o.mount(w.widgetId,y,w.config);return k&&h.set(k,b),()=>{b.unmount(),k&&h.delete(k)}}console.warn(`[Surfaces] Widget not found: ${w.widgetId}`),y.innerHTML=`<div data-widget-id="${w.widgetId}" data-widget-missing="true">Widget: ${w.widgetId}</div>`;return}case"custom":return w.mount(y);case"react":y.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function v(y,w,k){let b=c(),E=gs(y),P=k?.priority??0,A=k?.animation??i,H=k?.exclusive??!0,K=s.get(y);if(K&&H){if(K.options.priority>P)throw new Error(`Slot ${y} is occupied by higher priority content (${K.options.priority} > ${P})`);_(K)}let Y=bd(y,b);Y.style.zIndex=String(kd(y));let W;if(E==="static")yd(Y,y,k?.constraints),e.appendChild(Y);else if(E==="inline"){let D=al(y);if(!D)throw new Error(`Invalid inline slot: ${y}`);if(!r)throw new Error("Anchor resolver required for inline slots");let Z=r(D);if(!Z)throw new Error(`Anchor not found for inline slot: ${D}`);W=wd(Y,Z)}else if(E==="adjacent"){let D=al(y);if(!D)throw new Error(`Invalid adjacent slot: ${y}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let Z=r(D);if(!Z)throw new Error(`Anchor not found for adjacent slot: ${D}`);e.appendChild(Y),W=_d(Y,Z,k?.position??{placement:"bottom"})}let le=g(Y,w,b);xd(Y,A);let B={id:b,slot:y,content:w,options:{priority:P,exclusive:H,animation:A,position:k?.position??{placement:"auto"},constraints:k?.constraints??{},adaptiveId:k?.adaptiveId,autoUnmountOnRouteChange:k?.autoUnmountOnRouteChange??!0},container:Y,cleanup:()=>{W?.(),le?.()},mountedAt:Date.now()};return s.set(y,B),a.set(y,(a.get(y)??0)+1),u("surface.mounted",{slot:y,id:b,adaptiveId:k?.adaptiveId}),f(y),{id:b,update(D){let Z=s.get(y);if(!Z||Z.id!==b)throw new Error("Mount no longer active");let vt=h.get(b);if(vt){if(D.type==="widget"){vt.update(D.config),Z.content=D;return}vt.unmount(),h.delete(b)}Z.container.innerHTML="";let Vn=g(Z.container,D,b);if(Z.content=D,Vn){let Ge=Z.cleanup;Z.cleanup=()=>{Ge?.(),Vn()}}},setOptions(D){let Z=s.get(y);if(!Z||Z.id!==b)throw new Error("Mount no longer active");D.priority!==void 0&&(Z.options.priority=D.priority),D.animation!==void 0&&(Z.options.animation=D.animation),D.constraints&&E==="static"&&(D.constraints.maxWidth&&(Z.container.style.maxWidth=D.constraints.maxWidth),D.constraints.maxHeight&&(Z.container.style.maxHeight=D.constraints.maxHeight),D.constraints.minWidth&&(Z.container.style.minWidth=D.constraints.minWidth),D.constraints.minHeight&&(Z.container.style.minHeight=D.constraints.minHeight)),f(y)},async unmount(){let D=s.get(y);!D||D.id!==b||await _(D)},isMounted(){return s.get(y)?.id===b},getContainer(){let D=s.get(y);return D?.id===b?D.container:null}}}async function _(y){await Sd(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),s.delete(y.slot),u("surface.unmounted",{slot:y.slot,id:y.id}),f(y.slot)}function x(y){let w=s.get(y);return{slot:y,occupied:!!w,currentPriority:w?.options.priority,currentAdaptiveId:w?.options.adaptiveId,mountCount:a.get(y)??0,currentMountId:w?.id}}function d(y,w){let k=l.get(y);return k||(k=new Set,l.set(y,k)),k.add(w),()=>{k?.delete(w),k?.size===0&&l.delete(y)}}function p(y,w){let k=s.get(y);return k?w!==void 0?w>=k.options.priority:!1:!0}function m(){for(let y of s.values())try{y.cleanup?.(),y.container.remove()}catch(w){console.error("[Surfaces] Error during cleanup:",w)}s.clear(),l.clear()}return{mount:v,getState:x,onStateChange:d,canMount:p,destroy:m}}var ll=class{constructor(){j(this,"widgets",new Map);j(this,"mountedWidgets",new Map);j(this,"mountIdCounter",0)}register(e,n,r="custom",i){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:n,source:r,metadata:i})}unregister(e){let n=this.widgets.get(e);return n?n.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),!0):!1}unregisterBySource(e){for(let[n,r]of this.widgets.entries())r.source===e&&this.widgets.delete(n)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,n,r){let i=this.widgets.get(e);if(!i)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;n.setAttribute("data-widget-mount-id",o),n.setAttribute("data-widget-id",e);let s=i.widget.mount(n,r);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let l=this.mountedWidgets.get(o);l&&(l.cleanup?.(),this.mountedWidgets.delete(o),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:l=>{if(i.widget.update)i.widget.update(n,l);else{let c=this.mountedWidgets.get(o);if(c){c.cleanup?.(),n.innerHTML="";let u=i.widget.mount(n,l);c.cleanup=u??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(n=>n.source===e)}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},Cd=new ll;function Ad(t){let{appId:e,runtime:n,isBuiltIn:r=!1}=t,i=`app:${e}:`,o=[],s=[],a=n.state.ns(`app:${e}`);return{appId:e,state:{get:c=>a.get(c),set:(c,u)=>a.set(c,u),remove:c=>a.remove(c)},telemetry:n.telemetry?{emit:(c,u)=>{n.events.publish(c,{...u,_appId:e})},getSessionId:()=>n.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(c,u,f)=>{let h=n.surfaces.mount(c,u,{...f,adaptiveId:e});return{unmount:()=>h.unmount(),update:g=>h.update(g)}},canMount:(c,u)=>n.surfaces.canMount(c,u)},events:{subscribe:c=>n.events.subscribe(u=>{c(u)}),publish:(c,u)=>{n.events.publish(c,{...u,_appId:e})}},registerAction:c=>{n.executors.register(c.kind,c.executor,c.schema,e,r),o.push(c.kind)},registerWidget:c=>{n.widgets.register(c.id,c.component,e,c.metadata),s.push(c.id)}}}function Rd(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var cl=class{constructor(){j(this,"apps",new Map);j(this,"eventListeners",new Set);j(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,n]of this.apps)n.state==="active"&&await this.deactivate(e);this.runtime=null}register(e){if(!e.id||typeof e.id!="string")throw new Error("App manifest must have an 'id' property");if(!e.version||typeof e.version!="string")throw new Error("App manifest must have a 'version' property");if(!e.name||typeof e.name!="string")throw new Error("App manifest must have a 'name' property");if(this.apps.has(e.id)){if(this.apps.get(e.id).state==="active")throw new Error(`Cannot re-register active app: ${e.id}`);console.warn(`[AppRegistry] Overriding existing app registration: ${e.id}`)}let n={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,n),this.emit({type:"app:registered",appId:e.id,manifest:e}),n}async activate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state==="active"){console.warn(`[AppRegistry] App already active: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(n.manifest.dependencies)for(let r of n.manifest.dependencies){let i=this.apps.get(r);if(!i||i.state!=="active")throw new Error(`App ${e} depends on ${r}, which is not active`)}n.state="activating";try{let r=n.manifest.metadata?.isBuiltIn===!0,i=Ad({appId:e,runtime:this.runtime,isBuiltIn:r}),{runtime:o}=n.manifest,s=[];if(o){if(o.actions)for(let a of o.actions)i.registerAction(a);if(o.widgets)for(let a of o.widgets)i.registerWidget(a);if(o.events)for(let a of o.events){let l=this.runtime.events.subscribe(c=>{if(a.names.includes(c.name)){let u={appId:e,state:i.state,telemetry:i.telemetry,surfaces:i.surfaces};try{a.handler(c,u)}catch(f){console.error(`[AppRegistry] Event handler error in ${e}:`,f)}}});s.push(l)}}n.cleanup=async()=>{for(let a of s)try{await a()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}Rd(e,this.runtime)},n.state="active",n.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(r){throw n.state="error",n.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async deactivate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[r,i]of this.apps)if(i.state==="active"&&i.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${r} depends on it`);n.state="deactivating";try{n.cleanup&&(await n.cleanup(),n.cleanup=void 0),n.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(r){throw n.state="error",n.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async unregister(e){let n=this.apps.get(e);n&&(n.state==="active"&&await this.deactivate(e),this.apps.delete(e),this.emit({type:"app:unregistered",appId:e}))}get(e){return this.apps.get(e)}has(e){return this.apps.has(e)}isActive(e){return this.apps.get(e)?.state==="active"}list(){return Array.from(this.apps.values())}listActive(){return Array.from(this.apps.values()).filter(e=>e.state==="active")}listEditable(){return Array.from(this.apps.values()).filter(e=>e.manifest.editor!==void 0)}subscribe(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}emit(e){for(let n of this.eventListeners)try{n(e)}catch(r){console.error("[AppRegistry] Event listener error:",r)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},Td=new cl;var yO=new Set(["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","overlays:modal","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","navigation:scrollTo","navigation:navigate","core:mountWidget","core:wait","core:sequence","core:parallel","core:tour"]);function tv(t){return yO.has(t)}function nv(t){if(tv(t))return null;let e=t.indexOf(":");return e===-1?null:t.slice(0,e)}function rv(t){let e=t.indexOf(":");return e===-1?null:t.slice(0,e)}function Pd(t){let{cdnBase:e,registry:n,timeout:r=1e4,onLoadStart:i,onLoadEnd:o}=t,s=new Map,a=new Set;function l(v){return`${e}/apps/${v}/index.js`}async function c(v){if(n.has(v))return{appId:v,success:!0,manifest:n.get(v)?.manifest};if(s.has(v))return s.get(v);let _=(async()=>{i?.(v);try{let x=l(v);if(a.has(x)){let y=n.get(v);if(y)return o?.(v,!0),{appId:v,success:!0,manifest:y.manifest}}let d=new Promise((y,w)=>{setTimeout(()=>w(new Error(`Timeout loading app: ${v}`)),r)}),p=u(x,v);await Promise.race([p,d]),a.add(x);let m=n.get(v);if(!m)throw new Error(`App ${v} did not register after loading`);return o?.(v,!0),{appId:v,success:!0,manifest:m.manifest}}catch(x){let d=x instanceof Error?x.message:String(x);return o?.(v,!1,d),{appId:v,success:!1,error:d}}finally{s.delete(v)}})();return s.set(v,_),_}async function u(v,_){if(typeof window<"u"){try{let x=await import(v);x.manifest?n.register(x.manifest):x.default?.manifest?n.register(x.default.manifest):x.default&&n.register(x.default);return}catch{}return new Promise((x,d)=>{let p=document.createElement("script");p.src=v,p.async=!0,p.onload=()=>{n.get(_)?x():d(new Error(`App ${_} did not self-register`))},p.onerror=()=>{d(new Error(`Failed to load app script: ${v}`))},document.head.appendChild(p)})}throw new Error("Dynamic app loading not supported in SSR")}function f(v){let _=new Set;if(v.apps)for(let x of v.apps)_.add(x);if(v.actions)for(let x of v.actions){let d=nv(x.kind);if(d&&_.add(d),x.kind==="core:mountWidget"){let p=x.widget?.widgetId;if(p){let m=rv(p);m&&_.add(m)}}}return Array.from(_)}async function h(v){let _=f(v);return _.length===0?[]:await Promise.all(_.map(d=>c(d)))}async function g(v){return Promise.all(v.map(_=>c(_)))}return{loadApp:c,loadAppsForConfig:h,preloadApps:g,getRequiredApps:f,getAppUrl:l}}var ul=null;function p1(){if(ul&&document.body.contains(ul))return ul;let t=document.getElementById("syntro-overlays");return t||(t=document.createElement("div"),t.id="syntro-overlays",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none"}),document.body.appendChild(t)),ul=t,_O(),ul}var f1=!1;function _O(){if(f1)return;let t=`
|
|
142
|
+
</div>`);let o=Bk(n,e.overlayRoot,{html:i,placement:t.placement??"top",trigger:t.trigger??"immediate",onAction:s=>{if(s==="cta"&&r.cta)e.publishEvent("action.cta_clicked",{anchorId:t.anchorId,ctaLabel:r.cta.label});else if(r.ctaButtons){let a=r.ctaButtons.find(l=>l.actionId===s);a&&e.publishEvent("action.tooltip_cta_clicked",{anchorId:t.anchorId,actionId:s,label:a.label})}}});return e.publishEvent("action.applied",{id:e.generateId(),kind:"overlays:tooltip",anchorId:t.anchorId,trigger:t.trigger??"immediate"}),{cleanup:()=>{o.destroy()}}},Um=[{kind:"overlays:highlight",executor:Vk},{kind:"overlays:pulse",executor:zk},{kind:"overlays:badge",executor:Hk},{kind:"overlays:tooltip",executor:jk},{kind:"overlays:modal",executor:jm}],Uk={id:"adaptive-overlays",version:"1.0.0",name:"Overlays",description:"Tooltips, highlights, badges, modals, and visual overlays",executors:Um};var Wk=async(t,e)=>{let n=e.resolveAnchor(t.anchorId);if(!n)throw new Error(`Anchor not found: ${t.anchorId}`);let r=window.scrollX,i=window.scrollY;return n.scrollIntoView({behavior:t.behavior??"smooth",block:t.block??"center",inline:t.inline??"nearest"}),e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:scrollTo",anchorId:t.anchorId,behavior:t.behavior??"smooth"}),{cleanup:()=>{}}},qk=async(t,e)=>{let n=t.url.trim();if(n.toLowerCase().startsWith("javascript:"))throw new Error("javascript: URLs are not allowed");let r=t.target??"_self";return e.publishEvent("action.applied",{id:e.generateId(),kind:"navigation:navigate",url:t.url,target:r}),r==="_blank"?window.open(n,"_blank","noopener,noreferrer"):window.location.href=n,{cleanup:()=>{}}},Wm=[{kind:"navigation:scrollTo",executor:Wk},{kind:"navigation:navigate",executor:qk}],Kk={id:"adaptive-navigation",version:"1.0.0",name:"Navigation",description:"Scroll and page navigation actions",executors:Wm};var Km="syntro_active_tour",hd=new Map;function L2(t){try{let e=localStorage.getItem(Km);if(!e)return null;let n=JSON.parse(e);return n.tourId!==t?null:n}catch{return null}}function qm(t){try{localStorage.setItem(Km,JSON.stringify(t))}catch{}}function M2(){try{localStorage.removeItem(Km)}catch{}}function il(){return window.location.pathname}function F2(t){if(!t.route)return!0;let e=il();return t.route.includes("*")?new RegExp("^"+t.route.replace(/\*/g,".*")+"$").test(e):e===t.route}var Gm=async(t,e)=>{let{tourId:n,steps:r,startStep:i,autoStart:o=!0}=t;if(r.length===0)throw new Error(`Tour "${n}" has no steps`);if(hd.has(n))return{cleanup:async()=>{let m=hd.get(n);m&&await m.cleanup()}};if(!e.applyAction)throw new Error("Tour executor requires applyAction in context");let s=L2(n),a=!!s;if(!a&&!o)return{cleanup:()=>{}};s||(s={tourId:n,currentStepId:i||r[0].id,startedAt:Date.now()},qm(s));let l=r.findIndex(m=>m.id===s.currentStepId);if(l===-1){let m=i||r[0].id;l=r.findIndex(y=>y.id===m),l===-1&&(l=0),s.currentStepId=r[l].id,qm(s)}let c=r[l];if(!F2(c))return e.publishEvent("tour.waiting_for_route",{tourId:n,stepId:c.id,expectedRoute:c.route,currentRoute:il()}),{cleanup:()=>{}};let u=!1,f=null,h=null,g=null,v=async()=>{h&&(h(),h=null),f&&f.isApplied()&&(await f.revert(),f=null)},_=async m=>{if(u)return;if(await v(),m==="end"){M2(),e.publishEvent("tour.completed",{tourId:n,totalSteps:r.length}),u=!0;return}let y=r.find(w=>w.id===m);if(!y){console.error(`[Tour] Step "${m}" not found`);return}if(s.currentStepId=m,qm(s),e.publishEvent("tour.step_changed",{tourId:n,previousStepId:c.id,nextStepId:m}),y.route&&y.route!==il()){e.publishEvent("tour.awaiting_navigation",{tourId:n,stepId:m,targetRoute:y.route});return}await x(y)},x=async m=>{if(!u){e.publishEvent("tour.step_started",{tourId:n,stepId:m.id,stepIndex:r.findIndex(y=>y.id===m.id),totalSteps:r.length});try{f=await e.applyAction(m.action)}catch(y){console.error(`[Tour] Failed to execute step "${m.id}":`,y),e.publishEvent("tour.step_failed",{tourId:n,stepId:m.id,error:String(y)});return}if(m.onAction&&e.subscribeEvent){h=e.subscribeEvent("action.modal_cta_clicked",b=>{let k=b?.actionId;if(k&&m.onAction){let E=m.onAction[k];E&&_(E)}});let y=e.subscribeEvent("action.tooltip_cta_clicked",b=>{let k=b?.actionId;if(k&&m.onAction){let E=m.onAction[k];E&&_(E)}}),w=h;h=()=>{w(),y()}}}};g=(()=>{let m=il(),y=()=>{let k=il();k!==m&&(m=k,e.publishEvent("tour.route_changed",{tourId:n,newRoute:k}))};window.addEventListener("popstate",y);let w=history.pushState.bind(history),b=history.replaceState.bind(history);return history.pushState=(...k)=>{w(...k),y()},history.replaceState=(...k)=>{b(...k),y()},()=>{window.removeEventListener("popstate",y),history.pushState=w,history.replaceState=b}})(),a?e.publishEvent("tour.resumed",{tourId:n,stepId:s.currentStepId}):e.publishEvent("tour.started",{tourId:n,totalSteps:r.length,startStepId:s.currentStepId}),await x(c);let p=async()=>{u=!0,hd.delete(n),await v(),g&&g(),e.publishEvent("tour.paused",{tourId:n,stepId:s.currentStepId})};return hd.set(n,{cleanup:p}),{cleanup:p}};var ol=class{constructor(){j(this,"executors",new Map);for(let{kind:e,executor:n}of Fm)this.registerCore(e,n);for(let{kind:e,executor:n}of Um)this.registerCore(e,n);for(let{kind:e,executor:n}of Wm)this.registerCore(e,n);this.registerCore("core:mountWidget",async()=>{throw new Error("core:mountWidget must be handled by ActionEngine")}),this.registerCore("core:tour",Gm)}registerCore(e,n,r){this.executors.set(e,{kind:e,executor:n,schema:r,source:"core",isBuiltIn:!0})}register(e,n,r,i="custom",o=!1){if(this.executors.has(e)){if(this.executors.get(e).isBuiltIn)throw new Error(`Cannot override built-in executor: ${e}`);console.warn(`[ExecutorRegistry] Overriding executor for kind: ${e}`)}this.executors.set(e,{kind:e,executor:n,schema:r,source:i,isBuiltIn:o})}unregister(e){let n=this.executors.get(e);return n?n.isBuiltIn?(console.warn(`[ExecutorRegistry] Cannot unregister built-in executor: ${e}`),!1):(this.executors.delete(e),!0):!1}unregisterBySource(e){for(let[n,r]of this.executors.entries())r.source===e&&this.executors.delete(n)}get(e){return this.executors.get(e)?.executor}getRegistration(e){return this.executors.get(e)}has(e){return this.executors.has(e)}validate(e){let n=[];if(!e||typeof e!="object")return n.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:n,warnings:[]};let r=e.kind;if(!r||typeof r!="string")return n.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:n,warnings:[]};let i=this.executors.get(r);if(!i)return n.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:n,warnings:[]};if(i.schema){let o=i.schema.safeParse(e);if(!o.success){for(let s of o.error.issues)n.push({code:"SCHEMA_VALIDATION_ERROR",message:s.message,field:s.path.join(".")});return{valid:!1,errors:n,warnings:[]}}}return{valid:!0,errors:[],warnings:[]}}list(){return Array.from(this.executors.keys())}listRegistrations(){return Array.from(this.executors.values())}getBuiltInKinds(){return Array.from(this.executors.entries()).filter(([,e])=>e.isBuiltIn).map(([e])=>e)}getCustomKinds(){return Array.from(this.executors.entries()).filter(([,e])=>!e.isBuiltIn).map(([e])=>e)}},li=new ol;function Gk(t){return li.get(t)}function gd(t){return li.has(t)}var $2=["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","overlays:modal","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","core:mountWidget","core:wait","core:sequence","core:parallel","core:tour","navigation:scrollTo","navigation:navigate"],D2=new Set(["onclick","onerror","onload","onmouseover","onfocus","onblur","onchange","onsubmit","onkeydown","onkeyup","onkeypress"]),Zk=5e4,Yk=50;function hr(t){let e=[],n=[];if(!t||typeof t!="object")return e.push({code:"INVALID_ACTION",message:"Action must be an object"}),{valid:!1,errors:e,warnings:n};let r=t.kind;if(!r||typeof r!="string")return e.push({code:"MISSING_KIND",message:"Action must have a 'kind' property"}),{valid:!1,errors:e,warnings:n};if(!$2.includes(r))return e.push({code:"UNKNOWN_KIND",message:`Unknown action kind: ${r}`,field:"kind"}),{valid:!1,errors:e,warnings:n};switch(!gd(r)&&r!=="core:mountWidget"&&e.push({code:"NO_EXECUTOR",message:`No executor registered for action kind: ${r}`,field:"kind"}),r){case"overlays:highlight":case"overlays:pulse":case"navigation:scrollTo":ci(t,e,n);break;case"overlays:badge":ci(t,e,n),B2(t,e,n);break;case"overlays:tooltip":ci(t,e,n),V2(t,e,n);break;case"overlays:modal":X2(t,e,n);break;case"content:insertHtml":ci(t,e,n),z2(t,e,n);break;case"content:setText":ci(t,e,n),H2(t,e,n);break;case"content:setAttr":ci(t,e,n),j2(t,e,n);break;case"content:addClass":case"content:removeClass":ci(t,e,n),U2(t,e,n);break;case"content:setStyle":ci(t,e,n),W2(t,e,n);break;case"core:mountWidget":q2(t,e,n);break;case"core:wait":K2(t,e,n);break;case"core:sequence":G2(t,e,n);break;case"core:parallel":Z2(t,e,n);break;case"core:tour":Q2(t,e,n);break;case"navigation:navigate":Y2(t,e,n);break}return{valid:e.length===0,errors:e,warnings:n}}function ci(t,e,n){!t.anchorId||typeof t.anchorId!="string"?e.push({code:"MISSING_ANCHOR_ID",message:"Action requires an 'anchorId' property",field:"anchorId"}):t.anchorId.length>200&&n.push({code:"LONG_ANCHOR_ID",message:"Anchor ID is unusually long",suggestion:"Consider using a shorter, more descriptive ID"})}function B2(t,e,n){!t.content||typeof t.content!="string"?e.push({code:"MISSING_CONTENT",message:"Badge action requires 'content' property",field:"content"}):t.content.length>100&&n.push({code:"LONG_BADGE_CONTENT",message:"Badge content is quite long",suggestion:"Keep badge content short (under 100 characters)"})}function V2(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Tooltip action requires 'content' object",field:"content"});return}(!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Tooltip content requires 'body' property",field:"content.body"})}function z2(t,e,n){!t.html||typeof t.html!="string"?e.push({code:"MISSING_HTML",message:"insertHtml action requires 'html' property",field:"html"}):t.html.length>Zk&&e.push({code:"HTML_TOO_LONG",message:`HTML content exceeds maximum length of ${Zk}`,field:"html"});let r=["before","after","prepend","append","replace"];(!t.position||!r.includes(t.position))&&e.push({code:"INVALID_POSITION",message:`Position must be one of: ${r.join(", ")}`,field:"position"})}function H2(t,e,n){(t.text===void 0||t.text===null)&&e.push({code:"MISSING_TEXT",message:"setText action requires 'text' property",field:"text"})}function j2(t,e,n){!t.attr||typeof t.attr!="string"?e.push({code:"MISSING_ATTR",message:"setAttr action requires 'attr' property",field:"attr"}):(D2.has(t.attr.toLowerCase())||t.attr.toLowerCase().startsWith("on"))&&e.push({code:"DANGEROUS_ATTR",message:`Event handler attributes are not allowed: ${t.attr}`,field:"attr"}),(t.value===void 0||t.value===null)&&e.push({code:"MISSING_VALUE",message:"setAttr action requires 'value' property",field:"value"})}function U2(t,e,n){!t.className||typeof t.className!="string"?e.push({code:"MISSING_CLASS_NAME",message:"Class action requires 'className' property",field:"className"}):/^[a-zA-Z_-][a-zA-Z0-9_-]*$/.test(t.className)||n.push({code:"INVALID_CLASS_NAME",message:"Class name contains unusual characters",suggestion:"Use alphanumeric characters, hyphens, and underscores"})}function W2(t,e,n){if(!t.styles||typeof t.styles!="object")e.push({code:"MISSING_STYLES",message:"setStyle action requires 'styles' object",field:"styles"});else{let r=Object.keys(t.styles).length;r>Yk&&e.push({code:"TOO_MANY_STYLES",message:`Too many styles (${r}). Maximum is ${Yk}`,field:"styles"});for(let[i,o]of Object.entries(t.styles))typeof o=="string"&&o.includes("expression(")&&e.push({code:"DANGEROUS_STYLE",message:`Style expressions are not allowed: ${i}`,field:`styles.${i}`})}}function q2(t,e,n){(!t.slot||typeof t.slot!="string")&&e.push({code:"MISSING_SLOT",message:"mountWidget action requires 'slot' property",field:"slot"}),!t.widget||typeof t.widget!="object"?e.push({code:"MISSING_WIDGET",message:"mountWidget action requires 'widget' object",field:"widget"}):(!t.widget.widgetId||typeof t.widget.widgetId!="string")&&e.push({code:"MISSING_WIDGET_ID",message:"Widget must have a 'widgetId' property",field:"widget.widgetId"})}function K2(t,e,n){t.durationMs===void 0&&!t.event&&e.push({code:"MISSING_WAIT_CONFIG",message:"wait action requires either 'durationMs' or 'event' property"}),t.durationMs!==void 0&&t.durationMs<0&&e.push({code:"INVALID_DURATION",message:"durationMs must be a positive number",field:"durationMs"}),t.event!==void 0&&typeof t.event!="string"&&e.push({code:"INVALID_EVENT",message:"event must be a string",field:"event"})}function G2(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"sequence action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_SEQUENCE",message:"sequence has no actions",suggestion:"Add at least one action to the sequence"});for(let r=0;r<t.actions.length;r++){let i=hr(t.actions[r]);for(let o of i.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of i.warnings)n.push(o)}}function Z2(t,e,n){if(!t.actions||!Array.isArray(t.actions)){e.push({code:"MISSING_ACTIONS",message:"parallel action requires 'actions' array",field:"actions"});return}t.actions.length===0&&n.push({code:"EMPTY_PARALLEL",message:"parallel has no actions",suggestion:"Add at least one action to the parallel group"}),t.waitFor&&!["all","any"].includes(t.waitFor)&&e.push({code:"INVALID_WAIT_FOR",message:"waitFor must be 'all' or 'any'",field:"waitFor"});for(let r=0;r<t.actions.length;r++){let i=hr(t.actions[r]);for(let o of i.errors)e.push({...o,field:`actions[${r}]${o.field?`.${o.field}`:""}`});for(let o of i.warnings)n.push(o)}}function Y2(t,e,n){if(!t.url||typeof t.url!="string")e.push({code:"MISSING_URL",message:"navigate action requires 'url' property",field:"url"});else{let r=t.url.trim().toLowerCase();r.startsWith("javascript:")&&e.push({code:"DANGEROUS_URL",message:"javascript: URLs are not allowed",field:"url"}),r.startsWith("data:")&&n.push({code:"DATA_URL",message:"data: URLs may have limited support",suggestion:"Consider using a regular URL instead"})}}function X2(t,e,n){if(!t.content||typeof t.content!="object"){e.push({code:"MISSING_CONTENT",message:"Modal action requires 'content' object",field:"content"});return}if((!t.content.body||typeof t.content.body!="string")&&e.push({code:"MISSING_BODY",message:"Modal content requires 'body' property",field:"content.body"}),t.size&&!["sm","md","lg"].includes(t.size)&&e.push({code:"INVALID_SIZE",message:"Modal size must be 'sm', 'md', or 'lg'",field:"size"}),t.ctaButtons)if(!Array.isArray(t.ctaButtons))e.push({code:"INVALID_CTA_BUTTONS",message:"ctaButtons must be an array",field:"ctaButtons"});else for(let r=0;r<t.ctaButtons.length;r++){let i=t.ctaButtons[r];(!i.label||typeof i.label!="string")&&e.push({code:"MISSING_BUTTON_LABEL",message:`CTA button at index ${r} requires 'label' property`,field:`ctaButtons[${r}].label`}),(!i.actionId||typeof i.actionId!="string")&&e.push({code:"MISSING_BUTTON_ACTION_ID",message:`CTA button at index ${r} requires 'actionId' property`,field:`ctaButtons[${r}].actionId`})}}function Q2(t,e,n){if((!t.tourId||typeof t.tourId!="string")&&e.push({code:"MISSING_TOUR_ID",message:"Tour action requires 'tourId' property",field:"tourId"}),!t.steps||!Array.isArray(t.steps)){e.push({code:"MISSING_STEPS",message:"Tour action requires 'steps' array",field:"steps"});return}t.steps.length===0&&e.push({code:"EMPTY_STEPS",message:"Tour must have at least one step",field:"steps"});let r=new Set;for(let i=0;i<t.steps.length;i++){let o=t.steps[i];if(!o.id||typeof o.id!="string"?e.push({code:"MISSING_STEP_ID",message:`Step at index ${i} requires 'id' property`,field:`steps[${i}].id`}):(r.has(o.id)&&e.push({code:"DUPLICATE_STEP_ID",message:`Duplicate step ID: ${o.id}`,field:`steps[${i}].id`}),r.add(o.id)),!o.action)e.push({code:"MISSING_STEP_ACTION",message:`Step at index ${i} requires 'action' property`,field:`steps[${i}].action`});else{let s=hr(o.action);for(let a of s.errors)e.push({...a,field:`steps[${i}].action${a.field?`.${a.field}`:""}`});for(let a of s.warnings)n.push(a)}if(o.onAction)for(let[s,a]of Object.entries(o.onAction))a!=="end"&&!t.steps.some(l=>l.id===a)&&n.push({code:"UNKNOWN_TARGET_STEP",message:`Step "${o.id}" references unknown target step: ${a}`,suggestion:`Make sure step "${a}" exists in the tour`})}}function md(t){let e=[],n=[];if(!Array.isArray(t))return e.push({code:"INVALID_ACTIONS",message:"Actions must be an array"}),{valid:!1,errors:e,warnings:n};for(let r=0;r<t.length;r++){let i=hr(t[r]);for(let o of i.errors)e.push({...o,field:o.field?`[${r}].${o.field}`:`[${r}]`});for(let o of i.warnings)n.push({...o,suggestion:o.suggestion?`Action ${r}: ${o.suggestion}`:void 0})}return{valid:e.length===0,errors:e,warnings:n}}var J2=0;function vd(t){let{overlayRoot:e,eventBus:n,surfaces:r,anchorResolver:i,adaptiveId:o,executorRegistry:s=li}=t,a=new Map;function l(){return`action-${++J2}`}function c(d,p){n&&n.publish(d,p)}function u(){return{overlayRoot:e,resolveAnchor:i,generateId:l,publishEvent:c,adaptiveId:o,applyAction:h,subscribeEvent:n?(d,p)=>n.subscribe({names:[d]},m=>p(m.props)):void 0}}async function f(d,p){if(!r)throw new Error("Surfaces provider required for core:mountWidget actions");let m=r.mount(d.slot,{type:"widget",widgetId:d.widget.widgetId,config:d.widget.props},{priority:d.widget.priority});return p.publishEvent("action.applied",{id:p.generateId(),kind:"core:mountWidget",slot:d.slot,widgetId:d.widget.widgetId}),{cleanup:()=>{m.unmount()},updateFn:y=>{if("widget"in y&&y.widget){let w=y.widget;w.props&&m.update({type:"widget",widgetId:d.widget.widgetId,config:w.props})}}}}async function h(d){let p=hr(d);if(!p.valid){let E=p.errors.map(I=>I.message).join("; ");throw new Error(`Action validation failed: ${E}`)}let m=l(),y=u(),w;if(d.kind==="core:mountWidget")w=await f(d,y);else{let E=s.get(d.kind);if(!E)throw new Error(`No executor for action kind: ${d.kind}`);w=await E(d,y)}let b={id:m,action:d,adaptiveId:o,appliedTs:Date.now(),state:"applied",cleanup:w.cleanup,updateFn:w.updateFn};return a.set(m,b),c("action.applied",{id:m,kind:d.kind,anchorId:"anchorId"in d?d.anchorId:void 0}),{id:m,action:d,async revert(){let E=a.get(m);if(!(!E||E.state!=="applied"))try{await E.cleanup(),E.state="reverted",c("action.reverted",{id:m,kind:d.kind})}catch(I){throw E.state="failed",c("action.failed",{id:m,kind:d.kind,error:String(I)}),I}finally{a.delete(m)}},isApplied(){return a.get(m)?.state==="applied"},async update(E){let I=a.get(m);if(!I||I.state!=="applied")throw new Error("Cannot update action that is not applied");if(I.updateFn)await I.updateFn(E);else throw new Error(`Action kind ${d.kind} does not support updates`)},getState(){return a.get(m)?.state??"reverted"}}}async function g(d){let p=md(d);if(!p.valid){let k=p.errors.map(E=>E.message).join("; ");throw new Error(`Batch validation failed: ${k}`)}let m=l(),y=[],w=[];try{for(let k of d){let E=await h(k);y.push(E),w.push(E)}}catch(k){for(let E of w)try{await E.revert()}catch{}throw k}return{id:m,handles:y,async revertAll(){for(let k=y.length-1;k>=0;k--)try{await y[k].revert()}catch(E){console.error(`[ActionEngine] Error reverting action ${y[k].id}:`,E)}},isApplied(){return y.every(k=>k.isApplied())}}}function v(d){return hr(d)}function _(){return Array.from(a.values()).map(d=>({id:d.id,action:d.action,adaptiveId:d.adaptiveId,appliedTs:d.appliedTs,state:d.state}))}function x(){for(let d of a.values())if(d.state==="applied")try{d.cleanup()}catch(p){console.error("[ActionEngine] Error during cleanup:",p)}a.clear()}return{apply:h,applyBatch:g,validate:v,getActive:_,destroy:x}}function ps(t){return t.startsWith("inline:")?"inline":t.startsWith("adjacent:")?"adjacent":"static"}function sl(t){return t.startsWith("inline:")?t.slice(7):t.startsWith("adjacent:")?t.slice(9):null}function Xk(t){if(typeof window.Sanitizer=="function")try{let l=new window.Sanitizer({}).sanitizeToFragment(t),c=document.createElement("div");return c.append(l),c.innerHTML}catch{}let n=document.createElement("template");n.innerHTML=t;let r=n.content,i=document.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,null),o=new Set(["b","strong","i","em","u","span","div","p","br","ul","ol","li","code","pre","small","sup","sub","a","button"]),s=[];for(;i.nextNode();){let a=i.currentNode,l=a.tagName.toLowerCase();if(!o.has(l)){s.push(a);continue}for(let c of Array.from(a.attributes)){let u=c.name.toLowerCase(),f=c.value.trim().toLowerCase(),h=u.startsWith("on"),g=(u==="href"||u==="src")&&f.startsWith("javascript:");(h||g)&&a.removeAttribute(c.name)}}for(let a of s){for(;a.firstChild;)a.parentNode?.insertBefore(a.firstChild,a);a.remove()}return n.innerHTML=(r.firstChild,n.innerHTML)}function e1(t){let e=Le(t),n=parseFloat(e.width)||0,r=parseFloat(e.height)||0,i=Ve(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Nn(n)!==o||Nn(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Ym(t){return Ne(t)?t:t.contextElement}function hs(t){let e=Ym(t);if(!Ve(e))return Pe(1);let n=e.getBoundingClientRect(),{width:r,height:i,$:o}=e1(e),s=(o?Nn(n.width):n.width)/r,a=(o?Nn(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var eO=Pe(0);function t1(t){let e=Oe(t);return!Qi()||!e.visualViewport?eO:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function tO(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Oe(t)?!1:e}function to(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),o=Ym(t),s=Pe(1);e&&(r?Ne(r)&&(s=hs(r)):s=hs(t));let a=tO(o,n,r)?t1(o):Pe(0),l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){let h=Oe(o),g=r&&Ne(r)?Oe(r):r,v=h,_=Ji(v);for(;_&&r&&g!==v;){let x=hs(_),d=_.getBoundingClientRect(),p=Le(_),m=d.left+(_.clientLeft+parseFloat(p.paddingLeft))*x.x,y=d.top+(_.clientTop+parseFloat(p.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,f*=x.y,l+=m,c+=y,v=Oe(_),_=Ji(v)}}return Mn({width:u,height:f,x:l,y:c})}function Xm(t,e){let n=Dn(t).scrollLeft;return e?e.left+n:to($e(t)).left+n}function n1(t,e,n){n===void 0&&(n=!1);let r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:Xm(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function nO(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t,o=i==="fixed",s=$e(r),a=e?pr(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=Pe(1),u=Pe(0),f=Ve(r);if((f||!f&&!o)&&((mn(r)!=="body"||$n(s))&&(l=Dn(r)),Ve(r))){let g=to(r);c=hs(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}let h=s&&!f&&!o?n1(s,l,!0):Pe(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function rO(t){return Array.from(t.getClientRects())}function iO(t){let e=$e(t),n=Dn(t),r=t.ownerDocument.body,i=ct(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ct(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),s=-n.scrollLeft+Xm(t),a=-n.scrollTop;return Le(r).direction==="rtl"&&(s+=ct(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function oO(t,e){let n=Oe(t),r=$e(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;let c=Qi();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function sO(t,e){let n=to(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Ve(t)?hs(t):Pe(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function Qk(t,e,n){let r;if(e==="viewport")r=oO(t,n);else if(e==="document")r=iO($e(t));else if(Ne(e))r=sO(e,n);else{let i=t1(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Mn(r)}function r1(t,e){let n=mt(t);return n===e||!Ne(n)||tn(n)?!1:Le(n).position==="fixed"||r1(n,e)}function aO(t,e){let n=e.get(t);if(n)return n;let r=Fn(t,[],!1).filter(a=>Ne(a)&&mn(a)!=="body"),i=null,o=Le(t).position==="fixed",s=o?mt(t):t;for(;Ne(s)&&!tn(s);){let a=Le(s),l=Xi(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||$n(s)&&!l&&r1(t,s))?r=r.filter(u=>u!==s):i=a,s=mt(s)}return e.set(t,r),r}function lO(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t,s=[...n==="clippingAncestors"?pr(e)?[]:aO(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{let f=Qk(e,u,i);return c.top=ct(f.top,c.top),c.right=en(f.right,c.right),c.bottom=en(f.bottom,c.bottom),c.left=ct(f.left,c.left),c},Qk(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function cO(t){let{width:e,height:n}=e1(t);return{width:e,height:n}}function uO(t,e,n){let r=Ve(e),i=$e(e),o=n==="fixed",s=to(t,!0,o,e),a={scrollLeft:0,scrollTop:0},l=Pe(0);if(r||!r&&!o)if((mn(e)!=="body"||$n(i))&&(a=Dn(e)),r){let h=to(e,!0,o,e);l.x=h.x+e.clientLeft,l.y=h.y+e.clientTop}else i&&(l.x=Xm(i));let c=i&&!r&&!o?n1(i,a):Pe(0),u=s.left+a.scrollLeft-l.x-c.x,f=s.top+a.scrollTop-l.y-c.y;return{x:u,y:f,width:s.width,height:s.height}}function Zm(t){return Le(t).position==="static"}function Jk(t,e){if(!Ve(t)||Le(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return $e(t)===n&&(n=n.ownerDocument.body),n}function i1(t,e){let n=Oe(t);if(pr(t))return n;if(!Ve(t)){let i=mt(t);for(;i&&!tn(i);){if(Ne(i)&&!Zm(i))return i;i=mt(i)}return n}let r=Jk(t,e);for(;r&&dd(r)&&Zm(r);)r=Jk(r,e);return r&&tn(r)&&Zm(r)&&!Xi(r)?n:r||fd(t)||n}var dO=async function(t){let e=this.getOffsetParent||i1,n=this.getDimensions,r=await n(t.floating);return{reference:uO(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function fO(t){return Le(t).direction==="rtl"}var pO={convertOffsetParentRelativeRectToViewportRelativeRect:nO,getDocumentElement:$e,getClippingRect:lO,getOffsetParent:i1,getElementRects:dO,getClientRects:rO,getDimensions:cO,getScale:hs,isElement:Ne,isRTL:fO};function o1(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function hO(t,e){let n=null,r,i=$e(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();let c=t.getBoundingClientRect(),{left:u,top:f,width:h,height:g}=c;if(a||e(),!h||!g)return;let v=Ln(f),_=Ln(i.clientWidth-(u+h)),x=Ln(i.clientHeight-(f+g)),d=Ln(u),m={rootMargin:-v+"px "+-_+"px "+-x+"px "+-d+"px",threshold:ct(0,en(1,l))||1},y=!0;function w(b){let k=b[0].intersectionRatio;if(k!==l){if(!y)return s();k?s(!1,k):r=setTimeout(()=>{s(!1,1e-7)},1e3)}k===1&&!o1(c,t.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(w,{...m,root:i.ownerDocument})}catch{n=new IntersectionObserver(w,m)}n.observe(t)}return s(!0),o}function s1(t,e,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ym(t),u=i||o?[...c?Fn(c):[],...Fn(e)]:[];u.forEach(d=>{i&&d.addEventListener("scroll",n,{passive:!0}),o&&d.addEventListener("resize",n)});let f=c&&a?hO(c,n):null,h=-1,g=null;s&&(g=new ResizeObserver(d=>{let[p]=d;p&&p.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var m;(m=g)==null||m.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let v,_=l?to(t):null;l&&x();function x(){let d=to(t);_&&!o1(_,d)&&n(),_=d,v=requestAnimationFrame(x)}return n(),()=>{var d;u.forEach(p=>{i&&p.removeEventListener("scroll",n),o&&p.removeEventListener("resize",n)}),f?.(),(d=g)==null||d.disconnect(),g=null,l&&cancelAnimationFrame(v)}}var a1=ld;var l1=cd,c1=ad;var u1=(t,e,n)=>{let r=new Map,i={platform:pO,...n},o={...i.platform,_c:r};return sd(t,e,{...i,platform:o})};var Qm={drawer_right:{position:"fixed",top:"0",right:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_left:{position:"fixed",top:"0",left:"0",bottom:"0",width:"360px",maxWidth:"90vw"},drawer_bottom:{position:"fixed",left:"0",right:"0",bottom:"0",maxHeight:"50vh"},overlay_center:{position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",maxWidth:"90vw",maxHeight:"90vh"},overlay_corner_br:{position:"fixed",bottom:"16px",right:"16px",maxWidth:"400px",maxHeight:"80vh"},overlay_corner_bl:{position:"fixed",bottom:"16px",left:"16px",maxWidth:"400px",maxHeight:"80vh"},toast_top:{position:"fixed",top:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"},toast_bottom:{position:"fixed",bottom:"16px",left:"50%",transform:"translateX(-50%)",maxWidth:"90vw"}},gs={fade:[{opacity:0},{opacity:1}],slide:[{opacity:0,transform:"translateY(10px)"},{opacity:1,transform:"translateY(0)"}],scale:[{opacity:0,transform:"scale(0.95)"},{opacity:1,transform:"scale(1)"}],none:[]},d1={duration:200,easing:"cubic-bezier(0.16, 1, 0.3, 1)",fill:"forwards"};function yd(t,e,n){let r=Qm[e];Object.assign(t.style,r),n&&(n.maxWidth&&(t.style.maxWidth=n.maxWidth),n.maxHeight&&(t.style.maxHeight=n.maxHeight),n.minWidth&&(t.style.minWidth=n.minWidth),n.minHeight&&(t.style.minHeight=n.minHeight))}function _d(t,e,n){let r=n.placement==="auto"?"bottom":n.placement,i=[a1(n.offset?{mainAxis:n.offset.y,crossAxis:n.offset.x}:8)];return n.flip!==!1&&i.push(c1()),n.shift!==!1&&i.push(l1({padding:8})),t.style.position="absolute",t.style.zIndex="2147483646",s1(e,t,async()=>{let{x:s,y:a,strategy:l}=await u1(e,t,{placement:r,middleware:i});Object.assign(t.style,{position:l,left:`${s}px`,top:`${a}px`})})}function wd(t,e,n="append"){return t.style.position="relative",t.style.display="inline-block",n==="prepend"?e.insertBefore(t,e.firstChild):e.appendChild(t),()=>{t.remove()}}function xd(t,e){return e==="none"||gs[e].length===0?null:t.animate(gs[e],d1)}function Sd(t,e){if(e==="none"||gs[e].length===0)return Promise.resolve();let n=[...gs[e]].reverse(),r=t.animate(n,d1);return new Promise(i=>{r.onfinish=()=>i(),r.oncancel=()=>i()})}function bd(t,e){let n=document.createElement("div");return n.setAttribute("data-syntro-surface",t),n.setAttribute("data-syntro-mount-id",e),n.className="syntro-surface",Object.assign(n.style,{pointerEvents:"auto",boxSizing:"border-box",overflow:"auto"}),n}function kd(t){switch(ps(t)){case"static":return t.startsWith("drawer")?2147483640:t.startsWith("overlay")?2147483642:t.startsWith("toast")?2147483644:2147483640;case"inline":return 1;case"adjacent":return 2147483638;default:return 2147483640}}var gO=0;function Ed(t){let{overlayRoot:e,eventBus:n,anchorResolver:r,defaultAnimation:i="fade",widgetRegistry:o}=t,s=new Map,a=new Map,l=new Map;function c(){return`mount-${++gO}`}function u(y,w){n&&n.publish(y,w)}function f(y){let w=l.get(y);if(w){let b=x(y);for(let k of w)try{k(b)}catch(E){console.error("[Surfaces] State callback error:",E)}}}let h=new Map;function g(y,w,b){switch(w.type){case"html":y.innerHTML=Xk(w.content);return;case"widget":{if(o&&o.has(w.widgetId)){let k=o.mount(w.widgetId,y,w.config);return b&&h.set(b,k),()=>{k.unmount(),b&&h.delete(b)}}console.warn(`[Surfaces] Widget not found: ${w.widgetId}`),y.innerHTML=`<div data-widget-id="${w.widgetId}" data-widget-missing="true">Widget: ${w.widgetId}</div>`;return}case"custom":return w.mount(y);case"react":y.innerHTML="<div data-react-component>React Component</div>";return;default:console.warn("[Surfaces] Unknown content type");return}}function v(y,w,b){let k=c(),E=ps(y),I=b?.priority??0,A=b?.animation??i,H=b?.exclusive??!0,K=s.get(y);if(K&&H){if(K.options.priority>I)throw new Error(`Slot ${y} is occupied by higher priority content (${K.options.priority} > ${I})`);_(K)}let Y=bd(y,k);Y.style.zIndex=String(kd(y));let W;if(E==="static")yd(Y,y,b?.constraints),e.appendChild(Y);else if(E==="inline"){let V=sl(y);if(!V)throw new Error(`Invalid inline slot: ${y}`);if(!r)throw new Error("Anchor resolver required for inline slots");let Z=r(V);if(!Z)throw new Error(`Anchor not found for inline slot: ${V}`);W=wd(Y,Z)}else if(E==="adjacent"){let V=sl(y);if(!V)throw new Error(`Invalid adjacent slot: ${y}`);if(!r)throw new Error("Anchor resolver required for adjacent slots");let Z=r(V);if(!Z)throw new Error(`Anchor not found for adjacent slot: ${V}`);e.appendChild(Y),W=_d(Y,Z,b?.position??{placement:"bottom"})}let le=g(Y,w,k);xd(Y,A);let B={id:k,slot:y,content:w,options:{priority:I,exclusive:H,animation:A,position:b?.position??{placement:"auto"},constraints:b?.constraints??{},adaptiveId:b?.adaptiveId,autoUnmountOnRouteChange:b?.autoUnmountOnRouteChange??!0},container:Y,cleanup:()=>{W?.(),le?.()},mountedAt:Date.now()};return s.set(y,B),a.set(y,(a.get(y)??0)+1),u("surface.mounted",{slot:y,id:k,adaptiveId:b?.adaptiveId}),f(y),{id:k,update(V){let Z=s.get(y);if(!Z||Z.id!==k)throw new Error("Mount no longer active");let vt=h.get(k);if(vt){if(V.type==="widget"){vt.update(V.config),Z.content=V;return}vt.unmount(),h.delete(k)}Z.container.innerHTML="";let Bn=g(Z.container,V,k);if(Z.content=V,Bn){let Ge=Z.cleanup;Z.cleanup=()=>{Ge?.(),Bn()}}},setOptions(V){let Z=s.get(y);if(!Z||Z.id!==k)throw new Error("Mount no longer active");V.priority!==void 0&&(Z.options.priority=V.priority),V.animation!==void 0&&(Z.options.animation=V.animation),V.constraints&&E==="static"&&(V.constraints.maxWidth&&(Z.container.style.maxWidth=V.constraints.maxWidth),V.constraints.maxHeight&&(Z.container.style.maxHeight=V.constraints.maxHeight),V.constraints.minWidth&&(Z.container.style.minWidth=V.constraints.minWidth),V.constraints.minHeight&&(Z.container.style.minHeight=V.constraints.minHeight)),f(y)},async unmount(){let V=s.get(y);!V||V.id!==k||await _(V)},isMounted(){return s.get(y)?.id===k},getContainer(){let V=s.get(y);return V?.id===k?V.container:null}}}async function _(y){await Sd(y.container,y.options.animation),y.cleanup?.(),y.container.remove(),s.delete(y.slot),u("surface.unmounted",{slot:y.slot,id:y.id}),f(y.slot)}function x(y){let w=s.get(y);return{slot:y,occupied:!!w,currentPriority:w?.options.priority,currentAdaptiveId:w?.options.adaptiveId,mountCount:a.get(y)??0,currentMountId:w?.id}}function d(y,w){let b=l.get(y);return b||(b=new Set,l.set(y,b)),b.add(w),()=>{b?.delete(w),b?.size===0&&l.delete(y)}}function p(y,w){let b=s.get(y);return b?w!==void 0?w>=b.options.priority:!1:!0}function m(){for(let y of s.values())try{y.cleanup?.(),y.container.remove()}catch(w){console.error("[Surfaces] Error during cleanup:",w)}s.clear(),l.clear()}return{mount:v,getState:x,onStateChange:d,canMount:p,destroy:m}}var al=class{constructor(){j(this,"widgets",new Map);j(this,"mountedWidgets",new Map);j(this,"mountIdCounter",0)}register(e,n,r="custom",i){if(this.widgets.has(e)){if(this.widgets.get(e).source==="built-in")throw new Error(`Cannot override built-in widget: ${e}`);console.warn(`[WidgetRegistry] Overriding widget: ${e}`)}this.widgets.set(e,{id:e,widget:n,source:r,metadata:i})}unregister(e){let n=this.widgets.get(e);return n?n.source==="built-in"?(console.warn(`[WidgetRegistry] Cannot unregister built-in widget: ${e}`),!1):(this.widgets.delete(e),!0):!1}unregisterBySource(e){for(let[n,r]of this.widgets.entries())r.source===e&&this.widgets.delete(n)}get(e){return this.widgets.get(e)?.widget}getRegistration(e){return this.widgets.get(e)}has(e){return this.widgets.has(e)}mount(e,n,r){let i=this.widgets.get(e);if(!i)throw new Error(`Widget not found: ${e}`);let o=`widget-mount-${++this.mountIdCounter}`;n.setAttribute("data-widget-mount-id",o),n.setAttribute("data-widget-id",e);let s=i.widget.mount(n,r);return this.mountedWidgets.set(o,{cleanup:s??void 0,container:n}),{widgetId:e,container:n,unmount:()=>{let l=this.mountedWidgets.get(o);l&&(l.cleanup?.(),this.mountedWidgets.delete(o),n.removeAttribute("data-widget-mount-id"),n.removeAttribute("data-widget-id"),n.innerHTML="")},update:l=>{if(i.widget.update)i.widget.update(n,l);else{let c=this.mountedWidgets.get(o);if(c){c.cleanup?.(),n.innerHTML="";let u=i.widget.mount(n,l);c.cleanup=u??void 0}}}}}list(){return Array.from(this.widgets.keys())}listRegistrations(){return Array.from(this.widgets.values())}getBySource(e){return Array.from(this.widgets.values()).filter(n=>n.source===e)}destroy(){for(let[e,n]of this.mountedWidgets.entries())n.cleanup?.(),n.container.innerHTML="";this.mountedWidgets.clear()}},Cd=new al;function Ad(t){let{appId:e,runtime:n,isBuiltIn:r=!1}=t,i=`app:${e}:`,o=[],s=[],a=n.state.ns(`app:${e}`);return{appId:e,state:{get:c=>a.get(c),set:(c,u)=>a.set(c,u),remove:c=>a.remove(c)},telemetry:n.telemetry?{emit:(c,u)=>{n.events.publish(c,{...u,_appId:e})},getSessionId:()=>n.telemetry?.getSessionId?.()}:void 0,surfaces:{mount:(c,u,f)=>{let h=n.surfaces.mount(c,u,{...f,adaptiveId:e});return{unmount:()=>h.unmount(),update:g=>h.update(g)}},canMount:(c,u)=>n.surfaces.canMount(c,u)},events:{subscribe:c=>n.events.subscribe(u=>{c(u)}),publish:(c,u)=>{n.events.publish(c,{...u,_appId:e})}},registerAction:c=>{n.executors.register(c.kind,c.executor,c.schema,e,r),o.push(c.kind)},registerWidget:c=>{n.widgets.register(c.id,c.component,e,c.metadata),s.push(c.id)}}}function Td(t,e){e.executors.unregisterBySource(t),e.widgets.unregisterBySource(t)}var ll=class{constructor(){j(this,"apps",new Map);j(this,"eventListeners",new Set);j(this,"runtime",null)}bind(e){this.runtime=e}async unbind(){for(let[e,n]of this.apps)n.state==="active"&&await this.deactivate(e);this.runtime=null}register(e){if(!e.id||typeof e.id!="string")throw new Error("App manifest must have an 'id' property");if(!e.version||typeof e.version!="string")throw new Error("App manifest must have a 'version' property");if(!e.name||typeof e.name!="string")throw new Error("App manifest must have a 'name' property");if(this.apps.has(e.id)){if(this.apps.get(e.id).state==="active")throw new Error(`Cannot re-register active app: ${e.id}`);console.warn(`[AppRegistry] Overriding existing app registration: ${e.id}`)}let n={manifest:e,state:"registered",registeredAt:Date.now()};return this.apps.set(e.id,n),this.emit({type:"app:registered",appId:e.id,manifest:e}),n}async activate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state==="active"){console.warn(`[AppRegistry] App already active: ${e}`);return}if(!this.runtime)throw new Error("AppRegistry not bound to a runtime. Call bind() first.");if(n.manifest.dependencies)for(let r of n.manifest.dependencies){let i=this.apps.get(r);if(!i||i.state!=="active")throw new Error(`App ${e} depends on ${r}, which is not active`)}n.state="activating";try{let r=n.manifest.metadata?.isBuiltIn===!0,i=Ad({appId:e,runtime:this.runtime,isBuiltIn:r}),{runtime:o}=n.manifest,s=[];if(o){if(o.actions)for(let a of o.actions)i.registerAction(a);if(o.widgets)for(let a of o.widgets)i.registerWidget(a);if(o.events)for(let a of o.events){let l=this.runtime.events.subscribe(c=>{if(a.names.includes(c.name)){let u={appId:e,state:i.state,telemetry:i.telemetry,surfaces:i.surfaces};try{a.handler(c,u)}catch(f){console.error(`[AppRegistry] Event handler error in ${e}:`,f)}}});s.push(l)}}n.cleanup=async()=>{for(let a of s)try{await a()}catch(l){console.error(`[AppRegistry] Cleanup error in ${e}:`,l)}Td(e,this.runtime)},n.state="active",n.activatedAt=Date.now(),this.emit({type:"app:activated",appId:e})}catch(r){throw n.state="error",n.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async deactivate(e){let n=this.apps.get(e);if(!n)throw new Error(`App not registered: ${e}`);if(n.state!=="active"){console.warn(`[AppRegistry] App not active: ${e}`);return}for(let[r,i]of this.apps)if(i.state==="active"&&i.manifest.dependencies?.includes(e))throw new Error(`Cannot deactivate ${e}: app ${r} depends on it`);n.state="deactivating";try{n.cleanup&&(await n.cleanup(),n.cleanup=void 0),n.state="inactive",this.emit({type:"app:deactivated",appId:e})}catch(r){throw n.state="error",n.error=String(r),this.emit({type:"app:error",appId:e,error:String(r)}),r}}async unregister(e){let n=this.apps.get(e);n&&(n.state==="active"&&await this.deactivate(e),this.apps.delete(e),this.emit({type:"app:unregistered",appId:e}))}get(e){return this.apps.get(e)}has(e){return this.apps.has(e)}isActive(e){return this.apps.get(e)?.state==="active"}list(){return Array.from(this.apps.values())}listActive(){return Array.from(this.apps.values()).filter(e=>e.state==="active")}listEditable(){return Array.from(this.apps.values()).filter(e=>e.manifest.editor!==void 0)}subscribe(e){return this.eventListeners.add(e),()=>{this.eventListeners.delete(e)}}emit(e){for(let n of this.eventListeners)try{n(e)}catch(r){console.error("[AppRegistry] Event listener error:",r)}}async destroy(){await this.unbind(),this.apps.clear(),this.eventListeners.clear()}},Rd=new ll;var mO=new Set(["overlays:highlight","overlays:pulse","overlays:badge","overlays:tooltip","overlays:modal","content:insertHtml","content:setText","content:setAttr","content:addClass","content:removeClass","content:setStyle","navigation:scrollTo","navigation:navigate","core:mountWidget","core:wait","core:sequence","core:parallel","core:tour"]);function Jm(t){return mO.has(t)}function ev(t){if(Jm(t))return null;let e=t.indexOf(":");return e===-1?null:t.slice(0,e)}function tv(t){let e=t.indexOf(":");return e===-1?null:t.slice(0,e)}function Id(t){let{cdnBase:e,registry:n,timeout:r=1e4,onLoadStart:i,onLoadEnd:o}=t,s=new Map,a=new Set;function l(v){return`${e}/apps/${v}/index.js`}async function c(v){if(n.has(v))return{appId:v,success:!0,manifest:n.get(v)?.manifest};if(s.has(v))return s.get(v);let _=(async()=>{i?.(v);try{let x=l(v);if(a.has(x)){let y=n.get(v);if(y)return o?.(v,!0),{appId:v,success:!0,manifest:y.manifest}}let d=new Promise((y,w)=>{setTimeout(()=>w(new Error(`Timeout loading app: ${v}`)),r)}),p=u(x,v);await Promise.race([p,d]),a.add(x);let m=n.get(v);if(!m)throw new Error(`App ${v} did not register after loading`);return o?.(v,!0),{appId:v,success:!0,manifest:m.manifest}}catch(x){let d=x instanceof Error?x.message:String(x);return o?.(v,!1,d),{appId:v,success:!1,error:d}}finally{s.delete(v)}})();return s.set(v,_),_}async function u(v,_){if(typeof window<"u"){try{let x=await import(v);x.manifest?n.register(x.manifest):x.default?.manifest?n.register(x.default.manifest):x.default&&n.register(x.default);return}catch{}return new Promise((x,d)=>{let p=document.createElement("script");p.src=v,p.async=!0,p.onload=()=>{n.get(_)?x():d(new Error(`App ${_} did not self-register`))},p.onerror=()=>{d(new Error(`Failed to load app script: ${v}`))},document.head.appendChild(p)})}throw new Error("Dynamic app loading not supported in SSR")}function f(v){let _=new Set;if(v.apps)for(let x of v.apps)_.add(x);if(v.actions)for(let x of v.actions){let d=ev(x.kind);if(d&&_.add(d),x.kind==="core:mountWidget"){let p=x.widget?.widgetId;if(p){let m=tv(p);m&&_.add(m)}}}return Array.from(_)}async function h(v){let _=f(v);return _.length===0?[]:await Promise.all(_.map(d=>c(d)))}async function g(v){return Promise.all(v.map(_=>c(_)))}return{loadApp:c,loadAppsForConfig:h,preloadApps:g,getRequiredApps:f,getAppUrl:l}}var cl=null;function p1(){if(cl&&document.body.contains(cl))return cl;let t=document.getElementById("syntro-overlays");return t||(t=document.createElement("div"),t.id="syntro-overlays",Object.assign(t.style,{position:"fixed",inset:"0",zIndex:"2147483647",pointerEvents:"none"}),document.body.appendChild(t)),cl=t,vO(),cl}var f1=!1;function vO(){if(f1)return;let t=`
|
|
143
143
|
:root {
|
|
144
144
|
--syntro-surface: #111;
|
|
145
145
|
--syntro-fg: #fff;
|
|
@@ -396,7 +396,7 @@ Error generating stack: `+o.message+`
|
|
|
396
396
|
background: var(--syntro-accent, #4338ca);
|
|
397
397
|
filter: brightness(1.1);
|
|
398
398
|
}
|
|
399
|
-
`,e=document.createElement("style");e.setAttribute("data-syntro","base-overlay"),e.textContent=t,document.head.appendChild(e),f1=!0}var iv="2.0.0";function wO(t,e){if(!e)return!0;let n;try{n=new URL(t).pathname}catch{n=t}let r=n.replace(/\/$/,"")||"/";if(e.exclude){for(let i of e.exclude)if(h1(r,i))return!1}if(e.include&&e.include.length>0){for(let i of e.include)if(h1(r,i))return!0;return!1}return!0}function h1(t,e){let n=e.replace(/\/$/,"")||"/";if(t===n)return!0;let r=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${r}$`).test(t)}function xO(t,e){if(t.startsWith("[data-"))return document.querySelector(t);let n=e.get();if(n.anchors&&n.anchors.find(o=>o.anchorId===t)?.present){let o=document.querySelector(`[data-syntro-anchor="${t}"]`);if(o)return o}if(t.startsWith(".")||t.startsWith("#")||t.startsWith("["))return document.querySelector(t);let r=document.getElementById(t);return r||document.querySelector(`[data-syntro-anchor="${t}"]`)}function Id(t={}){let{telemetry:e,sessionMetrics:n,routes:r,mode:i="production",namespace:o}=t,s=t.widgets??Cd,a=t.executors??ci,l=t.apps??Td,c=Qu({telemetry:e,routes:r}),u=t.events??ds(),f=ed({namespace:o}),h=td({state:f,events:u,sessionMetrics:n}),g=p1(),v=p=>xO(p,c),_=Ed({overlayRoot:g,eventBus:u,anchorResolver:v,widgetRegistry:s}),x=vd({overlayRoot:g,eventBus:u,surfaces:_,anchorResolver:v,executorRegistry:a}),d={telemetry:e,context:c,events:u,state:f,sessionMetrics:n,actions:x,surfaces:_,widgets:s,executors:a,apps:l,version:iv,mode:i,async evaluate(p){return h.evaluate(p,c.get())},evaluateSync(p){return h.evaluateSync(p,c.get())},async filterTiles(p){let m=c.get().page.url,y=[];for(let w of p){let k=w.activation;if(!k){y.push(w);continue}if(!wO(m,k.routes))continue;if(!k.strategy){y.push(w);continue}(await this.evaluate(k.strategy)).value&&y.push(w)}return y},setRoutes(p){c.setRoutes(p)},destroy(){l.unbind().catch(p=>{console.error("[Runtime] Error unbinding apps registry:",p)}),c.destroy(),x.destroy(),_.destroy()}};return l.bind(d),d}var ov="syn_";function dl(t){if(!t.startsWith(ov))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(ov.length).replace(/-/g,"+").replace(/_/g,"/"),r=atob(n),i=JSON.parse(r);if(i.v!==1)throw new Error(`Unsupported token version: ${i.v}`);return i}function Od(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return ov+n}var g1={growthbook:t=>hc({...t,autoInit:!0})};function m1(t,e){let n=g1[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(g1).join(", ")}`);return n(e)}var v1={posthog:t=>ql(t)};function y1(t,e){let n=v1[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(v1).join(", ")}`);return n(e)}var SO=["cdn.syntrologie.com","localhost","127.0.0.1"];function bO(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):SO.some(i=>e.hostname===i)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var sv=class{constructor(e){j(this,"name","cdn");j(this,"url");j(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!bO(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),n=await fetch(this.url,{credentials:"omit",cache:"default"});if(!n.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${n.status})`);let r=await n.text();if(this.integrity){let l=await kO(r),c=this.integrity.replace("sha384-","");if(l!==c)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${c}, got ${l}`)}let i=JSON.parse(r),o=performance.now()-e,s=n.headers.get("cache-control"),a=n.headers.get("age");return{config:i,meta:{source:"cdn",fetchTimeMs:o,cached:s?.includes("public")??!1,cacheAge:a?parseInt(a,10):void 0}}}};async function kO(t){let n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-384",n),i=new Uint8Array(r);return btoa(String.fromCharCode(...i))}function _1(t){return new sv(t)}var EO="syntro_exp",CO="syntro_var",av=class{constructor(e){j(this,"name","experiments");j(this,"client");j(this,"featureKey");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config"}async fetch(){let e=performance.now();if(typeof window<"u"){let i=new URLSearchParams(window.location.search),o=i.get(EO),s=i.get(CO);if(o&&s!==null&&this.client.setForcedVariations){let a=parseInt(s,10);isNaN(a)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${a}`),this.client.setForcedVariations({[o]:a}))}}let n=this.client.getFeatureValue?.(this.featureKey,null);if(!n||typeof n!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let r=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:r,cached:!0}}}};function w1(t){return new av(t)}var AO="https://cdn.syntrologie.com/configs",x1={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return _1({baseUrl:t.baseUrl??AO,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return w1({featureKey:t.featureKey})}};function S1(t,e={}){let n=x1[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(x1).join(", ")}`);return n(e)}function mr(t){if(typeof process<"u"&&process.env)return process.env[t];try{let e=(0,eval)("import.meta");if(e?.env)return e.env[t]}catch{}}function RO(){if(typeof window>"u")return V("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=new URLSearchParams(window.location.search),e=t.has("editor_token");return V("Syntro Bootstrap","isEditorMode check:",{url:window.location.href,search:window.location.search,hasEditorToken:e,allParams:Object.fromEntries(t.entries())}),e}function TO(){if(typeof window>"u")return V("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=new URLSearchParams(window.location.search),e=t.has("syntro_audit");return V("Syntro Bootstrap","isAuditMode check:",{url:window.location.href,hasAuditFlag:e,auditSessionId:t.get("audit_session_id")??"none"}),e}var b1="syntro_segment_attributes";function PO(){if(typeof window>"u")return{};try{let t=localStorage.getItem(b1);if(t){let e=JSON.parse(t);return V("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){Bt("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function IO(t){if(!(typeof window>"u"))try{localStorage.setItem(b1,JSON.stringify(t)),V("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){Bt("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function OO(t){if(!t)return{};let e={};for(let[n,r]of Object.entries(t))n.startsWith("in_segment_")&&(e[n]=r===!0);return e}async function NO(t){vm(),V("Syntro Bootstrap","====== INIT ======"),V("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:t.token?.slice(0,15)+"...",hasCanvasOptions:!!t.canvas});let e=RO(),n=TO(),r=e?"editor":n?"audit":null;V("Syntro Bootstrap","SDK mode:",r??"normal");let i;if(t.token)if(t.token.startsWith("syn_"))V("Syntro Bootstrap","Token starts with syn_, decoding..."),i=dl(t.token),vm(i.d);else if(r)V("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${r} mode)`);else throw ju("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit mode!"),ju("Syntro Bootstrap","Token received:",t.token),new Error("Invalid Syntro token: must start with 'syn_'");else if(r)V("Syntro Bootstrap",`\u2713 No token, but ${r} mode - proceeding`);else throw ju("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit mode!"),new Error("Syntro token is required (unless in editor or audit mode)");let o=mr("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||mr("VITE_SYNTRO_EXPERIMENT_HOST")||i?.eh,s=mr("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||mr("VITE_SYNTRO_TELEMETRY_HOST")||i?.th,a=mr("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||mr("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,l=PO();V("Syntro Bootstrap","Phase 1: Using cached segment attributes:",l);let c,u=ds();console.log("[Syntro Bootstrap] EventBus created");let f=Ju(k=>{u.publishEvent(k)}),h=k=>{V("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let b=OO(k);if(V("Syntro Bootstrap","Segment flags from PostHog:",b),IO(b),c){let P={...v?.getAll?.()??{},...b};V("Syntro Bootstrap","Updating GrowthBook with attributes:",P),c.setAttributes?.(P)}},g;i?.t&&(g=y1("posthog",{apiKey:i.t,apiHost:s,enableFeatureFlags:!0,onFeatureFlagsLoaded:h,onCapture:f}),console.log("[Syntro Bootstrap] Telemetry client created with EventBus wiring"));let v;i?.e&&(c=m1("growthbook",{clientKey:i.e,apiHost:o,attributes:l,onExperimentViewed:g?.trackExperiment?(k,b,E)=>{g.trackExperiment(k,b,E)}:void 0})),t.enableSessionMetrics&&(v=Xu({experiments:c,onMetricChange:(k,b)=>{V("Syntro Bootstrap",`Session metric changed: ${k} = ${b}`)}}),V("Syntro Bootstrap","SessionMetricTracker created"));let _="production";e?_="editor":n?_="audit":mr("NODE_ENV")==="development"&&(_="development");let x=Id({telemetry:g,sessionMetrics:v,mode:_,events:u});V("Syntro Bootstrap","Runtime created:",{version:x.version,mode:x.mode,hasContext:!!x.context,hasEvents:!!x.events,hasState:!!x.state}),V("Syntro Bootstrap","Core app executors already registered");let d=t.cdnBase||mr("NEXT_PUBLIC_SYNTRO_CDN_BASE")||mr("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntro.io",p=Pd({cdnBase:d,registry:x.apps,onLoadStart:k=>{V("Syntro Bootstrap",`Loading app from CDN: ${k}`)},onLoadEnd:(k,b,E)=>{b?V("Syntro Bootstrap",`App loaded successfully: ${k}`):Bt("Syntro Bootstrap",`Failed to load app: ${k}`,E)}});typeof window<"u"&&(window.SynOS={appRegistry:x.apps,runtime:x,version:x.version},V("Syntro Bootstrap","Global SynOS object exposed"));let m;if(t.fetcher)m=t.fetcher;else if(i?.f){let k=S1(i.f,i.o??{});m=async()=>{let b=await k.fetch();return{...b.config,tiles:b.config.tiles??[]}}}else c&&(m=Mi({experiments:c}));let y=m?async()=>{let k=await m(),b=k,E=p.getRequiredApps(b);return V("Syntro Bootstrap","Config fetched, required apps:",E),E.length>0&&await p.loadAppsForConfig(b).then(async A=>{let H=A.filter(K=>!K.success);H.length>0&&Bt("Syntro Bootstrap","Some apps failed to load:",H);for(let K of E)if(x.apps.has(K))try{await x.apps.activate(K)}catch(Y){Bt("Syntro Bootstrap",`Failed to activate app: ${K}`,Y)}}),k}:void 0;return{canvas:await Uu({...t.canvas,fetcher:y,integrations:{experiments:c,telemetry:g},editorUrl:a,runtime:x}),runtime:x,experiments:c,telemetry:g,sessionMetrics:v,appLoader:p}}var lv={init:NO,encodeToken:Od,decodeToken:dl};typeof window<"u"&&(window.Syntro=lv);return L1(LO);})();
|
|
399
|
+
`,e=document.createElement("style");e.setAttribute("data-syntro","base-overlay"),e.textContent=t,document.head.appendChild(e),f1=!0}var nv="2.0.0";function yO(t,e){if(!e)return!0;let n;try{n=new URL(t).pathname}catch{n=t}let r=n.replace(/\/$/,"")||"/";if(e.exclude){for(let i of e.exclude)if(h1(r,i))return!1}if(e.include&&e.include.length>0){for(let i of e.include)if(h1(r,i))return!0;return!1}return!0}function h1(t,e){let n=e.replace(/\/$/,"")||"/";if(t===n)return!0;let r=n.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,".*").replace(/\*/g,"[^/]*").replace(/:[^/]+/g,"[^/]+");return new RegExp(`^${r}$`).test(t)}function _O(t,e){if(t.startsWith("[data-"))return document.querySelector(t);let n=e.get();if(n.anchors&&n.anchors.find(o=>o.anchorId===t)?.present){let o=document.querySelector(`[data-syntro-anchor="${t}"]`);if(o)return o}if(t.startsWith(".")||t.startsWith("#")||t.startsWith("["))return document.querySelector(t);let r=document.getElementById(t);return r||document.querySelector(`[data-syntro-anchor="${t}"]`)}function Pd(t={}){let{telemetry:e,sessionMetrics:n,routes:r,mode:i="production",namespace:o}=t,s=t.widgets??Cd,a=t.executors??li,l=t.apps??Rd,c=Qu({telemetry:e,routes:r}),u=t.events??cs(),f=ed({namespace:o}),h=td({state:f,events:u,sessionMetrics:n}),g=p1(),v=p=>_O(p,c),_=Ed({overlayRoot:g,eventBus:u,anchorResolver:v,widgetRegistry:s}),x=vd({overlayRoot:g,eventBus:u,surfaces:_,anchorResolver:v,executorRegistry:a}),d={telemetry:e,context:c,events:u,state:f,sessionMetrics:n,actions:x,surfaces:_,widgets:s,executors:a,apps:l,version:nv,mode:i,async evaluate(p){return h.evaluate(p,c.get())},evaluateSync(p){return h.evaluateSync(p,c.get())},async filterTiles(p){let m=c.get().page.url,y=[];for(let w of p){let b=w.activation;if(!b){y.push(w);continue}if(!yO(m,b.routes))continue;if(!b.strategy){y.push(w);continue}(await this.evaluate(b.strategy)).value&&y.push(w)}return y},setRoutes(p){c.setRoutes(p)},destroy(){l.unbind().catch(p=>{console.error("[Runtime] Error unbinding apps registry:",p)}),c.destroy(),x.destroy(),_.destroy()}};return l.bind(d),d}var rv="syn_";function ul(t){if(!t.startsWith(rv))throw new Error("Invalid Syntro token: must start with 'syn_'");let n=t.slice(rv.length).replace(/-/g,"+").replace(/_/g,"/"),r=atob(n),i=JSON.parse(r);if(i.v!==1)throw new Error(`Unsupported token version: ${i.v}`);return i}function Od(t){let e=JSON.stringify(t),n=btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return rv+n}var g1={growthbook:t=>dc({...t,autoInit:!0})};function m1(t,e){let n=g1[t];if(!n)throw new Error(`Unknown experiment provider: ${t}. Supported: ${Object.keys(g1).join(", ")}`);return n(e)}var v1={posthog:t=>Wl(t),noop:()=>ql()};function y1(t,e){let n=v1[t];if(!n)throw new Error(`Unknown telemetry provider: ${t}. Supported: ${Object.keys(v1).join(", ")}`);return n(e)}var wO=["cdn.syntrologie.com","localhost","127.0.0.1"];function xO(t){try{let e=new URL(t),n=/^(localhost|127\.0\.0\.1)$/.test(e.hostname);return e.protocol!=="https:"&&!n?(console.warn("[SmartCanvas] CDN URL must use HTTPS:",t),!1):wO.some(i=>e.hostname===i)?!0:(console.warn("[SmartCanvas] CDN host not in allowlist:",e.hostname),!1)}catch{return console.warn("[SmartCanvas] Invalid CDN URL:",t),!1}}var iv=class{constructor(e){j(this,"name","cdn");j(this,"url");j(this,"integrity");if(this.url=`${e.baseUrl}/${e.configId}.json`,this.integrity=e.integrity,!xO(this.url))throw new Error(`[SmartCanvas] CDN URL not allowed: ${this.url}`)}async fetch(){let e=performance.now(),n=await fetch(this.url,{credentials:"omit",cache:"default"});if(!n.ok)throw new Error(`[SmartCanvas] Failed to fetch config from CDN (${n.status})`);let r=await n.text();if(this.integrity){let l=await SO(r),c=this.integrity.replace("sha384-","");if(l!==c)throw new Error(`[SmartCanvas] Config integrity check failed. Expected ${c}, got ${l}`)}let i=JSON.parse(r),o=performance.now()-e,s=n.headers.get("cache-control"),a=n.headers.get("age");return{config:i,meta:{source:"cdn",fetchTimeMs:o,cached:s?.includes("public")??!1,cacheAge:a?parseInt(a,10):void 0}}}};async function SO(t){let n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-384",n),i=new Uint8Array(r);return btoa(String.fromCharCode(...i))}function _1(t){return new iv(t)}var bO="syntro_exp",kO="syntro_var",ov=class{constructor(e){j(this,"name","experiments");j(this,"client");j(this,"featureKey");this.client=e.client,this.featureKey=e.featureKey??"smart-canvas-config"}async fetch(){let e=performance.now();if(typeof window<"u"){let i=new URLSearchParams(window.location.search),o=i.get(bO),s=i.get(kO);if(o&&s!==null&&this.client.setForcedVariations){let a=parseInt(s,10);isNaN(a)||(console.log(`[SmartCanvas] Preview mode: forcing "${o}" to variation ${a}`),this.client.setForcedVariations({[o]:a}))}}let n=this.client.getFeatureValue?.(this.featureKey,null);if(!n||typeof n!="object")throw new Error(`[SmartCanvas] Feature "${this.featureKey}" not found or invalid. Ensure the feature is configured in your experiment platform.`);let r=performance.now()-e;return{config:n,meta:{source:"experiments",fetchTimeMs:r,cached:!0}}}};function w1(t){return new ov(t)}var EO="https://cdn.syntrologie.com/configs",x1={cdn:t=>{if(!t.configId)throw new Error("CDN fetcher requires 'configId' option");return _1({baseUrl:t.baseUrl??EO,configId:t.configId,integrity:t.integrity})},experiments:t=>{if(!t.featureKey)throw new Error("Experiments fetcher requires 'featureKey' option");return w1({featureKey:t.featureKey})}};function S1(t,e={}){let n=x1[t];if(!n)throw new Error(`Unknown config fetcher type: ${t}. Supported: ${Object.keys(x1).join(", ")}`);return n(e)}function gr(t){if(typeof process<"u"&&process.env)return process.env[t];try{let e=(0,eval)("import.meta");if(e?.env)return e.env[t]}catch{}}function CO(){if(typeof window>"u")return F("Syntro Bootstrap","isEditorMode: not in browser"),!1;let t=new URLSearchParams(window.location.search),e=t.has("editor_token");return F("Syntro Bootstrap","isEditorMode check:",{url:window.location.href,search:window.location.search,hasEditorToken:e,allParams:Object.fromEntries(t.entries())}),e}function AO(){if(typeof window>"u")return F("Syntro Bootstrap","isAuditMode: not in browser"),!1;let t=new URLSearchParams(window.location.search),e=t.has("syntro_audit");return F("Syntro Bootstrap","isAuditMode check:",{url:window.location.href,hasAuditFlag:e,auditSessionId:t.get("audit_session_id")??"none"}),e}var b1="syntro_segment_attributes";function TO(){if(typeof window>"u")return{};try{let t=localStorage.getItem(b1);if(t){let e=JSON.parse(t);return F("Syntro Bootstrap","Loaded cached segment attributes:",e),e}}catch(t){wt("Syntro Bootstrap","Failed to load cached segment attributes:",t)}return{}}function RO(t){if(!(typeof window>"u"))try{localStorage.setItem(b1,JSON.stringify(t)),F("Syntro Bootstrap","Cached segment attributes:",t)}catch(e){wt("Syntro Bootstrap","Failed to cache segment attributes:",e)}}function IO(t){if(!t)return{};let e={};for(let[n,r]of Object.entries(t))n.startsWith("in_segment_")&&(e[n]=r===!0);return e}async function PO(t){jp(),F("Syntro Bootstrap","====== INIT ======"),F("Syntro Bootstrap","Options:",{hasToken:!!t.token,tokenPrefix:t.token?.slice(0,15)+"...",hasCanvasOptions:!!t.canvas});let e=CO(),n=AO(),r=e?"editor":n?"audit":null;F("Syntro Bootstrap","SDK mode:",r??"normal");let i;if(t.token)if(t.token.startsWith("syn_"))F("Syntro Bootstrap","Token starts with syn_, decoding..."),i=ul(t.token),jp(i.d);else if(r)F("Syntro Bootstrap",`\u2713 Non-syn_ token allowed (${r} mode)`);else throw gc("Syntro Bootstrap","\u274C Token does not start with syn_ and NOT in editor/audit mode!"),gc("Syntro Bootstrap","Token received:",t.token),new Error("Invalid Syntro token: must start with 'syn_'");else if(r)F("Syntro Bootstrap",`\u2713 No token, but ${r} mode - proceeding`);else throw gc("Syntro Bootstrap","\u274C No token provided and NOT in editor/audit mode!"),new Error("Syntro token is required (unless in editor or audit mode)");let o=gr("NEXT_PUBLIC_SYNTRO_EXPERIMENT_HOST")||gr("VITE_SYNTRO_EXPERIMENT_HOST")||i?.eh,s=gr("NEXT_PUBLIC_SYNTRO_TELEMETRY_HOST")||gr("VITE_SYNTRO_TELEMETRY_HOST")||i?.th,a=gr("NEXT_PUBLIC_SYNTRO_EDITOR_URL")||gr("VITE_SYNTRO_EDITOR_URL")||t.canvas?.editorUrl,l=TO();F("Syntro Bootstrap","Phase 1: Using cached segment attributes:",l);let c,u=cs();console.log("[Syntro Bootstrap] EventBus created");let f=Ju(b=>{u.publishEvent(b)}),h=b=>{F("Syntro Bootstrap","Phase 2: PostHog feature flags loaded");let k=IO(b);if(F("Syntro Bootstrap","Segment flags from PostHog:",k),RO(k),c){let I={...v?.getAll?.()??{},...k};F("Syntro Bootstrap","Updating GrowthBook with attributes:",I),c.setAttributes?.(I)}},g;if(i?.t){let b=i.t==="noop"?"noop":"posthog";g=y1(b,{apiKey:i.t,apiHost:s,enableFeatureFlags:!0,onFeatureFlagsLoaded:h,onCapture:f}),console.log(`[Syntro Bootstrap] Telemetry client created (${b}) with EventBus wiring`)}let v;i?.e&&(c=m1("growthbook",{clientKey:i.e,apiHost:o,attributes:l,onExperimentViewed:g?.trackExperiment?(b,k,E)=>{g.trackExperiment(b,k,E)}:void 0})),t.enableSessionMetrics&&(v=Xu({experiments:c,onMetricChange:(b,k)=>{F("Syntro Bootstrap",`Session metric changed: ${b} = ${k}`)}}),F("Syntro Bootstrap","SessionMetricTracker created"));let _="production";e?_="editor":n?_="audit":gr("NODE_ENV")==="development"&&(_="development");let x=Pd({telemetry:g,sessionMetrics:v,mode:_,events:u});F("Syntro Bootstrap","Runtime created:",{version:x.version,mode:x.mode,hasContext:!!x.context,hasEvents:!!x.events,hasState:!!x.state}),F("Syntro Bootstrap","Core app executors already registered");let d=t.cdnBase||gr("NEXT_PUBLIC_SYNTRO_CDN_BASE")||gr("VITE_SYNTRO_CDN_BASE")||"https://cdn.syntro.io",p=Id({cdnBase:d,registry:x.apps,onLoadStart:b=>{F("Syntro Bootstrap",`Loading app from CDN: ${b}`)},onLoadEnd:(b,k,E)=>{k?F("Syntro Bootstrap",`App loaded successfully: ${b}`):wt("Syntro Bootstrap",`Failed to load app: ${b}`,E)}});if(typeof window<"u"&&(window.SynOS={appRegistry:x.apps,runtime:x,version:x.version},F("Syntro Bootstrap","Global SynOS object exposed")),c?.refreshFeatures)try{await c.refreshFeatures(),F("Syntro Bootstrap","GrowthBook features loaded")}catch(b){wt("Syntro Bootstrap","Failed to load GrowthBook features:",b)}let m;if(t.fetcher)m=t.fetcher;else if(i?.f){let b=S1(i.f,i.o??{});m=async()=>{let k=await b.fetch();return{...k.config,tiles:k.config.tiles??[]}}}else c&&(m=Ni({experiments:c}));let y=m?async()=>{let b=await m(),k=b,E=p.getRequiredApps(k);return F("Syntro Bootstrap","Config fetched, required apps:",E),E.length>0&&await p.loadAppsForConfig(k).then(async A=>{let H=A.filter(K=>!K.success);H.length>0&&wt("Syntro Bootstrap","Some apps failed to load:",H);for(let K of E)if(x.apps.has(K))try{await x.apps.activate(K)}catch(Y){wt("Syntro Bootstrap",`Failed to activate app: ${K}`,Y)}}),b}:void 0;return{canvas:await Uu({...t.canvas,fetcher:y,integrations:{experiments:c,telemetry:g},editorUrl:a,runtime:x}),runtime:x,experiments:c,telemetry:g,sessionMetrics:v,appLoader:p}}var sv={init:PO,encodeToken:Od,decodeToken:ul};typeof window<"u"&&(window.Syntro=sv);return L1(OO);})();
|
|
400
400
|
/*! Bundled license information:
|
|
401
401
|
|
|
402
402
|
react/cjs/react.production.min.js:
|