react-timezone-range-picker 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/RelativeTimePanel/index.d.ts.map +1 -1
- package/dist/RelativeTimePanel/timeOptions.d.ts +4 -1
- package/dist/RelativeTimePanel/timeOptions.d.ts.map +1 -1
- package/dist/TimezonePanel/util/getBrowserTimezone.d.ts.map +1 -1
- package/dist/TimezonePanel/util/getTimezones.d.ts.map +1 -1
- package/dist/index.cjs.js +10 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +692 -649
- package/dist/index.es.js.map +1 -1
- package/dist/interfaces/index.d.ts +7 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/RelativeTimePanel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,iBAAiB,GAAI,aAAa,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/RelativeTimePanel/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,iBAAiB,GAAI,aAAa,kBAAkB,4CAmFhE,CAAC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { TimezoneRangePickerOptions } from "../interfaces";
|
|
2
|
+
export type QuickRangeUnit = "seconds" | "minutes" | "hours" | "days";
|
|
1
3
|
export interface ITimeOptions {
|
|
2
4
|
label: string;
|
|
3
5
|
searchKey: string;
|
|
4
6
|
startTime: string;
|
|
5
7
|
endTime: string;
|
|
8
|
+
unit: QuickRangeUnit;
|
|
6
9
|
lineBreak?: boolean;
|
|
7
10
|
}
|
|
8
|
-
export declare const getTimeOptions: (timezoneName: string) => ITimeOptions[];
|
|
11
|
+
export declare const getTimeOptions: (timezoneName: string, options?: TimezoneRangePickerOptions) => ITimeOptions[];
|
|
9
12
|
//# sourceMappingURL=timeOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeOptions.d.ts","sourceRoot":"","sources":["../../src/RelativeTimePanel/timeOptions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"timeOptions.d.ts","sourceRoot":"","sources":["../../src/RelativeTimePanel/timeOptions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAE3D,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,MAAM,CAAC;AAEtE,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAkQD,eAAO,MAAM,cAAc,GACzB,cAAc,MAAM,EACpB,UAAU,0BAA0B,KACnC,YAAY,EASd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getBrowserTimezone.d.ts","sourceRoot":"","sources":["../../../src/TimezonePanel/util/getBrowserTimezone.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getBrowserTimezone.d.ts","sourceRoot":"","sources":["../../../src/TimezonePanel/util/getBrowserTimezone.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,kBAAkB;;;;;;CAW9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getTimezones.d.ts","sourceRoot":"","sources":["../../../src/TimezonePanel/util/getTimezones.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getTimezones.d.ts","sourceRoot":"","sources":["../../../src/TimezonePanel/util/getTimezones.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,YAAY;;;;;;GAWxB,CAAC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),D=require("@mantine/core"),re=require("@mantine/hooks"),ae=require("@mantine/dates");function Ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("react"),D=require("@mantine/core"),re=require("@mantine/hooks"),ae=require("@mantine/dates");function Ce(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge={exports:{}},fe={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var We;function Tt(){if(We)return fe;We=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,c){var i=null;if(c!==void 0&&(i=""+c),s.key!==void 0&&(i=""+s.key),"key"in s){c={};for(var u in s)u!=="key"&&(c[u]=s[u])}else c=s;return s=c.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:c}}return fe.Fragment=t,fe.jsx=r,fe.jsxs=r,fe}var me={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,27 +14,27 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var qe;function bt(){return qe||(qe=1,process.env.NODE_ENV!=="production"&&(function(){function e(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===z?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case
|
|
17
|
+
*/var qe;function bt(){return qe||(qe=1,process.env.NODE_ENV!=="production"&&(function(){function e(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===z?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case x:return"Fragment";case $:return"Profiler";case h:return"StrictMode";case N:return"Suspense";case w:return"SuspenseList";case q:return"Activity"}if(typeof a=="object")switch(typeof a.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),a.$$typeof){case O:return"Portal";case Y:return(a.displayName||"Context")+".Provider";case C:return(a._context.displayName||"Context")+".Consumer";case U:var S=a.render;return a=a.displayName,a||(a=S.displayName||S.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case A:return S=a.displayName||null,S!==null?S:e(a.type)||"Memo";case L:S=a._payload,a=a._init;try{return e(a(S))}catch{}}return null}function t(a){return""+a}function r(a){try{t(a);var S=!1}catch{S=!0}if(S){S=console;var F=S.error,I=typeof Symbol=="function"&&Symbol.toStringTag&&a[Symbol.toStringTag]||a.constructor.name||"Object";return F.call(S,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",I),t(a)}}function n(a){if(a===x)return"<>";if(typeof a=="object"&&a!==null&&a.$$typeof===L)return"<...>";try{var S=e(a);return S?"<"+S+">":"<...>"}catch{return"<...>"}}function s(){var a=V.A;return a===null?null:a.getOwner()}function c(){return Error("react-stack-top-frame")}function i(a){if(X.call(a,"key")){var S=Object.getOwnPropertyDescriptor(a,"key").get;if(S&&S.isReactWarning)return!1}return a.key!==void 0}function u(a,S){function F(){b||(b=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",S))}F.isReactWarning=!0,Object.defineProperty(a,"key",{get:F,configurable:!0})}function o(){var a=e(this.type);return y[a]||(y[a]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),a=this.props.ref,a!==void 0?a:null}function d(a,S,F,I,W,H,G,T){return F=H.ref,a={$$typeof:j,type:a,key:S,props:H,_owner:W},(F!==void 0?F:null)!==null?Object.defineProperty(a,"ref",{enumerable:!1,get:o}):Object.defineProperty(a,"ref",{enumerable:!1,value:null}),a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(a,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(a,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.defineProperty(a,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:T}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a}function v(a,S,F,I,W,H,G,T){var M=S.children;if(M!==void 0)if(I)if(se(M)){for(I=0;I<M.length;I++)_(M[I]);Object.freeze&&Object.freeze(M)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(M);if(X.call(S,"key")){M=e(a);var R=Object.keys(S).filter(function(Z){return Z!=="key"});I=0<R.length?"{key: someKey, "+R.join(": ..., ")+": ...}":"{key: someKey}",P[M+I]||(R=0<R.length?"{"+R.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,I,M,
|
|
22
|
+
<%s key={someKey} {...props} />`,I,M,R,M),P[M+I]=!0)}if(M=null,F!==void 0&&(r(F),M=""+F),i(S)&&(r(S.key),M=""+S.key),"key"in S){F={};for(var K in S)K!=="key"&&(F[K]=S[K])}else F=S;return M&&u(F,typeof a=="function"?a.displayName||a.name||"Unknown":a),d(a,M,H,W,s(),F,G,T)}function _(a){typeof a=="object"&&a!==null&&a.$$typeof===j&&a._store&&(a._store.validated=1)}var g=m,j=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),h=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),z=Symbol.for("react.client.reference"),V=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,se=Array.isArray,E=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(a){return a()}};var b,y={},k=g.react_stack_bottom_frame.bind(g,c)(),p=E(n(c)),P={};me.Fragment=x,me.jsx=function(a,S,F,I,W){var H=1e4>V.recentlyCreatedOwnerStacks++;return v(a,S,F,!1,I,W,H?Error("react-stack-top-frame"):k,H?E(n(a)):p)},me.jsxs=function(a,S,F,I,W){var H=1e4>V.recentlyCreatedOwnerStacks++;return v(a,S,F,!0,I,W,H?Error("react-stack-top-frame"):k,H?E(n(a)):p)}})()),me}var He;function vt(){return He||(He=1,process.env.NODE_ENV==="production"?ge.exports=Tt():ge.exports=bt()),ge.exports}var l=vt();function xt(e,t){var r=m.useRef(!1),n=m.useRef(),s=m.useRef(e),c=m.useCallback(function(){return r.current},[]),i=m.useCallback(function(){r.current=!1,n.current&&clearTimeout(n.current),n.current=setTimeout(function(){r.current=!0,s.current()},t)},[t]),u=m.useCallback(function(){r.current=null,n.current&&clearTimeout(n.current)},[]);return m.useEffect(function(){s.current=e},[e]),m.useEffect(function(){return i(),u},[t]),[c,u,i]}function ct(e,t,r){r===void 0&&(r=[]);var n=xt(e,t),s=n[0],c=n[1],i=n[2];return m.useEffect(i,r),[s,c]}function ut(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=ut(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function lt(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=ut(e))&&(n&&(n+=" "),n+=t);return n}const St="_row_550mo_1",he={row:St,"row-dark":"_row-dark_550mo_5","row-light":"_row-light_550mo_12","row-selected-dark":"_row-selected-dark_550mo_19","row-selected-light":"_row-selected-light_550mo_27"},Ue=()=>{const{colorScheme:e}=D.useMantineColorScheme(),t=D.useMantineTheme();return{colorScheme:e,theme:t}},Be=({name:e,longName:t,currentTime:r,utcOffset:n,selectedTimezone:s,isBrowserTimezone:c=!1,handleTimezoneMouseClick:i=void 0})=>{const{colorScheme:u}=Ue(),o=re.useMediaQuery("(max-width: 48em)"),d=()=>{c||i({name:e,longName:t,utcOffset:n})};return l.jsxs(D.Flex,{direction:"column",className:lt(he.row,c?void 0:u==="dark"?he["row-dark"]:he["row-light"],s?.name===e?u==="dark"?he["row-selected-dark"]:he["row-selected-light"]:void 0),onClick:d,children:[l.jsxs(D.Flex,{justify:"space-between",gap:8,wrap:o?"wrap":"nowrap",children:[l.jsx(D.Text,{size:"sm",children:e}),l.jsxs(D.Text,{size:"sm",children:[r," • UTC",n]})]}),l.jsx(D.Text,{size:"sm",c:o?"dimmed":void 0,children:t})]})};/**
|
|
23
23
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the MIT license.
|
|
26
26
|
* See the LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var
|
|
27
|
+
*/var $t={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
|
|
28
28
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
29
29
|
*
|
|
30
30
|
* This source code is licensed under the MIT license.
|
|
31
31
|
* See the LICENSE file in the root directory of this source tree.
|
|
32
|
-
*/const le=(e,t,r,n)=>{const s=m.forwardRef(({color:c="currentColor",size:
|
|
32
|
+
*/const le=(e,t,r,n)=>{const s=m.forwardRef(({color:c="currentColor",size:i=24,stroke:u=2,title:o,className:d,children:v,..._},g)=>m.createElement("svg",{ref:g,...$t[e],width:i,height:i,className:["tabler-icon",`tabler-icon-${t}`,d].join(" "),...e==="filled"?{fill:c}:{strokeWidth:u,stroke:c},..._},[o&&m.createElement("title",{key:"svg-title"},o),...n.map(([j,O])=>m.createElement(j,O)),...Array.isArray(v)?v:[v]]));return s.displayName=`${r}`,s};/**
|
|
33
33
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
34
34
|
*
|
|
35
35
|
* This source code is licensed under the MIT license.
|
|
36
36
|
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
-
*/const
|
|
37
|
+
*/const gt=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],Ve=le("outline","calendar","Calendar",gt);/**
|
|
38
38
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the MIT license.
|
|
@@ -44,12 +44,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
44
44
|
*
|
|
45
45
|
* This source code is licensed under the MIT license.
|
|
46
46
|
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/const
|
|
47
|
+
*/const wt=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],Me=le("outline","clock","Clock",wt);/**
|
|
48
48
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
49
49
|
*
|
|
50
50
|
* This source code is licensed under the MIT license.
|
|
51
51
|
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const
|
|
52
|
+
*/const kt=[["path",{d:"M4 6h16",key:"svg-0"}],["path",{d:"M6 12h12",key:"svg-1"}],["path",{d:"M9 18h6",key:"svg-2"}]],jt=le("outline","filter-2","Filter2",kt);/**
|
|
53
53
|
* @license @tabler/icons-react v3.35.0 - MIT
|
|
54
54
|
*
|
|
55
55
|
* This source code is licensed under the MIT license.
|
|
@@ -59,5 +59,5 @@ React keys must be passed directly to JSX without using spread:
|
|
|
59
59
|
*
|
|
60
60
|
* This source code is licensed under the MIT license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const Ot=[["path",{d:"M16 2c.183 0 .355 .05 .502 .135l.033 .02c.28 .177 .465 .49 .465 .845v1h1a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h1v-1a1 1 0 0 1 .514 -.874l.093 -.046l.066 -.025l.1 -.029l.107 -.019l.12 -.007q .083 0 .161 .013l.122 .029l.04 .012l.06 .023c.328 .135 .568 .44 .61 .806l.007 .117v1h6v-1a1 1 0 0 1 1 -1m3 7h-14v9.625c0 .705 .386 1.286 .883 1.366l.117 .009h12c.513 0 .936 -.53 .993 -1.215l.007 -.16z",key:"svg-0"}],["path",{d:"M9.015 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-1"}],["path",{d:"M13.015 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-2"}],["path",{d:"M17.02 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-3"}],["path",{d:"M12.02 15a1 1 0 0 1 0 2a1.001 1.001 0 1 1 -.005 -2z",key:"svg-4"}],["path",{d:"M9.015 16a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-5"}]],Mt=le("filled","calendar-week-filled","CalendarWeekFilled",Ot),Ct=({searchText:e,setSearchText:t})=>l.jsx(D.Input,{placeholder:"Timezone search (Asia, Tokyo, +09:00, etc)",leftSection:l.jsx(jt,{stroke:2}),value:e,onChange:r=>t(r.currentTarget.value)});var _e={exports:{}},Ft=_e.exports,Ze;function Pt(){return Ze||(Ze=1,(function(e,t){(function(r,n){e.exports=n()})(Ft,(function(){var r=1e3,n=6e4,s=36e5,c="millisecond",o="second",u="minute",i="hour",d="day",g="week",_="month",$="quarter",j="year",O="date",v="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var b=["th","st","nd","rd"],y=E%100;return"["+E+(b[(y-20)%10]||b[y]||b[0])+"]"}},Y=function(E,b,y){var w=String(E);return!w||w.length>=b?E:""+Array(b+1-w.length).join(y)+E},N={s:Y,z:function(E){var b=-E.utcOffset(),y=Math.abs(b),w=Math.floor(y/60),p=y%60;return(b<=0?"+":"-")+Y(w,2,"0")+":"+Y(p,2,"0")},m:function E(b,y){if(b.date()<y.date())return-E(y,b);var w=12*(y.year()-b.year())+(y.month()-b.month()),p=b.clone().add(w,_),P=y-p<0,a=b.clone().add(w+(P?-1:1),_);return+(-(w+(y-p)/(P?p-a:a-p))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:_,y:j,w:g,d,D:O,h:i,m:u,s:o,ms:c,Q:$}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},R="en",k={};k[R]=C;var A="$isDayjsObject",L=function(E){return E instanceof X||!(!E||!E[A])},q=function E(b,y,w){var p;if(!b)return R;if(typeof b=="string"){var P=b.toLowerCase();k[P]&&(p=P),y&&(k[P]=y,p=P);var a=b.split("-");if(!p&&a.length>1)return E(a[0])}else{var x=b.name;k[x]=b,p=x}return!w&&p&&(R=p),p||!w&&R},z=function(E,b){if(L(E))return E.clone();var y=typeof b=="object"?b:{};return y.date=E,y.args=arguments,new X(y)},V=N;V.l=q,V.i=L,V.w=function(E,b){return z(E,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var X=(function(){function E(y){this.$L=q(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[A]=!0}var b=E.prototype;return b.parse=function(y){this.$d=(function(w){var p=w.date,P=w.utc;if(p===null)return new Date(NaN);if(V.u(p))return new Date;if(p instanceof Date)return new Date(p);if(typeof p=="string"&&!/Z$/i.test(p)){var a=p.match(h);if(a){var x=a[2]-1||0,F=(a[7]||"0").substring(0,3);return P?new Date(Date.UTC(a[1],x,a[3]||1,a[4]||0,a[5]||0,a[6]||0,F)):new Date(a[1],x,a[3]||1,a[4]||0,a[5]||0,a[6]||0,F)}}return new Date(p)})(y),this.init()},b.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},b.$utils=function(){return V},b.isValid=function(){return this.$d.toString()!==v},b.isSame=function(y,w){var p=z(y);return this.startOf(w)<=p&&p<=this.endOf(w)},b.isAfter=function(y,w){return z(y)<this.startOf(w)},b.isBefore=function(y,w){return this.endOf(w)<z(y)},b.$g=function(y,w,p){return V.u(y)?this[w]:this.set(p,y)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(y,w){var p=this,P=!!V.u(w)||w,a=V.p(y),x=function(W,K){var Z=V.w(p.$u?Date.UTC(p.$y,K,W):new Date(p.$y,K,W),p);return P?Z:Z.endOf(d)},F=function(W,K){return V.w(p.toDate()[W].apply(p.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(K)),p)},I=this.$W,U=this.$M,H=this.$D,G="set"+(this.$u?"UTC":"");switch(a){case j:return P?x(1,0):x(31,11);case _:return P?x(1,U):x(0,U+1);case g:var T=this.$locale().weekStart||0,M=(I<T?I+7:I)-T;return x(P?H-M:H+(6-M),U);case d:case O:return F(G+"Hours",0);case i:return F(G+"Minutes",1);case u:return F(G+"Seconds",2);case o:return F(G+"Milliseconds",3);default:return this.clone()}},b.endOf=function(y){return this.startOf(y,!1)},b.$set=function(y,w){var p,P=V.p(y),a="set"+(this.$u?"UTC":""),x=(p={},p[d]=a+"Date",p[O]=a+"Date",p[_]=a+"Month",p[j]=a+"FullYear",p[i]=a+"Hours",p[u]=a+"Minutes",p[o]=a+"Seconds",p[c]=a+"Milliseconds",p)[P],F=P===d?this.$D+(w-this.$W):w;if(P===_||P===j){var I=this.clone().set(O,1);I.$d[x](F),I.init(),this.$d=I.set(O,Math.min(this.$D,I.daysInMonth())).$d}else x&&this.$d[x](F);return this.init(),this},b.set=function(y,w){return this.clone().$set(y,w)},b.get=function(y){return this[V.p(y)]()},b.add=function(y,w){var p,P=this;y=Number(y);var a=V.p(w),x=function(U){var H=z(P);return V.w(H.date(H.date()+Math.round(U*y)),P)};if(a===_)return this.set(_,this.$M+y);if(a===j)return this.set(j,this.$y+y);if(a===d)return x(1);if(a===g)return x(7);var F=(p={},p[u]=n,p[i]=s,p[o]=r,p)[a]||1,I=this.$d.getTime()+y*F;return V.w(I,this)},b.subtract=function(y,w){return this.add(-1*y,w)},b.format=function(y){var w=this,p=this.$locale();if(!this.isValid())return p.invalidDate||v;var P=y||"YYYY-MM-DDTHH:mm:ssZ",a=V.z(this),x=this.$H,F=this.$m,I=this.$M,U=p.weekdays,H=p.months,G=p.meridiem,T=function(K,Z,te,Q){return K&&(K[Z]||K(w,P))||te[Z].slice(0,Q)},M=function(K){return V.s(x%12||12,K,"0")},W=G||function(K,Z,te){var Q=K<12?"AM":"PM";return te?Q.toLowerCase():Q};return P.replace(S,(function(K,Z){return Z||(function(te){switch(te){case"YY":return String(w.$y).slice(-2);case"YYYY":return V.s(w.$y,4,"0");case"M":return I+1;case"MM":return V.s(I+1,2,"0");case"MMM":return T(p.monthsShort,I,H,3);case"MMMM":return T(H,I);case"D":return w.$D;case"DD":return V.s(w.$D,2,"0");case"d":return String(w.$W);case"dd":return T(p.weekdaysMin,w.$W,U,2);case"ddd":return T(p.weekdaysShort,w.$W,U,3);case"dddd":return U[w.$W];case"H":return String(x);case"HH":return V.s(x,2,"0");case"h":return M(1);case"hh":return M(2);case"a":return W(x,F,!0);case"A":return W(x,F,!1);case"m":return String(F);case"mm":return V.s(F,2,"0");case"s":return String(w.$s);case"ss":return V.s(w.$s,2,"0");case"SSS":return V.s(w.$ms,3,"0");case"Z":return a}return null})(K)||a.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(y,w,p){var P,a=this,x=V.p(w),F=z(y),I=(F.utcOffset()-this.utcOffset())*n,U=this-F,H=function(){return V.m(a,F)};switch(x){case j:P=H()/12;break;case _:P=H();break;case $:P=H()/3;break;case g:P=(U-I)/6048e5;break;case d:P=(U-I)/864e5;break;case i:P=U/s;break;case u:P=U/n;break;case o:P=U/r;break;default:P=U}return p?P:V.a(P)},b.daysInMonth=function(){return this.endOf(_).$D},b.$locale=function(){return k[this.$L]},b.locale=function(y,w){if(!y)return this.$L;var p=this.clone(),P=q(y,w,!0);return P&&(p.$L=P),p},b.clone=function(){return V.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},E})(),se=X.prototype;return z.prototype=se,[["$ms",c],["$s",o],["$m",u],["$H",i],["$W",d],["$M",_],["$y",j],["$D",O]].forEach((function(E){se[E[1]]=function(b){return this.$g(b,E[0],E[1])}})),z.extend=function(E,b){return E.$i||(E(b,X,z),E.$i=!0),z},z.locale=q,z.isDayjs=L,z.unix=function(E){return z(1e3*E)},z.en=k[R],z.Ls=k,z.p={},z}))})(_e)),_e.exports}var At=Pt();const f=Ce(At);var Ee={exports:{}},Vt=Ee.exports,Je;function It(){return Je||(Je=1,(function(e,t){(function(r,n){e.exports=n()})(Vt,(function(){var r="minute",n=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(c,o,u){var i=o.prototype;u.utc=function(v){var h={date:v,utc:!0,args:arguments};return new o(h)},i.utc=function(v){var h=u(this.toDate(),{locale:this.$L,utc:!0});return v?h.add(this.utcOffset(),r):h},i.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var d=i.parse;i.parse=function(v){v.utc&&(this.$u=!0),this.$utils().u(v.$offset)||(this.$offset=v.$offset),d.call(this,v)};var g=i.init;i.init=function(){if(this.$u){var v=this.$d;this.$y=v.getUTCFullYear(),this.$M=v.getUTCMonth(),this.$D=v.getUTCDate(),this.$W=v.getUTCDay(),this.$H=v.getUTCHours(),this.$m=v.getUTCMinutes(),this.$s=v.getUTCSeconds(),this.$ms=v.getUTCMilliseconds()}else g.call(this)};var _=i.utcOffset;i.utcOffset=function(v,h){var S=this.$utils().u;if(S(v))return this.$u?0:S(this.$offset)?_.call(this):this.$offset;if(typeof v=="string"&&(v=(function(R){R===void 0&&(R="");var k=R.match(n);if(!k)return null;var A=(""+k[0]).match(s)||["-",0,0],L=A[0],q=60*+A[1]+ +A[2];return q===0?0:L==="+"?q:-q})(v),v===null))return this;var C=Math.abs(v)<=16?60*v:v;if(C===0)return this.utc(h);var Y=this.clone();if(h)return Y.$offset=C,Y.$u=!1,Y;var N=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(Y=this.local().add(C+N,r)).$offset=C,Y.$x.$localOffset=N,Y};var $=i.format;i.format=function(v){var h=v||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return $.call(this,h)},i.valueOf=function(){var v=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*v},i.isUTC=function(){return!!this.$u},i.toISOString=function(){return this.toDate().toISOString()},i.toString=function(){return this.toDate().toUTCString()};var j=i.toDate;i.toDate=function(v){return v==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():j.call(this)};var O=i.diff;i.diff=function(v,h,S){if(v&&this.$u===v.$u)return O.call(this,v,h,S);var C=this.local(),Y=u(v).local();return O.call(C,Y,h,S)}}}))})(Ee)),Ee.exports}var Lt=It();const zt=Ce(Lt);var Oe={exports:{}},Yt=Oe.exports,Qe;function Rt(){return Qe||(Qe=1,(function(e,t){(function(r,n){e.exports=n()})(Yt,(function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(s,c,o){var u,i=function($,j,O){O===void 0&&(O={});var v=new Date($),h=(function(S,C){C===void 0&&(C={});var Y=C.timeZoneName||"short",N=S+"|"+Y,R=n[N];return R||(R=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:Y}),n[N]=R),R})(j,O);return h.formatToParts(v)},d=function($,j){for(var O=i($,j),v=[],h=0;h<O.length;h+=1){var S=O[h],C=S.type,Y=S.value,N=r[C];N>=0&&(v[N]=parseInt(Y,10))}var R=v[3],k=R===24?0:R,A=v[0]+"-"+v[1]+"-"+v[2]+" "+k+":"+v[4]+":"+v[5]+":000",L=+$;return(o.utc(A).valueOf()-(L-=L%1e3))/6e4},g=c.prototype;g.tz=function($,j){$===void 0&&($=u);var O,v=this.utcOffset(),h=this.toDate(),S=h.toLocaleString("en-US",{timeZone:$}),C=Math.round((h-new Date(S))/1e3/60),Y=15*-Math.round(h.getTimezoneOffset()/15)-C;if(!Number(Y))O=this.utcOffset(0,j);else if(O=o(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(Y,!0),j){var N=O.utcOffset();O=O.add(v-N,"minute")}return O.$x.$timezone=$,O},g.offsetName=function($){var j=this.$x.$timezone||o.tz.guess(),O=i(this.valueOf(),j,{timeZoneName:$}).find((function(v){return v.type.toLowerCase()==="timezonename"}));return O&&O.value};var _=g.startOf;g.startOf=function($,j){if(!this.$x||!this.$x.$timezone)return _.call(this,$,j);var O=o(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return _.call(O,$,j).tz(this.$x.$timezone,!0)},o.tz=function($,j,O){var v=O&&j,h=O||j||u,S=d(+o(),h);if(typeof $!="string")return o($).tz(h);var C=(function(k,A,L){var q=k-60*A*1e3,z=d(q,L);if(A===z)return[q,A];var V=d(q-=60*(z-A)*1e3,L);return z===V?[q,z]:[k-60*Math.min(z,V)*1e3,Math.max(z,V)]})(o.utc($,v).valueOf(),S,h),Y=C[0],N=C[1],R=o(Y).utcOffset(N);return R.$x.$timezone=h,R},o.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},o.tz.setDefault=function($){u=$}}}))})(Oe)),Oe.exports}var Nt=Rt();const Kt=Ce(Nt),Wt=(e,t="en-US")=>new Intl.DateTimeFormat(t,{timeZone:e,timeZoneName:"long"}).formatToParts(new Date).find(r=>r.type==="timeZoneName")?.value||"",Ut=e=>{const t=e[0]==="-"?-1:1,[r,n]=e.slice(1).split(":").map(Number);return t*(r*60+n)};f.extend(zt);f.extend(Kt);const qt=()=>Intl.supportedValuesOf("timeZone").map(t=>{const r=f().tz(t).format("Z");return{name:t,longName:Wt(t),currentTime:f().tz(t).format("h:mm A"),utcOffset:r,offsetMinutes:Ut(r)}}).sort((t,r)=>t.offsetMinutes-r.offsetMinutes),De={"timezone-panel-container":"_timezone-panel-container_tykz4_1","search-container":"_search-container_tykz4_6","timezone-scroll-area":"_timezone-scroll-area_tykz4_15","list-container":"_list-container_tykz4_21"},Ke={"form-container":"_form-container_1xxf4_1"},dt=m.createContext(void 0),de=()=>{const e=m.useContext(dt);if(!e)throw new Error("usePopoverContext must be used within a PopoverProvider");return e},Ht=({children:e})=>{const[t,r]=m.useState(!1),n=()=>{r(!1)};return l.jsx(dt.Provider,{value:{popoverOpened:t,setPopoverOpened:r,closePopover:n},children:e})},We=()=>{const{theme:e}=Ne(),{closePopover:t}=de(),r=re.useMediaQuery("(max-width: 48em)"),n=re.useMediaQuery("(max-width: 64em)");return l.jsx(D.Flex,{justify:"flex-end",mt:12,pb:12,children:l.jsxs(D.Flex,{direction:r?"column":"row",gap:12,w:n?"100%":void 0,children:[l.jsx(D.Button,{size:"xs",variant:"subtle",color:e.primaryColor,onClick:t,fullWidth:n,children:"Cancel"}),l.jsx(D.Button,{type:"submit",size:"xs",color:e.primaryColor,fullWidth:n,children:"Apply"})]})})},ee="YYYY/MM/DD",ue="HH:mm:ss",Ie=e=>e.timezone.name?f().tz(e.timezone.name).format(ue):f().format(ue),ft=e=>e.timezone.name?f().tz(e.timezone.name).format(ee):f().format(ee),Bt=e=>f().add(e,"day").format(ee),Zt=e=>e&&f().tz(e).format("Z"),Pe=(e,t="desktop")=>{const r=e.startDate?f(e.startDate):null,n=e.endDate?f(e.endDate):null,s=Zt(e.timezone.name);return!r||!n||!e.startTime||!e.endTime?"Select range":t==="mobile"?r.isSame(n,"day")?`${r.format("MMM D")} · ${e.startTime}`:`${r.format("MMM D")}–${n.format("MMM D")}`:t==="tablet"?`${r.format("MMM D, HH:mm")} → ${n.format("MMM D, HH:mm")}${s?` (${s})`:""}`:`${r.format(ee)} ${e.startTime} - ${n.format(ee)} ${e.endTime}${s?` (${s})`:""}`},oe=(e,t,r,n)=>{const s=f(`${e} ${t}`).subtract(r,n);return{date:s.format(ee),time:s.format(ue)}},ie=(e,t,r,n)=>{const s=f(`${e} ${t}`).add(r,n);return{date:s.format(ee),time:s.format(ue)}},ve=(e,t,r)=>f.tz(`${e} ${t}`,`${ee} ${ue}`,r).utc().toISOString(),xe=(e,t)=>{const r=f.utc(e).tz(t);return{date:r.format(ee),time:r.format(ue)}},mt=({tzRange:e})=>{const[t,r]=m.useState(e.timezone),[n,s]=m.useState([]),[c,o]=m.useState(""),u=re.useMediaQuery("(max-width: 64em)"),{closePopover:i}=de(),d=m.useMemo(()=>qt(),[]);m.useEffect(()=>{s(d)},[]),ct(()=>{if(c===""){s(d);return}s(d.filter(j=>j.name.toLowerCase().includes(c.toLocaleLowerCase())||j.longName.toLowerCase().includes(c.toLocaleLowerCase())||j.currentTime.toLowerCase().includes(c.toLocaleLowerCase())||j.utcOffset.toLowerCase().includes(c.toLocaleLowerCase())))},250,[c]);const g=j=>{r(j)},_=j=>{if(j.preventDefault(),!t?.name||!e.timezone.name||!e.startDate||!e.startTime||!e.endDate||!e.endTime)return;const O=ve(e.startDate,e.startTime,e.timezone.name),v=ve(e.endDate,e.endTime,e.timezone.name),h=xe(O,t.name),S=xe(v,t.name);e.onApply({startDate:h.date,startTime:h.time,endDate:S.date,endTime:S.time,timezone:t||{name:null,longName:null,utcOffset:null}}),u&&i()},$=j=>j?f().tz(j).format("h:mm A"):"";return l.jsxs("form",{className:Ke["form-container"],onSubmit:_,children:[l.jsxs(D.Flex,{direction:"column",className:De["timezone-panel-container"],children:[l.jsx(D.Box,{className:De["search-container"],children:l.jsx(Ct,{searchText:c,setSearchText:o})}),l.jsxs(D.Box,{className:De["timezone-scroll-area"],children:[l.jsx(D.Text,{fw:600,px:12,children:"My Location"}),l.jsx(D.Flex,{direction:"column",children:l.jsx(Be,{isBrowserTimezone:!0,name:e.timezone?.name,longName:e.timezone?.longName,currentTime:$(e.timezone?.name),utcOffset:e.timezone?.utcOffset,selectedTimezone:t})}),l.jsx(D.Text,{fw:600,px:12,children:"Locations"}),l.jsx(D.Flex,{direction:"column",className:De["list-container"],children:n.map((j,O)=>l.jsx(Be,{name:j.name,longName:j.longName,currentTime:j.currentTime,utcOffset:j.utcOffset,selectedTimezone:t,handleTimezoneMouseClick:g},O))})]})]}),l.jsx(D.Box,{px:12,children:l.jsx(We,{})})]})},ye={"sidebar-container":"_sidebar-container_1cvpv_1","sidebar-mobile-relative":"_sidebar-mobile-relative_1cvpv_11","sidebar-row":"_sidebar-row_1cvpv_17"},Ge=e=>[{label:"Today",searchKey:"today",startTime:f().tz(e).startOf("day").format(),endTime:f().tz(e).endOf("day").format()},{label:"Tomorrow",searchKey:"tomorrow",startTime:f().tz(e).add(1,"day").startOf("day").format(),endTime:f().tz(e).add(1,"day").endOf("day").format()},{label:"Yesterday",searchKey:"yesterday",startTime:f().tz(e).subtract(1,"day").startOf("day").format(),endTime:f().tz(e).subtract(1,"day").endOf("day").format(),lineBreak:!0},{label:"Last 15 seconds",searchKey:"-15s",startTime:f().tz(e).subtract(15,"second").format(),endTime:f().tz(e).format()},{label:"Last 30 seconds",searchKey:"-30s",startTime:f().tz(e).subtract(30,"second").format(),endTime:f().tz(e).format()},{label:"Next 15 seconds",searchKey:"+15s",startTime:f().tz(e).format(),endTime:f().tz(e).add(15,"second").format()},{label:"Next 30 seconds",searchKey:"+30s",startTime:f().tz(e).format(),endTime:f().tz(e).add(30,"second").format(),lineBreak:!0},{label:"Last 5 minutes",searchKey:"-5m",startTime:f().tz(e).subtract(5,"minute").format(),endTime:f().tz(e).format()},{label:"Last 10 minutes",searchKey:"-10m",startTime:f().tz(e).subtract(10,"minute").format(),endTime:f().tz(e).format()},{label:"Last 15 minutes",searchKey:"-15m",startTime:f().tz(e).subtract(15,"minute").format(),endTime:f().tz(e).format()},{label:"Last 30 minutes",searchKey:"-30m",startTime:f().tz(e).subtract(30,"minute").format(),endTime:f().tz(e).format()},{label:"Last 45 minutes",searchKey:"-45m",startTime:f().tz(e).subtract(45,"minute").format(),endTime:f().tz(e).format()},{label:"Next 5 minutes",searchKey:"+5m",startTime:f().tz(e).format(),endTime:f().tz(e).add(5,"minute").format()},{label:"Next 10 minutes",searchKey:"+10m",startTime:f().tz(e).format(),endTime:f().tz(e).add(10,"minute").format()},{label:"Next 15 minutes",searchKey:"+15m",startTime:f().tz(e).format(),endTime:f().tz(e).add(15,"minute").format()},{label:"Next 30 minutes",searchKey:"+30m",startTime:f().tz(e).format(),endTime:f().tz(e).add(30,"minute").format()},{label:"Next 45 minutes",searchKey:"+45m",startTime:f().tz(e).format(),endTime:f().tz(e).add(45,"minute").format(),lineBreak:!0},{label:"Last 1 hour",searchKey:"-1h",startTime:f().tz(e).subtract(1,"hour").format(),endTime:f().tz(e).format()},{label:"Last 3 hours",searchKey:"-3h",startTime:f().tz(e).subtract(3,"hour").format(),endTime:f().tz(e).format()},{label:"Last 6 hours",searchKey:"-6h",startTime:f().tz(e).subtract(6,"hour").format(),endTime:f().tz(e).format()},{label:"Last 12 hours",searchKey:"-12h",startTime:f().tz(e).subtract(12,"hour").format(),endTime:f().tz(e).format()},{label:"Next 1 hour",searchKey:"+1h",startTime:f().tz(e).format(),endTime:f().tz(e).add(1,"hour").format()},{label:"Next 3 hours",searchKey:"+3h",startTime:f().tz(e).format(),endTime:f().tz(e).add(3,"hour").format()},{label:"Next 6 hours",searchKey:"+6h",startTime:f().tz(e).format(),endTime:f().tz(e).add(6,"hour").format()},{label:"Next 12 hours",searchKey:"+12h",startTime:f().tz(e).format(),endTime:f().tz(e).add(12,"hour").format(),lineBreak:!0},{label:"Last 1 day",searchKey:"-1d",startTime:f().tz(e).subtract(1,"day").format(),endTime:f().tz(e).format()},{label:"Last 2 days",searchKey:"-2d",startTime:f().tz(e).subtract(2,"day").format(),endTime:f().tz(e).format()},{label:"Last 7 days",searchKey:"-7d",startTime:f().tz(e).subtract(7,"day").format(),endTime:f().tz(e).format()},{label:"Last 14 days",searchKey:"-14d",startTime:f().tz(e).subtract(14,"day").format(),endTime:f().tz(e).format()},{label:"Last 30 days",searchKey:"-30d",startTime:f().tz(e).subtract(30,"day").format(),endTime:f().tz(e).format()},{label:"Next 1 day",searchKey:"+1d",startTime:f().tz(e).format(),endTime:f().tz(e).add(1,"day").format()},{label:"Next 2 days",searchKey:"+2d",startTime:f().tz(e).format(),endTime:f().tz(e).add(2,"day").format()},{label:"Next 7 days",searchKey:"+7d",startTime:f().tz(e).format(),endTime:f().tz(e).add(7,"day").format()},{label:"Next 14 days",searchKey:"+14d",startTime:f().tz(e).format(),endTime:f().tz(e).add(14,"day").format()},{label:"Next 30 days",searchKey:"+30d",startTime:f().tz(e).format(),endTime:f().tz(e).add(30,"day").format()}],pe={"relative-time-root":"_relative-time-root_emohw_1","relative-time-panel-container":"_relative-time-panel-container_emohw_9","time-row":"_time-row_emohw_16","time-row-dark":"_time-row-dark_emohw_20","time-row-light":"_time-row-light_emohw_26"},Xe=({tzRange:e})=>{const[t,r]=m.useState([]),[n,s]=m.useState(""),{colorScheme:c}=Ne(),{closePopover:o}=de();m.useEffect(()=>{if(e.timezone.name!==null){const i=Ge(e.timezone.name);r(i)}},[e.timezone]),ct(()=>{if(n===""){r(Ge(e.timezone.name));return}const i=t.filter(d=>d.searchKey.includes(n));r(i)},250,[n]);const u=i=>{const[d,g]=i.startTime.split("T"),[_,$]=i.endTime.split("T");e.onApply({startDate:d,startTime:g.slice(0,8),endDate:_,endTime:$.slice(0,8),timezone:e.timezone}),o()};return l.jsxs(D.Flex,{direction:"column",className:pe["relative-time-root"],children:[l.jsx(D.Box,{style:{width:"90%"},mx:"auto",children:l.jsx(D.Input,{placeholder:"Relative time (15m, 1h, 1d, 1w)",value:n,onChange:i=>s(i.currentTarget.value)})}),l.jsx(D.Flex,{direction:"column",className:pe["relative-time-panel-container"],children:t.map(i=>l.jsxs(D.Flex,{align:"center",justify:"space-between",className:lt(c==="dark"?pe["time-row-dark"]:pe["time-row-light"],pe["time-row"]),py:4,px:12,mb:i.lineBreak?8:0,onClick:()=>u(i),children:[l.jsx(D.Text,{size:"sm",children:i.label}),l.jsx(D.Text,{size:"xs",c:"#5f6368",children:i.searchKey})]},i.label))})]})},et=({setSelectedPanel:e,tzRange:t,mobileOnlyRelative:r=!1})=>r?l.jsx(D.Box,{className:ye["sidebar-mobile-relative"],children:l.jsx(Xe,{tzRange:t})}):l.jsxs(D.Box,{className:ye["sidebar-container"],flex:1,children:[l.jsx(Xe,{tzRange:t}),l.jsxs(D.Flex,{direction:"column",rowGap:16,py:8,style:{borderTop:"1px solid #ddd"},children:[l.jsxs(D.Flex,{className:ye["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(be.START_END_TIME),children:[l.jsxs(D.Flex,{align:"center",children:[l.jsx(Mt,{stroke:1.5}),l.jsx(D.Text,{size:"sm",children:"Start and end times"})]}),l.jsx(Fe,{stroke:1.5})]}),l.jsxs(D.Flex,{className:ye["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(be.AROUND_TIME),children:[l.jsxs(D.Flex,{align:"center",children:[l.jsx(Me,{stroke:1.5}),l.jsx(D.Text,{size:"sm",children:"Around a time"})]}),l.jsx(Fe,{stroke:1.5})]}),l.jsxs(D.Flex,{className:ye["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(be.TIMEZONE),children:[l.jsxs(D.Flex,{align:"center",children:[l.jsx(Et,{stroke:1.5}),l.jsx(D.Text,{size:"sm",children:"Time zone"})]}),l.jsx(Fe,{stroke:1.5})]})]})]});var ht=(e=>(e.ThirtySeconds="± 30 seconds",e.OneMinute="± 1 minute",e.FifteenMinutes="± 15 minutes",e.ThirtyMinutes="± 30 minutes",e.OneHour="± 1 hour",e.OneDay="± 1 day",e))(ht||{});const Jt=["± 30 seconds","± 1 minute","± 15 minutes","± 30 minutes","± 1 hour","± 1 day"],Qt=(e,t,r)=>{switch(r){case"± 30 seconds":const n=oe(e,t,30,"second"),s=ie(e,t,30,"second");return{startDate:n.date,startTime:n.time,endDate:s.date,endTime:s.time};case"± 1 minute":const c=oe(e,t,1,"minute"),o=ie(e,t,1,"minute");return{startDate:c.date,startTime:c.time,endDate:o.date,endTime:o.time};case"± 15 minutes":const u=oe(e,t,15,"minute"),i=ie(e,t,15,"minute");return{startDate:u.date,startTime:u.time,endDate:i.date,endTime:i.time};case"± 30 minutes":const d=oe(e,t,30,"minute"),g=ie(e,t,30,"minute");return{startDate:d.date,startTime:d.time,endDate:g.date,endTime:g.time};case"± 1 hour":const _=oe(e,t,1,"hour"),$=ie(e,t,1,"hour");return{startDate:_.date,startTime:_.time,endDate:$.date,endTime:$.time};case"± 1 day":const j=oe(e,t,1,"day"),O=ie(e,t,1,"day");return{startDate:j.date,startTime:j.time,endDate:O.date,endTime:O.time};default:return{startDate:e,startTime:t,endDate:e,endTime:t}}};function Gt(e){if(!/^[0-9a-zA-Z-]+$/.test(e))throw new Error(`[@mantine/use-form] Form name "${e}" is invalid, it should contain only letters, numbers and dashes`)}const Xt=typeof window<"u"?m.useLayoutEffect:m.useEffect;function J(e,t){Xt(()=>{if(e)return window.addEventListener(e,t),()=>window.removeEventListener(e,t)},[e])}function er(e,t){e&&Gt(e),J(`mantine-form:${e}:set-field-value`,r=>t.setFieldValue(r.detail.path,r.detail.value)),J(`mantine-form:${e}:set-values`,r=>t.setValues(r.detail)),J(`mantine-form:${e}:set-initial-values`,r=>t.setInitialValues(r.detail)),J(`mantine-form:${e}:set-errors`,r=>t.setErrors(r.detail)),J(`mantine-form:${e}:set-field-error`,r=>t.setFieldError(r.detail.path,r.detail.error)),J(`mantine-form:${e}:clear-field-error`,r=>t.clearFieldError(r.detail)),J(`mantine-form:${e}:clear-errors`,t.clearErrors),J(`mantine-form:${e}:reset`,t.reset),J(`mantine-form:${e}:validate`,t.validate),J(`mantine-form:${e}:validate-field`,r=>t.validateField(r.detail)),J(`mantine-form:${e}:reorder-list-item`,r=>t.reorderListItem(r.detail.path,r.detail.payload)),J(`mantine-form:${e}:remove-list-item`,r=>t.removeListItem(r.detail.path,r.detail.index)),J(`mantine-form:${e}:insert-list-item`,r=>t.insertListItem(r.detail.path,r.detail.item,r.detail.index)),J(`mantine-form:${e}:set-dirty`,r=>t.setDirty(r.detail)),J(`mantine-form:${e}:set-touched`,r=>t.setTouched(r.detail)),J(`mantine-form:${e}:reset-dirty`,r=>t.resetDirty(r.detail)),J(`mantine-form:${e}:reset-touched`,t.resetTouched)}function tr(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:r}=t;r instanceof HTMLInputElement?r.type==="checkbox"?e(r.checked):e(r.value):(r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)&&e(r.value)}else e(t)}}function Le(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,r)=>{const n=e[r];return n!=null&&n!==!1&&(t[r]=n),t},{})}function rr(e){const[t,r]=m.useState(Le(e)),n=m.useRef(t),s=m.useCallback(i=>{r(d=>{const g=Le(typeof i=="function"?i(d):i);return n.current=g,g})},[]),c=m.useCallback(()=>s({}),[]),o=m.useCallback(i=>{n.current[i]!==void 0&&s(d=>{const g={...d};return delete g[i],g})},[t]),u=m.useCallback((i,d)=>{d==null||d===!1?o(i):n.current[i]!==d&&s(g=>({...g,[i]:d}))},[t]);return{errorsState:t,setErrors:s,clearErrors:c,setFieldError:u,clearFieldError:o}}function ze(e,t){if(t===null||typeof t!="object")return{};const r={...t};return Object.keys(t).forEach(n=>{n.includes(`${String(e)}.`)&&delete r[n]}),r}function tt(e,t){const r=e.substring(t.length+1).split(".")[0];return parseInt(r,10)}function rt(e,t,r,n){if(t===void 0)return r;const s=`${String(e)}`;let c=r;n===-1&&(c=ze(`${s}.${t}`,c));const o={...c},u=new Set;return Object.entries(c).filter(([i])=>{if(!i.startsWith(`${s}.`))return!1;const d=tt(i,s);return Number.isNaN(d)?!1:d>=t}).forEach(([i,d])=>{const g=tt(i,s),_=i.replace(`${s}.${g}`,`${s}.${g+n}`);o[_]=d,u.add(_),u.has(i)||delete o[i]}),o}function nr(e,{from:t,to:r},n){const s=`${e}.${t}`,c=`${e}.${r}`,o={...n},u=new Set;return Object.keys(n).forEach(i=>{if(u.has(i))return;let d,g;if(i.startsWith(s)?(d=i,g=i.replace(s,c)):i.startsWith(c)&&(d=i.replace(c,s),g=i),d&&g){const _=o[d],$=o[g];$===void 0?delete o[d]:o[d]=$,_===void 0?delete o[g]:o[g]=_,u.add(d),u.add(g)}}),o}function nt(e,t,r){typeof r.value=="object"&&(r.value=ce(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function ce(e){if(typeof e!="object")return e;var t=0,r,n,s,c=Object.prototype.toString.call(e);if(c==="[object Object]"?s=Object.create(e.__proto__||null):c==="[object Array]"?s=Array(e.length):c==="[object Set]"?(s=new Set,e.forEach(function(o){s.add(ce(o))})):c==="[object Map]"?(s=new Map,e.forEach(function(o,u){s.set(ce(u),ce(o))})):c==="[object Date]"?s=new Date(+e):c==="[object RegExp]"?s=new RegExp(e.source,e.flags):c==="[object DataView]"?s=new e.constructor(ce(e.buffer)):c==="[object ArrayBuffer]"?s=e.slice(0):c.slice(-6)==="Array]"&&(s=new e.constructor(e)),s){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)nt(s,n[t],Object.getOwnPropertyDescriptor(e,n[t]));for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++)Object.hasOwnProperty.call(s,r=n[t])&&s[r]===e[r]||nt(s,r,Object.getOwnPropertyDescriptor(e,r))}return s||e}function yt(e){return typeof e!="string"?[]:e.split(".")}function B(e,t){const r=yt(e);if(r.length===0||typeof t!="object"||t===null)return;let n=t[r[0]];for(let s=1;s<r.length&&n!=null;s+=1)n=n[r[s]];return n}function ge(e,t,r){const n=yt(e);if(n.length===0)return r;const s=ce(r);if(n.length===1)return s[n[0]]=t,s;let c=s[n[0]];for(let o=1;o<n.length-1;o+=1){if(c===void 0)return s;c=c[n[o]]}return c[n[n.length-1]]=t,s}function sr(e,{from:t,to:r},n){const s=B(e,n);if(!Array.isArray(s))return n;const c=[...s],o=s[t];return c.splice(t,1),c.splice(r,0,o),ge(e,c,n)}function or(e,t,r,n){const s=B(e,n);if(!Array.isArray(s))return n;const c=[...s];return c.splice(typeof r=="number"?r:c.length,0,t),ge(e,c,n)}function ir(e,t,r){const n=B(e,r);return Array.isArray(n)?ge(e,n.filter((s,c)=>c!==t),r):r}function ar(e,t,r,n){const s=B(e,n);if(!Array.isArray(s)||s.length<=r)return n;const c=[...s];return c[r]=t,ge(e,c,n)}function cr({$values:e,$errors:t,$status:r}){const n=m.useCallback((u,i)=>{r.clearFieldDirty(u),t.setErrors(d=>nr(u,i,d)),e.setValues({values:sr(u,i,e.refValues.current),updateState:!0})},[]),s=m.useCallback((u,i)=>{r.clearFieldDirty(u),t.setErrors(d=>rt(u,i,d,-1)),e.setValues({values:ir(u,i,e.refValues.current),updateState:!0})},[]),c=m.useCallback((u,i,d)=>{r.clearFieldDirty(u),t.setErrors(g=>rt(u,d,g,1)),e.setValues({values:or(u,i,d,e.refValues.current),updateState:!0})},[]),o=m.useCallback((u,i,d)=>{r.clearFieldDirty(u),e.setValues({values:ar(u,d,i,e.refValues.current),updateState:!0})},[]);return{reorderListItem:n,removeListItem:s,insertListItem:c,replaceListItem:o}}var Ae,st;function ur(){return st||(st=1,Ae=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,c;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(c=Object.keys(t),n=c.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,c[s]))return!1;for(s=n;s--!==0;){var o=c[s];if(!e(t[o],r[o]))return!1}return!0}return t!==t&&r!==r}),Ae}var lr=ur();const ke=Ce(lr);function Te(e,t){const r=Object.keys(e);if(typeof t=="string"){const n=r.filter(s=>s.startsWith(`${t}.`));return e[t]||n.some(s=>e[s])||!1}return r.some(n=>e[n])}function dr({initialDirty:e,initialTouched:t,mode:r,$values:n}){const[s,c]=m.useState(t),[o,u]=m.useState(e),i=m.useRef(t),d=m.useRef(e),g=m.useCallback(k=>{const A=typeof k=="function"?k(i.current):k;i.current=A,r==="controlled"&&c(A)},[]),_=m.useCallback((k,A=!1)=>{const L=typeof k=="function"?k(d.current):k;d.current=L,(r==="controlled"||A)&&u(L)},[]),$=m.useCallback(()=>g({}),[]),j=m.useCallback(k=>{const A=k?{...n.refValues.current,...k}:n.refValues.current;n.setValuesSnapshot(A),_({})},[]),O=m.useCallback((k,A)=>{g(L=>Te(L,k)===A?L:{...L,[k]:A})},[]),v=m.useCallback((k,A,L)=>{_(q=>Te(q,k)===A?q:{...q,[k]:A},L)},[]),h=m.useCallback((k,A)=>{const L=Te(d.current,k),q=!ke(B(k,n.getValuesSnapshot()),A),z=ze(k,d.current);z[k]=q,_(z,L!==q)},[]),S=m.useCallback(k=>Te(i.current,k),[]),C=m.useCallback(k=>_(A=>{if(typeof k!="string")return A;const L=ze(k,A);return delete L[k],ke(L,A)?A:L}),[]),Y=m.useCallback(k=>{if(k){const L=B(k,d.current);if(typeof L=="boolean")return L;const q=B(k,n.refValues.current),z=B(k,n.valuesSnapshot.current);return!ke(q,z)}return Object.keys(d.current).length>0?Te(d.current):!ke(n.refValues.current,n.valuesSnapshot.current)},[]),N=m.useCallback(()=>d.current,[]),R=m.useCallback(()=>i.current,[]);return{touchedState:s,dirtyState:o,touchedRef:i,dirtyRef:d,setTouched:g,setDirty:_,resetDirty:j,resetTouched:$,isTouched:S,setFieldTouched:O,setFieldDirty:v,setTouchedState:c,setDirtyState:u,clearFieldDirty:C,isDirty:Y,getDirty:N,getTouched:R,setCalculatedFieldDirty:h}}function fr({initialValues:e,onValuesChange:t,mode:r}){const n=m.useRef(!1),[s,c]=m.useState(e||{}),o=m.useRef(s),u=m.useRef(s),i=m.useCallback(({values:h,subscribers:S,updateState:C=!0,mergeWithPreviousValues:Y=!0})=>{const N=o.current,R=h instanceof Function?h(o.current):h,k=Y?{...N,...R}:R;o.current=k,C&&(c(k),r==="uncontrolled"&&(o.current=k)),t?.(k,N),S?.filter(Boolean).forEach(A=>A({updatedValues:k,previousValues:N}))},[t]),d=m.useCallback(h=>{const S=B(h.path,o.current),C=h.value instanceof Function?h.value(S):h.value;if(S!==C){const Y=o.current,N=ge(h.path,C,o.current);i({values:N,updateState:h.updateState}),h.subscribers?.filter(Boolean).forEach(R=>R({path:h.path,updatedValues:N,previousValues:Y}))}},[i]),g=m.useCallback(h=>{u.current=h},[]),_=m.useCallback((h,S)=>{n.current||(n.current=!0,i({values:h,updateState:r==="controlled"}),g(h),S())},[i]),$=m.useCallback(()=>{i({values:u.current,updateState:!0,mergeWithPreviousValues:!1})},[i]),j=m.useCallback(()=>o.current,[]),O=m.useCallback(()=>u.current,[]),v=m.useCallback((h,S)=>{const C=B(h,u.current);typeof C>"u"||d({path:h,value:C,updateState:r==="controlled",subscribers:S})},[d,r]);return{initialized:n,stateValues:s,refValues:o,valuesSnapshot:u,setValues:i,setFieldValue:d,resetValues:$,setValuesSnapshot:g,initialize:_,getValues:j,getValuesSnapshot:O,resetField:v}}function mr({$status:e,cascadeUpdates:t}){const r=m.useRef({}),n=m.useCallback((c,o)=>{m.useEffect(()=>(r.current[c]=r.current[c]||[],r.current[c].push(o),()=>{r.current[c]=r.current[c].filter(u=>u!==o)}),[o])},[]),s=m.useCallback(c=>{const o=r.current[c]?.map(u=>i=>u({previousValue:B(c,i.previousValues),value:B(c,i.updatedValues),touched:e.isTouched(c),dirty:e.isDirty(c)}))??[];if(t)for(const u in r.current)(u.startsWith(`${c}.`)||c.startsWith(`${u}.`))&&o.push(...r.current[u].map(i=>d=>i({previousValue:B(u,d.previousValues),value:B(u,d.updatedValues),touched:e.isTouched(u),dirty:e.isDirty(u)})));return o},[]);return{subscribers:r,watch:n,getFieldSubscribers:s}}function ot(e,t){return e?`${e}-${t.toString()}`:t.toString()}const we=Symbol("root-rule");function it(e){const t=Le(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function Ye(e,t,r="",n={}){return typeof e!="object"||e===null?n:Object.keys(e).reduce((s,c)=>{const o=e[c],u=`${r===""?"":`${r}.`}${c}`,i=B(u,t);let d=!1;return typeof o=="function"&&(s[u]=o(i,t,u)),typeof o=="object"&&Array.isArray(i)&&(d=!0,i.forEach((g,_)=>Ye(o,t,`${u}.${_}`,s)),we in o&&(s[u]=o[we](i,t,u))),typeof o=="object"&&typeof i=="object"&&i!==null&&(d||Ye(o,t,u,s),we in o&&(s[u]=o[we](i,t,u))),s},n)}function Re(e,t){return it(typeof e=="function"?e(t):Ye(e,t))}function je(e,t,r){if(typeof e!="string")return{hasError:!1,error:null};const n=Re(t,r),s=Object.keys(n.errors).find(c=>e.split(".").every((o,u)=>o===c.split(".")[u]));return{hasError:!!s,error:s?n.errors[s]:null}}const hr="__MANTINE_FORM_INDEX__";function at(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]+/g,`.${hr}`)):!1:!1}function pt({name:e,mode:t="controlled",initialValues:r,initialErrors:n={},initialDirty:s={},initialTouched:c={},clearInputErrorOnChange:o=!0,validateInputOnChange:u=!1,validateInputOnBlur:i=!1,onValuesChange:d,transformValues:g=(h=>h),enhanceGetInputProps:_,validate:$,onSubmitPreventDefault:j="always",touchTrigger:O="change",cascadeUpdates:v=!1}={}){const h=rr(n),S=fr({initialValues:r,onValuesChange:d,mode:t}),C=dr({initialDirty:s,initialTouched:c,$values:S,mode:t}),Y=cr({$values:S,$errors:h,$status:C}),N=mr({$status:C,cascadeUpdates:v}),[R,k]=m.useState(0),[A,L]=m.useState({}),[q,z]=m.useState(!1),V=m.useCallback(()=>{S.resetValues(),h.clearErrors(),C.resetDirty(),C.resetTouched(),t==="uncontrolled"&&k(T=>T+1)},[]),X=m.useCallback(T=>{o&&h.clearErrors(),t==="uncontrolled"&&k(M=>M+1),Object.keys(N.subscribers.current).forEach(M=>{const W=B(M,S.refValues.current),K=B(M,T);W!==K&&N.getFieldSubscribers(M).forEach(Z=>Z({previousValues:T,updatedValues:S.refValues.current}))})},[o]),se=m.useCallback(T=>{const M=S.refValues.current;S.initialize(T,()=>t==="uncontrolled"&&k(W=>W+1)),X(M)},[X]),E=m.useCallback((T,M,W)=>{const K=at(T,u),Z=M instanceof Function?M(B(T,S.refValues.current)):M;C.setCalculatedFieldDirty(T,Z),O==="change"&&C.setFieldTouched(T,!0),!K&&o&&h.clearFieldError(T),S.setFieldValue({path:T,value:M,updateState:t==="controlled",subscribers:[...N.getFieldSubscribers(T),K?te=>{const Q=je(T,$,te.updatedValues);Q.hasError?h.setFieldError(T,Q.error):h.clearFieldError(T)}:null,W?.forceUpdate!==!1&&t!=="controlled"?()=>L(te=>({...te,[T]:(te[T]||0)+1})):null]})},[d,$]),b=m.useCallback(T=>{const M=S.refValues.current;S.setValues({values:T,updateState:t==="controlled"}),X(M)},[d,X]),y=m.useCallback(()=>{const T=Re($,S.refValues.current);return h.setErrors(T.errors),T},[$]),w=m.useCallback(T=>{const M=je(T,$,S.refValues.current);return M.hasError?h.setFieldError(T,M.error):h.clearFieldError(T),M},[$]),p=(T,{type:M="input",withError:W=!0,withFocus:K=!0,...Z}={})=>{const Q={onChange:tr(Se=>E(T,Se,{forceUpdate:!1})),"data-path":ot(e,T)};return W&&(Q.error=h.errorsState[T]),M==="checkbox"?Q[t==="controlled"?"checked":"defaultChecked"]=B(T,S.refValues.current):Q[t==="controlled"?"value":"defaultValue"]=B(T,S.refValues.current),K&&(Q.onFocus=()=>C.setFieldTouched(T,!0),Q.onBlur=()=>{if(at(T,i)){const Se=je(T,$,S.refValues.current);Se.hasError?h.setFieldError(T,Se.error):h.clearFieldError(T)}}),Object.assign(Q,_?.({inputProps:Q,field:T,options:{type:M,withError:W,withFocus:K,...Z},form:G}))},P=(T,M)=>W=>{j==="always"&&W?.preventDefault();const K=y();if(K.hasErrors)j==="validation-failed"&&W?.preventDefault(),M?.(K.errors,S.refValues.current,W);else{const Z=T?.(g(S.refValues.current),W);Z instanceof Promise&&(z(!0),Z.finally(()=>z(!1)))}},a=T=>g(T||S.refValues.current),x=m.useCallback(T=>{T.preventDefault(),V()},[]),F=m.useCallback(T=>T?!je(T,$,S.refValues.current).hasError:!Re($,S.refValues.current).hasErrors,[$]),I=T=>`${R}-${String(T)}-${A[String(T)]||0}`,U=m.useCallback(T=>document.querySelector(`[data-path="${ot(e,T)}"]`),[]),H=m.useCallback(T=>{S.resetField(T,[t!=="controlled"?()=>L(M=>({...M,[T]:(M[T]||0)+1})):null])},[S.resetField,t,L]),G={watch:N.watch,initialized:S.initialized.current,values:t==="uncontrolled"?S.refValues.current:S.stateValues,getValues:S.getValues,getInitialValues:S.getValuesSnapshot,setInitialValues:S.setValuesSnapshot,resetField:H,initialize:se,setValues:b,setFieldValue:E,submitting:q,setSubmitting:z,errors:h.errorsState,setErrors:h.setErrors,setFieldError:h.setFieldError,clearFieldError:h.clearFieldError,clearErrors:h.clearErrors,resetDirty:C.resetDirty,setTouched:C.setTouched,setDirty:C.setDirty,isTouched:C.isTouched,resetTouched:C.resetTouched,isDirty:C.isDirty,getTouched:C.getTouched,getDirty:C.getDirty,reorderListItem:Y.reorderListItem,insertListItem:Y.insertListItem,removeListItem:Y.removeListItem,replaceListItem:Y.replaceListItem,reset:V,validate:y,validateField:w,getInputProps:p,onSubmit:P,onReset:x,isValid:F,getTransformedValues:a,key:I,getInputNode:U};return er(e,G),G}const yr=({tzRange:e})=>{const t=re.useMediaQuery("(max-width: 64em)"),{closePopover:r}=de(),n=e.timezone.utcOffset?`GMT${e.timezone.utcOffset}`:e.timezone?.longName,s=pt({initialValues:{date:e.startDate??ft(e),time:e.startTime??Ie(e),duration:ht.OneDay},validate:{date:o=>o?null:"Date is required",time:o=>o?null:"Time is required",duration:o=>o?null:"Duration is required"}}),c=o=>{if(!e.timezone.name)return;const u=ve(o.date,o.time,e.timezone.name),i=xe(u,e.timezone.name),{startDate:d,startTime:g,endDate:_,endTime:$}=Qt(i.date,i.time,o.duration);e.onApply({startDate:d,startTime:g,endDate:_,endTime:$,timezone:e.timezone}),t&&r()};return l.jsx(D.Flex,{direction:"column",flex:2,justify:"space-between",style:{height:"100%"},px:12,children:l.jsxs("form",{className:Ke["form-container"],onSubmit:s.onSubmit(c),children:[l.jsxs(D.Box,{children:[l.jsx(D.Text,{fw:600,children:"Around a time"}),l.jsxs(D.Flex,{direction:"column",gap:8,mt:12,children:[l.jsx(ae.DatePickerInput,{label:"Pick date",placeholder:"Pick date",...s.getInputProps("date"),popoverProps:{withinPortal:!1},valueFormat:ee,leftSection:l.jsx(Ve,{stroke:1.5})},s.key("date")),l.jsx(ae.TimeInput,{label:"Pick time",placeholder:"Pick time",withSeconds:!0,...s.getInputProps("time"),leftSection:l.jsx(Me,{stroke:1.5}),rightSection:t?void 0:l.jsx(D.Text,{style:{fontSize:12,fontStyle:"italic",textAlign:"right"},children:e.timezone?.longName}),rightSectionWidth:t?void 0:180,rightSectionProps:{style:{paddingRight:1}}},s.key("time")),t&&n?l.jsx(D.Text,{size:"xs",c:"dimmed",mt:-4,children:n}):null,l.jsx(D.Select,{label:"Duration",placeholder:"Pick value",data:Jt,...s.getInputProps("duration"),comboboxProps:{withinPortal:!1}},s.key("duration"))]})]}),l.jsx(We,{})]})})},pr=({tzRange:e})=>{const t=re.useMediaQuery("(max-width: 64em)"),{closePopover:r}=de(),n=e.timezone.utcOffset?`GMT${e.timezone.utcOffset}`:e.timezone?.longName,s=pt({mode:"uncontrolled",initialValues:{startDate:e.startDate??ft(e),startTime:e.startTime??Ie(e),endDate:e.endDate??Bt(30),endTime:e.endTime??Ie(e)},validate:{startDate:o=>o?null:"Start date is required",startTime:o=>o?null:"Start time is required",endDate:(o,u)=>{if(!o)return"End date is required";const i=f(`${u.startDate} ${u.startTime}`),d=f(`${o} ${u.endTime}`);return d.isAfter(i)||d.isSame(i)?null:"End time must be after start time"},endTime:(o,u)=>{if(!o)return"End time is required";const i=f(`${u.startDate} ${u.startTime}`),d=f(`${u.endDate} ${o}`);return d.isAfter(i)||d.isSame(i)?null:"End time must be after start time"}}}),c=o=>{if(!e.timezone.name)return;const u=ve(o.startDate,o.startTime,e.timezone.name),i=ve(o.endDate,o.endTime,e.timezone.name),d=xe(u,e.timezone.name),g=xe(i,e.timezone.name);e.onApply({startDate:d.date,startTime:d.time,endDate:g.date,endTime:g.time,timezone:e.timezone}),t&&r()};return l.jsx(D.Flex,{direction:"column",flex:2,style:{height:"100%"},px:12,children:l.jsxs("form",{className:Ke["form-container"],onSubmit:s.onSubmit(c),children:[l.jsxs(D.Box,{children:[l.jsx(D.Text,{fw:600,children:"Start and end times"}),l.jsxs(D.Flex,{direction:"column",gap:8,mt:12,children:[l.jsx(ae.DatePickerInput,{label:"Start time",...s.getInputProps("startDate"),popoverProps:{withinPortal:!1},valueFormat:ee,leftSection:l.jsx(Ve,{stroke:1.5})},s.key("startDate")),l.jsx(ae.TimeInput,{withSeconds:!0,...s.getInputProps("startTime"),leftSection:l.jsx(Me,{stroke:1.5}),rightSection:t?void 0:l.jsx(D.Text,{style:{fontSize:12,fontStyle:"italic"},children:e.timezone?.longName}),rightSectionWidth:t?void 0:180,rightSectionProps:{style:{paddingRight:1}}},s.key("startTime")),t&&n?l.jsx(D.Text,{size:"xs",c:"dimmed",mt:-4,children:n}):null,l.jsx(ae.DatePickerInput,{label:"End time",...s.getInputProps("endDate"),popoverProps:{withinPortal:!1},valueFormat:ee,leftSection:l.jsx(Ve,{stroke:1.5})},s.key("endDate")),l.jsx(ae.TimeInput,{withSeconds:!0,...s.getInputProps("endTime"),leftSection:l.jsx(Me,{stroke:1.5}),rightSection:t?void 0:l.jsx(D.Text,{style:{fontSize:12,fontStyle:"italic"},children:e.timezone?.longName}),rightSectionWidth:t?void 0:180,rightSectionProps:{style:{paddingRight:1}}},s.key("endTime")),t&&n?l.jsx(D.Text,{size:"xs",c:"dimmed",mt:-4,children:n}):null]})]}),l.jsx(We,{})]})})},ne={"trigger-button":"_trigger-button_1ds5p_1","picker-shell":"_picker-shell_1ds5p_18","mobile-layout":"_mobile-layout_1ds5p_22","mobile-nav":"_mobile-nav_1ds5p_29","mobile-content":"_mobile-content_1ds5p_33"};var be=(e=>(e.RELATIVE_TIME="Relative time",e.START_END_TIME="Start and end times",e.AROUND_TIME="Around a time",e.TIMEZONE="Time zone",e))(be||{});const Tr=e=>{const[t,r]=m.useState("Start and end times"),{popoverOpened:n,setPopoverOpened:s}=de(),c=re.useMediaQuery("(max-width: 48em)"),o=re.useMediaQuery("(max-width: 64em)");m.useEffect(()=>{!o&&t==="Relative time"&&r("Start and end times")},[o,t]);const u=()=>{switch(t){case"Relative time":return l.jsx(et,{tzRange:e,setSelectedPanel:r,mobileOnlyRelative:!0});case"Start and end times":return l.jsx(pr,{tzRange:e});case"Around a time":return l.jsx(yr,{tzRange:e});case"Time zone":return l.jsx(mt,{tzRange:e});default:return null}},i=()=>{s($=>!$)},d=m.useMemo(()=>Pe(e,"desktop"),[e.startDate,e.startTime,e.endDate,e.endTime,e.timezone]),g=m.useMemo(()=>c?Pe(e,"mobile"):o?Pe(e,"tablet"):d,[d,c,o,e]),_=o?l.jsxs("div",{className:ne["mobile-layout"],children:[l.jsx("div",{className:ne["mobile-nav"],children:l.jsx(D.SegmentedControl,{fullWidth:!0,value:t,onChange:$=>r($),data:[{label:"Quick",value:"Relative time"},{label:"Range",value:"Start and end times"},{label:"Around",value:"Around a time"},{label:"TZ",value:"Time zone"}]})}),l.jsx("div",{className:ne["mobile-content"],children:u()})]}):l.jsxs(D.Flex,{className:ne["picker-shell"],children:[l.jsx(et,{tzRange:e,setSelectedPanel:r}),u()]});return o?l.jsxs(l.Fragment,{children:[l.jsx(D.Button,{onClick:i,style:e.buttonStyle||{},className:ne["trigger-button"],title:d,children:g}),l.jsx(D.Drawer,{opened:n,onClose:()=>s(!1),size:"100%",padding:0,title:"Select time range",styles:{content:{display:"flex",flexDirection:"column"},body:{flex:1,overflow:"hidden",padding:0}},children:l.jsx("div",{className:ne["picker-shell"],children:_})})]}):l.jsxs(D.Popover,{position:"bottom",shadow:"md",opened:n,onChange:s,children:[l.jsx(D.Popover.Target,{children:l.jsx(D.Button,{onClick:i,style:e.buttonStyle||{},className:ne["trigger-button"],title:d,children:g})}),l.jsx(D.Popover.Dropdown,{style:{width:700,height:400,padding:0},py:8,children:_})]})},br=e=>l.jsx(Ht,{children:l.jsx(Tr,{...e})});exports.Panel=be;exports.TimezonePanel=mt;exports.TimezoneRangePicker=br;
|
|
62
|
+
*/const Ot=[["path",{d:"M16 2c.183 0 .355 .05 .502 .135l.033 .02c.28 .177 .465 .49 .465 .845v1h1a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h1v-1a1 1 0 0 1 .514 -.874l.093 -.046l.066 -.025l.1 -.029l.107 -.019l.12 -.007q .083 0 .161 .013l.122 .029l.04 .012l.06 .023c.328 .135 .568 .44 .61 .806l.007 .117v1h6v-1a1 1 0 0 1 1 -1m3 7h-14v9.625c0 .705 .386 1.286 .883 1.366l.117 .009h12c.513 0 .936 -.53 .993 -1.215l.007 -.16z",key:"svg-0"}],["path",{d:"M9.015 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-1"}],["path",{d:"M13.015 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-2"}],["path",{d:"M17.02 13a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-3"}],["path",{d:"M12.02 15a1 1 0 0 1 0 2a1.001 1.001 0 1 1 -.005 -2z",key:"svg-4"}],["path",{d:"M9.015 16a1 1 0 0 1 -1 1a1.001 1.001 0 1 1 -.005 -2c.557 0 1.005 .448 1.005 1",key:"svg-5"}]],Mt=le("filled","calendar-week-filled","CalendarWeekFilled",Ot),Ct=({searchText:e,setSearchText:t})=>l.jsx(D.Input,{placeholder:"Timezone search (Asia, Tokyo, +09:00, etc)",leftSection:l.jsx(jt,{stroke:2}),value:e,onChange:r=>t(r.currentTarget.value)});var _e={exports:{}},Ft=_e.exports,Ze;function Pt(){return Ze||(Ze=1,(function(e,t){(function(r,n){e.exports=n()})(Ft,(function(){var r=1e3,n=6e4,s=36e5,c="millisecond",i="second",u="minute",o="hour",d="day",v="week",_="month",g="quarter",j="year",O="date",x="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,$=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(E){var b=["th","st","nd","rd"],y=E%100;return"["+E+(b[(y-20)%10]||b[y]||b[0])+"]"}},Y=function(E,b,y){var k=String(E);return!k||k.length>=b?E:""+Array(b+1-k.length).join(y)+E},U={s:Y,z:function(E){var b=-E.utcOffset(),y=Math.abs(b),k=Math.floor(y/60),p=y%60;return(b<=0?"+":"-")+Y(k,2,"0")+":"+Y(p,2,"0")},m:function E(b,y){if(b.date()<y.date())return-E(y,b);var k=12*(y.year()-b.year())+(y.month()-b.month()),p=b.clone().add(k,_),P=y-p<0,a=b.clone().add(k+(P?-1:1),_);return+(-(k+(y-p)/(P?p-a:a-p))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:_,y:j,w:v,d,D:O,h:o,m:u,s:i,ms:c,Q:g}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},N="en",w={};w[N]=C;var A="$isDayjsObject",L=function(E){return E instanceof X||!(!E||!E[A])},q=function E(b,y,k){var p;if(!b)return N;if(typeof b=="string"){var P=b.toLowerCase();w[P]&&(p=P),y&&(w[P]=y,p=P);var a=b.split("-");if(!p&&a.length>1)return E(a[0])}else{var S=b.name;w[S]=b,p=S}return!k&&p&&(N=p),p||!k&&N},z=function(E,b){if(L(E))return E.clone();var y=typeof b=="object"?b:{};return y.date=E,y.args=arguments,new X(y)},V=U;V.l=q,V.i=L,V.w=function(E,b){return z(E,{locale:b.$L,utc:b.$u,x:b.$x,$offset:b.$offset})};var X=(function(){function E(y){this.$L=q(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[A]=!0}var b=E.prototype;return b.parse=function(y){this.$d=(function(k){var p=k.date,P=k.utc;if(p===null)return new Date(NaN);if(V.u(p))return new Date;if(p instanceof Date)return new Date(p);if(typeof p=="string"&&!/Z$/i.test(p)){var a=p.match(h);if(a){var S=a[2]-1||0,F=(a[7]||"0").substring(0,3);return P?new Date(Date.UTC(a[1],S,a[3]||1,a[4]||0,a[5]||0,a[6]||0,F)):new Date(a[1],S,a[3]||1,a[4]||0,a[5]||0,a[6]||0,F)}}return new Date(p)})(y),this.init()},b.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},b.$utils=function(){return V},b.isValid=function(){return this.$d.toString()!==x},b.isSame=function(y,k){var p=z(y);return this.startOf(k)<=p&&p<=this.endOf(k)},b.isAfter=function(y,k){return z(y)<this.startOf(k)},b.isBefore=function(y,k){return this.endOf(k)<z(y)},b.$g=function(y,k,p){return V.u(y)?this[k]:this.set(p,y)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(y,k){var p=this,P=!!V.u(k)||k,a=V.p(y),S=function(R,K){var Z=V.w(p.$u?Date.UTC(p.$y,K,R):new Date(p.$y,K,R),p);return P?Z:Z.endOf(d)},F=function(R,K){return V.w(p.toDate()[R].apply(p.toDate("s"),(P?[0,0,0,0]:[23,59,59,999]).slice(K)),p)},I=this.$W,W=this.$M,H=this.$D,G="set"+(this.$u?"UTC":"");switch(a){case j:return P?S(1,0):S(31,11);case _:return P?S(1,W):S(0,W+1);case v:var T=this.$locale().weekStart||0,M=(I<T?I+7:I)-T;return S(P?H-M:H+(6-M),W);case d:case O:return F(G+"Hours",0);case o:return F(G+"Minutes",1);case u:return F(G+"Seconds",2);case i:return F(G+"Milliseconds",3);default:return this.clone()}},b.endOf=function(y){return this.startOf(y,!1)},b.$set=function(y,k){var p,P=V.p(y),a="set"+(this.$u?"UTC":""),S=(p={},p[d]=a+"Date",p[O]=a+"Date",p[_]=a+"Month",p[j]=a+"FullYear",p[o]=a+"Hours",p[u]=a+"Minutes",p[i]=a+"Seconds",p[c]=a+"Milliseconds",p)[P],F=P===d?this.$D+(k-this.$W):k;if(P===_||P===j){var I=this.clone().set(O,1);I.$d[S](F),I.init(),this.$d=I.set(O,Math.min(this.$D,I.daysInMonth())).$d}else S&&this.$d[S](F);return this.init(),this},b.set=function(y,k){return this.clone().$set(y,k)},b.get=function(y){return this[V.p(y)]()},b.add=function(y,k){var p,P=this;y=Number(y);var a=V.p(k),S=function(W){var H=z(P);return V.w(H.date(H.date()+Math.round(W*y)),P)};if(a===_)return this.set(_,this.$M+y);if(a===j)return this.set(j,this.$y+y);if(a===d)return S(1);if(a===v)return S(7);var F=(p={},p[u]=n,p[o]=s,p[i]=r,p)[a]||1,I=this.$d.getTime()+y*F;return V.w(I,this)},b.subtract=function(y,k){return this.add(-1*y,k)},b.format=function(y){var k=this,p=this.$locale();if(!this.isValid())return p.invalidDate||x;var P=y||"YYYY-MM-DDTHH:mm:ssZ",a=V.z(this),S=this.$H,F=this.$m,I=this.$M,W=p.weekdays,H=p.months,G=p.meridiem,T=function(K,Z,te,Q){return K&&(K[Z]||K(k,P))||te[Z].slice(0,Q)},M=function(K){return V.s(S%12||12,K,"0")},R=G||function(K,Z,te){var Q=K<12?"AM":"PM";return te?Q.toLowerCase():Q};return P.replace($,(function(K,Z){return Z||(function(te){switch(te){case"YY":return String(k.$y).slice(-2);case"YYYY":return V.s(k.$y,4,"0");case"M":return I+1;case"MM":return V.s(I+1,2,"0");case"MMM":return T(p.monthsShort,I,H,3);case"MMMM":return T(H,I);case"D":return k.$D;case"DD":return V.s(k.$D,2,"0");case"d":return String(k.$W);case"dd":return T(p.weekdaysMin,k.$W,W,2);case"ddd":return T(p.weekdaysShort,k.$W,W,3);case"dddd":return W[k.$W];case"H":return String(S);case"HH":return V.s(S,2,"0");case"h":return M(1);case"hh":return M(2);case"a":return R(S,F,!0);case"A":return R(S,F,!1);case"m":return String(F);case"mm":return V.s(F,2,"0");case"s":return String(k.$s);case"ss":return V.s(k.$s,2,"0");case"SSS":return V.s(k.$ms,3,"0");case"Z":return a}return null})(K)||a.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(y,k,p){var P,a=this,S=V.p(k),F=z(y),I=(F.utcOffset()-this.utcOffset())*n,W=this-F,H=function(){return V.m(a,F)};switch(S){case j:P=H()/12;break;case _:P=H();break;case g:P=H()/3;break;case v:P=(W-I)/6048e5;break;case d:P=(W-I)/864e5;break;case o:P=W/s;break;case u:P=W/n;break;case i:P=W/r;break;default:P=W}return p?P:V.a(P)},b.daysInMonth=function(){return this.endOf(_).$D},b.$locale=function(){return w[this.$L]},b.locale=function(y,k){if(!y)return this.$L;var p=this.clone(),P=q(y,k,!0);return P&&(p.$L=P),p},b.clone=function(){return V.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},E})(),se=X.prototype;return z.prototype=se,[["$ms",c],["$s",i],["$m",u],["$H",o],["$W",d],["$M",_],["$y",j],["$D",O]].forEach((function(E){se[E[1]]=function(b){return this.$g(b,E[0],E[1])}})),z.extend=function(E,b){return E.$i||(E(b,X,z),E.$i=!0),z},z.locale=q,z.isDayjs=L,z.unix=function(E){return z(1e3*E)},z.en=w[N],z.Ls=w,z.p={},z}))})(_e)),_e.exports}var At=Pt();const f=Ce(At);var Ee={exports:{}},Vt=Ee.exports,Je;function It(){return Je||(Je=1,(function(e,t){(function(r,n){e.exports=n()})(Vt,(function(){var r="minute",n=/[+-]\d\d(?::?\d\d)?/g,s=/([+-]|\d\d)/g;return function(c,i,u){var o=i.prototype;u.utc=function(x){var h={date:x,utc:!0,args:arguments};return new i(h)},o.utc=function(x){var h=u(this.toDate(),{locale:this.$L,utc:!0});return x?h.add(this.utcOffset(),r):h},o.local=function(){return u(this.toDate(),{locale:this.$L,utc:!1})};var d=o.parse;o.parse=function(x){x.utc&&(this.$u=!0),this.$utils().u(x.$offset)||(this.$offset=x.$offset),d.call(this,x)};var v=o.init;o.init=function(){if(this.$u){var x=this.$d;this.$y=x.getUTCFullYear(),this.$M=x.getUTCMonth(),this.$D=x.getUTCDate(),this.$W=x.getUTCDay(),this.$H=x.getUTCHours(),this.$m=x.getUTCMinutes(),this.$s=x.getUTCSeconds(),this.$ms=x.getUTCMilliseconds()}else v.call(this)};var _=o.utcOffset;o.utcOffset=function(x,h){var $=this.$utils().u;if($(x))return this.$u?0:$(this.$offset)?_.call(this):this.$offset;if(typeof x=="string"&&(x=(function(N){N===void 0&&(N="");var w=N.match(n);if(!w)return null;var A=(""+w[0]).match(s)||["-",0,0],L=A[0],q=60*+A[1]+ +A[2];return q===0?0:L==="+"?q:-q})(x),x===null))return this;var C=Math.abs(x)<=16?60*x:x;if(C===0)return this.utc(h);var Y=this.clone();if(h)return Y.$offset=C,Y.$u=!1,Y;var U=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();return(Y=this.local().add(C+U,r)).$offset=C,Y.$x.$localOffset=U,Y};var g=o.format;o.format=function(x){var h=x||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return g.call(this,h)},o.valueOf=function(){var x=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*x},o.isUTC=function(){return!!this.$u},o.toISOString=function(){return this.toDate().toISOString()},o.toString=function(){return this.toDate().toUTCString()};var j=o.toDate;o.toDate=function(x){return x==="s"&&this.$offset?u(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():j.call(this)};var O=o.diff;o.diff=function(x,h,$){if(x&&this.$u===x.$u)return O.call(this,x,h,$);var C=this.local(),Y=u(x).local();return O.call(C,Y,h,$)}}}))})(Ee)),Ee.exports}var Lt=It();const zt=Ce(Lt);var Oe={exports:{}},Yt=Oe.exports,Qe;function Nt(){return Qe||(Qe=1,(function(e,t){(function(r,n){e.exports=n()})(Yt,(function(){var r={year:0,month:1,day:2,hour:3,minute:4,second:5},n={};return function(s,c,i){var u,o=function(g,j,O){O===void 0&&(O={});var x=new Date(g),h=(function($,C){C===void 0&&(C={});var Y=C.timeZoneName||"short",U=$+"|"+Y,N=n[U];return N||(N=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:$,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:Y}),n[U]=N),N})(j,O);return h.formatToParts(x)},d=function(g,j){for(var O=o(g,j),x=[],h=0;h<O.length;h+=1){var $=O[h],C=$.type,Y=$.value,U=r[C];U>=0&&(x[U]=parseInt(Y,10))}var N=x[3],w=N===24?0:N,A=x[0]+"-"+x[1]+"-"+x[2]+" "+w+":"+x[4]+":"+x[5]+":000",L=+g;return(i.utc(A).valueOf()-(L-=L%1e3))/6e4},v=c.prototype;v.tz=function(g,j){g===void 0&&(g=u);var O,x=this.utcOffset(),h=this.toDate(),$=h.toLocaleString("en-US",{timeZone:g}),C=Math.round((h-new Date($))/1e3/60),Y=15*-Math.round(h.getTimezoneOffset()/15)-C;if(!Number(Y))O=this.utcOffset(0,j);else if(O=i($,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(Y,!0),j){var U=O.utcOffset();O=O.add(x-U,"minute")}return O.$x.$timezone=g,O},v.offsetName=function(g){var j=this.$x.$timezone||i.tz.guess(),O=o(this.valueOf(),j,{timeZoneName:g}).find((function(x){return x.type.toLowerCase()==="timezonename"}));return O&&O.value};var _=v.startOf;v.startOf=function(g,j){if(!this.$x||!this.$x.$timezone)return _.call(this,g,j);var O=i(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return _.call(O,g,j).tz(this.$x.$timezone,!0)},i.tz=function(g,j,O){var x=O&&j,h=O||j||u,$=d(+i(),h);if(typeof g!="string")return i(g).tz(h);var C=(function(w,A,L){var q=w-60*A*1e3,z=d(q,L);if(A===z)return[q,A];var V=d(q-=60*(z-A)*1e3,L);return z===V?[q,z]:[w-60*Math.min(z,V)*1e3,Math.max(z,V)]})(i.utc(g,x).valueOf(),$,h),Y=C[0],U=C[1],N=i(Y).utcOffset(U);return N.$x.$timezone=h,N},i.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},i.tz.setDefault=function(g){u=g}}}))})(Oe)),Oe.exports}var Ut=Nt();const Kt=Ce(Ut),Rt=(e,t="en-US")=>new Intl.DateTimeFormat(t,{timeZone:e,timeZoneName:"long"}).formatToParts(new Date).find(r=>r.type==="timeZoneName")?.value||"",Wt=e=>{const t=e[0]==="-"?-1:1,[r,n]=e.slice(1).split(":").map(Number);return t*(r*60+n)};f.extend(zt);f.extend(Kt);const qt=e=>{const t=f().tz(e).format("Z");return{name:e,longName:Rt(e),currentTime:f().tz(e).format("h:mm A"),utcOffset:t,offsetMinutes:Wt(t)}},Ht=()=>["UTC",...Intl.supportedValuesOf("timeZone")].filter((t,r,n)=>n.indexOf(t)===r).map(t=>qt(t)).sort((t,r)=>t.name==="UTC"?-1:r.name==="UTC"?1:t.offsetMinutes-r.offsetMinutes),De={"timezone-panel-container":"_timezone-panel-container_tykz4_1","search-container":"_search-container_tykz4_6","timezone-scroll-area":"_timezone-scroll-area_tykz4_15","list-container":"_list-container_tykz4_21"},Ke={"form-container":"_form-container_1xxf4_1"},dt=m.createContext(void 0),de=()=>{const e=m.useContext(dt);if(!e)throw new Error("usePopoverContext must be used within a PopoverProvider");return e},Bt=({children:e})=>{const[t,r]=m.useState(!1),n=()=>{r(!1)};return l.jsx(dt.Provider,{value:{popoverOpened:t,setPopoverOpened:r,closePopover:n},children:e})},Re=()=>{const{theme:e}=Ue(),{closePopover:t}=de(),r=re.useMediaQuery("(max-width: 48em)"),n=re.useMediaQuery("(max-width: 64em)");return l.jsx(D.Flex,{justify:"flex-end",mt:12,pb:12,children:l.jsxs(D.Flex,{direction:r?"column":"row",gap:12,w:n?"100%":void 0,children:[l.jsx(D.Button,{size:"xs",variant:"subtle",color:e.primaryColor,onClick:t,fullWidth:n,children:"Cancel"}),l.jsx(D.Button,{type:"submit",size:"xs",color:e.primaryColor,fullWidth:n,children:"Apply"})]})})},ee="YYYY/MM/DD",ue="HH:mm:ss",Ie=e=>e.timezone.name?f().tz(e.timezone.name).format(ue):f().format(ue),ft=e=>e.timezone.name?f().tz(e.timezone.name).format(ee):f().format(ee),Zt=e=>f().add(e,"day").format(ee),Jt=e=>e&&f().tz(e).format("Z"),Pe=(e,t="desktop")=>{const r=e.startDate?f(e.startDate):null,n=e.endDate?f(e.endDate):null,s=Jt(e.timezone.name);return!r||!n||!e.startTime||!e.endTime?"Select range":t==="mobile"?r.isSame(n,"day")?`${r.format("MMM D")} · ${e.startTime}`:`${r.format("MMM D")}–${n.format("MMM D")}`:t==="tablet"?`${r.format("MMM D, HH:mm")} → ${n.format("MMM D, HH:mm")}${s?` (${s})`:""}`:`${r.format(ee)} ${e.startTime} - ${n.format(ee)} ${e.endTime}${s?` (${s})`:""}`},ie=(e,t,r,n)=>{const s=f(`${e} ${t}`).subtract(r,n);return{date:s.format(ee),time:s.format(ue)}},oe=(e,t,r,n)=>{const s=f(`${e} ${t}`).add(r,n);return{date:s.format(ee),time:s.format(ue)}},ve=(e,t,r)=>f.tz(`${e} ${t}`,`${ee} ${ue}`,r).utc().toISOString(),xe=(e,t)=>{const r=f.utc(e).tz(t);return{date:r.format(ee),time:r.format(ue)}},mt=({tzRange:e})=>{const[t,r]=m.useState(e.timezone),[n,s]=m.useState([]),[c,i]=m.useState(""),u=re.useMediaQuery("(max-width: 64em)"),{closePopover:o}=de(),d=m.useMemo(()=>Ht(),[]);m.useEffect(()=>{s(d)},[]),ct(()=>{if(c===""){s(d);return}s(d.filter(j=>j.name.toLowerCase().includes(c.toLocaleLowerCase())||j.longName.toLowerCase().includes(c.toLocaleLowerCase())||j.currentTime.toLowerCase().includes(c.toLocaleLowerCase())||j.utcOffset.toLowerCase().includes(c.toLocaleLowerCase())))},250,[c]);const v=j=>{r(j)},_=j=>{if(j.preventDefault(),!t?.name||!e.timezone.name||!e.startDate||!e.startTime||!e.endDate||!e.endTime)return;const O=ve(e.startDate,e.startTime,e.timezone.name),x=ve(e.endDate,e.endTime,e.timezone.name),h=xe(O,t.name),$=xe(x,t.name);e.onApply({startDate:h.date,startTime:h.time,endDate:$.date,endTime:$.time,timezone:t||{name:null,longName:null,utcOffset:null}}),u&&o()},g=j=>j?f().tz(j).format("h:mm A"):"";return l.jsxs("form",{className:Ke["form-container"],onSubmit:_,children:[l.jsxs(D.Flex,{direction:"column",className:De["timezone-panel-container"],children:[l.jsx(D.Box,{className:De["search-container"],children:l.jsx(Ct,{searchText:c,setSearchText:i})}),l.jsxs(D.Box,{className:De["timezone-scroll-area"],children:[l.jsx(D.Text,{fw:600,px:12,children:"My Location"}),l.jsx(D.Flex,{direction:"column",children:l.jsx(Be,{isBrowserTimezone:!0,name:e.timezone?.name,longName:e.timezone?.longName,currentTime:g(e.timezone?.name),utcOffset:e.timezone?.utcOffset,selectedTimezone:t})}),l.jsx(D.Text,{fw:600,px:12,children:"Locations"}),l.jsx(D.Flex,{direction:"column",className:De["list-container"],children:n.map((j,O)=>l.jsx(Be,{name:j.name,longName:j.longName,currentTime:j.currentTime,utcOffset:j.utcOffset,selectedTimezone:t,handleTimezoneMouseClick:v},O))})]})]}),l.jsx(D.Box,{px:12,children:l.jsx(Re,{})})]})},ye={"sidebar-container":"_sidebar-container_1cvpv_1","sidebar-mobile-relative":"_sidebar-mobile-relative_1cvpv_11","sidebar-row":"_sidebar-row_1cvpv_17"},Qt=e=>[{label:"Today",searchKey:"today",startTime:f().tz(e).startOf("day").format(),endTime:f().tz(e).endOf("day").format(),unit:"days"},{label:"Tomorrow",searchKey:"tomorrow",startTime:f().tz(e).add(1,"day").startOf("day").format(),endTime:f().tz(e).add(1,"day").endOf("day").format(),unit:"days"},{label:"Yesterday",searchKey:"yesterday",startTime:f().tz(e).subtract(1,"day").startOf("day").format(),endTime:f().tz(e).subtract(1,"day").endOf("day").format(),unit:"days"},{label:"Last 15 seconds",searchKey:"-15s",startTime:f().tz(e).subtract(15,"second").format(),endTime:f().tz(e).format(),unit:"seconds"},{label:"Last 30 seconds",searchKey:"-30s",startTime:f().tz(e).subtract(30,"second").format(),endTime:f().tz(e).format(),unit:"seconds"},{label:"Next 15 seconds",searchKey:"+15s",startTime:f().tz(e).format(),endTime:f().tz(e).add(15,"second").format(),unit:"seconds"},{label:"Next 30 seconds",searchKey:"+30s",startTime:f().tz(e).format(),endTime:f().tz(e).add(30,"second").format(),unit:"seconds"},{label:"Last 5 minutes",searchKey:"-5m",startTime:f().tz(e).subtract(5,"minute").format(),endTime:f().tz(e).format(),unit:"minutes"},{label:"Last 10 minutes",searchKey:"-10m",startTime:f().tz(e).subtract(10,"minute").format(),endTime:f().tz(e).format(),unit:"minutes"},{label:"Last 15 minutes",searchKey:"-15m",startTime:f().tz(e).subtract(15,"minute").format(),endTime:f().tz(e).format(),unit:"minutes"},{label:"Last 30 minutes",searchKey:"-30m",startTime:f().tz(e).subtract(30,"minute").format(),endTime:f().tz(e).format(),unit:"minutes"},{label:"Last 45 minutes",searchKey:"-45m",startTime:f().tz(e).subtract(45,"minute").format(),endTime:f().tz(e).format(),unit:"minutes"},{label:"Next 5 minutes",searchKey:"+5m",startTime:f().tz(e).format(),endTime:f().tz(e).add(5,"minute").format(),unit:"minutes"},{label:"Next 10 minutes",searchKey:"+10m",startTime:f().tz(e).format(),endTime:f().tz(e).add(10,"minute").format(),unit:"minutes"},{label:"Next 15 minutes",searchKey:"+15m",startTime:f().tz(e).format(),endTime:f().tz(e).add(15,"minute").format(),unit:"minutes"},{label:"Next 30 minutes",searchKey:"+30m",startTime:f().tz(e).format(),endTime:f().tz(e).add(30,"minute").format(),unit:"minutes"},{label:"Next 45 minutes",searchKey:"+45m",startTime:f().tz(e).format(),endTime:f().tz(e).add(45,"minute").format(),unit:"minutes"},{label:"Last 1 hour",searchKey:"-1h",startTime:f().tz(e).subtract(1,"hour").format(),endTime:f().tz(e).format(),unit:"hours"},{label:"Last 3 hours",searchKey:"-3h",startTime:f().tz(e).subtract(3,"hour").format(),endTime:f().tz(e).format(),unit:"hours"},{label:"Last 6 hours",searchKey:"-6h",startTime:f().tz(e).subtract(6,"hour").format(),endTime:f().tz(e).format(),unit:"hours"},{label:"Last 12 hours",searchKey:"-12h",startTime:f().tz(e).subtract(12,"hour").format(),endTime:f().tz(e).format(),unit:"hours"},{label:"Next 1 hour",searchKey:"+1h",startTime:f().tz(e).format(),endTime:f().tz(e).add(1,"hour").format(),unit:"hours"},{label:"Next 3 hours",searchKey:"+3h",startTime:f().tz(e).format(),endTime:f().tz(e).add(3,"hour").format(),unit:"hours"},{label:"Next 6 hours",searchKey:"+6h",startTime:f().tz(e).format(),endTime:f().tz(e).add(6,"hour").format(),unit:"hours"},{label:"Next 12 hours",searchKey:"+12h",startTime:f().tz(e).format(),endTime:f().tz(e).add(12,"hour").format(),unit:"hours"},{label:"Last 1 day",searchKey:"-1d",startTime:f().tz(e).subtract(1,"day").format(),endTime:f().tz(e).format(),unit:"days"},{label:"Last 2 days",searchKey:"-2d",startTime:f().tz(e).subtract(2,"day").format(),endTime:f().tz(e).format(),unit:"days"},{label:"Last 7 days",searchKey:"-7d",startTime:f().tz(e).subtract(7,"day").format(),endTime:f().tz(e).format(),unit:"days"},{label:"Last 14 days",searchKey:"-14d",startTime:f().tz(e).subtract(14,"day").format(),endTime:f().tz(e).format(),unit:"days"},{label:"Last 30 days",searchKey:"-30d",startTime:f().tz(e).subtract(30,"day").format(),endTime:f().tz(e).format(),unit:"days"},{label:"Next 1 day",searchKey:"+1d",startTime:f().tz(e).format(),endTime:f().tz(e).add(1,"day").format(),unit:"days"},{label:"Next 2 days",searchKey:"+2d",startTime:f().tz(e).format(),endTime:f().tz(e).add(2,"day").format(),unit:"days"},{label:"Next 7 days",searchKey:"+7d",startTime:f().tz(e).format(),endTime:f().tz(e).add(7,"day").format(),unit:"days"},{label:"Next 14 days",searchKey:"+14d",startTime:f().tz(e).format(),endTime:f().tz(e).add(14,"day").format(),unit:"days"},{label:"Next 30 days",searchKey:"+30d",startTime:f().tz(e).format(),endTime:f().tz(e).add(30,"day").format(),unit:"days"}],Gt=(e,t)=>e==="seconds"?!t?.disableSeconds:e==="minutes"?!t?.disableMinutes:e==="hours"?!t?.disableHours:e==="days"?!t?.disableDays:!0,Ge=(e,t)=>{const r=Qt(e).filter(n=>Gt(n.unit,t));return r.map((n,s)=>({...n,lineBreak:s<r.length-1&&r[s+1].unit!==n.unit}))},pe={"relative-time-root":"_relative-time-root_emohw_1","relative-time-panel-container":"_relative-time-panel-container_emohw_9","time-row":"_time-row_emohw_16","time-row-dark":"_time-row-dark_emohw_20","time-row-light":"_time-row-light_emohw_26"},Xe=({tzRange:e})=>{const[t,r]=m.useState([]),[n,s]=m.useState(""),{colorScheme:c}=Ue(),{closePopover:i}=de();m.useEffect(()=>{if(e.timezone.name!==null){const o=Ge(e.timezone.name,e.options);r(o)}},[e.timezone,e.options]),ct(()=>{if(!e.timezone.name)return;const o=Ge(e.timezone.name,e.options);if(n===""){r(o);return}const d=n.toLowerCase();r(o.filter(v=>v.searchKey.includes(d)||v.label.toLowerCase().includes(d)))},250,[n,e.timezone,e.options]);const u=o=>{const[d,v]=o.startTime.split("T"),[_,g]=o.endTime.split("T");e.onApply({startDate:d,startTime:v.slice(0,8),endDate:_,endTime:g.slice(0,8),timezone:e.timezone}),i()};return l.jsxs(D.Flex,{direction:"column",className:pe["relative-time-root"],children:[l.jsx(D.Box,{style:{width:"90%"},mx:"auto",children:l.jsx(D.Input,{placeholder:"Relative time (15m, 1h, 1d, 1w)",value:n,onChange:o=>s(o.currentTarget.value)})}),l.jsx(D.Flex,{direction:"column",className:pe["relative-time-panel-container"],children:t.map(o=>l.jsxs(D.Flex,{align:"center",justify:"space-between",className:lt(c==="dark"?pe["time-row-dark"]:pe["time-row-light"],pe["time-row"]),py:4,px:12,mb:o.lineBreak?8:0,onClick:()=>u(o),children:[l.jsx(D.Text,{size:"sm",children:o.label}),l.jsx(D.Text,{size:"xs",c:"#5f6368",children:o.searchKey})]},o.label))})]})},et=({setSelectedPanel:e,tzRange:t,mobileOnlyRelative:r=!1})=>r?l.jsx(D.Box,{className:ye["sidebar-mobile-relative"],children:l.jsx(Xe,{tzRange:t})}):l.jsxs(D.Box,{className:ye["sidebar-container"],flex:1,children:[l.jsx(Xe,{tzRange:t}),l.jsxs(D.Flex,{direction:"column",rowGap:16,py:8,style:{borderTop:"1px solid #ddd"},children:[l.jsxs(D.Flex,{className:ye["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(be.START_END_TIME),children:[l.jsxs(D.Flex,{align:"center",children:[l.jsx(Mt,{stroke:1.5}),l.jsx(D.Text,{size:"sm",children:"Start and end times"})]}),l.jsx(Fe,{stroke:1.5})]}),l.jsxs(D.Flex,{className:ye["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(be.AROUND_TIME),children:[l.jsxs(D.Flex,{align:"center",children:[l.jsx(Me,{stroke:1.5}),l.jsx(D.Text,{size:"sm",children:"Around a time"})]}),l.jsx(Fe,{stroke:1.5})]}),l.jsxs(D.Flex,{className:ye["sidebar-row"],justify:"space-between",align:"center",px:12,onClick:()=>e(be.TIMEZONE),children:[l.jsxs(D.Flex,{align:"center",children:[l.jsx(Et,{stroke:1.5}),l.jsx(D.Text,{size:"sm",children:"Time zone"})]}),l.jsx(Fe,{stroke:1.5})]})]})]});var ht=(e=>(e.ThirtySeconds="± 30 seconds",e.OneMinute="± 1 minute",e.FifteenMinutes="± 15 minutes",e.ThirtyMinutes="± 30 minutes",e.OneHour="± 1 hour",e.OneDay="± 1 day",e))(ht||{});const Xt=["± 30 seconds","± 1 minute","± 15 minutes","± 30 minutes","± 1 hour","± 1 day"],er=(e,t,r)=>{switch(r){case"± 30 seconds":const n=ie(e,t,30,"second"),s=oe(e,t,30,"second");return{startDate:n.date,startTime:n.time,endDate:s.date,endTime:s.time};case"± 1 minute":const c=ie(e,t,1,"minute"),i=oe(e,t,1,"minute");return{startDate:c.date,startTime:c.time,endDate:i.date,endTime:i.time};case"± 15 minutes":const u=ie(e,t,15,"minute"),o=oe(e,t,15,"minute");return{startDate:u.date,startTime:u.time,endDate:o.date,endTime:o.time};case"± 30 minutes":const d=ie(e,t,30,"minute"),v=oe(e,t,30,"minute");return{startDate:d.date,startTime:d.time,endDate:v.date,endTime:v.time};case"± 1 hour":const _=ie(e,t,1,"hour"),g=oe(e,t,1,"hour");return{startDate:_.date,startTime:_.time,endDate:g.date,endTime:g.time};case"± 1 day":const j=ie(e,t,1,"day"),O=oe(e,t,1,"day");return{startDate:j.date,startTime:j.time,endDate:O.date,endTime:O.time};default:return{startDate:e,startTime:t,endDate:e,endTime:t}}};function tr(e){if(!/^[0-9a-zA-Z-]+$/.test(e))throw new Error(`[@mantine/use-form] Form name "${e}" is invalid, it should contain only letters, numbers and dashes`)}const rr=typeof window<"u"?m.useLayoutEffect:m.useEffect;function J(e,t){rr(()=>{if(e)return window.addEventListener(e,t),()=>window.removeEventListener(e,t)},[e])}function nr(e,t){e&&tr(e),J(`mantine-form:${e}:set-field-value`,r=>t.setFieldValue(r.detail.path,r.detail.value)),J(`mantine-form:${e}:set-values`,r=>t.setValues(r.detail)),J(`mantine-form:${e}:set-initial-values`,r=>t.setInitialValues(r.detail)),J(`mantine-form:${e}:set-errors`,r=>t.setErrors(r.detail)),J(`mantine-form:${e}:set-field-error`,r=>t.setFieldError(r.detail.path,r.detail.error)),J(`mantine-form:${e}:clear-field-error`,r=>t.clearFieldError(r.detail)),J(`mantine-form:${e}:clear-errors`,t.clearErrors),J(`mantine-form:${e}:reset`,t.reset),J(`mantine-form:${e}:validate`,t.validate),J(`mantine-form:${e}:validate-field`,r=>t.validateField(r.detail)),J(`mantine-form:${e}:reorder-list-item`,r=>t.reorderListItem(r.detail.path,r.detail.payload)),J(`mantine-form:${e}:remove-list-item`,r=>t.removeListItem(r.detail.path,r.detail.index)),J(`mantine-form:${e}:insert-list-item`,r=>t.insertListItem(r.detail.path,r.detail.item,r.detail.index)),J(`mantine-form:${e}:set-dirty`,r=>t.setDirty(r.detail)),J(`mantine-form:${e}:set-touched`,r=>t.setTouched(r.detail)),J(`mantine-form:${e}:reset-dirty`,r=>t.resetDirty(r.detail)),J(`mantine-form:${e}:reset-touched`,t.resetTouched)}function sr(e){return t=>{if(!t)e(t);else if(typeof t=="function")e(t);else if(typeof t=="object"&&"nativeEvent"in t){const{currentTarget:r}=t;r instanceof HTMLInputElement?r.type==="checkbox"?e(r.checked):e(r.value):(r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement)&&e(r.value)}else e(t)}}function Le(e){return e===null||typeof e!="object"?{}:Object.keys(e).reduce((t,r)=>{const n=e[r];return n!=null&&n!==!1&&(t[r]=n),t},{})}function ir(e){const[t,r]=m.useState(Le(e)),n=m.useRef(t),s=m.useCallback(o=>{r(d=>{const v=Le(typeof o=="function"?o(d):o);return n.current=v,v})},[]),c=m.useCallback(()=>s({}),[]),i=m.useCallback(o=>{n.current[o]!==void 0&&s(d=>{const v={...d};return delete v[o],v})},[t]),u=m.useCallback((o,d)=>{d==null||d===!1?i(o):n.current[o]!==d&&s(v=>({...v,[o]:d}))},[t]);return{errorsState:t,setErrors:s,clearErrors:c,setFieldError:u,clearFieldError:i}}function ze(e,t){if(t===null||typeof t!="object")return{};const r={...t};return Object.keys(t).forEach(n=>{n.includes(`${String(e)}.`)&&delete r[n]}),r}function tt(e,t){const r=e.substring(t.length+1).split(".")[0];return parseInt(r,10)}function rt(e,t,r,n){if(t===void 0)return r;const s=`${String(e)}`;let c=r;n===-1&&(c=ze(`${s}.${t}`,c));const i={...c},u=new Set;return Object.entries(c).filter(([o])=>{if(!o.startsWith(`${s}.`))return!1;const d=tt(o,s);return Number.isNaN(d)?!1:d>=t}).forEach(([o,d])=>{const v=tt(o,s),_=o.replace(`${s}.${v}`,`${s}.${v+n}`);i[_]=d,u.add(_),u.has(o)||delete i[o]}),i}function or(e,{from:t,to:r},n){const s=`${e}.${t}`,c=`${e}.${r}`,i={...n},u=new Set;return Object.keys(n).forEach(o=>{if(u.has(o))return;let d,v;if(o.startsWith(s)?(d=o,v=o.replace(s,c)):o.startsWith(c)&&(d=o.replace(c,s),v=o),d&&v){const _=i[d],g=i[v];g===void 0?delete i[d]:i[d]=g,_===void 0?delete i[v]:i[v]=_,u.add(d),u.add(v)}}),i}function nt(e,t,r){typeof r.value=="object"&&(r.value=ce(r.value)),!r.enumerable||r.get||r.set||!r.configurable||!r.writable||t==="__proto__"?Object.defineProperty(e,t,r):e[t]=r.value}function ce(e){if(typeof e!="object")return e;var t=0,r,n,s,c=Object.prototype.toString.call(e);if(c==="[object Object]"?s=Object.create(e.__proto__||null):c==="[object Array]"?s=Array(e.length):c==="[object Set]"?(s=new Set,e.forEach(function(i){s.add(ce(i))})):c==="[object Map]"?(s=new Map,e.forEach(function(i,u){s.set(ce(u),ce(i))})):c==="[object Date]"?s=new Date(+e):c==="[object RegExp]"?s=new RegExp(e.source,e.flags):c==="[object DataView]"?s=new e.constructor(ce(e.buffer)):c==="[object ArrayBuffer]"?s=e.slice(0):c.slice(-6)==="Array]"&&(s=new e.constructor(e)),s){for(n=Object.getOwnPropertySymbols(e);t<n.length;t++)nt(s,n[t],Object.getOwnPropertyDescriptor(e,n[t]));for(t=0,n=Object.getOwnPropertyNames(e);t<n.length;t++)Object.hasOwnProperty.call(s,r=n[t])&&s[r]===e[r]||nt(s,r,Object.getOwnPropertyDescriptor(e,r))}return s||e}function yt(e){return typeof e!="string"?[]:e.split(".")}function B(e,t){const r=yt(e);if(r.length===0||typeof t!="object"||t===null)return;let n=t[r[0]];for(let s=1;s<r.length&&n!=null;s+=1)n=n[r[s]];return n}function Se(e,t,r){const n=yt(e);if(n.length===0)return r;const s=ce(r);if(n.length===1)return s[n[0]]=t,s;let c=s[n[0]];for(let i=1;i<n.length-1;i+=1){if(c===void 0)return s;c=c[n[i]]}return c[n[n.length-1]]=t,s}function ar(e,{from:t,to:r},n){const s=B(e,n);if(!Array.isArray(s))return n;const c=[...s],i=s[t];return c.splice(t,1),c.splice(r,0,i),Se(e,c,n)}function cr(e,t,r,n){const s=B(e,n);if(!Array.isArray(s))return n;const c=[...s];return c.splice(typeof r=="number"?r:c.length,0,t),Se(e,c,n)}function ur(e,t,r){const n=B(e,r);return Array.isArray(n)?Se(e,n.filter((s,c)=>c!==t),r):r}function lr(e,t,r,n){const s=B(e,n);if(!Array.isArray(s)||s.length<=r)return n;const c=[...s];return c[r]=t,Se(e,c,n)}function dr({$values:e,$errors:t,$status:r}){const n=m.useCallback((u,o)=>{r.clearFieldDirty(u),t.setErrors(d=>or(u,o,d)),e.setValues({values:ar(u,o,e.refValues.current),updateState:!0})},[]),s=m.useCallback((u,o)=>{r.clearFieldDirty(u),t.setErrors(d=>rt(u,o,d,-1)),e.setValues({values:ur(u,o,e.refValues.current),updateState:!0})},[]),c=m.useCallback((u,o,d)=>{r.clearFieldDirty(u),t.setErrors(v=>rt(u,d,v,1)),e.setValues({values:cr(u,o,d,e.refValues.current),updateState:!0})},[]),i=m.useCallback((u,o,d)=>{r.clearFieldDirty(u),e.setValues({values:lr(u,d,o,e.refValues.current),updateState:!0})},[]);return{reorderListItem:n,removeListItem:s,insertListItem:c,replaceListItem:i}}var Ae,st;function fr(){return st||(st=1,Ae=function e(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var n,s,c;if(Array.isArray(t)){if(n=t.length,n!=r.length)return!1;for(s=n;s--!==0;)if(!e(t[s],r[s]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if(c=Object.keys(t),n=c.length,n!==Object.keys(r).length)return!1;for(s=n;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,c[s]))return!1;for(s=n;s--!==0;){var i=c[s];if(!e(t[i],r[i]))return!1}return!0}return t!==t&&r!==r}),Ae}var mr=fr();const we=Ce(mr);function Te(e,t){const r=Object.keys(e);if(typeof t=="string"){const n=r.filter(s=>s.startsWith(`${t}.`));return e[t]||n.some(s=>e[s])||!1}return r.some(n=>e[n])}function hr({initialDirty:e,initialTouched:t,mode:r,$values:n}){const[s,c]=m.useState(t),[i,u]=m.useState(e),o=m.useRef(t),d=m.useRef(e),v=m.useCallback(w=>{const A=typeof w=="function"?w(o.current):w;o.current=A,r==="controlled"&&c(A)},[]),_=m.useCallback((w,A=!1)=>{const L=typeof w=="function"?w(d.current):w;d.current=L,(r==="controlled"||A)&&u(L)},[]),g=m.useCallback(()=>v({}),[]),j=m.useCallback(w=>{const A=w?{...n.refValues.current,...w}:n.refValues.current;n.setValuesSnapshot(A),_({})},[]),O=m.useCallback((w,A)=>{v(L=>Te(L,w)===A?L:{...L,[w]:A})},[]),x=m.useCallback((w,A,L)=>{_(q=>Te(q,w)===A?q:{...q,[w]:A},L)},[]),h=m.useCallback((w,A)=>{const L=Te(d.current,w),q=!we(B(w,n.getValuesSnapshot()),A),z=ze(w,d.current);z[w]=q,_(z,L!==q)},[]),$=m.useCallback(w=>Te(o.current,w),[]),C=m.useCallback(w=>_(A=>{if(typeof w!="string")return A;const L=ze(w,A);return delete L[w],we(L,A)?A:L}),[]),Y=m.useCallback(w=>{if(w){const L=B(w,d.current);if(typeof L=="boolean")return L;const q=B(w,n.refValues.current),z=B(w,n.valuesSnapshot.current);return!we(q,z)}return Object.keys(d.current).length>0?Te(d.current):!we(n.refValues.current,n.valuesSnapshot.current)},[]),U=m.useCallback(()=>d.current,[]),N=m.useCallback(()=>o.current,[]);return{touchedState:s,dirtyState:i,touchedRef:o,dirtyRef:d,setTouched:v,setDirty:_,resetDirty:j,resetTouched:g,isTouched:$,setFieldTouched:O,setFieldDirty:x,setTouchedState:c,setDirtyState:u,clearFieldDirty:C,isDirty:Y,getDirty:U,getTouched:N,setCalculatedFieldDirty:h}}function yr({initialValues:e,onValuesChange:t,mode:r}){const n=m.useRef(!1),[s,c]=m.useState(e||{}),i=m.useRef(s),u=m.useRef(s),o=m.useCallback(({values:h,subscribers:$,updateState:C=!0,mergeWithPreviousValues:Y=!0})=>{const U=i.current,N=h instanceof Function?h(i.current):h,w=Y?{...U,...N}:N;i.current=w,C&&(c(w),r==="uncontrolled"&&(i.current=w)),t?.(w,U),$?.filter(Boolean).forEach(A=>A({updatedValues:w,previousValues:U}))},[t]),d=m.useCallback(h=>{const $=B(h.path,i.current),C=h.value instanceof Function?h.value($):h.value;if($!==C){const Y=i.current,U=Se(h.path,C,i.current);o({values:U,updateState:h.updateState}),h.subscribers?.filter(Boolean).forEach(N=>N({path:h.path,updatedValues:U,previousValues:Y}))}},[o]),v=m.useCallback(h=>{u.current=h},[]),_=m.useCallback((h,$)=>{n.current||(n.current=!0,o({values:h,updateState:r==="controlled"}),v(h),$())},[o]),g=m.useCallback(()=>{o({values:u.current,updateState:!0,mergeWithPreviousValues:!1})},[o]),j=m.useCallback(()=>i.current,[]),O=m.useCallback(()=>u.current,[]),x=m.useCallback((h,$)=>{const C=B(h,u.current);typeof C>"u"||d({path:h,value:C,updateState:r==="controlled",subscribers:$})},[d,r]);return{initialized:n,stateValues:s,refValues:i,valuesSnapshot:u,setValues:o,setFieldValue:d,resetValues:g,setValuesSnapshot:v,initialize:_,getValues:j,getValuesSnapshot:O,resetField:x}}function pr({$status:e,cascadeUpdates:t}){const r=m.useRef({}),n=m.useCallback((c,i)=>{m.useEffect(()=>(r.current[c]=r.current[c]||[],r.current[c].push(i),()=>{r.current[c]=r.current[c].filter(u=>u!==i)}),[i])},[]),s=m.useCallback(c=>{const i=r.current[c]?.map(u=>o=>u({previousValue:B(c,o.previousValues),value:B(c,o.updatedValues),touched:e.isTouched(c),dirty:e.isDirty(c)}))??[];if(t)for(const u in r.current)(u.startsWith(`${c}.`)||c.startsWith(`${u}.`))&&i.push(...r.current[u].map(o=>d=>o({previousValue:B(u,d.previousValues),value:B(u,d.updatedValues),touched:e.isTouched(u),dirty:e.isDirty(u)})));return i},[]);return{subscribers:r,watch:n,getFieldSubscribers:s}}function it(e,t){return e?`${e}-${t.toString()}`:t.toString()}const ke=Symbol("root-rule");function ot(e){const t=Le(e);return{hasErrors:Object.keys(t).length>0,errors:t}}function Ye(e,t,r="",n={}){return typeof e!="object"||e===null?n:Object.keys(e).reduce((s,c)=>{const i=e[c],u=`${r===""?"":`${r}.`}${c}`,o=B(u,t);let d=!1;return typeof i=="function"&&(s[u]=i(o,t,u)),typeof i=="object"&&Array.isArray(o)&&(d=!0,o.forEach((v,_)=>Ye(i,t,`${u}.${_}`,s)),ke in i&&(s[u]=i[ke](o,t,u))),typeof i=="object"&&typeof o=="object"&&o!==null&&(d||Ye(i,t,u,s),ke in i&&(s[u]=i[ke](o,t,u))),s},n)}function Ne(e,t){return ot(typeof e=="function"?e(t):Ye(e,t))}function je(e,t,r){if(typeof e!="string")return{hasError:!1,error:null};const n=Ne(t,r),s=Object.keys(n.errors).find(c=>e.split(".").every((i,u)=>i===c.split(".")[u]));return{hasError:!!s,error:s?n.errors[s]:null}}const Tr="__MANTINE_FORM_INDEX__";function at(e,t){return t?typeof t=="boolean"?t:Array.isArray(t)?t.includes(e.replace(/[.][0-9]+/g,`.${Tr}`)):!1:!1}function pt({name:e,mode:t="controlled",initialValues:r,initialErrors:n={},initialDirty:s={},initialTouched:c={},clearInputErrorOnChange:i=!0,validateInputOnChange:u=!1,validateInputOnBlur:o=!1,onValuesChange:d,transformValues:v=(h=>h),enhanceGetInputProps:_,validate:g,onSubmitPreventDefault:j="always",touchTrigger:O="change",cascadeUpdates:x=!1}={}){const h=ir(n),$=yr({initialValues:r,onValuesChange:d,mode:t}),C=hr({initialDirty:s,initialTouched:c,$values:$,mode:t}),Y=dr({$values:$,$errors:h,$status:C}),U=pr({$status:C,cascadeUpdates:x}),[N,w]=m.useState(0),[A,L]=m.useState({}),[q,z]=m.useState(!1),V=m.useCallback(()=>{$.resetValues(),h.clearErrors(),C.resetDirty(),C.resetTouched(),t==="uncontrolled"&&w(T=>T+1)},[]),X=m.useCallback(T=>{i&&h.clearErrors(),t==="uncontrolled"&&w(M=>M+1),Object.keys(U.subscribers.current).forEach(M=>{const R=B(M,$.refValues.current),K=B(M,T);R!==K&&U.getFieldSubscribers(M).forEach(Z=>Z({previousValues:T,updatedValues:$.refValues.current}))})},[i]),se=m.useCallback(T=>{const M=$.refValues.current;$.initialize(T,()=>t==="uncontrolled"&&w(R=>R+1)),X(M)},[X]),E=m.useCallback((T,M,R)=>{const K=at(T,u),Z=M instanceof Function?M(B(T,$.refValues.current)):M;C.setCalculatedFieldDirty(T,Z),O==="change"&&C.setFieldTouched(T,!0),!K&&i&&h.clearFieldError(T),$.setFieldValue({path:T,value:M,updateState:t==="controlled",subscribers:[...U.getFieldSubscribers(T),K?te=>{const Q=je(T,g,te.updatedValues);Q.hasError?h.setFieldError(T,Q.error):h.clearFieldError(T)}:null,R?.forceUpdate!==!1&&t!=="controlled"?()=>L(te=>({...te,[T]:(te[T]||0)+1})):null]})},[d,g]),b=m.useCallback(T=>{const M=$.refValues.current;$.setValues({values:T,updateState:t==="controlled"}),X(M)},[d,X]),y=m.useCallback(()=>{const T=Ne(g,$.refValues.current);return h.setErrors(T.errors),T},[g]),k=m.useCallback(T=>{const M=je(T,g,$.refValues.current);return M.hasError?h.setFieldError(T,M.error):h.clearFieldError(T),M},[g]),p=(T,{type:M="input",withError:R=!0,withFocus:K=!0,...Z}={})=>{const Q={onChange:sr($e=>E(T,$e,{forceUpdate:!1})),"data-path":it(e,T)};return R&&(Q.error=h.errorsState[T]),M==="checkbox"?Q[t==="controlled"?"checked":"defaultChecked"]=B(T,$.refValues.current):Q[t==="controlled"?"value":"defaultValue"]=B(T,$.refValues.current),K&&(Q.onFocus=()=>C.setFieldTouched(T,!0),Q.onBlur=()=>{if(at(T,o)){const $e=je(T,g,$.refValues.current);$e.hasError?h.setFieldError(T,$e.error):h.clearFieldError(T)}}),Object.assign(Q,_?.({inputProps:Q,field:T,options:{type:M,withError:R,withFocus:K,...Z},form:G}))},P=(T,M)=>R=>{j==="always"&&R?.preventDefault();const K=y();if(K.hasErrors)j==="validation-failed"&&R?.preventDefault(),M?.(K.errors,$.refValues.current,R);else{const Z=T?.(v($.refValues.current),R);Z instanceof Promise&&(z(!0),Z.finally(()=>z(!1)))}},a=T=>v(T||$.refValues.current),S=m.useCallback(T=>{T.preventDefault(),V()},[]),F=m.useCallback(T=>T?!je(T,g,$.refValues.current).hasError:!Ne(g,$.refValues.current).hasErrors,[g]),I=T=>`${N}-${String(T)}-${A[String(T)]||0}`,W=m.useCallback(T=>document.querySelector(`[data-path="${it(e,T)}"]`),[]),H=m.useCallback(T=>{$.resetField(T,[t!=="controlled"?()=>L(M=>({...M,[T]:(M[T]||0)+1})):null])},[$.resetField,t,L]),G={watch:U.watch,initialized:$.initialized.current,values:t==="uncontrolled"?$.refValues.current:$.stateValues,getValues:$.getValues,getInitialValues:$.getValuesSnapshot,setInitialValues:$.setValuesSnapshot,resetField:H,initialize:se,setValues:b,setFieldValue:E,submitting:q,setSubmitting:z,errors:h.errorsState,setErrors:h.setErrors,setFieldError:h.setFieldError,clearFieldError:h.clearFieldError,clearErrors:h.clearErrors,resetDirty:C.resetDirty,setTouched:C.setTouched,setDirty:C.setDirty,isTouched:C.isTouched,resetTouched:C.resetTouched,isDirty:C.isDirty,getTouched:C.getTouched,getDirty:C.getDirty,reorderListItem:Y.reorderListItem,insertListItem:Y.insertListItem,removeListItem:Y.removeListItem,replaceListItem:Y.replaceListItem,reset:V,validate:y,validateField:k,getInputProps:p,onSubmit:P,onReset:S,isValid:F,getTransformedValues:a,key:I,getInputNode:W};return nr(e,G),G}const br=({tzRange:e})=>{const t=re.useMediaQuery("(max-width: 64em)"),{closePopover:r}=de(),n=e.timezone.utcOffset?`GMT${e.timezone.utcOffset}`:e.timezone?.longName,s=pt({initialValues:{date:e.startDate??ft(e),time:e.startTime??Ie(e),duration:ht.OneDay},validate:{date:i=>i?null:"Date is required",time:i=>i?null:"Time is required",duration:i=>i?null:"Duration is required"}}),c=i=>{if(!e.timezone.name)return;const u=ve(i.date,i.time,e.timezone.name),o=xe(u,e.timezone.name),{startDate:d,startTime:v,endDate:_,endTime:g}=er(o.date,o.time,i.duration);e.onApply({startDate:d,startTime:v,endDate:_,endTime:g,timezone:e.timezone}),t&&r()};return l.jsx(D.Flex,{direction:"column",flex:2,justify:"space-between",style:{height:"100%"},px:12,children:l.jsxs("form",{className:Ke["form-container"],onSubmit:s.onSubmit(c),children:[l.jsxs(D.Box,{children:[l.jsx(D.Text,{fw:600,children:"Around a time"}),l.jsxs(D.Flex,{direction:"column",gap:8,mt:12,children:[l.jsx(ae.DatePickerInput,{label:"Pick date",placeholder:"Pick date",...s.getInputProps("date"),popoverProps:{withinPortal:!1},valueFormat:ee,leftSection:l.jsx(Ve,{stroke:1.5})},s.key("date")),l.jsx(ae.TimeInput,{label:"Pick time",placeholder:"Pick time",withSeconds:!0,...s.getInputProps("time"),leftSection:l.jsx(Me,{stroke:1.5}),rightSection:t?void 0:l.jsx(D.Text,{style:{fontSize:12,fontStyle:"italic",textAlign:"right"},children:e.timezone?.longName}),rightSectionWidth:t?void 0:180,rightSectionProps:{style:{paddingRight:1}}},s.key("time")),t&&n?l.jsx(D.Text,{size:"xs",c:"dimmed",mt:-4,children:n}):null,l.jsx(D.Select,{label:"Duration",placeholder:"Pick value",data:Xt,...s.getInputProps("duration"),comboboxProps:{withinPortal:!1}},s.key("duration"))]})]}),l.jsx(Re,{})]})})},vr=({tzRange:e})=>{const t=re.useMediaQuery("(max-width: 64em)"),{closePopover:r}=de(),n=e.timezone.utcOffset?`GMT${e.timezone.utcOffset}`:e.timezone?.longName,s=pt({mode:"uncontrolled",initialValues:{startDate:e.startDate??ft(e),startTime:e.startTime??Ie(e),endDate:e.endDate??Zt(30),endTime:e.endTime??Ie(e)},validate:{startDate:i=>i?null:"Start date is required",startTime:i=>i?null:"Start time is required",endDate:(i,u)=>{if(!i)return"End date is required";const o=f(`${u.startDate} ${u.startTime}`),d=f(`${i} ${u.endTime}`);return d.isAfter(o)||d.isSame(o)?null:"End time must be after start time"},endTime:(i,u)=>{if(!i)return"End time is required";const o=f(`${u.startDate} ${u.startTime}`),d=f(`${u.endDate} ${i}`);return d.isAfter(o)||d.isSame(o)?null:"End time must be after start time"}}}),c=i=>{if(!e.timezone.name)return;const u=ve(i.startDate,i.startTime,e.timezone.name),o=ve(i.endDate,i.endTime,e.timezone.name),d=xe(u,e.timezone.name),v=xe(o,e.timezone.name);e.onApply({startDate:d.date,startTime:d.time,endDate:v.date,endTime:v.time,timezone:e.timezone}),t&&r()};return l.jsx(D.Flex,{direction:"column",flex:2,style:{height:"100%"},px:12,children:l.jsxs("form",{className:Ke["form-container"],onSubmit:s.onSubmit(c),children:[l.jsxs(D.Box,{children:[l.jsx(D.Text,{fw:600,children:"Start and end times"}),l.jsxs(D.Flex,{direction:"column",gap:8,mt:12,children:[l.jsx(ae.DatePickerInput,{label:"Start time",...s.getInputProps("startDate"),popoverProps:{withinPortal:!1},valueFormat:ee,leftSection:l.jsx(Ve,{stroke:1.5})},s.key("startDate")),l.jsx(ae.TimeInput,{withSeconds:!0,...s.getInputProps("startTime"),leftSection:l.jsx(Me,{stroke:1.5}),rightSection:t?void 0:l.jsx(D.Text,{style:{fontSize:12,fontStyle:"italic"},children:e.timezone?.longName}),rightSectionWidth:t?void 0:180,rightSectionProps:{style:{paddingRight:1}}},s.key("startTime")),t&&n?l.jsx(D.Text,{size:"xs",c:"dimmed",mt:-4,children:n}):null,l.jsx(ae.DatePickerInput,{label:"End time",...s.getInputProps("endDate"),popoverProps:{withinPortal:!1},valueFormat:ee,leftSection:l.jsx(Ve,{stroke:1.5})},s.key("endDate")),l.jsx(ae.TimeInput,{withSeconds:!0,...s.getInputProps("endTime"),leftSection:l.jsx(Me,{stroke:1.5}),rightSection:t?void 0:l.jsx(D.Text,{style:{fontSize:12,fontStyle:"italic"},children:e.timezone?.longName}),rightSectionWidth:t?void 0:180,rightSectionProps:{style:{paddingRight:1}}},s.key("endTime")),t&&n?l.jsx(D.Text,{size:"xs",c:"dimmed",mt:-4,children:n}):null]})]}),l.jsx(Re,{})]})})},ne={"trigger-button":"_trigger-button_1ds5p_1","picker-shell":"_picker-shell_1ds5p_18","mobile-layout":"_mobile-layout_1ds5p_22","mobile-nav":"_mobile-nav_1ds5p_29","mobile-content":"_mobile-content_1ds5p_33"};var be=(e=>(e.RELATIVE_TIME="Relative time",e.START_END_TIME="Start and end times",e.AROUND_TIME="Around a time",e.TIMEZONE="Time zone",e))(be||{});const xr=e=>{const[t,r]=m.useState("Start and end times"),{popoverOpened:n,setPopoverOpened:s}=de(),c=re.useMediaQuery("(max-width: 48em)"),i=re.useMediaQuery("(max-width: 64em)");m.useEffect(()=>{!i&&t==="Relative time"&&r("Start and end times")},[i,t]);const u=()=>{switch(t){case"Relative time":return l.jsx(et,{tzRange:e,setSelectedPanel:r,mobileOnlyRelative:!0});case"Start and end times":return l.jsx(vr,{tzRange:e});case"Around a time":return l.jsx(br,{tzRange:e});case"Time zone":return l.jsx(mt,{tzRange:e});default:return null}},o=()=>{s(g=>!g)},d=m.useMemo(()=>Pe(e,"desktop"),[e.startDate,e.startTime,e.endDate,e.endTime,e.timezone]),v=m.useMemo(()=>c?Pe(e,"mobile"):i?Pe(e,"tablet"):d,[d,c,i,e]),_=i?l.jsxs("div",{className:ne["mobile-layout"],children:[l.jsx("div",{className:ne["mobile-nav"],children:l.jsx(D.SegmentedControl,{fullWidth:!0,value:t,onChange:g=>r(g),data:[{label:"Quick",value:"Relative time"},{label:"Range",value:"Start and end times"},{label:"Around",value:"Around a time"},{label:"TZ",value:"Time zone"}]})}),l.jsx("div",{className:ne["mobile-content"],children:u()})]}):l.jsxs(D.Flex,{className:ne["picker-shell"],children:[l.jsx(et,{tzRange:e,setSelectedPanel:r}),u()]});return i?l.jsxs(l.Fragment,{children:[l.jsx(D.Button,{onClick:o,style:e.buttonStyle||{},className:ne["trigger-button"],title:d,children:v}),l.jsx(D.Drawer,{opened:n,onClose:()=>s(!1),size:"100%",padding:0,title:"Select time range",styles:{content:{display:"flex",flexDirection:"column"},body:{flex:1,overflow:"hidden",padding:0}},children:l.jsx("div",{className:ne["picker-shell"],children:_})})]}):l.jsxs(D.Popover,{position:"bottom",shadow:"md",opened:n,onChange:s,children:[l.jsx(D.Popover.Target,{children:l.jsx(D.Button,{onClick:o,style:e.buttonStyle||{},className:ne["trigger-button"],title:d,children:v})}),l.jsx(D.Popover.Dropdown,{style:{width:700,height:400,padding:0},py:8,children:_})]})},Sr=e=>l.jsx(Bt,{children:l.jsx(xr,{...e})});exports.Panel=be;exports.TimezonePanel=mt;exports.TimezoneRangePicker=Sr;
|
|
63
63
|
//# sourceMappingURL=index.cjs.js.map
|