@hedia/web-public 3.5.0-860 → 3.5.0-861
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,4 +1,4 @@
|
|
|
1
|
-
("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"ceeaf96e5510755b1a066fc381a1a7692a9a388a"};try{e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(t=(new e.Error).stack)&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3c7d2785-acc3-4be7-80c0-d2caf6f732da",e._sentryDebugIdIdentifier="sentry-dbid-3c7d2785-acc3-4be7-80c0-d2caf6f732da")}catch(e){}var e,t;function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}),n}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var r,a,o={exports:{}},s={};function l(){return a||(a=1,o.exports=function(){if(r)return s;r=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,i){var r=null;if(void 0!==i&&(r=""+i),void 0!==n.key&&(r=""+n.key),"key"in n)for(var a in i={},n)"key"!==a&&(i[a]=n[a]);else i=n;return n=i.ref,{$$typeof:e,type:t,key:r,ref:void 0!==n?n:null,props:i}}return s.Fragment=t,s.jsx=n,s.jsxs=n,s}()),o.exports}var u,c,d=l(),h={exports:{}},m={},p={exports:{}},f={};function _(){return c||(c=1,p.exports=(u||(u=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var i=n-1>>>1,a=e[i];if(!(0<r(a,t)))break e;e[i]=t,e[n]=a,n=i}}function n(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,a=e.length,o=a>>>1;i<o;){var s=2*(i+1)-1,l=e[s],u=s+1,c=e[u];if(0>r(l,n))u<a&&0>r(c,l)?(e[i]=c,e[u]=n,i=u):(e[i]=l,e[s]=n,i=s);else{if(!(u<a&&0>r(c,n)))break e;e[i]=c,e[u]=n,i=u}}}return t}function r(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],c=1,d=null,h=3,m=!1,p=!1,f=!1,_="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function v(e){for(var r=n(u);null!==r;){if(null===r.callback)i(u);else{if(!(r.startTime<=e))break;i(u),r.sortIndex=r.expirationTime,t(l,r)}r=n(u)}}function b(e){if(f=!1,v(e),!p)if(null!==n(l))p=!0,R();else{var t=n(u);null!==t&&A(b,t.startTime-e)}}var S,w=!1,k=-1,C=5,E=-1;function I(){return!(e.unstable_now()-E<C)}function x(){if(w){var t=e.unstable_now();E=t;var r=!0;try{e:{p=!1,f&&(f=!1,g(k),k=-1),m=!0;var a=h;try{t:{for(v(t),d=n(l);null!==d&&!(d.expirationTime>t&&I());){var o=d.callback;if("function"==typeof o){d.callback=null,h=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof s){d.callback=s,v(t),r=!0;break t}d===n(l)&&i(l),v(t)}else i(l);d=n(l)}if(null!==d)r=!0;else{var c=n(u);null!==c&&A(b,c.startTime-t),r=!1}}break e}finally{d=null,h=a,m=!1}r=void 0}}finally{r?S():w=!1}}}if("function"==typeof y)S=function(){y(x)};else if("undefined"!=typeof MessageChannel){var T=new MessageChannel,O=T.port2;T.port1.onmessage=x,S=function(){O.postMessage(null)}}else S=function(){_(x,0)};function R(){w||(w=!0,S())}function A(t,n){k=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||m||(p=!0,R())},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},e.unstable_scheduleCallback=function(i,r,a){var o=e.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?o+a:o,i){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return i={id:c++,callback:r,priorityLevel:i,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(i.sortIndex=a,t(u,i),null===n(l)&&i===n(u)&&(f?(g(k),k=-1):f=!0,A(b,a-o))):(i.sortIndex=s,t(l,i),p||m||(p=!0,R())),i},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}}(f)),f)),p.exports}var g,y,v={exports:{}},b={};function S(){if(g)return b;g=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.iterator;var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,p={};function f(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||h}function _(){}function y(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||h}f.prototype.isReactComponent={},f.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},f.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_.prototype=f.prototype;var v=y.prototype=new _;v.constructor=y,m(v,f.prototype),v.isPureReactComponent=!0;var S=Array.isArray,w={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function C(t,n,i,r,a,o){return i=o.ref,{$$typeof:e,type:t,key:n,ref:void 0!==i?i:null,props:o}}function E(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var I=/\/+/g;function x(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,i={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return i[e]})):t.toString(36);var n,i}function T(){}function O(n,i,r,a,o){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l,u,h=!1;if(null===n)h=!0;else switch(s){case"bigint":case"string":case"number":h=!0;break;case"object":switch(n.$$typeof){case e:case t:h=!0;break;case c:return O((h=n._init)(n._payload),i,r,a,o)}}if(h)return o=o(n),h=""===a?"."+x(n,0):a,S(o)?(r="",null!=h&&(r=h.replace(I,"$&/")+"/"),O(o,i,r,"",function(e){return e})):null!=o&&(E(o)&&(l=o,u=r+(null==o.key||n&&n.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+h,o=C(l.type,u,void 0,0,0,l.props)),i.push(o)),1;h=0;var m,p=""===a?".":a+":";if(S(n))for(var f=0;f<n.length;f++)h+=O(a=n[f],i,r,s=p+x(a,f),o);else if("function"==typeof(f=null===(m=n)||"object"!=typeof m?null:"function"==typeof(m=d&&m[d]||m["@@iterator"])?m:null))for(n=f.call(n),f=0;!(a=n.next()).done;)h+=O(a=a.value,i,r,s=p+x(a,f++),o);else if("object"===s){if("function"==typeof n.then)return O(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(T,T):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(n),i,r,a,o);throw i=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===i?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return h}function R(e,t,n){if(null==e)return e;var i=[],r=0;return O(e,i,"","",function(e){return t.call(n,e,r++)}),i}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var L="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function P(){}return b.Children={map:R,forEach:function(e,t,n){R(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return R(e,function(){t++}),t},toArray:function(e){return R(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},b.Component=f,b.Fragment=n,b.Profiler=r,b.PureComponent=y,b.StrictMode=i,b.Suspense=l,b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,b.act=function(){throw Error("act(...) is not supported in production builds of React.")},b.cache=function(e){return function(){return e.apply(null,arguments)}},b.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var i=m({},e.props),r=e.key;if(null!=t)for(a in void 0!==t.ref&&void 0,void 0!==t.key&&(r=""+t.key),t)!k.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(i[a]=t[a]);var a=arguments.length-2;if(1===a)i.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];i.children=o}return C(e.type,r,void 0,0,0,i)},b.createContext=function(e){return(e={$$typeof:o,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:a,_context:e},e},b.createElement=function(e,t,n){var i,r={},a=null;if(null!=t)for(i in void 0!==t.key&&(a=""+t.key),t)k.call(t,i)&&"key"!==i&&"__self"!==i&&"__source"!==i&&(r[i]=t[i]);var o=arguments.length-2;if(1===o)r.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(i in o=e.defaultProps)void 0===r[i]&&(r[i]=o[i]);return C(e,a,void 0,0,0,r)},b.createRef=function(){return{current:null}},b.forwardRef=function(e){return{$$typeof:s,render:e}},b.isValidElement=E,b.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:A}},b.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},b.startTransition=function(e){var t=w.T,n={};w.T=n;try{var i=e(),r=w.S;null!==r&&r(n,i),"object"==typeof i&&null!==i&&"function"==typeof i.then&&i.then(P,L)}catch(a){L(a)}finally{w.T=t}},b.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},b.use=function(e){return w.H.use(e)},b.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},b.useCallback=function(e,t){return w.H.useCallback(e,t)},b.useContext=function(e){return w.H.useContext(e)},b.useDebugValue=function(){},b.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},b.useEffect=function(e,t){return w.H.useEffect(e,t)},b.useId=function(){return w.H.useId()},b.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},b.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},b.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},b.useMemo=function(e,t){return w.H.useMemo(e,t)},b.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},b.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},b.useRef=function(e){return w.H.useRef(e)},b.useState=function(e){return w.H.useState(e)},b.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},b.useTransition=function(){return w.H.useTransition()},b.version="19.0.0",b}function w(){return y||(y=1,v.exports=S()),v.exports}var k,C,E,I,x={exports:{}},T={};function O(){if(k)return T;k=1;var e=w();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return T.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,T.createPortal=function(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:r,key:null==i?null:""+i,children:e,containerInfo:t,implementation:n}}(e,n,null,i)},T.flushSync=function(e){var t=a.T,n=i.p;try{if(a.T=null,i.p=2,e)return e()}finally{a.T=t,i.p=n,i.d.f()}},T.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,i.d.C(e,t))},T.prefetchDNS=function(e){"string"==typeof e&&i.d.D(e)},T.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,r=o(n,t.crossOrigin),a="string"==typeof t.integrity?t.integrity:void 0,s="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?i.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:s}):"script"===n&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:s,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},T.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=o(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&i.d.M(e)},T.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,r=o(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},T.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=o(t.as,t.crossOrigin);i.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else i.d.m(e)},T.requestFormReset=function(e){i.d.r(e)},T.unstable_batchedUpdates=function(e,t){return e(t)},T.useFormState=function(e,t,n){return a.H.useFormState(e,t,n)},T.useFormStatus=function(){return a.H.useHostTransitionStatus()},T.version="19.0.0",T}function R(){if(C)return x.exports;return C=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),x.exports=O(),x.exports}function A(){if(E)return m;E=1;
|
|
1
|
+
("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"9b47d2c3c5eacff2c28500864e85a0c35fa8b7f9"};try{e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},(t=(new e.Error).stack)&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="95accdca-c0fb-4fec-8742-ca299a0a59a1",e._sentryDebugIdIdentifier="sentry-dbid-95accdca-c0fb-4fec-8742-ca299a0a59a1")}catch(e){}var e,t;function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function i(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var n=function e(){var n=!1;try{n=this instanceof e}catch{}return n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})}),n}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver(e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)}).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();var r,a,o={exports:{}},s={};function l(){return a||(a=1,o.exports=function(){if(r)return s;r=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,i){var r=null;if(void 0!==i&&(r=""+i),void 0!==n.key&&(r=""+n.key),"key"in n)for(var a in i={},n)"key"!==a&&(i[a]=n[a]);else i=n;return n=i.ref,{$$typeof:e,type:t,key:r,ref:void 0!==n?n:null,props:i}}return s.Fragment=t,s.jsx=n,s.jsxs=n,s}()),o.exports}var u,c,d=l(),h={exports:{}},m={},p={exports:{}},f={};function _(){return c||(c=1,p.exports=(u||(u=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var i=n-1>>>1,a=e[i];if(!(0<r(a,t)))break e;e[i]=t,e[n]=a,n=i}}function n(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,a=e.length,o=a>>>1;i<o;){var s=2*(i+1)-1,l=e[s],u=s+1,c=e[u];if(0>r(l,n))u<a&&0>r(c,l)?(e[i]=c,e[u]=n,i=u):(e[i]=l,e[s]=n,i=s);else{if(!(u<a&&0>r(c,n)))break e;e[i]=c,e[u]=n,i=u}}}return t}function r(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],c=1,d=null,h=3,m=!1,p=!1,f=!1,_="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function v(e){for(var r=n(u);null!==r;){if(null===r.callback)i(u);else{if(!(r.startTime<=e))break;i(u),r.sortIndex=r.expirationTime,t(l,r)}r=n(u)}}function b(e){if(f=!1,v(e),!p)if(null!==n(l))p=!0,R();else{var t=n(u);null!==t&&A(b,t.startTime-e)}}var S,w=!1,k=-1,C=5,E=-1;function I(){return!(e.unstable_now()-E<C)}function x(){if(w){var t=e.unstable_now();E=t;var r=!0;try{e:{p=!1,f&&(f=!1,g(k),k=-1),m=!0;var a=h;try{t:{for(v(t),d=n(l);null!==d&&!(d.expirationTime>t&&I());){var o=d.callback;if("function"==typeof o){d.callback=null,h=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof s){d.callback=s,v(t),r=!0;break t}d===n(l)&&i(l),v(t)}else i(l);d=n(l)}if(null!==d)r=!0;else{var c=n(u);null!==c&&A(b,c.startTime-t),r=!1}}break e}finally{d=null,h=a,m=!1}r=void 0}}finally{r?S():w=!1}}}if("function"==typeof y)S=function(){y(x)};else if("undefined"!=typeof MessageChannel){var T=new MessageChannel,O=T.port2;T.port1.onmessage=x,S=function(){O.postMessage(null)}}else S=function(){_(x,0)};function R(){w||(w=!0,S())}function A(t,n){k=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){p||m||(p=!0,R())},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(h){case 1:case 2:case 3:var t=3;break;default:t=h}var n=h;h=t;try{return e()}finally{h=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=h;h=e;try{return t()}finally{h=n}},e.unstable_scheduleCallback=function(i,r,a){var o=e.unstable_now();switch(a="object"==typeof a&&null!==a&&"number"==typeof(a=a.delay)&&0<a?o+a:o,i){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return i={id:c++,callback:r,priorityLevel:i,startTime:a,expirationTime:s=a+s,sortIndex:-1},a>o?(i.sortIndex=a,t(u,i),null===n(l)&&i===n(u)&&(f?(g(k),k=-1):f=!0,A(b,a-o))):(i.sortIndex=s,t(l,i),p||m||(p=!0,R())),i},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}}(f)),f)),p.exports}var g,y,v={exports:{}},b={};function S(){if(g)return b;g=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.iterator;var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,p={};function f(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||h}function _(){}function y(e,t,n){this.props=e,this.context=t,this.refs=p,this.updater=n||h}f.prototype.isReactComponent={},f.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},f.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},_.prototype=f.prototype;var v=y.prototype=new _;v.constructor=y,m(v,f.prototype),v.isPureReactComponent=!0;var S=Array.isArray,w={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function C(t,n,i,r,a,o){return i=o.ref,{$$typeof:e,type:t,key:n,ref:void 0!==i?i:null,props:o}}function E(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var I=/\/+/g;function x(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(n=""+e.key,i={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,function(e){return i[e]})):t.toString(36);var n,i}function T(){}function O(n,i,r,a,o){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l,u,h=!1;if(null===n)h=!0;else switch(s){case"bigint":case"string":case"number":h=!0;break;case"object":switch(n.$$typeof){case e:case t:h=!0;break;case c:return O((h=n._init)(n._payload),i,r,a,o)}}if(h)return o=o(n),h=""===a?"."+x(n,0):a,S(o)?(r="",null!=h&&(r=h.replace(I,"$&/")+"/"),O(o,i,r,"",function(e){return e})):null!=o&&(E(o)&&(l=o,u=r+(null==o.key||n&&n.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+h,o=C(l.type,u,void 0,0,0,l.props)),i.push(o)),1;h=0;var m,p=""===a?".":a+":";if(S(n))for(var f=0;f<n.length;f++)h+=O(a=n[f],i,r,s=p+x(a,f),o);else if("function"==typeof(f=null===(m=n)||"object"!=typeof m?null:"function"==typeof(m=d&&m[d]||m["@@iterator"])?m:null))for(n=f.call(n),f=0;!(a=n.next()).done;)h+=O(a=a.value,i,r,s=p+x(a,f++),o);else if("object"===s){if("function"==typeof n.then)return O(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(T,T):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(n),i,r,a,o);throw i=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===i?"object with keys {"+Object.keys(n).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead.")}return h}function R(e,t,n){if(null==e)return e;var i=[],r=0;return O(e,i,"","",function(e){return t.call(n,e,r++)}),i}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var L="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function P(){}return b.Children={map:R,forEach:function(e,t,n){R(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return R(e,function(){t++}),t},toArray:function(e){return R(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},b.Component=f,b.Fragment=n,b.Profiler=r,b.PureComponent=y,b.StrictMode=i,b.Suspense=l,b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,b.act=function(){throw Error("act(...) is not supported in production builds of React.")},b.cache=function(e){return function(){return e.apply(null,arguments)}},b.cloneElement=function(e,t,n){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var i=m({},e.props),r=e.key;if(null!=t)for(a in void 0!==t.ref&&void 0,void 0!==t.key&&(r=""+t.key),t)!k.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(i[a]=t[a]);var a=arguments.length-2;if(1===a)i.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];i.children=o}return C(e.type,r,void 0,0,0,i)},b.createContext=function(e){return(e={$$typeof:o,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:a,_context:e},e},b.createElement=function(e,t,n){var i,r={},a=null;if(null!=t)for(i in void 0!==t.key&&(a=""+t.key),t)k.call(t,i)&&"key"!==i&&"__self"!==i&&"__source"!==i&&(r[i]=t[i]);var o=arguments.length-2;if(1===o)r.children=n;else if(1<o){for(var s=Array(o),l=0;l<o;l++)s[l]=arguments[l+2];r.children=s}if(e&&e.defaultProps)for(i in o=e.defaultProps)void 0===r[i]&&(r[i]=o[i]);return C(e,a,void 0,0,0,r)},b.createRef=function(){return{current:null}},b.forwardRef=function(e){return{$$typeof:s,render:e}},b.isValidElement=E,b.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:A}},b.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},b.startTransition=function(e){var t=w.T,n={};w.T=n;try{var i=e(),r=w.S;null!==r&&r(n,i),"object"==typeof i&&null!==i&&"function"==typeof i.then&&i.then(P,L)}catch(a){L(a)}finally{w.T=t}},b.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},b.use=function(e){return w.H.use(e)},b.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},b.useCallback=function(e,t){return w.H.useCallback(e,t)},b.useContext=function(e){return w.H.useContext(e)},b.useDebugValue=function(){},b.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},b.useEffect=function(e,t){return w.H.useEffect(e,t)},b.useId=function(){return w.H.useId()},b.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},b.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},b.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},b.useMemo=function(e,t){return w.H.useMemo(e,t)},b.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},b.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},b.useRef=function(e){return w.H.useRef(e)},b.useState=function(e){return w.H.useState(e)},b.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},b.useTransition=function(){return w.H.useTransition()},b.version="19.0.0",b}function w(){return y||(y=1,v.exports=S()),v.exports}var k,C,E,I,x={exports:{}},T={};function O(){if(k)return T;k=1;var e=w();function t(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},r=Symbol.for("react.portal");var a=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(e,t){return"font"===e?"":"string"==typeof t?"use-credentials"===t?t:"":void 0}return T.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,T.createPortal=function(e,n){var i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!n||1!==n.nodeType&&9!==n.nodeType&&11!==n.nodeType)throw Error(t(299));return function(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:r,key:null==i?null:""+i,children:e,containerInfo:t,implementation:n}}(e,n,null,i)},T.flushSync=function(e){var t=a.T,n=i.p;try{if(a.T=null,i.p=2,e)return e()}finally{a.T=t,i.p=n,i.d.f()}},T.preconnect=function(e,t){"string"==typeof e&&(t?t="string"==typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,i.d.C(e,t))},T.prefetchDNS=function(e){"string"==typeof e&&i.d.D(e)},T.preinit=function(e,t){if("string"==typeof e&&t&&"string"==typeof t.as){var n=t.as,r=o(n,t.crossOrigin),a="string"==typeof t.integrity?t.integrity:void 0,s="string"==typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?i.d.S(e,"string"==typeof t.precedence?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:s}):"script"===n&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:s,nonce:"string"==typeof t.nonce?t.nonce:void 0})}},T.preinitModule=function(e,t){if("string"==typeof e)if("object"==typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=o(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0})}}else null==t&&i.d.M(e)},T.preload=function(e,t){if("string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var n=t.as,r=o(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},T.preloadModule=function(e,t){if("string"==typeof e)if(t){var n=o(t.as,t.crossOrigin);i.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})}else i.d.m(e)},T.requestFormReset=function(e){i.d.r(e)},T.unstable_batchedUpdates=function(e,t){return e(t)},T.useFormState=function(e,t,n){return a.H.useFormState(e,t,n)},T.useFormStatus=function(){return a.H.useHostTransitionStatus()},T.version="19.0.0",T}function R(){if(C)return x.exports;return C=1,function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),x.exports=O(),x.exports}function A(){if(E)return m;E=1;
|
|
2
2
|
/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-dom-client.production.js
|
|
@@ -16,5 +16,5 @@ var t=_(),n=w(),i=R();function r(e){var t="https://react.dev/errors/"+e;if(1<arg
|
|
|
16
16
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
17
17
|
* @license MIT
|
|
18
18
|
*/
|
|
19
|
-
const n=function(){if(jz)return Hz;jz=1,Hz.byteLength=function(e){var t=a(e),n=t[0],i=t[1];return 3*(n+i)/4-i},Hz.toByteArray=function(e){var i,r,o=a(e),s=o[0],l=o[1],u=new n(function(e,t,n){return 3*(t+n)/4-n}(0,s,l)),c=0,d=l>0?s-4:s;for(r=0;r<d;r+=4)i=t[e.charCodeAt(r)]<<18|t[e.charCodeAt(r+1)]<<12|t[e.charCodeAt(r+2)]<<6|t[e.charCodeAt(r+3)],u[c++]=i>>16&255,u[c++]=i>>8&255,u[c++]=255&i;return 2===l&&(i=t[e.charCodeAt(r)]<<2|t[e.charCodeAt(r+1)]>>4,u[c++]=255&i),1===l&&(i=t[e.charCodeAt(r)]<<10|t[e.charCodeAt(r+1)]<<4|t[e.charCodeAt(r+2)]>>2,u[c++]=i>>8&255,u[c++]=255&i),u},Hz.fromByteArray=function(t){for(var n,i=t.length,r=i%3,a=[],o=16383,l=0,u=i-r;l<u;l+=o)a.push(s(t,l,l+o>u?u:l+o));return 1===r?(n=t[i-1],a.push(e[n>>2]+e[n<<4&63]+"==")):2===r&&(n=(t[i-2]<<8)+t[i-1],a.push(e[n>>10]+e[n>>4&63]+e[n<<2&63]+"=")),a.join("")};for(var e=[],t=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)e[r]=i[r],t[i.charCodeAt(r)]=r;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function o(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function s(e,t,n){for(var i,r=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),r.push(o(i));return r.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,Hz}(),i=(zz||(zz=1,Gz.read=function(e,t,n,i,r){var a,o,s=8*r-i-1,l=(1<<s)-1,u=l>>1,c=-7,d=n?r-1:0,h=n?-1:1,m=e[t+d];for(d+=h,a=m&(1<<-c)-1,m>>=-c,c+=s;c>0;a=256*a+e[t+d],d+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=i;c>0;o=256*o+e[t+d],d+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(m?-1:1);o+=Math.pow(2,i),a-=u}return(m?-1:1)*o*Math.pow(2,a-i)},Gz.write=function(e,t,n,i,r,a){var o,s,l,u=8*a-r-1,c=(1<<u)-1,d=c>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:a-1,p=i?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(o++,l/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*l-1)*Math.pow(2,r),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;e[n+m]=255&s,m+=p,s/=256,r-=8);for(o=o<<r|s,u+=r;u>0;e[n+m]=255&o,m+=p,o/=256,u-=8);e[n+m-p]|=128*f}),Gz),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function o(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|p(e,t);let i=o(n);const r=i.write(e,t);return r!==n&&(i=i.slice(0,r)),i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return s.from(i,t,n);const r=function(e){if(s.isBuffer(e)){const t=0|m(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||q(e.length)?o(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),o(e<0?0:0|m(e))}function d(e){const t=e.length<0?0:0|m(e.length),n=o(t);for(let i=0;i<t;i+=1)n[i]=255&e[i];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(i,s.prototype),i}function m(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function p(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(r)return i?-1:W(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,n){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return x(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function _(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function g(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),q(n=+n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=s.from(t,i)),s.isBuffer(t))return 0===t.length?-1:y(e,t,n,i,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,i,r){let a,o=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){let i=-1;for(a=n;a<s;a++)if(u(e,a)===u(t,-1===i?0:a-i)){if(-1===i&&(i=a),a-i+1===l)return i*o}else-1!==i&&(a-=a-i),i=-1}else for(n+l>s&&(n=s-l),a=n;a>=0;a--){let n=!0;for(let i=0;i<l;i++)if(u(e,a+i)!==u(t,i)){n=!1;break}if(n)return a}return-1}function v(e,t,n,i){n=Number(n)||0;const r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;const a=t.length;let o;for(i>a/2&&(i=a/2),o=0;o<i;++o){const i=parseInt(t.substr(2*o,2),16);if(q(i))return o;e[n+o]=i}return o}function b(e,t,n,i){return $(W(t,e.length-n),e,n,i)}function S(e,t,n,i){return $(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,i)}function w(e,t,n,i){return $(Y(t),e,n,i)}function k(e,t,n,i){return $(function(e,t){let n,i,r;const a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),i=n>>8,r=n%256,a.push(r),a.push(i);return a}(t,e.length-n),e,n,i)}function C(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function E(e,t,n){n=Math.min(e.length,n);const i=[];let r=t;for(;r<n;){const t=e[r];let a=null,o=t>239?4:t>223?3:t>191?2:1;if(r+o<=n){let n,i,s,l;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[r+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(a=l));break;case 3:n=e[r+1],i=e[r+2],128==(192&n)&&128==(192&i)&&(l=(15&t)<<12|(63&n)<<6|63&i,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:n=e[r+1],i=e[r+2],s=e[r+3],128==(192&n)&&128==(192&i)&&128==(192&s)&&(l=(15&t)<<18|(63&n)<<12|(63&i)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|1023&a),i.push(a),r+=o}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let n="",i=0;for(;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=I));return n}(i)}t.kMaxLength=a,s.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(X(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t.length;for(let r=0,a=Math.min(n,i);r<a;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:i<n?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const i=s.allocUnsafe(t);let r=0;for(n=0;n<e.length;++n){let t=e[n];if(X(t,Uint8Array))r+t.length>i.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(i,r)):Uint8Array.prototype.set.call(i,t,r);else{if(!s.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,r)}r+=t.length}return i},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)_(this,t,t+1);return this},s.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this},s.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this},s.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):f.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,i,r){if(X(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;let a=(r>>>=0)-(i>>>=0),o=(n>>>=0)-(t>>>=0);const l=Math.min(a,o),u=this.slice(i,r),c=e.slice(t,n);for(let s=0;s<l;++s)if(u[s]!==c[s]){a=u[s],o=c[s];break}return a<o?-1:o<a?1:0},s.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},s.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},s.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}const r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function x(e,t,n){let i="";n=Math.min(e.length,n);for(let r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}function T(e,t,n){let i="";n=Math.min(e.length,n);for(let r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function O(e,t,n){const i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);let r="";for(let a=t;a<n;++a)r+=Z[e[a]];return r}function R(e,t,n){const i=e.slice(t,n);let r="";for(let a=0;a<i.length-1;a+=2)r+=String.fromCharCode(i[a]+256*i[a+1]);return r}function A(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,i,r,a){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<a)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function P(e,t,n,i,r){H(t,i,r,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function M(e,t,n,i,r){H(t,i,r,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function D(e,t,n,i,r,a){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,a){return t=+t,n>>>=0,a||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,a){return t=+t,n>>>=0,a||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}s.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,s.prototype),i},s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let i=this[e],r=1,a=0;for(;++a<t&&(r*=256);)i+=this[e+a]*r;return i},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let i=this[e+--t],r=1;for(;t>0&&(r*=256);)i+=this[e+--t]*r;return i},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=K(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||U(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,r=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(i)+(BigInt(r)<<BigInt(32))}),s.prototype.readBigUInt64BE=K(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||U(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],r=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(i)<<BigInt(32))+BigInt(r)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let i=this[e],r=1,a=0;for(;++a<t&&(r*=256);)i+=this[e+a]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*t)),i},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let i=t,r=1,a=this[e+--i];for(;i>0&&(r*=256);)a+=this[e+--i]*r;return r*=128,a>=r&&(a-=Math.pow(2,8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=K(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||U(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),s.prototype.readBigInt64BE=K(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||U(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),i.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),i.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),i.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),i.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||L(this,e,t,n,Math.pow(2,8*n)-1,0);let r=1,a=0;for(this[t]=255&e;++a<n&&(r*=256);)this[t+a]=e/r&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||L(this,e,t,n,Math.pow(2,8*n)-1,0);let r=n-1,a=1;for(this[t+r]=255&e;--r>=0&&(a*=256);)this[t+r]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigUInt64LE=K(function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=K(function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}let r=0,a=1,o=0;for(this[t]=255&e;++r<n&&(a*=256);)e<0&&0===o&&0!==this[t+r-1]&&(o=1),this[t+r]=(e/a|0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}let r=n-1,a=1,o=0;for(this[t+r]=255&e;--r>=0&&(a*=256);)e<0&&0===o&&0!==this[t+r+1]&&(o=1),this[t+r]=(e/a|0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigInt64LE=K(function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=K(function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,i){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);const r=i-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),r},s.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let r;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(r=t;r<n;++r)this[r]=e;else{const a=s.isBuffer(e)?e:s.from(e,i),o=a.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(r=0;r<n-t;++r)this[r+t]=a[r%o]}return this};const B={};function j(e,t,n){B[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function V(e){let t="",n=e.length;const i="-"===e[0]?1:0;for(;n>=i+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function H(e,t,n,i,r,a){if(e>n||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||U(t,e.length-(n+1))}(i,r,a)}function z(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function U(e,t,n){if(Math.floor(e)!==e)throw z(e,n),new B.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),j("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),j("ERR_OUT_OF_RANGE",function(e,t,n){let i=`The value of "${e}" is out of range.`,r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=V(String(n)):"bigint"==typeof n&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=V(r)),r+="n"),i+=` It must be ${t}. Received ${r}`,i},RangeError);const G=/[^+/0-9A-Za-z-_]/g;function W(e,t){let n;t=t||1/0;const i=e.length;let r=null;const a=[];for(let o=0;o<i;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&a.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&a.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function Y(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,n,i){let r;for(r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const i=16*n;for(let r=0;r<16;++r)t[i+r]=e[n]+e[r]}return t}();function K(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}}(Vz)),Vz);const{OAUTH_BASE_URL:Yz="",OAUTH_CLIENT_ID:$z=""}=Wj,Xz={accessToken:Qj.getString("access_token"),refreshToken:Qj.getString("refresh_token"),isOnboardingFinished:Qj.getBoolean("isOnboardingFinished"),hasCompletedSetupFlow:!1,isLicenseValid:!1},qz=cL()(zj(e=>({...Xz,setTokens:({accessToken:t,refreshToken:n})=>{e({accessToken:t,refreshToken:n})},setIsOnboardingFinished:t=>{e({isOnboardingFinished:t,hasCompletedSetupFlow:t})},setHasCompletedSetupFlow:t=>{e({hasCompletedSetupFlow:t})},setIsLicenseValid:t=>{e({isLicenseValid:t})},clear:()=>{e(Xz)}}),{name:"AUTH_STORE",storage:Vj(Jj)}));var Zz="b30def84-6b37-426a-9752-be3cf572fdf1";const Kz=uV?"https://tracking.hedia.io":Wj.TRACKING_BASE_URL,Qz=uV?Zz:Wj.TRACKING_PROJECT_ID;async function Jz(e){const t={...e,uuid:void 0},n={headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t),method:NL.HTTPRequestMethod.POST},i=`${Kz}/api/v1/projects/${Qz}/events`,{status:r}=await fetch(i,n);if(r!==NL.StatusCode.CREATED)throw new Error("[tracking::syncTrackingEvent] Error while syncing tracking event")}var eU=(e=>(e.MalformedDataError="Malformed Data Error",e.IncorrectDataError="Incorrect Data Type Error",e))(eU||{});const tU="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,nU="8.55.0",iU=globalThis;function rU(e,t,n){const i=n||iU,r=i.__SENTRY__=i.__SENTRY__||{},a=r[nU]=r[nU]||{};return a[e]||(a[e]=t())}const aU="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,oU=["debug","info","warn","error","log","assert","trace"],sU={};function lU(e){if(!("console"in iU))return e();const t=iU.console,n={},i=Object.keys(sU);i.forEach(e=>{const i=sU[e];n[e]=t[e],t[e]=i});try{return e()}finally{i.forEach(e=>{t[e]=n[e]})}}const uU=rU("logger",function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return aU?oU.forEach(n=>{t[n]=(...t)=>{e&&lU(()=>{iU.console[n](`Sentry Logger [${n}]:`,...t)})}}):oU.forEach(e=>{t[e]=()=>{}}),t}),cU="<anonymous>";function dU(){return hU(iU),iU}function hU(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||nU,t[nU]=t[nU]||{}}const mU=Object.prototype.toString;function pU(e,t){return mU.call(e)===`[object ${t}]`}function fU(e){return pU(e,"String")}function _U(e){return pU(e,"Object")}function gU(e,t){try{return e instanceof t}catch(n){return!1}}const yU=iU;function vU(e,t){const n=e,i=[];if(!n||!n.tagName)return"";if(yU.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}i.push(n.tagName.toLowerCase());const r=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(r&&r.length)r.forEach(e=>{i.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&i.push(`#${n.id}`);const e=n.className;if(e&&fU(e)){const t=e.split(/\s+/);for(const e of t)i.push(`.${e}`)}}const a=["aria-label","type","name","title","alt"];for(const o of a){const e=n.getAttribute(o);e&&i.push(`[${o}="${e}"]`)}return i.join("")}function bU(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(i){aU&&uU.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function SU(e){if(function(e){switch(mU.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return gU(e,Error)}}(e))return{message:e.message,name:e.name,stack:e.stack,...kU(e)};if(t=e,"undefined"!=typeof Event&&gU(t,Event)){const t={type:e.type,target:wU(e.target),currentTarget:wU(e.currentTarget),...kU(e)};return"undefined"!=typeof CustomEvent&&gU(e,CustomEvent)&&(t.detail=e.detail),t}return e;var t}function wU(e){try{return t=e,"undefined"!=typeof Element&&gU(t,Element)?function(e,t={}){if(!e)return"<unknown>";try{let n=e;const i=5,r=[];let a=0,o=0;const s=" > ",l=s.length;let u;const c=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&a++<i&&(u=vU(n,c),!("html"===u||a>1&&o+r.length*l+u.length>=d));)r.push(u),o+=u.length,n=n.parentNode;return r.reverse().join(s)}catch(n){return"<unknown>"}}(e):Object.prototype.toString.call(e)}catch(n){return"<unknown>"}var t}function kU(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function CU(e){return EU(e,new Map)}function EU(e,t){if(function(e){if(!_U(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(t){return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const i={};t.set(e,i);for(const r of Object.getOwnPropertyNames(e))void 0!==e[r]&&(i[r]=EU(e[r],t));return i}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const i=[];return t.set(e,i),e.forEach(e=>{i.push(EU(e,t))}),i}return e}function IU(){return Date.now()/1e3}const xU=function(){const{performance:e}=iU;if(!e||!e.now)return IU;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();function TU(){const e=iU,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(i){}return"10000000100040008000100000000000".replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function OU(){return TU()}function RU(){return TU().substring(16)}function AU(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&t&&0===Object.keys(t).length)return e;const i={...e};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=AU(i[r],t[r],n-1));return i}(()=>{const{performance:e}=iU;if(!e||!e.now)return;const t=36e5,n=e.now(),i=Date.now(),r=e.timeOrigin?Math.abs(e.timeOrigin+n-i):t,a=r<t,o=e.timing&&e.timing.navigationStart,s="number"==typeof o?Math.abs(o+n-i):t;(a||s<t)&&(r<=s&&e.timeOrigin)})();const LU="_sentrySpan";function PU(e,t){t?bU(e,LU,t):delete e[LU]}function MU(e){return e[LU]}class DU{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:OU(),spanId:RU()}}clone(){const e=new DU;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,PU(e,MU(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&function(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||xU(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:TU()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,[n,i]=t instanceof NU?[t.getScopeData(),t.getRequestSession()]:_U(t)?[e,e.requestSession]:[],{tags:r,extra:a,user:o,contexts:s,level:l,fingerprint:u=[],propagationContext:c}=n||{};return this._tags={...this._tags,...r},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),l&&(this._level=l),u.length&&(this._fingerprint=u),c&&(this._propagationContext=c),i&&(this._requestSession=i),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,PU(this,void 0),this._attachments=[],this.setPropagationContext({traceId:OU()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const i={timestamp:IU(),...e};return this._breadcrumbs.push(i),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:MU(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=AU(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext={spanId:RU(),...e},this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:TU();if(!this._client)return uU.warn("No client configured on scope - will not capture exception!"),n;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...t,event_id:n},this),n}captureMessage(e,t,n){const i=n&&n.event_id?n.event_id:TU();if(!this._client)return uU.warn("No client configured on scope - will not capture message!"),i;const r=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:r,...n,event_id:i},this),i}captureEvent(e,t){const n=t&&t.event_id?t.event_id:TU();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(uU.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const NU=DU;class FU{constructor(e,t){let n,i;n=e||new NU,i=t||new NU,this._stack=[{scope:n}],this._isolationScope=i}withScope(t){const n=this._pushScope();let i;try{i=t(n)}catch(e){throw this._popScope(),e}return r=i,Boolean(r&&r.then&&"function"==typeof r.then)?i.then(e=>(this._popScope(),e),e=>{throw this._popScope(),e}):(this._popScope(),i);var r}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function BU(){const e=hU(dU());return e.stack=e.stack||new FU(rU("defaultCurrentScope",()=>new NU),rU("defaultIsolationScope",()=>new NU))}function jU(e){return BU().withScope(e)}function VU(e,t){const n=BU();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function HU(e){return BU().withScope(()=>e(BU().getIsolationScope()))}function zU(e){const t=hU(e);return t.acs?t.acs:{withIsolationScope:HU,withScope:jU,withSetScope:VU,withSetIsolationScope:(e,t)=>HU(t),getCurrentScope:()=>BU().getScope(),getIsolationScope:()=>BU().getIsolationScope()}}function UU(){return zU(dU()).getCurrentScope()}function GU(){return zU(dU()).getIsolationScope()}function WU(...e){const t=zU(dU());if(2===e.length){const[n,i]=e;return n?t.withSetScope(n,i):t.withScope(i)}return t.withScope(e[0])}function YU(){return UU().getClient()}function $U(e){const t=e._sentryMetrics;if(!t)return;const n={};for(const[,[i,r]]of t){(n[i]||(n[i]=[])).push(CU(r))}return n}const XU="sentry.source",qU="sentry.sample_rate",ZU="sentry.op",KU="sentry.origin",QU="sentry.idle_span_finish_reason",JU="sentry.custom_span_name",eG=/^sentry-/;function tG(e){const t=function(e){if(!e||!fU(e)&&!Array.isArray(e))return;if(Array.isArray(e))return e.reduce((e,t)=>{const n=nG(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{});return nG(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>{if(t.match(eG)){e[t.slice(7)]=n}return e},{});return Object.keys(n).length>0?n:void 0}function nG(e){return e.split(",").map(e=>e.split("=").map(e=>decodeURIComponent(e.trim()))).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}let iG=!1;function rG(e){const{spanId:t,traceId:n}=e.spanContext(),{data:i,op:r,parent_span_id:a,status:o,origin:s}=sG(e);return CU({parent_span_id:a,span_id:t,trace_id:n,data:i,op:r,status:o,origin:s})}function aG(e){return"number"==typeof e?oG(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?oG(e.getTime()):xU()}function oG(e){return e>9999999999?e/1e3:e}function sG(t){if(function(e){return"function"==typeof e.getSpanJSON}(t))return t.getSpanJSON();try{const{spanId:e,traceId:n}=t.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(t)){const{attributes:i,startTime:r,name:a,endTime:o,parentSpanId:s,status:l}=t;return CU({span_id:e,trace_id:n,data:i,description:a,parent_span_id:s,start_timestamp:aG(r),timestamp:aG(o)||void 0,status:uG(l),op:i[ZU],origin:i[KU],_metrics_summary:$U(t)})}return{span_id:e,trace_id:n}}catch(e){return{}}}function lG(e){const{traceFlags:t}=e.spanContext();return 1===t}function uG(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"unknown_error"}const cG="_sentryChildSpans",dG="_sentryRootSpan";function hG(e,t){const n=e[dG]||e;bU(t,dG,n),e[cG]?e[cG].add(t):bU(e,cG,new Set([t]))}function mG(e){const t=new Set;return function e(n){if(!t.has(n)&&lG(n)){t.add(n);const i=n[cG]?Array.from(n[cG]):[];for(const t of i)e(t)}}(e),Array.from(t)}function pG(e){return e[dG]||e}function fG(){const e=zU(dU());return e.getActiveSpan?e.getActiveSpan():MU(UU())}const _G="_sentryScope",gG="_sentryIsolationScope";function yG(e){return{scope:e[_G],isolationScope:e[gG]}}function vG(e){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=YU(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}class bG{constructor(e={}){this._traceId=e.traceId||OU(),this._spanId=e.spanId||RU()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}}const SG="_frozenDsc";function wG(e,t){bU(e,SG,t)}function kG(e){const t=YU();if(!t)return{};const n=pG(e),i=n[SG];if(i)return i;const r=n.spanContext().traceState,a=r&&r.get("sentry.dsc"),o=a&&tG(a);if(o)return o;const s=function(e,t){const n=t.getOptions(),{publicKey:i}=t.getDsn()||{},r=CU({environment:n.environment||"production",release:n.release,public_key:i,trace_id:e});return t.emit("createDsc",r),r}(e.spanContext().traceId,t),l=sG(n),u=l.data||{},c=u[qU];null!=c&&(s.sample_rate=`${c}`);const d=u[XU],h=l.description;return"url"!==d&&h&&(s.transaction=h),vG()&&(s.sampled=String(lG(n))),t.emit("createDsc",s,n),s}function CG(e,t){if(!vG(e))return[!1];const n=GU().getScopeData().sdkProcessingMetadata.normalizedRequest,i={...t,normalizedRequest:t.normalizedRequest||n};let r;r="function"==typeof e.tracesSampler?e.tracesSampler(i):void 0!==i.parentSampled?i.parentSampled:void 0!==e.tracesSampleRate?e.tracesSampleRate:1;const a=function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;if(!("number"!=typeof t||isNaN(t)||t<0||t>1))return t;tU&&uU.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`)}(r);if(void 0===a)return tU&&uU.warn("[Tracing] Discarding transaction because of invalid sample rate."),[!1];if(!a)return tU&&uU.log("[Tracing] Discarding transaction because "+("function"==typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),[!1,a];return Math.random()<a?[!0,a]:(tU&&uU.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),[!1,a])}function EG(e,t=!1){const{host:n,path:i,pass:r,port:a,projectId:o,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&r?`:${r}`:""}@${n}${a?`:${a}`:""}/${i?`${i}/`:i}${o}`}function IG(e,t=100,n=1/0){try{return xG("",e,t,n)}catch(i){return{ERROR:`**non-serializable** (${i})`}}}function xG(t,n,i=1/0,r=1/0,a=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[o,s]=a;if(null==n||["boolean","string"].includes(typeof n)||"number"==typeof n&&Number.isFinite(n))return n;const l=function(t,n){try{if("domain"===t&&n&&"object"==typeof n&&n._events)return"[Domain]";if("domainEmitter"===t)return"[DomainEmitter]";if("undefined"!=typeof self&&n===self)return"[Global]";if("undefined"!=typeof window&&n===window)return"[Window]";if("undefined"!=typeof document&&n===document)return"[Document]";if("object"==typeof(i=n)&&null!==i&&(i.__isVue||i._isVue))return"[VueViewModel]";if(function(e){return _U(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(n))return"[SyntheticEvent]";if("number"==typeof n&&!Number.isFinite(n))return`[${n}]`;if("function"==typeof n)return`[Function: ${function(t){try{return t&&"function"==typeof t&&t.name||cU}catch(e){return cU}}(n)}]`;if("symbol"==typeof n)return`[${String(n)}]`;if("bigint"==typeof n)return`[BigInt: ${String(n)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(n);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}var i}(t,n);if(!l.startsWith("[object "))return l;if(n.__sentry_skip_normalization__)return n;const u="number"==typeof n.__sentry_override_normalization_depth__?n.__sentry_override_normalization_depth__:i;if(0===u)return l.replace("object ","");if(o(n))return"[Circular ~]";const c=n;if(c&&"function"==typeof c.toJSON)try{return xG("",c.toJSON(),u-1,r,a)}catch(p){}const d=Array.isArray(n)?[]:{};let h=0;const m=SU(n);for(const e in m){if(!Object.prototype.hasOwnProperty.call(m,e))continue;if(h>=r){d[e]="[MaxProperties ~]";break}const t=m[e];d[e]=xG(e,t,u-1,r,a),h++}return s(n),d}function TG(e){return[{type:"span"},e]}function OG(e,t){const n=kG(e[0]),i=t&&t.getDsn(),r=t&&t.getOptions().tunnel,a={sent_at:(new Date).toISOString(),...(o=n,!!o.trace_id&&!!o.public_key&&{trace:n}),...!!r&&i&&{dsn:EG(i)}};var o;const s=t&&t.getOptions().beforeSendSpan,l=s?e=>{const t=s(sG(e));return t||iG||(lU(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),iG=!0),t}:e=>sG(e),u=[];for(const c of e){const e=l(c);e&&u.push(TG(e))}return function(e,t=[]){return[e,t]}(a,u)}function RG(e){if(!e||0===e.length)return;const t={};return e.forEach(e=>{const n=e.attributes||{},i=n["sentry.measurement_unit"],r=n["sentry.measurement_value"];"string"==typeof i&&"number"==typeof r&&(t[e.name]={value:r,unit:i})}),t}class AG{constructor(e={}){this._traceId=e.traceId||OU(),this._spanId=e.spanId||RU(),this._startTime=e.startTimestamp||xU(),this._attributes={},this.setAttributes({[KU]:"manual",[ZU]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this}addLinks(e){return this}recordException(e,t){}spanContext(){const{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:n?1:0}}setAttribute(e,t){return void 0===t?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=aG(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(XU,"custom"),this}end(e){this._endTime||(this._endTime=aG(e),function(e){if(!tU)return;const{description:t="< unknown name >",op:n="< unknown op >"}=sG(e),{spanId:i}=e.spanContext(),r=`[Tracing] Finishing "${n}" ${pG(e)===e?"root ":""}span "${t}" with ID ${i}`;uU.log(r)}(this),this._onSpanEnded())}getSpanJSON(){return CU({data:this._attributes,description:this._name,op:this._attributes[ZU],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:uG(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[KU],_metrics_summary:$U(this),profile_id:this._attributes["sentry.profile_id"],exclusive_time:this._attributes["sentry.exclusive_time"],measurements:RG(this._events),is_segment:this._isStandaloneSpan&&pG(this)===this||void 0,segment_id:this._isStandaloneSpan?pG(this).spanContext().spanId:void 0})}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){tU&&uU.log("[Tracing] Adding an event to span:",e);const i=LG(t)?t:n||xU(),r=LG(t)?{}:t||{},a={name:e,time:aG(i),attributes:r};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const e=YU();e&&e.emit("spanEnd",this);if(!(this._isStandaloneSpan||this===pG(this)))return;if(this._isStandaloneSpan)return void(this._sampled?function(e){const t=YU();if(!t)return;const n=e[1];if(!n||0===n.length)return void t.recordDroppedEvent("before_send","span");t.sendEnvelope(e)}(OG([this],e)):(tU&&uU.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span")));const t=this._convertSpanToTransaction();if(t){(yG(this).scope||UU()).captureEvent(t)}}_convertSpanToTransaction(){if(!PG(sG(this)))return;this._name||(tU&&uU.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:e,isolationScope:t}=yG(this),n=(e||UU()).getClient()||YU();if(!0!==this._sampled)return tU&&uU.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(n&&n.recordDroppedEvent("sample_rate","transaction"));const i=mG(this).filter(e=>e!==this&&!function(e){return e instanceof AG&&e.isStandaloneSpan()}(e)).map(e=>sG(e)).filter(PG),r=this._attributes[XU];delete this._attributes[JU],i.forEach(e=>{e.data&&delete e.data[JU]});const a={contexts:{trace:rG(this)},spans:i.length>1e3?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,1e3):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,...CU({dynamicSamplingContext:kG(this)})},_metrics_summary:$U(this),...r&&{transaction_info:{source:r}}},o=RG(this._events);return o&&Object.keys(o).length&&(tU&&uU.log("[Measurements] Adding measurements to transaction event",JSON.stringify(o,void 0,2)),a.measurements=o),a}}function LG(e){return e&&"number"==typeof e||e instanceof Date||Array.isArray(e)}function PG(e){return!!(e.start_timestamp&&e.timestamp&&e.span_id&&e.trace_id)}const MG="__SENTRY_SUPPRESS_TRACING__";function DG(e){const t=NG();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=function(e){const t=e.experimental||{},n={isStandalone:t.standalone,...e};if(e.startTime){const t={...n};return t.startTimestamp=aG(e.startTime),delete t.startTime,t}return n}(e),{forceTransaction:i,parentSpan:r}=e,a=e.scope?t=>WU(e.scope,t):void 0!==r?e=>function(e,t){const n=NG();if(n.withActiveSpan)return n.withActiveSpan(e,t);return WU(n=>(PU(n,e||void 0),t(n)))}(r,e):e=>e();return a(()=>{const t=UU(),r=function(e){const t=MU(e);if(!t)return;const n=YU(),i=n?n.getOptions():{};if(i.parentSpanIsAlwaysRootSpan)return pG(t);return t}(t);return e.onlyIfParent&&!r?new bG:function({parentSpan:e,spanArguments:t,forceTransaction:n,scope:i}){if(!vG())return new bG;const r=GU();let a;if(e&&!n)a=function(e,t,n){const{spanId:i,traceId:r}=e.spanContext(),a=!t.getScopeData().sdkProcessingMetadata[MG]&&lG(e),o=a?new AG({...n,parentSpanId:i,traceId:r,sampled:a}):new bG({traceId:r});hG(e,o);const s=YU();s&&(s.emit("spanStart",o),n.endTimestamp&&s.emit("spanEnd",o));return o}(e,i,t),hG(e,a);else if(e){const n=kG(e),{traceId:r,spanId:o}=e.spanContext(),s=lG(e);a=FG({traceId:r,parentSpanId:o,...t},i,s),wG(a,n)}else{const{traceId:e,dsc:n,parentSpanId:o,sampled:s}={...r.getPropagationContext(),...i.getPropagationContext()};a=FG({traceId:e,parentSpanId:o,...t},i,s),n&&wG(a,n)}return function(e){if(!tU)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:i}=sG(e),{spanId:r}=e.spanContext(),a=lG(e),o=pG(e),s=o===e,l=`[Tracing] Starting ${a?"sampled":"unsampled"} ${s?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${r}`];if(i&&u.push(`parent ID: ${i}`),!s){const{op:e,description:t}=sG(o);u.push(`root ID: ${o.spanContext().spanId}`),e&&u.push(`root op: ${e}`),t&&u.push(`root description: ${t}`)}uU.log(`${l}\n ${u.join("\n ")}`)}(a),function(e,t,n){e&&(bU(e,gG,n),bU(e,_G,t))}(a,i,r),a}({parentSpan:r,spanArguments:n,forceTransaction:i,scope:t})})}function NG(){return zU(dU())}function FG(e,t,n){const i=YU(),r=i&&i.getOptions()||{},{name:a="",attributes:o}=e,[s,l]=t.getScopeData().sdkProcessingMetadata[MG]?[!1]:CG(r,{name:a,parentSampled:n,attributes:o,transactionContext:{name:a,parentSampled:n}}),u=new AG({...e,attributes:{[XU]:"custom",...e.attributes},sampled:s});return void 0!==l&&u.setAttribute(qU,l),i&&i.emit("spanStart",u),u}const BG={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3};function jG(e,t={}){const n=new Map;let i,r=!1,a="externalFinish",o=!t.disableAutoFinish;const s=[],{idleTimeout:l=BG.idleTimeout,finalTimeout:u=BG.finalTimeout,childSpanTimeout:c=BG.childSpanTimeout,beforeSpanEnd:d}=t,h=YU();if(!h||!vG())return new bG;const m=UU(),p=fG(),f=function(e){const t=DG(e);return PU(UU(),t),tU&&uU.log("[Tracing] Started span is an idle span"),t}(e);function _(){i&&(clearTimeout(i),i=void 0)}function g(e){_(),i=setTimeout(()=>{!r&&0===n.size&&o&&(a="idleTimeout",f.end(e))},l)}function y(e){i=setTimeout(()=>{!r&&o&&(a="heartbeatFailed",f.end(e))},c)}function v(e){r=!0,n.clear(),s.forEach(e=>e()),PU(m,p);const t=sG(f),{start_timestamp:i}=t;if(!i)return;(t.data||{})[QU]||f.setAttribute(QU,a),uU.log(`[Tracing] Idle span "${t.op}" finished`);const o=mG(f).filter(e=>e!==f);let c=0;o.forEach(t=>{t.isRecording()&&(t.setStatus({code:2,message:"cancelled"}),t.end(e),tU&&uU.log("[Tracing] Cancelling span since span ended early",JSON.stringify(t,void 0,2)));const n=sG(t),{timestamp:i=0,start_timestamp:r=0}=n,a=r<=e,o=i-r<=(u+l)/1e3;if(tU){const e=JSON.stringify(t,void 0,2);a?o||uU.log("[Tracing] Discarding span since it finished after idle span final timeout",e):uU.log("[Tracing] Discarding span since it happened after idle span was finished",e)}o&&a||(!function(e,t){e[cG]&&e[cG].delete(t)}(f,t),c++)}),c>0&&f.setAttribute("sentry.idle_span_discarded_spans",c)}return f.end=new Proxy(f.end,{apply(e,t,n){d&&d(f);const[i,...r]=n,a=aG(i||xU()),o=mG(f).filter(e=>e!==f);if(!o.length)return v(a),Reflect.apply(e,t,[a,...r]);const s=o.map(e=>sG(e).timestamp).filter(e=>!!e),l=s.length?Math.max(...s):void 0,c=sG(f).start_timestamp,h=Math.min(c?c+u/1e3:1/0,Math.max(c||-1/0,Math.min(a,l||1/0)));return v(h),Reflect.apply(e,t,[h,...r])}}),s.push(h.on("spanStart",e=>{if(r||e===f||sG(e).timestamp)return;var t;mG(f).includes(e)&&(t=e.spanContext().spanId,_(),n.set(t,!0),y(xU()+c/1e3))})),s.push(h.on("spanEnd",e=>{var t;r||(t=e.spanContext().spanId,n.has(t)&&n.delete(t),0===n.size&&g(xU()+l/1e3))})),s.push(h.on("idleSpanEnableAutoFinish",e=>{e===f&&(o=!0,g(),n.size&&y())})),t.disableAutoFinish||g(),setTimeout(()=>{r||(f.setStatus({code:2,message:"deadline_exceeded"}),a="finalTimeout",f.end())},u),f}class VG extends Error{constructor(e,t="warn"){super(e),this.message=e,this.logLevel=t}}const HG=100;function zG(e,t){const n=YU(),i=GU();if(!n)return;const{beforeBreadcrumb:r=null,maxBreadcrumbs:a=HG}=n.getOptions();if(a<=0)return;const o={timestamp:IU(),...e},s=r?lU(()=>r(o,t)):o;null!==s&&(n.emit&&n.emit("beforeAddBreadcrumb",s,t),i.addBreadcrumb(s,a))}const UG={},GG=iU;function WG(e){var t;const n="string"!=typeof e&&"exception"in e&&(null===(t=e.exception)||void 0===t?void 0:t.values)?e.exception.values:[];for(const i of n)if(i.mechanism&&!1===i.mechanism.handled&&"onerror"===i.mechanism.type)return!0;return!1}function YG(){const e=null!==(i=null===(n=null===(t=GG.expo)||void 0===t?void 0:t.modules)||void 0===n?void 0:n.ExponentConstants)&&void 0!==i?i:void 0;var t,n,i;return"expo"===(e&&e.appOwnership)}function $G(){return"web"===lr.OS}function XG(){return"web"!==lr.OS}const qG="value";function ZG(e,t){let n;t=t||1/0;const i=e.length;let r=null;const a=[];for(let o=0;o<i;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&a.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&a.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}const KG=[],QG="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let Jee=0,ete=64;Jee<ete;++Jee)KG[Jee]=QG[Jee];function JG(e){return KG[e>>18&63]+KG[e>>12&63]+KG[e>>6&63]+KG[63&e]}function eW(e,t,n){let i;const r=[];for(let a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),r.push(JG(i));return r.join("")}var tW=function(t,n,i,r){return new(i||(i=Promise))(function(a,o){function s(t){try{u(r.next(t))}catch(e){o(e)}}function l(t){try{u(r.throw(t))}catch(e){o(e)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,l)}u((r=r.apply(t,n||[])).next())})},nW=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const iW=!0===GG.RN$Bridgeless||null!=GG.__turboModuleProxy?UG.TurboModuleRegistry&&UG.TurboModuleRegistry.get("RNSentry"):nr.RNSentry,rW=ZG("\n"),aW={fetchModules(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const e=yield iW.fetchModules();return e?JSON.parse(e):null})},sendEnvelope(e){return tW(this,void 0,void 0,function*(){if(!this.enableNative)return void uU.warn("Event was skipped as native SDK is not enabled.");if(!this._isModuleLoaded(iW))throw this._NativeClientError;const[t,n]=e,i=ZG(JSON.stringify(t));let r=new Uint8Array(i.length+rW.length);r.set(i),r.set(rW,i.length);let a=!1;for(const e of n){const[t,n]=this._processItem(e);let i,o;"string"==typeof n?(i="text/plain",o=ZG(n)):n instanceof Uint8Array?(i="string"==typeof t.content_type?t.content_type:"application/octet-stream",o=n):(i="application/json",o=ZG(JSON.stringify(n)),a||(a=WG(n))),t.content_type=i,t.length=o.length;const s=ZG(JSON.stringify(t)),l=new Uint8Array(r.length+s.length+rW.length+o.length+rW.length);l.set(r),l.set(s,r.length),l.set(rW,r.length+s.length),l.set(o,r.length+s.length+rW.length),l.set(rW,r.length+s.length+rW.length+o.length),r=l}yield iW.captureEnvelope(function(e){let t;const n=e.length,i=n%3,r=[],a=16383;for(let o=0,s=n-i;o<s;o+=a)r.push(eW(e,o,o+a>s?s:o+a));return 1===i?(t=e[n-1],r.push(`${KG[t>>2]+KG[t<<4&63]}==`)):2===i&&(t=(e[n-2]<<8)+e[n-1],r.push(`${KG[t>>10]+KG[t>>4&63]+KG[t<<2&63]}=`)),r.join("")}(r),{hardCrashed:a})})},initNativeSdk(e){return tW(this,void 0,void 0,function*(){const t=Object.assign({enableNative:!0,autoInitializeNativeSdk:!0},e);if(!t.enableNative)return t.enableNativeNagger&&uU.warn("Note: Native Sentry SDK is disabled."),this.enableNative=!1,!1;if(!t.autoInitializeNativeSdk)return t.enableNativeNagger&&uU.warn("Note: Native Sentry SDK was not initialized automatically, you will need to initialize it manually. If you wish to disable the native SDK and get rid of this warning, pass enableNative: false"),this.enableNative=!0,!1;if(!t.dsn)return uU.warn("Warning: No DSN was provided. The Sentry SDK will be disabled. Native SDK will also not be initalized."),this.enableNative=!1,!1;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const{beforeSend:n,beforeBreadcrumb:i,beforeSendTransaction:r,integrations:a}=t,o=nW(t,["beforeSend","beforeBreadcrumb","beforeSendTransaction","integrations"]),s=yield iW.initNativeSdk(o);return this.nativeIsReady=s,this.enableNative=!0,s})},fetchNativeRelease(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;return iW.fetchNativeRelease()})},fetchNativeSdkInfo(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;return iW.fetchNativeSdkInfo()})},fetchNativeDeviceContexts(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;return iW.fetchNativeDeviceContexts()})},fetchNativeAppStart(){return tW(this,void 0,void 0,function*(){return this.enableNative?this._isModuleLoaded(iW)?iW.fetchNativeAppStart():(uU.error(this._NativeClientError),null):(uU.warn(this._DisabledNativeError),null)})},fetchNativeFrames(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;return iW.fetchNativeFrames()})},nativeCrash(){if(this.enableNative){if(!this._isModuleLoaded(iW))throw this._NativeClientError;iW.crash()}},setUser(e){if(!this.enableNative)return;if(!this._isModuleLoaded(iW))throw this._NativeClientError;let t=null,n=null;if(e){const{id:i,ip_address:r,email:a,username:o,segment:s}=e,l=nW(e,["id","ip_address","email","username","segment"]),u={id:i,ip_address:r,email:a,username:o,segment:s};t=this._serializeObject(u),n=this._serializeObject(l)}iW.setUser(t,n)},setTag(e,t){if(!this.enableNative)return;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const n="string"==typeof t?t:JSON.stringify(t);iW.setTag(e,n)},setExtra(t,n){if(!this.enableNative)return;if(!this._isModuleLoaded(iW))throw this._NativeClientError;if("string"==typeof n)return iW.setExtra(t,n);if(void 0===n)return iW.setExtra(t,"undefined");let i;try{const e=IG(n);i=JSON.stringify(e)}catch(e){uU.error("Extra for key ${key} not passed to native SDK, because it contains non-stringifiable values",e)}return"string"==typeof i?iW.setExtra(t,i):iW.setExtra(t,"**non-stringifiable**")},addBreadcrumb(e){if(this.enableNative){if(!this._isModuleLoaded(iW))throw this._NativeClientError;iW.addBreadcrumb(Object.assign(Object.assign({},e),{level:e.level?this._processLevel(e.level):void 0}))}},clearBreadcrumbs(){if(this.enableNative){if(!this._isModuleLoaded(iW))throw this._NativeClientError;iW.clearBreadcrumbs()}},setContext(t,n){if(!this.enableNative)return;if(!this._isModuleLoaded(iW))throw this._NativeClientError;if(null===n)return iW.setContext(t,null);let i;try{i=function(e){const t=IG(e);return null===t||"object"!=typeof t||Array.isArray(t)||t.constructor!==Object?{[qG]:t}:t}(n)}catch(e){uU.error("Context for key ${key} not passed to native SDK, because it contains non-serializable values",e)}i?iW.setContext(t,i):iW.setContext(t,{error:"**non-serializable**"})},closeNativeSdk(){return tW(this,void 0,void 0,function*(){if(this.enableNative&&this._isModuleLoaded(iW))return iW.closeNativeSdk().then(()=>{this.enableNative=!1})})},disableNativeFramesTracking(){this.enableNative&&this._isModuleLoaded(iW)&&iW.disableNativeFramesTracking()},enableNativeFramesTracking(){this.enableNative&&this._isModuleLoaded(iW)&&iW.enableNativeFramesTracking()},isNativeAvailable(){return this._isModuleLoaded(iW)},captureScreenshot(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)return uU.warn(this._DisabledNativeError),null;if(!this._isModuleLoaded(iW))return uU.error(this._NativeClientError),null;let t;try{t=yield iW.captureScreenshot()}catch(e){uU.warn("Failed to capture screenshot",e)}return t?t.map(e=>Object.assign(Object.assign({},e),{data:new Uint8Array(e.data)})):null})},fetchViewHierarchy(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const e=yield iW.fetchViewHierarchy();return e?new Uint8Array(e):null})},startProfiling(e){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const{started:t,error:n}=iW.startProfiling(e);return t?uU.log("[NATIVE] Start Profiling"):uU.error("[NATIVE] Start Profiling Failed",n),!!t},stopProfiling(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const{profile:t,nativeProfile:n,androidProfile:i,error:r}=iW.stopProfiling();if(!t||r)return uU.error("[NATIVE] Stop Profiling Failed",r),null;"ios"!==lr.OS||n||uU.warn("[NATIVE] Stop Profiling Failed: No Native Profile"),"android"!==lr.OS||i||uU.warn("[NATIVE] Stop Profiling Failed: No Android Profile");try{return{hermesProfile:JSON.parse(t),nativeProfile:n,androidProfile:i}}catch(e){return uU.error("[NATIVE] Failed to parse Hermes Profile JSON",e),null}},fetchNativePackageName(){return this.enableNative&&this._isModuleLoaded(iW)&&iW.fetchNativePackageName()||null},fetchNativeStackFramesBy(e){return this.enableNative&&this._isModuleLoaded(iW)&&iW.fetchNativeStackFramesBy(e)||null},initNativeReactNavigationNewFrameTracking(){return tW(this,void 0,void 0,function*(){if(this.enableNative&&this._isModuleLoaded(iW))return iW.initNativeReactNavigationNewFrameTracking()})},captureReplay(e){return tW(this,void 0,void 0,function*(){return this.enableNative?this._isModuleLoaded(iW)?(yield iW.captureReplay(e))||null:(uU.warn(`[NATIVE] \`${this.captureReplay.name}\` is not available when native is not available.`),Promise.resolve(null)):(uU.warn(`[NATIVE] \`${this.captureReplay.name}\` is not available when native is disabled.`),Promise.resolve(null))})},getCurrentReplayId(){return this.enableNative?this._isModuleLoaded(iW)?iW.getCurrentReplayId()||null:(uU.warn(`[NATIVE] \`${this.getCurrentReplayId.name}\` is not available when native is not available.`),null):(uU.warn(`[NATIVE] \`${this.getCurrentReplayId.name}\` is not available when native is disabled.`),null)},crashedLastRun(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)return null;if(!this._isModuleLoaded(iW))return null;const e=yield iW.crashedLastRun();return"boolean"==typeof e?e:null})},getNewScreenTimeToDisplay(){return this.enableNative&&this._isModuleLoaded(iW)?iW.getNewScreenTimeToDisplay():Promise.resolve(null)},getDataFromUri(e){return tW(this,void 0,void 0,function*(){if(!this.enableNative||!this._isModuleLoaded(iW))return null;try{const t=yield iW.getDataFromUri(e);return new Uint8Array(t)}catch(t){return uU.error("Error:",t),null}})},popTimeToDisplayFor(e){if(!this.enableNative||!this._isModuleLoaded(iW))return Promise.resolve(null);try{return iW.popTimeToDisplayFor(e)}catch(t){return uU.error("Error:",t),null}},setActiveSpanId(e){if(this.enableNative&&this._isModuleLoaded(iW))try{iW.setActiveSpanId(e)}catch(t){return void uU.error("Error:",t)}},encodeToBase64(e){return tW(this,void 0,void 0,function*(){if(!this.enableNative||!this._isModuleLoaded(iW))return Promise.resolve(null);try{const t=Array.from(e);return(yield iW.encodeToBase64(t))||null}catch(t){return uU.error("Error:",t),Promise.resolve(null)}})},_processItem(e){const[t,n]=e;if("event"==t.type||"transaction"==t.type){const e=this._processLevels(n);return"android"===aW.platform&&"message"in e&&(e.message={message:e.message}),[t,e]}return e},_serializeObject(e){const t={};return Object.keys(e).forEach(n=>{const i=e[n];t[n]="string"==typeof i?i:JSON.stringify(i)}),t},_processLevels(e){var t;return Object.assign(Object.assign({},e),{level:e.level?this._processLevel(e.level):void 0,breadcrumbs:null===(t=e.breadcrumbs)||void 0===t?void 0:t.map(e=>Object.assign(Object.assign({},e),{level:e.level?this._processLevel(e.level):void 0}))})},_processLevel:e=>"log"==e?"debug":e,_isModuleLoaded:e=>!!e,_DisabledNativeError:new VG("Native is disabled"),_NativeClientError:new VG("Native Client is not available, can't start on native."),enableNative:!0,nativeIsReady:!1,platform:lr.OS};function oW(e){return tW(this,void 0,void 0,function*(){return aW.getDataFromUri(e)})}"android"===lr.OS||lr.OS;const sW="MobileFeedback",lW=(e={})=>{const{buttonOptions:t,screenshotButtonOptions:n,colorScheme:i,themeLight:r,themeDark:a}=e,o=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(e,["buttonOptions","screenshotButtonOptions","colorScheme","themeLight","themeDark"]);return{name:sW,options:o,buttonOptions:t||{},screenshotButtonOptions:n||{},colorScheme:i||"system",themeLight:r||{},themeDark:a||{}}},uW=()=>{var e;return null===(e=YU())||void 0===e?void 0:e.getIntegrationByName(sW)},cW="auto.interaction",dW="manual.interaction",hW=(e,t)=>{(function(e){return e===pG(e)})(t)&&function(e){return e instanceof AG}(t)?e.on("spanEnd",e=>{if(e!==t)return;mG(t).length<=1&&(uU.log(`Not sampling as ${sG(t).op} transaction has no child spans.`),t._sampled=!1)}):uU.warn("Not sampling childless spans only works for Sentry Transactions (Root Spans).")},mW=(e,{finalTimeout:t,idleTimeout:n})=>{const i=YU();if(!i)return uU.warn("[startIdleSpan] Can't create idle span, missing client."),new bG;if("background"===Tu.currentState)return uU.debug(`[startIdleSpan] App is already in background, not starting span for ${e.name}`),new bG;UU().setPropagationContext({traceId:OU(),spanId:RU()});const r=jG(e,{finalTimeout:t,idleTimeout:n});return((e,t)=>{const n=Tu.addEventListener("change",e=>{"background"===e&&(uU.debug(`Setting ${sG(t).op} transaction to cancelled because the app is in the background.`),t.setStatus({code:2,message:"cancelled"}),t.end())});n&&e.on("spanEnd",e=>{e===t&&(uU.debug(`Removing AppState listener for ${sG(t).op} transaction.`),n&&n.remove&&n.remove())})})(i,r),r};const pW="ReactNativeTracing";function fW(){const e=YU();if(e)return function(e){return e.getIntegrationByName(pW)}(e)}$G();const _W="UserInteraction",gW=e=>{const t=YU();if(!t)return;const n=fW();if(!n)return void uU.log(`[${_W}] Tracing integration is not available. Can not start user interaction span.`);const i=t.getOptions(),{elementId:r,op:a}=e;if(!i.enableUserInteractionTracing)return void uU.log(`[${_W}] User Interaction Tracing is disabled.`);if(!r)return void uU.log(`[${_W}] User Interaction Tracing can not create transaction with undefined elementId.`);if(!n.state.currentRoute)return void uU.log(`[${_W}] User Interaction Tracing can not create transaction without a current route.`);const o=fG(),s=o&&![cW,dW].includes(sG(o).origin);if(o&&s)return void uU.warn(`[${_W}] Did not create ${a} transaction because active transaction ${sG(o).description} exists on the scope.`);const l=`${n.state.currentRoute}.${r}`;if(o&&sG(o).description===l&&sG(o).op===a)return void uU.warn(`[${_W}] Did not create ${a} transaction because it the same transaction ${sG(o).description} already exists on the scope.`);const u=UU(),c={name:l,op:a,scope:u};!function(e){delete e._sentrySpan}(u);const d=mW(c,{idleTimeout:n.options.idleTimeoutMs,finalTimeout:n.options.finalTimeoutMs});return d.setAttribute(KU,dW),hW(t,d),uU.log(`[${_W}] User Interaction Tracing Created ${a} transaction ${l}.`),d};new class{constructor({cleanupInterval:e=5e3,ttl:t=2e3}={}){this._ttl=t,this._map=new Map,this._cleanupIntervalMs=e,this.startCleanup()}set(e,t){if(this._cleanupInterval||this.startCleanup(),"object"!=typeof t||!("then"in t))return void this._map.set(e,{value:t,expiresAt:Date.now()+this._ttl,promise:null});const n={value:void 0,expiresAt:null,promise:t};this._map.set(e,n),t.then(e=>{n.value=e,n.expiresAt=Date.now()+this._ttl,n.promise=null},()=>{n.expiresAt=Date.now()+this._ttl,n.promise=null})}pop(e){const t=this.get(e);return this._map.delete(e),t}get(e){const t=this._map.get(e);if(t)return t.promise?t.promise:(t.expiresAt&&t.expiresAt<=Date.now()&&this._map.delete(e),t.value)}has(e){const t=this._map.get(e);return!!t&&(!!t.promise||(!(t.expiresAt&&t.expiresAt<=Date.now())||(this._map.delete(e),!1)))}ttl(e){const t=this._map.get(e);if(t&&t.expiresAt){const e=t.expiresAt-Date.now();return e>0?e:0}}cleanup(){const e=Date.now();for(const[t,n]of this._map.entries())n.expiresAt&&n.expiresAt<=e&&this._map.delete(t);this._map.size||this.stopCleanup()}clear(){clearInterval(this._cleanupInterval),this._map.clear()}stopCleanup(){clearInterval(this._cleanupInterval)}startCleanup(){this._cleanupInterval=setInterval(()=>this.cleanup(),this._cleanupIntervalMs)}}({ttl:6e4});const yW=(e,t)=>{$G()&&void 0!==GG.alert?GG.alert(`${e}\n${t}`):sr.alert(e,t)},vW={onFormOpen:()=>{},onFormClose:()=>{},onAddScreenshot:e=>{},onSubmitSuccess:()=>{},onSubmitError:()=>{},onFormSubmitted:()=>{},showBranding:!0,isEmailRequired:!1,shouldValidateEmail:!0,isNameRequired:!1,showEmail:!0,showName:!0,enableScreenshot:!1,enableTakeScreenshot:!1,cancelButtonLabel:"Cancel",emailLabel:"Email",emailPlaceholder:"your.email@example.org",formTitle:"Report a Bug",isRequiredLabel:"(required)",messageLabel:"Description",messagePlaceholder:"What's the bug? What did you expect?",nameLabel:"Name",namePlaceholder:"Your Name",submitButtonLabel:"Send Bug Report",errorTitle:"Error",formError:"Please fill out all required fields.",emailError:"Please enter a valid email address.",captureScreenshotError:"Error capturing screenshot. Please try again.",successMessageText:"Thank you for your report!",addScreenshotButtonLabel:"Add a screenshot",removeScreenshotButtonLabel:"Remove screenshot",captureScreenshotButtonLabel:"Take a screenshot",genericError:"Unable to send feedback due to an unexpected error."};function bW(){const e=(()=>{const e=uW();return e?e.colorScheme:"system"})(),t="system"===e?hu.getColorScheme():e,n=Object.assign(Object.assign({},SW),(()=>{const e=uW();return e?e.themeLight:{}})()),i=Object.assign(Object.assign({},wW),(()=>{const e=uW();return e?e.themeDark:{}})());return"dark"===t?i:n}const SW={accentBackground:"rgba(88, 74, 192, 1)",accentForeground:"#ffffff",foreground:"#2b2233",background:"#ffffff",border:"rgba(41, 35, 47, 0.13)",feedbackIcon:"rgba(54, 45, 89, 1)",sentryLogo:"rgba(54, 45, 89, 1)"},wW={accentBackground:"rgba(88, 74, 192, 1)",accentForeground:"#ffffff",foreground:"#ebe6ef",background:"#29232f",border:"rgba(235, 230, 239, 0.15)",feedbackIcon:"#ffffff",sentryLogo:"#ffffff"};const kW="AutoInjectMobileScreenshotButton";class CW{static get _feedbackComponentName(){throw new Error("Subclasses must override feedbackComponentName")}static initialize(e){this._setVisibility=e}static reset(){this._isVisible=!1,this._setVisibility=void 0}static show(){this._setVisibility?(this._isVisible=!0,this._setVisibility(!0)):console.warn(`[Sentry] ${this._feedbackComponentName} requires 'Sentry.wrap(RootComponent)' to be called before 'show${this._feedbackComponentName}()'.`)}static hide(){this._setVisibility?(this._isVisible=!1,this._setVisibility(!1)):console.warn(`[Sentry] ${this._feedbackComponentName} requires 'Sentry.wrap(RootComponent)' before interacting with the widget.`)}static isFormVisible(){return this._isVisible}}CW._isVisible=!1;class EW extends CW{static get _feedbackComponentName(){return"FeedbackButton"}}class IW extends CW{static get _feedbackComponentName(){return"ScreenshotButton"}}const xW=()=>{var e,t;$G()?uU.warn("ScreenshotButton is not supported on Web."):((null===(e=YU())||void 0===e?void 0:e.getIntegrationByName(kW))||null===(t=YU())||void 0===t||t.addIntegration({name:kW}),IW.show())};let TW;var OW=function(t,n,i,r){return new(i||(i=Promise))(function(n,a){function o(t){try{l(r.next(t))}catch(e){a(e)}}function s(t){try{l(r.throw(t))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,s)}l((r=r.apply(t,[])).next())})};class RW extends M.Component{constructor(e){var t,n,i,r,a,o;super(e),this._didSubmitForm=!1,this.handleFeedbackSubmit=()=>{const{name:e,email:t,description:n}=this.state,{onSubmitSuccess:i,onSubmitError:r,onFormSubmitted:a}=this.props,o=this.props,s=null==e?void 0:e.trim(),l=null==t?void 0:t.trim(),u=null==n?void 0:n.trim();if(this.props.isNameRequired&&!s||this.props.isEmailRequired&&!l||!u)return void yW(o.errorTitle,o.formError);if(this.props.shouldValidateEmail&&(this.props.isEmailRequired||l.length>0)&&!(e=>/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e))(l))return void yW(o.errorTitle,o.emailError);const c=this.state.filename&&this.state.attachment?[{filename:this.state.filename,data:this.state.attachment}]:void 0,d={message:u,name:s,email:l,associatedEventId:GU().lastEventId()};try{a||this.setState({isVisible:!1}),function(e,t={},n=UU()){const{message:i,name:r,email:a,url:o,source:s,associatedEventId:l,tags:u}=e,c={contexts:{feedback:CU({contact_email:a,name:r,message:i,url:o,source:s,associated_event_id:l})},type:"feedback",level:"info",tags:u},d=n&&n.getClient()||YU();d&&d.emit("beforeSendFeedback",c,t),n.captureEvent(c,t)}(d,c?{attachments:c}:void 0),i({name:s,email:l,message:u,attachments:c}),yW(o.successMessageText,""),a(),this._didSubmitForm=!0}catch(h){r(new Error(`Feedback form submission failed: ${h}`)),yW(o.errorTitle,o.genericError),uU.error(`Feedback form submission failed: ${h}`)}},this.onScreenshotButtonPress=()=>OW(this,0,void 0,function*(){if(this._hasScreenshot())this.setState({filename:void 0,attachment:void 0,attachmentUri:void 0});else{const e=this.props;if(e.imagePicker){const t=e.imagePicker.launchImageLibraryAsync?()=>e.imagePicker.launchImageLibraryAsync({mediaTypes:["images"],base64:$G()}):e.imagePicker.launchImageLibrary?()=>e.imagePicker.launchImageLibrary({mediaType:"photo",includeBase64:$G()}):null;if(!t)return void uU.warn("No compatible image picker library found. Please provide a valid image picker library.");const n=yield t();if(n.assets&&n.assets.length>0)if($G()){const e=n.assets[0].fileName,t=n.assets[0].uri,i=(e=>{if("function"!=typeof atob||!$G())throw new Error("atob is not available in this environment.");const t=atob(e);return new Uint8Array([...t].map(e=>e.charCodeAt(0)))})(n.assets[0].base64);null!=i?this.setState({filename:e,attachment:i,attachmentUri:t}):uU.error("Failed to read image data on the web")}else{const e=n.assets[0].fileName,t=n.assets[0].uri;oW(t).then(n=>{null!=n?this.setState({filename:e,attachment:n,attachmentUri:t}):(this._showImageRetrievalDevelopmentNote(),uU.error("Failed to read image data from uri:",t))}).catch(e=>{this._showImageRetrievalDevelopmentNote(),uU.error("Failed to read image data from uri:",t,"error: ",e)})}}else{const{onAddScreenshot:e}=Object.assign(Object.assign({},vW),this.props);e(e=>{oW(e).then(t=>{null!=t?this.setState({filename:"feedback_screenshot",attachment:t,attachmentUri:e}):(this._showImageRetrievalDevelopmentNote(),uU.error("Failed to read image data from uri:",e))}).catch(t=>{this._showImageRetrievalDevelopmentNote(),uU.error("Failed to read image data from uri:",e,"error: ",t)})})}}}),this._setCapturedScreenshot=e=>{null!=e.data?(uU.debug("Setting captured screenshot:",e.filename),aW.encodeToBase64(e.data).then(t=>{if(null!=t){const n=`data:${e.contentType};base64,${t}`;this.setState({filename:e.filename,attachment:e.data,attachmentUri:n})}else uU.error("Failed to read image data from:",e.filename)}).catch(t=>{uU.error("Failed to read image data from:",e.filename,"error: ",t)})):uU.error("Failed to read image data from:",e.filename)},this._saveFormState=()=>{RW._savedState=Object.assign({},this.state)},this._clearFormState=()=>{RW._savedState={name:"",email:"",description:"",filename:void 0,attachment:void 0,attachmentUri:void 0}},this._hasScreenshot=()=>void 0!==this.state.filename&&void 0!==this.state.attachment&&void 0!==this.state.attachmentUri,this._getUser=()=>{const e=UU().getUser();if(e)return e;const t=GU().getUser();return t||rU("globalScope",()=>new NU).getUser()},this._showImageRetrievalDevelopmentNote=()=>{YG()&&yW("Development note","The feedback widget cannot retrieve image data in Expo Go. Please build your app to test this functionality.")};const s={useSentryUser:{email:(null===(n=null===(t=this.props)||void 0===t?void 0:t.useSentryUser)||void 0===n?void 0:n.email)||(null===(i=this._getUser())||void 0===i?void 0:i.email)||"",name:(null===(a=null===(r=this.props)||void 0===r?void 0:r.useSentryUser)||void 0===a?void 0:a.name)||(null===(o=this._getUser())||void 0===o?void 0:o.name)||""}};this.state={isVisible:!0,name:RW._savedState.name||s.useSentryUser.name,email:RW._savedState.email||s.useSentryUser.email,description:RW._savedState.description||"",filename:RW._savedState.filename||void 0,attachment:RW._savedState.attachment||void 0,attachmentUri:RW._savedState.attachmentUri||void 0},function(){var e,t;(null===(e=YU())||void 0===e?void 0:e.getIntegrationByName(sW))||null===(t=YU())||void 0===t||t.addIntegration(lW())}()}static reset(){RW._savedState={name:"",email:"",description:"",filename:void 0,attachment:void 0,attachmentUri:void 0}}componentDidMount(){this._themeListener=hu.addChangeListener(()=>{this.forceUpdate()})}componentWillUnmount(){this._didSubmitForm?(this._clearFormState(),this._didSubmitForm=!1):this._saveFormState(),this._themeListener&&this._themeListener.remove()}render(){const e=bW(),{name:t,email:n,description:i}=this.state,{onFormClose:r}=this.props,a=this.props,o=this.props,s=this.props,l=Object.assign(Object.assign({},(e=>({container:{flex:1,padding:20,backgroundColor:e.background},title:{fontSize:24,fontWeight:"bold",marginBottom:20,textAlign:"left",flex:1,color:e.foreground},label:{marginBottom:4,fontSize:16,color:e.foreground},input:{height:50,borderColor:e.border,borderWidth:1,borderRadius:5,paddingHorizontal:10,marginBottom:15,fontSize:16,color:e.foreground},textArea:{height:100,textAlignVertical:"top",color:e.foreground},screenshotButton:{backgroundColor:e.background,padding:15,borderRadius:5,alignItems:"center",flex:1,borderWidth:1,borderColor:e.border},screenshotContainer:{flexDirection:"row",alignItems:"center",width:"100%",marginBottom:20},screenshotThumbnail:{width:50,height:50,borderRadius:5,marginRight:10},screenshotText:{color:e.foreground,fontSize:16},takeScreenshotButton:{backgroundColor:e.background,padding:15,borderRadius:5,alignItems:"center",borderWidth:1,borderColor:e.border,marginTop:-10,marginBottom:20},takeScreenshotText:{color:e.foreground,fontSize:16},submitButton:{backgroundColor:e.accentBackground,paddingVertical:15,borderRadius:5,alignItems:"center",marginBottom:10},submitText:{color:e.accentForeground,fontSize:18},cancelButton:{backgroundColor:e.background,padding:15,borderRadius:5,alignItems:"center",borderWidth:1,borderColor:e.border},cancelText:{color:e.foreground,fontSize:16},titleContainer:{flexDirection:"row",width:"100%"},sentryLogo:{width:40,height:40,tintColor:e.sentryLogo}}))(e)),this.props.styles),u=()=>{r?r():this.setState({isVisible:!1})};if(!this.state.isVisible)return null;const c=(()=>{const e=TW;return TW=void 0,e})();return"ErrorCapturingScreenshot"===c?setTimeout(()=>OW(this,0,void 0,function*(){yW(s.errorTitle,s.captureScreenshotError)}),100):c&&this._setCapturedScreenshot(c),M.createElement(fm,{onPress:XG()?Pu.dismiss:void 0,accessible:!1,accessibilityElementsHidden:!1},M.createElement(_a,{style:l.container},M.createElement(_a,{style:l.titleContainer},M.createElement(hl,{style:l.title,testID:"sentry-feedback-form-title"},s.formTitle),a.showBranding&&M.createElement(Js,{source:{uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAC4BAMAAABUVL5sAAAAD1BMVEUAAAA2Llo3LVk4LFg2LVmgcvrUAAAABHRSTlMAgL9ARyeO/QAAA7pJREFUeNrtWltynDAQFBIHIFUcgCQ6AIk5AAjd/0ypxFk3ouUCNJofl/rHy75a09MzI7Q2DQ0NDQ0NDQ0NDQ0N9eF+xPh9MKpwPv6FLss7R9yMImz8j8nowb9IglFDF6N+KCNIdqMFcGjpBbVUXdzHqKsXUhJGNb2g1vz6azRgX8XulUwMtVZjFsWkvFz10s0ooEO+9Vpxj/6rp9eI5VsdE6eJcDCxilqICiZWMHBSMkBVA2vq1SVrVyr6Ea5VMjHqjytTwcAgRVJ0DAy9VoWUTNT3tQysZGIYmGNTKHfK0q6oFkysYWCuHB0DaxX9yHLx5JKrhVC0TGwjWNRMvNAuW6PoR4TCepnqLLuiicEyKJq4g2C6Rc+hsInlgtHCF41OrD65INisObksbKy2/YJg9U08sGBTbRN3YaBQQu2i74/mcQil6vZr5C0dQpGbGKJvdOA1VDVxd5LHooPR5BJPdwql5vaLeq9FQZKJpa1kOoUSKpq45+m+ZK93aUpSwRyuafslUguCIZRZamKoBYQT80QmlqnF38p6bSIDcyg2q5fw/uo8dx0upZMLLdadQ1kgkNDEOOGiYYXjVKGJ8V00rEggcErurxAKCwQTi9RCAW7UFcUm5vPAOFNXFBY9DggQyp76jnIkOyBwaeqtyMScEu7w4JRNLnyQOjyvACcWpR145g6PV1fp9mvE0jMd3tWZXDR3/Ud2cSXZfmHhvNpEoFlgYsjFHX4AJc3kXXSTyEfDTrz94ptE1qvS9ouG1Ud2sQT5PVcHg3FL78FIYUpqxWK1yLzMxNzhHVaLzItMzB0eB/S4CDRHC+AzFTjhAiSSHx9tpgJXqnmhXi7VizM/F5v4V5oVqOIp81PpEW4Xt7PUA0kEe5WZ2PLt7ZopDg8Seue9GpxoU0WrHyFPgYlzmyrKPDxcpFeX3YRS5mGvxybmsC2tPhLJQxPzdsfliwMeLjAx9wcujoFIaEAX/KSYXz0s+9TE/E7LX0yF8lQvitl99sVjSgITl/yk6Lk48JjfGadnanHml8xjMvFTA+eL42CRwDKEZwbm4rBMyAmdH6UEz8HDTPj4d4ie1EJxJCQg56DXaxKOl0iGz0jcdebZluzhbFSA1yEZ2JzbHZKQe3I/EK4CErTHbwn84ZP+8Poxqrd/+I2cXJAw0v9VAkBiI3DhLryZEe6SXNeJk5HcHFu+Aom5wiIn2a7niZiE1WKMUhIOhNFJSQZzh0VG8tPcQufLSQI46sO9vcM0NDQ0NDQ0NDQ0NHxF/AFGJOBYBWrb5gAAAABJRU5ErkJggg=="},style:l.sentryLogo,testID:"sentry-logo"})),a.showName&&M.createElement(M.Fragment,null,M.createElement(hl,{style:l.label},s.nameLabel,a.isNameRequired&&` ${s.isRequiredLabel}`),M.createElement(kh,{style:l.input,testID:"sentry-feedback-name-input",placeholder:s.namePlaceholder,value:t,onChangeText:e=>this.setState({name:e})})),a.showEmail&&M.createElement(M.Fragment,null,M.createElement(hl,{style:l.label},s.emailLabel,a.isEmailRequired&&` ${s.isRequiredLabel}`),M.createElement(kh,{style:l.input,testID:"sentry-feedback-email-input",placeholder:s.emailPlaceholder,keyboardType:"email-address",value:n,onChangeText:e=>this.setState({email:e})})),M.createElement(hl,{style:l.label},s.messageLabel,` ${s.isRequiredLabel}`),M.createElement(kh,{style:[l.input,l.textArea],testID:"sentry-feedback-message-input",placeholder:s.messagePlaceholder,value:i,onChangeText:e=>this.setState({description:e}),multiline:!0}),(a.enableScreenshot||o.imagePicker||this._hasScreenshot())&&M.createElement(_a,{style:l.screenshotContainer},this.state.attachmentUri&&M.createElement(Js,{source:{uri:this.state.attachmentUri},style:l.screenshotThumbnail}),M.createElement(xc,{style:l.screenshotButton,onPress:this.onScreenshotButtonPress},M.createElement(hl,{style:l.screenshotText},this._hasScreenshot()?s.removeScreenshotButtonLabel:s.addScreenshotButtonLabel))),XG()&&a.enableTakeScreenshot&&!this.state.attachmentUri&&M.createElement(xc,{style:l.takeScreenshotButton,onPress:()=>{EW.hide(),u(),xW()}},M.createElement(hl,{style:l.takeScreenshotText,testID:"sentry-feedback-take-screenshot-button"},s.captureScreenshotButtonLabel)),M.createElement(xc,{style:l.submitButton,onPress:this.handleFeedbackSubmit},M.createElement(hl,{style:l.submitText,testID:"sentry-feedback-submit-button"},s.submitButtonLabel)),M.createElement(xc,{style:l.cancelButton,onPress:u},M.createElement(hl,{style:l.cancelText},s.cancelButtonLabel))))}}RW.defaultProps=Object.assign({},vW),RW._savedState={name:"",email:"",description:"",filename:void 0,attachment:void 0,attachmentUri:void 0},function(){var e;const{major:t,minor:n}=(null===(e=UG.ReactNativeVersion)||void 0===e?void 0:e.version)||{}}();tr.hasViewManagerConfig&&tr.hasViewManagerConfig("RNSentryOnDrawReporter");const AW=Ei.create({wrapperView:{flex:1}}),LW="sentry-label",PW="data-sentry-component",MW="data-sentry-element",DW="data-sentry-source-file";class NW extends M.Component{constructor(){super(...arguments),this.name="TouchEventBoundary"}componentDidMount(){var e;const t=YU();null===(e=null==t?void 0:t.addIntegration)||void 0===e||e.call(t,function(e,t=()=>{}){return{name:e,setupOnce:t}}(this.name))}render(){return M.createElement(_a,{style:AW.wrapperView,onTouchStart:this._onTouchStart.bind(this)},this.props.children)}_logTouchEvent(e,t){const n=e[0],i=t||`${n.name}${n.file?` (${n.file})`:""}`,r={category:this.props.breadcrumbCategory,data:{path:e},level:"info",message:`Touch event within element: ${i}`,type:this.props.breadcrumbType};zG(r),uU.log(`[TouchEvents] ${r.message}`)}_isNameIgnored(e){let t=this.props.ignoreNames||[];return this.props.ignoredDisplayNames&&(t=[...t,...this.props.ignoredDisplayNames]),t.some(t=>"string"==typeof t&&e===t||t instanceof RegExp&&e.match(t))}_onTouchStart(e){var t,n;if(!e._targetInst)return;let i=e._targetInst;const r=[];for(;i&&this.props.maxComponentTreeSize&&r.length<this.props.maxComponentTreeSize&&(null===(t=i.elementType)||void 0===t?void 0:t.displayName)!==NW.displayName;){const e=FW(i,this.props.labelName);this._pushIfNotIgnored(r,e),i=i.return}const a=null===(n=r.find(e=>e.label))||void 0===n?void 0:n.label;r.length>0&&this._logTouchEvent(r,a);const o=gW({elementId:a,op:"ui.action.touch"});o&&o.setAttribute(KU,cW)}_pushIfNotIgnored(e,t){return!!t&&(!(!t.name&&!t.label)&&((!t.name||!this._isNameIgnored(t.name))&&((!t.label||!this._isNameIgnored(t.label))&&(!(e.length>0&&JSON.stringify(e[e.length-1])===JSON.stringify(t))&&(e.push(t),!0)))))}}function FW(e,t){var n;const i=null===(n=e.elementType)||void 0===n?void 0:n.displayName,r=e.memoizedProps;return r?CU({name:BW(r)||i,element:jW(r),file:VW(r),label:HW(r,t)}):i?{name:i}:void 0}function BW(e){return"string"==typeof e[PW]&&e[PW].length>0&&"unknown"!==e[PW]&&e[PW]||void 0}function jW(e){return"string"==typeof e[MW]&&e[MW].length>0&&"unknown"!==e[MW]&&e[MW]||void 0}function VW(e){return"string"==typeof e[DW]&&e[DW].length>0&&"unknown"!==e[DW]&&e[DW]||void 0}function HW(e,t){return"string"==typeof e[LW]&&e[LW].length>0?e[LW]:"string"==typeof t&&"string"==typeof e[t]&&e[t].length>0?e[t]:void 0}function zW(e){return Array.isArray(e)||eN(e)}function UW(e,t){const n=zW(e),i=zW(t);if(n!==i)throw zG({data:{incoming:e,schema:t,isArrayIncoming:n,isArraySchema:i},message:"TypeGuard isArray"}),new Error(`PersistenceUtils::typeGuard] ${eU.MalformedDataError}`);if(n)for(const r of e)UW(r,t[0]);return YW(t)&&Object.keys(t).forEach(n=>{const i=e[n],r=t[n];if(i&&zW(r))UW(i,r);else if(i&&YW(i))UW(i,r);else if(YW(e)&&!e.hasOwnProperty(n))throw zG({data:{key:n,incoming:e,incomingProperty:i,schema:t,schemaProperty:r,isObjectIncoming:YW(e),hasOwnPropertyIncoming:e.hasOwnProperty(n)},message:"TypeGuard isObject"}),new Error(`[PersistenceUtils::typeGuard] ${eU.MalformedDataError}`)}),!0}NW.displayName="__Sentry.TouchEventBoundary",NW.defaultProps={breadcrumbCategory:"touch",breadcrumbType:"user",ignoreNames:[],maxComponentTreeSize:20};const GW=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;function WW(e){if(zW(e))for(let t=0;t<e.length;t++)e[t]=WW(e[t]);else if(YW(e))for(const t of Object.keys(e)){const n=e[t];"object"==typeof n?e[t]=WW(n):"string"==typeof n&&GW.exec(n)&&(e[t]=new Date(n))}return e}function YW(e){return null!=e&&"object"==typeof e&&!zW(e)}class $W{storageName;schema;constructor(e,t){this.storageName=`${e}Storage`,this.schema=JSON.parse(JSON.stringify(t))}get(){const e=Qj.getString(this.storageName),t=this.instantiateData(e);return this.isT(t),t}update(e){const t=JSON.parse(JSON.stringify(e)),n=Object.assign(this.get(),t);return this.isT(n),Qj.set(this.storageName,JSON.stringify(n)),n}set(e){return this.isT(e),Qj.set(this.storageName,JSON.stringify(e)),e}clear(){return Qj.delete(this.storageName),this.instantiateData(void 0)}instantiateData(e){const t=e??JSON.stringify(this.schema);return Qj.set(this.storageName,t),JSON.parse(t)}isT(e){if(!e||"object"!=typeof e)throw new Error(`[PersistenceManager::isT] ${eU.IncorrectDataError}`);return UW(e,this.schema),!0}}class XW{persistenceManager;schema;data;constructor(e,t){this.schema=JSON.parse(JSON.stringify(t)),this.data=JSON.parse(JSON.stringify(t)),this.persistenceManager=new $W(e,t),this.createDataFromSchema(),this.restore()}get(){return this.data}set(e){return this.data=JSON.parse(JSON.stringify(e)),this.data=WW(this.data),this.data}update(e){if(zW(this.data)){const n=this.data.findIndex(t=>t.uuid===e.uuid);if(-1!==n)this.data[n]={...this.data[n],...e};else try{UW([e],this.schema),this.data.push(e)}catch(t){if(t.message===eU.MalformedDataError)throw new Error("[DataManager::update] Cannot add an element that does not contain required fields");throw t}}else Object.assign(this.data,e);return this.data}save(e=!0){return e?this.persistenceManager.update(this.data):this.persistenceManager.set(this.data)}restore(){if(this.data=this.persistenceManager.get(),this.data=WW(this.data),zW(this.data)){const e=e=>e.filter(e=>!!e.uuid);this.data=e(this.data)}return this.data}clear=()=>(this.persistenceManager.clear(),this.createDataFromSchema(),this.data);createDataFromSchema(){this.data=zW(this.schema)?[]:JSON.parse(JSON.stringify(this.schema))}}const qW=new class extends XW{migrateData(){throw new Error("[TrackingManager::migrateData] Method purposefully not implemented.")}constructor(){super("trackingEvent",[])}update(e){return super.update(e)}sync=async()=>{const e=super.get(),t=[];for(const n of e)try{await Jz(n)}catch{t.push(n)}super.set(t),super.save(!1)}},ZW=6048e5,KW=6e4,QW=36e5,JW=Symbol.for("constructDateFrom");function eY(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&JW in e?e[JW](t):e instanceof Date?new e.constructor(t):new Date(t)}function tY(e,t){return eY(t||e,e)}function nY(e,t,n){const i=tY(e,n?.in);return isNaN(t)?eY(n?.in||e,NaN):t?(i.setDate(i.getDate()+t),i):i}function iY(e,t,n){const i=tY(e,n?.in);if(isNaN(t))return eY(e,NaN);if(!t)return i;const r=i.getDate(),a=eY(e,i.getTime());a.setMonth(i.getMonth()+t+1,0);return r>=a.getDate()?a:(i.setFullYear(a.getFullYear(),a.getMonth(),r),i)}function rY(e,t,n){return function(e,t){return eY(e,+tY(e)+t)}(e,t*QW)}let aY={};function oY(){return aY}function sY(e,t){const n=oY(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=tY(e,t?.in),a=r.getDay(),o=(a<i?7:0)+a-i;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function lY(e,t){return sY(e,{...t,weekStartsOn:1})}function uY(e,t){const n=tY(e,t?.in),i=n.getFullYear(),r=eY(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const a=lY(r),o=eY(n,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const s=lY(o);return n.getTime()>=a.getTime()?i+1:n.getTime()>=s.getTime()?i:i-1}function cY(e){const t=tY(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function dY(e,...t){const n=eY.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}function hY(e,t){const n=tY(e,t?.in);return n.setHours(0,0,0,0),n}function mY(e,t,n){const i=tY(e,n?.in);return i.setTime(i.getTime()+t*KW),i}function pY(e,t){const n=+tY(e)-+tY(t);return n<0?-1:n>0?1:n}function fY(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+tY(e)));var t}function _Y(e,t,n){const i=(r=t,(+tY(e)-+tY(r))/KW);var r,a;return(a=n?.roundingMethod,e=>{const t=(a?Math[a]:Math.trunc)(e);return 0===t?0:t})(i)}function gY(e,t,n){const[i,r]=dY(n?.in,e,t),a=pY(i,r),o=Math.abs(function(e,t,n){const[i,r]=dY(n?.in,e,t);return i.getFullYear()-r.getFullYear()}(i,r));i.setFullYear(1584),r.setFullYear(1584);const s=a*(o-+(pY(i,r)===-a));return 0===s?0:s}const yY={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},vY=(e,t,n)=>{let i;const r=yY[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function bY(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const SY={date:bY({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:bY({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},wY={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},kY=(e,t,n,i)=>wY[e];function CY(e){return(t,n)=>{let i;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}return i[e.argumentCallback?e.argumentCallback(t):t]}}const EY={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:CY({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:CY({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function IY(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],a=t.match(r);if(!a)return null;const o=a[0],s=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,e=>e.test(o)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,e=>e.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;return{value:u,rest:t.slice(o.length)}}}function xY(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;return{value:o,rest:t.slice(r.length)}}}const TY={ordinalNumber:xY({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:IY({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},OY={code:"en-US",formatDistance:vY,formatLong:SY,formatRelative:kY,localize:EY,match:TY,options:{weekStartsOn:0,firstWeekContainsDate:1}};function RY(e,t){const n=tY(e,t?.in),i=function(e,t,n){const[i,r]=dY(n?.in,e,t),a=hY(i),o=hY(r),s=+a-cY(a),l=+o-cY(o);return Math.round((s-l)/864e5)}(n,function(e,t){const n=tY(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}(n));return i+1}function AY(e,t){const n=tY(e,t?.in),i=+lY(n)-+function(e,t){const n=uY(e,t),i=eY(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),lY(i)}(n);return Math.round(i/ZW)+1}function LY(e,t){const n=tY(e,t?.in),i=n.getFullYear(),r=oY(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=eY(t?.in||e,0);o.setFullYear(i+1,0,a),o.setHours(0,0,0,0);const s=sY(o,t),l=eY(t?.in||e,0);l.setFullYear(i,0,a),l.setHours(0,0,0,0);const u=sY(l,t);return+n>=+s?i+1:+n>=+u?i:i-1}function PY(e,t){const n=tY(e,t?.in),i=+sY(n,t)-+function(e,t){const n=oY(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=LY(e,t),a=eY(t?.in||e,0);return a.setFullYear(r,0,i),a.setHours(0,0,0,0),sY(a,t)}(n,t);return Math.round(i/ZW)+1}function MY(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const DY={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return MY("yy"===t?i%100:i,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):MY(n+1,2)},d:(e,t)=>MY(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>MY(e.getHours()%12||12,t.length),H:(e,t)=>MY(e.getHours(),t.length),m:(e,t)=>MY(e.getMinutes(),t.length),s:(e,t)=>MY(e.getSeconds(),t.length),S(e,t){const n=t.length,i=e.getMilliseconds();return MY(Math.trunc(i*Math.pow(10,n-3)),t.length)}},NY="midnight",FY="noon",BY="morning",jY="afternoon",VY="evening",HY="night",zY={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),i=t>0?t:1-t;return n.ordinalNumber(i,{unit:"year"})}return DY.y(e,t)},Y:function(e,t,n,i){const r=LY(e,i),a=r>0?r:1-r;if("YY"===t){return MY(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):MY(a,t.length)},R:function(e,t){return MY(uY(e),t.length)},u:function(e,t){return MY(e.getFullYear(),t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return MY(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return MY(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return DY.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return MY(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=PY(e,i);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):MY(r,t.length)},I:function(e,t,n){const i=AY(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):MY(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):DY.d(e,t)},D:function(e,t,n){const i=RY(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):MY(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return MY(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return MY(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=0===i?7:i;switch(t){case"i":return String(r);case"ii":return MY(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(r=12===i?FY:0===i?NY:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(r=i>=17?VY:i>=12?jY:i>=4?BY:HY,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return DY.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):DY.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):MY(i,t.length)},k:function(e,t,n){let i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):MY(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):DY.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):DY.s(e,t)},S:function(e,t){return DY.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return GY(i);case"XXXX":case"XX":return WY(i);default:return WY(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return GY(i);case"xxxx":case"xx":return WY(i);default:return WY(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+UY(i,":");default:return"GMT"+WY(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+UY(i,":");default:return"GMT"+WY(i,":")}},t:function(e,t,n){return MY(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return MY(+e,t.length)}};function UY(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),a=i%60;return 0===a?n+String(r):n+String(r)+t+MY(a,2)}function GY(e,t){if(e%60==0){return(e>0?"-":"+")+MY(Math.abs(e)/60,2)}return WY(e,t)}function WY(e,t=""){const n=e>0?"-":"+",i=Math.abs(e);return n+MY(Math.trunc(i/60),2)+t+MY(i%60,2)}const YY=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},$Y=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},XY={p:$Y,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return YY(e,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",YY(i,t)).replace("{{time}}",$Y(r,t))}},qY=/^D+$/,ZY=/^Y+$/,KY=["D","DD","YY","YYYY"];function QY(e){return qY.test(e)}function JY(e){return ZY.test(e)}function e$(e,t,n){const i=function(e,t,n){const i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(i),KY.includes(e))throw new RangeError(i)}const t$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,n$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,i$=/^'([^]*?)'?$/,r$=/''/g,a$=/[a-zA-Z]/;function o$(e,t,n){const i=oY(),r=i.locale??OY,a=i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=tY(e,n?.in);if(!fY(s))throw new RangeError("Invalid time value");let l=t.match(n$).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,XY[t])(e,r.formatLong)}return e}).join("").match(t$).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:s$(e)};if(zY[t])return{isToken:!0,value:e};if(t.match(a$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(l=r.localize.preprocessor(s,l));const u={firstWeekContainsDate:a,weekStartsOn:o,locale:r};return l.map(n=>{if(!n.isToken)return n.value;const i=n.value;(JY(i)||QY(i))&&e$(i,t,String(e));return(0,zY[i[0]])(s,i,r.localize,u)}).join("")}function s$(e){const t=e.match(i$);return t?t[1].replace(r$,"'"):e}function l$(e,t){const n=tY(e,t?.in),i=n.getFullYear(),r=n.getMonth(),a=eY(n,0);return a.setFullYear(i,r+1,0),a.setHours(0,0,0,0),a.getDate()}function u$(e,t){return+tY(e)>+tY(t)}function c$(e,t){return+tY(e)<+tY(t)}class d${subPriority=0;validate(e,t){return!0}}class h$ extends d${constructor(e,t,n,i,r){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=i,r&&(this.subPriority=r)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}}class m$ extends d${priority=10;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>eY(t,e))}set(e,t){return t.timestampIsSet?e:eY(e,function(e,t){const n=function(e){return"function"==typeof e&&e.prototype?.constructor===e}(t)?new t(0):eY(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}(e,this.context))}}class p${run(e,t,n,i){const r=this.parse(e,t,n,i);return r?{setter:new h$(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(e,t,n){return!0}}const f$=/^(1[0-2]|0?\d)/,_$=/^(3[0-1]|[0-2]?\d)/,g$=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,y$=/^(5[0-3]|[0-4]?\d)/,v$=/^(2[0-3]|[0-1]?\d)/,b$=/^(2[0-4]|[0-1]?\d)/,S$=/^(1[0-1]|0?\d)/,w$=/^(1[0-2]|0?\d)/,k$=/^[0-5]?\d/,C$=/^[0-5]?\d/,E$=/^\d/,I$=/^\d{1,2}/,x$=/^\d{1,3}/,T$=/^\d{1,4}/,O$=/^-?\d+/,R$=/^-?\d/,A$=/^-?\d{1,2}/,L$=/^-?\d{1,3}/,P$=/^-?\d{1,4}/,M$=/^([+-])(\d{2})(\d{2})?|Z/,D$=/^([+-])(\d{2})(\d{2})|Z/,N$=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,F$=/^([+-])(\d{2}):(\d{2})|Z/,B$=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function j$(e,t){return e?{value:t(e.value),rest:e.rest}:e}function V$(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function H$(e,t){const n=t.match(e);if(!n)return null;if("Z"===n[0])return{value:0,rest:t.slice(1)};const i="+"===n[1]?1:-1,r=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:i*(r*QW+a*KW+1e3*o),rest:t.slice(n[0].length)}}function z$(e){return V$(O$,e)}function U$(e,t){switch(e){case 1:return V$(E$,t);case 2:return V$(I$,t);case 3:return V$(x$,t);case 4:return V$(T$,t);default:return V$(new RegExp("^\\d{1,"+e+"}"),t)}}function G$(e,t){switch(e){case 1:return V$(R$,t);case 2:return V$(A$,t);case 3:return V$(L$,t);case 4:return V$(P$,t);default:return V$(new RegExp("^-?\\d{1,"+e+"}"),t)}}function W$(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Y$(e,t){const n=t>0,i=n?t:1-t;let r;if(i<=50)r=e||100;else{const t=i+50;r=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return n?r:1-r}function $$(e){return e%400==0||e%4==0&&e%100!=0}const X$=[31,28,31,30,31,30,31,31,30,31,30,31],q$=[31,29,31,30,31,30,31,31,30,31,30,31];function Z$(e,t,n){const i=oY(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=tY(e,n?.in),o=a.getDay(),s=7-r;return nY(a,t<0||t>6?t-(o+s)%7:((t%7+7)%7+s)%7-(o+s)%7,n)}function K$(e,t,n){const i=tY(e,n?.in),r=function(e,t){const n=tY(e,t?.in).getDay();return 0===n?7:n}(i,n);return nY(i,t-r,n)}const Q$={G:new class extends p${priority=140;parse(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]},y:new class extends p${priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,n){const i=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return j$(U$(4,e),i);case"yo":return j$(n.ordinalNumber(e,{unit:"year"}),i);default:return j$(U$(t.length,e),i)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){const i=e.getFullYear();if(n.isTwoDigitYear){const t=Y$(n.year,i);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const r="era"in t&&1!==t.era?1-n.year:n.year;return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}},Y:new class extends p${priority=130;parse(e,t,n){const i=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return j$(U$(4,e),i);case"Yo":return j$(n.ordinalNumber(e,{unit:"year"}),i);default:return j$(U$(t.length,e),i)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,i){const r=LY(e,i);if(n.isTwoDigitYear){const t=Y$(n.year,r);return e.setFullYear(t,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),sY(e,i)}const a="era"in t&&1!==t.era?1-n.year:n.year;return e.setFullYear(a,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),sY(e,i)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends p${priority=130;parse(e,t){return G$("R"===t?4:t.length,e)}set(e,t,n){const i=eY(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),lY(i)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends p${priority=130;parse(e,t){return G$("u"===t?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends p${priority=120;parse(e,t,n){switch(t){case"Q":case"QQ":return U$(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth(3*(n-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends p${priority=120;parse(e,t,n){switch(t){case"q":case"qq":return U$(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth(3*(n-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends p${incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,n){const i=e=>e-1;switch(t){case"M":return j$(V$(f$,e),i);case"MM":return j$(U$(2,e),i);case"Mo":return j$(n.ordinalNumber(e,{unit:"month"}),i);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},L:new class extends p${priority=110;parse(e,t,n){const i=e=>e-1;switch(t){case"L":return j$(V$(f$,e),i);case"LL":return j$(U$(2,e),i);case"Lo":return j$(n.ordinalNumber(e,{unit:"month"}),i);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends p${priority=100;parse(e,t,n){switch(t){case"w":return V$(y$,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return U$(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,i){return sY(function(e,t,n){const i=tY(e,n?.in),r=PY(i,n)-t;return i.setDate(i.getDate()-7*r),tY(i,n?.in)}(e,n,i),i)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends p${priority=100;parse(e,t,n){switch(t){case"I":return V$(y$,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return U$(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return lY(function(e,t,n){const i=tY(e,n?.in),r=AY(i,n)-t;return i.setDate(i.getDate()-7*r),i}(e,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends p${priority=90;subPriority=1;parse(e,t,n){switch(t){case"d":return V$(_$,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return U$(t.length,e)}}validate(e,t){const n=$$(e.getFullYear()),i=e.getMonth();return n?t>=1&&t<=q$[i]:t>=1&&t<=X$[i]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends p${priority=90;subpriority=1;parse(e,t,n){switch(t){case"D":case"DD":return V$(g$,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return U$(t.length,e)}}validate(e,t){return $$(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends p${priority=90;parse(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,i){return(e=Z$(e,n,i)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends p${priority=90;parse(e,t,n,i){const r=e=>{const t=7*Math.floor((e-1)/7);return(e+i.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return j$(U$(t.length,e),r);case"eo":return j$(n.ordinalNumber(e,{unit:"day"}),r);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,i){return(e=Z$(e,n,i)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends p${priority=90;parse(e,t,n,i){const r=e=>{const t=7*Math.floor((e-1)/7);return(e+i.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return j$(U$(t.length,e),r);case"co":return j$(n.ordinalNumber(e,{unit:"day"}),r);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,i){return(e=Z$(e,n,i)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends p${priority=90;parse(e,t,n){const i=e=>0===e?7:e;switch(t){case"i":case"ii":return U$(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return j$(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i);case"iiiii":return j$(n.day(e,{width:"narrow",context:"formatting"}),i);case"iiiiii":return j$(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i);default:return j$(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return(e=K$(e,n)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends p${priority=80;parse(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(W$(n),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends p${priority=80;parse(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(W$(n),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends p${priority=80;parse(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(W$(n),0,0,0),e}incompatibleTokens=["a","b","t","T"]},h:new class extends p${priority=70;parse(e,t,n){switch(t){case"h":return V$(w$,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return U$(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){const i=e.getHours()>=12;return i&&n<12?e.setHours(n+12,0,0,0):i||12!==n?e.setHours(n,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]},H:new class extends p${priority=70;parse(e,t,n){switch(t){case"H":return V$(v$,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return U$(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends p${priority=70;parse(e,t,n){switch(t){case"K":return V$(S$,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return U$(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]},k:new class extends p${priority=70;parse(e,t,n){switch(t){case"k":return V$(b$,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return U$(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){const i=n<=24?n%24:n;return e.setHours(i,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends p${priority=60;parse(e,t,n){switch(t){case"m":return V$(k$,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return U$(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=["t","T"]},s:new class extends p${priority=50;parse(e,t,n){switch(t){case"s":return V$(C$,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return U$(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=["t","T"]},S:new class extends p${priority=30;parse(e,t){return j$(U$(t.length,e),e=>Math.trunc(e*Math.pow(10,3-t.length)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=["t","T"]},X:new class extends p${priority=10;parse(e,t){switch(t){case"X":return H$(M$,e);case"XX":return H$(D$,e);case"XXXX":return H$(N$,e);case"XXXXX":return H$(B$,e);default:return H$(F$,e)}}set(e,t,n){return t.timestampIsSet?e:eY(e,e.getTime()-cY(e)-n)}incompatibleTokens=["t","T","x"]},x:new class extends p${priority=10;parse(e,t){switch(t){case"x":return H$(M$,e);case"xx":return H$(D$,e);case"xxxx":return H$(N$,e);case"xxxxx":return H$(B$,e);default:return H$(F$,e)}}set(e,t,n){return t.timestampIsSet?e:eY(e,e.getTime()-cY(e)-n)}incompatibleTokens=["t","T","X"]},t:new class extends p${priority=40;parse(e){return z$(e)}set(e,t,n){return[eY(e,1e3*n),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends p${priority=20;parse(e){return z$(e)}set(e,t,n){return[eY(e,n),{timestampIsSet:!0}]}incompatibleTokens="*"}},J$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eX=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tX=/^'([^]*?)'?$/,nX=/''/g,iX=/\S/,rX=/[a-zA-Z]/;function aX(e,t,n,i){const r=()=>eY(n,NaN),a=Object.assign({},oY()),o=a.locale??OY,s=a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?r():tY(n,i?.in);const u={firstWeekContainsDate:s,weekStartsOn:l,locale:o},c=[new m$(i?.in,n)],d=t.match(eX).map(e=>{const t=e[0];if(t in XY){return(0,XY[t])(e,o.formatLong)}return e}).join("").match(J$),h=[];for(let _ of d){JY(_)&&e$(_,t,e),QY(_)&&e$(_,t,e);const n=_[0],i=Q$[n];if(i){const{incompatibleTokens:t}=i;if(Array.isArray(t)){const e=h.find(e=>t.includes(e.token)||e.token===n);if(e)throw new RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${_}\` at the same time`)}else if("*"===i.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);h.push({token:n,fullToken:_});const a=i.run(e,_,o.match,u);if(!a)return r();c.push(a.setter),e=a.rest}else{if(n.match(rX))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");if("''"===_?_="'":"'"===n&&(_=oX(_)),0!==e.indexOf(_))return r();e=e.slice(_.length)}}if(e.length>0&&iX.test(e))return r();const m=c.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>c.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]);let p=tY(n,i?.in);if(isNaN(+p))return r();const f={};for(const _ of m){if(!_.validate(p,u))return r();const e=_.set(p,f,u);Array.isArray(e)?(p=e[0],Object.assign(f,e[1])):p=e}return p}function oX(e){return e.match(tX)[1].replace(nX,"'")}function sX(e,t){const n=tY(e,t?.in);return n.setMinutes(0,0,0),n}function lX(e,t,n){const[i,r]=dY(n?.in,e,t);return+sX(i)===+sX(r)}function uX(e,t,n){const[i,r]=dY(n?.in,e,t);return+sY(i,n)===+sY(r,n)}function cX(e,t,n){return nY(e,-t,n)}function dX(e,t,n){let i=tY(e,n?.in);return isNaN(+i)?eY(e,NaN):(null!=t.year&&i.setFullYear(t.year),null!=t.month&&(i=function(e,t,n){const i=tY(e,n?.in),r=i.getFullYear(),a=i.getDate(),o=eY(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const s=l$(o);return i.setMonth(t,Math.min(a,s)),i}(i,t.month)),null!=t.date&&i.setDate(t.date),null!=t.hours&&i.setHours(t.hours),null!=t.minutes&&i.setMinutes(t.minutes),null!=t.seconds&&i.setSeconds(t.seconds),null!=t.milliseconds&&i.setMilliseconds(t.milliseconds),i)}function hX(e){const t={},n=oY();for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(void 0===e[i]?delete t[i]:t[i]=e[i]);aY=t}function mX(e,t,n){const{years:i=0,months:r=0,weeks:a=0,days:o=0,hours:s=0,minutes:l=0,seconds:u=0}=t,c=function(e,t,n){return iY(e,-t,n)}(e,r+12*i,n);return eY(e,+cX(c,o+7*a,n)-1e3*(u+60*(l+60*s)))}function pX(e,t,n){return rY(e,-4)}function fX(e,t,n){return mY(e,-1,n)}function _X(e,t,n){return function(e,t,n){return iY(e,12*t,n)}(e,-18,n)}let gX;const yX=new Uint8Array(16);function vX(){if(!gX&&(gX="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gX))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gX(yX)}const bX=[];for(let Jee=0;Jee<256;++Jee)bX.push((Jee+256).toString(16).slice(1));const SX={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function wX(e,t,n){if(SX.randomUUID&&!e)return SX.randomUUID();const i=(e=e||{}).random||(e.rng||vX)();return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e,t=0){return bX[e[t+0]]+bX[e[t+1]]+bX[e[t+2]]+bX[e[t+3]]+"-"+bX[e[t+4]]+bX[e[t+5]]+"-"+bX[e[t+6]]+bX[e[t+7]]+"-"+bX[e[t+8]]+bX[e[t+9]]+"-"+bX[e[t+10]]+bX[e[t+11]]+bX[e[t+12]]+bX[e[t+13]]+bX[e[t+14]]+bX[e[t+15]]}(i)}const kX=uV?"/api/v2":Wj.HEDIA_API_URL_V2;var CX=(e=>(e[e.cL=10]="cL",e[e.g=100]="g",e[e.mL=100]="mL",e))(CX||{});const EX={cl:10,g:100,ml:100},IX=e=>{const t=e.reduce((e,t)=>{const n=AX(t.unit);return e+t.amount/n*t.foodItem.carbohydrates},0);return Math.round(t)},xX={cartItems:[],totalCarbsCartItems:0,manualCarbsInput:0},TX=cL()((e,t)=>({...xX,carbohydrateStoreActions:{setManualCarbsInput:t=>{e({manualCarbsInput:Math.round(t)})},upsertCartItem:t=>{e(e=>{const n=e.cartItems.findIndex(e=>e.foodItem.id===t.foodItem.id);let i;i=-1!==n?e.cartItems.map((e,i)=>i===n?t:e):[...e.cartItems,t];return{cartItems:i,totalCarbsCartItems:IX(i)}})},removeFromCart:(t,n)=>{e(e=>{const i=e.cartItems.filter(({foodItem:e})=>!("id"===n?e.id===t:e.title===t));return{cartItems:i,totalCarbsCartItems:IX(i)}})},clear:()=>{e(xX)},checkoutCart:async()=>{const e=t().cartItems.map(e=>({foodItemId:e.foodItem.id,amount:e.amount,unit:e.unit}));e.length&&await OX(e)}}})),OX=async e=>{try{await VX(`${kX}/food/foodcart`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({foodCartItems:e})})}catch(t){console.error(t)}},RX=()=>wX(),AX=e=>e?EX[e]:CX.g;function LX(e,t){const n=Object.values(e);return Object.keys(e)[n.indexOf(t)]}const PX=(e,t)=>Array.from({length:t-e+1},(t,n)=>(e+n).toString()),MX=(e,t)=>Array.from({length:10*(t-e)+1},(t,n)=>(e+n/10).toFixed(1)),DX=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!i.includes(r)||!DX(e[r],t[r]))return!1;return!0},NX="3.5.0";var FX=(e=>(e.QuickGuideStartPress="quickguide.start.press",e.QuickGuideBackPressStep1="quickguide.screen1.back.press",e.QuickGuideNextPressStep1="quickguide.screen1.next.press",e.QuickGuideBackPressStep2="quickguide.screen2.back.press",e.QuickGuideNextPressStep2="quickguide.screen2.next.press",e.QuickGuideBackPressStep3="quickguide.screen3.back.press",e.QuickGuideNextPressStep3="quickguide.screen3.next.press",e.QuickGuideBackPressStep4="quickguide.screen4.back.press",e.QuickGuideNextPressStep4="quickguide.screen4.next.press",e.QuickGuideBackPressStep5="quickguide.screen5.back.press",e.QuickGuideNextPressStep5="quickguide.screen5.next.press",e.QuickGuideBackPressStep6="quickguide.screen6.back.press",e.QuickGuideNextPressStep6="quickguide.screen6.next.press",e.QuickGuideBackPressStep7="quickguide.screen7.back.press",e.QuickGuideNextPressStep7="quickguide.screen7.next.press",e.QuickGuideBackPressStep8="quickguide.screen8.back.press",e.QuickGuideNextPressStep8="quickguide.screen8.next.press",e.QuickGuideBackPressStep9="quickguide.screen9.back.press",e.QuickGuideFinishPress="quickguide.finish.press",e.SetupIntroStartPress="setup.intro.start.press",e.SetupGeneralBackPress="setup.general.back.press",e.SetupGeneralNextPress="setup.general.next.press",e.SetupTreatmentBackPress="setup.treatment.back.press",e.SetupTreatmentNextPress="setup.treatment.next.press",e.SetupOptionsNextPress="setup.options.next.press",e.SetupOptionsBackPress="setup.options.back.press",e.SetupInsulinBackPress="setup.insulin.back.press",e.SetupInsulinNextPress="setup.insulin.next.press",e.SetupTDDBackPress="setup.tdd.back.press",e.SetupTDDNextPress="setup.tdd.next.press",e.SetupSummaryBackPress="setup.summary.back.press",e.SetupSummaryFinishPress="setup.summary.finish.press",e.CarbohydrateChart7DaysPress="carbohydratechart.7days.press",e.CarbohydrateChart14DaysPress="carbohydratechart.14days.press",e.CarbohydrateChart30DaysPress="carbohydratechart.30days.press",e.CarbohydrateChart90DaysPress="carbohydratechart.90days.press",e.CarbohydrateChartStart="carbohydratechart.start",e.CarbohydrateChartEnd="carbohydratechart.end",e.RapidInsulinChart7DaysPress="rapidinsulinchart.7days.press",e.RapidInsulinChart14DaysPress="rapidinsulinchart.14days.press",e.RapidInsulinChart30DaysPress="rapidinsulinchart.30days.press",e.RapidInsulinChart90DaysPress="rapidinsulinchart.90days.press",e.RapidInsulinChartStart="rapidinsulinchart.start",e.RapidInsulinChartEnd="rapidinsulinchart.end",e.TimeInRangeChart7DaysPress="timeinrangechart.7days.press",e.TimeInRangeChart14DaysPress="timeinrangechart.14days.press",e.TimeInRangeChart30DaysPress="timeinrangechart.30days.press",e.TimeInRangeChart90DaysPress="timeinrangechart.90days.press",e.TimeInRangeChartStart="timeinrangechart.start",e.TimeInRangeChartEnd="timeinrangechart.end",e.MyDayPreviousPress="mydaychart.previous.press",e.MyDayNextPress="mydaychart.next.press",e.MyDayChartStart="mydaychart.start",e.MyDayChartEnd="mydaychart.end",e.ActiveInsulinChartStart="activeinsulinchart.start",e.ActiveInsulinChartEnd="activeinsulinchart.end",e.GlucoseChart7DaysPressCGM="glucosechart.cgm.7days.press",e.GlucoseChart14DaysPressCGM="glucosechart.cgm.14days.press",e.GlucoseChart30DaysPressCGM="glucosechart.cgm.30days.press",e.GlucoseChart90DaysPressCGM="glucosechart.cgm.90days.press",e.GlucoseChartStartCGM="glucosechart.cgm.start",e.GlucoseChartEndCGM="glucosechart.cgm.end",e.GlucoseChart7DaysPressBGM="glucosechart.bgm.7days.press",e.GlucoseChart14DaysPressBGM="glucosechart.bgm.14days.press",e.GlucoseChart30DaysPressBGM="glucosechart.bgm.30days.press",e.GlucoseChart90DaysPressBGM="glucosechart.bgm.90days.press",e.GlucoseChartStartBGM="glucosechart.bgm.start",e.GlucoseChartEndBGM="glucosechart.bgm.end",e.DashboardCgmButtonPress="home.dashboard.cgm.press",e.DashboardTabPress="home.dashboard.press",e.LogbookTabPress="home.logbook.press",e.NewCalculationTabPress="home.newcalculation.press",e.SettingsTabPress="home.settings.press",e.FoodLibraryTabPress="home.foodlibrary.press",e.GlucoseTabPress="calcflow.glucose.press",e.CarbsTabPress="calcflow.carbs.press",e.ActivityTabPress="calcflow.activity.press",e.SummaryTabPress="calcflow.summary.press",e.AbortCalculationPress="calcflow.abort.press",e.RecentInsulinRegisterPress="calcflow.recentinsulin.register.press",e.RecentInsulinContinuePress="calcflow.recentinsulin.continue.press",e.CarbsManualInput="calcflow.carbs.input.manual",e.CarbsFoodLibraryDatabaseInput="calcflow.carbs.foodlibrary.input.database",e.CarbsFoodLibraryPersonalInput="calcflow.carbs.foodlibrary.input.personal",e.CarbsFoodLibraryPersonalPress="calcflow.carbs.foodlibrary.personal.press",e.CarbsFoodLibrarySearch="calcflow.carbs.foodlibrary.search",e.CarbsFoodLibraryAbort="calcflow.carbs.foodlibrary.abort",e.FoodLibrarySearched="foodlibrary.searched",e.FoodLibraryPersonalPress="foodlibrary.personal.press",e.FoodLibraryCreatePress="foodlibrary.create.press",e.FoodLibraryUpdatePress="foodlibrary.update.press",e.ActivityAddPress="calcflow.activity.add.press",e.ActivityEditPress="calcflow.activity.edit.press",e.TransferDevice="integration.device.transfer",e.TransferService="integration.service.transfer",e.ExpiredGlucose="calcflow.glucose.expired",e.SummaryExpiredGlucose="calcflow.summary.glucose.expired",e.SummaryEmptyGlucose="calcflow.summary.glucose.empty",e.RecommendationSuccess="calcflow.recommendation.success",e.RecommendationInvalid="calcflow.recommendation.invalid",e.RecommendationViewDetailsPress="calcflow.recommendation.details.press",e.RecommendationExpired="calcflow.recommendation.expired",e.RecommendationToastPress="calcflow.recommendation.toast.press",e.LogbookPersonalAddPress="logbook.personal.add.press",e.LogbookPersonalEditPress="logbook.personal.edit.press",e.LogbookPersonalDeletePress="logbook.personal.delete.press",e.LogbookExportPress="logbook.export.press",e.LogbookExportDurationFourteenDaysPress="logbook.export.duration.fourteendays.press",e.LogbookExportDurationThreeMonthsPress="logbook.export.duration.threemonths.press",e.LogbookExportDurationSixMonthsPress="logbook.export.duration.sixmonths.press",e.LogbookExportGeneratePress="logbook.export.generate.press",e.SettingsProfile="settings.profile.press",e.SettingsInsulin="settings.insulin.press",e.SettingsGlucose="settings.glucose.press",e.SettingsActivity="settings.activity.press",e.SettingsNotifications="settings.notifications.press",e.SettingsTheme="settings.theme.press",e.SettingsSmartPen="settings.smartpen.press",e.SettingsCGM="settings.cgm.press",e.SettingsBGM="settings.bgm.press",e.SettingsIFU="settings.ifu.press",e.SettingsSupport="settings.support.press",e.SettingsLegal="settings.legal.press",e.NotificationsAllowQuickGuide="quickguide.notifications.allow.press",e.NotificationsAllowSettings="settings.notifications.allow.press",e.NotificationsDenyQuickGuide="quickguide.notifications.deny.press",e.NotificationsDenySettings="settings.notifications.deny.press",e.ErrorOffline="errors.offline",e.ErrorForceUpdate="errors.forceupdate",e.ErrorLogOut="errors.logout",e))(FX||{});const BX=()=>{const{email:e,id:t,country:n=""}=Cq.get();return{id:t,isTester:e.includes("@hedia"),country:n,uuid:RX(),timestamp:(new Date).toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,platform:lr.OS}},jX=e=>{const{id:t,isTester:n,country:i,uuid:r,timestamp:a,timezone:o,platform:s}=BX(),l={uuid:r,type:e,timestamp:a,timezone:o,data:{version:NX,platform:s,user:{id:t,isTester:n},geo:{country:i}}};qW.update(l),qW.sync().catch(console.error)},VX=async(e,t,n=0)=>{if(uV)return fetch(e,t);const{accessToken:i,refreshToken:r}=qz.getState();if(!i||!r)throw new Error("Missing access token or refresh token");const a={...t?.headers,Authorization:`Bearer ${i}`},o=await fetch(e,{...t,headers:a});if([NL.StatusCode.UNAUTHORIZED,NL.StatusCode.FORBIDDEN].includes(o.status)){if(n<1)return await HX(r),VX(e,t,n+1);throw new Error("[hediaFetch::hediaFetch] Failed to refresh token after retry")}return o},HX=async e=>{const{setTokens:t}=qz.getState(),n=await(async e=>{const t=new URL(Yz+"/token");return fetch(t.toString(),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Basic "+Wz.Buffer.from(encodeURIComponent($z)).toString("base64")},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:e}).toString()})})(e);if(n.status===NL.StatusCode.BAD_REQUEST)throw jX(FX.ErrorLogOut),t({accessToken:void 0,refreshToken:void 0}),new Error("[hediaFetch::refreshAccessToken] Bad request - cleared storage");if(!n.ok)throw new Error("[hediaFetch::refreshAccessToken] Failed to refresh access token");const{access_token:i,refresh_token:r}=await n.json();t({accessToken:i,refreshToken:r})};const{HEDIA_API_URL_V3:zX}=uV?{HEDIA_API_URL_V3:"/api/v3"}:Wj,UX={email:""},GX={lessThanXSeconds:{one:"mindre end ét sekund",other:"mindre end {{count}} sekunder"},xSeconds:{one:"1 sekund",other:"{{count}} sekunder"},halfAMinute:"ét halvt minut",lessThanXMinutes:{one:"mindre end ét minut",other:"mindre end {{count}} minutter"},xMinutes:{one:"1 minut",other:"{{count}} minutter"},aboutXHours:{one:"cirka 1 time",other:"cirka {{count}} timer"},xHours:{one:"1 time",other:"{{count}} timer"},xDays:{one:"1 dag",other:"{{count}} dage"},aboutXWeeks:{one:"cirka 1 uge",other:"cirka {{count}} uger"},xWeeks:{one:"1 uge",other:"{{count}} uger"},aboutXMonths:{one:"cirka 1 måned",other:"cirka {{count}} måneder"},xMonths:{one:"1 måned",other:"{{count}} måneder"},aboutXYears:{one:"cirka 1 år",other:"cirka {{count}} år"},xYears:{one:"1 år",other:"{{count}} år"},overXYears:{one:"over 1 år",other:"over {{count}} år"},almostXYears:{one:"næsten 1 år",other:"næsten {{count}} år"}},WX={date:bY({formats:{full:"EEEE 'den' d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'kl'. {{time}}",long:"{{date}} 'kl'. {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},YX={lastWeek:"'sidste' eeee 'kl.' p",yesterday:"'i går kl.' p",today:"'i dag kl.' p",tomorrow:"'i morgen kl.' p",nextWeek:"'på' eeee 'kl.' p",other:"P"},$X={code:"da",formatDistance:(e,t,n)=>{let i;const r=GX[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?"om "+i:i+" siden":i},formatLong:WX,formatRelative:(e,t,n,i)=>YX[e],localize:{ordinalNumber:(e,t)=>Number(e)+".",era:CY({values:{narrow:["fvt","vt"],abbreviated:["f.v.t.","v.t."],wide:["før vesterlandsk tidsregning","vesterlandsk tidsregning"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["1. kvt.","2. kvt.","3. kvt.","4. kvt."],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],wide:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"]},defaultWidth:"wide"}),day:CY({values:{narrow:["S","M","T","O","T","F","L"],short:["sø","ma","ti","on","to","fr","lø"],abbreviated:["søn.","man.","tir.","ons.","tor.","fre.","lør."],wide:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"a",pm:"p",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"},abbreviated:{am:"AM",pm:"PM",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"},abbreviated:{am:"AM",pm:"PM",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:IY({matchPatterns:{narrow:/^(fKr|fvt|eKr|vt)/i,abbreviated:/^(f\.Kr\.?|f\.v\.t\.?|e\.Kr\.?|v\.t\.)/i,wide:/^(f.Kr.|før vesterlandsk tidsregning|e.Kr.|vesterlandsk tidsregning)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^f/i,/^(v|e)/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234]. kvt\./i,wide:/^[1234]\.? kvartal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mar.|apr.|maj|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januar|februar|marts|april|maj|juni|juli|august|september|oktober|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[smtofl]/i,short:/^(søn.|man.|tir.|ons.|tor.|fre.|lør.)/i,abbreviated:/^(søn|man|tir|ons|tor|fre|lør)/i,wide:/^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^o/i,/^t/i,/^f/i,/^l/i],any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(a|p|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i,any:/^([ap]\.?\s?m\.?|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/midnat/i,noon:/middag/i,morning:/morgen/i,afternoon:/eftermiddag/i,evening:/aften/i,night:/nat/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},XX={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},qX={date:bY({formats:{full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},ZX={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},KX={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},QX={narrow:KX.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:KX.wide},JX={code:"de",formatDistance:(e,t,n)=>{let i;const r=n?.addSuffix?XX[e].withPreposition:XX[e].standalone;return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:"vor "+i:i},formatLong:qX,formatRelative:(e,t,n,i)=>ZX[e],localize:{ordinalNumber:e=>Number(e)+".",era:CY({values:{narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:KX,formattingValues:QX,defaultWidth:"wide"}),day:CY({values:{narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},defaultWidth:"wide",formattingValues:{narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:IY({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:"wide",parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},eq={code:"en-GB",formatDistance:vY,formatLong:{date:bY({formats:{full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"dd/MM/yyyy"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},formatRelative:kY,localize:EY,match:TY,options:{weekStartsOn:1,firstWeekContainsDate:4}},tq={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},nq={date:bY({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},iq={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},rq={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},aq={code:"es",formatDistance:(e,t,n)=>{let i;const r=tq[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"en "+i:"hace "+i:i},formatLong:nq,formatRelative:(e,t,n,i)=>1!==t.getHours()?rq[e]:iq[e],localize:{ordinalNumber:(e,t)=>Number(e)+"º",era:CY({values:{narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:CY({values:{narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},defaultWidth:"wide"}),day:CY({values:{narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:IY({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:1}},oq={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},sq={date:bY({formats:{full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},lq={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},uq=["MMM","MMMM"],cq={code:"fr",formatDistance:(e,t,n)=>{let i;const r=oq[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?"dans "+i:"il y a "+i:i},formatLong:sq,formatRelative:(e,t,n,i)=>lq[e],localize:{preprocessor:(e,t)=>{if(1===e.getDate())return t;return t.some(e=>e.isToken&&uq.includes(e.value))?t.map(e=>e.isToken&&"do"===e.value?{isToken:!0,value:"d"}:e):t},ordinalNumber:(e,t)=>{const n=Number(e),i=t?.unit;if(0===n)return"0";let r;return r=1===n?i&&["year","week","hour","minute","second"].includes(i)?"ère":"er":"ème",n+r},era:CY({values:{narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},defaultWidth:"wide"}),day:CY({values:{narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},defaultWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(ième|ère|ème|er|e)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:IY({matchPatterns:{narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^av/i,/^ap/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},dq={lessThanXSeconds:{one:"meno di un secondo",other:"meno di {{count}} secondi"},xSeconds:{one:"un secondo",other:"{{count}} secondi"},halfAMinute:"alcuni secondi",lessThanXMinutes:{one:"meno di un minuto",other:"meno di {{count}} minuti"},xMinutes:{one:"un minuto",other:"{{count}} minuti"},aboutXHours:{one:"circa un'ora",other:"circa {{count}} ore"},xHours:{one:"un'ora",other:"{{count}} ore"},xDays:{one:"un giorno",other:"{{count}} giorni"},aboutXWeeks:{one:"circa una settimana",other:"circa {{count}} settimane"},xWeeks:{one:"una settimana",other:"{{count}} settimane"},aboutXMonths:{one:"circa un mese",other:"circa {{count}} mesi"},xMonths:{one:"un mese",other:"{{count}} mesi"},aboutXYears:{one:"circa un anno",other:"circa {{count}} anni"},xYears:{one:"un anno",other:"{{count}} anni"},overXYears:{one:"più di un anno",other:"più di {{count}} anni"},almostXYears:{one:"quasi un anno",other:"quasi {{count}} anni"}},hq={date:bY({formats:{full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},mq=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function pq(e){return"'"+mq[e]+" alle' p"}const fq={lastWeek:(e,t,n)=>{const i=e.getDay();return uX(e,t,n)?pq(i):function(e){return 0===e?"'domenica scorsa alle' p":"'"+mq[e]+" scorso alle' p"}(i)},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:(e,t,n)=>{const i=e.getDay();return uX(e,t,n)?pq(i):function(e){return 0===e?"'domenica prossima alle' p":"'"+mq[e]+" prossimo alle' p"}(i)},other:"P"},_q={code:"it",formatDistance:(e,t,n)=>{let i;const r=dq[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"tra "+i:i+" fa":i},formatLong:hq,formatRelative:(e,t,n,i)=>{const r=fq[e];return"function"==typeof r?r(t,n,i):r},localize:{ordinalNumber:(e,t)=>{const n=Number(e);return String(n)},era:CY({values:{narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:{narrow:["G","F","M","A","M","G","L","A","S","O","N","D"],abbreviated:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],wide:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"]},defaultWidth:"wide"}),day:CY({values:{narrow:["D","L","M","M","G","V","S"],short:["dom","lun","mar","mer","gio","ven","sab"],abbreviated:["dom","lun","mar","mer","gio","ven","sab"],wide:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"}},defaultWidth:"wide",formattingValues:{narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:IY({matchPatterns:{narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^a/i,/^(d|e)/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},gq={lessThanXSeconds:{one:"mindre än en sekund",other:"mindre än {{count}} sekunder"},xSeconds:{one:"en sekund",other:"{{count}} sekunder"},halfAMinute:"en halv minut",lessThanXMinutes:{one:"mindre än en minut",other:"mindre än {{count}} minuter"},xMinutes:{one:"en minut",other:"{{count}} minuter"},aboutXHours:{one:"ungefär en timme",other:"ungefär {{count}} timmar"},xHours:{one:"en timme",other:"{{count}} timmar"},xDays:{one:"en dag",other:"{{count}} dagar"},aboutXWeeks:{one:"ungefär en vecka",other:"ungefär {{count}} veckor"},xWeeks:{one:"en vecka",other:"{{count}} veckor"},aboutXMonths:{one:"ungefär en månad",other:"ungefär {{count}} månader"},xMonths:{one:"en månad",other:"{{count}} månader"},aboutXYears:{one:"ungefär ett år",other:"ungefär {{count}} år"},xYears:{one:"ett år",other:"{{count}} år"},overXYears:{one:"över ett år",other:"över {{count}} år"},almostXYears:{one:"nästan ett år",other:"nästan {{count}} år"}},yq=["noll","en","två","tre","fyra","fem","sex","sju","åtta","nio","tio","elva","tolv"],vq={date:bY({formats:{full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"y-MM-dd"},defaultWidth:"full"}),time:bY({formats:{full:"'kl'. HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'kl.' {{time}}",long:"{{date}} 'kl.' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},bq={lastWeek:"'i' EEEE's kl.' p",yesterday:"'igår kl.' p",today:"'idag kl.' p",tomorrow:"'imorgon kl.' p",nextWeek:"EEEE 'kl.' p",other:"P"},Sq={code:"sv",formatDistance:(e,t,n)=>{let i;const r=gq[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t<13?yq[t]:String(t)),n?.addSuffix?n.comparison&&n.comparison>0?"om "+i:i+" sedan":i},formatLong:vq,formatRelative:(e,t,n,i)=>bq[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:case 2:return n+":a"}return n+":e"},era:CY({values:{narrow:["f.Kr.","e.Kr."],abbreviated:["f.Kr.","e.Kr."],wide:["före Kristus","efter Kristus"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1:a kvartalet","2:a kvartalet","3:e kvartalet","4:e kvartalet"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],wide:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"]},defaultWidth:"wide"}),day:CY({values:{narrow:["S","M","T","O","T","F","L"],short:["sö","må","ti","on","to","fr","lö"],abbreviated:["sön","mån","tis","ons","tors","fre","lör"],wide:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"morg.",afternoon:"efterm.",evening:"kväll",night:"natt"},abbreviated:{am:"f.m.",pm:"e.m.",midnight:"midnatt",noon:"middag",morning:"morgon",afternoon:"efterm.",evening:"kväll",night:"natt"},wide:{am:"förmiddag",pm:"eftermiddag",midnight:"midnatt",noon:"middag",morning:"morgon",afternoon:"eftermiddag",evening:"kväll",night:"natt"}},defaultWidth:"wide",formattingValues:{narrow:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på efterm.",evening:"på kvällen",night:"på natten"},abbreviated:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på efterm.",evening:"på kvällen",night:"på natten"},wide:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morgonen",afternoon:"på eftermiddagen",evening:"på kvällen",night:"på natten"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(:a|:e)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:IY({matchPatterns:{narrow:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,abbreviated:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,wide:/^(före Kristus|före vår tid|efter Kristus|vår tid)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^f/i,/^[ev]/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](:a|:e)? kvartalet/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar[s]?|apr|maj|jun[i]?|jul[i]?|aug|sep|okt|nov|dec)\.?/i,wide:/^(januari|februari|mars|april|maj|juni|juli|augusti|september|oktober|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[smtofl]/i,short:/^(sö|må|ti|on|to|fr|lö)/i,abbreviated:/^(sön|mån|tis|ons|tors|fre|lör)/i,wide:/^(söndag|måndag|tisdag|onsdag|torsdag|fredag|lördag)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{any:/^([fe]\.?\s?m\.?|midn(att)?|midd(ag)?|(på) (morgonen|eftermiddagen|kvällen|natten))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^f/i,pm:/^e/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgon/i,afternoon:/eftermiddag/i,evening:/kväll/i,night:/natt/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},wq=LX(NL.Languages,NL.Languages.en);function kq(e){const{set:t}=tV.getState();t(e),function(e){const t={da:$X,de:JX,es:aq,fr:cq,it:_q,enGB:eq,sv:Sq};hX({locale:"en"===e?t.enGB:t[e]})}(e)}const Cq=new class extends XW{constructor(){super("userDetails",UX)}get(){const{id:e,country:t,language:n,email:i,name:r}=super.get();return{id:e,name:r,country:t,language:n,email:i}}async fetch(){const e=await(async()=>{const e={headers:{Accept:"application/json","Content-Type":"application/json"},method:NL.HTTPRequestMethod.GET},t=await VX(`${zX}/user`,e);if(t.status!==NL.StatusCode.OK){const{message:e}=await t.json();throw new Error("string"==typeof e?e:JSON.stringify(e))}return t.json()})();kq(e.language??wq),super.set(e),super.save()}migrateData(){throw new Error("[UserDetailsManager::migrateData] Purposefully not implemented.")}};var Eq,Iq,xq={},Tq={};function Oq(){return Iq||(Iq=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"calculateActiveInsulin",{enumerable:!0,get:function(){return t.calculateActiveInsulin}}),Object.defineProperty(e,"calculateRecommendation",{enumerable:!0,get:function(){return t.calculateRecommendation}}),Object.defineProperty(e,"getReduction",{enumerable:!0,get:function(){return t.getReduction}}),Object.defineProperty(e,"roundInsulinValue",{enumerable:!0,get:function(){return t.roundInsulinValue}});var t=function(){if(Eq)return Tq;Eq=1,Object.defineProperty(Tq,"__esModule",{value:!0}),Tq.adjustedInsulinCorrection=i,Tq.calculateActiveInsulin=o,Tq.calculateRecommendation=function(n){const{carbohydrateRatio:r,carbohydrates:o,glucoseReading:s,insulinSensitivity:u,targetBGL:d,recentBoluses:h,activity:m}=n;if(null==s)throw new Error(e.GlucoseErrors.MissingGlucoseReading);if(s.unit!==e.BloodGlucoseUnit.MMOL_L&&s.unit!==e.BloodGlucoseUnit.MG_DL)throw new Error(e.GlucoseErrors.InvalidGlucoseUnit);const p=t(s.value,s.unit);if(p<e.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL||p>e.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL)throw new Error(e.GlucoseErrors.OutOfRangeCurrentBGL);const f=new Date,_=m?.activitySettings?.target,g=l(o,r),{activeInsulin:y,adjustedInsulin:v,recentBolusesIds:b}=i(p,void 0!==_?Math.max(_,d):d,u,h);let S=g+v;const w=S>e.CONSTANTS.INSULIN_DOSE_MAX;S=Math.min(S,e.CONSTANTS.INSULIN_DOSE_MAX);let k=0;if(p<3.9){const e=l(15,r);S-=e,S<0&&(k=Math.max(15,a(S+e,r)))}else{const e=a(S,r);k=Math.max(0,e)}S=Math.max(0,S);const C=m?c(m.activityDuration,m.activitySettings,m.activityIntensity,m.activityDate):null;return C&&(S*=1-C),{activeInsulin:y,activityReduction:C,bolus:S,carbRecommendation:k,recentBolusesIds:b,recommendationDate:f,wasLimited:w}},Tq.convertBGL=t,Tq.foodBolus=l,Tq.foodRecommendation=a,Tq.fractionOfInsulinStillActive=r,Tq.getInterval=d,Tq.getRecentBolusIds=s,Tq.getReduction=c,Tq.insulinStillActive=u,Tq.rawInsulinCorrection=n,Tq.roundInsulinValue=void 0;var e=DL();function t(t,n){if(null==t||isNaN(t))throw new Error(e.GlucoseErrors.InvalidGlucoseValue);return n===e.BloodGlucoseUnit.MMOL_L?t:t*e.CONSTANTS.MMOLL_PER_MGDL_BGL}function n(e,t,n){return(e-t)/n}function i(e,t,i,r){const a=o(r),l=s(r),u=n(e,t,i);return{activeInsulin:a,adjustedInsulin:Math.max(u-a,Math.min(u,0)),recentBolusesIds:l}}function r(e){if(e<0)throw new RangeError(`Parameter secondsPassed can't be negative. Found ${e}.`);return 0===e?1:e<5e3?Math.cos((e+500)/5900):e<7e3?-120127e-9*e+1.197151:e<14400?.96-Math.tanh((e-2800)/6e3):0}function a(e,t){return-e*t}function o(e){return e.reduce((e,t)=>e+u(t),0)}function s(e){return e.map(e=>e.id)}function l(e,t){return e/t}function u(e){return e.insulinDose*r(e.secondsPassed)}function c(t,n,i,r){if(t<e.CONSTANTS.ACTIVITY_DURATION_MIN||t>e.CONSTANTS.ACTIVITY_DURATION_MAX)throw new Error(e.ActivityErrors.OutOfRangeDuration);const a=r.getTime()+t*e.Milliseconds.Minute,o=(new Date).getTime()>=a,s=d(t,(()=>{if(o)return n.post;if(null===i)throw new Error(e.ActivityErrors.MissingIntensity);return n[i]})());if(null==s)throw new Error(e.ActivityErrors.InvalidInterval);const l=1-s;if(l<e.CONSTANTS.ACTIVITY_REDUCTION_MIN||l>e.CONSTANTS.ACTIVITY_REDUCTION_MAX)throw new Error(e.ActivityErrors.InvalidReduction);return l}function d(e,t){const{fromZero:n,fromThirty:i,fromFortysix:r,fromSixtyone:a}=t;return e<=29?n:e<=45?i:e<=60?r:a}return Tq.roundInsulinValue=(t,n)=>{const i={[e.InjectionMethod.PenWhole]:1,[e.InjectionMethod.PenHalf]:2,[e.InjectionMethod.Pump]:10}[n];return Math.round(t*i)/i},Tq}()}(xq)),xq}var Rq=Oq();const Aq=uV?"/api/v2":Wj.HEDIA_API_URL_V2;const Lq=e=>{let t=Pq();t=t.filter(t=>t[0]!==e),Qj.set("event/index",JSON.stringify(t))},Pq=()=>{const e=Qj.getString("event/index");return void 0===e?[]:JSON.parse(e)},Mq=()=>{const e=Qj.getString("event/pendingChanges");return void 0===e?{lastSyncTimestamp:new Date(0).toJSON(),eventUpdates:[],deletedEvents:[]}:JSON.parse(e)},Dq=new class{create=async(e,t)=>{try{e.overwrittenByUUID=void 0;const n=Mq();n.eventUpdates.push({...e,uuidOld:t}),Qj.set("event/pendingChanges",JSON.stringify(n));const i=(e,t)=>{if(this.saveLocally(e),void 0!==t){const n=this.getByUUID(t);n.overwrittenByUUID=e.uuid,this.saveLocally(n)}};return uV?(await this.sync(),i(e,t)):(i(e,t),gZ.syncAll().catch(console.error)),!0}catch(n){return console.error(n),!1}};getActiveEvents=()=>{const e=Pq(),t=[];for(const n of e){const[e,i]=n,r=this.getByUUID(e);i>Date.now()-90*NL.Milliseconds.Minute-r.durationSeconds*NL.Milliseconds.Second&&t.push(r)}return t};getEvents=(e,t)=>{let n=Pq();if(void 0!==e){const t=e.getTime();n=n.filter(e=>e[1]>=t)}if(void 0!==t){const e=t.getTime();n=n.filter(t=>t[1]<e)}const i=[];for(const a of n)try{const e=this.getByUUID(a[0]);i.push(e)}catch(r){console.error(r)}return i};sync=async()=>{const e=Mq(),t={method:NL.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}},n=await VX(`${Aq}/events`,t),i=await n.json();if(n.status!==NL.StatusCode.OK)throw new Error(`[EventManager::sync] Problem during event synchronization. Server response: ${JSON.stringify(n)}`);const{lastSyncTimestamp:r,eventUpdates:a}=i;for(const l of a)this.saveLocally(l);const o=Mq(),s={lastSyncTimestamp:r,eventUpdates:o.eventUpdates.filter(t=>!e.eventUpdates.map(e=>e.uuid).includes(t.uuid)),deletedEvents:o.deletedEvents.filter(t=>!e.deletedEvents.includes(t))};Qj.set("event/pendingChanges",JSON.stringify(s))};getEventWithHighestReduction=e=>{if(!e)throw new Error("[EventManager::getEventWithHighestReduction] Cannot retrieve highest reduction without a provided setting!");const t=this.getActiveEvents();if(!t.length)return;const n=({durationSeconds:t,activityIntensity:n,startTimestamp:i})=>{if(null===i)throw new Error("[EventManager::calculateReduction] Cannot calculate reduction without startTimestamp!");return Rq.getReduction(t/60,e,n,new Date(i))},i=t.sort((e,t)=>n(e)-n(t));return i[i.length-1]};getByUUID=e=>{const t=Qj.getString(`event/${e}`);if(void 0===t)throw new Error(`[EventManager::getByUUID] The requested event with UUID ${e} does not exist!`);return JSON.parse(t)};saveLocally=e=>{if(Lq(e.uuid),Qj.set(`event/${e.uuid}`,JSON.stringify(e)),!e.deleted&&!e.overwrittenByUUID){let t=Pq();if(null===e.startTimestamp)throw new Error("[EventManager::saveLocally] event.startTimestamp must be non-null.");const n=new Date(e.startTimestamp).getTime();t.push([e.uuid,n]),t=t.sort((e,t)=>t[1]-e[1]),Qj.set("event/index",JSON.stringify(t))}}};const Nq=new class{get=()=>{const e=Qj.getString("userSettings"),t=this.safeParse(e);return this.migrateAndClean(t)??{}};write=e=>{const t=this.migrateAndClean(e)??{};Qj.set("userSettings",JSON.stringify(t))};getPending=()=>{const e=Qj.getString("pendingSettingsChanges");return(this.safeParse(e)??[]).map(e=>this.migrateAndClean(e)??{})};addPending=e=>{const t=this.getPending();t.push(this.migrateAndClean(e)??{}),Qj.set("pendingSettingsChanges",JSON.stringify(t))};removePending=e=>{const t=e.map(e=>e.uuid),n=this.getPending().filter(e=>!t.includes(e.uuid));Qj.set("pendingSettingsChanges",JSON.stringify(n))};safeParse=e=>{if(e)try{return JSON.parse(e)}catch{return}};migrateActivitySettings=e=>{if(!e.activity)return;const t=["hard","moderate","light","post"];for(const n of t)void 0===e.activity[n].fromSixtyone&&(e.activity[n].fromSixtyone=null)};migrateGenderToBiologicalSex=e=>{e.gender&&!e.biologicalSex&&(e.biologicalSex=e.gender),delete e.gender};removeEmailField=e=>{delete e.email};removeInsulinDependentField=e=>{delete e.insulinDependent};migrateBGLFields=e=>{if(!e.glucoseLevelTargets)return;const t={...e.glucoseLevelTargets};if(t.overallTargetBGL){const e={...t.overallTargetBGL};delete e.low,delete e.high,t.overallTargetBGL=e}Array.isArray(t.targetBGLIntervals)&&(t.targetBGLIntervals=t.targetBGLIntervals.map(e=>{const t={...e};return delete t.low,delete t.high,t})),e.glucoseLevelTargets=t};migrateNotificationsSettings=e=>{if(!e.notifications)return;const t={...e.notifications};void 0!==t.deviceIdentifiers&&delete t.deviceIdentifiers,e.notifications=t};migrateAndClean=e=>{if(!e)return;const t={...e};return this.migrateActivitySettings(t),this.migrateGenderToBiologicalSex(t),this.migrateBGLFields(t),this.migrateNotificationsSettings(t),this.removeEmailField(t),this.removeInsulinDependentField(t),t}};var Fq=Object.defineProperty,Bq=Object.getOwnPropertyDescriptor,jq=(e,t,n,i)=>{for(var r,a=i>1?void 0:i?Bq(t,n):t,o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i?r(t,n,a):r(a))||a);return i&&a&&Fq(t,n,a),a};const Vq=uV?"/api/v2":Wj.HEDIA_API_URL_V2;class Hq{_diabetesType;_biologicalSex;_heightCm;_weightKg;_birthDate;_injectionMethod;_glucoseUnit;_treatmentParameters;_glucoseLevelTargets;_fastActingInsulin;_longActingInsulin;_uuid;_activity;_notifications;constructor(){const e=this.getUserSettings();this.updateUserSettings(e),zD(this)}get diabetesType(){return this._diabetesType}get biologicalSex(){return this._biologicalSex}get heightCm(){return this._heightCm}get weightKg(){return this._weightKg}get birthDate(){return this._birthDate}get injectionMethod(){return this._injectionMethod}get glucoseUnit(){return this._glucoseUnit}get treatmentParameters(){return this._treatmentParameters}get glucoseLevelTargets(){return this._glucoseLevelTargets}get fastActingInsulin(){return this._fastActingInsulin}get longActingInsulin(){return this._longActingInsulin}get uuid(){return this._uuid}get activity(){return this._activity}get notifications(){return this._notifications}async setUserSettings(e){const t=this.getUserSettings();e.uuidOld=t.uuid,e.uuid=RX(),e.created=(new Date).toJSON();const n={...t,...e};return Nq.addPending(e),uV?this.syncWeb():(Nq.write(n),this.updateUserSettings(n),gZ.syncAll().catch(console.error),!0)}getUserSettings(){return Nq.get()}async syncWeb(){const e=Nq.getPending();try{const t=await this.makeSyncRequest(e);return Nq.write(t),this.updateUserSettings(t),!0}catch(t){return console.error(t),!1}finally{Nq.removePending(e)}}async sync(){const e=Nq.getPending(),t=await this.makeSyncRequest(e);Nq.write(t),this.updateUserSettings(t),Nq.removePending(e)}reset(){this.updateUserSettings({activity:void 0,biologicalSex:void 0,birthday:void 0,bloodGlucoseUnits:void 0,bloodKetonesUnit:void 0,created:void 0,diabetesType:void 0,fastActingInsulin:void 0,glucoseLevelTargets:void 0,height:void 0,longActingInsulin:void 0,notifications:void 0,parameters:void 0,treatmentType:void 0,uuid:void 0,uuidOld:void 0,weight:void 0})}makeSyncRequest=async e=>{const t={headers:{"Content-Type":"application/json"},method:e?NL.HTTPRequestMethod.POST:NL.HTTPRequestMethod.GET,body:e?JSON.stringify(e):void 0},n=await VX(`${Vq}/settings`,t),i=await n.json();if(n.status!==NL.StatusCode.OK)throw new Error(`[UserSettingsManager::makeSyncRequest] - ${JSON.stringify(i.message)}`);return i};updateUserSettings(e){this._activity=e.activity,this._biologicalSex=e.biologicalSex,this._birthDate=e.birthday,this._diabetesType=e.diabetesType,this._fastActingInsulin=e.fastActingInsulin,this._glucoseLevelTargets=e.glucoseLevelTargets,this._glucoseUnit=e.bloodGlucoseUnits,this._heightCm=e.height,this._injectionMethod=e.treatmentType,this._longActingInsulin=e.longActingInsulin,this._notifications=e.notifications,this._treatmentParameters=e.parameters,this._uuid=e.uuid,this._weightKg=e.weight}}function zq(e,t,n){const i={carbohydrateRatio:t,insulinSensitivity:e,startTime:"00:00"},r=["00:00","05:00","09:00","11:00","13:00","18:00","22:00"].map(e=>({insulinSensitivity:i.insulinSensitivity,carbohydrateRatio:i.carbohydrateRatio,startTime:e}));return{overallParameters:i,parameterIntervals:r,use:n}}jq([pM],Hq.prototype,"_diabetesType",2),jq([pM],Hq.prototype,"_biologicalSex",2),jq([pM],Hq.prototype,"_heightCm",2),jq([pM],Hq.prototype,"_weightKg",2),jq([pM],Hq.prototype,"_birthDate",2),jq([pM],Hq.prototype,"_injectionMethod",2),jq([pM],Hq.prototype,"_glucoseUnit",2),jq([pM],Hq.prototype,"_treatmentParameters",2),jq([pM],Hq.prototype,"_glucoseLevelTargets",2),jq([pM],Hq.prototype,"_fastActingInsulin",2),jq([pM],Hq.prototype,"_longActingInsulin",2),jq([pM],Hq.prototype,"_uuid",2),jq([pM],Hq.prototype,"_activity",2),jq([pM],Hq.prototype,"_notifications",2),jq([pD],Hq.prototype,"updateUserSettings",1);const Uq=new Hq,Gq="mmol/L",Wq=[0,30],Yq=[0,540],$q=3.9,Xq=10,qq=70,Zq=180,Kq=e=>{if(e===NL.BloodGlucoseUnit.MMOL_L)return{text:Gq,graphLimits:Wq,inputMin:NL.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL,inputMax:NL.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL,decimalPlaces:1,placeholder:"-.-",targetInterval:{low:$q,high:Xq}};if(e===NL.BloodGlucoseUnit.MG_DL)return{text:"mg/dL",graphLimits:Yq,inputMin:20,inputMax:600,decimalPlaces:0,placeholder:"-",targetInterval:{low:qq,high:Zq}};throw new Error(`[glucose::getBGConstants] Unsupported glucose unit! ${e}`)};function Qq(e){return e<=29?"0-29":e<=45?"30-45":e<=60?"46-60":"61-120"}function Jq(e,t){const n=new Date,i=_Y(mY(rY(new Date(e),1.5),t),n),r=Math.floor(i/60),a=i%60;return r>0?`${r}${nV("activity_card__active_hour")} ${a}${nV("activity_card__active_min")}`:`${a} ${nV("activity_card__active_min")}`}const eZ={Walk:()=>nV("new_activity_type_walk"),Run:()=>nV("new_activity_type_run"),Cycling:()=>nV("new_activity_type_cycling"),Swim:()=>nV("new_activity_type_swim"),Other:()=>nV("new_activity_type_other"),Sport:()=>nV("new_activity_type_sport"),Workout:()=>nV("new_activity_type_workout")},tZ={light:()=>nV("activity_intensity_1"),moderate:()=>nV("activity_intensity_2"),hard:()=>nV("activity_intensity_3")},nZ=Gq;function iZ(e,t,n){if(t===n)return e;switch(n){case NL.BloodGlucoseUnit.MG_DL:return e*NL.CONSTANTS.MGDL_PER_MMOLL_BGL;case NL.BloodGlucoseUnit.MMOL_L:return e*NL.CONSTANTS.MMOLL_PER_MGDL_BGL;default:throw new Error(`[conversionGlucose::convertBGL] Unsupported glucose unit! ${n}`)}}function rZ(e,t){const{decimalPlaces:n}=Kq(t);return(Math.round(10*e)/10).toFixed(n)}function aZ(e,t,n){return rZ(iZ(e,t,n),n)}const oZ=GB({entry_timestamp:WB([HB(),BB()]),settings_uuid:BB(),insulin_entered_units:WB([jB(),UB()]),carbohydrates_entered_grams:WB([jB(),UB()]),blood_glucose_millimolar:WB([jB(),UB()]),blood_ketones_millimolar:WB([jB(),UB(),zB()]),event_uuid:WB([BB(),UB(),zB()])});cj.textPdf,cj.textPdf,cj.textPdf,cj.textPdf;const sZ=e=>{oZ.parse(e);const{blood_glucose_millimolar:t,carbohydrates_entered_grams:n,insulin_entered_units:i,blood_ketones_millimolar:r}=e,{inputMax:a,inputMin:o}=Kq(NL.BloodGlucoseUnit.MMOL_L),{inputMax:s}={displayUnit:nZ,inputMin:0,inputMax:8,decimalPlaces:1};if(null!==t&&t>a)throw new Error(`[LogbookUtils::validateLogbook] blood_glucose_millimolar is greater than ${a}`);if(null!==t&&t<o)throw new Error(`[LogbookUtils::validateLogbook] blood_glucose_millimolar is less than ${o}`);if(null!==r&&r>s)throw new Error(`[LogbookUtils::validateLogbook] blood_ketones_millimolar is greater than ${s}`);const l={blood_glucose_millimolar:t,carbohydrates_entered_grams:n,insulin_entered_units:i,blood_ketones_millimolar:r};return Object.entries(l).forEach(([e,t])=>{if(function(e){return null!==e&&e<0}(t))throw new Error(`[LogbookUtils::validateLogbook] ${e} is less than 0`)}),!0},lZ=e=>({active_insulin_source_logbook_ids:[],active_insulin:null,activity_reduction:null,blood_glucose_millimolar_sample_id:null,blood_glucose_millimolar:null,glucose_sample_source_id:null,blood_ketones_millimolar:null,carbohydrates_entered_grams:0,carbohydrates_input_grams:0,carbohydrates_overwritten_suggested_grams:null,carbohydrates_suggested_grams:null,client_timestamp:new Date,client_version:"",device_and_os:"",entry_timestamp:new Date,event_uuid:null,insulin_entered_units:0,insulin_suggested_units:null,is_bolus_calculation:!1,is_deleted:null,overwritten_by_id:null,server_timestamp:null,server_version:null,settings_uuid:"",timezone:"",utc_timezone_offset:null,uuid:"",...e});const uZ=uV?"/api/v2":Wj.HEDIA_API_URL_V2,cZ=e=>{const t={...e};return delete t.carbohydrates_modified_suggested_grams,delete t.mood,delete t.smart_pen_sync_timestamp,t};const dZ=e=>{const{uuid:t}=e;if(!t)throw new Error("[LogbookManager::saveLocally] uuid must be defined");hZ(t);const n=fZ();n.push([t,new Date(e.entry_timestamp).getTime()]),n.sort((e,t)=>t[1]-e[1]),Qj.set("logbook/index",JSON.stringify(n)),Qj.set(`logbook/${e.uuid}`,JSON.stringify(e))},hZ=e=>{const t=fZ().filter(([t])=>t!==e);Qj.set("logbook/index",JSON.stringify(t)),Qj.delete(`logbook/${e}`)},mZ=()=>{const e=Qj.getString("logbook/pendingChanges");if(!e)return{last_sync_timestamp:new Date(0).toISOString(),created:[],edited:[],deleted:[]};const t=JSON.parse(e);return{...t,created:t.created.map(e=>cZ(e))}},pZ=(e,t)=>{const{created:n,deleted:i,edited:r,last_sync_timestamp:a}=mZ(),o={last_sync_timestamp:a,created:[...n].filter(({uuid:t})=>t!==e),edited:[...r].filter(({oldUUID:n,newUUID:i})=>n!==t&&i!==e),deleted:[...i].filter(t=>t!==e)};Qj.set("logbook/pendingChanges",JSON.stringify(o))},fZ=()=>{const e=Qj.getString("logbook/index");return void 0===e?[]:JSON.parse(e)},_Z=new class{async addLogbook(e,t){const n=t?this.getLogbookByUUID(t):null;try{e.uuid=RX(),e.client_timestamp=new Date,e.client_version=NX,e.device_and_os=`${lr.OS} ${lr.Version}`;const n=mZ();if(t){const i=this.getLogbookByUUID(t);e.settings_uuid=i.settings_uuid,n.edited.push({oldUUID:t,newUUID:e.uuid}),hZ(t)}else{const{uuid:t}=Uq;if(!t)throw new Error("[LogbookManager::addLogbook] settingsUUID must be defined");e.settings_uuid=t}return e.utc_timezone_offset=(()=>{const e=(new Date).getTimezoneOffset(),t=-e>=0?"+":"-",n=Math.abs(e);return`${t}${Math.floor(n/60).toString().padStart(2,"0")}:${(n%60).toString().padStart(2,"0")}`})(),e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone,n.created.push(e),Qj.set("logbook/pendingChanges",JSON.stringify(n)),dZ(e),uV?await this.syncWeb():gZ.syncAll().catch(console.error),e}catch(i){return console.error(i),uV&&(t?(hZ(e.uuid),null!==n&&dZ(n),pZ(e.uuid,t)):(hZ(e.uuid),pZ(e.uuid))),null}}deleteLogbook=async e=>{const t=this.getLogbookByUUID(e);try{const t=mZ();return t.deleted.push(e),Qj.set("logbook/pendingChanges",JSON.stringify(t)),hZ(e),uV?await this.syncWeb():gZ.syncAll().catch(console.error),!0}catch(n){return console.error(n),uV&&(dZ(t),pZ(e)),!1}};syncWeb=async()=>{const e=mZ(),t=await VX(`${uZ}/logbooks`,(n=e,{method:NL.HTTPRequestMethod.POST,body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}));var n;if(t.status!==NL.StatusCode.OK)throw new Error("Could not sync logbooks with server");const i=await t.json(),{created:r,last_sync_timestamp:a}=i;for(const s of r)dZ(s);const o={last_sync_timestamp:a,created:[],deleted:[],edited:[]};Qj.set("logbook/pendingChanges",JSON.stringify(o))};sync=async()=>{const e=mZ(),{created:t,deleted:n,edited:i,last_sync_timestamp:r}=e,a=e=>({method:NL.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),o=[],s=[],l=[];let u=[],c=[],d=e.last_sync_timestamp;const h=e=>{const{created:t,deleted:n,last_sync_timestamp:i}=e;u=u.concat(t),c=c.concat(n),d=i},m=[{list:t,listName:"created",unsuccess:o},{list:n,listName:"deleted",unsuccess:s},{list:i,listName:"edited",unsuccess:l}];if(!t.length&&!i.length&&!n.length){const e={created:[],deleted:[],edited:[],last_sync_timestamp:r},t=await VX(`${uZ}/logbooks`,a(e));h(await t.json())}for(const _ of m)for(const e of _.list){const t={created:[],deleted:[],edited:[],last_sync_timestamp:r};t[_.listName].push(e);try{const n=await VX(`${uZ}/logbooks`,a(t));if(n.status!==NL.StatusCode.OK)throw _.unsuccess.push(e),new Error(`[LogbookManager::sync] Could not sync logbooks with server ${JSON.stringify(await n.json())}`);h(await n.json())}catch(f){console.error(`[LogbookManager::sync] Failed to sync list ${_.listName}`,e,f)}}const p={last_sync_timestamp:d,created:o,deleted:s,edited:l};Qj.set("logbook/pendingChanges",JSON.stringify(p)),Qj.set("logbook/unsuccessful",JSON.stringify(p));for(const _ of u)dZ(_);for(const _ of c)hZ(_)};getRecentBoluses=(e=new Date(Date.now()-4*NL.Milliseconds.Hour),t=new Date)=>{const n=this.getLogbooks(e,t);if(0===n.length)return[];const i=n.filter(e=>null!==e.insulin_entered_units&&e.insulin_entered_units>0);return i.map(({insulin_entered_units:e,entry_timestamp:t,uuid:n})=>({insulinDose:e,secondsPassed:(Date.now()-new Date(t).getTime())/1e3,id:n}))};getLogbooks=(e,t)=>{let n=fZ();if(void 0!==e){const t=e.getTime();n=n.filter(e=>e[1]>=t)}if(void 0!==t){const e=t.getTime();n=n.filter(t=>t[1]<e)}const i=[];for(const[a]of n)try{const e=this.getLogbookByUUID(a);try{sZ(e),i.push(e)}catch(r){console.error(r),pZ(a),hZ(a)}}catch(r){console.error(r)}return i};getLogbookByUUID=e=>{const t=Qj.getString(`logbook/${e}`);if(!t)throw new Error("LogbookManager::getLogbookByUUID - could not find logbook in local storage");const n=JSON.parse(t),i=cZ(n);return{...i,entry_timestamp:new Date(i.entry_timestamp),server_timestamp:i.server_timestamp?new Date(i.server_timestamp):null,client_timestamp:new Date(i.client_timestamp)}}};const gZ=new class{currentIsConnected=null;isSynchronizing=!1;isListenerAttached=!1;constructor(){this.setListener()}syncAll=async()=>{if(!this.isSynchronizing)try{this.isSynchronizing=!0,await Uq.sync().catch(console.error),await Dq.sync().catch(console.error),await _Z.sync().catch(console.error),await Cq.fetch().catch(console.error)}finally{this.isSynchronizing=!1}};reset=()=>{Uq.reset(),Cq.clear()};handleConnectivity=async({isConnected:e,isInternetReachable:t})=>{const{accessToken:n}=qz.getState();this.currentIsConnected!==(e&&t)&&(this.currentIsConnected=e&&t,this.currentIsConnected&&n&&await this.syncAll())};setListener=()=>{this.isListenerAttached||uV||(Bz.addEventListener(this.handleConnectivity),this.isListenerAttached=!0)}},{add:yZ,multiply:vZ}=uu;function bZ(e,t,n){return yZ(vZ(e,t),vZ(e.interpolate({inputRange:[0,1],outputRange:[1,0]}),n))}const{add:SZ,multiply:wZ}=uu;function kZ(e){let{index:t,current:n,next:i,inverted:r,layouts:{screen:a},insets:o}=e;const s="ios"===lr.OS&&!lr.isPad&&!lr.isTV&&o.top>20,l=a.width>a.height,u=l?0:10,c=o.top,d=a.height/a.width,h=SZ(n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),i?i.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0),m=0===t,p=wZ(h.interpolate({inputRange:[0,1,2],outputRange:[a.height,m?0:u,(m?c:0)-u*d]}),r),f=h.interpolate({inputRange:[0,1,1.0001,2],outputRange:[0,.3,1,1]}),_=l?1:h.interpolate({inputRange:[0,1,2],outputRange:[1,1,a.width?1-2*u/a.width:1]}),g=l?0:m?h.interpolate({inputRange:[0,1,1.0001,2],outputRange:[0,0,s?38:0,10]}):10;return{cardStyle:{overflow:"hidden",borderTopLeftRadius:g,borderTopRightRadius:g,borderBottomLeftRadius:s?g:0,borderBottomRightRadius:s?g:0,marginTop:m?0:c,marginBottom:m?0:u,transform:[{translateY:p},{scale:_}]},overlayStyle:{opacity:f}}}function CZ(){return{}}const{add:EZ}=uu;function IZ(e){let{current:t,next:n}=e;const i=EZ(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0),r=i.interpolate({inputRange:[0,1,2],outputRange:[0,1,0]});return{leftButtonStyle:{opacity:r},rightButtonStyle:{opacity:r},titleStyle:{opacity:r},backgroundStyle:{opacity:i.interpolate({inputRange:[0,1,1.9,2],outputRange:[0,1,1,0]})}}}function xZ(e){let{current:t,next:n,layouts:{screen:i}}=e;const r=[{translateX:EZ(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0).interpolate({inputRange:[0,1,2],outputRange:Lu.getConstants().isRTL?[-i.width,0,i.width]:[i.width,0,-i.width]})}];return{leftButtonStyle:{transform:r},rightButtonStyle:{transform:r},titleStyle:{transform:r},backgroundStyle:{transform:r}}}function TZ(e){let{current:t,next:n,layouts:{screen:i}}=e;const r=[{translateX:EZ(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0).interpolate({inputRange:[0,1,2],outputRange:Lu.getConstants().isRTL?[i.width,0,-i.width]:[-i.width,0,i.width]})}];return{leftButtonStyle:{transform:r},rightButtonStyle:{transform:r},titleStyle:{transform:r},backgroundStyle:{transform:r}}}function OZ(e){let{current:t,next:n,layouts:{header:i}}=e;const r=[{translateY:EZ(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0).interpolate({inputRange:[0,1,2],outputRange:[-i.height,0,-i.height]})}];return{leftButtonStyle:{transform:r},rightButtonStyle:{transform:r},titleStyle:{transform:r},backgroundStyle:{transform:r}}}function RZ(){return{}}const AZ={animation:"spring",config:{stiffness:1e3,damping:500,mass:3,overshootClamping:!0,restDisplacementThreshold:10,restSpeedThreshold:10}},LZ={animation:"timing",config:{duration:350,easing:Xl.out(Xl.poly(5))}},PZ={animation:"timing",config:{duration:150,easing:Xl.in(Xl.linear)}},MZ={animation:"timing",config:{duration:425,easing:Xl.bezier(.35,.45,0,1)}},DZ={animation:"timing",config:{duration:400,easing:Xl.bezier(.35,.45,0,1)}},NZ={animation:"timing",config:{duration:250,easing:e=>Math.cos((e+1)*Math.PI)/2+.5}},FZ={animation:"timing",config:{duration:200,easing:e=>1===e?1:Math.pow(e,2)}},BZ={gestureDirection:"horizontal",transitionSpec:{open:AZ,close:AZ},cardStyleInterpolator:function(e){let{current:t,next:n,inverted:i,layouts:{screen:r}}=e;return{cardStyle:{transform:[{translateX:wZ(t.progress.interpolate({inputRange:[0,1],outputRange:[r.width,0],extrapolate:"clamp"}),i)},{translateX:n?wZ(n.progress.interpolate({inputRange:[0,1],outputRange:[0,-.3*r.width],extrapolate:"clamp"}),i):0}]},overlayStyle:{opacity:t.progress.interpolate({inputRange:[0,1],outputRange:[0,.07],extrapolate:"clamp"})},shadowStyle:{shadowOpacity:t.progress.interpolate({inputRange:[0,1],outputRange:[0,.3],extrapolate:"clamp"})}}},headerStyleInterpolator:IZ},jZ={gestureDirection:"vertical",transitionSpec:{open:AZ,close:AZ},cardStyleInterpolator:kZ,headerStyleInterpolator:IZ},VZ={gestureDirection:"vertical",transitionSpec:{open:LZ,close:PZ},cardStyleInterpolator:function(e){let{current:t,inverted:n,layouts:{screen:i},closing:r}=e;const a=wZ(t.progress.interpolate({inputRange:[0,1],outputRange:[.08*i.height,0],extrapolate:"clamp"}),n);return{cardStyle:{opacity:bZ(r,t.progress,t.progress.interpolate({inputRange:[0,.5,.9,1],outputRange:[0,.25,.7,1],extrapolate:"clamp"})),transform:[{translateY:a}]}}},headerStyleInterpolator:IZ},HZ={gestureDirection:"vertical",transitionSpec:{open:MZ,close:MZ},cardStyleInterpolator:function(e){let{current:t,next:n,inverted:i,layouts:{screen:r}}=e;return{containerStyle:{overflow:"hidden",transform:[{translateY:wZ(t.progress.interpolate({inputRange:[0,1],outputRange:[r.height,0],extrapolate:"clamp"}),i)}]},cardStyle:{transform:[{translateY:wZ(t.progress.interpolate({inputRange:[0,1],outputRange:[r.height*(95.9/100)*-1,0],extrapolate:"clamp"}),i)},{translateY:n?wZ(n.progress.interpolate({inputRange:[0,1],outputRange:[0,.02*r.height*-1],extrapolate:"clamp"}),i):0}]},overlayStyle:{opacity:t.progress.interpolate({inputRange:[0,.36,1],outputRange:[0,.1,.1],extrapolate:"clamp"})}}},headerStyleInterpolator:IZ},zZ={gestureDirection:"horizontal",transitionSpec:{open:DZ,close:DZ},cardStyleInterpolator:function(e){let{current:t,next:n,closing:i}=e;const r=SZ(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0);return{cardStyle:{opacity:r.interpolate({inputRange:[0,.75,.875,1,1.0825,1.2075,2],outputRange:[0,0,1,1,1,1,0]}),transform:[{scale:bZ(i,t.progress.interpolate({inputRange:[0,1],outputRange:[.925,1],extrapolate:"clamp"}),r.interpolate({inputRange:[0,1,2],outputRange:[.85,1,1.075]}))}]}}},headerStyleInterpolator:IZ},UZ={gestureDirection:"vertical",transitionSpec:{open:NZ,close:FZ},cardStyleInterpolator:function(e){let{current:t,inverted:n,layouts:{screen:i},closing:r}=e;const a=wZ(t.progress.interpolate({inputRange:[0,1],outputRange:[.8*i.height,0],extrapolate:"clamp"}),n);return{cardStyle:{opacity:bZ(r,t.progress,t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"})),transform:[{translateY:a}]},overlayStyle:{opacity:t.progress.interpolate({inputRange:[0,1],outputRange:[0,.3],extrapolate:"clamp"})}}},headerStyleInterpolator:IZ},GZ={gestureDirection:"vertical",transitionSpec:{open:NZ,close:FZ},cardStyleInterpolator:function(e){let{current:{progress:t}}=e;return{cardStyle:{opacity:t.interpolate({inputRange:[0,.5,.9,1],outputRange:[0,.25,.7,1]})},overlayStyle:{opacity:t.interpolate({inputRange:[0,1],outputRange:[0,.5],extrapolate:"clamp"})}}},headerStyleInterpolator:IZ},WZ=lr.select({ios:BZ,android:lr.Version>=29?zZ:lr.Version>=28?HZ:VZ,default:zZ}),YZ=lr.select({ios:jZ,default:UZ}),$Z=i(Object.freeze(Object.defineProperty({__proto__:null,default:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAQAAABIkb+zAAAAlklEQVR4Ae3a1REDMRDG4A3VmHbcUFLigf0exn/mkxuQjmELAAAAAD5Eq5atP6+rZeuPhGz9kZCtPxKy9fs6Zuuf60CfPn369OnTp0+fPn369OnTfx36X1vh+nO6/pytL+D1BCexy+iNhFPt6/dIOEiQIEGCBAkSJEiQ8B0k+PwoQYKhP2OXAYOvRo+vD38bvwcAAACABXF8ILs1PQqpAAAAAElFTkSuQmCC"},Symbol.toStringTag,{value:"Module"}))),XZ=i(Object.freeze(Object.defineProperty({__proto__:null,default:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABVCAQAAAChx3/YAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfkAQMKHDc9iQjuAAACmUlEQVRo3r3ZS2sUQRAH8M5zklwWg0K8mKBB/AIqXhTEi1cTPQe9iH4AUXBNjh79EooKgggSHyCICIIQL7NV1T2bze6EFS/xoms0ie0hs+sa9zE901U79/3R8+iu+pdSnn/VfbCAz/Um2r+XV8AO0jH9pP3vvSN2COdhGX8xInbIzNMKbv1PeEPsiLmEn2i7E+EJsSN4Az+UtjoTXpBwlG7CGnQlPCA2oFtQxZ3uRG7EBnAvjHsTOREbwB2s9bpRuZHKGCzCer9V5ELi8ehuOiIzYkejBUTYTkNkREyAV5DgdzoiE2ICuoYaUxMZEBPQdYpdCGfkzbA+rUsugDNiAnOGwJVwQipj0XlCd8IBscN0wv1GOSEmCE9qyEakREyAZ4myEqkQE+hzupydSIHE4+aUjvIQfZH6hL6QbxV9kfqEnqP1vEQPxA6YA3hReyB6IOUC3vZDdEXKBVPUG36ILkhlihbxqy+iI1KZogf4xW0zd0TWDuJD+AYWLRuyOo2P0DOxB6nM4Fv87pv4B1mdxhfY8E+0IeaIfok/OIgWEs3q97DJQyTI5xn9FBpcBFqlVDgLz6CBlu9S8SS9JlYCraKlTv2qb+QdN4FWYV0AEVkJLQH/M4kn9Sv2t0vkOxH64pt7F9f22LYLVw8D9y4sdJ40T0bgPRmVUqp+iP2MF6pWkrrrPnPdJVRB7tbCVMQNZkSkqlfKDtD+kLs/Eem0xHpGoe631cdHzIhIIiGUrSQp0XHmlEgo7xJK7loZZMiMJGlqjTVNbebCRKy5cPJsLjMn3EJZvdDUQWh+krwCReZJUHOmVaqxzrSEpnNCc0ahiWlz9ksrrLNfoSn27sgf5mCZfrIiStnB8lF8rHdYEaWU+ljQV/dW0X8Ac6zWpmDZsO8AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDEtMDNUMTA6Mjg6NTIrMDA6MDD7fVVWAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTAxLTAzVDEwOjI4OjUyKzAwOjAwiiDt6gAAAABJRU5ErkJggg=="},Symbol.toStringTag,{value:"Module"})));function qZ(){return qZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},qZ.apply(this,arguments)}function ZZ(e){let{style:t,...n}=e;const{colors:i}=Af();return M.createElement(_a,qZ({},n,{style:[{flex:1,backgroundColor:i.background},t]}))}function KZ(e,t,n){let i;const r=e.width>e.height;return i="ios"===lr.OS?lr.isPad||lr.isTV?t?56:50:r?32:t?56:44:"android"===lr.OS?56:64,i+n}function QZ(e,t){return"string"==typeof e.headerTitle?e.headerTitle:void 0!==e.title?e.title:t}function JZ(){return JZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},JZ.apply(this,arguments)}function eK(e){let{style:t,...n}=e;const{colors:i}=Af();return M.createElement(uu.View,JZ({style:[tK.container,{backgroundColor:i.card,borderBottomColor:i.border,shadowColor:i.border},t]},n))}const tK=Ei.create({container:{flex:1,...lr.select({android:{elevation:4},ios:{shadowOpacity:.85,shadowRadius:0,shadowOffset:{width:0,height:Ei.hairlineWidth}},default:{borderBottomWidth:Ei.hairlineWidth}})}}),nK="__react_navigation__elements_contexts";function iK(e,t){let n=self[nK].get(e);return n||(n=M.createContext(t),n.displayName=e,self[nK].set(e,n),n)}self[nK]=self[nK]??new Map;const rK=iK("HeaderShownContext",!1);function aK(){return aK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},aK.apply(this,arguments)}function oK(e){let{tintColor:t,style:n,...i}=e;const{colors:r}=Af();return M.createElement(uu.Text,aK({accessibilityRole:"header","aria-level":"1",numberOfLines:1},i,{style:[sK.title,{color:void 0===t?r.text:t},n]}))}const sK=Ei.create({title:lr.select({ios:{fontSize:17,fontWeight:"600"},android:{fontSize:20,fontFamily:"sans-serif-medium",fontWeight:"normal"},default:{fontSize:18,fontWeight:"500"}})});function lK(e){const t=pH(),n=fH(),i=M.useContext(rK),r="ios"===lr.OS&&t.top>50?t.top-5:t.top,{layout:a=n,modal:o=!1,title:s,headerTitle:l,headerTitleAlign:u=lr.select({ios:"center",default:"left"}),headerLeft:c,headerLeftLabelVisible:d,headerTransparent:h,headerTintColor:m,headerBackground:p,headerRight:f,headerTitleAllowFontScaling:_,headerTitleStyle:g,headerLeftContainerStyle:y,headerRightContainerStyle:v,headerTitleContainerStyle:b,headerBackgroundContainerStyle:S,headerStyle:w,headerShadowVisible:k,headerPressColor:C,headerPressOpacity:E,headerStatusBarHeight:I=(i?0:r)}=e,x=KZ(a,o,I),{height:T=x,minHeight:O,maxHeight:R,backgroundColor:A,borderBottomColor:L,borderBottomEndRadius:P,borderBottomLeftRadius:D,borderBottomRightRadius:N,borderBottomStartRadius:F,borderBottomWidth:B,borderColor:j,borderEndColor:V,borderEndWidth:H,borderLeftColor:z,borderLeftWidth:U,borderRadius:G,borderRightColor:W,borderRightWidth:Y,borderStartColor:$,borderStartWidth:X,borderStyle:q,borderTopColor:Z,borderTopEndRadius:K,borderTopLeftRadius:Q,borderTopRightRadius:J,borderTopStartRadius:ee,borderTopWidth:te,borderWidth:ne,boxShadow:ie,elevation:re,shadowColor:ae,shadowOffset:oe,shadowOpacity:se,shadowRadius:le,opacity:ue,transform:ce,...de}=Ei.flatten(w||{}),he={backgroundColor:A,borderBottomColor:L,borderBottomEndRadius:P,borderBottomLeftRadius:D,borderBottomRightRadius:N,borderBottomStartRadius:F,borderBottomWidth:B,borderColor:j,borderEndColor:V,borderEndWidth:H,borderLeftColor:z,borderLeftWidth:U,borderRadius:G,borderRightColor:W,borderRightWidth:Y,borderStartColor:$,borderStartWidth:X,borderStyle:q,borderTopColor:Z,borderTopEndRadius:K,borderTopLeftRadius:Q,borderTopRightRadius:J,borderTopStartRadius:ee,borderTopWidth:te,borderWidth:ne,boxShadow:ie,elevation:re,shadowColor:ae,shadowOffset:oe,shadowOpacity:se,shadowRadius:le,opacity:ue,transform:ce};for(const M in he)void 0===he[M]&&delete he[M];const me=[he,!1===k&&{elevation:0,shadowOpacity:0,borderBottomWidth:0}],pe=c?c({tintColor:m,pressColor:C,pressOpacity:E,labelVisible:d}):null,fe=f?f({tintColor:m,pressColor:C,pressOpacity:E}):null,_e="function"!=typeof l?e=>M.createElement(oK,e):l;return M.createElement(M.Fragment,null,M.createElement(uu.View,{pointerEvents:"box-none",style:[Ei.absoluteFill,{zIndex:0},S]},p?p({style:me}):h?null:M.createElement(eK,{style:me})),M.createElement(uu.View,{pointerEvents:"box-none",style:[{height:T,minHeight:O,maxHeight:R,opacity:ue,transform:ce}]},M.createElement(_a,{pointerEvents:"none",style:{height:I}}),M.createElement(_a,{pointerEvents:"box-none",style:uK.content},M.createElement(uu.View,{pointerEvents:"box-none",style:[uK.left,"center"===u&&uK.expand,{marginStart:t.left},y]},pe),M.createElement(uu.View,{pointerEvents:"box-none",style:[uK.title,{maxWidth:"center"===u?a.width-2*((pe?!1!==d?80:32:16)+Math.max(t.left,t.right)):a.width-((pe?72:16)+(fe?72:16)+t.left-t.right)},b]},_e({children:s,allowFontScaling:_,tintColor:m,style:g})),M.createElement(uu.View,{pointerEvents:"box-none",style:[uK.right,uK.expand,{marginEnd:t.right},v]},fe))))}const uK=Ei.create({content:{flex:1,flexDirection:"row",alignItems:"stretch"},title:{marginHorizontal:16,justifyContent:"center"},left:{justifyContent:"center",alignItems:"flex-start"},right:{justifyContent:"center",alignItems:"flex-end"},expand:{flexGrow:1,flexBasis:0}});function cK(e){let{children:t}=e;return t}function dK(){return dK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},dK.apply(this,arguments)}const hK=uu.createAnimatedComponent(eh),mK="android"===lr.OS&&lr.Version>=21;function pK(e){let{onPressIn:t,onPressOut:n,android_ripple:i,pressColor:r,pressOpacity:a=.3,style:o,...s}=e;const{dark:l}=Af(),[u]=M.useState(()=>new uu.Value(1)),c=(e,t)=>{mK||uu.timing(u,{toValue:e,duration:t,easing:Xl.inOut(Xl.quad),useNativeDriver:!0}).start()};return M.createElement(hK,dK({onPressIn:e=>{c(a,0),null==t||t(e)},onPressOut:e=>{c(1,200),null==n||n(e)},android_ripple:mK?{color:void 0!==r?r:l?"rgba(255, 255, 255, .32)":"rgba(0, 0, 0, .32)",...i}:void 0,style:[{opacity:mK?1:u},o]},s))}function fK(e){let{disabled:t,allowFontScaling:n,backImage:i,label:r,labelStyle:a,labelVisible:o="ios"===lr.OS,onLabelLayout:s,onPress:l,pressColor:u,pressOpacity:c,screenLayout:d,tintColor:h,titleLayout:m,truncatedLabel:p="Back",accessibilityLabel:f=(r&&"Back"!==r?`${r}, back`:"Go back"),testID:_,style:g}=e;const{colors:y}=Af(),[v,b]=M.useState(void 0),S=void 0!==h?h:lr.select({ios:y.primary,default:y.text}),w=e=>{null==s||s(e),b(e.nativeEvent.layout.x+e.nativeEvent.layout.width)};return M.createElement(pK,{disabled:t,accessible:!0,accessibilityRole:"button",accessibilityLabel:f,testID:_,onPress:t?void 0:()=>l&&requestAnimationFrame(l),pressColor:u,pressOpacity:c,android_ripple:_K,style:[gK.container,t&&gK.disabled,g],hitSlop:lr.select({ios:void 0,default:{top:16,right:16,bottom:16,left:16}})},M.createElement(M.Fragment,null,i?i({tintColor:S}):M.createElement(Js,{style:[gK.icon,Boolean(o)&&gK.iconWithLabel,Boolean(S)&&{tintColor:S}],source:$Z,fadeDuration:0}),(()=>{const e=!r||v&&m&&d&&(d.width-m.width)/2<v+26?p:r;if(!o||void 0===e)return null;const t=M.createElement(_a,{style:d?[gK.labelWrapper,{minWidth:d.width/2-27}]:null},M.createElement(uu.Text,{accessible:!1,onLayout:e===r?w:void 0,style:[gK.label,S?{color:S}:null,a],numberOfLines:1,allowFontScaling:!!n},e));return i||"ios"!==lr.OS?t:M.createElement(cK,{maskElement:M.createElement(_a,{style:gK.iconMaskContainer},M.createElement(Js,{source:XZ,style:gK.iconMask}),M.createElement(_a,{style:gK.iconMaskFillerRect}))},t)})()))}const _K={borderless:!0,foreground:"android"===lr.OS&&lr.Version>=23,radius:20},gK=Ei.create({container:{alignItems:"center",flexDirection:"row",minWidth:Ei.hairlineWidth,...lr.select({ios:null,default:{marginVertical:3,marginHorizontal:11}})},disabled:{opacity:.5},label:{fontSize:17,letterSpacing:.35},labelWrapper:{flexDirection:"row",alignItems:"flex-start"},icon:lr.select({ios:{height:21,width:13,marginLeft:8,marginRight:22,marginVertical:12,resizeMode:"contain",transform:[{scaleX:Lu.getConstants().isRTL?-1:1}]},default:{height:24,width:24,margin:3,resizeMode:"contain",transform:[{scaleX:Lu.getConstants().isRTL?-1:1}]}}),iconWithLabel:"ios"===lr.OS?{marginRight:6}:{},iconMaskContainer:{flex:1,flexDirection:"row",justifyContent:"center"},iconMaskFillerRect:{flex:1,backgroundColor:"#000"},iconMask:{height:21,width:13,marginLeft:-14.5,marginVertical:12,alignSelf:"center",resizeMode:"contain",transform:[{scaleX:Lu.getConstants().isRTL?-1:1}]}}),yK=iK("HeaderBackContext",void 0),vK=iK("HeaderHeightContext",void 0);function bK(e){let{color:t,size:n,style:i}=e;return M.createElement(hl,{style:[SK.icon,{color:t,fontSize:n},i]},"⏷")}const SK=Ei.create({icon:{backgroundColor:"transparent"}});function wK(){return wK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},wK.apply(this,arguments)}function kK(e){let{visible:t,children:n,style:i,...r}=e;return"web"===lr.OS?M.createElement(_a,wK({hidden:!t,style:[{display:t?"flex":"none"},CK.container,i],pointerEvents:t?"auto":"none"},r),n):M.createElement(_a,{style:[CK.container,i],pointerEvents:t?"auto":"none"},M.createElement(_a,{collapsable:!1,removeClippedSubviews:"ios"!==lr.OS&&"macos"!==lr.OS||!t,pointerEvents:t?"auto":"none",style:t?CK.attached:CK.detached},n))}const CK=Ei.create({container:{flex:1,overflow:"hidden"},attached:{flex:1},detached:{flex:1,top:3e4}}),{width:EK=0,height:IK=0}=Aa.get("window"),xK=(lr.OS,{frame:{x:0,y:0,width:EK,height:IK},insets:{top:0,left:0,right:0,bottom:0}});function TK(e){let{children:t,style:n}=e;return M.useContext(uH)?M.createElement(_a,{style:[RK.container,n]},t):("web"===lr.OS&&(t=M.createElement(OK,{initialMetrics:xK},t)),M.createElement(dH,{initialMetrics:xK,style:n},t))}const OK=e=>{let{initialMetrics:t,children:n}=e;const i=M.useRef(null),[r,a]=M.useState(t.frame);return M.useEffect(()=>{if(null==i.current)return;const e=i.current.getBoundingClientRect();let t;a({x:e.x,y:e.y,width:e.width,height:e.height});const n=new ResizeObserver(e=>{const n=e[0];if(n){const{x:e,y:i,width:r,height:o}=n.contentRect;clearTimeout(t),t=setTimeout(()=>{a({x:e,y:i,width:r,height:o})},100)}});return n.observe(i.current),()=>{n.disconnect(),clearTimeout(t)}},[]),M.createElement(cH.Provider,{value:r},M.createElement("div",{ref:i,style:{...Ei.absoluteFillObject,pointerEvents:"none",visibility:"hidden"}}),n)};TK.initialMetrics=xK;const RK=Ei.create({container:{flex:1}});function AK(e){const t=fH(),n=pH(),i=M.useContext(rK),r=M.useContext(vK),{focused:a,modal:o=!1,header:s,headerShown:l=!0,headerTransparent:u,headerStatusBarHeight:c=(i?0:n.top),navigation:d,route:h,children:m,style:p}=e,[f,_]=M.useState(()=>KZ(t,o,c));return M.createElement(ZZ,{accessibilityElementsHidden:!a,importantForAccessibility:a?"auto":"no-hide-descendants",style:[LK.container,p]},M.createElement(_a,{style:LK.content},M.createElement(rK.Provider,{value:i||!1!==l},M.createElement(vK.Provider,{value:l?f:r??0},m))),l?M.createElement(jm.Provider,{value:d},M.createElement(Vm.Provider,{value:h},M.createElement(_a,{onLayout:e=>{const{height:t}=e.nativeEvent.layout;_(t)},style:u?LK.absolute:null},s))):null)}const LK=Ei.create({container:{flex:1,flexDirection:"column-reverse"},content:{flex:1},absolute:{position:"absolute",top:0,left:0,right:0}}),PK=M.createContext(!1),MK=e=>{let{children:t}=e;return M.createElement(M.Fragment,null,t)},DK=_a,NK=3,FK=4,BK=5;function jK(e){let t,n;return function(){let i=!1;for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];if(t){if(t.length!==a.length)i=!0;else for(let e=0;e<t.length;e++)if(t[e]!==a[e]){i=!0;break}}else i=!0;return t=a,(i||void 0===n)&&(n=e(...a)),n}}function VK(){return VK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},VK.apply(this,arguments)}function HK(e){const[t,n]=M.useState(void 0),[i,r]=M.useState(void 0),a=e=>{const{height:t,width:n}=e.nativeEvent.layout;r(e=>e&&t===e.height&&n===e.width?e:{height:t,width:n})},o=e=>{const{height:i,width:r}=e.nativeEvent.layout;t&&i===t.height&&r===t.width||n({height:i,width:r})},s=jK((e,t,n,i,r,a,o)=>e({current:{progress:n},next:i&&{progress:i},layouts:{header:{height:o,width:t.width},screen:t,title:r,leftLabel:a}})),{progress:l,layout:u,modal:c,onGoBack:d,headerTitle:h,headerLeft:m=(d?e=>M.createElement(fK,e):void 0),headerRight:p,headerBackImage:f,headerBackTitle:_,headerBackTitleVisible:g="ios"===lr.OS,headerTruncatedBackTitle:y,headerBackAccessibilityLabel:v,headerBackTestID:b,headerBackAllowFontScaling:S,headerBackTitleStyle:w,headerTitleContainerStyle:k,headerLeftContainerStyle:C,headerRightContainerStyle:E,headerBackgroundContainerStyle:I,headerStyle:x,headerStatusBarHeight:T,styleInterpolator:O,...R}=e,A=KZ(u,c,T),{height:L=A}=Ei.flatten(x||{}),{titleStyle:P,leftButtonStyle:D,leftLabelStyle:N,rightButtonStyle:F,backgroundStyle:B}=s(O,u,l.current,l.next,i,_?t:void 0,"number"==typeof L?L:A),j=m?e=>m({...e,backImage:f,accessibilityLabel:v,testID:b,allowFontScaling:S,onPress:d,label:_,truncatedLabel:y,labelStyle:[N,w],onLabelLayout:o,screenLayout:u,titleLayout:i,canGoBack:Boolean(d)}):void 0,V=p?e=>p({...e,canGoBack:Boolean(d)}):void 0,H="function"!=typeof h?e=>M.createElement(oK,VK({},e,{onLayout:a})):e=>h({...e,onLayout:a});return M.createElement(lK,VK({modal:c,layout:u,headerTitle:H,headerLeft:j,headerLeftLabelVisible:g,headerRight:V,headerTitleContainerStyle:[P,k],headerLeftContainerStyle:[D,C],headerRightContainerStyle:[F,E],headerBackgroundContainerStyle:[B,I],headerStyle:x,headerStatusBarHeight:T},R))}function zK(){return zK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},zK.apply(this,arguments)}const UK=M.memo(function(e){let{back:t,layout:n,progress:i,options:r,route:a,navigation:o,styleInterpolator:s}=e;const l=pH();let u;void 0!==r.headerBackTitle?u=r.headerBackTitle:t&&(u=t.title);const c=M.useCallback(function(e,t){let n;return function(){if(!n){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];e.apply(this,r),n=setTimeout(()=>{n=void 0},t)}}}(()=>{o.isFocused()&&o.canGoBack()&&o.dispatch({...Am.pop(),source:a.key})},50),[o,a.key]),d=M.useContext(PK),h=M.useContext(rK),m=void 0!==r.headerStatusBarHeight?r.headerStatusBarHeight:d||h?0:l.top;return M.createElement(HK,zK({},r,{title:QZ(r,a.name),progress:i,layout:n,modal:d,headerBackTitle:void 0!==r.headerBackTitle?r.headerBackTitle:u,headerStatusBarHeight:m,onGoBack:t?c:void 0,styleInterpolator:s}))});function GK(e){let{mode:t,scenes:n,layout:i,getPreviousScene:r,getFocusedRoute:a,onContentHeightChange:o,style:s}=e;const l=a(),u=M.useContext(yK);return M.createElement(uu.View,{pointerEvents:"box-none",style:s},n.slice(-3).map((e,n,a)=>{var s,c;if("screen"===t&&n!==a.length-1||!e)return null;const{header:d,headerMode:h,headerShown:m=!0,headerTransparent:p,headerStyleInterpolator:f}=e.descriptor.options;if(h!==t||!m)return null;const _=l.key===e.descriptor.route.key,g=r({route:e.descriptor.route});let y=u;if(g){const{options:e,route:t}=g.descriptor;y=g?{title:QZ(e,t.name)}:u}const v=null===(s=a[n-1])||void 0===s?void 0:s.descriptor,b=null===(c=a[n+1])||void 0===c?void 0:c.descriptor,{headerShown:S=!0,headerMode:w}=(null==v?void 0:v.options)||{},k=a.slice(n+1).find(e=>{const{headerShown:t=!0,headerMode:n}=(null==e?void 0:e.descriptor.options)||{};return!1===t||"screen"===n}),{gestureDirection:C}=(null==k?void 0:k.descriptor.options)||{},E=(!1===S||"screen"===w)&&!b||k,I={layout:i,back:y,progress:e.progress,options:e.descriptor.options,route:e.descriptor.route,navigation:e.descriptor.navigation,styleInterpolator:"float"===t?E?"vertical"===C||"vertical-inverted"===C?OZ:"horizontal-inverted"===C?TZ:xZ:f:RZ};return M.createElement(jm.Provider,{key:e.descriptor.route.key,value:e.descriptor.navigation},M.createElement(Vm.Provider,{value:e.descriptor.route},M.createElement(_a,{onLayout:o?t=>{const{height:n}=t.nativeEvent.layout;o({route:e.descriptor.route,height:n})}:void 0,pointerEvents:_?"box-none":"none",accessibilityElementsHidden:!_,importantForAccessibility:_?"auto":"no-hide-descendants",style:"float"===t&&!_||p?WK.header:null},void 0!==d?d(I):M.createElement(UK,I))))}))}const WK=Ei.create({header:{position:"absolute",top:0,left:0,right:0}});var YK,$K,XK={exports:{}};function qK(){return $K?YK:($K=1,YK={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]})}var ZK,KK,QK,JK,eQ,tQ,nQ,iQ,rQ,aQ,oQ,sQ,lQ={exports:{}};function uQ(){if(QK)return lQ.exports;QK=1;var e=KK?ZK:(KK=1,ZK=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}),t=Array.prototype.concat,n=Array.prototype.slice,i=lQ.exports=function(i){for(var r=[],a=0,o=i.length;a<o;a++){var s=i[a];e(s)?r=t.call(r,n.call(s)):r.push(s)}return r};return i.wrap=function(e){return function(){return e(i(arguments))}},lQ.exports}function cQ(){if(tQ)return eQ;tQ=1;const e=qK(),t={};for(const r of Object.keys(e))t[e[r]]=r;const n={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};eQ=n;for(const r of Object.keys(n)){if(!("channels"in n[r]))throw new Error("missing channels property: "+r);if(!("labels"in n[r]))throw new Error("missing channel labels property: "+r);if(n[r].labels.length!==n[r].channels)throw new Error("channel and label counts mismatch: "+r);const{channels:e,labels:t}=n[r];delete n[r].channels,delete n[r].labels,Object.defineProperty(n[r],"channels",{value:e}),Object.defineProperty(n[r],"labels",{value:t})}function i(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}return n.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,i=e[2]/255,r=Math.min(t,n,i),a=Math.max(t,n,i),o=a-r;let s,l;a===r?s=0:t===a?s=(n-i)/o:n===a?s=2+(i-t)/o:i===a&&(s=4+(t-n)/o),s=Math.min(60*s,360),s<0&&(s+=360);const u=(r+a)/2;return l=a===r?0:u<=.5?o/(a+r):o/(2-a-r),[s,100*l,100*u]},n.rgb.hsv=function(e){let t,n,i,r,a;const o=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l),d=function(e){return(u-e)/6/c+.5};return 0===c?(r=0,a=0):(a=c/u,t=d(o),n=d(s),i=d(l),o===u?r=i-n:s===u?r=1/3+t-i:l===u&&(r=2/3+n-t),r<0?r+=1:r>1&&(r-=1)),[360*r,100*a,100*u]},n.rgb.hwb=function(e){const t=e[0],i=e[1];let r=e[2];const a=n.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(i,r));return r=1-1/255*Math.max(t,Math.max(i,r)),[a,100*o,100*r]},n.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,i=e[2]/255,r=Math.min(1-t,1-n,1-i);return[100*((1-t-r)/(1-r)||0),100*((1-n-r)/(1-r)||0),100*((1-i-r)/(1-r)||0),100*r]},n.rgb.keyword=function(n){const r=t[n];if(r)return r;let a,o=1/0;for(const t of Object.keys(e)){const r=i(n,e[t]);r<o&&(o=r,a=t)}return a},n.keyword.rgb=function(t){return e[t]},n.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,i=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;return[100*(.4124*t+.3576*n+.1805*i),100*(.2126*t+.7152*n+.0722*i),100*(.0193*t+.1192*n+.9505*i)]},n.rgb.lab=function(e){const t=n.rgb.xyz(e);let i=t[0],r=t[1],a=t[2];i/=95.047,r/=100,a/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;return[116*r-16,500*(i-r),200*(r-a)]},n.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,i=e[2]/100;let r,a,o;if(0===n)return o=255*i,[o,o,o];r=i<.5?i*(1+n):i+n-i*n;const s=2*i-r,l=[0,0,0];for(let u=0;u<3;u++)a=t+1/3*-(u-1),a<0&&a++,a>1&&a--,o=6*a<1?s+6*(r-s)*a:2*a<1?r:3*a<2?s+(r-s)*(2/3-a)*6:s,l[u]=255*o;return l},n.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,i=e[2]/100,r=n;const a=Math.max(i,.01);i*=2,n*=i<=1?i:2-i,r*=a<=1?a:2-a;return[t,100*(0===i?2*r/(a+r):2*n/(i+n)),100*((i+n)/2)]},n.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let i=e[2]/100;const r=Math.floor(t)%6,a=t-Math.floor(t),o=255*i*(1-n),s=255*i*(1-n*a),l=255*i*(1-n*(1-a));switch(i*=255,r){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},n.hsv.hsl=function(e){const t=e[0],n=e[1]/100,i=e[2]/100,r=Math.max(i,.01);let a,o;o=(2-n)*i;const s=(2-n)*r;return a=n*r,a/=s<=1?s:2-s,a=a||0,o/=2,[t,100*a,100*o]},n.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,i=e[2]/100;const r=n+i;let a;r>1&&(n/=r,i/=r);const o=Math.floor(6*t),s=1-i;a=6*t-o,1&o&&(a=1-a);const l=n+a*(s-n);let u,c,d;switch(o){default:case 6:case 0:u=s,c=l,d=n;break;case 1:u=l,c=s,d=n;break;case 2:u=n,c=s,d=l;break;case 3:u=n,c=l,d=s;break;case 4:u=l,c=n,d=s;break;case 5:u=s,c=n,d=l}return[255*u,255*c,255*d]},n.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,i=e[2]/100,r=e[3]/100;return[255*(1-Math.min(1,t*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r))]},n.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,i=e[2]/100;let r,a,o;return r=3.2406*t+-1.5372*n+-.4986*i,a=-.9689*t+1.8758*n+.0415*i,o=.0557*t+-.204*n+1.057*i,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,r=Math.min(Math.max(0,r),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[255*r,255*a,255*o]},n.xyz.lab=function(e){let t=e[0],n=e[1],i=e[2];t/=95.047,n/=100,i/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*n-16,500*(t-n),200*(n-i)]},n.lab.xyz=function(e){let t,n,i;n=(e[0]+16)/116,t=e[1]/500+n,i=n-e[2]/200;const r=n**3,a=t**3,o=i**3;return n=r>.008856?r:(n-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,i=o>.008856?o:(i-16/116)/7.787,t*=95.047,n*=100,i*=108.883,[t,n,i]},n.lab.lch=function(e){const t=e[0],n=e[1],i=e[2];let r;r=360*Math.atan2(i,n)/2/Math.PI,r<0&&(r+=360);return[t,Math.sqrt(n*n+i*i),r]},n.lch.lab=function(e){const t=e[0],n=e[1],i=e[2]/360*2*Math.PI;return[t,n*Math.cos(i),n*Math.sin(i)]},n.rgb.ansi16=function(e,t=null){const[i,r,a]=e;let o=null===t?n.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let s=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(i/255));return 2===o&&(s+=60),s},n.hsv.ansi16=function(e){return n.rgb.ansi16(n.hsv.rgb(e),e[2])},n.rgb.ansi256=function(e){const t=e[0],n=e[1],i=e[2];if(t===n&&n===i)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},n.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},n.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},n.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},n.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},n.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,i=e[2]/255,r=Math.max(Math.max(t,n),i),a=Math.min(Math.min(t,n),i),o=r-a;let s,l;return s=o<1?a/(1-o):0,l=o<=0?0:r===t?(n-i)/o%6:r===n?2+(i-t)/o:4+(t-n)/o,l/=6,l%=1,[360*l,100*o,100*s]},n.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,i=n<.5?2*t*n:2*t*(1-n);let r=0;return i<1&&(r=(n-.5*i)/(1-i)),[e[0],100*i,100*r]},n.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,i=t*n;let r=0;return i<1&&(r=(n-i)/(1-i)),[e[0],100*i,100*r]},n.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,i=e[2]/100;if(0===n)return[255*i,255*i,255*i];const r=[0,0,0],a=t%1*6,o=a%1,s=1-o;let l=0;switch(Math.floor(a)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=s,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=s,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=s}return l=(1-n)*i,[255*(n*r[0]+l),255*(n*r[1]+l),255*(n*r[2]+l)]},n.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let i=0;return n>0&&(i=t/n),[e[0],100*i,100*n]},n.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[e[0],100*i,100*n]},n.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},n.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,i=n-t;let r=0;return i<1&&(r=(n-i)/(1-i)),[e[0],100*i,100*r]},n.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},n.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},n.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},n.gray.hsl=function(e){return[0,0,e[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(e){return[0,100,e[0]]},n.gray.cmyk=function(e){return[0,0,0,e[0]]},n.gray.lab=function(e){return[e[0],0,0]},n.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},n.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},eQ}function dQ(){if(iQ)return nQ;iQ=1;const e=cQ();function t(t){const n=function(){const t={},n=Object.keys(e);for(let e=n.length,i=0;i<e;i++)t[n[i]]={distance:-1,parent:null};return t}(),i=[t];for(n[t].distance=0;i.length;){const t=i.pop(),r=Object.keys(e[t]);for(let e=r.length,a=0;a<e;a++){const e=r[a],o=n[e];-1===o.distance&&(o.distance=n[t].distance+1,o.parent=t,i.unshift(e))}}return n}function n(e,t){return function(n){return t(e(n))}}function i(t,i){const r=[i[t].parent,t];let a=e[i[t].parent][t],o=i[t].parent;for(;i[o].parent;)r.unshift(i[o].parent),a=n(e[i[o].parent][o],a),o=i[o].parent;return a.conversion=r,a}return nQ=function(e){const n=t(e),r={},a=Object.keys(n);for(let t=a.length,o=0;o<t;o++){const e=a[o];null!==n[e].parent&&(r[e]=i(e,n))}return r},nQ}function hQ(){if(aQ)return rQ;aQ=1;const e=cQ(),t=dQ(),n={};return Object.keys(e).forEach(i=>{n[i]={},Object.defineProperty(n[i],"channels",{value:e[i].channels}),Object.defineProperty(n[i],"labels",{value:e[i].labels});const r=t(i);Object.keys(r).forEach(e=>{const t=r[e];n[i][e]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const i=e(t);if("object"==typeof i)for(let e=i.length,r=0;r<e;r++)i[r]=Math.round(i[r]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}(t),n[i][e].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(t)})}),rQ=n}function mQ(){if(sQ)return oQ;sQ=1;const e=function(){if(JK)return XK.exports;JK=1;var e=qK(),t=uQ(),n=Object.hasOwnProperty,i=Object.create(null);for(var r in e)n.call(e,r)&&(i[e[r]]=r);var a=XK.exports={to:{},get:{}};function o(e,t,n){return Math.min(Math.max(t,e),n)}function s(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}return a.get=function(e){var t,n;switch(e.substring(0,3).toLowerCase()){case"hsl":t=a.get.hsl(e),n="hsl";break;case"hwb":t=a.get.hwb(e),n="hwb";break;default:t=a.get.rgb(e),n="rgb"}return t?{model:n,value:t}:null},a.get.rgb=function(t){if(!t)return null;var i,r,a,s=[0,0,0,1];if(i=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(a=i[2],i=i[1],r=0;r<3;r++){var l=2*r;s[r]=parseInt(i.slice(l,l+2),16)}a&&(s[3]=parseInt(a,16)/255)}else if(i=t.match(/^#([a-f0-9]{3,4})$/i)){for(a=(i=i[1])[3],r=0;r<3;r++)s[r]=parseInt(i[r]+i[r],16);a&&(s[3]=parseInt(a+a,16)/255)}else if(i=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)s[r]=parseInt(i[r+1],0);i[4]&&(i[5]?s[3]=.01*parseFloat(i[4]):s[3]=parseFloat(i[4]))}else{if(!(i=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(i=t.match(/^(\w+)$/))?"transparent"===i[1]?[0,0,0,0]:n.call(e,i[1])?((s=e[i[1]])[3]=1,s):null:null;for(r=0;r<3;r++)s[r]=Math.round(2.55*parseFloat(i[r+1]));i[4]&&(i[5]?s[3]=.01*parseFloat(i[4]):s[3]=parseFloat(i[4]))}for(r=0;r<3;r++)s[r]=o(s[r],0,255);return s[3]=o(s[3],0,1),s},a.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,o(parseFloat(t[2]),0,100),o(parseFloat(t[3]),0,100),o(isNaN(n)?1:n,0,1)]}return null},a.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,o(parseFloat(t[2]),0,100),o(parseFloat(t[3]),0,100),o(isNaN(n)?1:n,0,1)]}return null},a.to.hex=function(){var e=t(arguments);return"#"+s(e[0])+s(e[1])+s(e[2])+(e[3]<1?s(Math.round(255*e[3])):"")},a.to.rgb=function(){var e=t(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},a.to.rgb.percent=function(){var e=t(arguments),n=Math.round(e[0]/255*100),i=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+n+"%, "+i+"%, "+r+"%)":"rgba("+n+"%, "+i+"%, "+r+"%, "+e[3]+")"},a.to.hsl=function(){var e=t(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},a.to.hwb=function(){var e=t(arguments),n="";return e.length>=4&&1!==e[3]&&(n=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+n+")"},a.to.keyword=function(e){return i[e.slice(0,3)]},XK.exports}(),t=hQ(),n=["keyword","gray","hex"],i={};for(const c of Object.keys(t))i[[...t[c].labels].sort().join("")]=c;const r={};function a(o,s){if(!(this instanceof a))return new a(o,s);if(s&&s in n&&(s=null),s&&!(s in t))throw new Error("Unknown model: "+s);let l,c;if(null==o)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(o instanceof a)this.model=o.model,this.color=[...o.color],this.valpha=o.valpha;else if("string"==typeof o){const n=e.get(o);if(null===n)throw new Error("Unable to parse color from string: "+o);this.model=n.model,c=t[this.model].channels,this.color=n.value.slice(0,c),this.valpha="number"==typeof n.value[c]?n.value[c]:1}else if(o.length>0){this.model=s||"rgb",c=t[this.model].channels;const e=Array.prototype.slice.call(o,0,c);this.color=u(e,c),this.valpha="number"==typeof o[c]?o[c]:1}else if("number"==typeof o)this.model="rgb",this.color=[o>>16&255,o>>8&255,255&o],this.valpha=1;else{this.valpha=1;const e=Object.keys(o);"alpha"in o&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof o.alpha?o.alpha:0);const n=e.sort().join("");if(!(n in i))throw new Error("Unable to parse color from object: "+JSON.stringify(o));this.model=i[n];const{labels:r}=t[this.model],a=[];for(l=0;l<r.length;l++)a.push(o[r[l]]);this.color=u(a)}if(r[this.model])for(c=t[this.model].channels,l=0;l<c;l++){const e=r[this.model][l];e&&(this.color[l]=e(this.color[l]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}a.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(t){let n=this.model in e.to?this:this.rgb();n=n.round("number"==typeof t?t:1);const i=1===n.valpha?n.color:[...n.color,this.valpha];return e.to[n.model](i)},percentString(t){const n=this.rgb().round("number"==typeof t?t:1),i=1===n.valpha?n.color:[...n.color,this.valpha];return e.to.rgb.percent(i)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:n}=t[this.model],{labels:i}=t[this.model];for(let t=0;t<n;t++)e[i[t]]=this.color[t];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new a([...this.color.map(o(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new a([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:s("rgb",0,l(255)),green:s("rgb",1,l(255)),blue:s("rgb",2,l(255)),hue:s(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:s("hsl",1,l(100)),lightness:s("hsl",2,l(100)),saturationv:s("hsv",1,l(100)),value:s("hsv",2,l(100)),chroma:s("hcg",1,l(100)),gray:s("hcg",2,l(100)),white:s("hwb",1,l(100)),wblack:s("hwb",2,l(100)),cyan:s("cmyk",0,l(100)),magenta:s("cmyk",1,l(100)),yellow:s("cmyk",2,l(100)),black:s("cmyk",3,l(100)),x:s("xyz",0,l(95.047)),y:s("xyz",1,l(100)),z:s("xyz",2,l(108.833)),l:s("lab",0,l(100)),a:s("lab",1),b:s("lab",2),keyword(e){return void 0!==e?new a(e):t[this.model].keyword(this.color)},hex(t){return void 0!==t?new a(t):e.to.hex(this.rgb().round().color)},hexa(t){if(void 0!==t)return new a(t);const n=this.rgb().round().color;let i=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===i.length&&(i="0"+i),e.to.hex(n)+i},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[n,i]of e.entries()){const e=i/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return a.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),i=this.rgb(),r=void 0===t?.5:t,o=2*r-1,s=n.alpha()-i.alpha(),l=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,u=1-l;return a.rgb(l*n.red()+u*i.red(),l*n.green()+u*i.green(),l*n.blue()+u*i.blue(),n.alpha()*r+i.alpha()*(1-r))}};for(const c of Object.keys(t)){if(n.includes(c))continue;const{channels:e}=t[c];a.prototype[c]=function(...e){return this.model===c?new a(this):e.length>0?new a(e,c):new a([...(n=t[this.model][c].raw(this.color),Array.isArray(n)?n:[n]),this.valpha],c);var n},a[c]=function(...t){let n=t[0];return"number"==typeof n&&(n=u(t,e)),new a(n,c)}}function o(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function s(e,t,n){e=Array.isArray(e)?e:[e];for(const i of e)(r[i]||(r[i]=[]))[t]=n;return e=e[0],function(i){let r;return void 0!==i?(n&&(i=n(i)),r=this[e](),r.color[t]=i,r):(r=this[e]().color[t],n&&(r=n(r)),r)}}function l(e){return function(t){return Math.max(0,Math.min(e,t))}}function u(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}return oQ=a}const pQ=n(mQ());function fQ(e,t){for(var n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}function _Q(e){switch(e){case"vertical":return 1;case"vertical-inverted":return-1;case"horizontal":return Lu.getConstants().isRTL?-1:1;case"horizontal-inverted":return Lu.getConstants().isRTL?1:-1}}function gQ(e,t){const n=_Q(t);switch(t){case"vertical":case"vertical-inverted":return e.height*n;case"horizontal":case"horizontal-inverted":return e.width*n}}const yQ=i(iz);function vQ(){return vQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},vQ.apply(this,arguments)}let bQ;try{bQ=yQ}catch(e){}const SQ=e=>{let{enabled:t,...n}=e;return null!=bQ?M.createElement(bQ.ScreenContainer,vQ({enabled:t},n)):M.createElement(_a,n)},wQ=e=>{let{enabled:t,active:n,...i}=e;return null!=bQ?M.createElement(bQ.Screen,vQ({enabled:t,activityState:n},i)):M.createElement(_a,i)},kQ=M.createContext(void 0);function CQ(e){var t,n;let{dark:i,layout:r,insets:a,style:o}=e;const{dark:s}=Af(),[l,u]=M.useState(!0),c=1-20/r.width,d=(a.top-34)*c,h=Ei.flatten(o),m=null==h||null===(t=h.transform)||void 0===t||null===(n=t.find(e=>void 0!==e.translateY))||void 0===n?void 0:n.translateY;M.useEffect(()=>{const e=null==m?void 0:m.addListener(e=>{let{value:t}=e;u(t<d)});return()=>null==m?void 0:m.removeListener(e)},[d,m]);const p=i??!s;return M.createElement(uh,{animated:!0,barStyle:l&&p?"dark-content":"light-content"})}function EQ(){return EQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},EQ.apply(this,arguments)}const IQ=M.forwardRef(function(e,t){let{enabled:n,layout:i,style:r,...a}=e;const[o,s]=M.useState(!1),[l,u]=M.useState("auto");return M.useImperativeHandle(t,()=>({setPointerEvents:u})),M.useEffect(()=>{if("undefined"==typeof document||!document.body)return;const e=document.body.clientWidth,t=document.body.clientHeight;s(e===i.width&&t===i.height)},[i.height,i.width]),M.createElement(_a,EQ({},a,{pointerEvents:l,style:[n&&o?xQ.page:xQ.card,r]}))}),xQ=Ei.create({page:{minHeight:"100%"},card:{flex:1,overflow:"hidden"}});function TQ(){return TQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},TQ.apply(this,arguments)}const OQ="web"!==lr.OS,RQ=e=>{if(e){return null!=Ei.flatten(e).opacity}return!1};class AQ extends M.Component{static defaultProps={shadowEnabled:!1,gestureEnabled:!0,gestureVelocityImpact:.3,overlay:e=>{let{style:t}=e;return t?M.createElement(uu.View,{pointerEvents:"none",style:[PQ.overlay,t]}):null}};componentDidMount(){this.animate({closing:this.props.closing}),this.isCurrentlyMounted=!0}componentDidUpdate(e){const{layout:t,gestureDirection:n,closing:i}=this.props,{width:r,height:a}=t;r!==e.layout.width&&this.layout.width.setValue(r),a!==e.layout.height&&this.layout.height.setValue(a),n!==e.gestureDirection&&this.inverted.setValue(_Q(n));const o=this.getAnimateToValue(this.props);this.getAnimateToValue(e)===o&&this.lastToValue===o||this.animate({closing:i})}componentWillUnmount(){this.props.gesture.stopAnimation(),this.isCurrentlyMounted=!1,this.handleEndInteraction()}isCurrentlyMounted=!1;isClosing=new uu.Value(0);inverted=new uu.Value(_Q(this.props.gestureDirection));layout={width:new uu.Value(this.props.layout.width),height:new uu.Value(this.props.layout.height)};isSwiping=new uu.Value(0);animate=e=>{let{closing:t,velocity:n}=e;const{gesture:i,transitionSpec:r,onOpen:a,onClose:o,onTransition:s}=this.props,l=this.getAnimateToValue({...this.props,closing:t});this.lastToValue=l,this.isClosing.setValue(t?1:0);const u=t?r.close:r.open,c="spring"===u.animation?uu.spring:uu.timing;this.setPointerEventsEnabled(!t),this.handleStartInteraction(),clearTimeout(this.pendingGestureCallback),null==s||s({closing:t,gesture:void 0!==n}),c(i,{...u.config,velocity:n,toValue:l,useNativeDriver:OQ,isInteraction:!1}).start(e=>{let{finished:n}=e;this.handleEndInteraction(),clearTimeout(this.pendingGestureCallback),n&&(t?o():a(),this.isCurrentlyMounted&&this.forceUpdate())})};getAnimateToValue=e=>{let{closing:t,layout:n,gestureDirection:i}=e;return t?gQ(n,i):0};setPointerEventsEnabled=e=>{var t;const n=e?"box-none":"none";null===(t=this.ref.current)||void 0===t||t.setPointerEvents(n)};handleStartInteraction=()=>{void 0===this.interactionHandle&&(this.interactionHandle=Qa.createInteractionHandle())};handleEndInteraction=()=>{void 0!==this.interactionHandle&&(Qa.clearInteractionHandle(this.interactionHandle),this.interactionHandle=void 0)};handleGestureStateChange=e=>{let{nativeEvent:t}=e;const{layout:n,onClose:i,onGestureBegin:r,onGestureCanceled:a,onGestureEnd:o,gestureDirection:s,gestureVelocityImpact:l}=this.props;switch(t.state){case FK:this.isSwiping.setValue(1),this.handleStartInteraction(),null==r||r();break;case NK:{this.isSwiping.setValue(0),this.handleEndInteraction();const e="vertical"===s||"vertical-inverted"===s?t.velocityY:t.velocityX;this.animate({closing:this.props.closing,velocity:e}),null==a||a();break}case BK:{let e,r,a;this.isSwiping.setValue(0),"vertical"===s||"vertical-inverted"===s?(e=n.height,r=t.translationY,a=t.velocityY):(e=n.width,r=t.translationX,a=t.velocityX);const u=(r+a*l)*_Q(s)>e/2?0!==a||0!==r:this.props.closing;this.animate({closing:u,velocity:a}),u&&(this.pendingGestureCallback=setTimeout(()=>{i(),this.forceUpdate()},32)),null==o||o();break}}};getInterpolatedStyle=jK((e,t)=>e(t));getCardAnimation=jK((e,t,n,i,r,a,o,s)=>({index:e,current:{progress:t},next:n&&{progress:n},closing:this.isClosing,swiping:this.isSwiping,inverted:this.inverted,layouts:{screen:i},insets:{top:r,right:a,bottom:o,left:s}}));gestureActivationCriteria(){const{layout:e,gestureDirection:t,gestureResponseDistance:n}=this.props,i=!0,r=void 0!==n?n:"vertical"===t||"vertical-inverted"===t?135:50;if("vertical"===t)return{maxDeltaX:15,minOffsetY:5,hitSlop:{bottom:-e.height+r},enableTrackpadTwoFingerGesture:i};if("vertical-inverted"===t)return{maxDeltaX:15,minOffsetY:-5,hitSlop:{top:-e.height+r},enableTrackpadTwoFingerGesture:i};{const n=-e.width+r;return 1===_Q(t)?{minOffsetX:5,maxDeltaY:20,hitSlop:{right:n},enableTrackpadTwoFingerGesture:i}:{minOffsetX:-5,maxDeltaY:20,hitSlop:{left:n},enableTrackpadTwoFingerGesture:i}}}ref=M.createRef();render(){const{styleInterpolator:e,interpolationIndex:t,current:n,gesture:i,next:r,layout:a,insets:o,overlay:s,overlayEnabled:l,shadowEnabled:u,gestureEnabled:c,gestureDirection:d,pageOverflowEnabled:h,headerDarkContent:m,children:p,containerStyle:f,contentStyle:_,...g}=this.props,y=this.getCardAnimation(t,n,r,a,o.top,o.right,o.bottom,o.left),v=this.getInterpolatedStyle(e,y),{containerStyle:b,cardStyle:S,overlayStyle:w,shadowStyle:k}=v,C=c?uu.event([{nativeEvent:"vertical"===d||"vertical-inverted"===d?{translationY:i}:{translationX:i}}],{useNativeDriver:OQ}):void 0,{backgroundColor:E}=Ei.flatten(_||{}),I="string"==typeof E&&0===pQ(E).alpha();return M.createElement(kQ.Provider,{value:y},"ios"===lr.OS&&l&&r&&LQ(e)?M.createElement(CQ,{dark:m,layout:a,insets:o,style:S}):null,M.createElement(uu.View,{style:{opacity:n},collapsable:!1}),M.createElement(_a,TQ({pointerEvents:"box-none",collapsable:!1},g),l?M.createElement(_a,{pointerEvents:"box-none",style:Ei.absoluteFill},s({style:w})):null,M.createElement(uu.View,{style:[PQ.container,b,f],pointerEvents:"box-none"},M.createElement(MK,TQ({enabled:0!==a.width&&c,onGestureEvent:C,onHandlerStateChange:this.handleGestureStateChange},this.gestureActivationCriteria()),M.createElement(uu.View,{needsOffscreenAlphaCompositing:RQ(S),style:[PQ.container,S]},u&&k&&!I?M.createElement(uu.View,{style:[PQ.shadow,"horizontal"===d?[PQ.shadowHorizontal,PQ.shadowLeft]:"horizontal-inverted"===d?[PQ.shadowHorizontal,PQ.shadowRight]:"vertical"===d?[PQ.shadowVertical,PQ.shadowTop]:[PQ.shadowVertical,PQ.shadowBottom],{backgroundColor:E},k],pointerEvents:"none"}):null,M.createElement(IQ,{ref:this.ref,enabled:h,layout:a,style:_},p))))))}}const LQ=e=>e===kZ||"forModalPresentationIOS"===e.name,PQ=Ei.create({container:{flex:1},overlay:{flex:1,backgroundColor:"#000"},shadow:{position:"absolute",shadowRadius:5,shadowColor:"#000",shadowOpacity:.3},shadowHorizontal:{top:0,bottom:0,width:3,shadowOffset:{width:-1,height:1}},shadowLeft:{left:0},shadowRight:{right:0},shadowVertical:{left:0,right:0,height:3,shadowOffset:{width:1,height:-1}},shadowTop:{top:0},shadowBottom:{bottom:0}});function MQ(e){let{interpolationIndex:t,index:n,active:i,closing:r,gesture:a,focused:o,modal:s,getPreviousScene:l,getFocusedRoute:u,headerDarkContent:c,hasAbsoluteFloatHeader:d,headerHeight:h,onHeaderHeightChange:m,isParentHeaderShown:p,isNextScreenTransparent:f,detachCurrentScreen:_,layout:g,onCloseRoute:y,onOpenRoute:v,onGestureCancel:b,onGestureEnd:S,onGestureStart:w,onTransitionEnd:k,onTransitionStart:C,renderHeader:E,renderScene:I,safeAreaInsetBottom:x,safeAreaInsetLeft:T,safeAreaInsetRight:O,safeAreaInsetTop:R,scene:A}=e;const L=M.useContext(vK),{onPageChangeStart:P,onPageChangeCancel:D,onPageChangeConfirm:N}=function(e){const t=M.useRef(void 0),n=M.useRef(0),i=M.useRef(),r=M.useCallback(()=>{void 0!==i.current&&(clearTimeout(i.current),i.current=void 0)},[]),a=M.useCallback(()=>{if(!e())return;r();const i=kh.State.currentlyFocusedInput();null==i||i.blur(),t.current=i,n.current=Date.now()},[r,e]),o=M.useCallback(n=>{if(e()){if(r(),n)Pu.dismiss();else{const e=t.current;null==e||e.blur()}t.current=void 0}},[r,e]),s=M.useCallback(()=>{if(!e())return;r();const a=t.current;a&&(Date.now()-n.current<100?i.current=setTimeout(()=>{null==a||a.focus(),t.current=void 0},100):(null==a||a.focus(),t.current=void 0))},[r,e]);return M.useEffect(()=>()=>r(),[r]),{onPageChangeStart:a,onPageChangeConfirm:o,onPageChangeCancel:s}}(M.useCallback(()=>{const{options:e,navigation:t}=A.descriptor;return t.isFocused()&&!1!==e.keyboardHandlingEnabled},[A.descriptor])),F={top:R,right:O,bottom:x,left:T},{colors:B}=Af(),[j,V]=M.useState("box-none");M.useEffect(()=>{var e,t;const n=null===(e=A.progress.next)||void 0===e||null===(t=e.addListener)||void 0===t?void 0:t.call(e,e=>{let{value:t}=e;V(t<=.1?"box-none":"none")});return()=>{var e,t;n&&(null===(e=A.progress.next)||void 0===e||null===(t=e.removeListener)||void 0===t||t.call(e,n))}},[j,A.progress.next]);const{presentation:H,animationEnabled:z,cardOverlay:U,cardOverlayEnabled:G,cardShadowEnabled:W,cardStyle:Y,cardStyleInterpolator:$,gestureDirection:X,gestureEnabled:q,gestureResponseDistance:Z,gestureVelocityImpact:K,headerMode:Q,headerShown:J,transitionSpec:ee}=A.descriptor.options,te=l({route:A.descriptor.route});let ne;if(te){const{options:e,route:t}=te.descriptor;ne=QZ(e,t.name)}const ie=M.useMemo(()=>void 0!==ne?{title:ne}:void 0,[ne]);return M.createElement(AQ,{interpolationIndex:t,gestureDirection:X,layout:g,insets:F,gesture:a,current:A.progress.current,next:A.progress.next,closing:r,onOpen:()=>{const{route:e}=A.descriptor;k({route:e},!1),v({route:e})},onClose:()=>{const{route:e}=A.descriptor;k({route:e},!0),y({route:e})},overlay:U,overlayEnabled:G,shadowEnabled:W,onTransition:e=>{let{closing:t,gesture:n}=e;const{route:r}=A.descriptor;n?i&&t?null==N||N(!1):null==D||D():null==N||N(!0),null==C||C({route:r},t)},onGestureBegin:()=>{const{route:e}=A.descriptor;P(),w({route:e})},onGestureCanceled:()=>{const{route:e}=A.descriptor;D(),b({route:e})},onGestureEnd:()=>{const{route:e}=A.descriptor;S({route:e})},gestureEnabled:0!==n&&q,gestureResponseDistance:Z,gestureVelocityImpact:K,transitionSpec:ee,styleInterpolator:$,accessibilityElementsHidden:!o,importantForAccessibility:o?"auto":"no-hide-descendants",pointerEvents:i?"box-none":j,pageOverflowEnabled:"float"!==Q&&"modal"!==H,headerDarkContent:c,containerStyle:d&&"screen"!==Q?{marginTop:h}:null,contentStyle:[{backgroundColor:"transparentModal"===H?"transparent":B.background},Y],style:[{overflow:i?void 0:"hidden",display:!1!==z||!1!==f||!1===_||o?"flex":"none"},Ei.absoluteFill]},M.createElement(_a,{style:NQ.container},M.createElement(PK.Provider,{value:s},M.createElement(_a,{style:NQ.scene},M.createElement(yK.Provider,{value:ie},M.createElement(rK.Provider,{value:p||!1!==J},M.createElement(vK.Provider,{value:J?h:L??0},I({route:A.descriptor.route}))))),"float"!==Q?E({mode:"screen",layout:g,scenes:[te,A],getPreviousScene:l,getFocusedRoute:u,onContentHeightChange:m}):null)))}const DQ=M.memo(MQ),NQ=Ei.create({container:{flex:1,flexDirection:"column-reverse"},scene:{flex:1}}),FQ=Object.freeze({options:{}}),BQ=(e,t)=>{const{cardStyleInterpolator:n}=e[t].descriptor.options;let i=0;for(let a=t-1;a>=0;a--){var r;if((null===(r=e[a])||void 0===r?void 0:r.descriptor.options.cardStyleInterpolator)!==n)break;i++}return i},jQ=(e,t,n)=>{if(n)return!0;const{cardStyleInterpolator:i}=e.descriptor.options;return LQ(i)&&0!==t},VQ=(e,t,n,i,r,a)=>e.reduce((o,s,l)=>{const{headerStatusBarHeight:u=(n?0:t.top),headerStyle:c}=s.descriptor.options,d=Ei.flatten(c||{}),h="height"in d&&"number"==typeof d.height?d.height:a[s.route.key],m=BQ(e,l),p=jQ(s,m,i);return o[s.route.key]="number"==typeof h?h:KZ(r,p,u),o},{}),HQ=(e,t)=>{const{presentation:n,gestureDirection:i=("modal"===n?YZ.gestureDirection:WZ.gestureDirection)}=(null==t?void 0:t.options)||{};return gQ(e,i)},zQ=(e,t,n)=>{const i=HQ({width:Math.max(1,t.width),height:Math.max(1,t.height)},n);return i>0?e.interpolate({inputRange:[0,i],outputRange:[1,0]}):e.interpolate({inputRange:[i,0],outputRange:[0,1]})};class UQ extends M.Component{static getDerivedStateFromProps(e,t){if(e.routes===t.routes&&e.descriptors===t.descriptors)return null;const n=e.routes.reduce((n,i)=>{const r=e.descriptors[i.key],{animationEnabled:a}=(null==r?void 0:r.options)||{};return n[i.key]=t.gestures[i.key]||new uu.Value(e.openingRouteKeys.includes(i.key)&&!1!==a?HQ(t.layout,r):0),n},{}),i=e.routes.map((i,r,a)=>{const o=a[r-1],s=a[r+1],l=t.scenes[r],u=n[i.key],c=o?n[o.key]:void 0,d=s?n[s.key]:void 0,h=e.descriptors[i.key]||t.descriptors[i.key]||(l?l.descriptor:FQ),m=e.descriptors[null==s?void 0:s.key]||t.descriptors[null==s?void 0:s.key],p=e.descriptors[null==o?void 0:o.key]||t.descriptors[null==o?void 0:o.key],f=r!==a.length-1&&m&&"transparentModal"!==m.options.presentation?m.options:h.options;let _="modal"===f.presentation?YZ:"transparentModal"===f.presentation?GZ:WZ;const{animationEnabled:g="web"!==lr.OS&&"windows"!==lr.OS&&"macos"!==lr.OS,gestureEnabled:y="ios"===lr.OS&&g,gestureDirection:v=_.gestureDirection,transitionSpec:b=_.transitionSpec,cardStyleInterpolator:S=(!1===g?CZ:_.cardStyleInterpolator),headerStyleInterpolator:w=_.headerStyleInterpolator,cardOverlayEnabled:k="ios"!==lr.OS&&"transparentModal"!==f.presentation||LQ(S)}=f,C=h.options.headerMode??("modal"===f.presentation||"transparentModal"===f.presentation||"modal"===(null==m?void 0:m.options.presentation)||"transparentModal"===(null==m?void 0:m.options.presentation)||LQ(S)||"ios"!==lr.OS||void 0!==h.options.header?"screen":"float"),E={route:i,descriptor:{...h,options:{...h.options,animationEnabled:g,cardOverlayEnabled:k,cardStyleInterpolator:S,gestureDirection:v,gestureEnabled:y,headerStyleInterpolator:w,transitionSpec:b,headerMode:C}},progress:{current:zQ(u,t.layout,h),next:d&&"transparentModal"!==(null==m?void 0:m.options.presentation)?zQ(d,t.layout,m):void 0,previous:c?zQ(c,t.layout,p):void 0},__memo:[t.layout,h,m,p,u,d,c]};return l&&E.__memo.every((e,t)=>l.__memo[t]===e)?l:E});return{routes:e.routes,scenes:i,gestures:n,descriptors:e.descriptors,headerHeights:VQ(i,e.insets,e.isParentHeaderShown,e.isParentModal,t.layout,t.headerHeights)}}constructor(e){super(e),this.state={routes:[],scenes:[],gestures:{},layout:TK.initialMetrics.frame,descriptors:this.props.descriptors,headerHeights:{}}}handleLayout=e=>{const{height:t,width:n}=e.nativeEvent.layout,i={width:n,height:t};this.setState((e,r)=>t===e.layout.height&&n===e.layout.width?null:{layout:i,headerHeights:VQ(e.scenes,r.insets,r.isParentHeaderShown,r.isParentModal,i,e.headerHeights)})};handleHeaderLayout=e=>{let{route:t,height:n}=e;this.setState(e=>{let{headerHeights:i}=e;return i[t.key]===n?null:{headerHeights:{...i,[t.key]:n}}})};getFocusedRoute=()=>{const{state:e}=this.props;return e.routes[e.index]};getPreviousScene=e=>{let{route:t}=e;const{getPreviousRoute:n}=this.props,{scenes:i}=this.state,r=n({route:t});if(r){return i.find(e=>e.descriptor.route.key===r.key)}};render(){const{insets:e,state:t,routes:n,closingRouteKeys:i,onOpenRoute:r,onCloseRoute:a,renderHeader:o,renderScene:s,isParentHeaderShown:l,isParentModal:u,onTransitionStart:c,onTransitionEnd:d,onGestureStart:h,onGestureEnd:m,onGestureCancel:p,detachInactiveScreens:f="web"===lr.OS||"android"===lr.OS||"ios"===lr.OS}=this.props,{scenes:_,layout:g,gestures:y,headerHeights:v}=this.state,b=t.routes[t.index],S=v[b.key],w=this.state.scenes.slice(-2).some(e=>{const t=e.descriptor.options??{},{headerMode:n,headerTransparent:i,headerShown:r=!0}=t;return!(!i&&!1!==r&&"screen"!==n)});let k=1;for(let E=_.length-1;E>=0;E--){const{options:e}=_[E].descriptor,{detachPreviousScreen:t="transparentModal"!==e.presentation&&(!LQ(e.cardStyleInterpolator)||E!==fQ(_,e=>{const{cardStyleInterpolator:t}=e.descriptor.options;return t===kZ||"forModalPresentationIOS"===(null==t?void 0:t.name)}))}=e;if(!1===t)k++;else if(E<=_.length-2)break}const C=M.createElement(M.Fragment,{key:"header"},o({mode:"float",layout:g,scenes:_,getPreviousScene:this.getPreviousScene,getFocusedRoute:this.getFocusedRoute,onContentHeightChange:this.handleHeaderLayout,style:[GQ.floating,w&&[{height:S},GQ.absolute]]}));return M.createElement(ZZ,null,w?null:C,M.createElement(SQ,{enabled:f,style:GQ.container,onLayout:this.handleLayout},n.map((t,n,S)=>{var C,E;const I=b.key===t.key,x=y[t.key],T=_[n];let O=1;if(n<S.length-k-1)O=0;else{const e=_[S.length-1],t=n===S.length-1?2:n>=S.length-k?1:0;O=e?e.progress.current.interpolate({inputRange:[0,.99999,1],outputRange:[1,1,t],extrapolate:"clamp"}):1}const{headerShown:R=!0,headerTransparent:A,headerStyle:L,headerTintColor:P,freezeOnBlur:D}=T.descriptor.options,N=e.top,F=e.right,B=e.bottom,j=e.left,V=!1!==R?v[t.key]:0;let H;if(R)if("string"==typeof P)H=pQ(P).isDark();else{const e=Ei.flatten(L);e&&"backgroundColor"in e&&"string"==typeof e.backgroundColor&&(H=!pQ(e.backgroundColor).isDark())}const z=BQ(_,n),U=jQ(T,z,u),G="transparentModal"===(null===(C=_[n+1])||void 0===C?void 0:C.descriptor.options.presentation),W=!1!==(null===(E=_[n+1])||void 0===E?void 0:E.descriptor.options.detachPreviousScreen);return M.createElement(wQ,{key:t.key,style:Ei.absoluteFill,enabled:f,active:O,freezeOnBlur:D,pointerEvents:"box-none"},M.createElement(DQ,{index:n,interpolationIndex:z,modal:U,active:n===S.length-1,focused:I,closing:i.includes(t.key),layout:g,gesture:x,scene:T,safeAreaInsetTop:N,safeAreaInsetRight:F,safeAreaInsetBottom:B,safeAreaInsetLeft:j,onGestureStart:h,onGestureCancel:p,onGestureEnd:m,headerHeight:V,isParentHeaderShown:l,onHeaderHeightChange:this.handleHeaderLayout,getPreviousScene:this.getPreviousScene,getFocusedRoute:this.getFocusedRoute,headerDarkContent:H,hasAbsoluteFloatHeader:w&&!A,renderHeader:o,renderScene:s,onOpenRoute:r,onCloseRoute:a,onTransitionStart:c,onTransitionEnd:d,isNextScreenTransparent:G,detachCurrentScreen:W}))})),w?C:null)}}const GQ=Ei.create({container:{flex:1},absolute:{position:"absolute",top:0,left:0,right:0},floating:{zIndex:1}});function WQ(){return WQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},WQ.apply(this,arguments)}const YQ=DK??_a;class $Q extends M.Component{static getDerivedStateFromProps(e,t){if((e.state.routes===t.previousRoutes||(n=e.state.routes.map(e=>e.key),i=t.previousRoutes.map(e=>e.key),n.length===i.length&&n.every((e,t)=>e===i[t])))&&t.routes.length){let n=t.routes,i=t.previousRoutes,r=e.descriptors,a=t.previousDescriptors;if(e.descriptors!==t.previousDescriptors&&(r=t.routes.reduce((n,i)=>(n[i.key]=e.descriptors[i.key]||t.descriptors[i.key],n),{}),a=e.descriptors),e.state.routes!==t.previousRoutes){const r=e.state.routes.reduce((e,t)=>(e[t.key]=t,e),{});n=t.routes.map(e=>r[e.key]||e),i=e.state.routes}return{routes:n,previousRoutes:i,descriptors:r,previousDescriptors:a}}var n,i;let r=e.state.index<e.state.routes.length-1?e.state.routes.slice(0,e.state.index+1):e.state.routes,{openingRouteKeys:a,closingRouteKeys:o,replacingRouteKeys:s,previousRoutes:l}=t;const u=l[l.length-1],c=r[r.length-1],d=n=>{const i=e.descriptors[n]||t.descriptors[n];return!i||!1!==i.options.animationEnabled};var h;if(u&&u.key!==c.key?l.some(e=>e.key===c.key)?r.some(e=>e.key===u.key)||d(u.key)&&!o.includes(u.key)&&(o=[...o,u.key],a=a.filter(e=>e!==u.key),s=s.filter(e=>e!==u.key),r=[...r,u]):d(c.key)&&!a.includes(c.key)&&(a=[...a,c.key],o=o.filter(e=>e!==c.key),s=s.filter(e=>e!==c.key),r.some(e=>e.key===u.key)||(a=a.filter(e=>e!==u.key),"pop"===(h=c.key,(e.descriptors[h]||t.descriptors[h]).options.animationTypeForReplace??"push")?(o=[...o,u.key],a=a.filter(e=>e!==c.key),r=[...r,u]):(s=[...s,u.key],o=o.filter(e=>e!==u.key),r=r.slice(),r.splice(r.length-1,0,u)))):(s.length||o.length)&&(r=r.slice(),r.splice(r.length-1,0,...t.routes.filter(e=>{let{key:t}=e;return!!d(t)&&(s.includes(t)||o.includes(t))}))),!r.length)throw new Error("There should always be at least one route in the navigation state.");const m=r.reduce((n,i)=>(n[i.key]=e.descriptors[i.key]||t.descriptors[i.key],n),{});return{routes:r,previousRoutes:e.state.routes,previousDescriptors:e.descriptors,openingRouteKeys:a,closingRouteKeys:o,replacingRouteKeys:s,descriptors:m}}state={routes:[],previousRoutes:[],previousDescriptors:{},openingRouteKeys:[],closingRouteKeys:[],replacingRouteKeys:[],descriptors:{}};getPreviousRoute=e=>{let{route:t}=e;const{closingRouteKeys:n,replacingRouteKeys:i}=this.state,r=this.state.routes.filter(e=>e.key===t.key||!n.includes(e.key)&&!i.includes(e.key)),a=r.findIndex(e=>e.key===t.key);return r[a-1]};renderScene=e=>{let{route:t}=e;const n=this.state.descriptors[t.key]||this.props.descriptors[t.key];return n?n.render():null};renderHeader=e=>M.createElement(GK,e);handleOpenRoute=e=>{let{route:t}=e;const{state:n,navigation:i}=this.props,{closingRouteKeys:r,replacingRouteKeys:a}=this.state;r.some(e=>e===t.key)&&a.every(e=>e!==t.key)&&n.routeNames.includes(t.name)&&!n.routes.some(e=>e.key===t.key)?i.navigate(t):this.setState(e=>({routes:e.replacingRouteKeys.length?e.routes.filter(t=>!e.replacingRouteKeys.includes(t.key)):e.routes,openingRouteKeys:e.openingRouteKeys.filter(e=>e!==t.key),closingRouteKeys:e.closingRouteKeys.filter(e=>e!==t.key),replacingRouteKeys:[]}))};handleCloseRoute=e=>{let{route:t}=e;const{state:n,navigation:i}=this.props;n.routes.some(e=>e.key===t.key)?i.dispatch({...Am.pop(),source:t.key,target:n.key}):this.setState(e=>({routes:e.routes.filter(e=>e.key!==t.key),openingRouteKeys:e.openingRouteKeys.filter(e=>e!==t.key),closingRouteKeys:e.closingRouteKeys.filter(e=>e!==t.key)}))};handleTransitionStart=(e,t)=>{let{route:n}=e;return this.props.navigation.emit({type:"transitionStart",data:{closing:t},target:n.key})};handleTransitionEnd=(e,t)=>{let{route:n}=e;return this.props.navigation.emit({type:"transitionEnd",data:{closing:t},target:n.key})};handleGestureStart=e=>{let{route:t}=e;this.props.navigation.emit({type:"gestureStart",target:t.key})};handleGestureEnd=e=>{let{route:t}=e;this.props.navigation.emit({type:"gestureEnd",target:t.key})};handleGestureCancel=e=>{let{route:t}=e;this.props.navigation.emit({type:"gestureCancel",target:t.key})};render(){const{state:e,descriptors:t,...n}=this.props,{routes:i,descriptors:r,openingRouteKeys:a,closingRouteKeys:o}=this.state;return M.createElement(YQ,{style:XQ.container},M.createElement(TK,null,M.createElement(uH.Consumer,null,t=>M.createElement(PK.Consumer,null,s=>M.createElement(rK.Consumer,null,l=>M.createElement(UQ,WQ({insets:t,isParentHeaderShown:l,isParentModal:s,getPreviousRoute:this.getPreviousRoute,routes:i,openingRouteKeys:a,closingRouteKeys:o,onOpenRoute:this.handleOpenRoute,onCloseRoute:this.handleCloseRoute,onTransitionStart:this.handleTransitionStart,onTransitionEnd:this.handleTransitionEnd,renderHeader:this.renderHeader,renderScene:this.renderScene,state:e,descriptors:r,onGestureStart:this.handleGestureStart,onGestureEnd:this.handleGestureEnd,onGestureCancel:this.handleGestureCancel},n)))))))}}const XQ=Ei.create({container:{flex:1}});function qQ(){return qQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},qQ.apply(this,arguments)}const ZQ=tp(function(e){let{id:t,initialRouteName:n,children:i,screenListeners:r,screenOptions:a,...o}=e;const s=o.mode;WH(null!=s,`Stack Navigator: 'mode="${s}"' is deprecated. Use 'presentation: "${s}"' in 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/stack-navigator#presentation for more details.`);const l=o.headerMode;WH("none"===l,"Stack Navigator: 'headerMode=\"none\"' is deprecated. Use 'headerShown: false' in 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/stack-navigator/#headershown for more details."),WH(null!=l&&"none"!==l,"Stack Navigator: 'headerMode' is moved to 'options'. Moved it to 'screenOptions' to keep current behavior.\n\nSee https://reactnavigation.org/docs/stack-navigator/#headermode for more details.");const u=o.keyboardHandlingEnabled;WH(void 0!==u,"Stack Navigator: 'keyboardHandlingEnabled' is moved to 'options'. Moved it to 'screenOptions' to keep current behavior.\n\nSee https://reactnavigation.org/docs/stack-navigator/#keyboardhandlingenabled for more details.");const c={presentation:s,headerShown:!l||"none"!==l,headerMode:l&&"none"!==l?l:void 0,keyboardHandlingEnabled:u},{state:d,descriptors:h,navigation:m,NavigationContent:p}=cf(Lm,{id:t,initialRouteName:n,children:i,screenListeners:r,screenOptions:a,defaultScreenOptions:c});return M.useEffect(()=>{var e;return null===(e=m.addListener)||void 0===e?void 0:e.call(m,"tabPress",e=>{const t=m.isFocused();requestAnimationFrame(()=>{d.index>0&&t&&!e.defaultPrevented&&m.dispatch({...Am.popToTop(),target:d.key})})})},[m,d.index,d.key]),M.createElement(p,null,M.createElement($Q,qQ({},o,{state:d,descriptors:h,navigation:m})))});async function KQ(e){return e?e.startsWith("data:image/svg+xml;utf8")&&"android"===lr.OS?function(e){try{return decodeURIComponent(e).split(",").slice(1).join(",")}catch(t){throw new Error(`Decoding ${e} failed with error: ${t}`)}}(e):e.startsWith("data:image/svg+xml;base64")?QQ(e):async function(e){const t=await fetch(e);if(t.ok||0===t.status&&e.startsWith("file://"))return await t.text();throw new Error(`Fetching ${e} failed with status ${t.status}`)}(e):null}const QQ=e=>{const t=decodeURIComponent(e).split(";")[1].split(","),n=t[0],i=t.slice(1).join(",");return Wz.Buffer.from(i,n).toString("utf-8")};const JQ=e=>e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),eJ=e=>{if(e){if(1===e.nodeType&&"function"==typeof e.getBoundingClientRect)return e.getBoundingClientRect()}throw new Error("Can not get boundingClientRect of "+e||"undefined")};function tJ(){const e=this.state.touchable.responderID;null!==e&&((e,t)=>{const n=null==e?void 0:e.parentNode;n&&setTimeout(()=>{const i=eJ(n),{height:r,left:a,top:o,width:s}=eJ(e),l=a-i.left,u=o-i.top;t(l,u,s,r,a,o)},0)})(e,this._handleQueryLayout)}function nJ(e){return!!(e.onPress||e.onPressIn||e.onPressOut||e.onLongPress)}var iJ,rJ,aJ,oJ,sJ,lJ;function uJ(e,t){const n=[];if(t&&n.push(...cJ(t)),Array.isArray(e))if("number"==typeof e[0])n.push(`matrix(${e.join(" ")})`);else{const t=function(e){const t={};return null==e||e.forEach(e=>{const n=Object.keys(e);1!==n.length&&console.error("You must specify exactly one property per transform object.");const i=n[0],r=e[i];t[i]=r}),t}(e);n.push(...cJ(t))}else"string"==typeof e&&n.push(e);return n.length?n.join(" "):void 0}function cJ(e){const t=[];return null!=e.translate&&t.push(`translate(${e.translate})`),null==e.translateX&&null==e.translateY||t.push(`translate(${e.translateX||0}, ${e.translateY||0})`),null!=e.scale&&t.push(`scale(${e.scale})`),null==e.scaleX&&null==e.scaleY||t.push(`scale(${e.scaleX||1}, ${e.scaleY||1})`),null!=e.rotation&&t.push(`rotate(${e.rotation})`),null!=e.skewX&&t.push(`skewX(${e.skewX})`),null!=e.skewY&&t.push(`skewY(${e.skewY})`),t}!function(){if(rJ)return iJ;function e(t,n,i,r){this.message=t,this.expected=n,this.found=i,this.location=r,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}rJ=1,function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(e,Error),e.buildMessage=function(e,t){var n,i={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var t,n="";for(t=0;t<e.parts.length;t++)n+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return"["+(e.inverted?"^":"")+n+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function s(e){return i[e.type](e)}return"Expected "+function(e){var t,n,i=new Array(e.length);for(t=0;t<e.length;t++)i[t]=s(e[t]);if(i.sort(),i.length>0){for(t=1,n=1;t<i.length;t++)i[t-1]!==i[t]&&(i[n]=i[t],n++);i.length=n}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+(((n=t)?'"'+a(n)+'"':"end of input")+" found.")},iJ={SyntaxError:e,parse:function(t,n){n=void 0!==n?n:{};var i,r={},a={transformList:ue},o=ue,s=function(e){return e},l=function(e,t){return function(e,t){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=t[0],u=t[1],c=t[2],d=t[3],h=t[4],m=t[5],p=n*c+i*m+r,f=a*u+o*h;return[n*l+i*d,n*u+i*h,p,a*l+o*d,f,a*c+o*m+s]}(e,t)},u="matrix",c=re("matrix",!1),d="(",h=re("(",!1),m=")",p=re(")",!1),f=function(e,t,n,i,r,a){return[e,n,r,t,i,a]},_="translate",g=re("translate",!1),y=function(e,t){return[1,0,e,0,1,t||0]},v="scale",b=re("scale",!1),S=function(e,t){return[e,0,0,0,null===t?e:t,0]},w="rotate",k=re("rotate",!1),C=function(e,t){var n=Math.cos(Ce*e),i=Math.sin(Ce*e);if(null!==t){var r=t[0],a=t[1];return[n,-i,n*-r+-i*-a+r,i,n,i*-r+n*-a+a]}return[n,-i,0,i,n,0]},E="skewX",I=re("skewX",!1),x=function(e){return[1,Math.tan(Ce*e),0,0,1,0]},T="skewY",O=re("skewY",!1),R=function(e){return[1,0,0,Math.tan(Ce*e),1,0]},A=function(e){return parseFloat(e.join(""))},L=function(e){return parseInt(e.join(""))},P=function(e){return e},M=function(e,t){return[e,t]},D=",",N=re(",",!1),F=function(e){return e.join("")},B=function(e){return e.join("")},j=function(e){return e.join("")},V={type:"other",description:"fractionalConstant"},H=".",z=re(".",!1),U=function(e,t){return[e?e.join(""):null,".",t.join("")].join("")},G=/^[eE]/,W=ae(["e","E"],!1,!1),Y=function(e){return[e[0],e[1],e[2].join("")].join("")},$=/^[+\-]/,X=ae(["+","-"],!1,!1),q=/^[0-9]/,Z=ae([["0","9"]],!1,!1),K=/^[ \t\r\n]/,Q=ae([" ","\t","\r","\n"],!1,!1),J=0,ee=[{line:1,column:1}],te=0,ne=[],ie=0;if("startRule"in n){if(!(n.startRule in a))throw new Error("Can't start parsing from rule \""+n.startRule+'".');o=a[n.startRule]}function re(e,t){return{type:"literal",text:e,ignoreCase:t}}function ae(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function oe(e){var n,i=ee[e];if(i)return i;for(n=e-1;!ee[n];)n--;for(i={line:(i=ee[n]).line,column:i.column};n<e;)10===t.charCodeAt(n)?(i.line++,i.column=1):i.column++,n++;return ee[e]=i,i}function se(e,t){var n=oe(e),i=oe(t);return{start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:i.line,column:i.column}}}function le(e){J<te||(J>te&&(te=J,ne=[]),ne.push(e))}function ue(){var e,t,n,i,a;for(e=J,t=[],n=be();n!==r;)t.push(n),n=be();if(t!==r)if((n=ce())===r&&(n=null),n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();i!==r?e=t=s(n):(J=e,e=r)}else J=e,e=r;else J=e,e=r;return e}function ce(){var e,t,n,i;if(e=J,(t=de())!==r){for(n=[],i=pe();i!==r;)n.push(i),i=pe();n!==r&&(i=ce())!==r?e=t=l(t,i):(J=e,e=r)}else J=e,e=r;return e===r&&(e=de()),e}function de(){var e;return(e=function(){var e,n,i,a,o,s,l,_,g,y,v,b,S;e=J,t.substr(J,6)===u?(n=u,J+=6):(n=r,0===ie&&le(c));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r)if(pe()!==r)if((l=he())!==r)if(pe()!==r)if((_=he())!==r)if(pe()!==r)if((g=he())!==r)if(pe()!==r)if((y=he())!==r)if(pe()!==r)if((v=he())!==r){for(b=[],S=be();S!==r;)b.push(S),S=be();b!==r?(41===t.charCodeAt(J)?(S=m,J++):(S=r,0===ie&&le(p)),S!==r?e=n=f(s,l,_,g,y,v):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}())===r&&(e=function(){var e,n,i,a,o,s,l,u,c;e=J,t.substr(J,9)===_?(n=_,J+=9):(n=r,0===ie&&le(g));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r)if((l=me())===r&&(l=null),l!==r){for(u=[],c=be();c!==r;)u.push(c),c=be();u!==r?(41===t.charCodeAt(J)?(c=m,J++):(c=r,0===ie&&le(p)),c!==r?e=n=y(s,l):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}())===r&&(e=function(){var e,n,i,a,o,s,l,u,c;e=J,t.substr(J,5)===v?(n=v,J+=5):(n=r,0===ie&&le(b));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r)if((l=me())===r&&(l=null),l!==r){for(u=[],c=be();c!==r;)u.push(c),c=be();u!==r?(41===t.charCodeAt(J)?(c=m,J++):(c=r,0===ie&&le(p)),c!==r?e=n=S(s,l):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}())===r&&(e=function(){var e,n,i,a,o,s,l,u,c;e=J,t.substr(J,6)===w?(n=w,J+=6):(n=r,0===ie&&le(k));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r)if(l=function(){var e,t,n,i;e=J,t=pe(),t!==r&&(n=he())!==r&&pe()!==r&&(i=he())!==r?e=t=M(n,i):(J=e,e=r);return e}(),l===r&&(l=null),l!==r){for(u=[],c=be();c!==r;)u.push(c),c=be();u!==r?(41===t.charCodeAt(J)?(c=m,J++):(c=r,0===ie&&le(p)),c!==r?e=n=C(s,l):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}())===r&&(e=function(){var e,n,i,a,o,s,l,u;e=J,t.substr(J,5)===E?(n=E,J+=5):(n=r,0===ie&&le(I));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r){for(l=[],u=be();u!==r;)l.push(u),u=be();l!==r?(41===t.charCodeAt(J)?(u=m,J++):(u=r,0===ie&&le(p)),u!==r?e=n=x(s):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}())===r&&(e=function(){var e,n,i,a,o,s,l,u;e=J,t.substr(J,5)===T?(n=T,J+=5):(n=r,0===ie&&le(O));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r){for(l=[],u=be();u!==r;)l.push(u),u=be();l!==r?(41===t.charCodeAt(J)?(u=m,J++):(u=r,0===ie&&le(p)),u!==r?e=n=R(s):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}()),e}function he(){var e,n,i,a;return e=J,n=J,(i=ge())===r&&(i=null),i!==r?(a=function(){var e,n,i,a;e=J,n=J,i=function(){var e,n,i,a;ie++,e=J,n=ye(),n===r&&(n=null);n!==r?(46===t.charCodeAt(J)?(i=H,J++):(i=r,0===ie&&le(z)),i!==r&&(a=ye())!==r?e=n=U(n,a):(J=e,e=r)):(J=e,e=r);e===r&&(e=J,(n=ye())!==r?(46===t.charCodeAt(J)?(i=H,J++):(i=r,0===ie&&le(z)),i!==r?e=n=j(n):(J=e,e=r)):(J=e,e=r));ie--,e===r&&(n=r,0===ie&&le(V));return e}(),i!==r?((a=_e())===r&&(a=null),a!==r?n=i=[i,a]:(J=n,n=r)):(J=n,n=r);n!==r&&(n=B(n));e=n,e===r&&(e=J,n=J,(i=ye())!==r&&(a=_e())!==r?n=i=[i,a]:(J=n,n=r),n!==r&&(n=j(n)),e=n);return e}(),a!==r?n=i=[i,a]:(J=n,n=r)):(J=n,n=r),n!==r&&(n=A(n)),(e=n)===r&&(e=J,n=J,(i=ge())===r&&(i=null),i!==r?(a=function(){var e,t;e=J,t=ye(),t!==r&&(t=F(t));return e=t,e}(),a!==r?n=i=[i,a]:(J=n,n=r)):(J=n,n=r),n!==r&&(n=L(n)),e=n),e}function me(){var e,t;return e=J,pe()!==r&&(t=he())!==r?e=P(t):(J=e,e=r),e}function pe(){var e,t,n,i,a;if(e=J,t=[],(n=be())!==r)for(;n!==r;)t.push(n),n=be();else t=r;if(t!==r)if((n=fe())===r&&(n=null),n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();i!==r?e=t=[t,n,i]:(J=e,e=r)}else J=e,e=r;else J=e,e=r;if(e===r)if(e=J,(t=fe())!==r){for(n=[],i=be();i!==r;)n.push(i),i=be();n!==r?e=t=[t,n]:(J=e,e=r)}else J=e,e=r;return e}function fe(){var e;return 44===t.charCodeAt(J)?(e=D,J++):(e=r,0===ie&&le(N)),e}function _e(){var e,n,i,a;return e=J,G.test(t.charAt(J))?(n=t.charAt(J),J++):(n=r,0===ie&&le(W)),n!==r?((i=ge())===r&&(i=null),i!==r&&(a=ye())!==r?e=n=[n,i,a]:(J=e,e=r)):(J=e,e=r),e!==r&&(e=Y(e)),e}function ge(){var e;return $.test(t.charAt(J))?(e=t.charAt(J),J++):(e=r,0===ie&&le(X)),e}function ye(){var e,t;if(e=[],(t=ve())!==r)for(;t!==r;)e.push(t),t=ve();else e=r;return e}function ve(){var e;return q.test(t.charAt(J))?(e=t.charAt(J),J++):(e=r,0===ie&&le(Z)),e}function be(){var e;return K.test(t.charAt(J))?(e=t.charAt(J),J++):(e=r,0===ie&&le(Q)),e}var Se,we,ke,Ce=Math.PI/180;if((i=o())!==r&&J===t.length)return i;throw i!==r&&J<t.length&&le({type:"end"}),Se=ne,we=te<t.length?t.charAt(te):null,ke=te<t.length?se(te,te+1):se(te,te),new e(e.buildMessage(Se,we),Se,we,ke)}}}(),function(){if(oJ)return aJ;function e(t,n,i,r){var a=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(a,e.prototype),a.expected=n,a.found=i,a.location=r,a.name="SyntaxError",a}function t(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}oJ=1,function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(e,Error),e.prototype.format=function(e){var n="Error: "+this.message;if(this.location){var i,r=null;for(i=0;i<e.length;i++)if(e[i].source===this.location.source){r=e[i].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(a):a,s=this.location.source+":"+o.line+":"+o.column;if(r){var l=this.location.end,u=t("",o.line.toString().length," "),c=r[a.line-1],d=(a.line===l.line?l.column:c.length+1)-a.column||1;n+="\n --\x3e "+s+"\n"+u+" |\n"+o.line+" | "+c+"\n"+u+" | "+t("",a.column-1," ")+t("",d,"^")}else n+="\n at "+s}return n},e.buildMessage=function(e,t){var n,i={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var t=e.parts.map(function(e){return Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e)});return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function s(e){return i[e.type](e)}return"Expected "+function(e){var t,n,i=e.map(s);if(i.sort(),i.length>0){for(t=1,n=1;t<i.length;t++)i[t-1]!==i[t]&&(i[n]=i[t],n++);i.length=n}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+(((n=t)?'"'+a(n)+'"':"end of input")+" found.")},aJ={StartRules:["start"],SyntaxError:e,parse:function(t,n){var i,r,a,o,s={},l=(n=void 0!==n?n:{}).grammarSource,u={start:_e},c=_e,d="matrix(",h=")",m="translate(",p="scale(",f="rotate(",_="skewX(",g="skewY(",y=".",v="e",b=/^[ \t\n\r,]/,S=/^[ \t\n\r]/,w=/^[+\-]/,k=/^[0-9]/,C=he("transform functions"),E=he("transformFunctions"),I=he("transform function"),x=he("matrix"),T=ce("matrix(",!1),O=ce(")",!1),R=he("translate"),A=ce("translate(",!1),L=he("scale"),P=ce("scale(",!1),M=he("rotate"),D=ce("rotate(",!1),N=he("x, y"),F=he("skewX"),B=ce("skewX(",!1),j=he("skewY"),V=ce("skewY(",!1),H=he("space or comma"),z=de([" ","\t","\n","\r",","],!1,!1),U=he("whitespace"),G=de([" ","\t","\n","\r"],!1,!1),W=de(["+","-"],!1,!1),Y=de([["0","9"]],!1,!1),$=ce(".",!1),X=ce("e",!1),q=function(e,t){const n=Array.isArray(e)?e:[e];return t.forEach(e=>{Array.isArray(e[1])?n.push(...e[1]):n.push(e[1])}),n},Z=function(e,t,n,i,r,a,o,s,l){return{matrix:[e,t,n,i,r,a,o,s,l]}},K=function(e,t){return null==t?{translate:e}:{translate:[e,t]}},Q=function(e,t){return null==t?{scale:e}:[{scaleX:e},{scaleY:t}]},J=function(e,t){return null!==t?{rotate:`${e}deg`}:[{rotate:`${e}deg`}]},ee=function(e,t){return[e,t]},te=function(e){return[{skewX:`${e}deg`}]},ne=function(e){return[{skewY:`${e}deg`}]},ie=function(){return parseFloat(t.substring(ae,re))},re=0|n.peg$currPos,ae=re,oe=[{line:1,column:1}],se=re,le=n.peg$maxFailExpected||[],ue=0|n.peg$silentFails;if(n.startRule){if(!(n.startRule in u))throw new Error("Can't start parsing from rule \""+n.startRule+'".');c=u[n.startRule]}function ce(e,t){return{type:"literal",text:e,ignoreCase:t}}function de(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function he(e){return{type:"other",description:e}}function me(e){var n,i=oe[e];if(i)return i;if(e>=oe.length)n=oe.length-1;else for(n=e;!oe[--n];);for(i={line:(i=oe[n]).line,column:i.column};n<e;)10===t.charCodeAt(n)?(i.line++,i.column=1):i.column++,n++;return oe[e]=i,i}function pe(e,t,n){var i=me(e),r=me(t);return{source:l,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:r.line,column:r.column}}}function fe(e){re<se||(re>se&&(se=re,le=[]),le.push(e))}function _e(){var e;return ue++,e=function(){var e,t,n,i,r,a;if(ue++,e=re,(t=ge())!==s){for(n=[],i=re,r=ve(),(a=ge())!==s?i=r=[r,a]:(re=i,i=s);i!==s;)n.push(i),i=re,r=ve(),(a=ge())!==s?i=r=[r,a]:(re=i,i=s);ae=e,e=q(t,n)}else re=e,e=s;ue--,e===s&&(t=s,0===ue&&fe(E));return e}(),ue--,e===s&&0===ue&&fe(C),e}function ge(){var e;return ue++,(e=function(){var e,n,i,r,a,o,l,u,c,m,p,f;ue++,e=re,ve(),t.substr(re,7)===d?(n=d,re+=7):(n=s,0===ue&&fe(T));n!==s?(ve(),(i=be())!==s?(ye(),(r=be())!==s?(ye(),(a=be())!==s?(ye(),(o=be())!==s?(ye(),(l=be())!==s?(ye(),(u=be())!==s?(ye(),(c=be())!==s?(ye(),(m=be())!==s?(ye(),(p=be())!==s?(ve(),41===t.charCodeAt(re)?(f=h,re++):(f=s,0===ue&&fe(O)),f!==s?(ve(),ae=e,e=Z(i,r,a,o,l,u,c,m,p)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(x);return e}())===s&&(e=function(){var e,n,i,r,a;ue++,e=re,ve(),t.substr(re,10)===m?(n=m,re+=10):(n=s,0===ue&&fe(A));n!==s?(ve(),(i=be())!==s?(ye(),(r=be())===s&&(r=null),ve(),41===t.charCodeAt(re)?(a=h,re++):(a=s,0===ue&&fe(O)),a!==s?(ve(),ae=e,e=K(i,r)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(R);return e}())===s&&(e=function(){var e,n,i,r,a;ue++,e=re,ve(),t.substr(re,6)===p?(n=p,re+=6):(n=s,0===ue&&fe(P));n!==s?(ve(),(i=be())!==s?(ye(),(r=be())===s&&(r=null),ve(),41===t.charCodeAt(re)?(a=h,re++):(a=s,0===ue&&fe(O)),a!==s?(ve(),ae=e,e=Q(i,r)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(L);return e}())===s&&(e=function(){var e,n,i,r,a;ue++,e=re,ve(),t.substr(re,7)===f?(n=f,re+=7):(n=s,0===ue&&fe(D));n!==s?(ve(),(i=be())!==s?(r=function(){var e,t,n;ue++,e=re,ye(),t=be(),t!==s?(ye(),(n=be())!==s?(ae=e,e=ee(t,n)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(N);return e}(),r===s&&(r=null),ve(),41===t.charCodeAt(re)?(a=h,re++):(a=s,0===ue&&fe(O)),a!==s?(ve(),ae=e,e=J(i,r)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(M);return e}())===s&&(e=function(){var e,n,i,r;ue++,e=re,ve(),t.substr(re,6)===_?(n=_,re+=6):(n=s,0===ue&&fe(B));n!==s?(ve(),(i=be())!==s?(ve(),41===t.charCodeAt(re)?(r=h,re++):(r=s,0===ue&&fe(O)),r!==s?(ve(),ae=e,e=te(i)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(F);return e}())===s&&(e=function(){var e,n,i,r;ue++,e=re,ve(),t.substr(re,6)===g?(n=g,re+=6):(n=s,0===ue&&fe(V));n!==s?(ve(),(i=be())!==s?(ve(),41===t.charCodeAt(re)?(r=h,re++):(r=s,0===ue&&fe(O)),r!==s?(ve(),ae=e,e=ne(i)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(j);return e}()),ue--,e===s&&0===ue&&fe(I),e}function ye(){var e,n;for(ue++,e=[],n=t.charAt(re),b.test(n)?re++:(n=s,0===ue&&fe(z));n!==s;)e.push(n),n=t.charAt(re),b.test(n)?re++:(n=s,0===ue&&fe(z));return ue--,n=s,0===ue&&fe(H),e}function ve(){var e,n;for(ue++,e=[],n=t.charAt(re),S.test(n)?re++:(n=s,0===ue&&fe(G));n!==s;)e.push(n),n=t.charAt(re),S.test(n)?re++:(n=s,0===ue&&fe(G));return ue--,n=s,0===ue&&fe(U),e}function be(){var e,n,i,r,a,o,l,u;for(e=re,n=t.charAt(re),w.test(n)?re++:(n=s,0===ue&&fe(W)),n===s&&(n=null),i=re,r=[],a=t.charAt(re),k.test(a)?re++:(a=s,0===ue&&fe(Y));a!==s;)r.push(a),a=t.charAt(re),k.test(a)?re++:(a=s,0===ue&&fe(Y));if(46===t.charCodeAt(re)?(a=y,re++):(a=s,0===ue&&fe($)),a!==s){if(o=[],l=t.charAt(re),k.test(l)?re++:(l=s,0===ue&&fe(Y)),l!==s)for(;l!==s;)o.push(l),l=t.charAt(re),k.test(l)?re++:(l=s,0===ue&&fe(Y));else o=s;o!==s?i=r=[r,a,o]:(re=i,i=s)}else re=i,i=s;if(i===s)if(i=[],r=t.charAt(re),k.test(r)?re++:(r=s,0===ue&&fe(Y)),r!==s)for(;r!==s;)i.push(r),r=t.charAt(re),k.test(r)?re++:(r=s,0===ue&&fe(Y));else i=s;if(i!==s){if(r=re,101===t.charCodeAt(re)?(a=v,re++):(a=s,0===ue&&fe(X)),a!==s){if(o=t.charAt(re),w.test(o)?re++:(o=s,0===ue&&fe(W)),o===s&&(o=null),l=[],u=t.charAt(re),k.test(u)?re++:(u=s,0===ue&&fe(Y)),u!==s)for(;u!==s;)l.push(u),u=t.charAt(re),k.test(u)?re++:(u=s,0===ue&&fe(Y));else l=s;l!==s?r=a=[a,o,l]:(re=r,r=s)}else re=r,r=s;r===s&&(r=null),ae=e,e=ie()}else re=e,e=s;return e}if(i=c(),n.peg$library)return{peg$result:i,peg$currPos:re,peg$FAILED:s,peg$maxFailExpected:le,peg$maxFailPos:se};if(i!==s&&re===t.length)return i;throw i!==s&&re<t.length&&fe({type:"end"}),r=le,a=se<t.length?t.charAt(se):null,o=se<t.length?pe(se,se+1):pe(se,se),new e(e.buildMessage(r,a),r,a,o)}}}();var dJ=function(){if(lJ)return sJ;lJ=1;const e=[];return sJ={registerAsset:function(t){return e.push(t)},getAssetByID:function(t){return e[t-1]}}}();const hJ=/^(data:image\/svg\+xml;utf8,)(.*)/;const mJ=(e,t=e.props)=>{const{transform:n,origin:i,originX:r,originY:a,fontFamily:o,fontSize:s,fontWeight:l,fontStyle:u,style:c,forwardedRef:d,gradientTransform:h,patternTransform:m,onPress:p,...f}=t,_={...nJ(t)?{onStartShouldSetResponder:e.touchableHandleStartShouldSetResponder,onResponderTerminationRequest:e.touchableHandleResponderTerminationRequest,onResponderGrant:e.touchableHandleResponderGrant,onResponderMove:e.touchableHandleResponderMove,onResponderRelease:e.touchableHandleResponderRelease,onResponderTerminate:e.touchableHandleResponderTerminate}:null,...f};null!=i?_["transform-origin"]=i.toString().replace(","," "):null==r&&null==a||(_["transform-origin"]=`${r||0} ${a||0}`);const g=uJ(n,t);g&&(_.transform=g);const y=uJ(h);y&&(_.gradientTransform=y);const v=uJ(m);v&&(_.patternTransform=v),_.ref=t=>{e.elementRef.current=t,"function"==typeof d?d(t):d&&(d.current=t)};const b={};var S,w,k;(null!=o&&(b.fontFamily=o),null!=s&&(b.fontSize=s),null!=l&&(b.fontWeight=l),null!=u&&(b.fontStyle=u),_.style=(w=b,(S=c)?Ei?[S,w]:S[Symbol.iterator]?Object.assign({},...S,w):Object.assign({},S,w):w),null!==p&&(_.onClick=t.onPress),null!==t.href&&void 0!==t.href)&&(_.href=null===(k=function(e){let t={};if("number"==typeof e){const n=dJ.getAssetByID(e);if(null==n)throw new Error(`Image: asset with ID "${e}" could not be found. Please check the image source or packager.`);if(t={width:n.width,height:n.height,scale:n.scales[0]},n.scales.length>1){const e=Ws.get();t.scale=n.scales.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t)}const i=1!==t.scale?`@${t.scale}x`:"";t.uri=n?`${n.httpServerLocation}/${n.name}${i}.${n.type}`:""}else"string"==typeof e?t.uri=e:e&&!Array.isArray(e)&&"string"==typeof e.uri&&(t.uri=e.uri);if(t.uri){var n;const e=null===(n=t)||void 0===n||null===(n=n.uri)||void 0===n?void 0:n.match(hJ);if(e){const[,n,i]=e,r=encodeURIComponent(i);return t.uri=`${n}${r}`,t}}return t}(t.href))||void 0===k?void 0:k.uri);return _};function pJ(e){return`rgba(${e>>16&255},${e>>8&255},${255&e},${((e>>24&255)/255).toFixed(2)})`}const fJ={top:20,left:20,right:20,bottom:30},{Mixin:_J}=im,{touchableHandleStartShouldSetResponder:gJ,touchableHandleResponderTerminationRequest:yJ,touchableHandleResponderGrant:vJ,touchableHandleResponderMove:bJ,touchableHandleResponderRelease:SJ,touchableHandleResponderTerminate:wJ,touchableGetInitialState:kJ}=_J,CJ={..._J,touchableHandleStartShouldSetResponder(e){const{onStartShouldSetResponder:t}=this.props;return t?t(e):gJ.call(this,e)},touchableHandleResponderTerminationRequest(e){const{onResponderTerminationRequest:t}=this.props;return t?t(e):yJ.call(this,e)},touchableHandleResponderGrant(e){const{onResponderGrant:t}=this.props;return t?t(e):vJ.call(this,e)},touchableHandleResponderMove(e){const{onResponderMove:t}=this.props;return t?t(e):bJ.call(this,e)},touchableHandleResponderRelease(e){const{onResponderRelease:t}=this.props;return t?t(e):SJ.call(this,e)},touchableHandleResponderTerminate(e){const{onResponderTerminate:t}=this.props;return t?t(e):wJ.call(this,e)},touchableHandlePress(e){const{onPress:t}=this.props;t&&t(e)},touchableHandleActivePressIn(e){const{onPressIn:t}=this.props;t&&t(e)},touchableHandleActivePressOut(e){const{onPressOut:t}=this.props;t&&t(e)},touchableHandleLongPress(e){const{onLongPress:t}=this.props;t&&t(e)},touchableGetPressRectOffset(){const{pressRetentionOffset:e}=this.props;return e||fJ},touchableGetHitSlop(){const{hitSlop:e}=this.props;return e},touchableGetHighlightDelayMS(){const{delayPressIn:e}=this.props;return e||0},touchableGetLongPressDelayMS(){const{delayLongPress:e}=this.props;return 0===e?0:e||500},touchableGetPressOutDelayMS(){const{delayPressOut:e}=this.props;return e||0}},EJ=Object.keys(CJ),IJ=EJ.map(e=>CJ[e]),xJ=EJ.length;class TJ extends D.Component{prepareProps(e){return e}elementRef=D.createRef();lastMergedProps={};setNativeProps(e){const t=Object.assign({},this.props,this.lastMergedProps,e.style);this.lastMergedProps=t;const n=mJ(this,this.prepareProps(t)),i=this.elementRef.current;if(i)for(const r of Object.keys(n)){const e=n[r];switch(r){case"ref":case"children":break;case"style":for(const e of[].concat(n.style??[]))Object.assign(i.style,e);break;case"fill":if(e&&"object"==typeof e){const t=e;i.setAttribute("fill",pJ(t.payload))}break;case"stroke":if(e&&"object"==typeof e){const t=e;i.setAttribute("stroke",pJ(t.payload))}break;default:i.setAttribute(JQ(r),e)}}}constructor(e){super(e),nJ(e)&&(e=>{for(let t=0;t<xJ;t++){const n=EJ[t],i=IJ[t];e[n]="function"==typeof i?i.bind(e):i}e.state=kJ()})(this),this._remeasureMetricsOnActivation=tJ.bind(this)}render(){if(!this.tag)throw new Error("When extending `WebShape` you need to overwrite either `tag` or `render`!");return this.lastMergedProps={},Ui(this.tag,mJ(this,this.prepareProps(this.props)))}}class OJ extends TJ{tag="circle"}class RJ extends TJ{tag="clipPath"}class AJ extends TJ{tag="defs"}class LJ extends TJ{tag="ellipse"}class PJ extends TJ{tag="feBlend"}class MJ extends TJ{tag="feColorMatrix"}class DJ extends TJ{tag="feComponentTransfer"}class NJ extends TJ{tag="feComposite"}class FJ extends TJ{tag="feConvolveMatrix"}class BJ extends TJ{tag="feDiffuseLighting"}class jJ extends TJ{tag="feDisplacementMap"}class VJ extends TJ{tag="feDistantLight"}class HJ extends TJ{tag="feDropShadow"}class zJ extends TJ{tag="feFlood"}class UJ extends TJ{tag="feGaussianBlur"}class GJ extends TJ{tag="feImage"}class WJ extends TJ{tag="feMerge"}class YJ extends TJ{tag="feMergeNode"}class $J extends TJ{tag="feMorphology"}class XJ extends TJ{tag="feOffset"}class qJ extends TJ{tag="fePointLight"}class ZJ extends TJ{tag="feSpecularLighting"}class KJ extends TJ{tag="feSpotLight"}class QJ extends TJ{tag="feTile"}class JJ extends TJ{tag="feTurbulence"}class e1 extends TJ{tag="filter"}class t1 extends TJ{tag="foreignObject"}class n1 extends TJ{tag="g";prepareProps(e){const{x:t,y:n,...i}=e;return!t&&!n||i.translate||(i.translate=`${t||0}, ${n||0}`),i}}class i1 extends TJ{tag="image"}class r1 extends TJ{tag="line"}class a1 extends TJ{tag="linearGradient"}class o1 extends TJ{tag="marker"}class s1 extends TJ{tag="mask"}class l1 extends TJ{tag="path"}class u1 extends TJ{tag="pattern"}class c1 extends TJ{tag="polygon"}class d1 extends TJ{tag="polyline"}class h1 extends TJ{tag="radialGradient"}class m1 extends TJ{tag="rect"}class p1 extends TJ{tag="stop"}class f1 extends TJ{tag="svg";toDataURL(e,t={}){const n=this.elementRef.current;if(null===n)return;const i=eJ(n),r=Number(t.width)||i.width,a=Number(t.height)||i.height,o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox",`0 0 ${i.width} ${i.height}`),o.setAttribute("width",String(r)),o.setAttribute("height",String(a)),o.appendChild(n.cloneNode(!0));const s=new window.Image;var l;s.onload=()=>{const t=document.createElement("canvas");t.width=r,t.height=a;const n=t.getContext("2d");null==n||n.drawImage(s,0,0),e(t.toDataURL().replace("data:image/png;base64,",""))},s.src=`data:image/svg+xml;utf8,${l=(new window.XMLSerializer).serializeToString(o),l.replace("<svg",~l.indexOf("xmlns")?"<svg":'<svg xmlns="http://www.w3.org/2000/svg"').replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/{/g,"%7B").replace(/}/g,"%7D").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}`}}let _1=class extends TJ{tag="symbol"};class g1 extends TJ{tag="tspan"}let y1=class extends TJ{tag="text"};class v1 extends TJ{tag="textPath"}class b1 extends TJ{tag="use"}const S1={circle:OJ,clipPath:RJ,defs:AJ,ellipse:LJ,filter:e1,feBlend:PJ,feColorMatrix:MJ,feComponentTransfer:DJ,feComposite:NJ,feConvolveMatrix:FJ,feDiffuseLighting:BJ,feDisplacementMap:jJ,feDistantLight:VJ,feDropShadow:HJ,feFlood:zJ,feGaussianBlur:UJ,feImage:GJ,feMerge:WJ,feMergeNode:YJ,feMorphology:$J,feOffset:XJ,fePointLight:qJ,feSpecularLighting:ZJ,feSpotLight:KJ,feTile:QJ,feTurbulence:JJ,foreignObject:t1,g:n1,image:i1,line:r1,linearGradient:a1,marker:o1,mask:s1,path:l1,pattern:u1,polygon:c1,polyline:d1,radialGradient:h1,rect:m1,stop:p1,svg:f1,symbol:_1,text:y1,textPath:v1,tspan:g1,use:b1};function w1(){return w1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},w1.apply(null,arguments)}function k1(){return null}function C1({ast:e,override:t}){if(!e)return null;const{props:n,children:i}=e,r=S1.svg;return M.createElement(r,w1({},n,t),i)}const E1=console.error.bind(console);function I1(e){const{onError:t=E1,xml:n,override:i,fallback:r}=e;try{const t=M.useMemo(()=>null!==n?B1(n):null,[n]);return M.createElement(C1,{ast:t,override:i||e})}catch(a){return t(a),r??null}}class x1 extends M.Component{state={ast:null};componentDidMount(){this.parse(this.props.xml)}componentDidUpdate(e){const{xml:t}=this.props;t!==e.xml&&this.parse(t)}parse(t){const{onError:n=E1}=this.props;try{this.setState({ast:t?B1(t):null})}catch(e){const i=e;n({...i,message:`[RNSVG] Couldn't parse SVG, reason: ${i.message}`})}}render(){const{props:e,state:{ast:t}}=this;return M.createElement(C1,{ast:t,override:e.override||e})}}class T1 extends M.Component{state={xml:null};componentDidMount(){this.fetch(this.props.uri)}componentDidUpdate(e){const{uri:t}=this.props;t!==e.uri&&this.fetch(t)}async fetch(t){try{this.setState({xml:t?await KQ(t):null})}catch(e){console.error(e)}}render(){const{props:e,state:{xml:t}}=this;return M.createElement(x1,{xml:t,override:e,onError:e.onError})}}const O1=(e,t)=>t.toUpperCase(),R1=e=>e.replace(/[:-]([a-z])/g,O1);function A1(e,t){if("object"==typeof e){const{Tag:n,props:i,children:r}=e;return null!=i&&i.class&&(i.className=i.class,delete i.class),M.createElement(n,w1({key:t},i),r.map(A1))}return e}function L1(e,t){let n="";for(;t--;)n+=e;return n}const P1=e=>L1(" ",e.length);const M1=/[a-zA-Z0-9:_-]/,D1=/<!--/,N1=/[\s\t\r\n]/,F1=/['"]/;function B1(e,t){const n=e.length;let i,r=null,a=function(){for(;g+1<n&&("<"!==e[g]||!M1.test(e[g+1])&&!D1.test(e.slice(g,g+4)));)g++;return u()},o=null;const s=[];function l(t){const{line:n,column:i,snippet:r}=function(e,t){const n=e.split("\n"),i=n.length;let r=t,a=0;for(;a<i;a++){const{length:e}=n[a];if(!(r>=e))break;r-=e}const o=e.slice(0,t).replace(/^\t+/,P1),s=/(^|\n).*$/.exec(o),l=s&&s[0]||"",u=e.slice(t),c=/.*(\n|$)/.exec(u);return{line:a,column:r,snippet:`${l}${c&&c[0]}\n${L1(" ",l.length)}^`}}(e,g);throw new Error(`${t} (${n}:${i}). If this is valid SVG, it's probably a bug. Please raise an issue\n\n${r}`)}function u(){let t,i="";for(;g<n&&"<"!==(t=e[g]);)i+=t,g+=1;return/\S/.test(i)&&o.push(i),"<"===e[g]?c:u}function c(){const t=e[g];if("?"===t)return u;if("!"===t){const t=g+1;if("--"===e.slice(t,g+3))return d;const n=g+8;if("[CDATA["===e.slice(t,n))return h;if(/doctype/i.test(e.slice(t,n)))return u}if("/"===t)return m;const a=p(),c={},y={tag:a,props:c,children:[],parent:r,Tag:S1[a]||k1};r?o.push(y):i=y,function(t){for(;g<n;){if(!N1.test(e[g]))return;_();const n=p();if(!n)return;let i=!0;_(),"="===e[g]&&(g+=1,_(),i=f(),"id"===n||isNaN(+i)||""===i.trim()||(i=+i)),t[R1(n)]=i}}(c);const{style:v}=c;"string"==typeof v&&(y.styles=v,c.style=function(e){const t={},n=e.split(";").filter(e=>e.trim()),{length:i}=n;for(let r=0;r<i;r++){const e=n[r];if(0!==e.length){const n=e.split(":"),i=n[0],r=n[1];t[R1(i.trim())]=r.trim()}}return t}(v));let b=!1;return"/"===e[g]&&(g+=1,b=!0),">"!==e[g]&&l("Expected >"),b||(r=y,({children:o}=y),s.push(y)),u}function d(){const t=e.indexOf("--\x3e",g);return~t||l("expected --\x3e"),g=t+2,u}function h(){const t=e.indexOf("]]>",g);return~t||l("expected ]]>"),o.push(e.slice(g+7,t)),g=t+2,u}function m(){const t=p();return t||l("Expected tag name"),r&&t!==r.tag&&l(`Expected closing tag </${t}> to match opening tag <${r.tag}>`),_(),">"!==e[g]&&l("Expected >"),s.pop(),r=s[s.length-1],r&&({children:o}=r),u}function p(){let t,i="";for(;g<n&&M1.test(t=e[g]);)i+=t,g+=1;return i}function f(){return F1.test(e[g])?function(){const t=e[g++];let i="",r=!1;for(;g<n;){const n=e[g++];if(n===t&&!r)return i;"\\"!==n||r||(r=!0),i+=r?`\\${n}`:n,r=!1}return i}():function(){let t="";do{const n=e[g];if(" "===n||">"===n||"/"===n)return t;t+=n,g+=1}while(g<n);return t}()}function _(){for(;g<n&&N1.test(e[g]);)g+=1}let g=0;for(;g<n;)a||l("Unexpected character"),a=a(),g+=1;if(a!==u&&l("Unexpected end of input"),i){const e=(t?t(i):i)||i,n=e.children.map(A1),r=e;return r.children=n,r}return null}function j1(e,t){throw Error(`[react-native-svg] You are trying to import a ${t} \`${e}\` that has been moved to a sub-package. Change your import from \`react-native-svg\` to \`react-native-svg/css\`.`)}const V1=Object.freeze(Object.defineProperty({__proto__:null,Circle:OJ,ClipPath:RJ,Defs:AJ,Ellipse:LJ,FeBlend:PJ,FeColorMatrix:MJ,FeComponentTransfer:DJ,FeComposite:NJ,FeConvolveMatrix:FJ,FeDiffuseLighting:BJ,FeDisplacementMap:jJ,FeDistantLight:VJ,FeDropShadow:HJ,FeFlood:zJ,FeFuncA:class extends TJ{tag="feFuncA"},FeFuncB:class extends TJ{tag="feFuncB"},FeFuncG:class extends TJ{tag="feFuncG"},FeFuncR:class extends TJ{tag="feFuncR"},FeGaussianBlur:UJ,FeImage:GJ,FeMerge:WJ,FeMergeNode:YJ,FeMorphology:$J,FeOffset:XJ,FePointLight:qJ,FeSpecularLighting:ZJ,FeSpotLight:KJ,FeTile:QJ,FeTurbulence:JJ,Filter:e1,ForeignObject:t1,G:n1,Image:i1,Line:r1,LinearGradient:a1,LocalSvg:function(){j1("LocalSvg","component")},Marker:o1,Mask:s1,Path:l1,Pattern:u1,Polygon:c1,Polyline:d1,RadialGradient:h1,Rect:m1,Stop:p1,Svg:f1,SvgAst:C1,SvgCss:function(){j1("SvgCss","component")},SvgCssUri:function(){j1("SvgCssUri","component")},SvgFromUri:T1,SvgFromXml:x1,SvgUri:function(e){const{onError:t=E1,uri:n,onLoad:i,fallback:r}=e,[a,o]=M.useState(null),[s,l]=M.useState(!1);return M.useEffect(()=>{n?KQ(n).then(e=>{o(e),s&&l(!1),null==i||i()}).catch(e=>{t(e),l(!0)}):o(null)},[t,n,i]),s?r??null:M.createElement(I1,{xml:a,override:e,fallback:r})},SvgWithCss:function(){j1("SvgWithCss","component")},SvgWithCssUri:function(){j1("SvgWithCssUri","component")},SvgXml:I1,Symbol:_1,TSpan:g1,Text:y1,TextPath:v1,Use:b1,WithLocalSvg:function(){j1("WithLocalSvg","component")},camelCase:R1,default:f1,fetchText:KQ,inlineStyles:function(){j1("inlineStyles","function")},loadLocalRawResource:function(){j1("loadLocalRawResource","function")},parse:B1},Symbol.toStringTag,{value:"Module"})),H1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:28,height:28,viewBox:"0 0 28 28",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7447 9.05001C15.2398 9.38089 15.822 9.55749 16.4176 9.55749C17.2159 9.55657 17.9813 9.23902 18.5457 8.67452C19.1103 8.11002 19.4278 7.34465 19.4288 6.54632C19.4288 5.95077 19.2521 5.3686 18.9213 4.8734C18.5904 4.37822 18.1201 3.99228 17.5699 3.76437C17.0197 3.53646 16.4142 3.47683 15.8301 3.59301C15.246 3.7092 14.7095 3.99599 14.2883 4.41711C13.8673 4.83823 13.5805 5.37477 13.4643 5.95887C13.3481 6.54299 13.4077 7.14843 13.6356 7.69865C13.8635 8.24886 14.2495 8.71915 14.7447 9.05001ZM15.7169 5.4977C15.9243 5.35912 16.1682 5.28516 16.4176 5.28516C16.752 5.28547 17.0726 5.41843 17.309 5.65488C17.5454 5.89133 17.6784 6.21193 17.6788 6.54632C17.6788 6.79576 17.6048 7.03959 17.4662 7.24699C17.3276 7.45439 17.1307 7.61604 16.9002 7.7115C16.6697 7.80694 16.4162 7.83192 16.1715 7.78326C15.9269 7.7346 15.7022 7.61448 15.5258 7.4381C15.3494 7.26172 15.2293 7.03701 15.1806 6.79236C15.1319 6.54772 15.1569 6.29415 15.2524 6.06369C15.3479 5.83324 15.5095 5.63628 15.7169 5.4977ZM13.2683 22.7677C13.3935 22.8332 13.5327 22.8674 13.674 22.8674C13.8507 22.8669 14.023 22.8129 14.1685 22.7126C14.3139 22.6121 14.4254 22.47 14.4883 22.3051L15.5021 19.6031C15.8009 18.8176 15.78 17.9462 15.444 17.1758C15.1079 16.4056 14.4834 15.7976 13.7043 15.4824L12.925 15.1616C12.7078 15.073 12.5149 14.9342 12.362 14.7564C12.2091 14.5786 12.1007 14.367 12.0459 14.139C11.9909 13.911 11.9909 13.6733 12.0461 13.4453C12.1012 13.2174 12.2097 13.0059 12.3626 12.8282C12.6165 12.5344 12.9754 12.3518 13.3622 12.3195C13.7492 12.2872 14.1334 12.4078 14.4323 12.6556L15.6258 13.6507C16.206 14.1328 16.9365 14.3969 17.6908 14.3974H21.0741C21.3063 14.3974 21.5288 14.3051 21.6929 14.1411C21.857 13.9769 21.9491 13.7545 21.9491 13.5224C21.9491 13.2902 21.857 13.0678 21.6929 12.9036C21.5288 12.7396 21.3063 12.6474 21.0741 12.6474H17.6908C17.3453 12.6468 17.0107 12.526 16.7446 12.3055L15.5523 11.3115C14.8994 10.7709 14.0607 10.5077 13.2159 10.5783C12.3713 10.649 11.5878 11.0479 11.0338 11.6895C10.7016 12.0775 10.4661 12.5388 10.3467 13.0354C10.2274 13.5322 10.2275 14.0501 10.3472 14.5466C10.4669 15.0433 10.7027 15.5045 11.0352 15.8921C11.3677 16.2799 11.7875 16.5833 12.26 16.7774L13.0475 17.0982C13.4043 17.242 13.6904 17.5201 13.8443 17.8727C13.9981 18.2252 14.0074 18.6241 13.87 18.9836L12.8573 21.6856C12.8072 21.8176 12.7901 21.96 12.8071 22.1002C12.8243 22.2406 12.8751 22.3745 12.9555 22.4908C13.0358 22.607 13.1431 22.7021 13.2683 22.7677ZM7.24495 26.2852C6.43735 26.2852 5.64787 26.0456 4.97638 25.5969C4.30488 25.1484 3.78151 24.5105 3.47245 23.7645C3.16339 23.0184 3.08253 22.1973 3.24008 21.4052C3.39764 20.6132 3.78654 19.8855 4.35761 19.3144C4.92867 18.7434 5.65625 18.3545 6.44834 18.197C7.24042 18.0394 8.06145 18.1202 8.80758 18.4293C9.55371 18.7383 10.1914 19.2617 10.6401 19.9332C11.0888 20.6048 11.3283 21.3943 11.3283 22.2018C11.3283 23.2848 10.8981 24.3234 10.1323 25.0892C9.36653 25.855 8.32792 26.2852 7.24495 26.2852ZM7.24495 19.8685C6.78346 19.8685 6.33235 20.0053 5.94863 20.2618C5.56491 20.5181 5.26584 20.8826 5.08924 21.3089C4.91263 21.7353 4.86642 22.2044 4.95645 22.6571C5.04648 23.1096 5.26872 23.5254 5.59505 23.8517C5.92136 24.178 6.33713 24.4003 6.78975 24.4904C7.24237 24.5803 7.71152 24.5341 8.13789 24.3576C8.56425 24.181 8.92866 23.8818 9.18506 23.4981C9.44144 23.1144 9.57828 22.6634 9.57828 22.2018C9.57612 21.5844 9.32935 20.993 8.89199 20.5572C8.45464 20.1213 7.86238 19.8767 7.24495 19.8767V19.8685ZM18.5024 25.5969C19.174 26.0456 19.9633 26.2852 20.771 26.2852C21.8539 26.2852 22.8926 25.855 23.6584 25.0892C24.4241 24.3234 24.8544 23.2848 24.8544 22.2018C24.8544 21.3943 24.6148 20.6048 24.1661 19.9332C23.7174 19.2617 23.0797 18.7383 22.3337 18.4293C21.5875 18.1202 20.7665 18.0394 19.9744 18.197C19.1823 18.3545 18.4547 18.7434 17.8836 19.3144C17.3126 19.8855 16.9237 20.6132 16.7661 21.4052C16.6086 22.1973 16.6894 23.0184 16.9985 23.7645C17.3075 24.5105 17.8309 25.1484 18.5024 25.5969ZM19.4746 20.2618C19.8583 20.0053 20.3095 19.8685 20.771 19.8685V19.8767C21.3884 19.8767 21.9806 20.1213 22.418 20.5572C22.8554 20.993 23.1021 21.5844 23.1044 22.2018C23.1044 22.6634 22.9675 23.1144 22.7111 23.4981C22.4548 23.8818 22.0903 24.181 21.6639 24.3576C21.2376 24.5341 20.7685 24.5803 20.3158 24.4904C19.8631 24.4003 19.4474 24.178 19.1211 23.8517C18.7948 23.5254 18.5726 23.1096 18.4825 22.6571C18.3924 22.2044 18.4386 21.7353 18.6153 21.3089C18.7919 20.8826 19.0909 20.5181 19.4746 20.2618Z",fill:e?.color??t.labelSecondary}))},z1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M16.3935 5.69575C16.3935 6.98075 15.3475 8.02675 14.0625 8.02675C12.7765 8.02675 11.7305 6.98075 11.7305 5.69575C11.7305 4.41075 12.7765 3.36475 14.0625 3.36475C15.3475 3.36475 16.3935 4.41075 16.3935 5.69575ZM11.1694 12.8454L11.8384 13.1213C13.3544 13.7403 14.0934 15.4314 13.5184 16.9704L12.6484 19.2873C12.4984 19.6883 12.1174 19.9363 11.7124 19.9363C11.5954 19.9363 11.4764 19.9153 11.3604 19.8713C10.8434 19.6783 10.5824 19.1014 10.7764 18.5844L11.6454 16.2683C11.8384 15.7503 11.5904 15.1803 11.0794 14.9713L10.4094 14.6953C9.50536 14.3263 8.85336 13.5663 8.62336 12.6143C8.39236 11.6603 8.62636 10.6854 9.26336 9.94138C10.3334 8.69538 12.2274 8.53638 13.4864 9.58838L14.5084 10.4394C14.6914 10.5914 14.9224 10.6744 15.1594 10.6744H18.0604C18.6124 10.6744 19.0604 11.1223 19.0604 11.6743C19.0604 12.2263 18.6124 12.6743 18.0604 12.6743H15.1594C14.4564 12.6743 13.7704 12.4263 13.2294 11.9763L12.2054 11.1243C11.7804 10.7694 11.1424 10.8234 10.7824 11.2433C10.5674 11.4933 10.4894 11.8223 10.5674 12.1433C10.6444 12.4643 10.8644 12.7204 11.1694 12.8454ZM6.20457 21.115C5.10257 21.115 4.20557 20.219 4.20557 19.117C4.20557 18.015 5.10257 17.118 6.20457 17.118C7.30657 17.118 8.20257 18.015 8.20257 19.117C8.20257 20.219 7.30657 21.115 6.20457 21.115ZM6.20457 15.618C4.27557 15.618 2.70557 17.188 2.70557 19.117C2.70557 21.046 4.27557 22.615 6.20457 22.615C8.13357 22.615 9.70257 21.046 9.70257 19.117C9.70257 17.188 8.13357 15.618 6.20457 15.618ZM15.7974 19.117C15.7974 20.219 16.6944 21.115 17.7964 21.115C18.8984 21.115 19.7944 20.219 19.7944 19.117C19.7944 18.015 18.8984 17.118 17.7964 17.118C16.6944 17.118 15.7974 18.015 15.7974 19.117ZM14.2974 19.117C14.2974 17.188 15.8674 15.618 17.7964 15.618C19.7254 15.618 21.2944 17.188 21.2944 19.117C21.2944 21.046 19.7254 22.615 17.7964 22.615C15.8674 22.615 14.2974 21.046 14.2974 19.117Z",fill:e?.color??t.iconBrand}))},U1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M11.98 3C12.5309 3 12.9778 3.44676 12.9778 3.99778V10.9822H19.9622C20.5131 10.9822 20.96 11.429 20.96 11.98C20.96 12.2815 20.8262 12.5517 20.615 12.7345C20.4404 12.886 20.2117 12.9778 19.9622 12.9778H12.9778V19.9622C12.9778 20.5133 12.5309 20.96 11.98 20.96C11.4291 20.96 10.9822 20.5133 10.9822 19.9622V12.9778H3.99778C3.44692 12.9778 3 12.531 3 11.98C3 11.429 3.44692 10.9822 3.99778 10.9822H10.9822V3.99778C10.9822 3.44676 11.4291 3 11.98 3Z",fill:e?.color??t.iconButtonPrimary,fillOpacity:.95}))},G1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M9.26216 10.0642C9.43989 10.4341 9.28071 10.884 8.90669 11.0642C8.27046 11.364 7.79682 12.0142 7.70112 12.7041C7.64448 13.114 7.26606 13.404 6.85591 13.3442C6.44526 13.2942 6.15864 12.9141 6.21479 12.5041C6.37983 11.3039 7.17085 10.2241 8.26264 9.70412C8.63667 9.52419 9.08442 9.68411 9.26216 10.0642Z",fill:e?.color??t.labelSecondary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4458 7.23465C11.3667 6.69339 11.1977 6.19364 10.9272 5.7742C10.5483 5.19413 9.93601 4.72415 8.93992 4.53421C8.53318 4.45413 8.26707 4.05399 8.34617 3.65409C8.42478 3.24417 8.81883 2.97415 9.22508 3.05423C10.602 3.32401 11.5732 4.0242 12.1841 4.95413C12.6377 5.65262 12.8725 6.44925 12.9595 7.2432C13.4619 7.19974 13.9643 7.11014 14.4673 6.97415C15.1391 6.79422 16.7549 6.53421 18.2949 7.22415C19.9219 7.95413 21.2529 9.63407 21.4541 12.894L21.4555 12.9341C21.48 15.9941 20.5049 18.3039 19.3813 19.884C19.0459 20.3518 18.6968 20.7549 18.3554 21.093C18.1274 21.3188 17.9033 21.5159 17.6894 21.6841C17.4228 21.894 17.165 22.0642 16.9292 22.1941C16.7138 22.3013 16.4653 22.4082 16.2207 22.4416C15.2471 22.6555 14.3613 22.4893 13.6694 22.3042C13.3388 22.2141 12.9721 22.084 12.7471 22.0242C12.4746 21.9441 12.3291 21.9141 12.2495 21.9141C12.1621 21.9141 12.0122 21.9441 11.7431 22.0142C11.6382 22.043 11.4975 22.0854 11.3437 22.1321C11.1777 22.1824 10.9966 22.2373 10.8291 22.2842C10.1328 22.4624 9.24558 22.6306 8.26121 22.4302C8.02244 22.396 7.77976 22.2996 7.56639 22.1841C7.33006 22.0642 7.07225 21.894 6.80564 21.6841C6.27098 21.2642 5.67283 20.6641 5.11375 19.874C3.99119 18.3039 3.01853 15.9941 3.04344 12.9341L3.0449 12.894C3.24607 9.63407 4.57762 7.95413 6.20457 7.22415C7.74461 6.53421 9.35984 6.79422 10.0317 6.97415C10.5039 7.1016 10.9746 7.18851 11.4458 7.23465ZM16.0244 20.9473L16.0307 20.9458C16.0327 20.9453 16.0346 20.9448 16.0366 20.9441C16.0127 20.9541 16.0727 20.9441 16.2295 20.864C16.3711 20.7839 16.5532 20.6741 16.7627 20.5041C17.0688 20.2632 17.4179 19.9368 17.77 19.5137C17.9004 19.3572 18.0312 19.1875 18.1606 19.0041C19.1113 17.6785 19.9717 15.6775 19.9555 12.9714C19.7783 10.1409 18.6846 9.04349 17.6821 8.59427C16.5918 8.10404 15.373 8.28421 14.8574 8.42411C13.1211 8.88407 11.3774 8.88407 9.64109 8.42411C9.12596 8.28421 7.90769 8.10404 6.81736 8.59427C5.8159 9.043 4.72264 10.1385 4.54344 12.9629C4.52537 15.6733 5.38426 17.6772 6.33445 19.0041C6.58494 19.355 6.84129 19.6589 7.08885 19.9165C7.31443 20.1511 7.53269 20.3469 7.7324 20.5041C7.94236 20.6641 8.12498 20.7839 8.26805 20.864C8.37254 20.9172 8.43553 20.9394 8.46092 20.9482C8.4741 20.9529 8.47703 20.9541 8.47117 20.9541H8.53025C9.19432 21.094 9.82908 20.9941 10.4443 20.8342C10.7822 20.7441 11.0141 20.6641 11.3369 20.5742C11.6089 20.4941 11.9355 20.4141 12.2495 20.4141C12.5703 20.4141 12.9038 20.5041 13.1758 20.5842C13.3198 20.6247 13.4482 20.6653 13.5762 20.7058C13.7319 20.7551 13.8872 20.8047 14.0688 20.8542C14.6831 21.0242 15.3032 21.124 15.9409 20.9641C15.957 20.959 15.9731 20.9565 15.9892 20.9539C16.001 20.9521 16.0127 20.9502 16.0244 20.9473Z",fill:e?.color??t.labelSecondary}))},W1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M8.04316 3.60454C8.12202 3.1979 8.51559 2.93219 8.92223 3.01105C10.2992 3.27808 11.2703 3.97422 11.8813 4.91206C12.3804 5.6783 12.6145 6.56644 12.678 7.43902C13.1847 7.39462 13.6915 7.30411 14.1989 7.16747C14.8466 6.99265 16.3988 6.75245 17.8696 7.41069C19.4044 8.09754 20.6958 9.68948 20.892 12.8663C20.8926 12.8761 20.8929 12.886 20.893 12.8958C20.9177 15.8912 19.9638 18.1528 18.8702 19.6843C18.3249 20.4479 17.7434 21.0321 17.2281 21.437C16.9707 21.6392 16.7245 21.8008 16.5023 21.918C16.3043 22.0224 16.091 22.11 15.8887 22.14C14.9514 22.3607 14.0934 22.2028 13.4084 22.0136C13.1979 21.9554 12.9793 21.8866 12.7875 21.8263C12.6801 21.7925 12.5811 21.7613 12.4966 21.7361C12.2263 21.6556 12.0576 21.6208 11.9473 21.6208C11.8313 21.6208 11.6594 21.6545 11.3919 21.7297C11.3049 21.7542 11.2002 21.7855 11.0862 21.8195C10.899 21.8754 10.6868 21.9387 10.4871 21.9917C9.80436 22.1729 8.95309 22.3276 8.01418 22.1412C7.80916 22.1115 7.59125 22.0221 7.38731 21.9141C7.16483 21.7963 6.91848 21.6344 6.6609 21.4319C6.14526 21.0266 5.56418 20.4427 5.01958 19.6798C3.92731 18.1496 2.97639 15.8909 3.00045 12.8959C3.00053 12.886 3.00087 12.8762 3.00148 12.8663C3.19764 9.68942 4.48941 8.09751 6.02425 7.41068C7.49526 6.75242 9.04763 6.99267 9.69485 7.16754C10.1879 7.30029 10.6804 7.3895 11.1727 7.43516C11.1122 6.79573 10.9352 6.2078 10.6244 5.73084C10.2452 5.14868 9.63277 4.67679 8.63665 4.48361C8.23002 4.40475 7.9643 4.01118 8.04316 3.60454ZM8.60309 11.0139C8.97721 10.8361 9.13636 10.3887 8.95857 10.0146C8.78078 9.64044 8.33337 9.48129 7.95925 9.65908C6.86721 10.178 6.07626 11.2571 5.91139 12.4555C5.85494 12.8659 6.14182 13.2443 6.55217 13.3007C6.96252 13.3572 7.34094 13.0703 7.39739 12.66C7.49327 11.963 7.96717 11.3161 8.60309 11.0139Z",fill:e?.color??t.iconBrand}))},Y1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:"40",height:"84",viewBox:"0 0 40 84",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M40.0001 28.9285V24.5471C39.5337 24.6152 39.0574 24.65 38.5725 24.65C33.7881 24.65 29.7894 21.2357 28.8091 16.675H37.1449V12.325H28.8091C29.7894 7.76427 33.7881 4.35 38.5725 4.35C39.0574 4.35 39.5337 4.3848 40.0001 4.45247V0.0715333C39.5304 0.0241667 39.0545 0 38.5725 0C30.6878 0 24.2964 6.49165 24.2964 14.5C24.2964 22.5084 30.6878 29 38.5725 29C39.0545 29 39.5304 28.9758 40.0001 28.9285Z",fill:t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M0 14.5C0 22.5084 6.35291 29 14.1901 29C14.7014 29 15.2066 28.9725 15.7037 28.9188V24.533C15.2104 24.6104 14.7047 24.65 14.1901 24.65C8.7042 24.65 4.25703 20.1057 4.25703 14.5C4.25703 8.8943 8.7042 4.35 14.1901 4.35C14.7047 4.35 15.2104 4.38963 15.7037 4.46697V0.0812C15.2066 0.02755 14.7014 0 14.1901 0C6.35291 0 0 6.49165 0 14.5Z",fill:t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M3.07255 44C4.12117 44 4.89209 43.648 5.38529 42.9439C5.8785 42.2398 6.1251 41.1635 6.1251 39.7152V38.111C6.11177 36.7117 5.85851 35.6767 5.3653 35.006C4.87209 34.3353 4.1034 34 3.05922 34C2.00616 34 1.23302 34.3476 0.739811 35.0428C0.246604 35.738 0 36.8008 0 38.2313V39.8824C0.0177732 41.2504 0.275485 42.2787 0.773136 42.9672C1.27079 43.6557 2.03726 44 3.07255 44ZM3.07255 42.9906C2.45493 42.9906 1.99394 42.74 1.68957 42.2386C1.3852 41.7373 1.23302 40.9608 1.23302 39.9091V37.9305C1.24191 36.9412 1.39076 36.2081 1.67957 35.7313C1.96839 35.2545 2.42827 35.016 3.05922 35.016C3.69461 35.016 4.15894 35.2556 4.4522 35.7346C4.74546 36.2137 4.89209 36.9768 4.89209 38.0241V40.0495C4.87876 41.0655 4.72435 41.8097 4.42887 42.2821C4.13339 42.7545 3.68128 42.9906 3.07255 42.9906ZM15.4217 34.0869V43.8663H14.182V35.6243L11.696 36.5401V35.4171L15.2284 34.0869H15.4217ZM29.0572 43.8663V42.857H24.1851L26.7844 40.0294C28.0019 38.7059 28.6106 37.5651 28.6106 36.607C28.6106 35.8182 28.3485 35.1865 27.8242 34.7119C27.2998 34.2373 26.5867 34 25.6847 34C24.7205 34 23.9507 34.2763 23.3753 34.8289C22.7999 35.3815 22.5122 36.1056 22.5122 37.0013H23.7452C23.7452 36.3775 23.9151 35.8906 24.2551 35.5408C24.595 35.191 25.0715 35.016 25.6847 35.016C26.1957 35.016 26.6045 35.1787 26.911 35.504C27.2176 35.8293 27.3709 36.246 27.3709 36.754C27.3709 37.1328 27.2765 37.4993 27.0877 37.8536C26.8988 38.2079 26.5556 38.668 26.0579 39.234L22.6988 42.9773V43.8663H29.0572ZM39.1469 43.2313C38.5781 43.7438 37.8383 44 36.9275 44C36.0166 44 35.2757 43.7527 34.7047 43.258C34.1337 42.7634 33.8482 42.1105 33.8482 41.2995H35.0879C35.0879 41.8119 35.2545 42.2219 35.5878 42.5294C35.921 42.8369 36.3676 42.9906 36.9275 42.9906C37.5229 42.9906 37.9783 42.8347 38.2938 42.5227C38.6092 42.2108 38.767 41.7629 38.767 41.1791C38.767 40.6132 38.5937 40.1787 38.2471 39.8757C37.9005 39.5726 37.4007 39.4167 36.7475 39.4078H35.8211V38.3984H36.7475C37.3296 38.3895 37.7872 38.2357 38.1205 37.9372C38.4537 37.6386 38.6204 37.2353 38.6204 36.7273C38.6204 35.5865 38.0538 35.016 36.9208 35.016C36.3876 35.016 35.9621 35.1687 35.6444 35.4739C35.3267 35.7792 35.1679 36.1836 35.1679 36.6872H33.9349C33.9349 35.9162 34.2159 35.2756 34.778 34.7654C35.3401 34.2551 36.0543 34 36.9208 34C37.8361 34 38.5537 34.2429 39.0736 34.7286C39.5934 35.2143 39.8534 35.8895 39.8534 36.754C39.8534 37.1774 39.7167 37.5873 39.4435 37.984C39.1702 38.3806 38.7981 38.6769 38.3271 38.873C38.8603 39.0423 39.2724 39.3231 39.5634 39.7152C39.8545 40.1074 40 40.5865 40 41.1524C40 42.0258 39.7156 42.7188 39.1469 43.2313Z",fill:t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M38.5714 58.4286H1.42857V82H38.5714V58.4286ZM0 57V83.4286H40V57H0Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M4.4248 78.0714V62.2211H9.21449L12.0905 73.033L14.934 62.2211H19.7345V78.0714H16.7612V65.5944L13.615 78.0714H10.5336L7.39809 65.5944V78.0714H4.4248Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M22.4596 62.2211H28.3088C29.6279 62.2211 30.6334 62.322 31.3253 62.5238C32.2552 62.7977 33.0517 63.2842 33.7148 63.9834C34.3779 64.6826 34.8825 65.5403 35.2285 66.5567C35.5744 67.5658 35.7474 68.8127 35.7474 70.2976C35.7474 71.6022 35.5853 72.7267 35.2609 73.6709C34.8645 74.8242 34.2986 75.7576 33.5634 76.4712C33.0084 77.0118 32.2588 77.4335 31.3145 77.7362C30.6082 77.9597 29.6639 78.0714 28.4818 78.0714H22.4596V62.2211ZM25.6599 64.9024V75.4008H28.0493C28.9431 75.4008 29.5882 75.3504 29.9847 75.2495C30.5036 75.1197 30.9325 74.8999 31.2713 74.5899C31.6173 74.28 31.8984 73.7718 32.1146 73.0654C32.3309 72.3519 32.439 71.3824 32.439 70.157C32.439 68.9317 32.3309 67.991 32.1146 67.3351C31.8984 66.6792 31.5956 66.1674 31.2064 65.7998C30.8172 65.4322 30.3234 65.1835 29.7252 65.0538C29.2783 64.9529 28.4025 64.9024 27.0979 64.9024H25.6599Z",fill:t.labelPrimary}))},$1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M9.91114 17.3465C9.8166 17.3465 9.723 17.3278 9.63569 17.2916C9.54838 17.2554 9.46907 17.2023 9.40234 17.1353L5.20234 12.9353C5.07112 12.7995 4.99847 12.6177 5.00002 12.4289C5.00157 12.2401 5.07721 12.0595 5.21064 11.9259C5.34407 11.7924 5.52462 11.7166 5.7134 11.7148C5.90218 11.7131 6.08409 11.7856 6.21994 11.9167L9.91114 15.6079L18.6472 6.87191C18.7136 6.80317 18.7931 6.74836 18.881 6.71067C18.9688 6.67297 19.0633 6.65316 19.1589 6.65237C19.2545 6.65158 19.3492 6.66985 19.4378 6.70609C19.5263 6.74234 19.6066 6.79583 19.6741 6.86347C19.7417 6.9311 19.7952 7.01151 19.8313 7.10002C19.8674 7.18852 19.8857 7.28334 19.8847 7.37894C19.8839 7.47454 19.864 7.56901 19.8262 7.65684C19.7884 7.74467 19.7335 7.82408 19.6648 7.89046L10.4151 17.1353C10.2815 17.2694 10.1004 17.3452 9.91114 17.3465Z",fill:e?.color??t.iconBrand}))},X1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M16.3344 3.38489H7.6654C4.6444 3.38489 2.7504 5.52389 2.7504 8.55089V16.7189C2.7504 19.7459 4.6354 21.8849 7.6654 21.8849H16.3334C19.3644 21.8849 21.2504 19.7459 21.2504 16.7189V8.55089C21.2504 5.52389 19.3644 3.38489 16.3344 3.38489Z",stroke:e?.color??t.labelPrimary,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},q1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M14.5784 9.44215L14.5784 9.44219L10.8449 13.1767L9.41855 11.7512C9.41852 11.7511 9.41849 11.7511 9.41845 11.7511C8.93018 11.2629 8.13968 11.2629 7.65145 11.7512C7.16318 12.2394 7.16318 13.031 7.65145 13.5193L9.96045 15.8283C10.2049 16.0727 10.5246 16.1947 10.845 16.1947C11.1647 16.1947 11.4844 16.0724 11.7286 15.8283L16.3466 11.2103C16.8348 10.722 16.8348 9.93041 16.3466 9.44215C15.8583 8.95389 15.0667 8.95389 14.5784 9.44215ZM7.782 3.6347H16.217C17.6754 3.6347 18.8605 4.14442 19.6821 5.00394C20.5055 5.86543 21 7.11668 21 8.66171V16.6097C21 18.1541 20.5053 19.4048 19.6817 20.266C18.8599 21.1252 17.6745 21.6347 16.216 21.6347H7.782C6.32407 21.6347 5.13922 21.1252 4.31777 20.266C3.49445 19.4049 3 18.1542 3 16.6097V8.66171C3 7.11668 3.49448 5.86541 4.31784 5.00392C5.13931 4.14439 6.32414 3.6347 7.782 3.6347Z",fill:e?.color??t.iconBrand,stroke:e?.color??t.iconBrand}))},Z1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:25,height:26,viewBox:"0 0 25 26",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0713 21.2014C15.7665 21.2014 15.4618 21.0847 15.2296 20.8525L8.08689 13.7098C7.62143 13.2444 7.62143 12.492 8.08689 12.0266L15.2296 4.88383C15.6951 4.41836 16.4474 4.41836 16.913 4.88383C17.3784 5.3493 17.3784 6.10166 16.913 6.56713L10.6118 12.8682L16.913 19.1693C17.3784 19.6347 17.3784 20.3871 16.913 20.8525C16.6808 21.0847 16.3761 21.2014 16.0713 21.2014Z",fill:e.color??t.labelPrimary}))},K1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M8.21967 20.0899C7.9534 19.8236 7.9292 19.407 8.14705 19.1134L8.21967 19.0292L14.689 12.5596L8.21967 6.0899C7.9534 5.82363 7.9292 5.40697 8.14705 5.11336L8.21967 5.02924C8.48594 4.76297 8.9026 4.73877 9.19621 4.95662L9.28033 5.02924L16.2803 12.0292C16.5466 12.2955 16.5708 12.7122 16.3529 13.0058L16.2803 13.0899L9.28033 20.0899C8.98744 20.3828 8.51256 20.3828 8.21967 20.0899Z",fill:e.color??t.labelSecondary}))},Q1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M6.72911 6.34559C6.44794 6.06441 5.99206 6.06441 5.71088 6.34559C5.42971 6.62676 5.42971 7.08264 5.71088 7.36382L10.9617 12.6147L5.71088 17.8656C5.42971 18.1468 5.42971 18.6026 5.71088 18.8838C5.99206 19.165 6.44794 19.165 6.72911 18.8838L11.98 13.633L17.2309 18.8838C17.5121 19.165 17.9679 19.165 18.2491 18.8838C18.5303 18.6026 18.5303 18.1468 18.2491 17.8656L12.9983 12.6147L18.2491 7.36382C18.5303 7.08264 18.5303 6.62676 18.2491 6.34559C17.9679 6.06441 17.5121 6.06441 17.2309 6.34559L11.98 11.5964L6.72911 6.34559Z",fill:e?.color??t.labelPrimary}))},J1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:25,viewBox:"0 0 24 25",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M13.414 12.3682L18.707 7.07529C19.098 6.68429 19.098 6.05229 18.707 5.66129C18.316 5.27029 17.684 5.27029 17.293 5.66129L12 10.9542L6.70701 5.66129C6.31601 5.27029 5.68401 5.27029 5.29301 5.66129C4.90201 6.05229 4.90201 6.68429 5.29301 7.07529L10.586 12.3682L5.29301 17.6613C4.90201 18.0522 4.90201 18.6842 5.29301 19.0752C5.48801 19.2702 5.74401 19.3682 6.00001 19.3682C6.25601 19.3682 6.51201 19.2702 6.70701 19.0752L12 13.7823L17.293 19.0752C17.488 19.2702 17.744 19.3682 18 19.3682C18.256 19.3682 18.512 19.2702 18.707 19.0752C19.098 18.6842 19.098 18.0522 18.707 17.6613L13.414 12.3682Z",fill:e.color??t.labelPrimary}))};function e2(e){const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:25,viewBox:"0 0 24 25",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.638 7.76a2.58 2.58 0 102.868-4.29 2.58 2.58 0 00-2.868 4.29zm.834-3.044a1.081 1.081 0 111.2 1.798 1.081 1.081 0 01-1.2-1.798zm-2.1 14.803a.75.75 0 001.046-.397l.87-2.316a2.755 2.755 0 00-1.542-3.532L11.079 13a1.267 1.267 0 111.293-2.148l1.022.853c.498.413 1.124.64 1.77.64h2.9a.75.75 0 000-1.5h-2.9c-.296 0-.582-.104-.81-.293L13.33 9.7a2.777 2.777 0 00-3.873.324 2.768 2.768 0 001.05 4.361l.676.275a1.258 1.258 0 01.705 1.616l-.868 2.316a.748.748 0 00.352.928zM6.21 22.534a3.5 3.5 0 110-7 3.5 3.5 0 010 7zm0-5.5a2 2 0 102 2 2 2 0 00-2-1.993v-.007zm9.65 4.91a3.5 3.5 0 103.888-5.82 3.5 3.5 0 00-3.889 5.82zm.832-4.573a2 2 0 011.112-.337v.007a2 2 0 012 1.993 2 2 0 11-3.111-1.663z",fill:t.labelPrimary}))}const t2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:28,height:28,viewBox:"0 0 28 28",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M15.001 4.41143L14.5 5.20879L13.9989 4.41143C14.3038 4.20791 14.6961 4.20791 15.001 4.41143ZM14.5 6.3617C14.4414 6.40466 14.3782 6.45134 14.3109 6.50165C13.8698 6.83133 13.2501 7.3157 12.5427 7.92948C11.1256 9.15913 9.38504 10.8841 8.01956 12.9025C6.69517 15.0522 6.69988 17.9558 7.8799 20.3534C9.04765 22.7262 11.3296 24.5255 14.5 24.5255C17.6704 24.5255 19.9522 22.7262 21.1201 20.3534C22.3001 17.9558 22.3047 15.0522 20.9803 12.9025C19.6149 10.8841 17.8742 9.15913 16.4572 7.92948C15.7498 7.3157 15.1301 6.83133 14.689 6.50165C14.6217 6.45134 14.5585 6.40466 14.5 6.3617ZM13.9989 4.41143C13.9991 4.41131 13.9989 4.41143 14.5 5.20879C15.001 4.41143 15.0008 4.41131 15.001 4.41143L15.0029 4.4127L15.0065 4.41505L15.0181 4.42295L15.06 4.45146C15.0959 4.47608 15.1477 4.51183 15.2138 4.55835C15.3459 4.65134 15.5356 4.78745 15.7711 4.96346C16.2419 5.31529 16.8975 5.82789 17.6444 6.47598C19.1322 7.7669 21.0099 9.6196 22.5041 11.8329C22.5109 11.8431 22.5177 11.8535 22.5241 11.8639C24.2619 14.6665 24.1952 18.3049 22.764 21.213C21.3177 24.1517 18.44 26.4255 14.5 26.4255C10.5599 26.4255 7.68226 24.1517 6.23595 21.213C4.80472 18.3049 4.73807 14.6665 6.4758 11.8639C6.48228 11.8535 6.48897 11.8431 6.49585 11.8329C7.98996 9.6196 9.86782 7.7669 11.3555 6.47598C12.1024 5.82789 12.758 5.31529 13.2288 4.96346C13.4644 4.78745 13.654 4.65134 13.7861 4.55835C13.8523 4.51183 13.904 4.47608 13.9399 4.45146L13.9818 4.42295L13.9935 4.41505L13.997 4.4127L13.9989 4.41143ZM10.1358 17.1709C10.6088 16.9769 11.1448 17.2148 11.333 17.7023C11.7357 18.7452 12.6036 19.5672 13.8273 19.7115C14.3331 19.7712 14.6962 20.2421 14.6383 20.7633C14.5804 21.2847 14.1235 21.6589 13.6178 21.5992C11.6275 21.3645 10.2379 20.0043 9.62029 18.4049C9.43206 17.9174 9.66286 17.365 10.1358 17.1709Z",fill:e?.color??t.labelSecondary}))},n2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:28,height:28,viewBox:"0 0 28 28",fill:"none",...e},M.createElement(l1,{d:"M9.47572 16.8973L9.47563 16.8974C8.70231 17.2102 8.33375 18.0938 8.63669 18.8671C9.37596 20.7542 11.0517 22.3823 13.4637 22.6627C14.2958 22.7594 15.0352 22.1525 15.1284 21.3254L15.1284 21.3253C15.2214 20.4994 14.6377 19.741 13.8072 19.6443L13.8071 19.6443C12.6515 19.5101 11.8233 18.75 11.4309 17.7484L10.984 17.9235L11.4309 17.7484C11.1265 16.9714 10.253 16.5831 9.47572 16.8973ZM14.5 25.9455C10.7597 25.9455 8.05158 23.8421 6.67199 21.0789C5.2861 18.303 5.26321 14.906 6.85972 12.3608C9.34794 8.73088 12.9056 5.98426 14.2429 5.02279C14.3998 4.91003 14.6002 4.91003 14.7571 5.0228C16.0944 5.98427 19.6519 8.73087 22.1402 12.3608C23.7367 14.9059 23.7138 18.303 22.3279 21.0789C20.9483 23.8421 18.2402 25.9455 14.5 25.9455Z",fill:e?.color??t.iconBrand,stroke:e?.color??t.iconBrand,strokeWidth:.96}))},i2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.2513 6.38429C6.07792 5.49683 7.25513 4.99994 8.645 4.99994H11.6506C11.9986 4.99994 12.2808 5.28208 12.2808 5.63012C12.2808 5.97816 11.9986 6.26031 11.6506 6.26031H8.645C7.56779 6.26031 6.73758 6.6378 6.17357 7.24333C5.60494 7.85381 5.26037 8.74689 5.26037 9.85332V16.5305C5.26037 17.6382 5.6036 18.5314 6.17112 19.1416C6.73386 19.7466 7.56369 20.1243 8.645 20.1243H15.7324C16.8151 20.1243 17.6451 19.7465 18.2076 19.1416C18.7749 18.5315 19.1178 17.6384 19.1178 16.5305V13.5216C19.1178 13.1736 19.4 12.8914 19.748 12.8914C20.096 12.8914 20.3782 13.1736 20.3782 13.5216V16.5305C20.3782 17.8979 19.9518 19.1168 19.1305 19.9999C18.3045 20.8882 17.1266 21.3847 15.7324 21.3847H8.645C7.25186 21.3847 6.07429 20.888 5.24823 19.9999C4.42695 19.1169 4 17.8981 4 16.5305V9.85332C4 8.48531 4.42929 7.2668 5.2513 6.38429Z",fill:e?.color??t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M16.5818 6.82051L11.9345 11.8931C11.6675 12.1932 11.5006 12.5692 11.4569 12.9697L11.3377 14.0698C11.2974 14.4426 11.6242 14.7507 11.9937 14.6891C11.9936 14.6891 11.9938 14.689 11.9937 14.6891L13.0606 14.5101C13.4935 14.4373 13.8884 14.2197 14.1802 13.8934L14.1853 13.8878L18.786 8.86705L18.7882 8.8647C19.1016 8.52614 19.0813 7.99816 18.7425 7.68452L17.7614 6.77612C17.7614 6.77609 17.7614 6.77615 17.7614 6.77612C17.4228 6.46331 16.8946 6.48377 16.5818 6.82051ZM15.656 5.96537C16.4416 5.11656 17.7676 5.06553 18.6169 5.85059L19.5987 6.75961C19.5986 6.7596 19.5987 6.75963 19.5987 6.75961C20.4475 7.54548 20.4996 8.86988 19.7143 9.71954C19.7139 9.71999 19.7135 9.72045 19.7131 9.7209L15.117 14.7366C14.6344 15.275 13.9827 15.6332 13.2696 15.7531L12.2021 15.932C11.0092 16.1317 9.95483 15.1373 10.0846 13.9346L10.2039 12.8335C10.2761 12.1713 10.553 11.5478 10.9971 11.0507L11.0024 11.0449L15.6538 5.96774L15.656 5.96537Z",fill:e?.color??t.labelPrimary}))},r2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{height:48,width:48,viewBox:"0 0 48 48",fill:"none",...e},M.createElement(l1,{d:"M33 29C33 30.1045 32.1001 31 30.9907 31H17.0093C15.9 31 15 30.1045 15 29C15 27.8955 15.9 27 17.0093 27H24H30.9907C32.1001 27 33 27.8955 33 29Z",fill:e?.color??t.labelPrimary}),M.createElement(l1,{d:"M33 19C33 20.1045 32.1001 21 30.9907 21H17.0093C15.9 21 15 20.1045 15 19C15 17.8955 15.9 17 17.0093 17H24H30.9907C32.1001 17 33 17.8955 33 19Z",fill:e?.color??t.labelPrimary}))};function a2(e){const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M7.783 3h8.435C19.166 3 21 5.081 21 8.026v7.948C21 18.919 19.166 21 16.217 21H7.783C4.835 21 3 18.919 3 15.974V8.026C3 5.081 4.844 3 7.783 3zM14.612 14.155h-5.22M14.612 9.846h-5.22",stroke:t.labelPrimary,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}const o2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:48,height:48,viewBox:"0 0 48 48",fill:"none",...e},M.createElement(l1,{d:"M29.8751 5.55323C30.6937 5.68067 31.2539 6.44757 31.1265 7.26613L29.4705 17.9027C29.3431 18.7213 28.5763 19.2816 27.7577 19.1541C26.9391 19.0267 26.3789 18.2598 26.5063 17.4412L28.1623 6.80463C28.2897 5.98607 29.0565 5.42579 29.8751 5.55323Z",fill:t.labelSecondary}),M.createElement(l1,{d:"M38.9675 7.97557C39.7035 8.35561 39.9923 9.26045 39.6121 9.99655L35.2941 18.3603C34.9141 19.0964 34.0093 19.3851 33.2731 19.005C32.5371 18.625 32.2483 17.7201 32.6285 16.984L36.9465 8.62029C37.3265 7.88417 38.2313 7.59553 38.9675 7.97557Z",fill:t.labelSecondary}),M.createElement(l1,{d:"M9.05192 22.4805C7.24854 22.4805 5.8052 24.0585 6.02152 25.8737C6.07976 26.3593 6.15546 26.8399 6.24796 27.3143C6.31936 27.6805 6.64466 27.9381 7.0178 27.9381H42.9844C43.3572 27.9381 43.6824 27.6807 43.754 27.3147C43.8458 26.8443 43.9208 26.3685 43.9784 25.8881C44.1964 24.0733 42.7644 22.4805 40.9482 22.4805H9.05192Z",fill:t.labelSecondary}),M.createElement(l1,{d:"M42.4447 31.4848C42.5591 31.2252 42.3659 30.938 42.0821 30.938H7.91546C7.63188 30.938 7.43878 31.2248 7.55284 31.4846C9.30246 35.4668 12.3176 38.7632 16.091 40.862C17.4387 41.612 18.9573 41.965 20.4689 41.965H29.5351C31.0397 41.965 32.5549 41.6166 33.8999 40.8676C37.6725 38.771 40.6895 35.4708 42.4447 31.4848Z",fill:t.labelSecondary}))};function s2(e){return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M11.7012 4.125C11.8651 3.95886 12.1261 3.95886 12.29 4.125L18.2441 10.1582C19.2467 11.1743 19.2467 12.8256 18.2441 13.8418L12.29 19.875C12.1261 20.0411 11.8661 20.0411 11.7021 19.875L5.74805 13.8418C4.74547 12.8257 4.74558 11.1744 5.74805 10.1582L11.7012 4.125Z",fill:"#401782",stroke:"#9B8BF3",strokeWidth:2}))}const l2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:"40",height:"29",viewBox:"0 0 40 29",...e},M.createElement(l1,{d:"M29.8431 28.0756C28.6 27.6408 27.4897 26.9403 26.3499 26.2989C25.9038 26.048 25.4406 25.813 24.9615 25.6337C24.3315 25.3975 23.6719 25.5111 23.026 25.5973C22.0712 25.7234 21.1665 25.9947 20.3264 26.484C20.1788 26.5702 19.929 26.5691 19.7463 26.4953C19.6316 26.4488 19.5147 26.3727 19.3978 26.3125C18.5361 25.8755 17.6109 25.6643 16.6584 25.5394C15.7321 25.418 14.875 25.5883 14.0724 26.0651C13.4957 26.4079 12.9122 26.7394 12.3309 27.072C10.7507 27.9779 9.06826 28.5864 7.25074 28.7737C6.13367 28.8884 3.87456 28.8884 2.57812 28.5898C1.70853 28.407 0.858238 28.1312 0 27.8951C0 19.1628 0 10.4317 0 1.69951C0.662977 2.0923 1.33957 2.45444 2.09678 2.63948C3.20817 2.91081 4.33887 3.00957 5.47751 3.08563C6.8852 3.17986 8.24975 3.01865 9.54392 2.46579C10.5236 2.04803 11.467 1.54512 12.4285 1.08308C13.5025 0.566546 14.556 0.0273115 15.8081 0.0205C17.2158 0.0125534 18.5588 0.255494 19.8643 0.761808C19.9472 0.793595 20.0619 0.799268 20.1447 0.769752C21.3095 0.34858 23.6118 -0.225849 25.0422 0.0920169C25.855 0.272519 26.3726 0.516597 27.0061 0.803811C28.0119 1.26018 28.9837 1.78692 29.9827 2.25805C30.9068 2.69398 31.8763 3.02319 32.9014 3.06179C33.8289 3.09698 34.7632 3.0686 35.6895 2.99936C37.1392 2.89151 37.7942 2.87334 39.1032 2.15474C39.6458 1.85731 39.9557 1.4963 40 1.48155C40 10.207 40 19.2116 40 27.9405C38.5253 28.39 37.1301 28.7715 35.484 28.9031C32.8253 29.0473 30.9919 28.4774 29.8431 28.0756ZM19.2945 24.7198C19.2945 17.1739 19.2945 9.62345 19.2945 2.05824C19.2366 2.03327 19.1787 2.00035 19.1162 1.98332C18.5656 1.83233 18.0184 1.67 17.4633 1.53831C16.1771 1.2318 14.9454 1.36121 13.7715 2.00148C13.1086 2.36362 12.4229 2.68262 11.7485 3.02319C9.94012 3.93706 8.05222 4.72037 5.98155 4.58528C4.84745 4.51149 3.81098 4.37753 2.60082 4.17319C2.07407 4.07783 1.80275 4.00404 1.39634 3.91435C1.39634 11.5749 1.39634 19.2196 1.39634 26.8688C1.47807 26.8926 1.54619 26.9119 1.61317 26.9312C3.52945 27.483 5.47637 27.6294 7.44941 27.3433C9.26352 27.08 10.8937 26.3386 12.4331 25.3771C13.2244 24.8821 14.0292 24.3974 14.9522 24.2135C16.4405 23.9172 17.8697 24.2475 19.2945 24.7198ZM38.6264 3.92117C38.5821 3.92911 38.5537 3.93252 38.5276 3.93933C37.3299 4.25265 36.1084 4.39456 34.8744 4.47176C33.2533 4.57279 31.6515 4.48651 30.1428 3.83943C28.8906 3.30246 27.6725 2.68376 26.4408 2.09798C25.7199 1.75514 25.0047 1.38846 24.1794 1.38165C23.3234 1.37483 22.4856 1.50879 21.6637 1.74606C21.3436 1.83801 21.0291 1.94926 20.7124 2.05257C20.7124 9.63594 20.7124 17.1864 20.7124 24.705C21.2584 24.5643 21.8033 24.3974 22.3596 24.2861C23.1872 24.1215 24.0261 24.0239 24.8673 24.1681C25.7517 24.3191 26.518 24.755 27.2865 25.1977C28.1413 25.6893 28.9996 26.1888 29.901 26.5793C32.1237 27.5431 34.4521 27.6816 36.8225 27.2888C37.4253 27.1889 38.0213 27.0425 38.6252 26.9165C38.6264 19.2298 38.6264 11.5851 38.6264 3.92117Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M25.7222 22.1271C25.7222 21.6866 25.7222 21.2586 25.7222 20.8125C26.401 20.8125 27.0799 20.8125 27.7803 20.8125C27.7803 18.6669 27.7803 16.5383 27.7803 14.3916C27.131 14.3916 26.4907 14.3916 25.8391 14.3916C25.8391 13.9602 25.8391 13.547 25.8391 13.1235C27.9643 13.1235 30.094 13.1235 32.2407 13.1235C32.2407 15.6801 32.2407 18.2344 32.2407 20.8011C32.8946 20.8011 33.5314 20.8011 34.1842 20.8011C34.1842 21.2473 34.1842 21.6832 34.1842 22.1282C31.3654 22.1271 28.5546 22.1271 25.7222 22.1271Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M30.1452 11.5738C28.9521 11.5784 27.9372 10.5624 27.9292 9.3556C27.9224 8.15338 28.9339 7.13281 30.1361 7.1294C31.3576 7.126 32.3714 8.13295 32.3737 9.35219C32.376 10.5567 31.3599 11.5693 30.1452 11.5738Z",fill:t.labelPrimary}))},u2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:"41",height:"38",viewBox:"0 0 41 38",fill:e?.color,...e},M.createElement(l1,{d:"M1 36.5699V23.38L6.78992 13.95L11.38 21.1L15.77 13.95L20.2799 20.9L24.52 13.95L29.2799 21.72H29.2999V1H39.6599L39.5 36.5699H1Z",stroke:t.labelPrimary,strokeWidth:"1.5",strokeMiterlimit:"10"}))},c2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:97,height:96,viewBox:"0 0 97 96",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3851 13.1468C13.5574 11.976 15.4569 11.9773 16.6277 13.1496L27.9846 24.5217C28.1023 24.6223 28.2127 24.7326 28.3146 24.8521L42.6984 39.255C42.822 39.3602 42.9376 39.4756 43.0432 39.6003L75.1832 71.7828C76.354 72.9552 76.3524 74.8548 75.1804 76.0256C74.008 77.1964 72.1084 77.1952 70.9376 76.0228L62.0424 67.1156C61.3924 67.0936 60.7448 66.8612 60.2096 66.4088C54.1684 61.3036 45.2316 61.3112 39.2382 66.4328C37.9786 67.5092 36.0849 67.3608 35.0085 66.1012C33.9321 64.8416 34.0807 62.948 35.3402 61.8716C39.9733 57.9124 45.8648 56.1808 51.6056 56.6652L39.8186 44.8624C35.3322 46.0972 31.0205 48.292 27.1617 51.3804C25.8681 52.416 23.9802 52.2064 22.9449 50.9128C21.9096 49.6192 22.1189 47.7312 23.4125 46.696C26.9883 43.8344 30.923 41.6148 35.0573 40.0948L25.3825 30.407C21.9621 32.084 18.6787 34.2088 15.5787 36.709C14.2891 37.7491 12.4003 37.5468 11.3602 36.257C10.3201 34.9674 10.5224 33.0786 11.8121 32.0385C14.6889 29.7185 17.7374 27.6685 20.9314 25.95L12.3822 17.3894C11.2114 16.2171 11.2127 14.3176 12.3851 13.1468ZM83.8028 36.7014C71.9412 27.0553 56.9396 23.1622 42.5252 25.0733C40.8828 25.2911 39.3749 24.1361 39.1571 22.4936C38.9394 20.8511 40.0943 19.3431 41.7368 19.1254C57.7328 17.0046 74.4024 21.3231 87.5884 32.0464C88.8736 33.0918 89.0684 34.9813 88.0228 36.2668C86.9776 37.5522 85.088 37.7468 83.8028 36.7014ZM59.8708 41.7084C60.416 40.144 62.1268 39.3179 63.6912 39.8634C68.0844 41.3952 72.2192 43.6924 75.9788 46.696C77.2732 47.73 77.4844 49.6176 76.45 50.9124C75.416 52.2068 73.5284 52.4176 72.2336 51.3836C68.988 48.7908 65.4484 46.8304 61.7156 45.5288C60.1512 44.9836 59.3252 43.2728 59.8708 41.7084ZM49.7016 75.7004C51.3588 75.7004 52.7016 77.0436 52.7016 78.7004V78.868C52.7016 80.5248 51.3588 81.868 49.7016 81.868C48.0448 81.868 46.7016 80.5248 46.7016 78.868V78.7004C46.7016 77.0436 48.0448 75.7004 49.7016 75.7004Z",fill:t.labelPrimary}))};function d2(e){const{COLORS:t}=bL();return M.createElement(f1,{width:49,height:48,viewBox:"0 0 49 48",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M19.535 42a1.5 1.5 0 011.5-1.5h7.926a1.5 1.5 0 010 3h-7.926a1.5 1.5 0 01-1.5-1.5zM19.535 6a1.5 1.5 0 011.5-1.5h7.926a1.5 1.5 0 010 3h-7.926a1.5 1.5 0 01-1.5-1.5zM7 18.54a1.5 1.5 0 011.5 1.499v7.924a1.5 1.5 0 01-3 0v-7.924a1.5 1.5 0 011.5-1.5zM43 18.54a1.5 1.5 0 011.5 1.499v7.924a1.5 1.5 0 01-3 0v-7.924a1.5 1.5 0 011.5-1.5zM24.473 31.574a1.5 1.5 0 011.5 1.5v.088a1.5 1.5 0 01-3 0v-.088a1.5 1.5 0 011.5-1.5zM18.324 20.084A6.66 6.66 0 0125 13.408a6.67 6.67 0 016.675 6.676c0 2.604-1.489 4.445-3.437 5.522l-.343.193c-.576.324-1.032.58-1.404.915-.372.334-.527.636-.522 1.057a1.5 1.5 0 11-3 .039c-.02-1.51.69-2.583 1.515-3.326.645-.58 1.446-1.026 2.014-1.342l.265-.148.018-.01c1.231-.68 1.894-1.63 1.894-2.9A3.67 3.67 0 0025 16.408a3.66 3.66 0 00-3.676 3.676 1.5 1.5 0 01-3 0zM6.847 32.343A1.5 1.5 0 018.54 33.62c.538 3.843 3.007 6.41 6.782 6.85a1.5 1.5 0 11-.348 2.98c-5.235-.611-8.693-4.326-9.405-9.415a1.5 1.5 0 011.278-1.693zM43.063 32.343a1.5 1.5 0 011.278 1.693c-.712 5.085-4.147 8.801-9.385 9.414a1.5 1.5 0 11-.349-2.98c3.771-.44 6.224-3.002 6.763-6.85a1.5 1.5 0 011.693-1.277zM16.638 5.865a1.5 1.5 0 01-1.316 1.664c-3.77.442-6.243 3.022-6.782 6.87a1.5 1.5 0 11-2.97-.416c.71-5.085 4.165-8.82 9.404-9.434a1.5 1.5 0 011.664 1.316zM33.292 5.865a1.5 1.5 0 011.664-1.316c5.242.614 8.674 4.354 9.385 9.434a1.5 1.5 0 11-2.971.416c-.54-3.852-2.996-6.429-6.763-6.87a1.5 1.5 0 01-1.315-1.664z",fill:t.labelTertiary}))}const h2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:25,viewBox:"0 0 24 25",fill:"none",...e},M.createElement(l1,{d:"M20.9369 17.9484L18.4094 18.4528L17.9078 15.9393",stroke:e?.color??t.labelPrimary,strokeWidth:1.44,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement(l1,{d:"M3.68064 6.78526L6.19133 6.20428L6.76944 8.7019",stroke:e?.color??t.labelPrimary,strokeWidth:1.44,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement(l1,{d:"M18.3836 18.2968C21.7013 15.066 21.8396 9.7597 18.6638 6.35981C16.6744 4.22928 13.8508 3.34661 11.171 3.74264",stroke:e?.color??t.labelPrimary,strokeWidth:1.44,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement(l1,{d:"M6.22222 6.36179C3.00353 9.69069 3.0259 14.9998 6.30344 18.3026C8.35649 20.3705 11.2053 21.1682 13.8719 20.6908",stroke:e?.color??t.labelPrimary,strokeWidth:1.44,strokeLinecap:"round",strokeLinejoin:"round"}))},m2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:16,height:16,viewBox:"0 0 16 16",fill:"none",...e},M.createElement(l1,{d:"M7 12C9.76142 12 12 9.76142 12 7C12 4.23858 9.76142 2 7 2C4.23858 2 2 4.23858 2 7C2 9.76142 4.23858 12 7 12Z",stroke:t.iconSearch,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement(l1,{d:"M10.6666 11.3333L14 13.9999",stroke:t.iconSearch,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},p2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:39,height:25,viewBox:"0 0 39 25",fill:"none",...e},M.createElement(l1,{d:"M0 0.569824V24.7127H39V0.569824H0ZM1.15617 1.71512H37.8438V23.5685H1.15617V1.71512ZM23.3605 6.55721C22.882 6.56019 21.2049 6.58767 21.2 6.59248C21.1908 6.60164 21.1956 18.3199 21.2049 18.4937L21.2139 18.6678L21.3242 18.6742C21.3846 18.6774 21.9166 18.6793 22.5065 18.6786C23.4462 18.6774 23.5815 18.6744 23.6007 18.6554C23.6199 18.6364 23.6234 18.5141 23.6257 17.6961C23.6271 17.1805 23.6326 16.3241 23.6382 15.7927C23.644 15.261 23.6507 14.3077 23.6532 13.6739C23.6576 12.595 23.6705 11.9472 23.6879 11.9298C23.7075 11.9103 23.763 11.9926 23.85 12.1696C23.9025 12.2764 23.9695 12.4058 23.9991 12.4569C24.0287 12.5079 24.1344 12.7077 24.2341 12.9005C24.3335 13.0936 24.4863 13.3866 24.5735 13.552C24.715 13.82 24.7967 13.9728 25.0288 14.4039C25.0649 14.4707 25.2261 14.7736 25.387 15.0766C25.8041 15.8625 26.0923 16.4056 26.246 16.6945C26.3193 16.8324 26.4368 17.0545 26.5066 17.1883C26.8722 17.8895 27.2704 18.6014 27.324 18.6495C27.3506 18.6733 27.386 18.6767 27.6529 18.6818C27.8173 18.6848 27.9551 18.6905 27.959 18.6946C27.9731 18.7097 29.6988 18.6848 29.7145 18.6692C29.7247 18.6591 29.7324 18.056 29.7384 16.8044C29.7509 14.2607 29.7548 6.61928 29.7439 6.60141C29.7379 6.59202 29.3212 6.58721 28.5313 6.58721H27.3277L27.3183 7.38411C27.3067 8.33975 27.3086 11.5502 27.3213 12.4926C27.3264 12.8628 27.3271 13.2203 27.3231 13.2872L27.316 13.4088L27.278 13.3587C27.2373 13.3048 27.0919 13.0625 27.0919 13.0487C27.0919 13.0442 27.06 12.9848 27.0214 12.9168C26.9827 12.8488 26.9141 12.7223 26.8683 12.6358C26.8225 12.5492 26.7672 12.4493 26.7455 12.414C26.7238 12.3785 26.5804 12.108 26.4271 11.8125C26.2738 11.5173 26.1383 11.2596 26.1258 11.2399C26.1135 11.2204 25.9887 10.9852 25.8481 10.7174C25.7077 10.4498 25.5294 10.1115 25.452 9.96584C25.3747 9.82016 25.2705 9.62362 25.2203 9.52925C25.1703 9.43465 24.9997 9.11259 24.8411 8.81344C24.4743 8.12214 24.1289 7.45993 23.9485 7.1026C23.7866 6.78146 23.6932 6.61699 23.6532 6.58103C23.6285 6.55881 23.5942 6.55583 23.3605 6.55721ZM14.2773 6.57507C13.5973 6.5627 12.8139 6.65662 12.1981 6.82933C11.414 7.049 10.9679 7.26111 10.4846 7.64295C10.0904 7.95447 9.80758 8.28454 9.58628 8.69181C9.35436 9.11832 9.2207 9.76175 9.27111 10.2091C9.30325 10.4947 9.34164 10.6546 9.43853 10.9041C9.67693 11.517 10.1033 12.0457 10.6525 12.4094C11.1182 12.7178 11.386 12.8279 12.3181 13.093C13.2421 13.3557 14.1053 13.5483 15.046 13.7016C15.7276 13.8124 15.9362 13.8523 16.0676 13.8965C16.342 13.989 16.6209 14.1686 16.7777 14.3537C16.8834 14.479 16.925 14.5486 16.9721 14.6799C17.0057 14.7726 17.0096 14.8049 17.0101 14.9909C17.0108 15.1462 17.0045 15.2218 16.9853 15.2915C16.8272 15.8678 16.4442 16.2407 15.7861 16.4583C15.2992 16.6193 14.5097 16.6688 13.9261 16.5751C12.8453 16.4013 12.2126 16.0048 11.8413 15.2695C11.7326 15.0544 11.6353 14.8086 11.5983 14.6545C11.5377 14.402 11.524 14.3677 11.4836 14.3704C11.4637 14.3716 11.3758 14.3796 11.2884 14.3878C11.201 14.3961 10.9538 14.4188 10.7392 14.4387C9.93822 14.5131 9.26926 14.5873 9.25261 14.6038C9.23851 14.6176 9.26672 14.8011 9.33147 15.1188C9.51507 16.0196 9.88874 16.7836 10.4368 17.3775C10.9182 17.8995 11.6704 18.2718 12.6252 18.4612C13.1468 18.5645 13.8486 18.6474 14.374 18.6678C14.9463 18.69 15.4289 18.6454 16.1515 18.5031C17.2272 18.2917 17.8074 18.0175 18.3855 17.4465C18.6058 17.2286 18.7321 17.0646 18.8888 16.7925C18.9904 16.6166 19.1462 16.2787 19.1982 16.1218C19.3152 15.7702 19.3867 15.2802 19.3687 14.9577C19.3532 14.6868 19.3076 14.3267 19.2611 14.1104C19.2123 13.8837 19.1955 13.8308 19.1039 13.6093C18.9409 13.2155 18.7742 12.9631 18.4937 12.685C18.1743 12.3684 17.8256 12.1483 17.3872 11.9866C17.1599 11.9028 17.0089 11.8654 16.5275 11.7754C15.554 11.5935 14.8251 11.43 14.1788 11.2481C14.0278 11.2055 13.7839 11.1372 13.6371 11.0965C12.4101 10.7559 12.0327 10.4863 12.0327 9.94935C12.0327 9.67837 12.165 9.40762 12.4212 9.15428C12.5354 9.04113 12.7301 8.89797 12.8552 8.8352C13.1697 8.67738 13.7991 8.54796 14.2512 8.54842C14.627 8.54888 15.249 8.65241 15.5917 8.77084C15.8271 8.85238 16.0715 9.01501 16.1977 9.17444C16.3695 9.39136 16.5434 9.7125 16.6651 10.0373C16.7557 10.2794 16.7562 10.2808 16.8057 10.2808C16.829 10.2808 16.9564 10.2746 17.0887 10.2668C17.2212 10.2593 17.479 10.2462 17.6619 10.238C18.2497 10.2109 18.8012 10.1812 18.8877 10.1715C18.9846 10.161 19.0149 10.1385 19.0059 10.0836C18.9453 9.71548 18.8329 9.28301 18.7314 9.02761C18.6558 8.83772 18.4902 8.52139 18.3822 8.36013C18.0173 7.81543 17.6048 7.45466 17.026 7.17406C16.3404 6.84216 15.5507 6.65387 14.562 6.58721C14.4697 6.58103 14.3745 6.57691 14.2773 6.57507Z",fill:t.labelPrimary}))};function f2(e){const{COLORS:t}=bL();return M.createElement(f1,{width:48,height:48,viewBox:"0 0 56 56",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M28 51.615c13.255 0 24-10.745 24-24s-10.745-24-24-24-24 10.745-24 24 10.745 24 24 24zm-6.137-15.402a1 1 0 001.51 1.302l9.334-9.334.097-.112a1 1 0 00-.097-1.302l-9.333-9.333-.112-.097a1 1 0 00-1.302.097l-.097.112a1 1 0 00.097 1.302l8.625 8.626L21.96 36.1l-.097.113z",fill:t.bgSliderKnob}))}const _2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M12 2C17.53 2 22 6.48 22 12C22 17.53 17.53 22 12 22C6.48 22 2 17.53 2 12C2 6.48 6.48 2 12 2ZM11.65 6.93C11.24 6.93 10.9 7.26 10.9 7.68V12.73C10.9 12.99 11.04 13.23 11.27 13.37L15.19 15.71C15.31 15.78 15.44 15.82 15.58 15.82C15.83 15.82 16.08 15.69 16.22 15.45C16.43 15.1 16.32 14.64 15.96 14.42L12.4 12.3V7.68C12.4 7.26 12.06 6.93 11.65 6.93Z",fill:e?.color??t.labelPrimary}))},g2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:"41",height:"26",viewBox:"0 0 41 26",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M38.731 1.43448H1.43448V24.5655H38.731V1.43448ZM0 0V26H40.1655V0H0Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M5.86475 6.40173H8.48226V13.423C8.48226 14.5372 8.51468 15.2594 8.57953 15.5895C8.69154 16.1201 8.95683 16.5475 9.37539 16.8718C9.79986 17.1901 10.3776 17.3493 11.1086 17.3493C11.8514 17.3493 12.4115 17.199 12.7888 16.8983C13.1661 16.5917 13.393 16.2174 13.4697 15.7753C13.5463 15.3331 13.5846 14.5991 13.5846 13.5734V6.40173H16.2021V13.2108C16.2021 14.7672 16.1314 15.8666 15.9899 16.5092C15.8484 17.1518 15.5861 17.6942 15.2029 18.1363C14.8256 18.5785 14.3186 18.9322 13.6819 19.1975C13.0452 19.4569 12.214 19.5866 11.1882 19.5866C9.95019 19.5866 9.00989 19.4451 8.3673 19.1621C7.73061 18.8732 7.22656 18.5018 6.85516 18.0479C6.48375 17.5881 6.2391 17.1076 6.12119 16.6065C5.95023 15.8637 5.86475 14.7672 5.86475 13.3169V6.40173Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M18.9611 6.40173H23.7452C24.824 6.40173 25.6464 6.48427 26.2124 6.64934C26.9728 6.87336 27.6243 7.27129 28.1666 7.84313C28.709 8.41498 29.1217 9.11652 29.4047 9.94775C29.6876 10.7731 29.8291 11.793 29.8291 13.0074C29.8291 14.0745 29.6965 14.9941 29.4312 15.7664C29.1069 16.7097 28.6442 17.4731 28.0428 18.0567C27.5889 18.4989 26.9758 18.8438 26.2035 19.0914C25.6258 19.2741 24.8535 19.3655 23.8867 19.3655H18.9611V6.40173ZM21.5787 8.59478V17.1813H23.5329C24.264 17.1813 24.7916 17.14 25.1158 17.0575C25.5403 16.9514 25.8911 16.7716 26.1681 16.5181C26.4511 16.2646 26.681 15.8489 26.8579 15.2712C27.0347 14.6876 27.1232 13.8947 27.1232 12.8925C27.1232 11.8903 27.0347 11.1209 26.8579 10.5844C26.681 10.048 26.4334 9.62941 26.1151 9.32875C25.7967 9.02809 25.3929 8.8247 24.9036 8.71858C24.5381 8.63605 23.8218 8.59478 22.7548 8.59478H21.5787Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M31.978 19.3655V6.40173H34.5955V19.3655H31.978Z",fill:t.labelPrimary}))},y2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:"82",height:"28",viewBox:"0 0 82 28",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M40.2613 1.10811H1.10811V26.2252H40.2613V1.10811ZM0 0V27.3333H41.3694V0H0Z",fill:t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M80.8919 1.10811H41.3693V26.2252H80.8919V1.10811ZM40.2612 0V27.3333H82V0H40.2612Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M10.1362 8.20728H12.4318V14.365C12.4318 15.3422 12.4602 15.9755 12.5171 16.265C12.6153 16.7304 12.848 17.1052 13.2151 17.3896C13.5873 17.6688 14.094 17.8084 14.7351 17.8084C15.3866 17.8084 15.8777 17.6765 16.2086 17.4128C16.5395 17.144 16.7386 16.8157 16.8058 16.4279C16.873 16.0401 16.9066 15.3965 16.9066 14.4968V8.20728H19.2022V14.1789C19.2022 15.5438 19.1402 16.508 19.0161 17.0716C18.892 17.6352 18.6619 18.1108 18.3258 18.4986C17.9949 18.8863 17.5503 19.1966 16.9919 19.4292C16.4335 19.6567 15.7045 19.7704 14.8049 19.7704C13.7192 19.7704 12.8945 19.6464 12.331 19.3982C11.7726 19.1449 11.3305 18.8191 11.0048 18.421C10.6791 18.0177 10.4645 17.5964 10.3611 17.1569C10.2112 16.5055 10.1362 15.5438 10.1362 14.2719V8.20728Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M21.343 19.5766V8.20728H23.6385V13.256L28.2762 8.20728H31.3628L27.0819 12.6356L31.5955 19.5766H28.6252L25.4998 14.2409L23.6385 16.141V19.5766H21.343Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M45.9097 19.5766V8.20728H50.7412C51.9562 8.20728 52.8377 8.31068 53.3858 8.51749C53.939 8.71913 54.3811 9.08104 54.7119 9.60323C55.0428 10.1254 55.2083 10.7226 55.2083 11.3947C55.2083 12.2478 54.9575 12.9535 54.456 13.5119C53.9545 14.0651 53.2048 14.4141 52.207 14.5589C52.7033 14.8484 53.1118 15.1664 53.4323 15.5128C53.758 15.8592 54.1949 16.4744 54.743 17.3585L56.1312 19.5766H53.3858L51.7262 17.1026C51.1367 16.2185 50.7335 15.6627 50.5163 15.4352C50.2992 15.2026 50.0691 15.0449 49.8261 14.9622C49.5831 14.8743 49.1979 14.8303 48.6706 14.8303H48.2052V19.5766H45.9097ZM48.2052 13.0156H49.9037C51.0049 13.0156 51.6925 12.969 51.9666 12.876C52.2406 12.7829 52.4552 12.6226 52.6103 12.3951C52.7654 12.1677 52.8429 11.8833 52.8429 11.5421C52.8429 11.1595 52.7395 10.8518 52.5327 10.6192C52.3311 10.3813 52.0441 10.2314 51.6719 10.1694C51.4857 10.1435 50.9274 10.1306 49.9967 10.1306H48.2052V13.0156Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M57.0621 19.5766V8.20728H65.4921V10.1306H59.3577V12.6511H65.0656V14.5666H59.3577V17.661H65.7093V19.5766H57.0621Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M67.3382 19.5766V8.20728H71.022C72.4179 8.20728 73.3279 8.26415 73.7519 8.37789C74.4033 8.54851 74.9488 8.92076 75.3882 9.49466C75.8277 10.0634 76.0474 10.8001 76.0474 11.7049C76.0474 12.4029 75.9208 12.9897 75.6674 13.4654C75.4141 13.941 75.0909 14.3159 74.698 14.5899C74.3102 14.8587 73.9147 15.0371 73.5114 15.125C72.9634 15.2336 72.1698 15.2879 71.1306 15.2879H69.6338V19.5766H67.3382ZM69.6338 10.1306V13.3568H70.8902C71.7949 13.3568 72.3999 13.2973 72.7049 13.1784C73.0099 13.0595 73.2478 12.8734 73.4184 12.62C73.5942 12.3667 73.6821 12.072 73.6821 11.7359C73.6821 11.3223 73.5606 10.9811 73.3176 10.7122C73.0746 10.4434 72.7669 10.2754 72.3947 10.2081C72.1207 10.1564 71.57 10.1306 70.7428 10.1306H69.6338Z",fill:t.labelPrimary}))},v2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9617 12.9951H11.9927C14.8247 12.9951 17.1287 10.6912 17.1287 7.85917C17.1287 5.02717 14.8247 2.72217 11.9927 2.72217C9.15975 2.72217 6.85575 5.02717 6.85575 7.85617C6.85075 9.22517 7.37975 10.5132 8.34375 11.4841C9.30675 12.4541 10.5917 12.9911 11.9617 12.9951ZM8.35575 7.85917C8.35575 5.85417 9.98775 4.22217 11.9927 4.22217C13.9977 4.22217 15.6287 5.85417 15.6287 7.85917C15.6287 9.86417 13.9977 11.4951 11.9927 11.4951H11.9647C10.9967 11.4931 10.0897 11.1131 9.40775 10.4262C8.72575 9.74017 8.35275 8.82917 8.35575 7.85917Z",fill:e?.color??t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.40552 19.8591C4.40552 23.4841 10.1215 23.4841 11.9995 23.4841C13.8775 23.4841 19.5945 23.4841 19.5945 19.8371C19.5945 17.0441 16.1165 14.6841 11.9995 14.6841C7.88352 14.6841 4.40552 17.0541 4.40552 19.8591ZM5.90552 19.8591C5.90552 18.1241 8.51152 16.1841 11.9995 16.1841C15.4885 16.1841 18.0945 18.1131 18.0945 19.8371C18.0945 21.2611 16.0435 21.9841 11.9995 21.9841C7.95652 21.9841 5.90552 21.2691 5.90552 19.8591Z",fill:e?.color??t.labelPrimary}))},b2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.007 3C13.0263 3 13.9386 3.52359 14.4443 4.40053L21.6252 16.836C22.1279 17.706 22.1249 18.7443 21.6163 19.6123C21.1076 20.4814 20.1992 21 19.187 21H4.81404C3.80075 21 2.89239 20.4814 2.38374 19.6123C1.8751 18.7443 1.8721 17.706 2.37475 16.836L9.5697 4.39855C10.0753 3.5226 10.9867 3 12.007 3ZM12.006 4.48466C11.5303 4.48466 11.1066 4.72814 10.8688 5.13692L3.67584 17.5734C3.442 17.9792 3.444 18.4632 3.68083 18.868C3.91767 19.2728 4.34137 19.5153 4.81404 19.5153H19.187C19.6586 19.5153 20.0823 19.2728 20.3192 18.868C20.557 18.4632 20.559 17.9792 20.3232 17.5734L13.1432 5.13692C12.9064 4.72814 12.4827 4.48466 12.006 4.48466ZM11.9992 15.3712C12.5518 15.3712 12.9985 15.8136 12.9985 16.3609C12.9985 16.9083 12.5518 17.3507 11.9992 17.3507C11.4466 17.3507 10.9949 16.9083 10.9949 16.3609C10.9949 15.8136 11.4376 15.3712 11.9892 15.3712H11.9992ZM11.9972 9.49687C12.4109 9.49687 12.7467 9.82943 12.7467 10.2392V13.3075C12.7467 13.7173 12.4109 14.0498 11.9972 14.0498C11.5835 14.0498 11.2477 13.7173 11.2477 13.3075V10.2392C11.2477 9.82943 11.5835 9.49687 11.9972 9.49687Z",fill:e?.color??t.labelPrimary}))};var S2=(e=>(e.MainBottomTabs="MainBottomTabs",e.NewCalculationStack="NewCalculationStack",e.AccountWebView="AccountWebView",e.ActiveInsulin="ActiveInsulin",e.RegisterActiveInsulin="RegisterActiveInsulin",e.CalculationBottomTabs="CalculationBottomTabs",e.LoadingRecommendation="LoadingRecommendation",e.Recommendation="Recommendation",e.LeavingRecommendation="LeavingRecommendation",e.DashboardTab="DashboardTab",e.LogbooksTab="LogbooksTab",e.FoodTab="FoodTab",e.SettingsTab="SettingsTab",e.Dashboard="Dashboard",e.ActiveInsulinChart="ActiveInsulinChart",e.MyDay="MyDay",e.GlucoseBGM="GlucoseBGM",e.GlucoseCGM="GlucoseCGM",e.CarbohydrateChart="CarbohydrateChart",e.RapidInsulinChart="RapidInsulinChart",e.TimeInRange="TimeInRange",e.LicensingStatus="LicensingStatus",e.LicensingWebView="LicensingWebView",e.LicensingInfoWebView="LicensingInfoWebView",e.Logbooks="Logbooks",e.RecommendationLogbook="RecommendationLogbook",e.Settings="Settings",e.ProfileStack="ProfileStack",e.GlucoseSettings="GlucoseSettings",e.ActivitySettings="ActivitySettings",e.InsulinSettingsStack="InsulinSettingsStack",e.Notifications="Notifications",e.Theme="Theme",e.SetupGlucoseMeters="SetupGlucoseMeters",e.IFU="IFU",e.Support="Support",e.SupportWebView="SupportWebView",e.SupportContact="SupportContact",e.Legal="Legal",e.GlucoseUnit="GlucoseUnit",e.Profile="Profile",e.BiologicalSex="BiologicalSex",e.DiabetesType="DiabetesType",e.InsulinSettings="InsulinSettings",e.TreatmentType="TreatmentType",e.RapidActingInsulin="RapidActingInsulin",e.LongActingInsulin="LongActingInsulin",e.GlucoseTab="GlucoseTab",e.CarbsTab="CarbsTab",e.ActivityTab="ActivityTab",e.SummaryTab="SummaryTab",e.NovoPenSync="NovoPenSync",e.NovoPenConflict="NovoPenConflict",e.NovoPenSetupScreen1="NovoPenSetupScreen1",e.NovoPenSetupScreen2="NovoPenSetupScreen2",e.NovoPenSetupScreen3="NovoPenSetupScreen3",e.NovoPenSetupScreen4="NovoPenSetupScreen4",e.SmartPenSetupStack="SmartPenSetupStack",e.SmartPenSetupScreen1="SmartPenSetupScreen1",e.SmartPenSetupScreen2="SmartPenSetupScreen2",e.RenameSmartPen="RenameSmartPen",e.SetupCGMWebview="SetupCGMWebview",e.SetupForecastWebview="SetupForecastWebview",e.AddActivity="AddActivity",e.AddLogbook="AddLogbook",e.AddCarbs="AddCarbs",e.CreateFood="CreateFood",e.FoodLibraryStack="FoodLibraryStack",e.SyncNovoPenStack="SyncNovoPenStack",e.NovoPenSetupStack="NovoPenSetupStack",e.FoodLibrary="FoodLibrary",e.FoodDetails="FoodDetails",e))(S2||{}),w2=(e=>(e.SetupBolusCalculator="SetupBolusCalculator",e.QuickGuideStack="QuickGuideStack",e.LicensingInfoWebView="LicensingInfoWebView",e.LicensingWebView="LicensingWebView",e.LicensingStatus="LicensingStatus",e.SetupStart="SetupStart",e.Setup="Setup",e.BiologicalSex="BiologicalSex",e.TreatmentType="TreatmentType",e.RapidActingInsulin="RapidActingInsulin",e.LongActingInsulin="LongActingInsulin",e.InsulinSettings="InsulinSettings",e.QuickGuideStart="QuickGuideStart",e.QuickGuide="QuickGuide",e.QuickGuideAllSet="QuickGuideAllSet",e))(w2||{});const k2={selectedEventUUID:null,activityDurationSeconds:0},C2=cL()(e=>({...k2,activityStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(k2)}}}));var E2="/api/v3";const I2=uV?"/api/v2":Wj.HEDIA_API_URL_V2,x2=uV?E2:Wj.HEDIA_API_URL_V3,T2={frequentlyAdded:[],searchResults:[],myFood:[],isLoading:!1,hasSearched:!1,isMyFoodTab:!1,query:"",selectedFoodItem:void 0,animatedEntryId:void 0},O2=cL()((t,n)=>({...T2,foodStoreActions:{set:e=>{t(t=>({...t,...e}))},clear:()=>{t(T2)},search:async i=>{const r=encodeURIComponent(n().query.toLowerCase().trim());try{t({isLoading:!0});const e=await R2(r,i);if(!e)throw new Error("[foodStore::search] Failed to search for food items");t({searchResults:e})}catch(e){console.error(e),t({searchResults:[]})}finally{t({isLoading:!1})}},loadMyFood:async()=>{try{t({isLoading:!0});const e=await L2();if(!e)throw new Error("[foodStore::loadMyFood] Failed to load my food items");t({myFood:e})}catch(e){console.error(e)}finally{t({isLoading:!1})}},createMyFoodItem:async n=>{try{t({isLoading:!0});const e=await P2(n);if(!e)throw new Error("[foodStore::createMyFoodItem] Failed to create food item");return t(t=>({myFood:[e,...t.myFood],animatedEntryId:e.id.toString()})),!0}catch(e){return console.error(e),!1}finally{t({isLoading:!1})}},updateMyFoodItem:async i=>{try{t({isLoading:!0});const e=await M2(i);if(!e)throw new Error("[foodStore::updateMyFoodItem] Failed to update food item");return t(t=>({myFood:t.myFood.map(t=>t.id===e.id?e:t)})),e.id===n().selectedFoodItem?.id&&t({selectedFoodItem:e}),!0}catch(e){return console.error(e),!1}finally{t({isLoading:!1})}},deleteMyFoodItem:async n=>{try{if(t({isLoading:!0}),!n.id)throw new Error("[foodStore::deleteMyFoodItem] Failed to delete food item");return await D2(n),t(e=>({myFood:e.myFood.filter(e=>e.id!==n.id)})),!0}catch(e){return console.error(e),!1}finally{t({isLoading:!1})}},loadFrequentFoodItems:async()=>{try{t({isLoading:!0});const e=await A2();if(!e)throw new Error("[foodStore::loadFrequentFoodItems] Failed to load frequently added food items");t({frequentlyAdded:e})}catch(e){console.error(e),t({frequentlyAdded:[]})}finally{t({isLoading:!1})}}}})),R2=async(t,n)=>{try{const e=await VX(`${I2}/food?search=${t}&language=${n}`);return await e.json()}catch(e){return void console.error(e)}},A2=async()=>{try{const e=await VX(`${I2}/food/frequent`);return await e.json()}catch(e){return void console.error(e)}},L2=async()=>{try{const e=await VX(`${I2}/food/myfood`);return await e.json()}catch(e){return void console.error(e)}},P2=async t=>{try{const e=await VX(`${I2}/food`,{method:NL.HTTPRequestMethod.POST,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await e.json()}catch(e){return void console.error(e)}},M2=async t=>{try{const e=await VX(`${I2}/food/${t.id}`,{method:NL.HTTPRequestMethod.PUT,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await e.json()}catch(e){return void console.error(e)}},D2=async e=>{await VX(`${x2}/food-items/${e.id}`,{method:NL.HTTPRequestMethod.DELETE})},N2={availableGlucoseReadings:[],selectedReadingId:null},F2=cL()((e,t)=>({...N2,glucoseStoreActions:{set:t=>{e(e=>({...e,...t}))},addAvailableGlucoseReading:t=>{e(e=>{const n=e.availableGlucoseReadings.findIndex(e=>e.id===t.id||e.source===t.source);if(-1!==n){const i=[...e.availableGlucoseReadings];return i[n]=t,{...e,availableGlucoseReadings:i}}return{...e,availableGlucoseReadings:[...e.availableGlucoseReadings,t]}})},setAvailableGlucoseReadings:t=>{e(e=>({...e,availableGlucoseReadings:t}))},setSelectedReadingId:t=>{e(e=>({...e,selectedReadingId:t}))},getReadingById:e=>{if(null===e)return null;return t().availableGlucoseReadings.find(t=>t.id===e)??null},clear:()=>{e(N2)}}})),B2={isGoToSettingsPressed:!1,showDiscardCalculationModal:!1,showDiscardSmartPenSetupModal:!1,showSyncErrorModal:!1},j2=cL()(e=>({...B2,modalStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(B2)}}})),V2={setupCalculatorSettings:{},totalDailyDosage:null},H2=cL()(e=>({...V2,setupCalculatorActions:{setSetupCalculatorStoreValues:t=>{e(e=>({setupCalculatorSettings:{...e.setupCalculatorSettings,...t}}))},setTotalDailyDosage:t=>{e({totalDailyDosage:t})},clear:()=>{e(V2)}}})),z2=()=>H2(e=>e.setupCalculatorActions),U2=()=>H2(e=>e.setupCalculatorSettings),G2=()=>H2(e=>e.totalDailyDosage),W2=()=>{TX.getState().carbohydrateStoreActions.clear(),F2.getState().glucoseStoreActions.clear(),C2.getState().activityStoreActions.clear()},Y2={top:10,bottom:10,left:20,right:20},$2=()=>{const{goBack:e}=Wp(),{COLORS:t}=bL();return D.createElement(eh,{onPress:e,testID:"header-back-button",style:({pressed:e})=>[{opacity:e?.5:1},e0.iconContainerOutline,e0.backButton],hitSlop:Y2},D.createElement(Z1,{height:27,width:27,color:t.iconBrand}))},X2=({onPress:e})=>{const{pop:t}=Wp(),{COLORS:n}=bL();return D.createElement(eh,{onPress:e??(()=>{t()}),testID:"header-close-button",style:({pressed:e})=>[{opacity:e?.5:1},e0.iconContainerOutline,e0.closeButton],hitSlop:Y2},D.createElement(J1,{height:27,width:27,color:n.iconBrand}))},q2=()=>{const{navigate:e}=Wp(),{COLORS:t}=bL(),n=M.useCallback(()=>{uV&&W2(),e(S2.SettingsTab)},[e]);return D.createElement(eh,{onPress:n,testID:"header-profile-button",style:({pressed:e})=>[{opacity:e?.5:1},e0.iconContainerOutline,e0.profileButton],hitSlop:Y2},D.createElement(v2,{color:t.iconBrand}))},Z2=({onPress:e,title:t,disabled:n=!1})=>{const{t:i}=iV(),{COLORS:r}=bL();return D.createElement(eh,{style:({pressed:e})=>[{opacity:e?.5:1},e0.doneButton],onPress:()=>{!n&&e()},disabled:n},D.createElement(gj,{style:[e0.doneText,{color:r.textNavigationBarLabel},n&&{color:r.labelTertiary}],allowFontScaling:!1},t??i("button_add")))},K2=({onPress:e})=>{const{t:t}=iV(),n=Wp(),{COLORS:i}=bL(),r=M.useCallback(()=>{n.pop()},[n]);return D.createElement(eh,{style:({pressed:e})=>[{opacity:e?.5:1},e0.cancelButton],onPress:e??r},D.createElement(gj,{style:[e0.cancelText,{color:i.textNavigationBarLabel}],allowFontScaling:!1},t("button_cancel")))},Q2=({onPress:e})=>{const{t:t}=iV(),n=Wp(),{COLORS:i}=bL(),r=M.useCallback(()=>{n.pop()},[n]);return D.createElement(eh,{style:({pressed:e})=>[{opacity:e?.5:1},e0.cancelButton],onPress:e??r},D.createElement(gj,{style:[e0.cancelText,{color:i.textNavigationBarLabel}],allowFontScaling:!1},t("button_close")))},J2=({onPress:e})=>{const{COLORS:t}=bL();return D.createElement(eh,{onPress:e,style:({pressed:e})=>[{opacity:e?.5:1},e0.iconContainerOutline,e0.editButton],hitSlop:Y2},D.createElement(i2,{color:t.iconBrand}))},e0=Ei.create({headerLeftContainerStyle:{paddingLeft:16},headerTitle:{...oj.medium_Base},modalHeaderTitle:{...oj.medium_Base},iconContainerOutline:{padding:4},iconContainer:{padding:4},backButton:{marginLeft:uV?4:-12,marginRight:12},closeButton:{marginLeft:uV?4:-12,marginRight:uV?12:0},cancelButton:{marginLeft:uV?12:0},profileButton:{marginRight:uV?12:0},doneButton:{paddingRight:uV?12:0,paddingLeft:8},editButton:{marginRight:uV?12:-4,marginLeft:4},doneText:{...oj.semiBold_Base},cancelText:{...oj.regular_Base}}),t0={headerShown:!0,headerLeft:$2,headerTitleStyle:e0.headerTitle,headerTitleAlign:"center",headerBlurEffect:"regular"};e0.modalHeaderTitle;const n0={animationEnabled:!0,cardStyle:{flex:1},headerShown:!0,headerLeft:$2,headerTitleStyle:e0.headerTitle,headerTitleAlign:"center",headerTitleAllowFontScaling:!1},i0={...n0,presentation:"modal",headerLeft:X2,headerTitleStyle:e0.modalHeaderTitle,headerTitleAllowFontScaling:!1,headerLeftContainerStyle:{flex:1},headerTitleContainerStyle:{flex:3,alignItems:"center"},headerRightContainerStyle:{flex:1}},r0={headerLeftContainerStyle:e0.headerLeftContainerStyle,headerTitleStyle:e0.headerTitle,headerTitleAlign:"center",headerTitleAllowFontScaling:!1},a0=({setUnit:e,currentUnit:t})=>{const{COLORS:n}=bL(),i="ml"===t,r="cl"===t;return M.createElement(_a,{style:[o0.container,{backgroundColor:n.bgSegmentCard}]},M.createElement(xc,{style:i?[o0.selected,{backgroundColor:n.bgBrand}]:o0.unselected,onPress:()=>{e("ml")},testID:`unit-selector-ml-button-${i}`},M.createElement(gj,{style:[o0.unitText,{color:i?n.textLabelActive:n.textLabelInactive}]},"ml")),M.createElement(xc,{style:r?[o0.selected,{backgroundColor:n.bgBrand}]:o0.unselected,onPress:()=>{e("cl")},testID:`unit-selector-cl-button-${r}`},M.createElement(gj,{style:[o0.unitText,{color:r?n.textLabelActive:n.textLabelInactive}]},"cl")))},o0=Ei.create({container:{flex:1,flexDirection:"row",borderRadius:16,marginVertical:8,overflow:"hidden",padding:2},unselected:{flex:1,alignItems:"center",justifyContent:"center"},selected:{flex:1,alignItems:"center",justifyContent:"center",borderRadius:16},unitText:{...oj.regular_SM,padding:8}}),s0=({ref:e,style:t,onChangeText:n,onFocusChange:i,...r})=>{const{COLORS:a}=bL(),o=M.useCallback(e=>{const t=e.replace(/\D+/g,"");n(t)},[n]),s=M.useCallback(()=>{i?.(!0)},[i]),l=M.useCallback(()=>{i?.(!1)},[i]);return D.createElement(kh,{cursorColor:a.iconBrand,placeholder:"-",placeholderTextColor:a.labelSecondary,maxLength:3,inputMode:"numeric",enterKeyHint:"done",ref:e,style:t,onFocus:s,onBlur:l,autoFocus:void 0!==i,...r,onChangeText:o})},l0="add-carbs-details",u0=uV&&{outline:"none"},c0=()=>{const{t:e}=iV(),{COLORS:t}=bL(),n=Wp(),i=df(),{selectedFoodItem:r}=O2(),{cartItems:a,carbohydrateStoreActions:o}=TX(),[s,l]=M.useState(!1),u=M.useMemo(()=>a.find(e=>e.foodItem.id===r?.id),[a,r]);if(!r)throw new Error("[AddCarbs::render] selectedFoodItem is undefined");const c=M.useMemo(()=>{const e={foodItem:r,amount:0,unit:r.liquid?"ml":"g"};return u??e},[u,r]),[d,h]=M.useState(c.amount?c.amount.toString():""),[m,p]=M.useState(c.foodItem.liquid?"ml":"g"),[f,_]=M.useState(!1),[g,y]=M.useState(!1),[v,b]=M.useState(!1),S=M.useCallback((e=0)=>{const t=Number(d)||100,n="ml"===m||"g"===m?t:10*t;return Math.round(n*e/100)},[d,m]),w=M.useCallback(()=>{S(c.foodItem.carbohydrates)>300?_(!0):(o.upsertCartItem({foodItem:r,unit:m,amount:Number(d)}),null!==r.user_id?jX(FX.CarbsFoodLibraryPersonalInput):jX(FX.CarbsFoodLibraryDatabaseInput),n.pop(),!i.params.isCarbItem&&setTimeout(()=>{n.pop()},500))},[S,c.foodItem.carbohydrates,o,r,m,d,n,i.params.isCarbItem]);M.useEffect(()=>{const e=()=>{n.navigate(S2.CreateFood)};n.setOptions({title:c.foodItem.title,headerLeft:()=>D.createElement(Q2,{onPress:()=>{const e=c.amount?c.amount.toString():"";d===e?n.pop():y(!0)}}),headerRight:null!==r.user_id?()=>D.createElement(J2,{onPress:e}):()=>null})},[c.foodItem.title,d,n,r,c.amount]);const k=M.useCallback(()=>{v&&n.pop()},[n,v]),C=M.useMemo(()=>void 0===m?"":"g"===m?e("grams"):m,[m,e]);return D.createElement(Xa,{contentContainerStyle:[d0.pageWrapper,{backgroundColor:t.bgSheet}],disableScrollViewPanResponder:!0,keyboardDismissMode:"on-drag"},D.createElement(_a,{style:[d0.calculationCard,{backgroundColor:t.bgSecondary}]},D.createElement(_a,{style:d0.row},r.liquid?D.createElement(_a,{style:d0.liquidInputContainer},D.createElement(s0,{placeholderTextColor:t.labelPrimary,style:[d0.amountInputLiquid,{color:t.labelPrimary,backgroundColor:t.bgSecondaryInputInactive,borderColor:t.divider},s&&{borderColor:t.borderInputFocus}],value:d,onChangeText:h,onFocusChange:l,testID:`${l0}-amount-input`}),D.createElement(a0,{setUnit:p,currentUnit:m})):D.createElement(_a,{style:[d0.gramInputContainer,{borderColor:t.divider,backgroundColor:t.bgSecondaryInputInactive},s&&{borderColor:t.borderInputFocus}]},D.createElement(s0,{placeholderTextColor:t.labelPrimary,style:[d0.amountInputGrams,{color:t.labelPrimary}],value:d,onFocusChange:l,onChangeText:h,testID:`${l0}-amount-input`}),D.createElement(gj,{style:d0.weightText},e("food_card_unit")))),D.createElement(_a,{style:d0.dashedLineContainer},Array.from({length:20},(e,t)=>t).map(e=>D.createElement(_a,{key:e,style:[d0.dashedLine,{backgroundColor:t.divider}]}))),D.createElement(_a,{style:d0.carbsTotalContainer},D.createElement(_a,{style:d0.left},D.createElement(gj,{style:d0.carbAmount},Number(d)<1?0:S(c.foodItem.carbohydrates)),D.createElement(gj,{style:d0.carbsText},e("my_food_add_unit"))),D.createElement(mj,{title:e("button_add"),onPress:w,disabled:Number(d)<1,size:hj.Small}))),D.createElement(_a,{style:d0.foodNameContainer},D.createElement(gj,{style:d0.title},c.foodItem.title),D.createElement(gj,{style:[d0.subtitle,{color:t.labelSecondary}]},e("food_library_carb_body",{amount:""===d?"100":d,unit:C}))),!!c.foodItem.description&&c.foodItem.description!==c.foodItem.title&&D.createElement(_a,{style:d0.descriptionContainer},D.createElement(gj,{style:[d0.descriptionHeader,{color:t.labelSecondary}]},e("food_overview_description")),D.createElement(gj,{style:d0.description,testID:`${l0}-description`},c.foodItem.description)),D.createElement(_a,{style:[d0.valuesCard,{backgroundColor:t.bgSecondary}]},D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("logbook_personal_log_card_carbs")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}],testID:`${l0}-carbs`},S(c.foodItem.carbohydrates),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit")))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_library_item_energy")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}],testID:`${l0}-kcal`},S(c.foodItem.energy),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," kcal"))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_add_library_item_protein")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}]},S(c.foodItem.protein),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit")))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_add_library_item_sugar")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}]},S(c.foodItem.sugar),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit")))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_add_library_item_fibers")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}]},S(c.foodItem.fibers),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit")))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_add_library_item_fat")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}]},S(c.foodItem.fat),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit")))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_add_library_item_sfat")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}]},S(c.foodItem.saturated_fat),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit"))))),D.createElement(lz,{isVisible:f,title:e("current_glucose_invalid_modal_title"),message:e("current_glucose_invalid_modal_body"),buttons:[{testID:"close-button",title:e("button_close"),onPress:()=>{_(!1)}}]}),D.createElement(lz,{isVisible:g,title:e("food_modal_discard_title"),onModalHide:k,buttons:[{type:dj.Error,testID:"discard-button",title:e("button_discard_changes"),onPress:()=>{y(!1),b(!0)}},{type:dj.Secondary,testID:"keep-button",title:e("button_cancel"),onPress:()=>{y(!1)}}]}))},d0=Ei.create({pageWrapper:{paddingHorizontal:16,paddingVertical:32},calculationCard:{padding:16,borderRadius:16,marginBottom:16},valuesCard:{borderRadius:16},row:{flexDirection:"row",marginBottom:24},liquidInputContainer:{flexDirection:"row",alignItems:"center",gap:16,flex:1,borderRadius:16,overflow:"hidden"},gramInputContainer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flex:1,paddingHorizontal:16,borderWidth:1,borderRadius:16,overflow:"hidden"},amountInputGrams:{...oj.regular_Base,width:"100%",textAlign:"left",paddingVertical:16,flex:2,fontFamily:cV?aj.RobotoRegular:aj.PoppinsRegular,...u0},amountInputLiquid:{...oj.regular_Base,width:"100%",textAlign:"left",padding:16,flex:1,borderWidth:1,borderRadius:16,fontFamily:cV?aj.RobotoRegular:aj.PoppinsRegular,...u0},weightText:{flex:1,textAlign:"right"},line:{height:1},carbsTotalContainer:{justifyContent:"space-between",paddingTop:24,flexDirection:"row",flexWrap:"wrap"},left:{alignItems:"baseline",alignSelf:"center",flexDirection:"row",flexWrap:"wrap"},carbAmount:{...oj.bold_3XL,marginRight:4},carbsText:{...oj.medium_Base},foodNameContainer:{marginBottom:16},title:{...oj.semiBold_LG},subtitle:{...oj.regular_Base},tableCell:{flexDirection:"row",justifyContent:"space-between",alignContent:"center",paddingHorizontal:16,paddingVertical:16},cellText:{...oj.regular_Base,textAlign:"left"},cellValue:{...oj.regular_Base,textAlign:"right"},gText:{...oj.regular_Base},descriptionContainer:{marginBottom:16},descriptionHeader:{...oj.regular_XS},description:{...oj.regular_Base},dashedLineContainer:{flexDirection:"row",justifyContent:"space-between"},dashedLine:{height:1,width:8}}),h0=()=>{},m0={setDefaultMode:h0,setInputMode:h0,preload:h0,setFocusTo:h0},p0=()=>({remove:h0}),f0=_a,_0=_a,g0=()=>{},y0=()=>g0,v0=e=>({value:e,addListener:g0,removeListener:g0,modify:g0,get:()=>e,set:g0}),b0=v0(0),S0=v0(null),w0={enabled:!0,animated:{progress:new uu.Value(0),height:new uu.Value(0)},reanimated:{progress:b0,height:b0},layout:S0,setKeyboardHandlers:y0,setInputHandlers:y0,setEnabled:g0},k0=M.createContext(w0),C0=()=>M.useContext(k0);let E0={height:0,duration:0,timestamp:(new Date).getTime(),target:-1,type:"default",appearance:"light"};const I0={setDefaultMode:m0.setDefaultMode,setInputMode:m0.setInputMode,setFocusTo:m0.setFocusTo,preload:m0.preload,dismiss:async e=>(null==e||e.keepFocus,new Promise(e=>{e()})),isVisible:()=>!1,state:()=>E0};BR.createAnimatedComponent(uu.createAnimatedComponent(f0)),Ei.create({container:{flex:1},hidden:{display:"none",position:"absolute"}}),lr.OS;const x0=Aa.get("screen");let T0={width:x0.width,height:x0.height};const O0=["keyboardDidShow","keyboardDidHide"],R0=()=>({...I0.state(),isVisible:I0.isVisible()}),A0=e=>e;function L0(e,t){M.useEffect(()=>()=>I0.setDefaultMode(),[]),function(e,t){const n=C0();M.useLayoutEffect(()=>{const t=n.setKeyboardHandlers(e);return()=>t()},t)}(e,t)}lr.OS;const P0="android"===lr.OS&&lr.Version>=30||"ios"===lr.OS,M0={duration:250,easing:uE.bezier(.19919472913616398,.010644531250000006,.27920937042459737,.91025390625)},D0=(e,t)=>{let n;return t&&(n=t.find(t=>t>=e)),n??e};function N0(){return N0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},N0.apply(null,arguments)}const F0=M.forwardRef(({children:e,onLayout:t,bottomOffset:n=0,disableScrollOnKeyboardHide:i=!1,enabled:r=!0,extraKeyboardSpace:a=0,ScrollViewComponent:o=BR.ScrollView,snapToOffsets:s,...l},u)=>{const c=kR(),d=uR(null),h=uR(0),m=LR(c),p=uR(0),f=uR(0),_=uR(!1),g=uR(-1),y=uR(0),v=uR(0),{input:b}={input:C0().layout},S=uR(null),w=uR(null),{height:k}=(()=>{const[e,t]=M.useState(T0);return M.useEffect(()=>(t(T0),()=>{}),[]),e})(),C=M.useCallback(e=>{"function"==typeof u?u(e):u&&(u.current=e),c(e)},[]),E=M.useCallback(e=>{d.value=c.current,null==t||t(e)},[t]),I=M.useCallback((e,t=!1)=>{var i,a,o;if(!r)return 0;if((null===(i=S.value)||void 0===i?void 0:i.parentScrollViewTarget)!==d.value)return 0;const l=k-f.value,u=((null===(a=S.value)||void 0===a?void 0:a.layout.absoluteY)||0)+((null===(o=S.value)||void 0===o?void 0:o.layout.height)||0);if(l-u<=n){const i=f.value-(k-u)+n,r=QR(e,[y.value,f.value],[0,D0(i+h.value,s)-h.value]),a=Math.max(r,0)+h.value;return lA(c,0,a,t),r}if(u<0){const e=l-n,i=h.value+u;lA(c,0,i-e,t)}return 0},[n,r,k,s]),x=M.useCallback(e=>{const t=QR(e.height,[0,f.value],[0,f.value+a]);p.value=t},[a]),T=M.useCallback(()=>{var e,t;const n=null===(e=w.value)||void 0===e?void 0:e.selection.end.y;return!(null===(t=b.value)||void 0===t||!t.layout||!n)&&(S.value={...b.value,layout:{...b.value.layout,height:JR(n,0,b.value.layout.height)}},!0)},[b,w,S]),O=M.useCallback(()=>{const e=h.value,t=S.value;T()&&(h.value=m.value,I(f.value,!0),h.value=e,S.value=t)},[I]),R=M.useCallback(()=>{O()},[O]),A=M.useMemo(()=>((e,t=0)=>{const n={time:0};return(...i)=>{const r=Date.now();if(!(r-n.time<t))return n.time=r,e(...i);n.time=r}})(R,200),[R]),L=M.useCallback(e=>{var t,n;const i=null===(t=w.value)||void 0===t?void 0:t.target,r=null===(n=w.value)||void 0===n?void 0:n.selection;if(w.value=e,e.target===i)return e.selection.end.position===e.selection.start.position&&(null==r?void 0:r.end.y)!==e.selection.end.y||e.selection.start.position!==e.selection.end.position?O():void A()},[O,A]);!function(e,t){const n=C0();M.useLayoutEffect(()=>{const t=n.setInputHandlers(e);return()=>t()},t)}({onSelectionChange:L},[L]),((e,t)=>{const n=uR(-1),i=uR(0),r=uR(0),a=uR(0);yR(()=>{if(!P0&&0!==r.value)return{duration:M0.duration,target:n.value,height:a.value,progress:a.value/r.value}},t=>{var n,a;t&&(null===(n=e.onMove)||void 0===n||n.call(e,t),t.height===i.value&&(null===(a=e.onEnd)||void 0===a||a.call(e,t),r.value=i.value))},t),L0({onStart:t=>{var o,s,l;if(!P0&&t.height===r.value)return null===(s=e.onStart)||void 0===s||s.call(e,t),void(null===(l=e.onEnd)||void 0===l||l.call(e,t));n.value=t.target,i.value=t.height,t.height>0&&(r.value=t.height),P0||(a.value=NE(t.height,M0)),null===(o=e.onStart)||void 0===o||o.call(e,{...t,duration:P0?t.duration:M0.duration})},onMove:t=>{var n;P0&&(null===(n=e.onMove)||void 0===n||n.call(e,t))},onEnd:t=>{var n;P0&&(null===(n=e.onEnd)||void 0===n||n.call(e,t))}},t)})({onStart:e=>{const t=f.value!==e.height&&e.height>0;_.value=e.height>0&&0===f.value;const n=0===e.height,i=g.value!==e.target&&-1!==e.target||t;t&&(y.value=f.value),n&&(y.value=0,h.value=v.value),(_.value||t||i)&&(h.value=m.value,f.value=e.height),i&&(g.value=e.target,T(),v.value=m.value),i&&!_.value&&(m.value+=I(e.height,!0))},onMove:e=>{x(e),i&&!_.value||I(e.height)},onEnd:e=>{f.value=e.height,h.value=m.value,x(e)}},[I,i,x]),M.useEffect(()=>{Bk(I)(f.value,!0)},[n]),yR(()=>b.value,(e,t)=>{(null==e?void 0:e.target)===(null==t?void 0:t.target)&&(null==e?void 0:e.layout.height)!==(null==t?void 0:t.layout.height)&&O()},[]);const P=pR(()=>r?{paddingBottom:p.value+1}:{},[r]);return D.createElement(o,N0({ref:C},l,{scrollEventThrottle:16,onLayout:E}),e,r&&D.createElement(BR.View,{style:P}))}),B0={width:13,height:2,borderRadius:1},j0={marginHorizontal:5,width:30,height:30,justifyContent:"center",alignItems:"center"};Ei.create({arrowUpContainer:j0,arrowDownContainer:{...j0,transform:[{rotate:"180deg"}]},arrow:{width:20,height:20,flexDirection:"row",alignItems:"center",justifyContent:"space-between"},arrowLeftLine:{...B0,transform:[{rotate:"-45deg"}],left:-.5},arrowRightLine:{...B0,transform:[{rotate:"45deg"}],left:-5.5}});lr.select({android:({children:e,onPress:t,disabled:n,accessibilityLabel:i,accessibilityHint:r,testID:a,rippleRadius:o=18,style:s,theme:l})=>{const u=function(e=A0){const[t,n]=M.useState(()=>e(R0()));return M.useEffect(()=>{const t=O0.map(t=>p0(t,()=>n(e(R0()))));return n(e(R0())),()=>{t.forEach(e=>e.remove())}},[]),t}(e=>e.appearance),c=M.useMemo(()=>({disabled:n}),[n]),d=M.useMemo(()=>dm.Ripple(l[u].ripple,!0,o),[u,o,l]);return D.createElement(dm,{accessibilityHint:r,accessibilityLabel:i,accessibilityRole:"button",accessibilityState:c,background:d,style:s,testID:a,onPress:t},D.createElement(_a,{style:s},e))},default:({children:e,onPress:t,disabled:n,accessibilityLabel:i,accessibilityHint:r,testID:a,style:o})=>{const s=n?_a:xc,l=M.useMemo(()=>({disabled:n}),[n]);return D.createElement(s,{accessibilityHint:r,accessibilityLabel:i,accessibilityRole:"button",accessibilityState:l,style:o,testID:a,onPress:t},e)}});"ios"===lr.OS&&parseInt(lr.Version,10),Ei.create({flex:{flex:1},toolbar:{position:"absolute",bottom:0,alignItems:"center",width:"100%",flexDirection:"row",height:42},arrows:{flexDirection:"row",paddingLeft:8},doneButton:{fontWeight:"600",fontSize:15},doneButtonContainer:{marginRight:16,marginLeft:8},floating:{alignSelf:"center",borderRadius:20,overflow:"hidden"}}),Ei.create({absolute:{position:"absolute"},stretch:{top:0,bottom:0,left:0,right:0}}),uu.createAnimatedComponent(_0);const V0=({onModalHide:e})=>{const{t:t}=iV(),{showSyncErrorModal:n,modalStoreActions:i}=j2();return D.createElement(lz,{isVisible:n,onModalHide:e,onModalShow:()=>{jX(FX.ErrorOffline)},title:t("glucose_modal_changes_title"),message:t("glucose_modal_changes_body"),buttons:[{title:t("glucose_modal_changes_button_confirm"),onPress:()=>{i.set({showSyncErrorModal:!1})}}]})},H0=[NL.ActivityEnum.Run,NL.ActivityEnum.Walk,NL.ActivityEnum.Cycling,NL.ActivityEnum.Swim,NL.ActivityEnum.Sport,NL.ActivityEnum.Workout,NL.ActivityEnum.Other],z0=Ei.create({container:{flex:1,paddingHorizontal:16},contentContainer:{paddingVertical:32},cardMandatory:{gap:24},segmentContainer:{flexDirection:"row",justifyContent:"center",alignItems:"center",borderRadius:16,padding:2},segment:{flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center",alignSelf:"stretch",paddingVertical:4,borderRadius:16},borderLeft:{alignSelf:"center",height:16,width:1},value:{...oj.medium_Base},intensityDescription:{paddingHorizontal:16,paddingTop:16},intensityDescriptionText:{...oj.regular_XS},inputContainer:{marginTop:24},reductionContainer:{flex:1,flexDirection:"row",justifyContent:"space-between",marginTop:16},reductionDescription:{flex:1,alignSelf:"center",...oj.medium_SM},reductionPercentage:{...oj.bold_4XL,marginLeft:24},typesContainer:{flexDirection:"row",flexWrap:"wrap",gap:8,marginBottom:32},activityType:{borderRadius:16,paddingHorizontal:12,paddingVertical:8},activityTypeText:{...oj.medium_SM}}),U0=iF(()=>{const{t:e}=iV(),{COLORS:t}=bL(),{activityStoreActions:n}=C2(),{modalStoreActions:i,isGoToSettingsPressed:r}=j2(),a=Wp(),o=df(),[s,l]=M.useState(!1),[u,c]=M.useState(!1),{activity:d}=Uq;if(void 0===d)throw new Error("[CreateActivity::render] activitySettings is undefined");const h=M.useMemo(()=>({uuid:RX(),startTimestamp:null,deleted:!1,type:null,activityIntensity:null,durationSeconds:0}),[]),m=M.useMemo(()=>o.params?.activity??h,[h,o.params?.activity]),p=M.useMemo(()=>{if(null===m.startTimestamp)return null;return new Date(m.startTimestamp).getTime()+m.durationSeconds*NL.Milliseconds.Second>Date.now()?0:1},[m]),[f,_]=M.useState(m),[g,y]=M.useState(p),[v,b]=M.useState(0),S=M.useMemo(()=>null!==g&&(1===g?f.durationSeconds>0&&!!f.startTimestamp:f.durationSeconds>0&&!!f.activityIntensity&&!!f.startTimestamp),[f,g]),w=M.useMemo(()=>!DX(f,m),[f,m]),k=M.useCallback(()=>{w?l(!0):a.goBack()},[w,a]),C=M.useCallback(async()=>{const e=o.params?.activity?.uuid,t=e?{...f,uuid:RX()}:f;if(await Dq.create(t,e)){const i=Dq.getEventWithHighestReduction(d);n.set({selectedEventUUID:i?.uuid??t.uuid,activityDurationSeconds:i?.durationSeconds??0}),jX(e?FX.ActivityEditPress:FX.ActivityAddPress),a.goBack()}else i.set({showSyncErrorModal:!0})},[f,d,n,i,a,o.params?.activity]);M.useEffect(()=>{const t=o.params?.activity?e("button_done"):e("button_add"),n=!S||!w;a.setOptions({headerRight:()=>D.createElement(Z2,{title:t,onPress:C,disabled:n}),headerLeft:()=>D.createElement(K2,{onPress:k})})},[k,C,S,o.params?.activity,e,a,w]);const E=e=>{_(t=>({...t,...e}))},I=e=>{const t=60*e,n=Date.now()-(1===g?t*NL.Milliseconds.Second:0);E({durationSeconds:t,startTimestamp:new Date(n).toISOString()})},x=e=>{E({activityIntensity:NL.ActivityIntensity[e]})},T=()=>{E({durationSeconds:0,activityIntensity:null})},O=M.useMemo(()=>Math.round(f.durationSeconds/60),[f.durationSeconds]),R=M.useMemo(()=>{if(!S)return!1;const{activityIntensity:e}=f,{hard:t,light:n,moderate:i,post:r}=d,a=0===g;if(1===g)return 120!==O||null!==r.fromSixtyone;if(a){if(60===O&&e===NL.ActivityIntensity.hard)return null!==t.fromFortysix;if(120===O&&e===NL.ActivityIntensity.hard)return null!==t.fromSixtyone;if(120===O&&e===NL.ActivityIntensity.moderate)return null!==i.fromSixtyone;if(120===O&&e===NL.ActivityIntensity.light)return null!==n.fromSixtyone}return!0},[f,d,g,S,O]);M.useEffect(()=>{if(!R)return;const{activityIntensity:e,startTimestamp:t}=f,n=Rq.getReduction(O,d,e,new Date(t));b(n)},[d,f,O,S,R]);const A=M.useCallback(()=>{u&&setTimeout(a.goBack,100)},[u,a]),L=M.useCallback(()=>{l(!1),c(!0)},[]);return D.createElement(D.Fragment,null,D.createElement(F0,{testID:"create-activity-scroll-view",style:[z0.container,{backgroundColor:t.bgSheet}],contentContainerStyle:z0.contentContainer,keyboardDismissMode:uV?"none":"on-drag",automaticallyAdjustKeyboardInsets:!0,contentInsetAdjustmentBehavior:"automatic"},D.createElement(_a,{style:z0.cardMandatory},D.createElement(_a,null,D.createElement(Ej,{title:e("new_activity_when_title")}),D.createElement(_a,{style:[z0.segmentContainer,{backgroundColor:t.bgSegmentContainer}]},D.createElement(eh,{style:[z0.segment,0===g&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{y(0),0!==f.durationSeconds&&E({startTimestamp:(new Date).toISOString()})},testID:`starting-now-touchable-${0===g}`},D.createElement(gj,{style:[z0.value,{color:0===g?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},e("new_activity_intensity_option1"))),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,1===g&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{if(y(1),0!==f.durationSeconds){const e=new Date(Date.now()-f.durationSeconds*NL.Milliseconds.Second);E({startTimestamp:e.toISOString(),activityIntensity:null})}},testID:`just-finished-now-touchable-${1===g}`},D.createElement(gj,{style:[z0.value,{color:1===g?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},e("new_activity_intensity_option2"))))),D.createElement(_a,null,D.createElement(Ej,{title:e("new_activity_duration_title")}),D.createElement(_a,{style:[z0.segmentContainer,{backgroundColor:t.bgSegmentContainer}]},D.createElement(eh,{style:[z0.segment,29===O&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{I(29)}},D.createElement(gj,{style:[z0.value,{color:29===O?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},"0-29")),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,45===O&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{I(45)}},D.createElement(gj,{style:[z0.value,{color:45===O?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},"30-45")),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,60===O&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{I(60)}},D.createElement(gj,{style:[z0.value,{color:60===O?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},"46-60")),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,120===O&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{I(120)}},D.createElement(gj,{style:[z0.value,{color:120===O?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},"61-120")))),0===g&&D.createElement(_a,null,D.createElement(Ej,{title:e("new_activity_intensity_title")}),D.createElement(_a,{style:[z0.segmentContainer,{backgroundColor:t.bgSegmentContainer}]},D.createElement(eh,{style:[z0.segment,f.activityIntensity===NL.ActivityIntensity.light&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{x(NL.ActivityIntensity.light)},testID:`activity-light-touchable-${f.activityIntensity===NL.ActivityIntensity.light}`},D.createElement(gj,{style:[z0.value,{color:f.activityIntensity===NL.ActivityIntensity.light?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},e("activity_intensity_1"))),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,f.activityIntensity===NL.ActivityIntensity.moderate&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{x(NL.ActivityIntensity.moderate)},testID:`activity-moderate-touchable-${f.activityIntensity===NL.ActivityIntensity.moderate}`},D.createElement(gj,{style:[z0.value,{color:f.activityIntensity===NL.ActivityIntensity.moderate?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},e("activity_intensity_2"))),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,f.activityIntensity===NL.ActivityIntensity.hard&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{x(NL.ActivityIntensity.hard)},testID:`activity-hard-touchable-${f.activityIntensity===NL.ActivityIntensity.hard}`},D.createElement(gj,{style:[z0.value,{color:f.activityIntensity===NL.ActivityIntensity.hard?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},e("activity_intensity_3")))),f.activityIntensity&&D.createElement(_a,{style:z0.intensityDescription},f.activityIntensity===NL.ActivityIntensity.light&&D.createElement(gj,{style:z0.intensityDescriptionText},e("activity_intensity_1_text")),f.activityIntensity===NL.ActivityIntensity.moderate&&D.createElement(gj,{style:z0.intensityDescriptionText},e("activity_intensity_2_text")),f.activityIntensity===NL.ActivityIntensity.hard&&D.createElement(gj,{style:z0.intensityDescriptionText},e("activity_intensity_3_text"))))),D.createElement(mV,{testID:"activity-title-input",placeholder:e("new_activity_note_input"),value:f.title??"",onChangeText:e=>{E({title:e})},maxFontSizeMultiplier:sj,containerStyle:z0.inputContainer}),D.createElement(_a,{style:z0.typesContainer},H0.map(e=>{const n=f.type===e,i=`activity-${e}-touchable-${n}`.toLowerCase();return D.createElement(eh,{testID:i,key:e,style:[z0.activityType,{backgroundColor:t.bgSegmentContainer},n&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{E({type:NL.ActivityEnum[e]})}},D.createElement(gj,{style:[z0.activityTypeText,{color:n?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},eZ[e]()))})),R&&D.createElement(_a,null,D.createElement(fj,null),D.createElement(_a,{style:z0.reductionContainer},D.createElement(gj,{style:z0.reductionDescription,maxFontSizeMultiplier:sj},e("new_activity_reduction_amount_body")),D.createElement(gj,{style:z0.reductionPercentage,testID:"create-activity-reduction-percentage",maxFontSizeMultiplier:sj},`${Math.round(100*v)}%`)))),D.createElement(V0,null),D.createElement(lz,{isVisible:!R&&S,title:e("new_activity_modal_reduction_title"),message:e("new_activity_modal_reduction_subtitle"),onModalHide:()=>{r&&(a.goBack(),i.set({showDiscardCalculationModal:!0}))},buttons:[{title:e("button_settings"),testID:"settings-button",onPress:()=>{T(),i.set({isGoToSettingsPressed:!0})}},{title:e("button_cancel"),testID:"cancel-button",onPress:T,type:dj.Secondary}]}),D.createElement(lz,{isVisible:s,title:e("new_activity_modal_discard_title"),onModalHide:A,buttons:[{title:e("button_discard_changes"),testID:"discard-button",type:dj.Error,onPress:L},{title:e("button_keep_editing"),testID:"keep-button",type:dj.Secondary,onPress:()=>{l(!1)}}]}))});const G0=Ei.create({button:{borderRadius:13},buttonText:{fontSize:17,lineHeight:22,fontWeight:"600",paddingHorizontal:16,paddingVertical:14,textAlign:"center"}}),W0=D.memo(function({onPress:e}){const{t:t}=iV(),{COLORS:n}=bL();return D.createElement(eh,{accessibilityRole:"button",style:[G0.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:"wheel-picker-modal-cancel"},D.createElement(gj,{style:[G0.buttonText,{color:n.textKeyboardButtons}]},t("button_cancel")))});const Y0=Ei.create({button:{borderBottomLeftRadius:13,borderBottomRightRadius:13},buttonText:{fontSize:17,lineHeight:22,fontWeight:"400",paddingHorizontal:16,paddingVertical:14,textAlign:"center"}}),$0=D.memo(function({onPress:e}){const{t:t}=iV(),{COLORS:n}=bL();return D.createElement(eh,{accessibilityRole:"button",style:[Y0.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:"wheel-picker-modal-confirm"},D.createElement(gj,{style:[Y0.buttonText,{color:n.textKeyboardButtons}]},t("button_confirm")))});var X0=(e=>(e.selection="selection",e.impactLight="impactLight",e.impactMedium="impactMedium",e.impactHeavy="impactHeavy",e.rigid="rigid",e.soft="soft",e.notificationSuccess="notificationSuccess",e.notificationWarning="notificationWarning",e.notificationError="notificationError",e.clockTick="clockTick",e.contextClick="contextClick",e.keyboardPress="keyboardPress",e.keyboardRelease="keyboardRelease",e.keyboardTap="keyboardTap",e.longPress="longPress",e.textHandleMove="textHandleMove",e.virtualKey="virtualKey",e.virtualKeyRelease="virtualKeyRelease",e.effectClick="effectClick",e.effectDoubleClick="effectDoubleClick",e.effectHeavyClick="effectHeavyClick",e.effectTick="effectTick",e))(X0||{});const q0=Object.freeze(Object.defineProperty({__proto__:null,HapticFeedbackTypes:X0,triggerHaptic:function(e="selection",t){}},Symbol.toStringTag,{value:"Module"}));const Z0=Ei.create({item:{alignItems:"center",justifyContent:"center",zIndex:100},itemPressable:{width:"100%"},itemText:{textAlign:"center",fontSize:22,lineHeight:26,fontWeight:"400"}}),K0=D.memo(function({textStyle:e,style:t,height:n,option:i,onItemPress:r}){const{COLORS:a}=bL();return D.createElement(_a,{style:[Z0.item,t,{height:n}]},D.createElement(eh,{style:Z0.itemPressable,onPress:r},D.createElement(hl,{style:[e,Z0.itemText,{color:a.labelPrimary}]},i)))});const Q0=Ei.create({mask:{position:"absolute",left:0,right:0,pointerEvents:"none"}}),J0=M.memo(function({itemHeight:e,visibleRest:t}){const{COLORS:n}=bL(),i=e*t;return D.createElement(D.Fragment,null,D.createElement(tj,{colors:[n.iosKeyboardPicker+"FF",n.iosKeyboardPicker+"4D"],style:[Q0.mask,{top:0,height:i}]}),D.createElement(tj,{colors:[n.iosKeyboardPicker+"4D",n.iosKeyboardPicker+"FF"],style:[Q0.mask,{bottom:0,height:i}]}))});const e3=Ei.create({container:{borderTopLeftRadius:13,borderTopRightRadius:13,alignSelf:"center"},selectedIndicator:{position:"absolute",borderRadius:7,top:"50%",alignSelf:"center"}}),t3=D.memo(function({testID:e,initialScrollIndex:t,options:n,onChange:i,selectedIndicatorStyle:r={},containerStyle:a={},itemStyle:o={},itemTextStyle:s={},itemHeight:l=36,visibleRest:u=3,decelerationRate:c="normal",containerProps:d={},flatListProps:h={},accessibilityLabel:m,ref:p}){const{t:f}=iV(),{COLORS:_}=bL(),{width:g}=vm(),y=(1+2*u)*l,v=M.useRef(null),b=M.useRef(null);M.useImperativeHandle(p,()=>({scrollToIndex(e){v.current?.scrollToIndex({index:e,animated:!0})}}),[]);const[S]=M.useState(new uu.Value(0)),w=M.useMemo(()=>{const e=[...n];for(let t=0;t<u;t++)e.unshift(null),e.push(null);return e},[n,u]),k=M.useMemo(()=>[...Array(w.length)].map((e,t)=>t*l),[w,l]),C=M.useCallback(e=>{uV||b.current!==e&&(b.current=e)},[]),E=M.useCallback(e=>{const t=e.nativeEvent.contentOffset.y,r=Math.min(n.length-1,Math.max(0,Math.round(t/l)));C(r),uV&&(i(r),v.current?.scrollToIndex({index:r,animated:!0}))},[C,l,i,n.length]),I=vL((...e)=>{const t=e[0];E(t)},100),x=M.useCallback(e=>{const t=e.nativeEvent.contentOffset.y,r=Math.min(l*(n.length-1),Math.max(t,0));let a=Math.floor(Math.floor(r)/l);Math.floor(r%l)>l/2&&a++,i(a)},[l,i,n.length]);return D.createElement(_a,{accessible:!0,accessibilityHint:f("wheelpicker_accessibility_label"),accessibilityLabel:m,accessibilityRole:"adjustable",style:[e3.container,{backgroundColor:_.iosKeyboardPicker,height:y,width:g},a],...d},D.createElement(_a,{style:[e3.selectedIndicator,{backgroundColor:_.iosSelectorKeyboard},{transform:[{translateY:-l/2}],height:l,width:g-32-20},r]}),D.createElement(uu.FlatList,{...h,testID:e,ref:v,showsVerticalScrollIndicator:!1,removeClippedSubviews:cV,onScroll:uu.event([{nativeEvent:{contentOffset:{y:S}}}],{useNativeDriver:!uV,listener:uV?I:E}),scrollEventThrottle:16,initialScrollIndex:t,onMomentumScrollEnd:x,snapToInterval:l,snapToOffsets:k,decelerationRate:c,getItemLayout:(e,t)=>({length:l,offset:l*t,index:t}),data:w,keyExtractor:(e,t)=>t.toString(),windowSize:31,initialNumToRender:2*u+1,maxToRenderPerBatch:12,updateCellsBatchingPeriod:50,renderItem:({item:e,index:t})=>D.createElement(K0,{key:`option-${t}`,option:e,style:o,textStyle:s,height:l,onItemPress:()=>{const e=Math.max(0,Math.min(t-u,n.length-1));v.current?.scrollToIndex({index:e,animated:!0})}})}),D.createElement(J0,{itemHeight:l,visibleRest:u}))});const n3=D.memo(function({items:e,isVisible:t,onCancel:n,onConfirm:i,onModalHide:r,initialScrollIndex:a,accessibilityLabel:o,testID:s}){const{COLORS:l}=bL(),[u,c]=M.useState(a),{width:d}=vm();M.useEffect(()=>{c(a)},[a]);const h=M.useCallback(e=>{c(e)},[]),m=M.useCallback(()=>{i(parseFloat(e[u]))},[e,i,u]),p=M.useCallback(()=>{c(a),n()},[a,n]);return D.createElement(lz,{isVisible:t,containerStyle:{backgroundColor:l.bgTransparent},onModalHide:r},D.createElement(_a,null,D.createElement(_a,{style:i3.pickersContainer},D.createElement(t3,{testID:s,initialScrollIndex:a,options:e,onChange:h,accessibilityLabel:o,containerStyle:{width:d-32}})),D.createElement(_a,{style:i3.buttonContainer},D.createElement($0,{onPress:m}),D.createElement(W0,{onPress:p}))))}),i3=Ei.create({pickersContainer:{flexDirection:"row",borderTopLeftRadius:13,borderTopRightRadius:13,overflow:"hidden"},buttonContainer:{gap:8}}),r3=({isLiquid:e,setSelected:t})=>{const{t:n}=iV(),{COLORS:i}=bL();return M.createElement(_a,{style:[a3.container,{backgroundColor:i.bgInputActive}]},M.createElement(eh,{style:[a3.segment,!e&&{backgroundColor:i.bgSegmentPrimary}],onPress:()=>{t(!1)},testID:`food-type-food-${e}`},M.createElement(gj,{style:[a3.value,{color:e?i.textLabelInactive:i.textLabelActive}],maxFontSizeMultiplier:sj},n("add_food_segment_food"))),M.createElement(eh,{style:[a3.segment,e&&{backgroundColor:i.bgSegmentPrimary}],onPress:()=>{t(!0)},testID:`food-type-drink-${e}`},M.createElement(gj,{style:[a3.value,{color:e?i.textLabelActive:i.textLabelInactive}],maxFontSizeMultiplier:sj},n("add_food_segment_drink"))))},a3=Ei.create({container:{flexDirection:"row",justifyContent:"center",alignItems:"center",borderRadius:16,marginBottom:24,padding:2},segment:{flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center",paddingVertical:7,borderRadius:16},value:{...oj.medium_Base}}),o3={id:Date.now(),title:"",keywords:"",description:"",liquid:!1,energy:0,carbohydrates:0,protein:0,sugar:0,fibers:0,fat:0,saturated_fat:0,source:null,user_id:null},s3=PX(0,100),l3=PX(0,999),u3="create-food",c3=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{foodStoreActions:n,selectedFoodItem:i,isLoading:r}=O2(),{cartItems:a,carbohydrateStoreActions:o}=TX(),{modalStoreActions:s}=j2(),l=Wp(),[u,c]=M.useState(i??o3),[d,h]=M.useState(""),[m,p]=M.useState(!1),[f,_]=M.useState(!1),[g,y]=M.useState(0),[v,b]=M.useState(!1);M.useEffect(()=>{p(Boolean(u.title&&u.carbohydrates))},[u.title,u.carbohydrates]);const S=M.useCallback(e=>{const t=a.find(t=>t.foodItem.id===e.id);t&&o.upsertCartItem({...t,foodItem:e})},[a,o]),w=M.useCallback(async()=>{if(r)return;const e=i?await n.updateMyFoodItem(u):await n.createMyFoodItem(u);i&&e&&S(u),e?(l.pop(),jX(FX.FoodLibraryCreatePress)):s.set({showSyncErrorModal:!0})},[u,r,i,n,l,S,s]);M.useEffect(()=>{const t=e(i?"button_done":"button_add"),n=()=>{l.pop()};l.setOptions({title:u.title,headerLeft:()=>D.createElement(K2,{onPress:n}),headerRight:()=>D.createElement(Z2,{title:t,onPress:w,disabled:!m})})},[u.title,m,l,w,i,e]);const k=M.useCallback(e=>{Pu.dismiss(),h(e),y(Number(u[e])),_(!0)},[u]),C=M.useCallback(e=>{c(t=>({...t,[d]:e})),_(!1),h("")},[d]),E=M.useCallback(async()=>{if(!i||r)return;b(!1);await n.deleteMyFoodItem(i)?(o.removeFromCart(i.id,"id"),l.dispatch(Am.pop()),l.dispatch(Am.pop()),n.set({selectedFoodItem:void 0})):setTimeout(()=>{s.set({showSyncErrorModal:!0})},300)},[i,r,n,o,l,s]),{carbohydrates:I,description:x,energy:T,fat:O,fibers:R,liquid:A,protein:L,saturated_fat:P,sugar:N,title:F}=u;return D.createElement(Xa,{testID:`${u3}-scroll`,keyboardDismissMode:"on-drag",keyboardShouldPersistTaps:"always",style:{backgroundColor:t.bgSheet}},D.createElement(_a,{style:d3.container},D.createElement(r3,{isLiquid:A,setSelected:e=>{c(t=>({...t,liquid:e}))}}),D.createElement(gj,{style:[d3.sectionHeader,{color:t.labelPrimary}]},e("food_add_title")),D.createElement(_a,{style:d3.mandatorySection},D.createElement(mV,{value:F,placeholder:e(A?"food_add_library_input_drink_name":"food_add_library_input_name"),onChangeText:e=>{c(t=>({...t,title:e}))},testID:`${u3}-name`,autoFocus:!i}),D.createElement(kj,{title:e("food_add_library_item_carbs"),onPress:()=>{k("carbohydrates")},style:d3.smallNegativeMarginTop,renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-carbohydrates`},I," / 100g")})),D.createElement(gj,{style:[d3.sectionHeader,{color:t.labelPrimary}]},e("food_add_optional_title")),D.createElement(_a,{style:d3.optionalSection},D.createElement(mV,{value:x,placeholder:e("add_food_overview_description"),onChangeText:e=>{c(t=>({...t,description:e}))},testID:`${u3}-description`,containerStyle:d3.noBorder}),D.createElement(kj,{title:e("food_add_library_item_energy"),onPress:()=>{k("energy")},style:d3.mediumNegativeMarginTop,renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-energy`},T," / 100g")}),D.createElement(kj,{title:e("food_library_item_protein"),onPress:()=>{k("protein")},renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-protein`},L," / 100g")}),D.createElement(kj,{title:e("food_library_item_sugar"),onPress:()=>{k("sugar")},renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-sugar`},N," / 100g")}),D.createElement(kj,{title:e("food_library_item_fibers"),onPress:()=>{k("fibers")},renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-fibers`},R," / 100g")}),D.createElement(kj,{title:e("food_library_item_fat"),onPress:()=>{k("fat")},renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-fat`},O," / 100g")}),D.createElement(kj,{title:e("food_library_item_sfat"),onPress:()=>{k("saturated_fat")},renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-saturated-fat`},P," / 100g")})),i&&D.createElement(mj,{type:dj.ErrorSecondary,title:e("button_delete_food"),testID:"delete_food_button",onPress:()=>{b(!0)}})),D.createElement(lz,{isVisible:v,title:e("food_modal_delete_food_title"),buttons:[{title:e("button_delete_food"),type:dj.Error,testID:"delete_modal_delete_button",onPress:E},{title:e("button_cancel"),type:dj.Secondary,testID:"delete_modal_cancel_button",onPress:()=>{b(!1)}}]}),D.createElement(n3,{isVisible:f,items:"energy"===d?l3:s3,initialScrollIndex:g,onCancel:()=>{_(!1)},onConfirm:C}),D.createElement(V0,null))},d3=Ei.create({container:{flex:1,paddingHorizontal:16,paddingTop:32,paddingBottom:64},mandatorySection:{marginBottom:24},optionalSection:{marginBottom:24,gap:8},sectionHeader:{...oj.medium_SM,marginHorizontal:16,marginBottom:8},rightSlot:{...oj.regular_Base},noBorder:{borderWidth:0},smallNegativeMarginTop:{marginTop:-8},mediumNegativeMarginTop:{marginTop:-16}}),h3=({item:e,index:t,testID:n})=>{const{t:i}=iV(),{navigate:r}=Wp(),{foodStoreActions:a}=O2(),o=df(),{COLORS:s}=bL(),l=`${n}-${t}`;return D.createElement(xc,{style:[m3.container,{backgroundColor:s.bgInputActive}],onPress:()=>{a.set({selectedFoodItem:e}),o.params?.comingFrom===S2.FoodTab?r(S2.FoodDetails):r(S2.AddCarbs,{isCarbItem:!1})},testID:l},D.createElement(gj,{style:[m3.title,{color:s.labelPrimary}],numberOfLines:1,maxFontSizeMultiplier:uj,testID:`${l}-title`},e.title),D.createElement(gj,{style:[m3.subTitle,{color:s.labelSecondary}],numberOfLines:1,testID:`${l}-subtitle`,maxFontSizeMultiplier:uj},(()=>{const t=e.carbohydrates.toFixed(),n=i("new_cal_carbohydrates_input_unit"),r=i("food_card_kcal",{value:e.energy.toString()});return`${i("food_card_carb",{value:t,carbs:n})} ${r} ${i("food_card_grams")}`})()))},m3=Ei.create({container:{padding:16,borderRadius:16},title:{...oj.medium_Base,marginBottom:4},subTitle:{...oj.regular_SM}}),p3=uV?{outline:"none"}:{},f3=({comingFrom:e})=>{const{t:t,language:n}=iV(),{COLORS:i}=bL(),{query:r,foodStoreActions:a}=O2(),o=()=>{a.set({hasSearched:!1,query:"",searchResults:[]})},s=async()=>{""!==r&&(a.set({hasSearched:!0}),await a.search(n),e===S2.FoodTab?jX(FX.FoodLibrarySearched):jX(FX.CarbsFoodLibrarySearch))},l=vL(s,300);return D.createElement(_a,{style:[_3.container,{backgroundColor:i.bgSearch}]},D.createElement(m2,null),D.createElement(kh,{testID:"food-searchbar-input",autoCapitalize:"none",placeholder:t("food_search_title"),placeholderTextColor:i.textSearchPlaceholder,cursorColor:i.textSearchText,style:[_3.searchInput,{color:i.textSearchText}],multiline:!1,value:r,onChangeText:e=>{a.set({query:e}),e?e.length>2&&l():o()},onSubmitEditing:s,autoCorrect:!1,enterKeyHint:"search"}),r.length>0&&D.createElement(eh,{onPress:o,hitSlop:10},D.createElement(Q1,{color:i.labelSecondary,width:16,height:16})))},_3=Ei.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:16,marginTop:16,paddingHorizontal:12},searchInput:{...oj.regular_Base,flex:1,paddingVertical:8,paddingHorizontal:4,marginTop:2,fontFamily:cV?aj.RobotoRegular:aj.PoppinsRegular,...p3}}),g3=()=>{const{t:e,language:t}=iV(),{fontScale:n}=vm(),{myFood:i,searchResults:r,isLoading:a,isMyFoodTab:o,hasSearched:s,frequentlyAdded:l,animatedEntryId:u,foodStoreActions:c}=O2(),d=Wp(),h=df(),{COLORS:m}=bL(),[p,f]=M.useState(!0),_=M.useRef(0);Yp(M.useCallback(()=>{c.loadFrequentFoodItems().catch(console.error)},[c])),M.useEffect(()=>{i.sort((e,n)=>e.title.localeCompare(n.title,t))},[i,t]),M.useEffect(()=>{c.loadMyFood().catch(console.error)},[c]);const g=M.useCallback(()=>{c.set({isMyFoodTab:!0}),h.params.comingFrom===S2.CarbsTab?jX(FX.CarbsFoodLibraryPersonalPress):jX(FX.FoodLibraryPersonalPress)},[c,h.params.comingFrom]),y=M.useCallback(()=>{c.set({selectedFoodItem:void 0}),d.navigate(S2.CreateFood)},[c,d]),v=M.useMemo(()=>{const t=e(o||s?o?"food_empty_state_no_food":"food_empty_state_search_no_food":"food_empty_state_default");return D.createElement(_a,{style:[y3.emptyListContainer,{marginTop:o?64+Math.round(23*n):32}]},o||s?D.createElement(o2,null):D.createElement(W1,{color:m.labelSecondary,width:48,height:48}),D.createElement(gj,{style:[y3.message,{color:m.labelSecondary}]},t))},[o,n,m.labelSecondary,s,e]),b=M.useMemo(()=>D.createElement(_a,{style:y3.header},D.createElement(_a,{style:[y3.segmentContainer,{backgroundColor:m.bgInputActive}]},D.createElement(eh,{style:[y3.segment,!o&&{backgroundColor:m.bgSegmentPrimary}],onPress:()=>{c.set({isMyFoodTab:!1})},testID:`food-library-button-${!o}`},D.createElement(gj,{style:[y3.value,{color:o?m.textLabelInactive:m.textLabelActive}],maxFontSizeMultiplier:sj},e("food_segment_button_library"))),D.createElement(eh,{style:[y3.segment,o&&{backgroundColor:m.bgSegmentPrimary}],onPress:g,testID:`my-food-button-${o}`},D.createElement(gj,{style:[y3.value,{color:o?m.textLabelActive:m.textLabelInactive}],maxFontSizeMultiplier:sj},e("food_segment_button_my_food")))),!o&&D.createElement(D.Fragment,null,D.createElement(f3,{comingFrom:h.params.comingFrom??S2.FoodTab}),!s&&!!l.length&&D.createElement(gj,{style:[y3.frequentHeader,{color:m.labelSecondary}]},e("food_library_frequent_title")))),[m.bgInputActive,m.bgSegmentPrimary,m.textLabelActive,m.textLabelInactive,m.labelSecondary,o,e,g,h.params.comingFrom,s,l.length,c]),S=M.useMemo(()=>o?i:s?r:l,[o,i,s,r,l]),w=M.useCallback(e=>{const t=e.nativeEvent.contentOffset.y,n=t-_.current;p&&n>5?f(!1):n<-5&&f(!0),_.current=t},[p]);return D.createElement(D.Fragment,null,D.createElement(_a,{style:[y3.container,h.params.comingFrom===S2.CarbsTab&&{backgroundColor:m.bgSheet}]},D.createElement(Wo,{data:S,keyExtractor:e=>`${e.id}`,ListEmptyComponent:a?D.createElement(eH,null):v,ListHeaderComponent:b,renderItem:({item:e,index:t})=>D.createElement(ij,{onAnimationFinished:()=>{c.set({animatedEntryId:void 0})},isAnimated:o&&u===e.id.toString(),style:y3.listItem},D.createElement(h3,{item:e,index:t,testID:"food-item"})),disableScrollViewPanResponder:!0,keyboardDismissMode:"on-drag",contentContainerStyle:S.length?y3.contentContainer:y3.emptyContentContainer,onScroll:w,scrollEventThrottle:16})),o&&p&&D.createElement(_a,{style:{position:"absolute",bottom:0,left:0,right:0,backgroundColor:m.bgNavigationBar}},D.createElement(mj,{testID:"my-food-create-food-button",onPress:y,title:e("food_my_food_button_create"),style:y3.createFoodButton})))},y3=Ei.create({container:{flex:1},emptyContentContainer:{flex:1,marginHorizontal:16},contentContainer:{marginHorizontal:16,paddingBottom:80},header:{marginTop:32,marginBottom:16},segmentContainer:{flexDirection:"row",justifyContent:"center",alignItems:"center",borderRadius:16,padding:2},segment:{flex:1,alignSelf:"stretch",flexDirection:"row",justifyContent:"center",alignItems:"center",paddingVertical:7,borderRadius:16},value:{...oj.medium_Base},emptyListContainer:{flex:1,alignItems:"center"},message:{...oj.regular_SM,marginTop:16,marginHorizontal:16,textAlign:"center"},frequentHeader:{...oj.medium_SM,marginHorizontal:16,marginTop:32,marginBottom:-16},listItem:{marginBottom:8},createFoodButton:{margin:16}});function v3({uri:e,style:t,onLoadEnd:n}){const i=M.useRef(null);return M.useEffect(()=>{const e=i.current;if(n&&e)return e.addEventListener("load",n),()=>{e.removeEventListener("load",n)}},[i,n]),D.createElement("iframe",{ref:i,src:e,style:t})}function b3(){const{language:e}=tV.getState();return`https://pdf.hedia.io/IFU/${e}/Hedia-IFU-${NX}`}const S3=()=>D.createElement(v3,{style:w3.iframe,uri:b3()}),w3=Ei.create({iframe:{flex:1}});var k3,C3={},E3={exports:{}};var I3,x3,T3={};var O3=function(){if(x3)return C3;x3=1;var e,t=(k3||(k3=1,(e=E3).exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports),E3.exports);Object.defineProperty(C3,"__esModule",{value:!0}),C3.default=C3.WebView=void 0,t(w());var n=QB,i=t(function(){if(I3)return T3;I3=1,Object.defineProperty(T3,"__esModule",{value:!0}),T3.default=void 0;var e=QB.StyleSheet.create({container:{flex:1,overflow:"hidden"},loadingOrErrorView:{position:"absolute",flex:1,justifyContent:"center",alignItems:"center",height:"100%",width:"100%",backgroundColor:"white"},loadingProgressBar:{height:20},errorText:{fontSize:14,textAlign:"center",marginBottom:2},errorTextTitle:{fontSize:15,fontWeight:"500",marginBottom:10},webView:{backgroundColor:"#ffffff"},flexStart:{alignSelf:"flex-start"},colorRed:{color:"red"}});return T3.default=e,T3}()),r=l(),a=C3.WebView=function(){return(0,r.jsx)(n.View,{style:i.default.flexStart,children:(0,r.jsx)(n.Text,{style:i.default.colorRed,children:"React Native WebView does not support this platform."})})};return C3.default=a,C3}();const R3=n(O3);function A3({url:e,testID:t,incognito:n=!0,backgroundColor:i,onNavigationStateChange:r,spinnerSize:a=15,style:o}){const{COLORS:s}=bL(),[l,u]=M.useState(!1),c=i??s.bgPrimary,{top:d}=pH();return e?D.createElement(D.Fragment,null,D.createElement(R3,{source:{uri:e},testID:t,incognito:n,startInLoadingState:!0,renderLoading:()=>D.createElement(_a,{style:L3.centerContainer},D.createElement(QV,{source:JV.LOADING_SPINNER,autoPlay:!0,style:{height:`${a}%`}})),onHttpError:()=>{u(!0)},onNavigationStateChange:r,style:{backgroundColor:c},containerStyle:[L3.container,{backgroundColor:c,paddingTop:d},o]}),l&&D.createElement(BR.View,{entering:wI.duration(300).delay(2e3),style:L3.centerContainer},D.createElement(hl,{style:[L3.errorTitle,{color:s.labelPrimary}]},"The page can't be found"),D.createElement(hl,{style:[L3.errorSubtitle,{color:s.labelSecondary}]},"It looks like nothing was found at this location."))):null}const L3=Ei.create({container:{height:"100%"},centerContainer:{height:"100%",justifyContent:"center"},errorTitle:{...oj.semiBold_4XL,textAlign:"center"},errorSubtitle:{...oj.medium_XS,textAlign:"center"}});function P3(){return uV?D.createElement(v3,{style:M3.iframe,uri:"https://www.hedia.com/support/partner"}):D.createElement(A3,{url:"https://www.hedia.com/support/native",testID:"support-webview",style:M3.container})}const M3=Ei.create({iframe:{flex:1},container:{paddingTop:0}});function D3(){const{dispatch:e}=Wp(),t=df(),[n,i]=M.useState(!1);return M.useEffect(()=>{setTimeout(()=>{i(!0)},1e3)},[]),M.useEffect(()=>{n&&(uV?(window.location.href="/redirect?status=success",Qj.clearAll()):e(wm(S2.DashboardTab,{screen:S2.Dashboard,params:{action:aV.Saved,logbookEntry:t.params.logbookEntry}})))},[e,n,t.params.logbookEntry]),D.createElement(_a,{style:N3.animationContainer},D.createElement(QV,{autoPlay:!0,source:JV.LEAVING_RECOMMENDATION,style:N3.animation,webStyle:N3.animation,resizeMode:"cover",loop:!1}))}const N3=Ei.create({animationContainer:{flex:1,justifyContent:"center",alignItems:"center"},animation:{width:256,height:256}});var F3={},B3={};const j3=i(kH);var V3={},H3={};const z3=i(V1);var U3,G3,W3={},Y3={},$3={};function X3(){if(U3)return $3;U3=1,Object.defineProperty($3,"__esModule",{value:!0}),$3.COLORS=void 0;return $3.COLORS={base50:"#FFFFFF",base100:"#F7F7FA",base200:"#F2F2F7",base300:"#ECECF1",base400:"#E0E0E6",base500:"#CFCFD7",base600:"#B5B5BD",base700:"#9999A3",base800:"#6E6E78",base900:"#3F3F46",base100a:"#F7F7FA1A",base600a:"#B5B5BD99",base700a:"#9999A3B3",base900a:"#3F3F4699",primary100:"#EEF0FE",primary200:"#D7DBFB",primary300:"#B6BFF8",primary400:"#8F9EF4",primary500:"#4A5DEB",primary600:"#3F4DD5",primary700:"#3540B8",primary800:"#2D359B",primary900:"#242A7C",primary100a:"#B5D8FF99",primary300a:"#87B5FF4D",primary400a:"#73ADFF80",primary900a:"#3D4AC699",red50:"#F9E6E9",red100:"#FCCBCB",red200:"#F9A6A7",red300:"#F47475",red400:"#EB494B",red500:"#D82E30",red600:"#B62325",red700:"#962021",red800:"#7D2021",red900:"#440B0D",red300a:"#E0717166",green50:"#E3F0E4",green100:"#BEF6D2",green200:"#8DEEAF",green300:"#59DC86",green400:"#39C365",green500:"#2BA250",green600:"#237F42",green700:"#1F6437",green800:"#1A522F",green900:"#092E17",yellow50:"#FAF8E2",yellow100:"#FAF5C5",yellow200:"#F9ED7D",yellow300:"#FAE84D",yellow400:"#FAE84D",yellow500:"#F7C62F",yellow600:"#F6B82B",yellow700:"#F3A425",yellow800:"#F2941F",yellow900:"#F0831A",shadow:"#00000029",iosKeyboardPicker:"#FFFFFF",iosSelectorKeyboard:"#F4F4F4",gradientQuickGuideBottom:"#FFFFFF",gradientQuickGuideTop:"#FFFFFF0D",graphActiveInsulin:"#008DFF",graphActiveInsulinSecondary:"#42ABFF1A",graphCarbohydrate:"#FF9E38",graphCarbohydrateSecondary:"#EB892F",graphGlucoseAverage:"#E539AB",graphPhysicalActivity:"#5BA400",graphPhysicalActivitySecondary:"#5DA800",graphRapid:"#008DFF",graphRapidSecondary:"#42ABFF",rectangleRangeGraphMyDay:"#5CE59C33",graphVeryHighGlucose:"#FF9000",graphVeryHighGlucoseSecondary:"#F07C00",graphHighGlucose:"#EAB308",graphHighGlucoseSecondary:"#F8C62B",graphTargetGlucose:"#008B4F",graphTargetGlucoseSecondary:"#089B5C",graphLowGlucose:"#BC0027",graphLowGlucoseSecondary:"#DC2626",graphVeryLowGlucose:"#A30022",graphVeryLowGlucoseSecondary:"#94001F",base100:"#616161",base200:"#555555",base300:"#4A4A4A",base350:"#404040",base400:"#363636",base500:"#373739",base600:"#2A2A2C",base700:"#1C1C1E",base800:"#141414",base900:"#000000",base100a:"#E9E0FF1A",base600a:"#2A2A2C99",base700a:"#1C1C1E80",base800a:"#14141499",primary100:"#B5D8FF",primary200:"#9EC6FF",primary300:"#87B5FF",primary400:"#73ADFF",primary500:"#5F99F9",primary600:"#4A85F0",primary700:"#4A73ED",primary800:"#4A5DEB",primary900:"#3D4AC6",primary100a:"#B5D8FF99",primary300a:"#87B5FF4D",primary400a:"#73ADFF80",primary900a:"#3D4AC699",red50:"#F9E6E9",red100:"#F9C9CE",red200:"#EA9797",red300:"#E07171",red400:"#EA514E",red500:"#EF4235",red600:"#E03834",red700:"#CF2E2E",red800:"#C22727",red900:"#B31B1B",red300a:"#E0717166",green50:"#E3F0E4",green100:"#C4E1C5",green200:"#A2D2A4",green300:"#7EC381",green400:"#64B768",green500:"#4AAC4E",green600:"#429D46",green700:"#378B3B",green800:"#2D7B31",green900:"#1A5C1F",yellow50:"#FAF8E2",yellow100:"#FAF4C0",yellow200:"#FAF09A",yellow300:"#FAEC74",yellow400:"#FAE956",yellow500:"#FAE63A",yellow600:"#F8D434",yellow700:"#F6BC2C",yellow800:"#F4A524",yellow900:"#F07C17",shadow:"#FFFFFF00",iosKeyboardPicker:"#282828",iosSelectorKeyboard:"#5858593D",gradientQuickGuideBottom:"#000000",gradientQuickGuideTop:"#0000000D",graphActiveInsulin:"#66D6FF",graphActiveInsulinSecondary:"#66D6FF1A",graphCarbohydrate:"#FFB224",graphCarbohydrateSecondary:"#E88C2B",graphGlucoseAverage:"#FF8CD8",graphPhysicalActivity:"#D7EB98",graphPhysicalActivitySecondary:"#79A762",graphRapid:"#66D6FF",graphRapidSecondary:"#00ACEB",rectangleRangeGraphMyDay:"#5CE59C33",graphVeryHighGlucose:"#F07C17",graphVeryHighGlucoseSecondary:"#F4A524",graphHighGlucose:"#F6BC2C",graphHighGlucoseSecondary:"#F8D434",graphTargetGlucose:"#4AAC4E",graphTargetGlucoseSecondary:"#64B768",graphLowGlucose:"#EF4235",graphLowGlucoseSecondary:"#EA514E",graphVeryLowGlucose:"#B31B1B",graphVeryLowGlucoseSecondary:"#C22727",white100:"#FFFFFF0D",white200:"#FFFFFF1A",white300:"#FFFFFF33",white400:"#FFFFFF66",white500:"#FFFFFF99",white600:"#FFFFFFCC",white700:"#FFFFFFE6",white800:"#FFFFFFF2",white900:"#FFFFFF",black100:"#0000000D",black200:"#0000001A",black300:"#00000033",black400:"#0000004D",black500:"#00000080",black600:"#000000CC",black700:"#000000D9",black800:"#000000F2",black900:"#000000",noRisk:"#DFB38F",lowRisk:"#DB988D",moderateRisk:"#A76762",highRisk:"#773751",iosTextStatusBar:"#FFFFFF",iosAccentBlue:"#0A84FF",iosButtonHighlight:"#434343",iosKeyboard:"#383838BF",transparent:"transparent",plusInnerShadow:"#8752F2",plusOuterShadow:"#6422EE"},$3}var q3,Z3={};var K3,Q3,J3,e4={};function t4(){return Q3||(Q3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.COLORS=void 0,Object.defineProperty(e,"FONTS",{enumerable:!0,get:function(){return i.FONTS}}),Object.defineProperty(e,"FontFamily",{enumerable:!0,get:function(){return i.FontFamily}}),e.Theme=void 0,e.getColors=a;var t=function(){if(G3)return Y3;G3=1,Object.defineProperty(Y3,"__esModule",{value:!0}),Y3.DARK_SEMANTIC_COLORS=void 0;var e=X3();return Y3.DARK_SEMANTIC_COLORS={bgPrimary:e.COLORS.base900,bgSecondary:e.COLORS.base700,bgTertiary:e.COLORS.base600,bgMultiSheet:e.COLORS.white300,bgSheet:e.COLORS.base900,bgModal:e.COLORS.base700,bgOverlay:e.COLORS.black500,bgBrand:e.COLORS.primary800,bgToggle:e.COLORS.base350,bgSpecial:e.COLORS.base900,bgTransparent:e.COLORS.transparent,labelPrimary:e.COLORS.white900,labelSecondary:e.COLORS.white600,labelTertiary:e.COLORS.white400,labelBrand:e.COLORS.primary500,labelBrandInactive:e.COLORS.primary400a,bgActivationCode:e.COLORS.base700,borderActivationCodeDanger:e.COLORS.red500,borderActivationCodeFocus:e.COLORS.primary500,textActivationCodeDanger:e.COLORS.red500,textButtonPrimary:e.COLORS.white900,textButtonPrimaryDisabled:e.COLORS.white400,bgButtonPrimary:e.COLORS.primary800,bgButtonPrimaryDisabled:e.COLORS.primary900,iconButtonPrimary:e.COLORS.white900,iconButtonPrimaryDisabled:e.COLORS.white400,textButtonSecondary:e.COLORS.white900,textButtonSecondaryDisabled:e.COLORS.white400,bgButtonSecondary:e.COLORS.base600,bgButtonSecondaryDisabled:e.COLORS.base100a,iconButtonSecondary:e.COLORS.white900,iconButtonSecondaryDisabled:e.COLORS.white400,textButtonPlain:e.COLORS.white900,textButtonPlainDisabled:e.COLORS.white400,iconButtonPlain:e.COLORS.white900,iconButtonPlainDisabled:e.COLORS.white400,textButtonPrimaryDanger:e.COLORS.white900,textButtonPrimaryDangerDisabled:e.COLORS.white400,bgButtonPrimaryDanger:e.COLORS.red700,bgButtonPrimaryDangerDisabled:e.COLORS.red300a,iconButtonPrimaryDanger:e.COLORS.white900,iconButtonPrimaryDangerDisabled:e.COLORS.white400,textButtonSecondaryDanger:e.COLORS.red600,textButtonSecondaryDangerDisabled:e.COLORS.red300a,bgButtonSecondaryDanger:e.COLORS.base600,bgButtonSecondaryDangerDisabled:e.COLORS.base100a,iconButtonSecondaryDanger:e.COLORS.red600,iconButtonSecondaryDangerDisabled:e.COLORS.red300a,textLink:e.COLORS.primary500,buttonBorder:e.COLORS.shadow,borderAvatar:e.COLORS.white500,paginationActive:e.COLORS.primary800,paginationInactive:e.COLORS.white300,graphDivider:e.COLORS.white300,borderGraphNow:e.COLORS.white900,overlay:e.COLORS.black500,nowOverlay:e.COLORS.white200,veryHighGlucose:e.COLORS.yellow900,veryHighGlucoseSecondary:e.COLORS.yellow800,highGlucose:e.COLORS.yellow700,highGlucoseSecondary:e.COLORS.yellow600,targetGlucose:e.COLORS.green500,targetGlucoseSecondary:e.COLORS.green400,lowGlucose:e.COLORS.red500,lowGlucoseSecondary:e.COLORS.red400,veryLowGlucose:e.COLORS.red900,veryLowGlucoseSecondary:e.COLORS.red800,graphGlucoseAverage:e.COLORS.graphGlucoseAverage,graphDotGlucoseAverage:e.COLORS.green500,graphDotStrokeGlucoseAverage:e.COLORS.white900,graphActiveInsulin:e.COLORS.graphActiveInsulin,graphActiveInsulinSecondary:e.COLORS.graphActiveInsulinSecondary,strokeDotGraphActiveInsulin:e.COLORS.white900,graphOverlay:e.COLORS.base700a,graphRapid:e.COLORS.graphRapid,graphRapidSecondary:e.COLORS.graphRapidSecondary,graphCarbohydrate:e.COLORS.graphCarbohydrate,graphCarbohydrateSecondary:e.COLORS.graphCarbohydrateSecondary,graphPhysicalActivity:e.COLORS.graphPhysicalActivity,graphPhysicalActivitySecondary:e.COLORS.graphPhysicalActivitySecondary,rectangleRangeGraphMyDay:e.COLORS.rectangleRangeGraphMyDay,bgInputActive:e.COLORS.base600,bgInputInactive:e.COLORS.base700,bgInputHover:e.COLORS.white300,borderInputFocus:e.COLORS.primary500,borderInputDanger:e.COLORS.red500,textInputDanger:e.COLORS.red500,bgFoodInputDefault:e.COLORS.base600,bgFoodInputActive:e.COLORS.base600,bgFoodInputHover:e.COLORS.white300,bgListActive:e.COLORS.base600,bgListInactive:e.COLORS.base700,bgListHover:e.COLORS.white300,bgListPlainHover:e.COLORS.white200,bgLogbookManual:e.COLORS.base600,bgLogbookRecommendation:e.COLORS.base700,borderListFocused:e.COLORS.primary500,textListHightlight:e.COLORS.primary500,iosTextStatusBar:e.COLORS.white900,iosBGNudge:e.COLORS.white900,iosKeyboardPicker:e.COLORS.iosKeyboardPicker,iosSelectorKeyboard:e.COLORS.iosSelectorKeyboard,iosButtonHighlight:e.COLORS.iosButtonHighlight,iosKeyboard:e.COLORS.iosKeyboard,textKeyboardButtons:e.COLORS.iosAccentBlue,textNavigationBar:e.COLORS.white900,bgNavigationBar:e.COLORS.base800,textNavigationBarLabel:e.COLORS.primary500,iconNavigationBarActive:e.COLORS.primary500,iconNavigationBarCalc:e.COLORS.white900,bgNumber:e.COLORS.white600,textNumber:e.COLORS.black900,bgSegmentContainer:e.COLORS.base600,bgSegmentCard:e.COLORS.base600,bgSegmentPrimary:e.COLORS.primary800,textLabelActive:e.COLORS.white900,textLabelInactive:e.COLORS.white900,bgSliderBackground:e.COLORS.base500,bgSliderForeground:e.COLORS.primary600,bgSliderKnob:e.COLORS.white900,bgSliderCalculator:e.COLORS.base500,textSlider:e.COLORS.white900,iconSearch:e.COLORS.white500,textSearchPlaceholder:e.COLORS.white500,textSearchText:e.COLORS.white900,bgSearch:e.COLORS.white300,bgToastDefault:e.COLORS.base300,textToastDefault:e.COLORS.white900,iconToastDefault:e.COLORS.white900,textTableActive:e.COLORS.white900,textTableSecondary:e.COLORS.white500,textTableHighlight:e.COLORS.primary500,bgTableOdd:e.COLORS.base600,bgTableEven:e.COLORS.base700,textCarbRecommendation:e.COLORS.white900,iconCarbRecommendation:e.COLORS.white900,bgGradientTop:e.COLORS.primary700,bgGradientBottom:e.COLORS.primary600,bgLogbookTop:e.COLORS.base600,bgGradientOverlayTop:e.COLORS.black100,bgGradientOverlayBottom:e.COLORS.black900,divider:e.COLORS.white200,iconBrand:e.COLORS.primary500,iconBrandInactive:e.COLORS.primary400a,iconSuccess:e.COLORS.green500,iconWarning:e.COLORS.yellow800,iconDanger:e.COLORS.red500,textSuccess:e.COLORS.green500,textWarning:e.COLORS.yellow800,textDanger:e.COLORS.red700,textPdf:e.COLORS.black900,toggleKnob:e.COLORS.white900,plusInnerShadow:e.COLORS.plusInnerShadow,plusOuterShadow:e.COLORS.plusOuterShadow,gradientQuickGuide:[e.COLORS.gradientQuickGuideTop,e.COLORS.gradientQuickGuideBottom],gradientActiveInsulin:[e.COLORS.graphActiveInsulinSecondary,e.COLORS.graphActiveInsulin],gradientCarbohydrates:[e.COLORS.graphCarbohydrateSecondary,e.COLORS.graphCarbohydrate],gradientPhysicalActivity:[e.COLORS.graphPhysicalActivitySecondary,e.COLORS.graphPhysicalActivity],gradientRapid:[e.COLORS.graphRapidSecondary,e.COLORS.graphRapid],gradientVeryHigh:[e.COLORS.graphVeryHighGlucose,e.COLORS.graphVeryHighGlucoseSecondary],gradientHigh:[e.COLORS.graphHighGlucose,e.COLORS.graphHighGlucoseSecondary],gradientTarget:[e.COLORS.graphTargetGlucose,e.COLORS.graphTargetGlucoseSecondary],gradientLow:[e.COLORS.graphLowGlucoseSecondary,e.COLORS.graphLowGlucose],gradientVeryLow:[e.COLORS.graphVeryLowGlucose,e.COLORS.graphVeryLowGlucoseSecondary]},Y3}(),n=function(){if(q3)return Z3;q3=1,Object.defineProperty(Z3,"__esModule",{value:!0}),Z3.LIGHT_SEMANTIC_COLORS=void 0;var e=X3();return Z3.LIGHT_SEMANTIC_COLORS={bgPrimary:e.COLORS.base200,bgSecondary:e.COLORS.base50,bgTertiary:e.COLORS.base100,bgMultiSheet:e.COLORS.black300,bgSheet:e.COLORS.base200,bgModal:e.COLORS.base100,bgOverlay:e.COLORS.black500,bgBrand:e.COLORS.primary500,bgToggle:e.COLORS.base500,bgSpecial:e.COLORS.base50,bgTransparent:e.COLORS.transparent,labelPrimary:e.COLORS.black900,labelSecondary:e.COLORS.black600,labelTertiary:e.COLORS.black500,labelBrand:e.COLORS.primary600,labelBrandInactive:e.COLORS.primary400a,bgActivationCode:e.COLORS.base700,borderActivationCodeDanger:e.COLORS.red500,borderActivationCodeFocus:e.COLORS.primary500,textActivationCodeDanger:e.COLORS.red500,textButtonPrimary:e.COLORS.white900,textButtonPrimaryDisabled:e.COLORS.white400,bgButtonPrimary:e.COLORS.primary500,bgButtonPrimaryDisabled:e.COLORS.primary400,iconButtonPrimary:e.COLORS.white900,iconButtonPrimaryDisabled:e.COLORS.white400,textButtonSecondary:e.COLORS.black900,textButtonSecondaryDisabled:e.COLORS.black400,bgButtonSecondary:e.COLORS.base50,bgButtonSecondaryDisabled:e.COLORS.base400,iconButtonSecondary:e.COLORS.black900,iconButtonSecondaryDisabled:e.COLORS.black400,textButtonPlain:e.COLORS.black900,textButtonPlainDisabled:e.COLORS.black400,iconButtonPlain:e.COLORS.black900,iconButtonPlainDisabled:e.COLORS.black400,textButtonPrimaryDanger:e.COLORS.white900,textButtonPrimaryDangerDisabled:e.COLORS.white400,bgButtonPrimaryDanger:e.COLORS.red600,bgButtonPrimaryDangerDisabled:e.COLORS.red800,iconButtonPrimaryDanger:e.COLORS.white900,iconButtonPrimaryDangerDisabled:e.COLORS.white400,textButtonSecondaryDanger:e.COLORS.red500,textButtonSecondaryDangerDisabled:e.COLORS.red300a,bgButtonSecondaryDanger:e.COLORS.base50,bgButtonSecondaryDangerDisabled:e.COLORS.base400,iconButtonSecondaryDanger:e.COLORS.red500,iconButtonSecondaryDangerDisabled:e.COLORS.red300a,textLink:e.COLORS.primary500,buttonBorder:e.COLORS.base300,borderAvatar:e.COLORS.white500,paginationActive:e.COLORS.primary800,paginationInactive:e.COLORS.black300,graphDivider:e.COLORS.white200,borderGraphNow:e.COLORS.black900,overlay:e.COLORS.white500,nowOverlay:e.COLORS.white300,veryHighGlucose:e.COLORS.yellow900,veryHighGlucoseSecondary:e.COLORS.yellow800,highGlucose:e.COLORS.yellow700,highGlucoseSecondary:e.COLORS.yellow600,targetGlucose:e.COLORS.green600,targetGlucoseSecondary:e.COLORS.green500,lowGlucose:e.COLORS.red500,lowGlucoseSecondary:e.COLORS.red400,veryLowGlucose:e.COLORS.red700,veryLowGlucoseSecondary:e.COLORS.red600,graphGlucoseAverage:e.COLORS.graphGlucoseAverage,graphDotGlucoseAverage:e.COLORS.green500,graphDotStrokeGlucoseAverage:e.COLORS.white900,graphActiveInsulin:e.COLORS.graphActiveInsulin,graphActiveInsulinSecondary:e.COLORS.graphActiveInsulinSecondary,strokeDotGraphActiveInsulin:e.COLORS.white900,graphOverlay:e.COLORS.white900,graphRapid:e.COLORS.graphRapid,graphRapidSecondary:e.COLORS.graphRapidSecondary,graphCarbohydrate:e.COLORS.graphCarbohydrate,graphCarbohydrateSecondary:e.COLORS.graphCarbohydrateSecondary,graphPhysicalActivity:e.COLORS.graphPhysicalActivity,graphPhysicalActivitySecondary:e.COLORS.graphPhysicalActivitySecondary,rectangleRangeGraphMyDay:e.COLORS.rectangleRangeGraphMyDay,bgInputActive:e.COLORS.base50,bgInputInactive:e.COLORS.base400,bgInputHover:e.COLORS.black100,borderInputFocus:e.COLORS.primary500,borderInputDanger:e.COLORS.red500,textInputDanger:e.COLORS.red500,bgFoodInputDefault:e.COLORS.base200,bgFoodInputActive:e.COLORS.base50,bgFoodInputHover:e.COLORS.black100,bgListActive:e.COLORS.base50,bgListInactive:e.COLORS.base400,bgListHover:e.COLORS.black100,bgListPlainHover:e.COLORS.black100,bgLogbookManual:e.COLORS.base100,bgLogbookRecommendation:e.COLORS.base50,borderListFocused:e.COLORS.primary500,textListHightlight:e.COLORS.primary500,iosTextStatusBar:e.COLORS.black900,iosBGNudge:e.COLORS.black900,iosKeyboardPicker:e.COLORS.white900,iosSelectorKeyboard:e.COLORS.iosSelectorKeyboard,iosButtonHighlight:e.COLORS.white900,iosKeyboard:e.COLORS.iosKeyboard,textKeyboardButtons:e.COLORS.iosAccentBlue,textNavigationBar:e.COLORS.black900,bgNavigationBar:e.COLORS.base100,textNavigationBarLabel:e.COLORS.primary500,iconNavigationBarActive:e.COLORS.primary500,iconNavigationBarCalc:e.COLORS.white900,bgNumber:e.COLORS.black500,textNumber:e.COLORS.white900,bgSegmentContainer:e.COLORS.base50,bgSegmentCard:e.COLORS.base100,bgSegmentPrimary:e.COLORS.primary500,textLabelActive:e.COLORS.white900,textLabelInactive:e.COLORS.base900,bgSliderBackground:e.COLORS.black200,bgSliderForeground:e.COLORS.primary600,bgSliderKnob:e.COLORS.primary600,bgSliderCalculator:e.COLORS.white900,textSlider:e.COLORS.black900,iconSearch:e.COLORS.black500,textSearchPlaceholder:e.COLORS.black500,textSearchText:e.COLORS.black900,bgSearch:e.COLORS.base50,bgToastDefault:e.COLORS.base50,textToastDefault:e.COLORS.black900,iconToastDefault:e.COLORS.black900,textTableActive:e.COLORS.black900,textTableSecondary:e.COLORS.base500,textTableHighlight:e.COLORS.primary600,bgTableOdd:e.COLORS.base200,bgTableEven:e.COLORS.base50,textCarbRecommendation:e.COLORS.white900,iconCarbRecommendation:e.COLORS.white900,bgGradientTop:e.COLORS.primary700,bgGradientBottom:e.COLORS.primary600,bgLogbookTop:e.COLORS.black300,bgGradientOverlayTop:e.COLORS.black100,bgGradientOverlayBottom:e.COLORS.black100,divider:e.COLORS.black200,iconBrand:e.COLORS.primary600,iconBrandInactive:e.COLORS.primary400a,iconSuccess:e.COLORS.green500,iconWarning:e.COLORS.yellow900,iconDanger:e.COLORS.red500,textSuccess:e.COLORS.green500,textWarning:e.COLORS.yellow900,textDanger:e.COLORS.red700,textPdf:e.COLORS.white900,toggleKnob:e.COLORS.white900,plusInnerShadow:e.COLORS.plusInnerShadow,plusOuterShadow:e.COLORS.plusOuterShadow,gradientQuickGuide:[e.COLORS.gradientQuickGuideTop,e.COLORS.gradientQuickGuideBottom],gradientActiveInsulin:[e.COLORS.graphActiveInsulinSecondary,e.COLORS.graphActiveInsulin],gradientCarbohydrates:[e.COLORS.graphCarbohydrateSecondary,e.COLORS.graphCarbohydrate],gradientPhysicalActivity:[e.COLORS.graphPhysicalActivitySecondary,e.COLORS.graphPhysicalActivity],gradientRapid:[e.COLORS.graphRapidSecondary,e.COLORS.graphRapid],gradientVeryHigh:[e.COLORS.graphVeryHighGlucose,e.COLORS.graphVeryHighGlucoseSecondary],gradientHigh:[e.COLORS.graphHighGlucose,e.COLORS.graphHighGlucoseSecondary],gradientTarget:[e.COLORS.graphTargetGlucose,e.COLORS.graphTargetGlucoseSecondary],gradientLow:[e.COLORS.graphLowGlucoseSecondary,e.COLORS.graphLowGlucose],gradientVeryLow:[e.COLORS.graphVeryLowGlucose,e.COLORS.graphVeryLowGlucoseSecondary]},Z3}(),i=function(){if(K3)return e4;K3=1,Object.defineProperty(e4,"__esModule",{value:!0}),e4.FontFamily=e4.FONTS=void 0;let e=e4.FontFamily=function(e){return e.PoppinsBold="Poppins-Bold",e.PoppinsSemiBold="Poppins-SemiBold",e.PoppinsMedium="Poppins-Medium",e.PoppinsRegular="Poppins-Regular",e}({});return e4.FONTS={Poppins:{bold_6XL:{fontFamily:e.PoppinsBold,fontSize:60,lineHeight:78},semiBold_6XL:{fontFamily:e.PoppinsSemiBold,fontSize:60,lineHeight:78},bold_5XL:{fontFamily:e.PoppinsBold,fontSize:48,lineHeight:62},semiBold_5XL:{fontFamily:e.PoppinsSemiBold,fontSize:48,lineHeight:62},bold_4XL:{fontFamily:e.PoppinsBold,fontSize:36,lineHeight:47},semiBold_4XL:{fontFamily:e.PoppinsSemiBold,fontSize:36,lineHeight:47},bold_3XL:{fontFamily:e.PoppinsBold,fontSize:30,lineHeight:39},semiBold_3XL:{fontFamily:e.PoppinsSemiBold,fontSize:30,lineHeight:39},bold_2XL:{fontFamily:e.PoppinsBold,fontSize:24,lineHeight:31},semiBold_2XL:{fontFamily:e.PoppinsSemiBold,fontSize:24,lineHeight:31},medium_2XL:{fontFamily:e.PoppinsMedium,fontSize:24,lineHeight:31},bold_XL:{fontFamily:e.PoppinsBold,fontSize:20,lineHeight:26},semiBold_XL:{fontFamily:e.PoppinsSemiBold,fontSize:20,lineHeight:26},medium_XL:{fontFamily:e.PoppinsMedium,fontSize:20,lineHeight:26},bold_LG:{fontFamily:e.PoppinsBold,fontSize:18,lineHeight:23},semiBold_LG:{fontFamily:e.PoppinsSemiBold,fontSize:18,lineHeight:23},medium_LG:{fontFamily:e.PoppinsMedium,fontSize:18,lineHeight:23},bold_Base:{fontFamily:e.PoppinsBold,fontSize:16,lineHeight:21},semiBold_Base:{fontFamily:e.PoppinsSemiBold,fontSize:16,lineHeight:21},medium_Base:{fontFamily:e.PoppinsMedium,fontSize:16,lineHeight:21},regular_Base:{fontFamily:e.PoppinsRegular,fontSize:16,lineHeight:21},semiBold_SM:{fontFamily:e.PoppinsSemiBold,fontSize:14,lineHeight:18},medium_SM:{fontFamily:e.PoppinsMedium,fontSize:14,lineHeight:18},regular_SM:{fontFamily:e.PoppinsRegular,fontSize:14,lineHeight:18},semiBold_XS:{fontFamily:e.PoppinsSemiBold,fontSize:12,lineHeight:16},medium_XS:{fontFamily:e.PoppinsMedium,fontSize:12,lineHeight:16},regular_XS:{fontFamily:e.PoppinsRegular,fontSize:12,lineHeight:16},regular_XXS:{fontFamily:e.PoppinsRegular,fontSize:10,lineHeight:10}}},e4}();let r=e.Theme=function(e){return e.Light="light",e.Dark="dark",e}({});function a(e=r.Dark){switch(e){case r.Light:return n.LIGHT_SEMANTIC_COLORS;case r.Dark:default:return t.DARK_SEMANTIC_COLORS}}e.COLORS=a()}(W3)),W3}var n4,i4={};var r4,a4={};function o4(){if(r4)return a4;r4=1,Object.defineProperty(a4,"__esModule",{value:!0}),a4.TIMEOUT_MODAL_TRIGGER=a4.TARGET_BGL_MMOL_LIMITS=a4.INSULIN_TO_CARBS_RATIO_LIMITS=a4.INSULIN_SENSITIVITY_MMOL_LIMITS=a4.INSULIN_DOSE_LIMITS=a4.CURRENT_BGL_MMOL_LIMITS=a4.CARBOHYDRATES_LIMITS=a4.BOLUS_SECONDS_PASSED_LIMITS=a4.ACTIVITY_TARGET_BGL_MMOL_LIMITS=a4.ACTIVITY_SETTINGS_INTERVAL_LIMITS=a4.ACTIVITY_POSTPONE_GLUCOSE_MMOLL=a4.ACTIVITY_POSTPONE_GLUCOSE_MGDL=a4.ACTIVITY_DURATION_MINUTES_LIMITS=void 0;var e=DL();return a4.ACTIVITY_POSTPONE_GLUCOSE_MMOLL=5,a4.ACTIVITY_POSTPONE_GLUCOSE_MGDL=90,a4.TIMEOUT_MODAL_TRIGGER=6e5,a4.CARBOHYDRATES_LIMITS={min:e.CONSTANTS.CARBOHYDRATES_INPUT_MIN,max:e.CONSTANTS.CARBOHYDRATES_INPUT_MAX},a4.INSULIN_DOSE_LIMITS={min:e.CONSTANTS.INSULIN_DOSE_MIN,max:e.CONSTANTS.INSULIN_DOSE_MAX},a4.BOLUS_SECONDS_PASSED_LIMITS={min:e.CONSTANTS.BOLUS_SECONDS_MIN,max:e.CONSTANTS.BOLUS_SECONDS_MAX},a4.ACTIVITY_DURATION_MINUTES_LIMITS={min:e.CONSTANTS.ACTIVITY_DURATION_MIN,max:e.CONSTANTS.ACTIVITY_DURATION_MAX},a4.INSULIN_SENSITIVITY_MMOL_LIMITS={min:e.CONSTANTS.INSULIN_SENSITIVITY_MIN,max:e.CONSTANTS.INSULIN_SENSITIVITY_MAX},a4.INSULIN_TO_CARBS_RATIO_LIMITS={min:e.CONSTANTS.INSULIN_TO_CARBS_RATIO_MIN,max:e.CONSTANTS.INSULIN_TO_CARBS_RATIO_MAX},a4.CURRENT_BGL_MMOL_LIMITS={min:e.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL,max:e.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL},a4.TARGET_BGL_MMOL_LIMITS={min:e.CONSTANTS.TARGET_GLUCOSE_MIN,max:e.CONSTANTS.TARGET_GLUCOSE_MAX},a4.ACTIVITY_TARGET_BGL_MMOL_LIMITS={min:e.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MIN,max:e.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MAX},a4.ACTIVITY_SETTINGS_INTERVAL_LIMITS={min:e.CONSTANTS.ACTIVITY_REDUCTION_MIN,max:e.CONSTANTS.ACTIVITY_REDUCTION_MAX},a4}var s4,l4={};function u4(){if(s4)return l4;s4=1,Object.defineProperty(l4,"__esModule",{value:!0}),l4.useLanguage=l4.LanguageProvider=l4.LanguageContext=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=Bj(),n=l();const i=l4.LanguageContext=(0,e.createContext)(void 0);l4.LanguageProvider=({children:r})=>{const{language:a,changeLanguage:o,t:s}=(0,t.useTranslation)(),l=e.default.useMemo(()=>({language:a,changeLanguage:o,t:s}),[a,o,s]);return(0,n.jsx)(i.Provider,{value:l,children:r})};return l4.useLanguage=()=>{const t=(0,e.useContext)(i);if(!t)throw new Error("useLanguage must be used within a LanguageProvider");return t},l4}var c4,d4={};function h4(){if(c4)return d4;c4=1,Object.defineProperty(d4,"__esModule",{value:!0}),d4.convertAndFormatBGL=function(e,i,r){return n(t(e,i,r),r)},d4.convertBGL=t,d4.createSequentialArrayInteger=d4.createSequentialArrayHalf=d4.createSequentialArrayDecimal=void 0,d4.formatBGL=n,d4.formatUnit=void 0;var e=DL();function t(t,n,i){if(n!==e.BloodGlucoseUnit.MG_DL&&n!==e.BloodGlucoseUnit.MMOL_L)throw new Error(`Unsupported glucose unit! ${n}`);if(n===i)return t;switch(i){case e.BloodGlucoseUnit.MG_DL:return t*e.CONSTANTS.MGDL_PER_MMOLL_BGL;case e.BloodGlucoseUnit.MMOL_L:return t*e.CONSTANTS.MMOLL_PER_MGDL_BGL;default:throw new Error(`Unsupported glucose unit! ${i}`)}}function n(t,n){const i=n===e.BloodGlucoseUnit.MG_DL?0:1;return(Math.round(10*t)/10).toFixed(i)}d4.formatUnit=e=>`${e.substring(0,e.length-1)}${e.substring(e.length-1,e.length).toUpperCase()}`;d4.createSequentialArrayHalf=(e,t)=>Array.from({length:(t-e)/.5+1},(t,n)=>(e+.5*n).toFixed(1));d4.createSequentialArrayInteger=(e,t)=>Array.from({length:t-e+1},(t,n)=>(e+n).toString());return d4.createSequentialArrayDecimal=(e,t)=>Array.from({length:10*(t-e)+1},(t,n)=>(e+n/10).toFixed(1)),d4}var m4,p4,f4={};function _4(){if(m4)return f4;m4=1,Object.defineProperty(f4,"__esModule",{value:!0}),f4.default=void 0,function(e){e&&e.__esModule}(w());var e=QB,t=t4(),n=l();const i=e.StyleSheet.create({defaultText:{...t.FONTS.Poppins.regular_Base,color:t.COLORS.labelPrimary}});return f4.default=function(t){return(0,n.jsx)(e.Text,{...t,style:[i.defaultText,t.style],children:t.children})},f4}function g4(){if(p4)return V3;p4=1,Object.defineProperty(V3,"__esModule",{value:!0}),V3.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=DL(),i=h(function(){if(J3)return H3;J3=1,Object.defineProperty(H3,"__esModule",{value:!0}),H3.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=t4(),n=l();return H3.default=function(i){return(0,n.jsx)(e.default,{width:24,height:24,viewBox:"0 0 24 24",...i,children:(0,n.jsx)(e.Path,{d:"M7.668 13.77h0a1.375 1.375 0 00-.758 1.776c.642 1.638 2.097 3.053 4.194 3.297h0a1.36 1.36 0 001.503-1.207h0a1.368 1.368 0 00-1.193-1.517h0c-.962-.111-1.652-.743-1.98-1.582l-.448.176.447-.175a1.352 1.352 0 00-1.765-.768zM12 21.52c-3.177 0-5.476-1.785-6.648-4.133-1.18-2.361-1.197-5.247.157-7.405 2.079-3.033 5.034-5.346 6.234-6.216a.434.434 0 01.514 0c1.2.87 4.155 3.183 6.234 6.216 1.354 2.158 1.336 5.044.157 7.405-1.172 2.348-3.471 4.133-6.648 4.133z",fill:t.COLORS.labelPrimary,stroke:t.COLORS.labelPrimary,strokeWidth:.96})})},H3}()),r=h(function(){if(n4)return i4;n4=1,Object.defineProperty(i4,"__esModule",{value:!0}),i4.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=t4(),n=l();return i4.default=function(i){return(0,n.jsxs)(e.default,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...i,children:[(0,n.jsx)(e.Mask,{id:"a",fill:t.COLORS.labelPrimary,children:(0,n.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M17.862 4.741a2.493 2.493 0 01-2.49 2.489 2.492 2.492 0 01-2.49-2.489 2.492 2.492 0 012.49-2.491 2.493 2.493 0 012.49 2.491zm1.326 5.237c-1.271.056-2.72.02-3.824-.658-.385-.237-.744-.562-1.125-.907-.211-.191-.422-.382-.64-.562-2.246-1.865-5.681-1.71-7.818.353a1 1 0 101.388 1.439c1.056-1.018 2.637-1.326 3.974-.893-.818 1.14-1.496 2.52-1.013 4.322.225.84.699 1.452 1.118 1.99l.008.011c.404.524.724.94.777 1.469.105 1.04-.42 2.164-.928 3.249l-.253.547a1.002 1.002 0 00.91 1.413 1 1 0 00.912-.588l.243-.525v-.003c.593-1.267 1.265-2.704 1.106-4.292-.111-1.103-.685-1.845-1.19-2.5l-.004-.004c-.347-.447-.646-.834-.767-1.285-.267-.996.079-1.772.767-2.718l.028.024.039.035c.43.39.877.795 1.42 1.129 1.299.798 2.819.972 4.143.972.282 0 .556-.01.817-.02a1 1 0 00.955-1.043c-.024-.552-.511-.971-1.043-.955zm-10.37 4.539c-.533.289-1.12.567-1.81.654-.446.055-.915.052-1.404.046l-.162-.001c-.234-.001-.469-.003-.704.005a1 1 0 00.03 1.999h.029c.24-.008.482-.006.722-.004h.065c.536.007 1.093.01 1.672-.061 1.022-.127 1.845-.516 2.515-.88a1 1 0 00-.954-1.758z"})}),(0,n.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M17.862 4.741a2.493 2.493 0 01-2.49 2.489 2.492 2.492 0 01-2.49-2.489 2.492 2.492 0 012.49-2.491 2.493 2.493 0 012.49 2.491zm1.326 5.237c-1.271.056-2.72.02-3.824-.658-.385-.237-.744-.562-1.125-.907-.211-.191-.422-.382-.64-.562-2.246-1.865-5.681-1.71-7.818.353a1 1 0 101.388 1.439c1.056-1.018 2.637-1.326 3.974-.893-.818 1.14-1.496 2.52-1.013 4.322.225.84.699 1.452 1.118 1.99l.008.011c.404.524.724.94.777 1.469.105 1.04-.42 2.164-.928 3.249l-.253.547a1.002 1.002 0 00.91 1.413 1 1 0 00.912-.588l.243-.525v-.003c.593-1.267 1.265-2.704 1.106-4.292-.111-1.103-.685-1.845-1.19-2.5l-.004-.004c-.347-.447-.646-.834-.767-1.285-.267-.996.079-1.772.767-2.718l.028.024.039.035c.43.39.877.795 1.42 1.129 1.299.798 2.819.972 4.143.972.282 0 .556-.01.817-.02a1 1 0 00.955-1.043c-.024-.552-.511-.971-1.043-.955zm-10.37 4.539c-.533.289-1.12.567-1.81.654-.446.055-.915.052-1.404.046l-.162-.001c-.234-.001-.469-.003-.704.005a1 1 0 00.03 1.999h.029c.24-.008.482-.006.722-.004h.065c.536.007 1.093.01 1.672-.061 1.022-.127 1.845-.516 2.515-.88a1 1 0 00-.954-1.758z",fill:t.COLORS.labelPrimary}),(0,n.jsx)(e.Path,{d:"M15.364 9.32l-.525.851h.001l.524-.851zm3.824.658l-.03-1h-.014l.044 1zm-4.95-1.565l.672-.742-.671.742zm-.64-.562l-.638.769.002.002.637-.771zm-7.817.353l.693.72h.001l-.694-.72zm-.026 1.414l-.72.693v.002l.72-.695zm1.414.025l-.694-.72h-.002l.696.72zm3.974-.893l.812.582.798-1.112-1.302-.422-.308.952zm-1.013 4.322l.965-.26-.965.26zm1.118 1.99l.791-.61-.002-.003-.79.614zm.008.011l-.792.61.792-.61zm.777 1.469l-.995.098v.002l.995-.1zm-.928 3.249l-.906-.424-.002.004.908.42zm-.253.547l-.908-.42-.004.008.912.412zm.499 1.324l-.413.91.004.002.409-.912zm1.323-.5l-.908-.42-.003.008.91.413zm.243-.524l-.906-.424-.002.004.908.42zm0-.003l-.905-.423.906.424zm1.106-4.292l-.995.1.995-.1zm-1.19-2.5l.79-.611-.79.611zm-.004-.004l.79-.612v-.002l-.79.614zm-.767-1.285l-.966.258.966-.258zm.767-2.718l.672-.74-.825-.75-.656.901.809.589zm.028.024l-.65.761.65-.76zm.039.035l-.69.723.008.009.01.008.672-.74zm1.42 1.129l.524-.852-.523.852zm4.96.952l.042.999h.001l-.043-1zm.955-1.043l-1 .043 1-.043zM7.008 15.17l.123.992h.003l-.126-.992zm1.81-.654l-.477-.88.476.88zm-3.214.7l.012-1h-.008l-.004 1zm-.162-.001l-.005 1 .005-1zm-.704.005l.03 1h.002l-.032-1zm-.97 1.028l1-.028v-.001l-1 .029zm1.029.97v1h.03l-.03-1zm.722-.003l-.008 1h.008v-1zm0 0l.008-1H5.52v1zm.065 0l.012-1h-.004l-.008 1zm1.672-.061l.124.992-.124-.992zm2.515-.88l.478.878-.478-.878zm.402-1.356l-.879.476.001.002.879-.478zm5.199-6.689a3.493 3.493 0 003.49-3.489h-2c0 .82-.67 1.489-1.49 1.489v2zm-3.49-3.489a3.492 3.492 0 003.49 3.489v-2c-.82 0-1.49-.669-1.49-1.489h-2zm3.49-3.491a3.492 3.492 0 00-3.49 3.491h2c0-.822.67-1.491 1.49-1.491v-2zm3.49 3.491a3.493 3.493 0 00-3.49-3.491v2c.82 0 1.49.669 1.49 1.491h2zm-4.022 5.43c1.392.856 3.126.861 4.392.806l-.088-1.998c-1.277.056-2.438-.008-3.257-.511l-1.047 1.704zm-1.273-1.017c.365.33.794.723 1.272 1.017l1.049-1.703c-.292-.18-.581-.437-.978-.797l-1.343 1.483zm-.605-.532c.197.163.392.338.606.532l1.342-1.483c-.208-.188-.436-.395-.675-.591l-1.273 1.542zm-6.487.301c1.78-1.718 4.642-1.833 6.485-.303l1.277-1.539c-2.649-2.2-6.657-2.003-9.15.403l1.388 1.44zm0 .001s-.001-.001 0 0v-.001l-.001.002-1.387-1.442a2 2 0 00-.053 2.828l1.441-1.387zm-.002 0h.002c0-.001 0 0 0 0h-.001v-.002l-1.438 1.391a2 2 0 002.828.048l-1.39-1.437zm4.978-1.126c-1.667-.54-3.64-.164-4.976 1.125l1.388 1.44c.774-.747 1.965-.988 2.971-.662l.617-1.903zm-.356 5.015c-.368-1.376.113-2.439.86-3.48L10.33 8.166c-.89 1.24-1.763 2.937-1.166 5.164l1.931-.518zm.942 1.636c-.426-.548-.775-1.015-.942-1.636l-1.931.517c.283 1.06.882 1.816 1.294 2.346l1.58-1.227zm.01.013l-.008-.01-1.583 1.221.008.01 1.583-1.22zm.98 1.98c-.086-.867-.62-1.514-.98-1.98l-1.583 1.222c.449.582.554.765.573.957l1.99-.198zm-1.017 3.773c.25-.532.534-1.138.737-1.75.204-.614.353-1.307.28-2.024l-1.99.201c.033.324-.028.713-.188 1.192-.16.481-.391.98-.65 1.533l1.811.848zm-.25.542l.252-.547-1.815-.84-.253.548 1.815.84zm.003-.006c.001 0 0 0 0 0v-.002 0l-1.823-.823a2.002 2.002 0 00.998 2.646l.825-1.821zm0 0h.001l-.005-.002-.817 1.825c.262.118.542.177.82.177v-2zm0 0v2a2 2 0 001.822-1.176l-1.822-.825zm.246-.533l-.243.525 1.815.84.243-.525-1.815-.84zm.002-.006v.002l1.812.847v-.002l-1.812-.847zm1.017-3.77c.128 1.272-.404 2.461-1.016 3.77l1.811.847c.574-1.226 1.386-2.911 1.195-4.817l-1.99.2zm-.987-1.987c.514.664.908 1.201.987 1.987l1.99-.2c-.143-1.418-.896-2.365-1.395-3.01l-1.582 1.223zm-.004-.005l.004.005 1.582-1.223-.003-.005-1.583 1.223zm-.941-1.637c.183.682.626 1.231.943 1.639l1.58-1.227c-.378-.486-.533-.71-.592-.93l-1.931.518zm.924-3.566c-.743 1.022-1.31 2.123-.924 3.566l1.931-.518c-.147-.55-.023-1.001.61-1.871L12.02 9.247zm1.486-.147a.403.403 0 00-.005-.004l-1.345 1.48.052.045L13.506 9.1zm.08.071c-.036-.034-.07-.063-.08-.071l-1.298 1.521.007.006.001.001-.01-.01 1.38-1.447zm1.254 1c-.453-.278-.834-.62-1.272-1.017l-1.344 1.481c.423.384.934.85 1.57 1.24l1.046-1.704zm3.619.825c-1.259 0-2.556-.17-3.619-.824l-1.047 1.704c1.533.942 3.276 1.12 4.666 1.12v-2zm.774-.02c-.255.011-.513.02-.774.02v2c.302 0 .592-.01.859-.021l-.085-1.998zm-.001 0l.087 1.999a2 2 0 001.91-2.086l-1.997.087zm-.014.001c-.003 0-.003 0 0 .001a.045.045 0 01.014.008c.004.004.004.006.003.003a.044.044 0 01-.003-.013l1.998-.087c-.05-1.13-1.026-1.942-2.073-1.91l.06 1.998zM7.134 16.163c.88-.111 1.602-.464 2.16-.768l-.954-1.757c-.505.274-.957.478-1.457.54l.25 1.985zm-1.543.053c.482.006 1.017.012 1.54-.053l-.245-1.985c-.369.046-.772.045-1.27.039l-.025 2zm-.153 0h.16l.01-2h-.16l-.01 2zm-.668.004c.213-.006.43-.005.667-.004l.01-2c-.23-.001-.483-.003-.74.005l.063 2zm-.002 0l-.058-1.999a2 2 0 00-1.941 2.057l2-.058zm0 0c-.002 0 0 0 0 0-.001-.001-.001-.001 0 0v.001c0 .001 0 .001 0 0l-2 .055a2 2 0 002 1.944v-2zm.029 0h-.03v2h.03v-2zm.73-.004c-.237-.002-.497-.004-.76.004l.06 2c.219-.008.44-.006.684-.004l.016-2zm-.008 0v2-2zm.073 0h-.065l-.015 2h.065l.015-2zm1.541-.054c-.504.063-.997.06-1.537.055l-.023 2c.532.006 1.151.011 1.807-.07l-.247-1.985zm2.161-.766c-.631.343-1.324.662-2.16.766l.246 1.985c1.207-.15 2.16-.609 2.869-.994l-.955-1.757zm.001 0c0 .002 0 .002 0 0v-.001c0-.001 0-.001 0 0v.001h-.002l.957 1.757a2 2 0 00.802-2.712l-1.757.956zm0 0l1.758-.954a2.001 2.001 0 00-2.712-.805l.953 1.759z",fill:t.COLORS.labelPrimary,mask:"url(#a)"})]})},i4}()),a=o4(),o=u4(),s=t4(),u=h4(),c=h(_4()),d=l();function h(e){return e&&e.__esModule?e:{default:e}}const m=t.StyleSheet.create({container:{gap:16,flexWrap:"wrap"},text:{...s.FONTS.Poppins.regular_SM,color:s.COLORS.labelPrimary,flex:1},row:{flexDirection:"row",gap:8},icon:{alignSelf:"center"}});return V3.default=function({glucoseReading:s,hasActivity:l,bloodGlucoseUnit:h}){const{t:p}=(0,o.useLanguage)(),f=(0,e.useMemo)(()=>(0,u.convertBGL)(s.value,s.unit,n.BloodGlucoseUnit.MMOL_L),[s]),_=(0,e.useMemo)(()=>n.CONSTANTS.LEVEL_TWO_HYPOGLYCEMIA_MIN<=f&&f<n.CONSTANTS.LEVEL_TWO_HYPOGLYCEMIA_MAX?p("recommendation_suggestions_remeasure_very_low"):n.CONSTANTS.LEVEL_ONE_HYPOGLYCEMIA_MIN<=f&&f<n.CONSTANTS.LEVEL_ONE_HYPOGLYCEMIA_MAX?p("recommendation_suggestions_remeasure_low"):n.CONSTANTS.SEVERE_HYPOGLYCEMIA_MIN<=f&&f<=n.CONSTANTS.SEVERE_HYPERGLYCEMIA_MAX?p("recommendation_suggestions_measure_ketone"):null,[f,p]),g=(0,e.useMemo)(()=>{if(n.CONSTANTS.LOW_GLUCOSE_MESSAGE_ACTIVITY_MIN<=f&&f<=n.CONSTANTS.LOW_GLUCOSE_MESSAGE_ACTIVITY_MAX){const e=(0,u.formatUnit)(h),t=h===n.BloodGlucoseUnit.MG_DL?a.ACTIVITY_POSTPONE_GLUCOSE_MGDL.toString():a.ACTIVITY_POSTPONE_GLUCOSE_MMOLL.toString();return p("recommendation_suggestions_postpone_activity",{displayUnit:e,value:t})}return n.CONSTANTS.HIGH_GLUCOSE_MESSAGE_ACTIVITY_MIN<=f&&f<=n.CONSTANTS.HIGH_GLUCOSE_MESSAGE_ACTIVITY_MAX?p("recommendation_suggestions_reduce_intensity"):null},[f,h,p]);return(0,d.jsxs)(t.View,{style:m.container,children:[_&&(0,d.jsxs)(t.View,{style:m.row,children:[(0,d.jsx)(i.default,{style:m.icon,testID:"blood-icon"}),(0,d.jsx)(c.default,{style:m.text,testID:"blood-glucose-message",children:_})]}),l&&g&&(0,d.jsxs)(t.View,{style:m.row,children:[(0,d.jsx)(r.default,{style:m.icon,testID:"run-icon"}),(0,d.jsx)(c.default,{style:m.text,testID:"activity-message",children:g})]})]})},V3}var y4,v4={},b4={};var S4,w4={};function k4(){if(S4)return w4;S4=1,Object.defineProperty(w4,"__esModule",{value:!0}),w4.default=void 0,function(e){e&&e.__esModule}(w());var e=z3,t=t4(),n=l();return w4.default=i=>(0,n.jsxs)(e.Svg,{width:24,height:25,viewBox:"0 0 24 25",fill:"none",...i,children:[(0,n.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M3.99312 4.2711C4.97691 3.21491 6.37794 2.62354 8.03206 2.62354H11.6091C12.0233 2.62354 12.3591 2.95933 12.3591 3.37354C12.3591 3.78775 12.0233 4.12354 11.6091 4.12354H8.03206C6.75004 4.12354 5.76199 4.57281 5.09074 5.29347C4.414 6.02002 4.00391 7.08289 4.00391 8.39968V16.3464C4.00391 17.6647 4.4124 18.7277 5.08783 19.4539C5.75756 20.1739 6.74517 20.6235 8.03206 20.6235H16.467C17.7555 20.6235 18.7433 20.1738 19.4128 19.4539C20.088 18.7278 20.4961 17.6649 20.4961 16.3464V12.7654C20.4961 12.3512 20.8319 12.0154 21.2461 12.0154C21.6603 12.0154 21.9961 12.3512 21.9961 12.7654V16.3464C21.9961 17.9738 21.4886 19.4244 20.5112 20.4754C19.5281 21.5326 18.1263 22.1235 16.467 22.1235H8.03206C6.37405 22.1235 4.97259 21.5324 3.98947 20.4754C3.01204 19.4245 2.50391 17.974 2.50391 16.3464V8.39968C2.50391 6.77158 3.01482 5.32139 3.99312 4.2711Z",fill:i?.color??t.COLORS.labelPrimary}),(0,n.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M17.4779 4.79025L11.947 10.8273C11.6292 11.1844 11.4306 11.6319 11.3786 12.1085L11.2367 13.4178C11.1888 13.8615 11.5777 14.2282 12.0174 14.1548C12.0173 14.1548 12.0175 14.1547 12.0174 14.1548L13.2872 13.9418C13.8024 13.8552 14.2724 13.5962 14.6197 13.2079L14.6257 13.2012L20.1012 7.2259L20.1038 7.2231C20.4768 6.82017 20.4526 6.1918 20.0494 5.81853L18.8817 4.73742C18.8817 4.73738 18.8818 4.73746 18.8817 4.73742C18.4788 4.36513 17.8501 4.38948 17.4779 4.79025ZM16.376 3.77252C17.311 2.76233 18.8891 2.70159 19.8999 3.63592L21.0684 4.71777C21.0683 4.71776 21.0684 4.71779 21.0684 4.71777C22.0786 5.65306 22.1405 7.22926 21.206 8.24047C21.2055 8.24101 21.205 8.24155 21.2045 8.24209L15.7346 14.2114C15.1602 14.8521 14.3846 15.2784 13.5359 15.4211L12.2655 15.6341C10.8457 15.8717 9.59091 14.6883 9.74532 13.2569L9.88736 11.9465C9.97332 11.1584 10.3028 10.4163 10.8313 9.82475L10.8376 9.81777L16.3734 3.77534L16.376 3.77252Z",fill:i?.color??t.COLORS.labelPrimary})]}),w4}var C4={},E4={};const I4=i(te);var x4,T4={};var O4,R4,A4,L4={},P4={};function M4(){if(R4)return L4;R4=1,Object.defineProperty(L4,"__esModule",{value:!0}),L4.default=void 0,function(e){e&&e.__esModule}(w());var e=QB,t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(function(){if(O4)return P4;O4=1,Object.defineProperty(P4,"__esModule",{value:!0}),P4.default=P4.CheckmarkCircleFilledHeight=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=l();return P4.CheckmarkCircleFilledHeight=140,P4.default=function(n){return(0,t.jsxs)(e.default,{width:128,height:128,viewBox:"0 0 128 128",fill:"none",...n,children:[(0,t.jsx)(e.Circle,{cx:64,cy:64,r:63,fill:"#4A5DEB",stroke:"#4A73ED",strokeWidth:2}),(0,t.jsx)(e.Path,{d:"M43 67C43 67 54 78.5 55.5 79C57 79.5 85.5 49 85.5 49",stroke:"white",strokeWidth:5.33333,strokeLinecap:"round"})]})},P4}()),n=t4(),i=l();const r=e.StyleSheet.create({container:{position:"absolute",top:0,left:0,right:0,bottom:0},checkmarkContainer:{flex:1,flexGrow:1,alignItems:"center",backgroundColor:n.COLORS.bgPrimary}});return L4.default=()=>{const{height:n}=(0,e.useWindowDimensions)();return(0,i.jsx)(e.View,{style:r.container,testID:"backdrop-checkmark",children:(0,i.jsx)(e.View,{style:r.checkmarkContainer,children:(0,i.jsx)(t.default,{style:{marginTop:n/2-t.CheckmarkCircleFilledHeight,opacity:.6},testID:"timeout-modal-checkmark"})})})},L4}function D4(){if(A4)return E4;A4=1,Object.defineProperty(E4,"__esModule",{value:!0}),E4.default=void 0;var e=I4,t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),n=QB,i=j3,r=t4(),a=u(function(){if(x4)return T4;x4=1,Object.defineProperty(T4,"__esModule",{value:!0}),T4.default=void 0,function(e){e&&e.__esModule}(w());var e=QB,t=t4(),n=l();const i=e.StyleSheet.create({container:{backgroundColor:t.COLORS.bgOverlay,position:"absolute",top:0,left:0,right:0,bottom:0}});return T4.default=()=>(0,n.jsx)(e.View,{style:i.container,testID:"backdrop"}),T4}()),o=u(M4()),s=l();function u(e){return e&&e.__esModule?e:{default:e}}const c=Math.ceil(n.Dimensions.get("screen").height/100*85);function d({testID:r,isVisible:l,onModalHide:u,onModalShow:d,containerStyle:m,children:p,checkmark:f}){const{bottom:_}=(0,i.useSafeAreaInsets)(),[g,y]=(0,t.useState)(0),[v,b]=(0,t.useState)(!1),S=(0,t.useRef)(new n.Animated.Value(c)).current,w=(0,t.useCallback)(()=>{n.Animated.timing(S,{toValue:0,duration:300,easing:n.Easing.out(n.Easing.cubic),useNativeDriver:"web"!==n.Platform.OS}).start(({finished:e})=>{e&&d&&d()})},[S,d]),k=(0,t.useCallback)(()=>{n.Animated.timing(S,{toValue:g,duration:300,easing:n.Easing.out(n.Easing.cubic),useNativeDriver:"web"!==n.Platform.OS}).start(({finished:e})=>{e&&(b(!1),u&&u())})},[S,g,u]);(0,t.useEffect)(()=>{if(v!==l)return!v&&l?(b(!0),w()):void(v&&!l&&k())},[l,w,k,v]);const C=(0,t.useCallback)(e=>{y(e.nativeEvent.layout.height+_)},[_]);return v?(0,s.jsx)(e.Portal,{children:(0,s.jsxs)(n.View,{style:h.overlay,children:[f?(0,s.jsx)(o.default,{}):(0,s.jsx)(a.default,{}),(0,s.jsx)(n.Animated.View,{testID:r,onLayout:C,style:[h.modal,{transform:[{translateY:S}]},{paddingBottom:_+16},m],children:p})]})}):null}const h=n.StyleSheet.create({modal:{width:"100%",maxHeight:"85%",paddingTop:32,paddingBottom:16,paddingHorizontal:16,borderTopRightRadius:20,borderTopLeftRadius:20,backgroundColor:r.COLORS.bgModal},backdrop:{position:"absolute",left:0,right:0,top:0,bottom:0},overlay:{...n.StyleSheet.absoluteFillObject,backgroundColor:r.COLORS.bgTransparent,justifyContent:"flex-end"}});return E4.default=t.default.memo(d),E4}var N4,F4={},B4={};var j4={};const V4=i(q0);var H4;var z4,U4,G4,W4,Y4={};function $4(){if(U4)return F4;U4=1,Object.defineProperty(F4,"__esModule",{value:!0}),F4.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=u(ej()),i=function(){if(N4)return B4;N4=1,Object.defineProperty(B4,"__esModule",{value:!0}),B4.useDebouncedCallback=function(t,n){const i=(0,e.useRef)(null),r=(0,e.useRef)(t);return(0,e.useEffect)(()=>{r.current=t},[t]),(0,e.useCallback)((...e)=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current(...e)},n)},[n])};var e=w();return B4}(),r=t4(),a=(H4||(H4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"HapticFeedbackTypes",{enumerable:!0,get:function(){return n.HapticFeedbackTypes}}),e.triggerHaptic=function(e=("ios"===t.Platform.OS?n.HapticFeedbackTypes.selection:n.HapticFeedbackTypes.effectTick),i){n.default.trigger(e,{...i})};var t=QB,n=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(V4)}(j4)),j4),o=u(function(){if(z4)return Y4;z4=1,Object.defineProperty(Y4,"__esModule",{value:!0}),Y4.default=void 0;var e=function(e){return e&&e.__esModule?e:{default:e}}(w()),t=QB,n=t4(),i=l();function r({type:e,height:n,option:r,index:o,onItemPress:s}){return(0,i.jsx)(t.Pressable,{onPress:s,testID:`${e}-wheel-picker-item-`+o,children:(0,i.jsx)(t.Animated.View,{style:[a.option,{height:n}],children:(0,i.jsx)(t.Text,{style:a.itemTextStyle,children:r})})})}Y4.default=e.default.memo(r);const a=t.StyleSheet.create({option:{alignItems:"center",justifyContent:"center",zIndex:100},itemTextStyle:{fontSize:22,lineHeight:26,fontWeight:"400",color:n.COLORS.labelPrimary}});return Y4}()),s=l();function u(e){return e&&e.__esModule?e:{default:e}}F4.default=function({type:l,initialScrollIndex:u,selectedIndex:d,options:h,onChange:m,visibleRest:p=3,decelerationRate:f="normal"}){const{width:_}=(0,t.useWindowDimensions)(),g=35,y=g*p,v=(0,e.useRef)(null),b=(0,e.useRef)(null),S=(0,e.useMemo)(()=>new t.Animated.Value(0),[]),w=(1+2*p)*g,k=(0,e.useMemo)(()=>{const e=[...h];for(let t=0;t<p;t++)e.unshift(null),e.push(null);return e},[h,p]),C=(0,e.useMemo)(()=>[...Array(k.length)].map((e,t)=>t*g),[k,g]),E=(0,e.useCallback)(e=>{const t=Math.min(g*(h.length-1),Math.max(e.nativeEvent.contentOffset.y,0));let n=Math.floor(Math.floor(t)/g);Math.floor(t%g)>17.5&&n++,n!==d&&m(n)},[h.length,d,m]),I=(0,e.useCallback)(e=>{"web"!==t.Platform.OS&&b.current!==e&&(b.current=e,(0,a.triggerHaptic)())},[]),x=(0,e.useCallback)(e=>{const n=Math.round(Math.round(e.nativeEvent.contentOffset.y)/g),i=Math.min(h.length-1,Math.max(n,0));I(i),i!==d&&m(i),"web"===t.Platform.OS&&v.current?.scrollToIndex({index:i,animated:!0})},[I,m,d,h.length]),T=(0,i.useDebouncedCallback)(x,100),O=(0,e.useCallback)(e=>{m(e),v.current?.scrollToIndex({index:e,animated:!0})},[m]);return(0,s.jsxs)(t.View,{style:[c.containerPicker,{height:w}],testID:`${l}-wheel-picker`,children:[(0,s.jsx)(t.View,{style:[c.selectedIndicator,{transform:[{translateY:-17.5}],height:g,width:_-32-20}]}),(0,s.jsx)(t.Animated.FlatList,{testID:`${l}-wheel-picker-list`,ref:v,style:c.scrollView,showsVerticalScrollIndicator:!1,onScroll:t.Animated.event([{nativeEvent:{contentOffset:{y:S}}}],{useNativeDriver:"web"!==t.Platform.OS,listener:"web"===t.Platform.OS?T:x}),onMomentumScrollEnd:E,snapToInterval:g,snapToOffsets:C,decelerationRate:f,initialScrollIndex:u,getItemLayout:(e,t)=>({length:g,offset:g*t,index:t}),data:k,keyExtractor:(e,t)=>t.toString(),renderItem:({item:e,index:t})=>(0,s.jsx)(o.default,{type:l,index:t,option:e,height:g,onItemPress:()=>O(Math.max(0,Math.min(t-p,h.length-1)))},e)}),(0,s.jsx)(n.default,{colors:[r.COLORS.iosKeyboardPicker+"FF",r.COLORS.iosKeyboardPicker+"4D"],style:[c.mask,{top:0,height:y}]}),(0,s.jsx)(n.default,{colors:[r.COLORS.iosKeyboardPicker+"4D",r.COLORS.iosKeyboardPicker+"FF"],style:[c.mask,{bottom:0,height:y}]})]})};const c=t.StyleSheet.create({containerPicker:{borderTopLeftRadius:13,borderTopRightRadius:13,backgroundColor:r.COLORS.iosKeyboardPicker,overflow:"hidden"},selectedIndicator:{position:"absolute",backgroundColor:r.COLORS.iosSelectorKeyboard,borderRadius:7,top:"50%",alignSelf:"center"},scrollView:{overflow:"hidden",flex:1},mask:{position:"absolute",left:0,right:0,pointerEvents:"none"}});return F4}function X4(){if(G4)return C4;G4=1,Object.defineProperty(C4,"__esModule",{value:!0}),C4.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=u4(),i=t4(),r=u(D4()),a=u(_4()),o=u($4()),s=l();function u(e){return e&&e.__esModule?e:{default:e}}const c=i=>{const{isVisible:l,items:u,initialScrollIndex:c,type:h,onCancel:m,onConfirm:p,onDismiss:f}=i,{t:_}=(0,n.useLanguage)(),[g,y]=(0,e.useState)(c),v=(0,e.useCallback)(e=>{y(e)},[]),b=(0,e.useCallback)(()=>{p(parseFloat(u[g]))},[u,g,p]),S=(0,e.useCallback)(()=>{y(c),m()},[c,m]);return(0,s.jsx)(r.default,{isVisible:l,onModalHide:f,containerStyle:d.contentContainerModal,children:(0,s.jsxs)(t.View,{testID:`${h}-wheelpicker-modal`,children:[(0,s.jsx)(o.default,{type:h,selectedIndex:g,initialScrollIndex:c,options:u,onChange:v}),(0,s.jsxs)(t.View,{style:d.buttonContainer,children:[(0,s.jsx)(t.Pressable,{style:d.confirmButton,children:(0,s.jsx)(t.TouchableOpacity,{onPress:b,testID:`${h}-wheel-picker-modal-confirm-button`,accessibilityRole:"button",children:(0,s.jsx)(a.default,{style:d.buttonText,children:_("button_confirm")})})}),(0,s.jsx)(t.Pressable,{style:d.cancelButton,children:(0,s.jsx)(t.TouchableOpacity,{onPress:S,testID:`${h}-wheel-picker-modal-cancel-button`,accessibilityRole:"button",children:(0,s.jsx)(a.default,{style:d.cancelText,children:_("button_cancel")})})})]})]})})};C4.default=(0,e.memo)(c);const d=t.StyleSheet.create({buttonContainer:{gap:8},contentContainerModal:{backgroundColor:i.COLORS.bgTransparent},buttonText:{fontSize:17,lineHeight:22,fontWeight:"400",paddingHorizontal:16,paddingVertical:14,textAlign:"center",color:i.COLORS.textKeyboardButtons},cancelButton:{backgroundColor:i.COLORS.iosKeyboardPicker,borderRadius:13},cancelText:{fontSize:17,lineHeight:22,fontWeight:"600",paddingHorizontal:16,paddingVertical:14,textAlign:"center",color:i.COLORS.textKeyboardButtons},confirmButton:{backgroundColor:i.COLORS.iosKeyboardPicker,borderBottomLeftRadius:13,borderBottomRightRadius:13}});return C4}function q4(){if(W4)return v4;W4=1,Object.defineProperty(v4,"__esModule",{value:!0}),v4.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=h(function(){if(y4)return b4;y4=1,Object.defineProperty(b4,"__esModule",{value:!0}),b4.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=t4(),n=l();return b4.default=function(i){return(0,n.jsx)(e.default,{width:42,height:42,viewBox:"0 0 42 42",fill:"none",...i,children:(0,n.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M14.075 5.202a1.313 1.313 0 011.539-1.04c2.41.468 4.109 1.686 5.178 3.328.874 1.34 1.283 2.895 1.394 4.422a15.383 15.383 0 002.662-.475c1.134-.306 3.85-.727 6.424.425 2.686 1.202 4.946 3.988 5.289 9.548a.988.988 0 01.002.051c.043 5.242-1.626 9.2-3.54 11.88-.955 1.336-1.972 2.359-2.874 3.067a8.58 8.58 0 01-1.27.842c-.347.183-.72.336-1.074.389-1.64.386-3.142.11-4.34-.222-.369-.102-.751-.222-1.087-.327-.188-.06-.361-.114-.509-.158-.473-.141-.768-.202-.961-.202-.203 0-.504.059-.972.19-.152.043-.336.098-.535.158-.328.097-.7.208-1.049.301-1.194.317-2.684.588-4.327.262-.359-.052-.74-.209-1.097-.398-.39-.206-.82-.49-1.271-.844-.903-.709-1.92-1.73-2.873-3.066-1.911-2.678-3.575-6.63-3.533-11.872 0-.017 0-.034.002-.051.343-5.56 2.603-8.346 5.29-9.548 2.574-1.152 5.29-.731 6.423-.425.863.232 1.725.388 2.586.468-.106-1.119-.415-2.148-.96-2.982-.663-1.02-1.735-1.845-3.478-2.183a1.312 1.312 0 01-1.039-1.538zm.98 12.966a1.313 1.313 0 00-1.126-2.371c-1.911.908-3.296 2.796-3.584 4.894a1.312 1.312 0 102.6.358 3.85 3.85 0 012.11-2.881z",fill:t.COLORS.graphCarbohydrateSecondary})})},b4}()),i=h(k4()),r=o4(),a=u4(),o=t4(),s=h4(),u=h(_4()),c=h(X4()),d=l();function h(e){return e&&e.__esModule?e:{default:e}}const m=(0,s.createSequentialArrayInteger)(r.CARBOHYDRATES_LIMITS.min,r.CARBOHYDRATES_LIMITS.max);v4.default=function({carbsRecommendation:r,editedCarbsRecommendation:o,onDismiss:s,onConfirm:l}){const{t:h}=(0,a.useLanguage)(),[f,_]=(0,e.useState)(!1),g=(0,e.useCallback)(()=>{_(!1)},[]),y=(0,e.useCallback)(()=>{_(!0)},[]),v=(0,e.useCallback)(e=>{_(!1),l(e)},[l]),b=(0,e.useCallback)(()=>{if(null!==o)return m.findIndex(e=>e===o.toString());const e=Math.round(r);return m.findIndex(t=>t===e.toString())},[o,r]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(t.View,{style:p.card,testID:"carbs-recommendation-display",children:(0,d.jsxs)(t.View,{style:p.row,children:[(0,d.jsx)(n.default,{}),(0,d.jsxs)(t.View,{style:p.body,children:[(0,d.jsxs)(t.View,{style:p.valueRow,children:[(0,d.jsx)(u.default,{style:p.label,children:h("recommendation_carb_eat")}),null!==o?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u.default,{style:p.valueEdited,children:` ${r} g`}),(0,d.jsx)(u.default,{style:p.valueBold,children:` ${o} g`})]}):(0,d.jsx)(u.default,{style:p.valueBold,children:` ${r} g`})]}),(0,d.jsx)(u.default,{style:p.subtitle,children:h("recommendation_carb_title")})]}),(0,d.jsx)(t.TouchableOpacity,{onPress:y,testID:"carbohydrates-edit-button",hitSlop:10,style:p.editButton,children:(0,d.jsx)(i.default,{style:p.editIcon})})]})}),(0,d.jsx)(c.default,{type:"carbohydrates",items:m,isVisible:f,initialScrollIndex:b(),onConfirm:v,onCancel:g,onDismiss:s})]})};const p=t.StyleSheet.create({card:{backgroundColor:o.COLORS.bgSecondary,borderRadius:16,marginBottom:32},row:{flexDirection:"row",justifyContent:"center",alignItems:"center",padding:24,gap:12},body:{flex:1},valueRow:{flexDirection:"row",alignItems:"center"},label:{...o.FONTS.Poppins.medium_LG,color:o.COLORS.labelPrimary},valueBold:{...o.FONTS.Poppins.bold_LG,color:o.COLORS.labelPrimary},subtitle:{...o.FONTS.Poppins.medium_SM,color:o.COLORS.labelPrimary,lineHeight:23},valueEdited:{...o.FONTS.Poppins.medium_Base,textDecorationLine:"line-through",opacity:.4},editIcon:{marginLeft:4},editButton:{alignSelf:"flex-start"}});return v4}var Z4,K4={};var Q4,J4={},e9={};var t9,n9={};var i9,r9={};var a9,o9,s9={};function l9(){if(o9)return J4;o9=1,Object.defineProperty(J4,"__esModule",{value:!0}),J4.styles=J4.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=h(function(){if(Q4)return e9;Q4=1,Object.defineProperty(e9,"__esModule",{value:!0}),e9.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=t4(),n=l();return e9.default=function(i){return(0,n.jsx)(e.default,{width:21,height:20,viewBox:"0 0 21 20",...i,children:(0,n.jsx)(e.Path,{d:"M4.022 6.839a.692.692 0 01.84-.057l.073.057 5.565 5.074 5.565-5.074a.693.693 0 01.84-.057l.073.057a.55.55 0 01.062.766l-.062.066-6.022 5.49a.692.692 0 01-.84.057l-.072-.057-6.022-5.49a.552.552 0 010-.832z",fill:t.COLORS.labelSecondary})})},e9}()),i=h(function(){if(t9)return n9;t9=1,Object.defineProperty(n9,"__esModule",{value:!0}),n9.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=t4(),n=l();return n9.default=function(i){return(0,n.jsx)(e.default,{width:21,height:20,viewBox:"0 0 21 20",fill:"none",...i,children:(0,n.jsx)(e.Path,{d:"M16.984 13.15a.625.625 0 01-.814.061l-.07-.06-5.392-5.392-5.391 5.391a.625.625 0 01-.814.061l-.07-.06a.625.625 0 01-.06-.814l.06-.07 5.834-5.834a.625.625 0 01.813-.06l.07.06 5.834 5.834a.625.625 0 010 .883z",fill:t.COLORS.labelSecondary})})},n9}()),r=h(function(){if(i9)return r9;i9=1,Object.defineProperty(r9,"__esModule",{value:!0}),r9.default=void 0,n(w());var e=n(z3),t=l();function n(e,t){if("function"==typeof WeakMap)var i=new WeakMap,r=new WeakMap;return(n=function(e,t){if(!t&&e&&e.__esModule)return e;var n,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(n=t?r:i){if(n.has(e))return n.get(e);n.set(e,o)}for(const i in e)"default"!==i&&{}.hasOwnProperty.call(e,i)&&((a=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,i))&&(a.get||a.set)?n(o,i,a):o[i]=e[i]);return o})(e,t)}return r9.default=function(n){return(0,t.jsx)(e.default,{width:20,height:20,viewBox:"0 0 24 24",fill:"none",...n,children:(0,t.jsx)(e.Path,{d:"M11.7012 4.125C11.8651 3.95886 12.1261 3.95886 12.29 4.125L18.2441 10.1582C19.2467 11.1743 19.2467 12.8256 18.2441 13.8418L12.29 19.875C12.1261 20.0411 11.8661 20.0411 11.7021 19.875L5.74805 13.8418C4.74547 12.8257 4.74558 11.1744 5.74805 10.1582L11.7012 4.125Z",fill:"#401782",stroke:"#9B8BF3",strokeWidth:2})})},r9}()),a=u4(),o=t4(),s=h4(),u=h(_4()),c=h(function(){if(a9)return s9;a9=1,Object.defineProperty(s9,"__esModule",{value:!0}),s9.styles=s9.default=void 0,r(w());var e=QB,t=t4(),n=r(_4()),i=l();function r(e){return e&&e.__esModule?e:{default:e}}s9.default=function({title:t,value:r,unit:o,hasSeparator:s,testID:l,icon:u}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(e.View,{style:a.itemContainer,testID:l,children:[(0,i.jsx)(e.View,{style:a.itemTitleContainer,children:(0,i.jsx)(n.default,{style:a.title,testID:l+"-title",children:t})}),(0,i.jsxs)(e.View,{style:a.row,children:[u&&(0,i.jsx)(e.View,{style:a.icon,testID:l+"-icon",children:u}),(0,i.jsx)(n.default,{style:a.itemText,testID:l+"-value",children:r}),!!o&&(0,i.jsx)(e.View,{style:a.row,children:(0,i.jsx)(n.default,{style:a.itemText,testID:l+"-unit",children:" "+o})})]})]}),s&&(0,i.jsx)(e.View,{style:a.divider,testID:l+"-divider"})]})};const a=s9.styles=e.StyleSheet.create({itemContainer:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:14,paddingHorizontal:16,gap:8},itemTitleContainer:{alignSelf:"flex-start"},icon:{marginRight:8},title:{...t.FONTS.Poppins.regular_Base,color:t.COLORS.labelPrimary},itemText:{...t.FONTS.Poppins.regular_Base,color:t.COLORS.labelSecondary,textAlign:"right"},divider:{height:1,backgroundColor:t.COLORS.divider},row:{flexDirection:"row",flexShrink:1,justifyContent:"flex-end"}});return s9}()),d=l();function h(e){return e&&e.__esModule?e:{default:e}}J4.default=function({carbIntakeValue:o,activeInsulin:l,glucoseReading:h,bloodGlucoseUnit:p,activity:f,trackExpandDetails:_}){const{t:g}=(0,a.useLanguage)(),[y,v]=(0,e.useState)(!1),b=(0,e.useMemo)(()=>({light:g("activity_intensity_1"),moderate:g("activity_intensity_2"),hard:g("activity_intensity_3")}),[g]),S=(0,e.useCallback)(()=>{t.LayoutAnimation.configureNext(t.LayoutAnimation.Presets.easeInEaseOut),v(e=>{const t=!e;return t&&_(),t})},[_]),w=(0,e.useMemo)(()=>{if(!f)return"";const{activityDuration:e,activityIntensity:t,activityReduction:n}=f,i=n?Math.round(100*n):0,r=t?`${b[t]},`:"",a=`${i}% ${g("recommendation_reduction")}`;var o;return`${(o=e)<=29?"0-29 min":o<=45?"30-45 min":o<=60?"46-60 min":"61-120 min"}. ${r} ${a}`},[b,f,g]),k=(0,e.useMemo)(()=>[{title:g("recommendation_summary_active_insulin_title"),value:l,unit:g(1===l?"unit":"units"),testID:"active-insulin-item"},{title:g("Glucose"),value:(0,s.convertAndFormatBGL)(h.value,h.unit,p),unit:(0,s.formatUnit)(p),testID:"blood-glucose-item",icon:"forecast"===h.source?(0,d.jsx)(r.default,{}):void 0},{title:g("recommendation_carbohydrates_title"),value:o||"-",unit:o?g(1===o?"gram":"grams"):void 0,testID:"carbs-item"},void 0!==f&&{title:g("recommendation_activity_title"),value:w,testID:"activity-item"}].filter(e=>e),[g,l,h,p,o,f,w]);return(0,d.jsxs)(t.View,{style:m.container,children:[(0,d.jsxs)(t.TouchableOpacity,{style:m.clickableContainer,onPress:S,hitSlop:10,children:[(0,d.jsx)(u.default,{style:m.title,children:g("recommendation_card_cal_details_title")}),(0,d.jsx)(t.View,{style:m.expandButton,testID:"chevron-"+y,children:y?(0,d.jsx)(i.default,{style:m.chevron}):(0,d.jsx)(n.default,{style:m.chevron})})]}),y&&(0,d.jsx)(t.View,{children:k.map(({title:e,unit:t,value:n,testID:i,icon:r},a,o)=>(0,d.jsx)(c.default,{icon:r,testID:i,title:e,value:n,unit:t,hasSeparator:a!==o.length-1},e))})]})};const m=J4.styles=t.StyleSheet.create({container:{padding:16,gap:16},clickableContainer:{flexDirection:"row",justifyContent:"center"},expandButton:{justifyContent:"center",alignItems:"center"},chevron:{alignSelf:"center",marginLeft:4},title:{...o.FONTS.Poppins.regular_SM,color:o.COLORS.labelSecondary,textAlign:"center"}});return J4}var u9,c9={};var d9,h9={};var m9,p9={};var f9,_9,g9={},y9={};function v9(){if(f9)return y9;f9=1,Object.defineProperty(y9,"__esModule",{value:!0}),y9.styles=void 0;var e=QB,t=t4();return y9.styles=e.StyleSheet.create({backgroundStyle:{backgroundColor:t.COLORS.bgModal},containerStyle:{opacity:.5},handleIndicatorStyle:{display:"none"},title:{...t.FONTS.Poppins.semiBold_LG,color:t.COLORS.labelPrimary,textAlign:"center",marginBottom:8},container:{backgroundColor:t.COLORS.bgModal,paddingHorizontal:16,paddingTop:16},message:{color:t.COLORS.labelSecondary,textAlign:"center",marginBottom:32},buttonContainer:{gap:16},button:{paddingHorizontal:16,paddingVertical:12,backgroundColor:t.COLORS.bgBrand,borderRadius:16},buttonText:{...t.FONTS.Poppins.semiBold_Base,color:t.COLORS.textButtonPrimary,textAlign:"center"},cancelButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:t.COLORS.bgButtonSecondary,borderRadius:16},deleteRedButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:t.COLORS.bgButtonPrimaryDanger,borderRadius:16},deleteFailureCloseButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:t.COLORS.bgBrand,borderRadius:16},saveButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:t.COLORS.bgBrand,borderRadius:16},saveText:{...t.FONTS.Poppins.semiBold_Base,textAlign:"center",color:t.COLORS.textButtonPrimary},closeText:{...t.FONTS.Poppins.semiBold_Base,textAlign:"center",color:t.COLORS.textButtonPrimary}}),y9}var b9,S9={};var w9,k9={};var C9,E9={};var I9,x9={};var T9,O9={};var R9,A9,L9={},P9={};function M9(){if(A9)return L9;A9=1,Object.defineProperty(L9,"__esModule",{value:!0}),L9.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=o(ej()),i=o(function(){if(R9)return P9;R9=1,Object.defineProperty(P9,"__esModule",{value:!0}),P9.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=l();return P9.default=function(n){return(0,t.jsxs)(e.default,{width:29,height:28,viewBox:"0 0 29 28",fill:"none",...n,children:[(0,t.jsx)(e.Path,{d:"M14.5 0.5C21.9558 0.5 28 6.54416 28 14C28 21.4558 21.9558 27.5 14.5 27.5C7.04416 27.5 1 21.4558 1 14C1 6.54416 7.04416 0.5 14.5 0.5Z",fill:"#4A5DEB"}),(0,t.jsx)(e.Path,{d:"M14.5 0.5C21.9558 0.5 28 6.54416 28 14C28 21.4558 21.9558 27.5 14.5 27.5C7.04416 27.5 1 21.4558 1 14C1 6.54416 7.04416 0.5 14.5 0.5Z",stroke:"#FFFFFF"}),(0,t.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20.8158 11.1809C21.0614 11.4221 21.0614 11.8132 20.8158 12.0544L14.9448 17.8191C14.6991 18.0603 14.3009 18.0603 14.0552 17.8191L8.18424 12.0544C7.93859 11.8132 7.93859 11.4221 8.18424 11.1809C8.4299 10.9397 8.82812 10.9397 9.07378 11.1809L14.5 16.5089L19.9262 11.1809C20.1718 10.9397 20.5701 10.9397 20.8158 11.1809Z",fill:"#FFFFFF"})]})},P9}()),r=t4(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}const s=t.StyleSheet.create({scrollToEndButton:{position:"absolute",bottom:80,alignSelf:"center"},arrowContainer:{backgroundColor:r.COLORS.bgButtonPrimary,borderRadius:24},gradient:{position:"absolute",left:0,right:0,bottom:0,height:145},linearGradient:{flex:1}});return L9.default=function({scrollToEnd:o,isVisibleArrow:l,isVisibleBlur:u}){const c=(0,e.useRef)(new t.Animated.Value(155)).current,d=(0,e.useRef)(new t.Animated.Value(u?1:0)).current;return(0,e.useEffect)(()=>{t.Animated.timing(d,{toValue:u?1:0,duration:400,useNativeDriver:!0}).start()},[u,d]),(0,e.useEffect)(()=>{l&&t.Animated.spring(c,{toValue:0,damping:10,stiffness:100,mass:1,useNativeDriver:!0}).start()},[l,c]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Pressable,{style:s.scrollToEndButton,testID:"scroll-hint-arrow",children:l&&(0,a.jsx)(t.Animated.View,{style:[s.arrowContainer,{transform:[{translateY:c}]}],children:(0,a.jsx)(t.TouchableOpacity,{testID:"scroll-hint-arrow-button",onPress:o,children:(0,a.jsx)(i.default,{})})})}),(0,a.jsx)(t.Animated.View,{style:[s.gradient,{opacity:d}],pointerEvents:"none",testID:"scroll-hint-blur",children:(0,a.jsx)(n.default,{colors:r.COLORS.gradientQuickGuide,style:s.linearGradient})})]})},L9}var D9,N9,F9,B9,j9={},V9={},H9={},z9={},U9={},G9={},W9={};function Y9(){return D9||(D9=1,function(e){var t,n,i;Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0,(n=t||(e.util=t={})).assertEqual=e=>{},n.assertIs=function(e){},n.assertNever=function(e){throw new Error},n.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},n.getValidEnumValues=e=>{const t=n.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),i={};for(const n of t)i[n]=e[n];return n.objectValues(i)},n.objectValues=e=>n.objectKeys(e).map(function(t){return e[t]}),n.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},n.find=(e,t)=>{for(const n of e)if(t(n))return n},n.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,n.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},n.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(i||(e.objectUtil=i={})).mergeShapes=(e,t)=>({...e,...t}),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);e.getParsedType=t=>{switch(typeof t){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return Number.isNaN(t)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(t)?e.ZodParsedType.array:null===t?e.ZodParsedType.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?e.ZodParsedType.promise:"undefined"!=typeof Map&&t instanceof Map?e.ZodParsedType.map:"undefined"!=typeof Set&&t instanceof Set?e.ZodParsedType.set:"undefined"!=typeof Date&&t instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}}}(W9)),W9}function $9(){if(N9)return G9;N9=1,Object.defineProperty(G9,"__esModule",{value:!0}),G9.ZodError=G9.quotelessJson=G9.ZodIssueCode=void 0;const e=Y9();G9.ZodIssueCode=e.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);G9.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");let t=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},i=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(i);else if("invalid_return_type"===r.code)i(r.returnTypeError);else if("invalid_arguments"===r.code)i(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,i=0;for(;i<r.path.length;){const n=r.path[i];i===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],i++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const i of this.issues)if(i.path.length>0){const n=i.path[0];t[n]=t[n]||[],t[n].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};return G9.ZodError=t,t.create=e=>new t(e),G9}function X9(){if(F9)return U9;F9=1,Object.defineProperty(U9,"__esModule",{value:!0});const e=$9(),t=Y9();return U9.default=(n,i)=>{let r;switch(n.code){case e.ZodIssueCode.invalid_type:r=n.received===t.ZodParsedType.undefined?"Required":`Expected ${n.expected}, received ${n.received}`;break;case e.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(n.expected,t.util.jsonStringifyReplacer)}`;break;case e.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${t.util.joinValues(n.keys,", ")}`;break;case e.ZodIssueCode.invalid_union:r="Invalid input";break;case e.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${t.util.joinValues(n.options)}`;break;case e.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${t.util.joinValues(n.options)}, received '${n.received}'`;break;case e.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case e.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case e.ZodIssueCode.invalid_date:r="Invalid date";break;case e.ZodIssueCode.invalid_string:"object"==typeof n.validation?"includes"in n.validation?(r=`Invalid input: must include "${n.validation.includes}"`,"number"==typeof n.validation.position&&(r=`${r} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?r=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?r=`Invalid input: must end with "${n.validation.endsWith}"`:t.util.assertNever(n.validation):r="regex"!==n.validation?`Invalid ${n.validation}`:"Invalid";break;case e.ZodIssueCode.too_small:r="array"===n.type?`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:"string"===n.type?`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:"number"===n.type||"bigint"===n.type?`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:"date"===n.type?`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:"Invalid input";break;case e.ZodIssueCode.too_big:r="array"===n.type?`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:"string"===n.type?`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:"number"===n.type?`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:"bigint"===n.type?`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:"date"===n.type?`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:"Invalid input";break;case e.ZodIssueCode.custom:r="Invalid input";break;case e.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case e.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${n.multipleOf}`;break;case e.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=i.defaultError,t.util.assertNever(n)}return{message:r}},U9}function q9(){if(B9)return z9;B9=1;var e=z9&&z9.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(z9,"__esModule",{value:!0}),z9.defaultErrorMap=void 0,z9.setErrorMap=function(e){n=e},z9.getErrorMap=function(){return n};const t=e(X9());z9.defaultErrorMap=t.default;let n=t.default;return z9}var Z9,K9={};function Q9(){return Z9||(Z9=1,function(e){var t=K9&&K9.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.EMPTY_PATH=e.makeIssue=void 0,e.addIssueToContext=function(t,r){const a=(0,n.getErrorMap)(),o=(0,e.makeIssue)({issueData:r,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===i.default?void 0:i.default].filter(e=>!!e)});t.common.issues.push(o)};const n=q9(),i=t(X9());e.makeIssue=e=>{const{data:t,path:n,errorMaps:i,issueData:r}=e,a=[...n,...r.path||[]],o={...r,path:a};if(void 0!==r.message)return{...r,path:a,message:r.message};let s="";const l=i.filter(e=>!!e).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...r,path:a,message:s}},e.EMPTY_PATH=[];class r{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,n){const i=[];for(const r of n){if("aborted"===r.status)return e.INVALID;"dirty"===r.status&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(e,t){const n=[];for(const i of t){const e=await i.key,t=await i.value;n.push({key:e,value:t})}return r.mergeObjectSync(e,n)}static mergeObjectSync(t,n){const i={};for(const r of n){const{key:n,value:a}=r;if("aborted"===n.status)return e.INVALID;if("aborted"===a.status)return e.INVALID;"dirty"===n.status&&t.dirty(),"dirty"===a.status&&t.dirty(),"__proto__"===n.value||void 0===a.value&&!r.alwaysSet||(i[n.value]=a.value)}return{status:t.value,value:i}}}e.ParseStatus=r,e.INVALID=Object.freeze({status:"aborted"});e.DIRTY=e=>({status:"dirty",value:e});e.OK=e=>({status:"valid",value:e});e.isAborted=e=>"aborted"===e.status;e.isDirty=e=>"dirty"===e.status;e.isValid=e=>"valid"===e.status;e.isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise}(K9)),K9}var J9,e5={};function t5(){return J9||(J9=1,Object.defineProperty(e5,"__esModule",{value:!0})),e5}var n5,i5,r5,a5,o5,s5,l5,u5={},c5={};function d5(){return n5||(n5=1,Object.defineProperty(c5,"__esModule",{value:!0}),c5.errorUtil=void 0,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(e||(c5.errorUtil=e={}))),c5;var e}function h5(){if(i5)return u5;i5=1,Object.defineProperty(u5,"__esModule",{value:!0}),u5.discriminatedUnion=u5.date=u5.boolean=u5.bigint=u5.array=u5.any=u5.coerce=u5.ZodFirstPartyTypeKind=u5.late=u5.ZodSchema=u5.Schema=u5.ZodReadonly=u5.ZodPipeline=u5.ZodBranded=u5.BRAND=u5.ZodNaN=u5.ZodCatch=u5.ZodDefault=u5.ZodNullable=u5.ZodOptional=u5.ZodTransformer=u5.ZodEffects=u5.ZodPromise=u5.ZodNativeEnum=u5.ZodEnum=u5.ZodLiteral=u5.ZodLazy=u5.ZodFunction=u5.ZodSet=u5.ZodMap=u5.ZodRecord=u5.ZodTuple=u5.ZodIntersection=u5.ZodDiscriminatedUnion=u5.ZodUnion=u5.ZodObject=u5.ZodArray=u5.ZodVoid=u5.ZodNever=u5.ZodUnknown=u5.ZodAny=u5.ZodNull=u5.ZodUndefined=u5.ZodSymbol=u5.ZodDate=u5.ZodBoolean=u5.ZodBigInt=u5.ZodNumber=u5.ZodString=u5.ZodType=void 0,u5.NEVER=u5.void=u5.unknown=u5.union=u5.undefined=u5.tuple=u5.transformer=u5.symbol=u5.string=u5.strictObject=u5.set=u5.record=u5.promise=u5.preprocess=u5.pipeline=u5.ostring=u5.optional=u5.onumber=u5.oboolean=u5.object=u5.number=u5.nullable=u5.null=u5.never=u5.nativeEnum=u5.nan=u5.map=u5.literal=u5.lazy=u5.intersection=u5.instanceof=u5.function=u5.enum=u5.effect=void 0,u5.datetimeRegex=T,u5.custom=be;const e=$9(),t=q9(),n=d5(),i=Q9(),r=Y9();class a{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const o=(t,n)=>{if((0,i.isValid)(n))return{success:!0,data:n.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new e.ZodError(t.common.issues);return this._error=n,this._error}}};function s(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:r};return{errorMap:(t,r)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??r.defaultError}:void 0===r.data?{message:a??i??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:a??n??r.defaultError}},description:r}}class l{get description(){return this._def.description}_getType(e){return(0,r.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,r.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new i.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,r.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,i.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,r.getParsedType)(e)},i=this._parseSync({data:e,path:n.path,parent:n});return o(n,i)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,r.getParsedType)(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return(0,i.isValid)(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>(0,i.isValid)(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,r.getParsedType)(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await((0,i.isAsync)(a)?a:Promise.resolve(a));return o(n,s)}refine(t,n){const i=e=>"string"==typeof n||void 0===n?{message:n}:"function"==typeof n?n(e):n;return this._refinement((n,r)=>{const a=t(n),o=()=>r.addIssue({code:e.ZodIssueCode.custom,...i(n)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then(e=>!!e||(o(),!1)):!!a||(o(),!1)})}refinement(e,t){return this._refinement((n,i)=>!!e(n)||(i.addIssue("function"==typeof t?t(n,i):t),!1))}_refinement(e){return new ce({schema:this,typeName:Se.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return de.create(this,this._def)}nullable(){return he.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return ue.create(this,this._def)}or(e){return X.create([this,e],this._def)}and(e){return Q.create(this,e,this._def)}transform(e){return new ce({...s(this._def),schema:this,typeName:Se.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new me({...s(this._def),innerType:this,defaultValue:t,typeName:Se.ZodDefault})}brand(){return new _e({typeName:Se.ZodBranded,type:this,...s(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new pe({...s(this._def),innerType:this,catchValue:t,typeName:Se.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ge.create(this,e)}readonly(){return ye.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}u5.ZodType=l,u5.Schema=l,u5.ZodSchema=l;const u=/^c[^\s-]{8,}$/i,c=/^[0-9a-z]+$/,d=/^[0-9A-HJKMNP-TV-Z]{26}$/i,h=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,m=/^[a-z0-9_-]{21}$/i,p=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,f=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let g;const y=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,v=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,b=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,S=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,w=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,k=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,C="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",E=new RegExp(`^${C}$`);function I(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function x(e){return new RegExp(`^${I(e)}$`)}function T(e){let t=`${C}T${I(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function O(e,t){return!("v4"!==t&&t||!y.test(e))||!("v6"!==t&&t||!b.test(e))}function R(e,t){if(!p.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return"object"==typeof r&&null!==r&&((!("typ"in r)||"JWT"===r?.typ)&&(!!r.alg&&(!t||r.alg===t)))}catch{return!1}}function A(e,t){return!("v4"!==t&&t||!v.test(e))||!("v6"!==t&&t||!S.test(e))}class L extends l{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==r.ZodParsedType.string){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.string,received:n.parsedType}),i.INVALID}const n=new i.ParseStatus;let a;for(const o of this._def.checks)if("min"===o.kind)t.data.length<o.value&&(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if("max"===o.kind)t.data.length>o.value&&(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if("length"===o.kind){const r=t.data.length>o.value,s=t.data.length<o.value;(r||s)&&(a=this._getOrReturnCtx(t,a),r?(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if("email"===o.kind)_.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"email",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("emoji"===o.kind)g||(g=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),g.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"emoji",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("uuid"===o.kind)h.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"uuid",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("nanoid"===o.kind)m.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"nanoid",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("cuid"===o.kind)u.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"cuid",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("cuid2"===o.kind)c.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"cuid2",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("ulid"===o.kind)d.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"ulid",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("url"===o.kind)try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"url",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()}else if("regex"===o.kind){o.regex.lastIndex=0;o.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"regex",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty())}else if("trim"===o.kind)t.data=t.data.trim();else if("includes"===o.kind)t.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty());else if("toLowerCase"===o.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===o.kind)t.data=t.data.toUpperCase();else if("startsWith"===o.kind)t.data.startsWith(o.value)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty());else if("endsWith"===o.kind)t.data.endsWith(o.value)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty());else if("datetime"===o.kind){T(o).test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:"datetime",message:o.message}),n.dirty())}else if("date"===o.kind){E.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:"date",message:o.message}),n.dirty())}else if("time"===o.kind){x(o).test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:"time",message:o.message}),n.dirty())}else"duration"===o.kind?f.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"duration",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):"ip"===o.kind?O(t.data,o.version)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"ip",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):"jwt"===o.kind?R(t.data,o.alg)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"jwt",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):"cidr"===o.kind?A(t.data,o.version)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"cidr",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):"base64"===o.kind?w.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"base64",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):"base64url"===o.kind?k.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"base64url",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):r.util.assertNever(o);return{status:n.value,value:t.data}}_regex(t,i,r){return this.refinement(e=>t.test(e),{validation:i,code:e.ZodIssueCode.invalid_string,...n.errorUtil.errToObj(r)})}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...n.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...n.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...n.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...n.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...n.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...n.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...n.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...n.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...n.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...n.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...n.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...n.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...n.errorUtil.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...n.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...n.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...n.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...n.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...n.errorUtil.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...n.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...n.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...n.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...n.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...n.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,n.errorUtil.errToObj(e))}trim(){return new L({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new L({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new L({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function P(e,t){const n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}u5.ZodString=L,L.create=e=>new L({checks:[],typeName:Se.ZodString,coerce:e?.coerce??!1,...s(e)});class M extends l{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==r.ZodParsedType.number){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.number,received:n.parsedType}),i.INVALID}let n;const a=new i.ParseStatus;for(const o of this._def.checks)if("int"===o.kind)r.util.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty());else if("min"===o.kind){(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty())}else if("max"===o.kind){(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty())}else"multipleOf"===o.kind?0!==P(t.data,o.value)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):"finite"===o.kind?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.not_finite,message:o.message}),a.dirty()):r.util.assertNever(o);return{status:a.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,n.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,n.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,n.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,n.errorUtil.toString(t))}setLimit(e,t,i,r){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:n.errorUtil.toString(r)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:n.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:n.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:n.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:n.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:n.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:n.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:n.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:n.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:n.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&r.util.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}u5.ZodNumber=M,M.create=e=>new M({checks:[],typeName:Se.ZodNumber,coerce:e?.coerce||!1,...s(e)});class D extends l{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==r.ZodParsedType.bigint)return this._getInvalidInput(t);let n;const a=new i.ParseStatus;for(const o of this._def.checks)if("min"===o.kind){(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty())}else if("max"===o.kind){(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty())}else"multipleOf"===o.kind?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):r.util.assertNever(o);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.bigint,received:n.parsedType}),i.INVALID}gte(e,t){return this.setLimit("min",e,!0,n.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,n.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,n.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,n.errorUtil.toString(t))}setLimit(e,t,i,r){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:n.errorUtil.toString(r)}]})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:n.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}u5.ZodBigInt=D,D.create=e=>new D({checks:[],typeName:Se.ZodBigInt,coerce:e?.coerce??!1,...s(e)});class N extends l{_parse(t){this._def.coerce&&(t.data=Boolean(t.data));if(this._getType(t)!==r.ZodParsedType.boolean){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.boolean,received:n.parsedType}),i.INVALID}return(0,i.OK)(t.data)}}u5.ZodBoolean=N,N.create=e=>new N({typeName:Se.ZodBoolean,coerce:e?.coerce||!1,...s(e)});class F extends l{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==r.ZodParsedType.date){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.date,received:n.parsedType}),i.INVALID}if(Number.isNaN(t.data.getTime())){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_date}),i.INVALID}const n=new i.ParseStatus;let a;for(const o of this._def.checks)"min"===o.kind?t.data.getTime()<o.value&&(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):"max"===o.kind?t.data.getTime()>o.value&&(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):r.util.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:n.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:n.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}u5.ZodDate=F,F.create=e=>new F({checks:[],coerce:e?.coerce||!1,typeName:Se.ZodDate,...s(e)});class B extends l{_parse(t){if(this._getType(t)!==r.ZodParsedType.symbol){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.symbol,received:n.parsedType}),i.INVALID}return(0,i.OK)(t.data)}}u5.ZodSymbol=B,B.create=e=>new B({typeName:Se.ZodSymbol,...s(e)});class j extends l{_parse(t){if(this._getType(t)!==r.ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.undefined,received:n.parsedType}),i.INVALID}return(0,i.OK)(t.data)}}u5.ZodUndefined=j,j.create=e=>new j({typeName:Se.ZodUndefined,...s(e)});class V extends l{_parse(t){if(this._getType(t)!==r.ZodParsedType.null){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.null,received:n.parsedType}),i.INVALID}return(0,i.OK)(t.data)}}u5.ZodNull=V,V.create=e=>new V({typeName:Se.ZodNull,...s(e)});class H extends l{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,i.OK)(e.data)}}u5.ZodAny=H,H.create=e=>new H({typeName:Se.ZodAny,...s(e)});class z extends l{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,i.OK)(e.data)}}u5.ZodUnknown=z,z.create=e=>new z({typeName:Se.ZodUnknown,...s(e)});class U extends l{_parse(t){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.never,received:n.parsedType}),i.INVALID}}u5.ZodNever=U,U.create=e=>new U({typeName:Se.ZodNever,...s(e)});class G extends l{_parse(t){if(this._getType(t)!==r.ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.void,received:n.parsedType}),i.INVALID}return(0,i.OK)(t.data)}}u5.ZodVoid=G,G.create=e=>new G({typeName:Se.ZodVoid,...s(e)});class W extends l{_parse(t){const{ctx:n,status:o}=this._processInputParams(t),s=this._def;if(n.parsedType!==r.ZodParsedType.array)return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:n.parsedType}),i.INVALID;if(null!==s.exactLength){const t=n.data.length>s.exactLength.value,r=n.data.length<s.exactLength.value;(t||r)&&((0,i.addIssueToContext)(n,{code:t?e.ZodIssueCode.too_big:e.ZodIssueCode.too_small,minimum:r?s.exactLength.value:void 0,maximum:t?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),o.dirty())}if(null!==s.minLength&&n.data.length<s.minLength.value&&((0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),null!==s.maxLength&&n.data.length>s.maxLength.value&&((0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((e,t)=>s.type._parseAsync(new a(n,e,n.path,t)))).then(e=>i.ParseStatus.mergeArray(o,e));const l=[...n.data].map((e,t)=>s.type._parseSync(new a(n,e,n.path,t)));return i.ParseStatus.mergeArray(o,l)}get element(){return this._def.type}min(e,t){return new W({...this._def,minLength:{value:e,message:n.errorUtil.toString(t)}})}max(e,t){return new W({...this._def,maxLength:{value:e,message:n.errorUtil.toString(t)}})}length(e,t){return new W({...this._def,exactLength:{value:e,message:n.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function Y(e){if(e instanceof $){const t={};for(const n in e.shape){const i=e.shape[n];t[n]=de.create(Y(i))}return new $({...e._def,shape:()=>t})}return e instanceof W?new W({...e._def,type:Y(e.element)}):e instanceof de?de.create(Y(e.unwrap())):e instanceof he?he.create(Y(e.unwrap())):e instanceof J?J.create(e.items.map(e=>Y(e))):e}u5.ZodArray=W,W.create=(e,t)=>new W({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Se.ZodArray,...s(t)});class $ extends l{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=r.util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(t){if(this._getType(t)!==r.ZodParsedType.object){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:n.parsedType}),i.INVALID}const{status:n,ctx:o}=this._processInputParams(t),{shape:s,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof U&&"strip"===this._def.unknownKeys))for(const e in o.data)l.includes(e)||u.push(e);const c=[];for(const e of l){const t=s[e],n=o.data[e];c.push({key:{status:"valid",value:e},value:t._parse(new a(o,n,o.path,e)),alwaysSet:e in o.data})}if(this._def.catchall instanceof U){const t=this._def.unknownKeys;if("passthrough"===t)for(const e of u)c.push({key:{status:"valid",value:e},value:{status:"valid",value:o.data[e]}});else if("strict"===t)u.length>0&&((0,i.addIssueToContext)(o,{code:e.ZodIssueCode.unrecognized_keys,keys:u}),n.dirty());else if("strip"!==t)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of u){const n=o.data[t];c.push({key:{status:"valid",value:t},value:e._parse(new a(o,n,o.path,t)),alwaysSet:t in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of c){const n=await t.key,i=await t.value;e.push({key:n,value:i,alwaysSet:t.alwaysSet})}return e}).then(e=>i.ParseStatus.mergeObjectSync(n,e)):i.ParseStatus.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return n.errorUtil.errToObj,new $({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,i)=>{const r=this._def.errorMap?.(t,i).message??i.defaultError;return"unrecognized_keys"===t.code?{message:n.errorUtil.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new $({...this._def,unknownKeys:"strip"})}passthrough(){return new $({...this._def,unknownKeys:"passthrough"})}extend(e){return new $({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new $({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Se.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new $({...this._def,catchall:e})}pick(e){const t={};for(const n of r.util.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new $({...this._def,shape:()=>t})}omit(e){const t={};for(const n of r.util.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new $({...this._def,shape:()=>t})}deepPartial(){return Y(this)}partial(e){const t={};for(const n of r.util.objectKeys(this.shape)){const i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}return new $({...this._def,shape:()=>t})}required(e){const t={};for(const n of r.util.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof de;)e=e._def.innerType;t[n]=e}return new $({...this._def,shape:()=>t})}keyof(){return oe(r.util.objectKeys(this.shape))}}u5.ZodObject=$,$.create=(e,t)=>new $({shape:()=>e,unknownKeys:"strip",catchall:U.create(),typeName:Se.ZodObject,...s(t)}),$.strictCreate=(e,t)=>new $({shape:()=>e,unknownKeys:"strict",catchall:U.create(),typeName:Se.ZodObject,...s(t)}),$.lazycreate=(e,t)=>new $({shape:e,unknownKeys:"strip",catchall:U.create(),typeName:Se.ZodObject,...s(t)});class X extends l{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;if(n.common.async)return Promise.all(r.map(async e=>{const t={...n,common:{...n.common,issues:[]},parent:null};return{result:await e._parseAsync({data:n.data,path:n.path,parent:t}),ctx:t}})).then(function(t){for(const e of t)if("valid"===e.result.status)return e.result;for(const e of t)if("dirty"===e.result.status)return n.common.issues.push(...e.ctx.common.issues),e.result;const r=t.map(t=>new e.ZodError(t.ctx.common.issues));return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_union,unionErrors:r}),i.INVALID});{let t;const a=[];for(const e of r){const i={...n,common:{...n.common,issues:[]},parent:null},r=e._parseSync({data:n.data,path:n.path,parent:i});if("valid"===r.status)return r;"dirty"!==r.status||t||(t={result:r,ctx:i}),i.common.issues.length&&a.push(i.common.issues)}if(t)return n.common.issues.push(...t.ctx.common.issues),t.result;const o=a.map(t=>new e.ZodError(t));return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_union,unionErrors:o}),i.INVALID}}get options(){return this._def.options}}u5.ZodUnion=X,X.create=(e,t)=>new X({options:e,typeName:Se.ZodUnion,...s(t)});const q=e=>e instanceof re?q(e.schema):e instanceof ce?q(e.innerType()):e instanceof ae?[e.value]:e instanceof se?e.options:e instanceof le?r.util.objectValues(e.enum):e instanceof me?q(e._def.innerType):e instanceof j?[void 0]:e instanceof V?[null]:e instanceof de?[void 0,...q(e.unwrap())]:e instanceof he?[null,...q(e.unwrap())]:e instanceof _e||e instanceof ye?q(e.unwrap()):e instanceof pe?q(e._def.innerType):[];class Z extends l{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.object)return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:n.parsedType}),i.INVALID;const a=this.discriminator,o=n.data[a],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):((0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),i.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const i=new Map;for(const r of t){const t=q(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(i.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,r)}}return new Z({typeName:Se.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...s(n)})}}function K(e,t){const n=(0,r.getParsedType)(e),i=(0,r.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(n===r.ZodParsedType.object&&i===r.ZodParsedType.object){const n=r.util.objectKeys(t),i=r.util.objectKeys(e).filter(e=>-1!==n.indexOf(e)),a={...e,...t};for(const r of i){const n=K(e[r],t[r]);if(!n.valid)return{valid:!1};a[r]=n.data}return{valid:!0,data:a}}if(n===r.ZodParsedType.array&&i===r.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let i=0;i<e.length;i++){const r=K(e[i],t[i]);if(!r.valid)return{valid:!1};n.push(r.data)}return{valid:!0,data:n}}return n===r.ZodParsedType.date&&i===r.ZodParsedType.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}u5.ZodDiscriminatedUnion=Z;class Q extends l{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(t,a)=>{if((0,i.isAborted)(t)||(0,i.isAborted)(a))return i.INVALID;const o=K(t.value,a.value);return o.valid?(((0,i.isDirty)(t)||(0,i.isDirty)(a))&&n.dirty(),{status:n.value,value:o.data}):((0,i.addIssueToContext)(r,{code:e.ZodIssueCode.invalid_intersection_types}),i.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}u5.ZodIntersection=Q,Q.create=(e,t,n)=>new Q({left:e,right:t,typeName:Se.ZodIntersection,...s(n)});class J extends l{_parse(t){const{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==r.ZodParsedType.array)return(0,i.addIssueToContext)(o,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:o.parsedType}),i.INVALID;if(o.data.length<this._def.items.length)return(0,i.addIssueToContext)(o,{code:e.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.INVALID;!this._def.rest&&o.data.length>this._def.items.length&&((0,i.addIssueToContext)(o,{code:e.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...o.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new a(o,e,o.path,t)):null}).filter(e=>!!e);return o.common.async?Promise.all(s).then(e=>i.ParseStatus.mergeArray(n,e)):i.ParseStatus.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new J({...this._def,rest:e})}}u5.ZodTuple=J,J.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new J({items:e,typeName:Se.ZodTuple,rest:null,...s(t)})};class ee extends l{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==r.ZodParsedType.object)return(0,i.addIssueToContext)(o,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:o.parsedType}),i.INVALID;const s=[],l=this._def.keyType,u=this._def.valueType;for(const e in o.data)s.push({key:l._parse(new a(o,e,o.path,e)),value:u._parse(new a(o,o.data[e],o.path,e)),alwaysSet:e in o.data});return o.common.async?i.ParseStatus.mergeObjectAsync(n,s):i.ParseStatus.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,t,n){return new ee(t instanceof l?{keyType:e,valueType:t,typeName:Se.ZodRecord,...s(n)}:{keyType:L.create(),valueType:e,typeName:Se.ZodRecord,...s(t)})}}u5.ZodRecord=ee;class te extends l{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==r.ZodParsedType.map)return(0,i.addIssueToContext)(o,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.map,received:o.parsedType}),i.INVALID;const s=this._def.keyType,l=this._def.valueType,u=[...o.data.entries()].map(([e,t],n)=>({key:s._parse(new a(o,e,o.path,[n,"key"])),value:l._parse(new a(o,t,o.path,[n,"value"]))}));if(o.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const t of u){const r=await t.key,a=await t.value;if("aborted"===r.status||"aborted"===a.status)return i.INVALID;"dirty"!==r.status&&"dirty"!==a.status||n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}})}{const e=new Map;for(const t of u){const r=t.key,a=t.value;if("aborted"===r.status||"aborted"===a.status)return i.INVALID;"dirty"!==r.status&&"dirty"!==a.status||n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}}}}u5.ZodMap=te,te.create=(e,t,n)=>new te({valueType:t,keyType:e,typeName:Se.ZodMap,...s(n)});class ne extends l{_parse(t){const{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==r.ZodParsedType.set)return(0,i.addIssueToContext)(o,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.set,received:o.parsedType}),i.INVALID;const s=this._def;null!==s.minSize&&o.data.size<s.minSize.value&&((0,i.addIssueToContext)(o,{code:e.ZodIssueCode.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),null!==s.maxSize&&o.data.size>s.maxSize.value&&((0,i.addIssueToContext)(o,{code:e.ZodIssueCode.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function u(e){const t=new Set;for(const r of e){if("aborted"===r.status)return i.INVALID;"dirty"===r.status&&n.dirty(),t.add(r.value)}return{status:n.value,value:t}}const c=[...o.data.values()].map((e,t)=>l._parse(new a(o,e,o.path,t)));return o.common.async?Promise.all(c).then(e=>u(e)):u(c)}min(e,t){return new ne({...this._def,minSize:{value:e,message:n.errorUtil.toString(t)}})}max(e,t){return new ne({...this._def,maxSize:{value:e,message:n.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}u5.ZodSet=ne,ne.create=(e,t)=>new ne({valueType:e,minSize:null,maxSize:null,typeName:Se.ZodSet,...s(t)});class ie extends l{constructor(){super(...arguments),this.validate=this.implement}_parse(n){const{ctx:a}=this._processInputParams(n);if(a.parsedType!==r.ZodParsedType.function)return(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.function,received:a.parsedType}),i.INVALID;function o(n,r){return(0,i.makeIssue)({data:n,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(e=>!!e),issueData:{code:e.ZodIssueCode.invalid_arguments,argumentsError:r}})}function s(n,r){return(0,i.makeIssue)({data:n,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(e=>!!e),issueData:{code:e.ZodIssueCode.invalid_return_type,returnTypeError:r}})}const l={errorMap:a.common.contextualErrorMap},u=a.data;if(this._def.returns instanceof ue){const t=this;return(0,i.OK)(async function(...n){const i=new e.ZodError([]),r=await t._def.args.parseAsync(n,l).catch(e=>{throw i.addIssue(o(n,e)),i}),a=await Reflect.apply(u,this,r),c=await t._def.returns._def.type.parseAsync(a,l).catch(e=>{throw i.addIssue(s(a,e)),i});return c})}{const t=this;return(0,i.OK)(function(...n){const i=t._def.args.safeParse(n,l);if(!i.success)throw new e.ZodError([o(n,i.error)]);const r=Reflect.apply(u,this,i.data),a=t._def.returns.safeParse(r,l);if(!a.success)throw new e.ZodError([s(r,a.error)]);return a.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ie({...this._def,args:J.create(e).rest(z.create())})}returns(e){return new ie({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ie({args:e||J.create([]).rest(z.create()),returns:t||z.create(),typeName:Se.ZodFunction,...s(n)})}}u5.ZodFunction=ie;class re extends l{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}u5.ZodLazy=re,re.create=(e,t)=>new re({getter:e,typeName:Se.ZodLazy,...s(t)});class ae extends l{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{received:n.data,code:e.ZodIssueCode.invalid_literal,expected:this._def.value}),i.INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}}function oe(e,t){return new se({values:e,typeName:Se.ZodEnum,...s(t)})}u5.ZodLiteral=ae,ae.create=(e,t)=>new ae({value:e,typeName:Se.ZodLiteral,...s(t)});class se extends l{_parse(t){if("string"!=typeof t.data){const n=this._getOrReturnCtx(t),a=this._def.values;return(0,i.addIssueToContext)(n,{expected:r.util.joinValues(a),received:n.parsedType,code:e.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return(0,i.addIssueToContext)(n,{received:n.data,code:e.ZodIssueCode.invalid_enum_value,options:r}),i.INVALID}return(0,i.OK)(t.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return se.create(e,{...this._def,...t})}exclude(e,t=this._def){return se.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}u5.ZodEnum=se,se.create=oe;class le extends l{_parse(t){const n=r.util.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==r.ZodParsedType.string&&a.parsedType!==r.ZodParsedType.number){const t=r.util.objectValues(n);return(0,i.addIssueToContext)(a,{expected:r.util.joinValues(t),received:a.parsedType,code:e.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||(this._cache=new Set(r.util.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=r.util.objectValues(n);return(0,i.addIssueToContext)(a,{received:a.data,code:e.ZodIssueCode.invalid_enum_value,options:t}),i.INVALID}return(0,i.OK)(t.data)}get enum(){return this._def.values}}u5.ZodNativeEnum=le,le.create=(e,t)=>new le({values:e,typeName:Se.ZodNativeEnum,...s(t)});class ue extends l{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.promise&&!1===n.common.async)return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.promise,received:n.parsedType}),i.INVALID;const a=n.parsedType===r.ZodParsedType.promise?n.data:Promise.resolve(n.data);return(0,i.OK)(a.then(e=>this._def.type.parseAsync(e,{path:n.path,errorMap:n.common.contextualErrorMap})))}}u5.ZodPromise=ue,ue.create=(e,t)=>new ue({type:e,typeName:Se.ZodPromise,...s(t)});class ce extends l{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,o={addIssue:e=>{(0,i.addIssueToContext)(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===a.type){const e=a.transform(n.data,o);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return i.INVALID;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?i.INVALID:"dirty"===r.status||"dirty"===t.value?(0,i.DIRTY)(r.value):r});{if("aborted"===t.value)return i.INVALID;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?i.INVALID:"dirty"===r.status||"dirty"===t.value?(0,i.DIRTY)(r.value):r}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,o);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?i.INVALID:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?i.INVALID:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if("transform"===a.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,i.isValid)(e))return i.INVALID;const r=a.transform(e.value,o);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>(0,i.isValid)(e)?Promise.resolve(a.transform(e.value,o)).then(e=>({status:t.value,value:e})):i.INVALID)}r.util.assertNever(a)}}u5.ZodEffects=ce,u5.ZodTransformer=ce,ce.create=(e,t,n)=>new ce({schema:e,typeName:Se.ZodEffects,effect:t,...s(n)}),ce.createWithPreprocess=(e,t,n)=>new ce({schema:t,effect:{type:"preprocess",transform:e},typeName:Se.ZodEffects,...s(n)});class de extends l{_parse(e){return this._getType(e)===r.ZodParsedType.undefined?(0,i.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}u5.ZodOptional=de,de.create=(e,t)=>new de({innerType:e,typeName:Se.ZodOptional,...s(t)});class he extends l{_parse(e){return this._getType(e)===r.ZodParsedType.null?(0,i.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}u5.ZodNullable=he,he.create=(e,t)=>new he({innerType:e,typeName:Se.ZodNullable,...s(t)});class me extends l{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===r.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}u5.ZodDefault=me,me.create=(e,t)=>new me({innerType:e,typeName:Se.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...s(t)});class pe extends l{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,i.isAsync)(a)?a.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new e.ZodError(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new e.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}u5.ZodCatch=pe,pe.create=(e,t)=>new pe({innerType:e,typeName:Se.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...s(t)});class fe extends l{_parse(t){if(this._getType(t)!==r.ZodParsedType.nan){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.nan,received:n.parsedType}),i.INVALID}return{status:"valid",value:t.data}}}u5.ZodNaN=fe,fe.create=e=>new fe({typeName:Se.ZodNaN,...s(e)}),u5.BRAND=Symbol("zod_brand");class _e extends l{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}u5.ZodBranded=_e;class ge extends l{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?i.INVALID:"dirty"===e.status?(t.dirty(),(0,i.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?i.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new ge({in:e,out:t,typeName:Se.ZodPipeline})}}u5.ZodPipeline=ge;class ye extends l{_parse(e){const t=this._def.innerType._parse(e),n=e=>((0,i.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,i.isAsync)(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}function ve(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function be(e,t={},n){return e?H.create().superRefine((i,r)=>{const a=e(i);if(a instanceof Promise)return a.then(e=>{if(!e){const e=ve(t,i),a=e.fatal??n??!0;r.addIssue({code:"custom",...e,fatal:a})}});if(!a){const e=ve(t,i),a=e.fatal??n??!0;r.addIssue({code:"custom",...e,fatal:a})}}):H.create()}var Se,we;u5.ZodReadonly=ye,ye.create=(e,t)=>new ye({innerType:e,typeName:Se.ZodReadonly,...s(t)}),u5.late={object:$.lazycreate},(we=Se||(u5.ZodFirstPartyTypeKind=Se={})).ZodString="ZodString",we.ZodNumber="ZodNumber",we.ZodNaN="ZodNaN",we.ZodBigInt="ZodBigInt",we.ZodBoolean="ZodBoolean",we.ZodDate="ZodDate",we.ZodSymbol="ZodSymbol",we.ZodUndefined="ZodUndefined",we.ZodNull="ZodNull",we.ZodAny="ZodAny",we.ZodUnknown="ZodUnknown",we.ZodNever="ZodNever",we.ZodVoid="ZodVoid",we.ZodArray="ZodArray",we.ZodObject="ZodObject",we.ZodUnion="ZodUnion",we.ZodDiscriminatedUnion="ZodDiscriminatedUnion",we.ZodIntersection="ZodIntersection",we.ZodTuple="ZodTuple",we.ZodRecord="ZodRecord",we.ZodMap="ZodMap",we.ZodSet="ZodSet",we.ZodFunction="ZodFunction",we.ZodLazy="ZodLazy",we.ZodLiteral="ZodLiteral",we.ZodEnum="ZodEnum",we.ZodEffects="ZodEffects",we.ZodNativeEnum="ZodNativeEnum",we.ZodOptional="ZodOptional",we.ZodNullable="ZodNullable",we.ZodDefault="ZodDefault",we.ZodCatch="ZodCatch",we.ZodPromise="ZodPromise",we.ZodBranded="ZodBranded",we.ZodPipeline="ZodPipeline",we.ZodReadonly="ZodReadonly";u5.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>be(t=>t instanceof e,t);const ke=L.create;u5.string=ke;const Ce=M.create;u5.number=Ce;const Ee=fe.create;u5.nan=Ee;const Ie=D.create;u5.bigint=Ie;const xe=N.create;u5.boolean=xe;const Te=F.create;u5.date=Te;const Oe=B.create;u5.symbol=Oe;const Re=j.create;u5.undefined=Re;const Ae=V.create;u5.null=Ae;const Le=H.create;u5.any=Le;const Pe=z.create;u5.unknown=Pe;const Me=U.create;u5.never=Me;const De=G.create;u5.void=De;const Ne=W.create;u5.array=Ne;const Fe=$.create;u5.object=Fe;const Be=$.strictCreate;u5.strictObject=Be;const je=X.create;u5.union=je;const Ve=Z.create;u5.discriminatedUnion=Ve;const He=Q.create;u5.intersection=He;const ze=J.create;u5.tuple=ze;const Ue=ee.create;u5.record=Ue;const Ge=te.create;u5.map=Ge;const We=ne.create;u5.set=We;const Ye=ie.create;u5.function=Ye;const $e=re.create;u5.lazy=$e;const Xe=ae.create;u5.literal=Xe;const qe=se.create;u5.enum=qe;const Ze=le.create;u5.nativeEnum=Ze;const Ke=ue.create;u5.promise=Ke;const Qe=ce.create;u5.effect=Qe,u5.transformer=Qe;const Je=de.create;u5.optional=Je;const et=he.create;u5.nullable=et;const tt=ce.createWithPreprocess;u5.preprocess=tt;const nt=ge.create;u5.pipeline=nt;u5.ostring=()=>ke().optional();u5.onumber=()=>Ce().optional();return u5.oboolean=()=>xe().optional(),u5.coerce={string:e=>L.create({...e,coerce:!0}),number:e=>M.create({...e,coerce:!0}),boolean:e=>N.create({...e,coerce:!0}),bigint:e=>D.create({...e,coerce:!0}),date:e=>F.create({...e,coerce:!0})},u5.NEVER=i.INVALID,u5}function m5(){return r5||(r5=1,e=H9,t=H9&&H9.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=H9&&H9.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)},Object.defineProperty(e,"__esModule",{value:!0}),n(q9(),e),n(Q9(),e),n(t5(),e),n(Y9(),e),n(h5(),e),n($9(),e)),H9;var e,t,n}function p5(){return a5||(a5=1,function(e){var t=V9&&V9.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=V9&&V9.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=V9&&V9.__importStar||function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&t(i,e,r);return n(i,e),i},r=V9&&V9.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;const a=i(m5());e.z=a,r(m5(),e),e.default=a}(V9)),V9}function f5(){if(o5)return j9;o5=1,Object.defineProperty(j9,"__esModule",{value:!0}),j9.recommendationPropsSchema=j9.calculatorParamsSchema=j9.activitySchema=j9.activityReductionSchema=void 0;var e=p5(),t=DL(),n=o4();const i=(t,n)=>e.z.number().refine(e=>e>=t.min&&e<=t.max,{message:n}),r=j9.activityReductionSchema=e.z.object({fromZero:i(n.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromThirty:i(n.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromFortysix:i(n.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromSixtyone:i(n.ACTIVITY_SETTINGS_INTERVAL_LIMITS).nullable()}),a=j9.activitySchema=e.z.object({activityDuration:i(n.ACTIVITY_DURATION_MINUTES_LIMITS),activityIntensity:e.z.nativeEnum(t.ActivityIntensity).nullable(),activitySettings:e.z.object({light:r,moderate:r,hard:e.z.object({...r.shape,fromFortysix:i(n.ACTIVITY_SETTINGS_INTERVAL_LIMITS).nullable()}),post:r,target:i(n.ACTIVITY_TARGET_BGL_MMOL_LIMITS)}),activityDate:e.z.date()}).nullable(),o=j9.calculatorParamsSchema=e.z.object({glucoseReading:e.z.object({value:e.z.number(),unit:e.z.nativeEnum(t.BloodGlucoseUnit),source:e.z.enum(["manual","forecast","device","external"]),timestamp:e.z.number(),id:e.z.string().uuid()}),targetBGL:i(n.TARGET_BGL_MMOL_LIMITS),insulinSensitivity:i(n.INSULIN_SENSITIVITY_MMOL_LIMITS),carbohydrates:i(n.CARBOHYDRATES_LIMITS),carbohydrateRatio:i(n.INSULIN_TO_CARBS_RATIO_LIMITS),recentBoluses:e.z.array(e.z.object({secondsPassed:i(n.BOLUS_SECONDS_PASSED_LIMITS),insulinDose:i(n.INSULIN_DOSE_LIMITS),id:e.z.string().uuid()})),activity:a});return j9.recommendationPropsSchema=e.z.object({bloodGlucoseUnit:e.z.nativeEnum(t.BloodGlucoseUnit),injectionMethod:e.z.nativeEnum(t.InjectionMethod),language:e.z.string().refine(e=>Object.keys(t.Languages).includes(e)),calculatorParams:o}),j9}function _5(){if(s5)return B3;s5=1,Object.defineProperty(B3,"__esModule",{value:!0}),B3.default=B3.SyncStatus=B3.RecommendationScreen=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=j3,i=Oq(),r=DL(),a=I(g4()),o=I(q4()),s=I(function(){if(Z4)return K4;Z4=1,Object.defineProperty(K4,"__esModule",{value:!0}),K4.default=void 0,function(e){e&&e.__esModule}(w());var e=QB,t=t4(),n=l();const i=e.StyleSheet.create({container:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"},line:{width:8,height:1,borderRadius:4,backgroundColor:t.COLORS.divider}});return K4.default=function(){const t=Array.from({length:25},(e,t)=>`dot-${t}`);return(0,n.jsx)(e.View,{style:i.container,children:t.map(t=>(0,n.jsx)(e.View,{testID:t,style:i.line},t))})},K4}()),u=I(l9()),c=I(function(){if(u9)return c9;u9=1,Object.defineProperty(c9,"__esModule",{value:!0}),c9.default=void 0,a(w());var e=QB,t=u4(),n=t4(),i=a(_4()),r=l();function a(e){return e&&e.__esModule?e:{default:e}}const o=e.StyleSheet.create({container:{justifyContent:"flex-end",gap:16,backgroundColor:n.COLORS.bgNavigationBar,padding:16},saveButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:n.COLORS.bgButtonPrimary,borderRadius:16,borderColor:n.COLORS.divider,borderWidth:1},deleteButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:n.COLORS.bgButtonSecondaryDanger,borderRadius:16},saveText:{...n.FONTS.Poppins.semiBold_Base,textAlign:"center"},deleteText:{...n.FONTS.Poppins.semiBold_Base,color:n.COLORS.textButtonSecondaryDanger,textAlign:"center"}});return c9.default=function({prefixTestID:n,onSave:a,onDelete:s,onLayout:l}){const{t:u}=(0,t.useLanguage)();return(0,r.jsxs)(e.View,{style:o.container,onLayout:l,testID:n+"-footer",children:[(0,r.jsx)(e.TouchableOpacity,{style:o.saveButton,onPress:a,testID:n+"-footer-save-button",children:(0,r.jsx)(i.default,{style:o.saveText,children:u("button_save")})}),(0,r.jsx)(e.TouchableOpacity,{style:o.deleteButton,onPress:s,testID:n+"-footer-delete-button",children:(0,r.jsx)(i.default,{style:o.deleteText,children:u("button_delete")})})]})},c9}()),d=I(function(){if(d9)return h9;d9=1,Object.defineProperty(h9,"__esModule",{value:!0}),h9.default=void 0,a(w());var e=QB,t=a(ej()),n=t4(),i=u4(),r=l();function a(e){return e&&e.__esModule?e:{default:e}}const o=e.StyleSheet.create({gradientContainer:{borderTopLeftRadius:12,borderTopRightRadius:12,paddingVertical:20},text:{...n.FONTS.Poppins.medium_Base,color:n.COLORS.textCarbRecommendation,textAlign:"center"},textCrossed:{textDecorationLine:"line-through",opacity:.5,marginBottom:4}});return h9.default=function({isEdited:a}){const{t:s}=(0,i.useLanguage)(),{width:l}=(0,e.useWindowDimensions)();return a?(0,r.jsxs)(t.default,{colors:[n.COLORS.bgGradientBottom,n.COLORS.bgGradientTop],style:[o.gradientContainer],testID:"edited-recommendation-header",children:[(0,r.jsx)(e.Text,{style:[o.text,o.textCrossed],children:s("recommendation_card_title").toUpperCase()}),(0,r.jsx)(e.Text,{style:o.text,children:s("recommendation_change_title").toUpperCase()})]}):(0,r.jsx)(t.default,{colors:[n.COLORS.bgGradientBottom,n.COLORS.bgGradientTop],style:[o.gradientContainer,{width:l-32}],testID:"initial-recommendation-header",children:(0,r.jsx)(e.Text,{style:o.text,children:s("recommendation_card_title").toUpperCase()})})},h9}()),h=I(function(){if(m9)return p9;m9=1,Object.defineProperty(p9,"__esModule",{value:!0}),p9.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=Oq(),i=DL(),r=m(k4()),a=o4(),o=u4(),s=t4(),u=h4(),c=m(_4()),d=m(X4()),h=l();function m(e){return e&&e.__esModule?e:{default:e}}const p=t.StyleSheet.create({container:{paddingVertical:48,justifyContent:"center",alignItems:"center",backgroundColor:s.COLORS.bgSecondary},title:{...s.FONTS.Poppins.medium_Base,color:s.COLORS.labelSecondary},row:{flexDirection:"row",marginVertical:8,alignItems:"center"},value:{...s.FONTS.Poppins.bold_6XL,color:s.COLORS.labelPrimary},crossedValue:{...s.FONTS.Poppins.bold_2XL,color:s.COLORS.labelSecondary,textDecorationLine:"line-through",opacity:.4},crossedUnit:{...s.FONTS.Poppins.bold_2XL,color:s.COLORS.labelSecondary},unit:{...s.FONTS.Poppins.bold_2XL,color:s.COLORS.labelSecondary,lineHeight:78},editIcon:{marginLeft:4}});return p9.default=function({initialValue:s,editedValue:l,wasLimited:m,injectionMethod:f,onDismiss:_,onConfirm:g}){const{t:y}=(0,o.useLanguage)(),[v,b]=(0,e.useState)(!1),S=(0,e.useCallback)(()=>{b(!0)},[]),w=(0,e.useCallback)(()=>{b(!1)},[]),k=(0,e.useCallback)(e=>{b(!1),g(e)},[g]),C=(0,e.useMemo)(()=>{const{min:e,max:t}=a.INSULIN_DOSE_LIMITS,n=m?s:t;return f===i.InjectionMethod.Pump?(0,u.createSequentialArrayDecimal)(e,n):f===i.InjectionMethod.PenWhole?(0,u.createSequentialArrayInteger)(e,n):(0,u.createSequentialArrayHalf)(e,n)},[f,s,m]),E=(0,e.useMemo)(()=>f===i.InjectionMethod.PenWhole?0:1,[f]),I=(0,e.useCallback)(()=>{if(null!==l)return C.findIndex(e=>e===l.toFixed(E));const e=(0,n.roundInsulinValue)(s,f);return C.findIndex(t=>t===e.toFixed(E))},[l,s,C,f,E]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(t.View,{style:p.container,children:[null!==l&&(0,h.jsxs)(c.default,{style:p.crossedValue,testID:"insulin-initial-value",children:[`${s} `,(0,h.jsx)(c.default,{style:p.crossedUnit,testID:"insulin-initial-unit",children:y(1===s?"unit":"units")})]}),(0,h.jsxs)(t.TouchableOpacity,{style:p.row,testID:"insulin-current-value-container",onPress:S,children:[(0,h.jsxs)(c.default,{style:p.value,testID:"insulin-value",children:[`${l??s} `,(0,h.jsx)(c.default,{style:p.unit,testID:"insulin-unit",children:y(1===(l??s)?"unit":"units")})]}),(0,h.jsx)(t.TouchableOpacity,{onPress:S,testID:"insulin-edit-button",hitSlop:10,children:(0,h.jsx)(r.default,{style:p.editIcon})})]}),(0,h.jsx)(c.default,{style:p.title,testID:"insulin-display-title",children:y("recommendation_rapid_title")})]}),(0,h.jsx)(d.default,{type:"insulin",items:C,isVisible:v,initialScrollIndex:I(),onConfirm:k,onCancel:w,onDismiss:_})]})},p9}()),m=I(function(){if(_9)return g9;_9=1,Object.defineProperty(g9,"__esModule",{value:!0}),g9.default=void 0,o(w());var e=QB,t=u4(),n=o(_4()),i=o(D4()),r=v9(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}return g9.default=o=>{const{isVisible:s,onPressClose:l}=o,{t:u}=(0,t.useLanguage)();return(0,a.jsx)(i.default,{isVisible:s,children:(0,a.jsxs)(e.View,{testID:"delete-failure-modal-visible-"+s,children:[(0,a.jsx)(n.default,{style:r.styles.title,testID:"delete-modal-failure-title",children:u("new_activity_modal_no_delete_title")}),(0,a.jsx)(n.default,{style:r.styles.message,testID:"delete-modal-failure-message",children:u("new_activity_modal_no_delete_body")}),(0,a.jsx)(e.TouchableOpacity,{style:r.styles.deleteFailureCloseButton,onPress:l,testID:"delete-modal-failure-close-button",children:(0,a.jsx)(n.default,{style:r.styles.buttonText,children:u("button_close")})})]})})},g9}()),p=I(function(){if(b9)return S9;b9=1,Object.defineProperty(S9,"__esModule",{value:!0}),S9.default=void 0,o(w());var e=QB,t=u4(),n=o(_4()),i=o(D4()),r=v9(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}return S9.default=o=>{const{isVisible:s,onPressDelete:l,onPressCancel:u,onDismiss:c}=o,{t:d}=(0,t.useLanguage)();return(0,a.jsx)(i.default,{onModalHide:c,isVisible:s,children:(0,a.jsxs)(e.View,{testID:"delete-modal-visible-"+s,children:[(0,a.jsx)(n.default,{style:r.styles.title,testID:"delete-modal-title",children:d("recommendation_modal_delete_rec_title")}),(0,a.jsx)(n.default,{style:r.styles.message,testID:"delete-modal-message",children:d("recommendation_modal_delete_rec_body")}),(0,a.jsxs)(e.View,{style:r.styles.buttonContainer,children:[(0,a.jsx)(e.TouchableOpacity,{style:r.styles.deleteRedButton,onPress:l,testID:"delete-modal-delete-button",children:(0,a.jsx)(n.default,{style:r.styles.buttonText,children:d("recommendation_modal_delete_rec_button_danger_delete")})}),(0,a.jsx)(e.TouchableOpacity,{style:r.styles.cancelButton,onPress:u,testID:"delete-modal-cancel-button",children:(0,a.jsx)(n.default,{style:r.styles.buttonText,children:d("button_cancel")})})]})]})})},S9}()),f=I(function(){if(w9)return k9;w9=1,Object.defineProperty(k9,"__esModule",{value:!0}),k9.default=void 0,o(w());var e=QB,t=u4(),n=o(_4()),i=o(D4()),r=v9(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}return k9.default=o=>{const{isVisible:s,onPressClose:l}=o,{t:u}=(0,t.useLanguage)();return(0,a.jsx)(i.default,{isVisible:s,children:(0,a.jsxs)(e.View,{testID:"edit-failure-modal-visible-"+s,children:[(0,a.jsx)(n.default,{style:r.styles.title,testID:"edit-modal-failure-title",children:u("glucose_modal_changes_title")}),(0,a.jsx)(n.default,{style:r.styles.message,testID:"edit-modal-failure-message",children:u("glucose_modal_changes_body")}),(0,a.jsx)(e.TouchableOpacity,{style:r.styles.deleteFailureCloseButton,onPress:l,testID:"edit-modal-failure-close-button",children:(0,a.jsx)(n.default,{style:r.styles.buttonText,children:u("glucose_modal_changes_button_confirm")})})]})})},k9}()),_=I(function(){if(C9)return E9;C9=1,Object.defineProperty(E9,"__esModule",{value:!0}),E9.default=void 0,E9.getLimitedValue=c;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=DL(),i=u4(),r=u(_4()),a=u(D4()),o=v9(),s=l();function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return n.CONSTANTS.INSULIN_DOSE_MAX-n.CONSTANTS.INSULIN_DOSE_MAX*e}return E9.default=l=>{const{isVisible:u,activityReduction:d,onPress:h}=l,{t:m}=(0,i.useLanguage)(),p=(0,e.useMemo)(()=>null===d?m("recommendation_modal_safety_limitation_body",{SAFETY_INSULIN_LIMIT:`${n.CONSTANTS.INSULIN_DOSE_MAX}`}):m("recommendation_modal_safety_limitation2_body",{0:`${c(d)}`,SAFETY_INSULIN_LIMIT:`${n.CONSTANTS.INSULIN_DOSE_MAX}`,1:`${(100*d).toFixed(0)}`,2:`${c(d)}`}),[d,m]);return(0,s.jsx)(a.default,{isVisible:u,children:(0,s.jsxs)(t.View,{testID:"limitation-modal-visible-"+u,children:[(0,s.jsx)(r.default,{style:o.styles.title,children:m("recommendation_modal_safety_limitation_title")}),(0,s.jsx)(r.default,{style:o.styles.message,testID:"limitation-modal-message",children:p}),(0,s.jsx)(t.TouchableOpacity,{style:o.styles.button,onPress:h,testID:"limitation-modal-button",children:(0,s.jsx)(r.default,{style:o.styles.buttonText,children:m("button_understood")})})]})})},E9}()),g=I(function(){if(I9)return x9;I9=1,Object.defineProperty(x9,"__esModule",{value:!0}),x9.default=void 0,o(w());var e=QB,t=u4(),n=o(_4()),i=o(D4()),r=v9(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}return x9.default=o=>{const{isVisible:s,onPressClose:l}=o,{t:u}=(0,t.useLanguage)();return(0,a.jsx)(i.default,{isVisible:s,children:(0,a.jsxs)(e.View,{testID:"save-failure-modal-visible-"+s,children:[(0,a.jsx)(n.default,{style:r.styles.title,testID:"save-modal-failure-title",children:u("no_save_modal_title")}),(0,a.jsx)(n.default,{style:r.styles.message,testID:"save-modal-failure-message",children:u("no_save_modal_body")}),(0,a.jsx)(e.TouchableOpacity,{style:r.styles.deleteFailureCloseButton,onPress:l,testID:"save-modal-failure-close-button",children:(0,a.jsx)(n.default,{style:r.styles.buttonText,children:u("button_close")})})]})})},x9}()),y=I(function(){if(T9)return O9;T9=1,Object.defineProperty(O9,"__esModule",{value:!0}),O9.default=void 0,o(w());var e=QB,t=u4(),n=o(_4()),i=o(D4()),r=v9(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}return O9.default=o=>{const{isVisible:s,onPressViewInLogbook:l,onPressCancel:u,onDismiss:c}=o,{t:d}=(0,t.useLanguage)(),h="web"===e.Platform.OS;return(0,a.jsx)(i.default,{checkmark:!0,onModalHide:c,isVisible:s,children:(0,a.jsxs)(e.View,{testID:"timeout-modal-visible-"+s,children:[(0,a.jsx)(n.default,{style:r.styles.title,testID:"timeout-modal-title",children:d("recommendation_modal_auto_saved_title")}),(0,a.jsx)(n.default,{style:r.styles.message,testID:"timeout-modal-message",children:d("recommendation_modal_auto_saved_body")}),(0,a.jsxs)(e.View,{style:r.styles.buttonContainer,children:[!h&&(0,a.jsx)(e.TouchableOpacity,{style:r.styles.saveButton,onPress:l,testID:"timeout-modal-view-button",children:(0,a.jsx)(n.default,{style:r.styles.saveText,children:d("recommendation_modal_auto_saved_button_confirm")})}),(0,a.jsx)(e.TouchableOpacity,{style:r.styles.cancelButton,onPress:u,testID:"timeout-modal-close-button",children:(0,a.jsx)(n.default,{style:r.styles.closeText,children:d("button_close")})})]})]})})},O9}()),v=I(M9()),b=o4(),S=u4(),k=t4(),C=f5(),E=l();function I(e){return e&&e.__esModule?e:{default:e}}let x=B3.SyncStatus=function(e){return e.Idle="Idle",e.Success="Success",e.Loading="Loading",e.Failure="Failure",e}({});const T=l=>{const w=(0,n.useSafeAreaInsets)(),{changeLanguage:k}=(0,S.useLanguage)();"android"===t.Platform.OS&&t.UIManager.setLayoutAnimationEnabledExperimental?.(!0);const{height:I}=(0,t.useWindowDimensions)(),T=(0,e.useMemo)(()=>I-w.bottom-w.top,[I,w.bottom,w.top]),R=(0,e.useRef)(null),{deleteStatus:A,editStatus:L,saveStatus:P,calculatorParams:M,bloodGlucoseUnit:D,injectionMethod:N,transferEditedRecommendation:F,closeCalculationFooter:B,closeCalculationTimeoutModal:j,deleteCalculation:V,closeCalculationViewInlogbook:H,trackRecommendationTimeout:z,trackExpandDetails:U}=l,{glucoseReading:G,carbohydrates:W,activity:Y}=M,$=(0,e.useRef)((0,i.calculateRecommendation)(M)).current,[X,q]=(0,e.useState)(null),[Z,K]=(0,e.useState)(null),[Q,J]=(0,e.useState)(null),[ee,te]=(0,e.useState)(null),[ne,ie]=(0,e.useState)(0),[re,ae]=(0,e.useState)(0),[oe,se]=(0,e.useState)(0),[le,ue]=(0,e.useState)(!0),[ce,de]=(0,e.useState)(!1),[he,me]=(0,e.useState)(!1),[pe,fe]=(0,e.useState)(!0),[_e,ge]=(0,e.useState)(!1),[ye,ve]=(0,e.useState)(!1),[be,Se]=(0,e.useState)(!1),[we,ke]=(0,e.useState)(!1),[Ce,Ee]=(0,e.useState)(!1),[Ie,xe]=(0,e.useState)(!1),[Te,Oe]=(0,e.useState)(!1),[Re,Ae]=(0,e.useState)(!1),[Le,Pe]=(0,e.useState)(!1);(0,e.useEffect)(()=>{A===x.Failure&&Ae(!0)},[A]),(0,e.useEffect)(()=>{P===x.Failure&&Oe(!0)},[P]),(0,e.useEffect)(()=>{L===x.Success&&(q(Z),J(ee))},[A,L,ee,Z,P]),(0,e.useEffect)(()=>{C.recommendationPropsSchema.parse(l),k(l.language)},[k,l]),(0,e.useEffect)(()=>{$.wasLimited&&xe(!0)},[$.wasLimited]),(0,e.useEffect)(()=>{const e=$.recommendationDate.getTime(),t=setInterval(()=>{!((new Date).getTime()-e>b.TIMEOUT_MODAL_TRIGGER)||Ce||be||(Se(!0),Ee(!0),z())},1*r.Milliseconds.Second);return()=>clearInterval(t)},[be,Ce,$,z]);const Me=(0,e.useCallback)(e=>{const t=$.recommendationDate.getTime(),n=(new Date).getTime()-t>b.TIMEOUT_MODAL_TRIGGER;"active"===e&&n&&(Ee(!0),z())},[$,z]),De=(0,e.useCallback)(()=>(ke(!0),!0),[]);(0,e.useEffect)(()=>{const e=t.AppState.addEventListener("change",Me);let n=null;return"android"===t.Platform.OS&&(n=t.BackHandler.addEventListener("hardwareBackPress",De)),()=>{e.remove(),n?.remove()}},[Me,De]);const Ne=(0,e.useMemo)(()=>{if(Y)return{activityDuration:Y.activityDuration,activityIntensity:Y.activityIntensity,activityReduction:$.activityReduction}},[Y,$.activityReduction]),Fe=(0,e.useCallback)(e=>{t.LayoutAnimation.configureNext(t.LayoutAnimation.Presets.easeInEaseOut);const n=(0,i.roundInsulinValue)($.bolus,N),r=Math.round($.carbRecommendation),a=e!==n?e:null;e!==n?K(e):(q(null),K(null)),F({modified:Q,suggested:r},{modified:a,suggested:n},$.recommendationDate)},[$,N,Q,F]),Be=(0,e.useCallback)(e=>{t.LayoutAnimation.configureNext(t.LayoutAnimation.Presets.easeInEaseOut);const n=(0,i.roundInsulinValue)($.bolus,N),r=Math.round($.carbRecommendation),a=e!==r?e:null;e!==r?te(e):(J(null),te(null)),F({modified:a,suggested:r},{modified:X,suggested:n},$.recommendationDate)},[$,N,X,F]),je=(0,e.useCallback)(()=>{_e&&V()},[V,_e]),Ve=(0,e.useCallback)(()=>{ye?H():j()},[ye,j,H]),He=(0,e.useCallback)(()=>{ve(!0),Ee(!1)},[]),ze=(0,e.useCallback)(()=>{ge(!0),ke(!1)},[]),Ue=(0,e.useCallback)(()=>{L===x.Failure&&Pe(!0)},[L]),Ge=(0,e.useCallback)(()=>{Pe(!1)},[]),We=(0,e.useCallback)((e,t)=>{se(t)},[]),Ye=(0,e.useCallback)(()=>{R?.current?.scrollToEnd(),me(!0),setTimeout(()=>fe(!1),1)},[]),$e=(0,e.useCallback)(e=>{const{layoutMeasurement:{height:t},contentOffset:{y:n}}=e.nativeEvent,i=Math.round(t+n),r=i>=oe-ne,a=i>=Math.round(oe);de(r),le&&ue(!1),a&&me(!0),a&&setTimeout(()=>fe(!1),1)},[ne,oe,le]),Xe=(0,e.useMemo)(()=>Math.round(re+ne),[re,ne]);return be?(0,E.jsx)(t.View,{style:O.timeoutContainer,children:(0,E.jsx)(t.View,{style:O.timeoutContainerBackground,children:(0,E.jsx)(y.default,{isVisible:Ce,onPressViewInLogbook:He,onPressCancel:()=>Ee(!1),onDismiss:Ve})})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(t.ScrollView,{ref:R,scrollEventThrottle:16,style:O.scrollView,contentContainerStyle:he&&{paddingBottom:32},testID:"recommendation-screen",onScroll:$e,onContentSizeChange:We,children:[(0,E.jsxs)(t.View,{testID:"recommendation-content",onLayout:({nativeEvent:e})=>ae(e.layout.height),style:O.contentRecommendationContainer,children:[(0,E.jsxs)(t.View,{style:O.recommendationContainer,children:[(0,E.jsx)(d.default,{isEdited:null!==X}),(0,E.jsx)(h.default,{initialValue:(0,i.roundInsulinValue)($.bolus,N),editedValue:X,injectionMethod:N,wasLimited:$.wasLimited,onDismiss:Ue,onConfirm:Fe}),(0,E.jsx)(s.default,{}),(0,E.jsx)(u.default,{glucoseReading:G,bloodGlucoseUnit:D,trackExpandDetails:U,carbIntakeValue:Math.round(W),activeInsulin:Math.round(10*$.activeInsulin)/10,activity:Ne})]}),(0,E.jsxs)(t.View,{style:O.extraRecommendationContainer,children:[Math.round($.carbRecommendation)>0&&(0,E.jsx)(o.default,{carbsRecommendation:Math.round($.carbRecommendation),editedCarbsRecommendation:Q,onDismiss:Ue,onConfirm:Be}),(0,E.jsx)(a.default,{glucoseReading:G,hasActivity:null!==Y,bloodGlucoseUnit:D})]})]}),Xe>T&&pe&&(0,E.jsx)(c.default,{prefixTestID:"scroll",onSave:Ye,onDelete:Ye,onLayout:({nativeEvent:e})=>ie(e.layout.height)})]}),(0,E.jsx)(v.default,{scrollToEnd:Ye,isVisibleArrow:Xe>T&&le,isVisibleBlur:Xe>T&&!ce&&!he}),(Xe<=T||he)&&(0,E.jsx)(c.default,{prefixTestID:"fixed",onSave:B,onDelete:()=>ke(!0),onLayout:({nativeEvent:e})=>ie(e.layout.height)}),(0,E.jsx)(_.default,{isVisible:Ie,activityReduction:$.activityReduction,onPress:()=>xe(!1)}),(0,E.jsx)(p.default,{isVisible:we,onPressDelete:ze,onDismiss:je,onPressCancel:()=>ke(!1)}),(0,E.jsx)(m.default,{isVisible:Re,onPressClose:()=>Ae(!1)}),(0,E.jsx)(g.default,{isVisible:Te,onPressClose:()=>Oe(!1)}),(0,E.jsx)(f.default,{isVisible:Le,onPressClose:Ge})]})};B3.RecommendationScreen=T;B3.default=e=>(0,E.jsx)(S.LanguageProvider,{children:(0,E.jsx)(T,{...e})});const O=t.StyleSheet.create({timeoutContainer:{...t.StyleSheet.absoluteFillObject,backgroundColor:k.COLORS.bgPrimary},timeoutContainerBackground:{flex:1,opacity:.5},contentRecommendationContainer:{gap:32,paddingVertical:32},extraRecommendationContainer:{paddingHorizontal:16},scrollView:{backgroundColor:k.COLORS.bgPrimary,flex:1},recommendationContainer:{borderRadius:16,backgroundColor:k.COLORS.bgSecondary,marginHorizontal:16}});return B3}var g5=(l5||(l5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"RecommendationScreenWrapper",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"SyncStatus",{enumerable:!0,get:function(){return t.SyncStatus}}),Object.defineProperty(e,"recommendationPropsSchema",{enumerable:!0,get:function(){return n.recommendationPropsSchema}});var t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(_5()),n=f5()}(F3)),F3);const y5=()=>F2(e=>e.selectedReadingId&&e.availableGlucoseReadings.find(t=>t.id===e.selectedReadingId)||null);function v5(e,t){const n=o$(e,"HH:mm"),i=function(e){const t=[];for(const n of e)t.push(aX(n.startTime,"HH:mm",new Date));return t}(t),r=aX(n,"HH:mm",new Date);for(let a=0;a<i.length;a++)if(b5(i[a],i[(a+1)%i.length],r))return t[a];throw new Error("[ParameterTimeIntervalsUtils::getDailyParameters] The parameter interval has not been found")}function b5(e,t,n){const i=c$(e,t),r=(a=n,+tY(e)===+tY(a)||c$(e,n));var a;const o=S5(e),s=S5(t,!i),l=S5(n,!r);return o<=l&&l<s}function S5(e,t){return e.getMinutes()+60*(e.getHours()+(t?24:0))}const w5=Ei.create({animationContainer:{flex:1,justifyContent:"center",alignItems:"center"},text:{...oj.bold_Base,marginTop:32},animation:{width:128,height:128}}),k5=iF(function({setRemeasurementNotification:e}){const{t:t,language:n}=iV(),i=y5(),{selectedEventUUID:r}=C2(),{carbohydrateStoreActions:a,manualCarbsInput:o,totalCarbsCartItems:s}=TX(),l=Wp(),u=M.useRef(!1),[c,d]=D.useState(!1),[h,m]=D.useState(null),[p,f]=D.useState(null),{glucoseUnit:_,injectionMethod:g,activity:y}=Uq;if(void 0===_)throw new Error("[LoadingRecommendationScreen::render] glucoseUnit is undefined");if(void 0===g)throw new Error("[LoadingRecommendationScreen::render] injectionMethod is undefined");if(void 0===y)throw new Error("[LoadingRecommendationScreen::render] activity is undefined");if(null===i)throw new Error("[LoadingRecommendationScreen::render] selectedGlucoseReading is undefined");const v=M.useMemo(()=>r?Dq.getByUUID(r):null,[r]),b=M.useMemo(()=>null!==v&&v.startTimestamp?{activitySettings:y,activityDate:new Date(v.startTimestamp),activityDuration:v.durationSeconds/60,activityIntensity:v.activityIntensity}:null,[y,v]),S=M.useMemo(()=>{const{target:e}=function(e){const{glucoseLevelTargets:t}=Uq;if(void 0===t)throw new Error("[ParameterTimeIntervalsUtils::getBGLParameters] glucoseLevelTargets is undefined.");const n=t.use===NL.Usage.Overall,{overallTargetBGL:i,targetBGLIntervals:r}=t;if(n){if(void 0===i)throw new Error("[ParameterTimeIntervalsUtils::getBGLParameters] overallTargetBGL cannot be undefined");return i}if(void 0===r)throw new Error("[ParameterTimeIntervalsUtils::getBGLParameters] targetBGLIntervals cannot be undefined");return v5(e,r)}(new Date),{carbohydrateRatio:t,insulinSensitivity:r}=function(e){const t=Uq.treatmentParameters?.use===NL.Usage.Overall,{treatmentParameters:n}=Uq;if(void 0===n)throw new Error("[ParameterTimeIntervalsUtils::getInsulinParameters] treatmentParameters is undefined.");return t?n.overallParameters:v5(e,n.parameterIntervals)}(new Date),a=_Z.getRecentBoluses();return{bloodGlucoseUnit:_,injectionMethod:g,language:n,calculatorParams:{glucoseReading:i,activity:b,carbohydrateRatio:t,insulinSensitivity:r,carbohydrates:o+s,targetBGL:e,recentBoluses:a}}},[_,g,i,b,o,s,n]),w=M.useCallback(async()=>{const t=g5.recommendationPropsSchema.safeParse(S);if(!t.success)return jX(FX.RecommendationInvalid),console.error(t.error),void f(rV.Validation);const{activeInsulin:n,carbRecommendation:r,bolus:l,activityReduction:u,recentBolusesIds:c,recommendationDate:d}=Rq.calculateRecommendation(S.calculatorParams),h=o+s,p=iZ(S.calculatorParams.glucoseReading.value,S.calculatorParams.glucoseReading.unit,NL.BloodGlucoseUnit.MMOL_L),_=Rq.roundInsulinValue(l,S.injectionMethod),g="external"===i.source||"forecast"===i.source,y=await _Z.addLogbook(lZ({blood_glucose_millimolar:p,blood_glucose_millimolar_sample_id:g?i.sampleId:null,glucose_sample_source_id:g?i.sourceId:null,entry_timestamp:d,event_uuid:v?v.uuid:null,is_bolus_calculation:!0,carbohydrates_suggested_grams:r,carbohydrates_entered_grams:h+r,carbohydrates_input_grams:h,insulin_entered_units:_,insulin_suggested_units:_,active_insulin:n,activity_reduction:u,active_insulin_source_logbook_ids:c}));null!==y?(null!==y.blood_glucose_millimolar&&void 0!==e&&await e(y.blood_glucose_millimolar),a.checkoutCart().catch(console.error),m(y),jX(FX.RecommendationSuccess)):f(rV.Sync)},[S,a,v,i,o,e,s]);return u.current||(u.current=!0,w().catch(console.error)),M.useEffect(()=>{setTimeout(()=>{d(!0)},1600)},[]),M.useEffect(()=>{l.setOptions({gestureEnabled:!1});return l.addListener("beforeRemove",({preventDefault:e})=>{c||e()})},[c,l]),M.useEffect(()=>{c&&null!==h&&null===p&&l.replace(S2.Recommendation,{...S,logbookEntry:h}),c&&null!==p&&l.navigate({name:S2.SummaryTab,params:{errorType:p}})},[p,c,h,S,l]),D.createElement(_a,{style:w5.animationContainer},D.createElement(QV,{autoPlay:!0,source:JV.LOADING_RECOMMENDATION,style:w5.animation,webStyle:w5.animation,resizeMode:"cover",loop:!0}),D.createElement(gj,{style:w5.text},t("recommendation_loading_title")))});const C5=uV?"/api/v2":Wj.HEDIA_API_URL_V2;function E5(){const{COLORS:e}=bL(),t=Wp(),n=df(),{manualCarbsInput:i,totalCarbsCartItems:r}=TX(),[a,o]=M.useState(g5.SyncStatus.Idle),[s,l]=M.useState(g5.SyncStatus.Idle),[u,c]=M.useState(g5.SyncStatus.Idle),{bloodGlucoseUnit:d,calculatorParams:h,injectionMethod:m,language:p,logbookEntry:f}=n.params,[_,g]=M.useState(f),y=M.useCallback(e=>{const t=e.data.state;uV&&t.routes[t.index].name===S2.CalculationBottomTabs&&(W2(),window.location.href="/redirect?status=success",Qj.clearAll())},[]);M.useEffect(()=>(t.addListener("state",y),()=>{t.removeListener("state",y)}),[t,y]),M.useEffect(()=>{t.setOptions({gestureEnabled:!1})},[t]);const v=M.useCallback(async(e,t)=>{c(g5.SyncStatus.Loading);const n=i+r,a=lZ({..._,insulin_entered_units:t.modified??t.suggested,carbohydrates_overwritten_suggested_grams:e.modified,carbohydrates_entered_grams:n+(e.modified??e.suggested)}),o=await _Z.addLogbook(a,_.uuid);o?(g(o),c(g5.SyncStatus.Success)):c(g5.SyncStatus.Failure)},[i,_,r]),b=M.useCallback(()=>{if(uV)throw new Error("Recommendation::handleOnCloseCalculationViewInLogbook] Cannot view-in-logbook on web");const{Logbooks:e,LogbooksTab:n}=S2;t.navigate(n,{screen:e,params:{logbookEntry:_}}),W2()},[t,_]),S=M.useCallback(()=>{uV?(window.location.href="/redirect?status=success",Qj.clearAll()):t.dispatch(wm(S2.DashboardTab,{screen:S2.Dashboard})),W2()},[t]),w=M.useCallback(async()=>{o(g5.SyncStatus.Loading);const e=await _Z.deleteLogbook(_.uuid);if(uV)e?(window.location.href="/redirect?status=success",W2(),Qj.clearAll()):o(g5.SyncStatus.Failure);else{W2();const{Dashboard:e,DashboardTab:n}=S2;t.navigate(n,{screen:e,params:{action:aV.Deleted}})}},[_.uuid,t]),k=M.useCallback(async()=>{l(g5.SyncStatus.Loading);const e=()=>{l(g5.SyncStatus.Success),W2(),t.replace(S2.LeavingRecommendation,{logbookEntry:_})};if(uV){await(async()=>{let e;const t=new Promise((t,n)=>{e=setTimeout(()=>{n(new Error("Timeout exceeded"))},3e3)});try{return await Promise.race([fetch(`${C5}/basic/status`),t]),!0}catch(n){return console.error("API connection error:",n),!1}finally{clearTimeout(e)}})()?e():l(g5.SyncStatus.Failure)}else e()},[t,_]);return D.createElement(SH,{style:[I5.container,{backgroundColor:e.bgPrimary}]},D.createElement(g5.RecommendationScreenWrapper,{deleteStatus:a,saveStatus:s,editStatus:u,bloodGlucoseUnit:d,injectionMethod:m,language:p,calculatorParams:h,closeCalculationViewInlogbook:b,closeCalculationFooter:k,closeCalculationTimeoutModal:S,transferEditedRecommendation:v,deleteCalculation:w,trackExpandDetails:()=>{jX(FX.RecommendationViewDetailsPress)},trackRecommendationTimeout:()=>{jX(FX.RecommendationExpired)}}))}const I5=Ei.create({container:{flex:1}});function x5(){return D.useEffect(()=>{console.warn(`DateTimePicker is not supported on: ${lr.OS}`)},[]),null}const T5=(e,t)=>{const n=e.indexOf(t);return-1===n?0:n},O5=(e,t)=>{const n=new Date(e);return n.setHours(t,0,0,0),{date:n,formatted:o$(n,"HH:mm")}},R5=Array.from({length:60},(e,t)=>t.toString().padStart(2,"0"));const A5=D.memo(function({isVisible:e,initialValue:t,min:n,max:i,onCancel:r,onConfirm:a,onModalHide:o}){const{COLORS:s}=bL(),{width:l}=vm(),u=M.useRef(null),c=M.useRef(null),[d,h]=M.useState(t),m=M.useMemo(()=>{if(!n||!i){const e=new Date;return Array.from({length:24},(t,n)=>O5(e,n))}const e=n.getHours(),t=i.getHours(),r=[];if(o=i,(a=n).getFullYear()===o.getFullYear()&&a.getMonth()===o.getMonth()&&a.getDate()===o.getDate()&&n<i&&e<=t)for(let i=e;i<=t;i++)r.push(O5(n,i));else{for(let t=e;t<24;t++)r.push(O5(n,t));for(let e=0;e<=t;e++)r.push(O5(i,e))}var a,o;return r},[n,i]),p=M.useMemo(()=>m.map(e=>o$(e.date,"HH")),[m]),f=M.useMemo(()=>{const[e]=o$(t,"HH:mm").split(":");return T5(p,e)},[t,p]),_=M.useMemo(()=>{const[,e]=o$(t,"HH:mm").split(":");return T5(R5,e)},[t]),g=M.useMemo(()=>{const[e]=o$(d,"HH:mm").split(":");return T5(p,e)},[d,p]),y=M.useMemo(()=>{const[,e]=o$(d,"HH:mm").split(":");return T5(R5,e)},[d]),v=M.useMemo(()=>n?T5(p,o$(n,"HH")):null,[n,p]),b=M.useMemo(()=>i?T5(p,o$(i,"HH")):null,[i,p]),S=M.useMemo(()=>n?parseInt(o$(n,"mm"),10):null,[n]),w=M.useMemo(()=>i?parseInt(o$(i,"mm"),10):null,[i]),k=M.useCallback((e,t)=>{const n=e<0||e>=p.length,i=t<0||t>=R5.length;if(n||i)return;const r=dX(m[e].date,{minutes:parseInt(R5[t],10),seconds:0,milliseconds:0});h(r)},[p.length,m]),C=M.useCallback(e=>{c.current?.scrollToIndex(e)},[]),E=M.useCallback(e=>{if(null===b||null===v||(null===w||null===S))return void k(e,y);let t=y;return e===v&&y<S?(t=S,C(S),void k(e,t)):e===b&&y>w?(t=w,C(w),void k(e,t)):void k(e,y)},[b,v,w,S,y,k,C]),I=M.useCallback(e=>{if(null===b||null===v||(null===w||null===S))return void k(g,e);let t=e;return g===v&&e<S?(t=S,C(S),void k(g,t)):g===b&&e>w?(t=w,C(w),void k(g,t)):void k(g,t)},[b,w,v,S,g,k,C]),x=M.useCallback(()=>{a(d)},[a,d]),T=M.useCallback(()=>{h(t),r()},[r,t]);return D.createElement(lz,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o},D.createElement(_a,null,D.createElement(_a,{style:L5.pickersContainer},D.createElement(t3,{key:"hours-wheel-picker",ref:u,initialScrollIndex:f,options:p,onChange:E,containerStyle:[L5.itemContainerLeft,{width:(l-32)/2}],selectedIndicatorStyle:[L5.selectedIndicatorLeft,{width:(l-32)/2-10}],itemStyle:L5.itemLeft,testID:"hours-wheel-picker"}),D.createElement(t3,{key:"minutes-wheel-picker",ref:c,initialScrollIndex:_,options:R5,onChange:I,containerStyle:[L5.itemContainerRight,{width:(l-32)/2}],selectedIndicatorStyle:[L5.selectedIndicatorRight,{width:(l-32)/2-10}],itemStyle:L5.itemRight,testID:"minutes-wheel-picker"})),D.createElement(_a,{style:L5.buttonContainer},D.createElement($0,{onPress:x}),D.createElement(W0,{onPress:T}))))}),L5=Ei.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:"row",borderTopLeftRadius:13,borderTopRightRadius:13,overflow:"hidden"},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:16},itemContainerRight:{borderTopLeftRadius:0,paddingRight:16},itemLeft:{alignSelf:"flex-end",marginRight:16},itemRight:{alignSelf:"flex-start",marginLeft:16},selectedIndicatorRight:{alignSelf:"flex-start",borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorLeft:{alignSelf:"flex-end",borderTopRightRadius:0,borderBottomRightRadius:0}}),P5=e=>{switch(e){case NL.InjectionMethod.PenWhole:return PX(NL.CONSTANTS.INSULIN_DOSE_MIN,NL.CONSTANTS.INSULIN_DOSE_MAX);case NL.InjectionMethod.PenHalf:return((e,t,n=.1)=>Array.from({length:Math.round((t-e)/n)+1},(t,i)=>(e+i*n).toFixed(1)))(NL.CONSTANTS.INSULIN_DOSE_MIN,NL.CONSTANTS.INSULIN_DOSE_MAX,.5);case NL.InjectionMethod.Pump:return MX(NL.CONSTANTS.INSULIN_DOSE_MIN,NL.CONSTANTS.INSULIN_DOSE_MAX);default:throw new Error("[insulin::getInsulinInputSequentialArray] Unsupported injection method!")}},M5=()=>{const{t:e}=iV(),{showDiscardCalculationModal:t,modalStoreActions:n,isGoToSettingsPressed:i}=j2(),r=Wp(),[a,o]=M.useState(!1),s=M.useCallback(()=>{W2(),o(!0),n.set({showDiscardCalculationModal:!1})},[n]),l=M.useCallback(()=>{a&&r.pop(),i&&(uV?r.reset({index:1,routes:[{name:S2.NewCalculationStack},{name:S2.SettingsTab,state:{routes:[{name:S2.Settings},{name:S2.ActivitySettings}],index:1}}]}):r.reset({index:0,routes:[{name:S2.SettingsTab,state:{routes:[{name:S2.Settings},{name:S2.ActivitySettings}],index:1}}]}),n.set({isGoToSettingsPressed:!1}))},[a,i,n,r]),u=M.useMemo(()=>[{testID:"discard-button",title:e("new_cal_modal_discard_cal_danger_button"),type:dj.Error,onPress:s},{testID:"cancel-button",title:e("button_cancel"),type:dj.Secondary,onPress:()=>{n.set({showDiscardCalculationModal:!1,isGoToSettingsPressed:!1})}}],[s,n,e]);return D.createElement(lz,{key:"discard_calculation_modal",testID:"discard_calculation_modal",isVisible:t,title:e("new_cal_modal_discard_cal_title"),message:e("new_cal_modal_discard_cal_body"),onModalHide:l,buttons:u})};const D5=Ei.create({rightSlot:{flexDirection:"row",alignItems:"center"},insulinValueText:{...oj.medium_Base},separator:{width:1,alignSelf:"stretch",marginHorizontal:12}}),N5=D.memo(function({time:e,insulinValue:t,onEdit:n,testID:i}){const{t:r}=iV(),{COLORS:a}=bL();return D.createElement(kj,{title:o$(e,"HH:mm"),onPress:n,testID:i,renderRightSlot:()=>D.createElement(_a,{style:D5.rightSlot},D.createElement(gj,{style:D5.insulinValueText},`${t} ${1!==parseFloat(t)?r("units"):r("unit")}`),D.createElement(_a,{style:[D5.separator,{backgroundColor:a.divider}]}),D.createElement(i2,null))})});var F5=(e=>(e.Create="Create",e.Edit="Edit",e.Delete="Delete",e))(F5||{});function B5({renderRegisterInsulinButtons:e}){const{t:t}=iV(),{COLORS:n}=bL(),{navigate:i,setOptions:r,replace:a,pop:o}=Wp(),s=df(),{height:l}=vm(),u=M.useMemo(()=>l<667,[l]),[c,d]=M.useState([]),[h,m]=M.useState(null),[p,f]=M.useState(!1),_=M.useCallback(()=>{jX(FX.AbortCalculationPress),o()},[o]);M.useEffect(()=>{if(!uV){r({headerLeft:()=>D.createElement(X2,{onPress:_})})}},[_,r]),Yp(M.useCallback(()=>{const e=dX(pX(new Date),{seconds:0,milliseconds:0}),t=_Z.getLogbooks(e).map(e=>({uuid:e.uuid,time:e.entry_timestamp.toString(),insulinValue:e.insulin_entered_units?.toString()??""}));d(t)},[])),M.useEffect(()=>{if(!s.params)return;const{insulinEntryId:e}=s.params;m(e)},[s.params]);const g=M.useCallback(e=>{i(S2.RegisterActiveInsulin,{action:"Edit",insulinEntry:c.find(t=>t.uuid===e)})},[i,c]),y=M.useCallback(()=>{jX(FX.RecentInsulinContinuePress),a(S2.CalculationBottomTabs,{screen:S2.GlucoseTab})},[a]),v=M.useCallback(()=>{m(null)},[]),b=M.useMemo(()=>[{title:t("button_close"),onPress:()=>{f(!1)}}],[t]);return D.createElement(D.Fragment,null,D.createElement(Wo,{testID:"active_insulin_list",data:c,contentContainerStyle:V5.containerList,renderItem:({item:e,index:t})=>D.createElement(ij,{key:e.uuid,isAnimated:h===e.uuid,onAnimationFinished:v},D.createElement(N5,{time:e.time,testID:`entry-${t}`,insulinValue:e.insulinValue,onEdit:()=>{g(e.uuid)}})),ItemSeparatorComponent:j5,ListEmptyComponent:D.createElement(_a,{style:V5.emptyComponentList},D.createElement(d2,null),D.createElement(gj,{style:[V5.noInsulinText,{color:n.labelTertiary}]},t("Recent_insulin_empty_state_title"))),ListFooterComponent:()=>e(0===c.length),ListFooterComponentStyle:u?V5.smallScreenFooterList:V5.footerList,ListHeaderComponent:D.createElement(D.Fragment,null,c.length>0?D.createElement(gj,{style:V5.title},t("Recent_insulin_title",{timeFourHour:o$(pX(new Date),"HH:mm")})):D.createElement(gj,{style:V5.title},t("Recent_insulin_empty_title")),D.createElement(eh,{style:V5.infoTextContainer,onPress:()=>{f(!0)}},D.createElement(gj,{style:[V5.infoText,{color:n.textLink}]},t("Recent_insulin_link_modal")))),ListHeaderComponentStyle:u?V5.smallScreenHeaderList:V5.headerList}),D.createElement(SH,{style:[V5.footer,{backgroundColor:n.bgNavigationBar}],edges:["bottom"]},D.createElement(mj,{title:t("Recent_insulin_button_continue"),onPress:y,type:c.length>0?dj.Primary:dj.Secondary,style:V5.confirmButton})),D.createElement(lz,{key:"recent_insulin_info",isVisible:p,title:t("Recent_insulin_modal_title"),message:t("Recent_insulin_modal_body"),buttons:b}),D.createElement(M5,null))}const j5=()=>D.createElement(_a,{style:V5.separatorList}),V5=Ei.create({containerList:{paddingHorizontal:16},headerList:{paddingTop:32,paddingBottom:64,paddingHorizontal:16},smallScreenHeaderList:{paddingVertical:32},footerList:{paddingVertical:64},smallScreenFooterList:{paddingVertical:32},title:{...oj.semiBold_2XL,marginBottom:12},infoTextContainer:{flexDirection:"row",alignItems:"center"},infoText:{...oj.semiBold_SM,marginRight:4},emptyComponentList:{justifyContent:"space-between",alignItems:"center",gap:8,paddingHorizontal:64},separatorList:{height:8},noInsulinText:{...oj.medium_Base,textAlign:"center"},footer:{paddingHorizontal:16,paddingBottom:16},confirmButton:{marginTop:16}});const H5=iF(function(){const{t:e}=iV(),{COLORS:t}=bL(),n=Wp(),i=df(),{bottom:r}=pH(),[a,o]=M.useState(!1),[s,l]=M.useState(i.params.insulinEntry?.insulinValue),[u,c]=M.useState(!1),[d,h]=M.useState(i.params.insulinEntry?new Date(i.params.insulinEntry.time):void 0),[m,p]=M.useState(),[f,_]=M.useState(!1),[g,y]=M.useState(!1),[v,b]=M.useState(!1),{initialInsulinValue:S,initialDate:w}=M.useMemo(()=>({initialInsulinValue:i.params.insulinEntry?.insulinValue,initialDate:i.params.insulinEntry?new Date(i.params.insulinEntry.time):void 0}),[i.params.insulinEntry]),k=Uq.injectionMethod;if(void 0===k)throw new Error("[RegisterActiveInsulin::render] injectionMethod is undefined");const C=M.useMemo(()=>P5(k),[k]),E=M.useCallback(async()=>{if(!s||!d)throw new Error("[RegisterActiveInsulin::handleDonePressed] insulinValue or date is undefined");if(i.params.action===F5.Create){const e=lZ({entry_timestamp:d,insulin_entered_units:parseFloat(s)});return await _Z.addLogbook(e)?void n.navigate({name:S2.ActiveInsulin,params:{insulinEntryId:e.uuid},merge:!0}):void _(!0)}if(!i.params.insulinEntry)throw new Error("[RegisterActiveInsulin::handleDonePressed] insulinEntry is undefined");const e={..._Z.getLogbookByUUID(i.params.insulinEntry.uuid),entry_timestamp:d,insulin_entered_units:parseFloat(s)};await _Z.addLogbook(e,i.params.insulinEntry.uuid)?n.navigate({name:S2.ActiveInsulin,params:{insulinEntryId:e.uuid},merge:!0}):_(!0)},[d,s,n,i.params.action,i.params.insulinEntry]);M.useEffect(()=>{n.setOptions({headerRight:()=>D.createElement(Z2,{title:i.params.action===F5.Edit?e("button_done"):e("button_save"),onPress:E,disabled:!d||!s||!!m||w===d&&S===s})})},[n,E,s,d,i.params.action,e,w,S,m]);const I=M.useCallback(()=>{y(!0),b(!1)},[]),x=M.useCallback(()=>{setTimeout(async()=>{if(g&&i.params.insulinEntry){await _Z.deleteLogbook(i.params.insulinEntry.uuid)?n.goBack():_(!0)}},0)},[g,n,i.params.insulinEntry]),T=M.useCallback(()=>{c(!0)},[]),O=M.useCallback(()=>{o(!0)},[]),R=M.useCallback(t=>{const n=new Date,i=function(e,t,n){const i=+tY(e,n?.in),[r,a]=[+tY(t.start,n?.in),+tY(t.end,n?.in)].sort((e,t)=>e-t);return i>=r&&i<=a}(t,{start:dX(pX(n),{seconds:0,milliseconds:0}),end:n}),r=i?void 0:e("error_insulin_intake_hint");h(t),p(r),c(!1)},[e]),A=M.useCallback(()=>{c(!1)},[]),L=M.useCallback(e=>{l(e.toString()),o(!1)},[]),P=M.useMemo(()=>{if(!s)return 0;const e=(e=>{switch(e){case NL.InjectionMethod.PenWhole:return 0;case NL.InjectionMethod.PenHalf:case NL.InjectionMethod.Pump:return 1;default:throw new Error("[insulin::getInsulinInputDecimalPlaces] Unsupported injection method!")}})(k);return C.findIndex(t=>t===parseFloat(s).toFixed(e))},[s,C,k]);return D.createElement(D.Fragment,null,D.createElement(Xa,{contentContainerStyle:[z5.contentContainer,{backgroundColor:t.bgSheet}]},D.createElement(_a,{style:z5.screen},D.createElement(gj,{style:z5.screenTitle},e("register_insulin_title",{timeFourHour:o$(pX(new Date),"HH:mm")})),D.createElement(kj,{title:e("register_insulin_input_title"),testID:"insulin-input",onPress:O,renderRightSlot:()=>D.createElement(_a,{style:z5.insulinRightSlot},D.createElement(gj,{style:[z5.insulinText,{color:t.labelPrimary}]},s),D.createElement(gj,{style:[z5.unitsText,{color:t.labelPrimary}]},e("units"))),style:a?{borderColor:t.borderInputFocus}:void 0}),D.createElement(ZB,{isAnimated:!!m},D.createElement(kj,{renderLeftSlot:()=>D.createElement(gj,null,e("register_insulin_time_input_title")),testID:"time-input",errorMessage:m,onPress:T,renderRightSlot:()=>D.createElement(_a,{style:[z5.setTimeButton,{backgroundColor:t.bgTertiary}]},D.createElement(gj,{style:[z5.setTimeText,{color:t.labelPrimary},u&&{color:t.textLink},!!m&&{color:t.textInputDanger}]},d?o$(d,"HH:mm"):e("register_insulin_time_button_unit"))),style:u?{flexWrap:"wrap",paddingVertical:8,borderColor:t.borderInputFocus}:z5.rowInsulin}))),i.params.action===F5.Edit&&D.createElement(mj,{title:e("button_delete"),onPress:()=>{b(!0)},type:dj.ErrorSecondary})),D.createElement(n3,{isVisible:a,items:C,onConfirm:L,onCancel:()=>{o(!1)},initialScrollIndex:P,testID:"insulin-wheel-picker"}),dV?D.createElement(x5,{testID:"date-time-picker",isVisible:u,display:"spinner",date:d??new Date,mode:(new Date).getHours()>=4?"time":"datetime",onConfirm:R,onCancel:A,cancelTextIOS:e("button_cancel"),confirmTextIOS:e("button_confirm"),pickerStyleIOS:z5.alignCenter,modalStyleIOS:{paddingBottom:r},minimumDate:mX(new Date,{hours:4}),maximumDate:new Date}):D.createElement(A5,{isVisible:u,initialValue:d??new Date,min:mX(new Date,{hours:4}),max:new Date,onConfirm:R,onCancel:A}),D.createElement(lz,{isVisible:v,title:e("register_insulin_modal_title"),message:e("register_insulin_modal_body"),onModalHide:x,buttons:[{title:e("button_delete"),testID:"confirm_delete",type:dj.Error,onPress:I},{title:e("button_cancel"),type:dj.Secondary,onPress:()=>{b(!1)}}]}),D.createElement(lz,{isVisible:f,icon:c2,title:e("new_cal_modal_no_internet_title"),message:e("new_cal_modal_no_internet_body"),buttons:[{title:e("button_close"),onPress:()=>{_(!1)}}]}))}),z5=Ei.create({contentContainer:{flex:1,paddingHorizontal:16,paddingVertical:32,gap:24},screen:{gap:16},screenTitle:{textAlign:"center",marginBottom:8},rowInsulin:{flexWrap:"wrap",paddingVertical:8},insulinRightSlot:{flexDirection:"row",flex:1,alignItems:"center"},setTimeButton:{borderRadius:16,paddingHorizontal:12,paddingVertical:8},setTimeText:{...oj.medium_Base},insulinText:{...oj.medium_Base,marginRight:4},unitsText:{...oj.medium_Base},alignCenter:{alignSelf:"center"}});function U5(){const{t:e}=iV(),{COLORS:t}=bL(),n=Wp(),i=M.useCallback(()=>{jX(FX.RecentInsulinRegisterPress),n.navigate(S2.RegisterActiveInsulin,{action:F5.Create})},[n]);return d.jsx(B5,{renderRegisterInsulinButtons:n=>d.jsx(mj,{title:e("recent_insulin_button_add"),onPress:i,leftIcon:d.jsx(U1,{color:t.labelPrimary}),type:n?dj.Primary:dj.Secondary})})}const G5=M.createContext(void 0),W5=M.createContext(void 0);function Y5(){return Y5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Y5.apply(this,arguments)}function $5(e){let{children:t,style:n,visible:i=!0,size:r=18,...a}=e;const[o]=M.useState(()=>new uu.Value(i?1:0)),[s,l]=M.useState(i),u=Af();if(M.useEffect(()=>{if(s)return uu.timing(o,{toValue:i?1:0,duration:150,useNativeDriver:!0}).start(e=>{let{finished:t}=e;t&&!i&&l(!1)}),()=>o.stopAnimation()},[o,s,i]),!s){if(!i)return null;l(!0)}const{backgroundColor:c=u.colors.notification,...d}=Ei.flatten(n)||{},h=pQ(c).isLight()?"black":"white",m=r/2,p=Math.floor(3*r/4);return M.createElement(uu.Text,Y5({numberOfLines:1,style:[{transform:[{scale:o.interpolate({inputRange:[0,1],outputRange:[.5,1]})}],color:h,lineHeight:r-1,height:r,minWidth:r,opacity:o,backgroundColor:c,fontSize:p,borderRadius:m},X5.container,d]},a),t)}const X5=Ei.create({container:{alignSelf:"flex-end",textAlign:"center",paddingHorizontal:4,overflow:"hidden"}});function q5(e){let{route:t,horizontal:n,badge:i,badgeStyle:r,activeOpacity:a,inactiveOpacity:o,activeTintColor:s,inactiveTintColor:l,renderIcon:u,style:c}=e;return D.createElement(_a,{style:[n?Z5.iconHorizontal:Z5.iconVertical,c]},D.createElement(_a,{style:[Z5.icon,{opacity:a}]},u({focused:!0,size:25,color:s})),D.createElement(_a,{style:[Z5.icon,{opacity:o}]},u({focused:!1,size:25,color:l})),D.createElement($5,{visible:null!=i,style:[Z5.badge,n?Z5.badgeHorizontal:Z5.badgeVertical,r],size:75/4},i))}const Z5=Ei.create({icon:{position:"absolute",alignSelf:"center",alignItems:"center",justifyContent:"center",height:"100%",width:"100%",minWidth:25},iconVertical:{flex:1},iconHorizontal:{height:"100%",marginTop:3},badge:{position:"absolute",left:3},badgeVertical:{top:3},badgeHorizontal:{top:7}});function K5(){return K5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},K5.apply(this,arguments)}function Q5(e){let{focused:t,route:n,descriptor:i,label:r,icon:a,badge:o,badgeStyle:s,to:l,button:u=e=>{let{children:t,style:n,onPress:i,to:r,accessibilityRole:a,...o}=e;return"web"===lr.OS&&r?D.createElement(ff,K5({},o,{to:r,style:[J5.button,n],onPress:e=>{e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||null!=e.button&&0!==e.button||(e.preventDefault(),null==i||i(e))}}),t):D.createElement(eh,K5({},o,{accessibilityRole:a,onPress:i,style:n}),t)},accessibilityLabel:c,testID:d,onPress:h,onLongPress:m,horizontal:p,activeTintColor:f,inactiveTintColor:_,activeBackgroundColor:g="transparent",inactiveBackgroundColor:y="transparent",showLabel:v=!0,allowFontScaling:b,labelStyle:S,iconStyle:w,style:k}=e;const{colors:C}=Af(),E=void 0===f?C.primary:f,I=void 0===_?pQ(C.text).mix(pQ(C.card),.5).hex():_,x={focused:t},T=t?g:y;return u({to:l,onPress:h,onLongPress:m,testID:d,accessibilityLabel:c,accessibilityRole:lr.select({ios:"button",default:"tab"}),accessibilityState:{selected:t},accessibilityStates:t?["selected"]:[],style:[J5.tab,{backgroundColor:T},p?J5.tabLandscape:J5.tabPortrait,k],children:D.createElement(D.Fragment,null,(e=>{let{focused:t}=e;if(void 0===a)return null;const i=t?1:0,r=t?0:1;return D.createElement(q5,{route:n,horizontal:p,badge:o,badgeStyle:s,activeOpacity:i,inactiveOpacity:r,activeTintColor:E,inactiveTintColor:I,renderIcon:a,style:w})})(x),(e=>{let{focused:t}=e;if(!1===v)return null;const a=t?E:I;if("string"==typeof r)return D.createElement(hl,{numberOfLines:1,style:[J5.label,{color:a},p?J5.labelBeside:J5.labelBeneath,S],allowFontScaling:b},r);const{options:o}=i,s="string"==typeof o.tabBarLabel?o.tabBarLabel:void 0!==o.title?o.title:n.name;return r({focused:t,color:a,position:p?"beside-icon":"below-icon",children:s})})(x))})}const J5=Ei.create({tab:{flex:1,alignItems:"center"},tabPortrait:{justifyContent:"flex-end",flexDirection:"column"},tabLandscape:{justifyContent:"center",flexDirection:"row"},label:{textAlign:"center",backgroundColor:"transparent"},labelBeneath:{fontSize:10},labelBeside:{fontSize:13,marginLeft:20,marginTop:3},button:{display:"flex"}}),e6="web"!==lr.OS,t6=e=>{let{state:t,descriptors:n,layout:i,dimensions:r}=e;const{tabBarLabelPosition:a}=n[t.routes[t.index].key].options;if(a)switch(a){case"beside-icon":return!0;case"below-icon":return!1}if(i.width>=768){return t.routes.reduce((e,t)=>{const{tabBarItemStyle:i}=n[t.key].options,r=Ei.flatten(i);if(r){if("number"==typeof r.width)return e+r.width;if("number"==typeof r.maxWidth)return e+r.maxWidth}return e+125},0)<=i.width}return r.width>r.height},n6=e=>Math.max(e.bottom-lr.select({ios:4,default:0}),0),i6=e=>{var t;let{state:n,descriptors:i,dimensions:r,insets:a,style:o,...s}=e;const l=null===(t=Ei.flatten(o))||void 0===t?void 0:t.height;if("number"==typeof l)return l;const u=r.width>r.height,c=t6({state:n,descriptors:i,dimensions:r,...s}),d=n6(a);return"ios"===lr.OS&&!lr.isPad&&u&&c?32+d:49+d};function r6(e){let{state:t,navigation:n,descriptors:i,insets:r,style:a}=e;const{colors:o}=Af(),s=function(){const e=M.useContext(Bp),t=M.useContext(hf);return M.useCallback((n,i)=>{const{options:r}=t;if(!1===(null==r?void 0:r.enabled))return;const a=e?Lf(e,{index:0,routes:[{name:n,params:i}]}):{index:0,routes:[{name:n,params:i}]};return null!=r&&r.getPathFromState?r.getPathFromState(a,null==r?void 0:r.config):wp(a,null==r?void 0:r.config)},[t,e])}(),l=t.routes[t.index],u=i[l.key].options,{tabBarShowLabel:c,tabBarHideOnKeyboard:d=!1,tabBarVisibilityAnimationConfig:h,tabBarStyle:m,tabBarBackground:p,tabBarActiveTintColor:f,tabBarInactiveTintColor:_,tabBarActiveBackgroundColor:g,tabBarInactiveBackgroundColor:y}=u,v=fH(),b=function(){const[e,t]=M.useState(!1);return M.useEffect(()=>{const e=()=>t(!0),n=()=>t(!1);let i;return i="ios"===lr.OS?[Pu.addListener("keyboardWillShow",e),Pu.addListener("keyboardWillHide",n)]:[Pu.addListener("keyboardDidShow",e),Pu.addListener("keyboardDidHide",n)],()=>{i.forEach(e=>e.remove())}},[]),e}(),S=D.useContext(G5),w=!(d&&b),k=D.useRef(h);D.useEffect(()=>{k.current=h});const[C,E]=D.useState(!w),[I]=D.useState(()=>new uu.Value(w?1:0));D.useEffect(()=>{const e=k.current;if(w){var t,n;("spring"===(null==e||null===(t=e.show)||void 0===t?void 0:t.animation)?uu.spring:uu.timing)(I,{toValue:1,useNativeDriver:e6,duration:250,...null==e||null===(n=e.show)||void 0===n?void 0:n.config}).start(e=>{let{finished:t}=e;t&&E(!1)})}else{var i,r;E(!0);("spring"===(null==e||null===(i=e.hide)||void 0===i?void 0:i.animation)?uu.spring:uu.timing)(I,{toValue:0,useNativeDriver:e6,duration:200,...null==e||null===(r=e.hide)||void 0===r?void 0:r.config}).start()}return()=>I.stopAnimation()},[I,w]);const[x,T]=D.useState({height:0,width:v.width}),{routes:O}=t,R=n6(r),A=i6({state:t,descriptors:i,insets:r,dimensions:v,layout:x,style:[m,a]}),L=t6({state:t,descriptors:i,dimensions:v,layout:x}),P=null==p?void 0:p();return D.createElement(uu.View,{style:[a6.tabBar,{backgroundColor:null!=P?"transparent":o.card,borderTopColor:o.border},{transform:[{translateY:I.interpolate({inputRange:[0,1],outputRange:[x.height+R+Ei.hairlineWidth,0]})}],position:C?"absolute":null},{height:A,paddingBottom:R,paddingHorizontal:Math.max(r.left,r.right)},m],pointerEvents:C?"none":"auto",onLayout:e=>{const{height:t,width:n}=e.nativeEvent.layout;null==S||S(t),T(e=>t===e.height&&n===e.width?e:{height:t,width:n})}},D.createElement(_a,{pointerEvents:"none",style:Ei.absoluteFill},P),D.createElement(_a,{accessibilityRole:"tablist",style:a6.content},O.map((e,r)=>{const a=r===t.index,{options:o}=i[e.key],l=void 0!==o.tabBarLabel?o.tabBarLabel:void 0!==o.title?o.title:e.name,u=void 0!==o.tabBarAccessibilityLabel?o.tabBarAccessibilityLabel:"string"==typeof l&&"ios"===lr.OS?`${l}, tab, ${r+1} of ${O.length}`:void 0;return D.createElement(jm.Provider,{key:e.key,value:i[e.key].navigation},D.createElement(Vm.Provider,{value:e},D.createElement(Q5,{route:e,descriptor:i[e.key],focused:a,horizontal:L,onPress:()=>{const i=n.emit({type:"tabPress",target:e.key,canPreventDefault:!0});a||i.defaultPrevented||n.dispatch({...wm({name:e.name,merge:!0}),target:t.key})},onLongPress:()=>{n.emit({type:"tabLongPress",target:e.key})},accessibilityLabel:u,to:s(e.name,e.params),testID:o.tabBarTestID,allowFontScaling:o.tabBarAllowFontScaling,activeTintColor:f,inactiveTintColor:_,activeBackgroundColor:g,inactiveBackgroundColor:y,button:o.tabBarButton,icon:o.tabBarIcon??(e=>{let{color:t,size:n}=e;return D.createElement(bK,{color:t,size:n})}),badge:o.tabBarBadge,badgeStyle:o.tabBarBadgeStyle,label:l,showLabel:c,labelStyle:o.tabBarLabelStyle,iconStyle:o.tabBarIconStyle,style:o.tabBarItemStyle})))})))}const a6=Ei.create({tabBar:{left:0,right:0,bottom:0,borderTopWidth:Ei.hairlineWidth,elevation:8},content:{flex:1,flexDirection:"row"}});function o6(){return o6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},o6.apply(this,arguments)}let s6;try{s6=yQ}catch(e){}const l6=e=>{var t,n;let{enabled:i,...r}=e;return null!==(t=s6)&&void 0!==t&&null!==(n=t.screensEnabled)&&void 0!==n&&n.call(t)?M.createElement(s6.ScreenContainer,o6({enabled:i},r)):M.createElement(_a,r)};function u6(e){var t,n;let{visible:i,children:r,...a}=e;return null!==(t=s6)&&void 0!==t&&null!==(n=t.screensEnabled)&&void 0!==n&&n.call(t)?M.createElement(s6.Screen,o6({activityState:i?2:0},a),r):M.createElement(kK,o6({visible:i},a),r)}function c6(){return c6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c6.apply(this,arguments)}function d6(e){const{tabBar:t=e=>M.createElement(r6,e),state:n,navigation:i,descriptors:r,safeAreaInsets:a,detachInactiveScreens:o="web"===lr.OS||"android"===lr.OS||"ios"===lr.OS,sceneContainerStyle:s}=e,l=n.routes[n.index].key,[u,c]=M.useState([l]);u.includes(l)||c([...u,l]);const d=TK.initialMetrics.frame,[h,m]=M.useState(()=>i6({state:n,descriptors:r,dimensions:d,layout:{width:d.width,height:0},insets:{...TK.initialMetrics.insets,...e.safeAreaInsets},style:r[n.routes[n.index].key].options.tabBarStyle})),{routes:p}=n;return M.createElement(TK,null,M.createElement(l6,{enabled:o,hasTwoStates:!0,style:h6.container},p.map((e,t)=>{const i=r[e.key],{lazy:a=!0,unmountOnBlur:l}=i.options,c=n.index===t;if(l&&!c)return null;if(a&&!u.includes(e.key)&&!c)return null;const{freezeOnBlur:m,header:p=t=>{let{layout:n,options:i}=t;return M.createElement(lK,c6({},i,{layout:n,title:QZ(i,e.name)}))},headerShown:f,headerStatusBarHeight:_,headerTransparent:g}=i.options;return M.createElement(u6,{key:e.key,style:[Ei.absoluteFill,{zIndex:c?0:-1}],visible:c,enabled:o,freezeOnBlur:m},M.createElement(W5.Provider,{value:h},M.createElement(AK,{focused:c,route:i.route,navigation:i.navigation,headerShown:f,headerStatusBarHeight:_,headerTransparent:g,header:p({layout:d,route:i.route,navigation:i.navigation,options:i.options}),style:s},i.render())))})),M.createElement(G5.Provider,{value:m},M.createElement(uH.Consumer,null,e=>t({state:n,descriptors:r,navigation:i,insets:{top:(null==a?void 0:a.top)??(null==e?void 0:e.top)??0,right:(null==a?void 0:a.right)??(null==e?void 0:e.right)??0,bottom:(null==a?void 0:a.bottom)??(null==e?void 0:e.bottom)??0,left:(null==a?void 0:a.left)??(null==e?void 0:e.left)??0}}))))}const h6=Ei.create({container:{flex:1,overflow:"hidden"}});function m6(){return m6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},m6.apply(this,arguments)}const p6=tp(function(e){let{id:t,initialRouteName:n,backBehavior:i,children:r,screenListeners:a,screenOptions:o,sceneContainerStyle:s,...l}=e;const{lazy:u,tabBarOptions:c,...d}=l;let h={};c&&(Object.assign(h,{tabBarHideOnKeyboard:c.keyboardHidesTabBar,tabBarActiveTintColor:c.activeTintColor,tabBarInactiveTintColor:c.inactiveTintColor,tabBarActiveBackgroundColor:c.activeBackgroundColor,tabBarInactiveBackgroundColor:c.inactiveBackgroundColor,tabBarAllowFontScaling:c.allowFontScaling,tabBarShowLabel:c.showLabel,tabBarLabelStyle:c.labelStyle,tabBarIconStyle:c.iconStyle,tabBarItemStyle:c.tabStyle,tabBarLabelPosition:c.labelPosition??(!1===c.adaptive?"below-icon":void 0),tabBarStyle:[{display:c.tabBarVisible?"none":"flex"},h.tabBarStyle]}),Object.keys(h).forEach(e=>{void 0===h[e]&&delete h[e]}),WH(c,`Bottom Tab Navigator: 'tabBarOptions' is deprecated. Migrate the options to 'screenOptions' instead.\n\nPlace the following in 'screenOptions' in your code to keep current behavior:\n\n${JSON.stringify(h,null,2)}\n\nSee https://reactnavigation.org/docs/bottom-tab-navigator#options for more details.`)),"boolean"==typeof u&&(h.lazy=u,WH(!0,"Bottom Tab Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/bottom-tab-navigator/#lazy for more details."));const{state:m,descriptors:p,navigation:f,NavigationContent:_}=cf(Rm,{id:t,initialRouteName:n,backBehavior:i,children:r,screenListeners:a,screenOptions:o,defaultScreenOptions:h});return M.createElement(_,null,M.createElement(d6,m6({},d,{state:m,navigation:f,descriptors:p,sceneContainerStyle:s})))});new Xo(nr.RNDeviceInfo);const f6=new Xo(nr.RNDeviceInfo);let _6=!1,g6=-1,y6={};const v6=e=>{const{level:t,charging:n,chargingtime:i,dischargingtime:r}=e;return{batteryLevel:t,lowPowerMode:!1,batteryState:1===t?"full":n?"charging":"unplugged",chargingtime:i,dischargingtime:r}},b6=()=>window.performance&&window.performance.memory?window.performance.memory.jsHeapSizeLimit:-1,S6=()=>document.referrer,w6=()=>!!navigator.onLine,k6=()=>window.navigator.userAgent,C6=()=>!!navigator.geolocation,E6=()=>navigator.deviceMemory?1e9*navigator.deviceMemory:-1,I6=()=>window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize:-1;"undefined"!=typeof navigator&&navigator.getBattery&&navigator.getBattery().then(e=>{_6=e.charging,e.addEventListener("chargingchange",()=>{const{charging:t}=e;_6=t,y6=v6(e),f6.emit("RNDeviceInfo_powerStateDidChange",y6)}),e.addEventListener("levelchange",()=>{const{level:t}=e;g6=t,y6=v6(e),f6.emit("RNDeviceInfo_batteryLevelDidChange",t),t<.2&&f6.emit("RNDeviceInfo_batteryLevelIsLow",t)})});const x6=Object.freeze(Object.defineProperty({__proto__:null,getBaseOs:async()=>(()=>{const e=window.navigator.userAgent,t=window.navigator.platform;let n=t;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(t)?n="Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(t)?n="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(t)?n="Windows":/Android/.test(e)?n="Android":!n&&/Linux/.test(t)&&(n="Linux"),n})(),getBatteryLevel:async()=>navigator.getBattery?navigator.getBattery().then(e=>e.level):-1,getBatteryLevelSync:()=>g6,getFreeDiskStorage:async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e,usage:t})=>e-t):-1,getFreeDiskStorageSync:()=>(console.log("[react-native-device-info] getFreeDiskStorageSync not supported - please use getFreeDiskStorage"),-1),getInstallReferrer:async()=>S6(),getInstallReferrerSync:S6,getMaxMemory:async()=>b6(),getMaxMemorySync:b6,getPowerState:async()=>navigator.getBattery?navigator.getBattery().then(e=>v6(e)):{},getPowerStateSync:()=>y6,getTotalDiskCapacity:async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e})=>e):-1,getTotalDiskCapacitySync:()=>(console.log("[react-native-device-info] getTotalDiskCapacitySync not supported - please use getTotalDiskCapacity"),-1),getTotalMemory:async()=>E6(),getTotalMemorySync:E6,getUsedMemory:async()=>I6(),getUsedMemorySync:I6,getUserAgent:async()=>k6(),getUserAgentSync:k6,isAirplaneMode:async()=>w6(),isAirplaneModeSync:w6,isBatteryCharging:async()=>!!navigator.getBattery&&navigator.getBattery().then(e=>e.charging),isBatteryChargingSync:()=>_6,isCameraPresent:async()=>!(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)&&navigator.mediaDevices.enumerateDevices().then(e=>!!e.find(e=>"videoinput"===e.kind)),isCameraPresentSync:()=>(console.log("[react-native-device-info] isCameraPresentSync not supported - please use isCameraPresent"),!1),isLocationEnabled:async()=>C6(),isLocationEnabledSync:C6},Symbol.toStringTag,{value:"Module"})),T6=i(x6);let O6=nr.RNDeviceInfo;if("web"!==lr.OS&&"dom"!==lr.OS||(O6=T6),!O6&&("android"===lr.OS||"ios"===lr.OS||"web"===lr.OS||"dom"===lr.OS))throw new Error("react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue try these steps:\n • For react-native <= 0.59: Run `react-native link react-native-device-info` in the project root.\n • Rebuild and re-run the app.\n • If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.\n If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-device-info/react-native-device-info");const R6=O6;let A6={};function L6({getter:e,supportedPlatforms:t,defaultValue:n,memoKey:i}){if(i&&null!=A6[i])return A6[i];{const r=function(e,t,n){let i={};return e.filter(e=>lr.OS==e).forEach(e=>i[e]=t),lr.select({...i,default:n})}(t,e,()=>n)();return i&&(A6[i]=r),r}}const P6=()=>L6({defaultValue:!1,supportedPlatforms:["ios"],memoKey:"zoomed",getter:()=>R6.isDisplayZoomed});new Xo(nr.RNDeviceInfo);const M6=Ei.create({container:{flexDirection:"row",justifyContent:"space-between",padding:8,paddingLeft:16,borderRadius:40,marginBottom:16},button:{alignItems:"center",justifyContent:"center",minWidth:60,maxWidth:80},calculateButton:{alignItems:"center",borderRadius:26,height:52,flex:1,minWidth:60,borderWidth:1},title:{...oj.medium_XXS,paddingTop:2,textAlign:"center"},valueCircle:{borderRadius:8,position:"absolute",left:40,top:6},value:{...oj.semiBold_XXS,lineHeight:lr.select({web:15,default:14}),paddingHorizontal:lr.select({web:5,default:4})}}),D6=iF(({navigation:e})=>{const{t:t}=iV(),{COLORS:n}=bL(),{isCalculationTabBarHidden:i}=mL(),r=y5(),{totalCarbsCartItems:a,manualCarbsInput:o}=TX(),{activityDurationSeconds:s}=C2(),{glucoseUnit:l}=Uq;if(void 0===l)throw new Error("[BolusTab::render] glucoseUnit must be non-undefined.");const{navigate:u,getState:c}=e,d=c().index,[h,m]=M.useState(!1),[p,f]=M.useState([0,0,0,0]),_=uR(0);M.useEffect(()=>{_.value=NE(p[d],{duration:200})},[d,_,p]);const g=()=>{jX(FX.GlucoseTabPress),u(S2.GlucoseTab)},y=()=>{jX(FX.CarbsTabPress),u(S2.CarbsTab)},v=()=>{jX(FX.ActivityTabPress),u(S2.ActivityTab)},b=()=>{a+o>300?m(!0):(jX(FX.SummaryTabPress),u(S2.SummaryTab))};return i?null:D.createElement(D.Fragment,null,D.createElement(SH,{style:[M6.container,{backgroundColor:n.bgSecondary,marginHorizontal:P6()?4:24}],edges:["bottom"],mode:"margin"},(()=>{const e=Math.round(o+a),i=Math.round(s/60);return[{testID:"bg-tab",value:null===r?"-":aZ(r.value,r.unit,l),onPress:g,title:t("bottom_navigation_calculation_glucose")},{testID:"carbs-tab",value:e,onPress:y,title:t("bottom_navigation_calculation_carbs")},{testID:"activity-tab",value:i,onPress:v,title:t("bottom_navigation_calculation_activity")},{isSummary:!0,testID:"summary-tab",onPress:b}].map((e,t)=>{const{testID:i,title:r,value:a,onPress:o,isSummary:s}=e,l=`${t}_${i}`,u=t===d,c=s?[M6.calculateButton,{backgroundColor:u?n.bgCalculatorActive:n.bgCalculatorInactive,borderColor:u?n.bgTransparent:n.borderCalculator,maxWidth:P6()?70:84}]:M6.button,h=t,m={0:u?D.createElement(n2,null):D.createElement(t2,null),1:u?D.createElement(W1,{height:28,width:28}):D.createElement(G1,{height:28,width:28}),2:u?D.createElement(z1,{height:28,width:28}):D.createElement(H1,null),3:u?D.createElement(r2,{color:n.iconActive}):D.createElement(r2,null)};return D.createElement(eh,{key:l,testID:i,onPress:o,style:c,disabled:u,onLayout:e=>{((e,t,n)=>{const i=(n-30)/2+t-(uV?16:0);f(t=>{const n=[...t];return n[e]=i,n})})(t,e.nativeEvent.layout.x,e.nativeEvent.layout.width)}},m[h],D.createElement(gj,{maxFontSizeMultiplier:sj,style:[M6.title,{color:n.labelSecondary},u&&{color:n.labelBrand}],ellipsizeMode:"tail",numberOfLines:1},r),!s&&D.createElement(_a,{style:[M6.valueCircle,{backgroundColor:u?n.bgBrand:n.bgNumber}]},D.createElement(gj,{style:[M6.value,{color:n.textNumber}],maxFontSizeMultiplier:sj},a)))})})()),D.createElement(lz,{isVisible:h,title:t("current_glucose_invalid_modal_title"),message:t("current_glucose_invalid_modal_body"),buttons:[{title:t("button_close"),onPress:()=>{m(!1)}}]}),D.createElement(M5,null))}),N6=()=>{const{t:e}=iV(),{COLORS:t}=bL();return M.createElement(M.Fragment,null,M.createElement(gj,{style:F6.header,testID:"activity-info-title"},e("physical_activity_modal_activity_insulin_title")),M.createElement(gj,{style:[{color:t.labelSecondary},F6.spacing]},e("physical_activity_modal_activity_insulin_body")),M.createElement(gj,{style:F6.header},e("physical_activity_modal_adjust_insulin_title")),M.createElement(gj,{style:{color:t.labelSecondary}},e("physical_activity_modal_adjust_insulin_body")))},F6=Ei.create({header:{...oj.semiBold_LG,marginBottom:8},spacing:{marginBottom:32}});function B6({isSpinning:e,height:t=20,width:n=20}){const i=OR(),r=M.useRef(new uu.Value(0)).current;M.useEffect(()=>{const t=uu.loop(uu.timing(r,{toValue:1,duration:3e3,useNativeDriver:!uV,easing:Xl.linear}));return e&&!i&&t.start(),()=>{t.stop()}},[r,e,i]);const a=r.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return D.createElement(uu.View,{style:{transform:[{rotate:a}]}},D.createElement(h2,{height:t,width:n}))}function j6({activity:e,isChecked:t,index:n=0,onEdit:i,toggleActivitySwitch:r}){const{t:a}=iV(),{COLORS:o}=bL();if(!Uq.activity)throw new Error("[ActivityCard::render] No settings found!");if(!Uq.glucoseUnit)throw new Error("[ActivityCard::render] No glucose unit found!");const{activityIntensity:s,durationSeconds:l,startTimestamp:u,title:c,type:d,uuid:h}=e;if(!u)throw new Error("[ActivityCard::render] No startTimestamp!");const m=o$(u,"dd.MM.yy"),p=o$(u,"HH:mm"),f=s?tZ[s]():null,_={borderColor:o.borderInputFocus},g=M.useMemo(()=>Math.round(l/60),[l]),[y,v]=M.useState(Jq(u,g)),b=M.useMemo(()=>{const e=Uq.activity;if(!e)throw new Error("[ActivityCard::reduction] No settings found!");return(100*Rq.getReduction(g,e,s,new Date(u))).toFixed(0)},[s,g,u]),S=`activity-${g}-${s}-${d}-${t}`.toLowerCase(),w=`activity-card-${n}`,k=f?`${w}-intensity-${f.toLowerCase()}`:"",C=Uq.glucoseUnit===NL.BloodGlucoseUnit.MMOL_L?a("glucose_unit_mmol/l"):a("glucose_unit_mg/dl");return M.useEffect(()=>{const e=t?setInterval(()=>{v(Jq(u,g))},NL.Milliseconds.Minute):null;return()=>{var t;(t=e)&&clearInterval(t)}},[t,u,g]),D.createElement(_a,{testID:S,style:[V6.wrapper,t&&_]},D.createElement(_a,{style:[V6.headerContainer,{backgroundColor:o.bgSecondary,borderColor:o.divider}]},D.createElement(gj,{style:V6.header},a("activity_card_title")),D.createElement(yh,{testID:`${w}-${t}`,value:t,onValueChange:()=>{r(h)},trackColor:{true:o.bgSliderForeground,false:o.bgSliderBackground},thumbColor:o.toggleKnob,activeThumbColor:o.bgSliderKnob,activeTrackColor:o.bgSliderForeground})),D.createElement(_a,{style:[V6.mainInfoCard,{backgroundColor:o.bgSecondary}]},D.createElement(_a,{style:V6.titleAndEditContainer},d&&D.createElement(_a,{style:V6.row},D.createElement(_a,{style:V6.mainInfo},D.createElement(gj,{style:V6.type,testID:`${w}-type`},eZ[d]()),c&&D.createElement(gj,{style:[V6.title,{color:o.labelSecondary}],testID:`${w}-title`},c)))),D.createElement(_a,{style:V6.intensityDuration},null!==f&&D.createElement(D.Fragment,null,D.createElement(gj,{style:[V6.intensityText,{color:o.labelPrimary}],testID:k},f)),D.createElement(_2,{color:o.labelPrimary}),D.createElement(gj,{style:[V6.durationText,{color:o.labelPrimary}],testID:`${w}-duration`},`${Qq(g)} ${a("activity_card__active_min")}`),D.createElement(eh,{onPress:()=>{i(h)},style:V6.editButton,testID:`${w}-edit-button`},D.createElement(i2,{color:o.iconBrand}))),t&&D.createElement(_a,{style:V6.secondaryInfoCard,testID:`${w}-reduction-card`},D.createElement(_a,{style:[V6.activityTimeContainer,{borderBottomColor:o.divider}]},D.createElement(_a,{style:V6.activeForContainer},D.createElement(B6,{isSpinning:t}),D.createElement(gj,{style:[V6.activeFor,{color:o.labelPrimary}]},a("activity_card__active_time")," ",y)),D.createElement(gj,{style:[V6.startingTimeText,{color:o.labelSecondary}],testID:`${w}-time`},a("activity_card__created_time",{dateLogged:m,timeLogged:p}))),!!b&&D.createElement(_a,null,D.createElement(gj,{style:[V6.reductionText,{color:o.labelSecondary}]},a("activity_card__reduction"),` ${b}%`),D.createElement(gj,{style:[V6.targetText,{color:o.labelSecondary}]},a("activity_card__reduction_more",{value:aZ(Uq.activity.target,NL.BloodGlucoseUnit.MMOL_L,Uq.glucoseUnit),displayUnit:C}))))))}const V6=Ei.create({wrapper:{marginBottom:32,borderRadius:16,overflow:"hidden"},headerContainer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:12,paddingHorizontal:16,borderBottomWidth:1},header:{...oj.medium_Base},mainInfoCard:{padding:16},titleAndEditContainer:{flexDirection:"row",justifyContent:"space-between",marginBottom:12},row:{flex:1,flexDirection:"row"},mainInfo:{flex:1,justifyContent:"center"},type:{...oj.semiBold_Base},title:{...oj.medium_Base},editButton:{flexDirection:"row",alignItems:"center",marginLeft:16},intensityDuration:{alignItems:"center",flexDirection:"row"},intensityText:{...oj.medium_Base,marginRight:16},durationText:{...oj.medium_Base,marginLeft:4},secondaryInfoCard:{paddingTop:24},activityTimeContainer:{borderBottomWidth:1,marginBottom:24},activeForContainer:{flexDirection:"row",marginBottom:2,alignItems:"center"},activeFor:{...oj.medium_SM,marginLeft:2},startingTimeText:{...oj.regular_SM,marginBottom:16},reductionText:{...oj.regular_SM,marginBottom:12},targetText:{...oj.regular_SM}}),H6=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{selectedEventUUID:n,activityStoreActions:i}=C2(),{navigate:r,addListener:a,removeListener:o}=Wp(),[s,l]=M.useState([]),[u,c]=M.useState(!1);M.useEffect(()=>{const e=()=>{const e=Dq.getActiveEvents();l(e)},t=Tu.addEventListener("change",t=>{"active"===t&&e()});return a("focus",e),()=>{o("focus",e),t.remove()}},[o,a]);const d=M.useCallback(e=>{const t=Dq.getByUUID(e);i.set({selectedEventUUID:n===e?null:e,activityDurationSeconds:n===e?0:t.durationSeconds})},[i,n]),h=e=>{const t=Dq.getByUUID(e);r(S2.AddActivity,{activity:t})};return D.createElement(D.Fragment,null,D.createElement(Xa,{contentContainerStyle:z6.scrollView},D.createElement(_a,null,D.createElement(_a,{style:z6.row},D.createElement(z1,{color:t.labelPrimary,width:24,height:24}),D.createElement(gj,{style:[z6.pageHeader,{color:t.labelPrimary}]},e("new_cal_activity_title"))),D.createElement(gj,{style:[z6.subheader,{color:t.labelSecondary},0===s.length&&z6.noActivities],onPress:()=>{c(!0)}},D.createElement(gj,{style:[z6.subheaderText,{color:t.labelSecondary}]},e("new_cal_current_activity_body")+" "),D.createElement(gj,{style:[z6.learnMore,{color:t.textLink}]},e("new_cal_current_activity_body_link")))),s.map((e,t)=>D.createElement(j6,{key:e.uuid,index:t,toggleActivitySwitch:d,isChecked:n===e.uuid,onEdit:h,activity:e})),D.createElement(mj,{type:0===s.length?dj.Primary:dj.Secondary,testID:"add-activity-button",title:0===s.length?e("new_cal_activity_button_add"):e("new_cal_activity_button_add_new"),onPress:()=>{r(S2.AddActivity)}})),D.createElement(lz,{isVisible:u,enableScroll:!0,buttons:[{title:e("button_close"),onPress:()=>{c(!1)},style:z6.modalButton}]},D.createElement(N6,null)))},z6=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16,paddingBottom:130},row:{flexDirection:"row",justifyContent:"center",alignItems:"center"},pageHeader:{...oj.semiBold_Base,marginLeft:4},noActivities:{marginBottom:128},subheader:{paddingHorizontal:16,textAlign:"center",marginBottom:32,marginTop:8},subheaderText:{...oj.regular_SM,textAlign:"center"},learnMore:{...oj.semiBold_SM},modalButton:{marginTop:32}});PX(NL.CONSTANTS.CARBOHYDRATES_INPUT_MIN,NL.CONSTANTS.CARBOHYDRATES_INPUT_MAX);const U6=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{cartItems:n,carbohydrateStoreActions:i}=TX(),{foodStoreActions:r}=O2(),a=Wp(),o=M.useCallback((e,t)=>{e?i.removeFromCart(e,"id"):i.removeFromCart(t,"title")},[i]),s=M.useCallback(e=>AX(e),[]),l=M.useCallback(e=>{r.set({selectedFoodItem:e}),a.navigate(S2.AddCarbs,{isCarbItem:!0})},[r,a]),u=M.useCallback(({item:n,index:i})=>{const{carbohydrates:r,id:a,title:u}=n.foodItem;return D.createElement(eh,{onPress:()=>{l(n.foodItem)},style:[G6.foodItem,{backgroundColor:t.bgInputActive}]},D.createElement(_a,{style:G6.left},D.createElement(gj,{numberOfLines:1,style:G6.title},u),D.createElement(gj,{style:[G6.weight,{color:t.labelSecondary}]},n.amount," ",e("food_card_unit"))),D.createElement(_a,{style:G6.right},D.createElement(gj,{style:[G6.value,{color:t.labelSecondary}],testID:`carbs-item-${i}-amount`},(n.amount/s(n.unit)*r).toFixed(0)," g "+e("new_cal_carbohydrates_input_unit")),D.createElement(_a,{style:G6.separator}),D.createElement(eh,{onPress:()=>{o(a,u)},testID:`carbs-item-${i}-remove-icon`},D.createElement(Q1,null))))},[t.bgInputActive,t.labelSecondary,e,s,l,o]),c=M.useCallback((e,t)=>e.foodItem.id?e.foodItem.id.toString():`${t}-${e.foodItem.title}`,[]);return D.createElement(Wo,{data:n,renderItem:u,keyExtractor:c,contentContainerStyle:G6.container,showsVerticalScrollIndicator:!1})},G6=Ei.create({container:{gap:8},foodItem:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:8,padding:16,borderRadius:16},title:{...oj.medium_Base,paddingBottom:4},weight:{...oj.regular_SM},left:{flexShrink:1},right:{alignSelf:"flex-start",alignItems:"center",flexDirection:"row"},value:{textAlign:"right",marginRight:4},separator:{width:1,height:20,marginHorizontal:12}}),{max:W6,min:Y6}={min:NL.CONSTANTS.CARBOHYDRATES_INPUT_MIN,max:NL.CONSTANTS.CARBOHYDRATES_INPUT_MAX},$6=uV&&{outline:"none"},X6=()=>{const{flagsStoreActions:e}=mL(),{t:t}=iV(),{COLORS:n}=bL(),{totalCarbsCartItems:i,manualCarbsInput:r,carbohydrateStoreActions:a}=TX(),{dispatch:o,addListener:s,removeListener:l,navigate:u}=Wp(),{height:c}=vm(),d=M.useMemo(()=>c<=667,[c]),h=M.useRef(null),[m,p]=M.useState(!1),[f,_]=M.useState(r.toString()),[g,y]=M.useState(!1),[v,b]=M.useState(!1);M.useEffect(()=>{uV&&e.set({isCalculationTabBarHidden:m})},[e,m]);const S=M.useCallback(()=>{i+r>300&&b(!0)},[r,i]),w=M.useCallback(()=>{window.setTimeout(()=>{window.scrollTo({top:0,left:0,behavior:"smooth"})},100)},[]),k=M.useCallback(()=>{window.visualViewport?.addEventListener("resize",w),S()},[S,w]),C=M.useCallback(()=>{window.visualViewport?.removeEventListener("resize",w)},[w]);M.useEffect(()=>(s("focus",k),s("blur",C),()=>{l("focus",k),l("blur",C)}),[s,l,C,k]);const E=()=>{if(p(!1),""===f)return a.setManualCarbsInput(0),void _("0");const e=Number(f);return!isNaN(e)&&e>=Y6?e>W6?(_(r.toString()),void b(!0)):(a.setManualCarbsInput(e),_(e.toString()),void jX(FX.CarbsManualInput)):(_(r.toString()),void y(!0))};return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"carbs-screen-scroll",scrollEventThrottle:8,contentContainerStyle:q6.scrollView},D.createElement(_a,{style:d?q6.smallScreenHeaderContainer:q6.headerContainer},D.createElement(_a,{style:q6.row},D.createElement(W1,{color:n.labelPrimary}),D.createElement(gj,{style:[q6.pageHeader,{color:n.labelPrimary}]},t("new_cal_carbohydrates_title"))),D.createElement(gj,{style:[q6.subheader,{color:n.labelSecondary}]},t("new_cal_carbohydrates_body"))),D.createElement(kj,{renderLeftSlot:()=>D.createElement(gj,{testID:"carbs-input-unit"},t("new_cal_carbohydrates_input_entry")),renderRightSlot:()=>D.createElement(_a,{style:q6.inputRow},D.createElement(s0,{testID:"carbs-input",placeholder:"0",value:f,onChangeText:_,onBlur:E,style:[q6.numberInput,{color:n.labelSecondary}],ref:h,selectTextOnFocus:!0}),D.createElement(_a,{style:q6.rightSlotNumberInput},D.createElement(gj,{style:[q6.unit,{color:n.labelSecondary}]},t("my_food_add_unit")),D.createElement(_a,{style:[q6.separator,{backgroundColor:n.divider}]}),D.createElement(i2,null))),onPress:()=>{p(!0),h.current?.focus()},style:{...q6.groupedRow,...m&&{borderColor:n.borderInputFocus}}}),D.createElement(U6,null),D.createElement(mj,{type:dj.Secondary,title:t("new_cal_carbohydrates_button_add_food"),testID:"add-food-from-library-button",onPress:()=>{uV?u(S2.FoodLibrary,{comingFrom:S2.CarbsTab}):o(wm(S2.FoodLibraryStack,{comingFrom:S2.CarbsTab}))},style:q6.button}),D.createElement(lz,{isVisible:g,title:t("current_glucose_invalid_modal_title"),message:t("current_glucose_invalid_modal_body"),buttons:[{testID:"close-button",title:t("button_close"),onPress:()=>{y(!1)}}]}),D.createElement(lz,{isVisible:v,title:t("current_glucose_invalid_modal_title"),message:t("current_glucose_invalid_modal_body"),buttons:[{title:t("button_close"),onPress:()=>{b(!1)}}]})),D.createElement(_a,{style:q6.totalWrapper},D.createElement(fj,null)),D.createElement(_a,{style:d?q6.smallScreenTotalContainer:q6.totalContainer},D.createElement(gj,{style:q6.totalTitle},t("new_cal_carbohydrates_total_entry")),D.createElement(_a,{style:q6.totalGramsContainer},D.createElement(gj,{style:q6.totalValue,testID:"total-carbs-value"},i+r),D.createElement(gj,{style:q6.totalUnits,testID:"total-carbs-unit"},t("my_food_add_unit")))))},q6=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16},row:{flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center"},inputRow:{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:4},headerContainer:{marginBottom:112},smallScreenHeaderContainer:{marginBottom:32},pageHeader:{...oj.semiBold_Base,marginLeft:4},subheader:{...oj.regular_SM,textAlign:"center",marginTop:8,marginHorizontal:16},groupedRow:{marginBottom:16,flexWrap:"wrap",justifyContent:"space-between"},separator:{width:1,height:20,marginHorizontal:12},unit:{...oj.regular_Base},numberInput:{...oj.regular_Base,textAlign:"right",lineHeight:22,padding:0,maxWidth:40,fontFamily:cV?aj.RobotoRegular:aj.PoppinsRegular,...$6},rightSlotNumberInput:{flexDirection:"row",alignItems:"center"},totalWrapper:{marginHorizontal:16},totalContainer:{flexDirection:"row",justifyContent:"space-between",alignItems:"baseline",paddingVertical:32,paddingBottom:16,marginHorizontal:16,gap:8,flexWrap:"wrap"},smallScreenTotalContainer:{flexDirection:"row",justifyContent:"space-between",alignItems:"baseline",paddingVertical:16,paddingBottom:16,marginHorizontal:16,gap:8,flexWrap:"wrap"},totalTitle:{...oj.medium_SM},totalGramsContainer:{flexDirection:"row",alignItems:"baseline"},totalValue:{...oj.bold_4XL},totalUnits:{...oj.bold_2XL,marginLeft:8},button:{marginHorizontal:"auto",marginTop:32}});var Z6=(e=>(e.Add="Add",e.Sync="Sync",e.SyncSpinner="SyncSpinner",e.Edit="Edit",e.Done="Done",e))(Z6||{});const K6=({title:e,subtitle:t,children:n,icon:i,leftIcon:r,onPressCard:a,onPressIcon:o})=>{const{COLORS:s}=bL(),l=M.useMemo(()=>"SyncSpinner"===i,[i]);return D.createElement(eh,{style:({pressed:e})=>[Q6.container,{backgroundColor:s.bgSecondary,opacity:e?.5:1}],onPress:a,disabled:!a},r&&D.createElement(_a,{style:Q6.leftIconContainer},r),D.createElement(_a,{style:Q6.textContainer},D.createElement(gj,{style:Q6.title},e),n,!!t&&D.createElement(gj,{style:[Q6.subtitle,{color:s.labelSecondary}]},t)),D.createElement(eh,{style:({pressed:e})=>[Q6.iconContainer,{backgroundColor:s.bgTertiary,opacity:e?.5:1}],onPress:()=>{o&&o()},hitSlop:20,disabled:!o},"Add"===i&&D.createElement(U1,{width:32,height:32}),"Edit"===i&&D.createElement(i2,{width:32,height:32}),"Sync"===i&&D.createElement(h2,{height:32,width:32}),"SyncSpinner"===i&&D.createElement(B6,{isSpinning:l,height:32,width:32}),"Done"===i&&D.createElement($1,{width:32,height:32})))},Q6=Ei.create({container:{flexDirection:"row",justifyContent:"space-between",padding:16,borderRadius:16},textContainer:{flex:1},title:{...oj.semiBold_Base,marginBottom:4},subtitle:{...oj.regular_XS},iconContainer:{alignSelf:"center",justifyContent:"center",padding:6,borderRadius:16,marginLeft:16},leftIconContainer:{marginRight:2}}),J6=uV?{outline:"none"}:{};function e7({value:e,unit:t,editable:n=!0,onChange:i,onPress:r,onBlur:a,testID:o,ref:s,leftIcon:l}){const{t:u}=iV(),{COLORS:c}=bL(),{flagsStoreActions:d}=mL(),{height:h}=vm(),m=M.useMemo(()=>h<667,[h]),[p,f]=M.useState(!1),_=M.useRef(null);M.useImperativeHandle(s,()=>({focus:()=>{setTimeout(()=>{_.current?.focus(),uV&&d.set({isCalculationTabBarHidden:!0})},100)}}),[d]);const g=M.useCallback(()=>{f(!0),uV&&d.set({isCalculationTabBarHidden:!0})},[d]),y=M.useCallback(()=>{f(!1),a?.(),uV&&d.set({isCalculationTabBarHidden:!1})},[d,a]),v=M.useCallback(()=>{n?_.current?.focus():r?.()},[r,n]);return D.createElement(_a,{style:m?t7.smallScreenContainer:t7.container},D.createElement(eh,{onPress:v,style:t7.input,pointerEvents:"box-only"},l&&D.createElement(_a,{style:t7.leftIconContainer},l),D.createElement(kh,{ref:_,value:e,onChangeText:i,placeholder:p?"":u("bolus_glucose_enter_input"),onBlur:y,onFocus:g,style:[{...t7.textInput,...J6,color:c.labelPrimary},p||e?{...oj.bold_4XL}:{...oj.semiBold_2XL},cV&&!p&&!e&&{paddingTop:16}],placeholderTextColor:c.labelSecondary,cursorColor:c.iconBrand,enterKeyHint:"done",inputMode:"decimal",autoCorrect:!1,maxLength:4,maxFontSizeMultiplier:sj,multiline:!1,numberOfLines:1,selectTextOnFocus:!0,testID:o}),D.createElement(_a,{style:t7.unitContainer},D.createElement(gj,{style:[t7.unitText,{color:p?c.labelPrimary:c.labelSecondary}],maxFontSizeMultiplier:sj},t))),D.createElement(_a,{style:[t7.animationContainer,{backgroundColor:c.bgBrand}]}))}const t7=Ei.create({container:{paddingHorizontal:40,marginBottom:64},smallScreenContainer:{paddingHorizontal:20,marginBottom:32},input:{flexDirection:"row",alignItems:"center",height:62,justifyContent:"center"},textInput:{paddingTop:0,paddingBottom:0,flex:1,textAlign:"right",verticalAlign:"middle",width:"100%"},unitContainer:{marginLeft:8,flex:1},unitText:{...oj.semiBold_2XL},animationContainer:{height:4,width:"100%",borderRadius:2},leftIconContainer:{position:"absolute",left:15}});const{HEDIA_API_URL_V2:n7,NODE_ENV:i7}={HEDIA_API_URL_V2:"/api/v2"},r7=e=>({id:e.id,object_id:e.id,user_id:e.userId,type:e.type,quantity:{unit:e.quantity.unit.toLowerCase(),value:e.quantity.value},timestamp:new Date(e.startDate),source_id:e.source.id,device_name:e.device.name,source_name:e.source.name});const a7=Ei.create({scrollView:{paddingTop:32,paddingHorizontal:16,paddingBottom:130},headerContainer:{marginBottom:112},smallScreenHeaderContainer:{marginBottom:32},row:{flexDirection:"row",justifyContent:"center",alignItems:"center"},pageHeader:{...oj.semiBold_Base,marginLeft:4},subheader:{...oj.regular_SM,textAlign:"center",marginTop:8,marginHorizontal:16},noReadingsContainer:{padding:16,borderRadius:16},noMeasurements:{...oj.regular_XS,textAlign:"center",marginBottom:8},buttonText:{...oj.semiBold_SM,textAlign:"center"},card:{flexDirection:"row"},valueContainer:{paddingRight:8,borderRightWidth:1,marginBottom:4},value:{...oj.medium_XS},crossedOut:{textDecorationLine:"line-through"},time:{...oj.regular_XS,marginLeft:8}}),o7=iF(function(){const{t:e}=iV(),{COLORS:t}=bL(),n=Wp(),i=df(),{activityStoreActions:r}=C2(),{glucoseStoreActions:a}=F2(),o=(s="external",F2(e=>e.availableGlucoseReadings.find(e=>e.source===s)||null));var s;const l=y5(),{height:u}=vm(),c=M.useMemo(()=>u<667,[u]),{glucoseUnit:d,activity:h}=Uq;if(void 0===d)throw new Error("[Glucose::render] glucoseUnit must be non-undefined.");const{decimalPlaces:m,inputMax:p,inputMin:f,text:_}=M.useMemo(()=>Kq(d),[d]),[g,y]=M.useState(""),[v,b]=M.useState(!1),[S,w]=M.useState(!1),[k,C]=M.useState(!1),[E,I]=M.useState(!1),[x,T]=M.useState(!1),[O,R]=M.useState(!1),[A,L]=M.useState(!1),[P,N]=M.useState(!1),[F,B]=M.useState(""),[j,V]=M.useState(""),H=M.useRef(null),z=M.useCallback(()=>{window.setTimeout(()=>{window.scrollTo({top:0,left:0,behavior:"smooth"})},100)},[]),U=M.useCallback(()=>{window.visualViewport?.addEventListener("resize",z)},[z]),G=M.useCallback(()=>{window.visualViewport?.removeEventListener("resize",z)},[z]),W=M.useCallback(()=>{a.setSelectedReadingId(null)},[a]);M.useEffect(()=>(n.addListener("focus",U),n.addListener("blur",G),()=>{n.removeListener("focus",U),n.removeListener("blur",G)}),[n,G,U]),Yp(M.useCallback(()=>{const e=()=>{const e=l?.timestamp;e&&Date.now()-e>10*NL.Milliseconds.Minute?(I(!0),y("")):I(!1)};e();const t=setInterval(e,1e3);return()=>{clearInterval(t)}},[l]));const Y=M.useCallback(()=>{if(o){const t=Date.now()-o.timestamp>10*NL.Milliseconds.Minute,n=_Y(new Date,o.timestamp).toString();V(e("imprted_device_card_time",{min:n}));const i=function(e,t,n){const i=Kq(n).text;return`${aZ(e,t,n)} ${i}`}(o.value,o.unit,d);B(t?e("imprted_device_card_unit"):i),N(t)}},[d,o,e]);M.useEffect(()=>{Y()},[Y]),function(e,t){const n=M.useRef(void 0);M.useLayoutEffect(()=>{n.current=e},[e]),M.useEffect(()=>{const e=setInterval(function(){n.current&&n.current()},t);return()=>{clearInterval(e)}},[t])}(Y,1e3),M.useEffect(()=>{i.params?.editGlucose&&(y(""),H.current?.focus())},[i.params?.editGlucose]),M.useEffect(()=>{null===l&&y("")},[l]),M.useEffect(()=>{(async()=>{try{L(!0);const e=await VX(`${n7}/samples`);if(!e.ok)throw new Error("[Glucose::getSamples] response status not OK");const t=await e.json();if(t.length>0){const e=t.map(r7),n=e.filter(e=>"HDA"!==e.source_name&&e.timestamp.getTime()<=(new Date).getTime()).sort((e,t)=>t.timestamp.getTime()-e.timestamp.getTime());if(n.length>0){const e=n[0],{unit:t,value:i}=e.quantity,{inputMax:r,inputMin:o}=Kq(t);if(i>=o&&i<=r){const n={id:RX(),source:"external",value:i,unit:t,sampleId:e.id,sourceId:e.source_id,sourceName:e.source_name,deviceName:e.device_name,timestamp:e.timestamp.getTime()};a.addAvailableGlucoseReading(n),a.setSelectedReadingId(n.id),(e=>{const{id:t,isTester:n,country:i,uuid:r,timestamp:a,timezone:o,platform:s}=BX(),l={uuid:r,timestamp:a,timezone:o,type:"integration.service.transfer",data:{version:NX,platform:s,source:{sourceID:e.source_id,deviceName:e.device_name,sourceName:e.source_name},reading:{type:e.type,value:e.quantity.value,unit:e.quantity.unit},geo:{country:i},user:{id:t,isTester:n}}};qW.update(l),qW.sync().catch(console.error)})(e)}else a.setSelectedReadingId(null)}}}finally{L(!1)}})().catch(console.error)},[a]),M.useEffect(()=>{if("external"===l?.source&&o){const e=aZ(o.value,o.unit,d);y(e)}},[d,l,o]),M.useEffect(()=>{const e=Dq.getEventWithHighestReduction(h);r.set({selectedEventUUID:e?.uuid??null,activityDurationSeconds:e?.durationSeconds??0})},[h,r]);const $=M.useCallback(()=>{if(""===g)return void W();if(o&&!P){const e=aZ(o.value,o.unit,d);if(g===e)return void a.setSelectedReadingId(o.id)}const e=parseFloat(g);if(!(!isNaN(e)&&e>=f&&e<=p)){const e=l&&aZ(l.value,l.unit,d);return y(e||""),void b(!0)}const t={id:RX(),source:"manual",value:e,unit:d,timestamp:Date.now()};a.addAvailableGlucoseReading(t),a.setSelectedReadingId(t.id),y(e.toFixed(m))},[W,m,g,l,d,p,f,a,P,o]),X=M.useCallback(()=>{"external"===l?.source?C(!0):H.current?.focus()},[l]),q=M.useCallback(()=>{O&&(W(),C(!1),H.current?.focus(),R(!1))},[W,O]),Z=M.useCallback(()=>{R(!0),C(!1)},[]),K=M.useCallback(()=>{w(!0)},[]),Q=M.useCallback(()=>{!P&&o&&a.setSelectedReadingId(o.id)},[P,a,o]),J=M.useCallback(()=>{W(),I(!1)},[W]),ee=M.useCallback(()=>{W(),I(!1),T(!0)},[W]),te=M.useCallback(()=>{x&&H.current?.focus(),T(!1)},[H,x]),ne=M.useCallback(e=>{y(e.replace(",","."))},[]),ie=M.useCallback(()=>{const e={id:"TEST",timestamp:new Date(Date.now()-(4*Math.random()+5)*NL.Milliseconds.Minute),source_id:"TEST",quantity:{unit:NL.BloodGlucoseUnit.MMOL_L,value:Math.random()*(33.3-1.1)+1.1},source_name:"HDA Test Name",device_name:"HDA Test Device"},t={id:RX(),source:"external",value:e.quantity.value,unit:e.quantity.unit,timestamp:e.timestamp.getTime(),sampleId:e.id,sourceId:e.source_id,sourceName:e.source_name,deviceName:e.device_name};a.addAvailableGlucoseReading(t),a.setSelectedReadingId(t.id)},[a]),re=M.useMemo(()=>"external"!==l?.source&&!P,[P,l]);return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"bg-scroll-view",scrollEventThrottle:8,contentContainerStyle:a7.scrollView},D.createElement(_a,{style:c?a7.smallScreenHeaderContainer:a7.headerContainer},D.createElement(_a,{style:a7.row},D.createElement(n2,{color:t.labelPrimary,width:24,height:24}),D.createElement(gj,{style:[a7.pageHeader,{color:t.labelPrimary}]},e("new_cal_current_glucose_title"))),D.createElement(gj,{style:[a7.subheader,{color:t.labelSecondary}]},e("new_cal_glucose_body"))),D.createElement(e7,{ref:H,value:g,unit:_,onChange:ne,onPress:X,onBlur:$,editable:!("external"===l?.source||A)}),o&&"external"===o.source?D.createElement(K6,{title:o.deviceName,subtitle:e("from_source",{source:o.sourceName}),icon:"external"===l?.source?Z6.Done:Z6.Sync,onPressCard:"external"===l?.source?void 0:Q},D.createElement(_a,{style:a7.card},D.createElement(_a,{style:[a7.valueContainer,{borderRightColor:t.divider}]},D.createElement(gj,{style:[a7.value,re&&a7.crossedOut,re&&{color:t.labelSecondary},P&&{color:t.textWarning}]},F)),D.createElement(gj,{style:[a7.time,{color:t.labelSecondary}]},j))):D.createElement(eh,{style:[a7.noReadingsContainer,{backgroundColor:t.bgInputActive}],onPress:K,onLongPress:()=>{"production"!==i7&&ie()}},D.createElement(gj,{style:[a7.noMeasurements,{color:t.labelPrimary}]},e("bg_device_no_measurement")),D.createElement(gj,{style:[a7.buttonText,{color:t.labelBrand}]},e("bg_device_no_measurement_body")))),D.createElement(lz,{isVisible:v,title:e("current_glucose_invalid_high_modal_title",{min:rZ(f,d),max:rZ(p,d)}),buttons:[{testID:"close-button",title:e("button_close"),onPress:()=>{b(!1)}}]}),D.createElement(lz,{isVisible:S,title:e("import_modal_reading_title"),message:e("import_modal_reading_body"),buttons:[{testID:"close-button",title:e("button_close"),onPress:()=>{w(!1)}}]}),D.createElement(lz,{isVisible:k,title:e("new_cal_modal_change_synced_value_title"),onModalHide:q,buttons:[{testID:"change-button",type:dj.Error,title:e("new_cal_modal_change_synced_value_danger_button"),onPress:Z},{testID:"keep-button",type:dj.Secondary,title:e("new_cal_modal_change_synced_value_button"),onPress:()=>{C(!1)}}]}),D.createElement(lz,{isVisible:E,title:e("new_cal_summary_modal_expire_title"),message:e("new_cal_summary_modal_expire_body"),icon:n2,onModalHide:te,onModalShow:()=>{jX(FX.ExpiredGlucose)},buttons:[{title:e("new_cal_summary_modal_expire_button_edit"),onPress:ee},{title:e("button_cancel"),type:dj.Secondary,onPress:J}]}))}),s7=uV?56:48,l7=({onCompleteSwipe:e,testID:t,ref:n})=>{const{t:i}=iV(),{COLORS:r}=bL(),{width:a}=vm(),o=M.useMemo(()=>a-32-64,[a]),s=M.useMemo(()=>o-s7-(uV?3:12),[o]),l=uR(0),u=uR(o);M.useEffect(()=>{u.value=o},[o,u]);const[c,d]=M.useState(0);M.useImperativeHandle(n,()=>({reset:()=>{l.value=aI(100,NE(0)),u.value=aI(100,NE(o))}}));const h=iL.Pan().onUpdate(e=>{const t=Math.max(0,Math.min(e.translationX,s));l.value=t,u.value=o-t}).onEnd(()=>{l.value>=1*s?zk(e)():(l.value=uI(0),u.value=uI(o))}),m=pR(()=>({width:u.value}),[u]);return D.createElement(BR.View,{style:[u7.container,m,{backgroundColor:r.bgSliderCalculator}]},D.createElement(BA,{gesture:h},D.createElement(_a,{style:u7.iconContainer},D.createElement(f2,{testID:t}),D.createElement(gj,{style:[u7.text,{color:r.textSlider,left:(o-c)/2}],onLayout:e=>{const{width:t}=e.nativeEvent.layout;0===c&&d(t)}},i("new_cal_summary_calculate_slider")))))};l7.displayName="SwipeButton";const u7=Ei.create({container:{justifyContent:"center",alignSelf:"flex-end",marginHorizontal:16,borderRadius:42,height:58,shadowOpacity:.12,shadowRadius:8,elevation:6},iconContainer:{alignItems:"center",flexDirection:"row",overflow:"hidden",marginHorizontal:6},text:{position:"absolute",...oj.medium_LG}});const c7=Ei.create({scrollView:{paddingTop:32,paddingHorizontal:32,paddingBottom:130},headerContainer:{flexDirection:"row",gap:4,alignItems:"center",justifyContent:"center",paddingBottom:32},headerText:{...oj.semiBold_Base},invisibleCalculateButton:{position:"absolute",top:0,right:0,width:0,height:0,opacity:0},listItemContainer:{paddingVertical:16,paddingHorizontal:16},listItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},listItemLeft:{flexDirection:"row",alignItems:"center"},listItemRight:{alignItems:"flex-end"},listItemTitle:{...oj.regular_SM,marginLeft:8},listItemValue:{...oj.bold_2XL},listItemUnit:{...oj.regular_SM},separatorLine:{width:"100%",height:1},activityIntensityContainer:{alignSelf:"flex-end",paddingHorizontal:12,paddingVertical:8,borderRadius:40,justifyContent:"center",alignItems:"center",marginTop:4},activityIntensityText:{...oj.regular_XS},swipeContainer:{marginTop:64,justifyContent:"center"},smallScreenSwipeContainer:{marginTop:32,justifyContent:"center"},forecastContainer:{flexDirection:"row",alignItems:"center"},forecastIcon:{marginRight:8}}),d7=iF(function(){const{t:e}=iV(),{COLORS:t}=bL(),{navigate:n}=Wp(),i=df(),{height:r}=vm(),a=M.useMemo(()=>r<667,[r]),{glucoseStoreActions:o}=F2(),s=y5(),{manualCarbsInput:l,totalCarbsCartItems:u}=TX(),{selectedEventUUID:c}=C2(),{glucoseUnit:d,activity:h}=Uq;if(void 0===d)throw new Error("[Summary::render] glucoseUnit is undefined");if(void 0===h)throw new Error("[Summary::render] activity is undefined");const m=M.useRef(null),[p,f]=M.useState(!1),[_,g]=M.useState(null),[y,v]=M.useState(!1),[b,S]=M.useState(!1),[w,k]=M.useState(!1),[C,E]=M.useState(!1),I=M.useRef(new uu.Value(0)).current,x=M.useRef(new uu.Value(.8)).current;Yp(M.useCallback(()=>{I.setValue(0),x.setValue(.8),uu.parallel([uu.timing(I,{toValue:1,duration:200,useNativeDriver:!uV,easing:Xl.in(Xl.linear)}),uu.timing(x,{toValue:1,duration:200,useNativeDriver:!uV,easing:Xl.in(Xl.linear)})]).start()},[I,x])),M.useEffect(()=>{const e=()=>{const e=s?.timestamp;e&&Date.now()-e>10*NL.Milliseconds.Minute?(f(!0),o.setSelectedReadingId(null)):f(!1)};e();const t=setInterval(e,1e3);return()=>{clearInterval(t)}},[o,s]);const T=M.useMemo(()=>c?Dq.getByUUID(c):null,[c]),O=M.useCallback(()=>p?(jX(FX.SummaryExpiredGlucose),void k(!0)):null===s?(jX(FX.SummaryEmptyGlucose),void v(!0)):void n(S2.LoadingRecommendation),[s,p,n]);M.useEffect(()=>{i.params?.errorType&&(g(i.params.errorType),m.current?.reset())},[i.params]);const{glucoseDisplayValue:R,glucoseDisplayUnit:A}=M.useMemo(()=>p?{glucoseDisplayValue:null,glucoseDisplayUnit:e("new_cal_summary_expired")}:null!==s?{glucoseDisplayValue:aZ(s.value,s.unit,d),glucoseDisplayUnit:Kq(d).text}:{glucoseDisplayValue:null,glucoseDisplayUnit:"-"},[s,d,p,e]),{activityIntervalDisplay:L,activityIntensityDisplay:P}=M.useMemo(()=>{if(T?.durationSeconds&&T.startTimestamp){return{activityIntervalDisplay:Qq(Math.round(T.durationSeconds/60)),activityIntensityDisplay:T.activityIntensity?tZ[T.activityIntensity]():null}}return{activityIntervalDisplay:null,activityIntensityDisplay:null}},[T]),N=M.useMemo(()=>i.params?.errorType===rV.Sync,[i.params]);return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"summary-scroll-view",scrollEventThrottle:8,contentContainerStyle:c7.scrollView},uV&&D.createElement(eh,{testID:"invisible-calculate-button",onPress:O,style:c7.invisibleCalculateButton}),D.createElement(_a,{style:c7.headerContainer},D.createElement(a2,null),D.createElement(gj,{style:[c7.headerText,{color:t.labelPrimary}]},e("new_cal_summary_title"))),D.createElement(uu.View,{style:{opacity:I,transform:[{scale:x}]}},D.createElement(_a,{style:[c7.listItemContainer,c7.listItem]},D.createElement(_a,{style:c7.listItemLeft},D.createElement(n2,{color:t.labelPrimary,height:24,width:24}),D.createElement(gj,{style:c7.listItemTitle},e("new_cal_summary_glucose_title"))),D.createElement(_a,{style:c7.listItemRight},D.createElement(_a,{style:c7.forecastContainer},"forecast"===s?.source&&D.createElement(s2,{width:20,height:20,style:c7.forecastIcon}),null!==R&&D.createElement(gj,{style:c7.listItemValue},R)),D.createElement(gj,{style:c7.listItemUnit},A))),D.createElement(_a,{style:[c7.separatorLine,{backgroundColor:t.divider}]}),D.createElement(_a,{style:[c7.listItemContainer,c7.listItem]},D.createElement(_a,{style:c7.listItemLeft},D.createElement(W1,{color:t.labelPrimary,height:24,width:24}),D.createElement(gj,{style:c7.listItemTitle},e("new_cal_summary_carb_title"))),D.createElement(_a,{style:c7.listItemRight},D.createElement(gj,{style:c7.listItemValue},Math.round(l+u)),D.createElement(gj,{style:c7.listItemUnit},e("logbook_collum_unit")))),D.createElement(_a,{style:[c7.separatorLine,{backgroundColor:t.divider}]}),D.createElement(_a,{style:c7.listItemContainer},D.createElement(_a,{style:c7.listItem},D.createElement(_a,{style:c7.listItemLeft},D.createElement(e2,null),D.createElement(gj,{style:c7.listItemTitle},e("new_cal_summary_activity_title"))),D.createElement(_a,{style:c7.listItemRight},null!==L&&D.createElement(gj,{style:c7.listItemValue},L),D.createElement(gj,{style:c7.listItemUnit},null!==L?e("new_cal_summary_activity_unit"):"-"))),null!==P&&D.createElement(_a,{style:[c7.activityIntensityContainer,{backgroundColor:t.bgSecondary}]},D.createElement(gj,{style:c7.activityIntensityText},P)))),D.createElement(_a,{style:a?c7.smallScreenSwipeContainer:c7.swipeContainer},D.createElement(l7,{ref:m,onCompleteSwipe:O,testID:"calculate-swipe-button"}))),D.createElement(lz,{isVisible:null!==_,icon:N?c2:void 0,title:e(N?"recommendation_no_save_modal_title":"rejected_input_modal_title"),message:e(N?"recommendation_no_save_modal_body":"rejected_input_modal_body"),buttons:[{title:e("button_close"),onPress:()=>{g(null)}}]}),D.createElement(lz,{isVisible:y,title:e("new_cal_summary_modal_enter_glucose_title"),message:e("new_cal_summary_modal_enter_glucose_body"),icon:n2,onModalHide:()=>{m.current?.reset(),b&&n(S2.GlucoseTab,{editGlucose:RX()}),S(!1)},buttons:[{title:e("new_cal_summary_modal_enter_glucose_button_add"),onPress:()=>{S(!0),v(!1)}},{title:e("button_cancel"),type:dj.Secondary,onPress:()=>{v(!1)}}]}),D.createElement(lz,{isVisible:w,title:e("new_cal_summary_modal_expire_title"),message:e("new_cal_summary_modal_expire_body"),icon:n2,onModalHide:()=>{m.current?.reset(),o.setSelectedReadingId(null),C&&n(S2.GlucoseTab,{editGlucose:RX()}),C&&f(!1),E(!1)},buttons:[{title:e("new_cal_summary_modal_expire_button_edit"),onPress:()=>{E(!0),k(!1)}},{title:e("button_cancel"),type:dj.Secondary,onPress:()=>{k(!1)}}]}))}),h7=e=>d.jsx(D6,{...e}),m7=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{Navigator:n,Screen:i}=p6();return d.jsxs(n,{screenOptions:{...r0,headerStyle:{backgroundColor:t.bgNavigationBar},tabBarHideOnKeyboard:!0,title:e("new_calculation_navigation")},backBehavior:"none",tabBar:h7,children:[d.jsx(i,{name:S2.GlucoseTab,component:o7}),d.jsx(i,{name:S2.CarbsTab,component:X6}),d.jsx(i,{name:S2.ActivityTab,component:H6}),d.jsx(i,{name:S2.SummaryTab,component:d7})]})};function p7(){const{t:e}=iV(),{COLORS:t}=bL(),{Navigator:n,Screen:i}=ZQ();return d.jsxs(n,{screenOptions:{headerShown:!1,...BZ},children:[d.jsx(i,{name:S2.ActiveInsulin,component:U5,options:{...n0,headerStyle:{backgroundColor:t.bgSheet},headerLeft:()=>null,headerRight:q2,title:e("new_calculation_navigation")}}),d.jsx(i,{name:S2.RegisterActiveInsulin,component:H5,options:{...i0,headerStyle:{backgroundColor:t.bgSheet},headerLeft:K2,title:e("recent_insulin_navigation_title"),...YZ}}),d.jsx(i,{name:S2.CalculationBottomTabs,component:m7}),d.jsx(i,{name:S2.LoadingRecommendation,component:k5}),d.jsx(i,{name:S2.Recommendation,component:E5,options:{...n0,headerStyle:{backgroundColor:t.bgSheet},headerShown:!1}}),d.jsx(i,{name:S2.LeavingRecommendation,component:D3})]})}const f7=MX(NL.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MIN,NL.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MAX),_7=PX(90,250),g7={fromZero:1,fromThirty:.75,fromFortysix:.5,fromSixtyone:null},y7={fromZero:1,fromThirty:.5,fromFortysix:.25,fromSixtyone:null},v7={fromZero:1,fromThirty:.25,fromFortysix:null,fromSixtyone:null},b7={fromZero:1,fromThirty:.5,fromFortysix:.5,fromSixtyone:null};function S7(){return{target:8,light:g7,moderate:y7,hard:v7,post:b7}}const w7=({text:e,learnMoreText:t,learnMoreOnPress:n})=>{const{t:i}=iV(),{COLORS:r}=bL();return M.createElement(_a,{style:[k7.card,{backgroundColor:r.bgSecondary}]},M.createElement(b2,null),M.createElement(_a,{style:k7.rightContainer},M.createElement(gj,{style:[k7.contactText,{color:r.labelPrimary}]},e??i("warning_HCP")),void 0!==t&&void 0!==n&&M.createElement(xc,{onPress:n,style:k7.learnMoreContainer},M.createElement(gj,{style:[k7.learnMoreText,{color:r.textLink}]},t))))},k7=Ei.create({card:{borderRadius:16,paddingHorizontal:16,paddingVertical:12,flexDirection:"row",gap:8},rightContainer:{flex:1,gap:8},learnMoreContainer:{flexDirection:"row",alignItems:"center",gap:4},contactText:{flexShrink:1,...oj.medium_SM},learnMoreText:{flexShrink:1,...oj.semiBold_SM}});function C7({columnDisposition:e,disabled:t=!1,testID:n,children:i,style:r}){const{COLORS:a}=bL();return D.createElement(_a,{testID:n,style:[E7.row,t&&E7.disabledRow,{backgroundColor:a.bgTableOdd},r]},D.Children.map(i,(n,i)=>D.isValidElement(n)?D.cloneElement(n,{disabled:t,cellRatio:e?e[i]:void 0}):null))}const E7=Ei.create({row:{flexDirection:"row",justifyContent:"space-between"},disabledRow:{opacity:.5}});function I7({index:e,columnDisposition:t,disabled:n=!1,testID:i,children:r,style:a}){const{COLORS:o}=bL(),s=M.useCallback(e=>void 0!==e&&e%2?o.bgTableOdd:o.bgTableEven,[o]);return D.createElement(_a,{testID:i,style:[x7.row,{backgroundColor:s(e)},a]},D.Children.map(r,(e,i)=>D.isValidElement(e)?D.cloneElement(e,{disabled:n,cellRatio:t?t[i]:void 0}):null))}const x7=Ei.create({row:{flexDirection:"row",justifyContent:"space-between"}});function T7({columnDisposition:e,disabled:t=!1,testID:n,children:i,style:r}){const{COLORS:a}=bL();return D.createElement(_a,{testID:n,style:[O7.table,{backgroundColor:a.bgSecondary,borderWidth:1,borderColor:a.divider},t&&{backgroundColor:a.bgButtonSecondaryDangerDisabled},r]},(()=>{let n=0;return D.Children.map(i,i=>{if(D.isValidElement(i)){if(i.type===C7){const n=i;return D.cloneElement(n,{disabled:n.props.disabled??t,columnDisposition:e})}if(i.type===I7){const r=i,a=D.cloneElement(r,{disabled:r.props.disabled??t,index:n,columnDisposition:e});return n+=1,a}return D.cloneElement(i)}return null})})())}const O7=Ei.create({table:{borderRadius:16,overflow:"hidden"}});function R7({disabled:e=!1,onPress:t,testID:n,accessibilityLabel:i,accessibilityValue:r,cellRatio:a,children:o,style:s}){const{COLORS:l}=bL();return D.createElement(xc,{disabled:!t||e,onPress:t,style:[A7.cell,{flex:a??1,borderColor:l.divider},s],testID:n,accessibilityRole:"button",accessibilityHint:"Double-tap to set value",accessibilityState:{disabled:e},accessibilityLabel:i,accessibilityValue:{text:r}},D.Children.map(o,t=>{if(D.isValidElement(t)){const n=t;if(e){const e=n.props.style,t=Array.isArray(e)?[...e,{color:l.textTableSecondary}]:[e,{color:l.textTableSecondary}];return D.cloneElement(n,{...n.props,style:t})}return D.cloneElement(n)}return null}))}const A7=Ei.create({cell:{justifyContent:"center",alignItems:"center",borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}});function L7({testID:e,cellRatio:t,children:n,style:i,accessibilityLabel:r,accessibilityValue:a,disabled:o=!1}){const{COLORS:s}=bL();return D.createElement(_a,{style:[P7.cell,{flex:t??1,borderColor:s.divider},i],testID:e,accessible:!0,accessibilityRole:"header",accessibilityState:{disabled:o},accessibilityLabel:r,accessibilityValue:{text:a}},n)}const P7=Ei.create({cell:{justifyContent:"space-between",alignItems:"center",borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}}),M7=[NL.ActivityIntensity.light,NL.ActivityIntensity.moderate,NL.ActivityIntensity.hard],D7=[NL.ActivityReductionIntervals.fromZero,NL.ActivityReductionIntervals.fromThirty,NL.ActivityReductionIntervals.fromFortysix,NL.ActivityReductionIntervals.fromSixtyone],N7={[NL.ActivityReductionIntervals.fromZero]:"0-29",[NL.ActivityReductionIntervals.fromThirty]:"30-45",[NL.ActivityReductionIntervals.fromFortysix]:"46-60",[NL.ActivityReductionIntervals.fromSixtyone]:"61-120"},F7=e=>Math.round(100*(1-e)),B7=e=>null==e?"-":`${F7(e).toString()} %`,j7=e=>Math.round(100*(1-e/100))/100;const V7=iF(function(){const{t:e}=iV(),{COLORS:t}=bL(),{modalStoreActions:n}=j2(),[i,r]=M.useState(!1),[a,o]=M.useState(!1),[s,l]=M.useState(!1),[u,c]=M.useState(null),[d,h]=M.useState(null),[m,p]=M.useState(void 0),{glucoseUnit:f,activity:_}=Uq;if(void 0===f)throw new Error("[ActivitySettings::render] glucoseUnit is not defined");if(void 0===_)throw new Error("[ActivitySettings::render] activity is not defined");const{target:g,post:y,hard:v,light:b,moderate:S}=_,w=M.useMemo(()=>aZ(g,NL.BloodGlucoseUnit.MMOL_L,f),[f,g]),{text:k}=M.useMemo(()=>Kq(f),[f]),C=M.useMemo(()=>({light:b,moderate:S,hard:v}),[b,S,v]),E=M.useMemo(()=>({post:y}),[y]),I=M.useMemo(()=>[{title:e("table_activity_duration"),maxFontSizeMultiplier:lj},{title:tZ.light(),maxFontSizeMultiplier:lj},{title:tZ.moderate(),maxFontSizeMultiplier:lj},{title:tZ.hard(),maxFontSizeMultiplier:lj}],[e]),x=M.useCallback(async()=>{const e={...S7(),target:g,post:y};if(DX(_,e))return;const t=await Uq.setUserSettings({activity:e});p(t)},[_,y,g]),T=M.useCallback(async()=>{const e={hard:v,moderate:S,light:b,target:g,post:S7().post};if(DX(_,e))return;const t=await Uq.setUserSettings({activity:e});p(t)},[_,v,b,S,g]),O=M.useCallback((e,t)=>{c({interval:t,intensity:e}),r(!0)},[r,c]),R=M.useCallback(()=>{c(null),r(!0)},[]),A=M.useCallback(async e=>{if(null===u)throw new Error("[ActivitySettings::updateActivity] pressedTableCell is null");if(j7(e)!==_[u.intensity][u.interval]){const t=JSON.parse(JSON.stringify(_));t[u.intensity][u.interval]=j7(e);const n=await Uq.setUserSettings({activity:t});p(n)}},[_,u]),L=M.useCallback(async e=>{const t=iZ(e,f,NL.BloodGlucoseUnit.MMOL_L);if(t!==_.target){const e=JSON.parse(JSON.stringify(_));e.target=t;const n=await Uq.setUserSettings({activity:e});p(n)}},[_,f]),P=M.useCallback(async e=>{u?await A(e):await L(e),r(!1)},[u,A,L]),N=M.useMemo(()=>{if(null===u){return f===NL.BloodGlucoseUnit.MMOL_L?f7:_7}return PX(0,75)},[u,f]),F=M.useMemo(()=>{if(null===u){const e=aZ(g,NL.BloodGlucoseUnit.MMOL_L,f);return N.findIndex(t=>t===e)}const e=_[u.intensity][u.interval];return 0===e?0:e?F7(e):75},[u,_,g,f,N]),B=M.useCallback(()=>{!1===m&&n.set({showSyncErrorModal:!0}),p(void 0)},[m,n]);return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"settings-activity-scroll",style:H7.scrollView,contentContainerStyle:H7.scrollViewContent},D.createElement(w7,{text:e("physical_activity_hcp_card_body"),learnMoreText:e("physical_activity_hcp_card_button"),learnMoreOnPress:()=>{l(!0)}}),D.createElement(T7,null,D.createElement(_a,{style:[H7.tableDescripContainer,{borderBottomColor:t.divider}]},D.createElement(gj,{style:[H7.title,{color:t.labelPrimary}],accessibilityRole:"header"},e("physical_activity_target_title")),D.createElement(gj,{style:[H7.subtitle,{color:t.labelSecondary}]},e("physical_activity_target_body"))),D.createElement(kj,{title:e("target_activity_input"),value:`${w} ${k}`,testID:"activity-target",onPress:R,valueStyle:{color:t.labelBrand}})),D.createElement(T7,{columnDisposition:[1,1,1,1]},D.createElement(_a,{style:[H7.tableDescripContainer,{borderBottomColor:t.divider}]},D.createElement(gj,{style:[H7.title,{color:t.labelPrimary}],accessibilityRole:"header"},e("target_activity_reduction_title")),D.createElement(gj,{style:[H7.subtitle,{color:t.labelSecondary}]},e("target_activity_reduction_body"))),D.createElement(C7,null,I.map((e,n)=>D.createElement(L7,{key:e.title,style:[0===n&&H7.tableFirstCell,H7.noTopBorder]},D.createElement(gj,{style:[H7.tableHeaderTitle,{color:t.labelPrimary}],maxFontSizeMultiplier:e.maxFontSizeMultiplier},e.title)))),D7.map(n=>D.createElement(I7,{key:n},D.createElement(R7,{style:H7.tableFirstCell},D.createElement(gj,{style:[H7.tableInterval,{color:t.labelPrimary}]},N7[n]),D.createElement(gj,{style:[H7.minutes,{color:t.textTableSecondary}]},e("activity_settings_table_min"))),M7.map(e=>D.createElement(R7,{key:`${n}-${e}`,testID:`settings-activity-${e}-${n}`,onPress:()=>{O(e,n)}},D.createElement(gj,{style:[H7.tablePercentage,{color:t.textTableHighlight}]},B7(C[e][n])))))),D.createElement(xc,{style:[H7.resetContainer,{backgroundColor:t.bgButtonSecondaryDanger,borderColor:t.divider}],onPress:()=>{h("during"),o(!0)},testID:"restore-default-activity-settings-during"},D.createElement(gj,{style:[H7.resetText,{color:t.textButtonSecondaryDanger}]},e("button_reset_default")))),D.createElement(T7,null,D.createElement(_a,{style:[H7.tableDescripContainer,{borderBottomWidth:0}]},D.createElement(gj,{style:[H7.title,{color:t.labelPrimary}],accessibilityRole:"header"},e("target_activity_reduction_after_title")),D.createElement(gj,{style:[H7.subtitle,{color:t.labelSecondary}]},e("target_activity_reduction_after_body"))),D7.map(n=>D.createElement(I7,{key:`post-${n}`},D.createElement(R7,{style:[H7.tableFirstCell,H7.noLeftBorder]},D.createElement(gj,{style:H7.tableInterval},N7[n]),D.createElement(gj,{style:[H7.minutes,{color:t.textTableSecondary}]},e("activity_settings_table_min"))),D.createElement(R7,{testID:`settings-activity-post-${n}`,onPress:()=>{O("post",n)}},D.createElement(gj,{style:[H7.tablePercentage,{color:t.textTableHighlight}]},B7(E.post[n]))))),D.createElement(xc,{style:[H7.resetContainer,{backgroundColor:t.bgButtonSecondaryDanger,borderColor:t.divider}],onPress:()=>{h("after"),o(!0)},testID:"restore-default-activity-settings-after"},D.createElement(gj,{style:[H7.resetText,{color:t.textButtonSecondaryDanger}]},e("button_reset_default"))))),D.createElement(n3,{initialScrollIndex:F,isVisible:i,onCancel:()=>{r(!1)},onConfirm:P,items:N,onModalHide:B,testID:"activity-wheel-picker"}),D.createElement(lz,{title:e("physical_activity_modal_reset_title "),isVisible:a,onModalHide:B,buttons:[{title:e("button_reset"),type:dj.Error,onPress:async()=>{"after"===d?await T():await x(),o(!1)}},{title:e("button_cancel"),type:dj.Secondary,onPress:()=>{o(!1)}}]}),D.createElement(lz,{isVisible:s,enableScroll:!0,buttons:[{title:e("button_close"),onPress:()=>{l(!1)},style:H7.activityInfoModalButton}]},D.createElement(N6,null)),D.createElement(V0,{onModalHide:()=>{p(void 0)}}))}),H7=Ei.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32,paddingVertical:32},tableDescripContainer:{padding:16,borderBottomWidth:1},title:{...oj.semiBold_Base,marginBottom:8},subtitle:{...oj.regular_SM},tableFirstCell:{paddingLeft:16,paddingVertical:12,borderLeftWidth:0},resetText:{...oj.semiBold_Base,textAlign:"center"},resetContainer:{alignItems:"center",padding:16,borderTopWidth:1},tableHeaderTitle:{...oj.medium_SM},minutes:{...oj.regular_XS},tableInterval:{...oj.medium_Base},tablePercentage:{...oj.medium_Base},activityInfoModalButton:{marginTop:32},noTopBorder:{borderTopWidth:0,paddingVertical:16},noLeftBorder:{borderLeftWidth:0}}),z7=Array.from({length:60},(e,t)=>t.toString().padStart(2,"0"));const U7=D.memo(function({isVisible:e,initialValue:t,min:n,max:i,onCancel:r,onConfirm:a,onModalHide:o}){const{COLORS:s}=bL(),{width:l}=vm(),u=M.useRef(null),c=M.useRef(null),d=M.useMemo(()=>{const e=[],t=i?aX("59","mm",new Date(i)):aX("23:59","HH:mm",new Date);let r=n?aX("00","mm",new Date(n)):aX("00:00","HH:mm",new Date);for(;c$(r,t)||lX(r,t);)e.push(r),r=rY(r,1);return e},[i,n]),h=M.useMemo(()=>d.map(e=>e.getHours().toString().padStart(2,"0"),[]),[d]),[m,p]=M.useState(t),f=function(e){const t=M.useRef(void 0);return M.useEffect(()=>{t.current=e},[e]),t.current}(e);M.useEffect(()=>{!f&&e&&p(t)},[f,e,t]);const _=M.useMemo(()=>d.findIndex(e=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()&&e.getHours()===t.getHours()),[d,t]),g=M.useMemo(()=>{const[,e]=o$(t,"HH:mm").split(":");return z7.indexOf(e)},[t]),y=M.useMemo(()=>d.findIndex(e=>e.getFullYear()===m.getFullYear()&&e.getMonth()===m.getMonth()&&e.getDate()===m.getDate()&&e.getHours()===m.getHours()),[d,m]),v=M.useMemo(()=>{const[,e]=o$(m,"HH:mm").split(":");return z7.indexOf(e)},[m]),b=M.useMemo(()=>n?0:null,[n]),S=M.useMemo(()=>i?d.length-1:null,[i,d]),w=M.useMemo(()=>{if(!n)return null;const[,e]=o$(n,"HH:mm").split(":");return z7.indexOf(e)},[n]),k=M.useMemo(()=>{if(!i)return null;const[,e]=o$(i,"HH:mm").split(":");return z7.indexOf(e)},[i]),C=M.useCallback(()=>{a(m)},[a,m]),E=M.useCallback(()=>{p(t),r()},[r,t]),I=M.useCallback((e,r)=>{if(e<0||r<0||e>=d.length||r>=z7.length)return;const a=`${d[e].getHours()}:${z7[r]}`;if(!n||!i){const e=aX(a,"HH:mm",new Date(t));return void p(e)}const o=d[e],s=aX(a,"HH:mm",new Date(o));p(s)},[n,i,d,t]),x=M.useCallback(e=>{c.current?.scrollToIndex(e)},[]),T=M.useCallback(e=>{null!==S&&null!==b&&null!==k&&null!==w?e===b&&v<w?(I(e,w),x(w)):e===S&&v>k?(I(e,k),x(k)):I(e,v):I(e,v)},[S,b,k,w,I,v,x]),O=M.useCallback(e=>{null!==S&&null!==b&&null!==k&&null!==w?y===b&&e<w?(I(y,w),x(w)):y===S&&e>k?(I(y,k),x(k)):I(y,e):I(y,e)},[I,S,k,b,w,x,y]);return D.createElement(lz,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o},D.createElement(_a,null,D.createElement(_a,{style:G7.pickersContainer},D.createElement(t3,{testID:"hours_wheel_picker",key:"hours-wheel-picker",ref:u,initialScrollIndex:_,options:h,onChange:T,containerStyle:[G7.itemContainerLeft,{width:(l-32)/2}],selectedIndicatorStyle:[G7.selectedIndicatorLeft,{width:(l-32)/2-10}],itemStyle:G7.itemLeft}),D.createElement(t3,{testID:"minutes_wheel_picker",key:"minutes-wheel-picker",ref:c,initialScrollIndex:g,options:z7,onChange:O,containerStyle:[G7.itemContainerRight,{width:(l-32)/2}],selectedIndicatorStyle:[G7.selectedIndicatorRight,{width:(l-32)/2-10}],itemStyle:G7.itemRight})),D.createElement(_a,{style:G7.buttonContainer},D.createElement($0,{onPress:C}),D.createElement(W0,{onPress:E}))))}),G7=Ei.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:"row",borderTopLeftRadius:13,borderTopRightRadius:13,overflow:"hidden"},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:16},itemContainerRight:{borderTopLeftRadius:0,paddingRight:16},itemLeft:{alignSelf:"flex-end",marginRight:16},itemRight:{alignSelf:"flex-start",marginLeft:16},selectedIndicatorRight:{alignSelf:"flex-start",borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorLeft:{alignSelf:"flex-end",borderTopRightRadius:0,borderBottomRightRadius:0}});const W7=(e,t)=>({startTime:e.startTime,target:aZ(e.target,NL.BloodGlucoseUnit.MMOL_L,t)}),Y7=(e,t)=>{const n=e.startTime;let i=parseFloat(e.target);return i=iZ(i,t,NL.BloodGlucoseUnit.MMOL_L),{startTime:n,target:i}},$7=(e,t)=>e.map(e=>Y7(e,t));const X7=iF(function(){const{t:e}=iV(),{COLORS:t}=bL(),{modalStoreActions:n}=j2(),i=Wp(),[r,a]=M.useState(),[o,s]=M.useState(void 0),[l,u]=M.useState(!1),[c,d]=M.useState(!1),[h,m]=M.useState(!1),[p,f]=M.useState(),_=Uq.glucoseUnit;if(void 0===_)throw new Error("[GlucoseSettings::render] glucoseUnit is undefined.");const g=Uq.glucoseLevelTargets;if(void 0===g)throw new Error("[GlucoseSettings::render] parameters from userSettings must be defined and non-null.");const y=g.targetBGLIntervals;if(!y)throw new Error("[GlucoseSettings::render] parameters from userSettings must be defined and non-null.");const v=g.overallTargetBGL;if(!v)throw new Error("[GlucoseSettings::render] parameters from userSettings must be defined and non-null.");const b=g.use===NL.Usage.Overall,S=((e,t)=>e.map(e=>W7(e,t)))(y,_),w=W7(v,_),k=M.useCallback(e=>{d(!0),f(e)},[]),C=M.useCallback(async()=>{const e=[{startTime:"00:00",target:8},{startTime:"05:00",target:6},{startTime:"09:00",target:7},{startTime:"11:00",target:6},{startTime:"13:00",target:7},{startTime:"18:00",target:6},{startTime:"22:00",target:8}],t={startTime:"00:00",target:6},n={...g,targetBGLIntervals:e},i={...g,overallTargetBGL:t},r=b?i:n;if(b?!DX(g.overallTargetBGL,t):!DX(g.targetBGLIntervals,e)){const e=await Uq.setUserSettings({glucoseLevelTargets:r});s(e)}m(!1)},[g,b]),E=M.useCallback(async e=>{if(e!==parseFloat(w.target)){const t={...w};t.target=e.toString();const n=Y7(t,_),i={glucoseLevelTargets:{...g,overallTargetBGL:n}},r=await Uq.setUserSettings(i);s(r)}},[_,w,g]),I=M.useCallback(async e=>{if(void 0!==p&&e!==parseFloat(S[p].target)){const t=[...S],n={...t[p]};n.target=e.toString(),t[p]=n;const i=$7(t,_),r={glucoseLevelTargets:{...g,targetBGLIntervals:i}},a=await Uq.setUserSettings(r);s(a)}},[p,S,_,g]),x=M.useCallback(async e=>{b?await E(e):await I(e),d(!1)},[b,E,I]),T=M.useCallback(async()=>{const e=!b,t={glucoseLevelTargets:{...g,use:e?NL.Usage.Overall:NL.Usage.Intervals}},i=await Uq.setUserSettings(t);n.set({showSyncErrorModal:!i})},[b,g,n]),O=M.useMemo(()=>Kq(_).text,[_]),R=M.useMemo(()=>{const e=_===NL.BloodGlucoseUnit.MMOL_L,{min:t,max:n}=e?{min:NL.CONSTANTS.TARGET_GLUCOSE_MIN,max:NL.CONSTANTS.TARGET_GLUCOSE_MAX}:{min:79,max:180};return _===NL.BloodGlucoseUnit.MG_DL?PX(t,n):MX(t,n)},[_]),A=M.useMemo(()=>void 0===p?0:b?R.indexOf(w.target):R.indexOf(S[p].target),[p,b,R,S,w.target]),L=M.useCallback(e=>{const t=S[(e-1+S.length)%S.length].startTime,n=S[(e+1+S.length)%S.length].startTime,i=aX(S[e].startTime,"HH:mm",new Date),r=aX(t,"HH:mm",new Date),o=aX(n,"HH:mm",new Date);c$(i,r)&&c$(i,o)?a({current:i,min:mY(cX(r,1),1),max:fX(o)}):u$(i,r)&&u$(i,o)?a({current:i,min:mY(r,1),max:fX(nY(o,1))}):a({current:i,min:mY(r,1),max:fX(o)}),u(!0),f(e)},[S]),P=M.useCallback(async e=>{if(void 0===p)return;const t=o$(e,"HH:mm");if(t!==S[p].startTime){const e=[...S],n={...e[p]};n.startTime=t,e[p]=n;const i=$7(e,_),r={glucoseLevelTargets:{...g,targetBGLIntervals:i}},a=await Uq.setUserSettings(r);s(a)}u(!1)},[p,S,_,g]),N=M.useCallback(()=>{u(!1)},[]),F=M.useCallback(()=>{d(!1)},[]),B=M.useCallback(()=>{!1===o&&n.set({showSyncErrorModal:!0}),s(void 0)},[n,o]);return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"settings-glucose-scrollview",style:q7.scrollView,contentContainerStyle:q7.scrollViewContent},D.createElement(w7,null),D.createElement(kj,{title:e("glucose_input"),value:O,testID:"glucose-change",onPress:()=>{i.navigate(S2.GlucoseUnit)},renderRightSlot:()=>D.createElement(K1,null)}),D.createElement(T7,{columnDisposition:[1,2]},D.createElement(uz,{title:e("fixed_input_title"),message:e("fixed_input_body"),value:b,testID:"settings-glucose-overall-switch",onValueChange:T,style:q7.switchContainer}),D.createElement(C7,{disabled:!b,testID:"settings-glucose-overall-header"},D.createElement(L7,{style:q7.tableFirstCell,testID:"settings-glucose-overall-header-time"},D.createElement(gj,{style:[q7.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:uj},e("table_fixed_time"))),D.createElement(L7,{testID:"settings-glucose-overall-header-target"},D.createElement(gj,{style:[q7.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:uj},e("table_fixed_target")),D.createElement(gj,{style:[q7.headerSubtitle,{color:t.textTableSecondary}]},O))),D.createElement(I7,{disabled:!b},D.createElement(R7,{style:q7.tableFirstCell},D.createElement(gj,{style:[q7.subtitle,{color:t.textTableActive}]},e("table_fixed_all_day "))),D.createElement(R7,{onPress:()=>{k(0)}},D.createElement(gj,{style:[q7.fixedValueTitle,{color:t.textTableHighlight}],testID:"settings-glucose-overall-all-day-target"},w.target))),D.createElement(xc,{style:[q7.resetContainer,{borderColor:t.divider}],disabled:!b,onPress:()=>{m(!0)}},D.createElement(gj,{style:[q7.resetText,b?{color:t.textButtonSecondaryDanger}:{color:t.textButtonSecondaryDangerDisabled}]},e("button_reset_default")))),D.createElement(T7,{columnDisposition:[1,2]},D.createElement(uz,{title:e("table_variable_title"),message:e("table_variable_body"),value:!b,testID:"daily-interval-switch",onValueChange:T,style:q7.switchContainer}),D.createElement(C7,{disabled:b,testID:"settings-glucose-variable-header"},D.createElement(L7,{style:q7.tableFirstCell,testID:"settings-glucose-variable-header-time"},D.createElement(gj,{style:[q7.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:uj},e("table_variable_time")),D.createElement(gj,{style:[q7.headerSubtitle,{color:t.textTableSecondary}]},e("table_variable_time_unit"))),D.createElement(L7,{testID:"settings-glucose-variable-header-target"},D.createElement(gj,{style:[q7.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:sj},e("table_fixed_target")),D.createElement(gj,{style:[q7.headerSubtitle,{color:t.textTableSecondary}]},O))),S.map((e,n)=>D.createElement(I7,{key:e.startTime,disabled:b},D.createElement(R7,{style:q7.tableFirstCell,onPress:()=>{L(n)}},D.createElement(gj,{style:[q7.title,{color:t.textTableHighlight}]},e.startTime),D.createElement(gj,{style:[q7.subtitle,{color:t.textTableSecondary}]},sV[Object.keys(oV)[n]]())),D.createElement(R7,{onPress:()=>{k(n)}},D.createElement(gj,{style:[q7.title,{color:t.textTableHighlight}],testID:`settings-glucose-variable-target-${Object.keys(oV)[n].toLowerCase()}`},e.target)))),D.createElement(xc,{style:[q7.resetContainer,{borderColor:t.divider}],disabled:b,onPress:()=>{m(!0)}},D.createElement(gj,{style:[q7.resetText,b?{color:t.textButtonSecondaryDangerDisabled}:{color:t.textButtonSecondaryDanger}]},e("button_reset_default"))))),D.createElement(n3,{isVisible:c,items:R,onConfirm:x,onCancel:F,initialScrollIndex:A,onModalHide:B,testID:"settings-glucose-target-wheel-picker"}),D.createElement(U7,{isVisible:l,initialValue:r?.current??new Date,min:r?.min,max:r?.max,onConfirm:P,onCancel:N,onModalHide:B}),D.createElement(lz,{isVisible:h,title:e("physical_activity_modal_reset_title "),onModalHide:B,buttons:[{title:e("button_reset"),type:dj.Error,onPress:C},{title:e("button_cancel"),type:dj.Secondary,onPress:()=>{m(!1)}}]}),D.createElement(V0,{onModalHide:()=>{s(void 0)}}))}),q7=Ei.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32,paddingVertical:32},tableFirstCell:{alignItems:"flex-start",paddingLeft:16,borderLeftWidth:0},resetContainer:{alignItems:"center",padding:16,borderTopWidth:1},resetText:{...oj.semiBold_Base,textAlign:"center"},headerTitle:{...oj.medium_SM},headerSubtitle:{...oj.medium_XS},title:{...oj.medium_Base},fixedValueTitle:{...oj.medium_Base,paddingVertical:8},subtitle:{...oj.regular_XS},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}}),Z7=e=>{const{t:t}=iV(),{COLORS:n}=bL(),{glucoseUnit:i,isError:r,onPressMGDL:a,onPressMMOLL:o}=e;console.log("🔥 glucoseUnit",i);const s=i===NL.BloodGlucoseUnit.MMOL_L,l=i===NL.BloodGlucoseUnit.MG_DL;return D.createElement(_a,{style:K7.unitsContainer},D.createElement(xc,{testID:`mmoll-button-${s}`,onPress:o,style:[K7.unitButton,{backgroundColor:s?n.bgSegmentPrimary:n.bgInputActive},r&&{borderWidth:2,borderColor:n.borderInputDanger}],accessibilityRole:"button",accessibilityState:{selected:s}},D.createElement(gj,{style:[K7.unitText,{color:s?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("glucose_unit_mmol/l")),D.createElement(gj,{style:[K7.exampleText,{color:s?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("example")),D.createElement(gj,{style:[K7.unitExampleText,{color:s?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("glucose_unit_example_mmol/L"))),D.createElement(xc,{testID:`mgdl-button-${l}`,onPress:a,style:[K7.unitButton,{backgroundColor:l?n.bgSegmentPrimary:n.bgInputActive},r&&{borderWidth:2,borderColor:n.borderInputDanger}],accessibilityRole:"button",accessibilityState:{selected:l}},D.createElement(gj,{style:[K7.unitText,{color:l?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("glucose_unit_mg/dl")),D.createElement(gj,{style:[K7.exampleText,{color:l?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("example")),D.createElement(gj,{style:[K7.unitExampleText,{color:l?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("glucose_unit_example_mg/dl"))))},K7=Ei.create({unitsContainer:{flexDirection:"row",justifyContent:"space-between",gap:12},unitButton:{flex:1,paddingHorizontal:14,paddingVertical:10,borderRadius:16},unitText:{...oj.medium_Base,marginBottom:8},exampleText:{...oj.medium_XS,marginBottom:4},unitExampleText:{...oj.regular_XS}}),Q7=Ei.create({container:{paddingHorizontal:16,paddingTop:32}}),J7=iF(()=>{const{modalStoreActions:e}=j2(),t=M.useCallback(async t=>{if(t===Uq.glucoseUnit)return;const n=await Uq.setUserSettings({bloodGlucoseUnits:t});e.set({showSyncErrorModal:!n})},[e]);return D.createElement(D.Fragment,null,D.createElement(_a,{style:Q7.container},D.createElement(Z7,{onPressMMOLL:()=>t(NL.BloodGlucoseUnit.MMOL_L),onPressMGDL:()=>t(NL.BloodGlucoseUnit.MG_DL),glucoseUnit:Uq.glucoseUnit})),D.createElement(V0,null))}),e8=()=>{const{t:e}=iV(),{COLORS:t}=bL(),n=Wp();return M.createElement(Xa,{contentContainerStyle:t8.scrollView,testID:"legal-page-scrollview"},M.createElement(gj,{style:t8.title},e("legal_title")),M.createElement(_a,{style:t8.section},M.createElement(u2,{testID:"manufacturer-symbol",color:t.bgPrimary}),M.createElement(gj,{style:[t8.textContainer,{color:t.labelSecondary}]},"2025-11-13")),M.createElement(_a,{style:t8.section},M.createElement(l2,{testID:"manual-icon"}),M.createElement(gj,{testID:"manual-button",style:[t8.manualText,{color:t.textLink}],onPress:()=>{jX(FX.SettingsIFU),n.navigate(S2.IFU)}},e("legal_IFU"))),M.createElement(_a,{style:t8.section},M.createElement(p2,{testID:"SN-symbol"}),M.createElement(gj,{style:[t8.textContainer,{color:t.labelSecondary}]},NX)),M.createElement(_a,{style:t8.section},M.createElement(Y1,{testID:"ce-logo"}),M.createElement(gj,{style:[t8.alignTop,{color:t.labelSecondary}]},e("legal_ce_mark_text"))),M.createElement(_a,{style:t8.section},M.createElement(u2,{color:t.labelPrimary}),M.createElement(_a,{style:t8.textContainer},M.createElement(gj,{style:[t8.sectionTitle,{color:t.labelSecondary}]},e("legal_company_name")),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_company_adress")),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_company_country")),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_company_email")),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_company_cvr_vat")))),M.createElement(_a,{style:[t8.section,t8.udiSection]},M.createElement(g2,{testID:"udi-logo",style:t8.udiLogo}),M.createElement(gj,{style:[t8.textContainer,t8.udiText,{color:t.labelSecondary}]},M.createElement(gj,{style:{color:t.labelSecondary}},"(01)05700002209597(10)"),M.createElement(gj,{style:{color:t.labelSecondary}},`${NX}(8012)${NX}`))),M.createElement(_a,{style:t8.sectionColumn},M.createElement(y2,{testID:"uk-rep-logo",style:t8.repIcon}),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_ukrep")),M.createElement(gj,{style:{color:t.labelSecondary}},e("united_kingdom")),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_ukrep1"))),null)},t8=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16},title:{...oj.regular_SM,textAlign:"center",marginBottom:32},section:{flexDirection:"row",marginBottom:32},sectionTitle:{...oj.medium_Base},textContainer:{flex:1,marginLeft:20,alignSelf:"center"},alignTop:{flex:1,marginLeft:20,alignSelf:"flex-start"},sectionColumn:{marginBottom:32},repIcon:{marginBottom:12},manualText:{...oj.medium_Base,marginLeft:20,alignSelf:"center"},udiSection:{flexWrap:"wrap",marginBottom:20},udiLogo:{marginRight:20,marginBottom:12},udiText:{marginLeft:0,marginBottom:12,display:"flex",flexWrap:"wrap"}}),n8=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{navigate:n}=Wp(),i=M.useCallback(async()=>{if(uV)n(S2.SupportContact);else{const e="support@hedia.com",t="Hedia support",n=`App version: ${NX}\n${L6({defaultValue:"unknown",supportedPlatforms:["ios","android","windows"],memoKey:"systemName",getter:()=>lr.select({ios:R6.systemName,android:"Android",windows:"Windows",default:"unknown"})})} version: ${L6({defaultValue:"unknown",getter:()=>R6.systemVersion,supportedPlatforms:["android","ios","windows"],memoKey:"systemVersion"})}`;await Vu.openURL(`mailto:${e}?subject=${t}&body=${n}`)}},[n]);return D.createElement(Xa,{contentContainerStyle:i8.wrapper},D.createElement(gj,{style:[i8.title,{color:t.labelPrimary}]},e("support_title")),D.createElement(_a,{style:i8.buttons},D.createElement(mj,{title:e("button_email"),onPress:i,testID:"send_email_button"}),D.createElement(mj,{title:e("button_support_page"),onPress:()=>{n(S2.SupportWebView)},testID:"open_support_page_button",type:dj.Secondary}),D.createElement(mj,{title:e("button_instructions"),onPress:()=>{jX(FX.SettingsIFU),n(S2.IFU)},testID:"open_ifu_page_button",type:dj.Secondary})))},i8=Ei.create({wrapper:{flex:1,justifyContent:"center",paddingHorizontal:16},title:{...oj.bold_3XL,marginBottom:48,textAlign:"center"},buttons:{gap:16}}),r8=Ei.create({container:{marginHorizontal:16,marginTop:32},checkmarkContainer:{width:24,height:24}}),a8=iF(()=>{const{t:e}=iV(),{isOnboardingFinished:t}=qz(),{biologicalSex:n}=U2(),{setSetupCalculatorStoreValues:i}=z2(),{modalStoreActions:r}=j2(),a=t?Uq.biologicalSex:n,o=M.useCallback(async e=>{if(a!==e)if(t){await Uq.setUserSettings({biologicalSex:e})||r.set({showSyncErrorModal:!0})}else i({biologicalSex:e})},[a,t,r,i]);return D.createElement(_a,{testID:"biological-sex",style:r8.container},D.createElement(kj.Container,null,D.createElement(kj,{testID:"biological_sex_male",title:e("general_input_sex_option_male"),renderRightSlot:()=>D.createElement(_a,{style:r8.checkmarkContainer},a===NL.BiologicalSex.Male?D.createElement($1,null):null),onPress:()=>o(NL.BiologicalSex.Male)}),D.createElement(kj,{testID:"biological_sex_female",title:e("general_input_sex_option_female"),renderRightSlot:()=>D.createElement(_a,{style:r8.checkmarkContainer},a===NL.BiologicalSex.Female?D.createElement($1,null):null),onPress:()=>o(NL.BiologicalSex.Female)}),D.createElement(kj,{testID:"biological_sex_no_answer",title:e("biological_sex_no_answer"),renderRightSlot:()=>D.createElement(_a,{style:r8.checkmarkContainer},a===NL.BiologicalSex.Unspecified?D.createElement($1,null):null),onPress:()=>o(NL.BiologicalSex.Unspecified)})),D.createElement(V0,null))}),o8=Ei.create({container:{marginHorizontal:16,marginTop:32},checkmarkContainer:{width:24,height:24}}),s8=iF(()=>{const{t:e}=iV(),{modalStoreActions:t}=j2(),n=Uq.diabetesType,[i,r]=M.useState(!1),a=M.useCallback(async e=>{if(n===e)return;await Uq.setUserSettings({diabetesType:e})?e===NL.DiabetesType.Type2&&r(!0):t.set({showSyncErrorModal:!0})},[n,t]),o=M.useCallback(()=>{r(!1)},[]);return D.createElement(D.Fragment,null,D.createElement(_a,{style:o8.container},D.createElement(kj.Container,null,D.createElement(kj,{title:e("type_of_diabetes_type1"),renderRightSlot:()=>D.createElement(_a,{style:o8.checkmarkContainer},n===NL.DiabetesType.Type1?D.createElement($1,null):null),onPress:()=>a(NL.DiabetesType.Type1)}),D.createElement(kj,{title:e("type_of_diabetes_type2"),renderRightSlot:()=>D.createElement(_a,{style:o8.checkmarkContainer},n===NL.DiabetesType.Type2?D.createElement($1,null):null),onPress:()=>a(NL.DiabetesType.Type2)}))),D.createElement(lz,{title:e("modal_diabetes2_title"),isVisible:i,message:e("modal_diabetes2_body"),buttons:[{title:e("button_close"),onPress:o}]}),D.createElement(V0,null))}),l8=(e,t)=>l$(new Date(e,t)),u8=(()=>{const e=(new Date).getFullYear();return[...Array(12).keys()].map(t=>o$(new Date(e,t),"MMM"))})(),c8=Array.from({length:31},(e,t)=>(t+1).toString().padStart(2,"0")),d8=(()=>{const e=(new Date).getFullYear()-1900+1,t=Array.from({length:e},(e,t)=>(t+1900).toString());return t})();const h8=D.memo(function({isVisible:e,initialValue:t,onCancel:n,onConfirm:i,onModalHide:r}){const{COLORS:a}=bL(),{width:o}=vm(),s=M.useRef(null),l=M.useRef(null),u=M.useRef(null),[c,d]=M.useState(t);M.useEffect(()=>{e&&d(e=>e.getTime()===t.getTime()?e:new Date(t))},[t,e]);const h=M.useMemo(()=>t.getDate()-1,[t]),m=M.useMemo(()=>t.getMonth(),[t]),p=M.useMemo(()=>{const e=t.getFullYear();return d8.indexOf(e.toString())},[t]),f=M.useMemo(()=>c.getDate()-1,[c]),_=M.useMemo(()=>c.getMonth(),[c]),g=M.useMemo(()=>c.getFullYear(),[c]),y=M.useCallback(()=>{i(c)},[i,c]),v=M.useCallback(()=>{d(t),n()},[n,t]),b=M.useCallback(e=>{const t=l8(g,e)-1,n=Math.min(f,t),i=new Date(g,e,n+1);d(i),f>t&&s.current?.scrollToIndex(t)},[f,g]),S=M.useCallback(e=>{const t=l8(g,_)-1,n=Math.min(e,t),i=new Date(g,_,n+1);d(i),e>t&&s.current?.scrollToIndex(t)},[_,g]),w=M.useCallback(e=>{const t=parseInt(d8[e],10),n=l8(t,_)-1,i=Math.min(f,n),r=new Date(t,_,i+1);d(r),f>n&&s.current?.scrollToIndex(n)},[f,_]);return D.createElement(lz,{isVisible:e,containerStyle:{backgroundColor:a.bgTransparent},onModalHide:r},D.createElement(_a,null,D.createElement(_a,{style:m8.pickersContainer},D.createElement(t3,{key:"months-wheel-picker",ref:l,initialScrollIndex:m,options:u8,onChange:b,containerStyle:[m8.itemContainerLeft,{width:(o-32)/3}],selectedIndicatorStyle:[m8.selectedIndicatorLeft,{width:(o-32)/3-10}],itemStyle:m8.itemLeft,testID:"months-wheel-picker"}),D.createElement(t3,{key:"days-wheel-picker",ref:s,initialScrollIndex:h,options:c8,onChange:S,containerStyle:[m8.itemContainerCenter,{width:(o-32)/3}],selectedIndicatorStyle:[m8.selectedIndicatorCenter,{width:(o-32)/3}],itemStyle:m8.itemCenter,testID:"days-wheel-picker"}),D.createElement(t3,{key:"years-wheel-picker",ref:u,initialScrollIndex:p,options:d8,onChange:w,containerStyle:[m8.itemContainerRight,{width:(o-32)/3}],selectedIndicatorStyle:[m8.selectedIndicatorRight,{width:(o-32)/3-10}],itemStyle:m8.itemRight,testID:"years-wheel-picker"})),D.createElement(_a,{style:m8.buttonContainer},D.createElement($0,{onPress:y}),D.createElement(W0,{onPress:v}))))}),m8=Ei.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:"row",borderTopLeftRadius:13,borderTopRightRadius:13,overflow:"hidden"},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:8},itemContainerCenter:{borderTopLeftRadius:0,borderTopRightRadius:0},itemContainerRight:{borderTopLeftRadius:0,paddingRight:8},itemLeft:{alignSelf:"flex-end"},itemCenter:{alignSelf:"center"},itemRight:{alignSelf:"flex-start"},selectedIndicatorRight:{alignSelf:"flex-start",borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorCenter:{alignSelf:"center",borderRadius:0},selectedIndicatorLeft:{alignSelf:"flex-end",borderTopRightRadius:0,borderBottomRightRadius:0}}),p8=PX(50,220),f8=PX(35,300);const _8=iF(function(){const{t:e}=iV(),{modalStoreActions:t}=j2(),n=Wp(),{bottom:i}=pH(),[r,a]=M.useState(!1),[o,s]=M.useState(!1),[l,u]=M.useState(!1),[c,d]=M.useState(!1),[h,m]=M.useState(void 0),[p,f]=M.useState(!1),{birthDate:_,diabetesType:g,biologicalSex:y,weightKg:v,heightCm:b}=Uq;if(void 0===g)throw new Error("[AboutSection::render] diatbetesType must be defined.");const S=M.useMemo(()=>_?new Date(_):void 0,[_]),w=M.useMemo(()=>g===NL.DiabetesType.Type1?"type_of_diabetes_type1":"type_of_diabetes_type2",[g]),k=M.useCallback(async e=>{if(e!==b){const t=await Uq.setUserSettings({height:e});m(t)}a(!1)},[b]),C=M.useCallback(async e=>{if(e!==v){const t=await Uq.setUserSettings({weight:e});m(t)}s(!1)},[v]),E=M.useMemo(()=>{if(!b)return 0;const e=Math.round(10*b)/10;return p8.indexOf(e.toString())},[b]),I=M.useMemo(()=>{if(!v)return 0;const e=Math.round(10*v)/10;return f8.indexOf(e.toString())},[v]),x=async e=>{if(e.toISOString()!==_){if(c$(e,_X(new Date))){const t=await Uq.setUserSettings({birthday:e.toISOString()});m(t)}else cV?d(!0):f(!0)}u(!1)},T=M.useCallback(()=>{!1===h&&t.set({showSyncErrorModal:!0}),m(void 0)},[t,h]),O=M.useCallback(()=>{p?d(!0):T()},[p,T]);return D.createElement(D.Fragment,null,D.createElement(_a,null,D.createElement(kj.Container,null,D.createElement(kj,{title:e("my_profile_birth"),value:S?S.toLocaleDateString():"-",testID:"date-of-birth",onPress:()=>{u(!0)}}),D.createElement(kj,{title:e("my_profile_diabetes_type"),value:e(w),testID:"diabetes-type",onPress:()=>{n.navigate(S2.DiabetesType)},renderRightSlot:()=>D.createElement(K1,null)}),D.createElement(kj,{title:e("my_profile_sex"),testID:"biologicalSex",value:y?lV[y]():"-",onPress:()=>{n.navigate(S2.BiologicalSex)},renderRightSlot:()=>D.createElement(K1,null)}),D.createElement(kj,{title:e("my_profile_height"),value:`${b??"-"} cm`,testID:"height",onPress:()=>{a(!0)}}),D.createElement(kj,{title:e("my_profile_weight"),value:`${v??"-"} kg`,testID:"weight",onPress:()=>{s(!0)}}))),dV?D.createElement(x5,{testID:"birthday-date-picker",display:"spinner",minimumDate:new Date(1900,0,1),maximumDate:new Date,date:S,isVisible:l,onConfirm:x,onCancel:()=>{u(!1)},cancelTextIOS:e("button_cancel"),confirmTextIOS:e("button_confirm"),onHide:O,pickerStyleIOS:{alignSelf:"center"},modalStyleIOS:{paddingBottom:i}}):D.createElement(h8,{isVisible:l,initialValue:S??new Date,onConfirm:x,onCancel:()=>{u(!1)},onModalHide:O}),D.createElement(n3,{isVisible:r,items:p8,onConfirm:k,onCancel:()=>{a(!1)},initialScrollIndex:E,onModalHide:T,testID:"height_wheel_picker"}),D.createElement(n3,{isVisible:o,items:f8,onConfirm:C,onCancel:()=>{s(!1)},initialScrollIndex:I,onModalHide:T,testID:"weight_wheel_picker"}),D.createElement(lz,{isVisible:c,title:e("invalid_date_modal_title"),message:e("invalid_date_modal_body"),buttons:[{title:e("button_understood"),onPress:()=>{f(!1),d(!1)},testID:"understood-button"}]}),D.createElement(V0,{onModalHide:()=>{m(void 0)}}))});function g8(){const{t:e}=iV();return D.createElement(Xa,{testID:"profile-screen-scroll",style:y8.scrollView,contentContainerStyle:y8.contentContainer},D.createElement(kj,{title:e("my_profile_account"),testID:"first-name",renderLeftSlot:()=>D.createElement(v2,null),renderRightSlot:()=>D.createElement(K1,null),onPress:()=>{window.location.href="/account"}}),D.createElement(_8,null))}const y8=Ei.create({scrollView:{paddingHorizontal:16},contentContainer:{paddingVertical:32,flexGrow:1,gap:24}}),v8=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{Navigator:n,Screen:i}=ZQ();return d.jsxs(n,{screenOptions:{...n0,...BZ,headerStyle:{backgroundColor:t.bgSheet}},children:[d.jsx(i,{name:S2.Profile,component:g8,options:{title:e("my_profile_navigation")}}),d.jsx(i,{name:S2.BiologicalSex,component:a8,options:{title:e("biological_sex_navigation")}}),d.jsx(i,{name:S2.DiabetesType,component:s8,options:{title:e("diabetes_type_navigation")}})]})};const b8=uV?"/api/v2":Wj.HEDIA_API_URL_V2,S8=()=>{const{COLORS:e}=bL(),{fontScale:t}=vm(),n=t.toFixed(3);return D.createElement(D.Fragment,null,D.createElement(gj,{style:[w8.text,{backgroundColor:e.iconWarning,color:e.bgPrimary}],maxFontSizeMultiplier:sj},`Country code: ${Qj.getString("countryCodeAlpha2")}`),D.createElement(gj,{style:[w8.text,{backgroundColor:e.iconWarning,color:e.bgPrimary}],maxFontSizeMultiplier:sj},`Font scale: ${n}`),D.createElement(gj,{style:[w8.textBold,{backgroundColor:e.iconWarning,color:e.bgPrimary}],maxFontSizeMultiplier:sj},b8??".env is broken"))},w8=Ei.create({text:{...oj.regular_Base,textAlign:"center"},textBold:{...oj.semiBold_Base,textAlign:"center"}});function k8(){const{t:e}=iV(),{COLORS:t}=bL(),n=Wp(),[i,r]=M.useState(!0),a=M.useCallback(()=>{jX(FX.SettingsProfile),n.navigate(S2.ProfileStack,{screen:S2.Profile})},[n]),o=M.useCallback(()=>{jX(FX.SettingsGlucose),n.navigate(S2.GlucoseSettings)},[n]),s=M.useCallback(()=>{jX(FX.SettingsInsulin),n.navigate(S2.InsulinSettingsStack,{screen:S2.InsulinSettings})},[n]),l=M.useCallback(()=>{jX(FX.SettingsActivity),n.navigate(S2.ActivitySettings)},[n]),u=M.useCallback(()=>{jX(FX.SettingsSupport),n.navigate(S2.Support)},[n]),c=M.useCallback(()=>{jX(FX.SettingsLegal),n.navigate(S2.Legal)},[n]);return d.jsxs(Xa,{testID:"scroll-settings",style:C8.scrollView,contentContainerStyle:C8.scrollViewContentContainer,contentInsetAdjustmentBehavior:"automatic",children:[d.jsx(kj,{title:e("settings_card_my_profile"),testID:"edit-profile-button",renderRightSlot:()=>d.jsx(K1,{}),onPress:a}),d.jsxs(_a,{children:[d.jsx(Ej,{title:e("settings_personal_settings_title")}),d.jsxs(kj.Container,{children:[d.jsx(kj,{title:e("settings_card_glucose"),testID:"settings-glucose",onPress:o,renderRightSlot:()=>d.jsx(K1,{})}),d.jsx(kj,{title:e("settings_card_insulin_settings"),testID:"settings-insulin",onPress:s,renderRightSlot:()=>d.jsx(K1,{})}),d.jsx(kj,{title:e("settings_card_physical_activity"),testID:"settings-activity",onPress:l,renderRightSlot:()=>d.jsx(K1,{})})]})]}),d.jsxs(_a,{children:[d.jsx(Ej,{title:e("settings_hedia_diabetes_assistant_title")}),d.jsxs(kj.Container,{children:[d.jsx(kj,{title:e("settings_support"),testID:"settings-support",onPress:u,renderRightSlot:()=>d.jsx(K1,{})}),d.jsx(kj,{title:e("settings_card_legal"),testID:"settings-legal",onPress:c,renderRightSlot:()=>d.jsx(K1,{})})]})]}),d.jsx(xc,{onPress:()=>{r(!i)},style:C8.versionContainer,children:d.jsx(gj,{style:[C8.versionText,{color:t.labelSecondary}],children:i?NX:"(860)"})}),"false"===Wj.IS_PRODUCTION&&d.jsx(_a,{children:d.jsx(S8,{})})]})}const C8=Ei.create({scrollView:{flex:1,paddingHorizontal:16},scrollViewContentContainer:{paddingVertical:32,flexGrow:1,gap:24},versionContainer:{alignItems:"center",marginTop:"auto"},versionText:{...oj.regular_Base}}),E8=["transparentModal","containedTransparentModal"];function I8(e){let{state:t,descriptors:n}=e;const i=M.useContext(yK);return M.createElement(TK,null,M.createElement(_a,{style:x8.container},t.routes.map((e,r)=>{var a,o;const s=t.index===r,l=null===(a=t.routes[r-1])||void 0===a?void 0:a.key,u=null===(o=t.routes[r+1])||void 0===o?void 0:o.key,c=l?n[l]:void 0,d=u?n[u]:void 0,{options:h,navigation:m,render:p}=n[e.key],f=c?{title:QZ(c.options,c.route.name)}:i,_=void 0!==f,{header:g,headerShown:y,headerTintColor:v,headerBackImageSource:b,headerLeft:S,headerRight:w,headerTitle:k,headerTitleAlign:C,headerTitleStyle:E,headerStyle:I,headerShadowVisible:x,headerTransparent:T,headerBackground:O,headerBackTitle:R,presentation:A,contentStyle:L}=h,P=null==d?void 0:d.options.presentation;return M.createElement(AK,{key:e.key,focused:s,route:e,navigation:m,headerShown:y,headerTransparent:T,header:void 0!==g?g({back:f,options:h,route:e,navigation:m}):M.createElement(lK,{title:QZ(h,e.name),headerTintColor:v,headerLeft:"function"==typeof S?e=>{let{tintColor:t}=e;return S({tintColor:t,canGoBack:_,label:R})}:void 0===S&&_?e=>{let{tintColor:t}=e;return M.createElement(fK,{tintColor:t,backImage:void 0!==b?()=>M.createElement(Js,{source:b,style:[x8.backImage,{tintColor:t}]}):void 0,onPress:m.goBack,canGoBack:_})}:S,headerRight:"function"==typeof w?e=>{let{tintColor:t}=e;return w({tintColor:t,canGoBack:_})}:w,headerTitle:"function"==typeof k?e=>{let{children:t,tintColor:n}=e;return k({children:t,tintColor:n})}:k,headerTitleAlign:C,headerTitleStyle:E,headerTransparent:T,headerShadowVisible:x,headerBackground:O,headerStyle:I}),style:[Ei.absoluteFill,{display:s||null!=P&&E8.includes(P)?"flex":"none"},null!=A&&E8.includes(A)?{backgroundColor:"transparent"}:null]},M.createElement(yK.Provider,{value:f},M.createElement(_a,{style:[x8.contentContainer,L]},p())))})))}const x8=Ei.create({container:{flex:1},contentContainer:{flex:1},backImage:{height:24,width:24,margin:3,resizeMode:"contain"}});function T8(){return T8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},T8.apply(this,arguments)}const O8=tp(function(e){let{id:t,initialRouteName:n,children:i,screenListeners:r,screenOptions:a,...o}=e;const{state:s,descriptors:l,navigation:u,NavigationContent:c}=cf(Lm,{id:t,initialRouteName:n,children:i,screenListeners:r,screenOptions:a});return M.useEffect(()=>{var e;return null==u||null===(e=u.addListener)||void 0===e?void 0:e.call(u,"tabPress",e=>{const t=u.isFocused();requestAnimationFrame(()=>{s.index>0&&t&&!e.defaultPrevented&&u.dispatch({...Am.popToTop(),target:s.key})})})},[u,s.index,s.key]),M.createElement(c,null,M.createElement(I8,T8({},o,{state:s,navigation:u,descriptors:l})))});function R8(){const{COLORS:e}=bL();return D.createElement(_a,{style:[A8.separator,{backgroundColor:e.divider}]})}const A8=Ei.create({separator:{height:1}}),L8=MX(NL.CONSTANTS.INSULIN_TO_CARBS_RATIO_MIN,NL.CONSTANTS.INSULIN_TO_CARBS_RATIO_MAX);var P8=(e=>(e.DividendNumber="109",e.ExampleInsulinSensitivity="2.2",e))(P8||{}),M8=(e=>(e.DividendNumber="1960",e.ExampleInsulinSensitivity="39.2",e))(M8||{});const D8=MX(NL.CONSTANTS.INSULIN_SENSITIVITY_MIN,NL.CONSTANTS.INSULIN_SENSITIVITY_MAX),N8=PX(5,197),F8=({onPress:e,isVisible:t})=>{const{t:n}=iV(),{COLORS:i}=bL();return D.createElement(lz,{isVisible:t,title:n("insulin_settings_modal_carb_ratio_title"),enableScroll:!0,buttons:[{title:n("button_close"),onPress:e,testID:"close-button"}]},D.createElement(gj,{testID:"insulin_settings_modal_carb_ratio_body",style:[B8.bodyText,{color:i.labelSecondary}]},n("insulin_settings_modal_carb_ratio_body")),D.createElement(gj,{testID:"insulin_settings_modal_carb_ratio_example",style:{color:i.labelSecondary}},n("insulin_settings_modal_carb_example_body")))},B8=Ei.create({bodyText:{marginTop:12,marginBottom:16}}),j8=({glucoseUnit:e,onPress:t,isVisible:n})=>{const{t:i}=iV(),{COLORS:r}=bL(),{text:a}=Kq(e),o=e===NL.BloodGlucoseUnit.MMOL_L?P8.DividendNumber:M8.DividendNumber,s=e===NL.BloodGlucoseUnit.MMOL_L?P8.ExampleInsulinSensitivity:M8.ExampleInsulinSensitivity;return D.createElement(lz,{title:i("modal_insulin_seneitivity_title"),isVisible:n,enableScroll:!0,buttons:[{title:i("button_close"),onPress:t,testID:"close-button"}]},D.createElement(gj,{testID:"insulin_sensitivity_modal_body",style:[V8.bodyText,{color:r.labelSecondary}]},i("insulin_sensitivity_modal_body",{dividerNumber:o})),D.createElement(gj,{testID:"insulin_sensitivity_modal_example",style:{color:r.labelSecondary}},i("insulin_sensitivity_modal_example",{dividerNumber:o,displayResult:s,displayUnit:a})))},V8=Ei.create({bodyText:{marginTop:12,marginBottom:16}}),H8=()=>{const{t:e}=iV(),{bloodGlucoseUnits:t}=U2(),n=Uq.glucoseUnit??t;if(void 0===n)throw new Error("[HelpCalculatingSection::render] glucoseUnit must be defined.");const[i,r]=M.useState(!1),[a,o]=M.useState(!1),s=n===NL.BloodGlucoseUnit.MMOL_L?P8.DividendNumber:M8.DividendNumber;return D.createElement(_a,null,D.createElement(Ej,{title:e("insulin_settings_learn_more_title")}),D.createElement(kj.Container,null,D.createElement(kj,{testID:"info-insulin-carbs-ratio",title:e("insulin_settings_learn_more_carb_ratio"),onPress:()=>{o(!0)},displayType:Sj.ListItem}),D.createElement(kj,{testID:`info-insulin-sensitivity-${s}`,title:e("insulin_settings_learn_more_sensitivity"),onPress:()=>{r(!0)},displayType:Sj.ListItem})),D.createElement(j8,{onPress:()=>{r(!1)},glucoseUnit:n,isVisible:i}),D.createElement(F8,{onPress:()=>{o(!1)},isVisible:a}))},z8=Ei.create({switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0},firstTableCell:{paddingLeft:16,alignItems:"flex-start",justifyContent:"space-between",borderLeftWidth:0},tableHeaderTitle:{...oj.medium_SM,textAlign:"center"},tableHeaderTitleWithMargin:{marginHorizontal:8},tableTitle:{...oj.medium_Base},tableSubtitle:{...oj.regular_XS},tableText:{...oj.medium_Base}}),U8=iF(()=>{const{t:e}=iV(),{COLORS:t}=bL(),{modalStoreActions:n}=j2(),{glucoseUnit:i,treatmentParameters:r}=Uq;if(void 0===i)throw new Error("[DailyInsulinTable::render] glucoseUnit is undefined.");if(void 0===r)throw new Error("[DailyInsulinTable::render] parameters from userSettings must be defined and non-null.");const a=r.use,[o,s]=M.useState(!1),[l,u]=M.useState(!1),[c,d]=M.useState(void 0),[h,m]=M.useState(0),[p,f]=M.useState(!1),[_,g]=M.useState(),y=M.useCallback(async e=>{const t=iZ(e,i,NL.BloodGlucoseUnit.MMOL_L);if(t!==r.parameterIntervals[h].insulinSensitivity){const e={...r,parameterIntervals:r.parameterIntervals.map((e,n)=>n===h?{...e,insulinSensitivity:t}:e)},n=await Uq.setUserSettings({parameters:e});d(n)}s(!1)},[i,r,h]),v=M.useCallback(async e=>{const t=Number(e.toFixed(1));if(t!==r.parameterIntervals[h].carbohydrateRatio){const e={...r,parameterIntervals:r.parameterIntervals.map((e,n)=>n===h?{...e,carbohydrateRatio:t}:e)},n=await Uq.setUserSettings({parameters:e});d(n)}u(!1)},[r,h]),{text:b}=Kq(i),S=M.useMemo(()=>[{title:e("table_variable_insulin_time"),subtitle:e("table_variable_time_unit"),scale:uj},{title:e("table_variable_insulin_sensitivity"),subtitle:e("table_variable_insulin_sensitivity_unit",{displayUnit:b}),scale:sj},{title:e("table_variable_insulin_carb"),subtitle:e("table_variable_insulin_carb_unit"),scale:sj}],[b,e]),w=M.useMemo(()=>i===NL.BloodGlucoseUnit.MG_DL?N8:D8,[i]),k=M.useMemo(()=>{const e=aZ(r.parameterIntervals[h].insulinSensitivity,NL.BloodGlucoseUnit.MMOL_L,i);return w.findIndex(t=>t===e)},[w,i,r.parameterIntervals,h]),C=M.useMemo(()=>{const e=r.parameterIntervals[h].carbohydrateRatio.toFixed(1);return L8.findIndex(t=>t===e)},[r.parameterIntervals,h]),E=M.useCallback(async e=>{const t=o$(e,"HH:mm");if(t!==r.parameterIntervals[h].startTime){const e=[...r.parameterIntervals],n={...e[h]};n.startTime=t,e[h]=n;const i=await Uq.setUserSettings({parameters:{...r,parameterIntervals:e}});d(i)}f(!1)},[r,h]),I=M.useCallback(()=>{f(!1)},[]),x=M.useCallback(async e=>{const t={...r,use:e?NL.Usage.Intervals:NL.Usage.Overall},i=await Uq.setUserSettings({parameters:t});n.set({showSyncErrorModal:!i})},[r,n]),T=M.useCallback(()=>{!1===c&&n.set({showSyncErrorModal:!0}),d(void 0)},[n,c]);return D.createElement(D.Fragment,null,D.createElement(T7,{columnDisposition:[2,3,3]},D.createElement(uz,{testID:"daily-interval-switch",title:e("variable_insulin_settings_title"),message:e("variable_insulin_settings_body"),value:a===NL.Usage.Intervals,onValueChange:x,style:z8.switchContainer}),D.createElement(C7,{disabled:a!==NL.Usage.Intervals},S.map((e,n)=>D.createElement(L7,{key:e.title,style:0===n&&z8.firstTableCell},D.createElement(gj,{maxFontSizeMultiplier:e.scale,style:[z8.tableHeaderTitle,{color:t.labelPrimary},0!==n&&z8.tableHeaderTitleWithMargin]},e.title),D.createElement(gj,{style:[z8.tableSubtitle,{color:t.textTableSecondary}]},e.subtitle)))),Object.keys(oV).map((e,n)=>D.createElement(I7,{key:e,disabled:a!==NL.Usage.Intervals},D.createElement(R7,{onPress:()=>{(e=>{const t=r.parameterIntervals[(e-1+r.parameterIntervals.length)%r.parameterIntervals.length].startTime,n=r.parameterIntervals[(e+1+r.parameterIntervals.length)%r.parameterIntervals.length].startTime,i=aX(r.parameterIntervals[e].startTime,"HH:mm",new Date),a=aX(t,"HH:mm",new Date),o=aX(n,"HH:mm",new Date);c$(i,a)&&c$(i,o)?g({current:i,min:mY(aX(t,"HH:mm",cX(new Date,1)),1),max:fX(o)}):u$(i,a)&&u$(i,o)?g({current:i,min:mY(a,1),max:fX(aX(n,"HH:mm",nY(new Date,1)))}):g({current:i,min:mY(a,1),max:fX(o)}),m(e),f(!0)})(n)},style:z8.firstTableCell},D.createElement(gj,{maxFontSizeMultiplier:uj,style:[z8.tableTitle,{color:t.textTableHighlight}]},r.parameterIntervals[n].startTime),D.createElement(gj,{style:[z8.tableSubtitle,{color:t.textTableSecondary}]},sV[e]())),D.createElement(R7,{testID:`${e.toLowerCase()}-insulin`,onPress:()=>{(e=>{m(e),s(!0)})(n)}},D.createElement(gj,{maxFontSizeMultiplier:uj,style:[z8.tableText,{color:t.textTableHighlight}]},aZ(r.parameterIntervals[n].insulinSensitivity,NL.BloodGlucoseUnit.MMOL_L,i))),D.createElement(R7,{testID:`${e.toLowerCase()}-carbs`,onPress:()=>{(e=>{m(e),u(!0)})(n)}},D.createElement(gj,{maxFontSizeMultiplier:uj,style:[z8.tableText,{color:t.textTableHighlight}]},r.parameterIntervals[n].carbohydrateRatio.toFixed(1)))))),D.createElement(U7,{isVisible:p,initialValue:_?.current??new Date,min:_?.min,max:_?.max,onConfirm:E,onCancel:I,onModalHide:T}),D.createElement(n3,{isVisible:o,items:w,initialScrollIndex:k,onConfirm:y,onCancel:()=>{s(!1)},onModalHide:T,testID:"insulin_sensitivity_picker"}),D.createElement(n3,{isVisible:l,items:L8,initialScrollIndex:C,onConfirm:v,onCancel:()=>{u(!1)},onModalHide:T,testID:"insulin_to_carb_ratio_picker"}))}),G8={Lantus:()=>nV("long-acting_insulin_option1"),Basaglar:()=>nV("long-acting_insulin_option2"),Tuojeo:()=>nV("long-acting_insulin_option3"),Levemir:()=>nV("long-acting_insulin_option4"),Tresiba:()=>nV("long-acting_insulin_option5"),Other:()=>nV("long-acting_insulin_option6"),None:()=>nV("long-acting_insulin_option7")},W8=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),Y8=iF(()=>{const{isOnboardingFinished:e}=qz(),{longActingInsulin:t}=U2(),{setSetupCalculatorStoreValues:n}=z2(),{modalStoreActions:i}=j2(),r=df(),a=e?Uq.longActingInsulin:t,o=M.useCallback(async e=>{if(e!==a)if(r.params.comingFrom===w2.Setup)n({longActingInsulin:NL.LongActingInsulin[e]});else{await Uq.setUserSettings({longActingInsulin:NL.LongActingInsulin[e]})||i.set({showSyncErrorModal:!0})}},[r.params.comingFrom,a,n,i]);return D.createElement(Xa,{testID:"scroll",contentContainerStyle:W8.scrollView},D.createElement(kj.Container,null,Object.keys(NL.LongActingInsulin).map(e=>D.createElement(kj,{key:e,title:G8[e](),renderRightSlot:()=>D.createElement(_a,{style:W8.checkmarkContainer},NL.LongActingInsulin[e]===a?D.createElement($1,null):null),onPress:()=>o(e),displayType:Sj.ListItem,testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join("-").toLowerCase()}`}))),D.createElement(V0,null))}),$8={Novorapid:()=>nV("rapid-acting_insulin_option1"),Fiasp:()=>nV("rapid-acting_insulin_option2"),Humalog:()=>nV("rapid-acting_insulin_option3"),Apidra:()=>nV("rapid-acting_insulin_option4"),Other:()=>nV("rapid-acting_insulin_option5"),None:()=>nV("rapid-acting_insulin_option6")},X8=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),q8=iF(()=>{const{isOnboardingFinished:e}=qz(),{fastActingInsulin:t}=U2(),{setSetupCalculatorStoreValues:n}=z2(),{modalStoreActions:i}=j2(),r=df(),a=e?Uq.fastActingInsulin:t,o=M.useCallback(async e=>{if(e!==a)if(r.params.comingFrom===w2.Setup)n({fastActingInsulin:NL.FastActingInsulin[e]});else{await Uq.setUserSettings({fastActingInsulin:NL.FastActingInsulin[e]})||i.set({showSyncErrorModal:!0})}},[r.params.comingFrom,a,n,i]);return D.createElement(Xa,{testID:"scroll",contentContainerStyle:X8.scrollView},D.createElement(kj.Container,null,Object.keys(NL.FastActingInsulin).map(e=>D.createElement(kj,{key:e,title:$8[e](),renderRightSlot:()=>D.createElement(_a,{style:X8.checkmarkContainer},NL.FastActingInsulin[e]===a?D.createElement($1,null):null),onPress:()=>o(e),displayType:Sj.ListItem,testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join("-").toLowerCase()}`}))),D.createElement(V0,null))}),Z8={PenHalf:()=>nV("treatment_type_option1"),PenWhole:()=>nV("treatment_type_option2"),Pump:()=>nV("treatment_type_option3")},K8=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),Q8=iF(()=>{const{isOnboardingFinished:e}=qz(),{setSetupCalculatorStoreValues:t}=z2(),{treatmentType:n}=U2(),{modalStoreActions:i}=j2(),r=df(),a=e?Uq.injectionMethod:n,o=M.useCallback(async e=>{if(e!==a)if(r.params.comingFrom===w2.Setup)t({treatmentType:NL.InjectionMethod[e]});else{await Uq.setUserSettings({treatmentType:NL.InjectionMethod[e]})||i.set({showSyncErrorModal:!0})}},[r.params.comingFrom,a,t,i]);return D.createElement(Xa,{testID:"scroll",contentContainerStyle:K8.scrollView},D.createElement(kj.Container,null,Object.keys(NL.InjectionMethod).map(e=>D.createElement(kj,{key:e,title:Z8[e](),renderRightSlot:()=>D.createElement(_a,{style:K8.checkmarkContainer},NL.InjectionMethod[e]===a?D.createElement($1,null):null),onPress:()=>o(e),testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join("-").toLowerCase()}`,displayType:Sj.ListItem}))),D.createElement(V0,null))});const J8=iF(function(){const{t:e}=iV(),t=Wp(),{injectionMethod:n,fastActingInsulin:i,longActingInsulin:r}=Uq;if(void 0===n)throw new Error("[TreatmentSection::render] injectionMethod must be defined and non-null.");const a=M.useMemo(()=>{const e=LX(NL.InjectionMethod,n);return Z8[e]()},[n]),o=M.useMemo(()=>i?$8[i]():"-",[i]),s=M.useMemo(()=>r?G8[r]():"-",[r]);return D.createElement(_a,null,D.createElement(kj,{title:e("my_profile_treatment_type"),value:a,testID:"treatment-type",onPress:()=>{t.navigate(S2.TreatmentType,{comingFrom:S2.Profile})},renderRightSlot:()=>D.createElement(K1,null),style:{marginBottom:24}}),D.createElement(kj.Container,null,D.createElement(kj,{title:e("my_profile_rapid-acting_insulin"),value:o,testID:"fast-acting-insulin",onPress:()=>{t.navigate(S2.RapidActingInsulin,{comingFrom:S2.Profile})},renderRightSlot:()=>D.createElement(K1,null)}),D.createElement(kj,{title:e("my_profile_long-acting_insulin"),value:s,testID:"long-acting-insulin",onPress:()=>{t.navigate(S2.LongActingInsulin,{comingFrom:S2.Profile})},renderRightSlot:()=>D.createElement(K1,null)})))}),{MMOL_L:eee}=NL.BloodGlucoseUnit,tee=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},spacing:{height:32},active:{opacity:1},inactive:{opacity:.5},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}}),nee=iF(()=>{const{t:e}=iV(),{COLORS:t}=bL(),{modalStoreActions:n}=j2(),{glucoseUnit:i,treatmentParameters:r}=Uq;if(void 0===i)throw new Error("[InsulinSettings::render] glucoseUnit is undefined.");if(void 0===r)throw new Error("[InsulinSettings::render] parameters from userSettings must be defined and non-null.");const a=r.use===NL.Usage.Overall,{text:o}=Kq(i),{carbohydrateRatio:s,insulinSensitivity:l}=r.overallParameters,[u,c]=M.useState(!1),[d,h]=M.useState(!1),[m,p]=M.useState(void 0),f=M.useMemo(()=>i===eee?D8:N8,[i]),_=M.useCallback(async e=>{const t=iZ(e,i,eee);if(t!==r.overallParameters.insulinSensitivity){const e={...r,overallParameters:{...r.overallParameters,insulinSensitivity:t}},n=await Uq.setUserSettings({parameters:e});p(n)}c(!1)},[i,r]),g=M.useCallback(async e=>{const t=Number(e.toFixed(1));if(t!==r.overallParameters.carbohydrateRatio){const e={...r,overallParameters:{...r.overallParameters,carbohydrateRatio:t}},n=await Uq.setUserSettings({parameters:e});p(n)}h(!1)},[r]),y=M.useMemo(()=>{const e=aZ(l,eee,i);return f.findIndex(t=>t===e)},[f,i,l]),v=M.useMemo(()=>L8.findIndex(e=>e===s.toFixed(1)),[s]),b=M.useCallback(()=>{!1===m&&n.set({showSyncErrorModal:!0}),p(void 0)},[n,m]),S=M.useCallback(async e=>{const t={...r,use:e?NL.Usage.Overall:NL.Usage.Intervals},i=await Uq.setUserSettings({parameters:t});n.set({showSyncErrorModal:!i})},[r,n]);return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"scroll",contentContainerStyle:tee.scrollView},D.createElement(J8,null),D.createElement(_a,{style:tee.spacing}),D.createElement(w7,null),D.createElement(_a,{style:tee.spacing}),D.createElement(kj.Container,{containerStyle:{backgroundColor:t.bgSecondary,borderColor:t.divider,borderWidth:1}},D.createElement(uz,{testID:"insulin-settings-overall-switch",title:e("fixed_insulin_settings_title"),message:e("fixed_insulin_settings_body"),value:a,onValueChange:S,style:tee.switchContainer}),D.createElement(R8,null),D.createElement(kj,{title:e("fixed_insulin_settings_carb_ratio_title"),value:`${s.toFixed(1)} ${e("fixed_insulin_settings_carb_ratio_unit")}`,testID:"carbohydrate-ratio",onPress:a?()=>{h(!0)}:void 0,containerStyle:a?tee.active:tee.inactive,valueStyle:a?{color:t.textTableHighlight}:{color:t.labelSecondary}}),D.createElement(kj,{title:e("fixed_insulin_settings_sensitivity_title"),value:`${aZ(l,eee,i)} ${e("fixed_insulin_settings_sensitivity_unit",{displayUnit:o})}`,testID:"insulin-sensitivity",onPress:a?()=>{c(!0)}:void 0,containerStyle:a?tee.active:tee.inactive,valueStyle:a?{color:t.textTableHighlight}:{color:t.labelSecondary}})),D.createElement(_a,{style:tee.spacing}),D.createElement(U8,null),D.createElement(_a,{style:tee.spacing}),D.createElement(H8,null)),D.createElement(n3,{isVisible:u,items:f,initialScrollIndex:y,onConfirm:_,onCancel:()=>{c(!1)},onModalHide:b,testID:"insulin_sensitivity_picker"}),D.createElement(n3,{isVisible:d,items:L8,initialScrollIndex:v,onConfirm:g,onCancel:()=>{h(!1)},onModalHide:b,testID:"insulin_to_carb_ratio_picker"}),D.createElement(V0,{onModalHide:()=>{p(void 0)}}))}),iee=()=>{const{t:e}=iV(),{Navigator:t,Screen:n}=O8();return d.jsxs(t,{screenOptions:t0,children:[d.jsx(n,{name:S2.InsulinSettings,component:nee,options:{title:e("insulin_settings_navigation")}}),d.jsx(n,{name:S2.TreatmentType,component:Q8,options:{title:e("treatment_type_navigation")}}),d.jsx(n,{name:S2.RapidActingInsulin,component:q8,options:{title:e("rapid-acting_insulin_navigation")}}),d.jsx(n,{name:S2.LongActingInsulin,component:Y8,options:{title:e("long-acting_insulin_navigation")}})]})},ree=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{Navigator:n,Screen:i}=ZQ();return d.jsxs(n,{screenOptions:{...n0,...BZ,headerStyle:{backgroundColor:t.bgNavigationBar}},children:[d.jsx(i,{name:S2.Settings,component:k8,options:{title:e("settings_navigation"),headerShown:!0,headerLeft:X2}}),d.jsx(i,{name:S2.ProfileStack,component:v8,options:{headerShown:!1}}),d.jsx(i,{name:S2.GlucoseSettings,component:X7,options:{title:e("glucose_navigation")}}),d.jsx(i,{name:S2.GlucoseUnit,component:J7,options:{title:e("glucose_unit_navigation")}}),d.jsx(i,{name:S2.ActivitySettings,component:V7,options:{title:e("physical_activity_navigation")}}),d.jsx(i,{name:S2.InsulinSettingsStack,component:iee,options:{headerShown:!1}}),d.jsx(i,{name:S2.Support,component:n8,options:{title:e("support_navigation")}}),d.jsx(i,{name:S2.Legal,component:e8,options:{title:e("legal_navigation")}})]})};function aee(){return d.jsx(v3,{style:oee.iframe,uri:"https://www.hedia.com/contact#contactsupport"})}const oee=Ei.create({iframe:{flex:1}}),{Navigator:see,Screen:lee,Group:uee}=ZQ(),cee=()=>{const{t:e}=iV(),t=M.useCallback(()=>d.jsx(X2,{}),[]),n=M.useCallback(()=>d.jsx(K2,{}),[]);return d.jsxs(see,{children:[d.jsxs(uee,{screenOptions:{headerShown:!1,animationEnabled:!0},children:[d.jsx(lee,{name:S2.NewCalculationStack,component:p7}),d.jsx(lee,{name:S2.SettingsTab,component:ree})]}),d.jsxs(uee,{screenOptions:i0,children:[d.jsx(lee,{name:S2.AddActivity,component:U0,options:{title:e("new_activity_navigation"),headerLeft:n}}),d.jsx(lee,{name:S2.FoodLibrary,component:g3,options:{title:e("food_library_sheet_navigation"),headerLeft:t}}),d.jsx(lee,{name:S2.AddCarbs,component:c0,options:{title:""}}),d.jsx(lee,{name:S2.CreateFood,component:c3,options:{title:"",gestureEnabled:!1}}),d.jsx(lee,{name:S2.IFU,component:S3,options:{title:e("IFU_navigation"),headerLeft:t}}),d.jsx(lee,{name:S2.SupportWebView,component:P3,options:{title:e("support_navigation"),headerLeft:t}}),d.jsx(lee,{name:S2.SupportContact,component:aee,options:{title:e("support_navigation"),headerLeft:t}})]})]})},dee=({title:e,subtitle:t,stepChecked:n,onAnimationFinished:i})=>{const{t:r}=iV(),{COLORS:a}=bL();return M.useEffect(()=>{i?.()},[i]),D.createElement(Xa,{contentContainerStyle:hee.container},D.createElement(gj,{style:hee.title},e),D.createElement(gj,{style:[hee.subtitle,{color:a.labelSecondary}]},t),D.createElement(_a,{style:hee.stepsWrapper},D.createElement(_a,{style:hee.stepContainer},D.createElement(gj,{style:1===n||2===n||3===n?{color:a.labelPrimary}:{color:a.labelSecondary}}," 1. "+r("overview1")),(1===n||2===n||3===n)&&D.createElement($1,null)),D.createElement(_a,{style:hee.stepContainer},D.createElement(gj,{style:2===n||3===n?{color:a.labelPrimary}:{color:a.labelSecondary}},"2. "+r("overview2")),(2===n||3===n)&&D.createElement($1,null)),D.createElement(_a,{style:hee.stepContainer},D.createElement(gj,{style:3===n?{color:a.labelPrimary}:{color:a.labelSecondary}},"3. "+r("overview3")),3===n&&D.createElement($1,null))))},hee=Ei.create({container:{flex:1,justifyContent:"center",paddingHorizontal:16},title:{...oj.bold_3XL,paddingHorizontal:16,marginBottom:4},subtitle:{...oj.regular_Base,paddingHorizontal:16,marginBottom:16},stepsWrapper:{padding:16,gap:8},stepContainer:{flexDirection:"row",alignItems:"center",gap:8}}),mee=()=>{const{t:e}=iV(),{setIsOnboardingFinished:t}=qz(),n=M.useCallback(()=>{setTimeout(()=>{t(!0)},1e3)},[t]);return D.createElement(dee,{title:e("guide_end_title"),subtitle:e("guide_end_body"),stepChecked:3,onAnimationFinished:n})},pee=({currentStep:e,text:t,onPress:n,inactive:i,isBackVisible:r=!0,onBackPress:a})=>{const{t:o}=iV(),{COLORS:s}=bL(),{goBack:l}=Wp();return M.createElement(SH,{style:[fee.container,{backgroundColor:s.bgNavigationBar,borderTopColor:s.divider}],edges:["bottom"]},M.createElement(_a,{style:fee.buttonsWrapper},r&&M.createElement(mj,{title:o("button_back"),onPress:a||l,testID:`back${e}`,style:fee.button,type:dj.Secondary}),M.createElement(mj,{title:t??o("button_next"),onPress:n,inactive:i,testID:`next${e}`,style:fee.button})))},fee=Ei.create({container:{borderTopWidth:1},buttonsWrapper:{flexDirection:"row",paddingHorizontal:16,paddingBottom:16,gap:8},button:{flex:1,marginTop:12}}),_ee=()=>{const{t:e}=iV(),{navigate:t}=Wp(),n=M.useCallback(()=>{t(w2.QuickGuideStack,{screen:w2.QuickGuide}),jX(FX.QuickGuideStartPress)},[t]);return D.createElement(D.Fragment,null,D.createElement(dee,{title:e("guide_quick_guide_title"),subtitle:e("guide_quick_guide_body"),stepChecked:2}),D.createElement(pee,{currentStep:1,isBackVisible:!1,onPress:n,text:e("button_start")}))},gee=()=>{const{t:e}=iV(),t=Wp(),n=M.useRef(null),[i,r]=M.useState(2),[a,o]=M.useState(0),{height:s,width:l}=vm(),u=M.useMemo(()=>[{title:e("guide_recent_insulin_title"),subtitle:e("guide_recent_insulin_body"),image:"/assets/webp/1_EN.webp"},{title:e("web_guide_no_import_title"),subtitle:e("web_guide_no_import_body"),image:"/assets/webp/2_EN.webp"},{title:e("guide_glucose_title"),subtitle:e("guide_glucose_body"),image:"/assets/webp/3_EN.webp"},{title:e("guide_carbohydrates_title"),subtitle:e("guide_carbohydrates_body"),image:"/assets/webp/4_EN.webp"},{title:e("guide_activity_title"),subtitle:e("guide_activity_body"),image:"/assets/webp/5_EN.webp"},{title:e("guide_summary_title"),subtitle:e("onboarding_quick_guide_text"),image:"/assets/webp/6_EN.webp"},{title:e("guide_recommendation_title"),subtitle:e("guide_recommendation_body"),image:"/assets/webp/7_EN.webp"}],[e]),c=M.useCallback(e=>{switch(e-1){case 1:return FX.QuickGuideBackPressStep1;case 2:return FX.QuickGuideBackPressStep2;case 3:return FX.QuickGuideBackPressStep3;case 4:return FX.QuickGuideBackPressStep4;case 5:return FX.QuickGuideBackPressStep5;case 6:return FX.QuickGuideBackPressStep6;case 7:return FX.QuickGuideBackPressStep7;default:throw new Error("[QuickGuide::getTrackingEventBackPress] Invalid step")}},[]),h=M.useCallback(e=>{switch(e-1){case 1:return FX.QuickGuideNextPressStep1;case 2:return FX.QuickGuideNextPressStep2;case 3:return FX.QuickGuideNextPressStep3;case 4:return FX.QuickGuideNextPressStep4;case 5:return FX.QuickGuideNextPressStep5;case 6:return FX.QuickGuideNextPressStep6;default:throw new Error("[QuickGuide::getTrackingEventNextPress] Invalid step")}},[]),m=M.useCallback(()=>{if(a===u.length-1)jX(FX.QuickGuideFinishPress),t.navigate(w2.QuickGuideAllSet);else{const e=a+1;n.current?.scrollToIndex({index:e,animated:!0}),r(i+1),o(e);const t=h(i);jX(t)}},[a,i,h,t,u.length]),p=M.useCallback(()=>{if(0===a)t.navigate(w2.QuickGuideStart);else{const e=a-1;n.current?.scrollToIndex({index:e,animated:!0}),r(i-1),o(e)}const e=c(i);jX(e)},[a,i,c,t]);return d.jsxs(d.Fragment,{children:[d.jsx(Wo,{ref:n,data:u,initialNumToRender:1,renderItem:({item:e,index:t})=>1===t?(e=>d.jsxs(_a,{style:[yee.container,{width:l}],children:[d.jsx(tj,{colors:cj.gradientQuickGuide,style:yee.gradient}),d.jsx(_a,{style:{flex:1,justifyContent:"flex-end"},children:d.jsx(Js,{source:e.image,style:{height:JR(s/5,140,180),width:JR(s/5,140,180),zIndex:10},resizeMode:"stretch"})}),d.jsxs(_a,{style:[yee.textContainer,{flex:1,justifyContent:"center"}],children:[d.jsx(gj,{style:yee.title,maxFontSizeMultiplier:uj,children:e.title}),d.jsx(gj,{style:yee.subtitle,maxFontSizeMultiplier:uj,children:e.subtitle})]})]}))(e):d.jsxs(_a,{style:[yee.container,{width:l}],children:[d.jsx(Js,{source:e.image,style:yee.image,resizeMode:"contain"}),d.jsx(tj,{colors:cj.gradientQuickGuide,locations:[.45,.64],style:yee.gradient}),d.jsxs(_a,{style:yee.textContainer,children:[d.jsx(gj,{style:yee.title,maxFontSizeMultiplier:uj,children:e.title}),d.jsx(gj,{style:yee.subtitle,maxFontSizeMultiplier:uj,children:e.subtitle})]})]}),scrollEnabled:!1,horizontal:!0,showsHorizontalScrollIndicator:!1}),d.jsx(pee,{currentStep:i,onPress:m,onBackPress:p,text:a===u.length-1?e("button_complete"):e("button_next")})]})},yee=Ei.create({container:{flex:1,alignItems:"center"},image:{position:"absolute",width:"100%",height:"100%",marginTop:32,marginBottom:14},textContainer:{marginTop:"auto",minHeight:Ws.getFontScale()>sj?165:155,backgroundColor:cj.bgTransparent},title:{...oj.bold_2XL,marginBottom:4,paddingHorizontal:16,textAlign:"center"},subtitle:{...oj.medium_SM,color:cj.labelSecondary,paddingHorizontal:Ws.getFontScale()>sj?16:32,textAlign:"center"},gradient:{position:"absolute",top:"16%",bottom:0,left:0,right:0}}),vee=()=>{const{Navigator:e,Screen:t}=O8(),{COLORS:n}=bL();return d.jsxs(e,{screenOptions:{...t0,headerStyle:{backgroundColor:n.bgNavigationBar},headerShown:!1},children:[d.jsx(t,{name:w2.QuickGuideStart,component:_ee}),d.jsx(t,{name:w2.QuickGuide,component:gee}),d.jsx(t,{name:w2.QuickGuideAllSet,component:mee})]})};function bee({onOptionSelect:e,setNextEnabled:t,ref:n}){const{t:i}=iV(),{COLORS:r}=bL(),{width:a}=vm(),[o,s]=M.useState(null),l=M.useCallback(n=>{s(n),e(n),t(!0)},[e,t]);return M.useImperativeHandle(n,()=>({onBackPress(){jX(FX.SetupOptionsBackPress)},onNextPressed:()=>null!==o?(jX(FX.SetupOptionsNextPress),t(!0),{transitionAllowed:!0}):(t(!1),{transitionAllowed:!1}),validateData:()=>({isValid:null!==o})}),[o,t]),D.createElement(Xa,{contentContainerStyle:[See.container,{width:a}]},D.createElement(gj,{style:[See.header,{color:r.labelPrimary}]},i("insulin_settings_title")),D.createElement(_a,{style:See.buttonsContainer},D.createElement(mj,{title:i("insulin_settings_button_yes"),testID:"insulin_settings_yes",onPress:()=>{l("yes")},type:"yes"===o?dj.Primary:dj.Secondary,style:See.button}),D.createElement(mj,{title:i("insulin_settings_button_no"),testID:"insulin_settings_no",onPress:()=>{l("no")},type:"no"===o?dj.Primary:dj.Secondary,style:See.button})))}const See=Ei.create({container:{flex:1,paddingHorizontal:16,paddingTop:32},header:{...oj.semiBold_2XL,paddingHorizontal:16,marginBottom:24},buttonsContainer:{flexDirection:"row",marginBottom:24,gap:12},button:{flex:1}});function wee({setNextEnabled:e,ref:t}){const{t:n}=iV(),{COLORS:i}=bL(),{width:r}=vm(),{bottom:a}=pH(),{birthday:o,biologicalSex:s,diabetesType:l,bloodGlucoseUnits:u}=U2(),{setSetupCalculatorStoreValues:c}=z2(),d=Wp(),[h,m]=M.useState(!1),[p,f]=M.useState(!1),[_,g]=M.useState(""),[y,v]=M.useState(!1),b=M.useCallback(e=>{const t=new Date(e);t.setHours(0,0,0,0);const i=new Date;i.setHours(0,0,0,0);gY(i,t)>=18?(c({birthday:t.toISOString()}),g("")):(c({birthday:void 0}),g(n("birthday_error")))},[c,n]),S=M.useCallback(e=>{b(e),m(!1)},[b]),w=M.useCallback(()=>{c({diabetesType:NL.DiabetesType.Type2}),f(!0)},[c]),k=M.useCallback(()=>!!(o&&s&&l&&u),[o,u,l,s]);return M.useEffect(()=>{const t=k();e(t)},[e,k]),M.useImperativeHandle(t,()=>({onBackPress(){jX(FX.SetupGeneralBackPress)},onNextPressed:()=>{v(!0),!o&&g(n("birthday_error"));return k()?(e(!0),jX(FX.SetupGeneralNextPress),{transitionAllowed:!0}):(e(!1),{transitionAllowed:!1})},validateData:()=>({isValid:k()})}),[o,n,k,e]),D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"step_2",contentContainerStyle:[kee.container,{width:r}]},D.createElement(Ej,{title:n("general_birthday_title")}),D.createElement(ZB,{isAnimated:!!_},D.createElement(kj,{testID:"birthday",title:n("general_input_birthday"),subtitle:o?new Date(o).toLocaleDateString():"",errorMessage:_,containerStyle:kee.wrapper,onPress:()=>{m(!0)}})),D.createElement(_a,{style:kee.wrapper},D.createElement(Ej,{title:n("biological_sex_title")}),D.createElement(ZB,{isAnimated:y&&!s},D.createElement(kj,{title:n("my_profile_sex"),testID:"biological-sex",value:s?lV[s]():"-",onPress:()=>{d.navigate(w2.BiologicalSex)},renderRightSlot:()=>D.createElement(K1,null),errorMessage:y&&!s?n("diabetes_error"):void 0}))),D.createElement(_a,{style:kee.wrapper},D.createElement(Ej,{title:n("type_of_diabetes_title")}),D.createElement(ZB,{isAnimated:y&&!l,errorMessage:n("diabetes_error")},D.createElement(_a,{style:[kee.row,{backgroundColor:i.bgSegmentContainer}]},D.createElement(xj,{title:n("type_of_diabetes_type1"),isActive:l===NL.DiabetesType.Type1,testID:"type-1",onPress:()=>{c({diabetesType:NL.DiabetesType.Type1})},isError:y&&!l}),D.createElement(xj,{title:n("type_of_diabetes_type2"),isActive:l===NL.DiabetesType.Type2,testID:"type-2",onPress:w,isError:y&&!l})))),D.createElement(_a,{style:kee.wrapper},D.createElement(Ej,{title:n("glucose_unit_title")}),D.createElement(ZB,{isAnimated:y&&!u,errorMessage:n("glucose_unit_error")},D.createElement(Z7,{glucoseUnit:u,onPressMMOLL:()=>{c({bloodGlucoseUnits:NL.BloodGlucoseUnit.MMOL_L})},onPressMGDL:()=>{c({bloodGlucoseUnits:NL.BloodGlucoseUnit.MG_DL})},isError:y&&!u})))),dV?D.createElement(x5,{testID:"birthday-date-picker",display:"spinner",date:o?new Date(o):new Date,isVisible:h,onConfirm:S,onCancel:()=>{m(!1)},cancelTextIOS:n("button_cancel"),confirmTextIOS:n("button_confirm"),pickerStyleIOS:kee.alignCenter,modalStyleIOS:{paddingBottom:a},minimumDate:new Date(1900,0,1),maximumDate:new Date(2100,0,1)}):D.createElement(h8,{isVisible:h,initialValue:o?new Date(o):new Date,onConfirm:S,onCancel:()=>{m(!1)}}),D.createElement(lz,{isVisible:p,title:n("modal_diabetes2_title"),message:n("modal_diabetes2_body"),buttons:[{title:n("button_close"),testID:"type2-modal-understood-button",onPress:()=>{f(!1)}}]}))}const kee=Ei.create({container:{paddingTop:32,paddingHorizontal:16},wrapper:{marginBottom:24},row:{flexDirection:"row",padding:2,borderRadius:16},alignCenter:{alignSelf:"center"}});function Cee({setNextEnabled:e,ref:t}){const{t:n}=iV(),{width:i}=vm(),{parameters:r,treatmentType:a,fastActingInsulin:o,longActingInsulin:s}=U2(),{setSetupCalculatorStoreValues:l}=z2(),{navigate:u}=Wp(),[c,d]=M.useState(!1);M.useEffect(()=>{r||l({parameters:zq(0,0,NL.Usage.Overall)})},[r,l]),M.useEffect(()=>{e(!!a)},[e,a]),M.useImperativeHandle(t,()=>({onBackPress(){jX(FX.SetupTreatmentBackPress)},onNextPressed:()=>(d(!0),a?(e(!0),jX(FX.SetupTreatmentNextPress),{transitionAllowed:!0}):(e(!1),{transitionAllowed:!1})),validateData:()=>({isValid:!!a})}),[e,a]);const h=a?LX(NL.InjectionMethod,a):void 0,m=(h&&Z8[h]())??"-",p=(o&&$8[o]())??"-",f=(s&&G8[s]())??"-";return D.createElement(_a,{testID:"step_3",style:[Eee.container,{width:i}]},D.createElement(ZB,{isAnimated:c&&!a},D.createElement(kj,{title:n("treatment_type_input"),value:m,testID:"treatment-type",renderRightSlot:()=>D.createElement(K1,null),onPress:()=>{u(w2.TreatmentType,{comingFrom:w2.Setup})},errorMessage:c&&!a?n("treatment_type_input_error"):void 0})),D.createElement(_a,null,D.createElement(Ej,{title:n("treatment_type_insulin_title")}),D.createElement(kj.Container,null,D.createElement(kj,{title:n("Rapid-acting_insulin_input"),value:p,testID:"fast-acting",renderRightSlot:()=>D.createElement(K1,null),displayType:Sj.ListItem,onPress:()=>{u(w2.RapidActingInsulin,{comingFrom:w2.Setup})}}),D.createElement(kj,{title:n("long-acting_insulin_input"),value:f,testID:"long-acting",renderRightSlot:()=>D.createElement(K1,null),displayType:Sj.ListItem,onPress:()=>{u(w2.LongActingInsulin,{comingFrom:w2.Setup})}}))))}const Eee=Ei.create({container:{paddingHorizontal:16,paddingVertical:32,gap:24}}),Iee=PX(10,350);function xee({setNextEnabled:e,ref:t}){const{t:n}=iV(),{COLORS:i}=bL(),{width:r}=vm(),{bloodGlucoseUnits:a,parameters:o}=U2();if(!a||!o)throw new Error("[Step4::render] are not defined");const s=G2(),{setSetupCalculatorStoreValues:l,setTotalDailyDosage:u}=z2(),[c,d]=M.useState(!1),[h,m]=M.useState(void 0),p=M.useMemo(()=>{if(!s)return{carbohydrateRatio:0,insulinSensitivityMMOLL:0};return{carbohydrateRatio:parseFloat((500/s).toFixed(1)),insulinSensitivityMMOLL:Number(P8.DividendNumber)/s}},[s]);M.useEffect(()=>{const{carbohydrateRatio:e,insulinSensitivityMMOLL:t}=p,n=zq(t,e,NL.Usage.Overall);l({parameters:n})},[a,p,l]);const f=M.useMemo(()=>s?Iee.findIndex(e=>e===s.toString()):Iee.findIndex(e=>e===50..toString()),[s]);M.useImperativeHandle(t,()=>({onBackPress(){jX(FX.SetupTDDBackPress)},onNextPressed:()=>s?(jX(FX.SetupTDDNextPress),e(!0),{transitionAllowed:!0}):(m(n("insulin_settings_input_error",{inputTypeTranslated:n("daily_insulin_dosage_input")})),e(!1),{transitionAllowed:!1}),validateData:()=>({isValid:!!s})}),[e,s,n]);const _=M.useCallback(t=>{u(t),d(!1),m(void 0),e(!0)},[e,u]),{text:g}=M.useMemo(()=>Kq(a),[a]),y=M.useMemo(()=>`${aZ(o.overallParameters.insulinSensitivity,NL.BloodGlucoseUnit.MMOL_L,a)} ${n("fixed_insulin_settings_sensitivity_unit",{displayUnit:g})}`,[o,g,n,a]),v=M.useMemo(()=>o.overallParameters.carbohydrateRatio+" "+n("insulin_helper_carb_ratio_unit"),[o,n]);return D.createElement(D.Fragment,null,D.createElement(Xa,{contentContainerStyle:[Tee.container,{width:r}]},D.createElement(_a,null,D.createElement(Ej,{title:n("daily_insulin_dosage_title")}),D.createElement(gj,{style:[Tee.subheader,{color:i.labelSecondary}]},n("daily_insulin_dosage_body")),D.createElement(ZB,{isAnimated:!!h},D.createElement(kj,{testID:"daily_insulin_dosage",title:n("daily_insulin_dosage_input"),value:`${s??"-"} ${n(1===s?"unit":"units")}`,onPress:()=>{d(!0)},errorMessage:h}))),!!s&&D.createElement(_a,{style:[Tee.explanation,{backgroundColor:i.bgSecondary}]},D.createElement(gj,{style:[Tee.text,{color:i.labelSecondary}]},n("insulin_helper_body")),D.createElement(_a,{style:Tee.row},D.createElement(gj,{style:[Tee.textSemiBold,{color:i.labelSecondary}]},n("insulin_helper_carb_ratio_input")),D.createElement(gj,{style:[Tee.textSemiBold,{color:i.labelSecondary}]},v)),D.createElement(R8,null),D.createElement(_a,{style:Tee.row},D.createElement(gj,{style:[Tee.textSemiBold,{color:i.labelSecondary}]},n("insulin_helper_insulin_sensitivity_input")),D.createElement(gj,{style:[Tee.textSemiBold,{color:i.labelSecondary}]},y))),D.createElement(w7,null),D.createElement(_a,null,D.createElement(H8,null))),D.createElement(n3,{testID:"daily_insulin_dosage_picker",onCancel:()=>{d(!1)},onConfirm:_,initialScrollIndex:f,isVisible:c,items:Iee}))}const Tee=Ei.create({container:{paddingVertical:32,paddingHorizontal:16,gap:24},subheader:{...oj.regular_SM,marginBottom:8},explanation:{borderRadius:8,padding:16},row:{flexDirection:"row",justifyContent:"space-between"},text:{...oj.regular_SM,marginBottom:16},textSemiBold:{...oj.medium_SM,paddingVertical:16}});function Oee({setNextEnabled:e,ref:t}){const{t:n}=iV(),{width:i}=vm(),{bloodGlucoseUnits:r,parameters:a}=U2();if(!a||!r)throw new Error("[Step5::render] setupCalculatorStoreValues are not defined");const{setSetupCalculatorStoreValues:o,setTotalDailyDosage:s}=z2(),[l,u]=M.useState(void 0),[c,d]=M.useState(void 0),[h,m]=M.useState(!1),[p,f]=M.useState(!1),{text:_}=M.useMemo(()=>Kq(r),[r]),{carbohydrateRatio:g,insulinSensitivity:y}=M.useMemo(()=>a.overallParameters,[a]),v=M.useCallback(e=>{const t=n("IS"===e?"insulin_sensitivity_input":"insulin-to-carb_ratio_input");return n("insulin_settings_input_error",{inputTypeTranslated:t})},[n]);M.useEffect(()=>{e(!(!y||!g))},[g,y,e]),M.useImperativeHandle(t,()=>({onBackPress(){jX(FX.SetupInsulinBackPress)},onNextPressed:()=>g||y?g?y?(d(void 0),u(void 0),s(null),e(!0),jX(FX.SetupInsulinNextPress),{transitionAllowed:!0}):(e(!1),u(v("IS")),{transitionAllowed:!1}):(d(v("ICR")),e(!1),{transitionAllowed:!1}):(d(v("ICR")),u(v("IS")),e(!1),{transitionAllowed:!1}),validateData:()=>({isValid:!(!g||!y)})}),[g,y,s,e,v]);const b=M.useCallback(e=>{const t=iZ(e,r,NL.BloodGlucoseUnit.MMOL_L);o({parameters:{...a,overallParameters:{...a.overallParameters,insulinSensitivity:t}}}),s(null),u(void 0),m(!1)},[r,a,o,s]),S=M.useCallback(e=>{const t=Number(e.toFixed(1));a.overallParameters.carbohydrateRatio=t,o({parameters:{...a,overallParameters:{...a.overallParameters,carbohydrateRatio:t}}}),s(null),d(void 0),f(!1)},[a,o,s]),w=M.useMemo(()=>r===NL.BloodGlucoseUnit.MMOL_L?D8:N8,[r]),k=M.useMemo(()=>{const e=r===NL.BloodGlucoseUnit.MMOL_L?2..toFixed(1):36..toString();if(0===y)return w.findIndex(t=>t===e);const t=aZ(y,NL.BloodGlucoseUnit.MMOL_L,r);return w.findIndex(e=>e===t)},[w,r,y]),C=M.useMemo(()=>0===g?L8.findIndex(e=>e===10..toFixed(1)):L8.findIndex(e=>e===g.toFixed(1)),[g]),E=M.useMemo(()=>{const e=aZ(y,NL.BloodGlucoseUnit.MMOL_L,r);return`${y?e:"-"} ${n("fixed_insulin_settings_sensitivity_unit",{displayUnit:_})}`},[y,r,_,n]);return D.createElement(D.Fragment,null,D.createElement(Xa,{contentContainerStyle:[Ree.contentContainer,{width:i}]},D.createElement(_a,null,D.createElement(Ej,{title:n("insulin-to-carb_ratio_title")}),D.createElement(ZB,{isAnimated:!!c},D.createElement(kj,{title:n("insulin-to-carb_ratio_input"),value:`${g||"-"} ${n("fixed_insulin_settings_carb_ratio_unit")}`,testID:"carb_ratio",onPress:()=>{f(!0)},errorMessage:c}))),D.createElement(_a,null,D.createElement(Ej,{title:n("insulin_sensitivity_title")}),D.createElement(ZB,{isAnimated:!!l},D.createElement(kj,{title:n("insulin_sensitivity_input"),value:E,testID:"insulin_sensitivity",onPress:()=>{m(!0)},errorMessage:l}))),D.createElement(w7,null),D.createElement(H8,null)),D.createElement(n3,{testID:"insulin_sensitivity_picker",isVisible:h,items:w,initialScrollIndex:k,onConfirm:b,onCancel:()=>{m(!1)}}),D.createElement(n3,{testID:"insulin_to_carb_ratio_picker",isVisible:p,items:L8,initialScrollIndex:C,onConfirm:S,onCancel:()=>{f(!1)}}))}const Ree=Ei.create({contentContainer:{paddingVertical:32,paddingHorizontal:16,gap:24}});const Aee=Ei.create({scrollContent:{paddingHorizontal:16,paddingVertical:32},spacer:{height:32},itemStyle:{paddingHorizontal:0}}),Lee=iF(function({setNextEnabled:e,ref:t}){const{t:n}=iV(),{COLORS:i}=bL(),{width:r}=vm(),{fastActingInsulin:a,longActingInsulin:o,bloodGlucoseUnits:s,parameters:l,treatmentType:u,diabetesType:c,birthday:d,biologicalSex:h}=U2(),m=G2(),{modalStoreActions:p}=j2(),f=M.useCallback(async()=>{if(void 0===s)throw new Error("[Step6::setUserSettings] bloodGlucoseUnits from userSettingsManager is undefined.");if(void 0===c)throw new Error("[Step6::setUserSettings] diabetesType from userSettingsManager is undefined.");if(void 0===l)throw new Error("[Step6::setUserSettings] parameters from newUserSettingsManager is undefined.");if(void 0===d)throw new Error("[Step6::setUserSettings] birthday from newUserSettingsManager is undefined.");if(void 0===h)throw new Error("[Step6::setUserSettings] biologicalSex from newUserSettingsManager is undefined.");const{carbohydrateRatio:e,insulinSensitivity:t}=l.overallParameters,n=zq(t,e,NL.Usage.Overall);return Uq.setUserSettings({parameters:n,activity:S7(),notifications:{medicineNotification:{toggle:!1,dailyReminderTime:"19:00"},remeasurementNotification:{toggle:!0,remeasurement:1.5}},glucoseLevelTargets:{targetBGLIntervals:[{startTime:"00:00",target:8},{startTime:"05:00",target:6},{startTime:"09:00",target:7},{startTime:"11:00",target:6},{startTime:"13:00",target:7},{startTime:"18:00",target:6},{startTime:"22:00",target:8}],overallTargetBGL:{startTime:"00:00",target:6},use:NL.Usage.Intervals},bloodGlucoseUnits:s,fastActingInsulin:a,longActingInsulin:o,treatmentType:u,diabetesType:c,birthday:d,biologicalSex:h})},[d,s,c,a,h,o,l,u]);M.useImperativeHandle(t,()=>({onBackPress(){jX(FX.SetupSummaryBackPress)},onNextPressed:async()=>{jX(FX.SetupSummaryFinishPress);const t=await f();return t?e(!0):p.set({showSyncErrorModal:!0}),{transitionAllowed:t}},validateData:()=>({isValid:!0})}),[e,p,f]);const _=M.useMemo(()=>{if(void 0===s)throw new Error("[Step6::generalTreatmentItems] bloodGlucoseUnits is undefined");if(void 0===u)throw new Error("[Step6::generalTreatmentItems] treatmentType is undefined");if(void 0===c)throw new Error("[Step6::generalTreatmentItems] diabetesType is undefined");const{text:e}=Kq(s),t=LX(NL.InjectionMethod,u),i=c===NL.DiabetesType.Type1?"type_of_diabetes_type1":"type_of_diabetes_type2";return[{label:n("summary_setup_input_diabetes_type"),value:n(i),testID:"diabetes-type-result"},{label:n("summary_setup_input_treatment_type"),value:Z8[t](),testID:"treatment-type-result"},{label:n("summary_setup_input_glucose_unit"),value:e,testID:"glucose-result"},{label:n("summary_setup_input_rapid-acting_insulin"),value:(a&&$8[a]())??"-",testID:"fast-acting-result"},{label:n("summary_setup_input_long-acting_insulin_input"),value:(o&&G8[o]())??"-",testID:"long-acting-result"}]},[s,c,a,o,u,n]),g=M.useMemo(()=>{if(void 0===s)throw new Error("[Step6::insulinFactorsItems] bloodGlucoseUnits is undefined");const{text:e}=Kq(s),{carbohydrateRatio:t,insulinSensitivity:i}=l?.overallParameters??{};if(void 0===t||void 0===i)throw new Error("[Step6::insulinFactorsItems] carbohydrateRatio or insulinSensitivity is undefined");return[m?{label:n("summary_setup_input_daily_dose_input"),value:m.toFixed(0),unit:n("units"),testID:"total-daily-insulin-result"}:null,{label:n("summary_setup_input_insulin-to-carb_input"),value:`${t}`,unit:n("summary_setup_insulin-to-carb_unit"),testID:"carb-ratio-result"},{label:n("summary_setup_input_insulin_sensitivity_input"),value:aZ(i,NL.BloodGlucoseUnit.MMOL_L,s),unit:n("summary_setup_insulin_sensitivity_unit",{displayUnit:e}),testID:"insulin-sensitivity-result"}].filter(e=>null!==e)},[s,l?.overallParameters,n,m]);return D.createElement(Xa,{testID:"scroll",contentContainerStyle:[Aee.scrollContent,{width:r}]},D.createElement(w7,null),D.createElement(_a,{style:Aee.spacer}),D.createElement(Ej,{title:n("summary_setup_general_title")}),_.map(({testID:e,label:t,value:n,unit:r})=>D.createElement(kj,{key:e,testID:e,title:t,displayStyle:wj.List,displayType:Sj.ListItem,style:Aee.itemStyle,titleStyle:{color:i.labelPrimary},valueStyle:{color:i.labelSecondary},value:`${n} ${r??""}`})),D.createElement(_a,{style:Aee.spacer}),D.createElement(Ej,{title:n("summary_setup_insuling_settings_title")}),g.map(({testID:e,label:t,value:n,unit:r})=>D.createElement(kj,{key:e,testID:e,title:t,displayStyle:wj.List,displayType:Sj.ListItem,style:Aee.itemStyle,titleStyle:{color:i.labelPrimary},valueStyle:{color:i.labelSecondary},value:`${n} ${r??""}`})),D.createElement(V0,null))}),Pee=()=>{const{t:e}=iV(),{width:t}=vm(),{clear:n}=z2(),{setHasCompletedSetupFlow:i}=qz(),r=Wp(),[a,o]=M.useState(2),[s,l]=M.useState(0),[u,c]=M.useState(0),[d,h]=M.useState(!1),[m,p]=M.useState(!1),f=M.useRef(null),_=M.useRef(null);M.useEffect(()=>{n()},[n]);const g=M.useCallback(e=>{h(e)},[]),y=M.useCallback(e=>{p("yes"===e)},[]),v=M.useMemo(()=>[{title:e("general_navigation"),stepNumber:2,renderComponent:e=>D.createElement(wee,{ref:e,setNextEnabled:g})},{title:e("treatment_navigation"),stepNumber:3,renderComponent:e=>D.createElement(Cee,{ref:e,setNextEnabled:g})},{title:e("insulin_settings_navigation"),stepNumber:4,renderComponent:e=>D.createElement(bee,{ref:e,onOptionSelect:y,setNextEnabled:g})},{title:e("insulin_settings_navigation"),stepNumber:4,renderComponent:e=>m?D.createElement(Oee,{ref:e,setNextEnabled:g}):D.createElement(xee,{ref:e,setNextEnabled:g})},{title:e("summary_setup_navigation"),stepNumber:5,renderComponent:e=>D.createElement(Lee,{ref:e,setNextEnabled:g})}],[y,g,m,e]);M.useEffect(()=>{r.setOptions({title:v[s].title})},[s,r,v]),M.useEffect(()=>{if(!_.current)return;const{isValid:e}=_.current.validateData();h(e)},[s,v]);const b=M.useCallback(async()=>{if(!_.current)return;const{transitionAllowed:e}=await _.current.onNextPressed();if(e)if(s===v.length-1)i(!0),r.dispatch(km({index:0,routes:[{name:w2.QuickGuideStack}]}));else{const e=s+1;f.current?.scrollToIndex({index:e,animated:!0}),o(v[e].stepNumber),l(e),c(t=>Math.max(t,e))}},[s,v,r,i]),S=M.useCallback(()=>{if(_.current?.onBackPress(),0===s)r.goBack();else{const e=s-1;f.current?.scrollToIndex({index:e,animated:!0}),o(v[e].stepNumber),l(e),c(t=>Math.max(t,e))}},[s,r,v]);return Yp(M.useCallback(()=>{const e=Au.addEventListener("hardwareBackPress",()=>(S(),!0));return()=>{e.remove()}},[S])),D.createElement(D.Fragment,null,D.createElement(Wo,{ref:f,data:v,renderItem:({item:e,index:n})=>n<=u?e.renderComponent(n===s?_:null):D.createElement(_a,{style:{width:t}}),scrollEnabled:!1,horizontal:!0,initialNumToRender:1,showsHorizontalScrollIndicator:!1}),D.createElement(pee,{currentStep:a,onPress:b,onBackPress:S,inactive:!d,text:s===v.length-1?e("button_complete"):e("button_next")}))},{HEDIA_ACCOUNT_CALLBACK:Mee="",LICENSING_BASE_URL:Dee=""}=Wj;var Nee=(e=>(e.InactiveLicense="/problems/inactive-license",e.InvalidLicense="/problems/invalid-license",e.LicenseNotFound="/problems/license-not-found",e))(Nee||{});const Fee=GB({type:YB("/problems/license-not-found"),title:BB(),status:YB(NL.StatusCode.BAD_REQUEST),detail:BB()}),Bee=GB({type:YB("/problems/invalid-license"),title:BB(),status:YB(NL.StatusCode.BAD_REQUEST),detail:BB()}),jee=GB({type:YB("/problems/inactive-license"),title:BB(),status:YB(NL.StatusCode.BAD_REQUEST),detail:BB()}),Vee=GB({isActive:VB(),key:BB(),startDate:BB(),type:$B(["perpetual","subscription","time-limited"]),endDate:BB().optional(),duration:$B(["P1M","P3M","P6M","P12M"]).optional()});function Hee(e=2){const{setIsLicenseValid:t}=qz(),[n,i]=M.useState(0);return{checkLicense:M.useCallback(async r=>{try{const a=await(async()=>{const e=await VX(Dee+"/check-license?product=HDA"),t=await e.json();if(e.status===NL.StatusCode.OK)return Vee.parse(t);if(e.status===NL.StatusCode.BAD_REQUEST){if(Fee.safeParse(t).success)return Fee.parse(t);if(Bee.safeParse(t).success)return Bee.parse(t);if(jee.safeParse(t).success)return jee.parse(t)}throw Error(`licensing:: Check License failed: ${e.status} - ${t.type||"Unknown error"}`)})();if(n>=e)return void t(!0);if(a.type===Nee.InactiveLicense)return t(!1),await(async()=>{const e=await VX(Dee+"/activate-license",{method:NL.HTTPRequestMethod.POST,headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({product:"HDA"})});return await e.json()})(),void i(e=>e+1);if(a.type===Nee.InvalidLicense||a.type===Nee.LicenseNotFound)return void r(a.type);if(a.isActive)return t(!0),void i(0);t(!1),r()}catch(a){console.error("[useLicenseChecker]",a),t(!0)}},[t,n,e]),retryCount:n}}const zee=({isVisible:e,onCancelPress:t,onContinuePress:n,onModalHide:i})=>{const{t:r}=iV(),{COLORS:a}=bL(),[o,s]=M.useState([!1,!1,!1]),[l,u]=M.useState(!1),c=M.useMemo(()=>o.every(Boolean),[o]);M.useEffect(()=>{e&&(s([!1,!1,!1]),u(!1))},[e]);const d=M.useCallback(e=>{s(t=>t.map((t,n)=>n===e?!t:t))},[]),h=M.useCallback(()=>{l&&c&&i()},[c,l,i]),m=M.useCallback(()=>{u(!0),n()},[n]);return D.createElement(lz,{testID:"restrictions_modal",isVisible:e,enableScroll:!0,onModalHide:h,containerStyle:{backgroundColor:a.bgModal},buttons:[{testID:"restrictions_continue_button",title:r("welcome_modal_button_confirm"),onPress:m,disabled:!c},{testID:"restrictions_cancel_button",title:r("button_cancel"),type:dj.Secondary,onPress:t}]},D.createElement(gj,{style:Uee.title},r("welcome_modal_title")),D.createElement(gj,{style:[Uee.subtitle,{color:a.labelSecondary}]},r("welcome_modal_body")),D.createElement(eh,{testID:"restrictions_checkmark_1",onPress:()=>{d(0)},style:({pressed:e})=>[{opacity:e?.5:1},Uee.checkmarkContainer]},o[0]?D.createElement(q1,null):D.createElement(X1,null),D.createElement(_a,{style:Uee.checkmarkTextContainer},D.createElement(gj,{style:Uee.checkmarkTitle},r("welcome_modal_years_title")),D.createElement(gj,{style:[Uee.checkmarkSubtitle,{color:a.labelSecondary}]},r("welcome_modal_years_body")))),D.createElement(_a,{style:[Uee.separatorLine,{backgroundColor:a.divider}]}),D.createElement(eh,{testID:"restrictions_checkmark_2",onPress:()=>{d(1)},style:({pressed:e})=>[{opacity:e?.5:1},Uee.checkmarkContainer]},o[1]?D.createElement(q1,null):D.createElement(X1,null),D.createElement(_a,{style:Uee.checkmarkTextContainer},D.createElement(gj,{style:Uee.checkmarkTitle},r("welcome_modal_pregnancy_title")),D.createElement(gj,{style:[Uee.checkmarkSubtitle,{color:a.labelSecondary}]},r("welcome_modal_pregnancy_body")))),D.createElement(_a,{style:[Uee.separatorLine,{backgroundColor:a.divider}]}),D.createElement(eh,{testID:"restrictions_checkmark_3",onPress:()=>{d(2)},style:({pressed:e})=>[{opacity:e?.5:1},Uee.checkmarkContainer]},o[2]?D.createElement(q1,null):D.createElement(X1,null),D.createElement(_a,{style:Uee.checkmarkTextContainer},D.createElement(gj,{style:Uee.checkmarkTitle},r("welcome_modal_gestational_title")),D.createElement(gj,{style:[Uee.checkmarkSubtitle,{color:a.labelSecondary}]},r("welcome_modal_gestational_body")))))},Uee=Ei.create({title:{...oj.bold_2XL,marginBottom:8},subtitle:{...oj.regular_Base,marginBottom:16},checkmarkContainer:{paddingVertical:16,flexDirection:"row",justifyContent:"space-between"},checkmarkTextContainer:{flex:1,marginLeft:8},checkmarkTitle:{...oj.semiBold_Base,marginBottom:2},checkmarkSubtitle:{...oj.regular_SM},separatorLine:{width:"100%",height:1}}),Gee=iF(()=>{const{t:e}=iV(),{navigate:t}=Wp(),{clear:n}=z2(),{isLicenseValid:i}=qz(),{checkLicense:r}=Hee(),[a,o]=M.useState(!1);M.useEffect(()=>{n(),uV||r(e=>{t(w2.LicensingStatus,e&&{errorType:e})}).catch(console.error)},[r,n,t]);const s=M.useCallback(()=>{o(!0),jX(FX.SetupIntroStartPress)},[]);return uV||i?D.createElement(D.Fragment,null,D.createElement(dee,{title:e("setup_account_title"),subtitle:e("setup_account_body"),stepChecked:1}),D.createElement(pee,{currentStep:1,isBackVisible:!1,onPress:s,text:e("button_start")}),D.createElement(zee,{isVisible:a,onCancelPress:()=>{o(!1)},onContinuePress:()=>{o(!1)},onModalHide:()=>{t(w2.Setup)}})):D.createElement(eH,null)}),Wee=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{Navigator:n,Screen:i}=O8();return d.jsxs(n,{screenOptions:{...t0,headerStyle:{backgroundColor:t.bgNavigationBar},headerLeft:()=>null,headerBackVisible:!1},children:[d.jsx(i,{name:w2.SetupStart,component:Gee,options:{title:e("setup_account_navigation")}}),d.jsx(i,{name:w2.Setup,component:Pee,options:{title:e("general_navigation")}}),d.jsx(i,{name:w2.BiologicalSex,component:a8,options:{title:e("biological_sex_navigation"),headerLeft:$2}}),d.jsx(i,{name:w2.TreatmentType,component:Q8,options:{title:e("treatment_type_navigation"),headerLeft:$2}}),d.jsx(i,{name:w2.RapidActingInsulin,component:q8,options:{title:e("rapid-acting_insulin_navigation"),headerLeft:$2}}),d.jsx(i,{name:w2.LongActingInsulin,component:Y8,options:{title:e("long-acting_insulin_navigation"),headerLeft:$2}})]})},Yee=()=>{const{Navigator:e,Screen:t}=O8(),{hasCompletedSetupFlow:n}=qz(),{COLORS:i}=bL(),r=M.useMemo(()=>n?w2.QuickGuideStack:w2.SetupBolusCalculator,[n]);return d.jsxs(e,{initialRouteName:r,screenOptions:{...t0,headerStyle:{backgroundColor:i.bgNavigationBar},headerShown:!1},children:[d.jsx(t,{name:w2.SetupBolusCalculator,component:Wee}),d.jsx(t,{name:w2.QuickGuideStack,component:vee})]},r)},$ee=iF(()=>{const{isOnboardingFinished:e,setIsOnboardingFinished:t}=qz(),[n,i]=D.useState(!1),r=M.useCallback(async()=>{if(await gZ.syncAll(),!Uq.uuid)throw window.location.href="/redirect?status=error",new Error("[App::syncData] User settings not found");const e=XB(NL.BloodGlucoseUnit).safeParse(Uq.glucoseUnit);t(e.success)},[t]);return M.useEffect(()=>{r().catch(console.error).finally(()=>{i(!0)})},[r]),n&&void 0!==e?e?d.jsx(cee,{}):d.jsx(Yee,{}):d.jsx(eH,{})}),Xee={prefixes:[],config:{screens:{SetupBolusCalculator:{path:"setup-bolus-calculator",screens:{SetupStart:"setup-start",Setup:"setup",BiologicalSex:"biological-sex",InsulinSettings:"insulin-settings",TreatmentType:"treatment-type",RapidActingInsulin:"rapid-acting-insulin",LongActingInsulin:"long-acting-insulin"}},QuickGuideStack:{path:"quick-guide",screens:{QuickGuideStart:"quick-guide-start",QuickGuide:"quick-guide",QuickGuideAllSet:"quick-guide-all-set"}},NewCalculationStack:{path:"new-calculation",screens:{ActiveInsulin:{path:"active-insulin"},RegisterActiveInsulin:{path:"register"},CalculationBottomTabs:{path:"inputs",screens:{GlucoseTab:{path:"glucose",screens:{Glucose:""}},CarbsTab:{path:"carbs",screens:{Carbs:"",FoodLibrary:"library"}},ActivityTab:{path:"activity",screens:{ActivityOverview:"",AddActivity:"add-activity"}},SummaryTab:{path:"summary",screens:{Summary:""}}}},LoadingRecommendation:{path:"loading"},Recommendation:{path:"recommendation"},LeavingRecommendation:{path:"leaving"}}},IFU:"ifu",SettingsTab:{path:"settings",screens:{Settings:"",ProfileStack:{path:"profile",screens:{Profile:"",BiologicalSex:"biological-sex",TreatmentType:"treatment-type",RapidActingInsulin:"rapid-acting-insulin",LongActingInsulin:"long-acting-insulin",DiabetesType:"diabetes-type"}},GlucoseSettings:"glucose",ActivitySettings:"activity",InsulinSettingsStack:{path:"insulin-settings",screens:{InsulinSettings:"",TreatmentType:"treatment-type",RapidActingInsulin:"rapid-acting-insulin",LongActingInsulin:"long-acting-insulin"}},IFU:"ifu",Legal:"legal",GlucoseUnit:"glucose-unit"}}}}};var qee="web-production",Zee="https://key@sentry-proxy.hedia.io/123456";const Kee=function(){const e=[...Object.keys(Cm),"addListener","removeListener","resetRoot","dispatch","isFocused","canGoBack","getRootState","getState","getParent","getCurrentRoute","getCurrentOptions"],t={},n=(e,n)=>{t[e]&&(t[e]=t[e].filter(e=>e!==n))};let i=null;return{get current(){return i},set current(e){i=e,null!=e&&Object.entries(t).forEach(t=>{let[n,i]=t;i.forEach(t=>{e.addListener(n,t)})})},isReady:()=>null!=i&&i.isReady(),...e.reduce((e,r)=>(e[r]=function(){for(var e=arguments.length,a=new Array(e),o=0;o<e;o++)a[o]=arguments[o];if(null!=i)return i[r](...a);switch(r){case"addListener":{const[e,i]=a;return t[e]=t[e]||[],t[e].push(i),()=>n(e,i)}case"removeListener":{const[e,t]=a;n(e,t);break}default:console.error(Pm)}},e),{})}}();!function(e){const t={...e};var n,i;Ay(t,"react"),n="react",i={version:M.version},rg().setContext(n,i),function(e={}){const t=!e.skipBrowserExtensionCheck&&ob(),n={...e,enabled:!t&&e.enabled,stackParser:(i=e.stackParser||Gv,Array.isArray(i)?Yf(...i):i),integrations:ly({integrations:e.integrations,defaultIntegrations:null==e.defaultIntegrations?[jy(),Ny(),Zv(),Xv(),tb(),ab(),Xy(),rb(),eb()]:e.defaultIntegrations}),transport:e.transport||Fv};var i;Cy(wv,n)}(t)}({dsn:Zee,environment:qee,ignoreErrors:["No text/key with value"],beforeSend:e=>e.message?.includes("No text/key with value")?null:(e.user&&(delete e.user.email,delete e.user.ip_address,delete e.user.username,delete e.user.geo),e)});const Qee=()=>{const{COLORS:e}=bL(),t={..._f,colors:{..._f.colors,background:e.bgPrimary,border:e.divider}};return d.jsx(AS,{children:d.jsx(ee,{children:d.jsx(Rf,{theme:t,ref:Kee,linking:Xee,children:d.jsx($ee,{})})})})};P.createRoot(document.getElementById("root")).render(d.jsx(Qee,{}));
|
|
19
|
+
const n=function(){if(jz)return Hz;jz=1,Hz.byteLength=function(e){var t=a(e),n=t[0],i=t[1];return 3*(n+i)/4-i},Hz.toByteArray=function(e){var i,r,o=a(e),s=o[0],l=o[1],u=new n(function(e,t,n){return 3*(t+n)/4-n}(0,s,l)),c=0,d=l>0?s-4:s;for(r=0;r<d;r+=4)i=t[e.charCodeAt(r)]<<18|t[e.charCodeAt(r+1)]<<12|t[e.charCodeAt(r+2)]<<6|t[e.charCodeAt(r+3)],u[c++]=i>>16&255,u[c++]=i>>8&255,u[c++]=255&i;return 2===l&&(i=t[e.charCodeAt(r)]<<2|t[e.charCodeAt(r+1)]>>4,u[c++]=255&i),1===l&&(i=t[e.charCodeAt(r)]<<10|t[e.charCodeAt(r+1)]<<4|t[e.charCodeAt(r+2)]>>2,u[c++]=i>>8&255,u[c++]=255&i),u},Hz.fromByteArray=function(t){for(var n,i=t.length,r=i%3,a=[],o=16383,l=0,u=i-r;l<u;l+=o)a.push(s(t,l,l+o>u?u:l+o));return 1===r?(n=t[i-1],a.push(e[n>>2]+e[n<<4&63]+"==")):2===r&&(n=(t[i-2]<<8)+t[i-1],a.push(e[n>>10]+e[n>>4&63]+e[n<<2&63]+"=")),a.join("")};for(var e=[],t=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0;r<64;++r)e[r]=i[r],t[i.charCodeAt(r)]=r;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function o(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function s(e,t,n){for(var i,r=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),r.push(o(i));return r.join("")}return t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63,Hz}(),i=(zz||(zz=1,Gz.read=function(e,t,n,i,r){var a,o,s=8*r-i-1,l=(1<<s)-1,u=l>>1,c=-7,d=n?r-1:0,h=n?-1:1,m=e[t+d];for(d+=h,a=m&(1<<-c)-1,m>>=-c,c+=s;c>0;a=256*a+e[t+d],d+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=i;c>0;o=256*o+e[t+d],d+=h,c-=8);if(0===a)a=1-u;else{if(a===l)return o?NaN:1/0*(m?-1:1);o+=Math.pow(2,i),a-=u}return(m?-1:1)*o*Math.pow(2,a-i)},Gz.write=function(e,t,n,i,r,a){var o,s,l,u=8*a-r-1,c=(1<<u)-1,d=c>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,m=i?0:a-1,p=i?1:-1,f=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(o++,l/=2),o+d>=c?(s=0,o=c):o+d>=1?(s=(t*l-1)*Math.pow(2,r),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;e[n+m]=255&s,m+=p,s/=256,r-=8);for(o=o<<r|s,u+=r;u>0;e[n+m]=255&o,m+=p,o/=256,u-=8);e[n+m-p]|=128*f}),Gz),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.SlowBuffer=function(e){return+e!=e&&(e=0),s.alloc(+e)},t.INSPECT_MAX_BYTES=50;const a=2147483647;function o(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,n)}function l(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|p(e,t);let i=o(n);const r=i.write(e,t);return r!==n&&(i=i.slice(0,r)),i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(X(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(X(e,ArrayBuffer)||e&&X(e.buffer,ArrayBuffer))return h(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(X(e,SharedArrayBuffer)||e&&X(e.buffer,SharedArrayBuffer)))return h(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return s.from(i,t,n);const r=function(e){if(s.isBuffer(e)){const t=0|m(e.length),n=o(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||q(e.length)?o(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),o(e<0?0:0|m(e))}function d(e){const t=e.length<0?0:0|m(e.length),n=o(t);for(let i=0;i<t;i+=1)n[i]=255&e[i];return n}function h(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(i,s.prototype),i}function m(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function p(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||X(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(r)return i?-1:W(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,n){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return x(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function _(e,t,n){const i=e[t];e[t]=e[n],e[n]=i}function g(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),q(n=+n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=s.from(t,i)),s.isBuffer(t))return 0===t.length?-1:y(e,t,n,i,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,i,r){let a,o=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,s/=2,l/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){let i=-1;for(a=n;a<s;a++)if(u(e,a)===u(t,-1===i?0:a-i)){if(-1===i&&(i=a),a-i+1===l)return i*o}else-1!==i&&(a-=a-i),i=-1}else for(n+l>s&&(n=s-l),a=n;a>=0;a--){let n=!0;for(let i=0;i<l;i++)if(u(e,a+i)!==u(t,i)){n=!1;break}if(n)return a}return-1}function v(e,t,n,i){n=Number(n)||0;const r=e.length-n;i?(i=Number(i))>r&&(i=r):i=r;const a=t.length;let o;for(i>a/2&&(i=a/2),o=0;o<i;++o){const i=parseInt(t.substr(2*o,2),16);if(q(i))return o;e[n+o]=i}return o}function b(e,t,n,i){return $(W(t,e.length-n),e,n,i)}function S(e,t,n,i){return $(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,i)}function w(e,t,n,i){return $(Y(t),e,n,i)}function k(e,t,n,i){return $(function(e,t){let n,i,r;const a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),i=n>>8,r=n%256,a.push(r),a.push(i);return a}(t,e.length-n),e,n,i)}function C(e,t,i){return 0===t&&i===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,i))}function E(e,t,n){n=Math.min(e.length,n);const i=[];let r=t;for(;r<n;){const t=e[r];let a=null,o=t>239?4:t>223?3:t>191?2:1;if(r+o<=n){let n,i,s,l;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[r+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(a=l));break;case 3:n=e[r+1],i=e[r+2],128==(192&n)&&128==(192&i)&&(l=(15&t)<<12|(63&n)<<6|63&i,l>2047&&(l<55296||l>57343)&&(a=l));break;case 4:n=e[r+1],i=e[r+2],s=e[r+3],128==(192&n)&&128==(192&i)&&128==(192&s)&&(l=(15&t)<<18|(63&n)<<12|(63&i)<<6|63&s,l>65535&&l<1114112&&(a=l))}}null===a?(a=65533,o=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|1023&a),i.push(a),r+=o}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let n="",i=0;for(;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=I));return n}(i)}t.kMaxLength=a,s.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(e,t,n){return l(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?o(e):void 0!==t?"string"==typeof n?o(e).fill(t,n):o(e).fill(t):o(e)}(e,t,n)},s.allocUnsafe=function(e){return c(e)},s.allocUnsafeSlow=function(e){return c(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(X(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),X(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let n=e.length,i=t.length;for(let r=0,a=Math.min(n,i);r<a;++r)if(e[r]!==t[r]){n=e[r],i=t[r];break}return n<i?-1:i<n?1:0},s.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const i=s.allocUnsafe(t);let r=0;for(n=0;n<e.length;++n){let t=e[n];if(X(t,Uint8Array))r+t.length>i.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(i,r)):Uint8Array.prototype.set.call(i,t,r);else{if(!s.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,r)}r+=t.length}return i},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)_(this,t,t+1);return this},s.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this},s.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this},s.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):f.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,i,r){if(X(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;let a=(r>>>=0)-(i>>>=0),o=(n>>>=0)-(t>>>=0);const l=Math.min(a,o),u=this.slice(i,r),c=e.slice(t,n);for(let s=0;s<l;++s)if(u[s]!==c[s]){a=u[s],o=c[s];break}return a<o?-1:o<a?1:0},s.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},s.prototype.indexOf=function(e,t,n){return g(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return g(this,e,t,n,!1)},s.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}const r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":case"latin1":case"binary":return S(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function x(e,t,n){let i="";n=Math.min(e.length,n);for(let r=t;r<n;++r)i+=String.fromCharCode(127&e[r]);return i}function T(e,t,n){let i="";n=Math.min(e.length,n);for(let r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function O(e,t,n){const i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);let r="";for(let a=t;a<n;++a)r+=Z[e[a]];return r}function R(e,t,n){const i=e.slice(t,n);let r="";for(let a=0;a<i.length-1;a+=2)r+=String.fromCharCode(i[a]+256*i[a+1]);return r}function A(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,n,i,r,a){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<a)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}function P(e,t,n,i,r){H(t,i,r,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function M(e,t,n,i,r){H(t,i,r,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}function D(e,t,n,i,r,a){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,r,a){return t=+t,n>>>=0,a||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function F(e,t,n,r,a){return t=+t,n>>>=0,a||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}s.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,s.prototype),i},s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let i=this[e],r=1,a=0;for(;++a<t&&(r*=256);)i+=this[e+a]*r;return i},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let i=this[e+--t],r=1;for(;t>0&&(r*=256);)i+=this[e+--t]*r;return i},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=K(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||U(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,r=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(i)+(BigInt(r)<<BigInt(32))}),s.prototype.readBigUInt64BE=K(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||U(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],r=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(i)<<BigInt(32))+BigInt(r)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let i=this[e],r=1,a=0;for(;++a<t&&(r*=256);)i+=this[e+a]*r;return r*=128,i>=r&&(i-=Math.pow(2,8*t)),i},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||A(e,t,this.length);let i=t,r=1,a=this[e+--i];for(;i>0&&(r*=256);)a+=this[e+--i]*r;return r*=128,a>=r&&(a-=Math.pow(2,8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=K(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||U(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),s.prototype.readBigInt64BE=K(function(e){z(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||U(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),i.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),i.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),i.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),i.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||L(this,e,t,n,Math.pow(2,8*n)-1,0);let r=1,a=0;for(this[t]=255&e;++a<n&&(r*=256);)this[t+a]=e/r&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,i){e=+e,t>>>=0,n>>>=0,i||L(this,e,t,n,Math.pow(2,8*n)-1,0);let r=n-1,a=1;for(this[t+r]=255&e;--r>=0&&(a*=256);)this[t+r]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigUInt64LE=K(function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=K(function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}let r=0,a=1,o=0;for(this[t]=255&e;++r<n&&(a*=256);)e<0&&0===o&&0!==this[t+r-1]&&(o=1),this[t+r]=(e/a|0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*n-1);L(this,e,t,n,i-1,-i)}let r=n-1,a=1,o=0;for(this[t+r]=255&e;--r>=0&&(a*=256);)e<0&&0===o&&0!==this[t+r+1]&&(o=1),this[t+r]=(e/a|0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigInt64LE=K(function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=K(function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return F(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return F(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,i){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);const r=i-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),t),r},s.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!s.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let r;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(r=t;r<n;++r)this[r]=e;else{const a=s.isBuffer(e)?e:s.from(e,i),o=a.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(r=0;r<n-t;++r)this[r+t]=a[r%o]}return this};const B={};function j(e,t,n){B[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function V(e){let t="",n=e.length;const i="-"===e[0]?1:0;for(;n>=i+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function H(e,t,n,i,r,a){if(e>n||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(a+1)}${n}`:`>= -(2${n} ** ${8*(a+1)-1}${n}) and < 2 ** ${8*(a+1)-1}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||U(t,e.length-(n+1))}(i,r,a)}function z(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function U(e,t,n){if(Math.floor(e)!==e)throw z(e,n),new B.ERR_OUT_OF_RANGE("offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),j("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),j("ERR_OUT_OF_RANGE",function(e,t,n){let i=`The value of "${e}" is out of range.`,r=n;return Number.isInteger(n)&&Math.abs(n)>2**32?r=V(String(n)):"bigint"==typeof n&&(r=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(r=V(r)),r+="n"),i+=` It must be ${t}. Received ${r}`,i},RangeError);const G=/[^+/0-9A-Za-z-_]/g;function W(e,t){let n;t=t||1/0;const i=e.length;let r=null;const a=[];for(let o=0;o<i;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&a.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&a.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function Y(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,n,i){let r;for(r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function X(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const i=16*n;for(let r=0;r<16;++r)t[i+r]=e[n]+e[r]}return t}();function K(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}}(Vz)),Vz);const{OAUTH_BASE_URL:Yz="",OAUTH_CLIENT_ID:$z=""}=Wj,Xz={accessToken:Qj.getString("access_token"),refreshToken:Qj.getString("refresh_token"),isOnboardingFinished:Qj.getBoolean("isOnboardingFinished"),hasCompletedSetupFlow:!1,isLicenseValid:!1},qz=cL()(zj(e=>({...Xz,setTokens:({accessToken:t,refreshToken:n})=>{e({accessToken:t,refreshToken:n})},setIsOnboardingFinished:t=>{e({isOnboardingFinished:t,hasCompletedSetupFlow:t})},setHasCompletedSetupFlow:t=>{e({hasCompletedSetupFlow:t})},setIsLicenseValid:t=>{e({isLicenseValid:t})},clear:()=>{e(Xz)}}),{name:"AUTH_STORE",storage:Vj(Jj)}));var Zz="b30def84-6b37-426a-9752-be3cf572fdf1";const Kz=uV?"https://tracking.hedia.io":Wj.TRACKING_BASE_URL,Qz=uV?Zz:Wj.TRACKING_PROJECT_ID;async function Jz(e){const t={...e,uuid:void 0},n={headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(t),method:NL.HTTPRequestMethod.POST},i=`${Kz}/api/v1/projects/${Qz}/events`,{status:r}=await fetch(i,n);if(r!==NL.StatusCode.CREATED)throw new Error("[tracking::syncTrackingEvent] Error while syncing tracking event")}var eU=(e=>(e.MalformedDataError="Malformed Data Error",e.IncorrectDataError="Incorrect Data Type Error",e))(eU||{});const tU="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,nU="8.55.0",iU=globalThis;function rU(e,t,n){const i=n||iU,r=i.__SENTRY__=i.__SENTRY__||{},a=r[nU]=r[nU]||{};return a[e]||(a[e]=t())}const aU="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,oU=["debug","info","warn","error","log","assert","trace"],sU={};function lU(e){if(!("console"in iU))return e();const t=iU.console,n={},i=Object.keys(sU);i.forEach(e=>{const i=sU[e];n[e]=t[e],t[e]=i});try{return e()}finally{i.forEach(e=>{t[e]=n[e]})}}const uU=rU("logger",function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return aU?oU.forEach(n=>{t[n]=(...t)=>{e&&lU(()=>{iU.console[n](`Sentry Logger [${n}]:`,...t)})}}):oU.forEach(e=>{t[e]=()=>{}}),t}),cU="<anonymous>";function dU(){return hU(iU),iU}function hU(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||nU,t[nU]=t[nU]||{}}const mU=Object.prototype.toString;function pU(e,t){return mU.call(e)===`[object ${t}]`}function fU(e){return pU(e,"String")}function _U(e){return pU(e,"Object")}function gU(e,t){try{return e instanceof t}catch(n){return!1}}const yU=iU;function vU(e,t){const n=e,i=[];if(!n||!n.tagName)return"";if(yU.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}i.push(n.tagName.toLowerCase());const r=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(r&&r.length)r.forEach(e=>{i.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&i.push(`#${n.id}`);const e=n.className;if(e&&fU(e)){const t=e.split(/\s+/);for(const e of t)i.push(`.${e}`)}}const a=["aria-label","type","name","title","alt"];for(const o of a){const e=n.getAttribute(o);e&&i.push(`[${o}="${e}"]`)}return i.join("")}function bU(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(i){aU&&uU.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function SU(e){if(function(e){switch(mU.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return gU(e,Error)}}(e))return{message:e.message,name:e.name,stack:e.stack,...kU(e)};if(t=e,"undefined"!=typeof Event&&gU(t,Event)){const t={type:e.type,target:wU(e.target),currentTarget:wU(e.currentTarget),...kU(e)};return"undefined"!=typeof CustomEvent&&gU(e,CustomEvent)&&(t.detail=e.detail),t}return e;var t}function wU(e){try{return t=e,"undefined"!=typeof Element&&gU(t,Element)?function(e,t={}){if(!e)return"<unknown>";try{let n=e;const i=5,r=[];let a=0,o=0;const s=" > ",l=s.length;let u;const c=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||80;for(;n&&a++<i&&(u=vU(n,c),!("html"===u||a>1&&o+r.length*l+u.length>=d));)r.push(u),o+=u.length,n=n.parentNode;return r.reverse().join(s)}catch(n){return"<unknown>"}}(e):Object.prototype.toString.call(e)}catch(n){return"<unknown>"}var t}function kU(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function CU(e){return EU(e,new Map)}function EU(e,t){if(function(e){if(!_U(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(t){return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const i={};t.set(e,i);for(const r of Object.getOwnPropertyNames(e))void 0!==e[r]&&(i[r]=EU(e[r],t));return i}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const i=[];return t.set(e,i),e.forEach(e=>{i.push(EU(e,t))}),i}return e}function IU(){return Date.now()/1e3}const xU=function(){const{performance:e}=iU;if(!e||!e.now)return IU;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/1e3}();function TU(){const e=iU,t=e.crypto||e.msCrypto;let n=()=>16*Math.random();try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const e=new Uint8Array(1);return t.getRandomValues(e),e[0]})}catch(i){}return"10000000100040008000100000000000".replace(/[018]/g,e=>(e^(15&n())>>e/4).toString(16))}function OU(){return TU()}function RU(){return TU().substring(16)}function AU(e,t,n=2){if(!t||"object"!=typeof t||n<=0)return t;if(e&&t&&0===Object.keys(t).length)return e;const i={...e};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(i[r]=AU(i[r],t[r],n-1));return i}(()=>{const{performance:e}=iU;if(!e||!e.now)return;const t=36e5,n=e.now(),i=Date.now(),r=e.timeOrigin?Math.abs(e.timeOrigin+n-i):t,a=r<t,o=e.timing&&e.timing.navigationStart,s="number"==typeof o?Math.abs(o+n-i):t;(a||s<t)&&(r<=s&&e.timeOrigin)})();const LU="_sentrySpan";function PU(e,t){t?bU(e,LU,t):delete e[LU]}function MU(e){return e[LU]}class DU{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:OU(),spanId:RU()}}clone(){const e=new DU;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._requestSession=this._requestSession,e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,PU(e,MU(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&function(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||xU(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:TU()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,[n,i]=t instanceof NU?[t.getScopeData(),t.getRequestSession()]:_U(t)?[e,e.requestSession]:[],{tags:r,extra:a,user:o,contexts:s,level:l,fingerprint:u=[],propagationContext:c}=n||{};return this._tags={...this._tags,...r},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),l&&(this._level=l),u.length&&(this._fingerprint=u),c&&(this._propagationContext=c),i&&(this._requestSession=i),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,PU(this,void 0),this._attachments=[],this.setPropagationContext({traceId:OU()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const i={timestamp:IU(),...e};return this._breadcrumbs.push(i),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:MU(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=AU(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext={spanId:RU(),...e},this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:TU();if(!this._client)return uU.warn("No client configured on scope - will not capture exception!"),n;const i=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:i,...t,event_id:n},this),n}captureMessage(e,t,n){const i=n&&n.event_id?n.event_id:TU();if(!this._client)return uU.warn("No client configured on scope - will not capture message!"),i;const r=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:r,...n,event_id:i},this),i}captureEvent(e,t){const n=t&&t.event_id?t.event_id:TU();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(uU.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const NU=DU;class FU{constructor(e,t){let n,i;n=e||new NU,i=t||new NU,this._stack=[{scope:n}],this._isolationScope=i}withScope(t){const n=this._pushScope();let i;try{i=t(n)}catch(e){throw this._popScope(),e}return r=i,Boolean(r&&r.then&&"function"==typeof r.then)?i.then(e=>(this._popScope(),e),e=>{throw this._popScope(),e}):(this._popScope(),i);var r}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function BU(){const e=hU(dU());return e.stack=e.stack||new FU(rU("defaultCurrentScope",()=>new NU),rU("defaultIsolationScope",()=>new NU))}function jU(e){return BU().withScope(e)}function VU(e,t){const n=BU();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function HU(e){return BU().withScope(()=>e(BU().getIsolationScope()))}function zU(e){const t=hU(e);return t.acs?t.acs:{withIsolationScope:HU,withScope:jU,withSetScope:VU,withSetIsolationScope:(e,t)=>HU(t),getCurrentScope:()=>BU().getScope(),getIsolationScope:()=>BU().getIsolationScope()}}function UU(){return zU(dU()).getCurrentScope()}function GU(){return zU(dU()).getIsolationScope()}function WU(...e){const t=zU(dU());if(2===e.length){const[n,i]=e;return n?t.withSetScope(n,i):t.withScope(i)}return t.withScope(e[0])}function YU(){return UU().getClient()}function $U(e){const t=e._sentryMetrics;if(!t)return;const n={};for(const[,[i,r]]of t){(n[i]||(n[i]=[])).push(CU(r))}return n}const XU="sentry.source",qU="sentry.sample_rate",ZU="sentry.op",KU="sentry.origin",QU="sentry.idle_span_finish_reason",JU="sentry.custom_span_name",eG=/^sentry-/;function tG(e){const t=function(e){if(!e||!fU(e)&&!Array.isArray(e))return;if(Array.isArray(e))return e.reduce((e,t)=>{const n=nG(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{});return nG(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,[t,n])=>{if(t.match(eG)){e[t.slice(7)]=n}return e},{});return Object.keys(n).length>0?n:void 0}function nG(e){return e.split(",").map(e=>e.split("=").map(e=>decodeURIComponent(e.trim()))).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}let iG=!1;function rG(e){const{spanId:t,traceId:n}=e.spanContext(),{data:i,op:r,parent_span_id:a,status:o,origin:s}=sG(e);return CU({parent_span_id:a,span_id:t,trace_id:n,data:i,op:r,status:o,origin:s})}function aG(e){return"number"==typeof e?oG(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?oG(e.getTime()):xU()}function oG(e){return e>9999999999?e/1e3:e}function sG(t){if(function(e){return"function"==typeof e.getSpanJSON}(t))return t.getSpanJSON();try{const{spanId:e,traceId:n}=t.spanContext();if(function(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}(t)){const{attributes:i,startTime:r,name:a,endTime:o,parentSpanId:s,status:l}=t;return CU({span_id:e,trace_id:n,data:i,description:a,parent_span_id:s,start_timestamp:aG(r),timestamp:aG(o)||void 0,status:uG(l),op:i[ZU],origin:i[KU],_metrics_summary:$U(t)})}return{span_id:e,trace_id:n}}catch(e){return{}}}function lG(e){const{traceFlags:t}=e.spanContext();return 1===t}function uG(e){if(e&&0!==e.code)return 1===e.code?"ok":e.message||"unknown_error"}const cG="_sentryChildSpans",dG="_sentryRootSpan";function hG(e,t){const n=e[dG]||e;bU(t,dG,n),e[cG]?e[cG].add(t):bU(e,cG,new Set([t]))}function mG(e){const t=new Set;return function e(n){if(!t.has(n)&&lG(n)){t.add(n);const i=n[cG]?Array.from(n[cG]):[];for(const t of i)e(t)}}(e),Array.from(t)}function pG(e){return e[dG]||e}function fG(){const e=zU(dU());return e.getActiveSpan?e.getActiveSpan():MU(UU())}const _G="_sentryScope",gG="_sentryIsolationScope";function yG(e){return{scope:e[_G],isolationScope:e[gG]}}function vG(e){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=YU(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}class bG{constructor(e={}){this._traceId=e.traceId||OU(),this._spanId=e.spanId||RU()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}}const SG="_frozenDsc";function wG(e,t){bU(e,SG,t)}function kG(e){const t=YU();if(!t)return{};const n=pG(e),i=n[SG];if(i)return i;const r=n.spanContext().traceState,a=r&&r.get("sentry.dsc"),o=a&&tG(a);if(o)return o;const s=function(e,t){const n=t.getOptions(),{publicKey:i}=t.getDsn()||{},r=CU({environment:n.environment||"production",release:n.release,public_key:i,trace_id:e});return t.emit("createDsc",r),r}(e.spanContext().traceId,t),l=sG(n),u=l.data||{},c=u[qU];null!=c&&(s.sample_rate=`${c}`);const d=u[XU],h=l.description;return"url"!==d&&h&&(s.transaction=h),vG()&&(s.sampled=String(lG(n))),t.emit("createDsc",s,n),s}function CG(e,t){if(!vG(e))return[!1];const n=GU().getScopeData().sdkProcessingMetadata.normalizedRequest,i={...t,normalizedRequest:t.normalizedRequest||n};let r;r="function"==typeof e.tracesSampler?e.tracesSampler(i):void 0!==i.parentSampled?i.parentSampled:void 0!==e.tracesSampleRate?e.tracesSampleRate:1;const a=function(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;if(!("number"!=typeof t||isNaN(t)||t<0||t>1))return t;tU&&uU.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`)}(r);if(void 0===a)return tU&&uU.warn("[Tracing] Discarding transaction because of invalid sample rate."),[!1];if(!a)return tU&&uU.log("[Tracing] Discarding transaction because "+("function"==typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),[!1,a];return Math.random()<a?[!0,a]:(tU&&uU.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),[!1,a])}function EG(e,t=!1){const{host:n,path:i,pass:r,port:a,projectId:o,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&r?`:${r}`:""}@${n}${a?`:${a}`:""}/${i?`${i}/`:i}${o}`}function IG(e,t=100,n=1/0){try{return xG("",e,t,n)}catch(i){return{ERROR:`**non-serializable** (${i})`}}}function xG(t,n,i=1/0,r=1/0,a=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[o,s]=a;if(null==n||["boolean","string"].includes(typeof n)||"number"==typeof n&&Number.isFinite(n))return n;const l=function(t,n){try{if("domain"===t&&n&&"object"==typeof n&&n._events)return"[Domain]";if("domainEmitter"===t)return"[DomainEmitter]";if("undefined"!=typeof self&&n===self)return"[Global]";if("undefined"!=typeof window&&n===window)return"[Window]";if("undefined"!=typeof document&&n===document)return"[Document]";if("object"==typeof(i=n)&&null!==i&&(i.__isVue||i._isVue))return"[VueViewModel]";if(function(e){return _U(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(n))return"[SyntheticEvent]";if("number"==typeof n&&!Number.isFinite(n))return`[${n}]`;if("function"==typeof n)return`[Function: ${function(t){try{return t&&"function"==typeof t&&t.name||cU}catch(e){return cU}}(n)}]`;if("symbol"==typeof n)return`[${String(n)}]`;if("bigint"==typeof n)return`[BigInt: ${String(n)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}(n);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}var i}(t,n);if(!l.startsWith("[object "))return l;if(n.__sentry_skip_normalization__)return n;const u="number"==typeof n.__sentry_override_normalization_depth__?n.__sentry_override_normalization_depth__:i;if(0===u)return l.replace("object ","");if(o(n))return"[Circular ~]";const c=n;if(c&&"function"==typeof c.toJSON)try{return xG("",c.toJSON(),u-1,r,a)}catch(p){}const d=Array.isArray(n)?[]:{};let h=0;const m=SU(n);for(const e in m){if(!Object.prototype.hasOwnProperty.call(m,e))continue;if(h>=r){d[e]="[MaxProperties ~]";break}const t=m[e];d[e]=xG(e,t,u-1,r,a),h++}return s(n),d}function TG(e){return[{type:"span"},e]}function OG(e,t){const n=kG(e[0]),i=t&&t.getDsn(),r=t&&t.getOptions().tunnel,a={sent_at:(new Date).toISOString(),...(o=n,!!o.trace_id&&!!o.public_key&&{trace:n}),...!!r&&i&&{dsn:EG(i)}};var o;const s=t&&t.getOptions().beforeSendSpan,l=s?e=>{const t=s(sG(e));return t||iG||(lU(()=>{console.warn("[Sentry] Deprecation warning: Returning null from `beforeSendSpan` will be disallowed from SDK version 9.0.0 onwards. The callback will only support mutating spans. To drop certain spans, configure the respective integrations directly.")}),iG=!0),t}:e=>sG(e),u=[];for(const c of e){const e=l(c);e&&u.push(TG(e))}return function(e,t=[]){return[e,t]}(a,u)}function RG(e){if(!e||0===e.length)return;const t={};return e.forEach(e=>{const n=e.attributes||{},i=n["sentry.measurement_unit"],r=n["sentry.measurement_value"];"string"==typeof i&&"number"==typeof r&&(t[e.name]={value:r,unit:i})}),t}class AG{constructor(e={}){this._traceId=e.traceId||OU(),this._spanId=e.spanId||RU(),this._startTime=e.startTimestamp||xU(),this._attributes={},this.setAttributes({[KU]:"manual",[ZU]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this}addLinks(e){return this}recordException(e,t){}spanContext(){const{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:n?1:0}}setAttribute(e,t){return void 0===t?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=aG(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(XU,"custom"),this}end(e){this._endTime||(this._endTime=aG(e),function(e){if(!tU)return;const{description:t="< unknown name >",op:n="< unknown op >"}=sG(e),{spanId:i}=e.spanContext(),r=`[Tracing] Finishing "${n}" ${pG(e)===e?"root ":""}span "${t}" with ID ${i}`;uU.log(r)}(this),this._onSpanEnded())}getSpanJSON(){return CU({data:this._attributes,description:this._name,op:this._attributes[ZU],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:uG(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[KU],_metrics_summary:$U(this),profile_id:this._attributes["sentry.profile_id"],exclusive_time:this._attributes["sentry.exclusive_time"],measurements:RG(this._events),is_segment:this._isStandaloneSpan&&pG(this)===this||void 0,segment_id:this._isStandaloneSpan?pG(this).spanContext().spanId:void 0})}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){tU&&uU.log("[Tracing] Adding an event to span:",e);const i=LG(t)?t:n||xU(),r=LG(t)?{}:t||{},a={name:e,time:aG(i),attributes:r};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const e=YU();e&&e.emit("spanEnd",this);if(!(this._isStandaloneSpan||this===pG(this)))return;if(this._isStandaloneSpan)return void(this._sampled?function(e){const t=YU();if(!t)return;const n=e[1];if(!n||0===n.length)return void t.recordDroppedEvent("before_send","span");t.sendEnvelope(e)}(OG([this],e)):(tU&&uU.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span")));const t=this._convertSpanToTransaction();if(t){(yG(this).scope||UU()).captureEvent(t)}}_convertSpanToTransaction(){if(!PG(sG(this)))return;this._name||(tU&&uU.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:e,isolationScope:t}=yG(this),n=(e||UU()).getClient()||YU();if(!0!==this._sampled)return tU&&uU.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(n&&n.recordDroppedEvent("sample_rate","transaction"));const i=mG(this).filter(e=>e!==this&&!function(e){return e instanceof AG&&e.isStandaloneSpan()}(e)).map(e=>sG(e)).filter(PG),r=this._attributes[XU];delete this._attributes[JU],i.forEach(e=>{e.data&&delete e.data[JU]});const a={contexts:{trace:rG(this)},spans:i.length>1e3?i.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,1e3):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,...CU({dynamicSamplingContext:kG(this)})},_metrics_summary:$U(this),...r&&{transaction_info:{source:r}}},o=RG(this._events);return o&&Object.keys(o).length&&(tU&&uU.log("[Measurements] Adding measurements to transaction event",JSON.stringify(o,void 0,2)),a.measurements=o),a}}function LG(e){return e&&"number"==typeof e||e instanceof Date||Array.isArray(e)}function PG(e){return!!(e.start_timestamp&&e.timestamp&&e.span_id&&e.trace_id)}const MG="__SENTRY_SUPPRESS_TRACING__";function DG(e){const t=NG();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=function(e){const t=e.experimental||{},n={isStandalone:t.standalone,...e};if(e.startTime){const t={...n};return t.startTimestamp=aG(e.startTime),delete t.startTime,t}return n}(e),{forceTransaction:i,parentSpan:r}=e,a=e.scope?t=>WU(e.scope,t):void 0!==r?e=>function(e,t){const n=NG();if(n.withActiveSpan)return n.withActiveSpan(e,t);return WU(n=>(PU(n,e||void 0),t(n)))}(r,e):e=>e();return a(()=>{const t=UU(),r=function(e){const t=MU(e);if(!t)return;const n=YU(),i=n?n.getOptions():{};if(i.parentSpanIsAlwaysRootSpan)return pG(t);return t}(t);return e.onlyIfParent&&!r?new bG:function({parentSpan:e,spanArguments:t,forceTransaction:n,scope:i}){if(!vG())return new bG;const r=GU();let a;if(e&&!n)a=function(e,t,n){const{spanId:i,traceId:r}=e.spanContext(),a=!t.getScopeData().sdkProcessingMetadata[MG]&&lG(e),o=a?new AG({...n,parentSpanId:i,traceId:r,sampled:a}):new bG({traceId:r});hG(e,o);const s=YU();s&&(s.emit("spanStart",o),n.endTimestamp&&s.emit("spanEnd",o));return o}(e,i,t),hG(e,a);else if(e){const n=kG(e),{traceId:r,spanId:o}=e.spanContext(),s=lG(e);a=FG({traceId:r,parentSpanId:o,...t},i,s),wG(a,n)}else{const{traceId:e,dsc:n,parentSpanId:o,sampled:s}={...r.getPropagationContext(),...i.getPropagationContext()};a=FG({traceId:e,parentSpanId:o,...t},i,s),n&&wG(a,n)}return function(e){if(!tU)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:i}=sG(e),{spanId:r}=e.spanContext(),a=lG(e),o=pG(e),s=o===e,l=`[Tracing] Starting ${a?"sampled":"unsampled"} ${s?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${r}`];if(i&&u.push(`parent ID: ${i}`),!s){const{op:e,description:t}=sG(o);u.push(`root ID: ${o.spanContext().spanId}`),e&&u.push(`root op: ${e}`),t&&u.push(`root description: ${t}`)}uU.log(`${l}\n ${u.join("\n ")}`)}(a),function(e,t,n){e&&(bU(e,gG,n),bU(e,_G,t))}(a,i,r),a}({parentSpan:r,spanArguments:n,forceTransaction:i,scope:t})})}function NG(){return zU(dU())}function FG(e,t,n){const i=YU(),r=i&&i.getOptions()||{},{name:a="",attributes:o}=e,[s,l]=t.getScopeData().sdkProcessingMetadata[MG]?[!1]:CG(r,{name:a,parentSampled:n,attributes:o,transactionContext:{name:a,parentSampled:n}}),u=new AG({...e,attributes:{[XU]:"custom",...e.attributes},sampled:s});return void 0!==l&&u.setAttribute(qU,l),i&&i.emit("spanStart",u),u}const BG={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3};function jG(e,t={}){const n=new Map;let i,r=!1,a="externalFinish",o=!t.disableAutoFinish;const s=[],{idleTimeout:l=BG.idleTimeout,finalTimeout:u=BG.finalTimeout,childSpanTimeout:c=BG.childSpanTimeout,beforeSpanEnd:d}=t,h=YU();if(!h||!vG())return new bG;const m=UU(),p=fG(),f=function(e){const t=DG(e);return PU(UU(),t),tU&&uU.log("[Tracing] Started span is an idle span"),t}(e);function _(){i&&(clearTimeout(i),i=void 0)}function g(e){_(),i=setTimeout(()=>{!r&&0===n.size&&o&&(a="idleTimeout",f.end(e))},l)}function y(e){i=setTimeout(()=>{!r&&o&&(a="heartbeatFailed",f.end(e))},c)}function v(e){r=!0,n.clear(),s.forEach(e=>e()),PU(m,p);const t=sG(f),{start_timestamp:i}=t;if(!i)return;(t.data||{})[QU]||f.setAttribute(QU,a),uU.log(`[Tracing] Idle span "${t.op}" finished`);const o=mG(f).filter(e=>e!==f);let c=0;o.forEach(t=>{t.isRecording()&&(t.setStatus({code:2,message:"cancelled"}),t.end(e),tU&&uU.log("[Tracing] Cancelling span since span ended early",JSON.stringify(t,void 0,2)));const n=sG(t),{timestamp:i=0,start_timestamp:r=0}=n,a=r<=e,o=i-r<=(u+l)/1e3;if(tU){const e=JSON.stringify(t,void 0,2);a?o||uU.log("[Tracing] Discarding span since it finished after idle span final timeout",e):uU.log("[Tracing] Discarding span since it happened after idle span was finished",e)}o&&a||(!function(e,t){e[cG]&&e[cG].delete(t)}(f,t),c++)}),c>0&&f.setAttribute("sentry.idle_span_discarded_spans",c)}return f.end=new Proxy(f.end,{apply(e,t,n){d&&d(f);const[i,...r]=n,a=aG(i||xU()),o=mG(f).filter(e=>e!==f);if(!o.length)return v(a),Reflect.apply(e,t,[a,...r]);const s=o.map(e=>sG(e).timestamp).filter(e=>!!e),l=s.length?Math.max(...s):void 0,c=sG(f).start_timestamp,h=Math.min(c?c+u/1e3:1/0,Math.max(c||-1/0,Math.min(a,l||1/0)));return v(h),Reflect.apply(e,t,[h,...r])}}),s.push(h.on("spanStart",e=>{if(r||e===f||sG(e).timestamp)return;var t;mG(f).includes(e)&&(t=e.spanContext().spanId,_(),n.set(t,!0),y(xU()+c/1e3))})),s.push(h.on("spanEnd",e=>{var t;r||(t=e.spanContext().spanId,n.has(t)&&n.delete(t),0===n.size&&g(xU()+l/1e3))})),s.push(h.on("idleSpanEnableAutoFinish",e=>{e===f&&(o=!0,g(),n.size&&y())})),t.disableAutoFinish||g(),setTimeout(()=>{r||(f.setStatus({code:2,message:"deadline_exceeded"}),a="finalTimeout",f.end())},u),f}class VG extends Error{constructor(e,t="warn"){super(e),this.message=e,this.logLevel=t}}const HG=100;function zG(e,t){const n=YU(),i=GU();if(!n)return;const{beforeBreadcrumb:r=null,maxBreadcrumbs:a=HG}=n.getOptions();if(a<=0)return;const o={timestamp:IU(),...e},s=r?lU(()=>r(o,t)):o;null!==s&&(n.emit&&n.emit("beforeAddBreadcrumb",s,t),i.addBreadcrumb(s,a))}const UG={},GG=iU;function WG(e){var t;const n="string"!=typeof e&&"exception"in e&&(null===(t=e.exception)||void 0===t?void 0:t.values)?e.exception.values:[];for(const i of n)if(i.mechanism&&!1===i.mechanism.handled&&"onerror"===i.mechanism.type)return!0;return!1}function YG(){const e=null!==(i=null===(n=null===(t=GG.expo)||void 0===t?void 0:t.modules)||void 0===n?void 0:n.ExponentConstants)&&void 0!==i?i:void 0;var t,n,i;return"expo"===(e&&e.appOwnership)}function $G(){return"web"===lr.OS}function XG(){return"web"!==lr.OS}const qG="value";function ZG(e,t){let n;t=t||1/0;const i=e.length;let r=null;const a=[];for(let o=0;o<i;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&a.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&a.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}const KG=[],QG="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(let Jee=0,ete=64;Jee<ete;++Jee)KG[Jee]=QG[Jee];function JG(e){return KG[e>>18&63]+KG[e>>12&63]+KG[e>>6&63]+KG[63&e]}function eW(e,t,n){let i;const r=[];for(let a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),r.push(JG(i));return r.join("")}var tW=function(t,n,i,r){return new(i||(i=Promise))(function(a,o){function s(t){try{u(r.next(t))}catch(e){o(e)}}function l(t){try{u(r.throw(t))}catch(e){o(e)}}function u(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(s,l)}u((r=r.apply(t,n||[])).next())})},nW=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};const iW=!0===GG.RN$Bridgeless||null!=GG.__turboModuleProxy?UG.TurboModuleRegistry&&UG.TurboModuleRegistry.get("RNSentry"):nr.RNSentry,rW=ZG("\n"),aW={fetchModules(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const e=yield iW.fetchModules();return e?JSON.parse(e):null})},sendEnvelope(e){return tW(this,void 0,void 0,function*(){if(!this.enableNative)return void uU.warn("Event was skipped as native SDK is not enabled.");if(!this._isModuleLoaded(iW))throw this._NativeClientError;const[t,n]=e,i=ZG(JSON.stringify(t));let r=new Uint8Array(i.length+rW.length);r.set(i),r.set(rW,i.length);let a=!1;for(const e of n){const[t,n]=this._processItem(e);let i,o;"string"==typeof n?(i="text/plain",o=ZG(n)):n instanceof Uint8Array?(i="string"==typeof t.content_type?t.content_type:"application/octet-stream",o=n):(i="application/json",o=ZG(JSON.stringify(n)),a||(a=WG(n))),t.content_type=i,t.length=o.length;const s=ZG(JSON.stringify(t)),l=new Uint8Array(r.length+s.length+rW.length+o.length+rW.length);l.set(r),l.set(s,r.length),l.set(rW,r.length+s.length),l.set(o,r.length+s.length+rW.length),l.set(rW,r.length+s.length+rW.length+o.length),r=l}yield iW.captureEnvelope(function(e){let t;const n=e.length,i=n%3,r=[],a=16383;for(let o=0,s=n-i;o<s;o+=a)r.push(eW(e,o,o+a>s?s:o+a));return 1===i?(t=e[n-1],r.push(`${KG[t>>2]+KG[t<<4&63]}==`)):2===i&&(t=(e[n-2]<<8)+e[n-1],r.push(`${KG[t>>10]+KG[t>>4&63]+KG[t<<2&63]}=`)),r.join("")}(r),{hardCrashed:a})})},initNativeSdk(e){return tW(this,void 0,void 0,function*(){const t=Object.assign({enableNative:!0,autoInitializeNativeSdk:!0},e);if(!t.enableNative)return t.enableNativeNagger&&uU.warn("Note: Native Sentry SDK is disabled."),this.enableNative=!1,!1;if(!t.autoInitializeNativeSdk)return t.enableNativeNagger&&uU.warn("Note: Native Sentry SDK was not initialized automatically, you will need to initialize it manually. If you wish to disable the native SDK and get rid of this warning, pass enableNative: false"),this.enableNative=!0,!1;if(!t.dsn)return uU.warn("Warning: No DSN was provided. The Sentry SDK will be disabled. Native SDK will also not be initalized."),this.enableNative=!1,!1;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const{beforeSend:n,beforeBreadcrumb:i,beforeSendTransaction:r,integrations:a}=t,o=nW(t,["beforeSend","beforeBreadcrumb","beforeSendTransaction","integrations"]),s=yield iW.initNativeSdk(o);return this.nativeIsReady=s,this.enableNative=!0,s})},fetchNativeRelease(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;return iW.fetchNativeRelease()})},fetchNativeSdkInfo(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;return iW.fetchNativeSdkInfo()})},fetchNativeDeviceContexts(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;return iW.fetchNativeDeviceContexts()})},fetchNativeAppStart(){return tW(this,void 0,void 0,function*(){return this.enableNative?this._isModuleLoaded(iW)?iW.fetchNativeAppStart():(uU.error(this._NativeClientError),null):(uU.warn(this._DisabledNativeError),null)})},fetchNativeFrames(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;return iW.fetchNativeFrames()})},nativeCrash(){if(this.enableNative){if(!this._isModuleLoaded(iW))throw this._NativeClientError;iW.crash()}},setUser(e){if(!this.enableNative)return;if(!this._isModuleLoaded(iW))throw this._NativeClientError;let t=null,n=null;if(e){const{id:i,ip_address:r,email:a,username:o,segment:s}=e,l=nW(e,["id","ip_address","email","username","segment"]),u={id:i,ip_address:r,email:a,username:o,segment:s};t=this._serializeObject(u),n=this._serializeObject(l)}iW.setUser(t,n)},setTag(e,t){if(!this.enableNative)return;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const n="string"==typeof t?t:JSON.stringify(t);iW.setTag(e,n)},setExtra(t,n){if(!this.enableNative)return;if(!this._isModuleLoaded(iW))throw this._NativeClientError;if("string"==typeof n)return iW.setExtra(t,n);if(void 0===n)return iW.setExtra(t,"undefined");let i;try{const e=IG(n);i=JSON.stringify(e)}catch(e){uU.error("Extra for key ${key} not passed to native SDK, because it contains non-stringifiable values",e)}return"string"==typeof i?iW.setExtra(t,i):iW.setExtra(t,"**non-stringifiable**")},addBreadcrumb(e){if(this.enableNative){if(!this._isModuleLoaded(iW))throw this._NativeClientError;iW.addBreadcrumb(Object.assign(Object.assign({},e),{level:e.level?this._processLevel(e.level):void 0}))}},clearBreadcrumbs(){if(this.enableNative){if(!this._isModuleLoaded(iW))throw this._NativeClientError;iW.clearBreadcrumbs()}},setContext(t,n){if(!this.enableNative)return;if(!this._isModuleLoaded(iW))throw this._NativeClientError;if(null===n)return iW.setContext(t,null);let i;try{i=function(e){const t=IG(e);return null===t||"object"!=typeof t||Array.isArray(t)||t.constructor!==Object?{[qG]:t}:t}(n)}catch(e){uU.error("Context for key ${key} not passed to native SDK, because it contains non-serializable values",e)}i?iW.setContext(t,i):iW.setContext(t,{error:"**non-serializable**"})},closeNativeSdk(){return tW(this,void 0,void 0,function*(){if(this.enableNative&&this._isModuleLoaded(iW))return iW.closeNativeSdk().then(()=>{this.enableNative=!1})})},disableNativeFramesTracking(){this.enableNative&&this._isModuleLoaded(iW)&&iW.disableNativeFramesTracking()},enableNativeFramesTracking(){this.enableNative&&this._isModuleLoaded(iW)&&iW.enableNativeFramesTracking()},isNativeAvailable(){return this._isModuleLoaded(iW)},captureScreenshot(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)return uU.warn(this._DisabledNativeError),null;if(!this._isModuleLoaded(iW))return uU.error(this._NativeClientError),null;let t;try{t=yield iW.captureScreenshot()}catch(e){uU.warn("Failed to capture screenshot",e)}return t?t.map(e=>Object.assign(Object.assign({},e),{data:new Uint8Array(e.data)})):null})},fetchViewHierarchy(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const e=yield iW.fetchViewHierarchy();return e?new Uint8Array(e):null})},startProfiling(e){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const{started:t,error:n}=iW.startProfiling(e);return t?uU.log("[NATIVE] Start Profiling"):uU.error("[NATIVE] Start Profiling Failed",n),!!t},stopProfiling(){if(!this.enableNative)throw this._DisabledNativeError;if(!this._isModuleLoaded(iW))throw this._NativeClientError;const{profile:t,nativeProfile:n,androidProfile:i,error:r}=iW.stopProfiling();if(!t||r)return uU.error("[NATIVE] Stop Profiling Failed",r),null;"ios"!==lr.OS||n||uU.warn("[NATIVE] Stop Profiling Failed: No Native Profile"),"android"!==lr.OS||i||uU.warn("[NATIVE] Stop Profiling Failed: No Android Profile");try{return{hermesProfile:JSON.parse(t),nativeProfile:n,androidProfile:i}}catch(e){return uU.error("[NATIVE] Failed to parse Hermes Profile JSON",e),null}},fetchNativePackageName(){return this.enableNative&&this._isModuleLoaded(iW)&&iW.fetchNativePackageName()||null},fetchNativeStackFramesBy(e){return this.enableNative&&this._isModuleLoaded(iW)&&iW.fetchNativeStackFramesBy(e)||null},initNativeReactNavigationNewFrameTracking(){return tW(this,void 0,void 0,function*(){if(this.enableNative&&this._isModuleLoaded(iW))return iW.initNativeReactNavigationNewFrameTracking()})},captureReplay(e){return tW(this,void 0,void 0,function*(){return this.enableNative?this._isModuleLoaded(iW)?(yield iW.captureReplay(e))||null:(uU.warn(`[NATIVE] \`${this.captureReplay.name}\` is not available when native is not available.`),Promise.resolve(null)):(uU.warn(`[NATIVE] \`${this.captureReplay.name}\` is not available when native is disabled.`),Promise.resolve(null))})},getCurrentReplayId(){return this.enableNative?this._isModuleLoaded(iW)?iW.getCurrentReplayId()||null:(uU.warn(`[NATIVE] \`${this.getCurrentReplayId.name}\` is not available when native is not available.`),null):(uU.warn(`[NATIVE] \`${this.getCurrentReplayId.name}\` is not available when native is disabled.`),null)},crashedLastRun(){return tW(this,void 0,void 0,function*(){if(!this.enableNative)return null;if(!this._isModuleLoaded(iW))return null;const e=yield iW.crashedLastRun();return"boolean"==typeof e?e:null})},getNewScreenTimeToDisplay(){return this.enableNative&&this._isModuleLoaded(iW)?iW.getNewScreenTimeToDisplay():Promise.resolve(null)},getDataFromUri(e){return tW(this,void 0,void 0,function*(){if(!this.enableNative||!this._isModuleLoaded(iW))return null;try{const t=yield iW.getDataFromUri(e);return new Uint8Array(t)}catch(t){return uU.error("Error:",t),null}})},popTimeToDisplayFor(e){if(!this.enableNative||!this._isModuleLoaded(iW))return Promise.resolve(null);try{return iW.popTimeToDisplayFor(e)}catch(t){return uU.error("Error:",t),null}},setActiveSpanId(e){if(this.enableNative&&this._isModuleLoaded(iW))try{iW.setActiveSpanId(e)}catch(t){return void uU.error("Error:",t)}},encodeToBase64(e){return tW(this,void 0,void 0,function*(){if(!this.enableNative||!this._isModuleLoaded(iW))return Promise.resolve(null);try{const t=Array.from(e);return(yield iW.encodeToBase64(t))||null}catch(t){return uU.error("Error:",t),Promise.resolve(null)}})},_processItem(e){const[t,n]=e;if("event"==t.type||"transaction"==t.type){const e=this._processLevels(n);return"android"===aW.platform&&"message"in e&&(e.message={message:e.message}),[t,e]}return e},_serializeObject(e){const t={};return Object.keys(e).forEach(n=>{const i=e[n];t[n]="string"==typeof i?i:JSON.stringify(i)}),t},_processLevels(e){var t;return Object.assign(Object.assign({},e),{level:e.level?this._processLevel(e.level):void 0,breadcrumbs:null===(t=e.breadcrumbs)||void 0===t?void 0:t.map(e=>Object.assign(Object.assign({},e),{level:e.level?this._processLevel(e.level):void 0}))})},_processLevel:e=>"log"==e?"debug":e,_isModuleLoaded:e=>!!e,_DisabledNativeError:new VG("Native is disabled"),_NativeClientError:new VG("Native Client is not available, can't start on native."),enableNative:!0,nativeIsReady:!1,platform:lr.OS};function oW(e){return tW(this,void 0,void 0,function*(){return aW.getDataFromUri(e)})}"android"===lr.OS||lr.OS;const sW="MobileFeedback",lW=(e={})=>{const{buttonOptions:t,screenshotButtonOptions:n,colorScheme:i,themeLight:r,themeDark:a}=e,o=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(e,["buttonOptions","screenshotButtonOptions","colorScheme","themeLight","themeDark"]);return{name:sW,options:o,buttonOptions:t||{},screenshotButtonOptions:n||{},colorScheme:i||"system",themeLight:r||{},themeDark:a||{}}},uW=()=>{var e;return null===(e=YU())||void 0===e?void 0:e.getIntegrationByName(sW)},cW="auto.interaction",dW="manual.interaction",hW=(e,t)=>{(function(e){return e===pG(e)})(t)&&function(e){return e instanceof AG}(t)?e.on("spanEnd",e=>{if(e!==t)return;mG(t).length<=1&&(uU.log(`Not sampling as ${sG(t).op} transaction has no child spans.`),t._sampled=!1)}):uU.warn("Not sampling childless spans only works for Sentry Transactions (Root Spans).")},mW=(e,{finalTimeout:t,idleTimeout:n})=>{const i=YU();if(!i)return uU.warn("[startIdleSpan] Can't create idle span, missing client."),new bG;if("background"===Tu.currentState)return uU.debug(`[startIdleSpan] App is already in background, not starting span for ${e.name}`),new bG;UU().setPropagationContext({traceId:OU(),spanId:RU()});const r=jG(e,{finalTimeout:t,idleTimeout:n});return((e,t)=>{const n=Tu.addEventListener("change",e=>{"background"===e&&(uU.debug(`Setting ${sG(t).op} transaction to cancelled because the app is in the background.`),t.setStatus({code:2,message:"cancelled"}),t.end())});n&&e.on("spanEnd",e=>{e===t&&(uU.debug(`Removing AppState listener for ${sG(t).op} transaction.`),n&&n.remove&&n.remove())})})(i,r),r};const pW="ReactNativeTracing";function fW(){const e=YU();if(e)return function(e){return e.getIntegrationByName(pW)}(e)}$G();const _W="UserInteraction",gW=e=>{const t=YU();if(!t)return;const n=fW();if(!n)return void uU.log(`[${_W}] Tracing integration is not available. Can not start user interaction span.`);const i=t.getOptions(),{elementId:r,op:a}=e;if(!i.enableUserInteractionTracing)return void uU.log(`[${_W}] User Interaction Tracing is disabled.`);if(!r)return void uU.log(`[${_W}] User Interaction Tracing can not create transaction with undefined elementId.`);if(!n.state.currentRoute)return void uU.log(`[${_W}] User Interaction Tracing can not create transaction without a current route.`);const o=fG(),s=o&&![cW,dW].includes(sG(o).origin);if(o&&s)return void uU.warn(`[${_W}] Did not create ${a} transaction because active transaction ${sG(o).description} exists on the scope.`);const l=`${n.state.currentRoute}.${r}`;if(o&&sG(o).description===l&&sG(o).op===a)return void uU.warn(`[${_W}] Did not create ${a} transaction because it the same transaction ${sG(o).description} already exists on the scope.`);const u=UU(),c={name:l,op:a,scope:u};!function(e){delete e._sentrySpan}(u);const d=mW(c,{idleTimeout:n.options.idleTimeoutMs,finalTimeout:n.options.finalTimeoutMs});return d.setAttribute(KU,dW),hW(t,d),uU.log(`[${_W}] User Interaction Tracing Created ${a} transaction ${l}.`),d};new class{constructor({cleanupInterval:e=5e3,ttl:t=2e3}={}){this._ttl=t,this._map=new Map,this._cleanupIntervalMs=e,this.startCleanup()}set(e,t){if(this._cleanupInterval||this.startCleanup(),"object"!=typeof t||!("then"in t))return void this._map.set(e,{value:t,expiresAt:Date.now()+this._ttl,promise:null});const n={value:void 0,expiresAt:null,promise:t};this._map.set(e,n),t.then(e=>{n.value=e,n.expiresAt=Date.now()+this._ttl,n.promise=null},()=>{n.expiresAt=Date.now()+this._ttl,n.promise=null})}pop(e){const t=this.get(e);return this._map.delete(e),t}get(e){const t=this._map.get(e);if(t)return t.promise?t.promise:(t.expiresAt&&t.expiresAt<=Date.now()&&this._map.delete(e),t.value)}has(e){const t=this._map.get(e);return!!t&&(!!t.promise||(!(t.expiresAt&&t.expiresAt<=Date.now())||(this._map.delete(e),!1)))}ttl(e){const t=this._map.get(e);if(t&&t.expiresAt){const e=t.expiresAt-Date.now();return e>0?e:0}}cleanup(){const e=Date.now();for(const[t,n]of this._map.entries())n.expiresAt&&n.expiresAt<=e&&this._map.delete(t);this._map.size||this.stopCleanup()}clear(){clearInterval(this._cleanupInterval),this._map.clear()}stopCleanup(){clearInterval(this._cleanupInterval)}startCleanup(){this._cleanupInterval=setInterval(()=>this.cleanup(),this._cleanupIntervalMs)}}({ttl:6e4});const yW=(e,t)=>{$G()&&void 0!==GG.alert?GG.alert(`${e}\n${t}`):sr.alert(e,t)},vW={onFormOpen:()=>{},onFormClose:()=>{},onAddScreenshot:e=>{},onSubmitSuccess:()=>{},onSubmitError:()=>{},onFormSubmitted:()=>{},showBranding:!0,isEmailRequired:!1,shouldValidateEmail:!0,isNameRequired:!1,showEmail:!0,showName:!0,enableScreenshot:!1,enableTakeScreenshot:!1,cancelButtonLabel:"Cancel",emailLabel:"Email",emailPlaceholder:"your.email@example.org",formTitle:"Report a Bug",isRequiredLabel:"(required)",messageLabel:"Description",messagePlaceholder:"What's the bug? What did you expect?",nameLabel:"Name",namePlaceholder:"Your Name",submitButtonLabel:"Send Bug Report",errorTitle:"Error",formError:"Please fill out all required fields.",emailError:"Please enter a valid email address.",captureScreenshotError:"Error capturing screenshot. Please try again.",successMessageText:"Thank you for your report!",addScreenshotButtonLabel:"Add a screenshot",removeScreenshotButtonLabel:"Remove screenshot",captureScreenshotButtonLabel:"Take a screenshot",genericError:"Unable to send feedback due to an unexpected error."};function bW(){const e=(()=>{const e=uW();return e?e.colorScheme:"system"})(),t="system"===e?hu.getColorScheme():e,n=Object.assign(Object.assign({},SW),(()=>{const e=uW();return e?e.themeLight:{}})()),i=Object.assign(Object.assign({},wW),(()=>{const e=uW();return e?e.themeDark:{}})());return"dark"===t?i:n}const SW={accentBackground:"rgba(88, 74, 192, 1)",accentForeground:"#ffffff",foreground:"#2b2233",background:"#ffffff",border:"rgba(41, 35, 47, 0.13)",feedbackIcon:"rgba(54, 45, 89, 1)",sentryLogo:"rgba(54, 45, 89, 1)"},wW={accentBackground:"rgba(88, 74, 192, 1)",accentForeground:"#ffffff",foreground:"#ebe6ef",background:"#29232f",border:"rgba(235, 230, 239, 0.15)",feedbackIcon:"#ffffff",sentryLogo:"#ffffff"};const kW="AutoInjectMobileScreenshotButton";class CW{static get _feedbackComponentName(){throw new Error("Subclasses must override feedbackComponentName")}static initialize(e){this._setVisibility=e}static reset(){this._isVisible=!1,this._setVisibility=void 0}static show(){this._setVisibility?(this._isVisible=!0,this._setVisibility(!0)):console.warn(`[Sentry] ${this._feedbackComponentName} requires 'Sentry.wrap(RootComponent)' to be called before 'show${this._feedbackComponentName}()'.`)}static hide(){this._setVisibility?(this._isVisible=!1,this._setVisibility(!1)):console.warn(`[Sentry] ${this._feedbackComponentName} requires 'Sentry.wrap(RootComponent)' before interacting with the widget.`)}static isFormVisible(){return this._isVisible}}CW._isVisible=!1;class EW extends CW{static get _feedbackComponentName(){return"FeedbackButton"}}class IW extends CW{static get _feedbackComponentName(){return"ScreenshotButton"}}const xW=()=>{var e,t;$G()?uU.warn("ScreenshotButton is not supported on Web."):((null===(e=YU())||void 0===e?void 0:e.getIntegrationByName(kW))||null===(t=YU())||void 0===t||t.addIntegration({name:kW}),IW.show())};let TW;var OW=function(t,n,i,r){return new(i||(i=Promise))(function(n,a){function o(t){try{l(r.next(t))}catch(e){a(e)}}function s(t){try{l(r.throw(t))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(o,s)}l((r=r.apply(t,[])).next())})};class RW extends M.Component{constructor(e){var t,n,i,r,a,o;super(e),this._didSubmitForm=!1,this.handleFeedbackSubmit=()=>{const{name:e,email:t,description:n}=this.state,{onSubmitSuccess:i,onSubmitError:r,onFormSubmitted:a}=this.props,o=this.props,s=null==e?void 0:e.trim(),l=null==t?void 0:t.trim(),u=null==n?void 0:n.trim();if(this.props.isNameRequired&&!s||this.props.isEmailRequired&&!l||!u)return void yW(o.errorTitle,o.formError);if(this.props.shouldValidateEmail&&(this.props.isEmailRequired||l.length>0)&&!(e=>/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(e))(l))return void yW(o.errorTitle,o.emailError);const c=this.state.filename&&this.state.attachment?[{filename:this.state.filename,data:this.state.attachment}]:void 0,d={message:u,name:s,email:l,associatedEventId:GU().lastEventId()};try{a||this.setState({isVisible:!1}),function(e,t={},n=UU()){const{message:i,name:r,email:a,url:o,source:s,associatedEventId:l,tags:u}=e,c={contexts:{feedback:CU({contact_email:a,name:r,message:i,url:o,source:s,associated_event_id:l})},type:"feedback",level:"info",tags:u},d=n&&n.getClient()||YU();d&&d.emit("beforeSendFeedback",c,t),n.captureEvent(c,t)}(d,c?{attachments:c}:void 0),i({name:s,email:l,message:u,attachments:c}),yW(o.successMessageText,""),a(),this._didSubmitForm=!0}catch(h){r(new Error(`Feedback form submission failed: ${h}`)),yW(o.errorTitle,o.genericError),uU.error(`Feedback form submission failed: ${h}`)}},this.onScreenshotButtonPress=()=>OW(this,0,void 0,function*(){if(this._hasScreenshot())this.setState({filename:void 0,attachment:void 0,attachmentUri:void 0});else{const e=this.props;if(e.imagePicker){const t=e.imagePicker.launchImageLibraryAsync?()=>e.imagePicker.launchImageLibraryAsync({mediaTypes:["images"],base64:$G()}):e.imagePicker.launchImageLibrary?()=>e.imagePicker.launchImageLibrary({mediaType:"photo",includeBase64:$G()}):null;if(!t)return void uU.warn("No compatible image picker library found. Please provide a valid image picker library.");const n=yield t();if(n.assets&&n.assets.length>0)if($G()){const e=n.assets[0].fileName,t=n.assets[0].uri,i=(e=>{if("function"!=typeof atob||!$G())throw new Error("atob is not available in this environment.");const t=atob(e);return new Uint8Array([...t].map(e=>e.charCodeAt(0)))})(n.assets[0].base64);null!=i?this.setState({filename:e,attachment:i,attachmentUri:t}):uU.error("Failed to read image data on the web")}else{const e=n.assets[0].fileName,t=n.assets[0].uri;oW(t).then(n=>{null!=n?this.setState({filename:e,attachment:n,attachmentUri:t}):(this._showImageRetrievalDevelopmentNote(),uU.error("Failed to read image data from uri:",t))}).catch(e=>{this._showImageRetrievalDevelopmentNote(),uU.error("Failed to read image data from uri:",t,"error: ",e)})}}else{const{onAddScreenshot:e}=Object.assign(Object.assign({},vW),this.props);e(e=>{oW(e).then(t=>{null!=t?this.setState({filename:"feedback_screenshot",attachment:t,attachmentUri:e}):(this._showImageRetrievalDevelopmentNote(),uU.error("Failed to read image data from uri:",e))}).catch(t=>{this._showImageRetrievalDevelopmentNote(),uU.error("Failed to read image data from uri:",e,"error: ",t)})})}}}),this._setCapturedScreenshot=e=>{null!=e.data?(uU.debug("Setting captured screenshot:",e.filename),aW.encodeToBase64(e.data).then(t=>{if(null!=t){const n=`data:${e.contentType};base64,${t}`;this.setState({filename:e.filename,attachment:e.data,attachmentUri:n})}else uU.error("Failed to read image data from:",e.filename)}).catch(t=>{uU.error("Failed to read image data from:",e.filename,"error: ",t)})):uU.error("Failed to read image data from:",e.filename)},this._saveFormState=()=>{RW._savedState=Object.assign({},this.state)},this._clearFormState=()=>{RW._savedState={name:"",email:"",description:"",filename:void 0,attachment:void 0,attachmentUri:void 0}},this._hasScreenshot=()=>void 0!==this.state.filename&&void 0!==this.state.attachment&&void 0!==this.state.attachmentUri,this._getUser=()=>{const e=UU().getUser();if(e)return e;const t=GU().getUser();return t||rU("globalScope",()=>new NU).getUser()},this._showImageRetrievalDevelopmentNote=()=>{YG()&&yW("Development note","The feedback widget cannot retrieve image data in Expo Go. Please build your app to test this functionality.")};const s={useSentryUser:{email:(null===(n=null===(t=this.props)||void 0===t?void 0:t.useSentryUser)||void 0===n?void 0:n.email)||(null===(i=this._getUser())||void 0===i?void 0:i.email)||"",name:(null===(a=null===(r=this.props)||void 0===r?void 0:r.useSentryUser)||void 0===a?void 0:a.name)||(null===(o=this._getUser())||void 0===o?void 0:o.name)||""}};this.state={isVisible:!0,name:RW._savedState.name||s.useSentryUser.name,email:RW._savedState.email||s.useSentryUser.email,description:RW._savedState.description||"",filename:RW._savedState.filename||void 0,attachment:RW._savedState.attachment||void 0,attachmentUri:RW._savedState.attachmentUri||void 0},function(){var e,t;(null===(e=YU())||void 0===e?void 0:e.getIntegrationByName(sW))||null===(t=YU())||void 0===t||t.addIntegration(lW())}()}static reset(){RW._savedState={name:"",email:"",description:"",filename:void 0,attachment:void 0,attachmentUri:void 0}}componentDidMount(){this._themeListener=hu.addChangeListener(()=>{this.forceUpdate()})}componentWillUnmount(){this._didSubmitForm?(this._clearFormState(),this._didSubmitForm=!1):this._saveFormState(),this._themeListener&&this._themeListener.remove()}render(){const e=bW(),{name:t,email:n,description:i}=this.state,{onFormClose:r}=this.props,a=this.props,o=this.props,s=this.props,l=Object.assign(Object.assign({},(e=>({container:{flex:1,padding:20,backgroundColor:e.background},title:{fontSize:24,fontWeight:"bold",marginBottom:20,textAlign:"left",flex:1,color:e.foreground},label:{marginBottom:4,fontSize:16,color:e.foreground},input:{height:50,borderColor:e.border,borderWidth:1,borderRadius:5,paddingHorizontal:10,marginBottom:15,fontSize:16,color:e.foreground},textArea:{height:100,textAlignVertical:"top",color:e.foreground},screenshotButton:{backgroundColor:e.background,padding:15,borderRadius:5,alignItems:"center",flex:1,borderWidth:1,borderColor:e.border},screenshotContainer:{flexDirection:"row",alignItems:"center",width:"100%",marginBottom:20},screenshotThumbnail:{width:50,height:50,borderRadius:5,marginRight:10},screenshotText:{color:e.foreground,fontSize:16},takeScreenshotButton:{backgroundColor:e.background,padding:15,borderRadius:5,alignItems:"center",borderWidth:1,borderColor:e.border,marginTop:-10,marginBottom:20},takeScreenshotText:{color:e.foreground,fontSize:16},submitButton:{backgroundColor:e.accentBackground,paddingVertical:15,borderRadius:5,alignItems:"center",marginBottom:10},submitText:{color:e.accentForeground,fontSize:18},cancelButton:{backgroundColor:e.background,padding:15,borderRadius:5,alignItems:"center",borderWidth:1,borderColor:e.border},cancelText:{color:e.foreground,fontSize:16},titleContainer:{flexDirection:"row",width:"100%"},sentryLogo:{width:40,height:40,tintColor:e.sentryLogo}}))(e)),this.props.styles),u=()=>{r?r():this.setState({isVisible:!1})};if(!this.state.isVisible)return null;const c=(()=>{const e=TW;return TW=void 0,e})();return"ErrorCapturingScreenshot"===c?setTimeout(()=>OW(this,0,void 0,function*(){yW(s.errorTitle,s.captureScreenshotError)}),100):c&&this._setCapturedScreenshot(c),M.createElement(fm,{onPress:XG()?Pu.dismiss:void 0,accessible:!1,accessibilityElementsHidden:!1},M.createElement(_a,{style:l.container},M.createElement(_a,{style:l.titleContainer},M.createElement(hl,{style:l.title,testID:"sentry-feedback-form-title"},s.formTitle),a.showBranding&&M.createElement(Js,{source:{uri:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAC4BAMAAABUVL5sAAAAD1BMVEUAAAA2Llo3LVk4LFg2LVmgcvrUAAAABHRSTlMAgL9ARyeO/QAAA7pJREFUeNrtWltynDAQFBIHIFUcgCQ6AIk5AAjd/0ypxFk3ouUCNJofl/rHy75a09MzI7Q2DQ0NDQ0NDQ0NDQ0N9eF+xPh9MKpwPv6FLss7R9yMImz8j8nowb9IglFDF6N+KCNIdqMFcGjpBbVUXdzHqKsXUhJGNb2g1vz6azRgX8XulUwMtVZjFsWkvFz10s0ooEO+9Vpxj/6rp9eI5VsdE6eJcDCxilqICiZWMHBSMkBVA2vq1SVrVyr6Ea5VMjHqjytTwcAgRVJ0DAy9VoWUTNT3tQysZGIYmGNTKHfK0q6oFkysYWCuHB0DaxX9yHLx5JKrhVC0TGwjWNRMvNAuW6PoR4TCepnqLLuiicEyKJq4g2C6Rc+hsInlgtHCF41OrD65INisObksbKy2/YJg9U08sGBTbRN3YaBQQu2i74/mcQil6vZr5C0dQpGbGKJvdOA1VDVxd5LHooPR5BJPdwql5vaLeq9FQZKJpa1kOoUSKpq45+m+ZK93aUpSwRyuafslUguCIZRZamKoBYQT80QmlqnF38p6bSIDcyg2q5fw/uo8dx0upZMLLdadQ1kgkNDEOOGiYYXjVKGJ8V00rEggcErurxAKCwQTi9RCAW7UFcUm5vPAOFNXFBY9DggQyp76jnIkOyBwaeqtyMScEu7w4JRNLnyQOjyvACcWpR145g6PV1fp9mvE0jMd3tWZXDR3/Ud2cSXZfmHhvNpEoFlgYsjFHX4AJc3kXXSTyEfDTrz94ptE1qvS9ouG1Ud2sQT5PVcHg3FL78FIYUpqxWK1yLzMxNzhHVaLzItMzB0eB/S4CDRHC+AzFTjhAiSSHx9tpgJXqnmhXi7VizM/F5v4V5oVqOIp81PpEW4Xt7PUA0kEe5WZ2PLt7ZopDg8Seue9GpxoU0WrHyFPgYlzmyrKPDxcpFeX3YRS5mGvxybmsC2tPhLJQxPzdsfliwMeLjAx9wcujoFIaEAX/KSYXz0s+9TE/E7LX0yF8lQvitl99sVjSgITl/yk6Lk48JjfGadnanHml8xjMvFTA+eL42CRwDKEZwbm4rBMyAmdH6UEz8HDTPj4d4ie1EJxJCQg56DXaxKOl0iGz0jcdebZluzhbFSA1yEZ2JzbHZKQe3I/EK4CErTHbwn84ZP+8Poxqrd/+I2cXJAw0v9VAkBiI3DhLryZEe6SXNeJk5HcHFu+Aom5wiIn2a7niZiE1WKMUhIOhNFJSQZzh0VG8tPcQufLSQI46sO9vcM0NDQ0NDQ0NDQ0NHxF/AFGJOBYBWrb5gAAAABJRU5ErkJggg=="},style:l.sentryLogo,testID:"sentry-logo"})),a.showName&&M.createElement(M.Fragment,null,M.createElement(hl,{style:l.label},s.nameLabel,a.isNameRequired&&` ${s.isRequiredLabel}`),M.createElement(kh,{style:l.input,testID:"sentry-feedback-name-input",placeholder:s.namePlaceholder,value:t,onChangeText:e=>this.setState({name:e})})),a.showEmail&&M.createElement(M.Fragment,null,M.createElement(hl,{style:l.label},s.emailLabel,a.isEmailRequired&&` ${s.isRequiredLabel}`),M.createElement(kh,{style:l.input,testID:"sentry-feedback-email-input",placeholder:s.emailPlaceholder,keyboardType:"email-address",value:n,onChangeText:e=>this.setState({email:e})})),M.createElement(hl,{style:l.label},s.messageLabel,` ${s.isRequiredLabel}`),M.createElement(kh,{style:[l.input,l.textArea],testID:"sentry-feedback-message-input",placeholder:s.messagePlaceholder,value:i,onChangeText:e=>this.setState({description:e}),multiline:!0}),(a.enableScreenshot||o.imagePicker||this._hasScreenshot())&&M.createElement(_a,{style:l.screenshotContainer},this.state.attachmentUri&&M.createElement(Js,{source:{uri:this.state.attachmentUri},style:l.screenshotThumbnail}),M.createElement(xc,{style:l.screenshotButton,onPress:this.onScreenshotButtonPress},M.createElement(hl,{style:l.screenshotText},this._hasScreenshot()?s.removeScreenshotButtonLabel:s.addScreenshotButtonLabel))),XG()&&a.enableTakeScreenshot&&!this.state.attachmentUri&&M.createElement(xc,{style:l.takeScreenshotButton,onPress:()=>{EW.hide(),u(),xW()}},M.createElement(hl,{style:l.takeScreenshotText,testID:"sentry-feedback-take-screenshot-button"},s.captureScreenshotButtonLabel)),M.createElement(xc,{style:l.submitButton,onPress:this.handleFeedbackSubmit},M.createElement(hl,{style:l.submitText,testID:"sentry-feedback-submit-button"},s.submitButtonLabel)),M.createElement(xc,{style:l.cancelButton,onPress:u},M.createElement(hl,{style:l.cancelText},s.cancelButtonLabel))))}}RW.defaultProps=Object.assign({},vW),RW._savedState={name:"",email:"",description:"",filename:void 0,attachment:void 0,attachmentUri:void 0},function(){var e;const{major:t,minor:n}=(null===(e=UG.ReactNativeVersion)||void 0===e?void 0:e.version)||{}}();tr.hasViewManagerConfig&&tr.hasViewManagerConfig("RNSentryOnDrawReporter");const AW=Ei.create({wrapperView:{flex:1}}),LW="sentry-label",PW="data-sentry-component",MW="data-sentry-element",DW="data-sentry-source-file";class NW extends M.Component{constructor(){super(...arguments),this.name="TouchEventBoundary"}componentDidMount(){var e;const t=YU();null===(e=null==t?void 0:t.addIntegration)||void 0===e||e.call(t,function(e,t=()=>{}){return{name:e,setupOnce:t}}(this.name))}render(){return M.createElement(_a,{style:AW.wrapperView,onTouchStart:this._onTouchStart.bind(this)},this.props.children)}_logTouchEvent(e,t){const n=e[0],i=t||`${n.name}${n.file?` (${n.file})`:""}`,r={category:this.props.breadcrumbCategory,data:{path:e},level:"info",message:`Touch event within element: ${i}`,type:this.props.breadcrumbType};zG(r),uU.log(`[TouchEvents] ${r.message}`)}_isNameIgnored(e){let t=this.props.ignoreNames||[];return this.props.ignoredDisplayNames&&(t=[...t,...this.props.ignoredDisplayNames]),t.some(t=>"string"==typeof t&&e===t||t instanceof RegExp&&e.match(t))}_onTouchStart(e){var t,n;if(!e._targetInst)return;let i=e._targetInst;const r=[];for(;i&&this.props.maxComponentTreeSize&&r.length<this.props.maxComponentTreeSize&&(null===(t=i.elementType)||void 0===t?void 0:t.displayName)!==NW.displayName;){const e=FW(i,this.props.labelName);this._pushIfNotIgnored(r,e),i=i.return}const a=null===(n=r.find(e=>e.label))||void 0===n?void 0:n.label;r.length>0&&this._logTouchEvent(r,a);const o=gW({elementId:a,op:"ui.action.touch"});o&&o.setAttribute(KU,cW)}_pushIfNotIgnored(e,t){return!!t&&(!(!t.name&&!t.label)&&((!t.name||!this._isNameIgnored(t.name))&&((!t.label||!this._isNameIgnored(t.label))&&(!(e.length>0&&JSON.stringify(e[e.length-1])===JSON.stringify(t))&&(e.push(t),!0)))))}}function FW(e,t){var n;const i=null===(n=e.elementType)||void 0===n?void 0:n.displayName,r=e.memoizedProps;return r?CU({name:BW(r)||i,element:jW(r),file:VW(r),label:HW(r,t)}):i?{name:i}:void 0}function BW(e){return"string"==typeof e[PW]&&e[PW].length>0&&"unknown"!==e[PW]&&e[PW]||void 0}function jW(e){return"string"==typeof e[MW]&&e[MW].length>0&&"unknown"!==e[MW]&&e[MW]||void 0}function VW(e){return"string"==typeof e[DW]&&e[DW].length>0&&"unknown"!==e[DW]&&e[DW]||void 0}function HW(e,t){return"string"==typeof e[LW]&&e[LW].length>0?e[LW]:"string"==typeof t&&"string"==typeof e[t]&&e[t].length>0?e[t]:void 0}function zW(e){return Array.isArray(e)||eN(e)}function UW(e,t){const n=zW(e),i=zW(t);if(n!==i)throw zG({data:{incoming:e,schema:t,isArrayIncoming:n,isArraySchema:i},message:"TypeGuard isArray"}),new Error(`PersistenceUtils::typeGuard] ${eU.MalformedDataError}`);if(n)for(const r of e)UW(r,t[0]);return YW(t)&&Object.keys(t).forEach(n=>{const i=e[n],r=t[n];if(i&&zW(r))UW(i,r);else if(i&&YW(i))UW(i,r);else if(YW(e)&&!e.hasOwnProperty(n))throw zG({data:{key:n,incoming:e,incomingProperty:i,schema:t,schemaProperty:r,isObjectIncoming:YW(e),hasOwnPropertyIncoming:e.hasOwnProperty(n)},message:"TypeGuard isObject"}),new Error(`[PersistenceUtils::typeGuard] ${eU.MalformedDataError}`)}),!0}NW.displayName="__Sentry.TouchEventBoundary",NW.defaultProps={breadcrumbCategory:"touch",breadcrumbType:"user",ignoreNames:[],maxComponentTreeSize:20};const GW=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;function WW(e){if(zW(e))for(let t=0;t<e.length;t++)e[t]=WW(e[t]);else if(YW(e))for(const t of Object.keys(e)){const n=e[t];"object"==typeof n?e[t]=WW(n):"string"==typeof n&&GW.exec(n)&&(e[t]=new Date(n))}return e}function YW(e){return null!=e&&"object"==typeof e&&!zW(e)}class $W{storageName;schema;constructor(e,t){this.storageName=`${e}Storage`,this.schema=JSON.parse(JSON.stringify(t))}get(){const e=Qj.getString(this.storageName),t=this.instantiateData(e);return this.isT(t),t}update(e){const t=JSON.parse(JSON.stringify(e)),n=Object.assign(this.get(),t);return this.isT(n),Qj.set(this.storageName,JSON.stringify(n)),n}set(e){return this.isT(e),Qj.set(this.storageName,JSON.stringify(e)),e}clear(){return Qj.delete(this.storageName),this.instantiateData(void 0)}instantiateData(e){const t=e??JSON.stringify(this.schema);return Qj.set(this.storageName,t),JSON.parse(t)}isT(e){if(!e||"object"!=typeof e)throw new Error(`[PersistenceManager::isT] ${eU.IncorrectDataError}`);return UW(e,this.schema),!0}}class XW{persistenceManager;schema;data;constructor(e,t){this.schema=JSON.parse(JSON.stringify(t)),this.data=JSON.parse(JSON.stringify(t)),this.persistenceManager=new $W(e,t),this.createDataFromSchema(),this.restore()}get(){return this.data}set(e){return this.data=JSON.parse(JSON.stringify(e)),this.data=WW(this.data),this.data}update(e){if(zW(this.data)){const n=this.data.findIndex(t=>t.uuid===e.uuid);if(-1!==n)this.data[n]={...this.data[n],...e};else try{UW([e],this.schema),this.data.push(e)}catch(t){if(t.message===eU.MalformedDataError)throw new Error("[DataManager::update] Cannot add an element that does not contain required fields");throw t}}else Object.assign(this.data,e);return this.data}save(e=!0){return e?this.persistenceManager.update(this.data):this.persistenceManager.set(this.data)}restore(){if(this.data=this.persistenceManager.get(),this.data=WW(this.data),zW(this.data)){const e=e=>e.filter(e=>!!e.uuid);this.data=e(this.data)}return this.data}clear=()=>(this.persistenceManager.clear(),this.createDataFromSchema(),this.data);createDataFromSchema(){this.data=zW(this.schema)?[]:JSON.parse(JSON.stringify(this.schema))}}const qW=new class extends XW{migrateData(){throw new Error("[TrackingManager::migrateData] Method purposefully not implemented.")}constructor(){super("trackingEvent",[])}update(e){return super.update(e)}sync=async()=>{const e=super.get(),t=[];for(const n of e)try{await Jz(n)}catch{t.push(n)}super.set(t),super.save(!1)}},ZW=6048e5,KW=6e4,QW=36e5,JW=Symbol.for("constructDateFrom");function eY(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&JW in e?e[JW](t):e instanceof Date?new e.constructor(t):new Date(t)}function tY(e,t){return eY(t||e,e)}function nY(e,t,n){const i=tY(e,n?.in);return isNaN(t)?eY(n?.in||e,NaN):t?(i.setDate(i.getDate()+t),i):i}function iY(e,t,n){const i=tY(e,n?.in);if(isNaN(t))return eY(e,NaN);if(!t)return i;const r=i.getDate(),a=eY(e,i.getTime());a.setMonth(i.getMonth()+t+1,0);return r>=a.getDate()?a:(i.setFullYear(a.getFullYear(),a.getMonth(),r),i)}function rY(e,t,n){return function(e,t){return eY(e,+tY(e)+t)}(e,t*QW)}let aY={};function oY(){return aY}function sY(e,t){const n=oY(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=tY(e,t?.in),a=r.getDay(),o=(a<i?7:0)+a-i;return r.setDate(r.getDate()-o),r.setHours(0,0,0,0),r}function lY(e,t){return sY(e,{...t,weekStartsOn:1})}function uY(e,t){const n=tY(e,t?.in),i=n.getFullYear(),r=eY(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const a=lY(r),o=eY(n,0);o.setFullYear(i,0,4),o.setHours(0,0,0,0);const s=lY(o);return n.getTime()>=a.getTime()?i+1:n.getTime()>=s.getTime()?i:i-1}function cY(e){const t=tY(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function dY(e,...t){const n=eY.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}function hY(e,t){const n=tY(e,t?.in);return n.setHours(0,0,0,0),n}function mY(e,t,n){const i=tY(e,n?.in);return i.setTime(i.getTime()+t*KW),i}function pY(e,t){const n=+tY(e)-+tY(t);return n<0?-1:n>0?1:n}function fY(e){return!(!((t=e)instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t))&&"number"!=typeof e||isNaN(+tY(e)));var t}function _Y(e,t,n){const i=(r=t,(+tY(e)-+tY(r))/KW);var r,a;return(a=n?.roundingMethod,e=>{const t=(a?Math[a]:Math.trunc)(e);return 0===t?0:t})(i)}function gY(e,t,n){const[i,r]=dY(n?.in,e,t),a=pY(i,r),o=Math.abs(function(e,t,n){const[i,r]=dY(n?.in,e,t);return i.getFullYear()-r.getFullYear()}(i,r));i.setFullYear(1584),r.setFullYear(1584);const s=a*(o-+(pY(i,r)===-a));return 0===s?0:s}const yY={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},vY=(e,t,n)=>{let i;const r=yY[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function bY(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const SY={date:bY({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:bY({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},wY={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},kY=(e,t,n,i)=>wY[e];function CY(e){return(t,n)=>{let i;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}return i[e.argumentCallback?e.argumentCallback(t):t]}}const EY={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:CY({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:CY({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function IY(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],a=t.match(r);if(!a)return null;const o=a[0],s=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n;return}(s,e=>e.test(o)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n;return}(s,e=>e.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;return{value:u,rest:t.slice(o.length)}}}function xY(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;return{value:o,rest:t.slice(r.length)}}}const TY={ordinalNumber:xY({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:IY({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},OY={code:"en-US",formatDistance:vY,formatLong:SY,formatRelative:kY,localize:EY,match:TY,options:{weekStartsOn:0,firstWeekContainsDate:1}};function RY(e,t){const n=tY(e,t?.in),i=function(e,t,n){const[i,r]=dY(n?.in,e,t),a=hY(i),o=hY(r),s=+a-cY(a),l=+o-cY(o);return Math.round((s-l)/864e5)}(n,function(e,t){const n=tY(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}(n));return i+1}function AY(e,t){const n=tY(e,t?.in),i=+lY(n)-+function(e,t){const n=uY(e,t),i=eY(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),lY(i)}(n);return Math.round(i/ZW)+1}function LY(e,t){const n=tY(e,t?.in),i=n.getFullYear(),r=oY(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=eY(t?.in||e,0);o.setFullYear(i+1,0,a),o.setHours(0,0,0,0);const s=sY(o,t),l=eY(t?.in||e,0);l.setFullYear(i,0,a),l.setHours(0,0,0,0);const u=sY(l,t);return+n>=+s?i+1:+n>=+u?i:i-1}function PY(e,t){const n=tY(e,t?.in),i=+sY(n,t)-+function(e,t){const n=oY(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=LY(e,t),a=eY(t?.in||e,0);return a.setFullYear(r,0,i),a.setHours(0,0,0,0),sY(a,t)}(n,t);return Math.round(i/ZW)+1}function MY(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const DY={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return MY("yy"===t?i%100:i,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):MY(n+1,2)},d:(e,t)=>MY(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>MY(e.getHours()%12||12,t.length),H:(e,t)=>MY(e.getHours(),t.length),m:(e,t)=>MY(e.getMinutes(),t.length),s:(e,t)=>MY(e.getSeconds(),t.length),S(e,t){const n=t.length,i=e.getMilliseconds();return MY(Math.trunc(i*Math.pow(10,n-3)),t.length)}},NY="midnight",FY="noon",BY="morning",jY="afternoon",VY="evening",HY="night",zY={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),i=t>0?t:1-t;return n.ordinalNumber(i,{unit:"year"})}return DY.y(e,t)},Y:function(e,t,n,i){const r=LY(e,i),a=r>0?r:1-r;if("YY"===t){return MY(a%100,2)}return"Yo"===t?n.ordinalNumber(a,{unit:"year"}):MY(a,t.length)},R:function(e,t){return MY(uY(e),t.length)},u:function(e,t){return MY(e.getFullYear(),t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return MY(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return MY(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return DY.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return MY(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=PY(e,i);return"wo"===t?n.ordinalNumber(r,{unit:"week"}):MY(r,t.length)},I:function(e,t,n){const i=AY(e);return"Io"===t?n.ordinalNumber(i,{unit:"week"}):MY(i,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):DY.d(e,t)},D:function(e,t,n){const i=RY(e);return"Do"===t?n.ordinalNumber(i,{unit:"dayOfYear"}):MY(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return MY(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),a=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return MY(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=0===i?7:i;switch(t){case"i":return String(r);case"ii":return MY(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(r=12===i?FY:0===i?NY:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(r=i>=17?VY:i>=12?jY:i>=4?BY:HY,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return DY.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):DY.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return"Ko"===t?n.ordinalNumber(i,{unit:"hour"}):MY(i,t.length)},k:function(e,t,n){let i=e.getHours();return 0===i&&(i=24),"ko"===t?n.ordinalNumber(i,{unit:"hour"}):MY(i,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):DY.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):DY.s(e,t)},S:function(e,t){return DY.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return GY(i);case"XXXX":case"XX":return WY(i);default:return WY(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return GY(i);case"xxxx":case"xx":return WY(i);default:return WY(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+UY(i,":");default:return"GMT"+WY(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+UY(i,":");default:return"GMT"+WY(i,":")}},t:function(e,t,n){return MY(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return MY(+e,t.length)}};function UY(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),a=i%60;return 0===a?n+String(r):n+String(r)+t+MY(a,2)}function GY(e,t){if(e%60==0){return(e>0?"-":"+")+MY(Math.abs(e)/60,2)}return WY(e,t)}function WY(e,t=""){const n=e>0?"-":"+",i=Math.abs(e);return n+MY(Math.trunc(i/60),2)+t+MY(i%60,2)}const YY=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},$Y=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},XY={p:$Y,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return YY(e,t);let a;switch(i){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;default:a=t.dateTime({width:"full"})}return a.replace("{{date}}",YY(i,t)).replace("{{time}}",$Y(r,t))}},qY=/^D+$/,ZY=/^Y+$/,KY=["D","DD","YY","YYYY"];function QY(e){return qY.test(e)}function JY(e){return ZY.test(e)}function e$(e,t,n){const i=function(e,t,n){const i="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(i),KY.includes(e))throw new RangeError(i)}const t$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,n$=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,i$=/^'([^]*?)'?$/,r$=/''/g,a$=/[a-zA-Z]/;function o$(e,t,n){const i=oY(),r=i.locale??OY,a=i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=i.weekStartsOn??i.locale?.options?.weekStartsOn??0,s=tY(e,n?.in);if(!fY(s))throw new RangeError("Invalid time value");let l=t.match(n$).map(e=>{const t=e[0];if("p"===t||"P"===t){return(0,XY[t])(e,r.formatLong)}return e}).join("").match(t$).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:s$(e)};if(zY[t])return{isToken:!0,value:e};if(t.match(a$))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});r.localize.preprocessor&&(l=r.localize.preprocessor(s,l));const u={firstWeekContainsDate:a,weekStartsOn:o,locale:r};return l.map(n=>{if(!n.isToken)return n.value;const i=n.value;(JY(i)||QY(i))&&e$(i,t,String(e));return(0,zY[i[0]])(s,i,r.localize,u)}).join("")}function s$(e){const t=e.match(i$);return t?t[1].replace(r$,"'"):e}function l$(e,t){const n=tY(e,t?.in),i=n.getFullYear(),r=n.getMonth(),a=eY(n,0);return a.setFullYear(i,r+1,0),a.setHours(0,0,0,0),a.getDate()}function u$(e,t){return+tY(e)>+tY(t)}function c$(e,t){return+tY(e)<+tY(t)}class d${subPriority=0;validate(e,t){return!0}}class h$ extends d${constructor(e,t,n,i,r){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=i,r&&(this.subPriority=r)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}}class m$ extends d${priority=10;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>eY(t,e))}set(e,t){return t.timestampIsSet?e:eY(e,function(e,t){const n=function(e){return"function"==typeof e&&e.prototype?.constructor===e}(t)?new t(0):eY(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}(e,this.context))}}class p${run(e,t,n,i){const r=this.parse(e,t,n,i);return r?{setter:new h$(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(e,t,n){return!0}}const f$=/^(1[0-2]|0?\d)/,_$=/^(3[0-1]|[0-2]?\d)/,g$=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,y$=/^(5[0-3]|[0-4]?\d)/,v$=/^(2[0-3]|[0-1]?\d)/,b$=/^(2[0-4]|[0-1]?\d)/,S$=/^(1[0-1]|0?\d)/,w$=/^(1[0-2]|0?\d)/,k$=/^[0-5]?\d/,C$=/^[0-5]?\d/,E$=/^\d/,I$=/^\d{1,2}/,x$=/^\d{1,3}/,T$=/^\d{1,4}/,O$=/^-?\d+/,R$=/^-?\d/,A$=/^-?\d{1,2}/,L$=/^-?\d{1,3}/,P$=/^-?\d{1,4}/,M$=/^([+-])(\d{2})(\d{2})?|Z/,D$=/^([+-])(\d{2})(\d{2})|Z/,N$=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,F$=/^([+-])(\d{2}):(\d{2})|Z/,B$=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function j$(e,t){return e?{value:t(e.value),rest:e.rest}:e}function V$(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function H$(e,t){const n=t.match(e);if(!n)return null;if("Z"===n[0])return{value:0,rest:t.slice(1)};const i="+"===n[1]?1:-1,r=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:i*(r*QW+a*KW+1e3*o),rest:t.slice(n[0].length)}}function z$(e){return V$(O$,e)}function U$(e,t){switch(e){case 1:return V$(E$,t);case 2:return V$(I$,t);case 3:return V$(x$,t);case 4:return V$(T$,t);default:return V$(new RegExp("^\\d{1,"+e+"}"),t)}}function G$(e,t){switch(e){case 1:return V$(R$,t);case 2:return V$(A$,t);case 3:return V$(L$,t);case 4:return V$(P$,t);default:return V$(new RegExp("^-?\\d{1,"+e+"}"),t)}}function W$(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Y$(e,t){const n=t>0,i=n?t:1-t;let r;if(i<=50)r=e||100;else{const t=i+50;r=e+100*Math.trunc(t/100)-(e>=t%100?100:0)}return n?r:1-r}function $$(e){return e%400==0||e%4==0&&e%100!=0}const X$=[31,28,31,30,31,30,31,31,30,31,30,31],q$=[31,29,31,30,31,30,31,31,30,31,30,31];function Z$(e,t,n){const i=oY(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=tY(e,n?.in),o=a.getDay(),s=7-r;return nY(a,t<0||t>6?t-(o+s)%7:((t%7+7)%7+s)%7-(o+s)%7,n)}function K$(e,t,n){const i=tY(e,n?.in),r=function(e,t){const n=tY(e,t?.in).getDay();return 0===n?7:n}(i,n);return nY(i,t-r,n)}const Q$={G:new class extends p${priority=140;parse(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]},y:new class extends p${priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,n){const i=e=>({year:e,isTwoDigitYear:"yy"===t});switch(t){case"y":return j$(U$(4,e),i);case"yo":return j$(n.ordinalNumber(e,{unit:"year"}),i);default:return j$(U$(t.length,e),i)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){const i=e.getFullYear();if(n.isTwoDigitYear){const t=Y$(n.year,i);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}const r="era"in t&&1!==t.era?1-n.year:n.year;return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}},Y:new class extends p${priority=130;parse(e,t,n){const i=e=>({year:e,isTwoDigitYear:"YY"===t});switch(t){case"Y":return j$(U$(4,e),i);case"Yo":return j$(n.ordinalNumber(e,{unit:"year"}),i);default:return j$(U$(t.length,e),i)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,i){const r=LY(e,i);if(n.isTwoDigitYear){const t=Y$(n.year,r);return e.setFullYear(t,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),sY(e,i)}const a="era"in t&&1!==t.era?1-n.year:n.year;return e.setFullYear(a,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),sY(e,i)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:new class extends p${priority=130;parse(e,t){return G$("R"===t?4:t.length,e)}set(e,t,n){const i=eY(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),lY(i)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:new class extends p${priority=130;parse(e,t){return G$("u"===t?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]},Q:new class extends p${priority=120;parse(e,t,n){switch(t){case"Q":case"QQ":return U$(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth(3*(n-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:new class extends p${priority=120;parse(e,t,n){switch(t){case"q":case"qq":return U$(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth(3*(n-1),1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:new class extends p${incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,n){const i=e=>e-1;switch(t){case"M":return j$(V$(f$,e),i);case"MM":return j$(U$(2,e),i);case"Mo":return j$(n.ordinalNumber(e,{unit:"month"}),i);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},L:new class extends p${priority=110;parse(e,t,n){const i=e=>e-1;switch(t){case"L":return j$(V$(f$,e),i);case"LL":return j$(U$(2,e),i);case"Lo":return j$(n.ordinalNumber(e,{unit:"month"}),i);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:new class extends p${priority=100;parse(e,t,n){switch(t){case"w":return V$(y$,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return U$(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,i){return sY(function(e,t,n){const i=tY(e,n?.in),r=PY(i,n)-t;return i.setDate(i.getDate()-7*r),tY(i,n?.in)}(e,n,i),i)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:new class extends p${priority=100;parse(e,t,n){switch(t){case"I":return V$(y$,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return U$(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return lY(function(e,t,n){const i=tY(e,n?.in),r=AY(i,n)-t;return i.setDate(i.getDate()-7*r),i}(e,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:new class extends p${priority=90;subPriority=1;parse(e,t,n){switch(t){case"d":return V$(_$,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return U$(t.length,e)}}validate(e,t){const n=$$(e.getFullYear()),i=e.getMonth();return n?t>=1&&t<=q$[i]:t>=1&&t<=X$[i]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:new class extends p${priority=90;subpriority=1;parse(e,t,n){switch(t){case"D":case"DD":return V$(g$,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return U$(t.length,e)}}validate(e,t){return $$(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:new class extends p${priority=90;parse(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,i){return(e=Z$(e,n,i)).setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]},e:new class extends p${priority=90;parse(e,t,n,i){const r=e=>{const t=7*Math.floor((e-1)/7);return(e+i.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return j$(U$(t.length,e),r);case"eo":return j$(n.ordinalNumber(e,{unit:"day"}),r);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,i){return(e=Z$(e,n,i)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:new class extends p${priority=90;parse(e,t,n,i){const r=e=>{const t=7*Math.floor((e-1)/7);return(e+i.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return j$(U$(t.length,e),r);case"co":return j$(n.ordinalNumber(e,{unit:"day"}),r);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,i){return(e=Z$(e,n,i)).setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:new class extends p${priority=90;parse(e,t,n){const i=e=>0===e?7:e;switch(t){case"i":case"ii":return U$(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return j$(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i);case"iiiii":return j$(n.day(e,{width:"narrow",context:"formatting"}),i);case"iiiiii":return j$(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i);default:return j$(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),i)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return(e=K$(e,n)).setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:new class extends p${priority=80;parse(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(W$(n),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]},b:new class extends p${priority=80;parse(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(W$(n),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]},B:new class extends p${priority=80;parse(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(W$(n),0,0,0),e}incompatibleTokens=["a","b","t","T"]},h:new class extends p${priority=70;parse(e,t,n){switch(t){case"h":return V$(w$,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return U$(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){const i=e.getHours()>=12;return i&&n<12?e.setHours(n+12,0,0,0):i||12!==n?e.setHours(n,0,0,0):e.setHours(0,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]},H:new class extends p${priority=70;parse(e,t,n){switch(t){case"H":return V$(v$,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return U$(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]},K:new class extends p${priority=70;parse(e,t,n){switch(t){case"K":return V$(S$,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return U$(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]},k:new class extends p${priority=70;parse(e,t,n){switch(t){case"k":return V$(b$,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return U$(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){const i=n<=24?n%24:n;return e.setHours(i,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]},m:new class extends p${priority=60;parse(e,t,n){switch(t){case"m":return V$(k$,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return U$(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=["t","T"]},s:new class extends p${priority=50;parse(e,t,n){switch(t){case"s":return V$(C$,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return U$(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=["t","T"]},S:new class extends p${priority=30;parse(e,t){return j$(U$(t.length,e),e=>Math.trunc(e*Math.pow(10,3-t.length)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=["t","T"]},X:new class extends p${priority=10;parse(e,t){switch(t){case"X":return H$(M$,e);case"XX":return H$(D$,e);case"XXXX":return H$(N$,e);case"XXXXX":return H$(B$,e);default:return H$(F$,e)}}set(e,t,n){return t.timestampIsSet?e:eY(e,e.getTime()-cY(e)-n)}incompatibleTokens=["t","T","x"]},x:new class extends p${priority=10;parse(e,t){switch(t){case"x":return H$(M$,e);case"xx":return H$(D$,e);case"xxxx":return H$(N$,e);case"xxxxx":return H$(B$,e);default:return H$(F$,e)}}set(e,t,n){return t.timestampIsSet?e:eY(e,e.getTime()-cY(e)-n)}incompatibleTokens=["t","T","X"]},t:new class extends p${priority=40;parse(e){return z$(e)}set(e,t,n){return[eY(e,1e3*n),{timestampIsSet:!0}]}incompatibleTokens="*"},T:new class extends p${priority=20;parse(e){return z$(e)}set(e,t,n){return[eY(e,n),{timestampIsSet:!0}]}incompatibleTokens="*"}},J$=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,eX=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,tX=/^'([^]*?)'?$/,nX=/''/g,iX=/\S/,rX=/[a-zA-Z]/;function aX(e,t,n,i){const r=()=>eY(n,NaN),a=Object.assign({},oY()),o=a.locale??OY,s=a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?r():tY(n,i?.in);const u={firstWeekContainsDate:s,weekStartsOn:l,locale:o},c=[new m$(i?.in,n)],d=t.match(eX).map(e=>{const t=e[0];if(t in XY){return(0,XY[t])(e,o.formatLong)}return e}).join("").match(J$),h=[];for(let _ of d){JY(_)&&e$(_,t,e),QY(_)&&e$(_,t,e);const n=_[0],i=Q$[n];if(i){const{incompatibleTokens:t}=i;if(Array.isArray(t)){const e=h.find(e=>t.includes(e.token)||e.token===n);if(e)throw new RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${_}\` at the same time`)}else if("*"===i.incompatibleTokens&&h.length>0)throw new RangeError(`The format string mustn't contain \`${_}\` and any other token at the same time`);h.push({token:n,fullToken:_});const a=i.run(e,_,o.match,u);if(!a)return r();c.push(a.setter),e=a.rest}else{if(n.match(rX))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");if("''"===_?_="'":"'"===n&&(_=oX(_)),0!==e.indexOf(_))return r();e=e.slice(_.length)}}if(e.length>0&&iX.test(e))return r();const m=c.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>c.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]);let p=tY(n,i?.in);if(isNaN(+p))return r();const f={};for(const _ of m){if(!_.validate(p,u))return r();const e=_.set(p,f,u);Array.isArray(e)?(p=e[0],Object.assign(f,e[1])):p=e}return p}function oX(e){return e.match(tX)[1].replace(nX,"'")}function sX(e,t){const n=tY(e,t?.in);return n.setMinutes(0,0,0),n}function lX(e,t,n){const[i,r]=dY(n?.in,e,t);return+sX(i)===+sX(r)}function uX(e,t,n){const[i,r]=dY(n?.in,e,t);return+sY(i,n)===+sY(r,n)}function cX(e,t,n){return nY(e,-t,n)}function dX(e,t,n){let i=tY(e,n?.in);return isNaN(+i)?eY(e,NaN):(null!=t.year&&i.setFullYear(t.year),null!=t.month&&(i=function(e,t,n){const i=tY(e,n?.in),r=i.getFullYear(),a=i.getDate(),o=eY(e,0);o.setFullYear(r,t,15),o.setHours(0,0,0,0);const s=l$(o);return i.setMonth(t,Math.min(a,s)),i}(i,t.month)),null!=t.date&&i.setDate(t.date),null!=t.hours&&i.setHours(t.hours),null!=t.minutes&&i.setMinutes(t.minutes),null!=t.seconds&&i.setSeconds(t.seconds),null!=t.milliseconds&&i.setMilliseconds(t.milliseconds),i)}function hX(e){const t={},n=oY();for(const i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(void 0===e[i]?delete t[i]:t[i]=e[i]);aY=t}function mX(e,t,n){const{years:i=0,months:r=0,weeks:a=0,days:o=0,hours:s=0,minutes:l=0,seconds:u=0}=t,c=function(e,t,n){return iY(e,-t,n)}(e,r+12*i,n);return eY(e,+cX(c,o+7*a,n)-1e3*(u+60*(l+60*s)))}function pX(e,t,n){return rY(e,-4)}function fX(e,t,n){return mY(e,-1,n)}function _X(e,t,n){return function(e,t,n){return iY(e,12*t,n)}(e,-18,n)}let gX;const yX=new Uint8Array(16);function vX(){if(!gX&&(gX="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gX))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gX(yX)}const bX=[];for(let Jee=0;Jee<256;++Jee)bX.push((Jee+256).toString(16).slice(1));const SX={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function wX(e,t,n){if(SX.randomUUID&&!e)return SX.randomUUID();const i=(e=e||{}).random||(e.rng||vX)();return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e,t=0){return bX[e[t+0]]+bX[e[t+1]]+bX[e[t+2]]+bX[e[t+3]]+"-"+bX[e[t+4]]+bX[e[t+5]]+"-"+bX[e[t+6]]+bX[e[t+7]]+"-"+bX[e[t+8]]+bX[e[t+9]]+"-"+bX[e[t+10]]+bX[e[t+11]]+bX[e[t+12]]+bX[e[t+13]]+bX[e[t+14]]+bX[e[t+15]]}(i)}const kX=uV?"/api/v2":Wj.HEDIA_API_URL_V2;var CX=(e=>(e[e.cL=10]="cL",e[e.g=100]="g",e[e.mL=100]="mL",e))(CX||{});const EX={cl:10,g:100,ml:100},IX=e=>{const t=e.reduce((e,t)=>{const n=AX(t.unit);return e+t.amount/n*t.foodItem.carbohydrates},0);return Math.round(t)},xX={cartItems:[],totalCarbsCartItems:0,manualCarbsInput:0},TX=cL()((e,t)=>({...xX,carbohydrateStoreActions:{setManualCarbsInput:t=>{e({manualCarbsInput:Math.round(t)})},upsertCartItem:t=>{e(e=>{const n=e.cartItems.findIndex(e=>e.foodItem.id===t.foodItem.id);let i;i=-1!==n?e.cartItems.map((e,i)=>i===n?t:e):[...e.cartItems,t];return{cartItems:i,totalCarbsCartItems:IX(i)}})},removeFromCart:(t,n)=>{e(e=>{const i=e.cartItems.filter(({foodItem:e})=>!("id"===n?e.id===t:e.title===t));return{cartItems:i,totalCarbsCartItems:IX(i)}})},clear:()=>{e(xX)},checkoutCart:async()=>{const e=t().cartItems.map(e=>({foodItemId:e.foodItem.id,amount:e.amount,unit:e.unit}));e.length&&await OX(e)}}})),OX=async e=>{try{await VX(`${kX}/food/foodcart`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({foodCartItems:e})})}catch(t){console.error(t)}},RX=()=>wX(),AX=e=>e?EX[e]:CX.g;function LX(e,t){const n=Object.values(e);return Object.keys(e)[n.indexOf(t)]}const PX=(e,t)=>Array.from({length:t-e+1},(t,n)=>(e+n).toString()),MX=(e,t)=>Array.from({length:10*(t-e)+1},(t,n)=>(e+n/10).toFixed(1)),DX=(e,t)=>{if(e===t)return!0;if("object"!=typeof e||"object"!=typeof t||null===e||null===t)return!1;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(!i.includes(r)||!DX(e[r],t[r]))return!1;return!0},NX="3.5.0";var FX=(e=>(e.QuickGuideStartPress="quickguide.start.press",e.QuickGuideBackPressStep1="quickguide.screen1.back.press",e.QuickGuideNextPressStep1="quickguide.screen1.next.press",e.QuickGuideBackPressStep2="quickguide.screen2.back.press",e.QuickGuideNextPressStep2="quickguide.screen2.next.press",e.QuickGuideBackPressStep3="quickguide.screen3.back.press",e.QuickGuideNextPressStep3="quickguide.screen3.next.press",e.QuickGuideBackPressStep4="quickguide.screen4.back.press",e.QuickGuideNextPressStep4="quickguide.screen4.next.press",e.QuickGuideBackPressStep5="quickguide.screen5.back.press",e.QuickGuideNextPressStep5="quickguide.screen5.next.press",e.QuickGuideBackPressStep6="quickguide.screen6.back.press",e.QuickGuideNextPressStep6="quickguide.screen6.next.press",e.QuickGuideBackPressStep7="quickguide.screen7.back.press",e.QuickGuideNextPressStep7="quickguide.screen7.next.press",e.QuickGuideBackPressStep8="quickguide.screen8.back.press",e.QuickGuideNextPressStep8="quickguide.screen8.next.press",e.QuickGuideBackPressStep9="quickguide.screen9.back.press",e.QuickGuideFinishPress="quickguide.finish.press",e.SetupIntroStartPress="setup.intro.start.press",e.SetupGeneralBackPress="setup.general.back.press",e.SetupGeneralNextPress="setup.general.next.press",e.SetupTreatmentBackPress="setup.treatment.back.press",e.SetupTreatmentNextPress="setup.treatment.next.press",e.SetupOptionsNextPress="setup.options.next.press",e.SetupOptionsBackPress="setup.options.back.press",e.SetupInsulinBackPress="setup.insulin.back.press",e.SetupInsulinNextPress="setup.insulin.next.press",e.SetupTDDBackPress="setup.tdd.back.press",e.SetupTDDNextPress="setup.tdd.next.press",e.SetupSummaryBackPress="setup.summary.back.press",e.SetupSummaryFinishPress="setup.summary.finish.press",e.CarbohydrateChart7DaysPress="carbohydratechart.7days.press",e.CarbohydrateChart14DaysPress="carbohydratechart.14days.press",e.CarbohydrateChart30DaysPress="carbohydratechart.30days.press",e.CarbohydrateChart90DaysPress="carbohydratechart.90days.press",e.CarbohydrateChartStart="carbohydratechart.start",e.CarbohydrateChartEnd="carbohydratechart.end",e.RapidInsulinChart7DaysPress="rapidinsulinchart.7days.press",e.RapidInsulinChart14DaysPress="rapidinsulinchart.14days.press",e.RapidInsulinChart30DaysPress="rapidinsulinchart.30days.press",e.RapidInsulinChart90DaysPress="rapidinsulinchart.90days.press",e.RapidInsulinChartStart="rapidinsulinchart.start",e.RapidInsulinChartEnd="rapidinsulinchart.end",e.TimeInRangeChart7DaysPress="timeinrangechart.7days.press",e.TimeInRangeChart14DaysPress="timeinrangechart.14days.press",e.TimeInRangeChart30DaysPress="timeinrangechart.30days.press",e.TimeInRangeChart90DaysPress="timeinrangechart.90days.press",e.TimeInRangeChartStart="timeinrangechart.start",e.TimeInRangeChartEnd="timeinrangechart.end",e.MyDayPreviousPress="mydaychart.previous.press",e.MyDayNextPress="mydaychart.next.press",e.MyDayChartStart="mydaychart.start",e.MyDayChartEnd="mydaychart.end",e.ActiveInsulinChartStart="activeinsulinchart.start",e.ActiveInsulinChartEnd="activeinsulinchart.end",e.GlucoseChart7DaysPressCGM="glucosechart.cgm.7days.press",e.GlucoseChart14DaysPressCGM="glucosechart.cgm.14days.press",e.GlucoseChart30DaysPressCGM="glucosechart.cgm.30days.press",e.GlucoseChart90DaysPressCGM="glucosechart.cgm.90days.press",e.GlucoseChartStartCGM="glucosechart.cgm.start",e.GlucoseChartEndCGM="glucosechart.cgm.end",e.GlucoseChart7DaysPressBGM="glucosechart.bgm.7days.press",e.GlucoseChart14DaysPressBGM="glucosechart.bgm.14days.press",e.GlucoseChart30DaysPressBGM="glucosechart.bgm.30days.press",e.GlucoseChart90DaysPressBGM="glucosechart.bgm.90days.press",e.GlucoseChartStartBGM="glucosechart.bgm.start",e.GlucoseChartEndBGM="glucosechart.bgm.end",e.DashboardCgmButtonPress="home.dashboard.cgm.press",e.DashboardTabPress="home.dashboard.press",e.LogbookTabPress="home.logbook.press",e.NewCalculationTabPress="home.newcalculation.press",e.SettingsTabPress="home.settings.press",e.FoodLibraryTabPress="home.foodlibrary.press",e.GlucoseTabPress="calcflow.glucose.press",e.CarbsTabPress="calcflow.carbs.press",e.ActivityTabPress="calcflow.activity.press",e.SummaryTabPress="calcflow.summary.press",e.AbortCalculationPress="calcflow.abort.press",e.RecentInsulinRegisterPress="calcflow.recentinsulin.register.press",e.RecentInsulinContinuePress="calcflow.recentinsulin.continue.press",e.CarbsManualInput="calcflow.carbs.input.manual",e.CarbsFoodLibraryDatabaseInput="calcflow.carbs.foodlibrary.input.database",e.CarbsFoodLibraryPersonalInput="calcflow.carbs.foodlibrary.input.personal",e.CarbsFoodLibraryPersonalPress="calcflow.carbs.foodlibrary.personal.press",e.CarbsFoodLibrarySearch="calcflow.carbs.foodlibrary.search",e.CarbsFoodLibraryAbort="calcflow.carbs.foodlibrary.abort",e.FoodLibrarySearched="foodlibrary.searched",e.FoodLibraryPersonalPress="foodlibrary.personal.press",e.FoodLibraryCreatePress="foodlibrary.create.press",e.FoodLibraryUpdatePress="foodlibrary.update.press",e.ActivityAddPress="calcflow.activity.add.press",e.ActivityEditPress="calcflow.activity.edit.press",e.TransferDevice="integration.device.transfer",e.TransferService="integration.service.transfer",e.ExpiredGlucose="calcflow.glucose.expired",e.SummaryExpiredGlucose="calcflow.summary.glucose.expired",e.SummaryEmptyGlucose="calcflow.summary.glucose.empty",e.RecommendationSuccess="calcflow.recommendation.success",e.RecommendationInvalid="calcflow.recommendation.invalid",e.RecommendationViewDetailsPress="calcflow.recommendation.details.press",e.RecommendationExpired="calcflow.recommendation.expired",e.RecommendationToastPress="calcflow.recommendation.toast.press",e.LogbookPersonalAddPress="logbook.personal.add.press",e.LogbookPersonalEditPress="logbook.personal.edit.press",e.LogbookPersonalDeletePress="logbook.personal.delete.press",e.LogbookExportPress="logbook.export.press",e.LogbookExportDurationFourteenDaysPress="logbook.export.duration.fourteendays.press",e.LogbookExportDurationThreeMonthsPress="logbook.export.duration.threemonths.press",e.LogbookExportDurationSixMonthsPress="logbook.export.duration.sixmonths.press",e.LogbookExportGeneratePress="logbook.export.generate.press",e.SettingsProfile="settings.profile.press",e.SettingsInsulin="settings.insulin.press",e.SettingsGlucose="settings.glucose.press",e.SettingsActivity="settings.activity.press",e.SettingsNotifications="settings.notifications.press",e.SettingsTheme="settings.theme.press",e.SettingsSmartPen="settings.smartpen.press",e.SettingsCGM="settings.cgm.press",e.SettingsBGM="settings.bgm.press",e.SettingsIFU="settings.ifu.press",e.SettingsSupport="settings.support.press",e.SettingsLegal="settings.legal.press",e.NotificationsAllowQuickGuide="quickguide.notifications.allow.press",e.NotificationsAllowSettings="settings.notifications.allow.press",e.NotificationsDenyQuickGuide="quickguide.notifications.deny.press",e.NotificationsDenySettings="settings.notifications.deny.press",e.ErrorOffline="errors.offline",e.ErrorForceUpdate="errors.forceupdate",e.ErrorLogOut="errors.logout",e))(FX||{});const BX=()=>{const{email:e,id:t,country:n=""}=Cq.get();return{id:t,isTester:e.includes("@hedia"),country:n,uuid:RX(),timestamp:(new Date).toISOString(),timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,platform:lr.OS}},jX=e=>{const{id:t,isTester:n,country:i,uuid:r,timestamp:a,timezone:o,platform:s}=BX(),l={uuid:r,type:e,timestamp:a,timezone:o,data:{version:NX,platform:s,user:{id:t,isTester:n},geo:{country:i}}};qW.update(l),qW.sync().catch(console.error)},VX=async(e,t,n=0)=>{if(uV)return fetch(e,t);const{accessToken:i,refreshToken:r}=qz.getState();if(!i||!r)throw new Error("Missing access token or refresh token");const a={...t?.headers,Authorization:`Bearer ${i}`},o=await fetch(e,{...t,headers:a});if([NL.StatusCode.UNAUTHORIZED,NL.StatusCode.FORBIDDEN].includes(o.status)){if(n<1)return await HX(r),VX(e,t,n+1);throw new Error("[hediaFetch::hediaFetch] Failed to refresh token after retry")}return o},HX=async e=>{const{setTokens:t}=qz.getState(),n=await(async e=>{const t=new URL(Yz+"/token");return fetch(t.toString(),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:"Basic "+Wz.Buffer.from(encodeURIComponent($z)).toString("base64")},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:e}).toString()})})(e);if(n.status===NL.StatusCode.BAD_REQUEST)throw jX(FX.ErrorLogOut),t({accessToken:void 0,refreshToken:void 0}),new Error("[hediaFetch::refreshAccessToken] Bad request - cleared storage");if(!n.ok)throw new Error("[hediaFetch::refreshAccessToken] Failed to refresh access token");const{access_token:i,refresh_token:r}=await n.json();t({accessToken:i,refreshToken:r})};const{HEDIA_API_URL_V3:zX}=uV?{HEDIA_API_URL_V3:"/api/v3"}:Wj,UX={email:""},GX={lessThanXSeconds:{one:"mindre end ét sekund",other:"mindre end {{count}} sekunder"},xSeconds:{one:"1 sekund",other:"{{count}} sekunder"},halfAMinute:"ét halvt minut",lessThanXMinutes:{one:"mindre end ét minut",other:"mindre end {{count}} minutter"},xMinutes:{one:"1 minut",other:"{{count}} minutter"},aboutXHours:{one:"cirka 1 time",other:"cirka {{count}} timer"},xHours:{one:"1 time",other:"{{count}} timer"},xDays:{one:"1 dag",other:"{{count}} dage"},aboutXWeeks:{one:"cirka 1 uge",other:"cirka {{count}} uger"},xWeeks:{one:"1 uge",other:"{{count}} uger"},aboutXMonths:{one:"cirka 1 måned",other:"cirka {{count}} måneder"},xMonths:{one:"1 måned",other:"{{count}} måneder"},aboutXYears:{one:"cirka 1 år",other:"cirka {{count}} år"},xYears:{one:"1 år",other:"{{count}} år"},overXYears:{one:"over 1 år",other:"over {{count}} år"},almostXYears:{one:"næsten 1 år",other:"næsten {{count}} år"}},WX={date:bY({formats:{full:"EEEE 'den' d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'kl'. {{time}}",long:"{{date}} 'kl'. {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},YX={lastWeek:"'sidste' eeee 'kl.' p",yesterday:"'i går kl.' p",today:"'i dag kl.' p",tomorrow:"'i morgen kl.' p",nextWeek:"'på' eeee 'kl.' p",other:"P"},$X={code:"da",formatDistance:(e,t,n)=>{let i;const r=GX[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?"om "+i:i+" siden":i},formatLong:WX,formatRelative:(e,t,n,i)=>YX[e],localize:{ordinalNumber:(e,t)=>Number(e)+".",era:CY({values:{narrow:["fvt","vt"],abbreviated:["f.v.t.","v.t."],wide:["før vesterlandsk tidsregning","vesterlandsk tidsregning"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["1. kvt.","2. kvt.","3. kvt.","4. kvt."],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],wide:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"]},defaultWidth:"wide"}),day:CY({values:{narrow:["S","M","T","O","T","F","L"],short:["sø","ma","ti","on","to","fr","lø"],abbreviated:["søn.","man.","tir.","ons.","tor.","fre.","lør."],wide:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"a",pm:"p",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"},abbreviated:{am:"AM",pm:"PM",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"},abbreviated:{am:"AM",pm:"PM",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:IY({matchPatterns:{narrow:/^(fKr|fvt|eKr|vt)/i,abbreviated:/^(f\.Kr\.?|f\.v\.t\.?|e\.Kr\.?|v\.t\.)/i,wide:/^(f.Kr.|før vesterlandsk tidsregning|e.Kr.|vesterlandsk tidsregning)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^f/i,/^(v|e)/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234]. kvt\./i,wide:/^[1234]\.? kvartal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mar.|apr.|maj|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januar|februar|marts|april|maj|juni|juli|august|september|oktober|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[smtofl]/i,short:/^(søn.|man.|tir.|ons.|tor.|fre.|lør.)/i,abbreviated:/^(søn|man|tir|ons|tor|fre|lør)/i,wide:/^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^o/i,/^t/i,/^f/i,/^l/i],any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(a|p|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i,any:/^([ap]\.?\s?m\.?|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/midnat/i,noon:/middag/i,morning:/morgen/i,afternoon:/eftermiddag/i,evening:/aften/i,night:/nat/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},XX={lessThanXSeconds:{standalone:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als 1 Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"1 Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"1 Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als 1 Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"1 Minute",other:"{{count}} Minuten"},withPreposition:{one:"1 Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa 1 Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"1 Stunde",other:"{{count}} Stunden"},withPreposition:{one:"1 Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"1 Tag",other:"{{count}} Tage"},withPreposition:{one:"1 Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa 1 Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"1 Woche",other:"{{count}} Wochen"},withPreposition:{one:"1 Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa 1 Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa 1 Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"1 Monat",other:"{{count}} Monate"},withPreposition:{one:"1 Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa 1 Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"1 Jahr",other:"{{count}} Jahre"},withPreposition:{one:"1 Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als 1 Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast 1 Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast 1 Jahr",other:"fast {{count}} Jahren"}}},qX={date:bY({formats:{full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},ZX={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},KX={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},QX={narrow:KX.narrow,abbreviated:["Jan.","Feb.","März","Apr.","Mai","Juni","Juli","Aug.","Sep.","Okt.","Nov.","Dez."],wide:KX.wide},JX={code:"de",formatDistance:(e,t,n)=>{let i;const r=n?.addSuffix?XX[e].withPreposition:XX[e].standalone;return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:"vor "+i:i},formatLong:qX,formatRelative:(e,t,n,i)=>ZX[e],localize:{ordinalNumber:e=>Number(e)+".",era:CY({values:{narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:KX,formattingValues:QX,defaultWidth:"wide"}),day:CY({values:{narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},defaultWidth:"wide",formattingValues:{narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:IY({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^j[aä]/i,/^f/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:"wide",parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},eq={code:"en-GB",formatDistance:vY,formatLong:{date:bY({formats:{full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"dd/MM/yyyy"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},formatRelative:kY,localize:EY,match:TY,options:{weekStartsOn:1,firstWeekContainsDate:4}},tq={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},nq={date:bY({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},iq={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},rq={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},aq={code:"es",formatDistance:(e,t,n)=>{let i;const r=tq[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"en "+i:"hace "+i:i},formatLong:nq,formatRelative:(e,t,n,i)=>1!==t.getHours()?rq[e]:iq[e],localize:{ordinalNumber:(e,t)=>Number(e)+"º",era:CY({values:{narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:CY({values:{narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},defaultWidth:"wide"}),day:CY({values:{narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:IY({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:1}},oq={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},sq={date:bY({formats:{full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},lq={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},uq=["MMM","MMMM"],cq={code:"fr",formatDistance:(e,t,n)=>{let i;const r=oq[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",String(t)),n?.addSuffix?n.comparison&&n.comparison>0?"dans "+i:"il y a "+i:i},formatLong:sq,formatRelative:(e,t,n,i)=>lq[e],localize:{preprocessor:(e,t)=>{if(1===e.getDate())return t;return t.some(e=>e.isToken&&uq.includes(e.value))?t.map(e=>e.isToken&&"do"===e.value?{isToken:!0,value:"d"}:e):t},ordinalNumber:(e,t)=>{const n=Number(e),i=t?.unit;if(0===n)return"0";let r;return r=1===n?i&&["year","week","hour","minute","second"].includes(i)?"ère":"er":"ème",n+r},era:CY({values:{narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},defaultWidth:"wide"}),day:CY({values:{narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},defaultWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(ième|ère|ème|er|e)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e)}),era:IY({matchPatterns:{narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^av/i,/^ap/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^T?[1234]/i,abbreviated:/^[1234](er|ème|e)? trim\.?/i,wide:/^[1234](er|ème|e)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},dq={lessThanXSeconds:{one:"meno di un secondo",other:"meno di {{count}} secondi"},xSeconds:{one:"un secondo",other:"{{count}} secondi"},halfAMinute:"alcuni secondi",lessThanXMinutes:{one:"meno di un minuto",other:"meno di {{count}} minuti"},xMinutes:{one:"un minuto",other:"{{count}} minuti"},aboutXHours:{one:"circa un'ora",other:"circa {{count}} ore"},xHours:{one:"un'ora",other:"{{count}} ore"},xDays:{one:"un giorno",other:"{{count}} giorni"},aboutXWeeks:{one:"circa una settimana",other:"circa {{count}} settimane"},xWeeks:{one:"una settimana",other:"{{count}} settimane"},aboutXMonths:{one:"circa un mese",other:"circa {{count}} mesi"},xMonths:{one:"un mese",other:"{{count}} mesi"},aboutXYears:{one:"circa un anno",other:"circa {{count}} anni"},xYears:{one:"un anno",other:"{{count}} anni"},overXYears:{one:"più di un anno",other:"più di {{count}} anni"},almostXYears:{one:"quasi un anno",other:"quasi {{count}} anni"}},hq={date:bY({formats:{full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:bY({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},mq=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function pq(e){return"'"+mq[e]+" alle' p"}const fq={lastWeek:(e,t,n)=>{const i=e.getDay();return uX(e,t,n)?pq(i):function(e){return 0===e?"'domenica scorsa alle' p":"'"+mq[e]+" scorso alle' p"}(i)},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:(e,t,n)=>{const i=e.getDay();return uX(e,t,n)?pq(i):function(e){return 0===e?"'domenica prossima alle' p":"'"+mq[e]+" prossimo alle' p"}(i)},other:"P"},_q={code:"it",formatDistance:(e,t,n)=>{let i;const r=dq[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"tra "+i:i+" fa":i},formatLong:hq,formatRelative:(e,t,n,i)=>{const r=fq[e];return"function"==typeof r?r(t,n,i):r},localize:{ordinalNumber:(e,t)=>{const n=Number(e);return String(n)},era:CY({values:{narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:{narrow:["G","F","M","A","M","G","L","A","S","O","N","D"],abbreviated:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],wide:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"]},defaultWidth:"wide"}),day:CY({values:{narrow:["D","L","M","M","G","V","S"],short:["dom","lun","mar","mer","gio","ven","sab"],abbreviated:["dom","lun","mar","mer","gio","ven","sab"],wide:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"}},defaultWidth:"wide",formattingValues:{narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:IY({matchPatterns:{narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^a/i,/^(d|e)/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},gq={lessThanXSeconds:{one:"mindre än en sekund",other:"mindre än {{count}} sekunder"},xSeconds:{one:"en sekund",other:"{{count}} sekunder"},halfAMinute:"en halv minut",lessThanXMinutes:{one:"mindre än en minut",other:"mindre än {{count}} minuter"},xMinutes:{one:"en minut",other:"{{count}} minuter"},aboutXHours:{one:"ungefär en timme",other:"ungefär {{count}} timmar"},xHours:{one:"en timme",other:"{{count}} timmar"},xDays:{one:"en dag",other:"{{count}} dagar"},aboutXWeeks:{one:"ungefär en vecka",other:"ungefär {{count}} veckor"},xWeeks:{one:"en vecka",other:"{{count}} veckor"},aboutXMonths:{one:"ungefär en månad",other:"ungefär {{count}} månader"},xMonths:{one:"en månad",other:"{{count}} månader"},aboutXYears:{one:"ungefär ett år",other:"ungefär {{count}} år"},xYears:{one:"ett år",other:"{{count}} år"},overXYears:{one:"över ett år",other:"över {{count}} år"},almostXYears:{one:"nästan ett år",other:"nästan {{count}} år"}},yq=["noll","en","två","tre","fyra","fem","sex","sju","åtta","nio","tio","elva","tolv"],vq={date:bY({formats:{full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"y-MM-dd"},defaultWidth:"full"}),time:bY({formats:{full:"'kl'. HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:bY({formats:{full:"{{date}} 'kl.' {{time}}",long:"{{date}} 'kl.' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},bq={lastWeek:"'i' EEEE's kl.' p",yesterday:"'igår kl.' p",today:"'idag kl.' p",tomorrow:"'imorgon kl.' p",nextWeek:"EEEE 'kl.' p",other:"P"},Sq={code:"sv",formatDistance:(e,t,n)=>{let i;const r=gq[e];return i="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t<13?yq[t]:String(t)),n?.addSuffix?n.comparison&&n.comparison>0?"om "+i:i+" sedan":i},formatLong:vq,formatRelative:(e,t,n,i)=>bq[e],localize:{ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:case 2:return n+":a"}return n+":e"},era:CY({values:{narrow:["f.Kr.","e.Kr."],abbreviated:["f.Kr.","e.Kr."],wide:["före Kristus","efter Kristus"]},defaultWidth:"wide"}),quarter:CY({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1:a kvartalet","2:a kvartalet","3:e kvartalet","4:e kvartalet"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:CY({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],wide:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"]},defaultWidth:"wide"}),day:CY({values:{narrow:["S","M","T","O","T","F","L"],short:["sö","må","ti","on","to","fr","lö"],abbreviated:["sön","mån","tis","ons","tors","fre","lör"],wide:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"]},defaultWidth:"wide"}),dayPeriod:CY({values:{narrow:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"morg.",afternoon:"efterm.",evening:"kväll",night:"natt"},abbreviated:{am:"f.m.",pm:"e.m.",midnight:"midnatt",noon:"middag",morning:"morgon",afternoon:"efterm.",evening:"kväll",night:"natt"},wide:{am:"förmiddag",pm:"eftermiddag",midnight:"midnatt",noon:"middag",morning:"morgon",afternoon:"eftermiddag",evening:"kväll",night:"natt"}},defaultWidth:"wide",formattingValues:{narrow:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på efterm.",evening:"på kvällen",night:"på natten"},abbreviated:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på efterm.",evening:"på kvällen",night:"på natten"},wide:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morgonen",afternoon:"på eftermiddagen",evening:"på kvällen",night:"på natten"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:xY({matchPattern:/^(\d+)(:a|:e)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:IY({matchPatterns:{narrow:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,abbreviated:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,wide:/^(före Kristus|före vår tid|efter Kristus|vår tid)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^f/i,/^[ev]/i]},defaultParseWidth:"any"}),quarter:IY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](:a|:e)? kvartalet/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:IY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar[s]?|apr|maj|jun[i]?|jul[i]?|aug|sep|okt|nov|dec)\.?/i,wide:/^(januari|februari|mars|april|maj|juni|juli|augusti|september|oktober|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:IY({matchPatterns:{narrow:/^[smtofl]/i,short:/^(sö|må|ti|on|to|fr|lö)/i,abbreviated:/^(sön|mån|tis|ons|tors|fre|lör)/i,wide:/^(söndag|måndag|tisdag|onsdag|torsdag|fredag|lördag)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},defaultParseWidth:"any"}),dayPeriod:IY({matchPatterns:{any:/^([fe]\.?\s?m\.?|midn(att)?|midd(ag)?|(på) (morgonen|eftermiddagen|kvällen|natten))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^f/i,pm:/^e/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgon/i,afternoon:/eftermiddag/i,evening:/kväll/i,night:/natt/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},wq=LX(NL.Languages,NL.Languages.en);function kq(e){const{set:t}=tV.getState();t(e),function(e){const t={da:$X,de:JX,es:aq,fr:cq,it:_q,enGB:eq,sv:Sq};hX({locale:"en"===e?t.enGB:t[e]})}(e)}const Cq=new class extends XW{constructor(){super("userDetails",UX)}get(){const{id:e,country:t,language:n,email:i,name:r}=super.get();return{id:e,name:r,country:t,language:n,email:i}}async fetch(){const e=await(async()=>{const e={headers:{Accept:"application/json","Content-Type":"application/json"},method:NL.HTTPRequestMethod.GET},t=await VX(`${zX}/user`,e);if(t.status!==NL.StatusCode.OK){const{message:e}=await t.json();throw new Error("string"==typeof e?e:JSON.stringify(e))}return t.json()})();kq(e.language??wq),super.set(e),super.save()}migrateData(){throw new Error("[UserDetailsManager::migrateData] Purposefully not implemented.")}};var Eq,Iq,xq={},Tq={};function Oq(){return Iq||(Iq=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"calculateActiveInsulin",{enumerable:!0,get:function(){return t.calculateActiveInsulin}}),Object.defineProperty(e,"calculateRecommendation",{enumerable:!0,get:function(){return t.calculateRecommendation}}),Object.defineProperty(e,"getReduction",{enumerable:!0,get:function(){return t.getReduction}}),Object.defineProperty(e,"roundInsulinValue",{enumerable:!0,get:function(){return t.roundInsulinValue}});var t=function(){if(Eq)return Tq;Eq=1,Object.defineProperty(Tq,"__esModule",{value:!0}),Tq.adjustedInsulinCorrection=i,Tq.calculateActiveInsulin=o,Tq.calculateRecommendation=function(n){const{carbohydrateRatio:r,carbohydrates:o,glucoseReading:s,insulinSensitivity:u,targetBGL:d,recentBoluses:h,activity:m}=n;if(null==s)throw new Error(e.GlucoseErrors.MissingGlucoseReading);if(s.unit!==e.BloodGlucoseUnit.MMOL_L&&s.unit!==e.BloodGlucoseUnit.MG_DL)throw new Error(e.GlucoseErrors.InvalidGlucoseUnit);const p=t(s.value,s.unit);if(p<e.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL||p>e.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL)throw new Error(e.GlucoseErrors.OutOfRangeCurrentBGL);const f=new Date,_=m?.activitySettings?.target,g=l(o,r),{activeInsulin:y,adjustedInsulin:v,recentBolusesIds:b}=i(p,void 0!==_?Math.max(_,d):d,u,h);let S=g+v;const w=S>e.CONSTANTS.INSULIN_DOSE_MAX;S=Math.min(S,e.CONSTANTS.INSULIN_DOSE_MAX);let k=0;if(p<3.9){const e=l(15,r);S-=e,S<0&&(k=Math.max(15,a(S+e,r)))}else{const e=a(S,r);k=Math.max(0,e)}S=Math.max(0,S);const C=m?c(m.activityDuration,m.activitySettings,m.activityIntensity,m.activityDate):null;return C&&(S*=1-C),{activeInsulin:y,activityReduction:C,bolus:S,carbRecommendation:k,recentBolusesIds:b,recommendationDate:f,wasLimited:w}},Tq.convertBGL=t,Tq.foodBolus=l,Tq.foodRecommendation=a,Tq.fractionOfInsulinStillActive=r,Tq.getInterval=d,Tq.getRecentBolusIds=s,Tq.getReduction=c,Tq.insulinStillActive=u,Tq.rawInsulinCorrection=n,Tq.roundInsulinValue=void 0;var e=DL();function t(t,n){if(null==t||isNaN(t))throw new Error(e.GlucoseErrors.InvalidGlucoseValue);return n===e.BloodGlucoseUnit.MMOL_L?t:t*e.CONSTANTS.MMOLL_PER_MGDL_BGL}function n(e,t,n){return(e-t)/n}function i(e,t,i,r){const a=o(r),l=s(r),u=n(e,t,i);return{activeInsulin:a,adjustedInsulin:Math.max(u-a,Math.min(u,0)),recentBolusesIds:l}}function r(e){if(e<0)throw new RangeError(`Parameter secondsPassed can't be negative. Found ${e}.`);return 0===e?1:e<5e3?Math.cos((e+500)/5900):e<7e3?-120127e-9*e+1.197151:e<14400?.96-Math.tanh((e-2800)/6e3):0}function a(e,t){return-e*t}function o(e){return e.reduce((e,t)=>e+u(t),0)}function s(e){return e.map(e=>e.id)}function l(e,t){return e/t}function u(e){return e.insulinDose*r(e.secondsPassed)}function c(t,n,i,r){if(t<e.CONSTANTS.ACTIVITY_DURATION_MIN||t>e.CONSTANTS.ACTIVITY_DURATION_MAX)throw new Error(e.ActivityErrors.OutOfRangeDuration);const a=r.getTime()+t*e.Milliseconds.Minute,o=(new Date).getTime()>=a,s=d(t,(()=>{if(o)return n.post;if(null===i)throw new Error(e.ActivityErrors.MissingIntensity);return n[i]})());if(null==s)throw new Error(e.ActivityErrors.InvalidInterval);const l=1-s;if(l<e.CONSTANTS.ACTIVITY_REDUCTION_MIN||l>e.CONSTANTS.ACTIVITY_REDUCTION_MAX)throw new Error(e.ActivityErrors.InvalidReduction);return l}function d(e,t){const{fromZero:n,fromThirty:i,fromFortysix:r,fromSixtyone:a}=t;return e<=29?n:e<=45?i:e<=60?r:a}return Tq.roundInsulinValue=(t,n)=>{const i={[e.InjectionMethod.PenWhole]:1,[e.InjectionMethod.PenHalf]:2,[e.InjectionMethod.Pump]:10}[n];return Math.round(t*i)/i},Tq}()}(xq)),xq}var Rq=Oq();const Aq=uV?"/api/v2":Wj.HEDIA_API_URL_V2;const Lq=e=>{let t=Pq();t=t.filter(t=>t[0]!==e),Qj.set("event/index",JSON.stringify(t))},Pq=()=>{const e=Qj.getString("event/index");return void 0===e?[]:JSON.parse(e)},Mq=()=>{const e=Qj.getString("event/pendingChanges");return void 0===e?{lastSyncTimestamp:new Date(0).toJSON(),eventUpdates:[],deletedEvents:[]}:JSON.parse(e)},Dq=new class{create=async(e,t)=>{try{e.overwrittenByUUID=void 0;const n=Mq();n.eventUpdates.push({...e,uuidOld:t}),Qj.set("event/pendingChanges",JSON.stringify(n));const i=(e,t)=>{if(this.saveLocally(e),void 0!==t){const n=this.getByUUID(t);n.overwrittenByUUID=e.uuid,this.saveLocally(n)}};return uV?(await this.sync(),i(e,t)):(i(e,t),gZ.syncAll().catch(console.error)),!0}catch(n){return console.error(n),!1}};getActiveEvents=()=>{const e=Pq(),t=[];for(const n of e){const[e,i]=n,r=this.getByUUID(e);i>Date.now()-90*NL.Milliseconds.Minute-r.durationSeconds*NL.Milliseconds.Second&&t.push(r)}return t};getEvents=(e,t)=>{let n=Pq();if(void 0!==e){const t=e.getTime();n=n.filter(e=>e[1]>=t)}if(void 0!==t){const e=t.getTime();n=n.filter(t=>t[1]<e)}const i=[];for(const a of n)try{const e=this.getByUUID(a[0]);i.push(e)}catch(r){console.error(r)}return i};sync=async()=>{const e=Mq(),t={method:NL.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}},n=await VX(`${Aq}/events`,t),i=await n.json();if(n.status!==NL.StatusCode.OK)throw new Error(`[EventManager::sync] Problem during event synchronization. Server response: ${JSON.stringify(n)}`);const{lastSyncTimestamp:r,eventUpdates:a}=i;for(const l of a)this.saveLocally(l);const o=Mq(),s={lastSyncTimestamp:r,eventUpdates:o.eventUpdates.filter(t=>!e.eventUpdates.map(e=>e.uuid).includes(t.uuid)),deletedEvents:o.deletedEvents.filter(t=>!e.deletedEvents.includes(t))};Qj.set("event/pendingChanges",JSON.stringify(s))};getEventWithHighestReduction=e=>{if(!e)throw new Error("[EventManager::getEventWithHighestReduction] Cannot retrieve highest reduction without a provided setting!");const t=this.getActiveEvents();if(!t.length)return;const n=({durationSeconds:t,activityIntensity:n,startTimestamp:i})=>{if(null===i)throw new Error("[EventManager::calculateReduction] Cannot calculate reduction without startTimestamp!");return Rq.getReduction(t/60,e,n,new Date(i))},i=t.sort((e,t)=>n(e)-n(t));return i[i.length-1]};getByUUID=e=>{const t=Qj.getString(`event/${e}`);if(void 0===t)throw new Error(`[EventManager::getByUUID] The requested event with UUID ${e} does not exist!`);return JSON.parse(t)};saveLocally=e=>{if(Lq(e.uuid),Qj.set(`event/${e.uuid}`,JSON.stringify(e)),!e.deleted&&!e.overwrittenByUUID){let t=Pq();if(null===e.startTimestamp)throw new Error("[EventManager::saveLocally] event.startTimestamp must be non-null.");const n=new Date(e.startTimestamp).getTime();t.push([e.uuid,n]),t=t.sort((e,t)=>t[1]-e[1]),Qj.set("event/index",JSON.stringify(t))}}};const Nq=new class{get=()=>{const e=Qj.getString("userSettings"),t=this.safeParse(e);return this.migrateAndClean(t)??{}};write=e=>{const t=this.migrateAndClean(e)??{};Qj.set("userSettings",JSON.stringify(t))};getPending=()=>{const e=Qj.getString("pendingSettingsChanges");return(this.safeParse(e)??[]).map(e=>this.migrateAndClean(e)??{})};addPending=e=>{const t=this.getPending();t.push(this.migrateAndClean(e)??{}),Qj.set("pendingSettingsChanges",JSON.stringify(t))};removePending=e=>{const t=e.map(e=>e.uuid),n=this.getPending().filter(e=>!t.includes(e.uuid));Qj.set("pendingSettingsChanges",JSON.stringify(n))};safeParse=e=>{if(e)try{return JSON.parse(e)}catch{return}};migrateActivitySettings=e=>{if(!e.activity)return;const t=["hard","moderate","light","post"];for(const n of t)void 0===e.activity[n].fromSixtyone&&(e.activity[n].fromSixtyone=null)};migrateGenderToBiologicalSex=e=>{e.gender&&!e.biologicalSex&&(e.biologicalSex=e.gender),delete e.gender};removeEmailField=e=>{delete e.email};removeInsulinDependentField=e=>{delete e.insulinDependent};migrateBGLFields=e=>{if(!e.glucoseLevelTargets)return;const t={...e.glucoseLevelTargets};if(t.overallTargetBGL){const e={...t.overallTargetBGL};delete e.low,delete e.high,t.overallTargetBGL=e}Array.isArray(t.targetBGLIntervals)&&(t.targetBGLIntervals=t.targetBGLIntervals.map(e=>{const t={...e};return delete t.low,delete t.high,t})),e.glucoseLevelTargets=t};migrateNotificationsSettings=e=>{if(!e.notifications)return;const t={...e.notifications};void 0!==t.deviceIdentifiers&&delete t.deviceIdentifiers,e.notifications=t};migrateAndClean=e=>{if(!e)return;const t={...e};return this.migrateActivitySettings(t),this.migrateGenderToBiologicalSex(t),this.migrateBGLFields(t),this.migrateNotificationsSettings(t),this.removeEmailField(t),this.removeInsulinDependentField(t),t}};var Fq=Object.defineProperty,Bq=Object.getOwnPropertyDescriptor,jq=(e,t,n,i)=>{for(var r,a=i>1?void 0:i?Bq(t,n):t,o=e.length-1;o>=0;o--)(r=e[o])&&(a=(i?r(t,n,a):r(a))||a);return i&&a&&Fq(t,n,a),a};const Vq=uV?"/api/v2":Wj.HEDIA_API_URL_V2;class Hq{_diabetesType;_biologicalSex;_heightCm;_weightKg;_birthDate;_injectionMethod;_glucoseUnit;_treatmentParameters;_glucoseLevelTargets;_fastActingInsulin;_longActingInsulin;_uuid;_activity;_notifications;constructor(){const e=this.getUserSettings();this.updateUserSettings(e),zD(this)}get diabetesType(){return this._diabetesType}get biologicalSex(){return this._biologicalSex}get heightCm(){return this._heightCm}get weightKg(){return this._weightKg}get birthDate(){return this._birthDate}get injectionMethod(){return this._injectionMethod}get glucoseUnit(){return this._glucoseUnit}get treatmentParameters(){return this._treatmentParameters}get glucoseLevelTargets(){return this._glucoseLevelTargets}get fastActingInsulin(){return this._fastActingInsulin}get longActingInsulin(){return this._longActingInsulin}get uuid(){return this._uuid}get activity(){return this._activity}get notifications(){return this._notifications}async setUserSettings(e){const t=this.getUserSettings();e.uuidOld=t.uuid,e.uuid=RX(),e.created=(new Date).toJSON();const n={...t,...e};return Nq.addPending(e),uV?this.syncWeb():(Nq.write(n),this.updateUserSettings(n),gZ.syncAll().catch(console.error),!0)}getUserSettings(){return Nq.get()}async syncWeb(){const e=Nq.getPending();try{const t=await this.makeSyncRequest(e);return Nq.write(t),this.updateUserSettings(t),!0}catch(t){return console.error(t),!1}finally{Nq.removePending(e)}}async sync(){const e=Nq.getPending(),t=await this.makeSyncRequest(e);Nq.write(t),this.updateUserSettings(t),Nq.removePending(e)}reset(){this.updateUserSettings({activity:void 0,biologicalSex:void 0,birthday:void 0,bloodGlucoseUnits:void 0,bloodKetonesUnit:void 0,created:void 0,diabetesType:void 0,fastActingInsulin:void 0,glucoseLevelTargets:void 0,height:void 0,longActingInsulin:void 0,notifications:void 0,parameters:void 0,treatmentType:void 0,uuid:void 0,uuidOld:void 0,weight:void 0})}makeSyncRequest=async e=>{const t={headers:{"Content-Type":"application/json"},method:e?NL.HTTPRequestMethod.POST:NL.HTTPRequestMethod.GET,body:e?JSON.stringify(e):void 0},n=await VX(`${Vq}/settings`,t),i=await n.json();if(n.status!==NL.StatusCode.OK)throw new Error(`[UserSettingsManager::makeSyncRequest] - ${JSON.stringify(i.message)}`);return i};updateUserSettings(e){this._activity=e.activity,this._biologicalSex=e.biologicalSex,this._birthDate=e.birthday,this._diabetesType=e.diabetesType,this._fastActingInsulin=e.fastActingInsulin,this._glucoseLevelTargets=e.glucoseLevelTargets,this._glucoseUnit=e.bloodGlucoseUnits,this._heightCm=e.height,this._injectionMethod=e.treatmentType,this._longActingInsulin=e.longActingInsulin,this._notifications=e.notifications,this._treatmentParameters=e.parameters,this._uuid=e.uuid,this._weightKg=e.weight}}function zq(e,t,n){const i={carbohydrateRatio:t,insulinSensitivity:e,startTime:"00:00"},r=["00:00","05:00","09:00","11:00","13:00","18:00","22:00"].map(e=>({insulinSensitivity:i.insulinSensitivity,carbohydrateRatio:i.carbohydrateRatio,startTime:e}));return{overallParameters:i,parameterIntervals:r,use:n}}jq([pM],Hq.prototype,"_diabetesType",2),jq([pM],Hq.prototype,"_biologicalSex",2),jq([pM],Hq.prototype,"_heightCm",2),jq([pM],Hq.prototype,"_weightKg",2),jq([pM],Hq.prototype,"_birthDate",2),jq([pM],Hq.prototype,"_injectionMethod",2),jq([pM],Hq.prototype,"_glucoseUnit",2),jq([pM],Hq.prototype,"_treatmentParameters",2),jq([pM],Hq.prototype,"_glucoseLevelTargets",2),jq([pM],Hq.prototype,"_fastActingInsulin",2),jq([pM],Hq.prototype,"_longActingInsulin",2),jq([pM],Hq.prototype,"_uuid",2),jq([pM],Hq.prototype,"_activity",2),jq([pM],Hq.prototype,"_notifications",2),jq([pD],Hq.prototype,"updateUserSettings",1);const Uq=new Hq,Gq="mmol/L",Wq=[0,30],Yq=[0,540],$q=3.9,Xq=10,qq=70,Zq=180,Kq=e=>{if(e===NL.BloodGlucoseUnit.MMOL_L)return{text:Gq,graphLimits:Wq,inputMin:NL.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL,inputMax:NL.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL,decimalPlaces:1,placeholder:"-.-",targetInterval:{low:$q,high:Xq}};if(e===NL.BloodGlucoseUnit.MG_DL)return{text:"mg/dL",graphLimits:Yq,inputMin:20,inputMax:600,decimalPlaces:0,placeholder:"-",targetInterval:{low:qq,high:Zq}};throw new Error(`[glucose::getBGConstants] Unsupported glucose unit! ${e}`)};function Qq(e){return e<=29?"0-29":e<=45?"30-45":e<=60?"46-60":"61-120"}function Jq(e,t){const n=new Date,i=_Y(mY(rY(new Date(e),1.5),t),n),r=Math.floor(i/60),a=i%60;return r>0?`${r}${nV("activity_card__active_hour")} ${a}${nV("activity_card__active_min")}`:`${a} ${nV("activity_card__active_min")}`}const eZ={Walk:()=>nV("new_activity_type_walk"),Run:()=>nV("new_activity_type_run"),Cycling:()=>nV("new_activity_type_cycling"),Swim:()=>nV("new_activity_type_swim"),Other:()=>nV("new_activity_type_other"),Sport:()=>nV("new_activity_type_sport"),Workout:()=>nV("new_activity_type_workout")},tZ={light:()=>nV("activity_intensity_1"),moderate:()=>nV("activity_intensity_2"),hard:()=>nV("activity_intensity_3")},nZ=Gq;function iZ(e,t,n){if(t===n)return e;switch(n){case NL.BloodGlucoseUnit.MG_DL:return e*NL.CONSTANTS.MGDL_PER_MMOLL_BGL;case NL.BloodGlucoseUnit.MMOL_L:return e*NL.CONSTANTS.MMOLL_PER_MGDL_BGL;default:throw new Error(`[conversionGlucose::convertBGL] Unsupported glucose unit! ${n}`)}}function rZ(e,t){const{decimalPlaces:n}=Kq(t);return(Math.round(10*e)/10).toFixed(n)}function aZ(e,t,n){return rZ(iZ(e,t,n),n)}const oZ=GB({entry_timestamp:WB([HB(),BB()]),settings_uuid:BB(),insulin_entered_units:WB([jB(),UB()]),carbohydrates_entered_grams:WB([jB(),UB()]),blood_glucose_millimolar:WB([jB(),UB()]),blood_ketones_millimolar:WB([jB(),UB(),zB()]),event_uuid:WB([BB(),UB(),zB()])});cj.textPdf,cj.textPdf,cj.textPdf,cj.textPdf;const sZ=e=>{oZ.parse(e);const{blood_glucose_millimolar:t,carbohydrates_entered_grams:n,insulin_entered_units:i,blood_ketones_millimolar:r}=e,{inputMax:a,inputMin:o}=Kq(NL.BloodGlucoseUnit.MMOL_L),{inputMax:s}={displayUnit:nZ,inputMin:0,inputMax:8,decimalPlaces:1};if(null!==t&&t>a)throw new Error(`[LogbookUtils::validateLogbook] blood_glucose_millimolar is greater than ${a}`);if(null!==t&&t<o)throw new Error(`[LogbookUtils::validateLogbook] blood_glucose_millimolar is less than ${o}`);if(null!==r&&r>s)throw new Error(`[LogbookUtils::validateLogbook] blood_ketones_millimolar is greater than ${s}`);const l={blood_glucose_millimolar:t,carbohydrates_entered_grams:n,insulin_entered_units:i,blood_ketones_millimolar:r};return Object.entries(l).forEach(([e,t])=>{if(function(e){return null!==e&&e<0}(t))throw new Error(`[LogbookUtils::validateLogbook] ${e} is less than 0`)}),!0},lZ=e=>({active_insulin_source_logbook_ids:[],active_insulin:null,activity_reduction:null,blood_glucose_millimolar_sample_id:null,blood_glucose_millimolar:null,glucose_sample_source_id:null,blood_ketones_millimolar:null,carbohydrates_entered_grams:0,carbohydrates_input_grams:0,carbohydrates_overwritten_suggested_grams:null,carbohydrates_suggested_grams:null,client_timestamp:new Date,client_version:"",device_and_os:"",entry_timestamp:new Date,event_uuid:null,insulin_entered_units:0,insulin_suggested_units:null,is_bolus_calculation:!1,is_deleted:null,overwritten_by_id:null,server_timestamp:null,server_version:null,settings_uuid:"",timezone:"",utc_timezone_offset:null,uuid:"",...e});const uZ=uV?"/api/v2":Wj.HEDIA_API_URL_V2,cZ=e=>{const t={...e};return delete t.carbohydrates_modified_suggested_grams,delete t.mood,delete t.smart_pen_sync_timestamp,t};const dZ=e=>{const{uuid:t}=e;if(!t)throw new Error("[LogbookManager::saveLocally] uuid must be defined");hZ(t);const n=fZ();n.push([t,new Date(e.entry_timestamp).getTime()]),n.sort((e,t)=>t[1]-e[1]),Qj.set("logbook/index",JSON.stringify(n)),Qj.set(`logbook/${e.uuid}`,JSON.stringify(e))},hZ=e=>{const t=fZ().filter(([t])=>t!==e);Qj.set("logbook/index",JSON.stringify(t)),Qj.delete(`logbook/${e}`)},mZ=()=>{const e=Qj.getString("logbook/pendingChanges");if(!e)return{last_sync_timestamp:new Date(0).toISOString(),created:[],edited:[],deleted:[]};const t=JSON.parse(e);return{...t,created:t.created.map(e=>cZ(e))}},pZ=(e,t)=>{const{created:n,deleted:i,edited:r,last_sync_timestamp:a}=mZ(),o={last_sync_timestamp:a,created:[...n].filter(({uuid:t})=>t!==e),edited:[...r].filter(({oldUUID:n,newUUID:i})=>n!==t&&i!==e),deleted:[...i].filter(t=>t!==e)};Qj.set("logbook/pendingChanges",JSON.stringify(o))},fZ=()=>{const e=Qj.getString("logbook/index");return void 0===e?[]:JSON.parse(e)},_Z=new class{async addLogbook(e,t){const n=t?this.getLogbookByUUID(t):null;try{e.uuid=RX(),e.client_timestamp=new Date,e.client_version=NX,e.device_and_os=`${lr.OS} ${lr.Version}`;const n=mZ();if(t){const i=this.getLogbookByUUID(t);e.settings_uuid=i.settings_uuid,n.edited.push({oldUUID:t,newUUID:e.uuid}),hZ(t)}else{const{uuid:t}=Uq;if(!t)throw new Error("[LogbookManager::addLogbook] settingsUUID must be defined");e.settings_uuid=t}return e.utc_timezone_offset=(()=>{const e=(new Date).getTimezoneOffset(),t=-e>=0?"+":"-",n=Math.abs(e);return`${t}${Math.floor(n/60).toString().padStart(2,"0")}:${(n%60).toString().padStart(2,"0")}`})(),e.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone,n.created.push(e),Qj.set("logbook/pendingChanges",JSON.stringify(n)),dZ(e),uV?await this.syncWeb():gZ.syncAll().catch(console.error),e}catch(i){return console.error(i),uV&&(t?(hZ(e.uuid),null!==n&&dZ(n),pZ(e.uuid,t)):(hZ(e.uuid),pZ(e.uuid))),null}}deleteLogbook=async e=>{const t=this.getLogbookByUUID(e);try{const t=mZ();return t.deleted.push(e),Qj.set("logbook/pendingChanges",JSON.stringify(t)),hZ(e),uV?await this.syncWeb():gZ.syncAll().catch(console.error),!0}catch(n){return console.error(n),uV&&(dZ(t),pZ(e)),!1}};syncWeb=async()=>{const e=mZ(),t=await VX(`${uZ}/logbooks`,(n=e,{method:NL.HTTPRequestMethod.POST,body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}));var n;if(t.status!==NL.StatusCode.OK)throw new Error("Could not sync logbooks with server");const i=await t.json(),{created:r,last_sync_timestamp:a}=i;for(const s of r)dZ(s);const o={last_sync_timestamp:a,created:[],deleted:[],edited:[]};Qj.set("logbook/pendingChanges",JSON.stringify(o))};sync=async()=>{const e=mZ(),{created:t,deleted:n,edited:i,last_sync_timestamp:r}=e,a=e=>({method:NL.HTTPRequestMethod.POST,body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),o=[],s=[],l=[];let u=[],c=[],d=e.last_sync_timestamp;const h=e=>{const{created:t,deleted:n,last_sync_timestamp:i}=e;u=u.concat(t),c=c.concat(n),d=i},m=[{list:t,listName:"created",unsuccess:o},{list:n,listName:"deleted",unsuccess:s},{list:i,listName:"edited",unsuccess:l}];if(!t.length&&!i.length&&!n.length){const e={created:[],deleted:[],edited:[],last_sync_timestamp:r},t=await VX(`${uZ}/logbooks`,a(e));h(await t.json())}for(const _ of m)for(const e of _.list){const t={created:[],deleted:[],edited:[],last_sync_timestamp:r};t[_.listName].push(e);try{const n=await VX(`${uZ}/logbooks`,a(t));if(n.status!==NL.StatusCode.OK)throw _.unsuccess.push(e),new Error(`[LogbookManager::sync] Could not sync logbooks with server ${JSON.stringify(await n.json())}`);h(await n.json())}catch(f){console.error(`[LogbookManager::sync] Failed to sync list ${_.listName}`,e,f)}}const p={last_sync_timestamp:d,created:o,deleted:s,edited:l};Qj.set("logbook/pendingChanges",JSON.stringify(p)),Qj.set("logbook/unsuccessful",JSON.stringify(p));for(const _ of u)dZ(_);for(const _ of c)hZ(_)};getRecentBoluses=(e=new Date(Date.now()-4*NL.Milliseconds.Hour),t=new Date)=>{const n=this.getLogbooks(e,t);if(0===n.length)return[];const i=n.filter(e=>null!==e.insulin_entered_units&&e.insulin_entered_units>0);return i.map(({insulin_entered_units:e,entry_timestamp:t,uuid:n})=>({insulinDose:e,secondsPassed:(Date.now()-new Date(t).getTime())/1e3,id:n}))};getLogbooks=(e,t)=>{let n=fZ();if(void 0!==e){const t=e.getTime();n=n.filter(e=>e[1]>=t)}if(void 0!==t){const e=t.getTime();n=n.filter(t=>t[1]<e)}const i=[];for(const[a]of n)try{const e=this.getLogbookByUUID(a);try{sZ(e),i.push(e)}catch(r){console.error(r),pZ(a),hZ(a)}}catch(r){console.error(r)}return i};getLogbookByUUID=e=>{const t=Qj.getString(`logbook/${e}`);if(!t)throw new Error("LogbookManager::getLogbookByUUID - could not find logbook in local storage");const n=JSON.parse(t),i=cZ(n);return{...i,entry_timestamp:new Date(i.entry_timestamp),server_timestamp:i.server_timestamp?new Date(i.server_timestamp):null,client_timestamp:new Date(i.client_timestamp)}}};const gZ=new class{currentIsConnected=null;isSynchronizing=!1;isListenerAttached=!1;constructor(){this.setListener()}syncAll=async()=>{if(!this.isSynchronizing)try{this.isSynchronizing=!0,await Uq.sync().catch(console.error),await Dq.sync().catch(console.error),await _Z.sync().catch(console.error),await Cq.fetch().catch(console.error)}finally{this.isSynchronizing=!1}};reset=()=>{Uq.reset(),Cq.clear()};handleConnectivity=async({isConnected:e,isInternetReachable:t})=>{const{accessToken:n}=qz.getState();this.currentIsConnected!==(e&&t)&&(this.currentIsConnected=e&&t,this.currentIsConnected&&n&&await this.syncAll())};setListener=()=>{this.isListenerAttached||uV||(Bz.addEventListener(this.handleConnectivity),this.isListenerAttached=!0)}},{add:yZ,multiply:vZ}=uu;function bZ(e,t,n){return yZ(vZ(e,t),vZ(e.interpolate({inputRange:[0,1],outputRange:[1,0]}),n))}const{add:SZ,multiply:wZ}=uu;function kZ(e){let{index:t,current:n,next:i,inverted:r,layouts:{screen:a},insets:o}=e;const s="ios"===lr.OS&&!lr.isPad&&!lr.isTV&&o.top>20,l=a.width>a.height,u=l?0:10,c=o.top,d=a.height/a.width,h=SZ(n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),i?i.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0),m=0===t,p=wZ(h.interpolate({inputRange:[0,1,2],outputRange:[a.height,m?0:u,(m?c:0)-u*d]}),r),f=h.interpolate({inputRange:[0,1,1.0001,2],outputRange:[0,.3,1,1]}),_=l?1:h.interpolate({inputRange:[0,1,2],outputRange:[1,1,a.width?1-2*u/a.width:1]}),g=l?0:m?h.interpolate({inputRange:[0,1,1.0001,2],outputRange:[0,0,s?38:0,10]}):10;return{cardStyle:{overflow:"hidden",borderTopLeftRadius:g,borderTopRightRadius:g,borderBottomLeftRadius:s?g:0,borderBottomRightRadius:s?g:0,marginTop:m?0:c,marginBottom:m?0:u,transform:[{translateY:p},{scale:_}]},overlayStyle:{opacity:f}}}function CZ(){return{}}const{add:EZ}=uu;function IZ(e){let{current:t,next:n}=e;const i=EZ(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0),r=i.interpolate({inputRange:[0,1,2],outputRange:[0,1,0]});return{leftButtonStyle:{opacity:r},rightButtonStyle:{opacity:r},titleStyle:{opacity:r},backgroundStyle:{opacity:i.interpolate({inputRange:[0,1,1.9,2],outputRange:[0,1,1,0]})}}}function xZ(e){let{current:t,next:n,layouts:{screen:i}}=e;const r=[{translateX:EZ(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0).interpolate({inputRange:[0,1,2],outputRange:Lu.getConstants().isRTL?[-i.width,0,i.width]:[i.width,0,-i.width]})}];return{leftButtonStyle:{transform:r},rightButtonStyle:{transform:r},titleStyle:{transform:r},backgroundStyle:{transform:r}}}function TZ(e){let{current:t,next:n,layouts:{screen:i}}=e;const r=[{translateX:EZ(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0).interpolate({inputRange:[0,1,2],outputRange:Lu.getConstants().isRTL?[i.width,0,-i.width]:[-i.width,0,i.width]})}];return{leftButtonStyle:{transform:r},rightButtonStyle:{transform:r},titleStyle:{transform:r},backgroundStyle:{transform:r}}}function OZ(e){let{current:t,next:n,layouts:{header:i}}=e;const r=[{translateY:EZ(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0).interpolate({inputRange:[0,1,2],outputRange:[-i.height,0,-i.height]})}];return{leftButtonStyle:{transform:r},rightButtonStyle:{transform:r},titleStyle:{transform:r},backgroundStyle:{transform:r}}}function RZ(){return{}}const AZ={animation:"spring",config:{stiffness:1e3,damping:500,mass:3,overshootClamping:!0,restDisplacementThreshold:10,restSpeedThreshold:10}},LZ={animation:"timing",config:{duration:350,easing:Xl.out(Xl.poly(5))}},PZ={animation:"timing",config:{duration:150,easing:Xl.in(Xl.linear)}},MZ={animation:"timing",config:{duration:425,easing:Xl.bezier(.35,.45,0,1)}},DZ={animation:"timing",config:{duration:400,easing:Xl.bezier(.35,.45,0,1)}},NZ={animation:"timing",config:{duration:250,easing:e=>Math.cos((e+1)*Math.PI)/2+.5}},FZ={animation:"timing",config:{duration:200,easing:e=>1===e?1:Math.pow(e,2)}},BZ={gestureDirection:"horizontal",transitionSpec:{open:AZ,close:AZ},cardStyleInterpolator:function(e){let{current:t,next:n,inverted:i,layouts:{screen:r}}=e;return{cardStyle:{transform:[{translateX:wZ(t.progress.interpolate({inputRange:[0,1],outputRange:[r.width,0],extrapolate:"clamp"}),i)},{translateX:n?wZ(n.progress.interpolate({inputRange:[0,1],outputRange:[0,-.3*r.width],extrapolate:"clamp"}),i):0}]},overlayStyle:{opacity:t.progress.interpolate({inputRange:[0,1],outputRange:[0,.07],extrapolate:"clamp"})},shadowStyle:{shadowOpacity:t.progress.interpolate({inputRange:[0,1],outputRange:[0,.3],extrapolate:"clamp"})}}},headerStyleInterpolator:IZ},jZ={gestureDirection:"vertical",transitionSpec:{open:AZ,close:AZ},cardStyleInterpolator:kZ,headerStyleInterpolator:IZ},VZ={gestureDirection:"vertical",transitionSpec:{open:LZ,close:PZ},cardStyleInterpolator:function(e){let{current:t,inverted:n,layouts:{screen:i},closing:r}=e;const a=wZ(t.progress.interpolate({inputRange:[0,1],outputRange:[.08*i.height,0],extrapolate:"clamp"}),n);return{cardStyle:{opacity:bZ(r,t.progress,t.progress.interpolate({inputRange:[0,.5,.9,1],outputRange:[0,.25,.7,1],extrapolate:"clamp"})),transform:[{translateY:a}]}}},headerStyleInterpolator:IZ},HZ={gestureDirection:"vertical",transitionSpec:{open:MZ,close:MZ},cardStyleInterpolator:function(e){let{current:t,next:n,inverted:i,layouts:{screen:r}}=e;return{containerStyle:{overflow:"hidden",transform:[{translateY:wZ(t.progress.interpolate({inputRange:[0,1],outputRange:[r.height,0],extrapolate:"clamp"}),i)}]},cardStyle:{transform:[{translateY:wZ(t.progress.interpolate({inputRange:[0,1],outputRange:[r.height*(95.9/100)*-1,0],extrapolate:"clamp"}),i)},{translateY:n?wZ(n.progress.interpolate({inputRange:[0,1],outputRange:[0,.02*r.height*-1],extrapolate:"clamp"}),i):0}]},overlayStyle:{opacity:t.progress.interpolate({inputRange:[0,.36,1],outputRange:[0,.1,.1],extrapolate:"clamp"})}}},headerStyleInterpolator:IZ},zZ={gestureDirection:"horizontal",transitionSpec:{open:DZ,close:DZ},cardStyleInterpolator:function(e){let{current:t,next:n,closing:i}=e;const r=SZ(t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}),n?n.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"}):0);return{cardStyle:{opacity:r.interpolate({inputRange:[0,.75,.875,1,1.0825,1.2075,2],outputRange:[0,0,1,1,1,1,0]}),transform:[{scale:bZ(i,t.progress.interpolate({inputRange:[0,1],outputRange:[.925,1],extrapolate:"clamp"}),r.interpolate({inputRange:[0,1,2],outputRange:[.85,1,1.075]}))}]}}},headerStyleInterpolator:IZ},UZ={gestureDirection:"vertical",transitionSpec:{open:NZ,close:FZ},cardStyleInterpolator:function(e){let{current:t,inverted:n,layouts:{screen:i},closing:r}=e;const a=wZ(t.progress.interpolate({inputRange:[0,1],outputRange:[.8*i.height,0],extrapolate:"clamp"}),n);return{cardStyle:{opacity:bZ(r,t.progress,t.progress.interpolate({inputRange:[0,1],outputRange:[0,1],extrapolate:"clamp"})),transform:[{translateY:a}]},overlayStyle:{opacity:t.progress.interpolate({inputRange:[0,1],outputRange:[0,.3],extrapolate:"clamp"})}}},headerStyleInterpolator:IZ},GZ={gestureDirection:"vertical",transitionSpec:{open:NZ,close:FZ},cardStyleInterpolator:function(e){let{current:{progress:t}}=e;return{cardStyle:{opacity:t.interpolate({inputRange:[0,.5,.9,1],outputRange:[0,.25,.7,1]})},overlayStyle:{opacity:t.interpolate({inputRange:[0,1],outputRange:[0,.5],extrapolate:"clamp"})}}},headerStyleInterpolator:IZ},WZ=lr.select({ios:BZ,android:lr.Version>=29?zZ:lr.Version>=28?HZ:VZ,default:zZ}),YZ=lr.select({ios:jZ,default:UZ}),$Z=i(Object.freeze(Object.defineProperty({__proto__:null,default:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAQAAABIkb+zAAAAlklEQVR4Ae3a1REDMRDG4A3VmHbcUFLigf0exn/mkxuQjmELAAAAAD5Eq5atP6+rZeuPhGz9kZCtPxKy9fs6Zuuf60CfPn369OnTp0+fPn369OnTfx36X1vh+nO6/pytL+D1BCexy+iNhFPt6/dIOEiQIEGCBAkSJEiQ8B0k+PwoQYKhP2OXAYOvRo+vD38bvwcAAACABXF8ILs1PQqpAAAAAElFTkSuQmCC"},Symbol.toStringTag,{value:"Module"}))),XZ=i(Object.freeze(Object.defineProperty({__proto__:null,default:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAABVCAQAAAChx3/YAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAHdElNRQfkAQMKHDc9iQjuAAACmUlEQVRo3r3ZS2sUQRAH8M5zklwWg0K8mKBB/AIqXhTEi1cTPQe9iH4AUXBNjh79EooKgggSHyCICIIQL7NV1T2bze6EFS/xoms0ie0hs+sa9zE901U79/3R8+iu+pdSnn/VfbCAz/Um2r+XV8AO0jH9pP3vvSN2COdhGX8xInbIzNMKbv1PeEPsiLmEn2i7E+EJsSN4Az+UtjoTXpBwlG7CGnQlPCA2oFtQxZ3uRG7EBnAvjHsTOREbwB2s9bpRuZHKGCzCer9V5ELi8ehuOiIzYkejBUTYTkNkREyAV5DgdzoiE2ICuoYaUxMZEBPQdYpdCGfkzbA+rUsugDNiAnOGwJVwQipj0XlCd8IBscN0wv1GOSEmCE9qyEakREyAZ4myEqkQE+hzupydSIHE4+aUjvIQfZH6hL6QbxV9kfqEnqP1vEQPxA6YA3hReyB6IOUC3vZDdEXKBVPUG36ILkhlihbxqy+iI1KZogf4xW0zd0TWDuJD+AYWLRuyOo2P0DOxB6nM4Fv87pv4B1mdxhfY8E+0IeaIfok/OIgWEs3q97DJQyTI5xn9FBpcBFqlVDgLz6CBlu9S8SS9JlYCraKlTv2qb+QdN4FWYV0AEVkJLQH/M4kn9Sv2t0vkOxH64pt7F9f22LYLVw8D9y4sdJ40T0bgPRmVUqp+iP2MF6pWkrrrPnPdJVRB7tbCVMQNZkSkqlfKDtD+kLs/Eem0xHpGoe631cdHzIhIIiGUrSQp0XHmlEgo7xJK7loZZMiMJGlqjTVNbebCRKy5cPJsLjMn3EJZvdDUQWh+krwCReZJUHOmVaqxzrSEpnNCc0ahiWlz9ksrrLNfoSn27sgf5mCZfrIiStnB8lF8rHdYEaWU+ljQV/dW0X8Ac6zWpmDZsO8AAAAldEVYdGRhdGU6Y3JlYXRlADIwMjAtMDEtMDNUMTA6Mjg6NTIrMDA6MDD7fVVWAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIwLTAxLTAzVDEwOjI4OjUyKzAwOjAwiiDt6gAAAABJRU5ErkJggg=="},Symbol.toStringTag,{value:"Module"})));function qZ(){return qZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},qZ.apply(this,arguments)}function ZZ(e){let{style:t,...n}=e;const{colors:i}=Af();return M.createElement(_a,qZ({},n,{style:[{flex:1,backgroundColor:i.background},t]}))}function KZ(e,t,n){let i;const r=e.width>e.height;return i="ios"===lr.OS?lr.isPad||lr.isTV?t?56:50:r?32:t?56:44:"android"===lr.OS?56:64,i+n}function QZ(e,t){return"string"==typeof e.headerTitle?e.headerTitle:void 0!==e.title?e.title:t}function JZ(){return JZ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},JZ.apply(this,arguments)}function eK(e){let{style:t,...n}=e;const{colors:i}=Af();return M.createElement(uu.View,JZ({style:[tK.container,{backgroundColor:i.card,borderBottomColor:i.border,shadowColor:i.border},t]},n))}const tK=Ei.create({container:{flex:1,...lr.select({android:{elevation:4},ios:{shadowOpacity:.85,shadowRadius:0,shadowOffset:{width:0,height:Ei.hairlineWidth}},default:{borderBottomWidth:Ei.hairlineWidth}})}}),nK="__react_navigation__elements_contexts";function iK(e,t){let n=self[nK].get(e);return n||(n=M.createContext(t),n.displayName=e,self[nK].set(e,n),n)}self[nK]=self[nK]??new Map;const rK=iK("HeaderShownContext",!1);function aK(){return aK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},aK.apply(this,arguments)}function oK(e){let{tintColor:t,style:n,...i}=e;const{colors:r}=Af();return M.createElement(uu.Text,aK({accessibilityRole:"header","aria-level":"1",numberOfLines:1},i,{style:[sK.title,{color:void 0===t?r.text:t},n]}))}const sK=Ei.create({title:lr.select({ios:{fontSize:17,fontWeight:"600"},android:{fontSize:20,fontFamily:"sans-serif-medium",fontWeight:"normal"},default:{fontSize:18,fontWeight:"500"}})});function lK(e){const t=pH(),n=fH(),i=M.useContext(rK),r="ios"===lr.OS&&t.top>50?t.top-5:t.top,{layout:a=n,modal:o=!1,title:s,headerTitle:l,headerTitleAlign:u=lr.select({ios:"center",default:"left"}),headerLeft:c,headerLeftLabelVisible:d,headerTransparent:h,headerTintColor:m,headerBackground:p,headerRight:f,headerTitleAllowFontScaling:_,headerTitleStyle:g,headerLeftContainerStyle:y,headerRightContainerStyle:v,headerTitleContainerStyle:b,headerBackgroundContainerStyle:S,headerStyle:w,headerShadowVisible:k,headerPressColor:C,headerPressOpacity:E,headerStatusBarHeight:I=(i?0:r)}=e,x=KZ(a,o,I),{height:T=x,minHeight:O,maxHeight:R,backgroundColor:A,borderBottomColor:L,borderBottomEndRadius:P,borderBottomLeftRadius:D,borderBottomRightRadius:N,borderBottomStartRadius:F,borderBottomWidth:B,borderColor:j,borderEndColor:V,borderEndWidth:H,borderLeftColor:z,borderLeftWidth:U,borderRadius:G,borderRightColor:W,borderRightWidth:Y,borderStartColor:$,borderStartWidth:X,borderStyle:q,borderTopColor:Z,borderTopEndRadius:K,borderTopLeftRadius:Q,borderTopRightRadius:J,borderTopStartRadius:ee,borderTopWidth:te,borderWidth:ne,boxShadow:ie,elevation:re,shadowColor:ae,shadowOffset:oe,shadowOpacity:se,shadowRadius:le,opacity:ue,transform:ce,...de}=Ei.flatten(w||{}),he={backgroundColor:A,borderBottomColor:L,borderBottomEndRadius:P,borderBottomLeftRadius:D,borderBottomRightRadius:N,borderBottomStartRadius:F,borderBottomWidth:B,borderColor:j,borderEndColor:V,borderEndWidth:H,borderLeftColor:z,borderLeftWidth:U,borderRadius:G,borderRightColor:W,borderRightWidth:Y,borderStartColor:$,borderStartWidth:X,borderStyle:q,borderTopColor:Z,borderTopEndRadius:K,borderTopLeftRadius:Q,borderTopRightRadius:J,borderTopStartRadius:ee,borderTopWidth:te,borderWidth:ne,boxShadow:ie,elevation:re,shadowColor:ae,shadowOffset:oe,shadowOpacity:se,shadowRadius:le,opacity:ue,transform:ce};for(const M in he)void 0===he[M]&&delete he[M];const me=[he,!1===k&&{elevation:0,shadowOpacity:0,borderBottomWidth:0}],pe=c?c({tintColor:m,pressColor:C,pressOpacity:E,labelVisible:d}):null,fe=f?f({tintColor:m,pressColor:C,pressOpacity:E}):null,_e="function"!=typeof l?e=>M.createElement(oK,e):l;return M.createElement(M.Fragment,null,M.createElement(uu.View,{pointerEvents:"box-none",style:[Ei.absoluteFill,{zIndex:0},S]},p?p({style:me}):h?null:M.createElement(eK,{style:me})),M.createElement(uu.View,{pointerEvents:"box-none",style:[{height:T,minHeight:O,maxHeight:R,opacity:ue,transform:ce}]},M.createElement(_a,{pointerEvents:"none",style:{height:I}}),M.createElement(_a,{pointerEvents:"box-none",style:uK.content},M.createElement(uu.View,{pointerEvents:"box-none",style:[uK.left,"center"===u&&uK.expand,{marginStart:t.left},y]},pe),M.createElement(uu.View,{pointerEvents:"box-none",style:[uK.title,{maxWidth:"center"===u?a.width-2*((pe?!1!==d?80:32:16)+Math.max(t.left,t.right)):a.width-((pe?72:16)+(fe?72:16)+t.left-t.right)},b]},_e({children:s,allowFontScaling:_,tintColor:m,style:g})),M.createElement(uu.View,{pointerEvents:"box-none",style:[uK.right,uK.expand,{marginEnd:t.right},v]},fe))))}const uK=Ei.create({content:{flex:1,flexDirection:"row",alignItems:"stretch"},title:{marginHorizontal:16,justifyContent:"center"},left:{justifyContent:"center",alignItems:"flex-start"},right:{justifyContent:"center",alignItems:"flex-end"},expand:{flexGrow:1,flexBasis:0}});function cK(e){let{children:t}=e;return t}function dK(){return dK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},dK.apply(this,arguments)}const hK=uu.createAnimatedComponent(eh),mK="android"===lr.OS&&lr.Version>=21;function pK(e){let{onPressIn:t,onPressOut:n,android_ripple:i,pressColor:r,pressOpacity:a=.3,style:o,...s}=e;const{dark:l}=Af(),[u]=M.useState(()=>new uu.Value(1)),c=(e,t)=>{mK||uu.timing(u,{toValue:e,duration:t,easing:Xl.inOut(Xl.quad),useNativeDriver:!0}).start()};return M.createElement(hK,dK({onPressIn:e=>{c(a,0),null==t||t(e)},onPressOut:e=>{c(1,200),null==n||n(e)},android_ripple:mK?{color:void 0!==r?r:l?"rgba(255, 255, 255, .32)":"rgba(0, 0, 0, .32)",...i}:void 0,style:[{opacity:mK?1:u},o]},s))}function fK(e){let{disabled:t,allowFontScaling:n,backImage:i,label:r,labelStyle:a,labelVisible:o="ios"===lr.OS,onLabelLayout:s,onPress:l,pressColor:u,pressOpacity:c,screenLayout:d,tintColor:h,titleLayout:m,truncatedLabel:p="Back",accessibilityLabel:f=(r&&"Back"!==r?`${r}, back`:"Go back"),testID:_,style:g}=e;const{colors:y}=Af(),[v,b]=M.useState(void 0),S=void 0!==h?h:lr.select({ios:y.primary,default:y.text}),w=e=>{null==s||s(e),b(e.nativeEvent.layout.x+e.nativeEvent.layout.width)};return M.createElement(pK,{disabled:t,accessible:!0,accessibilityRole:"button",accessibilityLabel:f,testID:_,onPress:t?void 0:()=>l&&requestAnimationFrame(l),pressColor:u,pressOpacity:c,android_ripple:_K,style:[gK.container,t&&gK.disabled,g],hitSlop:lr.select({ios:void 0,default:{top:16,right:16,bottom:16,left:16}})},M.createElement(M.Fragment,null,i?i({tintColor:S}):M.createElement(Js,{style:[gK.icon,Boolean(o)&&gK.iconWithLabel,Boolean(S)&&{tintColor:S}],source:$Z,fadeDuration:0}),(()=>{const e=!r||v&&m&&d&&(d.width-m.width)/2<v+26?p:r;if(!o||void 0===e)return null;const t=M.createElement(_a,{style:d?[gK.labelWrapper,{minWidth:d.width/2-27}]:null},M.createElement(uu.Text,{accessible:!1,onLayout:e===r?w:void 0,style:[gK.label,S?{color:S}:null,a],numberOfLines:1,allowFontScaling:!!n},e));return i||"ios"!==lr.OS?t:M.createElement(cK,{maskElement:M.createElement(_a,{style:gK.iconMaskContainer},M.createElement(Js,{source:XZ,style:gK.iconMask}),M.createElement(_a,{style:gK.iconMaskFillerRect}))},t)})()))}const _K={borderless:!0,foreground:"android"===lr.OS&&lr.Version>=23,radius:20},gK=Ei.create({container:{alignItems:"center",flexDirection:"row",minWidth:Ei.hairlineWidth,...lr.select({ios:null,default:{marginVertical:3,marginHorizontal:11}})},disabled:{opacity:.5},label:{fontSize:17,letterSpacing:.35},labelWrapper:{flexDirection:"row",alignItems:"flex-start"},icon:lr.select({ios:{height:21,width:13,marginLeft:8,marginRight:22,marginVertical:12,resizeMode:"contain",transform:[{scaleX:Lu.getConstants().isRTL?-1:1}]},default:{height:24,width:24,margin:3,resizeMode:"contain",transform:[{scaleX:Lu.getConstants().isRTL?-1:1}]}}),iconWithLabel:"ios"===lr.OS?{marginRight:6}:{},iconMaskContainer:{flex:1,flexDirection:"row",justifyContent:"center"},iconMaskFillerRect:{flex:1,backgroundColor:"#000"},iconMask:{height:21,width:13,marginLeft:-14.5,marginVertical:12,alignSelf:"center",resizeMode:"contain",transform:[{scaleX:Lu.getConstants().isRTL?-1:1}]}}),yK=iK("HeaderBackContext",void 0),vK=iK("HeaderHeightContext",void 0);function bK(e){let{color:t,size:n,style:i}=e;return M.createElement(hl,{style:[SK.icon,{color:t,fontSize:n},i]},"⏷")}const SK=Ei.create({icon:{backgroundColor:"transparent"}});function wK(){return wK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},wK.apply(this,arguments)}function kK(e){let{visible:t,children:n,style:i,...r}=e;return"web"===lr.OS?M.createElement(_a,wK({hidden:!t,style:[{display:t?"flex":"none"},CK.container,i],pointerEvents:t?"auto":"none"},r),n):M.createElement(_a,{style:[CK.container,i],pointerEvents:t?"auto":"none"},M.createElement(_a,{collapsable:!1,removeClippedSubviews:"ios"!==lr.OS&&"macos"!==lr.OS||!t,pointerEvents:t?"auto":"none",style:t?CK.attached:CK.detached},n))}const CK=Ei.create({container:{flex:1,overflow:"hidden"},attached:{flex:1},detached:{flex:1,top:3e4}}),{width:EK=0,height:IK=0}=Aa.get("window"),xK=(lr.OS,{frame:{x:0,y:0,width:EK,height:IK},insets:{top:0,left:0,right:0,bottom:0}});function TK(e){let{children:t,style:n}=e;return M.useContext(uH)?M.createElement(_a,{style:[RK.container,n]},t):("web"===lr.OS&&(t=M.createElement(OK,{initialMetrics:xK},t)),M.createElement(dH,{initialMetrics:xK,style:n},t))}const OK=e=>{let{initialMetrics:t,children:n}=e;const i=M.useRef(null),[r,a]=M.useState(t.frame);return M.useEffect(()=>{if(null==i.current)return;const e=i.current.getBoundingClientRect();let t;a({x:e.x,y:e.y,width:e.width,height:e.height});const n=new ResizeObserver(e=>{const n=e[0];if(n){const{x:e,y:i,width:r,height:o}=n.contentRect;clearTimeout(t),t=setTimeout(()=>{a({x:e,y:i,width:r,height:o})},100)}});return n.observe(i.current),()=>{n.disconnect(),clearTimeout(t)}},[]),M.createElement(cH.Provider,{value:r},M.createElement("div",{ref:i,style:{...Ei.absoluteFillObject,pointerEvents:"none",visibility:"hidden"}}),n)};TK.initialMetrics=xK;const RK=Ei.create({container:{flex:1}});function AK(e){const t=fH(),n=pH(),i=M.useContext(rK),r=M.useContext(vK),{focused:a,modal:o=!1,header:s,headerShown:l=!0,headerTransparent:u,headerStatusBarHeight:c=(i?0:n.top),navigation:d,route:h,children:m,style:p}=e,[f,_]=M.useState(()=>KZ(t,o,c));return M.createElement(ZZ,{accessibilityElementsHidden:!a,importantForAccessibility:a?"auto":"no-hide-descendants",style:[LK.container,p]},M.createElement(_a,{style:LK.content},M.createElement(rK.Provider,{value:i||!1!==l},M.createElement(vK.Provider,{value:l?f:r??0},m))),l?M.createElement(jm.Provider,{value:d},M.createElement(Vm.Provider,{value:h},M.createElement(_a,{onLayout:e=>{const{height:t}=e.nativeEvent.layout;_(t)},style:u?LK.absolute:null},s))):null)}const LK=Ei.create({container:{flex:1,flexDirection:"column-reverse"},content:{flex:1},absolute:{position:"absolute",top:0,left:0,right:0}}),PK=M.createContext(!1),MK=e=>{let{children:t}=e;return M.createElement(M.Fragment,null,t)},DK=_a,NK=3,FK=4,BK=5;function jK(e){let t,n;return function(){let i=!1;for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];if(t){if(t.length!==a.length)i=!0;else for(let e=0;e<t.length;e++)if(t[e]!==a[e]){i=!0;break}}else i=!0;return t=a,(i||void 0===n)&&(n=e(...a)),n}}function VK(){return VK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},VK.apply(this,arguments)}function HK(e){const[t,n]=M.useState(void 0),[i,r]=M.useState(void 0),a=e=>{const{height:t,width:n}=e.nativeEvent.layout;r(e=>e&&t===e.height&&n===e.width?e:{height:t,width:n})},o=e=>{const{height:i,width:r}=e.nativeEvent.layout;t&&i===t.height&&r===t.width||n({height:i,width:r})},s=jK((e,t,n,i,r,a,o)=>e({current:{progress:n},next:i&&{progress:i},layouts:{header:{height:o,width:t.width},screen:t,title:r,leftLabel:a}})),{progress:l,layout:u,modal:c,onGoBack:d,headerTitle:h,headerLeft:m=(d?e=>M.createElement(fK,e):void 0),headerRight:p,headerBackImage:f,headerBackTitle:_,headerBackTitleVisible:g="ios"===lr.OS,headerTruncatedBackTitle:y,headerBackAccessibilityLabel:v,headerBackTestID:b,headerBackAllowFontScaling:S,headerBackTitleStyle:w,headerTitleContainerStyle:k,headerLeftContainerStyle:C,headerRightContainerStyle:E,headerBackgroundContainerStyle:I,headerStyle:x,headerStatusBarHeight:T,styleInterpolator:O,...R}=e,A=KZ(u,c,T),{height:L=A}=Ei.flatten(x||{}),{titleStyle:P,leftButtonStyle:D,leftLabelStyle:N,rightButtonStyle:F,backgroundStyle:B}=s(O,u,l.current,l.next,i,_?t:void 0,"number"==typeof L?L:A),j=m?e=>m({...e,backImage:f,accessibilityLabel:v,testID:b,allowFontScaling:S,onPress:d,label:_,truncatedLabel:y,labelStyle:[N,w],onLabelLayout:o,screenLayout:u,titleLayout:i,canGoBack:Boolean(d)}):void 0,V=p?e=>p({...e,canGoBack:Boolean(d)}):void 0,H="function"!=typeof h?e=>M.createElement(oK,VK({},e,{onLayout:a})):e=>h({...e,onLayout:a});return M.createElement(lK,VK({modal:c,layout:u,headerTitle:H,headerLeft:j,headerLeftLabelVisible:g,headerRight:V,headerTitleContainerStyle:[P,k],headerLeftContainerStyle:[D,C],headerRightContainerStyle:[F,E],headerBackgroundContainerStyle:[B,I],headerStyle:x,headerStatusBarHeight:T},R))}function zK(){return zK=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},zK.apply(this,arguments)}const UK=M.memo(function(e){let{back:t,layout:n,progress:i,options:r,route:a,navigation:o,styleInterpolator:s}=e;const l=pH();let u;void 0!==r.headerBackTitle?u=r.headerBackTitle:t&&(u=t.title);const c=M.useCallback(function(e,t){let n;return function(){if(!n){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];e.apply(this,r),n=setTimeout(()=>{n=void 0},t)}}}(()=>{o.isFocused()&&o.canGoBack()&&o.dispatch({...Am.pop(),source:a.key})},50),[o,a.key]),d=M.useContext(PK),h=M.useContext(rK),m=void 0!==r.headerStatusBarHeight?r.headerStatusBarHeight:d||h?0:l.top;return M.createElement(HK,zK({},r,{title:QZ(r,a.name),progress:i,layout:n,modal:d,headerBackTitle:void 0!==r.headerBackTitle?r.headerBackTitle:u,headerStatusBarHeight:m,onGoBack:t?c:void 0,styleInterpolator:s}))});function GK(e){let{mode:t,scenes:n,layout:i,getPreviousScene:r,getFocusedRoute:a,onContentHeightChange:o,style:s}=e;const l=a(),u=M.useContext(yK);return M.createElement(uu.View,{pointerEvents:"box-none",style:s},n.slice(-3).map((e,n,a)=>{var s,c;if("screen"===t&&n!==a.length-1||!e)return null;const{header:d,headerMode:h,headerShown:m=!0,headerTransparent:p,headerStyleInterpolator:f}=e.descriptor.options;if(h!==t||!m)return null;const _=l.key===e.descriptor.route.key,g=r({route:e.descriptor.route});let y=u;if(g){const{options:e,route:t}=g.descriptor;y=g?{title:QZ(e,t.name)}:u}const v=null===(s=a[n-1])||void 0===s?void 0:s.descriptor,b=null===(c=a[n+1])||void 0===c?void 0:c.descriptor,{headerShown:S=!0,headerMode:w}=(null==v?void 0:v.options)||{},k=a.slice(n+1).find(e=>{const{headerShown:t=!0,headerMode:n}=(null==e?void 0:e.descriptor.options)||{};return!1===t||"screen"===n}),{gestureDirection:C}=(null==k?void 0:k.descriptor.options)||{},E=(!1===S||"screen"===w)&&!b||k,I={layout:i,back:y,progress:e.progress,options:e.descriptor.options,route:e.descriptor.route,navigation:e.descriptor.navigation,styleInterpolator:"float"===t?E?"vertical"===C||"vertical-inverted"===C?OZ:"horizontal-inverted"===C?TZ:xZ:f:RZ};return M.createElement(jm.Provider,{key:e.descriptor.route.key,value:e.descriptor.navigation},M.createElement(Vm.Provider,{value:e.descriptor.route},M.createElement(_a,{onLayout:o?t=>{const{height:n}=t.nativeEvent.layout;o({route:e.descriptor.route,height:n})}:void 0,pointerEvents:_?"box-none":"none",accessibilityElementsHidden:!_,importantForAccessibility:_?"auto":"no-hide-descendants",style:"float"===t&&!_||p?WK.header:null},void 0!==d?d(I):M.createElement(UK,I))))}))}const WK=Ei.create({header:{position:"absolute",top:0,left:0,right:0}});var YK,$K,XK={exports:{}};function qK(){return $K?YK:($K=1,YK={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]})}var ZK,KK,QK,JK,eQ,tQ,nQ,iQ,rQ,aQ,oQ,sQ,lQ={exports:{}};function uQ(){if(QK)return lQ.exports;QK=1;var e=KK?ZK:(KK=1,ZK=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}),t=Array.prototype.concat,n=Array.prototype.slice,i=lQ.exports=function(i){for(var r=[],a=0,o=i.length;a<o;a++){var s=i[a];e(s)?r=t.call(r,n.call(s)):r.push(s)}return r};return i.wrap=function(e){return function(){return e(i(arguments))}},lQ.exports}function cQ(){if(tQ)return eQ;tQ=1;const e=qK(),t={};for(const r of Object.keys(e))t[e[r]]=r;const n={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};eQ=n;for(const r of Object.keys(n)){if(!("channels"in n[r]))throw new Error("missing channels property: "+r);if(!("labels"in n[r]))throw new Error("missing channel labels property: "+r);if(n[r].labels.length!==n[r].channels)throw new Error("channel and label counts mismatch: "+r);const{channels:e,labels:t}=n[r];delete n[r].channels,delete n[r].labels,Object.defineProperty(n[r],"channels",{value:e}),Object.defineProperty(n[r],"labels",{value:t})}function i(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}return n.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,i=e[2]/255,r=Math.min(t,n,i),a=Math.max(t,n,i),o=a-r;let s,l;a===r?s=0:t===a?s=(n-i)/o:n===a?s=2+(i-t)/o:i===a&&(s=4+(t-n)/o),s=Math.min(60*s,360),s<0&&(s+=360);const u=(r+a)/2;return l=a===r?0:u<=.5?o/(a+r):o/(2-a-r),[s,100*l,100*u]},n.rgb.hsv=function(e){let t,n,i,r,a;const o=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l),d=function(e){return(u-e)/6/c+.5};return 0===c?(r=0,a=0):(a=c/u,t=d(o),n=d(s),i=d(l),o===u?r=i-n:s===u?r=1/3+t-i:l===u&&(r=2/3+n-t),r<0?r+=1:r>1&&(r-=1)),[360*r,100*a,100*u]},n.rgb.hwb=function(e){const t=e[0],i=e[1];let r=e[2];const a=n.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(i,r));return r=1-1/255*Math.max(t,Math.max(i,r)),[a,100*o,100*r]},n.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,i=e[2]/255,r=Math.min(1-t,1-n,1-i);return[100*((1-t-r)/(1-r)||0),100*((1-n-r)/(1-r)||0),100*((1-i-r)/(1-r)||0),100*r]},n.rgb.keyword=function(n){const r=t[n];if(r)return r;let a,o=1/0;for(const t of Object.keys(e)){const r=i(n,e[t]);r<o&&(o=r,a=t)}return a},n.keyword.rgb=function(t){return e[t]},n.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,i=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;return[100*(.4124*t+.3576*n+.1805*i),100*(.2126*t+.7152*n+.0722*i),100*(.0193*t+.1192*n+.9505*i)]},n.rgb.lab=function(e){const t=n.rgb.xyz(e);let i=t[0],r=t[1],a=t[2];i/=95.047,r/=100,a/=108.883,i=i>.008856?i**(1/3):7.787*i+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;return[116*r-16,500*(i-r),200*(r-a)]},n.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,i=e[2]/100;let r,a,o;if(0===n)return o=255*i,[o,o,o];r=i<.5?i*(1+n):i+n-i*n;const s=2*i-r,l=[0,0,0];for(let u=0;u<3;u++)a=t+1/3*-(u-1),a<0&&a++,a>1&&a--,o=6*a<1?s+6*(r-s)*a:2*a<1?r:3*a<2?s+(r-s)*(2/3-a)*6:s,l[u]=255*o;return l},n.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,i=e[2]/100,r=n;const a=Math.max(i,.01);i*=2,n*=i<=1?i:2-i,r*=a<=1?a:2-a;return[t,100*(0===i?2*r/(a+r):2*n/(i+n)),100*((i+n)/2)]},n.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let i=e[2]/100;const r=Math.floor(t)%6,a=t-Math.floor(t),o=255*i*(1-n),s=255*i*(1-n*a),l=255*i*(1-n*(1-a));switch(i*=255,r){case 0:return[i,l,o];case 1:return[s,i,o];case 2:return[o,i,l];case 3:return[o,s,i];case 4:return[l,o,i];case 5:return[i,o,s]}},n.hsv.hsl=function(e){const t=e[0],n=e[1]/100,i=e[2]/100,r=Math.max(i,.01);let a,o;o=(2-n)*i;const s=(2-n)*r;return a=n*r,a/=s<=1?s:2-s,a=a||0,o/=2,[t,100*a,100*o]},n.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,i=e[2]/100;const r=n+i;let a;r>1&&(n/=r,i/=r);const o=Math.floor(6*t),s=1-i;a=6*t-o,1&o&&(a=1-a);const l=n+a*(s-n);let u,c,d;switch(o){default:case 6:case 0:u=s,c=l,d=n;break;case 1:u=l,c=s,d=n;break;case 2:u=n,c=s,d=l;break;case 3:u=n,c=l,d=s;break;case 4:u=l,c=n,d=s;break;case 5:u=s,c=n,d=l}return[255*u,255*c,255*d]},n.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,i=e[2]/100,r=e[3]/100;return[255*(1-Math.min(1,t*(1-r)+r)),255*(1-Math.min(1,n*(1-r)+r)),255*(1-Math.min(1,i*(1-r)+r))]},n.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,i=e[2]/100;let r,a,o;return r=3.2406*t+-1.5372*n+-.4986*i,a=-.9689*t+1.8758*n+.0415*i,o=.0557*t+-.204*n+1.057*i,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,r=Math.min(Math.max(0,r),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[255*r,255*a,255*o]},n.xyz.lab=function(e){let t=e[0],n=e[1],i=e[2];t/=95.047,n/=100,i/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*n-16,500*(t-n),200*(n-i)]},n.lab.xyz=function(e){let t,n,i;n=(e[0]+16)/116,t=e[1]/500+n,i=n-e[2]/200;const r=n**3,a=t**3,o=i**3;return n=r>.008856?r:(n-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,i=o>.008856?o:(i-16/116)/7.787,t*=95.047,n*=100,i*=108.883,[t,n,i]},n.lab.lch=function(e){const t=e[0],n=e[1],i=e[2];let r;r=360*Math.atan2(i,n)/2/Math.PI,r<0&&(r+=360);return[t,Math.sqrt(n*n+i*i),r]},n.lch.lab=function(e){const t=e[0],n=e[1],i=e[2]/360*2*Math.PI;return[t,n*Math.cos(i),n*Math.sin(i)]},n.rgb.ansi16=function(e,t=null){const[i,r,a]=e;let o=null===t?n.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let s=30+(Math.round(a/255)<<2|Math.round(r/255)<<1|Math.round(i/255));return 2===o&&(s+=60),s},n.hsv.ansi16=function(e){return n.rgb.ansi16(n.hsv.rgb(e),e[2])},n.rgb.ansi256=function(e){const t=e[0],n=e[1],i=e[2];if(t===n&&n===i)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(i/255*5)},n.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=.5*(1+~~(e>50));return[(1&t)*n*255,(t>>1&1)*n*255,(t>>2&1)*n*255]},n.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},n.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},n.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let n=t[0];3===t[0].length&&(n=n.split("").map(e=>e+e).join(""));const i=parseInt(n,16);return[i>>16&255,i>>8&255,255&i]},n.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,i=e[2]/255,r=Math.max(Math.max(t,n),i),a=Math.min(Math.min(t,n),i),o=r-a;let s,l;return s=o<1?a/(1-o):0,l=o<=0?0:r===t?(n-i)/o%6:r===n?2+(i-t)/o:4+(t-n)/o,l/=6,l%=1,[360*l,100*o,100*s]},n.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,i=n<.5?2*t*n:2*t*(1-n);let r=0;return i<1&&(r=(n-.5*i)/(1-i)),[e[0],100*i,100*r]},n.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,i=t*n;let r=0;return i<1&&(r=(n-i)/(1-i)),[e[0],100*i,100*r]},n.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,i=e[2]/100;if(0===n)return[255*i,255*i,255*i];const r=[0,0,0],a=t%1*6,o=a%1,s=1-o;let l=0;switch(Math.floor(a)){case 0:r[0]=1,r[1]=o,r[2]=0;break;case 1:r[0]=s,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=o;break;case 3:r[0]=0,r[1]=s,r[2]=1;break;case 4:r[0]=o,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=s}return l=(1-n)*i,[255*(n*r[0]+l),255*(n*r[1]+l),255*(n*r[2]+l)]},n.hcg.hsv=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);let i=0;return n>0&&(i=t/n),[e[0],100*i,100*n]},n.hcg.hsl=function(e){const t=e[1]/100,n=e[2]/100*(1-t)+.5*t;let i=0;return n>0&&n<.5?i=t/(2*n):n>=.5&&n<1&&(i=t/(2*(1-n))),[e[0],100*i,100*n]},n.hcg.hwb=function(e){const t=e[1]/100,n=t+e[2]/100*(1-t);return[e[0],100*(n-t),100*(1-n)]},n.hwb.hcg=function(e){const t=e[1]/100,n=1-e[2]/100,i=n-t;let r=0;return i<1&&(r=(n-i)/(1-i)),[e[0],100*i,100*r]},n.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},n.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},n.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},n.gray.hsl=function(e){return[0,0,e[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(e){return[0,100,e[0]]},n.gray.cmyk=function(e){return[0,0,0,e[0]]},n.gray.lab=function(e){return[e[0],0,0]},n.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n},n.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]},eQ}function dQ(){if(iQ)return nQ;iQ=1;const e=cQ();function t(t){const n=function(){const t={},n=Object.keys(e);for(let e=n.length,i=0;i<e;i++)t[n[i]]={distance:-1,parent:null};return t}(),i=[t];for(n[t].distance=0;i.length;){const t=i.pop(),r=Object.keys(e[t]);for(let e=r.length,a=0;a<e;a++){const e=r[a],o=n[e];-1===o.distance&&(o.distance=n[t].distance+1,o.parent=t,i.unshift(e))}}return n}function n(e,t){return function(n){return t(e(n))}}function i(t,i){const r=[i[t].parent,t];let a=e[i[t].parent][t],o=i[t].parent;for(;i[o].parent;)r.unshift(i[o].parent),a=n(e[i[o].parent][o],a),o=i[o].parent;return a.conversion=r,a}return nQ=function(e){const n=t(e),r={},a=Object.keys(n);for(let t=a.length,o=0;o<t;o++){const e=a[o];null!==n[e].parent&&(r[e]=i(e,n))}return r},nQ}function hQ(){if(aQ)return rQ;aQ=1;const e=cQ(),t=dQ(),n={};return Object.keys(e).forEach(i=>{n[i]={},Object.defineProperty(n[i],"channels",{value:e[i].channels}),Object.defineProperty(n[i],"labels",{value:e[i].labels});const r=t(i);Object.keys(r).forEach(e=>{const t=r[e];n[i][e]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const i=e(t);if("object"==typeof i)for(let e=i.length,r=0;r<e;r++)i[r]=Math.round(i[r]);return i};return"conversion"in e&&(t.conversion=e.conversion),t}(t),n[i][e].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(t)})}),rQ=n}function mQ(){if(sQ)return oQ;sQ=1;const e=function(){if(JK)return XK.exports;JK=1;var e=qK(),t=uQ(),n=Object.hasOwnProperty,i=Object.create(null);for(var r in e)n.call(e,r)&&(i[e[r]]=r);var a=XK.exports={to:{},get:{}};function o(e,t,n){return Math.min(Math.max(t,e),n)}function s(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}return a.get=function(e){var t,n;switch(e.substring(0,3).toLowerCase()){case"hsl":t=a.get.hsl(e),n="hsl";break;case"hwb":t=a.get.hwb(e),n="hwb";break;default:t=a.get.rgb(e),n="rgb"}return t?{model:n,value:t}:null},a.get.rgb=function(t){if(!t)return null;var i,r,a,s=[0,0,0,1];if(i=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(a=i[2],i=i[1],r=0;r<3;r++){var l=2*r;s[r]=parseInt(i.slice(l,l+2),16)}a&&(s[3]=parseInt(a,16)/255)}else if(i=t.match(/^#([a-f0-9]{3,4})$/i)){for(a=(i=i[1])[3],r=0;r<3;r++)s[r]=parseInt(i[r]+i[r],16);a&&(s[3]=parseInt(a+a,16)/255)}else if(i=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)s[r]=parseInt(i[r+1],0);i[4]&&(i[5]?s[3]=.01*parseFloat(i[4]):s[3]=parseFloat(i[4]))}else{if(!(i=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(i=t.match(/^(\w+)$/))?"transparent"===i[1]?[0,0,0,0]:n.call(e,i[1])?((s=e[i[1]])[3]=1,s):null:null;for(r=0;r<3;r++)s[r]=Math.round(2.55*parseFloat(i[r+1]));i[4]&&(i[5]?s[3]=.01*parseFloat(i[4]):s[3]=parseFloat(i[4]))}for(r=0;r<3;r++)s[r]=o(s[r],0,255);return s[3]=o(s[3],0,1),s},a.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,o(parseFloat(t[2]),0,100),o(parseFloat(t[3]),0,100),o(isNaN(n)?1:n,0,1)]}return null},a.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,o(parseFloat(t[2]),0,100),o(parseFloat(t[3]),0,100),o(isNaN(n)?1:n,0,1)]}return null},a.to.hex=function(){var e=t(arguments);return"#"+s(e[0])+s(e[1])+s(e[2])+(e[3]<1?s(Math.round(255*e[3])):"")},a.to.rgb=function(){var e=t(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},a.to.rgb.percent=function(){var e=t(arguments),n=Math.round(e[0]/255*100),i=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+n+"%, "+i+"%, "+r+"%)":"rgba("+n+"%, "+i+"%, "+r+"%, "+e[3]+")"},a.to.hsl=function(){var e=t(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},a.to.hwb=function(){var e=t(arguments),n="";return e.length>=4&&1!==e[3]&&(n=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+n+")"},a.to.keyword=function(e){return i[e.slice(0,3)]},XK.exports}(),t=hQ(),n=["keyword","gray","hex"],i={};for(const c of Object.keys(t))i[[...t[c].labels].sort().join("")]=c;const r={};function a(o,s){if(!(this instanceof a))return new a(o,s);if(s&&s in n&&(s=null),s&&!(s in t))throw new Error("Unknown model: "+s);let l,c;if(null==o)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(o instanceof a)this.model=o.model,this.color=[...o.color],this.valpha=o.valpha;else if("string"==typeof o){const n=e.get(o);if(null===n)throw new Error("Unable to parse color from string: "+o);this.model=n.model,c=t[this.model].channels,this.color=n.value.slice(0,c),this.valpha="number"==typeof n.value[c]?n.value[c]:1}else if(o.length>0){this.model=s||"rgb",c=t[this.model].channels;const e=Array.prototype.slice.call(o,0,c);this.color=u(e,c),this.valpha="number"==typeof o[c]?o[c]:1}else if("number"==typeof o)this.model="rgb",this.color=[o>>16&255,o>>8&255,255&o],this.valpha=1;else{this.valpha=1;const e=Object.keys(o);"alpha"in o&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof o.alpha?o.alpha:0);const n=e.sort().join("");if(!(n in i))throw new Error("Unable to parse color from object: "+JSON.stringify(o));this.model=i[n];const{labels:r}=t[this.model],a=[];for(l=0;l<r.length;l++)a.push(o[r[l]]);this.color=u(a)}if(r[this.model])for(c=t[this.model].channels,l=0;l<c;l++){const e=r[this.model][l];e&&(this.color[l]=e(this.color[l]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}a.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(t){let n=this.model in e.to?this:this.rgb();n=n.round("number"==typeof t?t:1);const i=1===n.valpha?n.color:[...n.color,this.valpha];return e.to[n.model](i)},percentString(t){const n=this.rgb().round("number"==typeof t?t:1),i=1===n.valpha?n.color:[...n.color,this.valpha];return e.to.rgb.percent(i)},array(){return 1===this.valpha?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:n}=t[this.model],{labels:i}=t[this.model];for(let t=0;t<n;t++)e[i[t]]=this.color[t];return 1!==this.valpha&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,1!==this.valpha&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,1!==this.valpha&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new a([...this.color.map(o(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new a([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:s("rgb",0,l(255)),green:s("rgb",1,l(255)),blue:s("rgb",2,l(255)),hue:s(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:s("hsl",1,l(100)),lightness:s("hsl",2,l(100)),saturationv:s("hsv",1,l(100)),value:s("hsv",2,l(100)),chroma:s("hcg",1,l(100)),gray:s("hcg",2,l(100)),white:s("hwb",1,l(100)),wblack:s("hwb",2,l(100)),cyan:s("cmyk",0,l(100)),magenta:s("cmyk",1,l(100)),yellow:s("cmyk",2,l(100)),black:s("cmyk",3,l(100)),x:s("xyz",0,l(95.047)),y:s("xyz",1,l(100)),z:s("xyz",2,l(108.833)),l:s("lab",0,l(100)),a:s("lab",1),b:s("lab",2),keyword(e){return void 0!==e?new a(e):t[this.model].keyword(this.color)},hex(t){return void 0!==t?new a(t):e.to.hex(this.rgb().round().color)},hexa(t){if(void 0!==t)return new a(t);const n=this.rgb().round().color;let i=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===i.length&&(i="0"+i),e.to.hex(n)+i},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[n,i]of e.entries()){const e=i/255;t[n]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return a.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),i=this.rgb(),r=void 0===t?.5:t,o=2*r-1,s=n.alpha()-i.alpha(),l=((o*s===-1?o:(o+s)/(1+o*s))+1)/2,u=1-l;return a.rgb(l*n.red()+u*i.red(),l*n.green()+u*i.green(),l*n.blue()+u*i.blue(),n.alpha()*r+i.alpha()*(1-r))}};for(const c of Object.keys(t)){if(n.includes(c))continue;const{channels:e}=t[c];a.prototype[c]=function(...e){return this.model===c?new a(this):e.length>0?new a(e,c):new a([...(n=t[this.model][c].raw(this.color),Array.isArray(n)?n:[n]),this.valpha],c);var n},a[c]=function(...t){let n=t[0];return"number"==typeof n&&(n=u(t,e)),new a(n,c)}}function o(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function s(e,t,n){e=Array.isArray(e)?e:[e];for(const i of e)(r[i]||(r[i]=[]))[t]=n;return e=e[0],function(i){let r;return void 0!==i?(n&&(i=n(i)),r=this[e](),r.color[t]=i,r):(r=this[e]().color[t],n&&(r=n(r)),r)}}function l(e){return function(t){return Math.max(0,Math.min(e,t))}}function u(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}return oQ=a}const pQ=n(mQ());function fQ(e,t){for(var n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}function _Q(e){switch(e){case"vertical":return 1;case"vertical-inverted":return-1;case"horizontal":return Lu.getConstants().isRTL?-1:1;case"horizontal-inverted":return Lu.getConstants().isRTL?1:-1}}function gQ(e,t){const n=_Q(t);switch(t){case"vertical":case"vertical-inverted":return e.height*n;case"horizontal":case"horizontal-inverted":return e.width*n}}const yQ=i(iz);function vQ(){return vQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},vQ.apply(this,arguments)}let bQ;try{bQ=yQ}catch(e){}const SQ=e=>{let{enabled:t,...n}=e;return null!=bQ?M.createElement(bQ.ScreenContainer,vQ({enabled:t},n)):M.createElement(_a,n)},wQ=e=>{let{enabled:t,active:n,...i}=e;return null!=bQ?M.createElement(bQ.Screen,vQ({enabled:t,activityState:n},i)):M.createElement(_a,i)},kQ=M.createContext(void 0);function CQ(e){var t,n;let{dark:i,layout:r,insets:a,style:o}=e;const{dark:s}=Af(),[l,u]=M.useState(!0),c=1-20/r.width,d=(a.top-34)*c,h=Ei.flatten(o),m=null==h||null===(t=h.transform)||void 0===t||null===(n=t.find(e=>void 0!==e.translateY))||void 0===n?void 0:n.translateY;M.useEffect(()=>{const e=null==m?void 0:m.addListener(e=>{let{value:t}=e;u(t<d)});return()=>null==m?void 0:m.removeListener(e)},[d,m]);const p=i??!s;return M.createElement(uh,{animated:!0,barStyle:l&&p?"dark-content":"light-content"})}function EQ(){return EQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},EQ.apply(this,arguments)}const IQ=M.forwardRef(function(e,t){let{enabled:n,layout:i,style:r,...a}=e;const[o,s]=M.useState(!1),[l,u]=M.useState("auto");return M.useImperativeHandle(t,()=>({setPointerEvents:u})),M.useEffect(()=>{if("undefined"==typeof document||!document.body)return;const e=document.body.clientWidth,t=document.body.clientHeight;s(e===i.width&&t===i.height)},[i.height,i.width]),M.createElement(_a,EQ({},a,{pointerEvents:l,style:[n&&o?xQ.page:xQ.card,r]}))}),xQ=Ei.create({page:{minHeight:"100%"},card:{flex:1,overflow:"hidden"}});function TQ(){return TQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},TQ.apply(this,arguments)}const OQ="web"!==lr.OS,RQ=e=>{if(e){return null!=Ei.flatten(e).opacity}return!1};class AQ extends M.Component{static defaultProps={shadowEnabled:!1,gestureEnabled:!0,gestureVelocityImpact:.3,overlay:e=>{let{style:t}=e;return t?M.createElement(uu.View,{pointerEvents:"none",style:[PQ.overlay,t]}):null}};componentDidMount(){this.animate({closing:this.props.closing}),this.isCurrentlyMounted=!0}componentDidUpdate(e){const{layout:t,gestureDirection:n,closing:i}=this.props,{width:r,height:a}=t;r!==e.layout.width&&this.layout.width.setValue(r),a!==e.layout.height&&this.layout.height.setValue(a),n!==e.gestureDirection&&this.inverted.setValue(_Q(n));const o=this.getAnimateToValue(this.props);this.getAnimateToValue(e)===o&&this.lastToValue===o||this.animate({closing:i})}componentWillUnmount(){this.props.gesture.stopAnimation(),this.isCurrentlyMounted=!1,this.handleEndInteraction()}isCurrentlyMounted=!1;isClosing=new uu.Value(0);inverted=new uu.Value(_Q(this.props.gestureDirection));layout={width:new uu.Value(this.props.layout.width),height:new uu.Value(this.props.layout.height)};isSwiping=new uu.Value(0);animate=e=>{let{closing:t,velocity:n}=e;const{gesture:i,transitionSpec:r,onOpen:a,onClose:o,onTransition:s}=this.props,l=this.getAnimateToValue({...this.props,closing:t});this.lastToValue=l,this.isClosing.setValue(t?1:0);const u=t?r.close:r.open,c="spring"===u.animation?uu.spring:uu.timing;this.setPointerEventsEnabled(!t),this.handleStartInteraction(),clearTimeout(this.pendingGestureCallback),null==s||s({closing:t,gesture:void 0!==n}),c(i,{...u.config,velocity:n,toValue:l,useNativeDriver:OQ,isInteraction:!1}).start(e=>{let{finished:n}=e;this.handleEndInteraction(),clearTimeout(this.pendingGestureCallback),n&&(t?o():a(),this.isCurrentlyMounted&&this.forceUpdate())})};getAnimateToValue=e=>{let{closing:t,layout:n,gestureDirection:i}=e;return t?gQ(n,i):0};setPointerEventsEnabled=e=>{var t;const n=e?"box-none":"none";null===(t=this.ref.current)||void 0===t||t.setPointerEvents(n)};handleStartInteraction=()=>{void 0===this.interactionHandle&&(this.interactionHandle=Qa.createInteractionHandle())};handleEndInteraction=()=>{void 0!==this.interactionHandle&&(Qa.clearInteractionHandle(this.interactionHandle),this.interactionHandle=void 0)};handleGestureStateChange=e=>{let{nativeEvent:t}=e;const{layout:n,onClose:i,onGestureBegin:r,onGestureCanceled:a,onGestureEnd:o,gestureDirection:s,gestureVelocityImpact:l}=this.props;switch(t.state){case FK:this.isSwiping.setValue(1),this.handleStartInteraction(),null==r||r();break;case NK:{this.isSwiping.setValue(0),this.handleEndInteraction();const e="vertical"===s||"vertical-inverted"===s?t.velocityY:t.velocityX;this.animate({closing:this.props.closing,velocity:e}),null==a||a();break}case BK:{let e,r,a;this.isSwiping.setValue(0),"vertical"===s||"vertical-inverted"===s?(e=n.height,r=t.translationY,a=t.velocityY):(e=n.width,r=t.translationX,a=t.velocityX);const u=(r+a*l)*_Q(s)>e/2?0!==a||0!==r:this.props.closing;this.animate({closing:u,velocity:a}),u&&(this.pendingGestureCallback=setTimeout(()=>{i(),this.forceUpdate()},32)),null==o||o();break}}};getInterpolatedStyle=jK((e,t)=>e(t));getCardAnimation=jK((e,t,n,i,r,a,o,s)=>({index:e,current:{progress:t},next:n&&{progress:n},closing:this.isClosing,swiping:this.isSwiping,inverted:this.inverted,layouts:{screen:i},insets:{top:r,right:a,bottom:o,left:s}}));gestureActivationCriteria(){const{layout:e,gestureDirection:t,gestureResponseDistance:n}=this.props,i=!0,r=void 0!==n?n:"vertical"===t||"vertical-inverted"===t?135:50;if("vertical"===t)return{maxDeltaX:15,minOffsetY:5,hitSlop:{bottom:-e.height+r},enableTrackpadTwoFingerGesture:i};if("vertical-inverted"===t)return{maxDeltaX:15,minOffsetY:-5,hitSlop:{top:-e.height+r},enableTrackpadTwoFingerGesture:i};{const n=-e.width+r;return 1===_Q(t)?{minOffsetX:5,maxDeltaY:20,hitSlop:{right:n},enableTrackpadTwoFingerGesture:i}:{minOffsetX:-5,maxDeltaY:20,hitSlop:{left:n},enableTrackpadTwoFingerGesture:i}}}ref=M.createRef();render(){const{styleInterpolator:e,interpolationIndex:t,current:n,gesture:i,next:r,layout:a,insets:o,overlay:s,overlayEnabled:l,shadowEnabled:u,gestureEnabled:c,gestureDirection:d,pageOverflowEnabled:h,headerDarkContent:m,children:p,containerStyle:f,contentStyle:_,...g}=this.props,y=this.getCardAnimation(t,n,r,a,o.top,o.right,o.bottom,o.left),v=this.getInterpolatedStyle(e,y),{containerStyle:b,cardStyle:S,overlayStyle:w,shadowStyle:k}=v,C=c?uu.event([{nativeEvent:"vertical"===d||"vertical-inverted"===d?{translationY:i}:{translationX:i}}],{useNativeDriver:OQ}):void 0,{backgroundColor:E}=Ei.flatten(_||{}),I="string"==typeof E&&0===pQ(E).alpha();return M.createElement(kQ.Provider,{value:y},"ios"===lr.OS&&l&&r&&LQ(e)?M.createElement(CQ,{dark:m,layout:a,insets:o,style:S}):null,M.createElement(uu.View,{style:{opacity:n},collapsable:!1}),M.createElement(_a,TQ({pointerEvents:"box-none",collapsable:!1},g),l?M.createElement(_a,{pointerEvents:"box-none",style:Ei.absoluteFill},s({style:w})):null,M.createElement(uu.View,{style:[PQ.container,b,f],pointerEvents:"box-none"},M.createElement(MK,TQ({enabled:0!==a.width&&c,onGestureEvent:C,onHandlerStateChange:this.handleGestureStateChange},this.gestureActivationCriteria()),M.createElement(uu.View,{needsOffscreenAlphaCompositing:RQ(S),style:[PQ.container,S]},u&&k&&!I?M.createElement(uu.View,{style:[PQ.shadow,"horizontal"===d?[PQ.shadowHorizontal,PQ.shadowLeft]:"horizontal-inverted"===d?[PQ.shadowHorizontal,PQ.shadowRight]:"vertical"===d?[PQ.shadowVertical,PQ.shadowTop]:[PQ.shadowVertical,PQ.shadowBottom],{backgroundColor:E},k],pointerEvents:"none"}):null,M.createElement(IQ,{ref:this.ref,enabled:h,layout:a,style:_},p))))))}}const LQ=e=>e===kZ||"forModalPresentationIOS"===e.name,PQ=Ei.create({container:{flex:1},overlay:{flex:1,backgroundColor:"#000"},shadow:{position:"absolute",shadowRadius:5,shadowColor:"#000",shadowOpacity:.3},shadowHorizontal:{top:0,bottom:0,width:3,shadowOffset:{width:-1,height:1}},shadowLeft:{left:0},shadowRight:{right:0},shadowVertical:{left:0,right:0,height:3,shadowOffset:{width:1,height:-1}},shadowTop:{top:0},shadowBottom:{bottom:0}});function MQ(e){let{interpolationIndex:t,index:n,active:i,closing:r,gesture:a,focused:o,modal:s,getPreviousScene:l,getFocusedRoute:u,headerDarkContent:c,hasAbsoluteFloatHeader:d,headerHeight:h,onHeaderHeightChange:m,isParentHeaderShown:p,isNextScreenTransparent:f,detachCurrentScreen:_,layout:g,onCloseRoute:y,onOpenRoute:v,onGestureCancel:b,onGestureEnd:S,onGestureStart:w,onTransitionEnd:k,onTransitionStart:C,renderHeader:E,renderScene:I,safeAreaInsetBottom:x,safeAreaInsetLeft:T,safeAreaInsetRight:O,safeAreaInsetTop:R,scene:A}=e;const L=M.useContext(vK),{onPageChangeStart:P,onPageChangeCancel:D,onPageChangeConfirm:N}=function(e){const t=M.useRef(void 0),n=M.useRef(0),i=M.useRef(),r=M.useCallback(()=>{void 0!==i.current&&(clearTimeout(i.current),i.current=void 0)},[]),a=M.useCallback(()=>{if(!e())return;r();const i=kh.State.currentlyFocusedInput();null==i||i.blur(),t.current=i,n.current=Date.now()},[r,e]),o=M.useCallback(n=>{if(e()){if(r(),n)Pu.dismiss();else{const e=t.current;null==e||e.blur()}t.current=void 0}},[r,e]),s=M.useCallback(()=>{if(!e())return;r();const a=t.current;a&&(Date.now()-n.current<100?i.current=setTimeout(()=>{null==a||a.focus(),t.current=void 0},100):(null==a||a.focus(),t.current=void 0))},[r,e]);return M.useEffect(()=>()=>r(),[r]),{onPageChangeStart:a,onPageChangeConfirm:o,onPageChangeCancel:s}}(M.useCallback(()=>{const{options:e,navigation:t}=A.descriptor;return t.isFocused()&&!1!==e.keyboardHandlingEnabled},[A.descriptor])),F={top:R,right:O,bottom:x,left:T},{colors:B}=Af(),[j,V]=M.useState("box-none");M.useEffect(()=>{var e,t;const n=null===(e=A.progress.next)||void 0===e||null===(t=e.addListener)||void 0===t?void 0:t.call(e,e=>{let{value:t}=e;V(t<=.1?"box-none":"none")});return()=>{var e,t;n&&(null===(e=A.progress.next)||void 0===e||null===(t=e.removeListener)||void 0===t||t.call(e,n))}},[j,A.progress.next]);const{presentation:H,animationEnabled:z,cardOverlay:U,cardOverlayEnabled:G,cardShadowEnabled:W,cardStyle:Y,cardStyleInterpolator:$,gestureDirection:X,gestureEnabled:q,gestureResponseDistance:Z,gestureVelocityImpact:K,headerMode:Q,headerShown:J,transitionSpec:ee}=A.descriptor.options,te=l({route:A.descriptor.route});let ne;if(te){const{options:e,route:t}=te.descriptor;ne=QZ(e,t.name)}const ie=M.useMemo(()=>void 0!==ne?{title:ne}:void 0,[ne]);return M.createElement(AQ,{interpolationIndex:t,gestureDirection:X,layout:g,insets:F,gesture:a,current:A.progress.current,next:A.progress.next,closing:r,onOpen:()=>{const{route:e}=A.descriptor;k({route:e},!1),v({route:e})},onClose:()=>{const{route:e}=A.descriptor;k({route:e},!0),y({route:e})},overlay:U,overlayEnabled:G,shadowEnabled:W,onTransition:e=>{let{closing:t,gesture:n}=e;const{route:r}=A.descriptor;n?i&&t?null==N||N(!1):null==D||D():null==N||N(!0),null==C||C({route:r},t)},onGestureBegin:()=>{const{route:e}=A.descriptor;P(),w({route:e})},onGestureCanceled:()=>{const{route:e}=A.descriptor;D(),b({route:e})},onGestureEnd:()=>{const{route:e}=A.descriptor;S({route:e})},gestureEnabled:0!==n&&q,gestureResponseDistance:Z,gestureVelocityImpact:K,transitionSpec:ee,styleInterpolator:$,accessibilityElementsHidden:!o,importantForAccessibility:o?"auto":"no-hide-descendants",pointerEvents:i?"box-none":j,pageOverflowEnabled:"float"!==Q&&"modal"!==H,headerDarkContent:c,containerStyle:d&&"screen"!==Q?{marginTop:h}:null,contentStyle:[{backgroundColor:"transparentModal"===H?"transparent":B.background},Y],style:[{overflow:i?void 0:"hidden",display:!1!==z||!1!==f||!1===_||o?"flex":"none"},Ei.absoluteFill]},M.createElement(_a,{style:NQ.container},M.createElement(PK.Provider,{value:s},M.createElement(_a,{style:NQ.scene},M.createElement(yK.Provider,{value:ie},M.createElement(rK.Provider,{value:p||!1!==J},M.createElement(vK.Provider,{value:J?h:L??0},I({route:A.descriptor.route}))))),"float"!==Q?E({mode:"screen",layout:g,scenes:[te,A],getPreviousScene:l,getFocusedRoute:u,onContentHeightChange:m}):null)))}const DQ=M.memo(MQ),NQ=Ei.create({container:{flex:1,flexDirection:"column-reverse"},scene:{flex:1}}),FQ=Object.freeze({options:{}}),BQ=(e,t)=>{const{cardStyleInterpolator:n}=e[t].descriptor.options;let i=0;for(let a=t-1;a>=0;a--){var r;if((null===(r=e[a])||void 0===r?void 0:r.descriptor.options.cardStyleInterpolator)!==n)break;i++}return i},jQ=(e,t,n)=>{if(n)return!0;const{cardStyleInterpolator:i}=e.descriptor.options;return LQ(i)&&0!==t},VQ=(e,t,n,i,r,a)=>e.reduce((o,s,l)=>{const{headerStatusBarHeight:u=(n?0:t.top),headerStyle:c}=s.descriptor.options,d=Ei.flatten(c||{}),h="height"in d&&"number"==typeof d.height?d.height:a[s.route.key],m=BQ(e,l),p=jQ(s,m,i);return o[s.route.key]="number"==typeof h?h:KZ(r,p,u),o},{}),HQ=(e,t)=>{const{presentation:n,gestureDirection:i=("modal"===n?YZ.gestureDirection:WZ.gestureDirection)}=(null==t?void 0:t.options)||{};return gQ(e,i)},zQ=(e,t,n)=>{const i=HQ({width:Math.max(1,t.width),height:Math.max(1,t.height)},n);return i>0?e.interpolate({inputRange:[0,i],outputRange:[1,0]}):e.interpolate({inputRange:[i,0],outputRange:[0,1]})};class UQ extends M.Component{static getDerivedStateFromProps(e,t){if(e.routes===t.routes&&e.descriptors===t.descriptors)return null;const n=e.routes.reduce((n,i)=>{const r=e.descriptors[i.key],{animationEnabled:a}=(null==r?void 0:r.options)||{};return n[i.key]=t.gestures[i.key]||new uu.Value(e.openingRouteKeys.includes(i.key)&&!1!==a?HQ(t.layout,r):0),n},{}),i=e.routes.map((i,r,a)=>{const o=a[r-1],s=a[r+1],l=t.scenes[r],u=n[i.key],c=o?n[o.key]:void 0,d=s?n[s.key]:void 0,h=e.descriptors[i.key]||t.descriptors[i.key]||(l?l.descriptor:FQ),m=e.descriptors[null==s?void 0:s.key]||t.descriptors[null==s?void 0:s.key],p=e.descriptors[null==o?void 0:o.key]||t.descriptors[null==o?void 0:o.key],f=r!==a.length-1&&m&&"transparentModal"!==m.options.presentation?m.options:h.options;let _="modal"===f.presentation?YZ:"transparentModal"===f.presentation?GZ:WZ;const{animationEnabled:g="web"!==lr.OS&&"windows"!==lr.OS&&"macos"!==lr.OS,gestureEnabled:y="ios"===lr.OS&&g,gestureDirection:v=_.gestureDirection,transitionSpec:b=_.transitionSpec,cardStyleInterpolator:S=(!1===g?CZ:_.cardStyleInterpolator),headerStyleInterpolator:w=_.headerStyleInterpolator,cardOverlayEnabled:k="ios"!==lr.OS&&"transparentModal"!==f.presentation||LQ(S)}=f,C=h.options.headerMode??("modal"===f.presentation||"transparentModal"===f.presentation||"modal"===(null==m?void 0:m.options.presentation)||"transparentModal"===(null==m?void 0:m.options.presentation)||LQ(S)||"ios"!==lr.OS||void 0!==h.options.header?"screen":"float"),E={route:i,descriptor:{...h,options:{...h.options,animationEnabled:g,cardOverlayEnabled:k,cardStyleInterpolator:S,gestureDirection:v,gestureEnabled:y,headerStyleInterpolator:w,transitionSpec:b,headerMode:C}},progress:{current:zQ(u,t.layout,h),next:d&&"transparentModal"!==(null==m?void 0:m.options.presentation)?zQ(d,t.layout,m):void 0,previous:c?zQ(c,t.layout,p):void 0},__memo:[t.layout,h,m,p,u,d,c]};return l&&E.__memo.every((e,t)=>l.__memo[t]===e)?l:E});return{routes:e.routes,scenes:i,gestures:n,descriptors:e.descriptors,headerHeights:VQ(i,e.insets,e.isParentHeaderShown,e.isParentModal,t.layout,t.headerHeights)}}constructor(e){super(e),this.state={routes:[],scenes:[],gestures:{},layout:TK.initialMetrics.frame,descriptors:this.props.descriptors,headerHeights:{}}}handleLayout=e=>{const{height:t,width:n}=e.nativeEvent.layout,i={width:n,height:t};this.setState((e,r)=>t===e.layout.height&&n===e.layout.width?null:{layout:i,headerHeights:VQ(e.scenes,r.insets,r.isParentHeaderShown,r.isParentModal,i,e.headerHeights)})};handleHeaderLayout=e=>{let{route:t,height:n}=e;this.setState(e=>{let{headerHeights:i}=e;return i[t.key]===n?null:{headerHeights:{...i,[t.key]:n}}})};getFocusedRoute=()=>{const{state:e}=this.props;return e.routes[e.index]};getPreviousScene=e=>{let{route:t}=e;const{getPreviousRoute:n}=this.props,{scenes:i}=this.state,r=n({route:t});if(r){return i.find(e=>e.descriptor.route.key===r.key)}};render(){const{insets:e,state:t,routes:n,closingRouteKeys:i,onOpenRoute:r,onCloseRoute:a,renderHeader:o,renderScene:s,isParentHeaderShown:l,isParentModal:u,onTransitionStart:c,onTransitionEnd:d,onGestureStart:h,onGestureEnd:m,onGestureCancel:p,detachInactiveScreens:f="web"===lr.OS||"android"===lr.OS||"ios"===lr.OS}=this.props,{scenes:_,layout:g,gestures:y,headerHeights:v}=this.state,b=t.routes[t.index],S=v[b.key],w=this.state.scenes.slice(-2).some(e=>{const t=e.descriptor.options??{},{headerMode:n,headerTransparent:i,headerShown:r=!0}=t;return!(!i&&!1!==r&&"screen"!==n)});let k=1;for(let E=_.length-1;E>=0;E--){const{options:e}=_[E].descriptor,{detachPreviousScreen:t="transparentModal"!==e.presentation&&(!LQ(e.cardStyleInterpolator)||E!==fQ(_,e=>{const{cardStyleInterpolator:t}=e.descriptor.options;return t===kZ||"forModalPresentationIOS"===(null==t?void 0:t.name)}))}=e;if(!1===t)k++;else if(E<=_.length-2)break}const C=M.createElement(M.Fragment,{key:"header"},o({mode:"float",layout:g,scenes:_,getPreviousScene:this.getPreviousScene,getFocusedRoute:this.getFocusedRoute,onContentHeightChange:this.handleHeaderLayout,style:[GQ.floating,w&&[{height:S},GQ.absolute]]}));return M.createElement(ZZ,null,w?null:C,M.createElement(SQ,{enabled:f,style:GQ.container,onLayout:this.handleLayout},n.map((t,n,S)=>{var C,E;const I=b.key===t.key,x=y[t.key],T=_[n];let O=1;if(n<S.length-k-1)O=0;else{const e=_[S.length-1],t=n===S.length-1?2:n>=S.length-k?1:0;O=e?e.progress.current.interpolate({inputRange:[0,.99999,1],outputRange:[1,1,t],extrapolate:"clamp"}):1}const{headerShown:R=!0,headerTransparent:A,headerStyle:L,headerTintColor:P,freezeOnBlur:D}=T.descriptor.options,N=e.top,F=e.right,B=e.bottom,j=e.left,V=!1!==R?v[t.key]:0;let H;if(R)if("string"==typeof P)H=pQ(P).isDark();else{const e=Ei.flatten(L);e&&"backgroundColor"in e&&"string"==typeof e.backgroundColor&&(H=!pQ(e.backgroundColor).isDark())}const z=BQ(_,n),U=jQ(T,z,u),G="transparentModal"===(null===(C=_[n+1])||void 0===C?void 0:C.descriptor.options.presentation),W=!1!==(null===(E=_[n+1])||void 0===E?void 0:E.descriptor.options.detachPreviousScreen);return M.createElement(wQ,{key:t.key,style:Ei.absoluteFill,enabled:f,active:O,freezeOnBlur:D,pointerEvents:"box-none"},M.createElement(DQ,{index:n,interpolationIndex:z,modal:U,active:n===S.length-1,focused:I,closing:i.includes(t.key),layout:g,gesture:x,scene:T,safeAreaInsetTop:N,safeAreaInsetRight:F,safeAreaInsetBottom:B,safeAreaInsetLeft:j,onGestureStart:h,onGestureCancel:p,onGestureEnd:m,headerHeight:V,isParentHeaderShown:l,onHeaderHeightChange:this.handleHeaderLayout,getPreviousScene:this.getPreviousScene,getFocusedRoute:this.getFocusedRoute,headerDarkContent:H,hasAbsoluteFloatHeader:w&&!A,renderHeader:o,renderScene:s,onOpenRoute:r,onCloseRoute:a,onTransitionStart:c,onTransitionEnd:d,isNextScreenTransparent:G,detachCurrentScreen:W}))})),w?C:null)}}const GQ=Ei.create({container:{flex:1},absolute:{position:"absolute",top:0,left:0,right:0},floating:{zIndex:1}});function WQ(){return WQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},WQ.apply(this,arguments)}const YQ=DK??_a;class $Q extends M.Component{static getDerivedStateFromProps(e,t){if((e.state.routes===t.previousRoutes||(n=e.state.routes.map(e=>e.key),i=t.previousRoutes.map(e=>e.key),n.length===i.length&&n.every((e,t)=>e===i[t])))&&t.routes.length){let n=t.routes,i=t.previousRoutes,r=e.descriptors,a=t.previousDescriptors;if(e.descriptors!==t.previousDescriptors&&(r=t.routes.reduce((n,i)=>(n[i.key]=e.descriptors[i.key]||t.descriptors[i.key],n),{}),a=e.descriptors),e.state.routes!==t.previousRoutes){const r=e.state.routes.reduce((e,t)=>(e[t.key]=t,e),{});n=t.routes.map(e=>r[e.key]||e),i=e.state.routes}return{routes:n,previousRoutes:i,descriptors:r,previousDescriptors:a}}var n,i;let r=e.state.index<e.state.routes.length-1?e.state.routes.slice(0,e.state.index+1):e.state.routes,{openingRouteKeys:a,closingRouteKeys:o,replacingRouteKeys:s,previousRoutes:l}=t;const u=l[l.length-1],c=r[r.length-1],d=n=>{const i=e.descriptors[n]||t.descriptors[n];return!i||!1!==i.options.animationEnabled};var h;if(u&&u.key!==c.key?l.some(e=>e.key===c.key)?r.some(e=>e.key===u.key)||d(u.key)&&!o.includes(u.key)&&(o=[...o,u.key],a=a.filter(e=>e!==u.key),s=s.filter(e=>e!==u.key),r=[...r,u]):d(c.key)&&!a.includes(c.key)&&(a=[...a,c.key],o=o.filter(e=>e!==c.key),s=s.filter(e=>e!==c.key),r.some(e=>e.key===u.key)||(a=a.filter(e=>e!==u.key),"pop"===(h=c.key,(e.descriptors[h]||t.descriptors[h]).options.animationTypeForReplace??"push")?(o=[...o,u.key],a=a.filter(e=>e!==c.key),r=[...r,u]):(s=[...s,u.key],o=o.filter(e=>e!==u.key),r=r.slice(),r.splice(r.length-1,0,u)))):(s.length||o.length)&&(r=r.slice(),r.splice(r.length-1,0,...t.routes.filter(e=>{let{key:t}=e;return!!d(t)&&(s.includes(t)||o.includes(t))}))),!r.length)throw new Error("There should always be at least one route in the navigation state.");const m=r.reduce((n,i)=>(n[i.key]=e.descriptors[i.key]||t.descriptors[i.key],n),{});return{routes:r,previousRoutes:e.state.routes,previousDescriptors:e.descriptors,openingRouteKeys:a,closingRouteKeys:o,replacingRouteKeys:s,descriptors:m}}state={routes:[],previousRoutes:[],previousDescriptors:{},openingRouteKeys:[],closingRouteKeys:[],replacingRouteKeys:[],descriptors:{}};getPreviousRoute=e=>{let{route:t}=e;const{closingRouteKeys:n,replacingRouteKeys:i}=this.state,r=this.state.routes.filter(e=>e.key===t.key||!n.includes(e.key)&&!i.includes(e.key)),a=r.findIndex(e=>e.key===t.key);return r[a-1]};renderScene=e=>{let{route:t}=e;const n=this.state.descriptors[t.key]||this.props.descriptors[t.key];return n?n.render():null};renderHeader=e=>M.createElement(GK,e);handleOpenRoute=e=>{let{route:t}=e;const{state:n,navigation:i}=this.props,{closingRouteKeys:r,replacingRouteKeys:a}=this.state;r.some(e=>e===t.key)&&a.every(e=>e!==t.key)&&n.routeNames.includes(t.name)&&!n.routes.some(e=>e.key===t.key)?i.navigate(t):this.setState(e=>({routes:e.replacingRouteKeys.length?e.routes.filter(t=>!e.replacingRouteKeys.includes(t.key)):e.routes,openingRouteKeys:e.openingRouteKeys.filter(e=>e!==t.key),closingRouteKeys:e.closingRouteKeys.filter(e=>e!==t.key),replacingRouteKeys:[]}))};handleCloseRoute=e=>{let{route:t}=e;const{state:n,navigation:i}=this.props;n.routes.some(e=>e.key===t.key)?i.dispatch({...Am.pop(),source:t.key,target:n.key}):this.setState(e=>({routes:e.routes.filter(e=>e.key!==t.key),openingRouteKeys:e.openingRouteKeys.filter(e=>e!==t.key),closingRouteKeys:e.closingRouteKeys.filter(e=>e!==t.key)}))};handleTransitionStart=(e,t)=>{let{route:n}=e;return this.props.navigation.emit({type:"transitionStart",data:{closing:t},target:n.key})};handleTransitionEnd=(e,t)=>{let{route:n}=e;return this.props.navigation.emit({type:"transitionEnd",data:{closing:t},target:n.key})};handleGestureStart=e=>{let{route:t}=e;this.props.navigation.emit({type:"gestureStart",target:t.key})};handleGestureEnd=e=>{let{route:t}=e;this.props.navigation.emit({type:"gestureEnd",target:t.key})};handleGestureCancel=e=>{let{route:t}=e;this.props.navigation.emit({type:"gestureCancel",target:t.key})};render(){const{state:e,descriptors:t,...n}=this.props,{routes:i,descriptors:r,openingRouteKeys:a,closingRouteKeys:o}=this.state;return M.createElement(YQ,{style:XQ.container},M.createElement(TK,null,M.createElement(uH.Consumer,null,t=>M.createElement(PK.Consumer,null,s=>M.createElement(rK.Consumer,null,l=>M.createElement(UQ,WQ({insets:t,isParentHeaderShown:l,isParentModal:s,getPreviousRoute:this.getPreviousRoute,routes:i,openingRouteKeys:a,closingRouteKeys:o,onOpenRoute:this.handleOpenRoute,onCloseRoute:this.handleCloseRoute,onTransitionStart:this.handleTransitionStart,onTransitionEnd:this.handleTransitionEnd,renderHeader:this.renderHeader,renderScene:this.renderScene,state:e,descriptors:r,onGestureStart:this.handleGestureStart,onGestureEnd:this.handleGestureEnd,onGestureCancel:this.handleGestureCancel},n)))))))}}const XQ=Ei.create({container:{flex:1}});function qQ(){return qQ=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},qQ.apply(this,arguments)}const ZQ=tp(function(e){let{id:t,initialRouteName:n,children:i,screenListeners:r,screenOptions:a,...o}=e;const s=o.mode;WH(null!=s,`Stack Navigator: 'mode="${s}"' is deprecated. Use 'presentation: "${s}"' in 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/stack-navigator#presentation for more details.`);const l=o.headerMode;WH("none"===l,"Stack Navigator: 'headerMode=\"none\"' is deprecated. Use 'headerShown: false' in 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/stack-navigator/#headershown for more details."),WH(null!=l&&"none"!==l,"Stack Navigator: 'headerMode' is moved to 'options'. Moved it to 'screenOptions' to keep current behavior.\n\nSee https://reactnavigation.org/docs/stack-navigator/#headermode for more details.");const u=o.keyboardHandlingEnabled;WH(void 0!==u,"Stack Navigator: 'keyboardHandlingEnabled' is moved to 'options'. Moved it to 'screenOptions' to keep current behavior.\n\nSee https://reactnavigation.org/docs/stack-navigator/#keyboardhandlingenabled for more details.");const c={presentation:s,headerShown:!l||"none"!==l,headerMode:l&&"none"!==l?l:void 0,keyboardHandlingEnabled:u},{state:d,descriptors:h,navigation:m,NavigationContent:p}=cf(Lm,{id:t,initialRouteName:n,children:i,screenListeners:r,screenOptions:a,defaultScreenOptions:c});return M.useEffect(()=>{var e;return null===(e=m.addListener)||void 0===e?void 0:e.call(m,"tabPress",e=>{const t=m.isFocused();requestAnimationFrame(()=>{d.index>0&&t&&!e.defaultPrevented&&m.dispatch({...Am.popToTop(),target:d.key})})})},[m,d.index,d.key]),M.createElement(p,null,M.createElement($Q,qQ({},o,{state:d,descriptors:h,navigation:m})))});async function KQ(e){return e?e.startsWith("data:image/svg+xml;utf8")&&"android"===lr.OS?function(e){try{return decodeURIComponent(e).split(",").slice(1).join(",")}catch(t){throw new Error(`Decoding ${e} failed with error: ${t}`)}}(e):e.startsWith("data:image/svg+xml;base64")?QQ(e):async function(e){const t=await fetch(e);if(t.ok||0===t.status&&e.startsWith("file://"))return await t.text();throw new Error(`Fetching ${e} failed with status ${t.status}`)}(e):null}const QQ=e=>{const t=decodeURIComponent(e).split(";")[1].split(","),n=t[0],i=t.slice(1).join(",");return Wz.Buffer.from(i,n).toString("utf-8")};const JQ=e=>e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),eJ=e=>{if(e){if(1===e.nodeType&&"function"==typeof e.getBoundingClientRect)return e.getBoundingClientRect()}throw new Error("Can not get boundingClientRect of "+e||"undefined")};function tJ(){const e=this.state.touchable.responderID;null!==e&&((e,t)=>{const n=null==e?void 0:e.parentNode;n&&setTimeout(()=>{const i=eJ(n),{height:r,left:a,top:o,width:s}=eJ(e),l=a-i.left,u=o-i.top;t(l,u,s,r,a,o)},0)})(e,this._handleQueryLayout)}function nJ(e){return!!(e.onPress||e.onPressIn||e.onPressOut||e.onLongPress)}var iJ,rJ,aJ,oJ,sJ,lJ;function uJ(e,t){const n=[];if(t&&n.push(...cJ(t)),Array.isArray(e))if("number"==typeof e[0])n.push(`matrix(${e.join(" ")})`);else{const t=function(e){const t={};return null==e||e.forEach(e=>{const n=Object.keys(e);1!==n.length&&console.error("You must specify exactly one property per transform object.");const i=n[0],r=e[i];t[i]=r}),t}(e);n.push(...cJ(t))}else"string"==typeof e&&n.push(e);return n.length?n.join(" "):void 0}function cJ(e){const t=[];return null!=e.translate&&t.push(`translate(${e.translate})`),null==e.translateX&&null==e.translateY||t.push(`translate(${e.translateX||0}, ${e.translateY||0})`),null!=e.scale&&t.push(`scale(${e.scale})`),null==e.scaleX&&null==e.scaleY||t.push(`scale(${e.scaleX||1}, ${e.scaleY||1})`),null!=e.rotation&&t.push(`rotate(${e.rotation})`),null!=e.skewX&&t.push(`skewX(${e.skewX})`),null!=e.skewY&&t.push(`skewY(${e.skewY})`),t}!function(){if(rJ)return iJ;function e(t,n,i,r){this.message=t,this.expected=n,this.found=i,this.location=r,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}rJ=1,function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(e,Error),e.buildMessage=function(e,t){var n,i={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var t,n="";for(t=0;t<e.parts.length;t++)n+=e.parts[t]instanceof Array?o(e.parts[t][0])+"-"+o(e.parts[t][1]):o(e.parts[t]);return"["+(e.inverted?"^":"")+n+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function s(e){return i[e.type](e)}return"Expected "+function(e){var t,n,i=new Array(e.length);for(t=0;t<e.length;t++)i[t]=s(e[t]);if(i.sort(),i.length>0){for(t=1,n=1;t<i.length;t++)i[t-1]!==i[t]&&(i[n]=i[t],n++);i.length=n}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+(((n=t)?'"'+a(n)+'"':"end of input")+" found.")},iJ={SyntaxError:e,parse:function(t,n){n=void 0!==n?n:{};var i,r={},a={transformList:ue},o=ue,s=function(e){return e},l=function(e,t){return function(e,t){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=t[0],u=t[1],c=t[2],d=t[3],h=t[4],m=t[5],p=n*c+i*m+r,f=a*u+o*h;return[n*l+i*d,n*u+i*h,p,a*l+o*d,f,a*c+o*m+s]}(e,t)},u="matrix",c=re("matrix",!1),d="(",h=re("(",!1),m=")",p=re(")",!1),f=function(e,t,n,i,r,a){return[e,n,r,t,i,a]},_="translate",g=re("translate",!1),y=function(e,t){return[1,0,e,0,1,t||0]},v="scale",b=re("scale",!1),S=function(e,t){return[e,0,0,0,null===t?e:t,0]},w="rotate",k=re("rotate",!1),C=function(e,t){var n=Math.cos(Ce*e),i=Math.sin(Ce*e);if(null!==t){var r=t[0],a=t[1];return[n,-i,n*-r+-i*-a+r,i,n,i*-r+n*-a+a]}return[n,-i,0,i,n,0]},E="skewX",I=re("skewX",!1),x=function(e){return[1,Math.tan(Ce*e),0,0,1,0]},T="skewY",O=re("skewY",!1),R=function(e){return[1,0,0,Math.tan(Ce*e),1,0]},A=function(e){return parseFloat(e.join(""))},L=function(e){return parseInt(e.join(""))},P=function(e){return e},M=function(e,t){return[e,t]},D=",",N=re(",",!1),F=function(e){return e.join("")},B=function(e){return e.join("")},j=function(e){return e.join("")},V={type:"other",description:"fractionalConstant"},H=".",z=re(".",!1),U=function(e,t){return[e?e.join(""):null,".",t.join("")].join("")},G=/^[eE]/,W=ae(["e","E"],!1,!1),Y=function(e){return[e[0],e[1],e[2].join("")].join("")},$=/^[+\-]/,X=ae(["+","-"],!1,!1),q=/^[0-9]/,Z=ae([["0","9"]],!1,!1),K=/^[ \t\r\n]/,Q=ae([" ","\t","\r","\n"],!1,!1),J=0,ee=[{line:1,column:1}],te=0,ne=[],ie=0;if("startRule"in n){if(!(n.startRule in a))throw new Error("Can't start parsing from rule \""+n.startRule+'".');o=a[n.startRule]}function re(e,t){return{type:"literal",text:e,ignoreCase:t}}function ae(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function oe(e){var n,i=ee[e];if(i)return i;for(n=e-1;!ee[n];)n--;for(i={line:(i=ee[n]).line,column:i.column};n<e;)10===t.charCodeAt(n)?(i.line++,i.column=1):i.column++,n++;return ee[e]=i,i}function se(e,t){var n=oe(e),i=oe(t);return{start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:i.line,column:i.column}}}function le(e){J<te||(J>te&&(te=J,ne=[]),ne.push(e))}function ue(){var e,t,n,i,a;for(e=J,t=[],n=be();n!==r;)t.push(n),n=be();if(t!==r)if((n=ce())===r&&(n=null),n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();i!==r?e=t=s(n):(J=e,e=r)}else J=e,e=r;else J=e,e=r;return e}function ce(){var e,t,n,i;if(e=J,(t=de())!==r){for(n=[],i=pe();i!==r;)n.push(i),i=pe();n!==r&&(i=ce())!==r?e=t=l(t,i):(J=e,e=r)}else J=e,e=r;return e===r&&(e=de()),e}function de(){var e;return(e=function(){var e,n,i,a,o,s,l,_,g,y,v,b,S;e=J,t.substr(J,6)===u?(n=u,J+=6):(n=r,0===ie&&le(c));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r)if(pe()!==r)if((l=he())!==r)if(pe()!==r)if((_=he())!==r)if(pe()!==r)if((g=he())!==r)if(pe()!==r)if((y=he())!==r)if(pe()!==r)if((v=he())!==r){for(b=[],S=be();S!==r;)b.push(S),S=be();b!==r?(41===t.charCodeAt(J)?(S=m,J++):(S=r,0===ie&&le(p)),S!==r?e=n=f(s,l,_,g,y,v):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}())===r&&(e=function(){var e,n,i,a,o,s,l,u,c;e=J,t.substr(J,9)===_?(n=_,J+=9):(n=r,0===ie&&le(g));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r)if((l=me())===r&&(l=null),l!==r){for(u=[],c=be();c!==r;)u.push(c),c=be();u!==r?(41===t.charCodeAt(J)?(c=m,J++):(c=r,0===ie&&le(p)),c!==r?e=n=y(s,l):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}())===r&&(e=function(){var e,n,i,a,o,s,l,u,c;e=J,t.substr(J,5)===v?(n=v,J+=5):(n=r,0===ie&&le(b));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r)if((l=me())===r&&(l=null),l!==r){for(u=[],c=be();c!==r;)u.push(c),c=be();u!==r?(41===t.charCodeAt(J)?(c=m,J++):(c=r,0===ie&&le(p)),c!==r?e=n=S(s,l):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}())===r&&(e=function(){var e,n,i,a,o,s,l,u,c;e=J,t.substr(J,6)===w?(n=w,J+=6):(n=r,0===ie&&le(k));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r)if(l=function(){var e,t,n,i;e=J,t=pe(),t!==r&&(n=he())!==r&&pe()!==r&&(i=he())!==r?e=t=M(n,i):(J=e,e=r);return e}(),l===r&&(l=null),l!==r){for(u=[],c=be();c!==r;)u.push(c),c=be();u!==r?(41===t.charCodeAt(J)?(c=m,J++):(c=r,0===ie&&le(p)),c!==r?e=n=C(s,l):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}())===r&&(e=function(){var e,n,i,a,o,s,l,u;e=J,t.substr(J,5)===E?(n=E,J+=5):(n=r,0===ie&&le(I));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r){for(l=[],u=be();u!==r;)l.push(u),u=be();l!==r?(41===t.charCodeAt(J)?(u=m,J++):(u=r,0===ie&&le(p)),u!==r?e=n=x(s):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}())===r&&(e=function(){var e,n,i,a,o,s,l,u;e=J,t.substr(J,5)===T?(n=T,J+=5):(n=r,0===ie&&le(O));if(n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();if(i!==r)if(40===t.charCodeAt(J)?(a=d,J++):(a=r,0===ie&&le(h)),a!==r){for(o=[],s=be();s!==r;)o.push(s),s=be();if(o!==r)if((s=he())!==r){for(l=[],u=be();u!==r;)l.push(u),u=be();l!==r?(41===t.charCodeAt(J)?(u=m,J++):(u=r,0===ie&&le(p)),u!==r?e=n=R(s):(J=e,e=r)):(J=e,e=r)}else J=e,e=r;else J=e,e=r}else J=e,e=r;else J=e,e=r}else J=e,e=r;return e}()),e}function he(){var e,n,i,a;return e=J,n=J,(i=ge())===r&&(i=null),i!==r?(a=function(){var e,n,i,a;e=J,n=J,i=function(){var e,n,i,a;ie++,e=J,n=ye(),n===r&&(n=null);n!==r?(46===t.charCodeAt(J)?(i=H,J++):(i=r,0===ie&&le(z)),i!==r&&(a=ye())!==r?e=n=U(n,a):(J=e,e=r)):(J=e,e=r);e===r&&(e=J,(n=ye())!==r?(46===t.charCodeAt(J)?(i=H,J++):(i=r,0===ie&&le(z)),i!==r?e=n=j(n):(J=e,e=r)):(J=e,e=r));ie--,e===r&&(n=r,0===ie&&le(V));return e}(),i!==r?((a=_e())===r&&(a=null),a!==r?n=i=[i,a]:(J=n,n=r)):(J=n,n=r);n!==r&&(n=B(n));e=n,e===r&&(e=J,n=J,(i=ye())!==r&&(a=_e())!==r?n=i=[i,a]:(J=n,n=r),n!==r&&(n=j(n)),e=n);return e}(),a!==r?n=i=[i,a]:(J=n,n=r)):(J=n,n=r),n!==r&&(n=A(n)),(e=n)===r&&(e=J,n=J,(i=ge())===r&&(i=null),i!==r?(a=function(){var e,t;e=J,t=ye(),t!==r&&(t=F(t));return e=t,e}(),a!==r?n=i=[i,a]:(J=n,n=r)):(J=n,n=r),n!==r&&(n=L(n)),e=n),e}function me(){var e,t;return e=J,pe()!==r&&(t=he())!==r?e=P(t):(J=e,e=r),e}function pe(){var e,t,n,i,a;if(e=J,t=[],(n=be())!==r)for(;n!==r;)t.push(n),n=be();else t=r;if(t!==r)if((n=fe())===r&&(n=null),n!==r){for(i=[],a=be();a!==r;)i.push(a),a=be();i!==r?e=t=[t,n,i]:(J=e,e=r)}else J=e,e=r;else J=e,e=r;if(e===r)if(e=J,(t=fe())!==r){for(n=[],i=be();i!==r;)n.push(i),i=be();n!==r?e=t=[t,n]:(J=e,e=r)}else J=e,e=r;return e}function fe(){var e;return 44===t.charCodeAt(J)?(e=D,J++):(e=r,0===ie&&le(N)),e}function _e(){var e,n,i,a;return e=J,G.test(t.charAt(J))?(n=t.charAt(J),J++):(n=r,0===ie&&le(W)),n!==r?((i=ge())===r&&(i=null),i!==r&&(a=ye())!==r?e=n=[n,i,a]:(J=e,e=r)):(J=e,e=r),e!==r&&(e=Y(e)),e}function ge(){var e;return $.test(t.charAt(J))?(e=t.charAt(J),J++):(e=r,0===ie&&le(X)),e}function ye(){var e,t;if(e=[],(t=ve())!==r)for(;t!==r;)e.push(t),t=ve();else e=r;return e}function ve(){var e;return q.test(t.charAt(J))?(e=t.charAt(J),J++):(e=r,0===ie&&le(Z)),e}function be(){var e;return K.test(t.charAt(J))?(e=t.charAt(J),J++):(e=r,0===ie&&le(Q)),e}var Se,we,ke,Ce=Math.PI/180;if((i=o())!==r&&J===t.length)return i;throw i!==r&&J<t.length&&le({type:"end"}),Se=ne,we=te<t.length?t.charAt(te):null,ke=te<t.length?se(te,te+1):se(te,te),new e(e.buildMessage(Se,we),Se,we,ke)}}}(),function(){if(oJ)return aJ;function e(t,n,i,r){var a=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(a,e.prototype),a.expected=n,a.found=i,a.location=r,a.name="SyntaxError",a}function t(e,t,n){return n=n||" ",e.length>t?e:(t-=e.length,e+(n+=n.repeat(t)).slice(0,t))}oJ=1,function(e,t){function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n}(e,Error),e.prototype.format=function(e){var n="Error: "+this.message;if(this.location){var i,r=null;for(i=0;i<e.length;i++)if(e[i].source===this.location.source){r=e[i].text.split(/\r\n|\n|\r/g);break}var a=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(a):a,s=this.location.source+":"+o.line+":"+o.column;if(r){var l=this.location.end,u=t("",o.line.toString().length," "),c=r[a.line-1],d=(a.line===l.line?l.column:c.length+1)-a.column||1;n+="\n --\x3e "+s+"\n"+u+" |\n"+o.line+" | "+c+"\n"+u+" | "+t("",a.column-1," ")+t("",d,"^")}else n+="\n at "+s}return n},e.buildMessage=function(e,t){var n,i={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var t=e.parts.map(function(e){return Array.isArray(e)?o(e[0])+"-"+o(e[1]):o(e)});return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function r(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+r(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+r(e)})}function s(e){return i[e.type](e)}return"Expected "+function(e){var t,n,i=e.map(s);if(i.sort(),i.length>0){for(t=1,n=1;t<i.length;t++)i[t-1]!==i[t]&&(i[n]=i[t],n++);i.length=n}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(e)+" but "+(((n=t)?'"'+a(n)+'"':"end of input")+" found.")},aJ={StartRules:["start"],SyntaxError:e,parse:function(t,n){var i,r,a,o,s={},l=(n=void 0!==n?n:{}).grammarSource,u={start:_e},c=_e,d="matrix(",h=")",m="translate(",p="scale(",f="rotate(",_="skewX(",g="skewY(",y=".",v="e",b=/^[ \t\n\r,]/,S=/^[ \t\n\r]/,w=/^[+\-]/,k=/^[0-9]/,C=he("transform functions"),E=he("transformFunctions"),I=he("transform function"),x=he("matrix"),T=ce("matrix(",!1),O=ce(")",!1),R=he("translate"),A=ce("translate(",!1),L=he("scale"),P=ce("scale(",!1),M=he("rotate"),D=ce("rotate(",!1),N=he("x, y"),F=he("skewX"),B=ce("skewX(",!1),j=he("skewY"),V=ce("skewY(",!1),H=he("space or comma"),z=de([" ","\t","\n","\r",","],!1,!1),U=he("whitespace"),G=de([" ","\t","\n","\r"],!1,!1),W=de(["+","-"],!1,!1),Y=de([["0","9"]],!1,!1),$=ce(".",!1),X=ce("e",!1),q=function(e,t){const n=Array.isArray(e)?e:[e];return t.forEach(e=>{Array.isArray(e[1])?n.push(...e[1]):n.push(e[1])}),n},Z=function(e,t,n,i,r,a,o,s,l){return{matrix:[e,t,n,i,r,a,o,s,l]}},K=function(e,t){return null==t?{translate:e}:{translate:[e,t]}},Q=function(e,t){return null==t?{scale:e}:[{scaleX:e},{scaleY:t}]},J=function(e,t){return null!==t?{rotate:`${e}deg`}:[{rotate:`${e}deg`}]},ee=function(e,t){return[e,t]},te=function(e){return[{skewX:`${e}deg`}]},ne=function(e){return[{skewY:`${e}deg`}]},ie=function(){return parseFloat(t.substring(ae,re))},re=0|n.peg$currPos,ae=re,oe=[{line:1,column:1}],se=re,le=n.peg$maxFailExpected||[],ue=0|n.peg$silentFails;if(n.startRule){if(!(n.startRule in u))throw new Error("Can't start parsing from rule \""+n.startRule+'".');c=u[n.startRule]}function ce(e,t){return{type:"literal",text:e,ignoreCase:t}}function de(e,t,n){return{type:"class",parts:e,inverted:t,ignoreCase:n}}function he(e){return{type:"other",description:e}}function me(e){var n,i=oe[e];if(i)return i;if(e>=oe.length)n=oe.length-1;else for(n=e;!oe[--n];);for(i={line:(i=oe[n]).line,column:i.column};n<e;)10===t.charCodeAt(n)?(i.line++,i.column=1):i.column++,n++;return oe[e]=i,i}function pe(e,t,n){var i=me(e),r=me(t);return{source:l,start:{offset:e,line:i.line,column:i.column},end:{offset:t,line:r.line,column:r.column}}}function fe(e){re<se||(re>se&&(se=re,le=[]),le.push(e))}function _e(){var e;return ue++,e=function(){var e,t,n,i,r,a;if(ue++,e=re,(t=ge())!==s){for(n=[],i=re,r=ve(),(a=ge())!==s?i=r=[r,a]:(re=i,i=s);i!==s;)n.push(i),i=re,r=ve(),(a=ge())!==s?i=r=[r,a]:(re=i,i=s);ae=e,e=q(t,n)}else re=e,e=s;ue--,e===s&&(t=s,0===ue&&fe(E));return e}(),ue--,e===s&&0===ue&&fe(C),e}function ge(){var e;return ue++,(e=function(){var e,n,i,r,a,o,l,u,c,m,p,f;ue++,e=re,ve(),t.substr(re,7)===d?(n=d,re+=7):(n=s,0===ue&&fe(T));n!==s?(ve(),(i=be())!==s?(ye(),(r=be())!==s?(ye(),(a=be())!==s?(ye(),(o=be())!==s?(ye(),(l=be())!==s?(ye(),(u=be())!==s?(ye(),(c=be())!==s?(ye(),(m=be())!==s?(ye(),(p=be())!==s?(ve(),41===t.charCodeAt(re)?(f=h,re++):(f=s,0===ue&&fe(O)),f!==s?(ve(),ae=e,e=Z(i,r,a,o,l,u,c,m,p)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(x);return e}())===s&&(e=function(){var e,n,i,r,a;ue++,e=re,ve(),t.substr(re,10)===m?(n=m,re+=10):(n=s,0===ue&&fe(A));n!==s?(ve(),(i=be())!==s?(ye(),(r=be())===s&&(r=null),ve(),41===t.charCodeAt(re)?(a=h,re++):(a=s,0===ue&&fe(O)),a!==s?(ve(),ae=e,e=K(i,r)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(R);return e}())===s&&(e=function(){var e,n,i,r,a;ue++,e=re,ve(),t.substr(re,6)===p?(n=p,re+=6):(n=s,0===ue&&fe(P));n!==s?(ve(),(i=be())!==s?(ye(),(r=be())===s&&(r=null),ve(),41===t.charCodeAt(re)?(a=h,re++):(a=s,0===ue&&fe(O)),a!==s?(ve(),ae=e,e=Q(i,r)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(L);return e}())===s&&(e=function(){var e,n,i,r,a;ue++,e=re,ve(),t.substr(re,7)===f?(n=f,re+=7):(n=s,0===ue&&fe(D));n!==s?(ve(),(i=be())!==s?(r=function(){var e,t,n;ue++,e=re,ye(),t=be(),t!==s?(ye(),(n=be())!==s?(ae=e,e=ee(t,n)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(N);return e}(),r===s&&(r=null),ve(),41===t.charCodeAt(re)?(a=h,re++):(a=s,0===ue&&fe(O)),a!==s?(ve(),ae=e,e=J(i,r)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(M);return e}())===s&&(e=function(){var e,n,i,r;ue++,e=re,ve(),t.substr(re,6)===_?(n=_,re+=6):(n=s,0===ue&&fe(B));n!==s?(ve(),(i=be())!==s?(ve(),41===t.charCodeAt(re)?(r=h,re++):(r=s,0===ue&&fe(O)),r!==s?(ve(),ae=e,e=te(i)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(F);return e}())===s&&(e=function(){var e,n,i,r;ue++,e=re,ve(),t.substr(re,6)===g?(n=g,re+=6):(n=s,0===ue&&fe(V));n!==s?(ve(),(i=be())!==s?(ve(),41===t.charCodeAt(re)?(r=h,re++):(r=s,0===ue&&fe(O)),r!==s?(ve(),ae=e,e=ne(i)):(re=e,e=s)):(re=e,e=s)):(re=e,e=s);ue--,e===s&&0===ue&&fe(j);return e}()),ue--,e===s&&0===ue&&fe(I),e}function ye(){var e,n;for(ue++,e=[],n=t.charAt(re),b.test(n)?re++:(n=s,0===ue&&fe(z));n!==s;)e.push(n),n=t.charAt(re),b.test(n)?re++:(n=s,0===ue&&fe(z));return ue--,n=s,0===ue&&fe(H),e}function ve(){var e,n;for(ue++,e=[],n=t.charAt(re),S.test(n)?re++:(n=s,0===ue&&fe(G));n!==s;)e.push(n),n=t.charAt(re),S.test(n)?re++:(n=s,0===ue&&fe(G));return ue--,n=s,0===ue&&fe(U),e}function be(){var e,n,i,r,a,o,l,u;for(e=re,n=t.charAt(re),w.test(n)?re++:(n=s,0===ue&&fe(W)),n===s&&(n=null),i=re,r=[],a=t.charAt(re),k.test(a)?re++:(a=s,0===ue&&fe(Y));a!==s;)r.push(a),a=t.charAt(re),k.test(a)?re++:(a=s,0===ue&&fe(Y));if(46===t.charCodeAt(re)?(a=y,re++):(a=s,0===ue&&fe($)),a!==s){if(o=[],l=t.charAt(re),k.test(l)?re++:(l=s,0===ue&&fe(Y)),l!==s)for(;l!==s;)o.push(l),l=t.charAt(re),k.test(l)?re++:(l=s,0===ue&&fe(Y));else o=s;o!==s?i=r=[r,a,o]:(re=i,i=s)}else re=i,i=s;if(i===s)if(i=[],r=t.charAt(re),k.test(r)?re++:(r=s,0===ue&&fe(Y)),r!==s)for(;r!==s;)i.push(r),r=t.charAt(re),k.test(r)?re++:(r=s,0===ue&&fe(Y));else i=s;if(i!==s){if(r=re,101===t.charCodeAt(re)?(a=v,re++):(a=s,0===ue&&fe(X)),a!==s){if(o=t.charAt(re),w.test(o)?re++:(o=s,0===ue&&fe(W)),o===s&&(o=null),l=[],u=t.charAt(re),k.test(u)?re++:(u=s,0===ue&&fe(Y)),u!==s)for(;u!==s;)l.push(u),u=t.charAt(re),k.test(u)?re++:(u=s,0===ue&&fe(Y));else l=s;l!==s?r=a=[a,o,l]:(re=r,r=s)}else re=r,r=s;r===s&&(r=null),ae=e,e=ie()}else re=e,e=s;return e}if(i=c(),n.peg$library)return{peg$result:i,peg$currPos:re,peg$FAILED:s,peg$maxFailExpected:le,peg$maxFailPos:se};if(i!==s&&re===t.length)return i;throw i!==s&&re<t.length&&fe({type:"end"}),r=le,a=se<t.length?t.charAt(se):null,o=se<t.length?pe(se,se+1):pe(se,se),new e(e.buildMessage(r,a),r,a,o)}}}();var dJ=function(){if(lJ)return sJ;lJ=1;const e=[];return sJ={registerAsset:function(t){return e.push(t)},getAssetByID:function(t){return e[t-1]}}}();const hJ=/^(data:image\/svg\+xml;utf8,)(.*)/;const mJ=(e,t=e.props)=>{const{transform:n,origin:i,originX:r,originY:a,fontFamily:o,fontSize:s,fontWeight:l,fontStyle:u,style:c,forwardedRef:d,gradientTransform:h,patternTransform:m,onPress:p,...f}=t,_={...nJ(t)?{onStartShouldSetResponder:e.touchableHandleStartShouldSetResponder,onResponderTerminationRequest:e.touchableHandleResponderTerminationRequest,onResponderGrant:e.touchableHandleResponderGrant,onResponderMove:e.touchableHandleResponderMove,onResponderRelease:e.touchableHandleResponderRelease,onResponderTerminate:e.touchableHandleResponderTerminate}:null,...f};null!=i?_["transform-origin"]=i.toString().replace(","," "):null==r&&null==a||(_["transform-origin"]=`${r||0} ${a||0}`);const g=uJ(n,t);g&&(_.transform=g);const y=uJ(h);y&&(_.gradientTransform=y);const v=uJ(m);v&&(_.patternTransform=v),_.ref=t=>{e.elementRef.current=t,"function"==typeof d?d(t):d&&(d.current=t)};const b={};var S,w,k;(null!=o&&(b.fontFamily=o),null!=s&&(b.fontSize=s),null!=l&&(b.fontWeight=l),null!=u&&(b.fontStyle=u),_.style=(w=b,(S=c)?Ei?[S,w]:S[Symbol.iterator]?Object.assign({},...S,w):Object.assign({},S,w):w),null!==p&&(_.onClick=t.onPress),null!==t.href&&void 0!==t.href)&&(_.href=null===(k=function(e){let t={};if("number"==typeof e){const n=dJ.getAssetByID(e);if(null==n)throw new Error(`Image: asset with ID "${e}" could not be found. Please check the image source or packager.`);if(t={width:n.width,height:n.height,scale:n.scales[0]},n.scales.length>1){const e=Ws.get();t.scale=n.scales.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t)}const i=1!==t.scale?`@${t.scale}x`:"";t.uri=n?`${n.httpServerLocation}/${n.name}${i}.${n.type}`:""}else"string"==typeof e?t.uri=e:e&&!Array.isArray(e)&&"string"==typeof e.uri&&(t.uri=e.uri);if(t.uri){var n;const e=null===(n=t)||void 0===n||null===(n=n.uri)||void 0===n?void 0:n.match(hJ);if(e){const[,n,i]=e,r=encodeURIComponent(i);return t.uri=`${n}${r}`,t}}return t}(t.href))||void 0===k?void 0:k.uri);return _};function pJ(e){return`rgba(${e>>16&255},${e>>8&255},${255&e},${((e>>24&255)/255).toFixed(2)})`}const fJ={top:20,left:20,right:20,bottom:30},{Mixin:_J}=im,{touchableHandleStartShouldSetResponder:gJ,touchableHandleResponderTerminationRequest:yJ,touchableHandleResponderGrant:vJ,touchableHandleResponderMove:bJ,touchableHandleResponderRelease:SJ,touchableHandleResponderTerminate:wJ,touchableGetInitialState:kJ}=_J,CJ={..._J,touchableHandleStartShouldSetResponder(e){const{onStartShouldSetResponder:t}=this.props;return t?t(e):gJ.call(this,e)},touchableHandleResponderTerminationRequest(e){const{onResponderTerminationRequest:t}=this.props;return t?t(e):yJ.call(this,e)},touchableHandleResponderGrant(e){const{onResponderGrant:t}=this.props;return t?t(e):vJ.call(this,e)},touchableHandleResponderMove(e){const{onResponderMove:t}=this.props;return t?t(e):bJ.call(this,e)},touchableHandleResponderRelease(e){const{onResponderRelease:t}=this.props;return t?t(e):SJ.call(this,e)},touchableHandleResponderTerminate(e){const{onResponderTerminate:t}=this.props;return t?t(e):wJ.call(this,e)},touchableHandlePress(e){const{onPress:t}=this.props;t&&t(e)},touchableHandleActivePressIn(e){const{onPressIn:t}=this.props;t&&t(e)},touchableHandleActivePressOut(e){const{onPressOut:t}=this.props;t&&t(e)},touchableHandleLongPress(e){const{onLongPress:t}=this.props;t&&t(e)},touchableGetPressRectOffset(){const{pressRetentionOffset:e}=this.props;return e||fJ},touchableGetHitSlop(){const{hitSlop:e}=this.props;return e},touchableGetHighlightDelayMS(){const{delayPressIn:e}=this.props;return e||0},touchableGetLongPressDelayMS(){const{delayLongPress:e}=this.props;return 0===e?0:e||500},touchableGetPressOutDelayMS(){const{delayPressOut:e}=this.props;return e||0}},EJ=Object.keys(CJ),IJ=EJ.map(e=>CJ[e]),xJ=EJ.length;class TJ extends D.Component{prepareProps(e){return e}elementRef=D.createRef();lastMergedProps={};setNativeProps(e){const t=Object.assign({},this.props,this.lastMergedProps,e.style);this.lastMergedProps=t;const n=mJ(this,this.prepareProps(t)),i=this.elementRef.current;if(i)for(const r of Object.keys(n)){const e=n[r];switch(r){case"ref":case"children":break;case"style":for(const e of[].concat(n.style??[]))Object.assign(i.style,e);break;case"fill":if(e&&"object"==typeof e){const t=e;i.setAttribute("fill",pJ(t.payload))}break;case"stroke":if(e&&"object"==typeof e){const t=e;i.setAttribute("stroke",pJ(t.payload))}break;default:i.setAttribute(JQ(r),e)}}}constructor(e){super(e),nJ(e)&&(e=>{for(let t=0;t<xJ;t++){const n=EJ[t],i=IJ[t];e[n]="function"==typeof i?i.bind(e):i}e.state=kJ()})(this),this._remeasureMetricsOnActivation=tJ.bind(this)}render(){if(!this.tag)throw new Error("When extending `WebShape` you need to overwrite either `tag` or `render`!");return this.lastMergedProps={},Ui(this.tag,mJ(this,this.prepareProps(this.props)))}}class OJ extends TJ{tag="circle"}class RJ extends TJ{tag="clipPath"}class AJ extends TJ{tag="defs"}class LJ extends TJ{tag="ellipse"}class PJ extends TJ{tag="feBlend"}class MJ extends TJ{tag="feColorMatrix"}class DJ extends TJ{tag="feComponentTransfer"}class NJ extends TJ{tag="feComposite"}class FJ extends TJ{tag="feConvolveMatrix"}class BJ extends TJ{tag="feDiffuseLighting"}class jJ extends TJ{tag="feDisplacementMap"}class VJ extends TJ{tag="feDistantLight"}class HJ extends TJ{tag="feDropShadow"}class zJ extends TJ{tag="feFlood"}class UJ extends TJ{tag="feGaussianBlur"}class GJ extends TJ{tag="feImage"}class WJ extends TJ{tag="feMerge"}class YJ extends TJ{tag="feMergeNode"}class $J extends TJ{tag="feMorphology"}class XJ extends TJ{tag="feOffset"}class qJ extends TJ{tag="fePointLight"}class ZJ extends TJ{tag="feSpecularLighting"}class KJ extends TJ{tag="feSpotLight"}class QJ extends TJ{tag="feTile"}class JJ extends TJ{tag="feTurbulence"}class e1 extends TJ{tag="filter"}class t1 extends TJ{tag="foreignObject"}class n1 extends TJ{tag="g";prepareProps(e){const{x:t,y:n,...i}=e;return!t&&!n||i.translate||(i.translate=`${t||0}, ${n||0}`),i}}class i1 extends TJ{tag="image"}class r1 extends TJ{tag="line"}class a1 extends TJ{tag="linearGradient"}class o1 extends TJ{tag="marker"}class s1 extends TJ{tag="mask"}class l1 extends TJ{tag="path"}class u1 extends TJ{tag="pattern"}class c1 extends TJ{tag="polygon"}class d1 extends TJ{tag="polyline"}class h1 extends TJ{tag="radialGradient"}class m1 extends TJ{tag="rect"}class p1 extends TJ{tag="stop"}class f1 extends TJ{tag="svg";toDataURL(e,t={}){const n=this.elementRef.current;if(null===n)return;const i=eJ(n),r=Number(t.width)||i.width,a=Number(t.height)||i.height,o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("viewBox",`0 0 ${i.width} ${i.height}`),o.setAttribute("width",String(r)),o.setAttribute("height",String(a)),o.appendChild(n.cloneNode(!0));const s=new window.Image;var l;s.onload=()=>{const t=document.createElement("canvas");t.width=r,t.height=a;const n=t.getContext("2d");null==n||n.drawImage(s,0,0),e(t.toDataURL().replace("data:image/png;base64,",""))},s.src=`data:image/svg+xml;utf8,${l=(new window.XMLSerializer).serializeToString(o),l.replace("<svg",~l.indexOf("xmlns")?"<svg":'<svg xmlns="http://www.w3.org/2000/svg"').replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/{/g,"%7B").replace(/}/g,"%7D").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}`}}let _1=class extends TJ{tag="symbol"};class g1 extends TJ{tag="tspan"}let y1=class extends TJ{tag="text"};class v1 extends TJ{tag="textPath"}class b1 extends TJ{tag="use"}const S1={circle:OJ,clipPath:RJ,defs:AJ,ellipse:LJ,filter:e1,feBlend:PJ,feColorMatrix:MJ,feComponentTransfer:DJ,feComposite:NJ,feConvolveMatrix:FJ,feDiffuseLighting:BJ,feDisplacementMap:jJ,feDistantLight:VJ,feDropShadow:HJ,feFlood:zJ,feGaussianBlur:UJ,feImage:GJ,feMerge:WJ,feMergeNode:YJ,feMorphology:$J,feOffset:XJ,fePointLight:qJ,feSpecularLighting:ZJ,feSpotLight:KJ,feTile:QJ,feTurbulence:JJ,foreignObject:t1,g:n1,image:i1,line:r1,linearGradient:a1,marker:o1,mask:s1,path:l1,pattern:u1,polygon:c1,polyline:d1,radialGradient:h1,rect:m1,stop:p1,svg:f1,symbol:_1,text:y1,textPath:v1,tspan:g1,use:b1};function w1(){return w1=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},w1.apply(null,arguments)}function k1(){return null}function C1({ast:e,override:t}){if(!e)return null;const{props:n,children:i}=e,r=S1.svg;return M.createElement(r,w1({},n,t),i)}const E1=console.error.bind(console);function I1(e){const{onError:t=E1,xml:n,override:i,fallback:r}=e;try{const t=M.useMemo(()=>null!==n?B1(n):null,[n]);return M.createElement(C1,{ast:t,override:i||e})}catch(a){return t(a),r??null}}class x1 extends M.Component{state={ast:null};componentDidMount(){this.parse(this.props.xml)}componentDidUpdate(e){const{xml:t}=this.props;t!==e.xml&&this.parse(t)}parse(t){const{onError:n=E1}=this.props;try{this.setState({ast:t?B1(t):null})}catch(e){const i=e;n({...i,message:`[RNSVG] Couldn't parse SVG, reason: ${i.message}`})}}render(){const{props:e,state:{ast:t}}=this;return M.createElement(C1,{ast:t,override:e.override||e})}}class T1 extends M.Component{state={xml:null};componentDidMount(){this.fetch(this.props.uri)}componentDidUpdate(e){const{uri:t}=this.props;t!==e.uri&&this.fetch(t)}async fetch(t){try{this.setState({xml:t?await KQ(t):null})}catch(e){console.error(e)}}render(){const{props:e,state:{xml:t}}=this;return M.createElement(x1,{xml:t,override:e,onError:e.onError})}}const O1=(e,t)=>t.toUpperCase(),R1=e=>e.replace(/[:-]([a-z])/g,O1);function A1(e,t){if("object"==typeof e){const{Tag:n,props:i,children:r}=e;return null!=i&&i.class&&(i.className=i.class,delete i.class),M.createElement(n,w1({key:t},i),r.map(A1))}return e}function L1(e,t){let n="";for(;t--;)n+=e;return n}const P1=e=>L1(" ",e.length);const M1=/[a-zA-Z0-9:_-]/,D1=/<!--/,N1=/[\s\t\r\n]/,F1=/['"]/;function B1(e,t){const n=e.length;let i,r=null,a=function(){for(;g+1<n&&("<"!==e[g]||!M1.test(e[g+1])&&!D1.test(e.slice(g,g+4)));)g++;return u()},o=null;const s=[];function l(t){const{line:n,column:i,snippet:r}=function(e,t){const n=e.split("\n"),i=n.length;let r=t,a=0;for(;a<i;a++){const{length:e}=n[a];if(!(r>=e))break;r-=e}const o=e.slice(0,t).replace(/^\t+/,P1),s=/(^|\n).*$/.exec(o),l=s&&s[0]||"",u=e.slice(t),c=/.*(\n|$)/.exec(u);return{line:a,column:r,snippet:`${l}${c&&c[0]}\n${L1(" ",l.length)}^`}}(e,g);throw new Error(`${t} (${n}:${i}). If this is valid SVG, it's probably a bug. Please raise an issue\n\n${r}`)}function u(){let t,i="";for(;g<n&&"<"!==(t=e[g]);)i+=t,g+=1;return/\S/.test(i)&&o.push(i),"<"===e[g]?c:u}function c(){const t=e[g];if("?"===t)return u;if("!"===t){const t=g+1;if("--"===e.slice(t,g+3))return d;const n=g+8;if("[CDATA["===e.slice(t,n))return h;if(/doctype/i.test(e.slice(t,n)))return u}if("/"===t)return m;const a=p(),c={},y={tag:a,props:c,children:[],parent:r,Tag:S1[a]||k1};r?o.push(y):i=y,function(t){for(;g<n;){if(!N1.test(e[g]))return;_();const n=p();if(!n)return;let i=!0;_(),"="===e[g]&&(g+=1,_(),i=f(),"id"===n||isNaN(+i)||""===i.trim()||(i=+i)),t[R1(n)]=i}}(c);const{style:v}=c;"string"==typeof v&&(y.styles=v,c.style=function(e){const t={},n=e.split(";").filter(e=>e.trim()),{length:i}=n;for(let r=0;r<i;r++){const e=n[r];if(0!==e.length){const n=e.split(":"),i=n[0],r=n[1];t[R1(i.trim())]=r.trim()}}return t}(v));let b=!1;return"/"===e[g]&&(g+=1,b=!0),">"!==e[g]&&l("Expected >"),b||(r=y,({children:o}=y),s.push(y)),u}function d(){const t=e.indexOf("--\x3e",g);return~t||l("expected --\x3e"),g=t+2,u}function h(){const t=e.indexOf("]]>",g);return~t||l("expected ]]>"),o.push(e.slice(g+7,t)),g=t+2,u}function m(){const t=p();return t||l("Expected tag name"),r&&t!==r.tag&&l(`Expected closing tag </${t}> to match opening tag <${r.tag}>`),_(),">"!==e[g]&&l("Expected >"),s.pop(),r=s[s.length-1],r&&({children:o}=r),u}function p(){let t,i="";for(;g<n&&M1.test(t=e[g]);)i+=t,g+=1;return i}function f(){return F1.test(e[g])?function(){const t=e[g++];let i="",r=!1;for(;g<n;){const n=e[g++];if(n===t&&!r)return i;"\\"!==n||r||(r=!0),i+=r?`\\${n}`:n,r=!1}return i}():function(){let t="";do{const n=e[g];if(" "===n||">"===n||"/"===n)return t;t+=n,g+=1}while(g<n);return t}()}function _(){for(;g<n&&N1.test(e[g]);)g+=1}let g=0;for(;g<n;)a||l("Unexpected character"),a=a(),g+=1;if(a!==u&&l("Unexpected end of input"),i){const e=(t?t(i):i)||i,n=e.children.map(A1),r=e;return r.children=n,r}return null}function j1(e,t){throw Error(`[react-native-svg] You are trying to import a ${t} \`${e}\` that has been moved to a sub-package. Change your import from \`react-native-svg\` to \`react-native-svg/css\`.`)}const V1=Object.freeze(Object.defineProperty({__proto__:null,Circle:OJ,ClipPath:RJ,Defs:AJ,Ellipse:LJ,FeBlend:PJ,FeColorMatrix:MJ,FeComponentTransfer:DJ,FeComposite:NJ,FeConvolveMatrix:FJ,FeDiffuseLighting:BJ,FeDisplacementMap:jJ,FeDistantLight:VJ,FeDropShadow:HJ,FeFlood:zJ,FeFuncA:class extends TJ{tag="feFuncA"},FeFuncB:class extends TJ{tag="feFuncB"},FeFuncG:class extends TJ{tag="feFuncG"},FeFuncR:class extends TJ{tag="feFuncR"},FeGaussianBlur:UJ,FeImage:GJ,FeMerge:WJ,FeMergeNode:YJ,FeMorphology:$J,FeOffset:XJ,FePointLight:qJ,FeSpecularLighting:ZJ,FeSpotLight:KJ,FeTile:QJ,FeTurbulence:JJ,Filter:e1,ForeignObject:t1,G:n1,Image:i1,Line:r1,LinearGradient:a1,LocalSvg:function(){j1("LocalSvg","component")},Marker:o1,Mask:s1,Path:l1,Pattern:u1,Polygon:c1,Polyline:d1,RadialGradient:h1,Rect:m1,Stop:p1,Svg:f1,SvgAst:C1,SvgCss:function(){j1("SvgCss","component")},SvgCssUri:function(){j1("SvgCssUri","component")},SvgFromUri:T1,SvgFromXml:x1,SvgUri:function(e){const{onError:t=E1,uri:n,onLoad:i,fallback:r}=e,[a,o]=M.useState(null),[s,l]=M.useState(!1);return M.useEffect(()=>{n?KQ(n).then(e=>{o(e),s&&l(!1),null==i||i()}).catch(e=>{t(e),l(!0)}):o(null)},[t,n,i]),s?r??null:M.createElement(I1,{xml:a,override:e,fallback:r})},SvgWithCss:function(){j1("SvgWithCss","component")},SvgWithCssUri:function(){j1("SvgWithCssUri","component")},SvgXml:I1,Symbol:_1,TSpan:g1,Text:y1,TextPath:v1,Use:b1,WithLocalSvg:function(){j1("WithLocalSvg","component")},camelCase:R1,default:f1,fetchText:KQ,inlineStyles:function(){j1("inlineStyles","function")},loadLocalRawResource:function(){j1("loadLocalRawResource","function")},parse:B1},Symbol.toStringTag,{value:"Module"})),H1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:28,height:28,viewBox:"0 0 28 28",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M14.7447 9.05001C15.2398 9.38089 15.822 9.55749 16.4176 9.55749C17.2159 9.55657 17.9813 9.23902 18.5457 8.67452C19.1103 8.11002 19.4278 7.34465 19.4288 6.54632C19.4288 5.95077 19.2521 5.3686 18.9213 4.8734C18.5904 4.37822 18.1201 3.99228 17.5699 3.76437C17.0197 3.53646 16.4142 3.47683 15.8301 3.59301C15.246 3.7092 14.7095 3.99599 14.2883 4.41711C13.8673 4.83823 13.5805 5.37477 13.4643 5.95887C13.3481 6.54299 13.4077 7.14843 13.6356 7.69865C13.8635 8.24886 14.2495 8.71915 14.7447 9.05001ZM15.7169 5.4977C15.9243 5.35912 16.1682 5.28516 16.4176 5.28516C16.752 5.28547 17.0726 5.41843 17.309 5.65488C17.5454 5.89133 17.6784 6.21193 17.6788 6.54632C17.6788 6.79576 17.6048 7.03959 17.4662 7.24699C17.3276 7.45439 17.1307 7.61604 16.9002 7.7115C16.6697 7.80694 16.4162 7.83192 16.1715 7.78326C15.9269 7.7346 15.7022 7.61448 15.5258 7.4381C15.3494 7.26172 15.2293 7.03701 15.1806 6.79236C15.1319 6.54772 15.1569 6.29415 15.2524 6.06369C15.3479 5.83324 15.5095 5.63628 15.7169 5.4977ZM13.2683 22.7677C13.3935 22.8332 13.5327 22.8674 13.674 22.8674C13.8507 22.8669 14.023 22.8129 14.1685 22.7126C14.3139 22.6121 14.4254 22.47 14.4883 22.3051L15.5021 19.6031C15.8009 18.8176 15.78 17.9462 15.444 17.1758C15.1079 16.4056 14.4834 15.7976 13.7043 15.4824L12.925 15.1616C12.7078 15.073 12.5149 14.9342 12.362 14.7564C12.2091 14.5786 12.1007 14.367 12.0459 14.139C11.9909 13.911 11.9909 13.6733 12.0461 13.4453C12.1012 13.2174 12.2097 13.0059 12.3626 12.8282C12.6165 12.5344 12.9754 12.3518 13.3622 12.3195C13.7492 12.2872 14.1334 12.4078 14.4323 12.6556L15.6258 13.6507C16.206 14.1328 16.9365 14.3969 17.6908 14.3974H21.0741C21.3063 14.3974 21.5288 14.3051 21.6929 14.1411C21.857 13.9769 21.9491 13.7545 21.9491 13.5224C21.9491 13.2902 21.857 13.0678 21.6929 12.9036C21.5288 12.7396 21.3063 12.6474 21.0741 12.6474H17.6908C17.3453 12.6468 17.0107 12.526 16.7446 12.3055L15.5523 11.3115C14.8994 10.7709 14.0607 10.5077 13.2159 10.5783C12.3713 10.649 11.5878 11.0479 11.0338 11.6895C10.7016 12.0775 10.4661 12.5388 10.3467 13.0354C10.2274 13.5322 10.2275 14.0501 10.3472 14.5466C10.4669 15.0433 10.7027 15.5045 11.0352 15.8921C11.3677 16.2799 11.7875 16.5833 12.26 16.7774L13.0475 17.0982C13.4043 17.242 13.6904 17.5201 13.8443 17.8727C13.9981 18.2252 14.0074 18.6241 13.87 18.9836L12.8573 21.6856C12.8072 21.8176 12.7901 21.96 12.8071 22.1002C12.8243 22.2406 12.8751 22.3745 12.9555 22.4908C13.0358 22.607 13.1431 22.7021 13.2683 22.7677ZM7.24495 26.2852C6.43735 26.2852 5.64787 26.0456 4.97638 25.5969C4.30488 25.1484 3.78151 24.5105 3.47245 23.7645C3.16339 23.0184 3.08253 22.1973 3.24008 21.4052C3.39764 20.6132 3.78654 19.8855 4.35761 19.3144C4.92867 18.7434 5.65625 18.3545 6.44834 18.197C7.24042 18.0394 8.06145 18.1202 8.80758 18.4293C9.55371 18.7383 10.1914 19.2617 10.6401 19.9332C11.0888 20.6048 11.3283 21.3943 11.3283 22.2018C11.3283 23.2848 10.8981 24.3234 10.1323 25.0892C9.36653 25.855 8.32792 26.2852 7.24495 26.2852ZM7.24495 19.8685C6.78346 19.8685 6.33235 20.0053 5.94863 20.2618C5.56491 20.5181 5.26584 20.8826 5.08924 21.3089C4.91263 21.7353 4.86642 22.2044 4.95645 22.6571C5.04648 23.1096 5.26872 23.5254 5.59505 23.8517C5.92136 24.178 6.33713 24.4003 6.78975 24.4904C7.24237 24.5803 7.71152 24.5341 8.13789 24.3576C8.56425 24.181 8.92866 23.8818 9.18506 23.4981C9.44144 23.1144 9.57828 22.6634 9.57828 22.2018C9.57612 21.5844 9.32935 20.993 8.89199 20.5572C8.45464 20.1213 7.86238 19.8767 7.24495 19.8767V19.8685ZM18.5024 25.5969C19.174 26.0456 19.9633 26.2852 20.771 26.2852C21.8539 26.2852 22.8926 25.855 23.6584 25.0892C24.4241 24.3234 24.8544 23.2848 24.8544 22.2018C24.8544 21.3943 24.6148 20.6048 24.1661 19.9332C23.7174 19.2617 23.0797 18.7383 22.3337 18.4293C21.5875 18.1202 20.7665 18.0394 19.9744 18.197C19.1823 18.3545 18.4547 18.7434 17.8836 19.3144C17.3126 19.8855 16.9237 20.6132 16.7661 21.4052C16.6086 22.1973 16.6894 23.0184 16.9985 23.7645C17.3075 24.5105 17.8309 25.1484 18.5024 25.5969ZM19.4746 20.2618C19.8583 20.0053 20.3095 19.8685 20.771 19.8685V19.8767C21.3884 19.8767 21.9806 20.1213 22.418 20.5572C22.8554 20.993 23.1021 21.5844 23.1044 22.2018C23.1044 22.6634 22.9675 23.1144 22.7111 23.4981C22.4548 23.8818 22.0903 24.181 21.6639 24.3576C21.2376 24.5341 20.7685 24.5803 20.3158 24.4904C19.8631 24.4003 19.4474 24.178 19.1211 23.8517C18.7948 23.5254 18.5726 23.1096 18.4825 22.6571C18.3924 22.2044 18.4386 21.7353 18.6153 21.3089C18.7919 20.8826 19.0909 20.5181 19.4746 20.2618Z",fill:e?.color??t.labelSecondary}))},z1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M16.3935 5.69575C16.3935 6.98075 15.3475 8.02675 14.0625 8.02675C12.7765 8.02675 11.7305 6.98075 11.7305 5.69575C11.7305 4.41075 12.7765 3.36475 14.0625 3.36475C15.3475 3.36475 16.3935 4.41075 16.3935 5.69575ZM11.1694 12.8454L11.8384 13.1213C13.3544 13.7403 14.0934 15.4314 13.5184 16.9704L12.6484 19.2873C12.4984 19.6883 12.1174 19.9363 11.7124 19.9363C11.5954 19.9363 11.4764 19.9153 11.3604 19.8713C10.8434 19.6783 10.5824 19.1014 10.7764 18.5844L11.6454 16.2683C11.8384 15.7503 11.5904 15.1803 11.0794 14.9713L10.4094 14.6953C9.50536 14.3263 8.85336 13.5663 8.62336 12.6143C8.39236 11.6603 8.62636 10.6854 9.26336 9.94138C10.3334 8.69538 12.2274 8.53638 13.4864 9.58838L14.5084 10.4394C14.6914 10.5914 14.9224 10.6744 15.1594 10.6744H18.0604C18.6124 10.6744 19.0604 11.1223 19.0604 11.6743C19.0604 12.2263 18.6124 12.6743 18.0604 12.6743H15.1594C14.4564 12.6743 13.7704 12.4263 13.2294 11.9763L12.2054 11.1243C11.7804 10.7694 11.1424 10.8234 10.7824 11.2433C10.5674 11.4933 10.4894 11.8223 10.5674 12.1433C10.6444 12.4643 10.8644 12.7204 11.1694 12.8454ZM6.20457 21.115C5.10257 21.115 4.20557 20.219 4.20557 19.117C4.20557 18.015 5.10257 17.118 6.20457 17.118C7.30657 17.118 8.20257 18.015 8.20257 19.117C8.20257 20.219 7.30657 21.115 6.20457 21.115ZM6.20457 15.618C4.27557 15.618 2.70557 17.188 2.70557 19.117C2.70557 21.046 4.27557 22.615 6.20457 22.615C8.13357 22.615 9.70257 21.046 9.70257 19.117C9.70257 17.188 8.13357 15.618 6.20457 15.618ZM15.7974 19.117C15.7974 20.219 16.6944 21.115 17.7964 21.115C18.8984 21.115 19.7944 20.219 19.7944 19.117C19.7944 18.015 18.8984 17.118 17.7964 17.118C16.6944 17.118 15.7974 18.015 15.7974 19.117ZM14.2974 19.117C14.2974 17.188 15.8674 15.618 17.7964 15.618C19.7254 15.618 21.2944 17.188 21.2944 19.117C21.2944 21.046 19.7254 22.615 17.7964 22.615C15.8674 22.615 14.2974 21.046 14.2974 19.117Z",fill:e?.color??t.iconBrand}))},U1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M11.98 3C12.5309 3 12.9778 3.44676 12.9778 3.99778V10.9822H19.9622C20.5131 10.9822 20.96 11.429 20.96 11.98C20.96 12.2815 20.8262 12.5517 20.615 12.7345C20.4404 12.886 20.2117 12.9778 19.9622 12.9778H12.9778V19.9622C12.9778 20.5133 12.5309 20.96 11.98 20.96C11.4291 20.96 10.9822 20.5133 10.9822 19.9622V12.9778H3.99778C3.44692 12.9778 3 12.531 3 11.98C3 11.429 3.44692 10.9822 3.99778 10.9822H10.9822V3.99778C10.9822 3.44676 11.4291 3 11.98 3Z",fill:e?.color??t.iconButtonPrimary,fillOpacity:.95}))},G1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M9.26216 10.0642C9.43989 10.4341 9.28071 10.884 8.90669 11.0642C8.27046 11.364 7.79682 12.0142 7.70112 12.7041C7.64448 13.114 7.26606 13.404 6.85591 13.3442C6.44526 13.2942 6.15864 12.9141 6.21479 12.5041C6.37983 11.3039 7.17085 10.2241 8.26264 9.70412C8.63667 9.52419 9.08442 9.68411 9.26216 10.0642Z",fill:e?.color??t.labelSecondary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.4458 7.23465C11.3667 6.69339 11.1977 6.19364 10.9272 5.7742C10.5483 5.19413 9.93601 4.72415 8.93992 4.53421C8.53318 4.45413 8.26707 4.05399 8.34617 3.65409C8.42478 3.24417 8.81883 2.97415 9.22508 3.05423C10.602 3.32401 11.5732 4.0242 12.1841 4.95413C12.6377 5.65262 12.8725 6.44925 12.9595 7.2432C13.4619 7.19974 13.9643 7.11014 14.4673 6.97415C15.1391 6.79422 16.7549 6.53421 18.2949 7.22415C19.9219 7.95413 21.2529 9.63407 21.4541 12.894L21.4555 12.9341C21.48 15.9941 20.5049 18.3039 19.3813 19.884C19.0459 20.3518 18.6968 20.7549 18.3554 21.093C18.1274 21.3188 17.9033 21.5159 17.6894 21.6841C17.4228 21.894 17.165 22.0642 16.9292 22.1941C16.7138 22.3013 16.4653 22.4082 16.2207 22.4416C15.2471 22.6555 14.3613 22.4893 13.6694 22.3042C13.3388 22.2141 12.9721 22.084 12.7471 22.0242C12.4746 21.9441 12.3291 21.9141 12.2495 21.9141C12.1621 21.9141 12.0122 21.9441 11.7431 22.0142C11.6382 22.043 11.4975 22.0854 11.3437 22.1321C11.1777 22.1824 10.9966 22.2373 10.8291 22.2842C10.1328 22.4624 9.24558 22.6306 8.26121 22.4302C8.02244 22.396 7.77976 22.2996 7.56639 22.1841C7.33006 22.0642 7.07225 21.894 6.80564 21.6841C6.27098 21.2642 5.67283 20.6641 5.11375 19.874C3.99119 18.3039 3.01853 15.9941 3.04344 12.9341L3.0449 12.894C3.24607 9.63407 4.57762 7.95413 6.20457 7.22415C7.74461 6.53421 9.35984 6.79422 10.0317 6.97415C10.5039 7.1016 10.9746 7.18851 11.4458 7.23465ZM16.0244 20.9473L16.0307 20.9458C16.0327 20.9453 16.0346 20.9448 16.0366 20.9441C16.0127 20.9541 16.0727 20.9441 16.2295 20.864C16.3711 20.7839 16.5532 20.6741 16.7627 20.5041C17.0688 20.2632 17.4179 19.9368 17.77 19.5137C17.9004 19.3572 18.0312 19.1875 18.1606 19.0041C19.1113 17.6785 19.9717 15.6775 19.9555 12.9714C19.7783 10.1409 18.6846 9.04349 17.6821 8.59427C16.5918 8.10404 15.373 8.28421 14.8574 8.42411C13.1211 8.88407 11.3774 8.88407 9.64109 8.42411C9.12596 8.28421 7.90769 8.10404 6.81736 8.59427C5.8159 9.043 4.72264 10.1385 4.54344 12.9629C4.52537 15.6733 5.38426 17.6772 6.33445 19.0041C6.58494 19.355 6.84129 19.6589 7.08885 19.9165C7.31443 20.1511 7.53269 20.3469 7.7324 20.5041C7.94236 20.6641 8.12498 20.7839 8.26805 20.864C8.37254 20.9172 8.43553 20.9394 8.46092 20.9482C8.4741 20.9529 8.47703 20.9541 8.47117 20.9541H8.53025C9.19432 21.094 9.82908 20.9941 10.4443 20.8342C10.7822 20.7441 11.0141 20.6641 11.3369 20.5742C11.6089 20.4941 11.9355 20.4141 12.2495 20.4141C12.5703 20.4141 12.9038 20.5041 13.1758 20.5842C13.3198 20.6247 13.4482 20.6653 13.5762 20.7058C13.7319 20.7551 13.8872 20.8047 14.0688 20.8542C14.6831 21.0242 15.3032 21.124 15.9409 20.9641C15.957 20.959 15.9731 20.9565 15.9892 20.9539C16.001 20.9521 16.0127 20.9502 16.0244 20.9473Z",fill:e?.color??t.labelSecondary}))},W1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M8.04316 3.60454C8.12202 3.1979 8.51559 2.93219 8.92223 3.01105C10.2992 3.27808 11.2703 3.97422 11.8813 4.91206C12.3804 5.6783 12.6145 6.56644 12.678 7.43902C13.1847 7.39462 13.6915 7.30411 14.1989 7.16747C14.8466 6.99265 16.3988 6.75245 17.8696 7.41069C19.4044 8.09754 20.6958 9.68948 20.892 12.8663C20.8926 12.8761 20.8929 12.886 20.893 12.8958C20.9177 15.8912 19.9638 18.1528 18.8702 19.6843C18.3249 20.4479 17.7434 21.0321 17.2281 21.437C16.9707 21.6392 16.7245 21.8008 16.5023 21.918C16.3043 22.0224 16.091 22.11 15.8887 22.14C14.9514 22.3607 14.0934 22.2028 13.4084 22.0136C13.1979 21.9554 12.9793 21.8866 12.7875 21.8263C12.6801 21.7925 12.5811 21.7613 12.4966 21.7361C12.2263 21.6556 12.0576 21.6208 11.9473 21.6208C11.8313 21.6208 11.6594 21.6545 11.3919 21.7297C11.3049 21.7542 11.2002 21.7855 11.0862 21.8195C10.899 21.8754 10.6868 21.9387 10.4871 21.9917C9.80436 22.1729 8.95309 22.3276 8.01418 22.1412C7.80916 22.1115 7.59125 22.0221 7.38731 21.9141C7.16483 21.7963 6.91848 21.6344 6.6609 21.4319C6.14526 21.0266 5.56418 20.4427 5.01958 19.6798C3.92731 18.1496 2.97639 15.8909 3.00045 12.8959C3.00053 12.886 3.00087 12.8762 3.00148 12.8663C3.19764 9.68942 4.48941 8.09751 6.02425 7.41068C7.49526 6.75242 9.04763 6.99267 9.69485 7.16754C10.1879 7.30029 10.6804 7.3895 11.1727 7.43516C11.1122 6.79573 10.9352 6.2078 10.6244 5.73084C10.2452 5.14868 9.63277 4.67679 8.63665 4.48361C8.23002 4.40475 7.9643 4.01118 8.04316 3.60454ZM8.60309 11.0139C8.97721 10.8361 9.13636 10.3887 8.95857 10.0146C8.78078 9.64044 8.33337 9.48129 7.95925 9.65908C6.86721 10.178 6.07626 11.2571 5.91139 12.4555C5.85494 12.8659 6.14182 13.2443 6.55217 13.3007C6.96252 13.3572 7.34094 13.0703 7.39739 12.66C7.49327 11.963 7.96717 11.3161 8.60309 11.0139Z",fill:e?.color??t.iconBrand}))},Y1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:"40",height:"84",viewBox:"0 0 40 84",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M40.0001 28.9285V24.5471C39.5337 24.6152 39.0574 24.65 38.5725 24.65C33.7881 24.65 29.7894 21.2357 28.8091 16.675H37.1449V12.325H28.8091C29.7894 7.76427 33.7881 4.35 38.5725 4.35C39.0574 4.35 39.5337 4.3848 40.0001 4.45247V0.0715333C39.5304 0.0241667 39.0545 0 38.5725 0C30.6878 0 24.2964 6.49165 24.2964 14.5C24.2964 22.5084 30.6878 29 38.5725 29C39.0545 29 39.5304 28.9758 40.0001 28.9285Z",fill:t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M0 14.5C0 22.5084 6.35291 29 14.1901 29C14.7014 29 15.2066 28.9725 15.7037 28.9188V24.533C15.2104 24.6104 14.7047 24.65 14.1901 24.65C8.7042 24.65 4.25703 20.1057 4.25703 14.5C4.25703 8.8943 8.7042 4.35 14.1901 4.35C14.7047 4.35 15.2104 4.38963 15.7037 4.46697V0.0812C15.2066 0.02755 14.7014 0 14.1901 0C6.35291 0 0 6.49165 0 14.5Z",fill:t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M3.07255 44C4.12117 44 4.89209 43.648 5.38529 42.9439C5.8785 42.2398 6.1251 41.1635 6.1251 39.7152V38.111C6.11177 36.7117 5.85851 35.6767 5.3653 35.006C4.87209 34.3353 4.1034 34 3.05922 34C2.00616 34 1.23302 34.3476 0.739811 35.0428C0.246604 35.738 0 36.8008 0 38.2313V39.8824C0.0177732 41.2504 0.275485 42.2787 0.773136 42.9672C1.27079 43.6557 2.03726 44 3.07255 44ZM3.07255 42.9906C2.45493 42.9906 1.99394 42.74 1.68957 42.2386C1.3852 41.7373 1.23302 40.9608 1.23302 39.9091V37.9305C1.24191 36.9412 1.39076 36.2081 1.67957 35.7313C1.96839 35.2545 2.42827 35.016 3.05922 35.016C3.69461 35.016 4.15894 35.2556 4.4522 35.7346C4.74546 36.2137 4.89209 36.9768 4.89209 38.0241V40.0495C4.87876 41.0655 4.72435 41.8097 4.42887 42.2821C4.13339 42.7545 3.68128 42.9906 3.07255 42.9906ZM15.4217 34.0869V43.8663H14.182V35.6243L11.696 36.5401V35.4171L15.2284 34.0869H15.4217ZM29.0572 43.8663V42.857H24.1851L26.7844 40.0294C28.0019 38.7059 28.6106 37.5651 28.6106 36.607C28.6106 35.8182 28.3485 35.1865 27.8242 34.7119C27.2998 34.2373 26.5867 34 25.6847 34C24.7205 34 23.9507 34.2763 23.3753 34.8289C22.7999 35.3815 22.5122 36.1056 22.5122 37.0013H23.7452C23.7452 36.3775 23.9151 35.8906 24.2551 35.5408C24.595 35.191 25.0715 35.016 25.6847 35.016C26.1957 35.016 26.6045 35.1787 26.911 35.504C27.2176 35.8293 27.3709 36.246 27.3709 36.754C27.3709 37.1328 27.2765 37.4993 27.0877 37.8536C26.8988 38.2079 26.5556 38.668 26.0579 39.234L22.6988 42.9773V43.8663H29.0572ZM39.1469 43.2313C38.5781 43.7438 37.8383 44 36.9275 44C36.0166 44 35.2757 43.7527 34.7047 43.258C34.1337 42.7634 33.8482 42.1105 33.8482 41.2995H35.0879C35.0879 41.8119 35.2545 42.2219 35.5878 42.5294C35.921 42.8369 36.3676 42.9906 36.9275 42.9906C37.5229 42.9906 37.9783 42.8347 38.2938 42.5227C38.6092 42.2108 38.767 41.7629 38.767 41.1791C38.767 40.6132 38.5937 40.1787 38.2471 39.8757C37.9005 39.5726 37.4007 39.4167 36.7475 39.4078H35.8211V38.3984H36.7475C37.3296 38.3895 37.7872 38.2357 38.1205 37.9372C38.4537 37.6386 38.6204 37.2353 38.6204 36.7273C38.6204 35.5865 38.0538 35.016 36.9208 35.016C36.3876 35.016 35.9621 35.1687 35.6444 35.4739C35.3267 35.7792 35.1679 36.1836 35.1679 36.6872H33.9349C33.9349 35.9162 34.2159 35.2756 34.778 34.7654C35.3401 34.2551 36.0543 34 36.9208 34C37.8361 34 38.5537 34.2429 39.0736 34.7286C39.5934 35.2143 39.8534 35.8895 39.8534 36.754C39.8534 37.1774 39.7167 37.5873 39.4435 37.984C39.1702 38.3806 38.7981 38.6769 38.3271 38.873C38.8603 39.0423 39.2724 39.3231 39.5634 39.7152C39.8545 40.1074 40 40.5865 40 41.1524C40 42.0258 39.7156 42.7188 39.1469 43.2313Z",fill:t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M38.5714 58.4286H1.42857V82H38.5714V58.4286ZM0 57V83.4286H40V57H0Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M4.4248 78.0714V62.2211H9.21449L12.0905 73.033L14.934 62.2211H19.7345V78.0714H16.7612V65.5944L13.615 78.0714H10.5336L7.39809 65.5944V78.0714H4.4248Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M22.4596 62.2211H28.3088C29.6279 62.2211 30.6334 62.322 31.3253 62.5238C32.2552 62.7977 33.0517 63.2842 33.7148 63.9834C34.3779 64.6826 34.8825 65.5403 35.2285 66.5567C35.5744 67.5658 35.7474 68.8127 35.7474 70.2976C35.7474 71.6022 35.5853 72.7267 35.2609 73.6709C34.8645 74.8242 34.2986 75.7576 33.5634 76.4712C33.0084 77.0118 32.2588 77.4335 31.3145 77.7362C30.6082 77.9597 29.6639 78.0714 28.4818 78.0714H22.4596V62.2211ZM25.6599 64.9024V75.4008H28.0493C28.9431 75.4008 29.5882 75.3504 29.9847 75.2495C30.5036 75.1197 30.9325 74.8999 31.2713 74.5899C31.6173 74.28 31.8984 73.7718 32.1146 73.0654C32.3309 72.3519 32.439 71.3824 32.439 70.157C32.439 68.9317 32.3309 67.991 32.1146 67.3351C31.8984 66.6792 31.5956 66.1674 31.2064 65.7998C30.8172 65.4322 30.3234 65.1835 29.7252 65.0538C29.2783 64.9529 28.4025 64.9024 27.0979 64.9024H25.6599Z",fill:t.labelPrimary}))},$1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M9.91114 17.3465C9.8166 17.3465 9.723 17.3278 9.63569 17.2916C9.54838 17.2554 9.46907 17.2023 9.40234 17.1353L5.20234 12.9353C5.07112 12.7995 4.99847 12.6177 5.00002 12.4289C5.00157 12.2401 5.07721 12.0595 5.21064 11.9259C5.34407 11.7924 5.52462 11.7166 5.7134 11.7148C5.90218 11.7131 6.08409 11.7856 6.21994 11.9167L9.91114 15.6079L18.6472 6.87191C18.7136 6.80317 18.7931 6.74836 18.881 6.71067C18.9688 6.67297 19.0633 6.65316 19.1589 6.65237C19.2545 6.65158 19.3492 6.66985 19.4378 6.70609C19.5263 6.74234 19.6066 6.79583 19.6741 6.86347C19.7417 6.9311 19.7952 7.01151 19.8313 7.10002C19.8674 7.18852 19.8857 7.28334 19.8847 7.37894C19.8839 7.47454 19.864 7.56901 19.8262 7.65684C19.7884 7.74467 19.7335 7.82408 19.6648 7.89046L10.4151 17.1353C10.2815 17.2694 10.1004 17.3452 9.91114 17.3465Z",fill:e?.color??t.iconBrand}))},X1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M16.3344 3.38489H7.6654C4.6444 3.38489 2.7504 5.52389 2.7504 8.55089V16.7189C2.7504 19.7459 4.6354 21.8849 7.6654 21.8849H16.3334C19.3644 21.8849 21.2504 19.7459 21.2504 16.7189V8.55089C21.2504 5.52389 19.3644 3.38489 16.3344 3.38489Z",stroke:e?.color??t.labelPrimary,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},q1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M14.5784 9.44215L14.5784 9.44219L10.8449 13.1767L9.41855 11.7512C9.41852 11.7511 9.41849 11.7511 9.41845 11.7511C8.93018 11.2629 8.13968 11.2629 7.65145 11.7512C7.16318 12.2394 7.16318 13.031 7.65145 13.5193L9.96045 15.8283C10.2049 16.0727 10.5246 16.1947 10.845 16.1947C11.1647 16.1947 11.4844 16.0724 11.7286 15.8283L16.3466 11.2103C16.8348 10.722 16.8348 9.93041 16.3466 9.44215C15.8583 8.95389 15.0667 8.95389 14.5784 9.44215ZM7.782 3.6347H16.217C17.6754 3.6347 18.8605 4.14442 19.6821 5.00394C20.5055 5.86543 21 7.11668 21 8.66171V16.6097C21 18.1541 20.5053 19.4048 19.6817 20.266C18.8599 21.1252 17.6745 21.6347 16.216 21.6347H7.782C6.32407 21.6347 5.13922 21.1252 4.31777 20.266C3.49445 19.4049 3 18.1542 3 16.6097V8.66171C3 7.11668 3.49448 5.86541 4.31784 5.00392C5.13931 4.14439 6.32414 3.6347 7.782 3.6347Z",fill:e?.color??t.iconBrand,stroke:e?.color??t.iconBrand}))},Z1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:25,height:26,viewBox:"0 0 25 26",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M16.0713 21.2014C15.7665 21.2014 15.4618 21.0847 15.2296 20.8525L8.08689 13.7098C7.62143 13.2444 7.62143 12.492 8.08689 12.0266L15.2296 4.88383C15.6951 4.41836 16.4474 4.41836 16.913 4.88383C17.3784 5.3493 17.3784 6.10166 16.913 6.56713L10.6118 12.8682L16.913 19.1693C17.3784 19.6347 17.3784 20.3871 16.913 20.8525C16.6808 21.0847 16.3761 21.2014 16.0713 21.2014Z",fill:e.color??t.labelPrimary}))},K1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M8.21967 20.0899C7.9534 19.8236 7.9292 19.407 8.14705 19.1134L8.21967 19.0292L14.689 12.5596L8.21967 6.0899C7.9534 5.82363 7.9292 5.40697 8.14705 5.11336L8.21967 5.02924C8.48594 4.76297 8.9026 4.73877 9.19621 4.95662L9.28033 5.02924L16.2803 12.0292C16.5466 12.2955 16.5708 12.7122 16.3529 13.0058L16.2803 13.0899L9.28033 20.0899C8.98744 20.3828 8.51256 20.3828 8.21967 20.0899Z",fill:e.color??t.labelSecondary}))},Q1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M6.72911 6.34559C6.44794 6.06441 5.99206 6.06441 5.71088 6.34559C5.42971 6.62676 5.42971 7.08264 5.71088 7.36382L10.9617 12.6147L5.71088 17.8656C5.42971 18.1468 5.42971 18.6026 5.71088 18.8838C5.99206 19.165 6.44794 19.165 6.72911 18.8838L11.98 13.633L17.2309 18.8838C17.5121 19.165 17.9679 19.165 18.2491 18.8838C18.5303 18.6026 18.5303 18.1468 18.2491 17.8656L12.9983 12.6147L18.2491 7.36382C18.5303 7.08264 18.5303 6.62676 18.2491 6.34559C17.9679 6.06441 17.5121 6.06441 17.2309 6.34559L11.98 11.5964L6.72911 6.34559Z",fill:e?.color??t.labelPrimary}))},J1=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:25,viewBox:"0 0 24 25",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M13.414 12.3682L18.707 7.07529C19.098 6.68429 19.098 6.05229 18.707 5.66129C18.316 5.27029 17.684 5.27029 17.293 5.66129L12 10.9542L6.70701 5.66129C6.31601 5.27029 5.68401 5.27029 5.29301 5.66129C4.90201 6.05229 4.90201 6.68429 5.29301 7.07529L10.586 12.3682L5.29301 17.6613C4.90201 18.0522 4.90201 18.6842 5.29301 19.0752C5.48801 19.2702 5.74401 19.3682 6.00001 19.3682C6.25601 19.3682 6.51201 19.2702 6.70701 19.0752L12 13.7823L17.293 19.0752C17.488 19.2702 17.744 19.3682 18 19.3682C18.256 19.3682 18.512 19.2702 18.707 19.0752C19.098 18.6842 19.098 18.0522 18.707 17.6613L13.414 12.3682Z",fill:e.color??t.labelPrimary}))};function e2(e){const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:25,viewBox:"0 0 24 25",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.638 7.76a2.58 2.58 0 102.868-4.29 2.58 2.58 0 00-2.868 4.29zm.834-3.044a1.081 1.081 0 111.2 1.798 1.081 1.081 0 01-1.2-1.798zm-2.1 14.803a.75.75 0 001.046-.397l.87-2.316a2.755 2.755 0 00-1.542-3.532L11.079 13a1.267 1.267 0 111.293-2.148l1.022.853c.498.413 1.124.64 1.77.64h2.9a.75.75 0 000-1.5h-2.9c-.296 0-.582-.104-.81-.293L13.33 9.7a2.777 2.777 0 00-3.873.324 2.768 2.768 0 001.05 4.361l.676.275a1.258 1.258 0 01.705 1.616l-.868 2.316a.748.748 0 00.352.928zM6.21 22.534a3.5 3.5 0 110-7 3.5 3.5 0 010 7zm0-5.5a2 2 0 102 2 2 2 0 00-2-1.993v-.007zm9.65 4.91a3.5 3.5 0 103.888-5.82 3.5 3.5 0 00-3.889 5.82zm.832-4.573a2 2 0 011.112-.337v.007a2 2 0 012 1.993 2 2 0 11-3.111-1.663z",fill:t.labelPrimary}))}const t2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:28,height:28,viewBox:"0 0 28 28",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M15.001 4.41143L14.5 5.20879L13.9989 4.41143C14.3038 4.20791 14.6961 4.20791 15.001 4.41143ZM14.5 6.3617C14.4414 6.40466 14.3782 6.45134 14.3109 6.50165C13.8698 6.83133 13.2501 7.3157 12.5427 7.92948C11.1256 9.15913 9.38504 10.8841 8.01956 12.9025C6.69517 15.0522 6.69988 17.9558 7.8799 20.3534C9.04765 22.7262 11.3296 24.5255 14.5 24.5255C17.6704 24.5255 19.9522 22.7262 21.1201 20.3534C22.3001 17.9558 22.3047 15.0522 20.9803 12.9025C19.6149 10.8841 17.8742 9.15913 16.4572 7.92948C15.7498 7.3157 15.1301 6.83133 14.689 6.50165C14.6217 6.45134 14.5585 6.40466 14.5 6.3617ZM13.9989 4.41143C13.9991 4.41131 13.9989 4.41143 14.5 5.20879C15.001 4.41143 15.0008 4.41131 15.001 4.41143L15.0029 4.4127L15.0065 4.41505L15.0181 4.42295L15.06 4.45146C15.0959 4.47608 15.1477 4.51183 15.2138 4.55835C15.3459 4.65134 15.5356 4.78745 15.7711 4.96346C16.2419 5.31529 16.8975 5.82789 17.6444 6.47598C19.1322 7.7669 21.0099 9.6196 22.5041 11.8329C22.5109 11.8431 22.5177 11.8535 22.5241 11.8639C24.2619 14.6665 24.1952 18.3049 22.764 21.213C21.3177 24.1517 18.44 26.4255 14.5 26.4255C10.5599 26.4255 7.68226 24.1517 6.23595 21.213C4.80472 18.3049 4.73807 14.6665 6.4758 11.8639C6.48228 11.8535 6.48897 11.8431 6.49585 11.8329C7.98996 9.6196 9.86782 7.7669 11.3555 6.47598C12.1024 5.82789 12.758 5.31529 13.2288 4.96346C13.4644 4.78745 13.654 4.65134 13.7861 4.55835C13.8523 4.51183 13.904 4.47608 13.9399 4.45146L13.9818 4.42295L13.9935 4.41505L13.997 4.4127L13.9989 4.41143ZM10.1358 17.1709C10.6088 16.9769 11.1448 17.2148 11.333 17.7023C11.7357 18.7452 12.6036 19.5672 13.8273 19.7115C14.3331 19.7712 14.6962 20.2421 14.6383 20.7633C14.5804 21.2847 14.1235 21.6589 13.6178 21.5992C11.6275 21.3645 10.2379 20.0043 9.62029 18.4049C9.43206 17.9174 9.66286 17.365 10.1358 17.1709Z",fill:e?.color??t.labelSecondary}))},n2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:28,height:28,viewBox:"0 0 28 28",fill:"none",...e},M.createElement(l1,{d:"M9.47572 16.8973L9.47563 16.8974C8.70231 17.2102 8.33375 18.0938 8.63669 18.8671C9.37596 20.7542 11.0517 22.3823 13.4637 22.6627C14.2958 22.7594 15.0352 22.1525 15.1284 21.3254L15.1284 21.3253C15.2214 20.4994 14.6377 19.741 13.8072 19.6443L13.8071 19.6443C12.6515 19.5101 11.8233 18.75 11.4309 17.7484L10.984 17.9235L11.4309 17.7484C11.1265 16.9714 10.253 16.5831 9.47572 16.8973ZM14.5 25.9455C10.7597 25.9455 8.05158 23.8421 6.67199 21.0789C5.2861 18.303 5.26321 14.906 6.85972 12.3608C9.34794 8.73088 12.9056 5.98426 14.2429 5.02279C14.3998 4.91003 14.6002 4.91003 14.7571 5.0228C16.0944 5.98427 19.6519 8.73087 22.1402 12.3608C23.7367 14.9059 23.7138 18.303 22.3279 21.0789C20.9483 23.8421 18.2402 25.9455 14.5 25.9455Z",fill:e?.color??t.iconBrand,stroke:e?.color??t.iconBrand,strokeWidth:.96}))},i2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.2513 6.38429C6.07792 5.49683 7.25513 4.99994 8.645 4.99994H11.6506C11.9986 4.99994 12.2808 5.28208 12.2808 5.63012C12.2808 5.97816 11.9986 6.26031 11.6506 6.26031H8.645C7.56779 6.26031 6.73758 6.6378 6.17357 7.24333C5.60494 7.85381 5.26037 8.74689 5.26037 9.85332V16.5305C5.26037 17.6382 5.6036 18.5314 6.17112 19.1416C6.73386 19.7466 7.56369 20.1243 8.645 20.1243H15.7324C16.8151 20.1243 17.6451 19.7465 18.2076 19.1416C18.7749 18.5315 19.1178 17.6384 19.1178 16.5305V13.5216C19.1178 13.1736 19.4 12.8914 19.748 12.8914C20.096 12.8914 20.3782 13.1736 20.3782 13.5216V16.5305C20.3782 17.8979 19.9518 19.1168 19.1305 19.9999C18.3045 20.8882 17.1266 21.3847 15.7324 21.3847H8.645C7.25186 21.3847 6.07429 20.888 5.24823 19.9999C4.42695 19.1169 4 17.8981 4 16.5305V9.85332C4 8.48531 4.42929 7.2668 5.2513 6.38429Z",fill:e?.color??t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M16.5818 6.82051L11.9345 11.8931C11.6675 12.1932 11.5006 12.5692 11.4569 12.9697L11.3377 14.0698C11.2974 14.4426 11.6242 14.7507 11.9937 14.6891C11.9936 14.6891 11.9938 14.689 11.9937 14.6891L13.0606 14.5101C13.4935 14.4373 13.8884 14.2197 14.1802 13.8934L14.1853 13.8878L18.786 8.86705L18.7882 8.8647C19.1016 8.52614 19.0813 7.99816 18.7425 7.68452L17.7614 6.77612C17.7614 6.77609 17.7614 6.77615 17.7614 6.77612C17.4228 6.46331 16.8946 6.48377 16.5818 6.82051ZM15.656 5.96537C16.4416 5.11656 17.7676 5.06553 18.6169 5.85059L19.5987 6.75961C19.5986 6.7596 19.5987 6.75963 19.5987 6.75961C20.4475 7.54548 20.4996 8.86988 19.7143 9.71954C19.7139 9.71999 19.7135 9.72045 19.7131 9.7209L15.117 14.7366C14.6344 15.275 13.9827 15.6332 13.2696 15.7531L12.2021 15.932C11.0092 16.1317 9.95483 15.1373 10.0846 13.9346L10.2039 12.8335C10.2761 12.1713 10.553 11.5478 10.9971 11.0507L11.0024 11.0449L15.6538 5.96774L15.656 5.96537Z",fill:e?.color??t.labelPrimary}))},r2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{height:48,width:48,viewBox:"0 0 48 48",fill:"none",...e},M.createElement(l1,{d:"M33 29C33 30.1045 32.1001 31 30.9907 31H17.0093C15.9 31 15 30.1045 15 29C15 27.8955 15.9 27 17.0093 27H24H30.9907C32.1001 27 33 27.8955 33 29Z",fill:e?.color??t.labelPrimary}),M.createElement(l1,{d:"M33 19C33 20.1045 32.1001 21 30.9907 21H17.0093C15.9 21 15 20.1045 15 19C15 17.8955 15.9 17 17.0093 17H24H30.9907C32.1001 17 33 17.8955 33 19Z",fill:e?.color??t.labelPrimary}))};function a2(e){const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M7.783 3h8.435C19.166 3 21 5.081 21 8.026v7.948C21 18.919 19.166 21 16.217 21H7.783C4.835 21 3 18.919 3 15.974V8.026C3 5.081 4.844 3 7.783 3zM14.612 14.155h-5.22M14.612 9.846h-5.22",stroke:t.labelPrimary,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}const o2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:48,height:48,viewBox:"0 0 48 48",fill:"none",...e},M.createElement(l1,{d:"M29.8751 5.55323C30.6937 5.68067 31.2539 6.44757 31.1265 7.26613L29.4705 17.9027C29.3431 18.7213 28.5763 19.2816 27.7577 19.1541C26.9391 19.0267 26.3789 18.2598 26.5063 17.4412L28.1623 6.80463C28.2897 5.98607 29.0565 5.42579 29.8751 5.55323Z",fill:t.labelSecondary}),M.createElement(l1,{d:"M38.9675 7.97557C39.7035 8.35561 39.9923 9.26045 39.6121 9.99655L35.2941 18.3603C34.9141 19.0964 34.0093 19.3851 33.2731 19.005C32.5371 18.625 32.2483 17.7201 32.6285 16.984L36.9465 8.62029C37.3265 7.88417 38.2313 7.59553 38.9675 7.97557Z",fill:t.labelSecondary}),M.createElement(l1,{d:"M9.05192 22.4805C7.24854 22.4805 5.8052 24.0585 6.02152 25.8737C6.07976 26.3593 6.15546 26.8399 6.24796 27.3143C6.31936 27.6805 6.64466 27.9381 7.0178 27.9381H42.9844C43.3572 27.9381 43.6824 27.6807 43.754 27.3147C43.8458 26.8443 43.9208 26.3685 43.9784 25.8881C44.1964 24.0733 42.7644 22.4805 40.9482 22.4805H9.05192Z",fill:t.labelSecondary}),M.createElement(l1,{d:"M42.4447 31.4848C42.5591 31.2252 42.3659 30.938 42.0821 30.938H7.91546C7.63188 30.938 7.43878 31.2248 7.55284 31.4846C9.30246 35.4668 12.3176 38.7632 16.091 40.862C17.4387 41.612 18.9573 41.965 20.4689 41.965H29.5351C31.0397 41.965 32.5549 41.6166 33.8999 40.8676C37.6725 38.771 40.6895 35.4708 42.4447 31.4848Z",fill:t.labelSecondary}))};function s2(e){return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M11.7012 4.125C11.8651 3.95886 12.1261 3.95886 12.29 4.125L18.2441 10.1582C19.2467 11.1743 19.2467 12.8256 18.2441 13.8418L12.29 19.875C12.1261 20.0411 11.8661 20.0411 11.7021 19.875L5.74805 13.8418C4.74547 12.8257 4.74558 11.1744 5.74805 10.1582L11.7012 4.125Z",fill:"#401782",stroke:"#9B8BF3",strokeWidth:2}))}const l2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:"40",height:"29",viewBox:"0 0 40 29",...e},M.createElement(l1,{d:"M29.8431 28.0756C28.6 27.6408 27.4897 26.9403 26.3499 26.2989C25.9038 26.048 25.4406 25.813 24.9615 25.6337C24.3315 25.3975 23.6719 25.5111 23.026 25.5973C22.0712 25.7234 21.1665 25.9947 20.3264 26.484C20.1788 26.5702 19.929 26.5691 19.7463 26.4953C19.6316 26.4488 19.5147 26.3727 19.3978 26.3125C18.5361 25.8755 17.6109 25.6643 16.6584 25.5394C15.7321 25.418 14.875 25.5883 14.0724 26.0651C13.4957 26.4079 12.9122 26.7394 12.3309 27.072C10.7507 27.9779 9.06826 28.5864 7.25074 28.7737C6.13367 28.8884 3.87456 28.8884 2.57812 28.5898C1.70853 28.407 0.858238 28.1312 0 27.8951C0 19.1628 0 10.4317 0 1.69951C0.662977 2.0923 1.33957 2.45444 2.09678 2.63948C3.20817 2.91081 4.33887 3.00957 5.47751 3.08563C6.8852 3.17986 8.24975 3.01865 9.54392 2.46579C10.5236 2.04803 11.467 1.54512 12.4285 1.08308C13.5025 0.566546 14.556 0.0273115 15.8081 0.0205C17.2158 0.0125534 18.5588 0.255494 19.8643 0.761808C19.9472 0.793595 20.0619 0.799268 20.1447 0.769752C21.3095 0.34858 23.6118 -0.225849 25.0422 0.0920169C25.855 0.272519 26.3726 0.516597 27.0061 0.803811C28.0119 1.26018 28.9837 1.78692 29.9827 2.25805C30.9068 2.69398 31.8763 3.02319 32.9014 3.06179C33.8289 3.09698 34.7632 3.0686 35.6895 2.99936C37.1392 2.89151 37.7942 2.87334 39.1032 2.15474C39.6458 1.85731 39.9557 1.4963 40 1.48155C40 10.207 40 19.2116 40 27.9405C38.5253 28.39 37.1301 28.7715 35.484 28.9031C32.8253 29.0473 30.9919 28.4774 29.8431 28.0756ZM19.2945 24.7198C19.2945 17.1739 19.2945 9.62345 19.2945 2.05824C19.2366 2.03327 19.1787 2.00035 19.1162 1.98332C18.5656 1.83233 18.0184 1.67 17.4633 1.53831C16.1771 1.2318 14.9454 1.36121 13.7715 2.00148C13.1086 2.36362 12.4229 2.68262 11.7485 3.02319C9.94012 3.93706 8.05222 4.72037 5.98155 4.58528C4.84745 4.51149 3.81098 4.37753 2.60082 4.17319C2.07407 4.07783 1.80275 4.00404 1.39634 3.91435C1.39634 11.5749 1.39634 19.2196 1.39634 26.8688C1.47807 26.8926 1.54619 26.9119 1.61317 26.9312C3.52945 27.483 5.47637 27.6294 7.44941 27.3433C9.26352 27.08 10.8937 26.3386 12.4331 25.3771C13.2244 24.8821 14.0292 24.3974 14.9522 24.2135C16.4405 23.9172 17.8697 24.2475 19.2945 24.7198ZM38.6264 3.92117C38.5821 3.92911 38.5537 3.93252 38.5276 3.93933C37.3299 4.25265 36.1084 4.39456 34.8744 4.47176C33.2533 4.57279 31.6515 4.48651 30.1428 3.83943C28.8906 3.30246 27.6725 2.68376 26.4408 2.09798C25.7199 1.75514 25.0047 1.38846 24.1794 1.38165C23.3234 1.37483 22.4856 1.50879 21.6637 1.74606C21.3436 1.83801 21.0291 1.94926 20.7124 2.05257C20.7124 9.63594 20.7124 17.1864 20.7124 24.705C21.2584 24.5643 21.8033 24.3974 22.3596 24.2861C23.1872 24.1215 24.0261 24.0239 24.8673 24.1681C25.7517 24.3191 26.518 24.755 27.2865 25.1977C28.1413 25.6893 28.9996 26.1888 29.901 26.5793C32.1237 27.5431 34.4521 27.6816 36.8225 27.2888C37.4253 27.1889 38.0213 27.0425 38.6252 26.9165C38.6264 19.2298 38.6264 11.5851 38.6264 3.92117Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M25.7222 22.1271C25.7222 21.6866 25.7222 21.2586 25.7222 20.8125C26.401 20.8125 27.0799 20.8125 27.7803 20.8125C27.7803 18.6669 27.7803 16.5383 27.7803 14.3916C27.131 14.3916 26.4907 14.3916 25.8391 14.3916C25.8391 13.9602 25.8391 13.547 25.8391 13.1235C27.9643 13.1235 30.094 13.1235 32.2407 13.1235C32.2407 15.6801 32.2407 18.2344 32.2407 20.8011C32.8946 20.8011 33.5314 20.8011 34.1842 20.8011C34.1842 21.2473 34.1842 21.6832 34.1842 22.1282C31.3654 22.1271 28.5546 22.1271 25.7222 22.1271Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M30.1452 11.5738C28.9521 11.5784 27.9372 10.5624 27.9292 9.3556C27.9224 8.15338 28.9339 7.13281 30.1361 7.1294C31.3576 7.126 32.3714 8.13295 32.3737 9.35219C32.376 10.5567 31.3599 11.5693 30.1452 11.5738Z",fill:t.labelPrimary}))},u2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:"41",height:"38",viewBox:"0 0 41 38",fill:e?.color,...e},M.createElement(l1,{d:"M1 36.5699V23.38L6.78992 13.95L11.38 21.1L15.77 13.95L20.2799 20.9L24.52 13.95L29.2799 21.72H29.2999V1H39.6599L39.5 36.5699H1Z",stroke:t.labelPrimary,strokeWidth:"1.5",strokeMiterlimit:"10"}))},c2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:97,height:96,viewBox:"0 0 97 96",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3851 13.1468C13.5574 11.976 15.4569 11.9773 16.6277 13.1496L27.9846 24.5217C28.1023 24.6223 28.2127 24.7326 28.3146 24.8521L42.6984 39.255C42.822 39.3602 42.9376 39.4756 43.0432 39.6003L75.1832 71.7828C76.354 72.9552 76.3524 74.8548 75.1804 76.0256C74.008 77.1964 72.1084 77.1952 70.9376 76.0228L62.0424 67.1156C61.3924 67.0936 60.7448 66.8612 60.2096 66.4088C54.1684 61.3036 45.2316 61.3112 39.2382 66.4328C37.9786 67.5092 36.0849 67.3608 35.0085 66.1012C33.9321 64.8416 34.0807 62.948 35.3402 61.8716C39.9733 57.9124 45.8648 56.1808 51.6056 56.6652L39.8186 44.8624C35.3322 46.0972 31.0205 48.292 27.1617 51.3804C25.8681 52.416 23.9802 52.2064 22.9449 50.9128C21.9096 49.6192 22.1189 47.7312 23.4125 46.696C26.9883 43.8344 30.923 41.6148 35.0573 40.0948L25.3825 30.407C21.9621 32.084 18.6787 34.2088 15.5787 36.709C14.2891 37.7491 12.4003 37.5468 11.3602 36.257C10.3201 34.9674 10.5224 33.0786 11.8121 32.0385C14.6889 29.7185 17.7374 27.6685 20.9314 25.95L12.3822 17.3894C11.2114 16.2171 11.2127 14.3176 12.3851 13.1468ZM83.8028 36.7014C71.9412 27.0553 56.9396 23.1622 42.5252 25.0733C40.8828 25.2911 39.3749 24.1361 39.1571 22.4936C38.9394 20.8511 40.0943 19.3431 41.7368 19.1254C57.7328 17.0046 74.4024 21.3231 87.5884 32.0464C88.8736 33.0918 89.0684 34.9813 88.0228 36.2668C86.9776 37.5522 85.088 37.7468 83.8028 36.7014ZM59.8708 41.7084C60.416 40.144 62.1268 39.3179 63.6912 39.8634C68.0844 41.3952 72.2192 43.6924 75.9788 46.696C77.2732 47.73 77.4844 49.6176 76.45 50.9124C75.416 52.2068 73.5284 52.4176 72.2336 51.3836C68.988 48.7908 65.4484 46.8304 61.7156 45.5288C60.1512 44.9836 59.3252 43.2728 59.8708 41.7084ZM49.7016 75.7004C51.3588 75.7004 52.7016 77.0436 52.7016 78.7004V78.868C52.7016 80.5248 51.3588 81.868 49.7016 81.868C48.0448 81.868 46.7016 80.5248 46.7016 78.868V78.7004C46.7016 77.0436 48.0448 75.7004 49.7016 75.7004Z",fill:t.labelPrimary}))};function d2(e){const{COLORS:t}=bL();return M.createElement(f1,{width:49,height:48,viewBox:"0 0 49 48",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M19.535 42a1.5 1.5 0 011.5-1.5h7.926a1.5 1.5 0 010 3h-7.926a1.5 1.5 0 01-1.5-1.5zM19.535 6a1.5 1.5 0 011.5-1.5h7.926a1.5 1.5 0 010 3h-7.926a1.5 1.5 0 01-1.5-1.5zM7 18.54a1.5 1.5 0 011.5 1.499v7.924a1.5 1.5 0 01-3 0v-7.924a1.5 1.5 0 011.5-1.5zM43 18.54a1.5 1.5 0 011.5 1.499v7.924a1.5 1.5 0 01-3 0v-7.924a1.5 1.5 0 011.5-1.5zM24.473 31.574a1.5 1.5 0 011.5 1.5v.088a1.5 1.5 0 01-3 0v-.088a1.5 1.5 0 011.5-1.5zM18.324 20.084A6.66 6.66 0 0125 13.408a6.67 6.67 0 016.675 6.676c0 2.604-1.489 4.445-3.437 5.522l-.343.193c-.576.324-1.032.58-1.404.915-.372.334-.527.636-.522 1.057a1.5 1.5 0 11-3 .039c-.02-1.51.69-2.583 1.515-3.326.645-.58 1.446-1.026 2.014-1.342l.265-.148.018-.01c1.231-.68 1.894-1.63 1.894-2.9A3.67 3.67 0 0025 16.408a3.66 3.66 0 00-3.676 3.676 1.5 1.5 0 01-3 0zM6.847 32.343A1.5 1.5 0 018.54 33.62c.538 3.843 3.007 6.41 6.782 6.85a1.5 1.5 0 11-.348 2.98c-5.235-.611-8.693-4.326-9.405-9.415a1.5 1.5 0 011.278-1.693zM43.063 32.343a1.5 1.5 0 011.278 1.693c-.712 5.085-4.147 8.801-9.385 9.414a1.5 1.5 0 11-.349-2.98c3.771-.44 6.224-3.002 6.763-6.85a1.5 1.5 0 011.693-1.277zM16.638 5.865a1.5 1.5 0 01-1.316 1.664c-3.77.442-6.243 3.022-6.782 6.87a1.5 1.5 0 11-2.97-.416c.71-5.085 4.165-8.82 9.404-9.434a1.5 1.5 0 011.664 1.316zM33.292 5.865a1.5 1.5 0 011.664-1.316c5.242.614 8.674 4.354 9.385 9.434a1.5 1.5 0 11-2.971.416c-.54-3.852-2.996-6.429-6.763-6.87a1.5 1.5 0 01-1.315-1.664z",fill:t.labelTertiary}))}const h2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:25,viewBox:"0 0 24 25",fill:"none",...e},M.createElement(l1,{d:"M20.9369 17.9484L18.4094 18.4528L17.9078 15.9393",stroke:e?.color??t.labelPrimary,strokeWidth:1.44,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement(l1,{d:"M3.68064 6.78526L6.19133 6.20428L6.76944 8.7019",stroke:e?.color??t.labelPrimary,strokeWidth:1.44,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement(l1,{d:"M18.3836 18.2968C21.7013 15.066 21.8396 9.7597 18.6638 6.35981C16.6744 4.22928 13.8508 3.34661 11.171 3.74264",stroke:e?.color??t.labelPrimary,strokeWidth:1.44,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement(l1,{d:"M6.22222 6.36179C3.00353 9.69069 3.0259 14.9998 6.30344 18.3026C8.35649 20.3705 11.2053 21.1682 13.8719 20.6908",stroke:e?.color??t.labelPrimary,strokeWidth:1.44,strokeLinecap:"round",strokeLinejoin:"round"}))},m2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:16,height:16,viewBox:"0 0 16 16",fill:"none",...e},M.createElement(l1,{d:"M7 12C9.76142 12 12 9.76142 12 7C12 4.23858 9.76142 2 7 2C4.23858 2 2 4.23858 2 7C2 9.76142 4.23858 12 7 12Z",stroke:t.iconSearch,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),M.createElement(l1,{d:"M10.6666 11.3333L14 13.9999",stroke:t.iconSearch,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},p2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:39,height:25,viewBox:"0 0 39 25",fill:"none",...e},M.createElement(l1,{d:"M0 0.569824V24.7127H39V0.569824H0ZM1.15617 1.71512H37.8438V23.5685H1.15617V1.71512ZM23.3605 6.55721C22.882 6.56019 21.2049 6.58767 21.2 6.59248C21.1908 6.60164 21.1956 18.3199 21.2049 18.4937L21.2139 18.6678L21.3242 18.6742C21.3846 18.6774 21.9166 18.6793 22.5065 18.6786C23.4462 18.6774 23.5815 18.6744 23.6007 18.6554C23.6199 18.6364 23.6234 18.5141 23.6257 17.6961C23.6271 17.1805 23.6326 16.3241 23.6382 15.7927C23.644 15.261 23.6507 14.3077 23.6532 13.6739C23.6576 12.595 23.6705 11.9472 23.6879 11.9298C23.7075 11.9103 23.763 11.9926 23.85 12.1696C23.9025 12.2764 23.9695 12.4058 23.9991 12.4569C24.0287 12.5079 24.1344 12.7077 24.2341 12.9005C24.3335 13.0936 24.4863 13.3866 24.5735 13.552C24.715 13.82 24.7967 13.9728 25.0288 14.4039C25.0649 14.4707 25.2261 14.7736 25.387 15.0766C25.8041 15.8625 26.0923 16.4056 26.246 16.6945C26.3193 16.8324 26.4368 17.0545 26.5066 17.1883C26.8722 17.8895 27.2704 18.6014 27.324 18.6495C27.3506 18.6733 27.386 18.6767 27.6529 18.6818C27.8173 18.6848 27.9551 18.6905 27.959 18.6946C27.9731 18.7097 29.6988 18.6848 29.7145 18.6692C29.7247 18.6591 29.7324 18.056 29.7384 16.8044C29.7509 14.2607 29.7548 6.61928 29.7439 6.60141C29.7379 6.59202 29.3212 6.58721 28.5313 6.58721H27.3277L27.3183 7.38411C27.3067 8.33975 27.3086 11.5502 27.3213 12.4926C27.3264 12.8628 27.3271 13.2203 27.3231 13.2872L27.316 13.4088L27.278 13.3587C27.2373 13.3048 27.0919 13.0625 27.0919 13.0487C27.0919 13.0442 27.06 12.9848 27.0214 12.9168C26.9827 12.8488 26.9141 12.7223 26.8683 12.6358C26.8225 12.5492 26.7672 12.4493 26.7455 12.414C26.7238 12.3785 26.5804 12.108 26.4271 11.8125C26.2738 11.5173 26.1383 11.2596 26.1258 11.2399C26.1135 11.2204 25.9887 10.9852 25.8481 10.7174C25.7077 10.4498 25.5294 10.1115 25.452 9.96584C25.3747 9.82016 25.2705 9.62362 25.2203 9.52925C25.1703 9.43465 24.9997 9.11259 24.8411 8.81344C24.4743 8.12214 24.1289 7.45993 23.9485 7.1026C23.7866 6.78146 23.6932 6.61699 23.6532 6.58103C23.6285 6.55881 23.5942 6.55583 23.3605 6.55721ZM14.2773 6.57507C13.5973 6.5627 12.8139 6.65662 12.1981 6.82933C11.414 7.049 10.9679 7.26111 10.4846 7.64295C10.0904 7.95447 9.80758 8.28454 9.58628 8.69181C9.35436 9.11832 9.2207 9.76175 9.27111 10.2091C9.30325 10.4947 9.34164 10.6546 9.43853 10.9041C9.67693 11.517 10.1033 12.0457 10.6525 12.4094C11.1182 12.7178 11.386 12.8279 12.3181 13.093C13.2421 13.3557 14.1053 13.5483 15.046 13.7016C15.7276 13.8124 15.9362 13.8523 16.0676 13.8965C16.342 13.989 16.6209 14.1686 16.7777 14.3537C16.8834 14.479 16.925 14.5486 16.9721 14.6799C17.0057 14.7726 17.0096 14.8049 17.0101 14.9909C17.0108 15.1462 17.0045 15.2218 16.9853 15.2915C16.8272 15.8678 16.4442 16.2407 15.7861 16.4583C15.2992 16.6193 14.5097 16.6688 13.9261 16.5751C12.8453 16.4013 12.2126 16.0048 11.8413 15.2695C11.7326 15.0544 11.6353 14.8086 11.5983 14.6545C11.5377 14.402 11.524 14.3677 11.4836 14.3704C11.4637 14.3716 11.3758 14.3796 11.2884 14.3878C11.201 14.3961 10.9538 14.4188 10.7392 14.4387C9.93822 14.5131 9.26926 14.5873 9.25261 14.6038C9.23851 14.6176 9.26672 14.8011 9.33147 15.1188C9.51507 16.0196 9.88874 16.7836 10.4368 17.3775C10.9182 17.8995 11.6704 18.2718 12.6252 18.4612C13.1468 18.5645 13.8486 18.6474 14.374 18.6678C14.9463 18.69 15.4289 18.6454 16.1515 18.5031C17.2272 18.2917 17.8074 18.0175 18.3855 17.4465C18.6058 17.2286 18.7321 17.0646 18.8888 16.7925C18.9904 16.6166 19.1462 16.2787 19.1982 16.1218C19.3152 15.7702 19.3867 15.2802 19.3687 14.9577C19.3532 14.6868 19.3076 14.3267 19.2611 14.1104C19.2123 13.8837 19.1955 13.8308 19.1039 13.6093C18.9409 13.2155 18.7742 12.9631 18.4937 12.685C18.1743 12.3684 17.8256 12.1483 17.3872 11.9866C17.1599 11.9028 17.0089 11.8654 16.5275 11.7754C15.554 11.5935 14.8251 11.43 14.1788 11.2481C14.0278 11.2055 13.7839 11.1372 13.6371 11.0965C12.4101 10.7559 12.0327 10.4863 12.0327 9.94935C12.0327 9.67837 12.165 9.40762 12.4212 9.15428C12.5354 9.04113 12.7301 8.89797 12.8552 8.8352C13.1697 8.67738 13.7991 8.54796 14.2512 8.54842C14.627 8.54888 15.249 8.65241 15.5917 8.77084C15.8271 8.85238 16.0715 9.01501 16.1977 9.17444C16.3695 9.39136 16.5434 9.7125 16.6651 10.0373C16.7557 10.2794 16.7562 10.2808 16.8057 10.2808C16.829 10.2808 16.9564 10.2746 17.0887 10.2668C17.2212 10.2593 17.479 10.2462 17.6619 10.238C18.2497 10.2109 18.8012 10.1812 18.8877 10.1715C18.9846 10.161 19.0149 10.1385 19.0059 10.0836C18.9453 9.71548 18.8329 9.28301 18.7314 9.02761C18.6558 8.83772 18.4902 8.52139 18.3822 8.36013C18.0173 7.81543 17.6048 7.45466 17.026 7.17406C16.3404 6.84216 15.5507 6.65387 14.562 6.58721C14.4697 6.58103 14.3745 6.57691 14.2773 6.57507Z",fill:t.labelPrimary}))};function f2(e){const{COLORS:t}=bL();return M.createElement(f1,{width:48,height:48,viewBox:"0 0 56 56",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M28 51.615c13.255 0 24-10.745 24-24s-10.745-24-24-24-24 10.745-24 24 10.745 24 24 24zm-6.137-15.402a1 1 0 001.51 1.302l9.334-9.334.097-.112a1 1 0 00-.097-1.302l-9.333-9.333-.112-.097a1 1 0 00-1.302.097l-.097.112a1 1 0 00.097 1.302l8.625 8.626L21.96 36.1l-.097.113z",fill:t.bgSliderKnob}))}const _2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{d:"M12 2C17.53 2 22 6.48 22 12C22 17.53 17.53 22 12 22C6.48 22 2 17.53 2 12C2 6.48 6.48 2 12 2ZM11.65 6.93C11.24 6.93 10.9 7.26 10.9 7.68V12.73C10.9 12.99 11.04 13.23 11.27 13.37L15.19 15.71C15.31 15.78 15.44 15.82 15.58 15.82C15.83 15.82 16.08 15.69 16.22 15.45C16.43 15.1 16.32 14.64 15.96 14.42L12.4 12.3V7.68C12.4 7.26 12.06 6.93 11.65 6.93Z",fill:e?.color??t.labelPrimary}))},g2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:"41",height:"26",viewBox:"0 0 41 26",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M38.731 1.43448H1.43448V24.5655H38.731V1.43448ZM0 0V26H40.1655V0H0Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M5.86475 6.40173H8.48226V13.423C8.48226 14.5372 8.51468 15.2594 8.57953 15.5895C8.69154 16.1201 8.95683 16.5475 9.37539 16.8718C9.79986 17.1901 10.3776 17.3493 11.1086 17.3493C11.8514 17.3493 12.4115 17.199 12.7888 16.8983C13.1661 16.5917 13.393 16.2174 13.4697 15.7753C13.5463 15.3331 13.5846 14.5991 13.5846 13.5734V6.40173H16.2021V13.2108C16.2021 14.7672 16.1314 15.8666 15.9899 16.5092C15.8484 17.1518 15.5861 17.6942 15.2029 18.1363C14.8256 18.5785 14.3186 18.9322 13.6819 19.1975C13.0452 19.4569 12.214 19.5866 11.1882 19.5866C9.95019 19.5866 9.00989 19.4451 8.3673 19.1621C7.73061 18.8732 7.22656 18.5018 6.85516 18.0479C6.48375 17.5881 6.2391 17.1076 6.12119 16.6065C5.95023 15.8637 5.86475 14.7672 5.86475 13.3169V6.40173Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M18.9611 6.40173H23.7452C24.824 6.40173 25.6464 6.48427 26.2124 6.64934C26.9728 6.87336 27.6243 7.27129 28.1666 7.84313C28.709 8.41498 29.1217 9.11652 29.4047 9.94775C29.6876 10.7731 29.8291 11.793 29.8291 13.0074C29.8291 14.0745 29.6965 14.9941 29.4312 15.7664C29.1069 16.7097 28.6442 17.4731 28.0428 18.0567C27.5889 18.4989 26.9758 18.8438 26.2035 19.0914C25.6258 19.2741 24.8535 19.3655 23.8867 19.3655H18.9611V6.40173ZM21.5787 8.59478V17.1813H23.5329C24.264 17.1813 24.7916 17.14 25.1158 17.0575C25.5403 16.9514 25.8911 16.7716 26.1681 16.5181C26.4511 16.2646 26.681 15.8489 26.8579 15.2712C27.0347 14.6876 27.1232 13.8947 27.1232 12.8925C27.1232 11.8903 27.0347 11.1209 26.8579 10.5844C26.681 10.048 26.4334 9.62941 26.1151 9.32875C25.7967 9.02809 25.3929 8.8247 24.9036 8.71858C24.5381 8.63605 23.8218 8.59478 22.7548 8.59478H21.5787Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M31.978 19.3655V6.40173H34.5955V19.3655H31.978Z",fill:t.labelPrimary}))},y2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:"82",height:"28",viewBox:"0 0 82 28",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M40.2613 1.10811H1.10811V26.2252H40.2613V1.10811ZM0 0V27.3333H41.3694V0H0Z",fill:t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M80.8919 1.10811H41.3693V26.2252H80.8919V1.10811ZM40.2612 0V27.3333H82V0H40.2612Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M10.1362 8.20728H12.4318V14.365C12.4318 15.3422 12.4602 15.9755 12.5171 16.265C12.6153 16.7304 12.848 17.1052 13.2151 17.3896C13.5873 17.6688 14.094 17.8084 14.7351 17.8084C15.3866 17.8084 15.8777 17.6765 16.2086 17.4128C16.5395 17.144 16.7386 16.8157 16.8058 16.4279C16.873 16.0401 16.9066 15.3965 16.9066 14.4968V8.20728H19.2022V14.1789C19.2022 15.5438 19.1402 16.508 19.0161 17.0716C18.892 17.6352 18.6619 18.1108 18.3258 18.4986C17.9949 18.8863 17.5503 19.1966 16.9919 19.4292C16.4335 19.6567 15.7045 19.7704 14.8049 19.7704C13.7192 19.7704 12.8945 19.6464 12.331 19.3982C11.7726 19.1449 11.3305 18.8191 11.0048 18.421C10.6791 18.0177 10.4645 17.5964 10.3611 17.1569C10.2112 16.5055 10.1362 15.5438 10.1362 14.2719V8.20728Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M21.343 19.5766V8.20728H23.6385V13.256L28.2762 8.20728H31.3628L27.0819 12.6356L31.5955 19.5766H28.6252L25.4998 14.2409L23.6385 16.141V19.5766H21.343Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M45.9097 19.5766V8.20728H50.7412C51.9562 8.20728 52.8377 8.31068 53.3858 8.51749C53.939 8.71913 54.3811 9.08104 54.7119 9.60323C55.0428 10.1254 55.2083 10.7226 55.2083 11.3947C55.2083 12.2478 54.9575 12.9535 54.456 13.5119C53.9545 14.0651 53.2048 14.4141 52.207 14.5589C52.7033 14.8484 53.1118 15.1664 53.4323 15.5128C53.758 15.8592 54.1949 16.4744 54.743 17.3585L56.1312 19.5766H53.3858L51.7262 17.1026C51.1367 16.2185 50.7335 15.6627 50.5163 15.4352C50.2992 15.2026 50.0691 15.0449 49.8261 14.9622C49.5831 14.8743 49.1979 14.8303 48.6706 14.8303H48.2052V19.5766H45.9097ZM48.2052 13.0156H49.9037C51.0049 13.0156 51.6925 12.969 51.9666 12.876C52.2406 12.7829 52.4552 12.6226 52.6103 12.3951C52.7654 12.1677 52.8429 11.8833 52.8429 11.5421C52.8429 11.1595 52.7395 10.8518 52.5327 10.6192C52.3311 10.3813 52.0441 10.2314 51.6719 10.1694C51.4857 10.1435 50.9274 10.1306 49.9967 10.1306H48.2052V13.0156Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M57.0621 19.5766V8.20728H65.4921V10.1306H59.3577V12.6511H65.0656V14.5666H59.3577V17.661H65.7093V19.5766H57.0621Z",fill:t.labelPrimary}),M.createElement(l1,{d:"M67.3382 19.5766V8.20728H71.022C72.4179 8.20728 73.3279 8.26415 73.7519 8.37789C74.4033 8.54851 74.9488 8.92076 75.3882 9.49466C75.8277 10.0634 76.0474 10.8001 76.0474 11.7049C76.0474 12.4029 75.9208 12.9897 75.6674 13.4654C75.4141 13.941 75.0909 14.3159 74.698 14.5899C74.3102 14.8587 73.9147 15.0371 73.5114 15.125C72.9634 15.2336 72.1698 15.2879 71.1306 15.2879H69.6338V19.5766H67.3382ZM69.6338 10.1306V13.3568H70.8902C71.7949 13.3568 72.3999 13.2973 72.7049 13.1784C73.0099 13.0595 73.2478 12.8734 73.4184 12.62C73.5942 12.3667 73.6821 12.072 73.6821 11.7359C73.6821 11.3223 73.5606 10.9811 73.3176 10.7122C73.0746 10.4434 72.7669 10.2754 72.3947 10.2081C72.1207 10.1564 71.57 10.1306 70.7428 10.1306H69.6338Z",fill:t.labelPrimary}))},v2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9617 12.9951H11.9927C14.8247 12.9951 17.1287 10.6912 17.1287 7.85917C17.1287 5.02717 14.8247 2.72217 11.9927 2.72217C9.15975 2.72217 6.85575 5.02717 6.85575 7.85617C6.85075 9.22517 7.37975 10.5132 8.34375 11.4841C9.30675 12.4541 10.5917 12.9911 11.9617 12.9951ZM8.35575 7.85917C8.35575 5.85417 9.98775 4.22217 11.9927 4.22217C13.9977 4.22217 15.6287 5.85417 15.6287 7.85917C15.6287 9.86417 13.9977 11.4951 11.9927 11.4951H11.9647C10.9967 11.4931 10.0897 11.1131 9.40775 10.4262C8.72575 9.74017 8.35275 8.82917 8.35575 7.85917Z",fill:e?.color??t.labelPrimary}),M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M4.40552 19.8591C4.40552 23.4841 10.1215 23.4841 11.9995 23.4841C13.8775 23.4841 19.5945 23.4841 19.5945 19.8371C19.5945 17.0441 16.1165 14.6841 11.9995 14.6841C7.88352 14.6841 4.40552 17.0541 4.40552 19.8591ZM5.90552 19.8591C5.90552 18.1241 8.51152 16.1841 11.9995 16.1841C15.4885 16.1841 18.0945 18.1131 18.0945 19.8371C18.0945 21.2611 16.0435 21.9841 11.9995 21.9841C7.95652 21.9841 5.90552 21.2691 5.90552 19.8591Z",fill:e?.color??t.labelPrimary}))},b2=e=>{const{COLORS:t}=bL();return M.createElement(f1,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},M.createElement(l1,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.007 3C13.0263 3 13.9386 3.52359 14.4443 4.40053L21.6252 16.836C22.1279 17.706 22.1249 18.7443 21.6163 19.6123C21.1076 20.4814 20.1992 21 19.187 21H4.81404C3.80075 21 2.89239 20.4814 2.38374 19.6123C1.8751 18.7443 1.8721 17.706 2.37475 16.836L9.5697 4.39855C10.0753 3.5226 10.9867 3 12.007 3ZM12.006 4.48466C11.5303 4.48466 11.1066 4.72814 10.8688 5.13692L3.67584 17.5734C3.442 17.9792 3.444 18.4632 3.68083 18.868C3.91767 19.2728 4.34137 19.5153 4.81404 19.5153H19.187C19.6586 19.5153 20.0823 19.2728 20.3192 18.868C20.557 18.4632 20.559 17.9792 20.3232 17.5734L13.1432 5.13692C12.9064 4.72814 12.4827 4.48466 12.006 4.48466ZM11.9992 15.3712C12.5518 15.3712 12.9985 15.8136 12.9985 16.3609C12.9985 16.9083 12.5518 17.3507 11.9992 17.3507C11.4466 17.3507 10.9949 16.9083 10.9949 16.3609C10.9949 15.8136 11.4376 15.3712 11.9892 15.3712H11.9992ZM11.9972 9.49687C12.4109 9.49687 12.7467 9.82943 12.7467 10.2392V13.3075C12.7467 13.7173 12.4109 14.0498 11.9972 14.0498C11.5835 14.0498 11.2477 13.7173 11.2477 13.3075V10.2392C11.2477 9.82943 11.5835 9.49687 11.9972 9.49687Z",fill:e?.color??t.labelPrimary}))};var S2=(e=>(e.MainBottomTabs="MainBottomTabs",e.NewCalculationStack="NewCalculationStack",e.AccountWebView="AccountWebView",e.ActiveInsulin="ActiveInsulin",e.RegisterActiveInsulin="RegisterActiveInsulin",e.CalculationBottomTabs="CalculationBottomTabs",e.LoadingRecommendation="LoadingRecommendation",e.Recommendation="Recommendation",e.LeavingRecommendation="LeavingRecommendation",e.DashboardTab="DashboardTab",e.LogbooksTab="LogbooksTab",e.FoodTab="FoodTab",e.SettingsTab="SettingsTab",e.Dashboard="Dashboard",e.ActiveInsulinChart="ActiveInsulinChart",e.MyDay="MyDay",e.GlucoseBGM="GlucoseBGM",e.GlucoseCGM="GlucoseCGM",e.CarbohydrateChart="CarbohydrateChart",e.RapidInsulinChart="RapidInsulinChart",e.TimeInRange="TimeInRange",e.LicensingStatus="LicensingStatus",e.LicensingWebView="LicensingWebView",e.LicensingInfoWebView="LicensingInfoWebView",e.Logbooks="Logbooks",e.RecommendationLogbook="RecommendationLogbook",e.Settings="Settings",e.ProfileStack="ProfileStack",e.GlucoseSettings="GlucoseSettings",e.ActivitySettings="ActivitySettings",e.InsulinSettingsStack="InsulinSettingsStack",e.Notifications="Notifications",e.Theme="Theme",e.SetupGlucoseMeters="SetupGlucoseMeters",e.IFU="IFU",e.Support="Support",e.SupportWebView="SupportWebView",e.SupportContact="SupportContact",e.Legal="Legal",e.GlucoseUnit="GlucoseUnit",e.Profile="Profile",e.BiologicalSex="BiologicalSex",e.DiabetesType="DiabetesType",e.InsulinSettings="InsulinSettings",e.TreatmentType="TreatmentType",e.RapidActingInsulin="RapidActingInsulin",e.LongActingInsulin="LongActingInsulin",e.GlucoseTab="GlucoseTab",e.CarbsTab="CarbsTab",e.ActivityTab="ActivityTab",e.SummaryTab="SummaryTab",e.NovoPenSync="NovoPenSync",e.NovoPenConflict="NovoPenConflict",e.NovoPenSetupScreen1="NovoPenSetupScreen1",e.NovoPenSetupScreen2="NovoPenSetupScreen2",e.NovoPenSetupScreen3="NovoPenSetupScreen3",e.NovoPenSetupScreen4="NovoPenSetupScreen4",e.SmartPenSetupStack="SmartPenSetupStack",e.SmartPenSetupScreen1="SmartPenSetupScreen1",e.SmartPenSetupScreen2="SmartPenSetupScreen2",e.RenameSmartPen="RenameSmartPen",e.SetupCGMWebview="SetupCGMWebview",e.SetupForecastWebview="SetupForecastWebview",e.AddActivity="AddActivity",e.AddLogbook="AddLogbook",e.AddCarbs="AddCarbs",e.CreateFood="CreateFood",e.FoodLibraryStack="FoodLibraryStack",e.SyncNovoPenStack="SyncNovoPenStack",e.NovoPenSetupStack="NovoPenSetupStack",e.FoodLibrary="FoodLibrary",e.FoodDetails="FoodDetails",e))(S2||{}),w2=(e=>(e.SetupBolusCalculator="SetupBolusCalculator",e.QuickGuideStack="QuickGuideStack",e.LicensingInfoWebView="LicensingInfoWebView",e.LicensingWebView="LicensingWebView",e.LicensingStatus="LicensingStatus",e.SetupStart="SetupStart",e.Setup="Setup",e.BiologicalSex="BiologicalSex",e.TreatmentType="TreatmentType",e.RapidActingInsulin="RapidActingInsulin",e.LongActingInsulin="LongActingInsulin",e.InsulinSettings="InsulinSettings",e.QuickGuideStart="QuickGuideStart",e.QuickGuide="QuickGuide",e.QuickGuideAllSet="QuickGuideAllSet",e))(w2||{});const k2={selectedEventUUID:null,activityDurationSeconds:0},C2=cL()(e=>({...k2,activityStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(k2)}}}));var E2="/api/v3";const I2=uV?"/api/v2":Wj.HEDIA_API_URL_V2,x2=uV?E2:Wj.HEDIA_API_URL_V3,T2={frequentlyAdded:[],searchResults:[],myFood:[],isLoading:!1,hasSearched:!1,isMyFoodTab:!1,query:"",selectedFoodItem:void 0,animatedEntryId:void 0},O2=cL()((t,n)=>({...T2,foodStoreActions:{set:e=>{t(t=>({...t,...e}))},clear:()=>{t(T2)},search:async i=>{const r=encodeURIComponent(n().query.toLowerCase().trim());try{t({isLoading:!0});const e=await R2(r,i);if(!e)throw new Error("[foodStore::search] Failed to search for food items");t({searchResults:e})}catch(e){console.error(e),t({searchResults:[]})}finally{t({isLoading:!1})}},loadMyFood:async()=>{try{t({isLoading:!0});const e=await L2();if(!e)throw new Error("[foodStore::loadMyFood] Failed to load my food items");t({myFood:e})}catch(e){console.error(e)}finally{t({isLoading:!1})}},createMyFoodItem:async n=>{try{t({isLoading:!0});const e=await P2(n);if(!e)throw new Error("[foodStore::createMyFoodItem] Failed to create food item");return t(t=>({myFood:[e,...t.myFood],animatedEntryId:e.id.toString()})),!0}catch(e){return console.error(e),!1}finally{t({isLoading:!1})}},updateMyFoodItem:async i=>{try{t({isLoading:!0});const e=await M2(i);if(!e)throw new Error("[foodStore::updateMyFoodItem] Failed to update food item");return t(t=>({myFood:t.myFood.map(t=>t.id===e.id?e:t)})),e.id===n().selectedFoodItem?.id&&t({selectedFoodItem:e}),!0}catch(e){return console.error(e),!1}finally{t({isLoading:!1})}},deleteMyFoodItem:async n=>{try{if(t({isLoading:!0}),!n.id)throw new Error("[foodStore::deleteMyFoodItem] Failed to delete food item");return await D2(n),t(e=>({myFood:e.myFood.filter(e=>e.id!==n.id)})),!0}catch(e){return console.error(e),!1}finally{t({isLoading:!1})}},loadFrequentFoodItems:async()=>{try{t({isLoading:!0});const e=await A2();if(!e)throw new Error("[foodStore::loadFrequentFoodItems] Failed to load frequently added food items");t({frequentlyAdded:e})}catch(e){console.error(e),t({frequentlyAdded:[]})}finally{t({isLoading:!1})}}}})),R2=async(t,n)=>{try{const e=await VX(`${I2}/food?search=${t}&language=${n}`);return await e.json()}catch(e){return void console.error(e)}},A2=async()=>{try{const e=await VX(`${I2}/food/frequent`);return await e.json()}catch(e){return void console.error(e)}},L2=async()=>{try{const e=await VX(`${I2}/food/myfood`);return await e.json()}catch(e){return void console.error(e)}},P2=async t=>{try{const e=await VX(`${I2}/food`,{method:NL.HTTPRequestMethod.POST,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await e.json()}catch(e){return void console.error(e)}},M2=async t=>{try{const e=await VX(`${I2}/food/${t.id}`,{method:NL.HTTPRequestMethod.PUT,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await e.json()}catch(e){return void console.error(e)}},D2=async e=>{await VX(`${x2}/food-items/${e.id}`,{method:NL.HTTPRequestMethod.DELETE})},N2={availableGlucoseReadings:[],selectedReadingId:null},F2=cL()((e,t)=>({...N2,glucoseStoreActions:{set:t=>{e(e=>({...e,...t}))},addAvailableGlucoseReading:t=>{e(e=>{const n=e.availableGlucoseReadings.findIndex(e=>e.id===t.id||e.source===t.source);if(-1!==n){const i=[...e.availableGlucoseReadings];return i[n]=t,{...e,availableGlucoseReadings:i}}return{...e,availableGlucoseReadings:[...e.availableGlucoseReadings,t]}})},setAvailableGlucoseReadings:t=>{e(e=>({...e,availableGlucoseReadings:t}))},setSelectedReadingId:t=>{e(e=>({...e,selectedReadingId:t}))},getReadingById:e=>{if(null===e)return null;return t().availableGlucoseReadings.find(t=>t.id===e)??null},clear:()=>{e(N2)}}})),B2={isGoToSettingsPressed:!1,showDiscardCalculationModal:!1,showDiscardSmartPenSetupModal:!1,showSyncErrorModal:!1},j2=cL()(e=>({...B2,modalStoreActions:{set:t=>{e(e=>({...e,...t}))},clear:()=>{e(B2)}}})),V2={setupCalculatorSettings:{},totalDailyDosage:null},H2=cL()(e=>({...V2,setupCalculatorActions:{setSetupCalculatorStoreValues:t=>{e(e=>({setupCalculatorSettings:{...e.setupCalculatorSettings,...t}}))},setTotalDailyDosage:t=>{e({totalDailyDosage:t})},clear:()=>{e(V2)}}})),z2=()=>H2(e=>e.setupCalculatorActions),U2=()=>H2(e=>e.setupCalculatorSettings),G2=()=>H2(e=>e.totalDailyDosage),W2=()=>{TX.getState().carbohydrateStoreActions.clear(),F2.getState().glucoseStoreActions.clear(),C2.getState().activityStoreActions.clear()},Y2={top:10,bottom:10,left:20,right:20},$2=()=>{const{goBack:e}=Wp(),{COLORS:t}=bL();return D.createElement(eh,{onPress:e,testID:"header-back-button",style:({pressed:e})=>[{opacity:e?.5:1},e0.iconContainerOutline,e0.backButton],hitSlop:Y2},D.createElement(Z1,{height:27,width:27,color:t.iconBrand}))},X2=({onPress:e})=>{const{pop:t}=Wp(),{COLORS:n}=bL();return D.createElement(eh,{onPress:e??(()=>{t()}),testID:"header-close-button",style:({pressed:e})=>[{opacity:e?.5:1},e0.iconContainerOutline,e0.closeButton],hitSlop:Y2},D.createElement(J1,{height:27,width:27,color:n.iconBrand}))},q2=()=>{const{navigate:e}=Wp(),{COLORS:t}=bL(),n=M.useCallback(()=>{uV&&W2(),e(S2.SettingsTab)},[e]);return D.createElement(eh,{onPress:n,testID:"header-profile-button",style:({pressed:e})=>[{opacity:e?.5:1},e0.iconContainerOutline,e0.profileButton],hitSlop:Y2},D.createElement(v2,{color:t.iconBrand}))},Z2=({onPress:e,title:t,disabled:n=!1})=>{const{t:i}=iV(),{COLORS:r}=bL();return D.createElement(eh,{style:({pressed:e})=>[{opacity:e?.5:1},e0.doneButton],onPress:()=>{!n&&e()},disabled:n},D.createElement(gj,{style:[e0.doneText,{color:r.textNavigationBarLabel},n&&{color:r.labelTertiary}],allowFontScaling:!1},t??i("button_add")))},K2=({onPress:e})=>{const{t:t}=iV(),n=Wp(),{COLORS:i}=bL(),r=M.useCallback(()=>{n.pop()},[n]);return D.createElement(eh,{style:({pressed:e})=>[{opacity:e?.5:1},e0.cancelButton],onPress:e??r},D.createElement(gj,{style:[e0.cancelText,{color:i.textNavigationBarLabel}],allowFontScaling:!1},t("button_cancel")))},Q2=({onPress:e})=>{const{t:t}=iV(),n=Wp(),{COLORS:i}=bL(),r=M.useCallback(()=>{n.pop()},[n]);return D.createElement(eh,{style:({pressed:e})=>[{opacity:e?.5:1},e0.cancelButton],onPress:e??r},D.createElement(gj,{style:[e0.cancelText,{color:i.textNavigationBarLabel}],allowFontScaling:!1},t("button_close")))},J2=({onPress:e})=>{const{COLORS:t}=bL();return D.createElement(eh,{onPress:e,style:({pressed:e})=>[{opacity:e?.5:1},e0.iconContainerOutline,e0.editButton],hitSlop:Y2},D.createElement(i2,{color:t.iconBrand}))},e0=Ei.create({headerLeftContainerStyle:{paddingLeft:16},headerTitle:{...oj.medium_Base},modalHeaderTitle:{...oj.medium_Base},iconContainerOutline:{padding:4},iconContainer:{padding:4},backButton:{marginLeft:uV?4:-12,marginRight:12},closeButton:{marginLeft:uV?4:-12,marginRight:uV?12:0},cancelButton:{marginLeft:uV?12:0},profileButton:{marginRight:uV?12:0},doneButton:{paddingRight:uV?12:0,paddingLeft:8},editButton:{marginRight:uV?12:-4,marginLeft:4},doneText:{...oj.semiBold_Base},cancelText:{...oj.regular_Base}}),t0={headerShown:!0,headerLeft:$2,headerTitleStyle:e0.headerTitle,headerTitleAlign:"center",headerBlurEffect:"regular"};e0.modalHeaderTitle;const n0={animationEnabled:!0,cardStyle:{flex:1},headerShown:!0,headerLeft:$2,headerTitleStyle:e0.headerTitle,headerTitleAlign:"center",headerTitleAllowFontScaling:!1},i0={...n0,presentation:"modal",headerLeft:X2,headerTitleStyle:e0.modalHeaderTitle,headerTitleAllowFontScaling:!1,headerLeftContainerStyle:{flex:1},headerTitleContainerStyle:{flex:3,alignItems:"center"},headerRightContainerStyle:{flex:1}},r0={headerLeftContainerStyle:e0.headerLeftContainerStyle,headerTitleStyle:e0.headerTitle,headerTitleAlign:"center",headerTitleAllowFontScaling:!1},a0=({setUnit:e,currentUnit:t})=>{const{COLORS:n}=bL(),i="ml"===t,r="cl"===t;return M.createElement(_a,{style:[o0.container,{backgroundColor:n.bgSegmentCard}]},M.createElement(xc,{style:i?[o0.selected,{backgroundColor:n.bgBrand}]:o0.unselected,onPress:()=>{e("ml")},testID:`unit-selector-ml-button-${i}`},M.createElement(gj,{style:[o0.unitText,{color:i?n.textLabelActive:n.textLabelInactive}]},"ml")),M.createElement(xc,{style:r?[o0.selected,{backgroundColor:n.bgBrand}]:o0.unselected,onPress:()=>{e("cl")},testID:`unit-selector-cl-button-${r}`},M.createElement(gj,{style:[o0.unitText,{color:r?n.textLabelActive:n.textLabelInactive}]},"cl")))},o0=Ei.create({container:{flex:1,flexDirection:"row",borderRadius:16,marginVertical:8,overflow:"hidden",padding:2},unselected:{flex:1,alignItems:"center",justifyContent:"center"},selected:{flex:1,alignItems:"center",justifyContent:"center",borderRadius:16},unitText:{...oj.regular_SM,padding:8}}),s0=({ref:e,style:t,onChangeText:n,onFocusChange:i,...r})=>{const{COLORS:a}=bL(),o=M.useCallback(e=>{const t=e.replace(/\D+/g,"");n(t)},[n]),s=M.useCallback(()=>{i?.(!0)},[i]),l=M.useCallback(()=>{i?.(!1)},[i]);return D.createElement(kh,{cursorColor:a.iconBrand,placeholder:"-",placeholderTextColor:a.labelSecondary,maxLength:3,inputMode:"numeric",enterKeyHint:"done",ref:e,style:t,onFocus:s,onBlur:l,autoFocus:void 0!==i,...r,onChangeText:o})},l0="add-carbs-details",u0=uV&&{outline:"none"},c0=()=>{const{t:e}=iV(),{COLORS:t}=bL(),n=Wp(),i=df(),{selectedFoodItem:r}=O2(),{cartItems:a,carbohydrateStoreActions:o}=TX(),[s,l]=M.useState(!1),u=M.useMemo(()=>a.find(e=>e.foodItem.id===r?.id),[a,r]);if(!r)throw new Error("[AddCarbs::render] selectedFoodItem is undefined");const c=M.useMemo(()=>{const e={foodItem:r,amount:0,unit:r.liquid?"ml":"g"};return u??e},[u,r]),[d,h]=M.useState(c.amount?c.amount.toString():""),[m,p]=M.useState(c.foodItem.liquid?"ml":"g"),[f,_]=M.useState(!1),[g,y]=M.useState(!1),[v,b]=M.useState(!1),S=M.useCallback((e=0)=>{const t=Number(d)||100,n="ml"===m||"g"===m?t:10*t;return Math.round(n*e/100)},[d,m]),w=M.useCallback(()=>{S(c.foodItem.carbohydrates)>300?_(!0):(o.upsertCartItem({foodItem:r,unit:m,amount:Number(d)}),null!==r.user_id?jX(FX.CarbsFoodLibraryPersonalInput):jX(FX.CarbsFoodLibraryDatabaseInput),n.pop(),!i.params.isCarbItem&&setTimeout(()=>{n.pop()},500))},[S,c.foodItem.carbohydrates,o,r,m,d,n,i.params.isCarbItem]);M.useEffect(()=>{const e=()=>{n.navigate(S2.CreateFood)};n.setOptions({title:c.foodItem.title,headerLeft:()=>D.createElement(Q2,{onPress:()=>{const e=c.amount?c.amount.toString():"";d===e?n.pop():y(!0)}}),headerRight:null!==r.user_id?()=>D.createElement(J2,{onPress:e}):()=>null})},[c.foodItem.title,d,n,r,c.amount]);const k=M.useCallback(()=>{v&&n.pop()},[n,v]),C=M.useMemo(()=>void 0===m?"":"g"===m?e("grams"):m,[m,e]);return D.createElement(Xa,{contentContainerStyle:[d0.pageWrapper,{backgroundColor:t.bgSheet}],disableScrollViewPanResponder:!0,keyboardDismissMode:"on-drag"},D.createElement(_a,{style:[d0.calculationCard,{backgroundColor:t.bgSecondary}]},D.createElement(_a,{style:d0.row},r.liquid?D.createElement(_a,{style:d0.liquidInputContainer},D.createElement(s0,{placeholderTextColor:t.labelPrimary,style:[d0.amountInputLiquid,{color:t.labelPrimary,backgroundColor:t.bgSecondaryInputInactive,borderColor:t.divider},s&&{borderColor:t.borderInputFocus}],value:d,onChangeText:h,onFocusChange:l,testID:`${l0}-amount-input`}),D.createElement(a0,{setUnit:p,currentUnit:m})):D.createElement(_a,{style:[d0.gramInputContainer,{borderColor:t.divider,backgroundColor:t.bgSecondaryInputInactive},s&&{borderColor:t.borderInputFocus}]},D.createElement(s0,{placeholderTextColor:t.labelPrimary,style:[d0.amountInputGrams,{color:t.labelPrimary}],value:d,onFocusChange:l,onChangeText:h,testID:`${l0}-amount-input`}),D.createElement(gj,{style:d0.weightText},e("food_card_unit")))),D.createElement(_a,{style:d0.dashedLineContainer},Array.from({length:20},(e,t)=>t).map(e=>D.createElement(_a,{key:e,style:[d0.dashedLine,{backgroundColor:t.divider}]}))),D.createElement(_a,{style:d0.carbsTotalContainer},D.createElement(_a,{style:d0.left},D.createElement(gj,{style:d0.carbAmount},Number(d)<1?0:S(c.foodItem.carbohydrates)),D.createElement(gj,{style:d0.carbsText},e("my_food_add_unit"))),D.createElement(mj,{title:e("button_add"),onPress:w,disabled:Number(d)<1,size:hj.Small}))),D.createElement(_a,{style:d0.foodNameContainer},D.createElement(gj,{style:d0.title},c.foodItem.title),D.createElement(gj,{style:[d0.subtitle,{color:t.labelSecondary}]},e("food_library_carb_body",{amount:""===d?"100":d,unit:C}))),!!c.foodItem.description&&c.foodItem.description!==c.foodItem.title&&D.createElement(_a,{style:d0.descriptionContainer},D.createElement(gj,{style:[d0.descriptionHeader,{color:t.labelSecondary}]},e("food_overview_description")),D.createElement(gj,{style:d0.description,testID:`${l0}-description`},c.foodItem.description)),D.createElement(_a,{style:[d0.valuesCard,{backgroundColor:t.bgSecondary}]},D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("logbook_personal_log_card_carbs")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}],testID:`${l0}-carbs`},S(c.foodItem.carbohydrates),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit")))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_library_item_energy")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}],testID:`${l0}-kcal`},S(c.foodItem.energy),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," kcal"))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_add_library_item_protein")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}]},S(c.foodItem.protein),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit")))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_add_library_item_sugar")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}]},S(c.foodItem.sugar),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit")))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_add_library_item_fibers")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}]},S(c.foodItem.fibers),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit")))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_add_library_item_fat")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}]},S(c.foodItem.fat),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit")))),D.createElement(_a,{style:[d0.line,{backgroundColor:t.divider}]}),D.createElement(_a,{style:d0.tableCell},D.createElement(gj,{style:d0.cellText},e("food_add_library_item_sfat")),D.createElement(gj,{style:[d0.cellValue,{color:t.labelSecondary}]},S(c.foodItem.saturated_fat),D.createElement(gj,{style:[d0.gText,{color:t.labelSecondary}]}," ",e("logbook_collum_unit"))))),D.createElement(lz,{isVisible:f,title:e("current_glucose_invalid_modal_title"),message:e("current_glucose_invalid_modal_body"),buttons:[{testID:"close-button",title:e("button_close"),onPress:()=>{_(!1)}}]}),D.createElement(lz,{isVisible:g,title:e("food_modal_discard_title"),onModalHide:k,buttons:[{type:dj.Error,testID:"discard-button",title:e("button_discard_changes"),onPress:()=>{y(!1),b(!0)}},{type:dj.Secondary,testID:"keep-button",title:e("button_cancel"),onPress:()=>{y(!1)}}]}))},d0=Ei.create({pageWrapper:{paddingHorizontal:16,paddingVertical:32},calculationCard:{padding:16,borderRadius:16,marginBottom:16},valuesCard:{borderRadius:16},row:{flexDirection:"row",marginBottom:24},liquidInputContainer:{flexDirection:"row",alignItems:"center",gap:16,flex:1,borderRadius:16,overflow:"hidden"},gramInputContainer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",flex:1,paddingHorizontal:16,borderWidth:1,borderRadius:16,overflow:"hidden"},amountInputGrams:{...oj.regular_Base,width:"100%",textAlign:"left",paddingVertical:16,flex:2,fontFamily:cV?aj.RobotoRegular:aj.PoppinsRegular,...u0},amountInputLiquid:{...oj.regular_Base,width:"100%",textAlign:"left",padding:16,flex:1,borderWidth:1,borderRadius:16,fontFamily:cV?aj.RobotoRegular:aj.PoppinsRegular,...u0},weightText:{flex:1,textAlign:"right"},line:{height:1},carbsTotalContainer:{justifyContent:"space-between",paddingTop:24,flexDirection:"row",flexWrap:"wrap"},left:{alignItems:"baseline",alignSelf:"center",flexDirection:"row",flexWrap:"wrap"},carbAmount:{...oj.bold_3XL,marginRight:4},carbsText:{...oj.medium_Base},foodNameContainer:{marginBottom:16},title:{...oj.semiBold_LG},subtitle:{...oj.regular_Base},tableCell:{flexDirection:"row",justifyContent:"space-between",alignContent:"center",paddingHorizontal:16,paddingVertical:16},cellText:{...oj.regular_Base,textAlign:"left"},cellValue:{...oj.regular_Base,textAlign:"right"},gText:{...oj.regular_Base},descriptionContainer:{marginBottom:16},descriptionHeader:{...oj.regular_XS},description:{...oj.regular_Base},dashedLineContainer:{flexDirection:"row",justifyContent:"space-between"},dashedLine:{height:1,width:8}}),h0=()=>{},m0={setDefaultMode:h0,setInputMode:h0,preload:h0,setFocusTo:h0},p0=()=>({remove:h0}),f0=_a,_0=_a,g0=()=>{},y0=()=>g0,v0=e=>({value:e,addListener:g0,removeListener:g0,modify:g0,get:()=>e,set:g0}),b0=v0(0),S0=v0(null),w0={enabled:!0,animated:{progress:new uu.Value(0),height:new uu.Value(0)},reanimated:{progress:b0,height:b0},layout:S0,setKeyboardHandlers:y0,setInputHandlers:y0,setEnabled:g0},k0=M.createContext(w0),C0=()=>M.useContext(k0);let E0={height:0,duration:0,timestamp:(new Date).getTime(),target:-1,type:"default",appearance:"light"};const I0={setDefaultMode:m0.setDefaultMode,setInputMode:m0.setInputMode,setFocusTo:m0.setFocusTo,preload:m0.preload,dismiss:async e=>(null==e||e.keepFocus,new Promise(e=>{e()})),isVisible:()=>!1,state:()=>E0};BR.createAnimatedComponent(uu.createAnimatedComponent(f0)),Ei.create({container:{flex:1},hidden:{display:"none",position:"absolute"}}),lr.OS;const x0=Aa.get("screen");let T0={width:x0.width,height:x0.height};const O0=["keyboardDidShow","keyboardDidHide"],R0=()=>({...I0.state(),isVisible:I0.isVisible()}),A0=e=>e;function L0(e,t){M.useEffect(()=>()=>I0.setDefaultMode(),[]),function(e,t){const n=C0();M.useLayoutEffect(()=>{const t=n.setKeyboardHandlers(e);return()=>t()},t)}(e,t)}lr.OS;const P0="android"===lr.OS&&lr.Version>=30||"ios"===lr.OS,M0={duration:250,easing:uE.bezier(.19919472913616398,.010644531250000006,.27920937042459737,.91025390625)},D0=(e,t)=>{let n;return t&&(n=t.find(t=>t>=e)),n??e};function N0(){return N0=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},N0.apply(null,arguments)}const F0=M.forwardRef(({children:e,onLayout:t,bottomOffset:n=0,disableScrollOnKeyboardHide:i=!1,enabled:r=!0,extraKeyboardSpace:a=0,ScrollViewComponent:o=BR.ScrollView,snapToOffsets:s,...l},u)=>{const c=kR(),d=uR(null),h=uR(0),m=LR(c),p=uR(0),f=uR(0),_=uR(!1),g=uR(-1),y=uR(0),v=uR(0),{input:b}={input:C0().layout},S=uR(null),w=uR(null),{height:k}=(()=>{const[e,t]=M.useState(T0);return M.useEffect(()=>(t(T0),()=>{}),[]),e})(),C=M.useCallback(e=>{"function"==typeof u?u(e):u&&(u.current=e),c(e)},[]),E=M.useCallback(e=>{d.value=c.current,null==t||t(e)},[t]),I=M.useCallback((e,t=!1)=>{var i,a,o;if(!r)return 0;if((null===(i=S.value)||void 0===i?void 0:i.parentScrollViewTarget)!==d.value)return 0;const l=k-f.value,u=((null===(a=S.value)||void 0===a?void 0:a.layout.absoluteY)||0)+((null===(o=S.value)||void 0===o?void 0:o.layout.height)||0);if(l-u<=n){const i=f.value-(k-u)+n,r=QR(e,[y.value,f.value],[0,D0(i+h.value,s)-h.value]),a=Math.max(r,0)+h.value;return lA(c,0,a,t),r}if(u<0){const e=l-n,i=h.value+u;lA(c,0,i-e,t)}return 0},[n,r,k,s]),x=M.useCallback(e=>{const t=QR(e.height,[0,f.value],[0,f.value+a]);p.value=t},[a]),T=M.useCallback(()=>{var e,t;const n=null===(e=w.value)||void 0===e?void 0:e.selection.end.y;return!(null===(t=b.value)||void 0===t||!t.layout||!n)&&(S.value={...b.value,layout:{...b.value.layout,height:JR(n,0,b.value.layout.height)}},!0)},[b,w,S]),O=M.useCallback(()=>{const e=h.value,t=S.value;T()&&(h.value=m.value,I(f.value,!0),h.value=e,S.value=t)},[I]),R=M.useCallback(()=>{O()},[O]),A=M.useMemo(()=>((e,t=0)=>{const n={time:0};return(...i)=>{const r=Date.now();if(!(r-n.time<t))return n.time=r,e(...i);n.time=r}})(R,200),[R]),L=M.useCallback(e=>{var t,n;const i=null===(t=w.value)||void 0===t?void 0:t.target,r=null===(n=w.value)||void 0===n?void 0:n.selection;if(w.value=e,e.target===i)return e.selection.end.position===e.selection.start.position&&(null==r?void 0:r.end.y)!==e.selection.end.y||e.selection.start.position!==e.selection.end.position?O():void A()},[O,A]);!function(e,t){const n=C0();M.useLayoutEffect(()=>{const t=n.setInputHandlers(e);return()=>t()},t)}({onSelectionChange:L},[L]),((e,t)=>{const n=uR(-1),i=uR(0),r=uR(0),a=uR(0);yR(()=>{if(!P0&&0!==r.value)return{duration:M0.duration,target:n.value,height:a.value,progress:a.value/r.value}},t=>{var n,a;t&&(null===(n=e.onMove)||void 0===n||n.call(e,t),t.height===i.value&&(null===(a=e.onEnd)||void 0===a||a.call(e,t),r.value=i.value))},t),L0({onStart:t=>{var o,s,l;if(!P0&&t.height===r.value)return null===(s=e.onStart)||void 0===s||s.call(e,t),void(null===(l=e.onEnd)||void 0===l||l.call(e,t));n.value=t.target,i.value=t.height,t.height>0&&(r.value=t.height),P0||(a.value=NE(t.height,M0)),null===(o=e.onStart)||void 0===o||o.call(e,{...t,duration:P0?t.duration:M0.duration})},onMove:t=>{var n;P0&&(null===(n=e.onMove)||void 0===n||n.call(e,t))},onEnd:t=>{var n;P0&&(null===(n=e.onEnd)||void 0===n||n.call(e,t))}},t)})({onStart:e=>{const t=f.value!==e.height&&e.height>0;_.value=e.height>0&&0===f.value;const n=0===e.height,i=g.value!==e.target&&-1!==e.target||t;t&&(y.value=f.value),n&&(y.value=0,h.value=v.value),(_.value||t||i)&&(h.value=m.value,f.value=e.height),i&&(g.value=e.target,T(),v.value=m.value),i&&!_.value&&(m.value+=I(e.height,!0))},onMove:e=>{x(e),i&&!_.value||I(e.height)},onEnd:e=>{f.value=e.height,h.value=m.value,x(e)}},[I,i,x]),M.useEffect(()=>{Bk(I)(f.value,!0)},[n]),yR(()=>b.value,(e,t)=>{(null==e?void 0:e.target)===(null==t?void 0:t.target)&&(null==e?void 0:e.layout.height)!==(null==t?void 0:t.layout.height)&&O()},[]);const P=pR(()=>r?{paddingBottom:p.value+1}:{},[r]);return D.createElement(o,N0({ref:C},l,{scrollEventThrottle:16,onLayout:E}),e,r&&D.createElement(BR.View,{style:P}))}),B0={width:13,height:2,borderRadius:1},j0={marginHorizontal:5,width:30,height:30,justifyContent:"center",alignItems:"center"};Ei.create({arrowUpContainer:j0,arrowDownContainer:{...j0,transform:[{rotate:"180deg"}]},arrow:{width:20,height:20,flexDirection:"row",alignItems:"center",justifyContent:"space-between"},arrowLeftLine:{...B0,transform:[{rotate:"-45deg"}],left:-.5},arrowRightLine:{...B0,transform:[{rotate:"45deg"}],left:-5.5}});lr.select({android:({children:e,onPress:t,disabled:n,accessibilityLabel:i,accessibilityHint:r,testID:a,rippleRadius:o=18,style:s,theme:l})=>{const u=function(e=A0){const[t,n]=M.useState(()=>e(R0()));return M.useEffect(()=>{const t=O0.map(t=>p0(t,()=>n(e(R0()))));return n(e(R0())),()=>{t.forEach(e=>e.remove())}},[]),t}(e=>e.appearance),c=M.useMemo(()=>({disabled:n}),[n]),d=M.useMemo(()=>dm.Ripple(l[u].ripple,!0,o),[u,o,l]);return D.createElement(dm,{accessibilityHint:r,accessibilityLabel:i,accessibilityRole:"button",accessibilityState:c,background:d,style:s,testID:a,onPress:t},D.createElement(_a,{style:s},e))},default:({children:e,onPress:t,disabled:n,accessibilityLabel:i,accessibilityHint:r,testID:a,style:o})=>{const s=n?_a:xc,l=M.useMemo(()=>({disabled:n}),[n]);return D.createElement(s,{accessibilityHint:r,accessibilityLabel:i,accessibilityRole:"button",accessibilityState:l,style:o,testID:a,onPress:t},e)}});"ios"===lr.OS&&parseInt(lr.Version,10),Ei.create({flex:{flex:1},toolbar:{position:"absolute",bottom:0,alignItems:"center",width:"100%",flexDirection:"row",height:42},arrows:{flexDirection:"row",paddingLeft:8},doneButton:{fontWeight:"600",fontSize:15},doneButtonContainer:{marginRight:16,marginLeft:8},floating:{alignSelf:"center",borderRadius:20,overflow:"hidden"}}),Ei.create({absolute:{position:"absolute"},stretch:{top:0,bottom:0,left:0,right:0}}),uu.createAnimatedComponent(_0);const V0=({onModalHide:e})=>{const{t:t}=iV(),{showSyncErrorModal:n,modalStoreActions:i}=j2();return D.createElement(lz,{isVisible:n,onModalHide:e,onModalShow:()=>{jX(FX.ErrorOffline)},title:t("glucose_modal_changes_title"),message:t("glucose_modal_changes_body"),buttons:[{title:t("glucose_modal_changes_button_confirm"),onPress:()=>{i.set({showSyncErrorModal:!1})}}]})},H0=[NL.ActivityEnum.Run,NL.ActivityEnum.Walk,NL.ActivityEnum.Cycling,NL.ActivityEnum.Swim,NL.ActivityEnum.Sport,NL.ActivityEnum.Workout,NL.ActivityEnum.Other],z0=Ei.create({container:{flex:1,paddingHorizontal:16},contentContainer:{paddingVertical:32},cardMandatory:{gap:24},segmentContainer:{flexDirection:"row",justifyContent:"center",alignItems:"center",borderRadius:16,padding:2},segment:{flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center",alignSelf:"stretch",paddingVertical:4,borderRadius:16},borderLeft:{alignSelf:"center",height:16,width:1},value:{...oj.medium_Base},intensityDescription:{paddingHorizontal:16,paddingTop:16},intensityDescriptionText:{...oj.regular_XS},inputContainer:{marginTop:24},reductionContainer:{flex:1,flexDirection:"row",justifyContent:"space-between",marginTop:16},reductionDescription:{flex:1,alignSelf:"center",...oj.medium_SM},reductionPercentage:{...oj.bold_4XL,marginLeft:24},typesContainer:{flexDirection:"row",flexWrap:"wrap",gap:8,marginBottom:32},activityType:{borderRadius:16,paddingHorizontal:12,paddingVertical:8},activityTypeText:{...oj.medium_SM}}),U0=iF(()=>{const{t:e}=iV(),{COLORS:t}=bL(),{activityStoreActions:n}=C2(),{modalStoreActions:i,isGoToSettingsPressed:r}=j2(),a=Wp(),o=df(),[s,l]=M.useState(!1),[u,c]=M.useState(!1),{activity:d}=Uq;if(void 0===d)throw new Error("[CreateActivity::render] activitySettings is undefined");const h=M.useMemo(()=>({uuid:RX(),startTimestamp:null,deleted:!1,type:null,activityIntensity:null,durationSeconds:0}),[]),m=M.useMemo(()=>o.params?.activity??h,[h,o.params?.activity]),p=M.useMemo(()=>{if(null===m.startTimestamp)return null;return new Date(m.startTimestamp).getTime()+m.durationSeconds*NL.Milliseconds.Second>Date.now()?0:1},[m]),[f,_]=M.useState(m),[g,y]=M.useState(p),[v,b]=M.useState(0),S=M.useMemo(()=>null!==g&&(1===g?f.durationSeconds>0&&!!f.startTimestamp:f.durationSeconds>0&&!!f.activityIntensity&&!!f.startTimestamp),[f,g]),w=M.useMemo(()=>!DX(f,m),[f,m]),k=M.useCallback(()=>{w?l(!0):a.goBack()},[w,a]),C=M.useCallback(async()=>{const e=o.params?.activity?.uuid,t=e?{...f,uuid:RX()}:f;if(await Dq.create(t,e)){const i=Dq.getEventWithHighestReduction(d);n.set({selectedEventUUID:i?.uuid??t.uuid,activityDurationSeconds:i?.durationSeconds??0}),jX(e?FX.ActivityEditPress:FX.ActivityAddPress),a.goBack()}else i.set({showSyncErrorModal:!0})},[f,d,n,i,a,o.params?.activity]);M.useEffect(()=>{const t=o.params?.activity?e("button_done"):e("button_add"),n=!S||!w;a.setOptions({headerRight:()=>D.createElement(Z2,{title:t,onPress:C,disabled:n}),headerLeft:()=>D.createElement(K2,{onPress:k})})},[k,C,S,o.params?.activity,e,a,w]);const E=e=>{_(t=>({...t,...e}))},I=e=>{const t=60*e,n=Date.now()-(1===g?t*NL.Milliseconds.Second:0);E({durationSeconds:t,startTimestamp:new Date(n).toISOString()})},x=e=>{E({activityIntensity:NL.ActivityIntensity[e]})},T=()=>{E({durationSeconds:0,activityIntensity:null})},O=M.useMemo(()=>Math.round(f.durationSeconds/60),[f.durationSeconds]),R=M.useMemo(()=>{if(!S)return!1;const{activityIntensity:e}=f,{hard:t,light:n,moderate:i,post:r}=d,a=0===g;if(1===g)return 120!==O||null!==r.fromSixtyone;if(a){if(60===O&&e===NL.ActivityIntensity.hard)return null!==t.fromFortysix;if(120===O&&e===NL.ActivityIntensity.hard)return null!==t.fromSixtyone;if(120===O&&e===NL.ActivityIntensity.moderate)return null!==i.fromSixtyone;if(120===O&&e===NL.ActivityIntensity.light)return null!==n.fromSixtyone}return!0},[f,d,g,S,O]);M.useEffect(()=>{if(!R)return;const{activityIntensity:e,startTimestamp:t}=f,n=Rq.getReduction(O,d,e,new Date(t));b(n)},[d,f,O,S,R]);const A=M.useCallback(()=>{u&&setTimeout(a.goBack,100)},[u,a]),L=M.useCallback(()=>{l(!1),c(!0)},[]);return D.createElement(D.Fragment,null,D.createElement(F0,{testID:"create-activity-scroll-view",style:[z0.container,{backgroundColor:t.bgSheet}],contentContainerStyle:z0.contentContainer,keyboardDismissMode:uV?"none":"on-drag",automaticallyAdjustKeyboardInsets:!0,contentInsetAdjustmentBehavior:"automatic"},D.createElement(_a,{style:z0.cardMandatory},D.createElement(_a,null,D.createElement(Ej,{title:e("new_activity_when_title")}),D.createElement(_a,{style:[z0.segmentContainer,{backgroundColor:t.bgSegmentContainer}]},D.createElement(eh,{style:[z0.segment,0===g&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{y(0),0!==f.durationSeconds&&E({startTimestamp:(new Date).toISOString()})},testID:`starting-now-touchable-${0===g}`},D.createElement(gj,{style:[z0.value,{color:0===g?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},e("new_activity_intensity_option1"))),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,1===g&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{if(y(1),0!==f.durationSeconds){const e=new Date(Date.now()-f.durationSeconds*NL.Milliseconds.Second);E({startTimestamp:e.toISOString(),activityIntensity:null})}},testID:`just-finished-now-touchable-${1===g}`},D.createElement(gj,{style:[z0.value,{color:1===g?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},e("new_activity_intensity_option2"))))),D.createElement(_a,null,D.createElement(Ej,{title:e("new_activity_duration_title")}),D.createElement(_a,{style:[z0.segmentContainer,{backgroundColor:t.bgSegmentContainer}]},D.createElement(eh,{style:[z0.segment,29===O&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{I(29)}},D.createElement(gj,{style:[z0.value,{color:29===O?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},"0-29")),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,45===O&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{I(45)}},D.createElement(gj,{style:[z0.value,{color:45===O?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},"30-45")),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,60===O&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{I(60)}},D.createElement(gj,{style:[z0.value,{color:60===O?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},"46-60")),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,120===O&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{I(120)}},D.createElement(gj,{style:[z0.value,{color:120===O?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},"61-120")))),0===g&&D.createElement(_a,null,D.createElement(Ej,{title:e("new_activity_intensity_title")}),D.createElement(_a,{style:[z0.segmentContainer,{backgroundColor:t.bgSegmentContainer}]},D.createElement(eh,{style:[z0.segment,f.activityIntensity===NL.ActivityIntensity.light&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{x(NL.ActivityIntensity.light)},testID:`activity-light-touchable-${f.activityIntensity===NL.ActivityIntensity.light}`},D.createElement(gj,{style:[z0.value,{color:f.activityIntensity===NL.ActivityIntensity.light?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},e("activity_intensity_1"))),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,f.activityIntensity===NL.ActivityIntensity.moderate&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{x(NL.ActivityIntensity.moderate)},testID:`activity-moderate-touchable-${f.activityIntensity===NL.ActivityIntensity.moderate}`},D.createElement(gj,{style:[z0.value,{color:f.activityIntensity===NL.ActivityIntensity.moderate?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},e("activity_intensity_2"))),D.createElement(_a,{style:[z0.borderLeft,{backgroundColor:t.divider}]}),D.createElement(eh,{style:[z0.segment,f.activityIntensity===NL.ActivityIntensity.hard&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{x(NL.ActivityIntensity.hard)},testID:`activity-hard-touchable-${f.activityIntensity===NL.ActivityIntensity.hard}`},D.createElement(gj,{style:[z0.value,{color:f.activityIntensity===NL.ActivityIntensity.hard?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},e("activity_intensity_3")))),f.activityIntensity&&D.createElement(_a,{style:z0.intensityDescription},f.activityIntensity===NL.ActivityIntensity.light&&D.createElement(gj,{style:z0.intensityDescriptionText},e("activity_intensity_1_text")),f.activityIntensity===NL.ActivityIntensity.moderate&&D.createElement(gj,{style:z0.intensityDescriptionText},e("activity_intensity_2_text")),f.activityIntensity===NL.ActivityIntensity.hard&&D.createElement(gj,{style:z0.intensityDescriptionText},e("activity_intensity_3_text"))))),D.createElement(mV,{testID:"activity-title-input",placeholder:e("new_activity_note_input"),value:f.title??"",onChangeText:e=>{E({title:e})},maxFontSizeMultiplier:sj,containerStyle:z0.inputContainer}),D.createElement(_a,{style:z0.typesContainer},H0.map(e=>{const n=f.type===e,i=`activity-${e}-touchable-${n}`.toLowerCase();return D.createElement(eh,{testID:i,key:e,style:[z0.activityType,{backgroundColor:t.bgSegmentContainer},n&&{backgroundColor:t.bgSegmentPrimary}],onPress:()=>{E({type:NL.ActivityEnum[e]})}},D.createElement(gj,{style:[z0.activityTypeText,{color:n?t.textLabelActive:t.textLabelInactive}],maxFontSizeMultiplier:sj},eZ[e]()))})),R&&D.createElement(_a,null,D.createElement(fj,null),D.createElement(_a,{style:z0.reductionContainer},D.createElement(gj,{style:z0.reductionDescription,maxFontSizeMultiplier:sj},e("new_activity_reduction_amount_body")),D.createElement(gj,{style:z0.reductionPercentage,testID:"create-activity-reduction-percentage",maxFontSizeMultiplier:sj},`${Math.round(100*v)}%`)))),D.createElement(V0,null),D.createElement(lz,{isVisible:!R&&S,title:e("new_activity_modal_reduction_title"),message:e("new_activity_modal_reduction_subtitle"),onModalHide:()=>{r&&(a.goBack(),i.set({showDiscardCalculationModal:!0}))},buttons:[{title:e("button_settings"),testID:"settings-button",onPress:()=>{T(),i.set({isGoToSettingsPressed:!0})}},{title:e("button_cancel"),testID:"cancel-button",onPress:T,type:dj.Secondary}]}),D.createElement(lz,{isVisible:s,title:e("new_activity_modal_discard_title"),onModalHide:A,buttons:[{title:e("button_discard_changes"),testID:"discard-button",type:dj.Error,onPress:L},{title:e("button_keep_editing"),testID:"keep-button",type:dj.Secondary,onPress:()=>{l(!1)}}]}))});const G0=Ei.create({button:{borderRadius:13},buttonText:{fontSize:17,lineHeight:22,fontWeight:"600",paddingHorizontal:16,paddingVertical:14,textAlign:"center"}}),W0=D.memo(function({onPress:e}){const{t:t}=iV(),{COLORS:n}=bL();return D.createElement(eh,{accessibilityRole:"button",style:[G0.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:"wheel-picker-modal-cancel"},D.createElement(gj,{style:[G0.buttonText,{color:n.textKeyboardButtons}]},t("button_cancel")))});const Y0=Ei.create({button:{borderBottomLeftRadius:13,borderBottomRightRadius:13},buttonText:{fontSize:17,lineHeight:22,fontWeight:"400",paddingHorizontal:16,paddingVertical:14,textAlign:"center"}}),$0=D.memo(function({onPress:e}){const{t:t}=iV(),{COLORS:n}=bL();return D.createElement(eh,{accessibilityRole:"button",style:[Y0.button,{backgroundColor:n.iosKeyboardPicker}],onPress:e,testID:"wheel-picker-modal-confirm"},D.createElement(gj,{style:[Y0.buttonText,{color:n.textKeyboardButtons}]},t("button_confirm")))});var X0=(e=>(e.selection="selection",e.impactLight="impactLight",e.impactMedium="impactMedium",e.impactHeavy="impactHeavy",e.rigid="rigid",e.soft="soft",e.notificationSuccess="notificationSuccess",e.notificationWarning="notificationWarning",e.notificationError="notificationError",e.clockTick="clockTick",e.contextClick="contextClick",e.keyboardPress="keyboardPress",e.keyboardRelease="keyboardRelease",e.keyboardTap="keyboardTap",e.longPress="longPress",e.textHandleMove="textHandleMove",e.virtualKey="virtualKey",e.virtualKeyRelease="virtualKeyRelease",e.effectClick="effectClick",e.effectDoubleClick="effectDoubleClick",e.effectHeavyClick="effectHeavyClick",e.effectTick="effectTick",e))(X0||{});const q0=Object.freeze(Object.defineProperty({__proto__:null,HapticFeedbackTypes:X0,triggerHaptic:function(e="selection",t){}},Symbol.toStringTag,{value:"Module"}));const Z0=Ei.create({item:{alignItems:"center",justifyContent:"center",zIndex:100},itemPressable:{width:"100%"},itemText:{textAlign:"center",fontSize:22,lineHeight:26,fontWeight:"400"}}),K0=D.memo(function({textStyle:e,style:t,height:n,option:i,onItemPress:r}){const{COLORS:a}=bL();return D.createElement(_a,{style:[Z0.item,t,{height:n}]},D.createElement(eh,{style:Z0.itemPressable,onPress:r},D.createElement(hl,{style:[e,Z0.itemText,{color:a.labelPrimary}]},i)))});const Q0=Ei.create({mask:{position:"absolute",left:0,right:0,pointerEvents:"none"}}),J0=M.memo(function({itemHeight:e,visibleRest:t}){const{COLORS:n}=bL(),i=e*t;return D.createElement(D.Fragment,null,D.createElement(tj,{colors:[n.iosKeyboardPicker+"FF",n.iosKeyboardPicker+"4D"],style:[Q0.mask,{top:0,height:i}]}),D.createElement(tj,{colors:[n.iosKeyboardPicker+"4D",n.iosKeyboardPicker+"FF"],style:[Q0.mask,{bottom:0,height:i}]}))});const e3=Ei.create({container:{borderTopLeftRadius:13,borderTopRightRadius:13,alignSelf:"center"},selectedIndicator:{position:"absolute",borderRadius:7,top:"50%",alignSelf:"center"}}),t3=D.memo(function({testID:e,initialScrollIndex:t,options:n,onChange:i,selectedIndicatorStyle:r={},containerStyle:a={},itemStyle:o={},itemTextStyle:s={},itemHeight:l=36,visibleRest:u=3,decelerationRate:c="normal",containerProps:d={},flatListProps:h={},accessibilityLabel:m,ref:p}){const{t:f}=iV(),{COLORS:_}=bL(),{width:g}=vm(),y=(1+2*u)*l,v=M.useRef(null),b=M.useRef(null);M.useImperativeHandle(p,()=>({scrollToIndex(e){v.current?.scrollToIndex({index:e,animated:!0})}}),[]);const[S]=M.useState(new uu.Value(0)),w=M.useMemo(()=>{const e=[...n];for(let t=0;t<u;t++)e.unshift(null),e.push(null);return e},[n,u]),k=M.useMemo(()=>[...Array(w.length)].map((e,t)=>t*l),[w,l]),C=M.useCallback(e=>{uV||b.current!==e&&(b.current=e)},[]),E=M.useCallback(e=>{const t=e.nativeEvent.contentOffset.y,r=Math.min(n.length-1,Math.max(0,Math.round(t/l)));C(r),uV&&(i(r),v.current?.scrollToIndex({index:r,animated:!0}))},[C,l,i,n.length]),I=vL((...e)=>{const t=e[0];E(t)},100),x=M.useCallback(e=>{const t=e.nativeEvent.contentOffset.y,r=Math.min(l*(n.length-1),Math.max(t,0));let a=Math.floor(Math.floor(r)/l);Math.floor(r%l)>l/2&&a++,i(a)},[l,i,n.length]);return D.createElement(_a,{accessible:!0,accessibilityHint:f("wheelpicker_accessibility_label"),accessibilityLabel:m,accessibilityRole:"adjustable",style:[e3.container,{backgroundColor:_.iosKeyboardPicker,height:y,width:g},a],...d},D.createElement(_a,{style:[e3.selectedIndicator,{backgroundColor:_.iosSelectorKeyboard},{transform:[{translateY:-l/2}],height:l,width:g-32-20},r]}),D.createElement(uu.FlatList,{...h,testID:e,ref:v,showsVerticalScrollIndicator:!1,removeClippedSubviews:cV,onScroll:uu.event([{nativeEvent:{contentOffset:{y:S}}}],{useNativeDriver:!uV,listener:uV?I:E}),scrollEventThrottle:16,initialScrollIndex:t,onMomentumScrollEnd:x,snapToInterval:l,snapToOffsets:k,decelerationRate:c,getItemLayout:(e,t)=>({length:l,offset:l*t,index:t}),data:w,keyExtractor:(e,t)=>t.toString(),windowSize:31,initialNumToRender:2*u+1,maxToRenderPerBatch:12,updateCellsBatchingPeriod:50,renderItem:({item:e,index:t})=>D.createElement(K0,{key:`option-${t}`,option:e,style:o,textStyle:s,height:l,onItemPress:()=>{const e=Math.max(0,Math.min(t-u,n.length-1));v.current?.scrollToIndex({index:e,animated:!0})}})}),D.createElement(J0,{itemHeight:l,visibleRest:u}))});const n3=D.memo(function({items:e,isVisible:t,onCancel:n,onConfirm:i,onModalHide:r,initialScrollIndex:a,accessibilityLabel:o,testID:s}){const{COLORS:l}=bL(),[u,c]=M.useState(a),{width:d}=vm();M.useEffect(()=>{c(a)},[a]);const h=M.useCallback(e=>{c(e)},[]),m=M.useCallback(()=>{i(parseFloat(e[u]))},[e,i,u]),p=M.useCallback(()=>{c(a),n()},[a,n]);return D.createElement(lz,{isVisible:t,containerStyle:{backgroundColor:l.bgTransparent},onModalHide:r},D.createElement(_a,null,D.createElement(_a,{style:i3.pickersContainer},D.createElement(t3,{testID:s,initialScrollIndex:a,options:e,onChange:h,accessibilityLabel:o,containerStyle:{width:d-32}})),D.createElement(_a,{style:i3.buttonContainer},D.createElement($0,{onPress:m}),D.createElement(W0,{onPress:p}))))}),i3=Ei.create({pickersContainer:{flexDirection:"row",borderTopLeftRadius:13,borderTopRightRadius:13,overflow:"hidden"},buttonContainer:{gap:8}}),r3=({isLiquid:e,setSelected:t})=>{const{t:n}=iV(),{COLORS:i}=bL();return M.createElement(_a,{style:[a3.container,{backgroundColor:i.bgInputActive}]},M.createElement(eh,{style:[a3.segment,!e&&{backgroundColor:i.bgSegmentPrimary}],onPress:()=>{t(!1)},testID:`food-type-food-${e}`},M.createElement(gj,{style:[a3.value,{color:e?i.textLabelInactive:i.textLabelActive}],maxFontSizeMultiplier:sj},n("add_food_segment_food"))),M.createElement(eh,{style:[a3.segment,e&&{backgroundColor:i.bgSegmentPrimary}],onPress:()=>{t(!0)},testID:`food-type-drink-${e}`},M.createElement(gj,{style:[a3.value,{color:e?i.textLabelActive:i.textLabelInactive}],maxFontSizeMultiplier:sj},n("add_food_segment_drink"))))},a3=Ei.create({container:{flexDirection:"row",justifyContent:"center",alignItems:"center",borderRadius:16,marginBottom:24,padding:2},segment:{flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center",paddingVertical:7,borderRadius:16},value:{...oj.medium_Base}}),o3={id:Date.now(),title:"",keywords:"",description:"",liquid:!1,energy:0,carbohydrates:0,protein:0,sugar:0,fibers:0,fat:0,saturated_fat:0,source:null,user_id:null},s3=PX(0,100),l3=PX(0,999),u3="create-food",c3=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{foodStoreActions:n,selectedFoodItem:i,isLoading:r}=O2(),{cartItems:a,carbohydrateStoreActions:o}=TX(),{modalStoreActions:s}=j2(),l=Wp(),[u,c]=M.useState(i??o3),[d,h]=M.useState(""),[m,p]=M.useState(!1),[f,_]=M.useState(!1),[g,y]=M.useState(0),[v,b]=M.useState(!1);M.useEffect(()=>{p(Boolean(u.title&&u.carbohydrates))},[u.title,u.carbohydrates]);const S=M.useCallback(e=>{const t=a.find(t=>t.foodItem.id===e.id);t&&o.upsertCartItem({...t,foodItem:e})},[a,o]),w=M.useCallback(async()=>{if(r)return;const e=i?await n.updateMyFoodItem(u):await n.createMyFoodItem(u);i&&e&&S(u),e?(l.pop(),jX(FX.FoodLibraryCreatePress)):s.set({showSyncErrorModal:!0})},[u,r,i,n,l,S,s]);M.useEffect(()=>{const t=e(i?"button_done":"button_add"),n=()=>{l.pop()};l.setOptions({title:u.title,headerLeft:()=>D.createElement(K2,{onPress:n}),headerRight:()=>D.createElement(Z2,{title:t,onPress:w,disabled:!m})})},[u.title,m,l,w,i,e]);const k=M.useCallback(e=>{Pu.dismiss(),h(e),y(Number(u[e])),_(!0)},[u]),C=M.useCallback(e=>{c(t=>({...t,[d]:e})),_(!1),h("")},[d]),E=M.useCallback(async()=>{if(!i||r)return;b(!1);await n.deleteMyFoodItem(i)?(o.removeFromCart(i.id,"id"),l.dispatch(Am.pop()),l.dispatch(Am.pop()),n.set({selectedFoodItem:void 0})):setTimeout(()=>{s.set({showSyncErrorModal:!0})},300)},[i,r,n,o,l,s]),{carbohydrates:I,description:x,energy:T,fat:O,fibers:R,liquid:A,protein:L,saturated_fat:P,sugar:N,title:F}=u;return D.createElement(Xa,{testID:`${u3}-scroll`,keyboardDismissMode:"on-drag",keyboardShouldPersistTaps:"always",style:{backgroundColor:t.bgSheet}},D.createElement(_a,{style:d3.container},D.createElement(r3,{isLiquid:A,setSelected:e=>{c(t=>({...t,liquid:e}))}}),D.createElement(gj,{style:[d3.sectionHeader,{color:t.labelPrimary}]},e("food_add_title")),D.createElement(_a,{style:d3.mandatorySection},D.createElement(mV,{value:F,placeholder:e(A?"food_add_library_input_drink_name":"food_add_library_input_name"),onChangeText:e=>{c(t=>({...t,title:e}))},testID:`${u3}-name`,autoFocus:!i}),D.createElement(kj,{title:e("food_add_library_item_carbs"),onPress:()=>{k("carbohydrates")},style:d3.smallNegativeMarginTop,renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-carbohydrates`},I," / 100g")})),D.createElement(gj,{style:[d3.sectionHeader,{color:t.labelPrimary}]},e("food_add_optional_title")),D.createElement(_a,{style:d3.optionalSection},D.createElement(mV,{value:x,placeholder:e("add_food_overview_description"),onChangeText:e=>{c(t=>({...t,description:e}))},testID:`${u3}-description`,containerStyle:d3.noBorder}),D.createElement(kj,{title:e("food_add_library_item_energy"),onPress:()=>{k("energy")},style:d3.mediumNegativeMarginTop,renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-energy`},T," / 100g")}),D.createElement(kj,{title:e("food_library_item_protein"),onPress:()=>{k("protein")},renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-protein`},L," / 100g")}),D.createElement(kj,{title:e("food_library_item_sugar"),onPress:()=>{k("sugar")},renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-sugar`},N," / 100g")}),D.createElement(kj,{title:e("food_library_item_fibers"),onPress:()=>{k("fibers")},renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-fibers`},R," / 100g")}),D.createElement(kj,{title:e("food_library_item_fat"),onPress:()=>{k("fat")},renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-fat`},O," / 100g")}),D.createElement(kj,{title:e("food_library_item_sfat"),onPress:()=>{k("saturated_fat")},renderRightSlot:()=>D.createElement(gj,{style:[d3.rightSlot,{color:t.labelSecondary}],testID:`${u3}-saturated-fat`},P," / 100g")})),i&&D.createElement(mj,{type:dj.ErrorSecondary,title:e("button_delete_food"),testID:"delete_food_button",onPress:()=>{b(!0)}})),D.createElement(lz,{isVisible:v,title:e("food_modal_delete_food_title"),buttons:[{title:e("button_delete_food"),type:dj.Error,testID:"delete_modal_delete_button",onPress:E},{title:e("button_cancel"),type:dj.Secondary,testID:"delete_modal_cancel_button",onPress:()=>{b(!1)}}]}),D.createElement(n3,{isVisible:f,items:"energy"===d?l3:s3,initialScrollIndex:g,onCancel:()=>{_(!1)},onConfirm:C}),D.createElement(V0,null))},d3=Ei.create({container:{flex:1,paddingHorizontal:16,paddingTop:32,paddingBottom:64},mandatorySection:{marginBottom:24},optionalSection:{marginBottom:24,gap:8},sectionHeader:{...oj.medium_SM,marginHorizontal:16,marginBottom:8},rightSlot:{...oj.regular_Base},noBorder:{borderWidth:0},smallNegativeMarginTop:{marginTop:-8},mediumNegativeMarginTop:{marginTop:-16}}),h3=({item:e,index:t,testID:n})=>{const{t:i}=iV(),{navigate:r}=Wp(),{foodStoreActions:a}=O2(),o=df(),{COLORS:s}=bL(),l=`${n}-${t}`;return D.createElement(xc,{style:[m3.container,{backgroundColor:s.bgInputActive}],onPress:()=>{a.set({selectedFoodItem:e}),o.params?.comingFrom===S2.FoodTab?r(S2.FoodDetails):r(S2.AddCarbs,{isCarbItem:!1})},testID:l},D.createElement(gj,{style:[m3.title,{color:s.labelPrimary}],numberOfLines:1,maxFontSizeMultiplier:uj,testID:`${l}-title`},e.title),D.createElement(gj,{style:[m3.subTitle,{color:s.labelSecondary}],numberOfLines:1,testID:`${l}-subtitle`,maxFontSizeMultiplier:uj},(()=>{const t=e.carbohydrates.toFixed(),n=i("new_cal_carbohydrates_input_unit"),r=i("food_card_kcal",{value:e.energy.toString()});return`${i("food_card_carb",{value:t,carbs:n})} ${r} ${i("food_card_grams")}`})()))},m3=Ei.create({container:{padding:16,borderRadius:16},title:{...oj.medium_Base,marginBottom:4},subTitle:{...oj.regular_SM}}),p3=uV?{outline:"none"}:{},f3=({comingFrom:e})=>{const{t:t,language:n}=iV(),{COLORS:i}=bL(),{query:r,foodStoreActions:a}=O2(),o=()=>{a.set({hasSearched:!1,query:"",searchResults:[]})},s=async()=>{""!==r&&(a.set({hasSearched:!0}),await a.search(n),e===S2.FoodTab?jX(FX.FoodLibrarySearched):jX(FX.CarbsFoodLibrarySearch))},l=vL(s,300);return D.createElement(_a,{style:[_3.container,{backgroundColor:i.bgSearch}]},D.createElement(m2,null),D.createElement(kh,{testID:"food-searchbar-input",autoCapitalize:"none",placeholder:t("food_search_title"),placeholderTextColor:i.textSearchPlaceholder,cursorColor:i.textSearchText,style:[_3.searchInput,{color:i.textSearchText}],multiline:!1,value:r,onChangeText:e=>{a.set({query:e}),e?e.length>2&&l():o()},onSubmitEditing:s,autoCorrect:!1,enterKeyHint:"search"}),r.length>0&&D.createElement(eh,{onPress:o,hitSlop:10},D.createElement(Q1,{color:i.labelSecondary,width:16,height:16})))},_3=Ei.create({container:{flexDirection:"row",alignItems:"center",justifyContent:"center",borderRadius:16,marginTop:16,paddingHorizontal:12},searchInput:{...oj.regular_Base,flex:1,paddingVertical:8,paddingHorizontal:4,marginTop:2,fontFamily:cV?aj.RobotoRegular:aj.PoppinsRegular,...p3}}),g3=()=>{const{t:e,language:t}=iV(),{fontScale:n}=vm(),{myFood:i,searchResults:r,isLoading:a,isMyFoodTab:o,hasSearched:s,frequentlyAdded:l,animatedEntryId:u,foodStoreActions:c}=O2(),d=Wp(),h=df(),{COLORS:m}=bL(),[p,f]=M.useState(!0),_=M.useRef(0);Yp(M.useCallback(()=>{c.loadFrequentFoodItems().catch(console.error)},[c])),M.useEffect(()=>{i.sort((e,n)=>e.title.localeCompare(n.title,t))},[i,t]),M.useEffect(()=>{c.loadMyFood().catch(console.error)},[c]);const g=M.useCallback(()=>{c.set({isMyFoodTab:!0}),h.params.comingFrom===S2.CarbsTab?jX(FX.CarbsFoodLibraryPersonalPress):jX(FX.FoodLibraryPersonalPress)},[c,h.params.comingFrom]),y=M.useCallback(()=>{c.set({selectedFoodItem:void 0}),d.navigate(S2.CreateFood)},[c,d]),v=M.useMemo(()=>{const t=e(o||s?o?"food_empty_state_no_food":"food_empty_state_search_no_food":"food_empty_state_default");return D.createElement(_a,{style:[y3.emptyListContainer,{marginTop:o?64+Math.round(23*n):32}]},o||s?D.createElement(o2,null):D.createElement(W1,{color:m.labelSecondary,width:48,height:48}),D.createElement(gj,{style:[y3.message,{color:m.labelSecondary}]},t))},[o,n,m.labelSecondary,s,e]),b=M.useMemo(()=>D.createElement(_a,{style:y3.header},D.createElement(_a,{style:[y3.segmentContainer,{backgroundColor:m.bgInputActive}]},D.createElement(eh,{style:[y3.segment,!o&&{backgroundColor:m.bgSegmentPrimary}],onPress:()=>{c.set({isMyFoodTab:!1})},testID:`food-library-button-${!o}`},D.createElement(gj,{style:[y3.value,{color:o?m.textLabelInactive:m.textLabelActive}],maxFontSizeMultiplier:sj},e("food_segment_button_library"))),D.createElement(eh,{style:[y3.segment,o&&{backgroundColor:m.bgSegmentPrimary}],onPress:g,testID:`my-food-button-${o}`},D.createElement(gj,{style:[y3.value,{color:o?m.textLabelActive:m.textLabelInactive}],maxFontSizeMultiplier:sj},e("food_segment_button_my_food")))),!o&&D.createElement(D.Fragment,null,D.createElement(f3,{comingFrom:h.params.comingFrom??S2.FoodTab}),!s&&!!l.length&&D.createElement(gj,{style:[y3.frequentHeader,{color:m.labelSecondary}]},e("food_library_frequent_title")))),[m.bgInputActive,m.bgSegmentPrimary,m.textLabelActive,m.textLabelInactive,m.labelSecondary,o,e,g,h.params.comingFrom,s,l.length,c]),S=M.useMemo(()=>o?i:s?r:l,[o,i,s,r,l]),w=M.useCallback(e=>{const t=e.nativeEvent.contentOffset.y,n=t-_.current;p&&n>5?f(!1):n<-5&&f(!0),_.current=t},[p]);return D.createElement(D.Fragment,null,D.createElement(_a,{style:[y3.container,h.params.comingFrom===S2.CarbsTab&&{backgroundColor:m.bgSheet}]},D.createElement(Wo,{data:S,keyExtractor:e=>`${e.id}`,ListEmptyComponent:a?D.createElement(eH,null):v,ListHeaderComponent:b,renderItem:({item:e,index:t})=>D.createElement(ij,{onAnimationFinished:()=>{c.set({animatedEntryId:void 0})},isAnimated:o&&u===e.id.toString(),style:y3.listItem},D.createElement(h3,{item:e,index:t,testID:"food-item"})),disableScrollViewPanResponder:!0,keyboardDismissMode:"on-drag",contentContainerStyle:S.length?y3.contentContainer:y3.emptyContentContainer,onScroll:w,scrollEventThrottle:16})),o&&p&&D.createElement(_a,{style:{position:"absolute",bottom:0,left:0,right:0,backgroundColor:m.bgNavigationBar}},D.createElement(mj,{testID:"my-food-create-food-button",onPress:y,title:e("food_my_food_button_create"),style:y3.createFoodButton})))},y3=Ei.create({container:{flex:1},emptyContentContainer:{flex:1,marginHorizontal:16},contentContainer:{marginHorizontal:16,paddingBottom:80},header:{marginTop:32,marginBottom:16},segmentContainer:{flexDirection:"row",justifyContent:"center",alignItems:"center",borderRadius:16,padding:2},segment:{flex:1,alignSelf:"stretch",flexDirection:"row",justifyContent:"center",alignItems:"center",paddingVertical:7,borderRadius:16},value:{...oj.medium_Base},emptyListContainer:{flex:1,alignItems:"center"},message:{...oj.regular_SM,marginTop:16,marginHorizontal:16,textAlign:"center"},frequentHeader:{...oj.medium_SM,marginHorizontal:16,marginTop:32,marginBottom:-16},listItem:{marginBottom:8},createFoodButton:{margin:16}});function v3({uri:e,style:t,onLoadEnd:n}){const i=M.useRef(null);return M.useEffect(()=>{const e=i.current;if(n&&e)return e.addEventListener("load",n),()=>{e.removeEventListener("load",n)}},[i,n]),D.createElement("iframe",{ref:i,src:e,style:t})}function b3(){const{language:e}=tV.getState();return`https://pdf.hedia.io/IFU/${e}/Hedia-IFU-${NX}`}const S3=()=>D.createElement(v3,{style:w3.iframe,uri:b3()}),w3=Ei.create({iframe:{flex:1}});var k3,C3={},E3={exports:{}};var I3,x3,T3={};var O3=function(){if(x3)return C3;x3=1;var e,t=(k3||(k3=1,(e=E3).exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports),E3.exports);Object.defineProperty(C3,"__esModule",{value:!0}),C3.default=C3.WebView=void 0,t(w());var n=QB,i=t(function(){if(I3)return T3;I3=1,Object.defineProperty(T3,"__esModule",{value:!0}),T3.default=void 0;var e=QB.StyleSheet.create({container:{flex:1,overflow:"hidden"},loadingOrErrorView:{position:"absolute",flex:1,justifyContent:"center",alignItems:"center",height:"100%",width:"100%",backgroundColor:"white"},loadingProgressBar:{height:20},errorText:{fontSize:14,textAlign:"center",marginBottom:2},errorTextTitle:{fontSize:15,fontWeight:"500",marginBottom:10},webView:{backgroundColor:"#ffffff"},flexStart:{alignSelf:"flex-start"},colorRed:{color:"red"}});return T3.default=e,T3}()),r=l(),a=C3.WebView=function(){return(0,r.jsx)(n.View,{style:i.default.flexStart,children:(0,r.jsx)(n.Text,{style:i.default.colorRed,children:"React Native WebView does not support this platform."})})};return C3.default=a,C3}();const R3=n(O3);function A3({url:e,testID:t,incognito:n=!0,backgroundColor:i,onNavigationStateChange:r,spinnerSize:a=15,style:o}){const{COLORS:s}=bL(),[l,u]=M.useState(!1),c=i??s.bgPrimary,{top:d}=pH();return e?D.createElement(D.Fragment,null,D.createElement(R3,{source:{uri:e},testID:t,incognito:n,startInLoadingState:!0,renderLoading:()=>D.createElement(_a,{style:L3.centerContainer},D.createElement(QV,{source:JV.LOADING_SPINNER,autoPlay:!0,style:{height:`${a}%`}})),onHttpError:()=>{u(!0)},onNavigationStateChange:r,style:{backgroundColor:c},containerStyle:[L3.container,{backgroundColor:c,paddingTop:d},o]}),l&&D.createElement(BR.View,{entering:wI.duration(300).delay(2e3),style:L3.centerContainer},D.createElement(hl,{style:[L3.errorTitle,{color:s.labelPrimary}]},"The page can't be found"),D.createElement(hl,{style:[L3.errorSubtitle,{color:s.labelSecondary}]},"It looks like nothing was found at this location."))):null}const L3=Ei.create({container:{height:"100%"},centerContainer:{height:"100%",justifyContent:"center"},errorTitle:{...oj.semiBold_4XL,textAlign:"center"},errorSubtitle:{...oj.medium_XS,textAlign:"center"}});function P3(){return uV?D.createElement(v3,{style:M3.iframe,uri:"https://www.hedia.com/support/partner"}):D.createElement(A3,{url:"https://www.hedia.com/support/native",testID:"support-webview",style:M3.container})}const M3=Ei.create({iframe:{flex:1},container:{paddingTop:0}});function D3(){const{dispatch:e}=Wp(),t=df(),[n,i]=M.useState(!1);return M.useEffect(()=>{setTimeout(()=>{i(!0)},1e3)},[]),M.useEffect(()=>{n&&(uV?(window.location.href="/redirect?status=success",Qj.clearAll()):e(wm(S2.DashboardTab,{screen:S2.Dashboard,params:{action:aV.Saved,logbookEntry:t.params.logbookEntry}})))},[e,n,t.params.logbookEntry]),D.createElement(_a,{style:N3.animationContainer},D.createElement(QV,{autoPlay:!0,source:JV.LEAVING_RECOMMENDATION,style:N3.animation,webStyle:N3.animation,resizeMode:"cover",loop:!1}))}const N3=Ei.create({animationContainer:{flex:1,justifyContent:"center",alignItems:"center"},animation:{width:256,height:256}});var F3={},B3={};const j3=i(kH);var V3={},H3={};const z3=i(V1);var U3,G3,W3={},Y3={},$3={};function X3(){if(U3)return $3;U3=1,Object.defineProperty($3,"__esModule",{value:!0}),$3.COLORS=void 0;return $3.COLORS={base50:"#FFFFFF",base100:"#F7F7FA",base200:"#F2F2F7",base300:"#ECECF1",base400:"#E0E0E6",base500:"#CFCFD7",base600:"#B5B5BD",base700:"#9999A3",base800:"#6E6E78",base900:"#3F3F46",base100a:"#F7F7FA1A",base600a:"#B5B5BD99",base700a:"#9999A3B3",base900a:"#3F3F4699",primary100:"#EEF0FE",primary200:"#D7DBFB",primary300:"#B6BFF8",primary400:"#8F9EF4",primary500:"#4A5DEB",primary600:"#3F4DD5",primary700:"#3540B8",primary800:"#2D359B",primary900:"#242A7C",primary100a:"#B5D8FF99",primary300a:"#87B5FF4D",primary400a:"#73ADFF80",primary900a:"#3D4AC699",red50:"#F9E6E9",red100:"#FCCBCB",red200:"#F9A6A7",red300:"#F47475",red400:"#EB494B",red500:"#D82E30",red600:"#B62325",red700:"#962021",red800:"#7D2021",red900:"#440B0D",red300a:"#E0717166",green50:"#E3F0E4",green100:"#BEF6D2",green200:"#8DEEAF",green300:"#59DC86",green400:"#39C365",green500:"#2BA250",green600:"#237F42",green700:"#1F6437",green800:"#1A522F",green900:"#092E17",yellow50:"#FAF8E2",yellow100:"#FAF5C5",yellow200:"#F9ED7D",yellow300:"#FAE84D",yellow400:"#FAE84D",yellow500:"#F7C62F",yellow600:"#F6B82B",yellow700:"#F3A425",yellow800:"#F2941F",yellow900:"#F0831A",shadow:"#00000029",iosKeyboardPicker:"#FFFFFF",iosSelectorKeyboard:"#F4F4F4",gradientQuickGuideBottom:"#FFFFFF",gradientQuickGuideTop:"#FFFFFF0D",graphActiveInsulin:"#008DFF",graphActiveInsulinSecondary:"#42ABFF1A",graphCarbohydrate:"#FF9E38",graphCarbohydrateSecondary:"#EB892F",graphGlucoseAverage:"#E539AB",graphPhysicalActivity:"#5BA400",graphPhysicalActivitySecondary:"#5DA800",graphRapid:"#008DFF",graphRapidSecondary:"#42ABFF",rectangleRangeGraphMyDay:"#5CE59C33",graphVeryHighGlucose:"#FF9000",graphVeryHighGlucoseSecondary:"#F07C00",graphHighGlucose:"#EAB308",graphHighGlucoseSecondary:"#F8C62B",graphTargetGlucose:"#008B4F",graphTargetGlucoseSecondary:"#089B5C",graphLowGlucose:"#BC0027",graphLowGlucoseSecondary:"#DC2626",graphVeryLowGlucose:"#A30022",graphVeryLowGlucoseSecondary:"#94001F",base100:"#616161",base200:"#555555",base300:"#4A4A4A",base350:"#404040",base400:"#363636",base500:"#373739",base600:"#2A2A2C",base700:"#1C1C1E",base800:"#141414",base900:"#000000",base100a:"#E9E0FF1A",base600a:"#2A2A2C99",base700a:"#1C1C1E80",base800a:"#14141499",primary100:"#B5D8FF",primary200:"#9EC6FF",primary300:"#87B5FF",primary400:"#73ADFF",primary500:"#5F99F9",primary600:"#4A85F0",primary700:"#4A73ED",primary800:"#4A5DEB",primary900:"#3D4AC6",primary100a:"#B5D8FF99",primary300a:"#87B5FF4D",primary400a:"#73ADFF80",primary900a:"#3D4AC699",red50:"#F9E6E9",red100:"#F9C9CE",red200:"#EA9797",red300:"#E07171",red400:"#EA514E",red500:"#EF4235",red600:"#E03834",red700:"#CF2E2E",red800:"#C22727",red900:"#B31B1B",red300a:"#E0717166",green50:"#E3F0E4",green100:"#C4E1C5",green200:"#A2D2A4",green300:"#7EC381",green400:"#64B768",green500:"#4AAC4E",green600:"#429D46",green700:"#378B3B",green800:"#2D7B31",green900:"#1A5C1F",yellow50:"#FAF8E2",yellow100:"#FAF4C0",yellow200:"#FAF09A",yellow300:"#FAEC74",yellow400:"#FAE956",yellow500:"#FAE63A",yellow600:"#F8D434",yellow700:"#F6BC2C",yellow800:"#F4A524",yellow900:"#F07C17",shadow:"#FFFFFF00",iosKeyboardPicker:"#282828",iosSelectorKeyboard:"#5858593D",gradientQuickGuideBottom:"#000000",gradientQuickGuideTop:"#0000000D",graphActiveInsulin:"#66D6FF",graphActiveInsulinSecondary:"#66D6FF1A",graphCarbohydrate:"#FFB224",graphCarbohydrateSecondary:"#E88C2B",graphGlucoseAverage:"#FF8CD8",graphPhysicalActivity:"#D7EB98",graphPhysicalActivitySecondary:"#79A762",graphRapid:"#66D6FF",graphRapidSecondary:"#00ACEB",rectangleRangeGraphMyDay:"#5CE59C33",graphVeryHighGlucose:"#F07C17",graphVeryHighGlucoseSecondary:"#F4A524",graphHighGlucose:"#F6BC2C",graphHighGlucoseSecondary:"#F8D434",graphTargetGlucose:"#4AAC4E",graphTargetGlucoseSecondary:"#64B768",graphLowGlucose:"#EF4235",graphLowGlucoseSecondary:"#EA514E",graphVeryLowGlucose:"#B31B1B",graphVeryLowGlucoseSecondary:"#C22727",white100:"#FFFFFF0D",white200:"#FFFFFF1A",white300:"#FFFFFF33",white400:"#FFFFFF66",white500:"#FFFFFF99",white600:"#FFFFFFCC",white700:"#FFFFFFE6",white800:"#FFFFFFF2",white900:"#FFFFFF",black100:"#0000000D",black200:"#0000001A",black300:"#00000033",black400:"#0000004D",black500:"#00000080",black600:"#000000CC",black700:"#000000D9",black800:"#000000F2",black900:"#000000",noRisk:"#DFB38F",lowRisk:"#DB988D",moderateRisk:"#A76762",highRisk:"#773751",iosTextStatusBar:"#FFFFFF",iosAccentBlue:"#0A84FF",iosButtonHighlight:"#434343",iosKeyboard:"#383838BF",transparent:"transparent",plusInnerShadow:"#8752F2",plusOuterShadow:"#6422EE"},$3}var q3,Z3={};var K3,Q3,J3,e4={};function t4(){return Q3||(Q3=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.COLORS=void 0,Object.defineProperty(e,"FONTS",{enumerable:!0,get:function(){return i.FONTS}}),Object.defineProperty(e,"FontFamily",{enumerable:!0,get:function(){return i.FontFamily}}),e.Theme=void 0,e.getColors=a;var t=function(){if(G3)return Y3;G3=1,Object.defineProperty(Y3,"__esModule",{value:!0}),Y3.DARK_SEMANTIC_COLORS=void 0;var e=X3();return Y3.DARK_SEMANTIC_COLORS={bgPrimary:e.COLORS.base900,bgSecondary:e.COLORS.base700,bgTertiary:e.COLORS.base600,bgMultiSheet:e.COLORS.white300,bgSheet:e.COLORS.base900,bgModal:e.COLORS.base700,bgOverlay:e.COLORS.black500,bgBrand:e.COLORS.primary800,bgToggle:e.COLORS.base350,bgSpecial:e.COLORS.base900,bgTransparent:e.COLORS.transparent,labelPrimary:e.COLORS.white900,labelSecondary:e.COLORS.white600,labelTertiary:e.COLORS.white400,labelBrand:e.COLORS.primary500,labelBrandInactive:e.COLORS.primary400a,bgActivationCode:e.COLORS.base700,borderActivationCodeDanger:e.COLORS.red500,borderActivationCodeFocus:e.COLORS.primary500,textActivationCodeDanger:e.COLORS.red500,textButtonPrimary:e.COLORS.white900,textButtonPrimaryDisabled:e.COLORS.white400,bgButtonPrimary:e.COLORS.primary800,bgButtonPrimaryDisabled:e.COLORS.primary900,iconButtonPrimary:e.COLORS.white900,iconButtonPrimaryDisabled:e.COLORS.white400,textButtonSecondary:e.COLORS.white900,textButtonSecondaryDisabled:e.COLORS.white400,bgButtonSecondary:e.COLORS.base600,bgButtonSecondaryDisabled:e.COLORS.base100a,iconButtonSecondary:e.COLORS.white900,iconButtonSecondaryDisabled:e.COLORS.white400,textButtonPlain:e.COLORS.white900,textButtonPlainDisabled:e.COLORS.white400,iconButtonPlain:e.COLORS.white900,iconButtonPlainDisabled:e.COLORS.white400,textButtonPrimaryDanger:e.COLORS.white900,textButtonPrimaryDangerDisabled:e.COLORS.white400,bgButtonPrimaryDanger:e.COLORS.red700,bgButtonPrimaryDangerDisabled:e.COLORS.red300a,iconButtonPrimaryDanger:e.COLORS.white900,iconButtonPrimaryDangerDisabled:e.COLORS.white400,textButtonSecondaryDanger:e.COLORS.red600,textButtonSecondaryDangerDisabled:e.COLORS.red300a,bgButtonSecondaryDanger:e.COLORS.base600,bgButtonSecondaryDangerDisabled:e.COLORS.base100a,iconButtonSecondaryDanger:e.COLORS.red600,iconButtonSecondaryDangerDisabled:e.COLORS.red300a,textLink:e.COLORS.primary500,buttonBorder:e.COLORS.shadow,borderAvatar:e.COLORS.white500,paginationActive:e.COLORS.primary800,paginationInactive:e.COLORS.white300,graphDivider:e.COLORS.white300,borderGraphNow:e.COLORS.white900,overlay:e.COLORS.black500,nowOverlay:e.COLORS.white200,veryHighGlucose:e.COLORS.yellow900,veryHighGlucoseSecondary:e.COLORS.yellow800,highGlucose:e.COLORS.yellow700,highGlucoseSecondary:e.COLORS.yellow600,targetGlucose:e.COLORS.green500,targetGlucoseSecondary:e.COLORS.green400,lowGlucose:e.COLORS.red500,lowGlucoseSecondary:e.COLORS.red400,veryLowGlucose:e.COLORS.red900,veryLowGlucoseSecondary:e.COLORS.red800,graphGlucoseAverage:e.COLORS.graphGlucoseAverage,graphDotGlucoseAverage:e.COLORS.green500,graphDotStrokeGlucoseAverage:e.COLORS.white900,graphActiveInsulin:e.COLORS.graphActiveInsulin,graphActiveInsulinSecondary:e.COLORS.graphActiveInsulinSecondary,strokeDotGraphActiveInsulin:e.COLORS.white900,graphOverlay:e.COLORS.base700a,graphRapid:e.COLORS.graphRapid,graphRapidSecondary:e.COLORS.graphRapidSecondary,graphCarbohydrate:e.COLORS.graphCarbohydrate,graphCarbohydrateSecondary:e.COLORS.graphCarbohydrateSecondary,graphPhysicalActivity:e.COLORS.graphPhysicalActivity,graphPhysicalActivitySecondary:e.COLORS.graphPhysicalActivitySecondary,rectangleRangeGraphMyDay:e.COLORS.rectangleRangeGraphMyDay,bgInputActive:e.COLORS.base600,bgInputInactive:e.COLORS.base700,bgInputHover:e.COLORS.white300,borderInputFocus:e.COLORS.primary500,borderInputDanger:e.COLORS.red500,textInputDanger:e.COLORS.red500,bgFoodInputDefault:e.COLORS.base600,bgFoodInputActive:e.COLORS.base600,bgFoodInputHover:e.COLORS.white300,bgListActive:e.COLORS.base600,bgListInactive:e.COLORS.base700,bgListHover:e.COLORS.white300,bgListPlainHover:e.COLORS.white200,bgLogbookManual:e.COLORS.base600,bgLogbookRecommendation:e.COLORS.base700,borderListFocused:e.COLORS.primary500,textListHightlight:e.COLORS.primary500,iosTextStatusBar:e.COLORS.white900,iosBGNudge:e.COLORS.white900,iosKeyboardPicker:e.COLORS.iosKeyboardPicker,iosSelectorKeyboard:e.COLORS.iosSelectorKeyboard,iosButtonHighlight:e.COLORS.iosButtonHighlight,iosKeyboard:e.COLORS.iosKeyboard,textKeyboardButtons:e.COLORS.iosAccentBlue,textNavigationBar:e.COLORS.white900,bgNavigationBar:e.COLORS.base800,textNavigationBarLabel:e.COLORS.primary500,iconNavigationBarActive:e.COLORS.primary500,iconNavigationBarCalc:e.COLORS.white900,bgNumber:e.COLORS.white600,textNumber:e.COLORS.black900,bgSegmentContainer:e.COLORS.base600,bgSegmentCard:e.COLORS.base600,bgSegmentPrimary:e.COLORS.primary800,textLabelActive:e.COLORS.white900,textLabelInactive:e.COLORS.white900,bgSliderBackground:e.COLORS.base500,bgSliderForeground:e.COLORS.primary600,bgSliderKnob:e.COLORS.white900,bgSliderCalculator:e.COLORS.base500,textSlider:e.COLORS.white900,iconSearch:e.COLORS.white500,textSearchPlaceholder:e.COLORS.white500,textSearchText:e.COLORS.white900,bgSearch:e.COLORS.white300,bgToastDefault:e.COLORS.base300,textToastDefault:e.COLORS.white900,iconToastDefault:e.COLORS.white900,textTableActive:e.COLORS.white900,textTableSecondary:e.COLORS.white500,textTableHighlight:e.COLORS.primary500,bgTableOdd:e.COLORS.base600,bgTableEven:e.COLORS.base700,textCarbRecommendation:e.COLORS.white900,iconCarbRecommendation:e.COLORS.white900,bgGradientTop:e.COLORS.primary700,bgGradientBottom:e.COLORS.primary600,bgLogbookTop:e.COLORS.base600,bgGradientOverlayTop:e.COLORS.black100,bgGradientOverlayBottom:e.COLORS.black900,divider:e.COLORS.white200,iconBrand:e.COLORS.primary500,iconBrandInactive:e.COLORS.primary400a,iconSuccess:e.COLORS.green500,iconWarning:e.COLORS.yellow800,iconDanger:e.COLORS.red500,textSuccess:e.COLORS.green500,textWarning:e.COLORS.yellow800,textDanger:e.COLORS.red700,textPdf:e.COLORS.black900,toggleKnob:e.COLORS.white900,plusInnerShadow:e.COLORS.plusInnerShadow,plusOuterShadow:e.COLORS.plusOuterShadow,gradientQuickGuide:[e.COLORS.gradientQuickGuideTop,e.COLORS.gradientQuickGuideBottom],gradientActiveInsulin:[e.COLORS.graphActiveInsulinSecondary,e.COLORS.graphActiveInsulin],gradientCarbohydrates:[e.COLORS.graphCarbohydrateSecondary,e.COLORS.graphCarbohydrate],gradientPhysicalActivity:[e.COLORS.graphPhysicalActivitySecondary,e.COLORS.graphPhysicalActivity],gradientRapid:[e.COLORS.graphRapidSecondary,e.COLORS.graphRapid],gradientVeryHigh:[e.COLORS.graphVeryHighGlucose,e.COLORS.graphVeryHighGlucoseSecondary],gradientHigh:[e.COLORS.graphHighGlucose,e.COLORS.graphHighGlucoseSecondary],gradientTarget:[e.COLORS.graphTargetGlucose,e.COLORS.graphTargetGlucoseSecondary],gradientLow:[e.COLORS.graphLowGlucoseSecondary,e.COLORS.graphLowGlucose],gradientVeryLow:[e.COLORS.graphVeryLowGlucose,e.COLORS.graphVeryLowGlucoseSecondary]},Y3}(),n=function(){if(q3)return Z3;q3=1,Object.defineProperty(Z3,"__esModule",{value:!0}),Z3.LIGHT_SEMANTIC_COLORS=void 0;var e=X3();return Z3.LIGHT_SEMANTIC_COLORS={bgPrimary:e.COLORS.base200,bgSecondary:e.COLORS.base50,bgTertiary:e.COLORS.base100,bgMultiSheet:e.COLORS.black300,bgSheet:e.COLORS.base200,bgModal:e.COLORS.base100,bgOverlay:e.COLORS.black500,bgBrand:e.COLORS.primary500,bgToggle:e.COLORS.base500,bgSpecial:e.COLORS.base50,bgTransparent:e.COLORS.transparent,labelPrimary:e.COLORS.black900,labelSecondary:e.COLORS.black600,labelTertiary:e.COLORS.black500,labelBrand:e.COLORS.primary600,labelBrandInactive:e.COLORS.primary400a,bgActivationCode:e.COLORS.base700,borderActivationCodeDanger:e.COLORS.red500,borderActivationCodeFocus:e.COLORS.primary500,textActivationCodeDanger:e.COLORS.red500,textButtonPrimary:e.COLORS.white900,textButtonPrimaryDisabled:e.COLORS.white400,bgButtonPrimary:e.COLORS.primary500,bgButtonPrimaryDisabled:e.COLORS.primary400,iconButtonPrimary:e.COLORS.white900,iconButtonPrimaryDisabled:e.COLORS.white400,textButtonSecondary:e.COLORS.black900,textButtonSecondaryDisabled:e.COLORS.black400,bgButtonSecondary:e.COLORS.base50,bgButtonSecondaryDisabled:e.COLORS.base400,iconButtonSecondary:e.COLORS.black900,iconButtonSecondaryDisabled:e.COLORS.black400,textButtonPlain:e.COLORS.black900,textButtonPlainDisabled:e.COLORS.black400,iconButtonPlain:e.COLORS.black900,iconButtonPlainDisabled:e.COLORS.black400,textButtonPrimaryDanger:e.COLORS.white900,textButtonPrimaryDangerDisabled:e.COLORS.white400,bgButtonPrimaryDanger:e.COLORS.red600,bgButtonPrimaryDangerDisabled:e.COLORS.red800,iconButtonPrimaryDanger:e.COLORS.white900,iconButtonPrimaryDangerDisabled:e.COLORS.white400,textButtonSecondaryDanger:e.COLORS.red500,textButtonSecondaryDangerDisabled:e.COLORS.red300a,bgButtonSecondaryDanger:e.COLORS.base50,bgButtonSecondaryDangerDisabled:e.COLORS.base400,iconButtonSecondaryDanger:e.COLORS.red500,iconButtonSecondaryDangerDisabled:e.COLORS.red300a,textLink:e.COLORS.primary500,buttonBorder:e.COLORS.base300,borderAvatar:e.COLORS.white500,paginationActive:e.COLORS.primary800,paginationInactive:e.COLORS.black300,graphDivider:e.COLORS.white200,borderGraphNow:e.COLORS.black900,overlay:e.COLORS.white500,nowOverlay:e.COLORS.white300,veryHighGlucose:e.COLORS.yellow900,veryHighGlucoseSecondary:e.COLORS.yellow800,highGlucose:e.COLORS.yellow700,highGlucoseSecondary:e.COLORS.yellow600,targetGlucose:e.COLORS.green600,targetGlucoseSecondary:e.COLORS.green500,lowGlucose:e.COLORS.red500,lowGlucoseSecondary:e.COLORS.red400,veryLowGlucose:e.COLORS.red700,veryLowGlucoseSecondary:e.COLORS.red600,graphGlucoseAverage:e.COLORS.graphGlucoseAverage,graphDotGlucoseAverage:e.COLORS.green500,graphDotStrokeGlucoseAverage:e.COLORS.white900,graphActiveInsulin:e.COLORS.graphActiveInsulin,graphActiveInsulinSecondary:e.COLORS.graphActiveInsulinSecondary,strokeDotGraphActiveInsulin:e.COLORS.white900,graphOverlay:e.COLORS.white900,graphRapid:e.COLORS.graphRapid,graphRapidSecondary:e.COLORS.graphRapidSecondary,graphCarbohydrate:e.COLORS.graphCarbohydrate,graphCarbohydrateSecondary:e.COLORS.graphCarbohydrateSecondary,graphPhysicalActivity:e.COLORS.graphPhysicalActivity,graphPhysicalActivitySecondary:e.COLORS.graphPhysicalActivitySecondary,rectangleRangeGraphMyDay:e.COLORS.rectangleRangeGraphMyDay,bgInputActive:e.COLORS.base50,bgInputInactive:e.COLORS.base400,bgInputHover:e.COLORS.black100,borderInputFocus:e.COLORS.primary500,borderInputDanger:e.COLORS.red500,textInputDanger:e.COLORS.red500,bgFoodInputDefault:e.COLORS.base200,bgFoodInputActive:e.COLORS.base50,bgFoodInputHover:e.COLORS.black100,bgListActive:e.COLORS.base50,bgListInactive:e.COLORS.base400,bgListHover:e.COLORS.black100,bgListPlainHover:e.COLORS.black100,bgLogbookManual:e.COLORS.base100,bgLogbookRecommendation:e.COLORS.base50,borderListFocused:e.COLORS.primary500,textListHightlight:e.COLORS.primary500,iosTextStatusBar:e.COLORS.black900,iosBGNudge:e.COLORS.black900,iosKeyboardPicker:e.COLORS.white900,iosSelectorKeyboard:e.COLORS.iosSelectorKeyboard,iosButtonHighlight:e.COLORS.white900,iosKeyboard:e.COLORS.iosKeyboard,textKeyboardButtons:e.COLORS.iosAccentBlue,textNavigationBar:e.COLORS.black900,bgNavigationBar:e.COLORS.base100,textNavigationBarLabel:e.COLORS.primary500,iconNavigationBarActive:e.COLORS.primary500,iconNavigationBarCalc:e.COLORS.white900,bgNumber:e.COLORS.black500,textNumber:e.COLORS.white900,bgSegmentContainer:e.COLORS.base50,bgSegmentCard:e.COLORS.base100,bgSegmentPrimary:e.COLORS.primary500,textLabelActive:e.COLORS.white900,textLabelInactive:e.COLORS.base900,bgSliderBackground:e.COLORS.black200,bgSliderForeground:e.COLORS.primary600,bgSliderKnob:e.COLORS.primary600,bgSliderCalculator:e.COLORS.white900,textSlider:e.COLORS.black900,iconSearch:e.COLORS.black500,textSearchPlaceholder:e.COLORS.black500,textSearchText:e.COLORS.black900,bgSearch:e.COLORS.base50,bgToastDefault:e.COLORS.base50,textToastDefault:e.COLORS.black900,iconToastDefault:e.COLORS.black900,textTableActive:e.COLORS.black900,textTableSecondary:e.COLORS.base500,textTableHighlight:e.COLORS.primary600,bgTableOdd:e.COLORS.base200,bgTableEven:e.COLORS.base50,textCarbRecommendation:e.COLORS.white900,iconCarbRecommendation:e.COLORS.white900,bgGradientTop:e.COLORS.primary700,bgGradientBottom:e.COLORS.primary600,bgLogbookTop:e.COLORS.black300,bgGradientOverlayTop:e.COLORS.black100,bgGradientOverlayBottom:e.COLORS.black100,divider:e.COLORS.black200,iconBrand:e.COLORS.primary600,iconBrandInactive:e.COLORS.primary400a,iconSuccess:e.COLORS.green500,iconWarning:e.COLORS.yellow900,iconDanger:e.COLORS.red500,textSuccess:e.COLORS.green500,textWarning:e.COLORS.yellow900,textDanger:e.COLORS.red700,textPdf:e.COLORS.white900,toggleKnob:e.COLORS.white900,plusInnerShadow:e.COLORS.plusInnerShadow,plusOuterShadow:e.COLORS.plusOuterShadow,gradientQuickGuide:[e.COLORS.gradientQuickGuideTop,e.COLORS.gradientQuickGuideBottom],gradientActiveInsulin:[e.COLORS.graphActiveInsulinSecondary,e.COLORS.graphActiveInsulin],gradientCarbohydrates:[e.COLORS.graphCarbohydrateSecondary,e.COLORS.graphCarbohydrate],gradientPhysicalActivity:[e.COLORS.graphPhysicalActivitySecondary,e.COLORS.graphPhysicalActivity],gradientRapid:[e.COLORS.graphRapidSecondary,e.COLORS.graphRapid],gradientVeryHigh:[e.COLORS.graphVeryHighGlucose,e.COLORS.graphVeryHighGlucoseSecondary],gradientHigh:[e.COLORS.graphHighGlucose,e.COLORS.graphHighGlucoseSecondary],gradientTarget:[e.COLORS.graphTargetGlucose,e.COLORS.graphTargetGlucoseSecondary],gradientLow:[e.COLORS.graphLowGlucoseSecondary,e.COLORS.graphLowGlucose],gradientVeryLow:[e.COLORS.graphVeryLowGlucose,e.COLORS.graphVeryLowGlucoseSecondary]},Z3}(),i=function(){if(K3)return e4;K3=1,Object.defineProperty(e4,"__esModule",{value:!0}),e4.FontFamily=e4.FONTS=void 0;let e=e4.FontFamily=function(e){return e.PoppinsBold="Poppins-Bold",e.PoppinsSemiBold="Poppins-SemiBold",e.PoppinsMedium="Poppins-Medium",e.PoppinsRegular="Poppins-Regular",e}({});return e4.FONTS={Poppins:{bold_6XL:{fontFamily:e.PoppinsBold,fontSize:60,lineHeight:78},semiBold_6XL:{fontFamily:e.PoppinsSemiBold,fontSize:60,lineHeight:78},bold_5XL:{fontFamily:e.PoppinsBold,fontSize:48,lineHeight:62},semiBold_5XL:{fontFamily:e.PoppinsSemiBold,fontSize:48,lineHeight:62},bold_4XL:{fontFamily:e.PoppinsBold,fontSize:36,lineHeight:47},semiBold_4XL:{fontFamily:e.PoppinsSemiBold,fontSize:36,lineHeight:47},bold_3XL:{fontFamily:e.PoppinsBold,fontSize:30,lineHeight:39},semiBold_3XL:{fontFamily:e.PoppinsSemiBold,fontSize:30,lineHeight:39},bold_2XL:{fontFamily:e.PoppinsBold,fontSize:24,lineHeight:31},semiBold_2XL:{fontFamily:e.PoppinsSemiBold,fontSize:24,lineHeight:31},medium_2XL:{fontFamily:e.PoppinsMedium,fontSize:24,lineHeight:31},bold_XL:{fontFamily:e.PoppinsBold,fontSize:20,lineHeight:26},semiBold_XL:{fontFamily:e.PoppinsSemiBold,fontSize:20,lineHeight:26},medium_XL:{fontFamily:e.PoppinsMedium,fontSize:20,lineHeight:26},bold_LG:{fontFamily:e.PoppinsBold,fontSize:18,lineHeight:23},semiBold_LG:{fontFamily:e.PoppinsSemiBold,fontSize:18,lineHeight:23},medium_LG:{fontFamily:e.PoppinsMedium,fontSize:18,lineHeight:23},bold_Base:{fontFamily:e.PoppinsBold,fontSize:16,lineHeight:21},semiBold_Base:{fontFamily:e.PoppinsSemiBold,fontSize:16,lineHeight:21},medium_Base:{fontFamily:e.PoppinsMedium,fontSize:16,lineHeight:21},regular_Base:{fontFamily:e.PoppinsRegular,fontSize:16,lineHeight:21},semiBold_SM:{fontFamily:e.PoppinsSemiBold,fontSize:14,lineHeight:18},medium_SM:{fontFamily:e.PoppinsMedium,fontSize:14,lineHeight:18},regular_SM:{fontFamily:e.PoppinsRegular,fontSize:14,lineHeight:18},semiBold_XS:{fontFamily:e.PoppinsSemiBold,fontSize:12,lineHeight:16},medium_XS:{fontFamily:e.PoppinsMedium,fontSize:12,lineHeight:16},regular_XS:{fontFamily:e.PoppinsRegular,fontSize:12,lineHeight:16},regular_XXS:{fontFamily:e.PoppinsRegular,fontSize:10,lineHeight:10}}},e4}();let r=e.Theme=function(e){return e.Light="light",e.Dark="dark",e}({});function a(e=r.Dark){switch(e){case r.Light:return n.LIGHT_SEMANTIC_COLORS;case r.Dark:default:return t.DARK_SEMANTIC_COLORS}}e.COLORS=a()}(W3)),W3}var n4,i4={};var r4,a4={};function o4(){if(r4)return a4;r4=1,Object.defineProperty(a4,"__esModule",{value:!0}),a4.TIMEOUT_MODAL_TRIGGER=a4.TARGET_BGL_MMOL_LIMITS=a4.INSULIN_TO_CARBS_RATIO_LIMITS=a4.INSULIN_SENSITIVITY_MMOL_LIMITS=a4.INSULIN_DOSE_LIMITS=a4.CURRENT_BGL_MMOL_LIMITS=a4.CARBOHYDRATES_LIMITS=a4.BOLUS_SECONDS_PASSED_LIMITS=a4.ACTIVITY_TARGET_BGL_MMOL_LIMITS=a4.ACTIVITY_SETTINGS_INTERVAL_LIMITS=a4.ACTIVITY_POSTPONE_GLUCOSE_MMOLL=a4.ACTIVITY_POSTPONE_GLUCOSE_MGDL=a4.ACTIVITY_DURATION_MINUTES_LIMITS=void 0;var e=DL();return a4.ACTIVITY_POSTPONE_GLUCOSE_MMOLL=5,a4.ACTIVITY_POSTPONE_GLUCOSE_MGDL=90,a4.TIMEOUT_MODAL_TRIGGER=6e5,a4.CARBOHYDRATES_LIMITS={min:e.CONSTANTS.CARBOHYDRATES_INPUT_MIN,max:e.CONSTANTS.CARBOHYDRATES_INPUT_MAX},a4.INSULIN_DOSE_LIMITS={min:e.CONSTANTS.INSULIN_DOSE_MIN,max:e.CONSTANTS.INSULIN_DOSE_MAX},a4.BOLUS_SECONDS_PASSED_LIMITS={min:e.CONSTANTS.BOLUS_SECONDS_MIN,max:e.CONSTANTS.BOLUS_SECONDS_MAX},a4.ACTIVITY_DURATION_MINUTES_LIMITS={min:e.CONSTANTS.ACTIVITY_DURATION_MIN,max:e.CONSTANTS.ACTIVITY_DURATION_MAX},a4.INSULIN_SENSITIVITY_MMOL_LIMITS={min:e.CONSTANTS.INSULIN_SENSITIVITY_MIN,max:e.CONSTANTS.INSULIN_SENSITIVITY_MAX},a4.INSULIN_TO_CARBS_RATIO_LIMITS={min:e.CONSTANTS.INSULIN_TO_CARBS_RATIO_MIN,max:e.CONSTANTS.INSULIN_TO_CARBS_RATIO_MAX},a4.CURRENT_BGL_MMOL_LIMITS={min:e.CONSTANTS.GLUCOSE_INPUT_MIN_MMOLL,max:e.CONSTANTS.GLUCOSE_INPUT_MAX_MMOLL},a4.TARGET_BGL_MMOL_LIMITS={min:e.CONSTANTS.TARGET_GLUCOSE_MIN,max:e.CONSTANTS.TARGET_GLUCOSE_MAX},a4.ACTIVITY_TARGET_BGL_MMOL_LIMITS={min:e.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MIN,max:e.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MAX},a4.ACTIVITY_SETTINGS_INTERVAL_LIMITS={min:e.CONSTANTS.ACTIVITY_REDUCTION_MIN,max:e.CONSTANTS.ACTIVITY_REDUCTION_MAX},a4}var s4,l4={};function u4(){if(s4)return l4;s4=1,Object.defineProperty(l4,"__esModule",{value:!0}),l4.useLanguage=l4.LanguageProvider=l4.LanguageContext=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=Bj(),n=l();const i=l4.LanguageContext=(0,e.createContext)(void 0);l4.LanguageProvider=({children:r})=>{const{language:a,changeLanguage:o,t:s}=(0,t.useTranslation)(),l=e.default.useMemo(()=>({language:a,changeLanguage:o,t:s}),[a,o,s]);return(0,n.jsx)(i.Provider,{value:l,children:r})};return l4.useLanguage=()=>{const t=(0,e.useContext)(i);if(!t)throw new Error("useLanguage must be used within a LanguageProvider");return t},l4}var c4,d4={};function h4(){if(c4)return d4;c4=1,Object.defineProperty(d4,"__esModule",{value:!0}),d4.convertAndFormatBGL=function(e,i,r){return n(t(e,i,r),r)},d4.convertBGL=t,d4.createSequentialArrayInteger=d4.createSequentialArrayHalf=d4.createSequentialArrayDecimal=void 0,d4.formatBGL=n,d4.formatUnit=void 0;var e=DL();function t(t,n,i){if(n!==e.BloodGlucoseUnit.MG_DL&&n!==e.BloodGlucoseUnit.MMOL_L)throw new Error(`Unsupported glucose unit! ${n}`);if(n===i)return t;switch(i){case e.BloodGlucoseUnit.MG_DL:return t*e.CONSTANTS.MGDL_PER_MMOLL_BGL;case e.BloodGlucoseUnit.MMOL_L:return t*e.CONSTANTS.MMOLL_PER_MGDL_BGL;default:throw new Error(`Unsupported glucose unit! ${i}`)}}function n(t,n){const i=n===e.BloodGlucoseUnit.MG_DL?0:1;return(Math.round(10*t)/10).toFixed(i)}d4.formatUnit=e=>`${e.substring(0,e.length-1)}${e.substring(e.length-1,e.length).toUpperCase()}`;d4.createSequentialArrayHalf=(e,t)=>Array.from({length:(t-e)/.5+1},(t,n)=>(e+.5*n).toFixed(1));d4.createSequentialArrayInteger=(e,t)=>Array.from({length:t-e+1},(t,n)=>(e+n).toString());return d4.createSequentialArrayDecimal=(e,t)=>Array.from({length:10*(t-e)+1},(t,n)=>(e+n/10).toFixed(1)),d4}var m4,p4,f4={};function _4(){if(m4)return f4;m4=1,Object.defineProperty(f4,"__esModule",{value:!0}),f4.default=void 0,function(e){e&&e.__esModule}(w());var e=QB,t=t4(),n=l();const i=e.StyleSheet.create({defaultText:{...t.FONTS.Poppins.regular_Base,color:t.COLORS.labelPrimary}});return f4.default=function(t){return(0,n.jsx)(e.Text,{...t,style:[i.defaultText,t.style],children:t.children})},f4}function g4(){if(p4)return V3;p4=1,Object.defineProperty(V3,"__esModule",{value:!0}),V3.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=DL(),i=h(function(){if(J3)return H3;J3=1,Object.defineProperty(H3,"__esModule",{value:!0}),H3.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=t4(),n=l();return H3.default=function(i){return(0,n.jsx)(e.default,{width:24,height:24,viewBox:"0 0 24 24",...i,children:(0,n.jsx)(e.Path,{d:"M7.668 13.77h0a1.375 1.375 0 00-.758 1.776c.642 1.638 2.097 3.053 4.194 3.297h0a1.36 1.36 0 001.503-1.207h0a1.368 1.368 0 00-1.193-1.517h0c-.962-.111-1.652-.743-1.98-1.582l-.448.176.447-.175a1.352 1.352 0 00-1.765-.768zM12 21.52c-3.177 0-5.476-1.785-6.648-4.133-1.18-2.361-1.197-5.247.157-7.405 2.079-3.033 5.034-5.346 6.234-6.216a.434.434 0 01.514 0c1.2.87 4.155 3.183 6.234 6.216 1.354 2.158 1.336 5.044.157 7.405-1.172 2.348-3.471 4.133-6.648 4.133z",fill:t.COLORS.labelPrimary,stroke:t.COLORS.labelPrimary,strokeWidth:.96})})},H3}()),r=h(function(){if(n4)return i4;n4=1,Object.defineProperty(i4,"__esModule",{value:!0}),i4.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=t4(),n=l();return i4.default=function(i){return(0,n.jsxs)(e.default,{width:24,height:24,viewBox:"0 0 24 24",fill:"none",...i,children:[(0,n.jsx)(e.Mask,{id:"a",fill:t.COLORS.labelPrimary,children:(0,n.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M17.862 4.741a2.493 2.493 0 01-2.49 2.489 2.492 2.492 0 01-2.49-2.489 2.492 2.492 0 012.49-2.491 2.493 2.493 0 012.49 2.491zm1.326 5.237c-1.271.056-2.72.02-3.824-.658-.385-.237-.744-.562-1.125-.907-.211-.191-.422-.382-.64-.562-2.246-1.865-5.681-1.71-7.818.353a1 1 0 101.388 1.439c1.056-1.018 2.637-1.326 3.974-.893-.818 1.14-1.496 2.52-1.013 4.322.225.84.699 1.452 1.118 1.99l.008.011c.404.524.724.94.777 1.469.105 1.04-.42 2.164-.928 3.249l-.253.547a1.002 1.002 0 00.91 1.413 1 1 0 00.912-.588l.243-.525v-.003c.593-1.267 1.265-2.704 1.106-4.292-.111-1.103-.685-1.845-1.19-2.5l-.004-.004c-.347-.447-.646-.834-.767-1.285-.267-.996.079-1.772.767-2.718l.028.024.039.035c.43.39.877.795 1.42 1.129 1.299.798 2.819.972 4.143.972.282 0 .556-.01.817-.02a1 1 0 00.955-1.043c-.024-.552-.511-.971-1.043-.955zm-10.37 4.539c-.533.289-1.12.567-1.81.654-.446.055-.915.052-1.404.046l-.162-.001c-.234-.001-.469-.003-.704.005a1 1 0 00.03 1.999h.029c.24-.008.482-.006.722-.004h.065c.536.007 1.093.01 1.672-.061 1.022-.127 1.845-.516 2.515-.88a1 1 0 00-.954-1.758z"})}),(0,n.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M17.862 4.741a2.493 2.493 0 01-2.49 2.489 2.492 2.492 0 01-2.49-2.489 2.492 2.492 0 012.49-2.491 2.493 2.493 0 012.49 2.491zm1.326 5.237c-1.271.056-2.72.02-3.824-.658-.385-.237-.744-.562-1.125-.907-.211-.191-.422-.382-.64-.562-2.246-1.865-5.681-1.71-7.818.353a1 1 0 101.388 1.439c1.056-1.018 2.637-1.326 3.974-.893-.818 1.14-1.496 2.52-1.013 4.322.225.84.699 1.452 1.118 1.99l.008.011c.404.524.724.94.777 1.469.105 1.04-.42 2.164-.928 3.249l-.253.547a1.002 1.002 0 00.91 1.413 1 1 0 00.912-.588l.243-.525v-.003c.593-1.267 1.265-2.704 1.106-4.292-.111-1.103-.685-1.845-1.19-2.5l-.004-.004c-.347-.447-.646-.834-.767-1.285-.267-.996.079-1.772.767-2.718l.028.024.039.035c.43.39.877.795 1.42 1.129 1.299.798 2.819.972 4.143.972.282 0 .556-.01.817-.02a1 1 0 00.955-1.043c-.024-.552-.511-.971-1.043-.955zm-10.37 4.539c-.533.289-1.12.567-1.81.654-.446.055-.915.052-1.404.046l-.162-.001c-.234-.001-.469-.003-.704.005a1 1 0 00.03 1.999h.029c.24-.008.482-.006.722-.004h.065c.536.007 1.093.01 1.672-.061 1.022-.127 1.845-.516 2.515-.88a1 1 0 00-.954-1.758z",fill:t.COLORS.labelPrimary}),(0,n.jsx)(e.Path,{d:"M15.364 9.32l-.525.851h.001l.524-.851zm3.824.658l-.03-1h-.014l.044 1zm-4.95-1.565l.672-.742-.671.742zm-.64-.562l-.638.769.002.002.637-.771zm-7.817.353l.693.72h.001l-.694-.72zm-.026 1.414l-.72.693v.002l.72-.695zm1.414.025l-.694-.72h-.002l.696.72zm3.974-.893l.812.582.798-1.112-1.302-.422-.308.952zm-1.013 4.322l.965-.26-.965.26zm1.118 1.99l.791-.61-.002-.003-.79.614zm.008.011l-.792.61.792-.61zm.777 1.469l-.995.098v.002l.995-.1zm-.928 3.249l-.906-.424-.002.004.908.42zm-.253.547l-.908-.42-.004.008.912.412zm.499 1.324l-.413.91.004.002.409-.912zm1.323-.5l-.908-.42-.003.008.91.413zm.243-.524l-.906-.424-.002.004.908.42zm0-.003l-.905-.423.906.424zm1.106-4.292l-.995.1.995-.1zm-1.19-2.5l.79-.611-.79.611zm-.004-.004l.79-.612v-.002l-.79.614zm-.767-1.285l-.966.258.966-.258zm.767-2.718l.672-.74-.825-.75-.656.901.809.589zm.028.024l-.65.761.65-.76zm.039.035l-.69.723.008.009.01.008.672-.74zm1.42 1.129l.524-.852-.523.852zm4.96.952l.042.999h.001l-.043-1zm.955-1.043l-1 .043 1-.043zM7.008 15.17l.123.992h.003l-.126-.992zm1.81-.654l-.477-.88.476.88zm-3.214.7l.012-1h-.008l-.004 1zm-.162-.001l-.005 1 .005-1zm-.704.005l.03 1h.002l-.032-1zm-.97 1.028l1-.028v-.001l-1 .029zm1.029.97v1h.03l-.03-1zm.722-.003l-.008 1h.008v-1zm0 0l.008-1H5.52v1zm.065 0l.012-1h-.004l-.008 1zm1.672-.061l.124.992-.124-.992zm2.515-.88l.478.878-.478-.878zm.402-1.356l-.879.476.001.002.879-.478zm5.199-6.689a3.493 3.493 0 003.49-3.489h-2c0 .82-.67 1.489-1.49 1.489v2zm-3.49-3.489a3.492 3.492 0 003.49 3.489v-2c-.82 0-1.49-.669-1.49-1.489h-2zm3.49-3.491a3.492 3.492 0 00-3.49 3.491h2c0-.822.67-1.491 1.49-1.491v-2zm3.49 3.491a3.493 3.493 0 00-3.49-3.491v2c.82 0 1.49.669 1.49 1.491h2zm-4.022 5.43c1.392.856 3.126.861 4.392.806l-.088-1.998c-1.277.056-2.438-.008-3.257-.511l-1.047 1.704zm-1.273-1.017c.365.33.794.723 1.272 1.017l1.049-1.703c-.292-.18-.581-.437-.978-.797l-1.343 1.483zm-.605-.532c.197.163.392.338.606.532l1.342-1.483c-.208-.188-.436-.395-.675-.591l-1.273 1.542zm-6.487.301c1.78-1.718 4.642-1.833 6.485-.303l1.277-1.539c-2.649-2.2-6.657-2.003-9.15.403l1.388 1.44zm0 .001s-.001-.001 0 0v-.001l-.001.002-1.387-1.442a2 2 0 00-.053 2.828l1.441-1.387zm-.002 0h.002c0-.001 0 0 0 0h-.001v-.002l-1.438 1.391a2 2 0 002.828.048l-1.39-1.437zm4.978-1.126c-1.667-.54-3.64-.164-4.976 1.125l1.388 1.44c.774-.747 1.965-.988 2.971-.662l.617-1.903zm-.356 5.015c-.368-1.376.113-2.439.86-3.48L10.33 8.166c-.89 1.24-1.763 2.937-1.166 5.164l1.931-.518zm.942 1.636c-.426-.548-.775-1.015-.942-1.636l-1.931.517c.283 1.06.882 1.816 1.294 2.346l1.58-1.227zm.01.013l-.008-.01-1.583 1.221.008.01 1.583-1.22zm.98 1.98c-.086-.867-.62-1.514-.98-1.98l-1.583 1.222c.449.582.554.765.573.957l1.99-.198zm-1.017 3.773c.25-.532.534-1.138.737-1.75.204-.614.353-1.307.28-2.024l-1.99.201c.033.324-.028.713-.188 1.192-.16.481-.391.98-.65 1.533l1.811.848zm-.25.542l.252-.547-1.815-.84-.253.548 1.815.84zm.003-.006c.001 0 0 0 0 0v-.002 0l-1.823-.823a2.002 2.002 0 00.998 2.646l.825-1.821zm0 0h.001l-.005-.002-.817 1.825c.262.118.542.177.82.177v-2zm0 0v2a2 2 0 001.822-1.176l-1.822-.825zm.246-.533l-.243.525 1.815.84.243-.525-1.815-.84zm.002-.006v.002l1.812.847v-.002l-1.812-.847zm1.017-3.77c.128 1.272-.404 2.461-1.016 3.77l1.811.847c.574-1.226 1.386-2.911 1.195-4.817l-1.99.2zm-.987-1.987c.514.664.908 1.201.987 1.987l1.99-.2c-.143-1.418-.896-2.365-1.395-3.01l-1.582 1.223zm-.004-.005l.004.005 1.582-1.223-.003-.005-1.583 1.223zm-.941-1.637c.183.682.626 1.231.943 1.639l1.58-1.227c-.378-.486-.533-.71-.592-.93l-1.931.518zm.924-3.566c-.743 1.022-1.31 2.123-.924 3.566l1.931-.518c-.147-.55-.023-1.001.61-1.871L12.02 9.247zm1.486-.147a.403.403 0 00-.005-.004l-1.345 1.48.052.045L13.506 9.1zm.08.071c-.036-.034-.07-.063-.08-.071l-1.298 1.521.007.006.001.001-.01-.01 1.38-1.447zm1.254 1c-.453-.278-.834-.62-1.272-1.017l-1.344 1.481c.423.384.934.85 1.57 1.24l1.046-1.704zm3.619.825c-1.259 0-2.556-.17-3.619-.824l-1.047 1.704c1.533.942 3.276 1.12 4.666 1.12v-2zm.774-.02c-.255.011-.513.02-.774.02v2c.302 0 .592-.01.859-.021l-.085-1.998zm-.001 0l.087 1.999a2 2 0 001.91-2.086l-1.997.087zm-.014.001c-.003 0-.003 0 0 .001a.045.045 0 01.014.008c.004.004.004.006.003.003a.044.044 0 01-.003-.013l1.998-.087c-.05-1.13-1.026-1.942-2.073-1.91l.06 1.998zM7.134 16.163c.88-.111 1.602-.464 2.16-.768l-.954-1.757c-.505.274-.957.478-1.457.54l.25 1.985zm-1.543.053c.482.006 1.017.012 1.54-.053l-.245-1.985c-.369.046-.772.045-1.27.039l-.025 2zm-.153 0h.16l.01-2h-.16l-.01 2zm-.668.004c.213-.006.43-.005.667-.004l.01-2c-.23-.001-.483-.003-.74.005l.063 2zm-.002 0l-.058-1.999a2 2 0 00-1.941 2.057l2-.058zm0 0c-.002 0 0 0 0 0-.001-.001-.001-.001 0 0v.001c0 .001 0 .001 0 0l-2 .055a2 2 0 002 1.944v-2zm.029 0h-.03v2h.03v-2zm.73-.004c-.237-.002-.497-.004-.76.004l.06 2c.219-.008.44-.006.684-.004l.016-2zm-.008 0v2-2zm.073 0h-.065l-.015 2h.065l.015-2zm1.541-.054c-.504.063-.997.06-1.537.055l-.023 2c.532.006 1.151.011 1.807-.07l-.247-1.985zm2.161-.766c-.631.343-1.324.662-2.16.766l.246 1.985c1.207-.15 2.16-.609 2.869-.994l-.955-1.757zm.001 0c0 .002 0 .002 0 0v-.001c0-.001 0-.001 0 0v.001h-.002l.957 1.757a2 2 0 00.802-2.712l-1.757.956zm0 0l1.758-.954a2.001 2.001 0 00-2.712-.805l.953 1.759z",fill:t.COLORS.labelPrimary,mask:"url(#a)"})]})},i4}()),a=o4(),o=u4(),s=t4(),u=h4(),c=h(_4()),d=l();function h(e){return e&&e.__esModule?e:{default:e}}const m=t.StyleSheet.create({container:{gap:16,flexWrap:"wrap"},text:{...s.FONTS.Poppins.regular_SM,color:s.COLORS.labelPrimary,flex:1},row:{flexDirection:"row",gap:8},icon:{alignSelf:"center"}});return V3.default=function({glucoseReading:s,hasActivity:l,bloodGlucoseUnit:h}){const{t:p}=(0,o.useLanguage)(),f=(0,e.useMemo)(()=>(0,u.convertBGL)(s.value,s.unit,n.BloodGlucoseUnit.MMOL_L),[s]),_=(0,e.useMemo)(()=>n.CONSTANTS.LEVEL_TWO_HYPOGLYCEMIA_MIN<=f&&f<n.CONSTANTS.LEVEL_TWO_HYPOGLYCEMIA_MAX?p("recommendation_suggestions_remeasure_very_low"):n.CONSTANTS.LEVEL_ONE_HYPOGLYCEMIA_MIN<=f&&f<n.CONSTANTS.LEVEL_ONE_HYPOGLYCEMIA_MAX?p("recommendation_suggestions_remeasure_low"):n.CONSTANTS.SEVERE_HYPOGLYCEMIA_MIN<=f&&f<=n.CONSTANTS.SEVERE_HYPERGLYCEMIA_MAX?p("recommendation_suggestions_measure_ketone"):null,[f,p]),g=(0,e.useMemo)(()=>{if(n.CONSTANTS.LOW_GLUCOSE_MESSAGE_ACTIVITY_MIN<=f&&f<=n.CONSTANTS.LOW_GLUCOSE_MESSAGE_ACTIVITY_MAX){const e=(0,u.formatUnit)(h),t=h===n.BloodGlucoseUnit.MG_DL?a.ACTIVITY_POSTPONE_GLUCOSE_MGDL.toString():a.ACTIVITY_POSTPONE_GLUCOSE_MMOLL.toString();return p("recommendation_suggestions_postpone_activity",{displayUnit:e,value:t})}return n.CONSTANTS.HIGH_GLUCOSE_MESSAGE_ACTIVITY_MIN<=f&&f<=n.CONSTANTS.HIGH_GLUCOSE_MESSAGE_ACTIVITY_MAX?p("recommendation_suggestions_reduce_intensity"):null},[f,h,p]);return(0,d.jsxs)(t.View,{style:m.container,children:[_&&(0,d.jsxs)(t.View,{style:m.row,children:[(0,d.jsx)(i.default,{style:m.icon,testID:"blood-icon"}),(0,d.jsx)(c.default,{style:m.text,testID:"blood-glucose-message",children:_})]}),l&&g&&(0,d.jsxs)(t.View,{style:m.row,children:[(0,d.jsx)(r.default,{style:m.icon,testID:"run-icon"}),(0,d.jsx)(c.default,{style:m.text,testID:"activity-message",children:g})]})]})},V3}var y4,v4={},b4={};var S4,w4={};function k4(){if(S4)return w4;S4=1,Object.defineProperty(w4,"__esModule",{value:!0}),w4.default=void 0,function(e){e&&e.__esModule}(w());var e=z3,t=t4(),n=l();return w4.default=i=>(0,n.jsxs)(e.Svg,{width:24,height:25,viewBox:"0 0 24 25",fill:"none",...i,children:[(0,n.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M3.99312 4.2711C4.97691 3.21491 6.37794 2.62354 8.03206 2.62354H11.6091C12.0233 2.62354 12.3591 2.95933 12.3591 3.37354C12.3591 3.78775 12.0233 4.12354 11.6091 4.12354H8.03206C6.75004 4.12354 5.76199 4.57281 5.09074 5.29347C4.414 6.02002 4.00391 7.08289 4.00391 8.39968V16.3464C4.00391 17.6647 4.4124 18.7277 5.08783 19.4539C5.75756 20.1739 6.74517 20.6235 8.03206 20.6235H16.467C17.7555 20.6235 18.7433 20.1738 19.4128 19.4539C20.088 18.7278 20.4961 17.6649 20.4961 16.3464V12.7654C20.4961 12.3512 20.8319 12.0154 21.2461 12.0154C21.6603 12.0154 21.9961 12.3512 21.9961 12.7654V16.3464C21.9961 17.9738 21.4886 19.4244 20.5112 20.4754C19.5281 21.5326 18.1263 22.1235 16.467 22.1235H8.03206C6.37405 22.1235 4.97259 21.5324 3.98947 20.4754C3.01204 19.4245 2.50391 17.974 2.50391 16.3464V8.39968C2.50391 6.77158 3.01482 5.32139 3.99312 4.2711Z",fill:i?.color??t.COLORS.labelPrimary}),(0,n.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M17.4779 4.79025L11.947 10.8273C11.6292 11.1844 11.4306 11.6319 11.3786 12.1085L11.2367 13.4178C11.1888 13.8615 11.5777 14.2282 12.0174 14.1548C12.0173 14.1548 12.0175 14.1547 12.0174 14.1548L13.2872 13.9418C13.8024 13.8552 14.2724 13.5962 14.6197 13.2079L14.6257 13.2012L20.1012 7.2259L20.1038 7.2231C20.4768 6.82017 20.4526 6.1918 20.0494 5.81853L18.8817 4.73742C18.8817 4.73738 18.8818 4.73746 18.8817 4.73742C18.4788 4.36513 17.8501 4.38948 17.4779 4.79025ZM16.376 3.77252C17.311 2.76233 18.8891 2.70159 19.8999 3.63592L21.0684 4.71777C21.0683 4.71776 21.0684 4.71779 21.0684 4.71777C22.0786 5.65306 22.1405 7.22926 21.206 8.24047C21.2055 8.24101 21.205 8.24155 21.2045 8.24209L15.7346 14.2114C15.1602 14.8521 14.3846 15.2784 13.5359 15.4211L12.2655 15.6341C10.8457 15.8717 9.59091 14.6883 9.74532 13.2569L9.88736 11.9465C9.97332 11.1584 10.3028 10.4163 10.8313 9.82475L10.8376 9.81777L16.3734 3.77534L16.376 3.77252Z",fill:i?.color??t.COLORS.labelPrimary})]}),w4}var C4={},E4={};const I4=i(te);var x4,T4={};var O4,R4,A4,L4={},P4={};function M4(){if(R4)return L4;R4=1,Object.defineProperty(L4,"__esModule",{value:!0}),L4.default=void 0,function(e){e&&e.__esModule}(w());var e=QB,t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(function(){if(O4)return P4;O4=1,Object.defineProperty(P4,"__esModule",{value:!0}),P4.default=P4.CheckmarkCircleFilledHeight=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=l();return P4.CheckmarkCircleFilledHeight=140,P4.default=function(n){return(0,t.jsxs)(e.default,{width:128,height:128,viewBox:"0 0 128 128",fill:"none",...n,children:[(0,t.jsx)(e.Circle,{cx:64,cy:64,r:63,fill:"#4A5DEB",stroke:"#4A73ED",strokeWidth:2}),(0,t.jsx)(e.Path,{d:"M43 67C43 67 54 78.5 55.5 79C57 79.5 85.5 49 85.5 49",stroke:"white",strokeWidth:5.33333,strokeLinecap:"round"})]})},P4}()),n=t4(),i=l();const r=e.StyleSheet.create({container:{position:"absolute",top:0,left:0,right:0,bottom:0},checkmarkContainer:{flex:1,flexGrow:1,alignItems:"center",backgroundColor:n.COLORS.bgPrimary}});return L4.default=()=>{const{height:n}=(0,e.useWindowDimensions)();return(0,i.jsx)(e.View,{style:r.container,testID:"backdrop-checkmark",children:(0,i.jsx)(e.View,{style:r.checkmarkContainer,children:(0,i.jsx)(t.default,{style:{marginTop:n/2-t.CheckmarkCircleFilledHeight,opacity:.6},testID:"timeout-modal-checkmark"})})})},L4}function D4(){if(A4)return E4;A4=1,Object.defineProperty(E4,"__esModule",{value:!0}),E4.default=void 0;var e=I4,t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),n=QB,i=j3,r=t4(),a=u(function(){if(x4)return T4;x4=1,Object.defineProperty(T4,"__esModule",{value:!0}),T4.default=void 0,function(e){e&&e.__esModule}(w());var e=QB,t=t4(),n=l();const i=e.StyleSheet.create({container:{backgroundColor:t.COLORS.bgOverlay,position:"absolute",top:0,left:0,right:0,bottom:0}});return T4.default=()=>(0,n.jsx)(e.View,{style:i.container,testID:"backdrop"}),T4}()),o=u(M4()),s=l();function u(e){return e&&e.__esModule?e:{default:e}}const c=Math.ceil(n.Dimensions.get("screen").height/100*85);function d({testID:r,isVisible:l,onModalHide:u,onModalShow:d,containerStyle:m,children:p,checkmark:f}){const{bottom:_}=(0,i.useSafeAreaInsets)(),[g,y]=(0,t.useState)(0),[v,b]=(0,t.useState)(!1),S=(0,t.useRef)(new n.Animated.Value(c)).current,w=(0,t.useCallback)(()=>{n.Animated.timing(S,{toValue:0,duration:300,easing:n.Easing.out(n.Easing.cubic),useNativeDriver:"web"!==n.Platform.OS}).start(({finished:e})=>{e&&d&&d()})},[S,d]),k=(0,t.useCallback)(()=>{n.Animated.timing(S,{toValue:g,duration:300,easing:n.Easing.out(n.Easing.cubic),useNativeDriver:"web"!==n.Platform.OS}).start(({finished:e})=>{e&&(b(!1),u&&u())})},[S,g,u]);(0,t.useEffect)(()=>{if(v!==l)return!v&&l?(b(!0),w()):void(v&&!l&&k())},[l,w,k,v]);const C=(0,t.useCallback)(e=>{y(e.nativeEvent.layout.height+_)},[_]);return v?(0,s.jsx)(e.Portal,{children:(0,s.jsxs)(n.View,{style:h.overlay,children:[f?(0,s.jsx)(o.default,{}):(0,s.jsx)(a.default,{}),(0,s.jsx)(n.Animated.View,{testID:r,onLayout:C,style:[h.modal,{transform:[{translateY:S}]},{paddingBottom:_+16},m],children:p})]})}):null}const h=n.StyleSheet.create({modal:{width:"100%",maxHeight:"85%",paddingTop:32,paddingBottom:16,paddingHorizontal:16,borderTopRightRadius:20,borderTopLeftRadius:20,backgroundColor:r.COLORS.bgModal},backdrop:{position:"absolute",left:0,right:0,top:0,bottom:0},overlay:{...n.StyleSheet.absoluteFillObject,backgroundColor:r.COLORS.bgTransparent,justifyContent:"flex-end"}});return E4.default=t.default.memo(d),E4}var N4,F4={},B4={};var j4={};const V4=i(q0);var H4;var z4,U4,G4,W4,Y4={};function $4(){if(U4)return F4;U4=1,Object.defineProperty(F4,"__esModule",{value:!0}),F4.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=u(ej()),i=function(){if(N4)return B4;N4=1,Object.defineProperty(B4,"__esModule",{value:!0}),B4.useDebouncedCallback=function(t,n){const i=(0,e.useRef)(null),r=(0,e.useRef)(t);return(0,e.useEffect)(()=>{r.current=t},[t]),(0,e.useCallback)((...e)=>{i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{r.current(...e)},n)},[n])};var e=w();return B4}(),r=t4(),a=(H4||(H4=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"HapticFeedbackTypes",{enumerable:!0,get:function(){return n.HapticFeedbackTypes}}),e.triggerHaptic=function(e=("ios"===t.Platform.OS?n.HapticFeedbackTypes.selection:n.HapticFeedbackTypes.effectTick),i){n.default.trigger(e,{...i})};var t=QB,n=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(V4)}(j4)),j4),o=u(function(){if(z4)return Y4;z4=1,Object.defineProperty(Y4,"__esModule",{value:!0}),Y4.default=void 0;var e=function(e){return e&&e.__esModule?e:{default:e}}(w()),t=QB,n=t4(),i=l();function r({type:e,height:n,option:r,index:o,onItemPress:s}){return(0,i.jsx)(t.Pressable,{onPress:s,testID:`${e}-wheel-picker-item-`+o,children:(0,i.jsx)(t.Animated.View,{style:[a.option,{height:n}],children:(0,i.jsx)(t.Text,{style:a.itemTextStyle,children:r})})})}Y4.default=e.default.memo(r);const a=t.StyleSheet.create({option:{alignItems:"center",justifyContent:"center",zIndex:100},itemTextStyle:{fontSize:22,lineHeight:26,fontWeight:"400",color:n.COLORS.labelPrimary}});return Y4}()),s=l();function u(e){return e&&e.__esModule?e:{default:e}}F4.default=function({type:l,initialScrollIndex:u,selectedIndex:d,options:h,onChange:m,visibleRest:p=3,decelerationRate:f="normal"}){const{width:_}=(0,t.useWindowDimensions)(),g=35,y=g*p,v=(0,e.useRef)(null),b=(0,e.useRef)(null),S=(0,e.useMemo)(()=>new t.Animated.Value(0),[]),w=(1+2*p)*g,k=(0,e.useMemo)(()=>{const e=[...h];for(let t=0;t<p;t++)e.unshift(null),e.push(null);return e},[h,p]),C=(0,e.useMemo)(()=>[...Array(k.length)].map((e,t)=>t*g),[k,g]),E=(0,e.useCallback)(e=>{const t=Math.min(g*(h.length-1),Math.max(e.nativeEvent.contentOffset.y,0));let n=Math.floor(Math.floor(t)/g);Math.floor(t%g)>17.5&&n++,n!==d&&m(n)},[h.length,d,m]),I=(0,e.useCallback)(e=>{"web"!==t.Platform.OS&&b.current!==e&&(b.current=e,(0,a.triggerHaptic)())},[]),x=(0,e.useCallback)(e=>{const n=Math.round(Math.round(e.nativeEvent.contentOffset.y)/g),i=Math.min(h.length-1,Math.max(n,0));I(i),i!==d&&m(i),"web"===t.Platform.OS&&v.current?.scrollToIndex({index:i,animated:!0})},[I,m,d,h.length]),T=(0,i.useDebouncedCallback)(x,100),O=(0,e.useCallback)(e=>{m(e),v.current?.scrollToIndex({index:e,animated:!0})},[m]);return(0,s.jsxs)(t.View,{style:[c.containerPicker,{height:w}],testID:`${l}-wheel-picker`,children:[(0,s.jsx)(t.View,{style:[c.selectedIndicator,{transform:[{translateY:-17.5}],height:g,width:_-32-20}]}),(0,s.jsx)(t.Animated.FlatList,{testID:`${l}-wheel-picker-list`,ref:v,style:c.scrollView,showsVerticalScrollIndicator:!1,onScroll:t.Animated.event([{nativeEvent:{contentOffset:{y:S}}}],{useNativeDriver:"web"!==t.Platform.OS,listener:"web"===t.Platform.OS?T:x}),onMomentumScrollEnd:E,snapToInterval:g,snapToOffsets:C,decelerationRate:f,initialScrollIndex:u,getItemLayout:(e,t)=>({length:g,offset:g*t,index:t}),data:k,keyExtractor:(e,t)=>t.toString(),renderItem:({item:e,index:t})=>(0,s.jsx)(o.default,{type:l,index:t,option:e,height:g,onItemPress:()=>O(Math.max(0,Math.min(t-p,h.length-1)))},e)}),(0,s.jsx)(n.default,{colors:[r.COLORS.iosKeyboardPicker+"FF",r.COLORS.iosKeyboardPicker+"4D"],style:[c.mask,{top:0,height:y}]}),(0,s.jsx)(n.default,{colors:[r.COLORS.iosKeyboardPicker+"4D",r.COLORS.iosKeyboardPicker+"FF"],style:[c.mask,{bottom:0,height:y}]})]})};const c=t.StyleSheet.create({containerPicker:{borderTopLeftRadius:13,borderTopRightRadius:13,backgroundColor:r.COLORS.iosKeyboardPicker,overflow:"hidden"},selectedIndicator:{position:"absolute",backgroundColor:r.COLORS.iosSelectorKeyboard,borderRadius:7,top:"50%",alignSelf:"center"},scrollView:{overflow:"hidden",flex:1},mask:{position:"absolute",left:0,right:0,pointerEvents:"none"}});return F4}function X4(){if(G4)return C4;G4=1,Object.defineProperty(C4,"__esModule",{value:!0}),C4.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=u4(),i=t4(),r=u(D4()),a=u(_4()),o=u($4()),s=l();function u(e){return e&&e.__esModule?e:{default:e}}const c=i=>{const{isVisible:l,items:u,initialScrollIndex:c,type:h,onCancel:m,onConfirm:p,onDismiss:f}=i,{t:_}=(0,n.useLanguage)(),[g,y]=(0,e.useState)(c),v=(0,e.useCallback)(e=>{y(e)},[]),b=(0,e.useCallback)(()=>{p(parseFloat(u[g]))},[u,g,p]),S=(0,e.useCallback)(()=>{y(c),m()},[c,m]);return(0,s.jsx)(r.default,{isVisible:l,onModalHide:f,containerStyle:d.contentContainerModal,children:(0,s.jsxs)(t.View,{testID:`${h}-wheelpicker-modal`,children:[(0,s.jsx)(o.default,{type:h,selectedIndex:g,initialScrollIndex:c,options:u,onChange:v}),(0,s.jsxs)(t.View,{style:d.buttonContainer,children:[(0,s.jsx)(t.Pressable,{style:d.confirmButton,children:(0,s.jsx)(t.TouchableOpacity,{onPress:b,testID:`${h}-wheel-picker-modal-confirm-button`,accessibilityRole:"button",children:(0,s.jsx)(a.default,{style:d.buttonText,children:_("button_confirm")})})}),(0,s.jsx)(t.Pressable,{style:d.cancelButton,children:(0,s.jsx)(t.TouchableOpacity,{onPress:S,testID:`${h}-wheel-picker-modal-cancel-button`,accessibilityRole:"button",children:(0,s.jsx)(a.default,{style:d.cancelText,children:_("button_cancel")})})})]})]})})};C4.default=(0,e.memo)(c);const d=t.StyleSheet.create({buttonContainer:{gap:8},contentContainerModal:{backgroundColor:i.COLORS.bgTransparent},buttonText:{fontSize:17,lineHeight:22,fontWeight:"400",paddingHorizontal:16,paddingVertical:14,textAlign:"center",color:i.COLORS.textKeyboardButtons},cancelButton:{backgroundColor:i.COLORS.iosKeyboardPicker,borderRadius:13},cancelText:{fontSize:17,lineHeight:22,fontWeight:"600",paddingHorizontal:16,paddingVertical:14,textAlign:"center",color:i.COLORS.textKeyboardButtons},confirmButton:{backgroundColor:i.COLORS.iosKeyboardPicker,borderBottomLeftRadius:13,borderBottomRightRadius:13}});return C4}function q4(){if(W4)return v4;W4=1,Object.defineProperty(v4,"__esModule",{value:!0}),v4.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=h(function(){if(y4)return b4;y4=1,Object.defineProperty(b4,"__esModule",{value:!0}),b4.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=t4(),n=l();return b4.default=function(i){return(0,n.jsx)(e.default,{width:42,height:42,viewBox:"0 0 42 42",fill:"none",...i,children:(0,n.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M14.075 5.202a1.313 1.313 0 011.539-1.04c2.41.468 4.109 1.686 5.178 3.328.874 1.34 1.283 2.895 1.394 4.422a15.383 15.383 0 002.662-.475c1.134-.306 3.85-.727 6.424.425 2.686 1.202 4.946 3.988 5.289 9.548a.988.988 0 01.002.051c.043 5.242-1.626 9.2-3.54 11.88-.955 1.336-1.972 2.359-2.874 3.067a8.58 8.58 0 01-1.27.842c-.347.183-.72.336-1.074.389-1.64.386-3.142.11-4.34-.222-.369-.102-.751-.222-1.087-.327-.188-.06-.361-.114-.509-.158-.473-.141-.768-.202-.961-.202-.203 0-.504.059-.972.19-.152.043-.336.098-.535.158-.328.097-.7.208-1.049.301-1.194.317-2.684.588-4.327.262-.359-.052-.74-.209-1.097-.398-.39-.206-.82-.49-1.271-.844-.903-.709-1.92-1.73-2.873-3.066-1.911-2.678-3.575-6.63-3.533-11.872 0-.017 0-.034.002-.051.343-5.56 2.603-8.346 5.29-9.548 2.574-1.152 5.29-.731 6.423-.425.863.232 1.725.388 2.586.468-.106-1.119-.415-2.148-.96-2.982-.663-1.02-1.735-1.845-3.478-2.183a1.312 1.312 0 01-1.039-1.538zm.98 12.966a1.313 1.313 0 00-1.126-2.371c-1.911.908-3.296 2.796-3.584 4.894a1.312 1.312 0 102.6.358 3.85 3.85 0 012.11-2.881z",fill:t.COLORS.graphCarbohydrateSecondary})})},b4}()),i=h(k4()),r=o4(),a=u4(),o=t4(),s=h4(),u=h(_4()),c=h(X4()),d=l();function h(e){return e&&e.__esModule?e:{default:e}}const m=(0,s.createSequentialArrayInteger)(r.CARBOHYDRATES_LIMITS.min,r.CARBOHYDRATES_LIMITS.max);v4.default=function({carbsRecommendation:r,editedCarbsRecommendation:o,onDismiss:s,onConfirm:l}){const{t:h}=(0,a.useLanguage)(),[f,_]=(0,e.useState)(!1),g=(0,e.useCallback)(()=>{_(!1)},[]),y=(0,e.useCallback)(()=>{_(!0)},[]),v=(0,e.useCallback)(e=>{_(!1),l(e)},[l]),b=(0,e.useCallback)(()=>{if(null!==o)return m.findIndex(e=>e===o.toString());const e=Math.round(r);return m.findIndex(t=>t===e.toString())},[o,r]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(t.View,{style:p.card,testID:"carbs-recommendation-display",children:(0,d.jsxs)(t.View,{style:p.row,children:[(0,d.jsx)(n.default,{}),(0,d.jsxs)(t.View,{style:p.body,children:[(0,d.jsxs)(t.View,{style:p.valueRow,children:[(0,d.jsx)(u.default,{style:p.label,children:h("recommendation_carb_eat")}),null!==o?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(u.default,{style:p.valueEdited,children:` ${r} g`}),(0,d.jsx)(u.default,{style:p.valueBold,children:` ${o} g`})]}):(0,d.jsx)(u.default,{style:p.valueBold,children:` ${r} g`})]}),(0,d.jsx)(u.default,{style:p.subtitle,children:h("recommendation_carb_title")})]}),(0,d.jsx)(t.TouchableOpacity,{onPress:y,testID:"carbohydrates-edit-button",hitSlop:10,style:p.editButton,children:(0,d.jsx)(i.default,{style:p.editIcon})})]})}),(0,d.jsx)(c.default,{type:"carbohydrates",items:m,isVisible:f,initialScrollIndex:b(),onConfirm:v,onCancel:g,onDismiss:s})]})};const p=t.StyleSheet.create({card:{backgroundColor:o.COLORS.bgSecondary,borderRadius:16,marginBottom:32},row:{flexDirection:"row",justifyContent:"center",alignItems:"center",padding:24,gap:12},body:{flex:1},valueRow:{flexDirection:"row",alignItems:"center"},label:{...o.FONTS.Poppins.medium_LG,color:o.COLORS.labelPrimary},valueBold:{...o.FONTS.Poppins.bold_LG,color:o.COLORS.labelPrimary},subtitle:{...o.FONTS.Poppins.medium_SM,color:o.COLORS.labelPrimary,lineHeight:23},valueEdited:{...o.FONTS.Poppins.medium_Base,textDecorationLine:"line-through",opacity:.4},editIcon:{marginLeft:4},editButton:{alignSelf:"flex-start"}});return v4}var Z4,K4={};var Q4,J4={},e9={};var t9,n9={};var i9,r9={};var a9,o9,s9={};function l9(){if(o9)return J4;o9=1,Object.defineProperty(J4,"__esModule",{value:!0}),J4.styles=J4.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=h(function(){if(Q4)return e9;Q4=1,Object.defineProperty(e9,"__esModule",{value:!0}),e9.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=t4(),n=l();return e9.default=function(i){return(0,n.jsx)(e.default,{width:21,height:20,viewBox:"0 0 21 20",...i,children:(0,n.jsx)(e.Path,{d:"M4.022 6.839a.692.692 0 01.84-.057l.073.057 5.565 5.074 5.565-5.074a.693.693 0 01.84-.057l.073.057a.55.55 0 01.062.766l-.062.066-6.022 5.49a.692.692 0 01-.84.057l-.072-.057-6.022-5.49a.552.552 0 010-.832z",fill:t.COLORS.labelSecondary})})},e9}()),i=h(function(){if(t9)return n9;t9=1,Object.defineProperty(n9,"__esModule",{value:!0}),n9.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=t4(),n=l();return n9.default=function(i){return(0,n.jsx)(e.default,{width:21,height:20,viewBox:"0 0 21 20",fill:"none",...i,children:(0,n.jsx)(e.Path,{d:"M16.984 13.15a.625.625 0 01-.814.061l-.07-.06-5.392-5.392-5.391 5.391a.625.625 0 01-.814.061l-.07-.06a.625.625 0 01-.06-.814l.06-.07 5.834-5.834a.625.625 0 01.813-.06l.07.06 5.834 5.834a.625.625 0 010 .883z",fill:t.COLORS.labelSecondary})})},n9}()),r=h(function(){if(i9)return r9;i9=1,Object.defineProperty(r9,"__esModule",{value:!0}),r9.default=void 0,n(w());var e=n(z3),t=l();function n(e,t){if("function"==typeof WeakMap)var i=new WeakMap,r=new WeakMap;return(n=function(e,t){if(!t&&e&&e.__esModule)return e;var n,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(n=t?r:i){if(n.has(e))return n.get(e);n.set(e,o)}for(const i in e)"default"!==i&&{}.hasOwnProperty.call(e,i)&&((a=(n=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,i))&&(a.get||a.set)?n(o,i,a):o[i]=e[i]);return o})(e,t)}return r9.default=function(n){return(0,t.jsx)(e.default,{width:20,height:20,viewBox:"0 0 24 24",fill:"none",...n,children:(0,t.jsx)(e.Path,{d:"M11.7012 4.125C11.8651 3.95886 12.1261 3.95886 12.29 4.125L18.2441 10.1582C19.2467 11.1743 19.2467 12.8256 18.2441 13.8418L12.29 19.875C12.1261 20.0411 11.8661 20.0411 11.7021 19.875L5.74805 13.8418C4.74547 12.8257 4.74558 11.1744 5.74805 10.1582L11.7012 4.125Z",fill:"#401782",stroke:"#9B8BF3",strokeWidth:2})})},r9}()),a=u4(),o=t4(),s=h4(),u=h(_4()),c=h(function(){if(a9)return s9;a9=1,Object.defineProperty(s9,"__esModule",{value:!0}),s9.styles=s9.default=void 0,r(w());var e=QB,t=t4(),n=r(_4()),i=l();function r(e){return e&&e.__esModule?e:{default:e}}s9.default=function({title:t,value:r,unit:o,hasSeparator:s,testID:l,icon:u}){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(e.View,{style:a.itemContainer,testID:l,children:[(0,i.jsx)(e.View,{style:a.itemTitleContainer,children:(0,i.jsx)(n.default,{style:a.title,testID:l+"-title",children:t})}),(0,i.jsxs)(e.View,{style:a.row,children:[u&&(0,i.jsx)(e.View,{style:a.icon,testID:l+"-icon",children:u}),(0,i.jsx)(n.default,{style:a.itemText,testID:l+"-value",children:r}),!!o&&(0,i.jsx)(e.View,{style:a.row,children:(0,i.jsx)(n.default,{style:a.itemText,testID:l+"-unit",children:" "+o})})]})]}),s&&(0,i.jsx)(e.View,{style:a.divider,testID:l+"-divider"})]})};const a=s9.styles=e.StyleSheet.create({itemContainer:{flex:1,flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:14,paddingHorizontal:16,gap:8},itemTitleContainer:{alignSelf:"flex-start"},icon:{marginRight:8},title:{...t.FONTS.Poppins.regular_Base,color:t.COLORS.labelPrimary},itemText:{...t.FONTS.Poppins.regular_Base,color:t.COLORS.labelSecondary,textAlign:"right"},divider:{height:1,backgroundColor:t.COLORS.divider},row:{flexDirection:"row",flexShrink:1,justifyContent:"flex-end"}});return s9}()),d=l();function h(e){return e&&e.__esModule?e:{default:e}}J4.default=function({carbIntakeValue:o,activeInsulin:l,glucoseReading:h,bloodGlucoseUnit:p,activity:f,trackExpandDetails:_}){const{t:g}=(0,a.useLanguage)(),[y,v]=(0,e.useState)(!1),b=(0,e.useMemo)(()=>({light:g("activity_intensity_1"),moderate:g("activity_intensity_2"),hard:g("activity_intensity_3")}),[g]),S=(0,e.useCallback)(()=>{t.LayoutAnimation.configureNext(t.LayoutAnimation.Presets.easeInEaseOut),v(e=>{const t=!e;return t&&_(),t})},[_]),w=(0,e.useMemo)(()=>{if(!f)return"";const{activityDuration:e,activityIntensity:t,activityReduction:n}=f,i=n?Math.round(100*n):0,r=t?`${b[t]},`:"",a=`${i}% ${g("recommendation_reduction")}`;var o;return`${(o=e)<=29?"0-29 min":o<=45?"30-45 min":o<=60?"46-60 min":"61-120 min"}. ${r} ${a}`},[b,f,g]),k=(0,e.useMemo)(()=>[{title:g("recommendation_summary_active_insulin_title"),value:l,unit:g(1===l?"unit":"units"),testID:"active-insulin-item"},{title:g("Glucose"),value:(0,s.convertAndFormatBGL)(h.value,h.unit,p),unit:(0,s.formatUnit)(p),testID:"blood-glucose-item",icon:"forecast"===h.source?(0,d.jsx)(r.default,{}):void 0},{title:g("recommendation_carbohydrates_title"),value:o||"-",unit:o?g(1===o?"gram":"grams"):void 0,testID:"carbs-item"},void 0!==f&&{title:g("recommendation_activity_title"),value:w,testID:"activity-item"}].filter(e=>e),[g,l,h,p,o,f,w]);return(0,d.jsxs)(t.View,{style:m.container,children:[(0,d.jsxs)(t.TouchableOpacity,{style:m.clickableContainer,onPress:S,hitSlop:10,children:[(0,d.jsx)(u.default,{style:m.title,children:g("recommendation_card_cal_details_title")}),(0,d.jsx)(t.View,{style:m.expandButton,testID:"chevron-"+y,children:y?(0,d.jsx)(i.default,{style:m.chevron}):(0,d.jsx)(n.default,{style:m.chevron})})]}),y&&(0,d.jsx)(t.View,{children:k.map(({title:e,unit:t,value:n,testID:i,icon:r},a,o)=>(0,d.jsx)(c.default,{icon:r,testID:i,title:e,value:n,unit:t,hasSeparator:a!==o.length-1},e))})]})};const m=J4.styles=t.StyleSheet.create({container:{padding:16,gap:16},clickableContainer:{flexDirection:"row",justifyContent:"center"},expandButton:{justifyContent:"center",alignItems:"center"},chevron:{alignSelf:"center",marginLeft:4},title:{...o.FONTS.Poppins.regular_SM,color:o.COLORS.labelSecondary,textAlign:"center"}});return J4}var u9,c9={};var d9,h9={};var m9,p9={};var f9,_9,g9={},y9={};function v9(){if(f9)return y9;f9=1,Object.defineProperty(y9,"__esModule",{value:!0}),y9.styles=void 0;var e=QB,t=t4();return y9.styles=e.StyleSheet.create({backgroundStyle:{backgroundColor:t.COLORS.bgModal},containerStyle:{opacity:.5},handleIndicatorStyle:{display:"none"},title:{...t.FONTS.Poppins.semiBold_LG,color:t.COLORS.labelPrimary,textAlign:"center",marginBottom:8},container:{backgroundColor:t.COLORS.bgModal,paddingHorizontal:16,paddingTop:16},message:{color:t.COLORS.labelSecondary,textAlign:"center",marginBottom:32},buttonContainer:{gap:16},button:{paddingHorizontal:16,paddingVertical:12,backgroundColor:t.COLORS.bgBrand,borderRadius:16},buttonText:{...t.FONTS.Poppins.semiBold_Base,color:t.COLORS.textButtonPrimary,textAlign:"center"},cancelButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:t.COLORS.bgButtonSecondary,borderRadius:16},deleteRedButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:t.COLORS.bgButtonPrimaryDanger,borderRadius:16},deleteFailureCloseButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:t.COLORS.bgBrand,borderRadius:16},saveButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:t.COLORS.bgBrand,borderRadius:16},saveText:{...t.FONTS.Poppins.semiBold_Base,textAlign:"center",color:t.COLORS.textButtonPrimary},closeText:{...t.FONTS.Poppins.semiBold_Base,textAlign:"center",color:t.COLORS.textButtonPrimary}}),y9}var b9,S9={};var w9,k9={};var C9,E9={};var I9,x9={};var T9,O9={};var R9,A9,L9={},P9={};function M9(){if(A9)return L9;A9=1,Object.defineProperty(L9,"__esModule",{value:!0}),L9.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=o(ej()),i=o(function(){if(R9)return P9;R9=1,Object.defineProperty(P9,"__esModule",{value:!0}),P9.default=void 0,function(e){e&&e.__esModule}(w());var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(z3),t=l();return P9.default=function(n){return(0,t.jsxs)(e.default,{width:29,height:28,viewBox:"0 0 29 28",fill:"none",...n,children:[(0,t.jsx)(e.Path,{d:"M14.5 0.5C21.9558 0.5 28 6.54416 28 14C28 21.4558 21.9558 27.5 14.5 27.5C7.04416 27.5 1 21.4558 1 14C1 6.54416 7.04416 0.5 14.5 0.5Z",fill:"#4A5DEB"}),(0,t.jsx)(e.Path,{d:"M14.5 0.5C21.9558 0.5 28 6.54416 28 14C28 21.4558 21.9558 27.5 14.5 27.5C7.04416 27.5 1 21.4558 1 14C1 6.54416 7.04416 0.5 14.5 0.5Z",stroke:"#FFFFFF"}),(0,t.jsx)(e.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20.8158 11.1809C21.0614 11.4221 21.0614 11.8132 20.8158 12.0544L14.9448 17.8191C14.6991 18.0603 14.3009 18.0603 14.0552 17.8191L8.18424 12.0544C7.93859 11.8132 7.93859 11.4221 8.18424 11.1809C8.4299 10.9397 8.82812 10.9397 9.07378 11.1809L14.5 16.5089L19.9262 11.1809C20.1718 10.9397 20.5701 10.9397 20.8158 11.1809Z",fill:"#FFFFFF"})]})},P9}()),r=t4(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}const s=t.StyleSheet.create({scrollToEndButton:{position:"absolute",bottom:80,alignSelf:"center"},arrowContainer:{backgroundColor:r.COLORS.bgButtonPrimary,borderRadius:24},gradient:{position:"absolute",left:0,right:0,bottom:0,height:145},linearGradient:{flex:1}});return L9.default=function({scrollToEnd:o,isVisibleArrow:l,isVisibleBlur:u}){const c=(0,e.useRef)(new t.Animated.Value(155)).current,d=(0,e.useRef)(new t.Animated.Value(u?1:0)).current;return(0,e.useEffect)(()=>{t.Animated.timing(d,{toValue:u?1:0,duration:400,useNativeDriver:!0}).start()},[u,d]),(0,e.useEffect)(()=>{l&&t.Animated.spring(c,{toValue:0,damping:10,stiffness:100,mass:1,useNativeDriver:!0}).start()},[l,c]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Pressable,{style:s.scrollToEndButton,testID:"scroll-hint-arrow",children:l&&(0,a.jsx)(t.Animated.View,{style:[s.arrowContainer,{transform:[{translateY:c}]}],children:(0,a.jsx)(t.TouchableOpacity,{testID:"scroll-hint-arrow-button",onPress:o,children:(0,a.jsx)(i.default,{})})})}),(0,a.jsx)(t.Animated.View,{style:[s.gradient,{opacity:d}],pointerEvents:"none",testID:"scroll-hint-blur",children:(0,a.jsx)(n.default,{colors:r.COLORS.gradientQuickGuide,style:s.linearGradient})})]})},L9}var D9,N9,F9,B9,j9={},V9={},H9={},z9={},U9={},G9={},W9={};function Y9(){return D9||(D9=1,function(e){var t,n,i;Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0,(n=t||(e.util=t={})).assertEqual=e=>{},n.assertIs=function(e){},n.assertNever=function(e){throw new Error},n.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},n.getValidEnumValues=e=>{const t=n.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),i={};for(const n of t)i[n]=e[n];return n.objectValues(i)},n.objectValues=e=>n.objectKeys(e).map(function(t){return e[t]}),n.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},n.find=(e,t)=>{for(const n of e)if(t(n))return n},n.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,n.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},n.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(i||(e.objectUtil=i={})).mergeShapes=(e,t)=>({...e,...t}),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);e.getParsedType=t=>{switch(typeof t){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return Number.isNaN(t)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(t)?e.ZodParsedType.array:null===t?e.ZodParsedType.null:t.then&&"function"==typeof t.then&&t.catch&&"function"==typeof t.catch?e.ZodParsedType.promise:"undefined"!=typeof Map&&t instanceof Map?e.ZodParsedType.map:"undefined"!=typeof Set&&t instanceof Set?e.ZodParsedType.set:"undefined"!=typeof Date&&t instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}}}(W9)),W9}function $9(){if(N9)return G9;N9=1,Object.defineProperty(G9,"__esModule",{value:!0}),G9.ZodError=G9.quotelessJson=G9.ZodIssueCode=void 0;const e=Y9();G9.ZodIssueCode=e.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);G9.quotelessJson=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");let t=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},i=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(i);else if("invalid_return_type"===r.code)i(r.returnTypeError);else if("invalid_arguments"===r.code)i(r.argumentsError);else if(0===r.path.length)n._errors.push(t(r));else{let e=n,i=0;for(;i<r.path.length;){const n=r.path[i];i===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],i++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.util.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const i of this.issues)if(i.path.length>0){const n=i.path[0];t[n]=t[n]||[],t[n].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};return G9.ZodError=t,t.create=e=>new t(e),G9}function X9(){if(F9)return U9;F9=1,Object.defineProperty(U9,"__esModule",{value:!0});const e=$9(),t=Y9();return U9.default=(n,i)=>{let r;switch(n.code){case e.ZodIssueCode.invalid_type:r=n.received===t.ZodParsedType.undefined?"Required":`Expected ${n.expected}, received ${n.received}`;break;case e.ZodIssueCode.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(n.expected,t.util.jsonStringifyReplacer)}`;break;case e.ZodIssueCode.unrecognized_keys:r=`Unrecognized key(s) in object: ${t.util.joinValues(n.keys,", ")}`;break;case e.ZodIssueCode.invalid_union:r="Invalid input";break;case e.ZodIssueCode.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${t.util.joinValues(n.options)}`;break;case e.ZodIssueCode.invalid_enum_value:r=`Invalid enum value. Expected ${t.util.joinValues(n.options)}, received '${n.received}'`;break;case e.ZodIssueCode.invalid_arguments:r="Invalid function arguments";break;case e.ZodIssueCode.invalid_return_type:r="Invalid function return type";break;case e.ZodIssueCode.invalid_date:r="Invalid date";break;case e.ZodIssueCode.invalid_string:"object"==typeof n.validation?"includes"in n.validation?(r=`Invalid input: must include "${n.validation.includes}"`,"number"==typeof n.validation.position&&(r=`${r} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?r=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?r=`Invalid input: must end with "${n.validation.endsWith}"`:t.util.assertNever(n.validation):r="regex"!==n.validation?`Invalid ${n.validation}`:"Invalid";break;case e.ZodIssueCode.too_small:r="array"===n.type?`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:"string"===n.type?`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:"number"===n.type||"bigint"===n.type?`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:"date"===n.type?`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:"Invalid input";break;case e.ZodIssueCode.too_big:r="array"===n.type?`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:"string"===n.type?`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:"number"===n.type?`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:"bigint"===n.type?`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:"date"===n.type?`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:"Invalid input";break;case e.ZodIssueCode.custom:r="Invalid input";break;case e.ZodIssueCode.invalid_intersection_types:r="Intersection results could not be merged";break;case e.ZodIssueCode.not_multiple_of:r=`Number must be a multiple of ${n.multipleOf}`;break;case e.ZodIssueCode.not_finite:r="Number must be finite";break;default:r=i.defaultError,t.util.assertNever(n)}return{message:r}},U9}function q9(){if(B9)return z9;B9=1;var e=z9&&z9.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(z9,"__esModule",{value:!0}),z9.defaultErrorMap=void 0,z9.setErrorMap=function(e){n=e},z9.getErrorMap=function(){return n};const t=e(X9());z9.defaultErrorMap=t.default;let n=t.default;return z9}var Z9,K9={};function Q9(){return Z9||(Z9=1,function(e){var t=K9&&K9.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.EMPTY_PATH=e.makeIssue=void 0,e.addIssueToContext=function(t,r){const a=(0,n.getErrorMap)(),o=(0,e.makeIssue)({issueData:r,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,a,a===i.default?void 0:i.default].filter(e=>!!e)});t.common.issues.push(o)};const n=q9(),i=t(X9());e.makeIssue=e=>{const{data:t,path:n,errorMaps:i,issueData:r}=e,a=[...n,...r.path||[]],o={...r,path:a};if(void 0!==r.message)return{...r,path:a,message:r.message};let s="";const l=i.filter(e=>!!e).slice().reverse();for(const u of l)s=u(o,{data:t,defaultError:s}).message;return{...r,path:a,message:s}},e.EMPTY_PATH=[];class r{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(t,n){const i=[];for(const r of n){if("aborted"===r.status)return e.INVALID;"dirty"===r.status&&t.dirty(),i.push(r.value)}return{status:t.value,value:i}}static async mergeObjectAsync(e,t){const n=[];for(const i of t){const e=await i.key,t=await i.value;n.push({key:e,value:t})}return r.mergeObjectSync(e,n)}static mergeObjectSync(t,n){const i={};for(const r of n){const{key:n,value:a}=r;if("aborted"===n.status)return e.INVALID;if("aborted"===a.status)return e.INVALID;"dirty"===n.status&&t.dirty(),"dirty"===a.status&&t.dirty(),"__proto__"===n.value||void 0===a.value&&!r.alwaysSet||(i[n.value]=a.value)}return{status:t.value,value:i}}}e.ParseStatus=r,e.INVALID=Object.freeze({status:"aborted"});e.DIRTY=e=>({status:"dirty",value:e});e.OK=e=>({status:"valid",value:e});e.isAborted=e=>"aborted"===e.status;e.isDirty=e=>"dirty"===e.status;e.isValid=e=>"valid"===e.status;e.isAsync=e=>"undefined"!=typeof Promise&&e instanceof Promise}(K9)),K9}var J9,e5={};function t5(){return J9||(J9=1,Object.defineProperty(e5,"__esModule",{value:!0})),e5}var n5,i5,r5,a5,o5,s5,l5,u5={},c5={};function d5(){return n5||(n5=1,Object.defineProperty(c5,"__esModule",{value:!0}),c5.errorUtil=void 0,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(e||(c5.errorUtil=e={}))),c5;var e}function h5(){if(i5)return u5;i5=1,Object.defineProperty(u5,"__esModule",{value:!0}),u5.discriminatedUnion=u5.date=u5.boolean=u5.bigint=u5.array=u5.any=u5.coerce=u5.ZodFirstPartyTypeKind=u5.late=u5.ZodSchema=u5.Schema=u5.ZodReadonly=u5.ZodPipeline=u5.ZodBranded=u5.BRAND=u5.ZodNaN=u5.ZodCatch=u5.ZodDefault=u5.ZodNullable=u5.ZodOptional=u5.ZodTransformer=u5.ZodEffects=u5.ZodPromise=u5.ZodNativeEnum=u5.ZodEnum=u5.ZodLiteral=u5.ZodLazy=u5.ZodFunction=u5.ZodSet=u5.ZodMap=u5.ZodRecord=u5.ZodTuple=u5.ZodIntersection=u5.ZodDiscriminatedUnion=u5.ZodUnion=u5.ZodObject=u5.ZodArray=u5.ZodVoid=u5.ZodNever=u5.ZodUnknown=u5.ZodAny=u5.ZodNull=u5.ZodUndefined=u5.ZodSymbol=u5.ZodDate=u5.ZodBoolean=u5.ZodBigInt=u5.ZodNumber=u5.ZodString=u5.ZodType=void 0,u5.NEVER=u5.void=u5.unknown=u5.union=u5.undefined=u5.tuple=u5.transformer=u5.symbol=u5.string=u5.strictObject=u5.set=u5.record=u5.promise=u5.preprocess=u5.pipeline=u5.ostring=u5.optional=u5.onumber=u5.oboolean=u5.object=u5.number=u5.nullable=u5.null=u5.never=u5.nativeEnum=u5.nan=u5.map=u5.literal=u5.lazy=u5.intersection=u5.instanceof=u5.function=u5.enum=u5.effect=void 0,u5.datetimeRegex=T,u5.custom=be;const e=$9(),t=q9(),n=d5(),i=Q9(),r=Y9();class a{constructor(e,t,n,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const o=(t,n)=>{if((0,i.isValid)(n))return{success:!0,data:n.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new e.ZodError(t.common.issues);return this._error=n,this._error}}};function s(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:i,description:r}=e;if(t&&(n||i))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:r};return{errorMap:(t,r)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??r.defaultError}:void 0===r.data?{message:a??i??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:a??n??r.defaultError}},description:r}}class l{get description(){return this._def.description}_getType(e){return(0,r.getParsedType)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,r.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new i.ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:(0,r.getParsedType)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,i.isAsync)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,r.getParsedType)(e)},i=this._parseSync({data:e,path:n.path,parent:n});return o(n,i)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,r.getParsedType)(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return(0,i.isValid)(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>(0,i.isValid)(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,r.getParsedType)(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await((0,i.isAsync)(a)?a:Promise.resolve(a));return o(n,s)}refine(t,n){const i=e=>"string"==typeof n||void 0===n?{message:n}:"function"==typeof n?n(e):n;return this._refinement((n,r)=>{const a=t(n),o=()=>r.addIssue({code:e.ZodIssueCode.custom,...i(n)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then(e=>!!e||(o(),!1)):!!a||(o(),!1)})}refinement(e,t){return this._refinement((n,i)=>!!e(n)||(i.addIssue("function"==typeof t?t(n,i):t),!1))}_refinement(e){return new ce({schema:this,typeName:Se.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return de.create(this,this._def)}nullable(){return he.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return ue.create(this,this._def)}or(e){return X.create([this,e],this._def)}and(e){return Q.create(this,e,this._def)}transform(e){return new ce({...s(this._def),schema:this,typeName:Se.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new me({...s(this._def),innerType:this,defaultValue:t,typeName:Se.ZodDefault})}brand(){return new _e({typeName:Se.ZodBranded,type:this,...s(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new pe({...s(this._def),innerType:this,catchValue:t,typeName:Se.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ge.create(this,e)}readonly(){return ye.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}u5.ZodType=l,u5.Schema=l,u5.ZodSchema=l;const u=/^c[^\s-]{8,}$/i,c=/^[0-9a-z]+$/,d=/^[0-9A-HJKMNP-TV-Z]{26}$/i,h=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,m=/^[a-z0-9_-]{21}$/i,p=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,f=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let g;const y=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,v=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,b=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,S=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,w=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,k=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,C="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",E=new RegExp(`^${C}$`);function I(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function x(e){return new RegExp(`^${I(e)}$`)}function T(e){let t=`${C}T${I(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function O(e,t){return!("v4"!==t&&t||!y.test(e))||!("v6"!==t&&t||!b.test(e))}function R(e,t){if(!p.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const i=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),r=JSON.parse(atob(i));return"object"==typeof r&&null!==r&&((!("typ"in r)||"JWT"===r?.typ)&&(!!r.alg&&(!t||r.alg===t)))}catch{return!1}}function A(e,t){return!("v4"!==t&&t||!v.test(e))||!("v6"!==t&&t||!S.test(e))}class L extends l{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==r.ZodParsedType.string){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.string,received:n.parsedType}),i.INVALID}const n=new i.ParseStatus;let a;for(const o of this._def.checks)if("min"===o.kind)t.data.length<o.value&&(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if("max"===o.kind)t.data.length>o.value&&(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if("length"===o.kind){const r=t.data.length>o.value,s=t.data.length<o.value;(r||s)&&(a=this._getOrReturnCtx(t,a),r?(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):s&&(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if("email"===o.kind)_.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"email",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("emoji"===o.kind)g||(g=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),g.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"emoji",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("uuid"===o.kind)h.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"uuid",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("nanoid"===o.kind)m.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"nanoid",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("cuid"===o.kind)u.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"cuid",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("cuid2"===o.kind)c.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"cuid2",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("ulid"===o.kind)d.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"ulid",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty());else if("url"===o.kind)try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"url",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()}else if("regex"===o.kind){o.regex.lastIndex=0;o.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"regex",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty())}else if("trim"===o.kind)t.data=t.data.trim();else if("includes"===o.kind)t.data.includes(o.value,o.position)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty());else if("toLowerCase"===o.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===o.kind)t.data=t.data.toUpperCase();else if("startsWith"===o.kind)t.data.startsWith(o.value)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty());else if("endsWith"===o.kind)t.data.endsWith(o.value)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty());else if("datetime"===o.kind){T(o).test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:"datetime",message:o.message}),n.dirty())}else if("date"===o.kind){E.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:"date",message:o.message}),n.dirty())}else if("time"===o.kind){x(o).test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_string,validation:"time",message:o.message}),n.dirty())}else"duration"===o.kind?f.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"duration",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):"ip"===o.kind?O(t.data,o.version)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"ip",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):"jwt"===o.kind?R(t.data,o.alg)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"jwt",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):"cidr"===o.kind?A(t.data,o.version)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"cidr",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):"base64"===o.kind?w.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"base64",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):"base64url"===o.kind?k.test(t.data)||(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{validation:"base64url",code:e.ZodIssueCode.invalid_string,message:o.message}),n.dirty()):r.util.assertNever(o);return{status:n.value,value:t.data}}_regex(t,i,r){return this.refinement(e=>t.test(e),{validation:i,code:e.ZodIssueCode.invalid_string,...n.errorUtil.errToObj(r)})}_addCheck(e){return new L({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...n.errorUtil.errToObj(e)})}url(e){return this._addCheck({kind:"url",...n.errorUtil.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...n.errorUtil.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...n.errorUtil.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...n.errorUtil.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...n.errorUtil.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...n.errorUtil.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...n.errorUtil.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...n.errorUtil.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...n.errorUtil.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...n.errorUtil.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...n.errorUtil.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...n.errorUtil.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...n.errorUtil.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...n.errorUtil.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...n.errorUtil.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...n.errorUtil.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...n.errorUtil.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...n.errorUtil.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...n.errorUtil.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...n.errorUtil.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...n.errorUtil.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...n.errorUtil.errToObj(t)})}nonempty(e){return this.min(1,n.errorUtil.errToObj(e))}trim(){return new L({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new L({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new L({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function P(e,t){const n=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,r=n>i?n:i;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}u5.ZodString=L,L.create=e=>new L({checks:[],typeName:Se.ZodString,coerce:e?.coerce??!1,...s(e)});class M extends l{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==r.ZodParsedType.number){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.number,received:n.parsedType}),i.INVALID}let n;const a=new i.ParseStatus;for(const o of this._def.checks)if("int"===o.kind)r.util.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:o.message}),a.dirty());else if("min"===o.kind){(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty())}else if("max"===o.kind){(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),a.dirty())}else"multipleOf"===o.kind?0!==P(t.data,o.value)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):"finite"===o.kind?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.not_finite,message:o.message}),a.dirty()):r.util.assertNever(o);return{status:a.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,n.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,n.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,n.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,n.errorUtil.toString(t))}setLimit(e,t,i,r){return new M({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:n.errorUtil.toString(r)}]})}_addCheck(e){return new M({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:n.errorUtil.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:n.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:n.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:n.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:n.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:n.errorUtil.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:n.errorUtil.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:n.errorUtil.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:n.errorUtil.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&r.util.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}u5.ZodNumber=M,M.create=e=>new M({checks:[],typeName:Se.ZodNumber,coerce:e?.coerce||!1,...s(e)});class D extends l{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==r.ZodParsedType.bigint)return this._getInvalidInput(t);let n;const a=new i.ParseStatus;for(const o of this._def.checks)if("min"===o.kind){(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty())}else if("max"===o.kind){(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),a.dirty())}else"multipleOf"===o.kind?t.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.not_multiple_of,multipleOf:o.value,message:o.message}),a.dirty()):r.util.assertNever(o);return{status:a.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.bigint,received:n.parsedType}),i.INVALID}gte(e,t){return this.setLimit("min",e,!0,n.errorUtil.toString(t))}gt(e,t){return this.setLimit("min",e,!1,n.errorUtil.toString(t))}lte(e,t){return this.setLimit("max",e,!0,n.errorUtil.toString(t))}lt(e,t){return this.setLimit("max",e,!1,n.errorUtil.toString(t))}setLimit(e,t,i,r){return new D({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:i,message:n.errorUtil.toString(r)}]})}_addCheck(e){return new D({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:n.errorUtil.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}u5.ZodBigInt=D,D.create=e=>new D({checks:[],typeName:Se.ZodBigInt,coerce:e?.coerce??!1,...s(e)});class N extends l{_parse(t){this._def.coerce&&(t.data=Boolean(t.data));if(this._getType(t)!==r.ZodParsedType.boolean){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.boolean,received:n.parsedType}),i.INVALID}return(0,i.OK)(t.data)}}u5.ZodBoolean=N,N.create=e=>new N({typeName:Se.ZodBoolean,coerce:e?.coerce||!1,...s(e)});class F extends l{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==r.ZodParsedType.date){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.date,received:n.parsedType}),i.INVALID}if(Number.isNaN(t.data.getTime())){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_date}),i.INVALID}const n=new i.ParseStatus;let a;for(const o of this._def.checks)"min"===o.kind?t.data.getTime()<o.value&&(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):"max"===o.kind?t.data.getTime()>o.value&&(a=this._getOrReturnCtx(t,a),(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):r.util.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(e){return new F({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:n.errorUtil.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:n.errorUtil.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}u5.ZodDate=F,F.create=e=>new F({checks:[],coerce:e?.coerce||!1,typeName:Se.ZodDate,...s(e)});class B extends l{_parse(t){if(this._getType(t)!==r.ZodParsedType.symbol){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.symbol,received:n.parsedType}),i.INVALID}return(0,i.OK)(t.data)}}u5.ZodSymbol=B,B.create=e=>new B({typeName:Se.ZodSymbol,...s(e)});class j extends l{_parse(t){if(this._getType(t)!==r.ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.undefined,received:n.parsedType}),i.INVALID}return(0,i.OK)(t.data)}}u5.ZodUndefined=j,j.create=e=>new j({typeName:Se.ZodUndefined,...s(e)});class V extends l{_parse(t){if(this._getType(t)!==r.ZodParsedType.null){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.null,received:n.parsedType}),i.INVALID}return(0,i.OK)(t.data)}}u5.ZodNull=V,V.create=e=>new V({typeName:Se.ZodNull,...s(e)});class H extends l{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,i.OK)(e.data)}}u5.ZodAny=H,H.create=e=>new H({typeName:Se.ZodAny,...s(e)});class z extends l{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,i.OK)(e.data)}}u5.ZodUnknown=z,z.create=e=>new z({typeName:Se.ZodUnknown,...s(e)});class U extends l{_parse(t){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.never,received:n.parsedType}),i.INVALID}}u5.ZodNever=U,U.create=e=>new U({typeName:Se.ZodNever,...s(e)});class G extends l{_parse(t){if(this._getType(t)!==r.ZodParsedType.undefined){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.void,received:n.parsedType}),i.INVALID}return(0,i.OK)(t.data)}}u5.ZodVoid=G,G.create=e=>new G({typeName:Se.ZodVoid,...s(e)});class W extends l{_parse(t){const{ctx:n,status:o}=this._processInputParams(t),s=this._def;if(n.parsedType!==r.ZodParsedType.array)return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:n.parsedType}),i.INVALID;if(null!==s.exactLength){const t=n.data.length>s.exactLength.value,r=n.data.length<s.exactLength.value;(t||r)&&((0,i.addIssueToContext)(n,{code:t?e.ZodIssueCode.too_big:e.ZodIssueCode.too_small,minimum:r?s.exactLength.value:void 0,maximum:t?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),o.dirty())}if(null!==s.minLength&&n.data.length<s.minLength.value&&((0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),o.dirty()),null!==s.maxLength&&n.data.length>s.maxLength.value&&((0,i.addIssueToContext)(n,{code:e.ZodIssueCode.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),o.dirty()),n.common.async)return Promise.all([...n.data].map((e,t)=>s.type._parseAsync(new a(n,e,n.path,t)))).then(e=>i.ParseStatus.mergeArray(o,e));const l=[...n.data].map((e,t)=>s.type._parseSync(new a(n,e,n.path,t)));return i.ParseStatus.mergeArray(o,l)}get element(){return this._def.type}min(e,t){return new W({...this._def,minLength:{value:e,message:n.errorUtil.toString(t)}})}max(e,t){return new W({...this._def,maxLength:{value:e,message:n.errorUtil.toString(t)}})}length(e,t){return new W({...this._def,exactLength:{value:e,message:n.errorUtil.toString(t)}})}nonempty(e){return this.min(1,e)}}function Y(e){if(e instanceof $){const t={};for(const n in e.shape){const i=e.shape[n];t[n]=de.create(Y(i))}return new $({...e._def,shape:()=>t})}return e instanceof W?new W({...e._def,type:Y(e.element)}):e instanceof de?de.create(Y(e.unwrap())):e instanceof he?he.create(Y(e.unwrap())):e instanceof J?J.create(e.items.map(e=>Y(e))):e}u5.ZodArray=W,W.create=(e,t)=>new W({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Se.ZodArray,...s(t)});class $ extends l{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=r.util.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(t){if(this._getType(t)!==r.ZodParsedType.object){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:n.parsedType}),i.INVALID}const{status:n,ctx:o}=this._processInputParams(t),{shape:s,keys:l}=this._getCached(),u=[];if(!(this._def.catchall instanceof U&&"strip"===this._def.unknownKeys))for(const e in o.data)l.includes(e)||u.push(e);const c=[];for(const e of l){const t=s[e],n=o.data[e];c.push({key:{status:"valid",value:e},value:t._parse(new a(o,n,o.path,e)),alwaysSet:e in o.data})}if(this._def.catchall instanceof U){const t=this._def.unknownKeys;if("passthrough"===t)for(const e of u)c.push({key:{status:"valid",value:e},value:{status:"valid",value:o.data[e]}});else if("strict"===t)u.length>0&&((0,i.addIssueToContext)(o,{code:e.ZodIssueCode.unrecognized_keys,keys:u}),n.dirty());else if("strip"!==t)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of u){const n=o.data[t];c.push({key:{status:"valid",value:t},value:e._parse(new a(o,n,o.path,t)),alwaysSet:t in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of c){const n=await t.key,i=await t.value;e.push({key:n,value:i,alwaysSet:t.alwaysSet})}return e}).then(e=>i.ParseStatus.mergeObjectSync(n,e)):i.ParseStatus.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return n.errorUtil.errToObj,new $({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,i)=>{const r=this._def.errorMap?.(t,i).message??i.defaultError;return"unrecognized_keys"===t.code?{message:n.errorUtil.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new $({...this._def,unknownKeys:"strip"})}passthrough(){return new $({...this._def,unknownKeys:"passthrough"})}extend(e){return new $({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new $({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Se.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new $({...this._def,catchall:e})}pick(e){const t={};for(const n of r.util.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new $({...this._def,shape:()=>t})}omit(e){const t={};for(const n of r.util.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new $({...this._def,shape:()=>t})}deepPartial(){return Y(this)}partial(e){const t={};for(const n of r.util.objectKeys(this.shape)){const i=this.shape[n];e&&!e[n]?t[n]=i:t[n]=i.optional()}return new $({...this._def,shape:()=>t})}required(e){const t={};for(const n of r.util.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof de;)e=e._def.innerType;t[n]=e}return new $({...this._def,shape:()=>t})}keyof(){return oe(r.util.objectKeys(this.shape))}}u5.ZodObject=$,$.create=(e,t)=>new $({shape:()=>e,unknownKeys:"strip",catchall:U.create(),typeName:Se.ZodObject,...s(t)}),$.strictCreate=(e,t)=>new $({shape:()=>e,unknownKeys:"strict",catchall:U.create(),typeName:Se.ZodObject,...s(t)}),$.lazycreate=(e,t)=>new $({shape:e,unknownKeys:"strip",catchall:U.create(),typeName:Se.ZodObject,...s(t)});class X extends l{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;if(n.common.async)return Promise.all(r.map(async e=>{const t={...n,common:{...n.common,issues:[]},parent:null};return{result:await e._parseAsync({data:n.data,path:n.path,parent:t}),ctx:t}})).then(function(t){for(const e of t)if("valid"===e.result.status)return e.result;for(const e of t)if("dirty"===e.result.status)return n.common.issues.push(...e.ctx.common.issues),e.result;const r=t.map(t=>new e.ZodError(t.ctx.common.issues));return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_union,unionErrors:r}),i.INVALID});{let t;const a=[];for(const e of r){const i={...n,common:{...n.common,issues:[]},parent:null},r=e._parseSync({data:n.data,path:n.path,parent:i});if("valid"===r.status)return r;"dirty"!==r.status||t||(t={result:r,ctx:i}),i.common.issues.length&&a.push(i.common.issues)}if(t)return n.common.issues.push(...t.ctx.common.issues),t.result;const o=a.map(t=>new e.ZodError(t));return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_union,unionErrors:o}),i.INVALID}}get options(){return this._def.options}}u5.ZodUnion=X,X.create=(e,t)=>new X({options:e,typeName:Se.ZodUnion,...s(t)});const q=e=>e instanceof re?q(e.schema):e instanceof ce?q(e.innerType()):e instanceof ae?[e.value]:e instanceof se?e.options:e instanceof le?r.util.objectValues(e.enum):e instanceof me?q(e._def.innerType):e instanceof j?[void 0]:e instanceof V?[null]:e instanceof de?[void 0,...q(e.unwrap())]:e instanceof he?[null,...q(e.unwrap())]:e instanceof _e||e instanceof ye?q(e.unwrap()):e instanceof pe?q(e._def.innerType):[];class Z extends l{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.object)return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:n.parsedType}),i.INVALID;const a=this.discriminator,o=n.data[a],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):((0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),i.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const i=new Map;for(const r of t){const t=q(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(i.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,r)}}return new Z({typeName:Se.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...s(n)})}}function K(e,t){const n=(0,r.getParsedType)(e),i=(0,r.getParsedType)(t);if(e===t)return{valid:!0,data:e};if(n===r.ZodParsedType.object&&i===r.ZodParsedType.object){const n=r.util.objectKeys(t),i=r.util.objectKeys(e).filter(e=>-1!==n.indexOf(e)),a={...e,...t};for(const r of i){const n=K(e[r],t[r]);if(!n.valid)return{valid:!1};a[r]=n.data}return{valid:!0,data:a}}if(n===r.ZodParsedType.array&&i===r.ZodParsedType.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let i=0;i<e.length;i++){const r=K(e[i],t[i]);if(!r.valid)return{valid:!1};n.push(r.data)}return{valid:!0,data:n}}return n===r.ZodParsedType.date&&i===r.ZodParsedType.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}u5.ZodDiscriminatedUnion=Z;class Q extends l{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),a=(t,a)=>{if((0,i.isAborted)(t)||(0,i.isAborted)(a))return i.INVALID;const o=K(t.value,a.value);return o.valid?(((0,i.isDirty)(t)||(0,i.isDirty)(a))&&n.dirty(),{status:n.value,value:o.data}):((0,i.addIssueToContext)(r,{code:e.ZodIssueCode.invalid_intersection_types}),i.INVALID)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}u5.ZodIntersection=Q,Q.create=(e,t,n)=>new Q({left:e,right:t,typeName:Se.ZodIntersection,...s(n)});class J extends l{_parse(t){const{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==r.ZodParsedType.array)return(0,i.addIssueToContext)(o,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.array,received:o.parsedType}),i.INVALID;if(o.data.length<this._def.items.length)return(0,i.addIssueToContext)(o,{code:e.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.INVALID;!this._def.rest&&o.data.length>this._def.items.length&&((0,i.addIssueToContext)(o,{code:e.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...o.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new a(o,e,o.path,t)):null}).filter(e=>!!e);return o.common.async?Promise.all(s).then(e=>i.ParseStatus.mergeArray(n,e)):i.ParseStatus.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new J({...this._def,rest:e})}}u5.ZodTuple=J,J.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new J({items:e,typeName:Se.ZodTuple,rest:null,...s(t)})};class ee extends l{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==r.ZodParsedType.object)return(0,i.addIssueToContext)(o,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.object,received:o.parsedType}),i.INVALID;const s=[],l=this._def.keyType,u=this._def.valueType;for(const e in o.data)s.push({key:l._parse(new a(o,e,o.path,e)),value:u._parse(new a(o,o.data[e],o.path,e)),alwaysSet:e in o.data});return o.common.async?i.ParseStatus.mergeObjectAsync(n,s):i.ParseStatus.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(e,t,n){return new ee(t instanceof l?{keyType:e,valueType:t,typeName:Se.ZodRecord,...s(n)}:{keyType:L.create(),valueType:e,typeName:Se.ZodRecord,...s(t)})}}u5.ZodRecord=ee;class te extends l{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==r.ZodParsedType.map)return(0,i.addIssueToContext)(o,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.map,received:o.parsedType}),i.INVALID;const s=this._def.keyType,l=this._def.valueType,u=[...o.data.entries()].map(([e,t],n)=>({key:s._parse(new a(o,e,o.path,[n,"key"])),value:l._parse(new a(o,t,o.path,[n,"value"]))}));if(o.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const t of u){const r=await t.key,a=await t.value;if("aborted"===r.status||"aborted"===a.status)return i.INVALID;"dirty"!==r.status&&"dirty"!==a.status||n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}})}{const e=new Map;for(const t of u){const r=t.key,a=t.value;if("aborted"===r.status||"aborted"===a.status)return i.INVALID;"dirty"!==r.status&&"dirty"!==a.status||n.dirty(),e.set(r.value,a.value)}return{status:n.value,value:e}}}}u5.ZodMap=te,te.create=(e,t,n)=>new te({valueType:t,keyType:e,typeName:Se.ZodMap,...s(n)});class ne extends l{_parse(t){const{status:n,ctx:o}=this._processInputParams(t);if(o.parsedType!==r.ZodParsedType.set)return(0,i.addIssueToContext)(o,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.set,received:o.parsedType}),i.INVALID;const s=this._def;null!==s.minSize&&o.data.size<s.minSize.value&&((0,i.addIssueToContext)(o,{code:e.ZodIssueCode.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),null!==s.maxSize&&o.data.size>s.maxSize.value&&((0,i.addIssueToContext)(o,{code:e.ZodIssueCode.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function u(e){const t=new Set;for(const r of e){if("aborted"===r.status)return i.INVALID;"dirty"===r.status&&n.dirty(),t.add(r.value)}return{status:n.value,value:t}}const c=[...o.data.values()].map((e,t)=>l._parse(new a(o,e,o.path,t)));return o.common.async?Promise.all(c).then(e=>u(e)):u(c)}min(e,t){return new ne({...this._def,minSize:{value:e,message:n.errorUtil.toString(t)}})}max(e,t){return new ne({...this._def,maxSize:{value:e,message:n.errorUtil.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}u5.ZodSet=ne,ne.create=(e,t)=>new ne({valueType:e,minSize:null,maxSize:null,typeName:Se.ZodSet,...s(t)});class ie extends l{constructor(){super(...arguments),this.validate=this.implement}_parse(n){const{ctx:a}=this._processInputParams(n);if(a.parsedType!==r.ZodParsedType.function)return(0,i.addIssueToContext)(a,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.function,received:a.parsedType}),i.INVALID;function o(n,r){return(0,i.makeIssue)({data:n,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(e=>!!e),issueData:{code:e.ZodIssueCode.invalid_arguments,argumentsError:r}})}function s(n,r){return(0,i.makeIssue)({data:n,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(e=>!!e),issueData:{code:e.ZodIssueCode.invalid_return_type,returnTypeError:r}})}const l={errorMap:a.common.contextualErrorMap},u=a.data;if(this._def.returns instanceof ue){const t=this;return(0,i.OK)(async function(...n){const i=new e.ZodError([]),r=await t._def.args.parseAsync(n,l).catch(e=>{throw i.addIssue(o(n,e)),i}),a=await Reflect.apply(u,this,r),c=await t._def.returns._def.type.parseAsync(a,l).catch(e=>{throw i.addIssue(s(a,e)),i});return c})}{const t=this;return(0,i.OK)(function(...n){const i=t._def.args.safeParse(n,l);if(!i.success)throw new e.ZodError([o(n,i.error)]);const r=Reflect.apply(u,this,i.data),a=t._def.returns.safeParse(r,l);if(!a.success)throw new e.ZodError([s(r,a.error)]);return a.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ie({...this._def,args:J.create(e).rest(z.create())})}returns(e){return new ie({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new ie({args:e||J.create([]).rest(z.create()),returns:t||z.create(),typeName:Se.ZodFunction,...s(n)})}}u5.ZodFunction=ie;class re extends l{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}u5.ZodLazy=re,re.create=(e,t)=>new re({getter:e,typeName:Se.ZodLazy,...s(t)});class ae extends l{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{received:n.data,code:e.ZodIssueCode.invalid_literal,expected:this._def.value}),i.INVALID}return{status:"valid",value:t.data}}get value(){return this._def.value}}function oe(e,t){return new se({values:e,typeName:Se.ZodEnum,...s(t)})}u5.ZodLiteral=ae,ae.create=(e,t)=>new ae({value:e,typeName:Se.ZodLiteral,...s(t)});class se extends l{_parse(t){if("string"!=typeof t.data){const n=this._getOrReturnCtx(t),a=this._def.values;return(0,i.addIssueToContext)(n,{expected:r.util.joinValues(a),received:n.parsedType,code:e.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return(0,i.addIssueToContext)(n,{received:n.data,code:e.ZodIssueCode.invalid_enum_value,options:r}),i.INVALID}return(0,i.OK)(t.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return se.create(e,{...this._def,...t})}exclude(e,t=this._def){return se.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}u5.ZodEnum=se,se.create=oe;class le extends l{_parse(t){const n=r.util.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(t);if(a.parsedType!==r.ZodParsedType.string&&a.parsedType!==r.ZodParsedType.number){const t=r.util.objectValues(n);return(0,i.addIssueToContext)(a,{expected:r.util.joinValues(t),received:a.parsedType,code:e.ZodIssueCode.invalid_type}),i.INVALID}if(this._cache||(this._cache=new Set(r.util.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=r.util.objectValues(n);return(0,i.addIssueToContext)(a,{received:a.data,code:e.ZodIssueCode.invalid_enum_value,options:t}),i.INVALID}return(0,i.OK)(t.data)}get enum(){return this._def.values}}u5.ZodNativeEnum=le,le.create=(e,t)=>new le({values:e,typeName:Se.ZodNativeEnum,...s(t)});class ue extends l{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==r.ZodParsedType.promise&&!1===n.common.async)return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.promise,received:n.parsedType}),i.INVALID;const a=n.parsedType===r.ZodParsedType.promise?n.data:Promise.resolve(n.data);return(0,i.OK)(a.then(e=>this._def.type.parseAsync(e,{path:n.path,errorMap:n.common.contextualErrorMap})))}}u5.ZodPromise=ue,ue.create=(e,t)=>new ue({type:e,typeName:Se.ZodPromise,...s(t)});class ce extends l{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Se.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,o={addIssue:e=>{(0,i.addIssueToContext)(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===a.type){const e=a.transform(n.data,o);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return i.INVALID;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?i.INVALID:"dirty"===r.status||"dirty"===t.value?(0,i.DIRTY)(r.value):r});{if("aborted"===t.value)return i.INVALID;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?i.INVALID:"dirty"===r.status||"dirty"===t.value?(0,i.DIRTY)(r.value):r}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,o);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?i.INVALID:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?i.INVALID:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if("transform"===a.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,i.isValid)(e))return i.INVALID;const r=a.transform(e.value,o);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>(0,i.isValid)(e)?Promise.resolve(a.transform(e.value,o)).then(e=>({status:t.value,value:e})):i.INVALID)}r.util.assertNever(a)}}u5.ZodEffects=ce,u5.ZodTransformer=ce,ce.create=(e,t,n)=>new ce({schema:e,typeName:Se.ZodEffects,effect:t,...s(n)}),ce.createWithPreprocess=(e,t,n)=>new ce({schema:t,effect:{type:"preprocess",transform:e},typeName:Se.ZodEffects,...s(n)});class de extends l{_parse(e){return this._getType(e)===r.ZodParsedType.undefined?(0,i.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}u5.ZodOptional=de,de.create=(e,t)=>new de({innerType:e,typeName:Se.ZodOptional,...s(t)});class he extends l{_parse(e){return this._getType(e)===r.ZodParsedType.null?(0,i.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}u5.ZodNullable=he,he.create=(e,t)=>new he({innerType:e,typeName:Se.ZodNullable,...s(t)});class me extends l{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===r.ZodParsedType.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}u5.ZodDefault=me,me.create=(e,t)=>new me({innerType:e,typeName:Se.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...s(t)});class pe extends l{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},a=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return(0,i.isAsync)(a)?a.then(t=>({status:"valid",value:"valid"===t.status?t.value:this._def.catchValue({get error(){return new e.ZodError(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new e.ZodError(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}u5.ZodCatch=pe,pe.create=(e,t)=>new pe({innerType:e,typeName:Se.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...s(t)});class fe extends l{_parse(t){if(this._getType(t)!==r.ZodParsedType.nan){const n=this._getOrReturnCtx(t);return(0,i.addIssueToContext)(n,{code:e.ZodIssueCode.invalid_type,expected:r.ZodParsedType.nan,received:n.parsedType}),i.INVALID}return{status:"valid",value:t.data}}}u5.ZodNaN=fe,fe.create=e=>new fe({typeName:Se.ZodNaN,...s(e)}),u5.BRAND=Symbol("zod_brand");class _e extends l{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}u5.ZodBranded=_e;class ge extends l{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?i.INVALID:"dirty"===e.status?(t.dirty(),(0,i.DIRTY)(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?i.INVALID:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new ge({in:e,out:t,typeName:Se.ZodPipeline})}}u5.ZodPipeline=ge;class ye extends l{_parse(e){const t=this._def.innerType._parse(e),n=e=>((0,i.isValid)(e)&&(e.value=Object.freeze(e.value)),e);return(0,i.isAsync)(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}function ve(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function be(e,t={},n){return e?H.create().superRefine((i,r)=>{const a=e(i);if(a instanceof Promise)return a.then(e=>{if(!e){const e=ve(t,i),a=e.fatal??n??!0;r.addIssue({code:"custom",...e,fatal:a})}});if(!a){const e=ve(t,i),a=e.fatal??n??!0;r.addIssue({code:"custom",...e,fatal:a})}}):H.create()}var Se,we;u5.ZodReadonly=ye,ye.create=(e,t)=>new ye({innerType:e,typeName:Se.ZodReadonly,...s(t)}),u5.late={object:$.lazycreate},(we=Se||(u5.ZodFirstPartyTypeKind=Se={})).ZodString="ZodString",we.ZodNumber="ZodNumber",we.ZodNaN="ZodNaN",we.ZodBigInt="ZodBigInt",we.ZodBoolean="ZodBoolean",we.ZodDate="ZodDate",we.ZodSymbol="ZodSymbol",we.ZodUndefined="ZodUndefined",we.ZodNull="ZodNull",we.ZodAny="ZodAny",we.ZodUnknown="ZodUnknown",we.ZodNever="ZodNever",we.ZodVoid="ZodVoid",we.ZodArray="ZodArray",we.ZodObject="ZodObject",we.ZodUnion="ZodUnion",we.ZodDiscriminatedUnion="ZodDiscriminatedUnion",we.ZodIntersection="ZodIntersection",we.ZodTuple="ZodTuple",we.ZodRecord="ZodRecord",we.ZodMap="ZodMap",we.ZodSet="ZodSet",we.ZodFunction="ZodFunction",we.ZodLazy="ZodLazy",we.ZodLiteral="ZodLiteral",we.ZodEnum="ZodEnum",we.ZodEffects="ZodEffects",we.ZodNativeEnum="ZodNativeEnum",we.ZodOptional="ZodOptional",we.ZodNullable="ZodNullable",we.ZodDefault="ZodDefault",we.ZodCatch="ZodCatch",we.ZodPromise="ZodPromise",we.ZodBranded="ZodBranded",we.ZodPipeline="ZodPipeline",we.ZodReadonly="ZodReadonly";u5.instanceof=(e,t={message:`Input not instance of ${e.name}`})=>be(t=>t instanceof e,t);const ke=L.create;u5.string=ke;const Ce=M.create;u5.number=Ce;const Ee=fe.create;u5.nan=Ee;const Ie=D.create;u5.bigint=Ie;const xe=N.create;u5.boolean=xe;const Te=F.create;u5.date=Te;const Oe=B.create;u5.symbol=Oe;const Re=j.create;u5.undefined=Re;const Ae=V.create;u5.null=Ae;const Le=H.create;u5.any=Le;const Pe=z.create;u5.unknown=Pe;const Me=U.create;u5.never=Me;const De=G.create;u5.void=De;const Ne=W.create;u5.array=Ne;const Fe=$.create;u5.object=Fe;const Be=$.strictCreate;u5.strictObject=Be;const je=X.create;u5.union=je;const Ve=Z.create;u5.discriminatedUnion=Ve;const He=Q.create;u5.intersection=He;const ze=J.create;u5.tuple=ze;const Ue=ee.create;u5.record=Ue;const Ge=te.create;u5.map=Ge;const We=ne.create;u5.set=We;const Ye=ie.create;u5.function=Ye;const $e=re.create;u5.lazy=$e;const Xe=ae.create;u5.literal=Xe;const qe=se.create;u5.enum=qe;const Ze=le.create;u5.nativeEnum=Ze;const Ke=ue.create;u5.promise=Ke;const Qe=ce.create;u5.effect=Qe,u5.transformer=Qe;const Je=de.create;u5.optional=Je;const et=he.create;u5.nullable=et;const tt=ce.createWithPreprocess;u5.preprocess=tt;const nt=ge.create;u5.pipeline=nt;u5.ostring=()=>ke().optional();u5.onumber=()=>Ce().optional();return u5.oboolean=()=>xe().optional(),u5.coerce={string:e=>L.create({...e,coerce:!0}),number:e=>M.create({...e,coerce:!0}),boolean:e=>N.create({...e,coerce:!0}),bigint:e=>D.create({...e,coerce:!0}),date:e=>F.create({...e,coerce:!0})},u5.NEVER=i.INVALID,u5}function m5(){return r5||(r5=1,e=H9,t=H9&&H9.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=H9&&H9.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)},Object.defineProperty(e,"__esModule",{value:!0}),n(q9(),e),n(Q9(),e),n(t5(),e),n(Y9(),e),n(h5(),e),n($9(),e)),H9;var e,t,n}function p5(){return a5||(a5=1,function(e){var t=V9&&V9.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=V9&&V9.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=V9&&V9.__importStar||function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&t(i,e,r);return n(i,e),i},r=V9&&V9.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;const a=i(m5());e.z=a,r(m5(),e),e.default=a}(V9)),V9}function f5(){if(o5)return j9;o5=1,Object.defineProperty(j9,"__esModule",{value:!0}),j9.recommendationPropsSchema=j9.calculatorParamsSchema=j9.activitySchema=j9.activityReductionSchema=void 0;var e=p5(),t=DL(),n=o4();const i=(t,n)=>e.z.number().refine(e=>e>=t.min&&e<=t.max,{message:n}),r=j9.activityReductionSchema=e.z.object({fromZero:i(n.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromThirty:i(n.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromFortysix:i(n.ACTIVITY_SETTINGS_INTERVAL_LIMITS),fromSixtyone:i(n.ACTIVITY_SETTINGS_INTERVAL_LIMITS).nullable()}),a=j9.activitySchema=e.z.object({activityDuration:i(n.ACTIVITY_DURATION_MINUTES_LIMITS),activityIntensity:e.z.nativeEnum(t.ActivityIntensity).nullable(),activitySettings:e.z.object({light:r,moderate:r,hard:e.z.object({...r.shape,fromFortysix:i(n.ACTIVITY_SETTINGS_INTERVAL_LIMITS).nullable()}),post:r,target:i(n.ACTIVITY_TARGET_BGL_MMOL_LIMITS)}),activityDate:e.z.date()}).nullable(),o=j9.calculatorParamsSchema=e.z.object({glucoseReading:e.z.object({value:e.z.number(),unit:e.z.nativeEnum(t.BloodGlucoseUnit),source:e.z.enum(["manual","forecast","device","external"]),timestamp:e.z.number(),id:e.z.string().uuid()}),targetBGL:i(n.TARGET_BGL_MMOL_LIMITS),insulinSensitivity:i(n.INSULIN_SENSITIVITY_MMOL_LIMITS),carbohydrates:i(n.CARBOHYDRATES_LIMITS),carbohydrateRatio:i(n.INSULIN_TO_CARBS_RATIO_LIMITS),recentBoluses:e.z.array(e.z.object({secondsPassed:i(n.BOLUS_SECONDS_PASSED_LIMITS),insulinDose:i(n.INSULIN_DOSE_LIMITS),id:e.z.string().uuid()})),activity:a});return j9.recommendationPropsSchema=e.z.object({bloodGlucoseUnit:e.z.nativeEnum(t.BloodGlucoseUnit),injectionMethod:e.z.nativeEnum(t.InjectionMethod),language:e.z.string().refine(e=>Object.keys(t.Languages).includes(e)),calculatorParams:o}),j9}function _5(){if(s5)return B3;s5=1,Object.defineProperty(B3,"__esModule",{value:!0}),B3.default=B3.SyncStatus=B3.RecommendationScreen=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=j3,i=Oq(),r=DL(),a=I(g4()),o=I(q4()),s=I(function(){if(Z4)return K4;Z4=1,Object.defineProperty(K4,"__esModule",{value:!0}),K4.default=void 0,function(e){e&&e.__esModule}(w());var e=QB,t=t4(),n=l();const i=e.StyleSheet.create({container:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%"},line:{width:8,height:1,borderRadius:4,backgroundColor:t.COLORS.divider}});return K4.default=function(){const t=Array.from({length:25},(e,t)=>`dot-${t}`);return(0,n.jsx)(e.View,{style:i.container,children:t.map(t=>(0,n.jsx)(e.View,{testID:t,style:i.line},t))})},K4}()),u=I(l9()),c=I(function(){if(u9)return c9;u9=1,Object.defineProperty(c9,"__esModule",{value:!0}),c9.default=void 0,a(w());var e=QB,t=u4(),n=t4(),i=a(_4()),r=l();function a(e){return e&&e.__esModule?e:{default:e}}const o=e.StyleSheet.create({container:{justifyContent:"flex-end",gap:16,backgroundColor:n.COLORS.bgNavigationBar,padding:16},saveButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:n.COLORS.bgButtonPrimary,borderRadius:16,borderColor:n.COLORS.divider,borderWidth:1},deleteButton:{paddingHorizontal:16,paddingVertical:12,backgroundColor:n.COLORS.bgButtonSecondaryDanger,borderRadius:16},saveText:{...n.FONTS.Poppins.semiBold_Base,textAlign:"center"},deleteText:{...n.FONTS.Poppins.semiBold_Base,color:n.COLORS.textButtonSecondaryDanger,textAlign:"center"}});return c9.default=function({prefixTestID:n,onSave:a,onDelete:s,onLayout:l}){const{t:u}=(0,t.useLanguage)();return(0,r.jsxs)(e.View,{style:o.container,onLayout:l,testID:n+"-footer",children:[(0,r.jsx)(e.TouchableOpacity,{style:o.saveButton,onPress:a,testID:n+"-footer-save-button",children:(0,r.jsx)(i.default,{style:o.saveText,children:u("button_save")})}),(0,r.jsx)(e.TouchableOpacity,{style:o.deleteButton,onPress:s,testID:n+"-footer-delete-button",children:(0,r.jsx)(i.default,{style:o.deleteText,children:u("button_delete")})})]})},c9}()),d=I(function(){if(d9)return h9;d9=1,Object.defineProperty(h9,"__esModule",{value:!0}),h9.default=void 0,a(w());var e=QB,t=a(ej()),n=t4(),i=u4(),r=l();function a(e){return e&&e.__esModule?e:{default:e}}const o=e.StyleSheet.create({gradientContainer:{borderTopLeftRadius:12,borderTopRightRadius:12,paddingVertical:20},text:{...n.FONTS.Poppins.medium_Base,color:n.COLORS.textCarbRecommendation,textAlign:"center"},textCrossed:{textDecorationLine:"line-through",opacity:.5,marginBottom:4}});return h9.default=function({isEdited:a}){const{t:s}=(0,i.useLanguage)(),{width:l}=(0,e.useWindowDimensions)();return a?(0,r.jsxs)(t.default,{colors:[n.COLORS.bgGradientBottom,n.COLORS.bgGradientTop],style:[o.gradientContainer],testID:"edited-recommendation-header",children:[(0,r.jsx)(e.Text,{style:[o.text,o.textCrossed],children:s("recommendation_card_title").toUpperCase()}),(0,r.jsx)(e.Text,{style:o.text,children:s("recommendation_change_title").toUpperCase()})]}):(0,r.jsx)(t.default,{colors:[n.COLORS.bgGradientBottom,n.COLORS.bgGradientTop],style:[o.gradientContainer,{width:l-32}],testID:"initial-recommendation-header",children:(0,r.jsx)(e.Text,{style:o.text,children:s("recommendation_card_title").toUpperCase()})})},h9}()),h=I(function(){if(m9)return p9;m9=1,Object.defineProperty(p9,"__esModule",{value:!0}),p9.default=void 0;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=Oq(),i=DL(),r=m(k4()),a=o4(),o=u4(),s=t4(),u=h4(),c=m(_4()),d=m(X4()),h=l();function m(e){return e&&e.__esModule?e:{default:e}}const p=t.StyleSheet.create({container:{paddingVertical:48,justifyContent:"center",alignItems:"center",backgroundColor:s.COLORS.bgSecondary},title:{...s.FONTS.Poppins.medium_Base,color:s.COLORS.labelSecondary},row:{flexDirection:"row",marginVertical:8,alignItems:"center"},value:{...s.FONTS.Poppins.bold_6XL,color:s.COLORS.labelPrimary},crossedValue:{...s.FONTS.Poppins.bold_2XL,color:s.COLORS.labelSecondary,textDecorationLine:"line-through",opacity:.4},crossedUnit:{...s.FONTS.Poppins.bold_2XL,color:s.COLORS.labelSecondary},unit:{...s.FONTS.Poppins.bold_2XL,color:s.COLORS.labelSecondary,lineHeight:78},editIcon:{marginLeft:4}});return p9.default=function({initialValue:s,editedValue:l,wasLimited:m,injectionMethod:f,onDismiss:_,onConfirm:g}){const{t:y}=(0,o.useLanguage)(),[v,b]=(0,e.useState)(!1),S=(0,e.useCallback)(()=>{b(!0)},[]),w=(0,e.useCallback)(()=>{b(!1)},[]),k=(0,e.useCallback)(e=>{b(!1),g(e)},[g]),C=(0,e.useMemo)(()=>{const{min:e,max:t}=a.INSULIN_DOSE_LIMITS,n=m?s:t;return f===i.InjectionMethod.Pump?(0,u.createSequentialArrayDecimal)(e,n):f===i.InjectionMethod.PenWhole?(0,u.createSequentialArrayInteger)(e,n):(0,u.createSequentialArrayHalf)(e,n)},[f,s,m]),E=(0,e.useMemo)(()=>f===i.InjectionMethod.PenWhole?0:1,[f]),I=(0,e.useCallback)(()=>{if(null!==l)return C.findIndex(e=>e===l.toFixed(E));const e=(0,n.roundInsulinValue)(s,f);return C.findIndex(t=>t===e.toFixed(E))},[l,s,C,f,E]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(t.View,{style:p.container,children:[null!==l&&(0,h.jsxs)(c.default,{style:p.crossedValue,testID:"insulin-initial-value",children:[`${s} `,(0,h.jsx)(c.default,{style:p.crossedUnit,testID:"insulin-initial-unit",children:y(1===s?"unit":"units")})]}),(0,h.jsxs)(t.TouchableOpacity,{style:p.row,testID:"insulin-current-value-container",onPress:S,children:[(0,h.jsxs)(c.default,{style:p.value,testID:"insulin-value",children:[`${l??s} `,(0,h.jsx)(c.default,{style:p.unit,testID:"insulin-unit",children:y(1===(l??s)?"unit":"units")})]}),(0,h.jsx)(t.TouchableOpacity,{onPress:S,testID:"insulin-edit-button",hitSlop:10,children:(0,h.jsx)(r.default,{style:p.editIcon})})]}),(0,h.jsx)(c.default,{style:p.title,testID:"insulin-display-title",children:y("recommendation_rapid_title")})]}),(0,h.jsx)(d.default,{type:"insulin",items:C,isVisible:v,initialScrollIndex:I(),onConfirm:k,onCancel:w,onDismiss:_})]})},p9}()),m=I(function(){if(_9)return g9;_9=1,Object.defineProperty(g9,"__esModule",{value:!0}),g9.default=void 0,o(w());var e=QB,t=u4(),n=o(_4()),i=o(D4()),r=v9(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}return g9.default=o=>{const{isVisible:s,onPressClose:l}=o,{t:u}=(0,t.useLanguage)();return(0,a.jsx)(i.default,{isVisible:s,children:(0,a.jsxs)(e.View,{testID:"delete-failure-modal-visible-"+s,children:[(0,a.jsx)(n.default,{style:r.styles.title,testID:"delete-modal-failure-title",children:u("new_activity_modal_no_delete_title")}),(0,a.jsx)(n.default,{style:r.styles.message,testID:"delete-modal-failure-message",children:u("new_activity_modal_no_delete_body")}),(0,a.jsx)(e.TouchableOpacity,{style:r.styles.deleteFailureCloseButton,onPress:l,testID:"delete-modal-failure-close-button",children:(0,a.jsx)(n.default,{style:r.styles.buttonText,children:u("button_close")})})]})})},g9}()),p=I(function(){if(b9)return S9;b9=1,Object.defineProperty(S9,"__esModule",{value:!0}),S9.default=void 0,o(w());var e=QB,t=u4(),n=o(_4()),i=o(D4()),r=v9(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}return S9.default=o=>{const{isVisible:s,onPressDelete:l,onPressCancel:u,onDismiss:c}=o,{t:d}=(0,t.useLanguage)();return(0,a.jsx)(i.default,{onModalHide:c,isVisible:s,children:(0,a.jsxs)(e.View,{testID:"delete-modal-visible-"+s,children:[(0,a.jsx)(n.default,{style:r.styles.title,testID:"delete-modal-title",children:d("recommendation_modal_delete_rec_title")}),(0,a.jsx)(n.default,{style:r.styles.message,testID:"delete-modal-message",children:d("recommendation_modal_delete_rec_body")}),(0,a.jsxs)(e.View,{style:r.styles.buttonContainer,children:[(0,a.jsx)(e.TouchableOpacity,{style:r.styles.deleteRedButton,onPress:l,testID:"delete-modal-delete-button",children:(0,a.jsx)(n.default,{style:r.styles.buttonText,children:d("recommendation_modal_delete_rec_button_danger_delete")})}),(0,a.jsx)(e.TouchableOpacity,{style:r.styles.cancelButton,onPress:u,testID:"delete-modal-cancel-button",children:(0,a.jsx)(n.default,{style:r.styles.buttonText,children:d("button_cancel")})})]})]})})},S9}()),f=I(function(){if(w9)return k9;w9=1,Object.defineProperty(k9,"__esModule",{value:!0}),k9.default=void 0,o(w());var e=QB,t=u4(),n=o(_4()),i=o(D4()),r=v9(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}return k9.default=o=>{const{isVisible:s,onPressClose:l}=o,{t:u}=(0,t.useLanguage)();return(0,a.jsx)(i.default,{isVisible:s,children:(0,a.jsxs)(e.View,{testID:"edit-failure-modal-visible-"+s,children:[(0,a.jsx)(n.default,{style:r.styles.title,testID:"edit-modal-failure-title",children:u("glucose_modal_changes_title")}),(0,a.jsx)(n.default,{style:r.styles.message,testID:"edit-modal-failure-message",children:u("glucose_modal_changes_body")}),(0,a.jsx)(e.TouchableOpacity,{style:r.styles.deleteFailureCloseButton,onPress:l,testID:"edit-modal-failure-close-button",children:(0,a.jsx)(n.default,{style:r.styles.buttonText,children:u("glucose_modal_changes_button_confirm")})})]})})},k9}()),_=I(function(){if(C9)return E9;C9=1,Object.defineProperty(E9,"__esModule",{value:!0}),E9.default=void 0,E9.getLimitedValue=c;var e=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(w()),t=QB,n=DL(),i=u4(),r=u(_4()),a=u(D4()),o=v9(),s=l();function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return n.CONSTANTS.INSULIN_DOSE_MAX-n.CONSTANTS.INSULIN_DOSE_MAX*e}return E9.default=l=>{const{isVisible:u,activityReduction:d,onPress:h}=l,{t:m}=(0,i.useLanguage)(),p=(0,e.useMemo)(()=>null===d?m("recommendation_modal_safety_limitation_body",{SAFETY_INSULIN_LIMIT:`${n.CONSTANTS.INSULIN_DOSE_MAX}`}):m("recommendation_modal_safety_limitation2_body",{0:`${c(d)}`,SAFETY_INSULIN_LIMIT:`${n.CONSTANTS.INSULIN_DOSE_MAX}`,1:`${(100*d).toFixed(0)}`,2:`${c(d)}`}),[d,m]);return(0,s.jsx)(a.default,{isVisible:u,children:(0,s.jsxs)(t.View,{testID:"limitation-modal-visible-"+u,children:[(0,s.jsx)(r.default,{style:o.styles.title,children:m("recommendation_modal_safety_limitation_title")}),(0,s.jsx)(r.default,{style:o.styles.message,testID:"limitation-modal-message",children:p}),(0,s.jsx)(t.TouchableOpacity,{style:o.styles.button,onPress:h,testID:"limitation-modal-button",children:(0,s.jsx)(r.default,{style:o.styles.buttonText,children:m("button_understood")})})]})})},E9}()),g=I(function(){if(I9)return x9;I9=1,Object.defineProperty(x9,"__esModule",{value:!0}),x9.default=void 0,o(w());var e=QB,t=u4(),n=o(_4()),i=o(D4()),r=v9(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}return x9.default=o=>{const{isVisible:s,onPressClose:l}=o,{t:u}=(0,t.useLanguage)();return(0,a.jsx)(i.default,{isVisible:s,children:(0,a.jsxs)(e.View,{testID:"save-failure-modal-visible-"+s,children:[(0,a.jsx)(n.default,{style:r.styles.title,testID:"save-modal-failure-title",children:u("no_save_modal_title")}),(0,a.jsx)(n.default,{style:r.styles.message,testID:"save-modal-failure-message",children:u("no_save_modal_body")}),(0,a.jsx)(e.TouchableOpacity,{style:r.styles.deleteFailureCloseButton,onPress:l,testID:"save-modal-failure-close-button",children:(0,a.jsx)(n.default,{style:r.styles.buttonText,children:u("button_close")})})]})})},x9}()),y=I(function(){if(T9)return O9;T9=1,Object.defineProperty(O9,"__esModule",{value:!0}),O9.default=void 0,o(w());var e=QB,t=u4(),n=o(_4()),i=o(D4()),r=v9(),a=l();function o(e){return e&&e.__esModule?e:{default:e}}return O9.default=o=>{const{isVisible:s,onPressViewInLogbook:l,onPressCancel:u,onDismiss:c}=o,{t:d}=(0,t.useLanguage)(),h="web"===e.Platform.OS;return(0,a.jsx)(i.default,{checkmark:!0,onModalHide:c,isVisible:s,children:(0,a.jsxs)(e.View,{testID:"timeout-modal-visible-"+s,children:[(0,a.jsx)(n.default,{style:r.styles.title,testID:"timeout-modal-title",children:d("recommendation_modal_auto_saved_title")}),(0,a.jsx)(n.default,{style:r.styles.message,testID:"timeout-modal-message",children:d("recommendation_modal_auto_saved_body")}),(0,a.jsxs)(e.View,{style:r.styles.buttonContainer,children:[!h&&(0,a.jsx)(e.TouchableOpacity,{style:r.styles.saveButton,onPress:l,testID:"timeout-modal-view-button",children:(0,a.jsx)(n.default,{style:r.styles.saveText,children:d("recommendation_modal_auto_saved_button_confirm")})}),(0,a.jsx)(e.TouchableOpacity,{style:r.styles.cancelButton,onPress:u,testID:"timeout-modal-close-button",children:(0,a.jsx)(n.default,{style:r.styles.closeText,children:d("button_close")})})]})]})})},O9}()),v=I(M9()),b=o4(),S=u4(),k=t4(),C=f5(),E=l();function I(e){return e&&e.__esModule?e:{default:e}}let x=B3.SyncStatus=function(e){return e.Idle="Idle",e.Success="Success",e.Loading="Loading",e.Failure="Failure",e}({});const T=l=>{const w=(0,n.useSafeAreaInsets)(),{changeLanguage:k}=(0,S.useLanguage)();"android"===t.Platform.OS&&t.UIManager.setLayoutAnimationEnabledExperimental?.(!0);const{height:I}=(0,t.useWindowDimensions)(),T=(0,e.useMemo)(()=>I-w.bottom-w.top,[I,w.bottom,w.top]),R=(0,e.useRef)(null),{deleteStatus:A,editStatus:L,saveStatus:P,calculatorParams:M,bloodGlucoseUnit:D,injectionMethod:N,transferEditedRecommendation:F,closeCalculationFooter:B,closeCalculationTimeoutModal:j,deleteCalculation:V,closeCalculationViewInlogbook:H,trackRecommendationTimeout:z,trackExpandDetails:U}=l,{glucoseReading:G,carbohydrates:W,activity:Y}=M,$=(0,e.useRef)((0,i.calculateRecommendation)(M)).current,[X,q]=(0,e.useState)(null),[Z,K]=(0,e.useState)(null),[Q,J]=(0,e.useState)(null),[ee,te]=(0,e.useState)(null),[ne,ie]=(0,e.useState)(0),[re,ae]=(0,e.useState)(0),[oe,se]=(0,e.useState)(0),[le,ue]=(0,e.useState)(!0),[ce,de]=(0,e.useState)(!1),[he,me]=(0,e.useState)(!1),[pe,fe]=(0,e.useState)(!0),[_e,ge]=(0,e.useState)(!1),[ye,ve]=(0,e.useState)(!1),[be,Se]=(0,e.useState)(!1),[we,ke]=(0,e.useState)(!1),[Ce,Ee]=(0,e.useState)(!1),[Ie,xe]=(0,e.useState)(!1),[Te,Oe]=(0,e.useState)(!1),[Re,Ae]=(0,e.useState)(!1),[Le,Pe]=(0,e.useState)(!1);(0,e.useEffect)(()=>{A===x.Failure&&Ae(!0)},[A]),(0,e.useEffect)(()=>{P===x.Failure&&Oe(!0)},[P]),(0,e.useEffect)(()=>{L===x.Success&&(q(Z),J(ee))},[A,L,ee,Z,P]),(0,e.useEffect)(()=>{C.recommendationPropsSchema.parse(l),k(l.language)},[k,l]),(0,e.useEffect)(()=>{$.wasLimited&&xe(!0)},[$.wasLimited]),(0,e.useEffect)(()=>{const e=$.recommendationDate.getTime(),t=setInterval(()=>{!((new Date).getTime()-e>b.TIMEOUT_MODAL_TRIGGER)||Ce||be||(Se(!0),Ee(!0),z())},1*r.Milliseconds.Second);return()=>clearInterval(t)},[be,Ce,$,z]);const Me=(0,e.useCallback)(e=>{const t=$.recommendationDate.getTime(),n=(new Date).getTime()-t>b.TIMEOUT_MODAL_TRIGGER;"active"===e&&n&&(Ee(!0),z())},[$,z]),De=(0,e.useCallback)(()=>(ke(!0),!0),[]);(0,e.useEffect)(()=>{const e=t.AppState.addEventListener("change",Me);let n=null;return"android"===t.Platform.OS&&(n=t.BackHandler.addEventListener("hardwareBackPress",De)),()=>{e.remove(),n?.remove()}},[Me,De]);const Ne=(0,e.useMemo)(()=>{if(Y)return{activityDuration:Y.activityDuration,activityIntensity:Y.activityIntensity,activityReduction:$.activityReduction}},[Y,$.activityReduction]),Fe=(0,e.useCallback)(e=>{t.LayoutAnimation.configureNext(t.LayoutAnimation.Presets.easeInEaseOut);const n=(0,i.roundInsulinValue)($.bolus,N),r=Math.round($.carbRecommendation),a=e!==n?e:null;e!==n?K(e):(q(null),K(null)),F({modified:Q,suggested:r},{modified:a,suggested:n},$.recommendationDate)},[$,N,Q,F]),Be=(0,e.useCallback)(e=>{t.LayoutAnimation.configureNext(t.LayoutAnimation.Presets.easeInEaseOut);const n=(0,i.roundInsulinValue)($.bolus,N),r=Math.round($.carbRecommendation),a=e!==r?e:null;e!==r?te(e):(J(null),te(null)),F({modified:a,suggested:r},{modified:X,suggested:n},$.recommendationDate)},[$,N,X,F]),je=(0,e.useCallback)(()=>{_e&&V()},[V,_e]),Ve=(0,e.useCallback)(()=>{ye?H():j()},[ye,j,H]),He=(0,e.useCallback)(()=>{ve(!0),Ee(!1)},[]),ze=(0,e.useCallback)(()=>{ge(!0),ke(!1)},[]),Ue=(0,e.useCallback)(()=>{L===x.Failure&&Pe(!0)},[L]),Ge=(0,e.useCallback)(()=>{Pe(!1)},[]),We=(0,e.useCallback)((e,t)=>{se(t)},[]),Ye=(0,e.useCallback)(()=>{R?.current?.scrollToEnd(),me(!0),setTimeout(()=>fe(!1),1)},[]),$e=(0,e.useCallback)(e=>{const{layoutMeasurement:{height:t},contentOffset:{y:n}}=e.nativeEvent,i=Math.round(t+n),r=i>=oe-ne,a=i>=Math.round(oe);de(r),le&&ue(!1),a&&me(!0),a&&setTimeout(()=>fe(!1),1)},[ne,oe,le]),Xe=(0,e.useMemo)(()=>Math.round(re+ne),[re,ne]);return be?(0,E.jsx)(t.View,{style:O.timeoutContainer,children:(0,E.jsx)(t.View,{style:O.timeoutContainerBackground,children:(0,E.jsx)(y.default,{isVisible:Ce,onPressViewInLogbook:He,onPressCancel:()=>Ee(!1),onDismiss:Ve})})}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(t.ScrollView,{ref:R,scrollEventThrottle:16,style:O.scrollView,contentContainerStyle:he&&{paddingBottom:32},testID:"recommendation-screen",onScroll:$e,onContentSizeChange:We,children:[(0,E.jsxs)(t.View,{testID:"recommendation-content",onLayout:({nativeEvent:e})=>ae(e.layout.height),style:O.contentRecommendationContainer,children:[(0,E.jsxs)(t.View,{style:O.recommendationContainer,children:[(0,E.jsx)(d.default,{isEdited:null!==X}),(0,E.jsx)(h.default,{initialValue:(0,i.roundInsulinValue)($.bolus,N),editedValue:X,injectionMethod:N,wasLimited:$.wasLimited,onDismiss:Ue,onConfirm:Fe}),(0,E.jsx)(s.default,{}),(0,E.jsx)(u.default,{glucoseReading:G,bloodGlucoseUnit:D,trackExpandDetails:U,carbIntakeValue:Math.round(W),activeInsulin:Math.round(10*$.activeInsulin)/10,activity:Ne})]}),(0,E.jsxs)(t.View,{style:O.extraRecommendationContainer,children:[Math.round($.carbRecommendation)>0&&(0,E.jsx)(o.default,{carbsRecommendation:Math.round($.carbRecommendation),editedCarbsRecommendation:Q,onDismiss:Ue,onConfirm:Be}),(0,E.jsx)(a.default,{glucoseReading:G,hasActivity:null!==Y,bloodGlucoseUnit:D})]})]}),Xe>T&&pe&&(0,E.jsx)(c.default,{prefixTestID:"scroll",onSave:Ye,onDelete:Ye,onLayout:({nativeEvent:e})=>ie(e.layout.height)})]}),(0,E.jsx)(v.default,{scrollToEnd:Ye,isVisibleArrow:Xe>T&&le,isVisibleBlur:Xe>T&&!ce&&!he}),(Xe<=T||he)&&(0,E.jsx)(c.default,{prefixTestID:"fixed",onSave:B,onDelete:()=>ke(!0),onLayout:({nativeEvent:e})=>ie(e.layout.height)}),(0,E.jsx)(_.default,{isVisible:Ie,activityReduction:$.activityReduction,onPress:()=>xe(!1)}),(0,E.jsx)(p.default,{isVisible:we,onPressDelete:ze,onDismiss:je,onPressCancel:()=>ke(!1)}),(0,E.jsx)(m.default,{isVisible:Re,onPressClose:()=>Ae(!1)}),(0,E.jsx)(g.default,{isVisible:Te,onPressClose:()=>Oe(!1)}),(0,E.jsx)(f.default,{isVisible:Le,onPressClose:Ge})]})};B3.RecommendationScreen=T;B3.default=e=>(0,E.jsx)(S.LanguageProvider,{children:(0,E.jsx)(T,{...e})});const O=t.StyleSheet.create({timeoutContainer:{...t.StyleSheet.absoluteFillObject,backgroundColor:k.COLORS.bgPrimary},timeoutContainerBackground:{flex:1,opacity:.5},contentRecommendationContainer:{gap:32,paddingVertical:32},extraRecommendationContainer:{paddingHorizontal:16},scrollView:{backgroundColor:k.COLORS.bgPrimary,flex:1},recommendationContainer:{borderRadius:16,backgroundColor:k.COLORS.bgSecondary,marginHorizontal:16}});return B3}var g5=(l5||(l5=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"RecommendationScreenWrapper",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"SyncStatus",{enumerable:!0,get:function(){return t.SyncStatus}}),Object.defineProperty(e,"recommendationPropsSchema",{enumerable:!0,get:function(){return n.recommendationPropsSchema}});var t=function(e,t){if("function"==typeof WeakMap)var n=new WeakMap,i=new WeakMap;return function(e,t){if(!t&&e&&e.__esModule)return e;var r,a,o={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return o;if(r=t?i:n){if(r.has(e))return r.get(e);r.set(e,o)}for(const n in e)"default"!==n&&{}.hasOwnProperty.call(e,n)&&((a=(r=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,n))&&(a.get||a.set)?r(o,n,a):o[n]=e[n]);return o}(e,t)}(_5()),n=f5()}(F3)),F3);const y5=()=>F2(e=>e.selectedReadingId&&e.availableGlucoseReadings.find(t=>t.id===e.selectedReadingId)||null);function v5(e,t){const n=o$(e,"HH:mm"),i=function(e){const t=[];for(const n of e)t.push(aX(n.startTime,"HH:mm",new Date));return t}(t),r=aX(n,"HH:mm",new Date);for(let a=0;a<i.length;a++)if(b5(i[a],i[(a+1)%i.length],r))return t[a];throw new Error("[ParameterTimeIntervalsUtils::getDailyParameters] The parameter interval has not been found")}function b5(e,t,n){const i=c$(e,t),r=(a=n,+tY(e)===+tY(a)||c$(e,n));var a;const o=S5(e),s=S5(t,!i),l=S5(n,!r);return o<=l&&l<s}function S5(e,t){return e.getMinutes()+60*(e.getHours()+(t?24:0))}const w5=Ei.create({animationContainer:{flex:1,justifyContent:"center",alignItems:"center"},text:{...oj.bold_Base,marginTop:32},animation:{width:128,height:128}}),k5=iF(function({setRemeasurementNotification:e}){const{t:t,language:n}=iV(),i=y5(),{selectedEventUUID:r}=C2(),{carbohydrateStoreActions:a,manualCarbsInput:o,totalCarbsCartItems:s}=TX(),l=Wp(),u=M.useRef(!1),[c,d]=D.useState(!1),[h,m]=D.useState(null),[p,f]=D.useState(null),{glucoseUnit:_,injectionMethod:g,activity:y}=Uq;if(void 0===_)throw new Error("[LoadingRecommendationScreen::render] glucoseUnit is undefined");if(void 0===g)throw new Error("[LoadingRecommendationScreen::render] injectionMethod is undefined");if(void 0===y)throw new Error("[LoadingRecommendationScreen::render] activity is undefined");if(null===i)throw new Error("[LoadingRecommendationScreen::render] selectedGlucoseReading is undefined");const v=M.useMemo(()=>r?Dq.getByUUID(r):null,[r]),b=M.useMemo(()=>null!==v&&v.startTimestamp?{activitySettings:y,activityDate:new Date(v.startTimestamp),activityDuration:v.durationSeconds/60,activityIntensity:v.activityIntensity}:null,[y,v]),S=M.useMemo(()=>{const{target:e}=function(e){const{glucoseLevelTargets:t}=Uq;if(void 0===t)throw new Error("[ParameterTimeIntervalsUtils::getBGLParameters] glucoseLevelTargets is undefined.");const n=t.use===NL.Usage.Overall,{overallTargetBGL:i,targetBGLIntervals:r}=t;if(n){if(void 0===i)throw new Error("[ParameterTimeIntervalsUtils::getBGLParameters] overallTargetBGL cannot be undefined");return i}if(void 0===r)throw new Error("[ParameterTimeIntervalsUtils::getBGLParameters] targetBGLIntervals cannot be undefined");return v5(e,r)}(new Date),{carbohydrateRatio:t,insulinSensitivity:r}=function(e){const t=Uq.treatmentParameters?.use===NL.Usage.Overall,{treatmentParameters:n}=Uq;if(void 0===n)throw new Error("[ParameterTimeIntervalsUtils::getInsulinParameters] treatmentParameters is undefined.");return t?n.overallParameters:v5(e,n.parameterIntervals)}(new Date),a=_Z.getRecentBoluses();return{bloodGlucoseUnit:_,injectionMethod:g,language:n,calculatorParams:{glucoseReading:i,activity:b,carbohydrateRatio:t,insulinSensitivity:r,carbohydrates:o+s,targetBGL:e,recentBoluses:a}}},[_,g,i,b,o,s,n]),w=M.useCallback(async()=>{const t=g5.recommendationPropsSchema.safeParse(S);if(!t.success)return jX(FX.RecommendationInvalid),console.error(t.error),void f(rV.Validation);const{activeInsulin:n,carbRecommendation:r,bolus:l,activityReduction:u,recentBolusesIds:c,recommendationDate:d}=Rq.calculateRecommendation(S.calculatorParams),h=o+s,p=iZ(S.calculatorParams.glucoseReading.value,S.calculatorParams.glucoseReading.unit,NL.BloodGlucoseUnit.MMOL_L),_=Rq.roundInsulinValue(l,S.injectionMethod),g=Math.round(r),y="external"===i.source||"forecast"===i.source,b=await _Z.addLogbook(lZ({blood_glucose_millimolar:p,blood_glucose_millimolar_sample_id:y?i.sampleId:null,glucose_sample_source_id:y?i.sourceId:null,entry_timestamp:d,event_uuid:v?v.uuid:null,is_bolus_calculation:!0,carbohydrates_suggested_grams:g,carbohydrates_entered_grams:h+g,carbohydrates_input_grams:h,insulin_entered_units:_,insulin_suggested_units:_,active_insulin:n,activity_reduction:u,active_insulin_source_logbook_ids:c}));null!==b?(null!==b.blood_glucose_millimolar&&void 0!==e&&await e(b.blood_glucose_millimolar),a.checkoutCart().catch(console.error),m(b),jX(FX.RecommendationSuccess)):f(rV.Sync)},[S,a,v,i,o,e,s]);return u.current||(u.current=!0,w().catch(console.error)),M.useEffect(()=>{setTimeout(()=>{d(!0)},1600)},[]),M.useEffect(()=>{l.setOptions({gestureEnabled:!1});return l.addListener("beforeRemove",({preventDefault:e})=>{c||e()})},[c,l]),M.useEffect(()=>{c&&null!==h&&null===p&&l.replace(S2.Recommendation,{...S,logbookEntry:h}),c&&null!==p&&l.navigate({name:S2.SummaryTab,params:{errorType:p}})},[p,c,h,S,l]),D.createElement(_a,{style:w5.animationContainer},D.createElement(QV,{autoPlay:!0,source:JV.LOADING_RECOMMENDATION,style:w5.animation,webStyle:w5.animation,resizeMode:"cover",loop:!0}),D.createElement(gj,{style:w5.text},t("recommendation_loading_title")))});const C5=uV?"/api/v2":Wj.HEDIA_API_URL_V2;function E5(){const{COLORS:e}=bL(),t=Wp(),n=df(),{manualCarbsInput:i,totalCarbsCartItems:r}=TX(),[a,o]=M.useState(g5.SyncStatus.Idle),[s,l]=M.useState(g5.SyncStatus.Idle),[u,c]=M.useState(g5.SyncStatus.Idle),{bloodGlucoseUnit:d,calculatorParams:h,injectionMethod:m,language:p,logbookEntry:f}=n.params,[_,g]=M.useState(f),y=M.useCallback(e=>{const t=e.data.state;uV&&t.routes[t.index].name===S2.CalculationBottomTabs&&(W2(),window.location.href="/redirect?status=success",Qj.clearAll())},[]);M.useEffect(()=>(t.addListener("state",y),()=>{t.removeListener("state",y)}),[t,y]),M.useEffect(()=>{t.setOptions({gestureEnabled:!1})},[t]);const v=M.useCallback(async(e,t)=>{c(g5.SyncStatus.Loading);const n=i+r,a=lZ({..._,insulin_entered_units:t.modified??t.suggested,carbohydrates_overwritten_suggested_grams:e.modified,carbohydrates_entered_grams:n+(e.modified??e.suggested)}),o=await _Z.addLogbook(a,_.uuid);o?(g(o),c(g5.SyncStatus.Success)):c(g5.SyncStatus.Failure)},[i,_,r]),b=M.useCallback(()=>{if(uV)throw new Error("Recommendation::handleOnCloseCalculationViewInLogbook] Cannot view-in-logbook on web");const{Logbooks:e,LogbooksTab:n}=S2;t.navigate(n,{screen:e,params:{logbookEntry:_}}),W2()},[t,_]),S=M.useCallback(()=>{uV?(window.location.href="/redirect?status=success",Qj.clearAll()):t.dispatch(wm(S2.DashboardTab,{screen:S2.Dashboard})),W2()},[t]),w=M.useCallback(async()=>{o(g5.SyncStatus.Loading);const e=await _Z.deleteLogbook(_.uuid);if(uV)e?(window.location.href="/redirect?status=success",W2(),Qj.clearAll()):o(g5.SyncStatus.Failure);else{W2();const{Dashboard:e,DashboardTab:n}=S2;t.navigate(n,{screen:e,params:{action:aV.Deleted}})}},[_.uuid,t]),k=M.useCallback(async()=>{l(g5.SyncStatus.Loading);const e=()=>{l(g5.SyncStatus.Success),W2(),t.replace(S2.LeavingRecommendation,{logbookEntry:_})};if(uV){await(async()=>{let e;const t=new Promise((t,n)=>{e=setTimeout(()=>{n(new Error("Timeout exceeded"))},3e3)});try{return await Promise.race([fetch(`${C5}/basic/status`),t]),!0}catch(n){return console.error("API connection error:",n),!1}finally{clearTimeout(e)}})()?e():l(g5.SyncStatus.Failure)}else e()},[t,_]);return D.createElement(SH,{style:[I5.container,{backgroundColor:e.bgPrimary}]},D.createElement(g5.RecommendationScreenWrapper,{deleteStatus:a,saveStatus:s,editStatus:u,bloodGlucoseUnit:d,injectionMethod:m,language:p,calculatorParams:h,closeCalculationViewInlogbook:b,closeCalculationFooter:k,closeCalculationTimeoutModal:S,transferEditedRecommendation:v,deleteCalculation:w,trackExpandDetails:()=>{jX(FX.RecommendationViewDetailsPress)},trackRecommendationTimeout:()=>{jX(FX.RecommendationExpired)}}))}const I5=Ei.create({container:{flex:1}});function x5(){return D.useEffect(()=>{console.warn(`DateTimePicker is not supported on: ${lr.OS}`)},[]),null}const T5=(e,t)=>{const n=e.indexOf(t);return-1===n?0:n},O5=(e,t)=>{const n=new Date(e);return n.setHours(t,0,0,0),{date:n,formatted:o$(n,"HH:mm")}},R5=Array.from({length:60},(e,t)=>t.toString().padStart(2,"0"));const A5=D.memo(function({isVisible:e,initialValue:t,min:n,max:i,onCancel:r,onConfirm:a,onModalHide:o}){const{COLORS:s}=bL(),{width:l}=vm(),u=M.useRef(null),c=M.useRef(null),[d,h]=M.useState(t),m=M.useMemo(()=>{if(!n||!i){const e=new Date;return Array.from({length:24},(t,n)=>O5(e,n))}const e=n.getHours(),t=i.getHours(),r=[];if(o=i,(a=n).getFullYear()===o.getFullYear()&&a.getMonth()===o.getMonth()&&a.getDate()===o.getDate()&&n<i&&e<=t)for(let i=e;i<=t;i++)r.push(O5(n,i));else{for(let t=e;t<24;t++)r.push(O5(n,t));for(let e=0;e<=t;e++)r.push(O5(i,e))}var a,o;return r},[n,i]),p=M.useMemo(()=>m.map(e=>o$(e.date,"HH")),[m]),f=M.useMemo(()=>{const[e]=o$(t,"HH:mm").split(":");return T5(p,e)},[t,p]),_=M.useMemo(()=>{const[,e]=o$(t,"HH:mm").split(":");return T5(R5,e)},[t]),g=M.useMemo(()=>{const[e]=o$(d,"HH:mm").split(":");return T5(p,e)},[d,p]),y=M.useMemo(()=>{const[,e]=o$(d,"HH:mm").split(":");return T5(R5,e)},[d]),v=M.useMemo(()=>n?T5(p,o$(n,"HH")):null,[n,p]),b=M.useMemo(()=>i?T5(p,o$(i,"HH")):null,[i,p]),S=M.useMemo(()=>n?parseInt(o$(n,"mm"),10):null,[n]),w=M.useMemo(()=>i?parseInt(o$(i,"mm"),10):null,[i]),k=M.useCallback((e,t)=>{const n=e<0||e>=p.length,i=t<0||t>=R5.length;if(n||i)return;const r=dX(m[e].date,{minutes:parseInt(R5[t],10),seconds:0,milliseconds:0});h(r)},[p.length,m]),C=M.useCallback(e=>{c.current?.scrollToIndex(e)},[]),E=M.useCallback(e=>{if(null===b||null===v||(null===w||null===S))return void k(e,y);let t=y;return e===v&&y<S?(t=S,C(S),void k(e,t)):e===b&&y>w?(t=w,C(w),void k(e,t)):void k(e,y)},[b,v,w,S,y,k,C]),I=M.useCallback(e=>{if(null===b||null===v||(null===w||null===S))return void k(g,e);let t=e;return g===v&&e<S?(t=S,C(S),void k(g,t)):g===b&&e>w?(t=w,C(w),void k(g,t)):void k(g,t)},[b,w,v,S,g,k,C]),x=M.useCallback(()=>{a(d)},[a,d]),T=M.useCallback(()=>{h(t),r()},[r,t]);return D.createElement(lz,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o},D.createElement(_a,null,D.createElement(_a,{style:L5.pickersContainer},D.createElement(t3,{key:"hours-wheel-picker",ref:u,initialScrollIndex:f,options:p,onChange:E,containerStyle:[L5.itemContainerLeft,{width:(l-32)/2}],selectedIndicatorStyle:[L5.selectedIndicatorLeft,{width:(l-32)/2-10}],itemStyle:L5.itemLeft,testID:"hours-wheel-picker"}),D.createElement(t3,{key:"minutes-wheel-picker",ref:c,initialScrollIndex:_,options:R5,onChange:I,containerStyle:[L5.itemContainerRight,{width:(l-32)/2}],selectedIndicatorStyle:[L5.selectedIndicatorRight,{width:(l-32)/2-10}],itemStyle:L5.itemRight,testID:"minutes-wheel-picker"})),D.createElement(_a,{style:L5.buttonContainer},D.createElement($0,{onPress:x}),D.createElement(W0,{onPress:T}))))}),L5=Ei.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:"row",borderTopLeftRadius:13,borderTopRightRadius:13,overflow:"hidden"},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:16},itemContainerRight:{borderTopLeftRadius:0,paddingRight:16},itemLeft:{alignSelf:"flex-end",marginRight:16},itemRight:{alignSelf:"flex-start",marginLeft:16},selectedIndicatorRight:{alignSelf:"flex-start",borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorLeft:{alignSelf:"flex-end",borderTopRightRadius:0,borderBottomRightRadius:0}}),P5=e=>{switch(e){case NL.InjectionMethod.PenWhole:return PX(NL.CONSTANTS.INSULIN_DOSE_MIN,NL.CONSTANTS.INSULIN_DOSE_MAX);case NL.InjectionMethod.PenHalf:return((e,t,n=.1)=>Array.from({length:Math.round((t-e)/n)+1},(t,i)=>(e+i*n).toFixed(1)))(NL.CONSTANTS.INSULIN_DOSE_MIN,NL.CONSTANTS.INSULIN_DOSE_MAX,.5);case NL.InjectionMethod.Pump:return MX(NL.CONSTANTS.INSULIN_DOSE_MIN,NL.CONSTANTS.INSULIN_DOSE_MAX);default:throw new Error("[insulin::getInsulinInputSequentialArray] Unsupported injection method!")}},M5=()=>{const{t:e}=iV(),{showDiscardCalculationModal:t,modalStoreActions:n,isGoToSettingsPressed:i}=j2(),r=Wp(),[a,o]=M.useState(!1),s=M.useCallback(()=>{W2(),o(!0),n.set({showDiscardCalculationModal:!1})},[n]),l=M.useCallback(()=>{a&&r.pop(),i&&(uV?r.reset({index:1,routes:[{name:S2.NewCalculationStack},{name:S2.SettingsTab,state:{routes:[{name:S2.Settings},{name:S2.ActivitySettings}],index:1}}]}):r.reset({index:0,routes:[{name:S2.SettingsTab,state:{routes:[{name:S2.Settings},{name:S2.ActivitySettings}],index:1}}]}),n.set({isGoToSettingsPressed:!1}))},[a,i,n,r]),u=M.useMemo(()=>[{testID:"discard-button",title:e("new_cal_modal_discard_cal_danger_button"),type:dj.Error,onPress:s},{testID:"cancel-button",title:e("button_cancel"),type:dj.Secondary,onPress:()=>{n.set({showDiscardCalculationModal:!1,isGoToSettingsPressed:!1})}}],[s,n,e]);return D.createElement(lz,{key:"discard_calculation_modal",testID:"discard_calculation_modal",isVisible:t,title:e("new_cal_modal_discard_cal_title"),message:e("new_cal_modal_discard_cal_body"),onModalHide:l,buttons:u})};const D5=Ei.create({rightSlot:{flexDirection:"row",alignItems:"center"},insulinValueText:{...oj.medium_Base},separator:{width:1,alignSelf:"stretch",marginHorizontal:12}}),N5=D.memo(function({time:e,insulinValue:t,onEdit:n,testID:i}){const{t:r}=iV(),{COLORS:a}=bL();return D.createElement(kj,{title:o$(e,"HH:mm"),onPress:n,testID:i,renderRightSlot:()=>D.createElement(_a,{style:D5.rightSlot},D.createElement(gj,{style:D5.insulinValueText},`${t} ${1!==parseFloat(t)?r("units"):r("unit")}`),D.createElement(_a,{style:[D5.separator,{backgroundColor:a.divider}]}),D.createElement(i2,null))})});var F5=(e=>(e.Create="Create",e.Edit="Edit",e.Delete="Delete",e))(F5||{});function B5({renderRegisterInsulinButtons:e}){const{t:t}=iV(),{COLORS:n}=bL(),{navigate:i,setOptions:r,replace:a,pop:o}=Wp(),s=df(),{height:l}=vm(),u=M.useMemo(()=>l<667,[l]),[c,d]=M.useState([]),[h,m]=M.useState(null),[p,f]=M.useState(!1),_=M.useCallback(()=>{jX(FX.AbortCalculationPress),o()},[o]);M.useEffect(()=>{if(!uV){r({headerLeft:()=>D.createElement(X2,{onPress:_})})}},[_,r]),Yp(M.useCallback(()=>{const e=dX(pX(new Date),{seconds:0,milliseconds:0}),t=_Z.getLogbooks(e).map(e=>({uuid:e.uuid,time:e.entry_timestamp.toString(),insulinValue:e.insulin_entered_units?.toString()??""}));d(t)},[])),M.useEffect(()=>{if(!s.params)return;const{insulinEntryId:e}=s.params;m(e)},[s.params]);const g=M.useCallback(e=>{i(S2.RegisterActiveInsulin,{action:"Edit",insulinEntry:c.find(t=>t.uuid===e)})},[i,c]),y=M.useCallback(()=>{jX(FX.RecentInsulinContinuePress),a(S2.CalculationBottomTabs,{screen:S2.GlucoseTab})},[a]),v=M.useCallback(()=>{m(null)},[]),b=M.useMemo(()=>[{title:t("button_close"),onPress:()=>{f(!1)}}],[t]);return D.createElement(D.Fragment,null,D.createElement(Wo,{testID:"active_insulin_list",data:c,contentContainerStyle:V5.containerList,renderItem:({item:e,index:t})=>D.createElement(ij,{key:e.uuid,isAnimated:h===e.uuid,onAnimationFinished:v},D.createElement(N5,{time:e.time,testID:`entry-${t}`,insulinValue:e.insulinValue,onEdit:()=>{g(e.uuid)}})),ItemSeparatorComponent:j5,ListEmptyComponent:D.createElement(_a,{style:V5.emptyComponentList},D.createElement(d2,null),D.createElement(gj,{style:[V5.noInsulinText,{color:n.labelTertiary}]},t("Recent_insulin_empty_state_title"))),ListFooterComponent:()=>e(0===c.length),ListFooterComponentStyle:u?V5.smallScreenFooterList:V5.footerList,ListHeaderComponent:D.createElement(D.Fragment,null,c.length>0?D.createElement(gj,{style:V5.title},t("Recent_insulin_title",{timeFourHour:o$(pX(new Date),"HH:mm")})):D.createElement(gj,{style:V5.title},t("Recent_insulin_empty_title")),D.createElement(eh,{style:V5.infoTextContainer,onPress:()=>{f(!0)}},D.createElement(gj,{style:[V5.infoText,{color:n.textLink}]},t("Recent_insulin_link_modal")))),ListHeaderComponentStyle:u?V5.smallScreenHeaderList:V5.headerList}),D.createElement(SH,{style:[V5.footer,{backgroundColor:n.bgNavigationBar}],edges:["bottom"]},D.createElement(mj,{title:t("Recent_insulin_button_continue"),onPress:y,type:c.length>0?dj.Primary:dj.Secondary,style:V5.confirmButton})),D.createElement(lz,{key:"recent_insulin_info",isVisible:p,title:t("Recent_insulin_modal_title"),message:t("Recent_insulin_modal_body"),buttons:b}),D.createElement(M5,null))}const j5=()=>D.createElement(_a,{style:V5.separatorList}),V5=Ei.create({containerList:{paddingHorizontal:16},headerList:{paddingTop:32,paddingBottom:64,paddingHorizontal:16},smallScreenHeaderList:{paddingVertical:32},footerList:{paddingVertical:64},smallScreenFooterList:{paddingVertical:32},title:{...oj.semiBold_2XL,marginBottom:12},infoTextContainer:{flexDirection:"row",alignItems:"center"},infoText:{...oj.semiBold_SM,marginRight:4},emptyComponentList:{justifyContent:"space-between",alignItems:"center",gap:8,paddingHorizontal:64},separatorList:{height:8},noInsulinText:{...oj.medium_Base,textAlign:"center"},footer:{paddingHorizontal:16,paddingBottom:16},confirmButton:{marginTop:16}});const H5=iF(function(){const{t:e}=iV(),{COLORS:t}=bL(),n=Wp(),i=df(),{bottom:r}=pH(),[a,o]=M.useState(!1),[s,l]=M.useState(i.params.insulinEntry?.insulinValue),[u,c]=M.useState(!1),[d,h]=M.useState(i.params.insulinEntry?new Date(i.params.insulinEntry.time):void 0),[m,p]=M.useState(),[f,_]=M.useState(!1),[g,y]=M.useState(!1),[v,b]=M.useState(!1),{initialInsulinValue:S,initialDate:w}=M.useMemo(()=>({initialInsulinValue:i.params.insulinEntry?.insulinValue,initialDate:i.params.insulinEntry?new Date(i.params.insulinEntry.time):void 0}),[i.params.insulinEntry]),k=Uq.injectionMethod;if(void 0===k)throw new Error("[RegisterActiveInsulin::render] injectionMethod is undefined");const C=M.useMemo(()=>P5(k),[k]),E=M.useCallback(async()=>{if(!s||!d)throw new Error("[RegisterActiveInsulin::handleDonePressed] insulinValue or date is undefined");if(i.params.action===F5.Create){const e=lZ({entry_timestamp:d,insulin_entered_units:parseFloat(s)});return await _Z.addLogbook(e)?void n.navigate({name:S2.ActiveInsulin,params:{insulinEntryId:e.uuid},merge:!0}):void _(!0)}if(!i.params.insulinEntry)throw new Error("[RegisterActiveInsulin::handleDonePressed] insulinEntry is undefined");const e={..._Z.getLogbookByUUID(i.params.insulinEntry.uuid),entry_timestamp:d,insulin_entered_units:parseFloat(s)};await _Z.addLogbook(e,i.params.insulinEntry.uuid)?n.navigate({name:S2.ActiveInsulin,params:{insulinEntryId:e.uuid},merge:!0}):_(!0)},[d,s,n,i.params.action,i.params.insulinEntry]);M.useEffect(()=>{n.setOptions({headerRight:()=>D.createElement(Z2,{title:i.params.action===F5.Edit?e("button_done"):e("button_save"),onPress:E,disabled:!d||!s||!!m||w===d&&S===s})})},[n,E,s,d,i.params.action,e,w,S,m]);const I=M.useCallback(()=>{y(!0),b(!1)},[]),x=M.useCallback(()=>{setTimeout(async()=>{if(g&&i.params.insulinEntry){await _Z.deleteLogbook(i.params.insulinEntry.uuid)?n.goBack():_(!0)}},0)},[g,n,i.params.insulinEntry]),T=M.useCallback(()=>{c(!0)},[]),O=M.useCallback(()=>{o(!0)},[]),R=M.useCallback(t=>{const n=new Date,i=function(e,t,n){const i=+tY(e,n?.in),[r,a]=[+tY(t.start,n?.in),+tY(t.end,n?.in)].sort((e,t)=>e-t);return i>=r&&i<=a}(t,{start:dX(pX(n),{seconds:0,milliseconds:0}),end:n}),r=i?void 0:e("error_insulin_intake_hint");h(t),p(r),c(!1)},[e]),A=M.useCallback(()=>{c(!1)},[]),L=M.useCallback(e=>{l(e.toString()),o(!1)},[]),P=M.useMemo(()=>{if(!s)return 0;const e=(e=>{switch(e){case NL.InjectionMethod.PenWhole:return 0;case NL.InjectionMethod.PenHalf:case NL.InjectionMethod.Pump:return 1;default:throw new Error("[insulin::getInsulinInputDecimalPlaces] Unsupported injection method!")}})(k);return C.findIndex(t=>t===parseFloat(s).toFixed(e))},[s,C,k]);return D.createElement(D.Fragment,null,D.createElement(Xa,{contentContainerStyle:[z5.contentContainer,{backgroundColor:t.bgSheet}]},D.createElement(_a,{style:z5.screen},D.createElement(gj,{style:z5.screenTitle},e("register_insulin_title",{timeFourHour:o$(pX(new Date),"HH:mm")})),D.createElement(kj,{title:e("register_insulin_input_title"),testID:"insulin-input",onPress:O,renderRightSlot:()=>D.createElement(_a,{style:z5.insulinRightSlot},D.createElement(gj,{style:[z5.insulinText,{color:t.labelPrimary}]},s),D.createElement(gj,{style:[z5.unitsText,{color:t.labelPrimary}]},e("units"))),style:a?{borderColor:t.borderInputFocus}:void 0}),D.createElement(ZB,{isAnimated:!!m},D.createElement(kj,{renderLeftSlot:()=>D.createElement(gj,null,e("register_insulin_time_input_title")),testID:"time-input",errorMessage:m,onPress:T,renderRightSlot:()=>D.createElement(_a,{style:[z5.setTimeButton,{backgroundColor:t.bgTertiary}]},D.createElement(gj,{style:[z5.setTimeText,{color:t.labelPrimary},u&&{color:t.textLink},!!m&&{color:t.textInputDanger}]},d?o$(d,"HH:mm"):e("register_insulin_time_button_unit"))),style:u?{flexWrap:"wrap",paddingVertical:8,borderColor:t.borderInputFocus}:z5.rowInsulin}))),i.params.action===F5.Edit&&D.createElement(mj,{title:e("button_delete"),onPress:()=>{b(!0)},type:dj.ErrorSecondary})),D.createElement(n3,{isVisible:a,items:C,onConfirm:L,onCancel:()=>{o(!1)},initialScrollIndex:P,testID:"insulin-wheel-picker"}),dV?D.createElement(x5,{testID:"date-time-picker",isVisible:u,display:"spinner",date:d??new Date,mode:(new Date).getHours()>=4?"time":"datetime",onConfirm:R,onCancel:A,cancelTextIOS:e("button_cancel"),confirmTextIOS:e("button_confirm"),pickerStyleIOS:z5.alignCenter,modalStyleIOS:{paddingBottom:r},minimumDate:mX(new Date,{hours:4}),maximumDate:new Date}):D.createElement(A5,{isVisible:u,initialValue:d??new Date,min:mX(new Date,{hours:4}),max:new Date,onConfirm:R,onCancel:A}),D.createElement(lz,{isVisible:v,title:e("register_insulin_modal_title"),message:e("register_insulin_modal_body"),onModalHide:x,buttons:[{title:e("button_delete"),testID:"confirm_delete",type:dj.Error,onPress:I},{title:e("button_cancel"),type:dj.Secondary,onPress:()=>{b(!1)}}]}),D.createElement(lz,{isVisible:f,icon:c2,title:e("new_cal_modal_no_internet_title"),message:e("new_cal_modal_no_internet_body"),buttons:[{title:e("button_close"),onPress:()=>{_(!1)}}]}))}),z5=Ei.create({contentContainer:{flex:1,paddingHorizontal:16,paddingVertical:32,gap:24},screen:{gap:16},screenTitle:{textAlign:"center",marginBottom:8},rowInsulin:{flexWrap:"wrap",paddingVertical:8},insulinRightSlot:{flexDirection:"row",flex:1,alignItems:"center"},setTimeButton:{borderRadius:16,paddingHorizontal:12,paddingVertical:8},setTimeText:{...oj.medium_Base},insulinText:{...oj.medium_Base,marginRight:4},unitsText:{...oj.medium_Base},alignCenter:{alignSelf:"center"}});function U5(){const{t:e}=iV(),{COLORS:t}=bL(),n=Wp(),i=M.useCallback(()=>{jX(FX.RecentInsulinRegisterPress),n.navigate(S2.RegisterActiveInsulin,{action:F5.Create})},[n]);return d.jsx(B5,{renderRegisterInsulinButtons:n=>d.jsx(mj,{title:e("recent_insulin_button_add"),onPress:i,leftIcon:d.jsx(U1,{color:t.labelPrimary}),type:n?dj.Primary:dj.Secondary})})}const G5=M.createContext(void 0),W5=M.createContext(void 0);function Y5(){return Y5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Y5.apply(this,arguments)}function $5(e){let{children:t,style:n,visible:i=!0,size:r=18,...a}=e;const[o]=M.useState(()=>new uu.Value(i?1:0)),[s,l]=M.useState(i),u=Af();if(M.useEffect(()=>{if(s)return uu.timing(o,{toValue:i?1:0,duration:150,useNativeDriver:!0}).start(e=>{let{finished:t}=e;t&&!i&&l(!1)}),()=>o.stopAnimation()},[o,s,i]),!s){if(!i)return null;l(!0)}const{backgroundColor:c=u.colors.notification,...d}=Ei.flatten(n)||{},h=pQ(c).isLight()?"black":"white",m=r/2,p=Math.floor(3*r/4);return M.createElement(uu.Text,Y5({numberOfLines:1,style:[{transform:[{scale:o.interpolate({inputRange:[0,1],outputRange:[.5,1]})}],color:h,lineHeight:r-1,height:r,minWidth:r,opacity:o,backgroundColor:c,fontSize:p,borderRadius:m},X5.container,d]},a),t)}const X5=Ei.create({container:{alignSelf:"flex-end",textAlign:"center",paddingHorizontal:4,overflow:"hidden"}});function q5(e){let{route:t,horizontal:n,badge:i,badgeStyle:r,activeOpacity:a,inactiveOpacity:o,activeTintColor:s,inactiveTintColor:l,renderIcon:u,style:c}=e;return D.createElement(_a,{style:[n?Z5.iconHorizontal:Z5.iconVertical,c]},D.createElement(_a,{style:[Z5.icon,{opacity:a}]},u({focused:!0,size:25,color:s})),D.createElement(_a,{style:[Z5.icon,{opacity:o}]},u({focused:!1,size:25,color:l})),D.createElement($5,{visible:null!=i,style:[Z5.badge,n?Z5.badgeHorizontal:Z5.badgeVertical,r],size:75/4},i))}const Z5=Ei.create({icon:{position:"absolute",alignSelf:"center",alignItems:"center",justifyContent:"center",height:"100%",width:"100%",minWidth:25},iconVertical:{flex:1},iconHorizontal:{height:"100%",marginTop:3},badge:{position:"absolute",left:3},badgeVertical:{top:3},badgeHorizontal:{top:7}});function K5(){return K5=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},K5.apply(this,arguments)}function Q5(e){let{focused:t,route:n,descriptor:i,label:r,icon:a,badge:o,badgeStyle:s,to:l,button:u=e=>{let{children:t,style:n,onPress:i,to:r,accessibilityRole:a,...o}=e;return"web"===lr.OS&&r?D.createElement(ff,K5({},o,{to:r,style:[J5.button,n],onPress:e=>{e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||null!=e.button&&0!==e.button||(e.preventDefault(),null==i||i(e))}}),t):D.createElement(eh,K5({},o,{accessibilityRole:a,onPress:i,style:n}),t)},accessibilityLabel:c,testID:d,onPress:h,onLongPress:m,horizontal:p,activeTintColor:f,inactiveTintColor:_,activeBackgroundColor:g="transparent",inactiveBackgroundColor:y="transparent",showLabel:v=!0,allowFontScaling:b,labelStyle:S,iconStyle:w,style:k}=e;const{colors:C}=Af(),E=void 0===f?C.primary:f,I=void 0===_?pQ(C.text).mix(pQ(C.card),.5).hex():_,x={focused:t},T=t?g:y;return u({to:l,onPress:h,onLongPress:m,testID:d,accessibilityLabel:c,accessibilityRole:lr.select({ios:"button",default:"tab"}),accessibilityState:{selected:t},accessibilityStates:t?["selected"]:[],style:[J5.tab,{backgroundColor:T},p?J5.tabLandscape:J5.tabPortrait,k],children:D.createElement(D.Fragment,null,(e=>{let{focused:t}=e;if(void 0===a)return null;const i=t?1:0,r=t?0:1;return D.createElement(q5,{route:n,horizontal:p,badge:o,badgeStyle:s,activeOpacity:i,inactiveOpacity:r,activeTintColor:E,inactiveTintColor:I,renderIcon:a,style:w})})(x),(e=>{let{focused:t}=e;if(!1===v)return null;const a=t?E:I;if("string"==typeof r)return D.createElement(hl,{numberOfLines:1,style:[J5.label,{color:a},p?J5.labelBeside:J5.labelBeneath,S],allowFontScaling:b},r);const{options:o}=i,s="string"==typeof o.tabBarLabel?o.tabBarLabel:void 0!==o.title?o.title:n.name;return r({focused:t,color:a,position:p?"beside-icon":"below-icon",children:s})})(x))})}const J5=Ei.create({tab:{flex:1,alignItems:"center"},tabPortrait:{justifyContent:"flex-end",flexDirection:"column"},tabLandscape:{justifyContent:"center",flexDirection:"row"},label:{textAlign:"center",backgroundColor:"transparent"},labelBeneath:{fontSize:10},labelBeside:{fontSize:13,marginLeft:20,marginTop:3},button:{display:"flex"}}),e6="web"!==lr.OS,t6=e=>{let{state:t,descriptors:n,layout:i,dimensions:r}=e;const{tabBarLabelPosition:a}=n[t.routes[t.index].key].options;if(a)switch(a){case"beside-icon":return!0;case"below-icon":return!1}if(i.width>=768){return t.routes.reduce((e,t)=>{const{tabBarItemStyle:i}=n[t.key].options,r=Ei.flatten(i);if(r){if("number"==typeof r.width)return e+r.width;if("number"==typeof r.maxWidth)return e+r.maxWidth}return e+125},0)<=i.width}return r.width>r.height},n6=e=>Math.max(e.bottom-lr.select({ios:4,default:0}),0),i6=e=>{var t;let{state:n,descriptors:i,dimensions:r,insets:a,style:o,...s}=e;const l=null===(t=Ei.flatten(o))||void 0===t?void 0:t.height;if("number"==typeof l)return l;const u=r.width>r.height,c=t6({state:n,descriptors:i,dimensions:r,...s}),d=n6(a);return"ios"===lr.OS&&!lr.isPad&&u&&c?32+d:49+d};function r6(e){let{state:t,navigation:n,descriptors:i,insets:r,style:a}=e;const{colors:o}=Af(),s=function(){const e=M.useContext(Bp),t=M.useContext(hf);return M.useCallback((n,i)=>{const{options:r}=t;if(!1===(null==r?void 0:r.enabled))return;const a=e?Lf(e,{index:0,routes:[{name:n,params:i}]}):{index:0,routes:[{name:n,params:i}]};return null!=r&&r.getPathFromState?r.getPathFromState(a,null==r?void 0:r.config):wp(a,null==r?void 0:r.config)},[t,e])}(),l=t.routes[t.index],u=i[l.key].options,{tabBarShowLabel:c,tabBarHideOnKeyboard:d=!1,tabBarVisibilityAnimationConfig:h,tabBarStyle:m,tabBarBackground:p,tabBarActiveTintColor:f,tabBarInactiveTintColor:_,tabBarActiveBackgroundColor:g,tabBarInactiveBackgroundColor:y}=u,v=fH(),b=function(){const[e,t]=M.useState(!1);return M.useEffect(()=>{const e=()=>t(!0),n=()=>t(!1);let i;return i="ios"===lr.OS?[Pu.addListener("keyboardWillShow",e),Pu.addListener("keyboardWillHide",n)]:[Pu.addListener("keyboardDidShow",e),Pu.addListener("keyboardDidHide",n)],()=>{i.forEach(e=>e.remove())}},[]),e}(),S=D.useContext(G5),w=!(d&&b),k=D.useRef(h);D.useEffect(()=>{k.current=h});const[C,E]=D.useState(!w),[I]=D.useState(()=>new uu.Value(w?1:0));D.useEffect(()=>{const e=k.current;if(w){var t,n;("spring"===(null==e||null===(t=e.show)||void 0===t?void 0:t.animation)?uu.spring:uu.timing)(I,{toValue:1,useNativeDriver:e6,duration:250,...null==e||null===(n=e.show)||void 0===n?void 0:n.config}).start(e=>{let{finished:t}=e;t&&E(!1)})}else{var i,r;E(!0);("spring"===(null==e||null===(i=e.hide)||void 0===i?void 0:i.animation)?uu.spring:uu.timing)(I,{toValue:0,useNativeDriver:e6,duration:200,...null==e||null===(r=e.hide)||void 0===r?void 0:r.config}).start()}return()=>I.stopAnimation()},[I,w]);const[x,T]=D.useState({height:0,width:v.width}),{routes:O}=t,R=n6(r),A=i6({state:t,descriptors:i,insets:r,dimensions:v,layout:x,style:[m,a]}),L=t6({state:t,descriptors:i,dimensions:v,layout:x}),P=null==p?void 0:p();return D.createElement(uu.View,{style:[a6.tabBar,{backgroundColor:null!=P?"transparent":o.card,borderTopColor:o.border},{transform:[{translateY:I.interpolate({inputRange:[0,1],outputRange:[x.height+R+Ei.hairlineWidth,0]})}],position:C?"absolute":null},{height:A,paddingBottom:R,paddingHorizontal:Math.max(r.left,r.right)},m],pointerEvents:C?"none":"auto",onLayout:e=>{const{height:t,width:n}=e.nativeEvent.layout;null==S||S(t),T(e=>t===e.height&&n===e.width?e:{height:t,width:n})}},D.createElement(_a,{pointerEvents:"none",style:Ei.absoluteFill},P),D.createElement(_a,{accessibilityRole:"tablist",style:a6.content},O.map((e,r)=>{const a=r===t.index,{options:o}=i[e.key],l=void 0!==o.tabBarLabel?o.tabBarLabel:void 0!==o.title?o.title:e.name,u=void 0!==o.tabBarAccessibilityLabel?o.tabBarAccessibilityLabel:"string"==typeof l&&"ios"===lr.OS?`${l}, tab, ${r+1} of ${O.length}`:void 0;return D.createElement(jm.Provider,{key:e.key,value:i[e.key].navigation},D.createElement(Vm.Provider,{value:e},D.createElement(Q5,{route:e,descriptor:i[e.key],focused:a,horizontal:L,onPress:()=>{const i=n.emit({type:"tabPress",target:e.key,canPreventDefault:!0});a||i.defaultPrevented||n.dispatch({...wm({name:e.name,merge:!0}),target:t.key})},onLongPress:()=>{n.emit({type:"tabLongPress",target:e.key})},accessibilityLabel:u,to:s(e.name,e.params),testID:o.tabBarTestID,allowFontScaling:o.tabBarAllowFontScaling,activeTintColor:f,inactiveTintColor:_,activeBackgroundColor:g,inactiveBackgroundColor:y,button:o.tabBarButton,icon:o.tabBarIcon??(e=>{let{color:t,size:n}=e;return D.createElement(bK,{color:t,size:n})}),badge:o.tabBarBadge,badgeStyle:o.tabBarBadgeStyle,label:l,showLabel:c,labelStyle:o.tabBarLabelStyle,iconStyle:o.tabBarIconStyle,style:o.tabBarItemStyle})))})))}const a6=Ei.create({tabBar:{left:0,right:0,bottom:0,borderTopWidth:Ei.hairlineWidth,elevation:8},content:{flex:1,flexDirection:"row"}});function o6(){return o6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},o6.apply(this,arguments)}let s6;try{s6=yQ}catch(e){}const l6=e=>{var t,n;let{enabled:i,...r}=e;return null!==(t=s6)&&void 0!==t&&null!==(n=t.screensEnabled)&&void 0!==n&&n.call(t)?M.createElement(s6.ScreenContainer,o6({enabled:i},r)):M.createElement(_a,r)};function u6(e){var t,n;let{visible:i,children:r,...a}=e;return null!==(t=s6)&&void 0!==t&&null!==(n=t.screensEnabled)&&void 0!==n&&n.call(t)?M.createElement(s6.Screen,o6({activityState:i?2:0},a),r):M.createElement(kK,o6({visible:i},a),r)}function c6(){return c6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},c6.apply(this,arguments)}function d6(e){const{tabBar:t=e=>M.createElement(r6,e),state:n,navigation:i,descriptors:r,safeAreaInsets:a,detachInactiveScreens:o="web"===lr.OS||"android"===lr.OS||"ios"===lr.OS,sceneContainerStyle:s}=e,l=n.routes[n.index].key,[u,c]=M.useState([l]);u.includes(l)||c([...u,l]);const d=TK.initialMetrics.frame,[h,m]=M.useState(()=>i6({state:n,descriptors:r,dimensions:d,layout:{width:d.width,height:0},insets:{...TK.initialMetrics.insets,...e.safeAreaInsets},style:r[n.routes[n.index].key].options.tabBarStyle})),{routes:p}=n;return M.createElement(TK,null,M.createElement(l6,{enabled:o,hasTwoStates:!0,style:h6.container},p.map((e,t)=>{const i=r[e.key],{lazy:a=!0,unmountOnBlur:l}=i.options,c=n.index===t;if(l&&!c)return null;if(a&&!u.includes(e.key)&&!c)return null;const{freezeOnBlur:m,header:p=t=>{let{layout:n,options:i}=t;return M.createElement(lK,c6({},i,{layout:n,title:QZ(i,e.name)}))},headerShown:f,headerStatusBarHeight:_,headerTransparent:g}=i.options;return M.createElement(u6,{key:e.key,style:[Ei.absoluteFill,{zIndex:c?0:-1}],visible:c,enabled:o,freezeOnBlur:m},M.createElement(W5.Provider,{value:h},M.createElement(AK,{focused:c,route:i.route,navigation:i.navigation,headerShown:f,headerStatusBarHeight:_,headerTransparent:g,header:p({layout:d,route:i.route,navigation:i.navigation,options:i.options}),style:s},i.render())))})),M.createElement(G5.Provider,{value:m},M.createElement(uH.Consumer,null,e=>t({state:n,descriptors:r,navigation:i,insets:{top:(null==a?void 0:a.top)??(null==e?void 0:e.top)??0,right:(null==a?void 0:a.right)??(null==e?void 0:e.right)??0,bottom:(null==a?void 0:a.bottom)??(null==e?void 0:e.bottom)??0,left:(null==a?void 0:a.left)??(null==e?void 0:e.left)??0}}))))}const h6=Ei.create({container:{flex:1,overflow:"hidden"}});function m6(){return m6=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},m6.apply(this,arguments)}const p6=tp(function(e){let{id:t,initialRouteName:n,backBehavior:i,children:r,screenListeners:a,screenOptions:o,sceneContainerStyle:s,...l}=e;const{lazy:u,tabBarOptions:c,...d}=l;let h={};c&&(Object.assign(h,{tabBarHideOnKeyboard:c.keyboardHidesTabBar,tabBarActiveTintColor:c.activeTintColor,tabBarInactiveTintColor:c.inactiveTintColor,tabBarActiveBackgroundColor:c.activeBackgroundColor,tabBarInactiveBackgroundColor:c.inactiveBackgroundColor,tabBarAllowFontScaling:c.allowFontScaling,tabBarShowLabel:c.showLabel,tabBarLabelStyle:c.labelStyle,tabBarIconStyle:c.iconStyle,tabBarItemStyle:c.tabStyle,tabBarLabelPosition:c.labelPosition??(!1===c.adaptive?"below-icon":void 0),tabBarStyle:[{display:c.tabBarVisible?"none":"flex"},h.tabBarStyle]}),Object.keys(h).forEach(e=>{void 0===h[e]&&delete h[e]}),WH(c,`Bottom Tab Navigator: 'tabBarOptions' is deprecated. Migrate the options to 'screenOptions' instead.\n\nPlace the following in 'screenOptions' in your code to keep current behavior:\n\n${JSON.stringify(h,null,2)}\n\nSee https://reactnavigation.org/docs/bottom-tab-navigator#options for more details.`)),"boolean"==typeof u&&(h.lazy=u,WH(!0,"Bottom Tab Navigator: 'lazy' in props is deprecated. Move it to 'screenOptions' instead.\n\nSee https://reactnavigation.org/docs/bottom-tab-navigator/#lazy for more details."));const{state:m,descriptors:p,navigation:f,NavigationContent:_}=cf(Rm,{id:t,initialRouteName:n,backBehavior:i,children:r,screenListeners:a,screenOptions:o,defaultScreenOptions:h});return M.createElement(_,null,M.createElement(d6,m6({},d,{state:m,navigation:f,descriptors:p,sceneContainerStyle:s})))});new Xo(nr.RNDeviceInfo);const f6=new Xo(nr.RNDeviceInfo);let _6=!1,g6=-1,y6={};const v6=e=>{const{level:t,charging:n,chargingtime:i,dischargingtime:r}=e;return{batteryLevel:t,lowPowerMode:!1,batteryState:1===t?"full":n?"charging":"unplugged",chargingtime:i,dischargingtime:r}},b6=()=>window.performance&&window.performance.memory?window.performance.memory.jsHeapSizeLimit:-1,S6=()=>document.referrer,w6=()=>!!navigator.onLine,k6=()=>window.navigator.userAgent,C6=()=>!!navigator.geolocation,E6=()=>navigator.deviceMemory?1e9*navigator.deviceMemory:-1,I6=()=>window.performance&&window.performance.memory?window.performance.memory.usedJSHeapSize:-1;"undefined"!=typeof navigator&&navigator.getBattery&&navigator.getBattery().then(e=>{_6=e.charging,e.addEventListener("chargingchange",()=>{const{charging:t}=e;_6=t,y6=v6(e),f6.emit("RNDeviceInfo_powerStateDidChange",y6)}),e.addEventListener("levelchange",()=>{const{level:t}=e;g6=t,y6=v6(e),f6.emit("RNDeviceInfo_batteryLevelDidChange",t),t<.2&&f6.emit("RNDeviceInfo_batteryLevelIsLow",t)})});const x6=Object.freeze(Object.defineProperty({__proto__:null,getBaseOs:async()=>(()=>{const e=window.navigator.userAgent,t=window.navigator.platform;let n=t;return-1!==["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(t)?n="Mac OS":-1!==["iPhone","iPad","iPod"].indexOf(t)?n="iOS":-1!==["Win32","Win64","Windows","WinCE"].indexOf(t)?n="Windows":/Android/.test(e)?n="Android":!n&&/Linux/.test(t)&&(n="Linux"),n})(),getBatteryLevel:async()=>navigator.getBattery?navigator.getBattery().then(e=>e.level):-1,getBatteryLevelSync:()=>g6,getFreeDiskStorage:async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e,usage:t})=>e-t):-1,getFreeDiskStorageSync:()=>(console.log("[react-native-device-info] getFreeDiskStorageSync not supported - please use getFreeDiskStorage"),-1),getInstallReferrer:async()=>S6(),getInstallReferrerSync:S6,getMaxMemory:async()=>b6(),getMaxMemorySync:b6,getPowerState:async()=>navigator.getBattery?navigator.getBattery().then(e=>v6(e)):{},getPowerStateSync:()=>y6,getTotalDiskCapacity:async()=>navigator.storage&&navigator.storage.estimate?navigator.storage.estimate().then(({quota:e})=>e):-1,getTotalDiskCapacitySync:()=>(console.log("[react-native-device-info] getTotalDiskCapacitySync not supported - please use getTotalDiskCapacity"),-1),getTotalMemory:async()=>E6(),getTotalMemorySync:E6,getUsedMemory:async()=>I6(),getUsedMemorySync:I6,getUserAgent:async()=>k6(),getUserAgentSync:k6,isAirplaneMode:async()=>w6(),isAirplaneModeSync:w6,isBatteryCharging:async()=>!!navigator.getBattery&&navigator.getBattery().then(e=>e.charging),isBatteryChargingSync:()=>_6,isCameraPresent:async()=>!(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)&&navigator.mediaDevices.enumerateDevices().then(e=>!!e.find(e=>"videoinput"===e.kind)),isCameraPresentSync:()=>(console.log("[react-native-device-info] isCameraPresentSync not supported - please use isCameraPresent"),!1),isLocationEnabled:async()=>C6(),isLocationEnabledSync:C6},Symbol.toStringTag,{value:"Module"})),T6=i(x6);let O6=nr.RNDeviceInfo;if("web"!==lr.OS&&"dom"!==lr.OS||(O6=T6),!O6&&("android"===lr.OS||"ios"===lr.OS||"web"===lr.OS||"dom"===lr.OS))throw new Error("react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue try these steps:\n • For react-native <= 0.59: Run `react-native link react-native-device-info` in the project root.\n • Rebuild and re-run the app.\n • If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.\n If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-device-info/react-native-device-info");const R6=O6;let A6={};function L6({getter:e,supportedPlatforms:t,defaultValue:n,memoKey:i}){if(i&&null!=A6[i])return A6[i];{const r=function(e,t,n){let i={};return e.filter(e=>lr.OS==e).forEach(e=>i[e]=t),lr.select({...i,default:n})}(t,e,()=>n)();return i&&(A6[i]=r),r}}const P6=()=>L6({defaultValue:!1,supportedPlatforms:["ios"],memoKey:"zoomed",getter:()=>R6.isDisplayZoomed});new Xo(nr.RNDeviceInfo);const M6=Ei.create({container:{flexDirection:"row",justifyContent:"space-between",padding:8,paddingLeft:16,borderRadius:40,marginBottom:16},button:{alignItems:"center",justifyContent:"center",minWidth:60,maxWidth:80},calculateButton:{alignItems:"center",borderRadius:26,height:52,flex:1,minWidth:60,borderWidth:1},title:{...oj.medium_XXS,paddingTop:2,textAlign:"center"},valueCircle:{borderRadius:8,position:"absolute",left:40,top:6},value:{...oj.semiBold_XXS,lineHeight:lr.select({web:15,default:14}),paddingHorizontal:lr.select({web:5,default:4})}}),D6=iF(({navigation:e})=>{const{t:t}=iV(),{COLORS:n}=bL(),{isCalculationTabBarHidden:i}=mL(),r=y5(),{totalCarbsCartItems:a,manualCarbsInput:o}=TX(),{activityDurationSeconds:s}=C2(),{glucoseUnit:l}=Uq;if(void 0===l)throw new Error("[BolusTab::render] glucoseUnit must be non-undefined.");const{navigate:u,getState:c}=e,d=c().index,[h,m]=M.useState(!1),[p,f]=M.useState([0,0,0,0]),_=uR(0);M.useEffect(()=>{_.value=NE(p[d],{duration:200})},[d,_,p]);const g=()=>{jX(FX.GlucoseTabPress),u(S2.GlucoseTab)},y=()=>{jX(FX.CarbsTabPress),u(S2.CarbsTab)},v=()=>{jX(FX.ActivityTabPress),u(S2.ActivityTab)},b=()=>{a+o>300?m(!0):(jX(FX.SummaryTabPress),u(S2.SummaryTab))};return i?null:D.createElement(D.Fragment,null,D.createElement(SH,{style:[M6.container,{backgroundColor:n.bgSecondary,marginHorizontal:P6()?4:24}],edges:["bottom"],mode:"margin"},(()=>{const e=Math.round(o+a),i=Math.round(s/60);return[{testID:"bg-tab",value:null===r?"-":aZ(r.value,r.unit,l),onPress:g,title:t("bottom_navigation_calculation_glucose")},{testID:"carbs-tab",value:e,onPress:y,title:t("bottom_navigation_calculation_carbs")},{testID:"activity-tab",value:i,onPress:v,title:t("bottom_navigation_calculation_activity")},{isSummary:!0,testID:"summary-tab",onPress:b}].map((e,t)=>{const{testID:i,title:r,value:a,onPress:o,isSummary:s}=e,l=`${t}_${i}`,u=t===d,c=s?[M6.calculateButton,{backgroundColor:u?n.bgCalculatorActive:n.bgCalculatorInactive,borderColor:u?n.bgTransparent:n.borderCalculator,maxWidth:P6()?70:84}]:M6.button,h=t,m={0:u?D.createElement(n2,null):D.createElement(t2,null),1:u?D.createElement(W1,{height:28,width:28}):D.createElement(G1,{height:28,width:28}),2:u?D.createElement(z1,{height:28,width:28}):D.createElement(H1,null),3:u?D.createElement(r2,{color:n.iconActive}):D.createElement(r2,null)};return D.createElement(eh,{key:l,testID:i,onPress:o,style:c,disabled:u,onLayout:e=>{((e,t,n)=>{const i=(n-30)/2+t-(uV?16:0);f(t=>{const n=[...t];return n[e]=i,n})})(t,e.nativeEvent.layout.x,e.nativeEvent.layout.width)}},m[h],D.createElement(gj,{maxFontSizeMultiplier:sj,style:[M6.title,{color:n.labelSecondary},u&&{color:n.labelBrand}],ellipsizeMode:"tail",numberOfLines:1},r),!s&&D.createElement(_a,{style:[M6.valueCircle,{backgroundColor:u?n.bgBrand:n.bgNumber}]},D.createElement(gj,{style:[M6.value,{color:n.textNumber}],maxFontSizeMultiplier:sj},a)))})})()),D.createElement(lz,{isVisible:h,title:t("current_glucose_invalid_modal_title"),message:t("current_glucose_invalid_modal_body"),buttons:[{title:t("button_close"),onPress:()=>{m(!1)}}]}),D.createElement(M5,null))}),N6=()=>{const{t:e}=iV(),{COLORS:t}=bL();return M.createElement(M.Fragment,null,M.createElement(gj,{style:F6.header,testID:"activity-info-title"},e("physical_activity_modal_activity_insulin_title")),M.createElement(gj,{style:[{color:t.labelSecondary},F6.spacing]},e("physical_activity_modal_activity_insulin_body")),M.createElement(gj,{style:F6.header},e("physical_activity_modal_adjust_insulin_title")),M.createElement(gj,{style:{color:t.labelSecondary}},e("physical_activity_modal_adjust_insulin_body")))},F6=Ei.create({header:{...oj.semiBold_LG,marginBottom:8},spacing:{marginBottom:32}});function B6({isSpinning:e,height:t=20,width:n=20}){const i=OR(),r=M.useRef(new uu.Value(0)).current;M.useEffect(()=>{const t=uu.loop(uu.timing(r,{toValue:1,duration:3e3,useNativeDriver:!uV,easing:Xl.linear}));return e&&!i&&t.start(),()=>{t.stop()}},[r,e,i]);const a=r.interpolate({inputRange:[0,1],outputRange:["0deg","360deg"]});return D.createElement(uu.View,{style:{transform:[{rotate:a}]}},D.createElement(h2,{height:t,width:n}))}function j6({activity:e,isChecked:t,index:n=0,onEdit:i,toggleActivitySwitch:r}){const{t:a}=iV(),{COLORS:o}=bL();if(!Uq.activity)throw new Error("[ActivityCard::render] No settings found!");if(!Uq.glucoseUnit)throw new Error("[ActivityCard::render] No glucose unit found!");const{activityIntensity:s,durationSeconds:l,startTimestamp:u,title:c,type:d,uuid:h}=e;if(!u)throw new Error("[ActivityCard::render] No startTimestamp!");const m=o$(u,"dd.MM.yy"),p=o$(u,"HH:mm"),f=s?tZ[s]():null,_={borderColor:o.borderInputFocus},g=M.useMemo(()=>Math.round(l/60),[l]),[y,v]=M.useState(Jq(u,g)),b=M.useMemo(()=>{const e=Uq.activity;if(!e)throw new Error("[ActivityCard::reduction] No settings found!");return(100*Rq.getReduction(g,e,s,new Date(u))).toFixed(0)},[s,g,u]),S=`activity-${g}-${s}-${d}-${t}`.toLowerCase(),w=`activity-card-${n}`,k=f?`${w}-intensity-${f.toLowerCase()}`:"",C=Uq.glucoseUnit===NL.BloodGlucoseUnit.MMOL_L?a("glucose_unit_mmol/l"):a("glucose_unit_mg/dl");return M.useEffect(()=>{const e=t?setInterval(()=>{v(Jq(u,g))},NL.Milliseconds.Minute):null;return()=>{var t;(t=e)&&clearInterval(t)}},[t,u,g]),D.createElement(_a,{testID:S,style:[V6.wrapper,t&&_]},D.createElement(_a,{style:[V6.headerContainer,{backgroundColor:o.bgSecondary,borderColor:o.divider}]},D.createElement(gj,{style:V6.header},a("activity_card_title")),D.createElement(yh,{testID:`${w}-${t}`,value:t,onValueChange:()=>{r(h)},trackColor:{true:o.bgSliderForeground,false:o.bgSliderBackground},thumbColor:o.toggleKnob,activeThumbColor:o.bgSliderKnob,activeTrackColor:o.bgSliderForeground})),D.createElement(_a,{style:[V6.mainInfoCard,{backgroundColor:o.bgSecondary}]},D.createElement(_a,{style:V6.titleAndEditContainer},d&&D.createElement(_a,{style:V6.row},D.createElement(_a,{style:V6.mainInfo},D.createElement(gj,{style:V6.type,testID:`${w}-type`},eZ[d]()),c&&D.createElement(gj,{style:[V6.title,{color:o.labelSecondary}],testID:`${w}-title`},c)))),D.createElement(_a,{style:V6.intensityDuration},null!==f&&D.createElement(D.Fragment,null,D.createElement(gj,{style:[V6.intensityText,{color:o.labelPrimary}],testID:k},f)),D.createElement(_2,{color:o.labelPrimary}),D.createElement(gj,{style:[V6.durationText,{color:o.labelPrimary}],testID:`${w}-duration`},`${Qq(g)} ${a("activity_card__active_min")}`),D.createElement(eh,{onPress:()=>{i(h)},style:V6.editButton,testID:`${w}-edit-button`},D.createElement(i2,{color:o.iconBrand}))),t&&D.createElement(_a,{style:V6.secondaryInfoCard,testID:`${w}-reduction-card`},D.createElement(_a,{style:[V6.activityTimeContainer,{borderBottomColor:o.divider}]},D.createElement(_a,{style:V6.activeForContainer},D.createElement(B6,{isSpinning:t}),D.createElement(gj,{style:[V6.activeFor,{color:o.labelPrimary}]},a("activity_card__active_time")," ",y)),D.createElement(gj,{style:[V6.startingTimeText,{color:o.labelSecondary}],testID:`${w}-time`},a("activity_card__created_time",{dateLogged:m,timeLogged:p}))),!!b&&D.createElement(_a,null,D.createElement(gj,{style:[V6.reductionText,{color:o.labelSecondary}]},a("activity_card__reduction"),` ${b}%`),D.createElement(gj,{style:[V6.targetText,{color:o.labelSecondary}]},a("activity_card__reduction_more",{value:aZ(Uq.activity.target,NL.BloodGlucoseUnit.MMOL_L,Uq.glucoseUnit),displayUnit:C}))))))}const V6=Ei.create({wrapper:{marginBottom:32,borderRadius:16,overflow:"hidden"},headerContainer:{flexDirection:"row",alignItems:"center",justifyContent:"space-between",paddingVertical:12,paddingHorizontal:16,borderBottomWidth:1},header:{...oj.medium_Base},mainInfoCard:{padding:16},titleAndEditContainer:{flexDirection:"row",justifyContent:"space-between",marginBottom:12},row:{flex:1,flexDirection:"row"},mainInfo:{flex:1,justifyContent:"center"},type:{...oj.semiBold_Base},title:{...oj.medium_Base},editButton:{flexDirection:"row",alignItems:"center",marginLeft:16},intensityDuration:{alignItems:"center",flexDirection:"row"},intensityText:{...oj.medium_Base,marginRight:16},durationText:{...oj.medium_Base,marginLeft:4},secondaryInfoCard:{paddingTop:24},activityTimeContainer:{borderBottomWidth:1,marginBottom:24},activeForContainer:{flexDirection:"row",marginBottom:2,alignItems:"center"},activeFor:{...oj.medium_SM,marginLeft:2},startingTimeText:{...oj.regular_SM,marginBottom:16},reductionText:{...oj.regular_SM,marginBottom:12},targetText:{...oj.regular_SM}}),H6=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{selectedEventUUID:n,activityStoreActions:i}=C2(),{navigate:r,addListener:a,removeListener:o}=Wp(),[s,l]=M.useState([]),[u,c]=M.useState(!1);M.useEffect(()=>{const e=()=>{const e=Dq.getActiveEvents();l(e)},t=Tu.addEventListener("change",t=>{"active"===t&&e()});return a("focus",e),()=>{o("focus",e),t.remove()}},[o,a]);const d=M.useCallback(e=>{const t=Dq.getByUUID(e);i.set({selectedEventUUID:n===e?null:e,activityDurationSeconds:n===e?0:t.durationSeconds})},[i,n]),h=e=>{const t=Dq.getByUUID(e);r(S2.AddActivity,{activity:t})};return D.createElement(D.Fragment,null,D.createElement(Xa,{contentContainerStyle:z6.scrollView},D.createElement(_a,null,D.createElement(_a,{style:z6.row},D.createElement(z1,{color:t.labelPrimary,width:24,height:24}),D.createElement(gj,{style:[z6.pageHeader,{color:t.labelPrimary}]},e("new_cal_activity_title"))),D.createElement(gj,{style:[z6.subheader,{color:t.labelSecondary},0===s.length&&z6.noActivities],onPress:()=>{c(!0)}},D.createElement(gj,{style:[z6.subheaderText,{color:t.labelSecondary}]},e("new_cal_current_activity_body")+" "),D.createElement(gj,{style:[z6.learnMore,{color:t.textLink}]},e("new_cal_current_activity_body_link")))),s.map((e,t)=>D.createElement(j6,{key:e.uuid,index:t,toggleActivitySwitch:d,isChecked:n===e.uuid,onEdit:h,activity:e})),D.createElement(mj,{type:0===s.length?dj.Primary:dj.Secondary,testID:"add-activity-button",title:0===s.length?e("new_cal_activity_button_add"):e("new_cal_activity_button_add_new"),onPress:()=>{r(S2.AddActivity)}})),D.createElement(lz,{isVisible:u,enableScroll:!0,buttons:[{title:e("button_close"),onPress:()=>{c(!1)},style:z6.modalButton}]},D.createElement(N6,null)))},z6=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16,paddingBottom:130},row:{flexDirection:"row",justifyContent:"center",alignItems:"center"},pageHeader:{...oj.semiBold_Base,marginLeft:4},noActivities:{marginBottom:128},subheader:{paddingHorizontal:16,textAlign:"center",marginBottom:32,marginTop:8},subheaderText:{...oj.regular_SM,textAlign:"center"},learnMore:{...oj.semiBold_SM},modalButton:{marginTop:32}});PX(NL.CONSTANTS.CARBOHYDRATES_INPUT_MIN,NL.CONSTANTS.CARBOHYDRATES_INPUT_MAX);const U6=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{cartItems:n,carbohydrateStoreActions:i}=TX(),{foodStoreActions:r}=O2(),a=Wp(),o=M.useCallback((e,t)=>{e?i.removeFromCart(e,"id"):i.removeFromCart(t,"title")},[i]),s=M.useCallback(e=>AX(e),[]),l=M.useCallback(e=>{r.set({selectedFoodItem:e}),a.navigate(S2.AddCarbs,{isCarbItem:!0})},[r,a]),u=M.useCallback(({item:n,index:i})=>{const{carbohydrates:r,id:a,title:u}=n.foodItem;return D.createElement(eh,{onPress:()=>{l(n.foodItem)},style:[G6.foodItem,{backgroundColor:t.bgInputActive}]},D.createElement(_a,{style:G6.left},D.createElement(gj,{numberOfLines:1,style:G6.title},u),D.createElement(gj,{style:[G6.weight,{color:t.labelSecondary}]},n.amount," ",e("food_card_unit"))),D.createElement(_a,{style:G6.right},D.createElement(gj,{style:[G6.value,{color:t.labelSecondary}],testID:`carbs-item-${i}-amount`},(n.amount/s(n.unit)*r).toFixed(0)," g "+e("new_cal_carbohydrates_input_unit")),D.createElement(_a,{style:G6.separator}),D.createElement(eh,{onPress:()=>{o(a,u)},testID:`carbs-item-${i}-remove-icon`},D.createElement(Q1,null))))},[t.bgInputActive,t.labelSecondary,e,s,l,o]),c=M.useCallback((e,t)=>e.foodItem.id?e.foodItem.id.toString():`${t}-${e.foodItem.title}`,[]);return D.createElement(Wo,{data:n,renderItem:u,keyExtractor:c,contentContainerStyle:G6.container,showsVerticalScrollIndicator:!1})},G6=Ei.create({container:{gap:8},foodItem:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:8,padding:16,borderRadius:16},title:{...oj.medium_Base,paddingBottom:4},weight:{...oj.regular_SM},left:{flexShrink:1},right:{alignSelf:"flex-start",alignItems:"center",flexDirection:"row"},value:{textAlign:"right",marginRight:4},separator:{width:1,height:20,marginHorizontal:12}}),{max:W6,min:Y6}={min:NL.CONSTANTS.CARBOHYDRATES_INPUT_MIN,max:NL.CONSTANTS.CARBOHYDRATES_INPUT_MAX},$6=uV&&{outline:"none"},X6=()=>{const{flagsStoreActions:e}=mL(),{t:t}=iV(),{COLORS:n}=bL(),{totalCarbsCartItems:i,manualCarbsInput:r,carbohydrateStoreActions:a}=TX(),{dispatch:o,addListener:s,removeListener:l,navigate:u}=Wp(),{height:c}=vm(),d=M.useMemo(()=>c<=667,[c]),h=M.useRef(null),[m,p]=M.useState(!1),[f,_]=M.useState(r.toString()),[g,y]=M.useState(!1),[v,b]=M.useState(!1);M.useEffect(()=>{uV&&e.set({isCalculationTabBarHidden:m})},[e,m]);const S=M.useCallback(()=>{i+r>300&&b(!0)},[r,i]),w=M.useCallback(()=>{window.setTimeout(()=>{window.scrollTo({top:0,left:0,behavior:"smooth"})},100)},[]),k=M.useCallback(()=>{window.visualViewport?.addEventListener("resize",w),S()},[S,w]),C=M.useCallback(()=>{window.visualViewport?.removeEventListener("resize",w)},[w]);M.useEffect(()=>(s("focus",k),s("blur",C),()=>{l("focus",k),l("blur",C)}),[s,l,C,k]);const E=()=>{if(p(!1),""===f)return a.setManualCarbsInput(0),void _("0");const e=Number(f);return!isNaN(e)&&e>=Y6?e>W6?(_(r.toString()),void b(!0)):(a.setManualCarbsInput(e),_(e.toString()),void jX(FX.CarbsManualInput)):(_(r.toString()),void y(!0))};return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"carbs-screen-scroll",scrollEventThrottle:8,contentContainerStyle:q6.scrollView},D.createElement(_a,{style:d?q6.smallScreenHeaderContainer:q6.headerContainer},D.createElement(_a,{style:q6.row},D.createElement(W1,{color:n.labelPrimary}),D.createElement(gj,{style:[q6.pageHeader,{color:n.labelPrimary}]},t("new_cal_carbohydrates_title"))),D.createElement(gj,{style:[q6.subheader,{color:n.labelSecondary}]},t("new_cal_carbohydrates_body"))),D.createElement(kj,{renderLeftSlot:()=>D.createElement(gj,{testID:"carbs-input-unit"},t("new_cal_carbohydrates_input_entry")),renderRightSlot:()=>D.createElement(_a,{style:q6.inputRow},D.createElement(s0,{testID:"carbs-input",placeholder:"0",value:f,onChangeText:_,onBlur:E,style:[q6.numberInput,{color:n.labelSecondary}],ref:h,selectTextOnFocus:!0}),D.createElement(_a,{style:q6.rightSlotNumberInput},D.createElement(gj,{style:[q6.unit,{color:n.labelSecondary}]},t("my_food_add_unit")),D.createElement(_a,{style:[q6.separator,{backgroundColor:n.divider}]}),D.createElement(i2,null))),onPress:()=>{p(!0),h.current?.focus()},style:{...q6.groupedRow,...m&&{borderColor:n.borderInputFocus}}}),D.createElement(U6,null),D.createElement(mj,{type:dj.Secondary,title:t("new_cal_carbohydrates_button_add_food"),testID:"add-food-from-library-button",onPress:()=>{uV?u(S2.FoodLibrary,{comingFrom:S2.CarbsTab}):o(wm(S2.FoodLibraryStack,{comingFrom:S2.CarbsTab}))},style:q6.button}),D.createElement(lz,{isVisible:g,title:t("current_glucose_invalid_modal_title"),message:t("current_glucose_invalid_modal_body"),buttons:[{testID:"close-button",title:t("button_close"),onPress:()=>{y(!1)}}]}),D.createElement(lz,{isVisible:v,title:t("current_glucose_invalid_modal_title"),message:t("current_glucose_invalid_modal_body"),buttons:[{title:t("button_close"),onPress:()=>{b(!1)}}]})),D.createElement(_a,{style:q6.totalWrapper},D.createElement(fj,null)),D.createElement(_a,{style:d?q6.smallScreenTotalContainer:q6.totalContainer},D.createElement(gj,{style:q6.totalTitle},t("new_cal_carbohydrates_total_entry")),D.createElement(_a,{style:q6.totalGramsContainer},D.createElement(gj,{style:q6.totalValue,testID:"total-carbs-value"},i+r),D.createElement(gj,{style:q6.totalUnits,testID:"total-carbs-unit"},t("my_food_add_unit")))))},q6=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16},row:{flex:1,flexDirection:"row",justifyContent:"center",alignItems:"center"},inputRow:{flexDirection:"row",justifyContent:"flex-start",alignItems:"center",gap:4},headerContainer:{marginBottom:112},smallScreenHeaderContainer:{marginBottom:32},pageHeader:{...oj.semiBold_Base,marginLeft:4},subheader:{...oj.regular_SM,textAlign:"center",marginTop:8,marginHorizontal:16},groupedRow:{marginBottom:16,flexWrap:"wrap",justifyContent:"space-between"},separator:{width:1,height:20,marginHorizontal:12},unit:{...oj.regular_Base},numberInput:{...oj.regular_Base,textAlign:"right",lineHeight:22,padding:0,maxWidth:40,fontFamily:cV?aj.RobotoRegular:aj.PoppinsRegular,...$6},rightSlotNumberInput:{flexDirection:"row",alignItems:"center"},totalWrapper:{marginHorizontal:16},totalContainer:{flexDirection:"row",justifyContent:"space-between",alignItems:"baseline",paddingVertical:32,paddingBottom:16,marginHorizontal:16,gap:8,flexWrap:"wrap"},smallScreenTotalContainer:{flexDirection:"row",justifyContent:"space-between",alignItems:"baseline",paddingVertical:16,paddingBottom:16,marginHorizontal:16,gap:8,flexWrap:"wrap"},totalTitle:{...oj.medium_SM},totalGramsContainer:{flexDirection:"row",alignItems:"baseline"},totalValue:{...oj.bold_4XL},totalUnits:{...oj.bold_2XL,marginLeft:8},button:{marginHorizontal:"auto",marginTop:32}});var Z6=(e=>(e.Add="Add",e.Sync="Sync",e.SyncSpinner="SyncSpinner",e.Edit="Edit",e.Done="Done",e))(Z6||{});const K6=({title:e,subtitle:t,children:n,icon:i,leftIcon:r,onPressCard:a,onPressIcon:o})=>{const{COLORS:s}=bL(),l=M.useMemo(()=>"SyncSpinner"===i,[i]);return D.createElement(eh,{style:({pressed:e})=>[Q6.container,{backgroundColor:s.bgSecondary,opacity:e?.5:1}],onPress:a,disabled:!a},r&&D.createElement(_a,{style:Q6.leftIconContainer},r),D.createElement(_a,{style:Q6.textContainer},D.createElement(gj,{style:Q6.title},e),n,!!t&&D.createElement(gj,{style:[Q6.subtitle,{color:s.labelSecondary}]},t)),D.createElement(eh,{style:({pressed:e})=>[Q6.iconContainer,{backgroundColor:s.bgTertiary,opacity:e?.5:1}],onPress:()=>{o&&o()},hitSlop:20,disabled:!o},"Add"===i&&D.createElement(U1,{width:32,height:32}),"Edit"===i&&D.createElement(i2,{width:32,height:32}),"Sync"===i&&D.createElement(h2,{height:32,width:32}),"SyncSpinner"===i&&D.createElement(B6,{isSpinning:l,height:32,width:32}),"Done"===i&&D.createElement($1,{width:32,height:32})))},Q6=Ei.create({container:{flexDirection:"row",justifyContent:"space-between",padding:16,borderRadius:16},textContainer:{flex:1},title:{...oj.semiBold_Base,marginBottom:4},subtitle:{...oj.regular_XS},iconContainer:{alignSelf:"center",justifyContent:"center",padding:6,borderRadius:16,marginLeft:16},leftIconContainer:{marginRight:2}}),J6=uV?{outline:"none"}:{};function e7({value:e,unit:t,editable:n=!0,onChange:i,onPress:r,onBlur:a,testID:o,ref:s,leftIcon:l}){const{t:u}=iV(),{COLORS:c}=bL(),{flagsStoreActions:d}=mL(),{height:h}=vm(),m=M.useMemo(()=>h<667,[h]),[p,f]=M.useState(!1),_=M.useRef(null);M.useImperativeHandle(s,()=>({focus:()=>{setTimeout(()=>{_.current?.focus(),uV&&d.set({isCalculationTabBarHidden:!0})},100)}}),[d]);const g=M.useCallback(()=>{f(!0),uV&&d.set({isCalculationTabBarHidden:!0})},[d]),y=M.useCallback(()=>{f(!1),a?.(),uV&&d.set({isCalculationTabBarHidden:!1})},[d,a]),v=M.useCallback(()=>{n?_.current?.focus():r?.()},[r,n]);return D.createElement(_a,{style:m?t7.smallScreenContainer:t7.container},D.createElement(eh,{onPress:v,style:t7.input,pointerEvents:"box-only"},l&&D.createElement(_a,{style:t7.leftIconContainer},l),D.createElement(kh,{ref:_,value:e,onChangeText:i,placeholder:p?"":u("bolus_glucose_enter_input"),onBlur:y,onFocus:g,style:[{...t7.textInput,...J6,color:c.labelPrimary},p||e?{...oj.bold_4XL}:{...oj.semiBold_2XL},cV&&!p&&!e&&{paddingTop:16}],placeholderTextColor:c.labelSecondary,cursorColor:c.iconBrand,enterKeyHint:"done",inputMode:"decimal",autoCorrect:!1,maxLength:4,maxFontSizeMultiplier:sj,multiline:!1,numberOfLines:1,selectTextOnFocus:!0,testID:o}),D.createElement(_a,{style:t7.unitContainer},D.createElement(gj,{style:[t7.unitText,{color:p?c.labelPrimary:c.labelSecondary}],maxFontSizeMultiplier:sj},t))),D.createElement(_a,{style:[t7.animationContainer,{backgroundColor:c.bgBrand}]}))}const t7=Ei.create({container:{paddingHorizontal:40,marginBottom:64},smallScreenContainer:{paddingHorizontal:20,marginBottom:32},input:{flexDirection:"row",alignItems:"center",height:62,justifyContent:"center"},textInput:{paddingTop:0,paddingBottom:0,flex:1,textAlign:"right",verticalAlign:"middle",width:"100%"},unitContainer:{marginLeft:8,flex:1},unitText:{...oj.semiBold_2XL},animationContainer:{height:4,width:"100%",borderRadius:2},leftIconContainer:{position:"absolute",left:15}});const{HEDIA_API_URL_V2:n7,NODE_ENV:i7}={HEDIA_API_URL_V2:"/api/v2"},r7=e=>({id:e.id,object_id:e.id,user_id:e.userId,type:e.type,quantity:{unit:e.quantity.unit.toLowerCase(),value:e.quantity.value},timestamp:new Date(e.startDate),source_id:e.source.id,device_name:e.device.name,source_name:e.source.name});const a7=Ei.create({scrollView:{paddingTop:32,paddingHorizontal:16,paddingBottom:130},headerContainer:{marginBottom:112},smallScreenHeaderContainer:{marginBottom:32},row:{flexDirection:"row",justifyContent:"center",alignItems:"center"},pageHeader:{...oj.semiBold_Base,marginLeft:4},subheader:{...oj.regular_SM,textAlign:"center",marginTop:8,marginHorizontal:16},noReadingsContainer:{padding:16,borderRadius:16},noMeasurements:{...oj.regular_XS,textAlign:"center",marginBottom:8},buttonText:{...oj.semiBold_SM,textAlign:"center"},card:{flexDirection:"row"},valueContainer:{paddingRight:8,borderRightWidth:1,marginBottom:4},value:{...oj.medium_XS},crossedOut:{textDecorationLine:"line-through"},time:{...oj.regular_XS,marginLeft:8}}),o7=iF(function(){const{t:e}=iV(),{COLORS:t}=bL(),n=Wp(),i=df(),{activityStoreActions:r}=C2(),{glucoseStoreActions:a}=F2(),o=(s="external",F2(e=>e.availableGlucoseReadings.find(e=>e.source===s)||null));var s;const l=y5(),{height:u}=vm(),c=M.useMemo(()=>u<667,[u]),{glucoseUnit:d,activity:h}=Uq;if(void 0===d)throw new Error("[Glucose::render] glucoseUnit must be non-undefined.");const{decimalPlaces:m,inputMax:p,inputMin:f,text:_}=M.useMemo(()=>Kq(d),[d]),[g,y]=M.useState(""),[v,b]=M.useState(!1),[S,w]=M.useState(!1),[k,C]=M.useState(!1),[E,I]=M.useState(!1),[x,T]=M.useState(!1),[O,R]=M.useState(!1),[A,L]=M.useState(!1),[P,N]=M.useState(!1),[F,B]=M.useState(""),[j,V]=M.useState(""),H=M.useRef(null),z=M.useCallback(()=>{window.setTimeout(()=>{window.scrollTo({top:0,left:0,behavior:"smooth"})},100)},[]),U=M.useCallback(()=>{window.visualViewport?.addEventListener("resize",z)},[z]),G=M.useCallback(()=>{window.visualViewport?.removeEventListener("resize",z)},[z]),W=M.useCallback(()=>{a.setSelectedReadingId(null)},[a]);M.useEffect(()=>(n.addListener("focus",U),n.addListener("blur",G),()=>{n.removeListener("focus",U),n.removeListener("blur",G)}),[n,G,U]),Yp(M.useCallback(()=>{const e=()=>{const e=l?.timestamp;e&&Date.now()-e>10*NL.Milliseconds.Minute?(I(!0),y("")):I(!1)};e();const t=setInterval(e,1e3);return()=>{clearInterval(t)}},[l]));const Y=M.useCallback(()=>{if(o){const t=Date.now()-o.timestamp>10*NL.Milliseconds.Minute,n=_Y(new Date,o.timestamp).toString();V(e("imprted_device_card_time",{min:n}));const i=function(e,t,n){const i=Kq(n).text;return`${aZ(e,t,n)} ${i}`}(o.value,o.unit,d);B(t?e("imprted_device_card_unit"):i),N(t)}},[d,o,e]);M.useEffect(()=>{Y()},[Y]),function(e,t){const n=M.useRef(void 0);M.useLayoutEffect(()=>{n.current=e},[e]),M.useEffect(()=>{const e=setInterval(function(){n.current&&n.current()},t);return()=>{clearInterval(e)}},[t])}(Y,1e3),M.useEffect(()=>{i.params?.editGlucose&&(y(""),H.current?.focus())},[i.params?.editGlucose]),M.useEffect(()=>{null===l&&y("")},[l]),M.useEffect(()=>{(async()=>{try{L(!0);const e=await VX(`${n7}/samples`);if(!e.ok)throw new Error("[Glucose::getSamples] response status not OK");const t=await e.json();if(t.length>0){const e=t.map(r7),n=e.filter(e=>"HDA"!==e.source_name&&e.timestamp.getTime()<=(new Date).getTime()).sort((e,t)=>t.timestamp.getTime()-e.timestamp.getTime());if(n.length>0){const e=n[0],{unit:t,value:i}=e.quantity,{inputMax:r,inputMin:o}=Kq(t);if(i>=o&&i<=r){const n={id:RX(),source:"external",value:i,unit:t,sampleId:e.id,sourceId:e.source_id,sourceName:e.source_name,deviceName:e.device_name,timestamp:e.timestamp.getTime()};a.addAvailableGlucoseReading(n),a.setSelectedReadingId(n.id),(e=>{const{id:t,isTester:n,country:i,uuid:r,timestamp:a,timezone:o,platform:s}=BX(),l={uuid:r,timestamp:a,timezone:o,type:"integration.service.transfer",data:{version:NX,platform:s,source:{sourceID:e.source_id,deviceName:e.device_name,sourceName:e.source_name},reading:{type:e.type,value:e.quantity.value,unit:e.quantity.unit},geo:{country:i},user:{id:t,isTester:n}}};qW.update(l),qW.sync().catch(console.error)})(e)}else a.setSelectedReadingId(null)}}}finally{L(!1)}})().catch(console.error)},[a]),M.useEffect(()=>{if("external"===l?.source&&o){const e=aZ(o.value,o.unit,d);y(e)}},[d,l,o]),M.useEffect(()=>{const e=Dq.getEventWithHighestReduction(h);r.set({selectedEventUUID:e?.uuid??null,activityDurationSeconds:e?.durationSeconds??0})},[h,r]);const $=M.useCallback(()=>{if(""===g)return void W();if(o&&!P){const e=aZ(o.value,o.unit,d);if(g===e)return void a.setSelectedReadingId(o.id)}const e=parseFloat(g);if(!(!isNaN(e)&&e>=f&&e<=p)){const e=l&&aZ(l.value,l.unit,d);return y(e||""),void b(!0)}const t={id:RX(),source:"manual",value:e,unit:d,timestamp:Date.now()};a.addAvailableGlucoseReading(t),a.setSelectedReadingId(t.id),y(e.toFixed(m))},[W,m,g,l,d,p,f,a,P,o]),X=M.useCallback(()=>{"external"===l?.source?C(!0):H.current?.focus()},[l]),q=M.useCallback(()=>{O&&(W(),C(!1),H.current?.focus(),R(!1))},[W,O]),Z=M.useCallback(()=>{R(!0),C(!1)},[]),K=M.useCallback(()=>{w(!0)},[]),Q=M.useCallback(()=>{!P&&o&&a.setSelectedReadingId(o.id)},[P,a,o]),J=M.useCallback(()=>{W(),I(!1)},[W]),ee=M.useCallback(()=>{W(),I(!1),T(!0)},[W]),te=M.useCallback(()=>{x&&H.current?.focus(),T(!1)},[H,x]),ne=M.useCallback(e=>{y(e.replace(",","."))},[]),ie=M.useCallback(()=>{const e={id:"TEST",timestamp:new Date(Date.now()-(4*Math.random()+5)*NL.Milliseconds.Minute),source_id:"TEST",quantity:{unit:NL.BloodGlucoseUnit.MMOL_L,value:Math.random()*(33.3-1.1)+1.1},source_name:"HDA Test Name",device_name:"HDA Test Device"},t={id:RX(),source:"external",value:e.quantity.value,unit:e.quantity.unit,timestamp:e.timestamp.getTime(),sampleId:e.id,sourceId:e.source_id,sourceName:e.source_name,deviceName:e.device_name};a.addAvailableGlucoseReading(t),a.setSelectedReadingId(t.id)},[a]),re=M.useMemo(()=>"external"!==l?.source&&!P,[P,l]);return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"bg-scroll-view",scrollEventThrottle:8,contentContainerStyle:a7.scrollView},D.createElement(_a,{style:c?a7.smallScreenHeaderContainer:a7.headerContainer},D.createElement(_a,{style:a7.row},D.createElement(n2,{color:t.labelPrimary,width:24,height:24}),D.createElement(gj,{style:[a7.pageHeader,{color:t.labelPrimary}]},e("new_cal_current_glucose_title"))),D.createElement(gj,{style:[a7.subheader,{color:t.labelSecondary}]},e("new_cal_glucose_body"))),D.createElement(e7,{ref:H,value:g,unit:_,onChange:ne,onPress:X,onBlur:$,editable:!("external"===l?.source||A)}),o&&"external"===o.source?D.createElement(K6,{title:o.deviceName,subtitle:e("from_source",{source:o.sourceName}),icon:"external"===l?.source?Z6.Done:Z6.Sync,onPressCard:"external"===l?.source?void 0:Q},D.createElement(_a,{style:a7.card},D.createElement(_a,{style:[a7.valueContainer,{borderRightColor:t.divider}]},D.createElement(gj,{style:[a7.value,re&&a7.crossedOut,re&&{color:t.labelSecondary},P&&{color:t.textWarning}]},F)),D.createElement(gj,{style:[a7.time,{color:t.labelSecondary}]},j))):D.createElement(eh,{style:[a7.noReadingsContainer,{backgroundColor:t.bgInputActive}],onPress:K,onLongPress:()=>{"production"!==i7&&ie()}},D.createElement(gj,{style:[a7.noMeasurements,{color:t.labelPrimary}]},e("bg_device_no_measurement")),D.createElement(gj,{style:[a7.buttonText,{color:t.labelBrand}]},e("bg_device_no_measurement_body")))),D.createElement(lz,{isVisible:v,title:e("current_glucose_invalid_high_modal_title",{min:rZ(f,d),max:rZ(p,d)}),buttons:[{testID:"close-button",title:e("button_close"),onPress:()=>{b(!1)}}]}),D.createElement(lz,{isVisible:S,title:e("import_modal_reading_title"),message:e("import_modal_reading_body"),buttons:[{testID:"close-button",title:e("button_close"),onPress:()=>{w(!1)}}]}),D.createElement(lz,{isVisible:k,title:e("new_cal_modal_change_synced_value_title"),onModalHide:q,buttons:[{testID:"change-button",type:dj.Error,title:e("new_cal_modal_change_synced_value_danger_button"),onPress:Z},{testID:"keep-button",type:dj.Secondary,title:e("new_cal_modal_change_synced_value_button"),onPress:()=>{C(!1)}}]}),D.createElement(lz,{isVisible:E,title:e("new_cal_summary_modal_expire_title"),message:e("new_cal_summary_modal_expire_body"),icon:n2,onModalHide:te,onModalShow:()=>{jX(FX.ExpiredGlucose)},buttons:[{title:e("new_cal_summary_modal_expire_button_edit"),onPress:ee},{title:e("button_cancel"),type:dj.Secondary,onPress:J}]}))}),s7=uV?56:48,l7=({onCompleteSwipe:e,testID:t,ref:n})=>{const{t:i}=iV(),{COLORS:r}=bL(),{width:a}=vm(),o=M.useMemo(()=>a-32-64,[a]),s=M.useMemo(()=>o-s7-(uV?3:12),[o]),l=uR(0),u=uR(o);M.useEffect(()=>{u.value=o},[o,u]);const[c,d]=M.useState(0);M.useImperativeHandle(n,()=>({reset:()=>{l.value=aI(100,NE(0)),u.value=aI(100,NE(o))}}));const h=iL.Pan().onUpdate(e=>{const t=Math.max(0,Math.min(e.translationX,s));l.value=t,u.value=o-t}).onEnd(()=>{l.value>=1*s?zk(e)():(l.value=uI(0),u.value=uI(o))}),m=pR(()=>({width:u.value}),[u]);return D.createElement(BR.View,{style:[u7.container,m,{backgroundColor:r.bgSliderCalculator}]},D.createElement(BA,{gesture:h},D.createElement(_a,{style:u7.iconContainer},D.createElement(f2,{testID:t}),D.createElement(gj,{style:[u7.text,{color:r.textSlider,left:(o-c)/2}],onLayout:e=>{const{width:t}=e.nativeEvent.layout;0===c&&d(t)}},i("new_cal_summary_calculate_slider")))))};l7.displayName="SwipeButton";const u7=Ei.create({container:{justifyContent:"center",alignSelf:"flex-end",marginHorizontal:16,borderRadius:42,height:58,shadowOpacity:.12,shadowRadius:8,elevation:6},iconContainer:{alignItems:"center",flexDirection:"row",overflow:"hidden",marginHorizontal:6},text:{position:"absolute",...oj.medium_LG}});const c7=Ei.create({scrollView:{paddingTop:32,paddingHorizontal:32,paddingBottom:130},headerContainer:{flexDirection:"row",gap:4,alignItems:"center",justifyContent:"center",paddingBottom:32},headerText:{...oj.semiBold_Base},invisibleCalculateButton:{position:"absolute",top:0,right:0,width:0,height:0,opacity:0},listItemContainer:{paddingVertical:16,paddingHorizontal:16},listItem:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},listItemLeft:{flexDirection:"row",alignItems:"center"},listItemRight:{alignItems:"flex-end"},listItemTitle:{...oj.regular_SM,marginLeft:8},listItemValue:{...oj.bold_2XL},listItemUnit:{...oj.regular_SM},separatorLine:{width:"100%",height:1},activityIntensityContainer:{alignSelf:"flex-end",paddingHorizontal:12,paddingVertical:8,borderRadius:40,justifyContent:"center",alignItems:"center",marginTop:4},activityIntensityText:{...oj.regular_XS},swipeContainer:{marginTop:64,justifyContent:"center"},smallScreenSwipeContainer:{marginTop:32,justifyContent:"center"},forecastContainer:{flexDirection:"row",alignItems:"center"},forecastIcon:{marginRight:8}}),d7=iF(function(){const{t:e}=iV(),{COLORS:t}=bL(),{navigate:n}=Wp(),i=df(),{height:r}=vm(),a=M.useMemo(()=>r<667,[r]),{glucoseStoreActions:o}=F2(),s=y5(),{manualCarbsInput:l,totalCarbsCartItems:u}=TX(),{selectedEventUUID:c}=C2(),{glucoseUnit:d,activity:h}=Uq;if(void 0===d)throw new Error("[Summary::render] glucoseUnit is undefined");if(void 0===h)throw new Error("[Summary::render] activity is undefined");const m=M.useRef(null),[p,f]=M.useState(!1),[_,g]=M.useState(null),[y,v]=M.useState(!1),[b,S]=M.useState(!1),[w,k]=M.useState(!1),[C,E]=M.useState(!1),I=M.useRef(new uu.Value(0)).current,x=M.useRef(new uu.Value(.8)).current;Yp(M.useCallback(()=>{I.setValue(0),x.setValue(.8),uu.parallel([uu.timing(I,{toValue:1,duration:200,useNativeDriver:!uV,easing:Xl.in(Xl.linear)}),uu.timing(x,{toValue:1,duration:200,useNativeDriver:!uV,easing:Xl.in(Xl.linear)})]).start()},[I,x])),M.useEffect(()=>{const e=()=>{const e=s?.timestamp;e&&Date.now()-e>10*NL.Milliseconds.Minute?(f(!0),o.setSelectedReadingId(null)):f(!1)};e();const t=setInterval(e,1e3);return()=>{clearInterval(t)}},[o,s]);const T=M.useMemo(()=>c?Dq.getByUUID(c):null,[c]),O=M.useCallback(()=>p?(jX(FX.SummaryExpiredGlucose),void k(!0)):null===s?(jX(FX.SummaryEmptyGlucose),void v(!0)):void n(S2.LoadingRecommendation),[s,p,n]);M.useEffect(()=>{i.params?.errorType&&(g(i.params.errorType),m.current?.reset())},[i.params]);const{glucoseDisplayValue:R,glucoseDisplayUnit:A}=M.useMemo(()=>p?{glucoseDisplayValue:null,glucoseDisplayUnit:e("new_cal_summary_expired")}:null!==s?{glucoseDisplayValue:aZ(s.value,s.unit,d),glucoseDisplayUnit:Kq(d).text}:{glucoseDisplayValue:null,glucoseDisplayUnit:"-"},[s,d,p,e]),{activityIntervalDisplay:L,activityIntensityDisplay:P}=M.useMemo(()=>{if(T?.durationSeconds&&T.startTimestamp){return{activityIntervalDisplay:Qq(Math.round(T.durationSeconds/60)),activityIntensityDisplay:T.activityIntensity?tZ[T.activityIntensity]():null}}return{activityIntervalDisplay:null,activityIntensityDisplay:null}},[T]),N=M.useMemo(()=>i.params?.errorType===rV.Sync,[i.params]);return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"summary-scroll-view",scrollEventThrottle:8,contentContainerStyle:c7.scrollView},uV&&D.createElement(eh,{testID:"invisible-calculate-button",onPress:O,style:c7.invisibleCalculateButton}),D.createElement(_a,{style:c7.headerContainer},D.createElement(a2,null),D.createElement(gj,{style:[c7.headerText,{color:t.labelPrimary}]},e("new_cal_summary_title"))),D.createElement(uu.View,{style:{opacity:I,transform:[{scale:x}]}},D.createElement(_a,{style:[c7.listItemContainer,c7.listItem]},D.createElement(_a,{style:c7.listItemLeft},D.createElement(n2,{color:t.labelPrimary,height:24,width:24}),D.createElement(gj,{style:c7.listItemTitle},e("new_cal_summary_glucose_title"))),D.createElement(_a,{style:c7.listItemRight},D.createElement(_a,{style:c7.forecastContainer},"forecast"===s?.source&&D.createElement(s2,{width:20,height:20,style:c7.forecastIcon}),null!==R&&D.createElement(gj,{style:c7.listItemValue},R)),D.createElement(gj,{style:c7.listItemUnit},A))),D.createElement(_a,{style:[c7.separatorLine,{backgroundColor:t.divider}]}),D.createElement(_a,{style:[c7.listItemContainer,c7.listItem]},D.createElement(_a,{style:c7.listItemLeft},D.createElement(W1,{color:t.labelPrimary,height:24,width:24}),D.createElement(gj,{style:c7.listItemTitle},e("new_cal_summary_carb_title"))),D.createElement(_a,{style:c7.listItemRight},D.createElement(gj,{style:c7.listItemValue},Math.round(l+u)),D.createElement(gj,{style:c7.listItemUnit},e("logbook_collum_unit")))),D.createElement(_a,{style:[c7.separatorLine,{backgroundColor:t.divider}]}),D.createElement(_a,{style:c7.listItemContainer},D.createElement(_a,{style:c7.listItem},D.createElement(_a,{style:c7.listItemLeft},D.createElement(e2,null),D.createElement(gj,{style:c7.listItemTitle},e("new_cal_summary_activity_title"))),D.createElement(_a,{style:c7.listItemRight},null!==L&&D.createElement(gj,{style:c7.listItemValue},L),D.createElement(gj,{style:c7.listItemUnit},null!==L?e("new_cal_summary_activity_unit"):"-"))),null!==P&&D.createElement(_a,{style:[c7.activityIntensityContainer,{backgroundColor:t.bgSecondary}]},D.createElement(gj,{style:c7.activityIntensityText},P)))),D.createElement(_a,{style:a?c7.smallScreenSwipeContainer:c7.swipeContainer},D.createElement(l7,{ref:m,onCompleteSwipe:O,testID:"calculate-swipe-button"}))),D.createElement(lz,{isVisible:null!==_,icon:N?c2:void 0,title:e(N?"recommendation_no_save_modal_title":"rejected_input_modal_title"),message:e(N?"recommendation_no_save_modal_body":"rejected_input_modal_body"),buttons:[{title:e("button_close"),onPress:()=>{g(null)}}]}),D.createElement(lz,{isVisible:y,title:e("new_cal_summary_modal_enter_glucose_title"),message:e("new_cal_summary_modal_enter_glucose_body"),icon:n2,onModalHide:()=>{m.current?.reset(),b&&n(S2.GlucoseTab,{editGlucose:RX()}),S(!1)},buttons:[{title:e("new_cal_summary_modal_enter_glucose_button_add"),onPress:()=>{S(!0),v(!1)}},{title:e("button_cancel"),type:dj.Secondary,onPress:()=>{v(!1)}}]}),D.createElement(lz,{isVisible:w,title:e("new_cal_summary_modal_expire_title"),message:e("new_cal_summary_modal_expire_body"),icon:n2,onModalHide:()=>{m.current?.reset(),o.setSelectedReadingId(null),C&&n(S2.GlucoseTab,{editGlucose:RX()}),C&&f(!1),E(!1)},buttons:[{title:e("new_cal_summary_modal_expire_button_edit"),onPress:()=>{E(!0),k(!1)}},{title:e("button_cancel"),type:dj.Secondary,onPress:()=>{k(!1)}}]}))}),h7=e=>d.jsx(D6,{...e}),m7=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{Navigator:n,Screen:i}=p6();return d.jsxs(n,{screenOptions:{...r0,headerStyle:{backgroundColor:t.bgNavigationBar},tabBarHideOnKeyboard:!0,title:e("new_calculation_navigation")},backBehavior:"none",tabBar:h7,children:[d.jsx(i,{name:S2.GlucoseTab,component:o7}),d.jsx(i,{name:S2.CarbsTab,component:X6}),d.jsx(i,{name:S2.ActivityTab,component:H6}),d.jsx(i,{name:S2.SummaryTab,component:d7})]})};function p7(){const{t:e}=iV(),{COLORS:t}=bL(),{Navigator:n,Screen:i}=ZQ();return d.jsxs(n,{screenOptions:{headerShown:!1,...BZ},children:[d.jsx(i,{name:S2.ActiveInsulin,component:U5,options:{...n0,headerStyle:{backgroundColor:t.bgSheet},headerLeft:()=>null,headerRight:q2,title:e("new_calculation_navigation")}}),d.jsx(i,{name:S2.RegisterActiveInsulin,component:H5,options:{...i0,headerStyle:{backgroundColor:t.bgSheet},headerLeft:K2,title:e("recent_insulin_navigation_title"),...YZ}}),d.jsx(i,{name:S2.CalculationBottomTabs,component:m7}),d.jsx(i,{name:S2.LoadingRecommendation,component:k5}),d.jsx(i,{name:S2.Recommendation,component:E5,options:{...n0,headerStyle:{backgroundColor:t.bgSheet},headerShown:!1}}),d.jsx(i,{name:S2.LeavingRecommendation,component:D3})]})}const f7=MX(NL.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MIN,NL.CONSTANTS.ACTIVITY_TARGET_GLUCOSE_MAX),_7=PX(90,250),g7={fromZero:1,fromThirty:.75,fromFortysix:.5,fromSixtyone:null},y7={fromZero:1,fromThirty:.5,fromFortysix:.25,fromSixtyone:null},v7={fromZero:1,fromThirty:.25,fromFortysix:null,fromSixtyone:null},b7={fromZero:1,fromThirty:.5,fromFortysix:.5,fromSixtyone:null};function S7(){return{target:8,light:g7,moderate:y7,hard:v7,post:b7}}const w7=({text:e,learnMoreText:t,learnMoreOnPress:n})=>{const{t:i}=iV(),{COLORS:r}=bL();return M.createElement(_a,{style:[k7.card,{backgroundColor:r.bgSecondary}]},M.createElement(b2,null),M.createElement(_a,{style:k7.rightContainer},M.createElement(gj,{style:[k7.contactText,{color:r.labelPrimary}]},e??i("warning_HCP")),void 0!==t&&void 0!==n&&M.createElement(xc,{onPress:n,style:k7.learnMoreContainer},M.createElement(gj,{style:[k7.learnMoreText,{color:r.textLink}]},t))))},k7=Ei.create({card:{borderRadius:16,paddingHorizontal:16,paddingVertical:12,flexDirection:"row",gap:8},rightContainer:{flex:1,gap:8},learnMoreContainer:{flexDirection:"row",alignItems:"center",gap:4},contactText:{flexShrink:1,...oj.medium_SM},learnMoreText:{flexShrink:1,...oj.semiBold_SM}});function C7({columnDisposition:e,disabled:t=!1,testID:n,children:i,style:r}){const{COLORS:a}=bL();return D.createElement(_a,{testID:n,style:[E7.row,t&&E7.disabledRow,{backgroundColor:a.bgTableOdd},r]},D.Children.map(i,(n,i)=>D.isValidElement(n)?D.cloneElement(n,{disabled:t,cellRatio:e?e[i]:void 0}):null))}const E7=Ei.create({row:{flexDirection:"row",justifyContent:"space-between"},disabledRow:{opacity:.5}});function I7({index:e,columnDisposition:t,disabled:n=!1,testID:i,children:r,style:a}){const{COLORS:o}=bL(),s=M.useCallback(e=>void 0!==e&&e%2?o.bgTableOdd:o.bgTableEven,[o]);return D.createElement(_a,{testID:i,style:[x7.row,{backgroundColor:s(e)},a]},D.Children.map(r,(e,i)=>D.isValidElement(e)?D.cloneElement(e,{disabled:n,cellRatio:t?t[i]:void 0}):null))}const x7=Ei.create({row:{flexDirection:"row",justifyContent:"space-between"}});function T7({columnDisposition:e,disabled:t=!1,testID:n,children:i,style:r}){const{COLORS:a}=bL();return D.createElement(_a,{testID:n,style:[O7.table,{backgroundColor:a.bgSecondary,borderWidth:1,borderColor:a.divider},t&&{backgroundColor:a.bgButtonSecondaryDangerDisabled},r]},(()=>{let n=0;return D.Children.map(i,i=>{if(D.isValidElement(i)){if(i.type===C7){const n=i;return D.cloneElement(n,{disabled:n.props.disabled??t,columnDisposition:e})}if(i.type===I7){const r=i,a=D.cloneElement(r,{disabled:r.props.disabled??t,index:n,columnDisposition:e});return n+=1,a}return D.cloneElement(i)}return null})})())}const O7=Ei.create({table:{borderRadius:16,overflow:"hidden"}});function R7({disabled:e=!1,onPress:t,testID:n,accessibilityLabel:i,accessibilityValue:r,cellRatio:a,children:o,style:s}){const{COLORS:l}=bL();return D.createElement(xc,{disabled:!t||e,onPress:t,style:[A7.cell,{flex:a??1,borderColor:l.divider},s],testID:n,accessibilityRole:"button",accessibilityHint:"Double-tap to set value",accessibilityState:{disabled:e},accessibilityLabel:i,accessibilityValue:{text:r}},D.Children.map(o,t=>{if(D.isValidElement(t)){const n=t;if(e){const e=n.props.style,t=Array.isArray(e)?[...e,{color:l.textTableSecondary}]:[e,{color:l.textTableSecondary}];return D.cloneElement(n,{...n.props,style:t})}return D.cloneElement(n)}return null}))}const A7=Ei.create({cell:{justifyContent:"center",alignItems:"center",borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}});function L7({testID:e,cellRatio:t,children:n,style:i,accessibilityLabel:r,accessibilityValue:a,disabled:o=!1}){const{COLORS:s}=bL();return D.createElement(_a,{style:[P7.cell,{flex:t??1,borderColor:s.divider},i],testID:e,accessible:!0,accessibilityRole:"header",accessibilityState:{disabled:o},accessibilityLabel:r,accessibilityValue:{text:a}},n)}const P7=Ei.create({cell:{justifyContent:"space-between",alignItems:"center",borderTopWidth:1,borderLeftWidth:1,paddingVertical:8}}),M7=[NL.ActivityIntensity.light,NL.ActivityIntensity.moderate,NL.ActivityIntensity.hard],D7=[NL.ActivityReductionIntervals.fromZero,NL.ActivityReductionIntervals.fromThirty,NL.ActivityReductionIntervals.fromFortysix,NL.ActivityReductionIntervals.fromSixtyone],N7={[NL.ActivityReductionIntervals.fromZero]:"0-29",[NL.ActivityReductionIntervals.fromThirty]:"30-45",[NL.ActivityReductionIntervals.fromFortysix]:"46-60",[NL.ActivityReductionIntervals.fromSixtyone]:"61-120"},F7=e=>Math.round(100*(1-e)),B7=e=>null==e?"-":`${F7(e).toString()} %`,j7=e=>Math.round(100*(1-e/100))/100;const V7=iF(function(){const{t:e}=iV(),{COLORS:t}=bL(),{modalStoreActions:n}=j2(),[i,r]=M.useState(!1),[a,o]=M.useState(!1),[s,l]=M.useState(!1),[u,c]=M.useState(null),[d,h]=M.useState(null),[m,p]=M.useState(void 0),{glucoseUnit:f,activity:_}=Uq;if(void 0===f)throw new Error("[ActivitySettings::render] glucoseUnit is not defined");if(void 0===_)throw new Error("[ActivitySettings::render] activity is not defined");const{target:g,post:y,hard:v,light:b,moderate:S}=_,w=M.useMemo(()=>aZ(g,NL.BloodGlucoseUnit.MMOL_L,f),[f,g]),{text:k}=M.useMemo(()=>Kq(f),[f]),C=M.useMemo(()=>({light:b,moderate:S,hard:v}),[b,S,v]),E=M.useMemo(()=>({post:y}),[y]),I=M.useMemo(()=>[{title:e("table_activity_duration"),maxFontSizeMultiplier:lj},{title:tZ.light(),maxFontSizeMultiplier:lj},{title:tZ.moderate(),maxFontSizeMultiplier:lj},{title:tZ.hard(),maxFontSizeMultiplier:lj}],[e]),x=M.useCallback(async()=>{const e={...S7(),target:g,post:y};if(DX(_,e))return;const t=await Uq.setUserSettings({activity:e});p(t)},[_,y,g]),T=M.useCallback(async()=>{const e={hard:v,moderate:S,light:b,target:g,post:S7().post};if(DX(_,e))return;const t=await Uq.setUserSettings({activity:e});p(t)},[_,v,b,S,g]),O=M.useCallback((e,t)=>{c({interval:t,intensity:e}),r(!0)},[r,c]),R=M.useCallback(()=>{c(null),r(!0)},[]),A=M.useCallback(async e=>{if(null===u)throw new Error("[ActivitySettings::updateActivity] pressedTableCell is null");if(j7(e)!==_[u.intensity][u.interval]){const t=JSON.parse(JSON.stringify(_));t[u.intensity][u.interval]=j7(e);const n=await Uq.setUserSettings({activity:t});p(n)}},[_,u]),L=M.useCallback(async e=>{const t=iZ(e,f,NL.BloodGlucoseUnit.MMOL_L);if(t!==_.target){const e=JSON.parse(JSON.stringify(_));e.target=t;const n=await Uq.setUserSettings({activity:e});p(n)}},[_,f]),P=M.useCallback(async e=>{u?await A(e):await L(e),r(!1)},[u,A,L]),N=M.useMemo(()=>{if(null===u){return f===NL.BloodGlucoseUnit.MMOL_L?f7:_7}return PX(0,75)},[u,f]),F=M.useMemo(()=>{if(null===u){const e=aZ(g,NL.BloodGlucoseUnit.MMOL_L,f);return N.findIndex(t=>t===e)}const e=_[u.intensity][u.interval];return 0===e?0:e?F7(e):75},[u,_,g,f,N]),B=M.useCallback(()=>{!1===m&&n.set({showSyncErrorModal:!0}),p(void 0)},[m,n]);return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"settings-activity-scroll",style:H7.scrollView,contentContainerStyle:H7.scrollViewContent},D.createElement(w7,{text:e("physical_activity_hcp_card_body"),learnMoreText:e("physical_activity_hcp_card_button"),learnMoreOnPress:()=>{l(!0)}}),D.createElement(T7,null,D.createElement(_a,{style:[H7.tableDescripContainer,{borderBottomColor:t.divider}]},D.createElement(gj,{style:[H7.title,{color:t.labelPrimary}],accessibilityRole:"header"},e("physical_activity_target_title")),D.createElement(gj,{style:[H7.subtitle,{color:t.labelSecondary}]},e("physical_activity_target_body"))),D.createElement(kj,{title:e("target_activity_input"),value:`${w} ${k}`,testID:"activity-target",onPress:R,valueStyle:{color:t.labelBrand}})),D.createElement(T7,{columnDisposition:[1,1,1,1]},D.createElement(_a,{style:[H7.tableDescripContainer,{borderBottomColor:t.divider}]},D.createElement(gj,{style:[H7.title,{color:t.labelPrimary}],accessibilityRole:"header"},e("target_activity_reduction_title")),D.createElement(gj,{style:[H7.subtitle,{color:t.labelSecondary}]},e("target_activity_reduction_body"))),D.createElement(C7,null,I.map((e,n)=>D.createElement(L7,{key:e.title,style:[0===n&&H7.tableFirstCell,H7.noTopBorder]},D.createElement(gj,{style:[H7.tableHeaderTitle,{color:t.labelPrimary}],maxFontSizeMultiplier:e.maxFontSizeMultiplier},e.title)))),D7.map(n=>D.createElement(I7,{key:n},D.createElement(R7,{style:H7.tableFirstCell},D.createElement(gj,{style:[H7.tableInterval,{color:t.labelPrimary}]},N7[n]),D.createElement(gj,{style:[H7.minutes,{color:t.textTableSecondary}]},e("activity_settings_table_min"))),M7.map(e=>D.createElement(R7,{key:`${n}-${e}`,testID:`settings-activity-${e}-${n}`,onPress:()=>{O(e,n)}},D.createElement(gj,{style:[H7.tablePercentage,{color:t.textTableHighlight}]},B7(C[e][n])))))),D.createElement(xc,{style:[H7.resetContainer,{backgroundColor:t.bgButtonSecondaryDanger,borderColor:t.divider}],onPress:()=>{h("during"),o(!0)},testID:"restore-default-activity-settings-during"},D.createElement(gj,{style:[H7.resetText,{color:t.textButtonSecondaryDanger}]},e("button_reset_default")))),D.createElement(T7,null,D.createElement(_a,{style:[H7.tableDescripContainer,{borderBottomWidth:0}]},D.createElement(gj,{style:[H7.title,{color:t.labelPrimary}],accessibilityRole:"header"},e("target_activity_reduction_after_title")),D.createElement(gj,{style:[H7.subtitle,{color:t.labelSecondary}]},e("target_activity_reduction_after_body"))),D7.map(n=>D.createElement(I7,{key:`post-${n}`},D.createElement(R7,{style:[H7.tableFirstCell,H7.noLeftBorder]},D.createElement(gj,{style:H7.tableInterval},N7[n]),D.createElement(gj,{style:[H7.minutes,{color:t.textTableSecondary}]},e("activity_settings_table_min"))),D.createElement(R7,{testID:`settings-activity-post-${n}`,onPress:()=>{O("post",n)}},D.createElement(gj,{style:[H7.tablePercentage,{color:t.textTableHighlight}]},B7(E.post[n]))))),D.createElement(xc,{style:[H7.resetContainer,{backgroundColor:t.bgButtonSecondaryDanger,borderColor:t.divider}],onPress:()=>{h("after"),o(!0)},testID:"restore-default-activity-settings-after"},D.createElement(gj,{style:[H7.resetText,{color:t.textButtonSecondaryDanger}]},e("button_reset_default"))))),D.createElement(n3,{initialScrollIndex:F,isVisible:i,onCancel:()=>{r(!1)},onConfirm:P,items:N,onModalHide:B,testID:"activity-wheel-picker"}),D.createElement(lz,{title:e("physical_activity_modal_reset_title "),isVisible:a,onModalHide:B,buttons:[{title:e("button_reset"),type:dj.Error,onPress:async()=>{"after"===d?await T():await x(),o(!1)}},{title:e("button_cancel"),type:dj.Secondary,onPress:()=>{o(!1)}}]}),D.createElement(lz,{isVisible:s,enableScroll:!0,buttons:[{title:e("button_close"),onPress:()=>{l(!1)},style:H7.activityInfoModalButton}]},D.createElement(N6,null)),D.createElement(V0,{onModalHide:()=>{p(void 0)}}))}),H7=Ei.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32,paddingVertical:32},tableDescripContainer:{padding:16,borderBottomWidth:1},title:{...oj.semiBold_Base,marginBottom:8},subtitle:{...oj.regular_SM},tableFirstCell:{paddingLeft:16,paddingVertical:12,borderLeftWidth:0},resetText:{...oj.semiBold_Base,textAlign:"center"},resetContainer:{alignItems:"center",padding:16,borderTopWidth:1},tableHeaderTitle:{...oj.medium_SM},minutes:{...oj.regular_XS},tableInterval:{...oj.medium_Base},tablePercentage:{...oj.medium_Base},activityInfoModalButton:{marginTop:32},noTopBorder:{borderTopWidth:0,paddingVertical:16},noLeftBorder:{borderLeftWidth:0}}),z7=Array.from({length:60},(e,t)=>t.toString().padStart(2,"0"));const U7=D.memo(function({isVisible:e,initialValue:t,min:n,max:i,onCancel:r,onConfirm:a,onModalHide:o}){const{COLORS:s}=bL(),{width:l}=vm(),u=M.useRef(null),c=M.useRef(null),d=M.useMemo(()=>{const e=[],t=i?aX("59","mm",new Date(i)):aX("23:59","HH:mm",new Date);let r=n?aX("00","mm",new Date(n)):aX("00:00","HH:mm",new Date);for(;c$(r,t)||lX(r,t);)e.push(r),r=rY(r,1);return e},[i,n]),h=M.useMemo(()=>d.map(e=>e.getHours().toString().padStart(2,"0"),[]),[d]),[m,p]=M.useState(t),f=function(e){const t=M.useRef(void 0);return M.useEffect(()=>{t.current=e},[e]),t.current}(e);M.useEffect(()=>{!f&&e&&p(t)},[f,e,t]);const _=M.useMemo(()=>d.findIndex(e=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()&&e.getHours()===t.getHours()),[d,t]),g=M.useMemo(()=>{const[,e]=o$(t,"HH:mm").split(":");return z7.indexOf(e)},[t]),y=M.useMemo(()=>d.findIndex(e=>e.getFullYear()===m.getFullYear()&&e.getMonth()===m.getMonth()&&e.getDate()===m.getDate()&&e.getHours()===m.getHours()),[d,m]),v=M.useMemo(()=>{const[,e]=o$(m,"HH:mm").split(":");return z7.indexOf(e)},[m]),b=M.useMemo(()=>n?0:null,[n]),S=M.useMemo(()=>i?d.length-1:null,[i,d]),w=M.useMemo(()=>{if(!n)return null;const[,e]=o$(n,"HH:mm").split(":");return z7.indexOf(e)},[n]),k=M.useMemo(()=>{if(!i)return null;const[,e]=o$(i,"HH:mm").split(":");return z7.indexOf(e)},[i]),C=M.useCallback(()=>{a(m)},[a,m]),E=M.useCallback(()=>{p(t),r()},[r,t]),I=M.useCallback((e,r)=>{if(e<0||r<0||e>=d.length||r>=z7.length)return;const a=`${d[e].getHours()}:${z7[r]}`;if(!n||!i){const e=aX(a,"HH:mm",new Date(t));return void p(e)}const o=d[e],s=aX(a,"HH:mm",new Date(o));p(s)},[n,i,d,t]),x=M.useCallback(e=>{c.current?.scrollToIndex(e)},[]),T=M.useCallback(e=>{null!==S&&null!==b&&null!==k&&null!==w?e===b&&v<w?(I(e,w),x(w)):e===S&&v>k?(I(e,k),x(k)):I(e,v):I(e,v)},[S,b,k,w,I,v,x]),O=M.useCallback(e=>{null!==S&&null!==b&&null!==k&&null!==w?y===b&&e<w?(I(y,w),x(w)):y===S&&e>k?(I(y,k),x(k)):I(y,e):I(y,e)},[I,S,k,b,w,x,y]);return D.createElement(lz,{isVisible:e,containerStyle:{backgroundColor:s.bgTransparent},onModalHide:o},D.createElement(_a,null,D.createElement(_a,{style:G7.pickersContainer},D.createElement(t3,{testID:"hours_wheel_picker",key:"hours-wheel-picker",ref:u,initialScrollIndex:_,options:h,onChange:T,containerStyle:[G7.itemContainerLeft,{width:(l-32)/2}],selectedIndicatorStyle:[G7.selectedIndicatorLeft,{width:(l-32)/2-10}],itemStyle:G7.itemLeft}),D.createElement(t3,{testID:"minutes_wheel_picker",key:"minutes-wheel-picker",ref:c,initialScrollIndex:g,options:z7,onChange:O,containerStyle:[G7.itemContainerRight,{width:(l-32)/2}],selectedIndicatorStyle:[G7.selectedIndicatorRight,{width:(l-32)/2-10}],itemStyle:G7.itemRight})),D.createElement(_a,{style:G7.buttonContainer},D.createElement($0,{onPress:C}),D.createElement(W0,{onPress:E}))))}),G7=Ei.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:"row",borderTopLeftRadius:13,borderTopRightRadius:13,overflow:"hidden"},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:16},itemContainerRight:{borderTopLeftRadius:0,paddingRight:16},itemLeft:{alignSelf:"flex-end",marginRight:16},itemRight:{alignSelf:"flex-start",marginLeft:16},selectedIndicatorRight:{alignSelf:"flex-start",borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorLeft:{alignSelf:"flex-end",borderTopRightRadius:0,borderBottomRightRadius:0}});const W7=(e,t)=>({startTime:e.startTime,target:aZ(e.target,NL.BloodGlucoseUnit.MMOL_L,t)}),Y7=(e,t)=>{const n=e.startTime;let i=parseFloat(e.target);return i=iZ(i,t,NL.BloodGlucoseUnit.MMOL_L),{startTime:n,target:i}},$7=(e,t)=>e.map(e=>Y7(e,t));const X7=iF(function(){const{t:e}=iV(),{COLORS:t}=bL(),{modalStoreActions:n}=j2(),i=Wp(),[r,a]=M.useState(),[o,s]=M.useState(void 0),[l,u]=M.useState(!1),[c,d]=M.useState(!1),[h,m]=M.useState(!1),[p,f]=M.useState(),_=Uq.glucoseUnit;if(void 0===_)throw new Error("[GlucoseSettings::render] glucoseUnit is undefined.");const g=Uq.glucoseLevelTargets;if(void 0===g)throw new Error("[GlucoseSettings::render] parameters from userSettings must be defined and non-null.");const y=g.targetBGLIntervals;if(!y)throw new Error("[GlucoseSettings::render] parameters from userSettings must be defined and non-null.");const v=g.overallTargetBGL;if(!v)throw new Error("[GlucoseSettings::render] parameters from userSettings must be defined and non-null.");const b=g.use===NL.Usage.Overall,S=((e,t)=>e.map(e=>W7(e,t)))(y,_),w=W7(v,_),k=M.useCallback(e=>{d(!0),f(e)},[]),C=M.useCallback(async()=>{const e=[{startTime:"00:00",target:8},{startTime:"05:00",target:6},{startTime:"09:00",target:7},{startTime:"11:00",target:6},{startTime:"13:00",target:7},{startTime:"18:00",target:6},{startTime:"22:00",target:8}],t={startTime:"00:00",target:6},n={...g,targetBGLIntervals:e},i={...g,overallTargetBGL:t},r=b?i:n;if(b?!DX(g.overallTargetBGL,t):!DX(g.targetBGLIntervals,e)){const e=await Uq.setUserSettings({glucoseLevelTargets:r});s(e)}m(!1)},[g,b]),E=M.useCallback(async e=>{if(e!==parseFloat(w.target)){const t={...w};t.target=e.toString();const n=Y7(t,_),i={glucoseLevelTargets:{...g,overallTargetBGL:n}},r=await Uq.setUserSettings(i);s(r)}},[_,w,g]),I=M.useCallback(async e=>{if(void 0!==p&&e!==parseFloat(S[p].target)){const t=[...S],n={...t[p]};n.target=e.toString(),t[p]=n;const i=$7(t,_),r={glucoseLevelTargets:{...g,targetBGLIntervals:i}},a=await Uq.setUserSettings(r);s(a)}},[p,S,_,g]),x=M.useCallback(async e=>{b?await E(e):await I(e),d(!1)},[b,E,I]),T=M.useCallback(async()=>{const e=!b,t={glucoseLevelTargets:{...g,use:e?NL.Usage.Overall:NL.Usage.Intervals}},i=await Uq.setUserSettings(t);n.set({showSyncErrorModal:!i})},[b,g,n]),O=M.useMemo(()=>Kq(_).text,[_]),R=M.useMemo(()=>{const e=_===NL.BloodGlucoseUnit.MMOL_L,{min:t,max:n}=e?{min:NL.CONSTANTS.TARGET_GLUCOSE_MIN,max:NL.CONSTANTS.TARGET_GLUCOSE_MAX}:{min:79,max:180};return _===NL.BloodGlucoseUnit.MG_DL?PX(t,n):MX(t,n)},[_]),A=M.useMemo(()=>void 0===p?0:b?R.indexOf(w.target):R.indexOf(S[p].target),[p,b,R,S,w.target]),L=M.useCallback(e=>{const t=S[(e-1+S.length)%S.length].startTime,n=S[(e+1+S.length)%S.length].startTime,i=aX(S[e].startTime,"HH:mm",new Date),r=aX(t,"HH:mm",new Date),o=aX(n,"HH:mm",new Date);c$(i,r)&&c$(i,o)?a({current:i,min:mY(cX(r,1),1),max:fX(o)}):u$(i,r)&&u$(i,o)?a({current:i,min:mY(r,1),max:fX(nY(o,1))}):a({current:i,min:mY(r,1),max:fX(o)}),u(!0),f(e)},[S]),P=M.useCallback(async e=>{if(void 0===p)return;const t=o$(e,"HH:mm");if(t!==S[p].startTime){const e=[...S],n={...e[p]};n.startTime=t,e[p]=n;const i=$7(e,_),r={glucoseLevelTargets:{...g,targetBGLIntervals:i}},a=await Uq.setUserSettings(r);s(a)}u(!1)},[p,S,_,g]),N=M.useCallback(()=>{u(!1)},[]),F=M.useCallback(()=>{d(!1)},[]),B=M.useCallback(()=>{!1===o&&n.set({showSyncErrorModal:!0}),s(void 0)},[n,o]);return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"settings-glucose-scrollview",style:q7.scrollView,contentContainerStyle:q7.scrollViewContent},D.createElement(w7,null),D.createElement(kj,{title:e("glucose_input"),value:O,testID:"glucose-change",onPress:()=>{i.navigate(S2.GlucoseUnit)},renderRightSlot:()=>D.createElement(K1,null)}),D.createElement(T7,{columnDisposition:[1,2]},D.createElement(uz,{title:e("fixed_input_title"),message:e("fixed_input_body"),value:b,testID:"settings-glucose-overall-switch",onValueChange:T,style:q7.switchContainer}),D.createElement(C7,{disabled:!b,testID:"settings-glucose-overall-header"},D.createElement(L7,{style:q7.tableFirstCell,testID:"settings-glucose-overall-header-time"},D.createElement(gj,{style:[q7.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:uj},e("table_fixed_time"))),D.createElement(L7,{testID:"settings-glucose-overall-header-target"},D.createElement(gj,{style:[q7.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:uj},e("table_fixed_target")),D.createElement(gj,{style:[q7.headerSubtitle,{color:t.textTableSecondary}]},O))),D.createElement(I7,{disabled:!b},D.createElement(R7,{style:q7.tableFirstCell},D.createElement(gj,{style:[q7.subtitle,{color:t.textTableActive}]},e("table_fixed_all_day "))),D.createElement(R7,{onPress:()=>{k(0)}},D.createElement(gj,{style:[q7.fixedValueTitle,{color:t.textTableHighlight}],testID:"settings-glucose-overall-all-day-target"},w.target))),D.createElement(xc,{style:[q7.resetContainer,{borderColor:t.divider}],disabled:!b,onPress:()=>{m(!0)}},D.createElement(gj,{style:[q7.resetText,b?{color:t.textButtonSecondaryDanger}:{color:t.textButtonSecondaryDangerDisabled}]},e("button_reset_default")))),D.createElement(T7,{columnDisposition:[1,2]},D.createElement(uz,{title:e("table_variable_title"),message:e("table_variable_body"),value:!b,testID:"daily-interval-switch",onValueChange:T,style:q7.switchContainer}),D.createElement(C7,{disabled:b,testID:"settings-glucose-variable-header"},D.createElement(L7,{style:q7.tableFirstCell,testID:"settings-glucose-variable-header-time"},D.createElement(gj,{style:[q7.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:uj},e("table_variable_time")),D.createElement(gj,{style:[q7.headerSubtitle,{color:t.textTableSecondary}]},e("table_variable_time_unit"))),D.createElement(L7,{testID:"settings-glucose-variable-header-target"},D.createElement(gj,{style:[q7.headerTitle,{color:t.textTableActive}],maxFontSizeMultiplier:sj},e("table_fixed_target")),D.createElement(gj,{style:[q7.headerSubtitle,{color:t.textTableSecondary}]},O))),S.map((e,n)=>D.createElement(I7,{key:e.startTime,disabled:b},D.createElement(R7,{style:q7.tableFirstCell,onPress:()=>{L(n)}},D.createElement(gj,{style:[q7.title,{color:t.textTableHighlight}]},e.startTime),D.createElement(gj,{style:[q7.subtitle,{color:t.textTableSecondary}]},sV[Object.keys(oV)[n]]())),D.createElement(R7,{onPress:()=>{k(n)}},D.createElement(gj,{style:[q7.title,{color:t.textTableHighlight}],testID:`settings-glucose-variable-target-${Object.keys(oV)[n].toLowerCase()}`},e.target)))),D.createElement(xc,{style:[q7.resetContainer,{borderColor:t.divider}],disabled:b,onPress:()=>{m(!0)}},D.createElement(gj,{style:[q7.resetText,b?{color:t.textButtonSecondaryDangerDisabled}:{color:t.textButtonSecondaryDanger}]},e("button_reset_default"))))),D.createElement(n3,{isVisible:c,items:R,onConfirm:x,onCancel:F,initialScrollIndex:A,onModalHide:B,testID:"settings-glucose-target-wheel-picker"}),D.createElement(U7,{isVisible:l,initialValue:r?.current??new Date,min:r?.min,max:r?.max,onConfirm:P,onCancel:N,onModalHide:B}),D.createElement(lz,{isVisible:h,title:e("physical_activity_modal_reset_title "),onModalHide:B,buttons:[{title:e("button_reset"),type:dj.Error,onPress:C},{title:e("button_cancel"),type:dj.Secondary,onPress:()=>{m(!1)}}]}),D.createElement(V0,{onModalHide:()=>{s(void 0)}}))}),q7=Ei.create({scrollView:{paddingHorizontal:16},scrollViewContent:{flexGrow:1,gap:32,paddingVertical:32},tableFirstCell:{alignItems:"flex-start",paddingLeft:16,borderLeftWidth:0},resetContainer:{alignItems:"center",padding:16,borderTopWidth:1},resetText:{...oj.semiBold_Base,textAlign:"center"},headerTitle:{...oj.medium_SM},headerSubtitle:{...oj.medium_XS},title:{...oj.medium_Base},fixedValueTitle:{...oj.medium_Base,paddingVertical:8},subtitle:{...oj.regular_XS},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}}),Z7=e=>{const{t:t}=iV(),{COLORS:n}=bL(),{glucoseUnit:i,isError:r,onPressMGDL:a,onPressMMOLL:o}=e;console.log("🔥 glucoseUnit",i);const s=i===NL.BloodGlucoseUnit.MMOL_L,l=i===NL.BloodGlucoseUnit.MG_DL;return D.createElement(_a,{style:K7.unitsContainer},D.createElement(xc,{testID:`mmoll-button-${s}`,onPress:o,style:[K7.unitButton,{backgroundColor:s?n.bgSegmentPrimary:n.bgInputActive},r&&{borderWidth:2,borderColor:n.borderInputDanger}],accessibilityRole:"button",accessibilityState:{selected:s}},D.createElement(gj,{style:[K7.unitText,{color:s?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("glucose_unit_mmol/l")),D.createElement(gj,{style:[K7.exampleText,{color:s?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("example")),D.createElement(gj,{style:[K7.unitExampleText,{color:s?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("glucose_unit_example_mmol/L"))),D.createElement(xc,{testID:`mgdl-button-${l}`,onPress:a,style:[K7.unitButton,{backgroundColor:l?n.bgSegmentPrimary:n.bgInputActive},r&&{borderWidth:2,borderColor:n.borderInputDanger}],accessibilityRole:"button",accessibilityState:{selected:l}},D.createElement(gj,{style:[K7.unitText,{color:l?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("glucose_unit_mg/dl")),D.createElement(gj,{style:[K7.exampleText,{color:l?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("example")),D.createElement(gj,{style:[K7.unitExampleText,{color:l?n.textLabelActive:n.textLabelInactive}],maxFontSizeMultiplier:sj},t("glucose_unit_example_mg/dl"))))},K7=Ei.create({unitsContainer:{flexDirection:"row",justifyContent:"space-between",gap:12},unitButton:{flex:1,paddingHorizontal:14,paddingVertical:10,borderRadius:16},unitText:{...oj.medium_Base,marginBottom:8},exampleText:{...oj.medium_XS,marginBottom:4},unitExampleText:{...oj.regular_XS}}),Q7=Ei.create({container:{paddingHorizontal:16,paddingTop:32}}),J7=iF(()=>{const{modalStoreActions:e}=j2(),t=M.useCallback(async t=>{if(t===Uq.glucoseUnit)return;const n=await Uq.setUserSettings({bloodGlucoseUnits:t});e.set({showSyncErrorModal:!n})},[e]);return D.createElement(D.Fragment,null,D.createElement(_a,{style:Q7.container},D.createElement(Z7,{onPressMMOLL:()=>t(NL.BloodGlucoseUnit.MMOL_L),onPressMGDL:()=>t(NL.BloodGlucoseUnit.MG_DL),glucoseUnit:Uq.glucoseUnit})),D.createElement(V0,null))}),e8=()=>{const{t:e}=iV(),{COLORS:t}=bL(),n=Wp();return M.createElement(Xa,{contentContainerStyle:t8.scrollView,testID:"legal-page-scrollview"},M.createElement(gj,{style:t8.title},e("legal_title")),M.createElement(_a,{style:t8.section},M.createElement(u2,{testID:"manufacturer-symbol",color:t.bgPrimary}),M.createElement(gj,{style:[t8.textContainer,{color:t.labelSecondary}]},"2025-11-14")),M.createElement(_a,{style:t8.section},M.createElement(l2,{testID:"manual-icon"}),M.createElement(gj,{testID:"manual-button",style:[t8.manualText,{color:t.textLink}],onPress:()=>{jX(FX.SettingsIFU),n.navigate(S2.IFU)}},e("legal_IFU"))),M.createElement(_a,{style:t8.section},M.createElement(p2,{testID:"SN-symbol"}),M.createElement(gj,{style:[t8.textContainer,{color:t.labelSecondary}]},NX)),M.createElement(_a,{style:t8.section},M.createElement(Y1,{testID:"ce-logo"}),M.createElement(gj,{style:[t8.alignTop,{color:t.labelSecondary}]},e("legal_ce_mark_text"))),M.createElement(_a,{style:t8.section},M.createElement(u2,{color:t.labelPrimary}),M.createElement(_a,{style:t8.textContainer},M.createElement(gj,{style:[t8.sectionTitle,{color:t.labelSecondary}]},e("legal_company_name")),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_company_adress")),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_company_country")),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_company_email")),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_company_cvr_vat")))),M.createElement(_a,{style:[t8.section,t8.udiSection]},M.createElement(g2,{testID:"udi-logo",style:t8.udiLogo}),M.createElement(gj,{style:[t8.textContainer,t8.udiText,{color:t.labelSecondary}]},M.createElement(gj,{style:{color:t.labelSecondary}},"(01)05700002209597(10)"),M.createElement(gj,{style:{color:t.labelSecondary}},`${NX}(8012)${NX}`))),M.createElement(_a,{style:t8.sectionColumn},M.createElement(y2,{testID:"uk-rep-logo",style:t8.repIcon}),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_ukrep")),M.createElement(gj,{style:{color:t.labelSecondary}},e("united_kingdom")),M.createElement(gj,{style:{color:t.labelSecondary}},e("legal_ukrep1"))),null)},t8=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16},title:{...oj.regular_SM,textAlign:"center",marginBottom:32},section:{flexDirection:"row",marginBottom:32},sectionTitle:{...oj.medium_Base},textContainer:{flex:1,marginLeft:20,alignSelf:"center"},alignTop:{flex:1,marginLeft:20,alignSelf:"flex-start"},sectionColumn:{marginBottom:32},repIcon:{marginBottom:12},manualText:{...oj.medium_Base,marginLeft:20,alignSelf:"center"},udiSection:{flexWrap:"wrap",marginBottom:20},udiLogo:{marginRight:20,marginBottom:12},udiText:{marginLeft:0,marginBottom:12,display:"flex",flexWrap:"wrap"}}),n8=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{navigate:n}=Wp(),i=M.useCallback(async()=>{if(uV)n(S2.SupportContact);else{const e="support@hedia.com",t="Hedia support",n=`App version: ${NX}\n${L6({defaultValue:"unknown",supportedPlatforms:["ios","android","windows"],memoKey:"systemName",getter:()=>lr.select({ios:R6.systemName,android:"Android",windows:"Windows",default:"unknown"})})} version: ${L6({defaultValue:"unknown",getter:()=>R6.systemVersion,supportedPlatforms:["android","ios","windows"],memoKey:"systemVersion"})}`;await Vu.openURL(`mailto:${e}?subject=${t}&body=${n}`)}},[n]);return D.createElement(Xa,{contentContainerStyle:i8.wrapper},D.createElement(gj,{style:[i8.title,{color:t.labelPrimary}]},e("support_title")),D.createElement(_a,{style:i8.buttons},D.createElement(mj,{title:e("button_email"),onPress:i,testID:"send_email_button"}),D.createElement(mj,{title:e("button_support_page"),onPress:()=>{n(S2.SupportWebView)},testID:"open_support_page_button",type:dj.Secondary}),D.createElement(mj,{title:e("button_instructions"),onPress:()=>{jX(FX.SettingsIFU),n(S2.IFU)},testID:"open_ifu_page_button",type:dj.Secondary})))},i8=Ei.create({wrapper:{flex:1,justifyContent:"center",paddingHorizontal:16},title:{...oj.bold_3XL,marginBottom:48,textAlign:"center"},buttons:{gap:16}}),r8=Ei.create({container:{marginHorizontal:16,marginTop:32},checkmarkContainer:{width:24,height:24}}),a8=iF(()=>{const{t:e}=iV(),{isOnboardingFinished:t}=qz(),{biologicalSex:n}=U2(),{setSetupCalculatorStoreValues:i}=z2(),{modalStoreActions:r}=j2(),a=t?Uq.biologicalSex:n,o=M.useCallback(async e=>{if(a!==e)if(t){await Uq.setUserSettings({biologicalSex:e})||r.set({showSyncErrorModal:!0})}else i({biologicalSex:e})},[a,t,r,i]);return D.createElement(_a,{testID:"biological-sex",style:r8.container},D.createElement(kj.Container,null,D.createElement(kj,{testID:"biological_sex_male",title:e("general_input_sex_option_male"),renderRightSlot:()=>D.createElement(_a,{style:r8.checkmarkContainer},a===NL.BiologicalSex.Male?D.createElement($1,null):null),onPress:()=>o(NL.BiologicalSex.Male)}),D.createElement(kj,{testID:"biological_sex_female",title:e("general_input_sex_option_female"),renderRightSlot:()=>D.createElement(_a,{style:r8.checkmarkContainer},a===NL.BiologicalSex.Female?D.createElement($1,null):null),onPress:()=>o(NL.BiologicalSex.Female)}),D.createElement(kj,{testID:"biological_sex_no_answer",title:e("biological_sex_no_answer"),renderRightSlot:()=>D.createElement(_a,{style:r8.checkmarkContainer},a===NL.BiologicalSex.Unspecified?D.createElement($1,null):null),onPress:()=>o(NL.BiologicalSex.Unspecified)})),D.createElement(V0,null))}),o8=Ei.create({container:{marginHorizontal:16,marginTop:32},checkmarkContainer:{width:24,height:24}}),s8=iF(()=>{const{t:e}=iV(),{modalStoreActions:t}=j2(),n=Uq.diabetesType,[i,r]=M.useState(!1),a=M.useCallback(async e=>{if(n===e)return;await Uq.setUserSettings({diabetesType:e})?e===NL.DiabetesType.Type2&&r(!0):t.set({showSyncErrorModal:!0})},[n,t]),o=M.useCallback(()=>{r(!1)},[]);return D.createElement(D.Fragment,null,D.createElement(_a,{style:o8.container},D.createElement(kj.Container,null,D.createElement(kj,{title:e("type_of_diabetes_type1"),renderRightSlot:()=>D.createElement(_a,{style:o8.checkmarkContainer},n===NL.DiabetesType.Type1?D.createElement($1,null):null),onPress:()=>a(NL.DiabetesType.Type1)}),D.createElement(kj,{title:e("type_of_diabetes_type2"),renderRightSlot:()=>D.createElement(_a,{style:o8.checkmarkContainer},n===NL.DiabetesType.Type2?D.createElement($1,null):null),onPress:()=>a(NL.DiabetesType.Type2)}))),D.createElement(lz,{title:e("modal_diabetes2_title"),isVisible:i,message:e("modal_diabetes2_body"),buttons:[{title:e("button_close"),onPress:o}]}),D.createElement(V0,null))}),l8=(e,t)=>l$(new Date(e,t)),u8=(()=>{const e=(new Date).getFullYear();return[...Array(12).keys()].map(t=>o$(new Date(e,t),"MMM"))})(),c8=Array.from({length:31},(e,t)=>(t+1).toString().padStart(2,"0")),d8=(()=>{const e=(new Date).getFullYear()-1900+1,t=Array.from({length:e},(e,t)=>(t+1900).toString());return t})();const h8=D.memo(function({isVisible:e,initialValue:t,onCancel:n,onConfirm:i,onModalHide:r}){const{COLORS:a}=bL(),{width:o}=vm(),s=M.useRef(null),l=M.useRef(null),u=M.useRef(null),[c,d]=M.useState(t);M.useEffect(()=>{e&&d(e=>e.getTime()===t.getTime()?e:new Date(t))},[t,e]);const h=M.useMemo(()=>t.getDate()-1,[t]),m=M.useMemo(()=>t.getMonth(),[t]),p=M.useMemo(()=>{const e=t.getFullYear();return d8.indexOf(e.toString())},[t]),f=M.useMemo(()=>c.getDate()-1,[c]),_=M.useMemo(()=>c.getMonth(),[c]),g=M.useMemo(()=>c.getFullYear(),[c]),y=M.useCallback(()=>{i(c)},[i,c]),v=M.useCallback(()=>{d(t),n()},[n,t]),b=M.useCallback(e=>{const t=l8(g,e)-1,n=Math.min(f,t),i=new Date(g,e,n+1);d(i),f>t&&s.current?.scrollToIndex(t)},[f,g]),S=M.useCallback(e=>{const t=l8(g,_)-1,n=Math.min(e,t),i=new Date(g,_,n+1);d(i),e>t&&s.current?.scrollToIndex(t)},[_,g]),w=M.useCallback(e=>{const t=parseInt(d8[e],10),n=l8(t,_)-1,i=Math.min(f,n),r=new Date(t,_,i+1);d(r),f>n&&s.current?.scrollToIndex(n)},[f,_]);return D.createElement(lz,{isVisible:e,containerStyle:{backgroundColor:a.bgTransparent},onModalHide:r},D.createElement(_a,null,D.createElement(_a,{style:m8.pickersContainer},D.createElement(t3,{key:"months-wheel-picker",ref:l,initialScrollIndex:m,options:u8,onChange:b,containerStyle:[m8.itemContainerLeft,{width:(o-32)/3}],selectedIndicatorStyle:[m8.selectedIndicatorLeft,{width:(o-32)/3-10}],itemStyle:m8.itemLeft,testID:"months-wheel-picker"}),D.createElement(t3,{key:"days-wheel-picker",ref:s,initialScrollIndex:h,options:c8,onChange:S,containerStyle:[m8.itemContainerCenter,{width:(o-32)/3}],selectedIndicatorStyle:[m8.selectedIndicatorCenter,{width:(o-32)/3}],itemStyle:m8.itemCenter,testID:"days-wheel-picker"}),D.createElement(t3,{key:"years-wheel-picker",ref:u,initialScrollIndex:p,options:d8,onChange:w,containerStyle:[m8.itemContainerRight,{width:(o-32)/3}],selectedIndicatorStyle:[m8.selectedIndicatorRight,{width:(o-32)/3-10}],itemStyle:m8.itemRight,testID:"years-wheel-picker"})),D.createElement(_a,{style:m8.buttonContainer},D.createElement($0,{onPress:y}),D.createElement(W0,{onPress:v}))))}),m8=Ei.create({buttonContainer:{gap:8},pickersContainer:{flexDirection:"row",borderTopLeftRadius:13,borderTopRightRadius:13,overflow:"hidden"},itemContainerLeft:{borderTopRightRadius:0,paddingLeft:8},itemContainerCenter:{borderTopLeftRadius:0,borderTopRightRadius:0},itemContainerRight:{borderTopLeftRadius:0,paddingRight:8},itemLeft:{alignSelf:"flex-end"},itemCenter:{alignSelf:"center"},itemRight:{alignSelf:"flex-start"},selectedIndicatorRight:{alignSelf:"flex-start",borderTopLeftRadius:0,borderBottomLeftRadius:0},selectedIndicatorCenter:{alignSelf:"center",borderRadius:0},selectedIndicatorLeft:{alignSelf:"flex-end",borderTopRightRadius:0,borderBottomRightRadius:0}}),p8=PX(50,220),f8=PX(35,300);const _8=iF(function(){const{t:e}=iV(),{modalStoreActions:t}=j2(),n=Wp(),{bottom:i}=pH(),[r,a]=M.useState(!1),[o,s]=M.useState(!1),[l,u]=M.useState(!1),[c,d]=M.useState(!1),[h,m]=M.useState(void 0),[p,f]=M.useState(!1),{birthDate:_,diabetesType:g,biologicalSex:y,weightKg:v,heightCm:b}=Uq;if(void 0===g)throw new Error("[AboutSection::render] diatbetesType must be defined.");const S=M.useMemo(()=>_?new Date(_):void 0,[_]),w=M.useMemo(()=>g===NL.DiabetesType.Type1?"type_of_diabetes_type1":"type_of_diabetes_type2",[g]),k=M.useCallback(async e=>{if(e!==b){const t=await Uq.setUserSettings({height:e});m(t)}a(!1)},[b]),C=M.useCallback(async e=>{if(e!==v){const t=await Uq.setUserSettings({weight:e});m(t)}s(!1)},[v]),E=M.useMemo(()=>{if(!b)return 0;const e=Math.round(10*b)/10;return p8.indexOf(e.toString())},[b]),I=M.useMemo(()=>{if(!v)return 0;const e=Math.round(10*v)/10;return f8.indexOf(e.toString())},[v]),x=async e=>{if(e.toISOString()!==_){if(c$(e,_X(new Date))){const t=await Uq.setUserSettings({birthday:e.toISOString()});m(t)}else cV?d(!0):f(!0)}u(!1)},T=M.useCallback(()=>{!1===h&&t.set({showSyncErrorModal:!0}),m(void 0)},[t,h]),O=M.useCallback(()=>{p?d(!0):T()},[p,T]);return D.createElement(D.Fragment,null,D.createElement(_a,null,D.createElement(kj.Container,null,D.createElement(kj,{title:e("my_profile_birth"),value:S?S.toLocaleDateString():"-",testID:"date-of-birth",onPress:()=>{u(!0)}}),D.createElement(kj,{title:e("my_profile_diabetes_type"),value:e(w),testID:"diabetes-type",onPress:()=>{n.navigate(S2.DiabetesType)},renderRightSlot:()=>D.createElement(K1,null)}),D.createElement(kj,{title:e("my_profile_sex"),testID:"biologicalSex",value:y?lV[y]():"-",onPress:()=>{n.navigate(S2.BiologicalSex)},renderRightSlot:()=>D.createElement(K1,null)}),D.createElement(kj,{title:e("my_profile_height"),value:`${b??"-"} cm`,testID:"height",onPress:()=>{a(!0)}}),D.createElement(kj,{title:e("my_profile_weight"),value:`${v??"-"} kg`,testID:"weight",onPress:()=>{s(!0)}}))),dV?D.createElement(x5,{testID:"birthday-date-picker",display:"spinner",minimumDate:new Date(1900,0,1),maximumDate:new Date,date:S,isVisible:l,onConfirm:x,onCancel:()=>{u(!1)},cancelTextIOS:e("button_cancel"),confirmTextIOS:e("button_confirm"),onHide:O,pickerStyleIOS:{alignSelf:"center"},modalStyleIOS:{paddingBottom:i}}):D.createElement(h8,{isVisible:l,initialValue:S??new Date,onConfirm:x,onCancel:()=>{u(!1)},onModalHide:O}),D.createElement(n3,{isVisible:r,items:p8,onConfirm:k,onCancel:()=>{a(!1)},initialScrollIndex:E,onModalHide:T,testID:"height_wheel_picker"}),D.createElement(n3,{isVisible:o,items:f8,onConfirm:C,onCancel:()=>{s(!1)},initialScrollIndex:I,onModalHide:T,testID:"weight_wheel_picker"}),D.createElement(lz,{isVisible:c,title:e("invalid_date_modal_title"),message:e("invalid_date_modal_body"),buttons:[{title:e("button_understood"),onPress:()=>{f(!1),d(!1)},testID:"understood-button"}]}),D.createElement(V0,{onModalHide:()=>{m(void 0)}}))});function g8(){const{t:e}=iV();return D.createElement(Xa,{testID:"profile-screen-scroll",style:y8.scrollView,contentContainerStyle:y8.contentContainer},D.createElement(kj,{title:e("my_profile_account"),testID:"first-name",renderLeftSlot:()=>D.createElement(v2,null),renderRightSlot:()=>D.createElement(K1,null),onPress:()=>{window.location.href="/account"}}),D.createElement(_8,null))}const y8=Ei.create({scrollView:{paddingHorizontal:16},contentContainer:{paddingVertical:32,flexGrow:1,gap:24}}),v8=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{Navigator:n,Screen:i}=ZQ();return d.jsxs(n,{screenOptions:{...n0,...BZ,headerStyle:{backgroundColor:t.bgSheet}},children:[d.jsx(i,{name:S2.Profile,component:g8,options:{title:e("my_profile_navigation")}}),d.jsx(i,{name:S2.BiologicalSex,component:a8,options:{title:e("biological_sex_navigation")}}),d.jsx(i,{name:S2.DiabetesType,component:s8,options:{title:e("diabetes_type_navigation")}})]})};const b8=uV?"/api/v2":Wj.HEDIA_API_URL_V2,S8=()=>{const{COLORS:e}=bL(),{fontScale:t}=vm(),n=t.toFixed(3);return D.createElement(D.Fragment,null,D.createElement(gj,{style:[w8.text,{backgroundColor:e.iconWarning,color:e.bgPrimary}],maxFontSizeMultiplier:sj},`Country code: ${Qj.getString("countryCodeAlpha2")}`),D.createElement(gj,{style:[w8.text,{backgroundColor:e.iconWarning,color:e.bgPrimary}],maxFontSizeMultiplier:sj},`Font scale: ${n}`),D.createElement(gj,{style:[w8.textBold,{backgroundColor:e.iconWarning,color:e.bgPrimary}],maxFontSizeMultiplier:sj},b8??".env is broken"))},w8=Ei.create({text:{...oj.regular_Base,textAlign:"center"},textBold:{...oj.semiBold_Base,textAlign:"center"}});function k8(){const{t:e}=iV(),{COLORS:t}=bL(),n=Wp(),[i,r]=M.useState(!0),a=M.useCallback(()=>{jX(FX.SettingsProfile),n.navigate(S2.ProfileStack,{screen:S2.Profile})},[n]),o=M.useCallback(()=>{jX(FX.SettingsGlucose),n.navigate(S2.GlucoseSettings)},[n]),s=M.useCallback(()=>{jX(FX.SettingsInsulin),n.navigate(S2.InsulinSettingsStack,{screen:S2.InsulinSettings})},[n]),l=M.useCallback(()=>{jX(FX.SettingsActivity),n.navigate(S2.ActivitySettings)},[n]),u=M.useCallback(()=>{jX(FX.SettingsSupport),n.navigate(S2.Support)},[n]),c=M.useCallback(()=>{jX(FX.SettingsLegal),n.navigate(S2.Legal)},[n]);return d.jsxs(Xa,{testID:"scroll-settings",style:C8.scrollView,contentContainerStyle:C8.scrollViewContentContainer,contentInsetAdjustmentBehavior:"automatic",children:[d.jsx(kj,{title:e("settings_card_my_profile"),testID:"edit-profile-button",renderRightSlot:()=>d.jsx(K1,{}),onPress:a}),d.jsxs(_a,{children:[d.jsx(Ej,{title:e("settings_personal_settings_title")}),d.jsxs(kj.Container,{children:[d.jsx(kj,{title:e("settings_card_glucose"),testID:"settings-glucose",onPress:o,renderRightSlot:()=>d.jsx(K1,{})}),d.jsx(kj,{title:e("settings_card_insulin_settings"),testID:"settings-insulin",onPress:s,renderRightSlot:()=>d.jsx(K1,{})}),d.jsx(kj,{title:e("settings_card_physical_activity"),testID:"settings-activity",onPress:l,renderRightSlot:()=>d.jsx(K1,{})})]})]}),d.jsxs(_a,{children:[d.jsx(Ej,{title:e("settings_hedia_diabetes_assistant_title")}),d.jsxs(kj.Container,{children:[d.jsx(kj,{title:e("settings_support"),testID:"settings-support",onPress:u,renderRightSlot:()=>d.jsx(K1,{})}),d.jsx(kj,{title:e("settings_card_legal"),testID:"settings-legal",onPress:c,renderRightSlot:()=>d.jsx(K1,{})})]})]}),d.jsx(xc,{onPress:()=>{r(!i)},style:C8.versionContainer,children:d.jsx(gj,{style:[C8.versionText,{color:t.labelSecondary}],children:i?NX:"(861)"})}),"false"===Wj.IS_PRODUCTION&&d.jsx(_a,{children:d.jsx(S8,{})})]})}const C8=Ei.create({scrollView:{flex:1,paddingHorizontal:16},scrollViewContentContainer:{paddingVertical:32,flexGrow:1,gap:24},versionContainer:{alignItems:"center",marginTop:"auto"},versionText:{...oj.regular_Base}}),E8=["transparentModal","containedTransparentModal"];function I8(e){let{state:t,descriptors:n}=e;const i=M.useContext(yK);return M.createElement(TK,null,M.createElement(_a,{style:x8.container},t.routes.map((e,r)=>{var a,o;const s=t.index===r,l=null===(a=t.routes[r-1])||void 0===a?void 0:a.key,u=null===(o=t.routes[r+1])||void 0===o?void 0:o.key,c=l?n[l]:void 0,d=u?n[u]:void 0,{options:h,navigation:m,render:p}=n[e.key],f=c?{title:QZ(c.options,c.route.name)}:i,_=void 0!==f,{header:g,headerShown:y,headerTintColor:v,headerBackImageSource:b,headerLeft:S,headerRight:w,headerTitle:k,headerTitleAlign:C,headerTitleStyle:E,headerStyle:I,headerShadowVisible:x,headerTransparent:T,headerBackground:O,headerBackTitle:R,presentation:A,contentStyle:L}=h,P=null==d?void 0:d.options.presentation;return M.createElement(AK,{key:e.key,focused:s,route:e,navigation:m,headerShown:y,headerTransparent:T,header:void 0!==g?g({back:f,options:h,route:e,navigation:m}):M.createElement(lK,{title:QZ(h,e.name),headerTintColor:v,headerLeft:"function"==typeof S?e=>{let{tintColor:t}=e;return S({tintColor:t,canGoBack:_,label:R})}:void 0===S&&_?e=>{let{tintColor:t}=e;return M.createElement(fK,{tintColor:t,backImage:void 0!==b?()=>M.createElement(Js,{source:b,style:[x8.backImage,{tintColor:t}]}):void 0,onPress:m.goBack,canGoBack:_})}:S,headerRight:"function"==typeof w?e=>{let{tintColor:t}=e;return w({tintColor:t,canGoBack:_})}:w,headerTitle:"function"==typeof k?e=>{let{children:t,tintColor:n}=e;return k({children:t,tintColor:n})}:k,headerTitleAlign:C,headerTitleStyle:E,headerTransparent:T,headerShadowVisible:x,headerBackground:O,headerStyle:I}),style:[Ei.absoluteFill,{display:s||null!=P&&E8.includes(P)?"flex":"none"},null!=A&&E8.includes(A)?{backgroundColor:"transparent"}:null]},M.createElement(yK.Provider,{value:f},M.createElement(_a,{style:[x8.contentContainer,L]},p())))})))}const x8=Ei.create({container:{flex:1},contentContainer:{flex:1},backImage:{height:24,width:24,margin:3,resizeMode:"contain"}});function T8(){return T8=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},T8.apply(this,arguments)}const O8=tp(function(e){let{id:t,initialRouteName:n,children:i,screenListeners:r,screenOptions:a,...o}=e;const{state:s,descriptors:l,navigation:u,NavigationContent:c}=cf(Lm,{id:t,initialRouteName:n,children:i,screenListeners:r,screenOptions:a});return M.useEffect(()=>{var e;return null==u||null===(e=u.addListener)||void 0===e?void 0:e.call(u,"tabPress",e=>{const t=u.isFocused();requestAnimationFrame(()=>{s.index>0&&t&&!e.defaultPrevented&&u.dispatch({...Am.popToTop(),target:s.key})})})},[u,s.index,s.key]),M.createElement(c,null,M.createElement(I8,T8({},o,{state:s,navigation:u,descriptors:l})))});function R8(){const{COLORS:e}=bL();return D.createElement(_a,{style:[A8.separator,{backgroundColor:e.divider}]})}const A8=Ei.create({separator:{height:1}}),L8=MX(NL.CONSTANTS.INSULIN_TO_CARBS_RATIO_MIN,NL.CONSTANTS.INSULIN_TO_CARBS_RATIO_MAX);var P8=(e=>(e.DividendNumber="109",e.ExampleInsulinSensitivity="2.2",e))(P8||{}),M8=(e=>(e.DividendNumber="1960",e.ExampleInsulinSensitivity="39.2",e))(M8||{});const D8=MX(NL.CONSTANTS.INSULIN_SENSITIVITY_MIN,NL.CONSTANTS.INSULIN_SENSITIVITY_MAX),N8=PX(5,197),F8=({onPress:e,isVisible:t})=>{const{t:n}=iV(),{COLORS:i}=bL();return D.createElement(lz,{isVisible:t,title:n("insulin_settings_modal_carb_ratio_title"),enableScroll:!0,buttons:[{title:n("button_close"),onPress:e,testID:"close-button"}]},D.createElement(gj,{testID:"insulin_settings_modal_carb_ratio_body",style:[B8.bodyText,{color:i.labelSecondary}]},n("insulin_settings_modal_carb_ratio_body")),D.createElement(gj,{testID:"insulin_settings_modal_carb_ratio_example",style:{color:i.labelSecondary}},n("insulin_settings_modal_carb_example_body")))},B8=Ei.create({bodyText:{marginTop:12,marginBottom:16}}),j8=({glucoseUnit:e,onPress:t,isVisible:n})=>{const{t:i}=iV(),{COLORS:r}=bL(),{text:a}=Kq(e),o=e===NL.BloodGlucoseUnit.MMOL_L?P8.DividendNumber:M8.DividendNumber,s=e===NL.BloodGlucoseUnit.MMOL_L?P8.ExampleInsulinSensitivity:M8.ExampleInsulinSensitivity;return D.createElement(lz,{title:i("modal_insulin_seneitivity_title"),isVisible:n,enableScroll:!0,buttons:[{title:i("button_close"),onPress:t,testID:"close-button"}]},D.createElement(gj,{testID:"insulin_sensitivity_modal_body",style:[V8.bodyText,{color:r.labelSecondary}]},i("insulin_sensitivity_modal_body",{dividerNumber:o})),D.createElement(gj,{testID:"insulin_sensitivity_modal_example",style:{color:r.labelSecondary}},i("insulin_sensitivity_modal_example",{dividerNumber:o,displayResult:s,displayUnit:a})))},V8=Ei.create({bodyText:{marginTop:12,marginBottom:16}}),H8=()=>{const{t:e}=iV(),{bloodGlucoseUnits:t}=U2(),n=Uq.glucoseUnit??t;if(void 0===n)throw new Error("[HelpCalculatingSection::render] glucoseUnit must be defined.");const[i,r]=M.useState(!1),[a,o]=M.useState(!1),s=n===NL.BloodGlucoseUnit.MMOL_L?P8.DividendNumber:M8.DividendNumber;return D.createElement(_a,null,D.createElement(Ej,{title:e("insulin_settings_learn_more_title")}),D.createElement(kj.Container,null,D.createElement(kj,{testID:"info-insulin-carbs-ratio",title:e("insulin_settings_learn_more_carb_ratio"),onPress:()=>{o(!0)},displayType:Sj.ListItem}),D.createElement(kj,{testID:`info-insulin-sensitivity-${s}`,title:e("insulin_settings_learn_more_sensitivity"),onPress:()=>{r(!0)},displayType:Sj.ListItem})),D.createElement(j8,{onPress:()=>{r(!1)},glucoseUnit:n,isVisible:i}),D.createElement(F8,{onPress:()=>{o(!1)},isVisible:a}))},z8=Ei.create({switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0},firstTableCell:{paddingLeft:16,alignItems:"flex-start",justifyContent:"space-between",borderLeftWidth:0},tableHeaderTitle:{...oj.medium_SM,textAlign:"center"},tableHeaderTitleWithMargin:{marginHorizontal:8},tableTitle:{...oj.medium_Base},tableSubtitle:{...oj.regular_XS},tableText:{...oj.medium_Base}}),U8=iF(()=>{const{t:e}=iV(),{COLORS:t}=bL(),{modalStoreActions:n}=j2(),{glucoseUnit:i,treatmentParameters:r}=Uq;if(void 0===i)throw new Error("[DailyInsulinTable::render] glucoseUnit is undefined.");if(void 0===r)throw new Error("[DailyInsulinTable::render] parameters from userSettings must be defined and non-null.");const a=r.use,[o,s]=M.useState(!1),[l,u]=M.useState(!1),[c,d]=M.useState(void 0),[h,m]=M.useState(0),[p,f]=M.useState(!1),[_,g]=M.useState(),y=M.useCallback(async e=>{const t=iZ(e,i,NL.BloodGlucoseUnit.MMOL_L);if(t!==r.parameterIntervals[h].insulinSensitivity){const e={...r,parameterIntervals:r.parameterIntervals.map((e,n)=>n===h?{...e,insulinSensitivity:t}:e)},n=await Uq.setUserSettings({parameters:e});d(n)}s(!1)},[i,r,h]),v=M.useCallback(async e=>{const t=Number(e.toFixed(1));if(t!==r.parameterIntervals[h].carbohydrateRatio){const e={...r,parameterIntervals:r.parameterIntervals.map((e,n)=>n===h?{...e,carbohydrateRatio:t}:e)},n=await Uq.setUserSettings({parameters:e});d(n)}u(!1)},[r,h]),{text:b}=Kq(i),S=M.useMemo(()=>[{title:e("table_variable_insulin_time"),subtitle:e("table_variable_time_unit"),scale:uj},{title:e("table_variable_insulin_sensitivity"),subtitle:e("table_variable_insulin_sensitivity_unit",{displayUnit:b}),scale:sj},{title:e("table_variable_insulin_carb"),subtitle:e("table_variable_insulin_carb_unit"),scale:sj}],[b,e]),w=M.useMemo(()=>i===NL.BloodGlucoseUnit.MG_DL?N8:D8,[i]),k=M.useMemo(()=>{const e=aZ(r.parameterIntervals[h].insulinSensitivity,NL.BloodGlucoseUnit.MMOL_L,i);return w.findIndex(t=>t===e)},[w,i,r.parameterIntervals,h]),C=M.useMemo(()=>{const e=r.parameterIntervals[h].carbohydrateRatio.toFixed(1);return L8.findIndex(t=>t===e)},[r.parameterIntervals,h]),E=M.useCallback(async e=>{const t=o$(e,"HH:mm");if(t!==r.parameterIntervals[h].startTime){const e=[...r.parameterIntervals],n={...e[h]};n.startTime=t,e[h]=n;const i=await Uq.setUserSettings({parameters:{...r,parameterIntervals:e}});d(i)}f(!1)},[r,h]),I=M.useCallback(()=>{f(!1)},[]),x=M.useCallback(async e=>{const t={...r,use:e?NL.Usage.Intervals:NL.Usage.Overall},i=await Uq.setUserSettings({parameters:t});n.set({showSyncErrorModal:!i})},[r,n]),T=M.useCallback(()=>{!1===c&&n.set({showSyncErrorModal:!0}),d(void 0)},[n,c]);return D.createElement(D.Fragment,null,D.createElement(T7,{columnDisposition:[2,3,3]},D.createElement(uz,{testID:"daily-interval-switch",title:e("variable_insulin_settings_title"),message:e("variable_insulin_settings_body"),value:a===NL.Usage.Intervals,onValueChange:x,style:z8.switchContainer}),D.createElement(C7,{disabled:a!==NL.Usage.Intervals},S.map((e,n)=>D.createElement(L7,{key:e.title,style:0===n&&z8.firstTableCell},D.createElement(gj,{maxFontSizeMultiplier:e.scale,style:[z8.tableHeaderTitle,{color:t.labelPrimary},0!==n&&z8.tableHeaderTitleWithMargin]},e.title),D.createElement(gj,{style:[z8.tableSubtitle,{color:t.textTableSecondary}]},e.subtitle)))),Object.keys(oV).map((e,n)=>D.createElement(I7,{key:e,disabled:a!==NL.Usage.Intervals},D.createElement(R7,{onPress:()=>{(e=>{const t=r.parameterIntervals[(e-1+r.parameterIntervals.length)%r.parameterIntervals.length].startTime,n=r.parameterIntervals[(e+1+r.parameterIntervals.length)%r.parameterIntervals.length].startTime,i=aX(r.parameterIntervals[e].startTime,"HH:mm",new Date),a=aX(t,"HH:mm",new Date),o=aX(n,"HH:mm",new Date);c$(i,a)&&c$(i,o)?g({current:i,min:mY(aX(t,"HH:mm",cX(new Date,1)),1),max:fX(o)}):u$(i,a)&&u$(i,o)?g({current:i,min:mY(a,1),max:fX(aX(n,"HH:mm",nY(new Date,1)))}):g({current:i,min:mY(a,1),max:fX(o)}),m(e),f(!0)})(n)},style:z8.firstTableCell},D.createElement(gj,{maxFontSizeMultiplier:uj,style:[z8.tableTitle,{color:t.textTableHighlight}]},r.parameterIntervals[n].startTime),D.createElement(gj,{style:[z8.tableSubtitle,{color:t.textTableSecondary}]},sV[e]())),D.createElement(R7,{testID:`${e.toLowerCase()}-insulin`,onPress:()=>{(e=>{m(e),s(!0)})(n)}},D.createElement(gj,{maxFontSizeMultiplier:uj,style:[z8.tableText,{color:t.textTableHighlight}]},aZ(r.parameterIntervals[n].insulinSensitivity,NL.BloodGlucoseUnit.MMOL_L,i))),D.createElement(R7,{testID:`${e.toLowerCase()}-carbs`,onPress:()=>{(e=>{m(e),u(!0)})(n)}},D.createElement(gj,{maxFontSizeMultiplier:uj,style:[z8.tableText,{color:t.textTableHighlight}]},r.parameterIntervals[n].carbohydrateRatio.toFixed(1)))))),D.createElement(U7,{isVisible:p,initialValue:_?.current??new Date,min:_?.min,max:_?.max,onConfirm:E,onCancel:I,onModalHide:T}),D.createElement(n3,{isVisible:o,items:w,initialScrollIndex:k,onConfirm:y,onCancel:()=>{s(!1)},onModalHide:T,testID:"insulin_sensitivity_picker"}),D.createElement(n3,{isVisible:l,items:L8,initialScrollIndex:C,onConfirm:v,onCancel:()=>{u(!1)},onModalHide:T,testID:"insulin_to_carb_ratio_picker"}))}),G8={Lantus:()=>nV("long-acting_insulin_option1"),Basaglar:()=>nV("long-acting_insulin_option2"),Tuojeo:()=>nV("long-acting_insulin_option3"),Levemir:()=>nV("long-acting_insulin_option4"),Tresiba:()=>nV("long-acting_insulin_option5"),Other:()=>nV("long-acting_insulin_option6"),None:()=>nV("long-acting_insulin_option7")},W8=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),Y8=iF(()=>{const{isOnboardingFinished:e}=qz(),{longActingInsulin:t}=U2(),{setSetupCalculatorStoreValues:n}=z2(),{modalStoreActions:i}=j2(),r=df(),a=e?Uq.longActingInsulin:t,o=M.useCallback(async e=>{if(e!==a)if(r.params.comingFrom===w2.Setup)n({longActingInsulin:NL.LongActingInsulin[e]});else{await Uq.setUserSettings({longActingInsulin:NL.LongActingInsulin[e]})||i.set({showSyncErrorModal:!0})}},[r.params.comingFrom,a,n,i]);return D.createElement(Xa,{testID:"scroll",contentContainerStyle:W8.scrollView},D.createElement(kj.Container,null,Object.keys(NL.LongActingInsulin).map(e=>D.createElement(kj,{key:e,title:G8[e](),renderRightSlot:()=>D.createElement(_a,{style:W8.checkmarkContainer},NL.LongActingInsulin[e]===a?D.createElement($1,null):null),onPress:()=>o(e),displayType:Sj.ListItem,testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join("-").toLowerCase()}`}))),D.createElement(V0,null))}),$8={Novorapid:()=>nV("rapid-acting_insulin_option1"),Fiasp:()=>nV("rapid-acting_insulin_option2"),Humalog:()=>nV("rapid-acting_insulin_option3"),Apidra:()=>nV("rapid-acting_insulin_option4"),Other:()=>nV("rapid-acting_insulin_option5"),None:()=>nV("rapid-acting_insulin_option6")},X8=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),q8=iF(()=>{const{isOnboardingFinished:e}=qz(),{fastActingInsulin:t}=U2(),{setSetupCalculatorStoreValues:n}=z2(),{modalStoreActions:i}=j2(),r=df(),a=e?Uq.fastActingInsulin:t,o=M.useCallback(async e=>{if(e!==a)if(r.params.comingFrom===w2.Setup)n({fastActingInsulin:NL.FastActingInsulin[e]});else{await Uq.setUserSettings({fastActingInsulin:NL.FastActingInsulin[e]})||i.set({showSyncErrorModal:!0})}},[r.params.comingFrom,a,n,i]);return D.createElement(Xa,{testID:"scroll",contentContainerStyle:X8.scrollView},D.createElement(kj.Container,null,Object.keys(NL.FastActingInsulin).map(e=>D.createElement(kj,{key:e,title:$8[e](),renderRightSlot:()=>D.createElement(_a,{style:X8.checkmarkContainer},NL.FastActingInsulin[e]===a?D.createElement($1,null):null),onPress:()=>o(e),displayType:Sj.ListItem,testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join("-").toLowerCase()}`}))),D.createElement(V0,null))}),Z8={PenHalf:()=>nV("treatment_type_option1"),PenWhole:()=>nV("treatment_type_option2"),Pump:()=>nV("treatment_type_option3")},K8=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},checkmarkContainer:{width:24,height:24}}),Q8=iF(()=>{const{isOnboardingFinished:e}=qz(),{setSetupCalculatorStoreValues:t}=z2(),{treatmentType:n}=U2(),{modalStoreActions:i}=j2(),r=df(),a=e?Uq.injectionMethod:n,o=M.useCallback(async e=>{if(e!==a)if(r.params.comingFrom===w2.Setup)t({treatmentType:NL.InjectionMethod[e]});else{await Uq.setUserSettings({treatmentType:NL.InjectionMethod[e]})||i.set({showSyncErrorModal:!0})}},[r.params.comingFrom,a,t,i]);return D.createElement(Xa,{testID:"scroll",contentContainerStyle:K8.scrollView},D.createElement(kj.Container,null,Object.keys(NL.InjectionMethod).map(e=>D.createElement(kj,{key:e,title:Z8[e](),renderRightSlot:()=>D.createElement(_a,{style:K8.checkmarkContainer},NL.InjectionMethod[e]===a?D.createElement($1,null):null),onPress:()=>o(e),testID:`treatment-${e.match(/[A-Z][a-z]+/g)?.join("-").toLowerCase()}`,displayType:Sj.ListItem}))),D.createElement(V0,null))});const J8=iF(function(){const{t:e}=iV(),t=Wp(),{injectionMethod:n,fastActingInsulin:i,longActingInsulin:r}=Uq;if(void 0===n)throw new Error("[TreatmentSection::render] injectionMethod must be defined and non-null.");const a=M.useMemo(()=>{const e=LX(NL.InjectionMethod,n);return Z8[e]()},[n]),o=M.useMemo(()=>i?$8[i]():"-",[i]),s=M.useMemo(()=>r?G8[r]():"-",[r]);return D.createElement(_a,null,D.createElement(kj,{title:e("my_profile_treatment_type"),value:a,testID:"treatment-type",onPress:()=>{t.navigate(S2.TreatmentType,{comingFrom:S2.Profile})},renderRightSlot:()=>D.createElement(K1,null),style:{marginBottom:24}}),D.createElement(kj.Container,null,D.createElement(kj,{title:e("my_profile_rapid-acting_insulin"),value:o,testID:"fast-acting-insulin",onPress:()=>{t.navigate(S2.RapidActingInsulin,{comingFrom:S2.Profile})},renderRightSlot:()=>D.createElement(K1,null)}),D.createElement(kj,{title:e("my_profile_long-acting_insulin"),value:s,testID:"long-acting-insulin",onPress:()=>{t.navigate(S2.LongActingInsulin,{comingFrom:S2.Profile})},renderRightSlot:()=>D.createElement(K1,null)})))}),{MMOL_L:eee}=NL.BloodGlucoseUnit,tee=Ei.create({scrollView:{paddingVertical:32,paddingHorizontal:16,flexGrow:1},spacing:{height:32},active:{opacity:1},inactive:{opacity:.5},switchContainer:{borderBottomLeftRadius:0,borderBottomRightRadius:0}}),nee=iF(()=>{const{t:e}=iV(),{COLORS:t}=bL(),{modalStoreActions:n}=j2(),{glucoseUnit:i,treatmentParameters:r}=Uq;if(void 0===i)throw new Error("[InsulinSettings::render] glucoseUnit is undefined.");if(void 0===r)throw new Error("[InsulinSettings::render] parameters from userSettings must be defined and non-null.");const a=r.use===NL.Usage.Overall,{text:o}=Kq(i),{carbohydrateRatio:s,insulinSensitivity:l}=r.overallParameters,[u,c]=M.useState(!1),[d,h]=M.useState(!1),[m,p]=M.useState(void 0),f=M.useMemo(()=>i===eee?D8:N8,[i]),_=M.useCallback(async e=>{const t=iZ(e,i,eee);if(t!==r.overallParameters.insulinSensitivity){const e={...r,overallParameters:{...r.overallParameters,insulinSensitivity:t}},n=await Uq.setUserSettings({parameters:e});p(n)}c(!1)},[i,r]),g=M.useCallback(async e=>{const t=Number(e.toFixed(1));if(t!==r.overallParameters.carbohydrateRatio){const e={...r,overallParameters:{...r.overallParameters,carbohydrateRatio:t}},n=await Uq.setUserSettings({parameters:e});p(n)}h(!1)},[r]),y=M.useMemo(()=>{const e=aZ(l,eee,i);return f.findIndex(t=>t===e)},[f,i,l]),v=M.useMemo(()=>L8.findIndex(e=>e===s.toFixed(1)),[s]),b=M.useCallback(()=>{!1===m&&n.set({showSyncErrorModal:!0}),p(void 0)},[n,m]),S=M.useCallback(async e=>{const t={...r,use:e?NL.Usage.Overall:NL.Usage.Intervals},i=await Uq.setUserSettings({parameters:t});n.set({showSyncErrorModal:!i})},[r,n]);return D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"scroll",contentContainerStyle:tee.scrollView},D.createElement(J8,null),D.createElement(_a,{style:tee.spacing}),D.createElement(w7,null),D.createElement(_a,{style:tee.spacing}),D.createElement(kj.Container,{containerStyle:{backgroundColor:t.bgSecondary,borderColor:t.divider,borderWidth:1}},D.createElement(uz,{testID:"insulin-settings-overall-switch",title:e("fixed_insulin_settings_title"),message:e("fixed_insulin_settings_body"),value:a,onValueChange:S,style:tee.switchContainer}),D.createElement(R8,null),D.createElement(kj,{title:e("fixed_insulin_settings_carb_ratio_title"),value:`${s.toFixed(1)} ${e("fixed_insulin_settings_carb_ratio_unit")}`,testID:"carbohydrate-ratio",onPress:a?()=>{h(!0)}:void 0,containerStyle:a?tee.active:tee.inactive,valueStyle:a?{color:t.textTableHighlight}:{color:t.labelSecondary}}),D.createElement(kj,{title:e("fixed_insulin_settings_sensitivity_title"),value:`${aZ(l,eee,i)} ${e("fixed_insulin_settings_sensitivity_unit",{displayUnit:o})}`,testID:"insulin-sensitivity",onPress:a?()=>{c(!0)}:void 0,containerStyle:a?tee.active:tee.inactive,valueStyle:a?{color:t.textTableHighlight}:{color:t.labelSecondary}})),D.createElement(_a,{style:tee.spacing}),D.createElement(U8,null),D.createElement(_a,{style:tee.spacing}),D.createElement(H8,null)),D.createElement(n3,{isVisible:u,items:f,initialScrollIndex:y,onConfirm:_,onCancel:()=>{c(!1)},onModalHide:b,testID:"insulin_sensitivity_picker"}),D.createElement(n3,{isVisible:d,items:L8,initialScrollIndex:v,onConfirm:g,onCancel:()=>{h(!1)},onModalHide:b,testID:"insulin_to_carb_ratio_picker"}),D.createElement(V0,{onModalHide:()=>{p(void 0)}}))}),iee=()=>{const{t:e}=iV(),{Navigator:t,Screen:n}=O8();return d.jsxs(t,{screenOptions:t0,children:[d.jsx(n,{name:S2.InsulinSettings,component:nee,options:{title:e("insulin_settings_navigation")}}),d.jsx(n,{name:S2.TreatmentType,component:Q8,options:{title:e("treatment_type_navigation")}}),d.jsx(n,{name:S2.RapidActingInsulin,component:q8,options:{title:e("rapid-acting_insulin_navigation")}}),d.jsx(n,{name:S2.LongActingInsulin,component:Y8,options:{title:e("long-acting_insulin_navigation")}})]})},ree=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{Navigator:n,Screen:i}=ZQ();return d.jsxs(n,{screenOptions:{...n0,...BZ,headerStyle:{backgroundColor:t.bgNavigationBar}},children:[d.jsx(i,{name:S2.Settings,component:k8,options:{title:e("settings_navigation"),headerShown:!0,headerLeft:X2}}),d.jsx(i,{name:S2.ProfileStack,component:v8,options:{headerShown:!1}}),d.jsx(i,{name:S2.GlucoseSettings,component:X7,options:{title:e("glucose_navigation")}}),d.jsx(i,{name:S2.GlucoseUnit,component:J7,options:{title:e("glucose_unit_navigation")}}),d.jsx(i,{name:S2.ActivitySettings,component:V7,options:{title:e("physical_activity_navigation")}}),d.jsx(i,{name:S2.InsulinSettingsStack,component:iee,options:{headerShown:!1}}),d.jsx(i,{name:S2.Support,component:n8,options:{title:e("support_navigation")}}),d.jsx(i,{name:S2.Legal,component:e8,options:{title:e("legal_navigation")}})]})};function aee(){return d.jsx(v3,{style:oee.iframe,uri:"https://www.hedia.com/contact#contactsupport"})}const oee=Ei.create({iframe:{flex:1}}),{Navigator:see,Screen:lee,Group:uee}=ZQ(),cee=()=>{const{t:e}=iV(),t=M.useCallback(()=>d.jsx(X2,{}),[]),n=M.useCallback(()=>d.jsx(K2,{}),[]);return d.jsxs(see,{children:[d.jsxs(uee,{screenOptions:{headerShown:!1,animationEnabled:!0},children:[d.jsx(lee,{name:S2.NewCalculationStack,component:p7}),d.jsx(lee,{name:S2.SettingsTab,component:ree})]}),d.jsxs(uee,{screenOptions:i0,children:[d.jsx(lee,{name:S2.AddActivity,component:U0,options:{title:e("new_activity_navigation"),headerLeft:n}}),d.jsx(lee,{name:S2.FoodLibrary,component:g3,options:{title:e("food_library_sheet_navigation"),headerLeft:t}}),d.jsx(lee,{name:S2.AddCarbs,component:c0,options:{title:""}}),d.jsx(lee,{name:S2.CreateFood,component:c3,options:{title:"",gestureEnabled:!1}}),d.jsx(lee,{name:S2.IFU,component:S3,options:{title:e("IFU_navigation"),headerLeft:t}}),d.jsx(lee,{name:S2.SupportWebView,component:P3,options:{title:e("support_navigation"),headerLeft:t}}),d.jsx(lee,{name:S2.SupportContact,component:aee,options:{title:e("support_navigation"),headerLeft:t}})]})]})},dee=({title:e,subtitle:t,stepChecked:n,onAnimationFinished:i})=>{const{t:r}=iV(),{COLORS:a}=bL();return M.useEffect(()=>{i?.()},[i]),D.createElement(Xa,{contentContainerStyle:hee.container},D.createElement(gj,{style:hee.title},e),D.createElement(gj,{style:[hee.subtitle,{color:a.labelSecondary}]},t),D.createElement(_a,{style:hee.stepsWrapper},D.createElement(_a,{style:hee.stepContainer},D.createElement(gj,{style:1===n||2===n||3===n?{color:a.labelPrimary}:{color:a.labelSecondary}}," 1. "+r("overview1")),(1===n||2===n||3===n)&&D.createElement($1,null)),D.createElement(_a,{style:hee.stepContainer},D.createElement(gj,{style:2===n||3===n?{color:a.labelPrimary}:{color:a.labelSecondary}},"2. "+r("overview2")),(2===n||3===n)&&D.createElement($1,null)),D.createElement(_a,{style:hee.stepContainer},D.createElement(gj,{style:3===n?{color:a.labelPrimary}:{color:a.labelSecondary}},"3. "+r("overview3")),3===n&&D.createElement($1,null))))},hee=Ei.create({container:{flex:1,justifyContent:"center",paddingHorizontal:16},title:{...oj.bold_3XL,paddingHorizontal:16,marginBottom:4},subtitle:{...oj.regular_Base,paddingHorizontal:16,marginBottom:16},stepsWrapper:{padding:16,gap:8},stepContainer:{flexDirection:"row",alignItems:"center",gap:8}}),mee=()=>{const{t:e}=iV(),{setIsOnboardingFinished:t}=qz(),n=M.useCallback(()=>{setTimeout(()=>{t(!0)},1e3)},[t]);return D.createElement(dee,{title:e("guide_end_title"),subtitle:e("guide_end_body"),stepChecked:3,onAnimationFinished:n})},pee=({currentStep:e,text:t,onPress:n,inactive:i,isBackVisible:r=!0,onBackPress:a})=>{const{t:o}=iV(),{COLORS:s}=bL(),{goBack:l}=Wp();return M.createElement(SH,{style:[fee.container,{backgroundColor:s.bgNavigationBar,borderTopColor:s.divider}],edges:["bottom"]},M.createElement(_a,{style:fee.buttonsWrapper},r&&M.createElement(mj,{title:o("button_back"),onPress:a||l,testID:`back${e}`,style:fee.button,type:dj.Secondary}),M.createElement(mj,{title:t??o("button_next"),onPress:n,inactive:i,testID:`next${e}`,style:fee.button})))},fee=Ei.create({container:{borderTopWidth:1},buttonsWrapper:{flexDirection:"row",paddingHorizontal:16,paddingBottom:16,gap:8},button:{flex:1,marginTop:12}}),_ee=()=>{const{t:e}=iV(),{navigate:t}=Wp(),n=M.useCallback(()=>{t(w2.QuickGuideStack,{screen:w2.QuickGuide}),jX(FX.QuickGuideStartPress)},[t]);return D.createElement(D.Fragment,null,D.createElement(dee,{title:e("guide_quick_guide_title"),subtitle:e("guide_quick_guide_body"),stepChecked:2}),D.createElement(pee,{currentStep:1,isBackVisible:!1,onPress:n,text:e("button_start")}))},gee=()=>{const{t:e}=iV(),t=Wp(),n=M.useRef(null),[i,r]=M.useState(2),[a,o]=M.useState(0),{height:s,width:l}=vm(),u=M.useMemo(()=>[{title:e("guide_recent_insulin_title"),subtitle:e("guide_recent_insulin_body"),image:"/assets/webp/1_EN.webp"},{title:e("web_guide_no_import_title"),subtitle:e("web_guide_no_import_body"),image:"/assets/webp/2_EN.webp"},{title:e("guide_glucose_title"),subtitle:e("guide_glucose_body"),image:"/assets/webp/3_EN.webp"},{title:e("guide_carbohydrates_title"),subtitle:e("guide_carbohydrates_body"),image:"/assets/webp/4_EN.webp"},{title:e("guide_activity_title"),subtitle:e("guide_activity_body"),image:"/assets/webp/5_EN.webp"},{title:e("guide_summary_title"),subtitle:e("onboarding_quick_guide_text"),image:"/assets/webp/6_EN.webp"},{title:e("guide_recommendation_title"),subtitle:e("guide_recommendation_body"),image:"/assets/webp/7_EN.webp"}],[e]),c=M.useCallback(e=>{switch(e-1){case 1:return FX.QuickGuideBackPressStep1;case 2:return FX.QuickGuideBackPressStep2;case 3:return FX.QuickGuideBackPressStep3;case 4:return FX.QuickGuideBackPressStep4;case 5:return FX.QuickGuideBackPressStep5;case 6:return FX.QuickGuideBackPressStep6;case 7:return FX.QuickGuideBackPressStep7;default:throw new Error("[QuickGuide::getTrackingEventBackPress] Invalid step")}},[]),h=M.useCallback(e=>{switch(e-1){case 1:return FX.QuickGuideNextPressStep1;case 2:return FX.QuickGuideNextPressStep2;case 3:return FX.QuickGuideNextPressStep3;case 4:return FX.QuickGuideNextPressStep4;case 5:return FX.QuickGuideNextPressStep5;case 6:return FX.QuickGuideNextPressStep6;default:throw new Error("[QuickGuide::getTrackingEventNextPress] Invalid step")}},[]),m=M.useCallback(()=>{if(a===u.length-1)jX(FX.QuickGuideFinishPress),t.navigate(w2.QuickGuideAllSet);else{const e=a+1;n.current?.scrollToIndex({index:e,animated:!0}),r(i+1),o(e);const t=h(i);jX(t)}},[a,i,h,t,u.length]),p=M.useCallback(()=>{if(0===a)t.navigate(w2.QuickGuideStart);else{const e=a-1;n.current?.scrollToIndex({index:e,animated:!0}),r(i-1),o(e)}const e=c(i);jX(e)},[a,i,c,t]);return d.jsxs(d.Fragment,{children:[d.jsx(Wo,{ref:n,data:u,initialNumToRender:1,renderItem:({item:e,index:t})=>1===t?(e=>d.jsxs(_a,{style:[yee.container,{width:l}],children:[d.jsx(tj,{colors:cj.gradientQuickGuide,style:yee.gradient}),d.jsx(_a,{style:{flex:1,justifyContent:"flex-end"},children:d.jsx(Js,{source:e.image,style:{height:JR(s/5,140,180),width:JR(s/5,140,180),zIndex:10},resizeMode:"stretch"})}),d.jsxs(_a,{style:[yee.textContainer,{flex:1,justifyContent:"center"}],children:[d.jsx(gj,{style:yee.title,maxFontSizeMultiplier:uj,children:e.title}),d.jsx(gj,{style:yee.subtitle,maxFontSizeMultiplier:uj,children:e.subtitle})]})]}))(e):d.jsxs(_a,{style:[yee.container,{width:l}],children:[d.jsx(Js,{source:e.image,style:yee.image,resizeMode:"contain"}),d.jsx(tj,{colors:cj.gradientQuickGuide,locations:[.45,.64],style:yee.gradient}),d.jsxs(_a,{style:yee.textContainer,children:[d.jsx(gj,{style:yee.title,maxFontSizeMultiplier:uj,children:e.title}),d.jsx(gj,{style:yee.subtitle,maxFontSizeMultiplier:uj,children:e.subtitle})]})]}),scrollEnabled:!1,horizontal:!0,showsHorizontalScrollIndicator:!1}),d.jsx(pee,{currentStep:i,onPress:m,onBackPress:p,text:a===u.length-1?e("button_complete"):e("button_next")})]})},yee=Ei.create({container:{flex:1,alignItems:"center"},image:{position:"absolute",width:"100%",height:"100%",marginTop:32,marginBottom:14},textContainer:{marginTop:"auto",minHeight:Ws.getFontScale()>sj?165:155,backgroundColor:cj.bgTransparent},title:{...oj.bold_2XL,marginBottom:4,paddingHorizontal:16,textAlign:"center"},subtitle:{...oj.medium_SM,color:cj.labelSecondary,paddingHorizontal:Ws.getFontScale()>sj?16:32,textAlign:"center"},gradient:{position:"absolute",top:"16%",bottom:0,left:0,right:0}}),vee=()=>{const{Navigator:e,Screen:t}=O8(),{COLORS:n}=bL();return d.jsxs(e,{screenOptions:{...t0,headerStyle:{backgroundColor:n.bgNavigationBar},headerShown:!1},children:[d.jsx(t,{name:w2.QuickGuideStart,component:_ee}),d.jsx(t,{name:w2.QuickGuide,component:gee}),d.jsx(t,{name:w2.QuickGuideAllSet,component:mee})]})};function bee({onOptionSelect:e,setNextEnabled:t,ref:n}){const{t:i}=iV(),{COLORS:r}=bL(),{width:a}=vm(),[o,s]=M.useState(null),l=M.useCallback(n=>{s(n),e(n),t(!0)},[e,t]);return M.useImperativeHandle(n,()=>({onBackPress(){jX(FX.SetupOptionsBackPress)},onNextPressed:()=>null!==o?(jX(FX.SetupOptionsNextPress),t(!0),{transitionAllowed:!0}):(t(!1),{transitionAllowed:!1}),validateData:()=>({isValid:null!==o})}),[o,t]),D.createElement(Xa,{contentContainerStyle:[See.container,{width:a}]},D.createElement(gj,{style:[See.header,{color:r.labelPrimary}]},i("insulin_settings_title")),D.createElement(_a,{style:See.buttonsContainer},D.createElement(mj,{title:i("insulin_settings_button_yes"),testID:"insulin_settings_yes",onPress:()=>{l("yes")},type:"yes"===o?dj.Primary:dj.Secondary,style:See.button}),D.createElement(mj,{title:i("insulin_settings_button_no"),testID:"insulin_settings_no",onPress:()=>{l("no")},type:"no"===o?dj.Primary:dj.Secondary,style:See.button})))}const See=Ei.create({container:{flex:1,paddingHorizontal:16,paddingTop:32},header:{...oj.semiBold_2XL,paddingHorizontal:16,marginBottom:24},buttonsContainer:{flexDirection:"row",marginBottom:24,gap:12},button:{flex:1}});function wee({setNextEnabled:e,ref:t}){const{t:n}=iV(),{COLORS:i}=bL(),{width:r}=vm(),{bottom:a}=pH(),{birthday:o,biologicalSex:s,diabetesType:l,bloodGlucoseUnits:u}=U2(),{setSetupCalculatorStoreValues:c}=z2(),d=Wp(),[h,m]=M.useState(!1),[p,f]=M.useState(!1),[_,g]=M.useState(""),[y,v]=M.useState(!1),b=M.useCallback(e=>{const t=new Date(e);t.setHours(0,0,0,0);const i=new Date;i.setHours(0,0,0,0);gY(i,t)>=18?(c({birthday:t.toISOString()}),g("")):(c({birthday:void 0}),g(n("birthday_error")))},[c,n]),S=M.useCallback(e=>{b(e),m(!1)},[b]),w=M.useCallback(()=>{c({diabetesType:NL.DiabetesType.Type2}),f(!0)},[c]),k=M.useCallback(()=>!!(o&&s&&l&&u),[o,u,l,s]);return M.useEffect(()=>{const t=k();e(t)},[e,k]),M.useImperativeHandle(t,()=>({onBackPress(){jX(FX.SetupGeneralBackPress)},onNextPressed:()=>{v(!0),!o&&g(n("birthday_error"));return k()?(e(!0),jX(FX.SetupGeneralNextPress),{transitionAllowed:!0}):(e(!1),{transitionAllowed:!1})},validateData:()=>({isValid:k()})}),[o,n,k,e]),D.createElement(D.Fragment,null,D.createElement(Xa,{testID:"step_2",contentContainerStyle:[kee.container,{width:r}]},D.createElement(Ej,{title:n("general_birthday_title")}),D.createElement(ZB,{isAnimated:!!_},D.createElement(kj,{testID:"birthday",title:n("general_input_birthday"),subtitle:o?new Date(o).toLocaleDateString():"",errorMessage:_,containerStyle:kee.wrapper,onPress:()=>{m(!0)}})),D.createElement(_a,{style:kee.wrapper},D.createElement(Ej,{title:n("biological_sex_title")}),D.createElement(ZB,{isAnimated:y&&!s},D.createElement(kj,{title:n("my_profile_sex"),testID:"biological-sex",value:s?lV[s]():"-",onPress:()=>{d.navigate(w2.BiologicalSex)},renderRightSlot:()=>D.createElement(K1,null),errorMessage:y&&!s?n("diabetes_error"):void 0}))),D.createElement(_a,{style:kee.wrapper},D.createElement(Ej,{title:n("type_of_diabetes_title")}),D.createElement(ZB,{isAnimated:y&&!l,errorMessage:n("diabetes_error")},D.createElement(_a,{style:[kee.row,{backgroundColor:i.bgSegmentContainer}]},D.createElement(xj,{title:n("type_of_diabetes_type1"),isActive:l===NL.DiabetesType.Type1,testID:"type-1",onPress:()=>{c({diabetesType:NL.DiabetesType.Type1})},isError:y&&!l}),D.createElement(xj,{title:n("type_of_diabetes_type2"),isActive:l===NL.DiabetesType.Type2,testID:"type-2",onPress:w,isError:y&&!l})))),D.createElement(_a,{style:kee.wrapper},D.createElement(Ej,{title:n("glucose_unit_title")}),D.createElement(ZB,{isAnimated:y&&!u,errorMessage:n("glucose_unit_error")},D.createElement(Z7,{glucoseUnit:u,onPressMMOLL:()=>{c({bloodGlucoseUnits:NL.BloodGlucoseUnit.MMOL_L})},onPressMGDL:()=>{c({bloodGlucoseUnits:NL.BloodGlucoseUnit.MG_DL})},isError:y&&!u})))),dV?D.createElement(x5,{testID:"birthday-date-picker",display:"spinner",date:o?new Date(o):new Date,isVisible:h,onConfirm:S,onCancel:()=>{m(!1)},cancelTextIOS:n("button_cancel"),confirmTextIOS:n("button_confirm"),pickerStyleIOS:kee.alignCenter,modalStyleIOS:{paddingBottom:a},minimumDate:new Date(1900,0,1),maximumDate:new Date(2100,0,1)}):D.createElement(h8,{isVisible:h,initialValue:o?new Date(o):new Date,onConfirm:S,onCancel:()=>{m(!1)}}),D.createElement(lz,{isVisible:p,title:n("modal_diabetes2_title"),message:n("modal_diabetes2_body"),buttons:[{title:n("button_close"),testID:"type2-modal-understood-button",onPress:()=>{f(!1)}}]}))}const kee=Ei.create({container:{paddingTop:32,paddingHorizontal:16},wrapper:{marginBottom:24},row:{flexDirection:"row",padding:2,borderRadius:16},alignCenter:{alignSelf:"center"}});function Cee({setNextEnabled:e,ref:t}){const{t:n}=iV(),{width:i}=vm(),{parameters:r,treatmentType:a,fastActingInsulin:o,longActingInsulin:s}=U2(),{setSetupCalculatorStoreValues:l}=z2(),{navigate:u}=Wp(),[c,d]=M.useState(!1);M.useEffect(()=>{r||l({parameters:zq(0,0,NL.Usage.Overall)})},[r,l]),M.useEffect(()=>{e(!!a)},[e,a]),M.useImperativeHandle(t,()=>({onBackPress(){jX(FX.SetupTreatmentBackPress)},onNextPressed:()=>(d(!0),a?(e(!0),jX(FX.SetupTreatmentNextPress),{transitionAllowed:!0}):(e(!1),{transitionAllowed:!1})),validateData:()=>({isValid:!!a})}),[e,a]);const h=a?LX(NL.InjectionMethod,a):void 0,m=(h&&Z8[h]())??"-",p=(o&&$8[o]())??"-",f=(s&&G8[s]())??"-";return D.createElement(_a,{testID:"step_3",style:[Eee.container,{width:i}]},D.createElement(ZB,{isAnimated:c&&!a},D.createElement(kj,{title:n("treatment_type_input"),value:m,testID:"treatment-type",renderRightSlot:()=>D.createElement(K1,null),onPress:()=>{u(w2.TreatmentType,{comingFrom:w2.Setup})},errorMessage:c&&!a?n("treatment_type_input_error"):void 0})),D.createElement(_a,null,D.createElement(Ej,{title:n("treatment_type_insulin_title")}),D.createElement(kj.Container,null,D.createElement(kj,{title:n("Rapid-acting_insulin_input"),value:p,testID:"fast-acting",renderRightSlot:()=>D.createElement(K1,null),displayType:Sj.ListItem,onPress:()=>{u(w2.RapidActingInsulin,{comingFrom:w2.Setup})}}),D.createElement(kj,{title:n("long-acting_insulin_input"),value:f,testID:"long-acting",renderRightSlot:()=>D.createElement(K1,null),displayType:Sj.ListItem,onPress:()=>{u(w2.LongActingInsulin,{comingFrom:w2.Setup})}}))))}const Eee=Ei.create({container:{paddingHorizontal:16,paddingVertical:32,gap:24}}),Iee=PX(10,350);function xee({setNextEnabled:e,ref:t}){const{t:n}=iV(),{COLORS:i}=bL(),{width:r}=vm(),{bloodGlucoseUnits:a,parameters:o}=U2();if(!a||!o)throw new Error("[Step4::render] are not defined");const s=G2(),{setSetupCalculatorStoreValues:l,setTotalDailyDosage:u}=z2(),[c,d]=M.useState(!1),[h,m]=M.useState(void 0),p=M.useMemo(()=>{if(!s)return{carbohydrateRatio:0,insulinSensitivityMMOLL:0};return{carbohydrateRatio:parseFloat((500/s).toFixed(1)),insulinSensitivityMMOLL:Number(P8.DividendNumber)/s}},[s]);M.useEffect(()=>{const{carbohydrateRatio:e,insulinSensitivityMMOLL:t}=p,n=zq(t,e,NL.Usage.Overall);l({parameters:n})},[a,p,l]);const f=M.useMemo(()=>s?Iee.findIndex(e=>e===s.toString()):Iee.findIndex(e=>e===50..toString()),[s]);M.useImperativeHandle(t,()=>({onBackPress(){jX(FX.SetupTDDBackPress)},onNextPressed:()=>s?(jX(FX.SetupTDDNextPress),e(!0),{transitionAllowed:!0}):(m(n("insulin_settings_input_error",{inputTypeTranslated:n("daily_insulin_dosage_input")})),e(!1),{transitionAllowed:!1}),validateData:()=>({isValid:!!s})}),[e,s,n]);const _=M.useCallback(t=>{u(t),d(!1),m(void 0),e(!0)},[e,u]),{text:g}=M.useMemo(()=>Kq(a),[a]),y=M.useMemo(()=>`${aZ(o.overallParameters.insulinSensitivity,NL.BloodGlucoseUnit.MMOL_L,a)} ${n("fixed_insulin_settings_sensitivity_unit",{displayUnit:g})}`,[o,g,n,a]),v=M.useMemo(()=>o.overallParameters.carbohydrateRatio+" "+n("insulin_helper_carb_ratio_unit"),[o,n]);return D.createElement(D.Fragment,null,D.createElement(Xa,{contentContainerStyle:[Tee.container,{width:r}]},D.createElement(_a,null,D.createElement(Ej,{title:n("daily_insulin_dosage_title")}),D.createElement(gj,{style:[Tee.subheader,{color:i.labelSecondary}]},n("daily_insulin_dosage_body")),D.createElement(ZB,{isAnimated:!!h},D.createElement(kj,{testID:"daily_insulin_dosage",title:n("daily_insulin_dosage_input"),value:`${s??"-"} ${n(1===s?"unit":"units")}`,onPress:()=>{d(!0)},errorMessage:h}))),!!s&&D.createElement(_a,{style:[Tee.explanation,{backgroundColor:i.bgSecondary}]},D.createElement(gj,{style:[Tee.text,{color:i.labelSecondary}]},n("insulin_helper_body")),D.createElement(_a,{style:Tee.row},D.createElement(gj,{style:[Tee.textSemiBold,{color:i.labelSecondary}]},n("insulin_helper_carb_ratio_input")),D.createElement(gj,{style:[Tee.textSemiBold,{color:i.labelSecondary}]},v)),D.createElement(R8,null),D.createElement(_a,{style:Tee.row},D.createElement(gj,{style:[Tee.textSemiBold,{color:i.labelSecondary}]},n("insulin_helper_insulin_sensitivity_input")),D.createElement(gj,{style:[Tee.textSemiBold,{color:i.labelSecondary}]},y))),D.createElement(w7,null),D.createElement(_a,null,D.createElement(H8,null))),D.createElement(n3,{testID:"daily_insulin_dosage_picker",onCancel:()=>{d(!1)},onConfirm:_,initialScrollIndex:f,isVisible:c,items:Iee}))}const Tee=Ei.create({container:{paddingVertical:32,paddingHorizontal:16,gap:24},subheader:{...oj.regular_SM,marginBottom:8},explanation:{borderRadius:8,padding:16},row:{flexDirection:"row",justifyContent:"space-between"},text:{...oj.regular_SM,marginBottom:16},textSemiBold:{...oj.medium_SM,paddingVertical:16}});function Oee({setNextEnabled:e,ref:t}){const{t:n}=iV(),{width:i}=vm(),{bloodGlucoseUnits:r,parameters:a}=U2();if(!a||!r)throw new Error("[Step5::render] setupCalculatorStoreValues are not defined");const{setSetupCalculatorStoreValues:o,setTotalDailyDosage:s}=z2(),[l,u]=M.useState(void 0),[c,d]=M.useState(void 0),[h,m]=M.useState(!1),[p,f]=M.useState(!1),{text:_}=M.useMemo(()=>Kq(r),[r]),{carbohydrateRatio:g,insulinSensitivity:y}=M.useMemo(()=>a.overallParameters,[a]),v=M.useCallback(e=>{const t=n("IS"===e?"insulin_sensitivity_input":"insulin-to-carb_ratio_input");return n("insulin_settings_input_error",{inputTypeTranslated:t})},[n]);M.useEffect(()=>{e(!(!y||!g))},[g,y,e]),M.useImperativeHandle(t,()=>({onBackPress(){jX(FX.SetupInsulinBackPress)},onNextPressed:()=>g||y?g?y?(d(void 0),u(void 0),s(null),e(!0),jX(FX.SetupInsulinNextPress),{transitionAllowed:!0}):(e(!1),u(v("IS")),{transitionAllowed:!1}):(d(v("ICR")),e(!1),{transitionAllowed:!1}):(d(v("ICR")),u(v("IS")),e(!1),{transitionAllowed:!1}),validateData:()=>({isValid:!(!g||!y)})}),[g,y,s,e,v]);const b=M.useCallback(e=>{const t=iZ(e,r,NL.BloodGlucoseUnit.MMOL_L);o({parameters:{...a,overallParameters:{...a.overallParameters,insulinSensitivity:t}}}),s(null),u(void 0),m(!1)},[r,a,o,s]),S=M.useCallback(e=>{const t=Number(e.toFixed(1));a.overallParameters.carbohydrateRatio=t,o({parameters:{...a,overallParameters:{...a.overallParameters,carbohydrateRatio:t}}}),s(null),d(void 0),f(!1)},[a,o,s]),w=M.useMemo(()=>r===NL.BloodGlucoseUnit.MMOL_L?D8:N8,[r]),k=M.useMemo(()=>{const e=r===NL.BloodGlucoseUnit.MMOL_L?2..toFixed(1):36..toString();if(0===y)return w.findIndex(t=>t===e);const t=aZ(y,NL.BloodGlucoseUnit.MMOL_L,r);return w.findIndex(e=>e===t)},[w,r,y]),C=M.useMemo(()=>0===g?L8.findIndex(e=>e===10..toFixed(1)):L8.findIndex(e=>e===g.toFixed(1)),[g]),E=M.useMemo(()=>{const e=aZ(y,NL.BloodGlucoseUnit.MMOL_L,r);return`${y?e:"-"} ${n("fixed_insulin_settings_sensitivity_unit",{displayUnit:_})}`},[y,r,_,n]);return D.createElement(D.Fragment,null,D.createElement(Xa,{contentContainerStyle:[Ree.contentContainer,{width:i}]},D.createElement(_a,null,D.createElement(Ej,{title:n("insulin-to-carb_ratio_title")}),D.createElement(ZB,{isAnimated:!!c},D.createElement(kj,{title:n("insulin-to-carb_ratio_input"),value:`${g||"-"} ${n("fixed_insulin_settings_carb_ratio_unit")}`,testID:"carb_ratio",onPress:()=>{f(!0)},errorMessage:c}))),D.createElement(_a,null,D.createElement(Ej,{title:n("insulin_sensitivity_title")}),D.createElement(ZB,{isAnimated:!!l},D.createElement(kj,{title:n("insulin_sensitivity_input"),value:E,testID:"insulin_sensitivity",onPress:()=>{m(!0)},errorMessage:l}))),D.createElement(w7,null),D.createElement(H8,null)),D.createElement(n3,{testID:"insulin_sensitivity_picker",isVisible:h,items:w,initialScrollIndex:k,onConfirm:b,onCancel:()=>{m(!1)}}),D.createElement(n3,{testID:"insulin_to_carb_ratio_picker",isVisible:p,items:L8,initialScrollIndex:C,onConfirm:S,onCancel:()=>{f(!1)}}))}const Ree=Ei.create({contentContainer:{paddingVertical:32,paddingHorizontal:16,gap:24}});const Aee=Ei.create({scrollContent:{paddingHorizontal:16,paddingVertical:32},spacer:{height:32},itemStyle:{paddingHorizontal:0}}),Lee=iF(function({setNextEnabled:e,ref:t}){const{t:n}=iV(),{COLORS:i}=bL(),{width:r}=vm(),{fastActingInsulin:a,longActingInsulin:o,bloodGlucoseUnits:s,parameters:l,treatmentType:u,diabetesType:c,birthday:d,biologicalSex:h}=U2(),m=G2(),{modalStoreActions:p}=j2(),f=M.useCallback(async()=>{if(void 0===s)throw new Error("[Step6::setUserSettings] bloodGlucoseUnits from userSettingsManager is undefined.");if(void 0===c)throw new Error("[Step6::setUserSettings] diabetesType from userSettingsManager is undefined.");if(void 0===l)throw new Error("[Step6::setUserSettings] parameters from newUserSettingsManager is undefined.");if(void 0===d)throw new Error("[Step6::setUserSettings] birthday from newUserSettingsManager is undefined.");if(void 0===h)throw new Error("[Step6::setUserSettings] biologicalSex from newUserSettingsManager is undefined.");const{carbohydrateRatio:e,insulinSensitivity:t}=l.overallParameters,n=zq(t,e,NL.Usage.Overall);return Uq.setUserSettings({parameters:n,activity:S7(),notifications:{medicineNotification:{toggle:!1,dailyReminderTime:"19:00"},remeasurementNotification:{toggle:!0,remeasurement:1.5}},glucoseLevelTargets:{targetBGLIntervals:[{startTime:"00:00",target:8},{startTime:"05:00",target:6},{startTime:"09:00",target:7},{startTime:"11:00",target:6},{startTime:"13:00",target:7},{startTime:"18:00",target:6},{startTime:"22:00",target:8}],overallTargetBGL:{startTime:"00:00",target:6},use:NL.Usage.Intervals},bloodGlucoseUnits:s,fastActingInsulin:a,longActingInsulin:o,treatmentType:u,diabetesType:c,birthday:d,biologicalSex:h})},[d,s,c,a,h,o,l,u]);M.useImperativeHandle(t,()=>({onBackPress(){jX(FX.SetupSummaryBackPress)},onNextPressed:async()=>{jX(FX.SetupSummaryFinishPress);const t=await f();return t?e(!0):p.set({showSyncErrorModal:!0}),{transitionAllowed:t}},validateData:()=>({isValid:!0})}),[e,p,f]);const _=M.useMemo(()=>{if(void 0===s)throw new Error("[Step6::generalTreatmentItems] bloodGlucoseUnits is undefined");if(void 0===u)throw new Error("[Step6::generalTreatmentItems] treatmentType is undefined");if(void 0===c)throw new Error("[Step6::generalTreatmentItems] diabetesType is undefined");const{text:e}=Kq(s),t=LX(NL.InjectionMethod,u),i=c===NL.DiabetesType.Type1?"type_of_diabetes_type1":"type_of_diabetes_type2";return[{label:n("summary_setup_input_diabetes_type"),value:n(i),testID:"diabetes-type-result"},{label:n("summary_setup_input_treatment_type"),value:Z8[t](),testID:"treatment-type-result"},{label:n("summary_setup_input_glucose_unit"),value:e,testID:"glucose-result"},{label:n("summary_setup_input_rapid-acting_insulin"),value:(a&&$8[a]())??"-",testID:"fast-acting-result"},{label:n("summary_setup_input_long-acting_insulin_input"),value:(o&&G8[o]())??"-",testID:"long-acting-result"}]},[s,c,a,o,u,n]),g=M.useMemo(()=>{if(void 0===s)throw new Error("[Step6::insulinFactorsItems] bloodGlucoseUnits is undefined");const{text:e}=Kq(s),{carbohydrateRatio:t,insulinSensitivity:i}=l?.overallParameters??{};if(void 0===t||void 0===i)throw new Error("[Step6::insulinFactorsItems] carbohydrateRatio or insulinSensitivity is undefined");return[m?{label:n("summary_setup_input_daily_dose_input"),value:m.toFixed(0),unit:n("units"),testID:"total-daily-insulin-result"}:null,{label:n("summary_setup_input_insulin-to-carb_input"),value:`${t}`,unit:n("summary_setup_insulin-to-carb_unit"),testID:"carb-ratio-result"},{label:n("summary_setup_input_insulin_sensitivity_input"),value:aZ(i,NL.BloodGlucoseUnit.MMOL_L,s),unit:n("summary_setup_insulin_sensitivity_unit",{displayUnit:e}),testID:"insulin-sensitivity-result"}].filter(e=>null!==e)},[s,l?.overallParameters,n,m]);return D.createElement(Xa,{testID:"scroll",contentContainerStyle:[Aee.scrollContent,{width:r}]},D.createElement(w7,null),D.createElement(_a,{style:Aee.spacer}),D.createElement(Ej,{title:n("summary_setup_general_title")}),_.map(({testID:e,label:t,value:n,unit:r})=>D.createElement(kj,{key:e,testID:e,title:t,displayStyle:wj.List,displayType:Sj.ListItem,style:Aee.itemStyle,titleStyle:{color:i.labelPrimary},valueStyle:{color:i.labelSecondary},value:`${n} ${r??""}`})),D.createElement(_a,{style:Aee.spacer}),D.createElement(Ej,{title:n("summary_setup_insuling_settings_title")}),g.map(({testID:e,label:t,value:n,unit:r})=>D.createElement(kj,{key:e,testID:e,title:t,displayStyle:wj.List,displayType:Sj.ListItem,style:Aee.itemStyle,titleStyle:{color:i.labelPrimary},valueStyle:{color:i.labelSecondary},value:`${n} ${r??""}`})),D.createElement(V0,null))}),Pee=()=>{const{t:e}=iV(),{width:t}=vm(),{clear:n}=z2(),{setHasCompletedSetupFlow:i}=qz(),r=Wp(),[a,o]=M.useState(2),[s,l]=M.useState(0),[u,c]=M.useState(0),[d,h]=M.useState(!1),[m,p]=M.useState(!1),f=M.useRef(null),_=M.useRef(null);M.useEffect(()=>{n()},[n]);const g=M.useCallback(e=>{h(e)},[]),y=M.useCallback(e=>{p("yes"===e)},[]),v=M.useMemo(()=>[{title:e("general_navigation"),stepNumber:2,renderComponent:e=>D.createElement(wee,{ref:e,setNextEnabled:g})},{title:e("treatment_navigation"),stepNumber:3,renderComponent:e=>D.createElement(Cee,{ref:e,setNextEnabled:g})},{title:e("insulin_settings_navigation"),stepNumber:4,renderComponent:e=>D.createElement(bee,{ref:e,onOptionSelect:y,setNextEnabled:g})},{title:e("insulin_settings_navigation"),stepNumber:4,renderComponent:e=>m?D.createElement(Oee,{ref:e,setNextEnabled:g}):D.createElement(xee,{ref:e,setNextEnabled:g})},{title:e("summary_setup_navigation"),stepNumber:5,renderComponent:e=>D.createElement(Lee,{ref:e,setNextEnabled:g})}],[y,g,m,e]);M.useEffect(()=>{r.setOptions({title:v[s].title})},[s,r,v]),M.useEffect(()=>{if(!_.current)return;const{isValid:e}=_.current.validateData();h(e)},[s,v]);const b=M.useCallback(async()=>{if(!_.current)return;const{transitionAllowed:e}=await _.current.onNextPressed();if(e)if(s===v.length-1)i(!0),r.dispatch(km({index:0,routes:[{name:w2.QuickGuideStack}]}));else{const e=s+1;f.current?.scrollToIndex({index:e,animated:!0}),o(v[e].stepNumber),l(e),c(t=>Math.max(t,e))}},[s,v,r,i]),S=M.useCallback(()=>{if(_.current?.onBackPress(),0===s)r.goBack();else{const e=s-1;f.current?.scrollToIndex({index:e,animated:!0}),o(v[e].stepNumber),l(e),c(t=>Math.max(t,e))}},[s,r,v]);return Yp(M.useCallback(()=>{const e=Au.addEventListener("hardwareBackPress",()=>(S(),!0));return()=>{e.remove()}},[S])),D.createElement(D.Fragment,null,D.createElement(Wo,{ref:f,data:v,renderItem:({item:e,index:n})=>n<=u?e.renderComponent(n===s?_:null):D.createElement(_a,{style:{width:t}}),scrollEnabled:!1,horizontal:!0,initialNumToRender:1,showsHorizontalScrollIndicator:!1}),D.createElement(pee,{currentStep:a,onPress:b,onBackPress:S,inactive:!d,text:s===v.length-1?e("button_complete"):e("button_next")}))},{HEDIA_ACCOUNT_CALLBACK:Mee="",LICENSING_BASE_URL:Dee=""}=Wj;var Nee=(e=>(e.InactiveLicense="/problems/inactive-license",e.InvalidLicense="/problems/invalid-license",e.LicenseNotFound="/problems/license-not-found",e))(Nee||{});const Fee=GB({type:YB("/problems/license-not-found"),title:BB(),status:YB(NL.StatusCode.BAD_REQUEST),detail:BB()}),Bee=GB({type:YB("/problems/invalid-license"),title:BB(),status:YB(NL.StatusCode.BAD_REQUEST),detail:BB()}),jee=GB({type:YB("/problems/inactive-license"),title:BB(),status:YB(NL.StatusCode.BAD_REQUEST),detail:BB()}),Vee=GB({isActive:VB(),key:BB(),startDate:BB(),type:$B(["perpetual","subscription","time-limited"]),endDate:BB().optional(),duration:$B(["P1M","P3M","P6M","P12M"]).optional()});function Hee(e=2){const{setIsLicenseValid:t}=qz(),[n,i]=M.useState(0);return{checkLicense:M.useCallback(async r=>{try{const a=await(async()=>{const e=await VX(Dee+"/check-license?product=HDA"),t=await e.json();if(e.status===NL.StatusCode.OK)return Vee.parse(t);if(e.status===NL.StatusCode.BAD_REQUEST){if(Fee.safeParse(t).success)return Fee.parse(t);if(Bee.safeParse(t).success)return Bee.parse(t);if(jee.safeParse(t).success)return jee.parse(t)}throw Error(`licensing:: Check License failed: ${e.status} - ${t.type||"Unknown error"}`)})();if(n>=e)return void t(!0);if(a.type===Nee.InactiveLicense)return t(!1),await(async()=>{const e=await VX(Dee+"/activate-license",{method:NL.HTTPRequestMethod.POST,headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({product:"HDA"})});return await e.json()})(),void i(e=>e+1);if(a.type===Nee.InvalidLicense||a.type===Nee.LicenseNotFound)return void r(a.type);if(a.isActive)return t(!0),void i(0);t(!1),r()}catch(a){console.error("[useLicenseChecker]",a),t(!0)}},[t,n,e]),retryCount:n}}const zee=({isVisible:e,onCancelPress:t,onContinuePress:n,onModalHide:i})=>{const{t:r}=iV(),{COLORS:a}=bL(),[o,s]=M.useState([!1,!1,!1]),[l,u]=M.useState(!1),c=M.useMemo(()=>o.every(Boolean),[o]);M.useEffect(()=>{e&&(s([!1,!1,!1]),u(!1))},[e]);const d=M.useCallback(e=>{s(t=>t.map((t,n)=>n===e?!t:t))},[]),h=M.useCallback(()=>{l&&c&&i()},[c,l,i]),m=M.useCallback(()=>{u(!0),n()},[n]);return D.createElement(lz,{testID:"restrictions_modal",isVisible:e,enableScroll:!0,onModalHide:h,containerStyle:{backgroundColor:a.bgModal},buttons:[{testID:"restrictions_continue_button",title:r("welcome_modal_button_confirm"),onPress:m,disabled:!c},{testID:"restrictions_cancel_button",title:r("button_cancel"),type:dj.Secondary,onPress:t}]},D.createElement(gj,{style:Uee.title},r("welcome_modal_title")),D.createElement(gj,{style:[Uee.subtitle,{color:a.labelSecondary}]},r("welcome_modal_body")),D.createElement(eh,{testID:"restrictions_checkmark_1",onPress:()=>{d(0)},style:({pressed:e})=>[{opacity:e?.5:1},Uee.checkmarkContainer]},o[0]?D.createElement(q1,null):D.createElement(X1,null),D.createElement(_a,{style:Uee.checkmarkTextContainer},D.createElement(gj,{style:Uee.checkmarkTitle},r("welcome_modal_years_title")),D.createElement(gj,{style:[Uee.checkmarkSubtitle,{color:a.labelSecondary}]},r("welcome_modal_years_body")))),D.createElement(_a,{style:[Uee.separatorLine,{backgroundColor:a.divider}]}),D.createElement(eh,{testID:"restrictions_checkmark_2",onPress:()=>{d(1)},style:({pressed:e})=>[{opacity:e?.5:1},Uee.checkmarkContainer]},o[1]?D.createElement(q1,null):D.createElement(X1,null),D.createElement(_a,{style:Uee.checkmarkTextContainer},D.createElement(gj,{style:Uee.checkmarkTitle},r("welcome_modal_pregnancy_title")),D.createElement(gj,{style:[Uee.checkmarkSubtitle,{color:a.labelSecondary}]},r("welcome_modal_pregnancy_body")))),D.createElement(_a,{style:[Uee.separatorLine,{backgroundColor:a.divider}]}),D.createElement(eh,{testID:"restrictions_checkmark_3",onPress:()=>{d(2)},style:({pressed:e})=>[{opacity:e?.5:1},Uee.checkmarkContainer]},o[2]?D.createElement(q1,null):D.createElement(X1,null),D.createElement(_a,{style:Uee.checkmarkTextContainer},D.createElement(gj,{style:Uee.checkmarkTitle},r("welcome_modal_gestational_title")),D.createElement(gj,{style:[Uee.checkmarkSubtitle,{color:a.labelSecondary}]},r("welcome_modal_gestational_body")))))},Uee=Ei.create({title:{...oj.bold_2XL,marginBottom:8},subtitle:{...oj.regular_Base,marginBottom:16},checkmarkContainer:{paddingVertical:16,flexDirection:"row",justifyContent:"space-between"},checkmarkTextContainer:{flex:1,marginLeft:8},checkmarkTitle:{...oj.semiBold_Base,marginBottom:2},checkmarkSubtitle:{...oj.regular_SM},separatorLine:{width:"100%",height:1}}),Gee=iF(()=>{const{t:e}=iV(),{navigate:t}=Wp(),{clear:n}=z2(),{isLicenseValid:i}=qz(),{checkLicense:r}=Hee(),[a,o]=M.useState(!1);M.useEffect(()=>{n(),uV||r(e=>{t(w2.LicensingStatus,e&&{errorType:e})}).catch(console.error)},[r,n,t]);const s=M.useCallback(()=>{o(!0),jX(FX.SetupIntroStartPress)},[]);return uV||i?D.createElement(D.Fragment,null,D.createElement(dee,{title:e("setup_account_title"),subtitle:e("setup_account_body"),stepChecked:1}),D.createElement(pee,{currentStep:1,isBackVisible:!1,onPress:s,text:e("button_start")}),D.createElement(zee,{isVisible:a,onCancelPress:()=>{o(!1)},onContinuePress:()=>{o(!1)},onModalHide:()=>{t(w2.Setup)}})):D.createElement(eH,null)}),Wee=()=>{const{t:e}=iV(),{COLORS:t}=bL(),{Navigator:n,Screen:i}=O8();return d.jsxs(n,{screenOptions:{...t0,headerStyle:{backgroundColor:t.bgNavigationBar},headerLeft:()=>null,headerBackVisible:!1},children:[d.jsx(i,{name:w2.SetupStart,component:Gee,options:{title:e("setup_account_navigation")}}),d.jsx(i,{name:w2.Setup,component:Pee,options:{title:e("general_navigation")}}),d.jsx(i,{name:w2.BiologicalSex,component:a8,options:{title:e("biological_sex_navigation"),headerLeft:$2}}),d.jsx(i,{name:w2.TreatmentType,component:Q8,options:{title:e("treatment_type_navigation"),headerLeft:$2}}),d.jsx(i,{name:w2.RapidActingInsulin,component:q8,options:{title:e("rapid-acting_insulin_navigation"),headerLeft:$2}}),d.jsx(i,{name:w2.LongActingInsulin,component:Y8,options:{title:e("long-acting_insulin_navigation"),headerLeft:$2}})]})},Yee=()=>{const{Navigator:e,Screen:t}=O8(),{hasCompletedSetupFlow:n}=qz(),{COLORS:i}=bL(),r=M.useMemo(()=>n?w2.QuickGuideStack:w2.SetupBolusCalculator,[n]);return d.jsxs(e,{initialRouteName:r,screenOptions:{...t0,headerStyle:{backgroundColor:i.bgNavigationBar},headerShown:!1},children:[d.jsx(t,{name:w2.SetupBolusCalculator,component:Wee}),d.jsx(t,{name:w2.QuickGuideStack,component:vee})]},r)},$ee=iF(()=>{const{isOnboardingFinished:e,setIsOnboardingFinished:t}=qz(),[n,i]=D.useState(!1),r=M.useCallback(async()=>{if(await gZ.syncAll(),!Uq.uuid)throw window.location.href="/redirect?status=error",new Error("[App::syncData] User settings not found");const e=XB(NL.BloodGlucoseUnit).safeParse(Uq.glucoseUnit);t(e.success)},[t]);return M.useEffect(()=>{r().catch(console.error).finally(()=>{i(!0)})},[r]),n&&void 0!==e?e?d.jsx(cee,{}):d.jsx(Yee,{}):d.jsx(eH,{})}),Xee={prefixes:[],config:{screens:{SetupBolusCalculator:{path:"setup-bolus-calculator",screens:{SetupStart:"setup-start",Setup:"setup",BiologicalSex:"biological-sex",InsulinSettings:"insulin-settings",TreatmentType:"treatment-type",RapidActingInsulin:"rapid-acting-insulin",LongActingInsulin:"long-acting-insulin"}},QuickGuideStack:{path:"quick-guide",screens:{QuickGuideStart:"quick-guide-start",QuickGuide:"quick-guide",QuickGuideAllSet:"quick-guide-all-set"}},NewCalculationStack:{path:"new-calculation",screens:{ActiveInsulin:{path:"active-insulin"},RegisterActiveInsulin:{path:"register"},CalculationBottomTabs:{path:"inputs",screens:{GlucoseTab:{path:"glucose",screens:{Glucose:""}},CarbsTab:{path:"carbs",screens:{Carbs:"",FoodLibrary:"library"}},ActivityTab:{path:"activity",screens:{ActivityOverview:"",AddActivity:"add-activity"}},SummaryTab:{path:"summary",screens:{Summary:""}}}},LoadingRecommendation:{path:"loading"},Recommendation:{path:"recommendation"},LeavingRecommendation:{path:"leaving"}}},IFU:"ifu",SettingsTab:{path:"settings",screens:{Settings:"",ProfileStack:{path:"profile",screens:{Profile:"",BiologicalSex:"biological-sex",TreatmentType:"treatment-type",RapidActingInsulin:"rapid-acting-insulin",LongActingInsulin:"long-acting-insulin",DiabetesType:"diabetes-type"}},GlucoseSettings:"glucose",ActivitySettings:"activity",InsulinSettingsStack:{path:"insulin-settings",screens:{InsulinSettings:"",TreatmentType:"treatment-type",RapidActingInsulin:"rapid-acting-insulin",LongActingInsulin:"long-acting-insulin"}},IFU:"ifu",Legal:"legal",GlucoseUnit:"glucose-unit"}}}}};var qee="web-production",Zee="https://key@sentry-proxy.hedia.io/123456";const Kee=function(){const e=[...Object.keys(Cm),"addListener","removeListener","resetRoot","dispatch","isFocused","canGoBack","getRootState","getState","getParent","getCurrentRoute","getCurrentOptions"],t={},n=(e,n)=>{t[e]&&(t[e]=t[e].filter(e=>e!==n))};let i=null;return{get current(){return i},set current(e){i=e,null!=e&&Object.entries(t).forEach(t=>{let[n,i]=t;i.forEach(t=>{e.addListener(n,t)})})},isReady:()=>null!=i&&i.isReady(),...e.reduce((e,r)=>(e[r]=function(){for(var e=arguments.length,a=new Array(e),o=0;o<e;o++)a[o]=arguments[o];if(null!=i)return i[r](...a);switch(r){case"addListener":{const[e,i]=a;return t[e]=t[e]||[],t[e].push(i),()=>n(e,i)}case"removeListener":{const[e,t]=a;n(e,t);break}default:console.error(Pm)}},e),{})}}();!function(e){const t={...e};var n,i;Ay(t,"react"),n="react",i={version:M.version},rg().setContext(n,i),function(e={}){const t=!e.skipBrowserExtensionCheck&&ob(),n={...e,enabled:!t&&e.enabled,stackParser:(i=e.stackParser||Gv,Array.isArray(i)?Yf(...i):i),integrations:ly({integrations:e.integrations,defaultIntegrations:null==e.defaultIntegrations?[jy(),Ny(),Zv(),Xv(),tb(),ab(),Xy(),rb(),eb()]:e.defaultIntegrations}),transport:e.transport||Fv};var i;Cy(wv,n)}(t)}({dsn:Zee,environment:qee,ignoreErrors:["No text/key with value"],beforeSend:e=>e.message?.includes("No text/key with value")?null:(e.user&&(delete e.user.email,delete e.user.ip_address,delete e.user.username,delete e.user.geo),e)});const Qee=()=>{const{COLORS:e}=bL(),t={..._f,colors:{..._f.colors,background:e.bgPrimary,border:e.divider}};return d.jsx(AS,{children:d.jsx(ee,{children:d.jsx(Rf,{theme:t,ref:Kee,linking:Xee,children:d.jsx($ee,{})})})})};P.createRoot(document.getElementById("root")).render(d.jsx(Qee,{}));
|
|
20
20
|
//# sourceMappingURL=index.bundle.js.map
|