@iccandle/news 0.0.9 → 0.0.10

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.
@@ -1,12 +1,12 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.cta-loader__overlay{background-color:var(--iccandle-background);position:fixed;inset:0;z-index:999999;display:flex;align-items:center;justify-content:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.cta-loader__content{position:relative;display:flex;height:100%;width:100%;flex-direction:column;align-items:center;justify-content:center;gap:9rem;padding-left:1.5rem;padding-right:1.5rem}.cta-loader__video{height:100%;max-height:18rem;width:100%;object-fit:contain}@media(min-width:768px){.cta-loader__video{max-height:20rem}}.cta-loader__bar-wrapper{width:100%;max-width:24rem}.cta-loader__bar-track{position:relative;height:.25rem;overflow:hidden;border-radius:9999px;background-color:var( --iccandle-background-secondary, rgba(128, 128, 128, .7) )}.cta-loader__bar-fill{position:absolute;top:0;bottom:0;left:0;width:100%;transform-origin:left;border-radius:9999px;background-color:var(--iccandle-primary, #ffffff);will-change:transform}.news-widget_detail_page__container{background:var(--iccandle-background);display:flex;height:100%;width:100%}.news-widget_detail_page__right_border{display:flex;flex:1;flex-direction:column;min-width:50%;border-right-style:solid;border-right-color:var(--iccandle-border);border-right-width:1px}.news-widget_detail_page__event_details{height:calc(100% - 57px)}.news-widget_detail_page__title_container{display:flex;height:57px;width:100%;align-items:center;justify-content:space-between;border-bottom-style:solid;border-bottom-color:var(--iccandle-border);border-bottom-width:1px}.news-widget_detail_page__title_padding{display:flex;align-items:center;gap:8px;padding:16px}.news-widget_detail_page__title_text{font-size:18px;line-height:calc(1.75 / 1.125);font-weight:600;color:var(--iccandle-title)}.news-widget_detail_page__back_button{height:2.25rem;width:2.25rem;border:none}.news-widget_detail_page__back_icon{color:var(--iccandle-text);height:1.25rem;width:1.25rem}.news-widget_event_details__container{background-color:var(--iccandle-background);box-sizing:border-box;display:flex;min-height:100%;width:100%;min-width:50%;flex:1;flex-direction:column;overflow:auto;gap:16px;padding:16px}.news-widget_event_details__container_sm{height:50%}@media(min-width:40rem){.news-widget_event_details__container_sm{height:100%}}.news-widget_event_details__ghost_button{background-color:var(--iccandle-background);position:absolute;right:50%;bottom:-8px;height:12px;width:24px;color:var(--iccandle-text);border-radius:calc(infinity * 1px);border-style:solid;border-width:1px;border-color:var(--iccandle-border);transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.news-widget_event_details__ghost_button_open{rotate:180deg}.news-widget_event_details__icon{height:16px;width:16px}.news-widget_event_details__chart_wrapper{position:relative;height:100%;min-height:500px}.news-widget_event_details__chart{height:100%;min-height:500px;overflow:hidden;border-radius:.75rem;border-style:solid;border-width:1px;border-color:var(--iccandle-border)}.news-widget_event_details_card__container{background-color:var(--iccandle-background);position:relative;border-radius:1rem;border-style:solid;border-width:1px;border-color:var(--iccandle-border);padding:.75rem}@media(min-width:40rem){.news-widget_event_details_card__container{min-height:170px;padding:1rem}}.news-widget_event_details_card__text{font-weight:600;color:var(--iccandle-news-details-title)}.news-widget_event_details_card__event_name{line-height:1.25;font-weight:700;font-size:1rem;color:var(--iccandle-title)}@media(min-width:40rem){.news-widget_event_details_card__event_name{font-size:1.125rem;line-height:1.75rem}}.news-widget_event_details_card__status_container{display:flex;align-items:center;gap:.25rem;font-size:.75rem;line-height:calc(1 / .75);text-wrap:nowrap;color:var(--iccandle-title)}.news-widget_event_details_card__status{height:.5rem;width:.5rem;border-radius:calc(infinity * 1px)}.news-widget_event_details_card__collapsible{display:grid;width:100%;overflow:hidden;transition:grid-template-rows .5s ease-in-out,opacity .5s ease-in-out}.news-widget_event_details_card__collapsible--open{grid-template-rows:1fr;opacity:1}.news-widget_event_details_card__collapsible--closed{grid-template-rows:0fr;opacity:0}.news-widget_event_details_card__text_bold{font-size:.875rem;line-height:1.25rem;font-weight:700}.news-widget_event_details_card__body{display:flex;height:100%;flex-direction:column;align-items:stretch;justify-content:space-between;gap:.75rem}@media(min-width:40rem){.news-widget_event_details_card__body{flex-direction:row;gap:.25rem}}.news-widget_event_details_card__left{display:flex;width:100%;flex-direction:column;gap:.5rem;border-bottom:1px solid var(--iccandle-border);padding-bottom:.75rem}@media(min-width:40rem){.news-widget_event_details_card__left{border-bottom:none;border-right:1px solid var(--iccandle-border);padding-bottom:0;padding-right:1rem}}.news-widget_event_details_card__header_row{display:flex;width:100%;align-items:flex-start;gap:.5rem}@media(min-width:40rem){.news-widget_event_details_card__header_row{align-items:center;gap:.75rem}}.news-widget_event_details_card__header_inner{display:flex;width:100%;flex-direction:column;align-items:flex-start;gap:.5rem}.news-widget_event_details_card__timestamp_row{display:flex;width:100%;align-items:center;justify-content:space-between;gap:.5rem}.news-widget_event_details_card__timestamp{font-size:.875rem;color:var(--iccandle-gray)}.news-widget_event_details_card__currency_row{display:flex;width:100%;align-items:center;gap:.5rem}@media(min-width:40rem){.news-widget_event_details_card__currency_row{max-height:2.25rem;gap:.75rem}}.news-widget_event_details_card__currency_icon{width:1.75rem;height:1.75rem;flex-shrink:0}@media(min-width:40rem){.news-widget_event_details_card__currency_icon{width:2.25rem;height:2.25rem}}.news-widget_event_details_card__currency_img{height:100%;width:100%;border-radius:9999px;object-fit:cover}.news-widget_event_details_card__speech_icon{width:1.25rem;height:1.25rem;flex-shrink:0}@media(min-width:40rem){.news-widget_event_details_card__speech_icon{width:1.75rem;height:1.75rem}}.news-widget_event_details_card__values_row{display:flex;width:100%;flex-direction:column;gap:.5rem}@media(min-width:40rem){.news-widget_event_details_card__values_row{flex-direction:row;justify-content:space-between}}.news-widget_event_details_card__values_group{display:flex;flex-wrap:wrap;align-items:flex-start;gap:.5rem}@media(min-width:40rem){.news-widget_event_details_card__values_group{align-items:center;gap:.75rem}}.news-widget_event_details_card__label{font-size:.75rem;font-weight:500;color:var(--iccandle-dark-gray)}.news-widget_event_details_card__fomc_source{margin-top:.5rem;font-size:.75rem;color:var(--iccandle-news-details-title)}@media(min-width:40rem){.news-widget_event_details_card__fomc_source{font-size:.875rem}}.news-widget_event_details_card__fomc_link{word-break:break-all;color:#3b82f6;text-decoration:underline}.news-widget_event_details_card__right{display:flex;width:100%;flex:1;flex-direction:column;align-items:flex-end;justify-content:center;gap:.75rem;padding-left:.25rem}@media(min-width:40rem){.news-widget_event_details_card__right{min-width:40%;padding-left:1rem}}.news-widget_event_details_card__description{font-size:.75rem;color:var(--iccandle-dark-gray);text-align:start;overflow-wrap:break-word;line-height:var(1 / .75)}.news-widget_event_details_card__collapsible_inner{display:flex;min-height:0;flex-direction:column;gap:1rem;overflow:hidden;padding-top:1rem;text-align:left}.news-widget_event_details_card__previous_events_list{display:flex;gap:.75rem;overflow-x:auto;padding-bottom:.75rem}.news-widget_event_details_card__info{display:flex;flex-direction:column;border-radius:.375rem;border-style:solid;border-width:1px;border-color:color-mix(in oklab,var(--iccandle-muted) 50%,transparent);padding-inline:.5rem;padding-block:.25rem;box-shadow:0 1px 2px #0000000d;text-align:left}.news-widget_news_card__container{background:var(--iccandle-background);width:220px;flex-shrink:0;border-radius:.75rem;border-style:solid;border-width:1px;border-color:var(--iccandle-border);padding:.75rem}.news-widget_news_card__title{color:var(--iccandle-news-card-title);font-size:.875rem;line-height:1.25;font-weight:600;text-align:left}.news-widget_news_card__info_card{background:color-mix(in oklab,var(--iccandle-muted) 50%,transparent);flex:1;padding:.25rem;text-align:center;border-radius:.5rem}.news-widget_news_card__font_semibold{font-weight:600}.news-widget_news_card__info_row{display:flex;align-items:stretch;gap:.25rem;font-size:.75rem;line-height:1rem}.news-widget_news_card__label{color:var(--iccandle-gray);margin-bottom:.25rem}.news-widget_news_card__header{display:flex;align-items:flex-start;gap:.75rem;margin-bottom:.75rem}.news-widget_news_card__currency_icon{width:1.75rem;height:1.75rem;flex-shrink:0}.news-widget_news_card__currency_img{height:100%;width:100%;border-radius:9999px;object-fit:cover}.news-widget_news_card__meta{min-width:0}.news-widget_news_card__date{color:var(--iccandle-gray);margin-bottom:.125rem;font-size:.75rem;line-height:1rem}.news-widget_main__container{display:flex;height:100%;width:100%;flex-direction:column;overflow-y:auto}@media(min-width:1024px){.news-widget_main__container--lg{flex-direction:row;overflow-y:unset}}.news-widget_main__iframe_full{height:100%;width:100%;border:none}.news-widget_main__iframe_half{width:100%;height:100%;border:none;flex-shrink:0}@media(min-width:1024px){.news-widget_main__container--lg .news-widget_main__iframe_half{width:50%;height:100%;flex-shrink:1}}.news-widget_main__left{width:100%;height:100%;flex-shrink:0;display:flex;flex-direction:column}@media(min-width:1024px){.news-widget_main__container--lg .news-widget_main__left{width:50%;height:100%;flex-shrink:1}}.news-widget__button{display:inline-flex;align-items:center;justify-content:center;gap:8px;white-space:nowrap;border-radius:6px;font-size:14px;font-weight:500;cursor:pointer;color:var(--iccandle-text);transition:color .15s,background-color .15s}.news-widget__button:focus-visible{outline:none;box-shadow:0 0 0 2px var(--iccandle-background),0 0 0 4px var(--iccandle-primary)}.news-widget__button:disabled{pointer-events:none;opacity:.5}.news-widget__button svg{pointer-events:none;width:16px;height:16px;flex-shrink:0}.news-widget__button--ghost{background:transparent}.news-widget__button--ghost:hover{background-color:var(--iccandle-secondary)}.news-widget__button--icon{height:40px;width:40px;padding:0}.news-widget,.news-widget *:before,.news-widget *:after{margin:0;padding:0;border:0 solid}.news-widget,.news-widget *,.news-widget *:before,.news-widget *:after{box-sizing:border-box;letter-spacing:normal}.news-widget{line-height:1.5;tab-size:4;--iccandle-primary: #00dfb9;--iccandle-primary-gradient-end: #ffb84d;--iccandle-background: #ffffff;--iccandle-border: #d1d5dc;--iccandle-text: #000000;--iccandle-secondary: oklch( from var(--iccandle-background) clamp(.92, calc(l - .06) , .98) c h / .92 );--iccandle-green: #22c55e;--iccandle-gray: #667085;--iccandle-dark-gray: #667085;--iccandle-orange: #ffb84d;--iccandle-red: #ef4444;--iccandle-title: #000;--iccandle-news-card-title: #0a0a0a;--iccandle-news-details-title: #344054;--iccandle-muted: hsl(0 0% 96.1%);font-family:var( --iccandle-font, "Inter Tight", ui-sans-serif, system-ui, sans-serif );position:relative;height:100%}.dark{--iccandle-primary: #00dfb9;--iccandle-primary-gradient-end: #ffb84d;--iccandle-background: #1a1a1a;--iccandle-border: rgba(255, 255, 255, .2);--iccandle-text: #ffffff;--iccandle-secondary: oklch( from var(--iccandle-background) clamp(.22, calc(l + .22) , .34) c h / .92 );--iccandle-green: #22c55e;--iccandle-gray: #a3a3a3;--iccandle-dark-gray: #6a7282;--iccandle-orange: #ffb84d;--iccandle-red: #ef4444;--iccandle-title: #fff;--iccandle-news-card-title: #fafafa;--iccandle-news-details-title: #d1d5dc;--iccandle-muted: hsl(0 0% 14.9%)}.news-widget__container{height:100%;width:100%}.news-widget__red{color:var(--iccandle-red)}.news-widget__green{color:var(--iccandle-green)}.news-widget__gray{color:var(--iccandle-gray)}.news-widget__orange{color:var(--iccandle-orange)}.news-widget__bg_green{background:var(--iccandle-green)}.news-widget__bg_gray{background:var(--iccandle-gray)}.news-widget__bg_orange{background:var(--iccandle-orange)}')),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react");var xe={exports:{}},Re={};var ct;function mn(){if(ct)return Re;ct=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,r,i){var o=null;if(i!==void 0&&(o=""+i),r.key!==void 0&&(o=""+r.key),"key"in r){i={};for(var a in r)a!=="key"&&(i[a]=r[a])}else i=r;return r=i.ref,{$$typeof:e,type:s,key:o,ref:r!==void 0?r:null,props:i}}return Re.Fragment=t,Re.jsx=n,Re.jsxs=n,Re}var Ee={};var lt;function _n(){return lt||(lt=1,process.env.NODE_ENV!=="production"&&(function(){function e(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===V?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case h:return"Fragment";case J:return"Profiler";case D:return"StrictMode";case F:return"Suspense";case Y:return"SuspenseList";case q:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case w:return"Portal";case P:return u.displayName||"Context";case x:return(u._context.displayName||"Context")+".Consumer";case X:var g=u.render;return u=u.displayName,u||(u=g.displayName||g.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case se:return g=u.displayName||null,g!==null?g:e(u.type)||"Memo";case Q:g=u._payload,u=u._init;try{return e(u(g))}catch{}}return null}function t(u){return""+u}function n(u){try{t(u);var g=!1}catch{g=!0}if(g){g=console;var U=g.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return U.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),t(u)}}function s(u){if(u===h)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===Q)return"<...>";try{var g=e(u);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function r(){var u=W.A;return u===null?null:u.getOwner()}function i(){return Error("react-stack-top-frame")}function o(u){if(k.call(u,"key")){var g=Object.getOwnPropertyDescriptor(u,"key").get;if(g&&g.isReactWarning)return!1}return u.key!==void 0}function a(u,g){function U(){L||(L=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",g))}U.isReactWarning=!0,Object.defineProperty(u,"key",{get:U,configurable:!0})}function f(){var u=e(this.type);return re[u]||(re[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function d(u,g,U,E,B,$){var T=U.ref;return u={$$typeof:p,type:u,key:g,props:U,_owner:E},(T!==void 0?T:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:f}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:$}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function l(u,g,U,E,B,$){var T=g.children;if(T!==void 0)if(E)if(A(T)){for(E=0;E<T.length;E++)_(T[E]);Object.freeze&&Object.freeze(T)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(T);if(k.call(g,"key")){T=e(u);var M=Object.keys(g).filter(function(K){return K!=="key"});E=0<M.length?"{key: someKey, "+M.join(": ..., ")+": ...}":"{key: someKey}",N[T+E]||(M=0<M.length?"{"+M.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react");var xe={exports:{}},Re={};var ct;function mn(){if(ct)return Re;ct=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,r,i){var o=null;if(i!==void 0&&(o=""+i),r.key!==void 0&&(o=""+r.key),"key"in r){i={};for(var a in r)a!=="key"&&(i[a]=r[a])}else i=r;return r=i.ref,{$$typeof:e,type:s,key:o,ref:r!==void 0?r:null,props:i}}return Re.Fragment=t,Re.jsx=n,Re.jsxs=n,Re}var Ee={};var lt;function _n(){return lt||(lt=1,process.env.NODE_ENV!=="production"&&(function(){function e(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===K?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case h:return"Fragment";case J:return"Profiler";case D:return"StrictMode";case F:return"Suspense";case Y:return"SuspenseList";case q:return"Activity"}if(typeof u=="object")switch(typeof u.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),u.$$typeof){case w:return"Portal";case P:return u.displayName||"Context";case x:return(u._context.displayName||"Context")+".Consumer";case X:var g=u.render;return u=u.displayName,u||(u=g.displayName||g.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case se:return g=u.displayName||null,g!==null?g:e(u.type)||"Memo";case Q:g=u._payload,u=u._init;try{return e(u(g))}catch{}}return null}function t(u){return""+u}function n(u){try{t(u);var g=!1}catch{g=!0}if(g){g=console;var T=g.error,E=typeof Symbol=="function"&&Symbol.toStringTag&&u[Symbol.toStringTag]||u.constructor.name||"Object";return T.call(g,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",E),t(u)}}function s(u){if(u===h)return"<>";if(typeof u=="object"&&u!==null&&u.$$typeof===Q)return"<...>";try{var g=e(u);return g?"<"+g+">":"<...>"}catch{return"<...>"}}function r(){var u=W.A;return u===null?null:u.getOwner()}function i(){return Error("react-stack-top-frame")}function o(u){if(k.call(u,"key")){var g=Object.getOwnPropertyDescriptor(u,"key").get;if(g&&g.isReactWarning)return!1}return u.key!==void 0}function a(u,g){function T(){L||(L=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",g))}T.isReactWarning=!0,Object.defineProperty(u,"key",{get:T,configurable:!0})}function f(){var u=e(this.type);return re[u]||(re[u]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),u=this.props.ref,u!==void 0?u:null}function d(u,g,T,E,B,$){var U=T.ref;return u={$$typeof:p,type:u,key:g,props:T,_owner:E},(U!==void 0?U:null)!==null?Object.defineProperty(u,"ref",{enumerable:!1,get:f}):Object.defineProperty(u,"ref",{enumerable:!1,value:null}),u._store={},Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(u,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(u,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.defineProperty(u,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:$}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u}function l(u,g,T,E,B,$){var U=g.children;if(U!==void 0)if(E)if(A(U)){for(E=0;E<U.length;E++)_(U[E]);Object.freeze&&Object.freeze(U)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(U);if(k.call(g,"key")){U=e(u);var M=Object.keys(g).filter(function(V){return V!=="key"});E=0<M.length?"{key: someKey, "+M.join(": ..., ")+": ...}":"{key: someKey}",v[U+E]||(M=0<M.length?"{"+M.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
3
3
  let props = %s;
4
4
  <%s {...props} />
5
5
  React keys must be passed directly to JSX without using spread:
6
6
  let props = %s;
7
- <%s key={someKey} {...props} />`,E,T,M,T),N[T+E]=!0)}if(T=null,U!==void 0&&(n(U),T=""+U),o(g)&&(n(g.key),T=""+g.key),"key"in g){U={};for(var v in g)v!=="key"&&(U[v]=g[v])}else U=g;return T&&a(U,typeof u=="function"?u.displayName||u.name||"Unknown":u),d(u,T,U,r(),B,$)}function _(u){b(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===Q&&(u._payload.status==="fulfilled"?b(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function b(u){return typeof u=="object"&&u!==null&&u.$$typeof===p}var S=y,p=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),P=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),se=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),V=Symbol.for("react.client.reference"),W=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=Object.prototype.hasOwnProperty,A=Array.isArray,j=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(u){return u()}};var L,re={},C=S.react_stack_bottom_frame.bind(S,i)(),I=j(s(i)),N={};Ee.Fragment=h,Ee.jsx=function(u,g,U){var E=1e4>W.recentlyCreatedOwnerStacks++;return l(u,g,U,!1,E?Error("react-stack-top-frame"):C,E?j(s(u)):I)},Ee.jsxs=function(u,g,U){var E=1e4>W.recentlyCreatedOwnerStacks++;return l(u,g,U,!0,E?Error("react-stack-top-frame"):C,E?j(s(u)):I)}})()),Ee}var dt;function hn(){return dt||(dt=1,process.env.NODE_ENV==="production"?xe.exports=mn():xe.exports=_n()),xe.exports}var m=hn();const jt=y.createContext(null);function wn(){const e=y.useContext(jt);if(!e)throw new Error("useCtaLoader must be used within CtaLoaderProvider");return e}const ut=1100,yn=180;function gn({children:e,theme:t}){const[n,s]=y.useState(!1),[r,i]=y.useState(!1),[o,a]=y.useState(0),f=y.useRef(null),d=y.useRef(null),l=y.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null,d.current&&window.clearTimeout(d.current),d.current=null,d.current=window.setTimeout(()=>{d.current=null,s(!1),i(!1)},yn)},[]),_=y.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null,d.current&&window.clearTimeout(d.current),d.current=null,a(p=>p+1),i(!1),s(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>i(!0))),f.current=window.setTimeout(()=>{f.current=null,l()},ut)},[l]);y.useEffect(()=>l,[l]);const b=y.useMemo(()=>({start:_,stop:l,visible:n}),[_,l,n]),S=t==="light"?"https://icc-web-assets.s3.ap-southeast-1.amazonaws.com/loader/build-up-white.webm":"https://icc-web-assets.s3.ap-southeast-1.amazonaws.com/loader/build-up-black.webm";return m.jsxs(jt.Provider,{value:b,children:[e,n&&m.jsx("div",{className:"cta-loader__overlay",children:m.jsxs("div",{className:"cta-loader__content",children:[m.jsx("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:"auto",className:"cta-loader__video",children:m.jsx("source",{src:S,type:"video/webm"})}),m.jsx("div",{className:"cta-loader__bar-wrapper",children:m.jsx("div",{className:"cta-loader__bar-track",children:m.jsx("div",{className:"cta-loader__bar-fill",style:{transform:r?"scaleX(1)":"scaleX(0)",transition:`transform ${ut}ms linear`}},o)})})]})})]})}function Bt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Cn}=Object.prototype,{getPrototypeOf:Qe}=Object,{iterator:je,toStringTag:Mt}=Symbol,Be=(e=>t=>{const n=Cn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),fe=e=>(e=e.toLowerCase(),t=>Be(t)===e),Me=e=>t=>typeof t===e,{isArray:be}=Array,Ce=Me("undefined");function Ae(e){return e!==null&&!Ce(e)&&e.constructor!==null&&!Ce(e.constructor)&&oe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Yt=fe("ArrayBuffer");function bn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Yt(e.buffer),t}const Rn=Me("string"),oe=Me("function"),Ht=Me("number"),Ue=e=>e!==null&&typeof e=="object",En=e=>e===!0||e===!1,Pe=e=>{if(Be(e)!=="object")return!1;const t=Qe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Mt in e)&&!(je in e)},Sn=e=>{if(!Ue(e)||Ae(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Dn=fe("Date"),An=fe("File"),Un=fe("Blob"),Tn=fe("FileList"),Nn=e=>Ue(e)&&oe(e.pipe),vn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||oe(e.append)&&((t=Be(e))==="formdata"||t==="object"&&oe(e.toString)&&e.toString()==="[object FormData]"))},xn=fe("URLSearchParams"),[Ln,Pn,On,kn]=["ReadableStream","Request","Response","Headers"].map(fe),Fn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Te(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),be(e))for(s=0,r=e.length;s<r;s++)t.call(null,e[s],s,e);else{if(Ae(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(s=0;s<o;s++)a=i[s],t.call(null,e[a],a,e)}}function It(e,t){if(Ae(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,r;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const _e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$t=e=>!Ce(e)&&e!==_e;function Je(){const{caseless:e,skipUndefined:t}=$t(this)&&this||{},n={},s=(r,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const o=e&&It(n,i)||i;Pe(n[o])&&Pe(r)?n[o]=Je(n[o],r):Pe(r)?n[o]=Je({},r):be(r)?n[o]=r.slice():(!t||!Ce(r))&&(n[o]=r)};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Te(arguments[r],s);return n}const jn=(e,t,n,{allOwnKeys:s}={})=>(Te(t,(r,i)=>{n&&oe(r)?Object.defineProperty(e,i,{value:Bt(r,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{value:r,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),e),Bn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Mn=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Yn=(e,t,n,s)=>{let r,i,o;const a={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)o=r[i],(!s||s(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&Qe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Hn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},In=e=>{if(!e)return null;if(be(e))return e;let t=e.length;if(!Ht(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},$n=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qe(Uint8Array)),Gn=(e,t)=>{const s=(e&&e[je]).call(e);let r;for(;(r=s.next())&&!r.done;){const i=r.value;t.call(e,i[0],i[1])}},Jn=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},Xn=fe("HTMLFormElement"),qn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),pt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Vn=fe("RegExp"),Gt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Te(n,(r,i)=>{let o;(o=t(r,i,e))!==!1&&(s[i]=o||r)}),Object.defineProperties(e,s)},Kn=e=>{Gt(e,(t,n)=>{if(oe(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(oe(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zn=(e,t)=>{const n={},s=r=>{r.forEach(i=>{n[i]=!0})};return be(e)?s(e):s(String(e).split(t)),n},Zn=()=>{},Wn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Qn(e){return!!(e&&oe(e.append)&&e[Mt]==="FormData"&&e[je])}const es=e=>{const t=new Array(10),n=(s,r)=>{if(Ue(s)){if(t.indexOf(s)>=0)return;if(Ae(s))return s;if(!("toJSON"in s)){t[r]=s;const i=be(s)?[]:{};return Te(s,(o,a)=>{const f=n(o,r+1);!Ce(f)&&(i[a]=f)}),t[r]=void 0,i}}return s};return n(e,0)},ts=fe("AsyncFunction"),ns=e=>e&&(Ue(e)||oe(e))&&oe(e.then)&&oe(e.catch),Jt=((e,t)=>e?setImmediate:t?((n,s)=>(_e.addEventListener("message",({source:r,data:i})=>{r===_e&&i===n&&s.length&&s.shift()()},!1),r=>{s.push(r),_e.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",oe(_e.postMessage)),ss=typeof queueMicrotask<"u"?queueMicrotask.bind(_e):typeof process<"u"&&process.nextTick||Jt,rs=e=>e!=null&&oe(e[je]),c={isArray:be,isArrayBuffer:Yt,isBuffer:Ae,isFormData:vn,isArrayBufferView:bn,isString:Rn,isNumber:Ht,isBoolean:En,isObject:Ue,isPlainObject:Pe,isEmptyObject:Sn,isReadableStream:Ln,isRequest:Pn,isResponse:On,isHeaders:kn,isUndefined:Ce,isDate:Dn,isFile:An,isBlob:Un,isRegExp:Vn,isFunction:oe,isStream:Nn,isURLSearchParams:xn,isTypedArray:$n,isFileList:Tn,forEach:Te,merge:Je,extend:jn,trim:Fn,stripBOM:Bn,inherits:Mn,toFlatObject:Yn,kindOf:Be,kindOfTest:fe,endsWith:Hn,toArray:In,forEachEntry:Gn,matchAll:Jn,isHTMLForm:Xn,hasOwnProperty:pt,hasOwnProp:pt,reduceDescriptors:Gt,freezeMethods:Kn,toObjectSet:zn,toCamelCase:qn,noop:Zn,toFiniteNumber:Wn,findKey:It,global:_e,isContextDefined:$t,isSpecCompliantForm:Qn,toJSONObject:es,isAsyncFn:ts,isThenable:ns,setImmediate:Jt,asap:ss,isIterable:rs};let R=class Xt extends Error{static from(t,n,s,r,i,o){const a=new Xt(t.message,n||t.code,s,r,i);return a.cause=t,a.name=t.name,o&&Object.assign(a,o),a}constructor(t,n,s,r,i){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),s&&(this.config=s),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}};R.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";R.ERR_BAD_OPTION="ERR_BAD_OPTION";R.ECONNABORTED="ECONNABORTED";R.ETIMEDOUT="ETIMEDOUT";R.ERR_NETWORK="ERR_NETWORK";R.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";R.ERR_DEPRECATED="ERR_DEPRECATED";R.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";R.ERR_BAD_REQUEST="ERR_BAD_REQUEST";R.ERR_CANCELED="ERR_CANCELED";R.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";R.ERR_INVALID_URL="ERR_INVALID_URL";const is=null;function Xe(e){return c.isPlainObject(e)||c.isArray(e)}function qt(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function ft(e,t,n){return e?e.concat(t).map(function(r,i){return r=qt(r),!n&&i?"["+r+"]":r}).join(n?".":""):t}function os(e){return c.isArray(e)&&!e.some(Xe)}const as=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Ye(e,t,n){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,h){return!c.isUndefined(h[w])});const s=n.metaTokens,r=n.visitor||l,i=n.dots,o=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(r))throw new TypeError("visitor must be a function");function d(p){if(p===null)return"";if(c.isDate(p))return p.toISOString();if(c.isBoolean(p))return p.toString();if(!f&&c.isBlob(p))throw new R("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(p)||c.isTypedArray(p)?f&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,w,h){let D=p;if(p&&!h&&typeof p=="object"){if(c.endsWith(w,"{}"))w=s?w:w.slice(0,-2),p=JSON.stringify(p);else if(c.isArray(p)&&os(p)||(c.isFileList(p)||c.endsWith(w,"[]"))&&(D=c.toArray(p)))return w=qt(w),D.forEach(function(x,P){!(c.isUndefined(x)||x===null)&&t.append(o===!0?ft([w],P,i):o===null?w:w+"[]",d(x))}),!1}return Xe(p)?!0:(t.append(ft(h,w,i),d(p)),!1)}const _=[],b=Object.assign(as,{defaultVisitor:l,convertValue:d,isVisitable:Xe});function S(p,w){if(!c.isUndefined(p)){if(_.indexOf(p)!==-1)throw Error("Circular reference detected in "+w.join("."));_.push(p),c.forEach(p,function(D,J){(!(c.isUndefined(D)||D===null)&&r.call(t,D,c.isString(J)?J.trim():J,w,b))===!0&&S(D,w?w.concat(J):[J])}),_.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return S(e),t}function mt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function et(e,t){this._pairs=[],e&&Ye(e,this,t)}const Vt=et.prototype;Vt.append=function(t,n){this._pairs.push([t,n])};Vt.toString=function(t){const n=t?function(s){return t.call(this,s,mt)}:mt;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function cs(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Kt(e,t,n){if(!t)return e;const s=n&&n.encode||cs,r=c.isFunction(n)?{serialize:n}:n,i=r&&r.serialize;let o;if(i?o=i(t,r):o=c.isURLSearchParams(t)?t.toString():new et(t,r).toString(s),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class _t{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(s){s!==null&&t(s)})}}const tt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ls=typeof URLSearchParams<"u"?URLSearchParams:et,ds=typeof FormData<"u"?FormData:null,us=typeof Blob<"u"?Blob:null,ps={isBrowser:!0,classes:{URLSearchParams:ls,FormData:ds,Blob:us},protocols:["http","https","file","blob","url","data"]},nt=typeof window<"u"&&typeof document<"u",qe=typeof navigator=="object"&&navigator||void 0,fs=nt&&(!qe||["ReactNative","NativeScript","NS"].indexOf(qe.product)<0),ms=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_s=nt&&window.location.href||"http://localhost",hs=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:nt,hasStandardBrowserEnv:fs,hasStandardBrowserWebWorkerEnv:ms,navigator:qe,origin:_s},Symbol.toStringTag,{value:"Module"})),ne={...hs,...ps};function ws(e,t){return Ye(e,new ne.classes.URLSearchParams,{visitor:function(n,s,r,i){return ne.isNode&&c.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function ys(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function gs(e){const t={},n=Object.keys(e);let s;const r=n.length;let i;for(s=0;s<r;s++)i=n[s],t[i]=e[i];return t}function zt(e){function t(n,s,r,i){let o=n[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),f=i>=n.length;return o=!o&&c.isArray(r)?r.length:o,f?(c.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!c.isObject(r[o]))&&(r[o]=[]),t(n,s,r[o],i)&&c.isArray(r[o])&&(r[o]=gs(r[o])),!a)}if(c.isFormData(e)&&c.isFunction(e.entries)){const n={};return c.forEachEntry(e,(s,r)=>{t(ys(s),r,n,0)}),n}return null}function Cs(e,t,n){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const Ne={transitional:tt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,i=c.isObject(t);if(i&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return r?JSON.stringify(zt(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return ws(t,this.formSerializer).toString();if((a=c.isFileList(t))||s.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Ye(a?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),Cs(t)):t}],transformResponse:[function(t){const n=this.transitional||Ne.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(s&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?R.from(a,R.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ne.classes.FormData,Blob:ne.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{Ne.headers[e]={}});const bs=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Rs=e=>{const t={};let n,s,r;return e&&e.split(`
7
+ <%s key={someKey} {...props} />`,E,U,M,U),v[U+E]=!0)}if(U=null,T!==void 0&&(n(T),U=""+T),o(g)&&(n(g.key),U=""+g.key),"key"in g){T={};for(var N in g)N!=="key"&&(T[N]=g[N])}else T=g;return U&&a(T,typeof u=="function"?u.displayName||u.name||"Unknown":u),d(u,U,T,r(),B,$)}function _(u){b(u)?u._store&&(u._store.validated=1):typeof u=="object"&&u!==null&&u.$$typeof===Q&&(u._payload.status==="fulfilled"?b(u._payload.value)&&u._payload.value._store&&(u._payload.value._store.validated=1):u._store&&(u._store.validated=1))}function b(u){return typeof u=="object"&&u!==null&&u.$$typeof===p}var S=y,p=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),P=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),se=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),K=Symbol.for("react.client.reference"),W=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=Object.prototype.hasOwnProperty,A=Array.isArray,j=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(u){return u()}};var L,re={},C=S.react_stack_bottom_frame.bind(S,i)(),I=j(s(i)),v={};Ee.Fragment=h,Ee.jsx=function(u,g,T){var E=1e4>W.recentlyCreatedOwnerStacks++;return l(u,g,T,!1,E?Error("react-stack-top-frame"):C,E?j(s(u)):I)},Ee.jsxs=function(u,g,T){var E=1e4>W.recentlyCreatedOwnerStacks++;return l(u,g,T,!0,E?Error("react-stack-top-frame"):C,E?j(s(u)):I)}})()),Ee}var dt;function hn(){return dt||(dt=1,process.env.NODE_ENV==="production"?xe.exports=mn():xe.exports=_n()),xe.exports}var m=hn();const jt=y.createContext(null);function wn(){const e=y.useContext(jt);if(!e)throw new Error("useCtaLoader must be used within CtaLoaderProvider");return e}const ut=1100,yn=180;function gn({children:e,theme:t}){const[n,s]=y.useState(!1),[r,i]=y.useState(!1),[o,a]=y.useState(0),f=y.useRef(null),d=y.useRef(null),l=y.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null,d.current&&window.clearTimeout(d.current),d.current=null,d.current=window.setTimeout(()=>{d.current=null,s(!1),i(!1)},yn)},[]),_=y.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null,d.current&&window.clearTimeout(d.current),d.current=null,a(p=>p+1),i(!1),s(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>i(!0))),f.current=window.setTimeout(()=>{f.current=null,l()},ut)},[l]);y.useEffect(()=>l,[l]);const b=y.useMemo(()=>({start:_,stop:l,visible:n}),[_,l,n]),S=t==="light"?"https://icc-web-assets.s3.ap-southeast-1.amazonaws.com/loader/build-up-white.webm":"https://icc-web-assets.s3.ap-southeast-1.amazonaws.com/loader/build-up-black.webm";return m.jsxs(jt.Provider,{value:b,children:[e,n&&m.jsx("div",{className:"cta-loader__overlay",children:m.jsxs("div",{className:"cta-loader__content",children:[m.jsx("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:"auto",className:"cta-loader__video",children:m.jsx("source",{src:S,type:"video/webm"})}),m.jsx("div",{className:"cta-loader__bar-wrapper",children:m.jsx("div",{className:"cta-loader__bar-track",children:m.jsx("div",{className:"cta-loader__bar-fill",style:{transform:r?"scaleX(1)":"scaleX(0)",transition:`transform ${ut}ms linear`}},o)})})]})})]})}function Bt(e,t){return function(){return e.apply(t,arguments)}}const{toString:Cn}=Object.prototype,{getPrototypeOf:Qe}=Object,{iterator:je,toStringTag:Mt}=Symbol,Be=(e=>t=>{const n=Cn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),fe=e=>(e=e.toLowerCase(),t=>Be(t)===e),Me=e=>t=>typeof t===e,{isArray:be}=Array,Ce=Me("undefined");function Ae(e){return e!==null&&!Ce(e)&&e.constructor!==null&&!Ce(e.constructor)&&oe(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Yt=fe("ArrayBuffer");function bn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Yt(e.buffer),t}const Rn=Me("string"),oe=Me("function"),Ht=Me("number"),Ue=e=>e!==null&&typeof e=="object",En=e=>e===!0||e===!1,Pe=e=>{if(Be(e)!=="object")return!1;const t=Qe(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Mt in e)&&!(je in e)},Sn=e=>{if(!Ue(e)||Ae(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Dn=fe("Date"),An=fe("File"),Un=fe("Blob"),Tn=fe("FileList"),Nn=e=>Ue(e)&&oe(e.pipe),vn=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||oe(e.append)&&((t=Be(e))==="formdata"||t==="object"&&oe(e.toString)&&e.toString()==="[object FormData]"))},xn=fe("URLSearchParams"),[Ln,Pn,On,kn]=["ReadableStream","Request","Response","Headers"].map(fe),Fn=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Te(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let s,r;if(typeof e!="object"&&(e=[e]),be(e))for(s=0,r=e.length;s<r;s++)t.call(null,e[s],s,e);else{if(Ae(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let a;for(s=0;s<o;s++)a=i[s],t.call(null,e[a],a,e)}}function It(e,t){if(Ae(e))return null;t=t.toLowerCase();const n=Object.keys(e);let s=n.length,r;for(;s-- >0;)if(r=n[s],t===r.toLowerCase())return r;return null}const _e=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,$t=e=>!Ce(e)&&e!==_e;function Je(){const{caseless:e,skipUndefined:t}=$t(this)&&this||{},n={},s=(r,i)=>{if(i==="__proto__"||i==="constructor"||i==="prototype")return;const o=e&&It(n,i)||i;Pe(n[o])&&Pe(r)?n[o]=Je(n[o],r):Pe(r)?n[o]=Je({},r):be(r)?n[o]=r.slice():(!t||!Ce(r))&&(n[o]=r)};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Te(arguments[r],s);return n}const jn=(e,t,n,{allOwnKeys:s}={})=>(Te(t,(r,i)=>{n&&oe(r)?Object.defineProperty(e,i,{value:Bt(r,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{value:r,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),e),Bn=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Mn=(e,t,n,s)=>{e.prototype=Object.create(t.prototype,s),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Yn=(e,t,n,s)=>{let r,i,o;const a={};if(t=t||{},e==null)return t;do{for(r=Object.getOwnPropertyNames(e),i=r.length;i-- >0;)o=r[i],(!s||s(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&Qe(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Hn=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const s=e.indexOf(t,n);return s!==-1&&s===n},In=e=>{if(!e)return null;if(be(e))return e;let t=e.length;if(!Ht(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},$n=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qe(Uint8Array)),Gn=(e,t)=>{const s=(e&&e[je]).call(e);let r;for(;(r=s.next())&&!r.done;){const i=r.value;t.call(e,i[0],i[1])}},Jn=(e,t)=>{let n;const s=[];for(;(n=e.exec(t))!==null;)s.push(n);return s},Xn=fe("HTMLFormElement"),qn=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,s,r){return s.toUpperCase()+r}),pt=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Vn=fe("RegExp"),Gt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),s={};Te(n,(r,i)=>{let o;(o=t(r,i,e))!==!1&&(s[i]=o||r)}),Object.defineProperties(e,s)},Kn=e=>{Gt(e,(t,n)=>{if(oe(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const s=e[n];if(oe(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},zn=(e,t)=>{const n={},s=r=>{r.forEach(i=>{n[i]=!0})};return be(e)?s(e):s(String(e).split(t)),n},Zn=()=>{},Wn=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Qn(e){return!!(e&&oe(e.append)&&e[Mt]==="FormData"&&e[je])}const es=e=>{const t=new Array(10),n=(s,r)=>{if(Ue(s)){if(t.indexOf(s)>=0)return;if(Ae(s))return s;if(!("toJSON"in s)){t[r]=s;const i=be(s)?[]:{};return Te(s,(o,a)=>{const f=n(o,r+1);!Ce(f)&&(i[a]=f)}),t[r]=void 0,i}}return s};return n(e,0)},ts=fe("AsyncFunction"),ns=e=>e&&(Ue(e)||oe(e))&&oe(e.then)&&oe(e.catch),Jt=((e,t)=>e?setImmediate:t?((n,s)=>(_e.addEventListener("message",({source:r,data:i})=>{r===_e&&i===n&&s.length&&s.shift()()},!1),r=>{s.push(r),_e.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",oe(_e.postMessage)),ss=typeof queueMicrotask<"u"?queueMicrotask.bind(_e):typeof process<"u"&&process.nextTick||Jt,rs=e=>e!=null&&oe(e[je]),c={isArray:be,isArrayBuffer:Yt,isBuffer:Ae,isFormData:vn,isArrayBufferView:bn,isString:Rn,isNumber:Ht,isBoolean:En,isObject:Ue,isPlainObject:Pe,isEmptyObject:Sn,isReadableStream:Ln,isRequest:Pn,isResponse:On,isHeaders:kn,isUndefined:Ce,isDate:Dn,isFile:An,isBlob:Un,isRegExp:Vn,isFunction:oe,isStream:Nn,isURLSearchParams:xn,isTypedArray:$n,isFileList:Tn,forEach:Te,merge:Je,extend:jn,trim:Fn,stripBOM:Bn,inherits:Mn,toFlatObject:Yn,kindOf:Be,kindOfTest:fe,endsWith:Hn,toArray:In,forEachEntry:Gn,matchAll:Jn,isHTMLForm:Xn,hasOwnProperty:pt,hasOwnProp:pt,reduceDescriptors:Gt,freezeMethods:Kn,toObjectSet:zn,toCamelCase:qn,noop:Zn,toFiniteNumber:Wn,findKey:It,global:_e,isContextDefined:$t,isSpecCompliantForm:Qn,toJSONObject:es,isAsyncFn:ts,isThenable:ns,setImmediate:Jt,asap:ss,isIterable:rs};let R=class Xt extends Error{static from(t,n,s,r,i,o){const a=new Xt(t.message,n||t.code,s,r,i);return a.cause=t,a.name=t.name,o&&Object.assign(a,o),a}constructor(t,n,s,r,i){super(t),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),s&&(this.config=s),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}};R.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";R.ERR_BAD_OPTION="ERR_BAD_OPTION";R.ECONNABORTED="ECONNABORTED";R.ETIMEDOUT="ETIMEDOUT";R.ERR_NETWORK="ERR_NETWORK";R.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";R.ERR_DEPRECATED="ERR_DEPRECATED";R.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";R.ERR_BAD_REQUEST="ERR_BAD_REQUEST";R.ERR_CANCELED="ERR_CANCELED";R.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";R.ERR_INVALID_URL="ERR_INVALID_URL";const is=null;function Xe(e){return c.isPlainObject(e)||c.isArray(e)}function qt(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function ft(e,t,n){return e?e.concat(t).map(function(r,i){return r=qt(r),!n&&i?"["+r+"]":r}).join(n?".":""):t}function os(e){return c.isArray(e)&&!e.some(Xe)}const as=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function Ye(e,t,n){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,h){return!c.isUndefined(h[w])});const s=n.metaTokens,r=n.visitor||l,i=n.dots,o=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(r))throw new TypeError("visitor must be a function");function d(p){if(p===null)return"";if(c.isDate(p))return p.toISOString();if(c.isBoolean(p))return p.toString();if(!f&&c.isBlob(p))throw new R("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(p)||c.isTypedArray(p)?f&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function l(p,w,h){let D=p;if(p&&!h&&typeof p=="object"){if(c.endsWith(w,"{}"))w=s?w:w.slice(0,-2),p=JSON.stringify(p);else if(c.isArray(p)&&os(p)||(c.isFileList(p)||c.endsWith(w,"[]"))&&(D=c.toArray(p)))return w=qt(w),D.forEach(function(x,P){!(c.isUndefined(x)||x===null)&&t.append(o===!0?ft([w],P,i):o===null?w:w+"[]",d(x))}),!1}return Xe(p)?!0:(t.append(ft(h,w,i),d(p)),!1)}const _=[],b=Object.assign(as,{defaultVisitor:l,convertValue:d,isVisitable:Xe});function S(p,w){if(!c.isUndefined(p)){if(_.indexOf(p)!==-1)throw Error("Circular reference detected in "+w.join("."));_.push(p),c.forEach(p,function(D,J){(!(c.isUndefined(D)||D===null)&&r.call(t,D,c.isString(J)?J.trim():J,w,b))===!0&&S(D,w?w.concat(J):[J])}),_.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return S(e),t}function mt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(s){return t[s]})}function et(e,t){this._pairs=[],e&&Ye(e,this,t)}const Vt=et.prototype;Vt.append=function(t,n){this._pairs.push([t,n])};Vt.toString=function(t){const n=t?function(s){return t.call(this,s,mt)}:mt;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};function cs(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Kt(e,t,n){if(!t)return e;const s=n&&n.encode||cs,r=c.isFunction(n)?{serialize:n}:n,i=r&&r.serialize;let o;if(i?o=i(t,r):o=c.isURLSearchParams(t)?t.toString():new et(t,r).toString(s),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class _t{constructor(){this.handlers=[]}use(t,n,s){return this.handlers.push({fulfilled:t,rejected:n,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(s){s!==null&&t(s)})}}const tt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},ls=typeof URLSearchParams<"u"?URLSearchParams:et,ds=typeof FormData<"u"?FormData:null,us=typeof Blob<"u"?Blob:null,ps={isBrowser:!0,classes:{URLSearchParams:ls,FormData:ds,Blob:us},protocols:["http","https","file","blob","url","data"]},nt=typeof window<"u"&&typeof document<"u",qe=typeof navigator=="object"&&navigator||void 0,fs=nt&&(!qe||["ReactNative","NativeScript","NS"].indexOf(qe.product)<0),ms=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_s=nt&&window.location.href||"http://localhost",hs=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:nt,hasStandardBrowserEnv:fs,hasStandardBrowserWebWorkerEnv:ms,navigator:qe,origin:_s},Symbol.toStringTag,{value:"Module"})),ne={...hs,...ps};function ws(e,t){return Ye(e,new ne.classes.URLSearchParams,{visitor:function(n,s,r,i){return ne.isNode&&c.isBuffer(n)?(this.append(s,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function ys(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function gs(e){const t={},n=Object.keys(e);let s;const r=n.length;let i;for(s=0;s<r;s++)i=n[s],t[i]=e[i];return t}function zt(e){function t(n,s,r,i){let o=n[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),f=i>=n.length;return o=!o&&c.isArray(r)?r.length:o,f?(c.hasOwnProp(r,o)?r[o]=[r[o],s]:r[o]=s,!a):((!r[o]||!c.isObject(r[o]))&&(r[o]=[]),t(n,s,r[o],i)&&c.isArray(r[o])&&(r[o]=gs(r[o])),!a)}if(c.isFormData(e)&&c.isFunction(e.entries)){const n={};return c.forEachEntry(e,(s,r)=>{t(ys(s),r,n,0)}),n}return null}function Cs(e,t,n){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(n||JSON.stringify)(e)}const Ne={transitional:tt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const s=n.getContentType()||"",r=s.indexOf("application/json")>-1,i=c.isObject(t);if(i&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return r?JSON.stringify(zt(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(i){if(s.indexOf("application/x-www-form-urlencoded")>-1)return ws(t,this.formSerializer).toString();if((a=c.isFileList(t))||s.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Ye(a?{"files[]":t}:t,f&&new f,this.formSerializer)}}return i||r?(n.setContentType("application/json",!1),Cs(t)):t}],transformResponse:[function(t){const n=this.transitional||Ne.transitional,s=n&&n.forcedJSONParsing,r=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(s&&!this.responseType||r)){const o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(t,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?R.from(a,R.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ne.classes.FormData,Blob:ne.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{Ne.headers[e]={}});const bs=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Rs=e=>{const t={};let n,s,r;return e&&e.split(`
8
8
  `).forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),s=o.substring(r+1).trim(),!(!n||t[n]&&bs[n])&&(n==="set-cookie"?t[n]?t[n].push(s):t[n]=[s]:t[n]=t[n]?t[n]+", "+s:s)}),t},ht=Symbol("internals");function Se(e){return e&&String(e).trim().toLowerCase()}function Oe(e){return e===!1||e==null?e:c.isArray(e)?e.map(Oe):String(e)}function Es(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(e);)t[s[1]]=s[2];return t}const Ss=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Ie(e,t,n,s,r){if(c.isFunction(s))return s.call(this,t,n);if(r&&(t=n),!!c.isString(t)){if(c.isString(s))return t.indexOf(s)!==-1;if(c.isRegExp(s))return s.test(t)}}function Ds(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function As(e,t){const n=c.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+n,{value:function(r,i,o){return this[s].call(this,t,r,i,o)},configurable:!0})})}let ae=class{constructor(t){t&&this.set(t)}set(t,n,s){const r=this;function i(a,f,d){const l=Se(f);if(!l)throw new Error("header name must be a non-empty string");const _=c.findKey(r,l);(!_||r[_]===void 0||d===!0||d===void 0&&r[_]!==!1)&&(r[_||f]=Oe(a))}const o=(a,f)=>c.forEach(a,(d,l)=>i(d,l,f));if(c.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(c.isString(t)&&(t=t.trim())&&!Ss(t))o(Rs(t),n);else if(c.isObject(t)&&c.isIterable(t)){let a={},f,d;for(const l of t){if(!c.isArray(l))throw TypeError("Object iterator must return a key-value pair");a[d=l[0]]=(f=a[d])?c.isArray(f)?[...f,l[1]]:[f,l[1]]:l[1]}o(a,n)}else t!=null&&i(n,t,s);return this}get(t,n){if(t=Se(t),t){const s=c.findKey(this,t);if(s){const r=this[s];if(!n)return r;if(n===!0)return Es(r);if(c.isFunction(n))return n.call(this,r,s);if(c.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Se(t),t){const s=c.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||Ie(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let r=!1;function i(o){if(o=Se(o),o){const a=c.findKey(s,o);a&&(!n||Ie(s,s[a],a,n))&&(delete s[a],r=!0)}}return c.isArray(t)?t.forEach(i):i(t),r}clear(t){const n=Object.keys(this);let s=n.length,r=!1;for(;s--;){const i=n[s];(!t||Ie(this,this[i],i,t,!0))&&(delete this[i],r=!0)}return r}normalize(t){const n=this,s={};return c.forEach(this,(r,i)=>{const o=c.findKey(s,i);if(o){n[o]=Oe(r),delete n[i];return}const a=t?Ds(i):String(i).trim();a!==i&&delete n[i],n[a]=Oe(r),s[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return c.forEach(this,(s,r)=>{s!=null&&s!==!1&&(n[r]=t&&c.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
9
- `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[ht]=this[ht]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=Se(o);s[a]||(As(r,o),s[a]=!0)}return c.isArray(t)?t.forEach(i):i(t),this}};ae.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(ae.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});c.freezeMethods(ae);function $e(e,t){const n=this||Ne,s=t||n,r=ae.from(s.headers);let i=s.data;return c.forEach(e,function(a){i=a.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function Zt(e){return!!(e&&e.__CANCEL__)}let ve=class extends R{constructor(t,n,s){super(t??"canceled",R.ERR_CANCELED,n,s),this.name="CanceledError",this.__CANCEL__=!0}};function Wt(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new R("Request failed with status code "+n.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Us(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Ts(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,i=0,o;return t=t!==void 0?t:1e3,function(f){const d=Date.now(),l=s[i];o||(o=d),n[r]=f,s[r]=d;let _=i,b=0;for(;_!==r;)b+=n[_++],_=_%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),d-o<t)return;const S=l&&d-l;return S?Math.round(b*1e3/S):void 0}}function Ns(e,t){let n=0,s=1e3/t,r,i;const o=(d,l=Date.now())=>{n=l,r=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const l=Date.now(),_=l-n;_>=s?o(d,l):(r=d,i||(i=setTimeout(()=>{i=null,o(r)},s-_)))},()=>r&&o(r)]}const Fe=(e,t,n=3)=>{let s=0;const r=Ts(50,250);return Ns(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,f=o-s,d=r(f),l=o<=a;s=o;const _={loaded:o,total:a,progress:a?o/a:void 0,bytes:f,rate:d||void 0,estimated:d&&a&&l?(a-o)/d:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(_)},n)},wt=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},yt=e=>(...t)=>c.asap(()=>e(...t)),vs=ne.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ne.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ne.origin),ne.navigator&&/(msie|trident)/i.test(ne.navigator.userAgent)):()=>!0,xs=ne.hasStandardBrowserEnv?{write(e,t,n,s,r,i,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];c.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),c.isString(s)&&a.push(`path=${s}`),c.isString(r)&&a.push(`domain=${r}`),i===!0&&a.push("secure"),c.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ls(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ps(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Qt(e,t,n){let s=!Ls(t);return e&&(s||n==!1)?Ps(e,t):t}const gt=e=>e instanceof ae?{...e}:e;function ye(e,t){t=t||{};const n={};function s(d,l,_,b){return c.isPlainObject(d)&&c.isPlainObject(l)?c.merge.call({caseless:b},d,l):c.isPlainObject(l)?c.merge({},l):c.isArray(l)?l.slice():l}function r(d,l,_,b){if(c.isUndefined(l)){if(!c.isUndefined(d))return s(void 0,d,_,b)}else return s(d,l,_,b)}function i(d,l){if(!c.isUndefined(l))return s(void 0,l)}function o(d,l){if(c.isUndefined(l)){if(!c.isUndefined(d))return s(void 0,d)}else return s(void 0,l)}function a(d,l,_){if(_ in t)return s(d,l);if(_ in e)return s(void 0,d)}const f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(d,l,_)=>r(gt(d),gt(l),_,!0)};return c.forEach(Object.keys({...e,...t}),function(l){if(l==="__proto__"||l==="constructor"||l==="prototype")return;const _=c.hasOwnProp(f,l)?f[l]:r,b=_(e[l],t[l],l);c.isUndefined(b)&&_!==a||(n[l]=b)}),n}const en=e=>{const t=ye({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=t;if(t.headers=o=ae.from(o),t.url=Kt(Qt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(n)){if(ne.hasStandardBrowserEnv||ne.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(c.isFunction(n.getHeaders)){const f=n.getHeaders(),d=["content-type","content-length"];Object.entries(f).forEach(([l,_])=>{d.includes(l.toLowerCase())&&o.set(l,_)})}}if(ne.hasStandardBrowserEnv&&(s&&c.isFunction(s)&&(s=s(t)),s||s!==!1&&vs(t.url))){const f=r&&i&&xs.read(i);f&&o.set(r,f)}return t},Os=typeof XMLHttpRequest<"u",ks=Os&&function(e){return new Promise(function(n,s){const r=en(e);let i=r.data;const o=ae.from(r.headers).normalize();let{responseType:a,onUploadProgress:f,onDownloadProgress:d}=r,l,_,b,S,p;function w(){S&&S(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function D(){if(!h)return;const x=ae.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),X={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:x,config:e,request:h};Wt(function(Y){n(Y),w()},function(Y){s(Y),w()},X),h=null}"onloadend"in h?h.onloadend=D:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(D)},h.onabort=function(){h&&(s(new R("Request aborted",R.ECONNABORTED,e,h)),h=null)},h.onerror=function(P){const X=P&&P.message?P.message:"Network Error",F=new R(X,R.ERR_NETWORK,e,h);F.event=P||null,s(F),h=null},h.ontimeout=function(){let P=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const X=r.transitional||tt;r.timeoutErrorMessage&&(P=r.timeoutErrorMessage),s(new R(P,X.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,e,h)),h=null},i===void 0&&o.setContentType(null),"setRequestHeader"in h&&c.forEach(o.toJSON(),function(P,X){h.setRequestHeader(X,P)}),c.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),a&&a!=="json"&&(h.responseType=r.responseType),d&&([b,p]=Fe(d,!0),h.addEventListener("progress",b)),f&&h.upload&&([_,S]=Fe(f),h.upload.addEventListener("progress",_),h.upload.addEventListener("loadend",S)),(r.cancelToken||r.signal)&&(l=x=>{h&&(s(!x||x.type?new ve(null,e,h):x),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));const J=Us(r.url);if(J&&ne.protocols.indexOf(J)===-1){s(new R("Unsupported protocol "+J+":",R.ERR_BAD_REQUEST,e));return}h.send(i||null)})},Fs=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,r;const i=function(d){if(!r){r=!0,a();const l=d instanceof Error?d:this.reason;s.abort(l instanceof R?l:new ve(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,i(new R(`timeout of ${t}ms exceeded`,R.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:f}=s;return f.unsubscribe=()=>c.asap(a),f}},js=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,r;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},Bs=async function*(e,t){for await(const n of Ms(e))yield*js(n,t)},Ms=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},Ct=(e,t,n,s)=>{const r=Bs(e,t);let i=0,o,a=f=>{o||(o=!0,s&&s(f))};return new ReadableStream({async pull(f){try{const{done:d,value:l}=await r.next();if(d){a(),f.close();return}let _=l.byteLength;if(n){let b=i+=_;n(b)}f.enqueue(new Uint8Array(l))}catch(d){throw a(d),d}},cancel(f){return a(f),r.return()}},{highWaterMark:2})},bt=64*1024,{isFunction:Le}=c,Ys=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:Rt,TextEncoder:Et}=c.global,St=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Hs=e=>{e=c.merge.call({skipUndefined:!0},Ys,e);const{fetch:t,Request:n,Response:s}=e,r=t?Le(t):typeof fetch=="function",i=Le(n),o=Le(s);if(!r)return!1;const a=r&&Le(Rt),f=r&&(typeof Et=="function"?(p=>w=>p.encode(w))(new Et):async p=>new Uint8Array(await new n(p).arrayBuffer())),d=i&&a&&St(()=>{let p=!1;const w=new n(ne.origin,{body:new Rt,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!w}),l=o&&a&&St(()=>c.isReadableStream(new s("").body)),_={stream:l&&(p=>p.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!_[p]&&(_[p]=(w,h)=>{let D=w&&w[p];if(D)return D.call(w);throw new R(`Response type '${p}' is not supported`,R.ERR_NOT_SUPPORT,h)})});const b=async p=>{if(p==null)return 0;if(c.isBlob(p))return p.size;if(c.isSpecCompliantForm(p))return(await new n(ne.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(c.isArrayBufferView(p)||c.isArrayBuffer(p))return p.byteLength;if(c.isURLSearchParams(p)&&(p=p+""),c.isString(p))return(await f(p)).byteLength},S=async(p,w)=>{const h=c.toFiniteNumber(p.getContentLength());return h??b(w)};return async p=>{let{url:w,method:h,data:D,signal:J,cancelToken:x,timeout:P,onDownloadProgress:X,onUploadProgress:F,responseType:Y,headers:se,withCredentials:Q="same-origin",fetchOptions:q}=en(p),V=t||fetch;Y=Y?(Y+"").toLowerCase():"text";let W=Fs([J,x&&x.toAbortSignal()],P),k=null;const A=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let j;try{if(F&&d&&h!=="get"&&h!=="head"&&(j=await S(se,D))!==0){let u=new n(w,{method:"POST",body:D,duplex:"half"}),g;if(c.isFormData(D)&&(g=u.headers.get("content-type"))&&se.setContentType(g),u.body){const[U,E]=wt(j,Fe(yt(F)));D=Ct(u.body,bt,U,E)}}c.isString(Q)||(Q=Q?"include":"omit");const L=i&&"credentials"in n.prototype,re={...q,signal:W,method:h.toUpperCase(),headers:se.normalize().toJSON(),body:D,duplex:"half",credentials:L?Q:void 0};k=i&&new n(w,re);let C=await(i?V(k,q):V(w,re));const I=l&&(Y==="stream"||Y==="response");if(l&&(X||I&&A)){const u={};["status","statusText","headers"].forEach(B=>{u[B]=C[B]});const g=c.toFiniteNumber(C.headers.get("content-length")),[U,E]=X&&wt(g,Fe(yt(X),!0))||[];C=new s(Ct(C.body,bt,U,()=>{E&&E(),A&&A()}),u)}Y=Y||"text";let N=await _[c.findKey(_,Y)||"text"](C,p);return!I&&A&&A(),await new Promise((u,g)=>{Wt(u,g,{data:N,headers:ae.from(C.headers),status:C.status,statusText:C.statusText,config:p,request:k})})}catch(L){throw A&&A(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new R("Network Error",R.ERR_NETWORK,p,k,L&&L.response),{cause:L.cause||L}):R.from(L,L&&L.code,p,k,L&&L.response)}}},Is=new Map,tn=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:r}=t,i=[s,r,n];let o=i.length,a=o,f,d,l=Is;for(;a--;)f=i[a],d=l.get(f),d===void 0&&l.set(f,d=a?new Map:Hs(t)),l=d;return d};tn();const st={http:is,xhr:ks,fetch:{get:tn}};c.forEach(st,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Dt=e=>`- ${e}`,$s=e=>c.isFunction(e)||e===null||e===!1;function Gs(e,t){e=c.isArray(e)?e:[e];const{length:n}=e;let s,r;const i={};for(let o=0;o<n;o++){s=e[o];let a;if(r=s,!$s(s)&&(r=st[(a=String(s)).toLowerCase()],r===void 0))throw new R(`Unknown adapter '${a}'`);if(r&&(c.isFunction(r)||(r=r.get(t))))break;i[a||"#"+o]=r}if(!r){const o=Object.entries(i).map(([f,d])=>`adapter ${f} `+(d===!1?"is not supported by the environment":"is not available in the build"));let a=n?o.length>1?`since :
9
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(r=>s.set(r)),s}static accessor(t){const s=(this[ht]=this[ht]={accessors:{}}).accessors,r=this.prototype;function i(o){const a=Se(o);s[a]||(As(r,o),s[a]=!0)}return c.isArray(t)?t.forEach(i):i(t),this}};ae.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(ae.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[n]=s}}});c.freezeMethods(ae);function $e(e,t){const n=this||Ne,s=t||n,r=ae.from(s.headers);let i=s.data;return c.forEach(e,function(a){i=a.call(n,i,r.normalize(),t?t.status:void 0)}),r.normalize(),i}function Zt(e){return!!(e&&e.__CANCEL__)}let ve=class extends R{constructor(t,n,s){super(t??"canceled",R.ERR_CANCELED,n,s),this.name="CanceledError",this.__CANCEL__=!0}};function Wt(e,t,n){const s=n.config.validateStatus;!n.status||!s||s(n.status)?e(n):t(new R("Request failed with status code "+n.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Us(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Ts(e,t){e=e||10;const n=new Array(e),s=new Array(e);let r=0,i=0,o;return t=t!==void 0?t:1e3,function(f){const d=Date.now(),l=s[i];o||(o=d),n[r]=f,s[r]=d;let _=i,b=0;for(;_!==r;)b+=n[_++],_=_%e;if(r=(r+1)%e,r===i&&(i=(i+1)%e),d-o<t)return;const S=l&&d-l;return S?Math.round(b*1e3/S):void 0}}function Ns(e,t){let n=0,s=1e3/t,r,i;const o=(d,l=Date.now())=>{n=l,r=null,i&&(clearTimeout(i),i=null),e(...d)};return[(...d)=>{const l=Date.now(),_=l-n;_>=s?o(d,l):(r=d,i||(i=setTimeout(()=>{i=null,o(r)},s-_)))},()=>r&&o(r)]}const Fe=(e,t,n=3)=>{let s=0;const r=Ts(50,250);return Ns(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,f=o-s,d=r(f),l=o<=a;s=o;const _={loaded:o,total:a,progress:a?o/a:void 0,bytes:f,rate:d||void 0,estimated:d&&a&&l?(a-o)/d:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(_)},n)},wt=(e,t)=>{const n=e!=null;return[s=>t[0]({lengthComputable:n,total:e,loaded:s}),t[1]]},yt=e=>(...t)=>c.asap(()=>e(...t)),vs=ne.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,ne.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(ne.origin),ne.navigator&&/(msie|trident)/i.test(ne.navigator.userAgent)):()=>!0,xs=ne.hasStandardBrowserEnv?{write(e,t,n,s,r,i,o){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];c.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),c.isString(s)&&a.push(`path=${s}`),c.isString(r)&&a.push(`domain=${r}`),i===!0&&a.push("secure"),c.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Ls(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Ps(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Qt(e,t,n){let s=!Ls(t);return e&&(s||n==!1)?Ps(e,t):t}const gt=e=>e instanceof ae?{...e}:e;function ye(e,t){t=t||{};const n={};function s(d,l,_,b){return c.isPlainObject(d)&&c.isPlainObject(l)?c.merge.call({caseless:b},d,l):c.isPlainObject(l)?c.merge({},l):c.isArray(l)?l.slice():l}function r(d,l,_,b){if(c.isUndefined(l)){if(!c.isUndefined(d))return s(void 0,d,_,b)}else return s(d,l,_,b)}function i(d,l){if(!c.isUndefined(l))return s(void 0,l)}function o(d,l){if(c.isUndefined(l)){if(!c.isUndefined(d))return s(void 0,d)}else return s(void 0,l)}function a(d,l,_){if(_ in t)return s(d,l);if(_ in e)return s(void 0,d)}const f={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(d,l,_)=>r(gt(d),gt(l),_,!0)};return c.forEach(Object.keys({...e,...t}),function(l){if(l==="__proto__"||l==="constructor"||l==="prototype")return;const _=c.hasOwnProp(f,l)?f[l]:r,b=_(e[l],t[l],l);c.isUndefined(b)&&_!==a||(n[l]=b)}),n}const en=e=>{const t=ye({},e);let{data:n,withXSRFToken:s,xsrfHeaderName:r,xsrfCookieName:i,headers:o,auth:a}=t;if(t.headers=o=ae.from(o),t.url=Kt(Qt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(n)){if(ne.hasStandardBrowserEnv||ne.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(c.isFunction(n.getHeaders)){const f=n.getHeaders(),d=["content-type","content-length"];Object.entries(f).forEach(([l,_])=>{d.includes(l.toLowerCase())&&o.set(l,_)})}}if(ne.hasStandardBrowserEnv&&(s&&c.isFunction(s)&&(s=s(t)),s||s!==!1&&vs(t.url))){const f=r&&i&&xs.read(i);f&&o.set(r,f)}return t},Os=typeof XMLHttpRequest<"u",ks=Os&&function(e){return new Promise(function(n,s){const r=en(e);let i=r.data;const o=ae.from(r.headers).normalize();let{responseType:a,onUploadProgress:f,onDownloadProgress:d}=r,l,_,b,S,p;function w(){S&&S(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener("abort",l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function D(){if(!h)return;const x=ae.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),X={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:x,config:e,request:h};Wt(function(Y){n(Y),w()},function(Y){s(Y),w()},X),h=null}"onloadend"in h?h.onloadend=D:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(D)},h.onabort=function(){h&&(s(new R("Request aborted",R.ECONNABORTED,e,h)),h=null)},h.onerror=function(P){const X=P&&P.message?P.message:"Network Error",F=new R(X,R.ERR_NETWORK,e,h);F.event=P||null,s(F),h=null},h.ontimeout=function(){let P=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const X=r.transitional||tt;r.timeoutErrorMessage&&(P=r.timeoutErrorMessage),s(new R(P,X.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,e,h)),h=null},i===void 0&&o.setContentType(null),"setRequestHeader"in h&&c.forEach(o.toJSON(),function(P,X){h.setRequestHeader(X,P)}),c.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),a&&a!=="json"&&(h.responseType=r.responseType),d&&([b,p]=Fe(d,!0),h.addEventListener("progress",b)),f&&h.upload&&([_,S]=Fe(f),h.upload.addEventListener("progress",_),h.upload.addEventListener("loadend",S)),(r.cancelToken||r.signal)&&(l=x=>{h&&(s(!x||x.type?new ve(null,e,h):x),h.abort(),h=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener("abort",l)));const J=Us(r.url);if(J&&ne.protocols.indexOf(J)===-1){s(new R("Unsupported protocol "+J+":",R.ERR_BAD_REQUEST,e));return}h.send(i||null)})},Fs=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let s=new AbortController,r;const i=function(d){if(!r){r=!0,a();const l=d instanceof Error?d:this.reason;s.abort(l instanceof R?l:new ve(l instanceof Error?l.message:l))}};let o=t&&setTimeout(()=>{o=null,i(new R(`timeout of ${t}ms exceeded`,R.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:f}=s;return f.unsubscribe=()=>c.asap(a),f}},js=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let s=0,r;for(;s<n;)r=s+t,yield e.slice(s,r),s=r},Bs=async function*(e,t){for await(const n of Ms(e))yield*js(n,t)},Ms=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:s}=await t.read();if(n)break;yield s}}finally{await t.cancel()}},Ct=(e,t,n,s)=>{const r=Bs(e,t);let i=0,o,a=f=>{o||(o=!0,s&&s(f))};return new ReadableStream({async pull(f){try{const{done:d,value:l}=await r.next();if(d){a(),f.close();return}let _=l.byteLength;if(n){let b=i+=_;n(b)}f.enqueue(new Uint8Array(l))}catch(d){throw a(d),d}},cancel(f){return a(f),r.return()}},{highWaterMark:2})},bt=64*1024,{isFunction:Le}=c,Ys=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:Rt,TextEncoder:Et}=c.global,St=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Hs=e=>{e=c.merge.call({skipUndefined:!0},Ys,e);const{fetch:t,Request:n,Response:s}=e,r=t?Le(t):typeof fetch=="function",i=Le(n),o=Le(s);if(!r)return!1;const a=r&&Le(Rt),f=r&&(typeof Et=="function"?(p=>w=>p.encode(w))(new Et):async p=>new Uint8Array(await new n(p).arrayBuffer())),d=i&&a&&St(()=>{let p=!1;const w=new n(ne.origin,{body:new Rt,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!w}),l=o&&a&&St(()=>c.isReadableStream(new s("").body)),_={stream:l&&(p=>p.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!_[p]&&(_[p]=(w,h)=>{let D=w&&w[p];if(D)return D.call(w);throw new R(`Response type '${p}' is not supported`,R.ERR_NOT_SUPPORT,h)})});const b=async p=>{if(p==null)return 0;if(c.isBlob(p))return p.size;if(c.isSpecCompliantForm(p))return(await new n(ne.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(c.isArrayBufferView(p)||c.isArrayBuffer(p))return p.byteLength;if(c.isURLSearchParams(p)&&(p=p+""),c.isString(p))return(await f(p)).byteLength},S=async(p,w)=>{const h=c.toFiniteNumber(p.getContentLength());return h??b(w)};return async p=>{let{url:w,method:h,data:D,signal:J,cancelToken:x,timeout:P,onDownloadProgress:X,onUploadProgress:F,responseType:Y,headers:se,withCredentials:Q="same-origin",fetchOptions:q}=en(p),K=t||fetch;Y=Y?(Y+"").toLowerCase():"text";let W=Fs([J,x&&x.toAbortSignal()],P),k=null;const A=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let j;try{if(F&&d&&h!=="get"&&h!=="head"&&(j=await S(se,D))!==0){let u=new n(w,{method:"POST",body:D,duplex:"half"}),g;if(c.isFormData(D)&&(g=u.headers.get("content-type"))&&se.setContentType(g),u.body){const[T,E]=wt(j,Fe(yt(F)));D=Ct(u.body,bt,T,E)}}c.isString(Q)||(Q=Q?"include":"omit");const L=i&&"credentials"in n.prototype,re={...q,signal:W,method:h.toUpperCase(),headers:se.normalize().toJSON(),body:D,duplex:"half",credentials:L?Q:void 0};k=i&&new n(w,re);let C=await(i?K(k,q):K(w,re));const I=l&&(Y==="stream"||Y==="response");if(l&&(X||I&&A)){const u={};["status","statusText","headers"].forEach(B=>{u[B]=C[B]});const g=c.toFiniteNumber(C.headers.get("content-length")),[T,E]=X&&wt(g,Fe(yt(X),!0))||[];C=new s(Ct(C.body,bt,T,()=>{E&&E(),A&&A()}),u)}Y=Y||"text";let v=await _[c.findKey(_,Y)||"text"](C,p);return!I&&A&&A(),await new Promise((u,g)=>{Wt(u,g,{data:v,headers:ae.from(C.headers),status:C.status,statusText:C.statusText,config:p,request:k})})}catch(L){throw A&&A(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new R("Network Error",R.ERR_NETWORK,p,k,L&&L.response),{cause:L.cause||L}):R.from(L,L&&L.code,p,k,L&&L.response)}}},Is=new Map,tn=e=>{let t=e&&e.env||{};const{fetch:n,Request:s,Response:r}=t,i=[s,r,n];let o=i.length,a=o,f,d,l=Is;for(;a--;)f=i[a],d=l.get(f),d===void 0&&l.set(f,d=a?new Map:Hs(t)),l=d;return d};tn();const st={http:is,xhr:ks,fetch:{get:tn}};c.forEach(st,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Dt=e=>`- ${e}`,$s=e=>c.isFunction(e)||e===null||e===!1;function Gs(e,t){e=c.isArray(e)?e:[e];const{length:n}=e;let s,r;const i={};for(let o=0;o<n;o++){s=e[o];let a;if(r=s,!$s(s)&&(r=st[(a=String(s)).toLowerCase()],r===void 0))throw new R(`Unknown adapter '${a}'`);if(r&&(c.isFunction(r)||(r=r.get(t))))break;i[a||"#"+o]=r}if(!r){const o=Object.entries(i).map(([f,d])=>`adapter ${f} `+(d===!1?"is not supported by the environment":"is not available in the build"));let a=n?o.length>1?`since :
10
10
  `+o.map(Dt).join(`
11
11
  `):" "+Dt(o[0]):"as no adapter specified";throw new R("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r}const nn={getAdapter:Gs,adapters:st};function Ge(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ve(null,e)}function At(e){return Ge(e),e.headers=ae.from(e.headers),e.data=$e.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),nn.getAdapter(e.adapter||Ne.adapter,e)(e).then(function(s){return Ge(e),s.data=$e.call(e,e.transformResponse,s),s.headers=ae.from(s.headers),s},function(s){return Zt(s)||(Ge(e),s&&s.response&&(s.response.data=$e.call(e,e.transformResponse,s.response),s.response.headers=ae.from(s.response.headers))),Promise.reject(s)})}const sn="1.13.5",He={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{He[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Ut={};He.transitional=function(t,n,s){function r(i,o){return"[Axios v"+sn+"] Transitional option '"+i+"'"+o+(s?". "+s:"")}return(i,o,a)=>{if(t===!1)throw new R(r(o," has been removed"+(n?" in "+n:"")),R.ERR_DEPRECATED);return n&&!Ut[o]&&(Ut[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,a):!0}};He.spelling=function(t){return(n,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function Js(e,t,n){if(typeof e!="object")throw new R("options must be an object",R.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let r=s.length;for(;r-- >0;){const i=s[r],o=t[i];if(o){const a=e[i],f=a===void 0||o(a,i,e);if(f!==!0)throw new R("option "+i+" must be "+f,R.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new R("Unknown option "+i,R.ERR_BAD_OPTION)}}const ke={assertOptions:Js,validators:He},ue=ke.validators;let he=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _t,response:new _t}}async request(t,n){try{return await this._request(t,n)}catch(s){if(s instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const i=r.stack?r.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
12
- `+i):s.stack=i}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ye(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:i}=n;s!==void 0&&ke.assertOptions(s,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean),legacyInterceptorReqResOrdering:ue.transitional(ue.boolean)},!1),r!=null&&(c.isFunction(r)?n.paramsSerializer={serialize:r}:ke.assertOptions(r,{encode:ue.function,serialize:ue.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ke.assertOptions(n,{baseUrl:ue.spelling("baseURL"),withXsrfToken:ue.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&c.merge(i.common,i[n.method]);i&&c.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=ae.concat(o,i);const a=[];let f=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(n)===!1)return;f=f&&w.synchronous;const h=n.transitional||tt;h&&h.legacyInterceptorReqResOrdering?a.unshift(w.fulfilled,w.rejected):a.push(w.fulfilled,w.rejected)});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let l,_=0,b;if(!f){const p=[At.bind(this),void 0];for(p.unshift(...a),p.push(...d),b=p.length,l=Promise.resolve(n);_<b;)l=l.then(p[_++],p[_++]);return l}b=a.length;let S=n;for(;_<b;){const p=a[_++],w=a[_++];try{S=p(S)}catch(h){w.call(this,h);break}}try{l=At.call(this,S)}catch(p){return Promise.reject(p)}for(_=0,b=d.length;_<b;)l=l.then(d[_++],d[_++]);return l}getUri(t){t=ye(this.defaults,t);const n=Qt(t.baseURL,t.url,t.allowAbsoluteUrls);return Kt(n,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){he.prototype[t]=function(n,s){return this.request(ye(s||{},{method:t,url:n,data:(s||{}).data}))}});c.forEach(["post","put","patch"],function(t){function n(s){return function(i,o,a){return this.request(ye(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}he.prototype[t]=n(),he.prototype[t+"Form"]=n(!0)});let Xs=class rn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{s.subscribe(a),i=a}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},t(function(i,o,a){s.reason||(s.reason=new ve(i,o,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new rn(function(r){t=r}),cancel:t}}};function qs(e){return function(n){return e.apply(null,n)}}function Vs(e){return c.isObject(e)&&e.isAxiosError===!0}const Ve={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ve).forEach(([e,t])=>{Ve[t]=e});function on(e){const t=new he(e),n=Bt(he.prototype.request,t);return c.extend(n,he.prototype,t,{allOwnKeys:!0}),c.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return on(ye(e,r))},n}const H=on(Ne);H.Axios=he;H.CanceledError=ve;H.CancelToken=Xs;H.isCancel=Zt;H.VERSION=sn;H.toFormData=Ye;H.AxiosError=R;H.Cancel=H.CanceledError;H.all=function(t){return Promise.all(t)};H.spread=qs;H.isAxiosError=Vs;H.mergeConfig=ye;H.AxiosHeaders=ae;H.formToJSON=e=>zt(c.isHTMLForm(e)?new FormData(e):e);H.getAdapter=nn.getAdapter;H.HttpStatusCode=Ve;H.default=H;const{Axios:kr,AxiosError:Fr,CanceledError:jr,isCancel:Br,CancelToken:Mr,VERSION:Yr,all:Hr,Cancel:Ir,isAxiosError:$r,spread:Gr,toFormData:Jr,AxiosHeaders:Xr,HttpStatusCode:qr,formToJSON:Vr,getAdapter:Kr,mergeConfig:zr}=H,Tt=e=>{let t;const n=new Set,s=(d,l)=>{const _=typeof d=="function"?d(t):d;if(!Object.is(_,t)){const b=t;t=l??(typeof _!="object"||_===null)?_:Object.assign({},t,_),n.forEach(S=>S(t,b))}},r=()=>t,a={setState:s,getState:r,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(s,r,a);return a},Ks=(e=>e?Tt(e):Tt),zs=e=>e;function Zs(e,t=zs){const n=y.useSyncExternalStore(e.subscribe,y.useCallback(()=>t(e.getState()),[e,t]),y.useCallback(()=>t(e.getInitialState()),[e,t]));return y.useDebugValue(n),n}const Nt=e=>{const t=Ks(e),n=s=>Zs(t,s);return Object.assign(n,t),n},Ws=(e=>e?Nt(e):Nt),ge=Ws(e=>({newsSelectedCandles:null,newsPlayEndTimestamp:null,newsTargetCandle:null,gapCount:0,isReplayMode:!1,setNewsSelectedCandles:t=>e({newsSelectedCandles:t}),setNewsPlayEndTimestamp:t=>e({newsPlayEndTimestamp:t}),setNewsTargetCandle:t=>e({newsTargetCandle:t}),setGapCount:t=>e({gapCount:t}),setReplayMode:t=>e({isReplayMode:t})})),Qs={"1D":"D1",D:"D1",240:"H4",120:"H2",60:"H1",30:"M30",15:"M15",5:"M5",1:"M1"},Ke=e=>({1:60,5:300,15:900,30:1800,60:3600})[e]||3600,an=[10,15,20,25,30,35,40,45,50],cn=y.createContext(null),er=()=>{const e=y.useContext(cn);if(!e)throw new Error("useWidgetContext must be used inside WidgetProvider");return e},tr=({children:e,selectedTimeframe:t,setSelectedTimeframe:n,currentSymbol:s,setCurrentSymbol:r})=>m.jsx(cn.Provider,{value:{currentSymbol:s,setCurrentSymbol:r,selectedTimeframe:t,setSelectedTimeframe:n},children:e});const ln=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const nr=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const sr=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const vt=e=>{const t=sr(e);return t.charAt(0).toUpperCase()+t.slice(1)};var rr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ir=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const or=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:r="",children:i,iconNode:o,...a},f)=>y.createElement("svg",{ref:f,...rr,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:ln("lucide",r),...!i&&!ir(a)&&{"aria-hidden":"true"},...a},[...o.map(([d,l])=>y.createElement(d,l)),...Array.isArray(i)?i:[i]]));const rt=(e,t)=>{const n=y.forwardRef(({className:s,...r},i)=>y.createElement(or,{ref:i,iconNode:t,className:ln(`lucide-${nr(vt(e))}`,`lucide-${e}`,s),...r}));return n.displayName=vt(e),n};const ar=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cr=rt("chevron-down",ar);const lr=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],dr=rt("chevron-left",lr);const ur=[["path",{d:"M8.8 20v-4.1l1.9.2a2.3 2.3 0 0 0 2.164-2.1V8.3A5.37 5.37 0 0 0 2 8.25c0 2.8.656 3.054 1 4.55a5.77 5.77 0 0 1 .029 2.758L2 20",key:"11atix"}],["path",{d:"M19.8 17.8a7.5 7.5 0 0 0 .003-10.603",key:"yol142"}],["path",{d:"M17 15a3.5 3.5 0 0 0-.025-4.975",key:"ssbmkc"}]],pr=rt("speech",ur),ze=(e,t)=>{if(!e||e==="-"||e.trim()===""||!t||t==="-"||t.trim()==="")return"news-widget__orange";const n=e.trim().replace(/[kKmMbB%]/g,"").replace(/[^\d.-]/g,""),s=t.trim().replace(/[kKmMbB%]/g,"").replace(/[^\d.-]/g,""),r=parseFloat(n)||0,i=parseFloat(s)||0;return r>i?"news-widget__green":r===i?"news-widget__orange":"news-widget__red"},xt=e=>e.trim().replaceAll(" ","").replaceAll("_",""),fr=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}),dn=e=>{const t=fr.formatToParts(e),n=s=>t.find(r=>r.type===s)?.value??"";return`${n("year")} ${n("month")} ${n("day")}, ${n("hour")}:${n("minute")}`},mr=({currency:e,size:t=24})=>m.jsx("img",{src:`https://cdn.iccandle.ai/web-assets/${e}.svg`,className:"news-widget_news_card__currency_img",alt:e,width:t,height:t}),_r=({title:e,date:t,forecast:n,actual:s,currency:r})=>m.jsxs("div",{className:"news-widget_news_card__container",children:[m.jsxs("div",{className:"news-widget_news_card__header",children:[r&&m.jsx("div",{className:"news-widget_news_card__currency_icon",children:m.jsx(mr,{currency:r})}),m.jsxs("div",{className:"news-widget_news_card__meta",children:[m.jsx("div",{className:"news-widget_news_card__date",children:dn(new Date(t??0))}),m.jsx("div",{className:"news-widget_news_card__title",children:e})]})]}),m.jsxs("div",{className:"news-widget_news_card__info_row",children:[m.jsxs("div",{className:"news-widget_news_card__info_card",children:[m.jsx("div",{className:"news-widget_news_card__label",children:"Actual"}),m.jsx("div",{className:`news-widget_news_card__font_semibold ${ze(String(s),String(n))}`,children:s||"-"})]}),m.jsxs("div",{className:"news-widget_news_card__info_card",children:[m.jsx("div",{className:"news-widget_news_card__label",children:"Forecast"}),m.jsx("div",{className:"news-widget_news_card__font_semibold news-widget__orange",children:n||"-"})]})]})]});function hr(e){switch(e){case"post":return"news-widget__bg_green";case"early":return"news-widget__bg_gray";case"coming":return"news-widget__bg_orange"}}const wr=({eventData:e,showStatus:t=!0,showPreviousValues:n=!1,showSimilarEvents:s=!1,isSimilarEventsOpen:r=!1})=>m.jsxs("div",{className:"news-widget_event_details_card__container",children:[m.jsxs("div",{className:"news-widget_event_details_card__body",children:[m.jsxs("div",{className:"news-widget_event_details_card__left",children:[m.jsx("div",{className:"news-widget_event_details_card__header_row",children:m.jsxs("div",{className:"news-widget_event_details_card__header_inner",children:[m.jsxs("div",{className:"news-widget_event_details_card__timestamp_row",children:[m.jsxs("p",{className:"news-widget_event_details_card__timestamp",children:[e?.timestamp&&dn(new Date(e?.timestamp??0))," "]})," ",e?.status&&t&&m.jsxs("div",{className:"news-widget_event_details_card__status_container",children:[m.jsx("div",{className:`news-widget_event_details_card__status ${hr(e.status)}`}),e.status==="post"&&"Actual Released",e.status==="coming"&&"Predict Available",e.status==="early"&&"Predict Unavailable"]})," "]}),m.jsxs("div",{className:"news-widget_event_details_card__currency_row",children:[m.jsx("div",{className:"news-widget_event_details_card__currency_icon",children:m.jsx("img",{src:`https://cdn.iccandle.ai/web-assets/${e?.currency??"USD"}.svg`,className:"news-widget_event_details_card__currency_img",alt:e?.currency||"",width:36,height:36})}),m.jsxs("p",{className:"news-widget_event_details_card__event_name",children:[e?.event_name," ",e?.event_time&&` ${e?.event_time}`]}),e?.slug=="FOMC"&&m.jsx(pr,{stroke:"url(#gradient)",className:"news-widget_event_details_card__speech_icon"})]})]})}),e?.slug!="FOMC"&&m.jsxs("div",{className:"news-widget_event_details_card__values_row",children:[m.jsxs("div",{className:"news-widget_event_details_card__values_group",children:[m.jsxs("div",{className:"news-widget_event_details_card__info",children:[m.jsx("span",{className:"news-widget_event_details_card__label",children:"Actual:"}),m.jsx("span",{className:`news-widget_event_details_card__text_bold ${ze(e?.actual,e?.forecast)}`,children:e?.actual||"Soon"})]}),m.jsxs("div",{className:"news-widget_event_details_card__info",children:[m.jsx("span",{className:"news-widget_event_details_card__label",children:"Forecast:"}),m.jsx("span",{className:"news-widget_event_details_card__text_bold news-widget__orange",children:e?.forecast||"-"})]})]}),n&&m.jsxs("div",{className:"news-widget_event_details_card__values_group",children:[m.jsxs("div",{className:"news-widget_event_details_card__info",children:[m.jsx("span",{className:"news-widget_event_details_card__label",children:"Previous Actual:"}),m.jsx("span",{className:`news-widget_event_details_card__text_bold ${ze(e?.similar?.referenceEvent?.previous_actual,e?.similar?.referenceEvent?.previous_forecast)}`,children:e?.similar?.referenceEvent?.previous_actual||"-"})]}),m.jsxs("div",{className:"news-widget_event_details_card__info",children:[m.jsx("span",{className:"news-widget_event_details_card__label",children:"Previous Forecast:"}),m.jsx("span",{className:"news-widget_event_details_card__text_bold news-widget__orange",children:e?.similar?.referenceEvent?.previous_forecast||"-"})]})]})]}),e?.slug=="FOMC"&&m.jsxs("p",{className:"news-widget_event_details_card__fomc_source",children:["Source:"," ",m.jsx("a",{href:e?.resource??"#",target:"_blank",rel:"noopener noreferrer",className:"news-widget_event_details_card__fomc_link",children:"FOMC Report"})]})]}),m.jsx("div",{className:"news-widget_event_details_card__right",children:e?.description&&m.jsx("p",{className:"news-widget_event_details_card__description",children:e.description})})]}),s&&e?.similar?.referenceEvent?.previousEvents&&e?.similar?.referenceEvent?.previousEvents.length>0&&m.jsx("div",{className:`news-widget_event_details_card__collapsible ${r?"news-widget_event_details_card__collapsible--open":"news-widget_event_details_card__collapsible--closed"}`,children:r&&m.jsxs("div",{className:"news-widget_event_details_card__collapsible_inner",children:[e?.similar?.referenceEvent?.previousEvents.length>0&&m.jsxs("p",{className:"news-widget_event_details_card__text",children:["News Before This ",e?.event_name]}),e?.similar?.referenceEvent?.previousEvents.length>0&&m.jsx("div",{className:"news-widget_event_details_card__previous_events_list",children:e?.similar?.referenceEvent?.previousEvents?.map((i,o)=>m.jsx(_r,{title:i.event_name,date:new Date(i.timestamp),forecast:i.forecast,actual:i.actual,currency:e?.currency},o))})]})})]}),yr=({newsDetail:e,children:t,isCompared:n})=>{const[s,r]=y.useState(!1);return m.jsxs("div",{className:"news-widget_event_details__container news-widget_event_details__container_sm",children:[e&&m.jsxs("div",{style:{position:"relative"},children:[m.jsx(wr,{eventData:e.event,showPreviousValues:!n,showSimilarEvents:!0,isSimilarEventsOpen:s}),m.jsx("button",{type:"button",className:`news-widget__button news-widget_event_details__ghost_button ${s?"news-widget_event_details__ghost_button_open":""}`,onClick:()=>r(!s),children:m.jsx(cr,{className:"news-widget_event_details__icon"})})]}),m.jsx("div",{className:"news-widget_event_details__chart_wrapper",children:m.jsx("div",{className:"news-widget_event_details__chart",children:t})})]})},gr=[{name:"LTC_USD",type:"CFD",pipLocation:-1},{name:"HK33_HKD",type:"CFD",pipLocation:0},{name:"USD_JPY",type:"CURRENCY",pipLocation:-2},{name:"EUR_TRY",type:"CURRENCY",pipLocation:-4},{name:"BTCUSDT",type:"CRYPTO",pipLocation:0},{name:"ETHUSDT",type:"CRYPTO",pipLocation:0},{name:"XRPUSDT",type:"CRYPTO",pipLocation:-3},{name:"SOLUSDT",type:"CRYPTO",pipLocation:-1},{name:"AUD_NZD",type:"CURRENCY",pipLocation:-4},{name:"USD_THB",type:"CURRENCY",pipLocation:-2},{name:"GBP_CHF",type:"CURRENCY",pipLocation:-4},{name:"EUR_HUF",type:"CURRENCY",pipLocation:-2},{name:"EUR_ZAR",type:"CURRENCY",pipLocation:-4},{name:"NZD_JPY",type:"CURRENCY",pipLocation:-2},{name:"EUR_NZD",type:"CURRENCY",pipLocation:-4},{name:"USB02Y_USD",type:"CFD",pipLocation:-2},{name:"XAU_CAD",type:"METAL",pipLocation:-2},{name:"GBP_JPY",type:"CURRENCY",pipLocation:-2},{name:"USD_TRY",type:"CURRENCY",pipLocation:-4},{name:"EUR_NOK",type:"CURRENCY",pipLocation:-4},{name:"TRY_JPY",type:"CURRENCY",pipLocation:-2},{name:"USD_SGD",type:"CURRENCY",pipLocation:-4},{name:"EUR_SEK",type:"CURRENCY",pipLocation:-4},{name:"DE30_EUR",type:"CFD",pipLocation:0},{name:"AUD_CAD",type:"CURRENCY",pipLocation:-4},{name:"UK10YB_GBP",type:"CFD",pipLocation:-2},{name:"XPD_USD",type:"CFD",pipLocation:-2},{name:"UK100_GBP",type:"CFD",pipLocation:0},{name:"XAG_CHF",type:"METAL",pipLocation:-4},{name:"USD_CHF",type:"CURRENCY",pipLocation:-4},{name:"CHF_HKD",type:"CURRENCY",pipLocation:-4},{name:"EUR_HKD",type:"CURRENCY",pipLocation:-4},{name:"GBP_HKD",type:"CURRENCY",pipLocation:-4},{name:"XAU_NZD",type:"METAL",pipLocation:-2},{name:"GBP_NZD",type:"CURRENCY",pipLocation:-4},{name:"GBP_SGD",type:"CURRENCY",pipLocation:-4},{name:"USD_SEK",type:"CURRENCY",pipLocation:-4},{name:"EUR_SGD",type:"CURRENCY",pipLocation:-4},{name:"XAG_JPY",type:"METAL",pipLocation:0},{name:"USD_HKD",type:"CURRENCY",pipLocation:-4},{name:"XAG_HKD",type:"METAL",pipLocation:-4},{name:"XCU_USD",type:"CFD",pipLocation:-4},{name:"XAU_JPY",type:"METAL",pipLocation:1},{name:"EUR_PLN",type:"CURRENCY",pipLocation:-4},{name:"SUGAR_USD",type:"CFD",pipLocation:-4},{name:"HKD_JPY",type:"CURRENCY",pipLocation:-4},{name:"CHF_ZAR",type:"CURRENCY",pipLocation:-4},{name:"ZAR_JPY",type:"CURRENCY",pipLocation:-2},{name:"XAU_HKD",type:"METAL",pipLocation:-2},{name:"AUD_CHF",type:"CURRENCY",pipLocation:-4},{name:"EUR_CHF",type:"CURRENCY",pipLocation:-4},{name:"USD_MXN",type:"CURRENCY",pipLocation:-4},{name:"GBP_USD",type:"CURRENCY",pipLocation:-4},{name:"GBP_ZAR",type:"CURRENCY",pipLocation:-4},{name:"SGD_JPY",type:"CURRENCY",pipLocation:-2},{name:"BCH_USD",type:"CFD",pipLocation:-1},{name:"XAG_AUD",type:"METAL",pipLocation:-4},{name:"WTICO_USD",type:"CFD",pipLocation:-2},{name:"AUD_HKD",type:"CURRENCY",pipLocation:-4},{name:"AUD_SGD",type:"CURRENCY",pipLocation:-4},{name:"NZD_HKD",type:"CURRENCY",pipLocation:-4},{name:"EUR_JPY",type:"CURRENCY",pipLocation:-2},{name:"USD_NOK",type:"CURRENCY",pipLocation:-4},{name:"XAU_USD",type:"METAL",pipLocation:-1},{name:"DE10YB_EUR",type:"CFD",pipLocation:-2},{name:"USD_CZK",type:"CURRENCY",pipLocation:-4},{name:"XAU_CHF",type:"METAL",pipLocation:-2},{name:"USD_HUF",type:"CURRENCY",pipLocation:-2},{name:"WHEAT_USD",type:"CFD",pipLocation:-2},{name:"XAU_AUD",type:"METAL",pipLocation:-2},{name:"EUR_USD",type:"CURRENCY",pipLocation:-4},{name:"SG30_SGD",type:"CFD",pipLocation:-1},{name:"GBP_AUD",type:"CURRENCY",pipLocation:-4},{name:"USD_PLN",type:"CURRENCY",pipLocation:-4},{name:"NZD_CAD",type:"CURRENCY",pipLocation:-4},{name:"XAG_EUR",type:"METAL",pipLocation:-4},{name:"CORN_USD",type:"CFD",pipLocation:-2},{name:"XAG_SGD",type:"METAL",pipLocation:-4},{name:"CHINAH_HKD",type:"CFD",pipLocation:0},{name:"XAU_SGD",type:"METAL",pipLocation:-2},{name:"NZD_USD",type:"CURRENCY",pipLocation:-4},{name:"JP225Y_JPY",type:"CFD",pipLocation:0},{name:"XAG_NZD",type:"METAL",pipLocation:-4},{name:"EUR_CZK",type:"CURRENCY",pipLocation:-4},{name:"AU200_AUD",type:"CFD",pipLocation:0},{name:"SGD_CHF",type:"CURRENCY",pipLocation:-4},{name:"USD_DKK",type:"CURRENCY",pipLocation:-4},{name:"SPX500_USD",type:"CFD",pipLocation:0},{name:"NZD_SGD",type:"CURRENCY",pipLocation:-4},{name:"US30_USD",type:"CFD",pipLocation:0},{name:"NL25_EUR",type:"CFD",pipLocation:-2},{name:"JP225_USD",type:"CFD",pipLocation:0},{name:"USB30Y_USD",type:"CFD",pipLocation:-2},{name:"XAG_USD",type:"METAL",pipLocation:-4},{name:"GBP_PLN",type:"CURRENCY",pipLocation:-4},{name:"CN50_USD",type:"CFD",pipLocation:0},{name:"USB05Y_USD",type:"CFD",pipLocation:-2},{name:"AUD_USD",type:"CURRENCY",pipLocation:-4},{name:"USD_CNH",type:"CURRENCY",pipLocation:-4},{name:"EUR_GBP",type:"CURRENCY",pipLocation:-4},{name:"XAG_GBP",type:"METAL",pipLocation:-4},{name:"XAU_EUR",type:"METAL",pipLocation:-2},{name:"USD_CAD",type:"CURRENCY",pipLocation:-4},{name:"NAS100_USD",type:"CFD",pipLocation:0},{name:"EUR_CAD",type:"CURRENCY",pipLocation:-4},{name:"USB10Y_USD",type:"CFD",pipLocation:-2},{name:"EU50_EUR",type:"CFD",pipLocation:0},{name:"NATGAS_USD",type:"CFD",pipLocation:-2},{name:"CAD_JPY",type:"CURRENCY",pipLocation:-2},{name:"FR40_EUR",type:"CFD",pipLocation:0},{name:"XAU_XAG",type:"METAL",pipLocation:-2},{name:"CAD_SGD",type:"CURRENCY",pipLocation:-4},{name:"GBP_CAD",type:"CURRENCY",pipLocation:-4},{name:"USD_ZAR",type:"CURRENCY",pipLocation:-4},{name:"XAU_GBP",type:"METAL",pipLocation:-2},{name:"CH20_CHF",type:"CFD",pipLocation:0},{name:"CAD_HKD",type:"CURRENCY",pipLocation:-4},{name:"CHF_JPY",type:"CURRENCY",pipLocation:-2},{name:"NZD_CHF",type:"CURRENCY",pipLocation:-4},{name:"ESPIX_EUR",type:"CFD",pipLocation:0},{name:"XAG_CAD",type:"METAL",pipLocation:-4},{name:"XPT_USD",type:"CFD",pipLocation:-2},{name:"EUR_AUD",type:"CURRENCY",pipLocation:-4},{name:"CAD_CHF",type:"CURRENCY",pipLocation:-4},{name:"EUR_DKK",type:"CURRENCY",pipLocation:-4},{name:"SOYBN_USD",type:"CFD",pipLocation:-2},{name:"US2000_USD",type:"CFD",pipLocation:-2},{name:"BCO_USD",type:"CFD",pipLocation:-2},{name:"AUD_JPY",type:"CURRENCY",pipLocation:-2}];function Cr(e,t,n=1){if(t===0||!isFinite(t))return n;const s=e/t;return isFinite(s)?s:n}function Lt(e){if(e.length===0)return 0;const t=[...e].sort((s,r)=>s-r),n=Math.floor(t.length/2);return t.length%2!==0?t[n]:(t[n-1]+t[n])/2}function br(e,t,n=[]){if(e.length===0)return[];const s=n.map(l=>Math.abs(l.c-l.o)),r=e.map(l=>Math.abs(l.c-l.o)),i=Lt(r),o=Lt(s),a=Cr(o,i),f=e[0].o,d=t.c;return e.map(l=>{const _=(l.o-f)*a+d,b=(l.h-f)*a+d,S=(l.l-f)*a+d,p=(l.c-f)*a+d;return{o:_,h:Math.max(b,_,p),l:Math.min(S,_,p),c:p}})}const we=e=>e==="1"?60:e==="5"?300:e==="1D"?1440*3600:parseInt(e,10)*60,Ze=8,un=4,We=5,pn=e=>{const t=new Date(e+Ze*60*60*1e3),n=t.getUTCDay(),s=t.getUTCHours();return n===0?!1:n===1?s>=We:n===6?s<=un:!0},fn=e=>{const t=new Date(e+Ze*60*60*1e3),n=t.getUTCDay(),s=t.getUTCHours();if(n===0||n===1&&s<We||n===6&&s>=un){const r=(8-n)%7;return t.setUTCDate(t.getUTCDate()+r),t.setUTCHours(We,0,0,0),t.getTime()-Ze*60*60*1e3}return e},Rr=(e,t,n)=>{const s=we(t)*1e3,r=[];let i=e;for(let o=0;o<n;o++)i+=s,pn(i)||(i=fn(i)),r.push(i);return r},Pt=(e,t,n,s)=>{if(n<=0)return[];if(s==="24x7"){const i=we(t)*1e3;return Array.from({length:n},(o,a)=>e+(a+1)*i)}if(s==="1700-1700")return Rr(e,t,n);const r=we(t)*1e3;return Array.from({length:n},(i,o)=>e+(o+1)*r)},Er=(e,t,n,s)=>{if(s==="24x7"){const i=we(n)*1e3;return Math.max(0,Math.floor((t-e)/i))}if(s==="1700-1700"){const i=we(n)*1e3;let o=0,a=e;for(;a<t;)a+=i,pn(a)||(a=fn(a)),a<=t&&o++;return o}const r=we(n)*1e3;return Math.max(0,Math.floor((t-e)/r))},it=[{ticker:"EUR_JPY",display_name:"EURJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"EUR JPY",type:"forex",session:"1700-1700"},{ticker:"GBP_JPY",display_name:"GBPJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"GBP JPY",type:"forex",session:"1700-1700"},{ticker:"AUD_JPY",display_name:"AUDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/AUD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"AUD JPY",type:"forex",session:"1700-1700"},{ticker:"NZD_JPY",display_name:"NZDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"NZD JPY",type:"forex",session:"1700-1700"},{ticker:"CAD_JPY",display_name:"CADJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/CAD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"CAD JPY",type:"forex",session:"1700-1700"},{ticker:"CHF_JPY",display_name:"CHFJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/CHF.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"CHF JPY",type:"forex",session:"1700-1700"},{ticker:"USD_JPY",display_name:"USDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"USD JPY",type:"forex",session:"1700-1700"},{ticker:"EUR_USD",display_name:"EURUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"EUR USD",type:"forex",session:"1700-1700"},{ticker:"AUD_USD",display_name:"AUDUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/AUD.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"AUD USD",type:"forex",session:"1700-1700"},{ticker:"NZD_USD",display_name:"NZDUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"NZD USD",type:"forex",session:"1700-1700"},{ticker:"USD_CHF",display_name:"USDCHF",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/CHF.svg"],description:"USD CHF",type:"forex",session:"1700-1700"},{ticker:"USD_CAD",display_name:"USDCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"USD CAD",type:"forex",session:"1700-1700"},{ticker:"GBP_AUD",display_name:"GBPAUD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/AUD.svg"],description:"GBP AUD",type:"forex",session:"1700-1700"},{ticker:"GBP_CAD",display_name:"GBPCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"GBP CAD",type:"forex",session:"1700-1700"},{ticker:"GBP_CHF",display_name:"GBPCHF",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/CHF.svg"],description:"GBP CHF",type:"forex",session:"1700-1700"},{ticker:"GBP_NZD",display_name:"GBPNZD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/NZD.svg"],description:"GBP NZD",type:"forex",session:"1700-1700"},{ticker:"GBP_USD",display_name:"GBPUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"GBP USD",type:"forex",session:"1700-1700"},{ticker:"NZD_CAD",display_name:"NZDCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"NZD CAD",type:"forex",session:"1700-1700"},{ticker:"EUR_CAD",display_name:"EURCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"EUR CAD",type:"forex",session:"1700-1700"},{ticker:"EUR_AUD",display_name:"EURAUD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/AUD.svg"],description:"EUR AUD",type:"forex",session:"1700-1700"},{ticker:"XAU_USD",display_name:"XAUUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XAU.svg"],description:"Gold",type:"commodity",session:"1700-1700"},{ticker:"BCO_USD",display_name:"BCOUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/BCO.svg"],description:"Brent Crude Oil",type:"commodity",session:"1700-1700"},{ticker:"SPX500_USD",display_name:"S&P500",logo_urls:["https://cdn.iccandle.ai/web-assets/SPX500.svg"],description:"S&P 500",type:"indices",session:"1700-1700"},{ticker:"NAS100_USD",display_name:"NASDAQ100",logo_urls:["https://cdn.iccandle.ai/web-assets/NAS100.svg"],description:"NASDAQ 100",type:"indices",session:"1700-1700"},{ticker:"US30_USD",display_name:"US30",logo_urls:["https://cdn.iccandle.ai/web-assets/US30.svg"],description:"US Wall St 30",type:"indices",session:"1700-1700"},{ticker:"BTCUSDT",display_name:"BTCUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/BTC.svg"],description:"BTCUSDT",type:"crypto",session:"24x7"},{ticker:"ETHUSDT",display_name:"ETHUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/ETH.svg"],description:"ETHUSDT",type:"crypto",session:"24x7"},{ticker:"XRPUSDT",display_name:"XRPUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/XRP.svg"],description:"XRPUSDT",type:"crypto",session:"24x7"},{ticker:"SOLUSDT",display_name:"SOLUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/SOL.svg"],description:"SOLUSDT",type:"crypto",session:"24x7"},{ticker:"ADAUSDT",display_name:"ADAUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/ADA.svg"],description:"ADAUSDT",type:"crypto",session:"24x7"},{ticker:"AVAUSDT",display_name:"AVAUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/AVA.svg"],description:"AVAUSDT",type:"crypto",session:"24x7"},{ticker:"AVAXUSDT",display_name:"AVAXUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/AVAX.svg"],description:"AVAXUSDT",type:"crypto",session:"24x7"},{ticker:"BNBUSDT",display_name:"BNBUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/BNB.svg"],description:"BNBUSDT",type:"crypto",session:"24x7"},{ticker:"DOGEUSDT",display_name:"DOGEUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/DOGE.svg"],description:"DOGEUSDT",type:"crypto",session:"24x7"},{ticker:"DOTUSDT",display_name:"DOTUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/DOT.svg"],description:"DOTUSDT",type:"crypto",session:"24x7"},{ticker:"TRXUSDT",display_name:"TRXUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/TRX.svg"],description:"TRXUSDT",type:"crypto",session:"24x7"},{ticker:"AAPL",display_name:"AAPL",logo_urls:["https://cdn.iccandle.ai/web-assets/AAPL.svg"],description:"Apple Inc.",type:"stock",session:"24x7"},{ticker:"AMZN",display_name:"AMZN",logo_urls:["https://cdn.iccandle.ai/web-assets/AMZN.svg"],description:"Amazon.Com Inc",type:"stock",session:"24x7"},{ticker:"BRK.B",display_name:"BRK.B",logo_urls:["https://cdn.iccandle.ai/web-assets/BRK.B.svg"],description:"BERKSHIRE HATHAWAY Class B",type:"stock",session:"24x7"},{ticker:"GOOGL",display_name:"GOOGL",logo_urls:["https://cdn.iccandle.ai/web-assets/GOOGL.svg"],description:"Alphabet Inc. Class A Common Stock",type:"stock",session:"24x7"},{ticker:"KO",display_name:"KO",logo_urls:["https://cdn.iccandle.ai/web-assets/KO.svg"],description:"Coca-Cola Company",type:"stock",session:"24x7"},{ticker:"META",display_name:"META",logo_urls:["https://cdn.iccandle.ai/web-assets/META.svg"],description:"Meta Platforms, Inc. Class A Common Stock",type:"stock",session:"24x7"},{ticker:"MSFT",display_name:"MSFT",logo_urls:["https://cdn.iccandle.ai/web-assets/MSFT.svg"],description:"Microsoft Corp",type:"stock",session:"24x7"},{ticker:"NFLX",display_name:"NFLX",logo_urls:["https://cdn.iccandle.ai/web-assets/NFLX.svg"],description:"NetFlix Inc",type:"stock",session:"24x7"},{ticker:"NKE",display_name:"NKE",logo_urls:["https://cdn.iccandle.ai/web-assets/NKE.svg"],description:"Nike, Inc.",type:"stock",session:"24x7"},{ticker:"NVDA",display_name:"NVDA",logo_urls:["https://cdn.iccandle.ai/web-assets/NVDA.svg"],description:"Nvidia Corp",type:"stock",session:"24x7"},{ticker:"TME",display_name:"TME",logo_urls:["https://cdn.iccandle.ai/web-assets/TME.svg"],description:"Tencent Music Entertainment Group American Depositary Shares, each representing two Class A Ordinary Shares",type:"stock",session:"24x7"},{ticker:"TSLA",display_name:"TSLA",logo_urls:["https://cdn.iccandle.ai/web-assets/TSLA.svg"],description:"Tesla, Inc. Common Stock",type:"stock",session:"24x7"},{ticker:"XAG_USD",display_name:"XAGUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XAG.svg"],description:"Silver",type:"commodity",session:"1700-1700"},{ticker:"XCU_USD",display_name:"XCUUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XCU.svg"],description:"Copper",type:"commodity",session:"1700-1700"}],Sr=({replayTabId:e,futureBarsRef:t,highlightBarsRef:n,tvWidgetRef:s,pushBar:r,resolution:i,symbol:o,resolvedTheme:a})=>{const f=ge(p=>p.newsSelectedCandles),d=ge(p=>p.newsTargetCandle),l=ge(p=>p.newsPlayEndTimestamp),_=ge(p=>p.gapCount),b=y.useRef(f),S=y.useRef(null);return y.useEffect(()=>{const p={current:null};let w=null,h=!1;return(async()=>{if(!h){if(f?.length&&d!==null){if(S.current===f)return;t.current=[];const D=l!=null;if(b.current||D)try{s?.current?.resetCache(),s?.current?.activeChart().resetData()}catch{}try{s?.current?.activeChart().executeActionById("timeScaleReset")}catch{}const x=[...f].slice(-50-(_||0)),P=br(x,d[d.length-1],d),F=it.find(A=>A.ticker===o||A.display_name===o)?.session||"24x7",Y=Pt(d[d.length-1].timestamp,i,_||0,F),se=Pt(_?Y[Y.length-1]:d[d.length-1].timestamp,i,P.length,F),q=P.map((A,j)=>({open:A.o,high:A.h,low:A.l,close:A.c,time:se[j]})).sort((A,j)=>A.time-j.time);n.current=q.slice(-50);let V=0,W=0;const k=async()=>{p.current&&(clearInterval(p.current),p.current=null),S.current=f;try{f&&q.length>0}catch(A){console.error("Error setting visible range:",A)}};q.length===0?(t.current=[],await k()):w=setTimeout(()=>{h||(p.current=setInterval(()=>{if(V<q.length){if(r(e,q[V]))t.current=q.slice(0,V+1),V++,W=0,V===q.length&&(t.current=q,k());else if(W++,W>=10){t.current=[...q];try{s?.current?.activeChart().resetData()}catch{}k()}}},150))},700)}else{if(t.current=[],b.current)try{s?.current?.resetCache(),s?.current?.activeChart().resetData()}catch{}S.current=null}b.current=f}})(),()=>{h=!0,w&&clearTimeout(w),p.current&&(t.current=[],clearInterval(p.current))}},[r,t,n,l,f,d,e,i,o,s,_]),y.useEffect(()=>{f===null&&(n.current=[])},[n,f]),m.jsx(m.Fragment,{children:_>900&&m.jsx("div",{className:"bg-backdrop absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 p-4",children:m.jsxs("div",{className:"flex items-center justify-center gap-2",children:[m.jsx("img",{src:`/images/error-${a==="dark"?"black":"white"}.png`,alt:"alert",width:44,height:44}),m.jsxs("p",{className:"text-theme text-center text-sm font-semibold",children:["Candle data too far from event.",m.jsx("br",{})," Please try another timeframe."]})]})})})},Dr=({children:e,eventId:t,widgetKey:n,chartWidget:s,event:r,theme:i,newsDetail:o,selectedCandles:a,defaultSymbol:f,currentSymbol:d,currentTimeFrame:l,isUpcoming:_=!1,isElapsed:b=!1,onBack:S,pushBar:p,iframeRef:w,futureRef:h,pendingMessageRef:D,iframeReadyToListenRef:J,highlightBarsRef:x,setGapCountExternal:P,setReplayModeExternal:X})=>{const F=y.useRef(null),{setCurrentSymbol:Y,setSelectedTimeframe:se}=er(),{setNewsTargetCandle:Q,setGapCount:q,setNewsPlayEndTimestamp:V,setNewsSelectedCandles:W}=ge();return y.useEffect(()=>{if(!t||t==""||!s)return;const k=()=>{if(s)try{const C=s?.activeChart();C&&C.getAllShapes().forEach(I=>{try{C.removeEntity(I.id)}catch(N){console.error("Failed to remove shape",N)}})}catch{}},A=async()=>{const{data:C,status:I}=await H.get(`https://corprate-widget.iccandle.ai/news/${t}`,{headers:{"api-key":n},params:{symbol:f}});if(I!==200){console.error("Failed to fetch news detail");return}return C};let j=!1;const L=[],re=(C,I)=>{const N=window.setTimeout(C,I);return L.push(N),N};return F.current=s,s.onChartReady(async()=>{i==="dark"||i==="system"?(s.applyOverrides({"paneProperties.background":"#000000","scalesProperties.textColor":"#fff"}),s.setCSSCustomProperty("--tv-color-pane-background","#000000"),s.setCSSCustomProperty("--tv-color-platform-background","#0f0f0f")):(s.applyOverrides({"paneProperties.background":"#ffffff","scalesProperties.textColor":"#000"}),s.setCSSCustomProperty("--tv-color-pane-background","#ffffff"),s.setCSSCustomProperty("--tv-color-platform-background","#f9fafb"));const C=s.activeChart();if(!C)return;const I=async(E,B)=>{await C.createShape({time:B},{shape:"vertical_line",lock:!0,disableSelection:!0,overrides:{linestyle:2,linewidth:1}});const $=await C.exportData(),T=$.data.findIndex(v=>v[0]===B);let M=a;if(T!=-1&&!M&&(M=[...an].sort((v,K)=>K-v).find(v=>$.data[T+v])??null),T!=-1&&M){const v=E,K=$.data[T+M][0],G=$.data.filter(ce=>ce[0]>v&&ce[0]<=K)??[];let ie=null,pe=null;if(G.length>0){const ce=G.reduce((z,ee,le,O)=>Number(ee[3])<Number(O[z][3])?le:z,0),de=G[ce];pe={time:de[0],value:Number(de[3])}}if(G.length>0){const ce=G.reduce((z,ee,le,O)=>Number(ee[2])>Number(O[z][2])?le:z,0),de=G[ce];ie={time:de[0],value:Number(de[2])}}if(ie&&pe&&G.length>0){const ce=ie.value,de=pe.value,ee=$.data[T+1][1];await C.createMultipointShape([{time:v,price:ee},{time:K,price:ce}],{shape:"rectangle",overrides:{showLabel:!1,linecolor:"#12B76A",linewidth:1,linestyle:0,color:"#12B76A10",borderColor:"#12B76A",borderWidth:1,backgroundColor:"#12B76A",transparency:70,drawBorder:!1,frozen:!0}}),await C.createMultipointShape([{time:v,price:de},{time:K,price:ee}],{shape:"rectangle",overrides:{showLabel:!1,linecolor:"#D92D2030",linewidth:1,linestyle:0,color:"#D92D2010",borderWidth:1,backgroundColor:"#D92D20",transparency:70,drawBorder:!1,frozen:!0}}),await C.createMultipointShape([{time:v,price:ce},{time:K,price:ce}],{shape:"trend_line",overrides:{linecolor:"#12B76A",linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0}}),await C.createMultipointShape([{time:v,price:de},{time:K,price:de}],{shape:"trend_line",overrides:{linecolor:"#D92D20",linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0}});const le=gr.find(me=>xt(me.name)==xt(d))?.pipLocation;let O="",Z="";if(le){const me=Math.pow(10,-le),ot=parseFloat(Math.abs((ce-ee)*me).toFixed(1)),at=parseFloat(Math.abs((de-ee)*me).toFixed(1));O=`${ot>=0?"+":""}${ot.toFixed(2)} pip`,Z=`${at>=0?"-":""}${at.toFixed(2)} pip`}await C.createShape({time:ie.time,price:ie.value},{shape:"arrow_down",overrides:{arrowColor:"#12B76A",fontsize:11,color:"#12B76A",text:O,bold:!0}}),await C.createShape({time:pe.time,price:pe.value},{shape:"arrow_up",overrides:{arrowColor:"#D92D20",fontsize:11,color:"#D92D20",text:Z,bold:!0}});const te=Math.floor((v+K)/2);await C.createShape({time:te},{shape:"text",text:`${M} candles`,zOrder:"top",overrides:{fontsize:12,color:"#FFFFFF",bold:!0,backgroundColor:"#FFFFFF"}})}}if($&&$.data.length>0&&$.data[0][0]>=$.data[$.data.length-1][0]&&await C.setVisibleRange({from:$.data[0][0],to:$.data[$.data.length-1][0]}),_&&r){const v=Math.floor(Date.now()/1e3),K=B,G=C.resolution(),ie=3600*24*7;v-ie>=K+ie&&await C.setVisibleRange({from:v-ie,to:K+ie},{applyDefaultRightMargin:!0,percentRightMargin:50}),re(()=>{j||F.current!==s||Number(G)<=30&&C.createShape({time:K},{shape:"vertical_line",lock:!0,disableSelection:!0,overrides:{linestyle:2,linewidth:1}})},2e3)}},N=async()=>{if(j||F.current!==s)return;const E=await A();if(j||F.current!==s)return;k();const B=(E?.event?.timestamp??0)/1e3,$=Ke(l),T=B-B%$;C.getVisibleBarsRange()||await new Promise(K=>setTimeout(K,2e3));const v=C.getVisibleBarsRange();v&&v.from<=B&&B<=v.to?await I(B,T):(_||await C.setVisibleRange({from:B},{applyDefaultRightMargin:!0,percentRightMargin:50}),await I(B,T))},u=()=>{re(()=>{j||F.current!==s||d==C.symbol()||(async()=>{try{P(0),X(!1),W(null),w.current?.contentWindow?.postMessage({action:"handleClose"},"*"),Y(C.symbol())}catch(E){console.log("error=>",E)}})()},300)},g=E=>{re(()=>{j||F.current!==s||l==E||(async()=>{try{P(0),X(!1),W(null),w.current?.contentWindow?.postMessage({action:"handleClose"},"*"),se(E)}catch(B){console.log("error=>",B)}})()},300)};C.onSymbolChanged().subscribe(null,u),C.onIntervalChanged().subscribe(null,g);try{b||await N()}catch(E){console.log("error=>",E)}j&&(()=>{try{C.onSymbolChanged().unsubscribe(null,u)}catch{}try{C.onIntervalChanged().unsubscribe(null,g)}catch{}})()}),()=>{j=!0,L.forEach(C=>window.clearTimeout(C)),k(),F.current===s&&(F.current=null)}},[i,n,s,_,f,a,r,t,l,se,d,Y,b,V,W,q,Q,P,X,w]),y.useEffect(()=>{if(s){if(t==""||b)return;s.onChartReady(async()=>{const k=s?.activeChart();se(k.resolution()),s.resetCache(),k.resetData(),k&&k.onDataLoaded().subscribe(null,async()=>{const{data:A}=await k.exportData(),j=Ke(l),L=(r?.timestamp??0)/1e3,re=L-L%j,C=A.findIndex(N=>N[0]===re),I=A.slice(C-49,C+1).map(N=>({o:N[1],h:N[2],l:N[3],c:N[4],timestamp:N[0]*1e3}));if(_){const N=A[A.length-1],u={o:N[1],h:N[2],l:N[3],c:N[4],timestamp:N[0]*1e3},g=k.resolution(),U=we(g)*1e3,E=u.timestamp,B=r?.timestamp??0,$=Math.floor(B/U)*U,T=it.find(G=>G.ticker===d||G.display_name===d)?.session||"24x7",M=Er(E,$,g,T),v=A.slice(-50).map(G=>({o:G[1],h:G[2],l:G[3],c:G[4],timestamp:G[0]*1e3}));q(M),Q(v);const K={newsTargetCandle:v,gapCount:M};D.current=K,J.current&&(w.current?.contentWindow?.postMessage(D.current,"*"),D.current=null)}else{Q(I),q(0);const N={newsTargetCandle:I,gapCount:0};D.current=N,J.current&&(w.current?.contentWindow?.postMessage(D.current,"*"),D.current=null)}},!0)})}},[t,r?.timestamp,Q,se,q,l,_,b,d,s,D]),m.jsx("div",{className:"news-widget_detail_page__container",children:m.jsxs("div",{className:"news-widget_detail_page__right_border",children:[m.jsx("div",{className:"news-widget_detail_page__title_container",children:m.jsxs("div",{className:"news-widget_detail_page__title_padding",children:[m.jsx("button",{type:"button",className:"news-widget__button news-widget__button--ghost news-widget__button--icon news-widget_detail_page__back_button",onClick:S,children:m.jsx(dr,{className:"news-widget_detail_page__back_icon"})}),m.jsx("p",{className:"news-widget_detail_page__title_text",children:"Economic Calendar Analysis"})]})}),m.jsx("div",{className:"news-widget_detail_page__event_details",children:m.jsxs(yr,{newsDetail:o,children:[e,_&&m.jsx(Sr,{replayTabId:t||"news",futureBarsRef:h,highlightBarsRef:x,pushBar:p,tvWidgetRef:F,resolution:l||"15",symbol:d,resolvedTheme:i})]})})]})})},De="https://widget-result-news.iccandle.ai",Ot="https://corprate-widget.iccandle.ai/news",Ar=({chartWidget:e,children:t,widgetKey:n,userId:s,defaultSymbol:r,chartInterval:i="15",theme:o,symbolMapper:a,analyzeCallback:f,pushBar:d,futureRef:l,highlightBarsRef:_,setGapCountExternal:b,setReplayModeExternal:S})=>{const{start:p}=wn(),[w,h]=y.useState(""),[D,J]=y.useState(i),[x,P]=y.useState(r),[X,F]=y.useState(i),[Y,se]=y.useState(r),[Q,q]=y.useState(null),[V,W]=y.useState(null),k=y.useRef(null),A=y.useRef(!1),{setNewsSelectedCandles:j,setNewsPlayEndTimestamp:L,newsTargetCandle:re,gapCount:C}=ge(),I=y.useRef(null),N=Qs[D]||"M15",u=Ke("60"),g=V?.[0]?.timestamp?V?.[0]?.timestamp/1e3:0,U=g-g%u,E=V?.[0]?.candleData.H1?.candles,B=E?.findIndex(z=>z.timestamp===U)||0,T=(E?.length||0)-B<=10,M="next_pip_up_10"in(V?.[0]?.candleData[N]?.metadata??{}),v=!!w&&!M,K=y.useRef(v),G=y.useRef(!1);y.useEffect(()=>{if(v!==K.current){if(K.current=v,G.current){G.current=!1;return}p()}},[v,p]),y.useEffect(()=>{const z=async O=>{const{data:Z,status:te}=await H.get(`${Ot}/${O}`,{headers:{"api-key":n},params:{symbol:r}});return te!==200?(console.error("Failed to fetch news detail"),null):Z},ee=async O=>{const{data:Z,status:te}=await H.get(`${Ot}/similar-details`,{headers:{"api-key":n},params:{event_id:O}});return te!==200?(console.error("Failed to fetch compared news"),null):Z};(async()=>{if(w==="")return;const[O,Z]=await Promise.all([z(w),ee(w)]);O&&q(O),Z&&W(Z)})()},[n,w,r]);const ie=y.useCallback(()=>{S(!1),b(0),j(null),L(null)},[S,b,j,L]),pe=y.useCallback(()=>{h(""),P(r),ie()},[r,ie]);y.useEffect(()=>{const z=async({origin:ee,data:le})=>{if(ee!==De||typeof le!="string")return;const O=JSON.parse(le);if(O.action=="back")pe();else if(O.action=="back-to-similar-events")ie();else if(O.action=="eventClicked"){G.current=!0,p();const te=O.data.event,me=e?.activeChart();await e?.headerReady(),me?.clearMarks(2),localStorage.setItem("iccandle:current-news-event",JSON.stringify({actual:te.actual,event_name:te.event_name,forecast:te.forecast,id:te.id,metric:te.metric,previous:te.previous,timestamp:te.timestamp,currency:te.currency})),me?.refreshMarks(),F(D),se(x),h(te.id)}else if(O.action=="intervalChanged"||O.action=="symbolChanged"){const Z=O.data;if(Z.type===2)return;Z.resolution&&J(Z.resolution);const te=it.find(me=>me.display_name==Z.symbol||me.ticker==Z.symbol)?.ticker||"XAU_USD";P(te)}else if(O.action=="replay"){if(M)return;const Z=O.data;S(Z.isReplay),b(C),j(Z.selectedCandles),L(re?.[re.length-1]?.timestamp??null)}else O.action=="iframe-ready"?(A.current=!0,k.current?.contentWindow?.postMessage(I.current,"*"),I.current=null):O.action=="analyze"&&f()};return window.addEventListener("message",z),()=>window.removeEventListener("message",z)},[M,re,C,e,r,p,ie,pe,a,I,F,se,x,D,S,b,L,j,f]);const ce=y.useMemo(()=>{const z=V?.[0]?.candleData?.[N]?.metadata;return z?[...an].sort((ee,le)=>le-ee).find(ee=>[`next_pip_up_${ee}`,`next_pip_down_${ee}`].some(O=>z[O]!==void 0))??null:null},[V,N]);y.useEffect(()=>{const z=()=>{pe()};return window.addEventListener("popstate",z),()=>window.removeEventListener("popstate",z)},[pe]);const de=y.useMemo(()=>w?V?M?`${De}/${w}?apiKey=${n}&userId=${s}&theme=${o}&interval=${X}&symbol=${Y}`:`${De}/similar-events/${w}?apiKey=${n}&userId=${s}&theme=${o}`:`${De}?apiKey=${n}&userId=${s}&theme=${o}`:`${De}?apiKey=${n}&userId=${s}&theme=${o}`,[w,V,M,n,o,s,X,Y]);return m.jsxs("div",{className:"news-widget_main__container news-widget_main__container--lg",children:[m.jsx("div",{className:"news-widget_main__left",style:{display:w&&!M?"flex":"none"},children:m.jsx(tr,{selectedTimeframe:D,setSelectedTimeframe:J,currentSymbol:x,setCurrentSymbol:P,children:m.jsx(Dr,{eventId:w,chartWidget:e,widgetKey:n,theme:o,defaultSymbol:r,newsDetail:Q,isUpcoming:T,event:Q?.event,selectedCandles:ce,currentTimeFrame:D,currentSymbol:x,onBack:pe,isElapsed:M,iframeRef:k,pendingMessageRef:I,iframeReadyToListenRef:A,pushBar:d,futureRef:l,highlightBarsRef:_,setReplayModeExternal:S,setGapCountExternal:b,children:t})})}),m.jsx("iframe",{src:de,ref:k,className:w&&!M?"news-widget_main__iframe_half":"news-widget_main__iframe_full"})]})},Ur="https://api.iccandle.ai",Tr='"Inter Tight", ui-sans-serif, system-ui, sans-serif';function kt(e){return{iccandle_primary:e.iccandle_primary,iccandle_border:e.iccandle_border,iccandle_text:e.iccandle_text,iccandle_background:e.iccandle_background,iccandle_primary_gradient_end:e.iccandle_primary_gradient_end,iccandle_font:e.icc_font??e.iccandle_font??Tr}}const Nr=async e=>{const t=await fetch(`${Ur}/corporate-client/v1/widgetStyle/search/user/?service_type=news`,{headers:{"api-key":e}});if(!t.ok)throw new Error(`Failed to fetch widget style: ${t.statusText}`);const n=await t.json();return{...n,dark:kt(n.dark),light:kt(n.light)}},Ft={iccandle_font:"--iccandle-font",iccandle_primary:"--iccandle-primary",iccandle_border:"--iccandle-border",iccandle_text:"--iccandle-text",iccandle_background:"--iccandle-background",iccandle_primary_gradient_end:"--iccandle-primary-gradient-end"};function vr(e,t){const[n,s]=y.useState(null);y.useEffect(()=>{Nr(e).then(d=>{s(d)})},[e]);const r=y.useRef(null),[i,o]=y.useState(null),a=y.useMemo(()=>t==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,[t]),f=y.useMemo(()=>{if(n)return a==="dark"?n.dark:n.light},[n,a]);return y.useEffect(()=>{if(typeof window>"u"||!f||!i)return;const d=i;Object.keys(Ft).forEach(l=>{d.style.setProperty(Ft[l],f[l])})},[f,i]),{rootRef:r,setRootEl:o,resolvedTheme:a}}const xr=e=>{const{rootRef:t,setRootEl:n,resolvedTheme:s}=vr(e.widgetKey,e.theme);return m.jsx("div",{ref:r=>{t.current=r,n(r)},className:`news-widget__container news-widget ${s==="dark"?"dark":""}`,children:m.jsx(gn,{theme:s,children:m.jsx(Ar,{...e,children:e.children})})})};exports.NewsWidget=xr;
12
+ `+i):s.stack=i}catch{}}throw s}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ye(this.defaults,n);const{transitional:s,paramsSerializer:r,headers:i}=n;s!==void 0&&ke.assertOptions(s,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean),legacyInterceptorReqResOrdering:ue.transitional(ue.boolean)},!1),r!=null&&(c.isFunction(r)?n.paramsSerializer={serialize:r}:ke.assertOptions(r,{encode:ue.function,serialize:ue.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ke.assertOptions(n,{baseUrl:ue.spelling("baseURL"),withXsrfToken:ue.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&c.merge(i.common,i[n.method]);i&&c.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=ae.concat(o,i);const a=[];let f=!0;this.interceptors.request.forEach(function(w){if(typeof w.runWhen=="function"&&w.runWhen(n)===!1)return;f=f&&w.synchronous;const h=n.transitional||tt;h&&h.legacyInterceptorReqResOrdering?a.unshift(w.fulfilled,w.rejected):a.push(w.fulfilled,w.rejected)});const d=[];this.interceptors.response.forEach(function(w){d.push(w.fulfilled,w.rejected)});let l,_=0,b;if(!f){const p=[At.bind(this),void 0];for(p.unshift(...a),p.push(...d),b=p.length,l=Promise.resolve(n);_<b;)l=l.then(p[_++],p[_++]);return l}b=a.length;let S=n;for(;_<b;){const p=a[_++],w=a[_++];try{S=p(S)}catch(h){w.call(this,h);break}}try{l=At.call(this,S)}catch(p){return Promise.reject(p)}for(_=0,b=d.length;_<b;)l=l.then(d[_++],d[_++]);return l}getUri(t){t=ye(this.defaults,t);const n=Qt(t.baseURL,t.url,t.allowAbsoluteUrls);return Kt(n,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){he.prototype[t]=function(n,s){return this.request(ye(s||{},{method:t,url:n,data:(s||{}).data}))}});c.forEach(["post","put","patch"],function(t){function n(s){return function(i,o,a){return this.request(ye(a||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}he.prototype[t]=n(),he.prototype[t+"Form"]=n(!0)});let Xs=class rn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const s=this;this.promise.then(r=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](r);s._listeners=null}),this.promise.then=r=>{let i;const o=new Promise(a=>{s.subscribe(a),i=a}).then(r);return o.cancel=function(){s.unsubscribe(i)},o},t(function(i,o,a){s.reason||(s.reason=new ve(i,o,a),n(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=s=>{t.abort(s)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new rn(function(r){t=r}),cancel:t}}};function qs(e){return function(n){return e.apply(null,n)}}function Vs(e){return c.isObject(e)&&e.isAxiosError===!0}const Ve={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Ve).forEach(([e,t])=>{Ve[t]=e});function on(e){const t=new he(e),n=Bt(he.prototype.request,t);return c.extend(n,he.prototype,t,{allOwnKeys:!0}),c.extend(n,t,null,{allOwnKeys:!0}),n.create=function(r){return on(ye(e,r))},n}const H=on(Ne);H.Axios=he;H.CanceledError=ve;H.CancelToken=Xs;H.isCancel=Zt;H.VERSION=sn;H.toFormData=Ye;H.AxiosError=R;H.Cancel=H.CanceledError;H.all=function(t){return Promise.all(t)};H.spread=qs;H.isAxiosError=Vs;H.mergeConfig=ye;H.AxiosHeaders=ae;H.formToJSON=e=>zt(c.isHTMLForm(e)?new FormData(e):e);H.getAdapter=nn.getAdapter;H.HttpStatusCode=Ve;H.default=H;const{Axios:kr,AxiosError:Fr,CanceledError:jr,isCancel:Br,CancelToken:Mr,VERSION:Yr,all:Hr,Cancel:Ir,isAxiosError:$r,spread:Gr,toFormData:Jr,AxiosHeaders:Xr,HttpStatusCode:qr,formToJSON:Vr,getAdapter:Kr,mergeConfig:zr}=H,Tt=e=>{let t;const n=new Set,s=(d,l)=>{const _=typeof d=="function"?d(t):d;if(!Object.is(_,t)){const b=t;t=l??(typeof _!="object"||_===null)?_:Object.assign({},t,_),n.forEach(S=>S(t,b))}},r=()=>t,a={setState:s,getState:r,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(s,r,a);return a},Ks=(e=>e?Tt(e):Tt),zs=e=>e;function Zs(e,t=zs){const n=y.useSyncExternalStore(e.subscribe,y.useCallback(()=>t(e.getState()),[e,t]),y.useCallback(()=>t(e.getInitialState()),[e,t]));return y.useDebugValue(n),n}const Nt=e=>{const t=Ks(e),n=s=>Zs(t,s);return Object.assign(n,t),n},Ws=(e=>e?Nt(e):Nt),ge=Ws(e=>({newsSelectedCandles:null,newsPlayEndTimestamp:null,newsTargetCandle:null,gapCount:0,isReplayMode:!1,setNewsSelectedCandles:t=>e({newsSelectedCandles:t}),setNewsPlayEndTimestamp:t=>e({newsPlayEndTimestamp:t}),setNewsTargetCandle:t=>e({newsTargetCandle:t}),setGapCount:t=>e({gapCount:t}),setReplayMode:t=>e({isReplayMode:t})})),Qs={"1D":"D1",D:"D1",240:"H4",120:"H2",60:"H1",30:"M30",15:"M15",5:"M5",1:"M1"},Ke=e=>({1:60,5:300,15:900,30:1800,60:3600})[e]||3600,an=[10,15,20,25,30,35,40,45,50],cn=y.createContext(null),er=()=>{const e=y.useContext(cn);if(!e)throw new Error("useWidgetContext must be used inside WidgetProvider");return e},tr=({children:e,selectedTimeframe:t,setSelectedTimeframe:n,currentSymbol:s,setCurrentSymbol:r})=>m.jsx(cn.Provider,{value:{currentSymbol:s,setCurrentSymbol:r,selectedTimeframe:t,setSelectedTimeframe:n},children:e});const ln=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const nr=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const sr=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const vt=e=>{const t=sr(e);return t.charAt(0).toUpperCase()+t.slice(1)};var rr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const ir=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const or=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:r="",children:i,iconNode:o,...a},f)=>y.createElement("svg",{ref:f,...rr,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:ln("lucide",r),...!i&&!ir(a)&&{"aria-hidden":"true"},...a},[...o.map(([d,l])=>y.createElement(d,l)),...Array.isArray(i)?i:[i]]));const rt=(e,t)=>{const n=y.forwardRef(({className:s,...r},i)=>y.createElement(or,{ref:i,iconNode:t,className:ln(`lucide-${nr(vt(e))}`,`lucide-${e}`,s),...r}));return n.displayName=vt(e),n};const ar=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],cr=rt("chevron-down",ar);const lr=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],dr=rt("chevron-left",lr);const ur=[["path",{d:"M8.8 20v-4.1l1.9.2a2.3 2.3 0 0 0 2.164-2.1V8.3A5.37 5.37 0 0 0 2 8.25c0 2.8.656 3.054 1 4.55a5.77 5.77 0 0 1 .029 2.758L2 20",key:"11atix"}],["path",{d:"M19.8 17.8a7.5 7.5 0 0 0 .003-10.603",key:"yol142"}],["path",{d:"M17 15a3.5 3.5 0 0 0-.025-4.975",key:"ssbmkc"}]],pr=rt("speech",ur),ze=(e,t)=>{if(!e||e==="-"||e.trim()===""||!t||t==="-"||t.trim()==="")return"news-widget__orange";const n=e.trim().replace(/[kKmMbB%]/g,"").replace(/[^\d.-]/g,""),s=t.trim().replace(/[kKmMbB%]/g,"").replace(/[^\d.-]/g,""),r=parseFloat(n)||0,i=parseFloat(s)||0;return r>i?"news-widget__green":r===i?"news-widget__orange":"news-widget__red"},xt=e=>e.trim().replaceAll(" ","").replaceAll("_",""),fr=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}),dn=e=>{const t=fr.formatToParts(e),n=s=>t.find(r=>r.type===s)?.value??"";return`${n("year")} ${n("month")} ${n("day")}, ${n("hour")}:${n("minute")}`},mr=({currency:e,size:t=24})=>m.jsx("img",{src:`https://cdn.iccandle.ai/web-assets/${e}.svg`,className:"news-widget_news_card__currency_img",alt:e,width:t,height:t}),_r=({title:e,date:t,forecast:n,actual:s,currency:r})=>m.jsxs("div",{className:"news-widget_news_card__container",children:[m.jsxs("div",{className:"news-widget_news_card__header",children:[r&&m.jsx("div",{className:"news-widget_news_card__currency_icon",children:m.jsx(mr,{currency:r})}),m.jsxs("div",{className:"news-widget_news_card__meta",children:[m.jsx("div",{className:"news-widget_news_card__date",children:dn(new Date(t??0))}),m.jsx("div",{className:"news-widget_news_card__title",children:e})]})]}),m.jsxs("div",{className:"news-widget_news_card__info_row",children:[m.jsxs("div",{className:"news-widget_news_card__info_card",children:[m.jsx("div",{className:"news-widget_news_card__label",children:"Actual"}),m.jsx("div",{className:`news-widget_news_card__font_semibold ${ze(String(s),String(n))}`,children:s||"-"})]}),m.jsxs("div",{className:"news-widget_news_card__info_card",children:[m.jsx("div",{className:"news-widget_news_card__label",children:"Forecast"}),m.jsx("div",{className:"news-widget_news_card__font_semibold news-widget__orange",children:n||"-"})]})]})]});function hr(e){switch(e){case"post":return"news-widget__bg_green";case"early":return"news-widget__bg_gray";case"coming":return"news-widget__bg_orange"}}const wr=({eventData:e,showStatus:t=!0,showPreviousValues:n=!1,showSimilarEvents:s=!1,isSimilarEventsOpen:r=!1})=>m.jsxs("div",{className:"news-widget_event_details_card__container",children:[m.jsxs("div",{className:"news-widget_event_details_card__body",children:[m.jsxs("div",{className:"news-widget_event_details_card__left",children:[m.jsx("div",{className:"news-widget_event_details_card__header_row",children:m.jsxs("div",{className:"news-widget_event_details_card__header_inner",children:[m.jsxs("div",{className:"news-widget_event_details_card__timestamp_row",children:[m.jsxs("p",{className:"news-widget_event_details_card__timestamp",children:[e?.timestamp&&dn(new Date(e?.timestamp??0))," "]})," ",e?.status&&t&&m.jsxs("div",{className:"news-widget_event_details_card__status_container",children:[m.jsx("div",{className:`news-widget_event_details_card__status ${hr(e.status)}`}),e.status==="post"&&"Actual Released",e.status==="coming"&&"Predict Available",e.status==="early"&&"Predict Unavailable"]})," "]}),m.jsxs("div",{className:"news-widget_event_details_card__currency_row",children:[m.jsx("div",{className:"news-widget_event_details_card__currency_icon",children:m.jsx("img",{src:`https://cdn.iccandle.ai/web-assets/${e?.currency??"USD"}.svg`,className:"news-widget_event_details_card__currency_img",alt:e?.currency||"",width:36,height:36})}),m.jsxs("p",{className:"news-widget_event_details_card__event_name",children:[e?.event_name," ",e?.event_time&&` ${e?.event_time}`]}),e?.slug=="FOMC"&&m.jsx(pr,{stroke:"url(#gradient)",className:"news-widget_event_details_card__speech_icon"})]})]})}),e?.slug!="FOMC"&&m.jsxs("div",{className:"news-widget_event_details_card__values_row",children:[m.jsxs("div",{className:"news-widget_event_details_card__values_group",children:[m.jsxs("div",{className:"news-widget_event_details_card__info",children:[m.jsx("span",{className:"news-widget_event_details_card__label",children:"Actual:"}),m.jsx("span",{className:`news-widget_event_details_card__text_bold ${ze(e?.actual,e?.forecast)}`,children:e?.actual||"Soon"})]}),m.jsxs("div",{className:"news-widget_event_details_card__info",children:[m.jsx("span",{className:"news-widget_event_details_card__label",children:"Forecast:"}),m.jsx("span",{className:"news-widget_event_details_card__text_bold news-widget__orange",children:e?.forecast||"-"})]})]}),n&&m.jsxs("div",{className:"news-widget_event_details_card__values_group",children:[m.jsxs("div",{className:"news-widget_event_details_card__info",children:[m.jsx("span",{className:"news-widget_event_details_card__label",children:"Previous Actual:"}),m.jsx("span",{className:`news-widget_event_details_card__text_bold ${ze(e?.similar?.referenceEvent?.previous_actual,e?.similar?.referenceEvent?.previous_forecast)}`,children:e?.similar?.referenceEvent?.previous_actual||"-"})]}),m.jsxs("div",{className:"news-widget_event_details_card__info",children:[m.jsx("span",{className:"news-widget_event_details_card__label",children:"Previous Forecast:"}),m.jsx("span",{className:"news-widget_event_details_card__text_bold news-widget__orange",children:e?.similar?.referenceEvent?.previous_forecast||"-"})]})]})]}),e?.slug=="FOMC"&&m.jsxs("p",{className:"news-widget_event_details_card__fomc_source",children:["Source:"," ",m.jsx("a",{href:e?.resource??"#",target:"_blank",rel:"noopener noreferrer",className:"news-widget_event_details_card__fomc_link",children:"FOMC Report"})]})]}),m.jsx("div",{className:"news-widget_event_details_card__right",children:e?.description&&m.jsx("p",{className:"news-widget_event_details_card__description",children:e.description})})]}),s&&e?.similar?.referenceEvent?.previousEvents&&e?.similar?.referenceEvent?.previousEvents.length>0&&m.jsx("div",{className:`news-widget_event_details_card__collapsible ${r?"news-widget_event_details_card__collapsible--open":"news-widget_event_details_card__collapsible--closed"}`,children:r&&m.jsxs("div",{className:"news-widget_event_details_card__collapsible_inner",children:[e?.similar?.referenceEvent?.previousEvents.length>0&&m.jsxs("p",{className:"news-widget_event_details_card__text",children:["News Before This ",e?.event_name]}),e?.similar?.referenceEvent?.previousEvents.length>0&&m.jsx("div",{className:"news-widget_event_details_card__previous_events_list",children:e?.similar?.referenceEvent?.previousEvents?.map((i,o)=>m.jsx(_r,{title:i.event_name,date:new Date(i.timestamp),forecast:i.forecast,actual:i.actual,currency:e?.currency},o))})]})})]}),yr=({newsDetail:e,children:t,isCompared:n})=>{const[s,r]=y.useState(!1);return m.jsxs("div",{className:"news-widget_event_details__container news-widget_event_details__container_sm",children:[e&&m.jsxs("div",{style:{position:"relative"},children:[m.jsx(wr,{eventData:e.event,showPreviousValues:!n,showSimilarEvents:!0,isSimilarEventsOpen:s}),m.jsx("button",{type:"button",className:`news-widget__button news-widget_event_details__ghost_button ${s?"news-widget_event_details__ghost_button_open":""}`,onClick:()=>r(!s),children:m.jsx(cr,{className:"news-widget_event_details__icon"})})]}),m.jsx("div",{className:"news-widget_event_details__chart_wrapper",children:m.jsx("div",{className:"news-widget_event_details__chart",children:t})})]})},gr=[{name:"LTC_USD",type:"CFD",pipLocation:-1},{name:"HK33_HKD",type:"CFD",pipLocation:0},{name:"USD_JPY",type:"CURRENCY",pipLocation:-2},{name:"EUR_TRY",type:"CURRENCY",pipLocation:-4},{name:"BTCUSDT",type:"CRYPTO",pipLocation:0},{name:"ETHUSDT",type:"CRYPTO",pipLocation:0},{name:"XRPUSDT",type:"CRYPTO",pipLocation:-3},{name:"SOLUSDT",type:"CRYPTO",pipLocation:-1},{name:"AUD_NZD",type:"CURRENCY",pipLocation:-4},{name:"USD_THB",type:"CURRENCY",pipLocation:-2},{name:"GBP_CHF",type:"CURRENCY",pipLocation:-4},{name:"EUR_HUF",type:"CURRENCY",pipLocation:-2},{name:"EUR_ZAR",type:"CURRENCY",pipLocation:-4},{name:"NZD_JPY",type:"CURRENCY",pipLocation:-2},{name:"EUR_NZD",type:"CURRENCY",pipLocation:-4},{name:"USB02Y_USD",type:"CFD",pipLocation:-2},{name:"XAU_CAD",type:"METAL",pipLocation:-2},{name:"GBP_JPY",type:"CURRENCY",pipLocation:-2},{name:"USD_TRY",type:"CURRENCY",pipLocation:-4},{name:"EUR_NOK",type:"CURRENCY",pipLocation:-4},{name:"TRY_JPY",type:"CURRENCY",pipLocation:-2},{name:"USD_SGD",type:"CURRENCY",pipLocation:-4},{name:"EUR_SEK",type:"CURRENCY",pipLocation:-4},{name:"DE30_EUR",type:"CFD",pipLocation:0},{name:"AUD_CAD",type:"CURRENCY",pipLocation:-4},{name:"UK10YB_GBP",type:"CFD",pipLocation:-2},{name:"XPD_USD",type:"CFD",pipLocation:-2},{name:"UK100_GBP",type:"CFD",pipLocation:0},{name:"XAG_CHF",type:"METAL",pipLocation:-4},{name:"USD_CHF",type:"CURRENCY",pipLocation:-4},{name:"CHF_HKD",type:"CURRENCY",pipLocation:-4},{name:"EUR_HKD",type:"CURRENCY",pipLocation:-4},{name:"GBP_HKD",type:"CURRENCY",pipLocation:-4},{name:"XAU_NZD",type:"METAL",pipLocation:-2},{name:"GBP_NZD",type:"CURRENCY",pipLocation:-4},{name:"GBP_SGD",type:"CURRENCY",pipLocation:-4},{name:"USD_SEK",type:"CURRENCY",pipLocation:-4},{name:"EUR_SGD",type:"CURRENCY",pipLocation:-4},{name:"XAG_JPY",type:"METAL",pipLocation:0},{name:"USD_HKD",type:"CURRENCY",pipLocation:-4},{name:"XAG_HKD",type:"METAL",pipLocation:-4},{name:"XCU_USD",type:"CFD",pipLocation:-4},{name:"XAU_JPY",type:"METAL",pipLocation:1},{name:"EUR_PLN",type:"CURRENCY",pipLocation:-4},{name:"SUGAR_USD",type:"CFD",pipLocation:-4},{name:"HKD_JPY",type:"CURRENCY",pipLocation:-4},{name:"CHF_ZAR",type:"CURRENCY",pipLocation:-4},{name:"ZAR_JPY",type:"CURRENCY",pipLocation:-2},{name:"XAU_HKD",type:"METAL",pipLocation:-2},{name:"AUD_CHF",type:"CURRENCY",pipLocation:-4},{name:"EUR_CHF",type:"CURRENCY",pipLocation:-4},{name:"USD_MXN",type:"CURRENCY",pipLocation:-4},{name:"GBP_USD",type:"CURRENCY",pipLocation:-4},{name:"GBP_ZAR",type:"CURRENCY",pipLocation:-4},{name:"SGD_JPY",type:"CURRENCY",pipLocation:-2},{name:"BCH_USD",type:"CFD",pipLocation:-1},{name:"XAG_AUD",type:"METAL",pipLocation:-4},{name:"WTICO_USD",type:"CFD",pipLocation:-2},{name:"AUD_HKD",type:"CURRENCY",pipLocation:-4},{name:"AUD_SGD",type:"CURRENCY",pipLocation:-4},{name:"NZD_HKD",type:"CURRENCY",pipLocation:-4},{name:"EUR_JPY",type:"CURRENCY",pipLocation:-2},{name:"USD_NOK",type:"CURRENCY",pipLocation:-4},{name:"XAU_USD",type:"METAL",pipLocation:-1},{name:"DE10YB_EUR",type:"CFD",pipLocation:-2},{name:"USD_CZK",type:"CURRENCY",pipLocation:-4},{name:"XAU_CHF",type:"METAL",pipLocation:-2},{name:"USD_HUF",type:"CURRENCY",pipLocation:-2},{name:"WHEAT_USD",type:"CFD",pipLocation:-2},{name:"XAU_AUD",type:"METAL",pipLocation:-2},{name:"EUR_USD",type:"CURRENCY",pipLocation:-4},{name:"SG30_SGD",type:"CFD",pipLocation:-1},{name:"GBP_AUD",type:"CURRENCY",pipLocation:-4},{name:"USD_PLN",type:"CURRENCY",pipLocation:-4},{name:"NZD_CAD",type:"CURRENCY",pipLocation:-4},{name:"XAG_EUR",type:"METAL",pipLocation:-4},{name:"CORN_USD",type:"CFD",pipLocation:-2},{name:"XAG_SGD",type:"METAL",pipLocation:-4},{name:"CHINAH_HKD",type:"CFD",pipLocation:0},{name:"XAU_SGD",type:"METAL",pipLocation:-2},{name:"NZD_USD",type:"CURRENCY",pipLocation:-4},{name:"JP225Y_JPY",type:"CFD",pipLocation:0},{name:"XAG_NZD",type:"METAL",pipLocation:-4},{name:"EUR_CZK",type:"CURRENCY",pipLocation:-4},{name:"AU200_AUD",type:"CFD",pipLocation:0},{name:"SGD_CHF",type:"CURRENCY",pipLocation:-4},{name:"USD_DKK",type:"CURRENCY",pipLocation:-4},{name:"SPX500_USD",type:"CFD",pipLocation:0},{name:"NZD_SGD",type:"CURRENCY",pipLocation:-4},{name:"US30_USD",type:"CFD",pipLocation:0},{name:"NL25_EUR",type:"CFD",pipLocation:-2},{name:"JP225_USD",type:"CFD",pipLocation:0},{name:"USB30Y_USD",type:"CFD",pipLocation:-2},{name:"XAG_USD",type:"METAL",pipLocation:-4},{name:"GBP_PLN",type:"CURRENCY",pipLocation:-4},{name:"CN50_USD",type:"CFD",pipLocation:0},{name:"USB05Y_USD",type:"CFD",pipLocation:-2},{name:"AUD_USD",type:"CURRENCY",pipLocation:-4},{name:"USD_CNH",type:"CURRENCY",pipLocation:-4},{name:"EUR_GBP",type:"CURRENCY",pipLocation:-4},{name:"XAG_GBP",type:"METAL",pipLocation:-4},{name:"XAU_EUR",type:"METAL",pipLocation:-2},{name:"USD_CAD",type:"CURRENCY",pipLocation:-4},{name:"NAS100_USD",type:"CFD",pipLocation:0},{name:"EUR_CAD",type:"CURRENCY",pipLocation:-4},{name:"USB10Y_USD",type:"CFD",pipLocation:-2},{name:"EU50_EUR",type:"CFD",pipLocation:0},{name:"NATGAS_USD",type:"CFD",pipLocation:-2},{name:"CAD_JPY",type:"CURRENCY",pipLocation:-2},{name:"FR40_EUR",type:"CFD",pipLocation:0},{name:"XAU_XAG",type:"METAL",pipLocation:-2},{name:"CAD_SGD",type:"CURRENCY",pipLocation:-4},{name:"GBP_CAD",type:"CURRENCY",pipLocation:-4},{name:"USD_ZAR",type:"CURRENCY",pipLocation:-4},{name:"XAU_GBP",type:"METAL",pipLocation:-2},{name:"CH20_CHF",type:"CFD",pipLocation:0},{name:"CAD_HKD",type:"CURRENCY",pipLocation:-4},{name:"CHF_JPY",type:"CURRENCY",pipLocation:-2},{name:"NZD_CHF",type:"CURRENCY",pipLocation:-4},{name:"ESPIX_EUR",type:"CFD",pipLocation:0},{name:"XAG_CAD",type:"METAL",pipLocation:-4},{name:"XPT_USD",type:"CFD",pipLocation:-2},{name:"EUR_AUD",type:"CURRENCY",pipLocation:-4},{name:"CAD_CHF",type:"CURRENCY",pipLocation:-4},{name:"EUR_DKK",type:"CURRENCY",pipLocation:-4},{name:"SOYBN_USD",type:"CFD",pipLocation:-2},{name:"US2000_USD",type:"CFD",pipLocation:-2},{name:"BCO_USD",type:"CFD",pipLocation:-2},{name:"AUD_JPY",type:"CURRENCY",pipLocation:-2}];function Cr(e,t,n=1){if(t===0||!isFinite(t))return n;const s=e/t;return isFinite(s)?s:n}function Lt(e){if(e.length===0)return 0;const t=[...e].sort((s,r)=>s-r),n=Math.floor(t.length/2);return t.length%2!==0?t[n]:(t[n-1]+t[n])/2}function br(e,t,n=[]){if(e.length===0)return[];const s=n.map(l=>Math.abs(l.c-l.o)),r=e.map(l=>Math.abs(l.c-l.o)),i=Lt(r),o=Lt(s),a=Cr(o,i),f=e[0].o,d=t.c;return e.map(l=>{const _=(l.o-f)*a+d,b=(l.h-f)*a+d,S=(l.l-f)*a+d,p=(l.c-f)*a+d;return{o:_,h:Math.max(b,_,p),l:Math.min(S,_,p),c:p}})}const we=e=>e==="1"?60:e==="5"?300:e==="1D"?1440*3600:parseInt(e,10)*60,Ze=8,un=4,We=5,pn=e=>{const t=new Date(e+Ze*60*60*1e3),n=t.getUTCDay(),s=t.getUTCHours();return n===0?!1:n===1?s>=We:n===6?s<=un:!0},fn=e=>{const t=new Date(e+Ze*60*60*1e3),n=t.getUTCDay(),s=t.getUTCHours();if(n===0||n===1&&s<We||n===6&&s>=un){const r=(8-n)%7;return t.setUTCDate(t.getUTCDate()+r),t.setUTCHours(We,0,0,0),t.getTime()-Ze*60*60*1e3}return e},Rr=(e,t,n)=>{const s=we(t)*1e3,r=[];let i=e;for(let o=0;o<n;o++)i+=s,pn(i)||(i=fn(i)),r.push(i);return r},Pt=(e,t,n,s)=>{if(n<=0)return[];if(s==="24x7"){const i=we(t)*1e3;return Array.from({length:n},(o,a)=>e+(a+1)*i)}if(s==="1700-1700")return Rr(e,t,n);const r=we(t)*1e3;return Array.from({length:n},(i,o)=>e+(o+1)*r)},Er=(e,t,n,s)=>{if(s==="24x7"){const i=we(n)*1e3;return Math.max(0,Math.floor((t-e)/i))}if(s==="1700-1700"){const i=we(n)*1e3;let o=0,a=e;for(;a<t;)a+=i,pn(a)||(a=fn(a)),a<=t&&o++;return o}const r=we(n)*1e3;return Math.max(0,Math.floor((t-e)/r))},it=[{ticker:"EUR_JPY",display_name:"EURJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"EUR JPY",type:"forex",session:"1700-1700"},{ticker:"GBP_JPY",display_name:"GBPJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"GBP JPY",type:"forex",session:"1700-1700"},{ticker:"AUD_JPY",display_name:"AUDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/AUD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"AUD JPY",type:"forex",session:"1700-1700"},{ticker:"NZD_JPY",display_name:"NZDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"NZD JPY",type:"forex",session:"1700-1700"},{ticker:"CAD_JPY",display_name:"CADJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/CAD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"CAD JPY",type:"forex",session:"1700-1700"},{ticker:"CHF_JPY",display_name:"CHFJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/CHF.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"CHF JPY",type:"forex",session:"1700-1700"},{ticker:"USD_JPY",display_name:"USDJPY",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/JPY.svg"],description:"USD JPY",type:"forex",session:"1700-1700"},{ticker:"EUR_USD",display_name:"EURUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"EUR USD",type:"forex",session:"1700-1700"},{ticker:"AUD_USD",display_name:"AUDUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/AUD.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"AUD USD",type:"forex",session:"1700-1700"},{ticker:"NZD_USD",display_name:"NZDUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"NZD USD",type:"forex",session:"1700-1700"},{ticker:"USD_CHF",display_name:"USDCHF",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/CHF.svg"],description:"USD CHF",type:"forex",session:"1700-1700"},{ticker:"USD_CAD",display_name:"USDCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/USD.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"USD CAD",type:"forex",session:"1700-1700"},{ticker:"GBP_AUD",display_name:"GBPAUD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/AUD.svg"],description:"GBP AUD",type:"forex",session:"1700-1700"},{ticker:"GBP_CAD",display_name:"GBPCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"GBP CAD",type:"forex",session:"1700-1700"},{ticker:"GBP_CHF",display_name:"GBPCHF",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/CHF.svg"],description:"GBP CHF",type:"forex",session:"1700-1700"},{ticker:"GBP_NZD",display_name:"GBPNZD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/NZD.svg"],description:"GBP NZD",type:"forex",session:"1700-1700"},{ticker:"GBP_USD",display_name:"GBPUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/GBP.svg","https://cdn.iccandle.ai/web-assets/USD.svg"],description:"GBP USD",type:"forex",session:"1700-1700"},{ticker:"NZD_CAD",display_name:"NZDCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/NZD.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"NZD CAD",type:"forex",session:"1700-1700"},{ticker:"EUR_CAD",display_name:"EURCAD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/CAD.svg"],description:"EUR CAD",type:"forex",session:"1700-1700"},{ticker:"EUR_AUD",display_name:"EURAUD",logo_urls:["https://cdn.iccandle.ai/web-assets/EUR.svg","https://cdn.iccandle.ai/web-assets/AUD.svg"],description:"EUR AUD",type:"forex",session:"1700-1700"},{ticker:"XAU_USD",display_name:"XAUUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XAU.svg"],description:"Gold",type:"commodity",session:"1700-1700"},{ticker:"BCO_USD",display_name:"BCOUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/BCO.svg"],description:"Brent Crude Oil",type:"commodity",session:"1700-1700"},{ticker:"SPX500_USD",display_name:"S&P500",logo_urls:["https://cdn.iccandle.ai/web-assets/SPX500.svg"],description:"S&P 500",type:"indices",session:"1700-1700"},{ticker:"NAS100_USD",display_name:"NASDAQ100",logo_urls:["https://cdn.iccandle.ai/web-assets/NAS100.svg"],description:"NASDAQ 100",type:"indices",session:"1700-1700"},{ticker:"US30_USD",display_name:"US30",logo_urls:["https://cdn.iccandle.ai/web-assets/US30.svg"],description:"US Wall St 30",type:"indices",session:"1700-1700"},{ticker:"BTCUSDT",display_name:"BTCUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/BTC.svg"],description:"BTCUSDT",type:"crypto",session:"24x7"},{ticker:"ETHUSDT",display_name:"ETHUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/ETH.svg"],description:"ETHUSDT",type:"crypto",session:"24x7"},{ticker:"XRPUSDT",display_name:"XRPUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/XRP.svg"],description:"XRPUSDT",type:"crypto",session:"24x7"},{ticker:"SOLUSDT",display_name:"SOLUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/SOL.svg"],description:"SOLUSDT",type:"crypto",session:"24x7"},{ticker:"ADAUSDT",display_name:"ADAUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/ADA.svg"],description:"ADAUSDT",type:"crypto",session:"24x7"},{ticker:"AVAUSDT",display_name:"AVAUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/AVA.svg"],description:"AVAUSDT",type:"crypto",session:"24x7"},{ticker:"AVAXUSDT",display_name:"AVAXUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/AVAX.svg"],description:"AVAXUSDT",type:"crypto",session:"24x7"},{ticker:"BNBUSDT",display_name:"BNBUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/BNB.svg"],description:"BNBUSDT",type:"crypto",session:"24x7"},{ticker:"DOGEUSDT",display_name:"DOGEUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/DOGE.svg"],description:"DOGEUSDT",type:"crypto",session:"24x7"},{ticker:"DOTUSDT",display_name:"DOTUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/DOT.svg"],description:"DOTUSDT",type:"crypto",session:"24x7"},{ticker:"TRXUSDT",display_name:"TRXUSDT",logo_urls:["https://cdn.iccandle.ai/web-assets/TRX.svg"],description:"TRXUSDT",type:"crypto",session:"24x7"},{ticker:"AAPL",display_name:"AAPL",logo_urls:["https://cdn.iccandle.ai/web-assets/AAPL.svg"],description:"Apple Inc.",type:"stock",session:"24x7"},{ticker:"AMZN",display_name:"AMZN",logo_urls:["https://cdn.iccandle.ai/web-assets/AMZN.svg"],description:"Amazon.Com Inc",type:"stock",session:"24x7"},{ticker:"BRK.B",display_name:"BRK.B",logo_urls:["https://cdn.iccandle.ai/web-assets/BRK.B.svg"],description:"BERKSHIRE HATHAWAY Class B",type:"stock",session:"24x7"},{ticker:"GOOGL",display_name:"GOOGL",logo_urls:["https://cdn.iccandle.ai/web-assets/GOOGL.svg"],description:"Alphabet Inc. Class A Common Stock",type:"stock",session:"24x7"},{ticker:"KO",display_name:"KO",logo_urls:["https://cdn.iccandle.ai/web-assets/KO.svg"],description:"Coca-Cola Company",type:"stock",session:"24x7"},{ticker:"META",display_name:"META",logo_urls:["https://cdn.iccandle.ai/web-assets/META.svg"],description:"Meta Platforms, Inc. Class A Common Stock",type:"stock",session:"24x7"},{ticker:"MSFT",display_name:"MSFT",logo_urls:["https://cdn.iccandle.ai/web-assets/MSFT.svg"],description:"Microsoft Corp",type:"stock",session:"24x7"},{ticker:"NFLX",display_name:"NFLX",logo_urls:["https://cdn.iccandle.ai/web-assets/NFLX.svg"],description:"NetFlix Inc",type:"stock",session:"24x7"},{ticker:"NKE",display_name:"NKE",logo_urls:["https://cdn.iccandle.ai/web-assets/NKE.svg"],description:"Nike, Inc.",type:"stock",session:"24x7"},{ticker:"NVDA",display_name:"NVDA",logo_urls:["https://cdn.iccandle.ai/web-assets/NVDA.svg"],description:"Nvidia Corp",type:"stock",session:"24x7"},{ticker:"TME",display_name:"TME",logo_urls:["https://cdn.iccandle.ai/web-assets/TME.svg"],description:"Tencent Music Entertainment Group American Depositary Shares, each representing two Class A Ordinary Shares",type:"stock",session:"24x7"},{ticker:"TSLA",display_name:"TSLA",logo_urls:["https://cdn.iccandle.ai/web-assets/TSLA.svg"],description:"Tesla, Inc. Common Stock",type:"stock",session:"24x7"},{ticker:"XAG_USD",display_name:"XAGUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XAG.svg"],description:"Silver",type:"commodity",session:"1700-1700"},{ticker:"XCU_USD",display_name:"XCUUSD",logo_urls:["https://cdn.iccandle.ai/web-assets/XCU.svg"],description:"Copper",type:"commodity",session:"1700-1700"}],Sr=({replayTabId:e,futureBarsRef:t,highlightBarsRef:n,tvWidgetRef:s,pushBar:r,resolution:i,symbol:o,resolvedTheme:a})=>{const f=ge(p=>p.newsSelectedCandles),d=ge(p=>p.newsTargetCandle),l=ge(p=>p.newsPlayEndTimestamp),_=ge(p=>p.gapCount),b=y.useRef(f),S=y.useRef(null);return y.useEffect(()=>{const p={current:null};let w=null,h=!1;return(async()=>{if(!h){if(f?.length&&d!==null){if(S.current===f)return;t.current=[];const D=l!=null;if(b.current||D)try{s?.current?.resetCache(),s?.current?.activeChart().resetData()}catch{}try{s?.current?.activeChart().executeActionById("timeScaleReset")}catch{}const x=[...f].slice(-50-(_||0)),P=br(x,d[d.length-1],d),F=it.find(A=>A.ticker===o||A.display_name===o)?.session||"24x7",Y=Pt(d[d.length-1].timestamp,i,_||0,F),se=Pt(_?Y[Y.length-1]:d[d.length-1].timestamp,i,P.length,F),q=P.map((A,j)=>({open:A.o,high:A.h,low:A.l,close:A.c,time:se[j]})).sort((A,j)=>A.time-j.time);n.current=q.slice(-50);let K=0,W=0;const k=async()=>{p.current&&(clearInterval(p.current),p.current=null),S.current=f;try{f&&q.length>0}catch(A){console.error("Error setting visible range:",A)}};q.length===0?(t.current=[],await k()):w=setTimeout(()=>{h||(p.current=setInterval(()=>{if(K<q.length){if(r(e,q[K]))t.current=q.slice(0,K+1),K++,W=0,K===q.length&&(t.current=q,k());else if(W++,W>=10){t.current=[...q];try{s?.current?.activeChart().resetData()}catch{}k()}}},150))},700)}else{if(t.current=[],b.current)try{s?.current?.resetCache(),s?.current?.activeChart().resetData()}catch{}S.current=null}b.current=f}})(),()=>{h=!0,w&&clearTimeout(w),p.current&&(t.current=[],clearInterval(p.current))}},[r,t,n,l,f,d,e,i,o,s,_]),y.useEffect(()=>{f===null&&(n.current=[])},[n,f]),m.jsx(m.Fragment,{children:_>900&&m.jsx("div",{className:"bg-backdrop absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 p-4",children:m.jsxs("div",{className:"flex items-center justify-center gap-2",children:[m.jsx("img",{src:`/images/error-${a==="dark"?"black":"white"}.png`,alt:"alert",width:44,height:44}),m.jsxs("p",{className:"text-theme text-center text-sm font-semibold",children:["Candle data too far from event.",m.jsx("br",{})," Please try another timeframe."]})]})})})},Dr=({children:e,eventId:t,widgetKey:n,chartWidget:s,event:r,theme:i,newsDetail:o,selectedCandles:a,defaultSymbol:f,currentSymbol:d,currentTimeFrame:l,isUpcoming:_=!1,isElapsed:b=!1,onBack:S,pushBar:p,iframeRef:w,futureRef:h,pendingMessageRef:D,iframeReadyToListenRef:J,highlightBarsRef:x,setGapCountExternal:P,setReplayModeExternal:X})=>{const F=y.useRef(null),{setCurrentSymbol:Y,setSelectedTimeframe:se}=er(),{setNewsTargetCandle:Q,setGapCount:q,setNewsPlayEndTimestamp:K,setNewsSelectedCandles:W}=ge();return y.useEffect(()=>{if(!t||t==""||!s)return;const k=()=>{if(s)try{const C=s?.activeChart();C&&C.getAllShapes().forEach(I=>{try{C.removeEntity(I.id)}catch(v){console.error("Failed to remove shape",v)}})}catch{}},A=async()=>{const{data:C,status:I}=await H.get(`https://corprate-widget.iccandle.ai/news/${t}`,{headers:{"api-key":n},params:{symbol:f}});if(I!==200){console.error("Failed to fetch news detail");return}return C};let j=!1;const L=[],re=(C,I)=>{const v=window.setTimeout(C,I);return L.push(v),v};return F.current=s,s.onChartReady(async()=>{i==="dark"||i==="system"?(s.applyOverrides({"paneProperties.background":"#000000","scalesProperties.textColor":"#fff"}),s.setCSSCustomProperty("--tv-color-pane-background","#000000"),s.setCSSCustomProperty("--tv-color-platform-background","#0f0f0f")):(s.applyOverrides({"paneProperties.background":"#ffffff","scalesProperties.textColor":"#000"}),s.setCSSCustomProperty("--tv-color-pane-background","#ffffff"),s.setCSSCustomProperty("--tv-color-platform-background","#f9fafb"));const C=s.activeChart();if(!C)return;const I=async(E,B)=>{await C.createShape({time:B},{shape:"vertical_line",lock:!0,disableSelection:!0,overrides:{linestyle:2,linewidth:1}});const $=await C.exportData(),U=$.data.findIndex(N=>N[0]===B);let M=a;if(U!=-1&&!M&&(M=[...an].sort((N,V)=>V-N).find(N=>$.data[U+N])??null),U!=-1&&M){const N=E,V=$.data[U+M][0],G=$.data.filter(ce=>ce[0]>N&&ce[0]<=V)??[];let ie=null,pe=null;if(G.length>0){const ce=G.reduce((z,ee,le,O)=>Number(ee[3])<Number(O[z][3])?le:z,0),de=G[ce];pe={time:de[0],value:Number(de[3])}}if(G.length>0){const ce=G.reduce((z,ee,le,O)=>Number(ee[2])>Number(O[z][2])?le:z,0),de=G[ce];ie={time:de[0],value:Number(de[2])}}if(ie&&pe&&G.length>0){const ce=ie.value,de=pe.value,ee=$.data[U+1][1];await C.createMultipointShape([{time:N,price:ee},{time:V,price:ce}],{shape:"rectangle",overrides:{showLabel:!1,linecolor:"#12B76A",linewidth:1,linestyle:0,color:"#12B76A10",borderColor:"#12B76A",borderWidth:1,backgroundColor:"#12B76A",transparency:70,drawBorder:!1,frozen:!0}}),await C.createMultipointShape([{time:N,price:de},{time:V,price:ee}],{shape:"rectangle",overrides:{showLabel:!1,linecolor:"#D92D2030",linewidth:1,linestyle:0,color:"#D92D2010",borderWidth:1,backgroundColor:"#D92D20",transparency:70,drawBorder:!1,frozen:!0}}),await C.createMultipointShape([{time:N,price:ce},{time:V,price:ce}],{shape:"trend_line",overrides:{linecolor:"#12B76A",linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0}}),await C.createMultipointShape([{time:N,price:de},{time:V,price:de}],{shape:"trend_line",overrides:{linecolor:"#D92D20",linewidth:1,linestyle:2,extendLeft:!0,extendRight:!0}});const le=gr.find(me=>xt(me.name)==xt(d))?.pipLocation;let O="",Z="";if(le){const me=Math.pow(10,-le),ot=parseFloat(Math.abs((ce-ee)*me).toFixed(1)),at=parseFloat(Math.abs((de-ee)*me).toFixed(1));O=`${ot>=0?"+":""}${ot.toFixed(2)} pip`,Z=`${at>=0?"-":""}${at.toFixed(2)} pip`}await C.createShape({time:ie.time,price:ie.value},{shape:"arrow_down",overrides:{arrowColor:"#12B76A",fontsize:11,color:"#12B76A",text:O,bold:!0}}),await C.createShape({time:pe.time,price:pe.value},{shape:"arrow_up",overrides:{arrowColor:"#D92D20",fontsize:11,color:"#D92D20",text:Z,bold:!0}});const te=Math.floor((N+V)/2);await C.createShape({time:te},{shape:"text",text:`${M} candles`,zOrder:"top",overrides:{fontsize:12,color:"#FFFFFF",bold:!0,backgroundColor:"#FFFFFF"}})}}if($&&$.data.length>0&&$.data[0][0]>=$.data[$.data.length-1][0]&&await C.setVisibleRange({from:$.data[0][0],to:$.data[$.data.length-1][0]}),_&&r){const N=Math.floor(Date.now()/1e3),V=B,G=C.resolution(),ie=3600*24*7;N-ie>=V+ie&&await C.setVisibleRange({from:N-ie,to:V+ie},{applyDefaultRightMargin:!0,percentRightMargin:50}),re(()=>{j||F.current!==s||Number(G)<=30&&C.createShape({time:V},{shape:"vertical_line",lock:!0,disableSelection:!0,overrides:{linestyle:2,linewidth:1}})},2e3)}},v=async()=>{if(j||F.current!==s)return;const E=await A();if(j||F.current!==s)return;k();const B=(E?.event?.timestamp??0)/1e3,$=Ke(l),U=B-B%$;C.getVisibleBarsRange()||await new Promise(V=>setTimeout(V,2e3));const N=C.getVisibleBarsRange();N&&N.from<=B&&B<=N.to?await I(B,U):(_||await C.setVisibleRange({from:B},{applyDefaultRightMargin:!0,percentRightMargin:50}),await I(B,U))},u=()=>{re(()=>{j||F.current!==s||d==C.symbol()||(async()=>{try{P(0),X(!1),W(null),w.current?.contentWindow?.postMessage({action:"handleClose"},"*"),Y(C.symbol())}catch(E){console.log("error=>",E)}})()},300)},g=E=>{re(()=>{j||F.current!==s||l==E||(async()=>{try{P(0),X(!1),W(null),w.current?.contentWindow?.postMessage({action:"handleClose"},"*"),se(E)}catch(B){console.log("error=>",B)}})()},300)};C.onSymbolChanged().subscribe(null,u),C.onIntervalChanged().subscribe(null,g);try{await v()}catch(E){console.log("error=>",E)}j&&(()=>{try{C.onSymbolChanged().unsubscribe(null,u)}catch{}try{C.onIntervalChanged().unsubscribe(null,g)}catch{}})()}),()=>{j=!0,L.forEach(C=>window.clearTimeout(C)),k(),F.current===s&&(F.current=null)}},[i,n,s,_,f,a,r,t,l,se,d,Y,b,K,W,q,Q,P,X,w]),y.useEffect(()=>{if(s){if(t==""||b)return;s.onChartReady(async()=>{const k=s?.activeChart();se(k.resolution()),s.resetCache(),k.resetData(),k&&k.onDataLoaded().subscribe(null,async()=>{const{data:A}=await k.exportData(),j=Ke(l),L=(r?.timestamp??0)/1e3,re=L-L%j,C=A.findIndex(v=>v[0]===re),I=A.slice(C-49,C+1).map(v=>({o:v[1],h:v[2],l:v[3],c:v[4],timestamp:v[0]*1e3}));if(_){const v=A[A.length-1],u={o:v[1],h:v[2],l:v[3],c:v[4],timestamp:v[0]*1e3},g=k.resolution(),T=we(g)*1e3,E=u.timestamp,B=r?.timestamp??0,$=Math.floor(B/T)*T,U=it.find(G=>G.ticker===d||G.display_name===d)?.session||"24x7",M=Er(E,$,g,U),N=A.slice(-50).map(G=>({o:G[1],h:G[2],l:G[3],c:G[4],timestamp:G[0]*1e3}));q(M),Q(N);const V={newsTargetCandle:N,gapCount:M};D.current=V,J.current&&(w.current?.contentWindow?.postMessage(D.current,"*"),D.current=null)}else{Q(I),q(0);const v={newsTargetCandle:I,gapCount:0};D.current=v,J.current&&(w.current?.contentWindow?.postMessage(D.current,"*"),D.current=null)}},!0)})}},[t,r?.timestamp,Q,se,q,l,_,b,d,s,D]),m.jsx("div",{className:"news-widget_detail_page__container",children:m.jsxs("div",{className:"news-widget_detail_page__right_border",children:[m.jsx("div",{className:"news-widget_detail_page__title_container",children:m.jsxs("div",{className:"news-widget_detail_page__title_padding",children:[m.jsx("button",{type:"button",className:"news-widget__button news-widget__button--ghost news-widget__button--icon news-widget_detail_page__back_button",onClick:S,children:m.jsx(dr,{className:"news-widget_detail_page__back_icon"})}),m.jsx("p",{className:"news-widget_detail_page__title_text",children:"Economic Calendar Analysis"})]})}),m.jsx("div",{className:"news-widget_detail_page__event_details",children:m.jsxs(yr,{newsDetail:o,children:[e,_&&m.jsx(Sr,{replayTabId:t||"news",futureBarsRef:h,highlightBarsRef:x,pushBar:p,tvWidgetRef:F,resolution:l||"15",symbol:d,resolvedTheme:i})]})})]})})},De="https://widget-result-news.iccandle.ai",Ot="https://corprate-widget.iccandle.ai/news",Ar=({chartWidget:e,children:t,widgetKey:n,userId:s,defaultSymbol:r,chartInterval:i="15",theme:o,symbolMapper:a,analyzeCallback:f,pushBar:d,futureRef:l,highlightBarsRef:_,setGapCountExternal:b,setReplayModeExternal:S})=>{const{start:p}=wn(),[w,h]=y.useState(""),[D,J]=y.useState(i),[x,P]=y.useState(r),[X,F]=y.useState(i),[Y,se]=y.useState(r),[Q,q]=y.useState(null),[K,W]=y.useState(null),k=y.useRef(null),A=y.useRef(!1),{setNewsSelectedCandles:j,setNewsPlayEndTimestamp:L,newsTargetCandle:re,gapCount:C}=ge(),I=y.useRef(null),v=Qs[D]||"M15",u=Ke("60"),g=K?.[0]?.timestamp?K?.[0]?.timestamp/1e3:0,T=g-g%u,E=K?.[0]?.candleData.H1?.candles,B=E?.findIndex(z=>z.timestamp===T)||0,U=(E?.length||0)-B<=10,M=!U,N=!!w&&!M,V=y.useRef(N),G=y.useRef(!1);y.useEffect(()=>{if(N!==V.current){if(V.current=N,G.current){G.current=!1;return}p()}},[N,p]),y.useEffect(()=>{const z=async O=>{const{data:Z,status:te}=await H.get(`${Ot}/${O}`,{headers:{"api-key":n},params:{symbol:r}});return te!==200?(console.error("Failed to fetch news detail"),null):Z},ee=async O=>{const{data:Z,status:te}=await H.get(`${Ot}/similar-details`,{headers:{"api-key":n},params:{event_id:O}});return te!==200?(console.error("Failed to fetch compared news"),null):Z};(async()=>{if(w==="")return;const[O,Z]=await Promise.all([z(w),ee(w)]);O&&q(O),Z&&W(Z)})()},[n,w,r]);const ie=y.useCallback(()=>{S(!1),b(0),j(null),L(null)},[S,b,j,L]),pe=y.useCallback(()=>{h(""),P(r),ie()},[r,ie]);y.useEffect(()=>{const z=async({origin:ee,data:le})=>{if(ee!==De||typeof le!="string")return;const O=JSON.parse(le);if(O.action=="back")pe();else if(O.action=="back-to-similar-events")ie();else if(O.action=="eventClicked"){G.current=!0,p();const te=O.data.event,me=e?.activeChart();await e?.headerReady(),me?.clearMarks(2),localStorage.setItem("iccandle:current-news-event",JSON.stringify({actual:te.actual,event_name:te.event_name,forecast:te.forecast,id:te.id,metric:te.metric,previous:te.previous,timestamp:te.timestamp,currency:te.currency})),me?.refreshMarks(),F(D),se(x),h(te.id)}else if(O.action=="intervalChanged"||O.action=="symbolChanged"){const Z=O.data;if(Z.type===2)return;Z.resolution&&J(Z.resolution);const te=it.find(me=>me.display_name==Z.symbol||me.ticker==Z.symbol)?.ticker||"XAU_USD";P(te)}else if(O.action=="replay"){if(M)return;const Z=O.data;S(Z.isReplay),b(C),j(Z.selectedCandles),L(re?.[re.length-1]?.timestamp??null)}else O.action=="iframe-ready"?(A.current=!0,k.current?.contentWindow?.postMessage(I.current,"*"),I.current=null):O.action=="analyze"&&f()};return window.addEventListener("message",z),()=>window.removeEventListener("message",z)},[M,re,C,e,r,p,ie,pe,a,I,F,se,x,D,S,b,L,j,f]);const ce=y.useMemo(()=>{const z=K?.[0]?.candleData?.[v]?.metadata;return z?[...an].sort((ee,le)=>le-ee).find(ee=>[`next_pip_up_${ee}`,`next_pip_down_${ee}`].some(O=>z[O]!==void 0))??null:null},[K,v]);y.useEffect(()=>{const z=()=>{pe()};return window.addEventListener("popstate",z),()=>window.removeEventListener("popstate",z)},[pe]);const de=y.useMemo(()=>w?K?M?`${De}/${w}?apiKey=${n}&userId=${s}&theme=${o}&interval=${X}&symbol=${Y}`:`${De}/similar-events/${w}?apiKey=${n}&userId=${s}&theme=${o}`:`${De}?apiKey=${n}&userId=${s}&theme=${o}`:`${De}?apiKey=${n}&userId=${s}&theme=${o}`,[w,K,M,n,o,s,X,Y]);return m.jsxs("div",{className:"news-widget_main__container news-widget_main__container--lg",children:[m.jsx("div",{className:"news-widget_main__left",style:{display:w&&!M?"flex":"none"},children:m.jsx(tr,{selectedTimeframe:D,setSelectedTimeframe:J,currentSymbol:x,setCurrentSymbol:P,children:m.jsx(Dr,{eventId:w,chartWidget:e,widgetKey:n,theme:o,defaultSymbol:r,newsDetail:Q,isUpcoming:U,event:Q?.event,selectedCandles:ce,currentTimeFrame:D,currentSymbol:x,onBack:pe,isElapsed:M,iframeRef:k,pendingMessageRef:I,iframeReadyToListenRef:A,pushBar:d,futureRef:l,highlightBarsRef:_,setReplayModeExternal:S,setGapCountExternal:b,children:t})})}),m.jsx("iframe",{src:de,ref:k,className:w&&!M?"news-widget_main__iframe_half":"news-widget_main__iframe_full"})]})},Ur="https://api.iccandle.ai",Tr='"Inter Tight", ui-sans-serif, system-ui, sans-serif';function kt(e){return{iccandle_primary:e.iccandle_primary,iccandle_border:e.iccandle_border,iccandle_text:e.iccandle_text,iccandle_background:e.iccandle_background,iccandle_primary_gradient_end:e.iccandle_primary_gradient_end,iccandle_font:e.icc_font??e.iccandle_font??Tr}}const Nr=async e=>{const t=await fetch(`${Ur}/corporate-client/v1/widgetStyle/search/user/?service_type=news`,{headers:{"api-key":e}});if(!t.ok)throw new Error(`Failed to fetch widget style: ${t.statusText}`);const n=await t.json();return{...n,dark:kt(n.dark),light:kt(n.light)}},Ft={iccandle_font:"--iccandle-font",iccandle_primary:"--iccandle-primary",iccandle_border:"--iccandle-border",iccandle_text:"--iccandle-text",iccandle_background:"--iccandle-background",iccandle_primary_gradient_end:"--iccandle-primary-gradient-end"};function vr(e,t){const[n,s]=y.useState(null);y.useEffect(()=>{Nr(e).then(d=>{s(d)})},[e]);const r=y.useRef(null),[i,o]=y.useState(null),a=y.useMemo(()=>t==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t,[t]),f=y.useMemo(()=>{if(n)return a==="dark"?n.dark:n.light},[n,a]);return y.useEffect(()=>{if(typeof window>"u"||!f||!i)return;const d=i;Object.keys(Ft).forEach(l=>{d.style.setProperty(Ft[l],f[l])})},[f,i]),{rootRef:r,setRootEl:o,resolvedTheme:a}}const xr=e=>{const{rootRef:t,setRootEl:n,resolvedTheme:s}=vr(e.widgetKey,e.theme);return m.jsx("div",{ref:r=>{t.current=r,n(r)},className:`news-widget__container news-widget ${s==="dark"?"dark":""}`,children:m.jsx(gn,{theme:s,children:m.jsx(Ar,{...e,children:e.children})})})};exports.NewsWidget=xr;
@@ -30,7 +30,7 @@ function Sn() {
30
30
  function e(u) {
31
31
  if (u == null) return null;
32
32
  if (typeof u == "function")
33
- return u.$$typeof === q ? null : u.displayName || u.name || null;
33
+ return u.$$typeof === V ? null : u.displayName || u.name || null;
34
34
  if (typeof u == "string") return u;
35
35
  switch (u) {
36
36
  case h:
@@ -82,8 +82,8 @@ function Sn() {
82
82
  }
83
83
  if (y) {
84
84
  y = console;
85
- var A = y.error, R = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
86
- return A.call(
85
+ var U = y.error, R = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
86
+ return U.call(
87
87
  y,
88
88
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
89
89
  R
@@ -116,14 +116,14 @@ function Sn() {
116
116
  return u.key !== void 0;
117
117
  }
118
118
  function a(u, y) {
119
- function A() {
119
+ function U() {
120
120
  x || (x = !0, console.error(
121
121
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
122
122
  y
123
123
  ));
124
124
  }
125
- A.isReactWarning = !0, Object.defineProperty(u, "key", {
126
- get: A,
125
+ U.isReactWarning = !0, Object.defineProperty(u, "key", {
126
+ get: U,
127
127
  configurable: !0
128
128
  });
129
129
  }
@@ -133,15 +133,15 @@ function Sn() {
133
133
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
134
134
  )), u = this.props.ref, u !== void 0 ? u : null;
135
135
  }
136
- function d(u, y, A, R, j, I) {
137
- var U = A.ref;
136
+ function d(u, y, U, R, j, I) {
137
+ var A = U.ref;
138
138
  return u = {
139
139
  $$typeof: p,
140
140
  type: u,
141
141
  key: y,
142
- props: A,
142
+ props: U,
143
143
  _owner: R
144
- }, (U !== void 0 ? U : null) !== null ? Object.defineProperty(u, "ref", {
144
+ }, (A !== void 0 ? A : null) !== null ? Object.defineProperty(u, "ref", {
145
145
  enumerable: !1,
146
146
  get: f
147
147
  }) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
@@ -166,25 +166,25 @@ function Sn() {
166
166
  value: I
167
167
  }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
168
168
  }
169
- function l(u, y, A, R, j, I) {
170
- var U = y.children;
171
- if (U !== void 0)
169
+ function l(u, y, U, R, j, I) {
170
+ var A = y.children;
171
+ if (A !== void 0)
172
172
  if (R)
173
- if (D(U)) {
174
- for (R = 0; R < U.length; R++)
175
- _(U[R]);
176
- Object.freeze && Object.freeze(U);
173
+ if (D(A)) {
174
+ for (R = 0; R < A.length; R++)
175
+ _(A[R]);
176
+ Object.freeze && Object.freeze(A);
177
177
  } else
178
178
  console.error(
179
179
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
180
180
  );
181
- else _(U);
181
+ else _(A);
182
182
  if (O.call(y, "key")) {
183
- U = e(u);
184
- var B = Object.keys(y).filter(function(V) {
185
- return V !== "key";
183
+ A = e(u);
184
+ var B = Object.keys(y).filter(function(q) {
185
+ return q !== "key";
186
186
  });
187
- R = 0 < B.length ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}", T[U + R] || (B = 0 < B.length ? "{" + B.join(": ..., ") + ": ...}" : "{}", console.error(
187
+ R = 0 < B.length ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}", N[A + R] || (B = 0 < B.length ? "{" + B.join(": ..., ") + ": ...}" : "{}", console.error(
188
188
  `A props object containing a "key" prop is being spread into JSX:
189
189
  let props = %s;
190
190
  <%s {...props} />
@@ -192,23 +192,23 @@ React keys must be passed directly to JSX without using spread:
192
192
  let props = %s;
193
193
  <%s key={someKey} {...props} />`,
194
194
  R,
195
- U,
195
+ A,
196
196
  B,
197
- U
198
- ), T[U + R] = !0);
197
+ A
198
+ ), N[A + R] = !0);
199
199
  }
200
- if (U = null, A !== void 0 && (n(A), U = "" + A), o(y) && (n(y.key), U = "" + y.key), "key" in y) {
201
- A = {};
202
- for (var N in y)
203
- N !== "key" && (A[N] = y[N]);
204
- } else A = y;
205
- return U && a(
206
- A,
200
+ if (A = null, U !== void 0 && (n(U), A = "" + U), o(y) && (n(y.key), A = "" + y.key), "key" in y) {
201
+ U = {};
202
+ for (var T in y)
203
+ T !== "key" && (U[T] = y[T]);
204
+ } else U = y;
205
+ return A && a(
206
+ U,
207
207
  typeof u == "function" ? u.displayName || u.name || "Unknown" : u
208
208
  ), d(
209
209
  u,
210
- U,
211
210
  A,
211
+ U,
212
212
  r(),
213
213
  j,
214
214
  I
@@ -220,7 +220,7 @@ React keys must be passed directly to JSX without using spread:
220
220
  function C(u) {
221
221
  return typeof u == "object" && u !== null && u.$$typeof === p;
222
222
  }
223
- var E = Te, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), w = /* @__PURE__ */ Symbol.for("react.portal"), h = /* @__PURE__ */ Symbol.for("react.fragment"), S = /* @__PURE__ */ Symbol.for("react.strict_mode"), G = /* @__PURE__ */ Symbol.for("react.profiler"), v = /* @__PURE__ */ Symbol.for("react.consumer"), L = /* @__PURE__ */ Symbol.for("react.context"), J = /* @__PURE__ */ Symbol.for("react.forward_ref"), k = /* @__PURE__ */ Symbol.for("react.suspense"), Y = /* @__PURE__ */ Symbol.for("react.suspense_list"), ne = /* @__PURE__ */ Symbol.for("react.memo"), W = /* @__PURE__ */ Symbol.for("react.lazy"), X = /* @__PURE__ */ Symbol.for("react.activity"), q = /* @__PURE__ */ Symbol.for("react.client.reference"), Z = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, D = Array.isArray, F = console.createTask ? console.createTask : function() {
223
+ var E = Te, p = /* @__PURE__ */ Symbol.for("react.transitional.element"), w = /* @__PURE__ */ Symbol.for("react.portal"), h = /* @__PURE__ */ Symbol.for("react.fragment"), S = /* @__PURE__ */ Symbol.for("react.strict_mode"), G = /* @__PURE__ */ Symbol.for("react.profiler"), v = /* @__PURE__ */ Symbol.for("react.consumer"), L = /* @__PURE__ */ Symbol.for("react.context"), J = /* @__PURE__ */ Symbol.for("react.forward_ref"), k = /* @__PURE__ */ Symbol.for("react.suspense"), Y = /* @__PURE__ */ Symbol.for("react.suspense_list"), ne = /* @__PURE__ */ Symbol.for("react.memo"), W = /* @__PURE__ */ Symbol.for("react.lazy"), X = /* @__PURE__ */ Symbol.for("react.activity"), V = /* @__PURE__ */ Symbol.for("react.client.reference"), Z = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, D = Array.isArray, F = console.createTask ? console.createTask : function() {
224
224
  return null;
225
225
  };
226
226
  E = {
@@ -231,23 +231,23 @@ React keys must be passed directly to JSX without using spread:
231
231
  var x, se = {}, g = E.react_stack_bottom_frame.bind(
232
232
  E,
233
233
  i
234
- )(), H = F(s(i)), T = {};
235
- De.Fragment = h, De.jsx = function(u, y, A) {
234
+ )(), H = F(s(i)), N = {};
235
+ De.Fragment = h, De.jsx = function(u, y, U) {
236
236
  var R = 1e4 > Z.recentlyCreatedOwnerStacks++;
237
237
  return l(
238
238
  u,
239
239
  y,
240
- A,
240
+ U,
241
241
  !1,
242
242
  R ? Error("react-stack-top-frame") : g,
243
243
  R ? F(s(u)) : H
244
244
  );
245
- }, De.jsxs = function(u, y, A) {
245
+ }, De.jsxs = function(u, y, U) {
246
246
  var R = 1e4 > Z.recentlyCreatedOwnerStacks++;
247
247
  return l(
248
248
  u,
249
249
  y,
250
- A,
250
+ U,
251
251
  !0,
252
252
  R ? Error("react-stack-top-frame") : g,
253
253
  R ? F(s(u)) : H
@@ -1589,7 +1589,7 @@ const dn = (e) => {
1589
1589
  headers: ne,
1590
1590
  withCredentials: W = "same-origin",
1591
1591
  fetchOptions: X
1592
- } = dn(p), q = t || fetch;
1592
+ } = dn(p), V = t || fetch;
1593
1593
  Y = Y ? (Y + "").toLowerCase() : "text";
1594
1594
  let Z = Js([G, v && v.toAbortSignal()], L), O = null;
1595
1595
  const D = Z && Z.unsubscribe && (() => {
@@ -1604,11 +1604,11 @@ const dn = (e) => {
1604
1604
  duplex: "half"
1605
1605
  }), y;
1606
1606
  if (c.isFormData(S) && (y = u.headers.get("content-type")) && ne.setContentType(y), u.body) {
1607
- const [A, R] = Et(
1607
+ const [U, R] = Et(
1608
1608
  F,
1609
1609
  He(St(k))
1610
1610
  );
1611
- S = At(u.body, Ut, A, R);
1611
+ S = At(u.body, Ut, U, R);
1612
1612
  }
1613
1613
  }
1614
1614
  c.isString(W) || (W = W ? "include" : "omit");
@@ -1622,29 +1622,29 @@ const dn = (e) => {
1622
1622
  credentials: x ? W : void 0
1623
1623
  };
1624
1624
  O = i && new n(w, se);
1625
- let g = await (i ? q(O, X) : q(w, se));
1625
+ let g = await (i ? V(O, X) : V(w, se));
1626
1626
  const H = l && (Y === "stream" || Y === "response");
1627
1627
  if (l && (J || H && D)) {
1628
1628
  const u = {};
1629
1629
  ["status", "statusText", "headers"].forEach((j) => {
1630
1630
  u[j] = g[j];
1631
1631
  });
1632
- const y = c.toFiniteNumber(g.headers.get("content-length")), [A, R] = J && Et(
1632
+ const y = c.toFiniteNumber(g.headers.get("content-length")), [U, R] = J && Et(
1633
1633
  y,
1634
1634
  He(St(J), !0)
1635
1635
  ) || [];
1636
1636
  g = new s(
1637
- At(g.body, Ut, A, () => {
1637
+ At(g.body, Ut, U, () => {
1638
1638
  R && R(), D && D();
1639
1639
  }),
1640
1640
  u
1641
1641
  );
1642
1642
  }
1643
1643
  Y = Y || "text";
1644
- let T = await _[c.findKey(_, Y) || "text"](g, p);
1644
+ let N = await _[c.findKey(_, Y) || "text"](g, p);
1645
1645
  return !H && D && D(), await new Promise((u, y) => {
1646
1646
  cn(u, y, {
1647
- data: T,
1647
+ data: N,
1648
1648
  headers: oe.from(g.headers),
1649
1649
  status: g.status,
1650
1650
  statusText: g.statusText,
@@ -3186,7 +3186,7 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3186
3186
  })
3187
3187
  ).sort((D, F) => D.time - F.time);
3188
3188
  n.current = X.slice(-50);
3189
- let q = 0, Z = 0;
3189
+ let V = 0, Z = 0;
3190
3190
  const O = async () => {
3191
3191
  p.current && (clearInterval(p.current), p.current = null), E.current = f;
3192
3192
  try {
@@ -3197,9 +3197,9 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3197
3197
  };
3198
3198
  X.length === 0 ? (t.current = [], await O()) : w = setTimeout(() => {
3199
3199
  h || (p.current = setInterval(() => {
3200
- if (q < X.length) {
3201
- if (r(e, X[q]))
3202
- t.current = X.slice(0, q + 1), q++, Z = 0, q === X.length && (t.current = X, O());
3200
+ if (V < X.length) {
3201
+ if (r(e, X[V]))
3202
+ t.current = X.slice(0, V + 1), V++, Z = 0, V === X.length && (t.current = X, O());
3203
3203
  else if (Z++, Z >= 10) {
3204
3204
  t.current = [...X];
3205
3205
  try {
@@ -3281,7 +3281,7 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3281
3281
  const k = fe(null), { setCurrentSymbol: Y, setSelectedTimeframe: ne } = lr(), {
3282
3282
  setNewsTargetCandle: W,
3283
3283
  setGapCount: X,
3284
- setNewsPlayEndTimestamp: q,
3284
+ setNewsPlayEndTimestamp: V,
3285
3285
  setNewsSelectedCandles: Z
3286
3286
  } = be();
3287
3287
  return me(() => {
@@ -3293,8 +3293,8 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3293
3293
  g && g.getAllShapes().forEach((H) => {
3294
3294
  try {
3295
3295
  g.removeEntity(H.id);
3296
- } catch (T) {
3297
- console.error("Failed to remove shape", T);
3296
+ } catch (N) {
3297
+ console.error("Failed to remove shape", N);
3298
3298
  }
3299
3299
  });
3300
3300
  } catch {
@@ -3315,8 +3315,8 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3315
3315
  };
3316
3316
  let F = !1;
3317
3317
  const x = [], se = (g, H) => {
3318
- const T = window.setTimeout(g, H);
3319
- return x.push(T), T;
3318
+ const N = window.setTimeout(g, H);
3319
+ return x.push(N), N;
3320
3320
  };
3321
3321
  return k.current = s, s.onChartReady(async () => {
3322
3322
  i === "dark" || i === "system" ? (s.applyOverrides({
@@ -3352,11 +3352,11 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3352
3352
  overrides: { linestyle: 2, linewidth: 1 }
3353
3353
  }
3354
3354
  );
3355
- const I = await g.exportData(), U = I.data.findIndex((N) => N[0] === j);
3355
+ const I = await g.exportData(), A = I.data.findIndex((T) => T[0] === j);
3356
3356
  let B = a;
3357
- if (U != -1 && !B && (B = [...hn].sort((N, V) => V - N).find((N) => I.data[U + N]) ?? null), U != -1 && B) {
3358
- const N = R, V = I.data[U + B][0], $ = I.data.filter(
3359
- (ae) => ae[0] > N && ae[0] <= V
3357
+ if (A != -1 && !B && (B = [...hn].sort((T, q) => q - T).find((T) => I.data[A + T]) ?? null), A != -1 && B) {
3358
+ const T = R, q = I.data[A + B][0], $ = I.data.filter(
3359
+ (ae) => ae[0] > T && ae[0] <= q
3360
3360
  ) ?? [];
3361
3361
  let re = null, pe = null;
3362
3362
  if ($.length > 0) {
@@ -3380,15 +3380,15 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3380
3380
  };
3381
3381
  }
3382
3382
  if (re && pe && $.length > 0) {
3383
- const ae = re.value, de = pe.value, Q = I.data[U + 1][1];
3383
+ const ae = re.value, de = pe.value, Q = I.data[A + 1][1];
3384
3384
  await g.createMultipointShape(
3385
3385
  [
3386
3386
  {
3387
- time: N,
3387
+ time: T,
3388
3388
  price: Q
3389
3389
  },
3390
3390
  {
3391
- time: V,
3391
+ time: q,
3392
3392
  price: ae
3393
3393
  }
3394
3394
  ],
@@ -3411,11 +3411,11 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3411
3411
  ), await g.createMultipointShape(
3412
3412
  [
3413
3413
  {
3414
- time: N,
3414
+ time: T,
3415
3415
  price: de
3416
3416
  },
3417
3417
  {
3418
- time: V,
3418
+ time: q,
3419
3419
  price: Q
3420
3420
  }
3421
3421
  ],
@@ -3437,11 +3437,11 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3437
3437
  ), await g.createMultipointShape(
3438
3438
  [
3439
3439
  {
3440
- time: N,
3440
+ time: T,
3441
3441
  price: ae
3442
3442
  },
3443
3443
  {
3444
- time: V,
3444
+ time: q,
3445
3445
  price: ae
3446
3446
  }
3447
3447
  ],
@@ -3458,11 +3458,11 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3458
3458
  ), await g.createMultipointShape(
3459
3459
  [
3460
3460
  {
3461
- time: N,
3461
+ time: T,
3462
3462
  price: de
3463
3463
  },
3464
3464
  {
3465
- time: V,
3465
+ time: q,
3466
3466
  price: de
3467
3467
  }
3468
3468
  ],
@@ -3524,7 +3524,7 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3524
3524
  }
3525
3525
  }
3526
3526
  );
3527
- const ee = Math.floor((N + V) / 2);
3527
+ const ee = Math.floor((T + q) / 2);
3528
3528
  await g.createShape(
3529
3529
  {
3530
3530
  time: ee
@@ -3547,16 +3547,16 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3547
3547
  from: I.data[0][0],
3548
3548
  to: I.data[I.data.length - 1][0]
3549
3549
  }), _ && r) {
3550
- const N = Math.floor(Date.now() / 1e3), V = j, $ = g.resolution(), re = 3600 * 24 * 7;
3551
- N - re >= V + re && await g.setVisibleRange(
3550
+ const T = Math.floor(Date.now() / 1e3), q = j, $ = g.resolution(), re = 3600 * 24 * 7;
3551
+ T - re >= q + re && await g.setVisibleRange(
3552
3552
  {
3553
- from: N - re,
3554
- to: V + re
3553
+ from: T - re,
3554
+ to: q + re
3555
3555
  },
3556
3556
  { applyDefaultRightMargin: !0, percentRightMargin: 50 }
3557
3557
  ), se(() => {
3558
3558
  F || k.current !== s || Number($) <= 30 && g.createShape(
3559
- { time: V },
3559
+ { time: q },
3560
3560
  {
3561
3561
  shape: "vertical_line",
3562
3562
  lock: !0,
@@ -3566,18 +3566,18 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3566
3566
  );
3567
3567
  }, 2e3);
3568
3568
  }
3569
- }, T = async () => {
3569
+ }, N = async () => {
3570
3570
  if (F || k.current !== s) return;
3571
3571
  const R = await D();
3572
3572
  if (F || k.current !== s) return;
3573
3573
  O();
3574
- const j = (R?.event?.timestamp ?? 0) / 1e3, I = tt(l), U = j - j % I;
3575
- g.getVisibleBarsRange() || await new Promise((V) => setTimeout(V, 2e3));
3576
- const N = g.getVisibleBarsRange();
3577
- N && N.from <= j && j <= N.to ? await H(j, U) : (_ || await g.setVisibleRange(
3574
+ const j = (R?.event?.timestamp ?? 0) / 1e3, I = tt(l), A = j - j % I;
3575
+ g.getVisibleBarsRange() || await new Promise((q) => setTimeout(q, 2e3));
3576
+ const T = g.getVisibleBarsRange();
3577
+ T && T.from <= j && j <= T.to ? await H(j, A) : (_ || await g.setVisibleRange(
3578
3578
  { from: j },
3579
3579
  { applyDefaultRightMargin: !0, percentRightMargin: 50 }
3580
- ), await H(j, U));
3580
+ ), await H(j, A));
3581
3581
  }, u = () => {
3582
3582
  se(() => {
3583
3583
  F || k.current !== s || d == g.symbol() || (async () => {
@@ -3607,7 +3607,7 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3607
3607
  };
3608
3608
  g.onSymbolChanged().subscribe(null, u), g.onIntervalChanged().subscribe(null, y);
3609
3609
  try {
3610
- C || await T();
3610
+ await N();
3611
3611
  } catch (R) {
3612
3612
  console.log("error=>", R);
3613
3613
  }
@@ -3638,7 +3638,7 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3638
3638
  d,
3639
3639
  Y,
3640
3640
  C,
3641
- q,
3641
+ V,
3642
3642
  Z,
3643
3643
  X,
3644
3644
  W,
@@ -3654,48 +3654,48 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3654
3654
  null,
3655
3655
  async () => {
3656
3656
  const { data: D } = await O.exportData(), F = tt(l), x = (r?.timestamp ?? 0) / 1e3, se = x - x % F, g = D.findIndex(
3657
- (T) => T[0] === se
3658
- ), H = D.slice(g - 49, g + 1).map((T) => ({
3659
- o: T[1],
3660
- h: T[2],
3661
- l: T[3],
3662
- c: T[4],
3663
- timestamp: T[0] * 1e3
3657
+ (N) => N[0] === se
3658
+ ), H = D.slice(g - 49, g + 1).map((N) => ({
3659
+ o: N[1],
3660
+ h: N[2],
3661
+ l: N[3],
3662
+ c: N[4],
3663
+ timestamp: N[0] * 1e3
3664
3664
  }));
3665
3665
  if (_) {
3666
- const T = D[D.length - 1], u = {
3667
- o: T[1],
3668
- h: T[2],
3669
- l: T[3],
3670
- c: T[4],
3671
- timestamp: T[0] * 1e3
3672
- }, y = O.resolution(), A = ge(y) * 1e3, R = u.timestamp, j = r?.timestamp ?? 0, I = Math.floor(j / A) * A, U = ut.find(
3666
+ const N = D[D.length - 1], u = {
3667
+ o: N[1],
3668
+ h: N[2],
3669
+ l: N[3],
3670
+ c: N[4],
3671
+ timestamp: N[0] * 1e3
3672
+ }, y = O.resolution(), U = ge(y) * 1e3, R = u.timestamp, j = r?.timestamp ?? 0, I = Math.floor(j / U) * U, A = ut.find(
3673
3673
  ($) => $.ticker === d || $.display_name === d
3674
3674
  )?.session || "24x7", B = Lr(
3675
3675
  R,
3676
3676
  I,
3677
3677
  y,
3678
- U
3679
- ), N = D.slice(-50).map(($) => ({
3678
+ A
3679
+ ), T = D.slice(-50).map(($) => ({
3680
3680
  o: $[1],
3681
3681
  h: $[2],
3682
3682
  l: $[3],
3683
3683
  c: $[4],
3684
3684
  timestamp: $[0] * 1e3
3685
3685
  }));
3686
- X(B), W(N);
3687
- const V = { newsTargetCandle: N, gapCount: B };
3688
- S.current = V, G.current && (w.current?.contentWindow?.postMessage(
3686
+ X(B), W(T);
3687
+ const q = { newsTargetCandle: T, gapCount: B };
3688
+ S.current = q, G.current && (w.current?.contentWindow?.postMessage(
3689
3689
  S.current,
3690
3690
  "*"
3691
3691
  ), S.current = null);
3692
3692
  } else {
3693
3693
  W(H), X(0);
3694
- const T = {
3694
+ const N = {
3695
3695
  newsTargetCandle: H,
3696
3696
  gapCount: 0
3697
3697
  };
3698
- S.current = T, G.current && (w.current?.contentWindow?.postMessage(
3698
+ S.current = N, G.current && (w.current?.contentWindow?.postMessage(
3699
3699
  S.current,
3700
3700
  "*"
3701
3701
  ), S.current = null);
@@ -3763,23 +3763,23 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3763
3763
  setGapCountExternal: C,
3764
3764
  setReplayModeExternal: E
3765
3765
  }) => {
3766
- const { start: p } = An(), [w, h] = le(""), [S, G] = le(i), [v, L] = le(r), [J, k] = le(i), [Y, ne] = le(r), [W, X] = le(null), [q, Z] = le(
3766
+ const { start: p } = An(), [w, h] = le(""), [S, G] = le(i), [v, L] = le(r), [J, k] = le(i), [Y, ne] = le(r), [W, X] = le(null), [V, Z] = le(
3767
3767
  null
3768
3768
  ), O = fe(null), D = fe(!1), {
3769
3769
  setNewsSelectedCandles: F,
3770
3770
  setNewsPlayEndTimestamp: x,
3771
3771
  newsTargetCandle: se,
3772
3772
  gapCount: g
3773
- } = be(), H = fe(null), T = cr[S] || "M15", u = tt("60"), y = q?.[0]?.timestamp ? q?.[0]?.timestamp / 1e3 : 0, A = y - y % u, R = q?.[0]?.candleData.H1?.candles, j = R?.findIndex((K) => K.timestamp === A) || 0, U = (R?.length || 0) - j <= 10, B = "next_pip_up_10" in (q?.[0]?.candleData[T]?.metadata ?? {}), N = !!w && !B, V = fe(N), $ = fe(!1);
3773
+ } = be(), H = fe(null), N = cr[S] || "M15", u = tt("60"), y = V?.[0]?.timestamp ? V?.[0]?.timestamp / 1e3 : 0, U = y - y % u, R = V?.[0]?.candleData.H1?.candles, j = R?.findIndex((K) => K.timestamp === U) || 0, A = (R?.length || 0) - j <= 10, B = !A, T = !!w && !B, q = fe(T), $ = fe(!1);
3774
3774
  me(() => {
3775
- if (N !== V.current) {
3776
- if (V.current = N, $.current) {
3775
+ if (T !== q.current) {
3776
+ if (q.current = T, $.current) {
3777
3777
  $.current = !1;
3778
3778
  return;
3779
3779
  }
3780
3780
  p();
3781
3781
  }
3782
- }, [N, p]), me(() => {
3782
+ }, [T, p]), me(() => {
3783
3783
  const K = async (P) => {
3784
3784
  const { data: z, status: ee } = await M.get(
3785
3785
  `${Mt}/${P}`,
@@ -3884,23 +3884,23 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3884
3884
  f
3885
3885
  ]);
3886
3886
  const ae = Ne(() => {
3887
- const K = q?.[0]?.candleData?.[T]?.metadata;
3887
+ const K = V?.[0]?.candleData?.[N]?.metadata;
3888
3888
  return K ? [...hn].sort((Q, ce) => ce - Q).find((Q) => [
3889
3889
  `next_pip_up_${Q}`,
3890
3890
  `next_pip_down_${Q}`
3891
3891
  ].some(
3892
3892
  (P) => K[P] !== void 0
3893
3893
  )) ?? null : null;
3894
- }, [q, T]);
3894
+ }, [V, N]);
3895
3895
  me(() => {
3896
3896
  const K = () => {
3897
3897
  pe();
3898
3898
  };
3899
3899
  return window.addEventListener("popstate", K), () => window.removeEventListener("popstate", K);
3900
3900
  }, [pe]);
3901
- const de = Ne(() => w ? q ? B ? `${Ue}/${w}?apiKey=${n}&userId=${s}&theme=${o}&interval=${J}&symbol=${Y}` : `${Ue}/similar-events/${w}?apiKey=${n}&userId=${s}&theme=${o}` : `${Ue}?apiKey=${n}&userId=${s}&theme=${o}` : `${Ue}?apiKey=${n}&userId=${s}&theme=${o}`, [
3901
+ const de = Ne(() => w ? V ? B ? `${Ue}/${w}?apiKey=${n}&userId=${s}&theme=${o}&interval=${J}&symbol=${Y}` : `${Ue}/similar-events/${w}?apiKey=${n}&userId=${s}&theme=${o}` : `${Ue}?apiKey=${n}&userId=${s}&theme=${o}` : `${Ue}?apiKey=${n}&userId=${s}&theme=${o}`, [
3902
3902
  w,
3903
- q,
3903
+ V,
3904
3904
  B,
3905
3905
  n,
3906
3906
  o,
@@ -3930,7 +3930,7 @@ const ge = (e) => e === "1" ? 60 : e === "5" ? 300 : e === "1D" ? 1440 * 3600 :
3930
3930
  theme: o,
3931
3931
  defaultSymbol: r,
3932
3932
  newsDetail: W,
3933
- isUpcoming: U,
3933
+ isUpcoming: A,
3934
3934
  event: W?.event,
3935
3935
  selectedCandles: ae,
3936
3936
  currentTimeFrame: S,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iccandle/news",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "author": "ICCandle",
6
6
  "license": "MIT",