@integrativedesigndevelopment/dashboard-core 0.0.11 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -5
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +25 -4
package/README.md
CHANGED
|
@@ -298,16 +298,21 @@ import {
|
|
|
298
298
|
} from '@integrativedesigndevelopment/dashboard-core';
|
|
299
299
|
|
|
300
300
|
function UserManagement() {
|
|
301
|
-
|
|
302
|
-
const { execute, loading, error } = useAsyncOperation(async (userId) => {
|
|
303
|
-
return await api.deleteUser(userId);
|
|
304
|
-
});
|
|
301
|
+
const { executeAsync, loading } = useAsyncOperation();
|
|
305
302
|
|
|
306
303
|
// User management hooks
|
|
307
304
|
const { users, loading: usersLoading } = useGetUsers();
|
|
308
305
|
const { updateUser } = useUpdateUser();
|
|
309
306
|
const { deleteUser } = useDeleteUsers();
|
|
310
307
|
|
|
308
|
+
const handleDelete = (userId: string) => {
|
|
309
|
+
executeAsync(
|
|
310
|
+
() => api.deleteUser(userId),
|
|
311
|
+
'User deleted',
|
|
312
|
+
'Failed to delete user'
|
|
313
|
+
);
|
|
314
|
+
};
|
|
315
|
+
|
|
311
316
|
return (
|
|
312
317
|
<div>
|
|
313
318
|
{usersLoading ? (
|
|
@@ -319,7 +324,12 @@ function UserManagement() {
|
|
|
319
324
|
<button onClick={() => updateUser(user.id, { active: false })}>
|
|
320
325
|
Deactivate
|
|
321
326
|
</button>
|
|
322
|
-
<button
|
|
327
|
+
<button
|
|
328
|
+
onClick={() => handleDelete(user.id)}
|
|
329
|
+
disabled={loading}
|
|
330
|
+
>
|
|
331
|
+
Delete
|
|
332
|
+
</button>
|
|
323
333
|
</div>
|
|
324
334
|
))
|
|
325
335
|
)}
|
package/dist/index.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import t,{Component as a,useState as i,useCallback as o,useEffect as n,Fragment as s,createContext as l,useContext as d,useRef as c}from"react";import{useTailwindConfig as u,IDDInput as g,IDDButton as m,IDDLoader as p,IDDCard as h}from"@integrativedesigndevelopment/idd-common";import{IDDShowPasswordIcon as b,IDDHidePasswordIcon as f,IDDXIcon as y,IDDOutlineWarningIcon as v,IDDInfoIcon as x,IDDOutlineCheckmarkIcon as w}from"@integrativedesigndevelopment/idd-icons";function k(e,r,t,a){return new(t||(t=Promise))(function(i,o){function n(e){try{l(a.next(e))}catch(e){o(e)}}function s(e){try{l(a.throw(e))}catch(e){o(e)}}function l(e){var r;e.done?i(e.value):(r=e.value,r instanceof t?r:new t(function(e){e(r)})).then(n,s)}l((a=a.apply(e,r||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class N extends a{constructor(){super(...arguments),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,r){console.error("ErrorBoundary caught an error:",e,r)}render(){return this.state.hasError?this.props.fallback||e("div",{className:"flex items-center justify-center h-full w-full p-4",children:r("div",{className:"text-center",children:[e("h2",{className:"text-xl font-semibold mb-2",children:"Something went wrong"}),e("p",{className:"text-gray-600 mb-4",children:"An error occurred while loading this component."}),e("button",{onClick:()=>this.setState({hasError:!1,error:void 0}),className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Try again"})]})}):this.props.children}}const E={loginBackground:{type:"color",value:"#f3f4f6",fallback:"#ffffff",backgroundSize:"cover",backgroundPosition:"center",additionalStyles:{}}},_=e=>{const r={backgroundRepeat:"no-repeat"};switch("image"===e.type&&(r.backgroundSize=e.backgroundSize||"cover",r.backgroundPosition=e.backgroundPosition||"center"),e.type){case"image":r.backgroundImage=`url('${e.value}')`,r.backgroundColor=e.fallback;break;case"color":r.backgroundColor=e.value;break;case"gradient":r.backgroundImage=e.value,r.backgroundColor=e.fallback;break;default:r.backgroundColor=e.fallback}return r},C=e=>{try{const r="undefined"!=typeof window?window.location.origin:"http://localhost";return new URL(e,r),!0}catch(e){return!1}},T=e=>{const r=[];return e.type&&["image","color","gradient"].includes(e.type)||r.push('Invalid background type. Must be "image", "color", or "gradient".'),e.value||r.push("Background value is required."),e.fallback||r.push("Fallback color is required."),"image"!==e.type||C(e.value)||r.push("Invalid image URL provided."),r},S=()=>({type:E.loginBackground.type,value:E.loginBackground.value,fallback:E.loginBackground.fallback,backgroundSize:E.loginBackground.backgroundSize,backgroundPosition:E.loginBackground.backgroundPosition,additionalStyles:E.loginBackground.additionalStyles}),P=e=>new Promise((r,t)=>{const a=new Image;a.onload=()=>r(a),a.onerror=t,a.src=e}),I=(e,r)=>{let t;return(...a)=>{clearTimeout(t),t=setTimeout(()=>e(...a),r)}},R=({config:r,className:t="",children:a,onImageError:s,onImageLoad:l,"data-testid":d="login-background"})=>{const[c,u]=i(!1),[g,m]=i(!1),[p,h]=i(!1),b=r||S(),f=T(b);f.length>0&&console.warn("LoginBackground configuration errors:",f);const y=o(()=>k(void 0,void 0,void 0,function*(){if("image"===b.type){h(!0),m(!1);try{yield P(b.value),u(!0),m(!1),null==l||l(new Event("load"))}catch(e){m(!0),u(!1),null==s||s(new Event("error")),console.warn("Failed to load background image:",b.value)}finally{h(!1)}}}),[b.type,b.value,s,l]);n(()=>{y()},[y]),n(()=>{const e=document.documentElement;"image"===b.type?e.style.setProperty("--login-bg-image",`url('${b.value}')`):"color"===b.type?(e.style.setProperty("--login-bg-image","none"),e.style.setProperty("--login-bg-color",b.value)):"gradient"===b.type&&e.style.setProperty("--login-bg-image",b.value),e.style.setProperty("--login-bg-fallback",b.fallback),b.backgroundSize&&e.style.setProperty("--login-bg-size",b.backgroundSize),b.backgroundPosition&&e.style.setProperty("--login-bg-position",b.backgroundPosition),"image"===b.type&&(g||p)&&(e.style.setProperty("--login-bg-image","none"),e.style.setProperty("--login-bg-color",b.fallback))},[b,g,p]);const v=b.additionalStyles||{},x=["bg-login","transition-all duration-300 ease-in-out","min-h-full w-full",t].filter(Boolean).join(" ");return e(N,{fallback:e("div",{children:"Something went wrong with the background"}),children:e("div",{className:x,style:v,"data-testid":d,"data-background-type":b.type,"data-image-loaded":"image"===b.type?c:void 0,"aria-label":"image"===b.type?`Background image: ${b.value}`:"Background styling",children:a})})},D=()=>o(e=>{if("undefined"==typeof window||"undefined"==typeof document)return;const r=document.documentElement;try{if("image"===e.type&&e.value){const t=e.value.replace(/[<>"']/g,"");r.style.setProperty("--login-bg-image",`url('${t}')`)}else if("color"===e.type&&e.value){/^(#[0-9A-F]{6}|#[0-9A-F]{3}|rgb\(|rgba\(|hsl\(|hsla\()/i.test(e.value)&&(r.style.setProperty("--login-bg-image","none"),r.style.setProperty("--login-bg-color",e.value))}else"gradient"===e.type&&e.value&&e.value.includes("gradient(")&&r.style.setProperty("--login-bg-image",e.value);if(e.fallback){const t=e.fallback.replace(/[<>"']/g,"");r.style.setProperty("--login-bg-fallback",t)}if(e.backgroundSize){(["cover","contain","auto","100%"].includes(e.backgroundSize)||/^\d+(px|%|em|rem)$/.test(e.backgroundSize))&&r.style.setProperty("--login-bg-size",e.backgroundSize)}if(e.backgroundPosition){/^(center|left|right|top|bottom|\d+(px|%|em|rem)|\s)+$/.test(e.backgroundPosition)&&r.style.setProperty("--login-bg-position",e.backgroundPosition)}}catch(e){console.warn("Failed to set login background styles:",e)}},[]);var L;!function(e){e[e.VERY_WEAK=0]="VERY_WEAK",e[e.WEAK=1]="WEAK",e[e.FAIR=2]="FAIR",e[e.GOOD=3]="GOOD",e[e.STRONG=4]="STRONG"}(L||(L={}));const A=e=>e/4*100,O=t.memo(({analysis:t,showDetails:a=!0,className:i=""})=>{const o=A(t.score);return r("div",{className:`password-strength-indicator ${i}`,role:"status","aria-live":"polite",children:[r("div",{className:"flex items-center gap-2 mb-2",children:[e("div",{className:"flex-1 bg-gray-200 rounded-full h-2",role:"progressbar","aria-valuenow":t.score,"aria-valuemin":0,"aria-valuemax":4,children:e("div",{className:"h-2 rounded-full transition-all duration-300",style:{width:`${o}%`}})}),e("span",{className:"text-sm font-medium",children:t.label})]}),a&&r("div",{className:"space-y-2",children:[r("div",{className:"flex justify-between text-xs text-gray-600",children:[r("span",{children:["Entropy: ",t.entropy," bits"]}),r("span",{children:["Crack time: ",t.crackTime]})]}),t.warnings.length>0&&e("div",{className:"space-y-1",children:t.warnings.map((t,a)=>r("div",{className:"flex items-start gap-2 text-xs text-amber-600",children:[e("span",{className:"text-amber-500 mt-0.5",children:"⚠"}),e("span",{children:t})]},a))}),t.suggestions.length>0&&e("div",{className:"space-y-1",children:t.suggestions.map((t,a)=>r("div",{className:"flex items-start gap-2 text-xs text-blue-600",children:[e("span",{className:"text-blue-500 mt-0.5",children:"💡"}),e("span",{children:t})]},a))}),e("div",{className:"text-xs font-medium "+(t.isAcceptable?"text-green-600":"text-red-600"),children:t.isAcceptable?"✓ Password meets security requirements":"✗ Password does not meet security requirements"})]})]})}),$=t.memo(({score:r,className:t=""})=>{const a=A(r);return e("div",{className:`w-full bg-gray-200 rounded-full h-1 ${t}`,children:e("div",{className:`h-1 rounded-full transition-all duration-300 ${(e=>{switch(e){case L.VERY_WEAK:return"bg-red-500";case L.WEAK:return"bg-orange-500";case L.FAIR:return"bg-yellow-500";case L.GOOD:return"bg-lime-500";case L.STRONG:return"bg-green-500";default:return"bg-gray-300"}})(r)}`,style:{width:`${a}%`}})})}),z=({requirements:t,password:a,className:i=""})=>r("div",{className:`password-requirements ${i}`,children:[e("div",{className:"text-sm font-medium text-gray-700 mb-2",children:"Password Requirements:"}),e("ul",{className:"space-y-1",children:t.map((t,i)=>{const o=!!a&&(e=>{if(e.includes("lowercase"))return/[a-z]/.test(a);if(e.includes("uppercase"))return/[A-Z]/.test(a);if(e.includes("number"))return/[0-9]/.test(a);if(e.includes("special character"))return/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/.test(a);if(e.includes("characters long")){const r=e.match(/(\d+)-(\d+) characters/);if(r){const e=parseInt(r[1]),t=parseInt(r[2]);return a.length>=e&&a.length<=t}}return!1})(t);return r("li",{className:"flex items-start gap-2 text-xs",children:[e("span",{className:"mt-0.5 "+(o?"text-green-500":"text-gray-400"),children:o?"✓":"○"}),e("span",{className:o?"text-green-600":"text-gray-600",children:t})]},i)})})]}),U={title:"IDD Dashboard",pages:[],plugins:["Dashboard"],categories:[],sub_categories:{},style:{colors:{"idd-red":"#DD3150","idd-red-20":"#F6CBD3","idd-orange":"#D1823B","idd-orange-20":"#F3DFCE","idd-yellow":"#D9C982","idd-yellow-20":"#F4EFDA","idd-green":"#98BD83","idd-green-20":"#E5EEE0","idd-blue":"#00A89D","idd-blue-20":"#6F6F5","idd-purple":"#4040D8","idd-purple-20":"#CFCFF5","idd-brown":"#7A6C53","idd-brown-20":"#F2F0EE","idd-black":"#19191c","idd-black-20":"#C5C5C6","idd-grey":"#6D6E81","idd-grey-20":"#DCDCE1","idd-white":"#fff","idd-transparent":"transparent","idd-primary-color":"#292929","idd-secondary-color":"#5f696d","idd-tertiary-color":"#d8dfe7","idd-tertiary-color-20":"#ECECEC","idd-active-color":"#ad0000","idd-inactive-color":"#DCDCE1","idd-primary-background":"#ad0000","idd-secondary-background":"#f2f0ee","idd-tertiary-background":"#F6F6F9","idd-active-background":"#7a6c53","idd-inactive-background":"#7a6c531a","idd-shadow-color":"rgba(50,69,71,0.17)"},fontFamily:{"idd-primary-font":"Gotham-Book","idd-primary-font-light":"Gotham-Light","idd-primary-font-regular":"Gotham-Book","idd-primary-font-medium":"Gotham-Medium","idd-primary-font-bold":"Gotham-Bold","idd-secondary-font":"Rubik-Regular","idd-secondary-font-light":"Rubik-Light","idd-secondary-font-regular":"Rubik-Regular","idd-secondary-font-medium":"Rubik-Medium","idd-secondary-font-bold":"Rubik-Bold"},fontStyle:{"idd-font-style":"normal"},fontWeight:{"idd-light-font-weight":"300","idd-regular-font-weight":"normal","idd-medium-font-weight":"medium","idd-bold-font-weight":"bold"},fontSize:{"idd-primary-font-size":"1rem","idd-xtrasmall-font-size":"0.25rem","idd-small-font-size":"0.5rem","idd-medium-font-size":"1.125rem","idd-large-font-size":"1.25rem","idd-xtralarge-font-size":"1.5rem"},letterSpacing:{"idd-character-spacing":"0","idd-body-character-spacing":"0.05"},lineHeight:{"idd-primary-line-spacing":"1.5"},backgroundImage:{"gradient-radial":"radial-gradient(var(--tw-gradient-stops))","gradient-conic":"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))","signup-theme":"linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/signup-theme.png')"},borderRadius:{"idd-border-radius":"0.3125rem"}}};let F=U;const B=e=>{F=Object.assign(Object.assign({},U),e)},G=()=>F,j=()=>G(),M=({onChange:t=()=>{},label:a="Password",value:o,componentClass:n="",appendToInputClass:l="",error:d="",errorColor:c="",isErrorOnlyColor:p=!0})=>{const[h,y]=i(!1),[v,x]=i(!1),w=j(),k=u(w.style);return e(g,{label:a,value:o,type:h?"text":"password",componentClass:n,inputWrapperClass:"w-full h-14 rounded-sm border border-idd-grey",inputClass:"px-4 py-2",appendToInputClass:`me-4 ${l}`,activeTextColor:k.colors["idd-black"],inactiveTextColor:!o||"string"==typeof o&&0===o.length?k.colors["idd-grey"]:k.colors["idd-black"],activeColor:k.colors["idd-black"],inactiveColor:!o||"string"==typeof o&&0===o.length?k.colors["idd-grey"]:k.colors["idd-black"],activeLabelColor:k.colors["idd-black"],inactiveLabelColor:!o||"string"==typeof o&&0===o.length?k.colors["idd-grey"]:k.colors["idd-black"],errors:d,errorColor:p?!o||"string"==typeof o&&0===o.length?k.colors["idd-grey"]:k.colors["idd-black"]:c,errorClass:"font-idd-primary-font text-idd-primary-font-size !mb-0",errorStyle:p?{color:k.colors["idd-active-color"]}:{},onFocus:()=>x(!0),onBlur:()=>x(!1),appendToInput:e(m,{buttonClass:"p-1 rounded-sm focus:outline focus-visible:outline focus:outline-1 focus-visible:outline-1offset-1 focus:outline-idd-black focus-visible:outline-idd-black",onPress:()=>y(!h),children:r(s,{children:[e("span",{className:"sr-only",children:h?"password shown":"password hidden"}),e(h?b:f,{color:v?k.colors["idd-black"]:k.colors["idd-grey"]})]})}),onChange:e=>{if(t)if(e&&"object"==typeof e&&"target"in e)t(e);else if("string"==typeof e){t({target:{value:e}})}}})},W=()=>{const e=j(),r=u(e.style);return{config:e,tailwindConfig:r,colors:r.colors}},q={primary:{base:"text-idd-white bg-idd-active-color hover:bg-idd-primary-color focus:bg-idd-primary-color",disabled:"opacity-50 cursor-not-allowed"},secondary:{base:"text-idd-active-color bg-idd-tertiary-background border border-idd-active-color hover:bg-idd-active-color hover:text-idd-white focus:bg-idd-active-color focus:text-idd-white",disabled:"opacity-50 cursor-not-allowed"},tertiary:{base:"text-idd-black bg-idd-tertiary-background hover:bg-idd-grey-20 focus:bg-idd-grey-20",disabled:"opacity-50 cursor-not-allowed"},outline:{base:"text-idd-active-color bg-transparent border border-idd-active-color hover:bg-idd-active-color hover:text-idd-white focus:bg-idd-active-color focus:text-idd-white",disabled:"opacity-50 cursor-not-allowed"},ghost:{base:"text-idd-grey bg-transparent hover:bg-idd-grey-20 hover:text-idd-black focus:bg-idd-grey-20 focus:text-idd-black",disabled:"opacity-50 cursor-not-allowed"},danger:{base:"text-idd-white bg-idd-red hover:opacity-90 focus:opacity-90",disabled:"opacity-50 cursor-not-allowed"},success:{base:"text-idd-white bg-idd-green hover:opacity-90 focus:opacity-90",disabled:"opacity-50 cursor-not-allowed"}},V={button:"font-idd-primary-font-medium text-idd-primary-font-size text-center py-2 px-4 rounded-sm focus:outline-none focus-visible:outline-none transition-colors duration-200",input:"w-full h-[3.125rem] rounded-sm",error:"font-idd-primary-font text-idd-primary-font-size !mb-0",label:"font-idd-primary-font-medium text-idd-primary-font-size"},H=(e="primary",r=!1,t="")=>{const a=q[e];return`${V.button} ${r?a.disabled:a.base} ${t}`.trim()},K=({children:r,onPress:t,onClick:a,disabled:i=!1,type:o="button",className:n="",variant:s="primary","data-testid":l})=>e(m,{type:o,onPress:t||a||(()=>{}),disabled:i,buttonClass:H(s,i,n),"data-testid":l,children:r}),Y=t.memo(({label:t,type:a,value:i,onChange:o,errors:n=[],required:s=!1,autoComplete:l,placeholder:d,disabled:c=!1,showErrors:u=!1,showPasswordToggle:g=!1,onTogglePassword:m,showPassword:p=!1})=>{const h=u&&n.length>0,b=`field-${t.toLowerCase().replace(/\s+/g,"-")}`;return r("div",{className:"form-field "+(h?"form-field--error":""),children:[r("label",{htmlFor:b,className:"form-field__label",children:[t,s&&e("span",{className:"form-field__required","aria-label":"required",children:"*"})]}),r("div",{className:"form-field__input-wrapper",children:[e("input",{id:b,type:a,value:i,onChange:e=>o(e.target.value),autoComplete:l,placeholder:d,disabled:c,required:s,className:"form-field__input "+(h?"form-field__input--error":""),"aria-invalid":h,"aria-required":s,"aria-describedby":h?`${b}-errors`:void 0}),g&&e(K,{type:"button",onPress:m,variant:"ghost",className:"form-field__password-toggle",disabled:c,"data-testid":"password-toggle",children:p?"👁️":"👁️🗨️"})]}),h&&e("div",{id:`${b}-errors`,className:"form-field__errors",role:"alert",children:n.map((r,t)=>e("div",{className:"form-field__error",children:r},t))})]})}),Z=({size:t="medium",message:a="Loading...",show:i=!0,color:o,className:n="","data-testid":s})=>{var l,d;const c=j();return i?(o||null===(d=null===(l=c.style)||void 0===l?void 0:l.colors)||void 0===d||d["idd-active-color"],r("div",{className:`flex flex-col items-center justify-center space-y-4 ${n}`,"data-testid":s,children:[e(p,{}),a&&e("p",{className:"text-sm text-gray-600 font-medium",children:a})]})):null},J=t.memo(({isLoading:t,disabled:a=!1,text:i,loadingText:o,className:n=""})=>r(K,{type:"submit",disabled:a||t,variant:"primary",className:n,"aria-busy":t,"aria-disabled":a||t,children:[r("div",{className:"flex items-center space-x-2",children:[t&&e("div",{className:"inline-block",children:e(Z,{show:!0,size:"small"})}),e("span",{className:"submit-button__text",children:t?o:i})]}),t&&e("span",{id:"submit-loading-text",className:"sr-only",children:"Please wait while we process your request"})]})),Q=t.memo(({checked:t,onChange:a,errors:i=[],disabled:o=!1,showErrors:n=!1,termsUrl:s="/terms",privacyUrl:l="/privacy"})=>{const d=n&&i.length>0,c="terms-checkbox";return r("div",{className:"terms-checkbox "+(d?"terms-checkbox--error":""),children:[r("div",{className:"terms-checkbox__wrapper",children:[e("input",{id:c,type:"checkbox",checked:t,onChange:e=>a(e.target.checked),disabled:o,className:"terms-checkbox__input "+(d?"terms-checkbox__input--error":""),"aria-invalid":d,"aria-describedby":d?`${c}-errors`:void 0,required:!0}),r("label",{htmlFor:c,className:"terms-checkbox__label",children:[e("span",{className:"terms-checkbox__checkmark","aria-hidden":"true",children:t?"✓":""}),r("span",{className:"terms-checkbox__text",children:["I agree to the"," ",e("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"terms-checkbox__link",children:"Terms of Service"})," ","and"," ",e("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"terms-checkbox__link",children:"Privacy Policy"}),e("span",{className:"terms-checkbox__required","aria-label":"required",children:"*"})]})]})]}),d&&e("div",{id:`${c}-errors`,className:"terms-checkbox__errors",role:"alert",children:i.map((r,t)=>e("div",{className:"terms-checkbox__error",children:r},t))})]})}),X={SET_PLUGINS:"set_plugins",SET_CURRENT_PLUGIN:"set_current_plugin",SET_CURRENT_TAB:"set_current_tab",SET_CURRENT_STATE:"set_current_state",SET_CURRENT_VIEW:"set_current_view",SET_CURRENT_ITEM:"set_current_item",COLLAPSED_TOGGLE:"toggle_collapsed",SET_COLOR_MODE:"set_color_mode",TOGGLE_NOTIFICATIONS:"toggle_notifications",SET_SETTING:"set_setting",SET_JWT:"SET_JWT",SET_USER:"SET_USER",RESET:"reset"},ee=e=>({type:X.SET_PLUGINS,payload:e}),re=e=>({type:X.SET_CURRENT_PLUGIN,payload:e}),te=e=>({type:X.SET_CURRENT_TAB,payload:e}),ae=e=>({type:X.SET_CURRENT_STATE,payload:e}),ie=e=>({type:X.SET_CURRENT_VIEW,payload:e}),oe=e=>({type:X.SET_CURRENT_ITEM,payload:e}),ne=()=>({type:X.RESET}),se=(e,r)=>(t,a)=>{t(re(e)),t(te(0));const{session:i}=a(),o=[...i.currentState||[]],n=o.findIndex(r=>r.pluginID===e);-1!==n?o[n]={pluginID:e,tabID:r}:o.push({pluginID:e,tabID:r}),t(ae(o))},le=(e,r)=>(t,a)=>{t(te(e));const{session:i}=a(),o=i.current.id,n=[...i.currentState||[]],s=n.findIndex(e=>e.pluginID===o);-1!==s?n[s]={pluginID:o,tabID:r}:n.push({pluginID:o,tabID:r}),t(ae(n))},de=(e,r)=>({type:X.SET_SETTING,payload:{key:e,value:r}}),ce=()=>({type:X.COLLAPSED_TOGGLE}),ue=()=>({type:X.TOGGLE_NOTIFICATIONS}),ge=({children:r,onPress:t,disabled:a=!1,type:i="button",className:o="",variant:n="outline","data-testid":s})=>e(m,{type:i,onPress:t||(()=>{}),disabled:a,buttonClass:H(n,a,`px-5 ${o}`),"data-testid":s,children:r}),me=({children:r,onPress:t,disabled:a=!1,type:i="submit",className:o="",variant:n="primary","data-testid":s})=>e(m,{type:i,onPress:t||(()=>{}),disabled:a,buttonClass:H(n,a,`px-5 ${o}`),"data-testid":s,children:r});function pe(e){return/^(?:\w+:)?\/\/([^\s.]+\.\S{2}|localhost[:?\d]*)\S*$/.test(e)}const he=({id:t,idsArray:a,onDelete:o=()=>{},onBlur:l=()=>{},link:d,className:c=""})=>{const p=j(),h=u(p.style),[b,f]=i(h.colors["idd-black"]),[v,x]=i({id:"",text:"",url:""});return n(()=>{d&&(d.path&&d.path.length>0?x({id:d.id,text:d.text,url:d.path}):x(d))},[d]),r("div",{className:`flex justify-between items-center ${c}`,onBlur:e=>{e.stopPropagation(),l(v)},children:[e(g,{id:`link-${t}`,componentClass:"w-[45%]",type:"text",label:"Link Text",labelClass:"text-capitalize",showLabel:!!(v&&v.text&&v.text.length>0),placeholder:"Link Text",value:v.text,inputClass:"ps-3 active-primary-black",onChange:e=>{x(Object.assign(Object.assign({},v),{text:e.target.value}))}}),e(g,{id:`url-${t}`,componentClass:"w-45",type:"url",label:"URL",showLabel:!!(v&&v.url&&v.url.length>0),placeholder:"URL",value:v.url,inputClass:"ps-3 active-primary-black",onChange:e=>{x(Object.assign(Object.assign({},v),{url:e.target.value}))}}),e(m,{id:`removeLink-${t}`,onPress:()=>{if(a){let e=[...a];e=e.filter(e=>e!==t),x({id:"",text:"",url:""}),o(e)}},onMouseEnter:()=>f("var(--idd-red)"),onFocus:()=>f("var(--idd-red)"),onMouseLeave:()=>f("var(--idd-primary-black)"),onBlur:()=>f("var(--idd-primary-black)"),isSecondary:!0,buttonClass:"flex items-center justify-center border-0 rounded-sm w-[1.5625rem] h-[1.5625rem] p-0",children:r(s,{children:[e("span",{className:"sr-only",children:"remove link"}),e(y,{wrapperClass:"flex justify-center items-center",color:b})]})})]})},be=({children:r,className:t="flex items-center justify-center min-h-screen w-full p-5"})=>e(N,{children:e("div",{className:`bg-signup-theme bg-cover bg-center bg-no-repeat ${t}`,children:r})}),fe=({label:r,onChange:t=()=>{},value:a,placeholder:i,type:o="text",readOnly:n=!1,error:s="",errorColor:l="",isErrorOnlyColor:d=!0})=>{const c=j(),m=u(c.style);return e(g,{label:r,value:a,onChange:t,placeholder:i,type:o,readOnly:n,activeColor:n?m.colors["idd-grey"]:m.colors["idd-black"],inactiveColor:!a||"string"==typeof a&&0===a.length?m.colors["idd-grey"]:m.colors["idd-black"],activeLabelColor:n?m.colors["idd-grey"]:m.colors["idd-black"],inactiveLabelColor:!a||"string"==typeof a&&0===a.length?m.colors["idd-grey"]:m.colors["idd-black"],activeTextColor:n?m.colors["idd-grey"]:m.colors["idd-black"],inactiveTextColor:!a||"string"==typeof a&&0===a.length?m.colors["idd-grey"]:m.colors["idd-black"],inputWrapperClass:"w-full h-[3.125rem] rounded-sm border border-idd-grey",inputClass:n?"pointer-events-none px-4":"px-4",errors:s,errorColor:d?!a||"string"==typeof a&&0===a.length?m.colors["idd-grey"]:m.colors["idd-black"]:l,errorClass:"font-idd-primary-font text-idd-primary-font-size !mb-0",errorStyle:d?{color:m.colors["idd-active-color"]}:{}})},ye=({children:t,isOpen:a,onClose:i,title:o,showCloseButton:n=!0,size:s="medium",className:l="","data-testid":d})=>{if(!a)return null;return e("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center min-h-screen p-4 z-50",onClick:e=>{e.target===e.currentTarget&&i()},onKeyDown:e=>{"Escape"===e.key&&i()},"data-testid":d,role:"dialog","aria-modal":"true",tabIndex:-1,children:r("div",{className:`bg-white rounded-lg shadow-xl ${{small:"max-w-md",medium:"max-w-lg",large:"max-w-2xl",full:"max-w-full mx-4"}[s]} w-full ${l}`,children:[o&&r("div",{className:"flex items-center justify-between p-6 border-b border-gray-200",children:[e("h2",{className:"text-xl font-semibold text-gray-900",children:o}),n&&e("button",{onClick:i,className:"text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600","aria-label":"Close modal",children:e("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),e("div",{className:"p-6",children:t})]})})},ve=({children:t,title:a,subtitle:i,className:o="",padding:n="medium",shadow:s="medium",border:l=!0,"data-testid":d})=>{const c=["bg-white rounded-lg",{none:"",small:"shadow-sm",medium:"shadow-md",large:"shadow-lg"}[s],l?"border border-gray-200":"",o].filter(Boolean).join(" ");return e(h,{"data-testid":d,children:e("div",{className:c,children:r("div",{className:{none:"",small:"p-3",medium:"p-6",large:"p-8"}[n],children:[(a||i)&&r("div",{className:"mb-4",children:[a&&e("h3",{className:"text-lg font-semibold text-gray-900 mb-1",children:a}),i&&e("p",{className:"text-sm text-gray-600",children:i})]}),t]})})})},xe=[],we=l(void 0),ke=({config:r,children:a})=>{const[i,o]=t.useState(r),n={config:i,updateConfig:e=>{o(r=>Object.assign(Object.assign({},r),e))}};return e(we.Provider,{value:n,children:a})},Ne=()=>{const e=d(we);if(!e)throw new Error("useDashboard must be used within a DashboardProvider");return e},Ee=({plugins:t,children:a})=>{const[o,n]=i(t.length>0?t[0].id:null),[s,l]=i(0);return r("div",{className:"plugin-manager",children:[a,0===t.length?null:r("div",{className:"plugin-list mb-4",children:[e("h3",{className:"text-lg font-semibold mb-2",children:"Available Plugins:"}),e("div",{className:"space-x-2",children:t.map(r=>e("button",{onClick:()=>{n(r.id),l(0)},className:"px-3 py-1 rounded "+(o===r.id?"bg-blue-500 text-white":"bg-gray-200 text-gray-700 hover:bg-gray-300"),children:r.name},r.id))})]}),e("div",{className:"plugin-content",children:(()=>{if(!o||0===t.length)return null;const e=t.find(e=>e.id===o);if(!e||!e.tabs||0===e.tabs.length)return null;return(e.tabs[s]||e.tabs[0]).content})()})]})},_e=e=>xe.flatMap(e=>Array.isArray(e)?e:[e]);function Ce(e){return Array.isArray(e)?e:[]}function Te(e,r){return Ce(e).filter(r)}function Se(e,r){return Ce(e).map(r)}function Pe(e,r){return Ce(e).find(r)}function Ie(e,r){return Ce(e).some(r)}function Re(e){return Ce(e).length}function De(e){return Array.isArray(e)&&e.length>0}const Le=(e,...r)=>k(void 0,[e,...r],void 0,function*(e,r=5e3){return e.startsWith("data:")||e.startsWith("url(")?{exists:!0,fallbackUsed:!1}:new Promise(t=>{const a=new Image,i=setTimeout(()=>{t({exists:!1,error:"Asset loading timeout",fallbackUsed:!0})},r);a.onload=()=>{clearTimeout(i),t({exists:!0,fallbackUsed:!1})},a.onerror=()=>{clearTimeout(i),t({exists:!1,error:"Asset failed to load",fallbackUsed:!0})},a.src=e})}),Ae=(e,r)=>k(void 0,void 0,void 0,function*(){const t=e.map(e=>k(void 0,void 0,void 0,function*(){return{path:e,result:yield Le(e,r)}}));return(yield Promise.all(t)).reduce((e,{path:r,result:t})=>(e[r]=t,e),{})}),Oe=(e,r)=>{if(((null==r?void 0:r.fallbackUsed)||!1===(null==r?void 0:r.exists))&&e.fallback)return{backgroundColor:e.fallback,backgroundImage:"none"};return{backgroundImage:e.path.startsWith("url(")||e.path.startsWith("data:")?e.path:`url('${e.path}')`}},$e=(e,r)=>{const[t,a]=i({exists:!0,fallbackUsed:!1}),[o,s]=i(!0);return n(()=>{let t=!0;return k(void 0,void 0,void 0,function*(){s(!0);const i=yield Le(e,r);t&&(a(i),s(!1))}),()=>{t=!1}},[e,r]),{result:t,isLoading:o}},ze={SIGNUP_THEME:"/signup-theme.png",LOGO_ENVIROME:"/logo-envirome.png",BVOC:"/bvoc.png",LOGO:"/logo.png"},Ue={PRIMARY:"#ad0000",SECONDARY:"#0066cc",NEUTRAL:"#666666",SUCCESS:"#00A89D",WARNING:"#DD3150"},Fe=()=>k(void 0,void 0,void 0,function*(){return Ae(Object.values(ze))}),Be=e=>{if("development"!==process.env.NODE_ENV)return;const r=Object.entries(e).filter(([,e])=>!e.exists).map(([e])=>e);r.length>0&&console.warn("⚠️ IDD Dashboard: Missing optional assets detected:",r,"\nSee https://github.com/integrativedesigndevelopment/idd-dashboard/blob/main/docs/guides/required-assets.md for details.")};function Ge(e){if(!e)return e;if("undefined"!=typeof window){const r=document.createElement("div");r.textContent=e;return r.innerHTML.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/javascript:/gi,"").replace(/on\w+\s*=/gi,"").replace(/style\s*=/gi,"").replace(/<iframe/gi,"<iframe").replace(/<object/gi,"<object").replace(/<embed/gi,"<embed").replace(/<form/gi,"<form")}return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function je(e){return/<[a-z][\s\S]*>/i.test(e)}function Me(e,r){for(let t=0;t<e.length;t++){let a=!1;if(a=je(e[t]),a){const a={text:e[t],hasLinks:!0};r.push(a)}else{const a={text:e[t],hasLinks:!1};r.push(a)}}}const We=({type:r,style:t,text:a,items:i,orderedListStyle:o="",unorderedListStyle:n="",paragraphStyle:s=""})=>{if("list"===r){if("ordered"===t){const r=[];return i&&Me(i,r),e("ol",{className:o,children:r.map((r,t)=>r.hasLinks?e("li",{dangerouslySetInnerHTML:{__html:Ge(r.text)}},t):e("li",{children:r.text},t))})}{const r=[];return i&&Me(i,r),e("ul",{className:n,children:r.map((r,t)=>r.hasLinks?e("li",{dangerouslySetInnerHTML:{__html:Ge(r.text)}},t):e("li",{children:r.text},t))})}}{let r;return a?(r=je(a),e("p",r?{className:s,dangerouslySetInnerHTML:{__html:Ge(a)}}:{className:s,children:a})):e("p",{className:s,children:a})}},qe=(e,r)=>e&&e.length>r?e.slice(0,r)+"...":e,Ve=()=>{const[e,r]=i({width:0,height:0});return n(()=>{function e(){r({width:window.innerWidth,height:window.innerHeight})}return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e};function He(e,r){const t=r||[];return(e||[]).filter(e=>!t.includes(e))}function Ke(e){return(e||[]).reduce((e,r)=>e.concat(Array.isArray(r)?Ke(r):r),[])}const Ye=e=>{let r="";return e&&(r=e.address_1&&e.address_1.length>0?e.address_1+", ":"",e.address_2&&e.address_2.length>0?r+=e.address_2+", ":r+="",e.city&&e.city.length>0?r+=e.city+", ":r+="",e.state&&e.state.length>0?r+=e.state:r+="",e.zip&&e.zip.length>0&&(r+=" "+e.zip)),r},Ze=e=>"EVALUATOR"===e?"MODERATOR":e,Je=e=>e&&"string"==typeof e?e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/<[^>]+>/g,"").replace(/javascript:/gi,"").replace(/on\w+\s*=/gi,"").trim():"",Qe=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),Xe=e=>{try{return new URL(e),!0}catch(e){return!1}},er=e=>!e||0===e.trim().length,rr=(e,r,t)=>{const a=e?e.length:0;return a>=r&&a<=t},tr=e=>/^[a-zA-Z0-9]+$/.test(e),ar=e=>/^[a-zA-Z]+$/.test(e),ir=e=>/^\d+$/.test(e),or=e=>/^[\d\s\-\(\)\+]+$/.test(e)&&e.replace(/\D/g,"").length>=10,nr=e=>e.replace(/\s+/g," ").trim(),sr=(e,r)=>r.test(e),lr=e=>{const r=new Date(e);return!isNaN(r.getTime())},dr=(e,r=[])=>({isValid:e,errors:r}),cr=l(null),ur=({children:r})=>{const[t,a]=i([]),s=c(new Map),l=o(e=>{const r=s.current.get(e);r&&(clearTimeout(r),s.current.delete(e)),a(r=>r.filter(r=>r.id!==e))},[]),d=o((e,r="error",t=!0,i=1e4)=>{const o=`error_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,n={id:o,type:r,message:e,timestamp:Date.now(),autoHide:t,duration:i};if(a(t=>t.some(t=>t.message===e&&t.type===r)?t:[...t,n]),t&&i){const e=setTimeout(()=>{l(o)},i);s.current.set(o,e)}return o},[l]),u=o(()=>{s.current.forEach(e=>{clearTimeout(e)}),s.current.clear(),a([])},[]),g=o((e,r=!0)=>d(e,"error",r),[d]),m=o((e,r=!0)=>d(e,"success",r),[d]),p=o((e,r=!0)=>d(e,"warning",r),[d]),h=o((e,r=!0)=>d(e,"info",r),[d]);n(()=>()=>{s.current.forEach(e=>{clearTimeout(e)}),s.current.clear()},[]);const b={errors:t,addError:d,removeError:l,clearErrors:u,showError:g,showSuccess:m,showWarning:p,showInfo:h};return e(cr.Provider,{value:b,children:r})},gr=()=>{const e=d(cr);if(!e)throw new Error("useError must be used within an ErrorProvider");return e},mr=()=>{const{showError:e}=gr();return{handleError:o((r,t)=>{console.error("Error caught by boundary:",r,t),e("An unexpected error occurred. Please try again.")},[e])}},pr=({error:t,onClose:a})=>r("div",{className:`text-white p-4 rounded-lg shadow-lg ring-2 ${(()=>{switch(t.type){case"success":return"ring-idd-green";case"warning":return"ring-idd-yellow";case"info":return"ring-idd-purple";default:return"ring-idd-active-color"}})()} flex items-start gap-3 max-w-md`,children:[e("div",{className:"flex-shrink-0 mt-0.5",children:(()=>{switch(t.type){case"success":return e(w,{});case"warning":default:return e(v,{});case"info":return e(x,{})}})()}),e("div",{className:"flex-1 min-w-0",children:r("div",{className:"font-idd-primary-font-regular text-lg leading-relaxed",children:[e("span",{className:"font-idd-primary-font-bold text-lg",children:(()=>{switch(t.type){case"success":return"Success: ";case"warning":return"Warning: ";case"info":return"Info: ";default:return"Error: "}})()})," ",t.message]})}),e(m,{buttonClass:"border-0 bg-idd-transparent ms-auto",onPress:()=>a(t.id),"aria-label":"Close",children:e(y,{})})]}),hr=()=>{const{errors:r,removeError:t}=gr();return 0===r.length?null:e("div",{className:"fixed bottom-10 right-10 flex flex-col gap-3",style:{zIndex:1e3},children:r.map(r=>e("div",{className:"bg-idd-white mt-3",children:e(pr,{error:r,onClose:t})},r.id))})};export{X as ActionTypes,ge as CancelActionButton,ve as Card,me as ConfirmActionButton,We as ContentItem,ze as DEFAULT_ASSET_PATHS,Ue as DEFAULT_FALLBACK_COLORS,ke as DashboardProvider,N as ErrorBoundary,ur as ErrorProvider,pr as ErrorToast,hr as ErrorToastContainer,Y as FormField,he as IDDLinkInputItem,be as Layout,Z as Loader,R as LoginBackground,ye as Modal,M as Password,z as PasswordRequirements,L as PasswordStrength,$ as PasswordStrengthBar,O as PasswordStrengthIndicator,Ee as PluginManager,K as SimpleButton,J as SubmitButton,Q as TermsCheckbox,fe as TextInput,q as buttonVariants,V as commonStyles,S as createDefaultConfig,dr as createValidationResult,I as debounce,U as defaultConfig,Ce as ensureArray,Ke as flatten,_ as generateBackgroundStyles,He as getArraysDiff,Oe as getBackgroundStyle,H as getButtonStyles,G as getConfig,Ye as getLocationString,_e as get_all_plugins,ar as isAlpha,tr as isAlphanumeric,er as isEmpty,rr as isLengthValid,De as isNonEmptyArray,ir as isNumeric,pe as isURL,lr as isValidDate,Qe as isValidEmail,C as isValidImageUrl,or as isValidPhone,Xe as isValidUrl,Ze as mapUserRole,sr as matchesPattern,nr as normalizeWhitespace,P as preloadImage,ne as resetReducer,Te as safeFilter,Pe as safeFind,Re as safeLength,Se as safeMap,Ie as safeSome,Je as sanitizeInput,B as setConfig,oe as setCurrentItem,re as setCurrentPlugin,se as setCurrentPluginAndTab,ae as setCurrentState,te as setCurrentTab,le as setCurrentTabAndState,ie as setCurrentView,ee as setPlugins,de as setSetting,ce as toggleCollapsed,ue as toggleNotifications,qe as truncate,$e as useAssetValidation,j as useConfig,Ne as useDashboard,gr as useError,mr as useErrorBoundary,W as useIDDTheme,D as useLoginBackground,Ve as useWindowDimensions,Le as validateAsset,Ae as validateAssets,Fe as validateCommonAssets,T as validateConfig,Be as warnMissingAssets};
|
|
1
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import r,{memo as n,Fragment as s,useMemo as i,useCallback as a,useState as o,useEffect as l,Component as u,createContext as c,useContext as d,useId as h,useRef as m}from"react";import{useTailwindConfig as f,IDDInput as y,IDDButton as g,IDDLoader as p,IDDModal as b,HeaderSize as w,IDDCard as v}from"@integrativedesigndevelopment/idd-common";import{IDDShowPasswordIcon as k,IDDHidePasswordIcon as N,IDDXIcon as S,IDDOutlineXIcon as T,IDDInfoIcon as x,IDDOutlineWarningIcon as O,IDDOutlineCheckmarkIcon as C}from"@integrativedesigndevelopment/idd-icons";import{Tracker as E,TrackerProvider as D}from"react-tracker";var I;!function(e){e[e.VERY_WEAK=0]="VERY_WEAK",e[e.WEAK=1]="WEAK",e[e.FAIR=2]="FAIR",e[e.GOOD=3]="GOOD",e[e.STRONG=4]="STRONG"}(I||(I={}));const M=e=>Math.min(100,Math.max(0,e/4*100)),_=e=>({[I.VERY_WEAK]:"bg-red-500",[I.WEAK]:"bg-orange-500",[I.FAIR]:"bg-yellow-500",[I.GOOD]:"bg-lime-500",[I.STRONG]:"bg-green-500"}[e]||"bg-gray-300"),$=n(({analysis:r})=>{var n,i,a;const o=r.warnings.length>0?r.warnings:(null===(n=r.feedback)||void 0===n?void 0:n.warning)?[r.feedback.warning]:[],l=r.suggestions.length>0?r.suggestions:null!==(a=null===(i=r.feedback)||void 0===i?void 0:i.suggestions)&&void 0!==a?a:[],u=o.length>0,c=l.length>0;return e("div",{className:"space-y-2",role:"status",children:[(void 0!==r.entropy||r.crackTime)&&e("div",{className:"flex justify-between text-xs text-gray-600","aria-label":"Security metrics",children:[void 0!==r.entropy&&e("span",{children:["Entropy: ",Math.round(r.entropy)," bits"]}),r.crackTime&&e("span",{children:["Crack time: ",r.crackTime]})]}),u&&t("div",{className:"space-y-1",role:"alert","aria-label":"Password warnings",children:o.map((r,n)=>e("div",{className:"flex items-start gap-2 text-xs text-amber-600",children:[t("span",{className:"text-amber-500 mt-0.5","aria-hidden":"true",children:"⚠"}),t("span",{children:r})]},`warning-${r}-${n}`))}),c&&t("div",{className:"space-y-1","aria-label":"Password improvement suggestions",children:l.map((r,n)=>e("div",{className:"flex items-start gap-2 text-xs text-blue-600",children:[t("span",{className:"text-blue-500 mt-0.5","aria-hidden":"true",children:"💡"}),t("span",{children:r})]},`suggestion-${r}-${n}`))}),void 0!==r.isAcceptable&&t("div",{className:"text-xs font-medium "+(r.isAcceptable?"text-green-600":"text-red-600"),role:"status","aria-live":"assertive",children:r.isAcceptable?e(s,{children:[t("span",{"aria-hidden":"true",children:"✓"})," Password meets security requirements"]},"acceptance-status-true"):e(s,{children:[t("span",{"aria-hidden":"true",children:"✗"})," Password does not meet security requirements"]},"acceptance-status-false")})]})});$.displayName="StrengthDetails";const V=n(({score:e,className:r="",label:n})=>{const s=i(()=>M(e),[e]),a=i(()=>_(e),[e]),o=i(()=>({width:`${s}%`,transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"}),[s]);return t("div",{className:`w-full bg-gray-200 rounded-full h-1 overflow-hidden ${r}`,role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":4,"aria-label":n||`Password strength: ${e} out of 4`,children:t("div",{className:`h-1 rounded-full ${a}`,style:o,"data-testid":"password-strength-bar"})})});V.displayName="PasswordStrengthBar";const L={lowercase:{pattern:/[a-z]/},uppercase:{pattern:/[A-Z]/},number:{pattern:/[0-9]/},special:{pattern:/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/},symbol:{pattern:/[!@#$%^&*()_+\-=[\]{};':"\\|,.<>/?]/}},F=/\b(no|not|without|must not|cannot)\b/i,W=n(({requirements:r,password:n,custom_check:s,className:o="",title:l="Password Requirements:"})=>{const u=a((e,t)=>{const r=null==s?void 0:s(e,t);return void 0!==r?r:function(e,t){if(!t)return!1;const r=e.toLowerCase();let n=!1;for(const[s,i]of Object.entries(L)){if(!r.includes(s))continue;n=!0;const a=i.pattern.test(t);if(F.test(e)&&e.toLowerCase().indexOf(s)>e.toLowerCase().search(F)){if(a)return!1}else if(!a)return!1}const s=e.match(/(\d+)(?:\s*-\s*(\d+))?\s*characters?/i);if(s){n=!0;const e=parseInt(s[1],10),r=s[2]?parseInt(s[2],10):1/0;if(t.length<e||t.length>r)return!1}const i=e.match(/at\s+least\s+(\d+)/i);if(i){n=!0;const e=parseInt(i[1],10);if(t.length<e)return!1}return n}(e,t)},[s]),c=i(()=>r.map(e=>({requirement:e,is_met:u(e,n)})),[r,n,u]),d=i(()=>c.every(({is_met:e})=>e),[c]);return e("div",{className:`password-requirements ${o}`,role:"group","aria-label":l,children:[t("div",{className:"text-sm font-medium text-gray-700 mb-2",children:l}),t("ul",{className:"space-y-1",role:"list",children:c.map(({requirement:r,is_met:n})=>e("li",{className:"flex items-start gap-2 text-xs",role:"listitem",children:[t("span",{className:"mt-0.5 transition-colors duration-200 "+(n?"text-green-500":"text-gray-400"),"aria-hidden":"true",children:n?"✓":"○"}),e("span",{className:"transition-colors duration-200 "+(n?"text-green-600":"text-gray-600"),children:[r,n&&t("span",{className:"sr-only",children:" (met)"}),!n&&t("span",{className:"sr-only",children:" (not met)"})]})]},r))}),d&&t("div",{className:"sr-only",role:"status","aria-live":"polite",children:"All password requirements have been met"})]})});W.displayName="PasswordRequirements";const A=n(({analysis:r,showDetails:n=!0,className:s="","aria-describedby":a})=>{const o=i(()=>M(r.score),[r.score]),l=i(()=>_(r.score),[r.score]),u=i(()=>r.label||`Strength: ${r.score}/4`,[r.label,r.score]),c=i(()=>({width:`${o}%`,transition:"width 0.3s ease, background-color 0.3s ease"}),[o]);return e("div",{className:`password-strength-indicator ${s}`,role:"region","aria-label":"Password strength indicator","aria-live":"polite","aria-atomic":"true",children:[e("div",{className:"flex items-center gap-2 mb-2",children:[t("div",{className:"flex-1 bg-gray-200 rounded-full h-2 overflow-hidden",role:"progressbar","aria-valuenow":r.score,"aria-valuemin":0,"aria-valuemax":4,"aria-valuetext":u,children:t("div",{className:`h-2 rounded-full ${l}`,style:c,"data-testid":"strength-bar"})}),t("span",{className:"text-sm font-medium min-w-[80px] text-right",id:a,children:u})]}),n&&t($,{analysis:r})]})});A.displayName="PasswordStrengthIndicator";const z={title:"IDD Dashboard",pages:[],plugins:["Dashboard"],categories:[],sub_categories:{},style:{colors:{"idd-red":"#DD3150","idd-red-20":"#F6CBD3","idd-orange":"#D1823B","idd-orange-20":"#F3DFCE","idd-yellow":"#D9C982","idd-yellow-20":"#F4EFDA","idd-green":"#98BD83","idd-green-20":"#E5EEE0","idd-blue":"#00A89D","idd-blue-20":"#6F6F5","idd-purple":"#4040D8","idd-purple-20":"#CFCFF5","idd-brown":"#7A6C53","idd-brown-20":"#F2F0EE","idd-black":"#19191c","idd-black-20":"#C5C5C6","idd-grey":"#6D6E81","idd-grey-20":"#DCDCE1","idd-white":"#fff","idd-transparent":"transparent","idd-primary-color":"#292929","idd-secondary-color":"#5f696d","idd-tertiary-color":"#d8dfe7","idd-tertiary-color-20":"#ECECEC","idd-active-color":"#ad0000","idd-inactive-color":"#DCDCE1","idd-primary-background":"#ad0000","idd-secondary-background":"#f2f0ee","idd-tertiary-background":"#F6F6F9","idd-active-background":"#7a6c53","idd-inactive-background":"#7a6c531a","idd-shadow-color":"rgba(50,69,71,0.17)"},fontFamily:{"idd-primary-font":"Gotham-Book","idd-primary-font-light":"Gotham-Light","idd-primary-font-regular":"Gotham-Book","idd-primary-font-medium":"Gotham-Medium","idd-primary-font-bold":"Gotham-Bold","idd-secondary-font":"Rubik-Regular","idd-secondary-font-light":"Rubik-Light","idd-secondary-font-regular":"Rubik-Regular","idd-secondary-font-medium":"Rubik-Medium","idd-secondary-font-bold":"Rubik-Bold"},fontStyle:{"idd-font-style":"normal"},fontWeight:{"idd-light-font-weight":"300","idd-regular-font-weight":"normal","idd-medium-font-weight":"medium","idd-bold-font-weight":"bold"},fontSize:{"idd-primary-font-size":"1rem","idd-xtrasmall-font-size":"0.25rem","idd-small-font-size":"0.5rem","idd-medium-font-size":"1.125rem","idd-large-font-size":"1.25rem","idd-xtralarge-font-size":"1.5rem"},letterSpacing:{"idd-character-spacing":"0","idd-body-character-spacing":"0.05"},lineHeight:{"idd-primary-line-spacing":"1.5"},backgroundImage:{"gradient-radial":"radial-gradient(var(--tw-gradient-stops))","gradient-conic":"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))","signup-theme":"linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/signup-theme.png')"},borderRadius:{"idd-border-radius":"0.3125rem"}}};let j=z;const Z=e=>{j=Object.assign(Object.assign({},z),e)},R=()=>j,q=()=>R(),U=({label:r="Password",onChange:n=()=>{},value:i,componentClass:a="",inputWrapperClass:l="w-full h-[3.125rem] rounded-[0.3125rem] border border-idd-grey",inputClass:u="px-4",appendToInputClass:c="",error:d="",errorColor:h="",errorClass:m="font-idd-primary-font text-idd-primary-font-size !mb-0",isErrorOnlyColor:p=!0,iconColorActive:b="idd-black",iconColorInactive:w="idd-grey",textColorActive:v="idd-black",textColorInactive:S="idd-grey",labelColorActive:T="idd-black",labelColorInactive:x="idd-grey",borderColorActive:O="idd-grey",borderColorInactive:C="idd-grey",toggleVisibilityButtonClass:E="p-1 rounded-sm focus:outline focus-visible:outline focus:outline-1 focus-visible:offset-1 focus:outline-idd-black focus-visible:outline-idd-black"})=>{const[D,I]=o(!1),[M,_]=o(!1),$=q(),V=f($.style).colors;return t(y,{label:r,value:i,type:D?"text":"password",componentClass:a,inputWrapperClass:l,inputClass:u,appendToInputClass:`me-4 ${c}`,activeTextColor:v,inactiveTextColor:S,activeColor:O,inactiveColor:C,activeLabelColor:T,inactiveLabelColor:x,errors:d,errorColor:p?!i||"string"==typeof i&&0===i.length?V[S]:V[v]:h,errorClass:m,errorStyle:p?{color:V["idd-active-color"]}:{},onFocus:()=>_(!0),onBlur:()=>_(!1),appendToInput:t(g,{buttonClass:E,onPress:()=>I(!D),children:e(s,{children:[t("span",{className:"sr-only",children:D?"Hide password":"Show password"}),t("span",D?{"data-testid":"show-password-icon",children:t(k,{color:M?V[b]:V[w]})}:{"data-testid":"hide-password-icon",children:t(N,{color:M?V[b]:V[w]})})]})}),onChange:e=>{(e=>!!e&&"object"==typeof e&&"target"in e)(e)?n(e):"string"==typeof e&&n({target:{value:e}})}})};U.displayName="Password";const P=()=>{const e=q(),t=f(e.style);return{config:e,tailwindConfig:t,colors:t.colors}},G={primary:{base:"text-idd-white bg-idd-active-color hover:bg-idd-primary-color focus:bg-idd-primary-color",disabled:"opacity-50 cursor-not-allowed"},secondary:{base:"text-idd-active-color bg-idd-tertiary-background border border-idd-active-color hover:bg-idd-active-color hover:text-idd-white focus:bg-idd-active-color focus:text-idd-white",disabled:"opacity-50 cursor-not-allowed"},tertiary:{base:"text-idd-black bg-idd-tertiary-background hover:bg-idd-grey-20 focus:bg-idd-grey-20",disabled:"opacity-50 cursor-not-allowed"},outline:{base:"text-idd-active-color bg-transparent border border-idd-active-color hover:bg-idd-active-color hover:text-idd-white focus:bg-idd-active-color focus:text-idd-white",disabled:"opacity-50 cursor-not-allowed"},ghost:{base:"text-idd-grey bg-transparent hover:bg-idd-grey-20 hover:text-idd-black focus:bg-idd-grey-20 focus:text-idd-black",disabled:"opacity-50 cursor-not-allowed"},danger:{base:"text-idd-white bg-idd-red hover:opacity-90 focus:opacity-90",disabled:"opacity-50 cursor-not-allowed"},success:{base:"text-idd-white bg-idd-green hover:opacity-90 focus:opacity-90",disabled:"opacity-50 cursor-not-allowed"}},H={button:"font-idd-primary-font-medium text-idd-primary-font-size text-center py-2 px-4 rounded-[0.3125rem] focus:outline-none focus-visible:outline-none transition-colors duration-200",input:"w-full h-[3.125rem] rounded-[0.3125rem]",error:"font-idd-primary-font text-idd-primary-font-size !mb-0",label:"font-idd-primary-font-medium text-idd-primary-font-size"},Y=(e="primary",t=!1,r="")=>{const n=G[e];return`${H.button} ${t?n.disabled:n.base} ${r}`.trim()},J=({children:e,onPress:r,onClick:n,disabled:s=!1,type:i="button",className:a="",variant:o="primary","data-testid":l})=>t(g,{type:i,onPress:r||n||(()=>{}),disabled:s,buttonClass:Y(o,s,a),"data-testid":l,children:e});J.displayName="SimpleButton";const B=r.memo(({label:r,type:n,value:s,onChange:i,errors:a=[],required:o=!1,autoComplete:l,placeholder:u,disabled:c=!1,showErrors:d=!1,showPasswordToggle:h=!1,onTogglePassword:m,showPassword:f=!1})=>{const y=d&&a.length>0,g=`field-${r.toLowerCase().replace(/\s+/g,"-")}`;return e("div",{className:"form-field "+(y?"form-field--error":""),children:[e("label",{htmlFor:g,className:"form-field__label",children:[r,o&&t("span",{className:"form-field__required","aria-label":"required",children:"*"})]}),e("div",{className:"form-field__input-wrapper",children:[t("input",{id:g,type:n,value:s,onChange:e=>i(e.target.value),autoComplete:l,placeholder:u,disabled:c,required:o,className:"form-field__input "+(y?"form-field__input--error":""),"aria-invalid":y,"aria-required":o,"aria-describedby":y?`${g}-errors`:void 0}),h&&t(J,{type:"button",onPress:m,variant:"ghost",className:"form-field__password-toggle",disabled:c,"data-testid":"password-toggle",children:f?"👁️":"👁️🗨️"})]}),y&&t("div",{id:`${g}-errors`,className:"form-field__errors",role:"alert",children:a.map((e,r)=>t("div",{className:"form-field__error",children:e},r))})]})});function K(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]])}return r}function Q(e,t,r,n){return new(r||(r=Promise))(function(s,i){function a(e){try{l(n.next(e))}catch(e){i(e)}}function o(e){try{l(n.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,o)}l((n=n.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const X=r.memo(r=>{var n,s,{message:i="Loading...",message_class:a="text-idd-primary-font-size text-idd-grey font-idd-primary-font-medium",show:o=!0,size:l,color:u,className:c="","data-testid":d}=r,h=K(r,["message","message_class","show","size","color","className","data-testid"]);const m=q();if(!o)return null;const f=["flex flex-col items-center justify-center",c].join(" "),y=u||(null===(s=null===(n=m.style)||void 0===n?void 0:n.colors)||void 0===s?void 0:s["idd-active-color"])||"#ad0000";return e("div",{className:f,"data-testid":d,role:"status","aria-live":"polite","aria-busy":!0,children:[t(p,Object.assign({},h,null!=l?{size:l}:{},{squareColor:y})),(null==i?void 0:i.trim())&&t("p",{className:a,children:i})]})});X.displayName="Loader";const ee=r.memo(({isLoading:r,disabled:n=!1,text:s,loadingText:i,className:a=""})=>e(J,{type:"submit",disabled:n||r,variant:"primary",className:a,"aria-busy":r,"aria-disabled":n||r,children:[e("div",{className:"flex items-center space-x-2",children:[r&&t("div",{className:"inline-block",children:t(X,{show:!0,size:"small"})}),t("span",{className:"submit-button__text",children:r?i:s})]}),r&&t("span",{id:"submit-loading-text",className:"sr-only",children:"Please wait while we process your request"})]})),te=r.memo(({checked:r,onChange:n,errors:s=[],disabled:i=!1,showErrors:a=!1,termsUrl:o="/terms",privacyUrl:l="/privacy"})=>{const u=a&&s.length>0,c="terms-checkbox";return e("div",{className:"terms-checkbox "+(u?"terms-checkbox--error":""),children:[e("div",{className:"terms-checkbox__wrapper",children:[t("input",{id:c,type:"checkbox",checked:r,onChange:e=>n(e.target.checked),disabled:i,className:"terms-checkbox__input "+(u?"terms-checkbox__input--error":""),"aria-invalid":u,"aria-describedby":u?`${c}-errors`:void 0,required:!0}),e("label",{htmlFor:c,className:"terms-checkbox__label",children:[t("span",{className:"terms-checkbox__checkmark","aria-hidden":"true",children:r?"✓":""}),e("span",{className:"terms-checkbox__text",children:["I agree to the"," ",t("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"terms-checkbox__link",children:"Terms of Service"})," ","and"," ",t("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"terms-checkbox__link",children:"Privacy Policy"}),t("span",{className:"terms-checkbox__required","aria-label":"required",children:"*"})]})]})]}),u&&t("div",{id:`${c}-errors`,className:"terms-checkbox__errors",role:"alert",children:s.map((e,r)=>t("div",{className:"terms-checkbox__error",children:e},r))})]})}),re={SET_PLUGINS:"set_plugins",SET_CURRENT_PLUGIN:"set_current_plugin",SET_CURRENT_TAB:"set_current_tab",SET_CURRENT_STATE:"set_current_state",SET_CURRENT_VIEW:"set_current_view",SET_CURRENT_ITEM:"set_current_item",COLLAPSED_TOGGLE:"toggle_collapsed",SET_COLOR_MODE:"set_color_mode",TOGGLE_NOTIFICATIONS:"toggle_notifications",SET_SETTING:"set_setting",SET_JWT:"SET_JWT",SET_USER:"SET_USER",RESET:"reset"},ne=e=>({type:re.SET_PLUGINS,payload:e}),se=e=>({type:re.SET_CURRENT_PLUGIN,payload:e}),ie=e=>({type:re.SET_CURRENT_TAB,payload:e}),ae=e=>({type:re.SET_CURRENT_STATE,payload:e}),oe=e=>({type:re.SET_CURRENT_VIEW,payload:e}),le=e=>({type:re.SET_CURRENT_ITEM,payload:e}),ue=()=>({type:re.RESET}),ce=(e,t)=>(r,n)=>{r(se(e)),r(ie(0));const{session:s}=n(),i=[...s.currentState||[]],a=i.findIndex(t=>t.pluginID===e);-1!==a?i[a]={pluginID:e,tabID:t}:i.push({pluginID:e,tabID:t}),r(ae(i))},de=(e,t)=>(r,n)=>{r(ie(e));const{session:s}=n(),i=s.current.id,a=[...s.currentState||[]],o=a.findIndex(e=>e.pluginID===i);-1!==o?a[o]={pluginID:i,tabID:t}:a.push({pluginID:i,tabID:t}),r(ae(a))},he=(e,t)=>({type:re.SET_SETTING,payload:{key:e,value:t}}),me=()=>({type:re.COLLAPSED_TOGGLE}),fe=()=>({type:re.TOGGLE_NOTIFICATIONS});class ye extends Error{}class ge extends ye{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class pe extends ye{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class be extends ye{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class we extends ye{}class ve extends ye{constructor(e){super(`Invalid unit ${e}`)}}class ke extends ye{}class Ne extends ye{constructor(){super("Zone is an abstract class")}}const Se="numeric",Te="short",xe="long",Oe={year:Se,month:Se,day:Se},Ce={year:Se,month:Te,day:Se},Ee={year:Se,month:Te,day:Se,weekday:Te},De={year:Se,month:xe,day:Se},Ie={year:Se,month:xe,day:Se,weekday:xe},Me={hour:Se,minute:Se},_e={hour:Se,minute:Se,second:Se},$e={hour:Se,minute:Se,second:Se,timeZoneName:Te},Ve={hour:Se,minute:Se,second:Se,timeZoneName:xe},Le={hour:Se,minute:Se,hourCycle:"h23"},Fe={hour:Se,minute:Se,second:Se,hourCycle:"h23"},We={hour:Se,minute:Se,second:Se,hourCycle:"h23",timeZoneName:Te},Ae={hour:Se,minute:Se,second:Se,hourCycle:"h23",timeZoneName:xe},ze={year:Se,month:Se,day:Se,hour:Se,minute:Se},je={year:Se,month:Se,day:Se,hour:Se,minute:Se,second:Se},Ze={year:Se,month:Te,day:Se,hour:Se,minute:Se},Re={year:Se,month:Te,day:Se,hour:Se,minute:Se,second:Se},qe={year:Se,month:Te,day:Se,weekday:Te,hour:Se,minute:Se},Ue={year:Se,month:xe,day:Se,hour:Se,minute:Se,timeZoneName:Te},Pe={year:Se,month:xe,day:Se,hour:Se,minute:Se,second:Se,timeZoneName:Te},Ge={year:Se,month:xe,day:Se,weekday:xe,hour:Se,minute:Se,timeZoneName:xe},He={year:Se,month:xe,day:Se,weekday:xe,hour:Se,minute:Se,second:Se,timeZoneName:xe};class Ye{get type(){throw new Ne}get name(){throw new Ne}get ianaName(){return this.name}get isUniversal(){throw new Ne}offsetName(e,t){throw new Ne}formatOffset(e,t){throw new Ne}offset(e){throw new Ne}equals(e){throw new Ne}get isValid(){throw new Ne}}let Je=null;class Be extends Ye{static get instance(){return null===Je&&(Je=new Be),Je}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return gr(e,t,r)}formatOffset(e,t){return vr(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}const Ke=new Map;const Qe={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};const Xe=new Map;class et extends Ye{static create(e){let t=Xe.get(e);return void 0===t&&Xe.set(e,t=new et(e)),t}static resetCache(){Xe.clear(),Ke.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=et.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return gr(e,t,r,this.name)}formatOffset(e,t){return vr(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const r=function(e){let t=Ke.get(e);return void 0===t&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),Ke.set(e,t)),t}(this.name);let[n,s,i,a,o,l,u]=r.formatToParts?function(e,t){const r=e.formatToParts(t),n=[];for(let e=0;e<r.length;e++){const{type:t,value:s}=r[e],i=Qe[t];"era"===t?n[i]=s:Jt(i)||(n[i]=parseInt(s,10))}return n}(r,t):function(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,s,i,a,o,l,u,c]=n;return[a,s,i,o,l,u,c]}(r,t);"BC"===a&&(n=1-Math.abs(n));let c=+t;const d=c%1e3;return c-=d>=0?d:1e3+d,(hr({year:n,month:s,day:i,hour:24===o?0:o,minute:l,second:u,millisecond:0})-c)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let tt={};const rt=new Map;function nt(e,t={}){const r=JSON.stringify([e,t]);let n=rt.get(r);return void 0===n&&(n=new Intl.DateTimeFormat(e,t),rt.set(r,n)),n}const st=new Map;const it=new Map;let at=null;const ot=new Map;function lt(e){let t=ot.get(e);return void 0===t&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),ot.set(e,t)),t}const ut=new Map;function ct(e,t,r,n){const s=e.listingMode();return"error"===s?null:"en"===s?r(t):n(t)}class dt{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:s,...i}=r;if(!t||Object.keys(i).length>0){const t={useGrouping:!1,...r};r.padTo>0&&(t.minimumIntegerDigits=r.padTo),this.inf=function(e,t={}){const r=JSON.stringify([e,t]);let n=st.get(r);return void 0===n&&(n=new Intl.NumberFormat(e,t),st.set(r,n)),n}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return sr(this.floor?Math.floor(e):lr(e,3),this.padTo)}}class ht{constructor(e,t,r){let n;if(this.opts=r,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,r=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&et.create(r).valid?(n=r,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||n,this.dtf=nt(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class mt{constructor(e,t,r){this.opts={style:"long",...r},!t&&Qt()&&(this.rtf=function(e,t={}){const{base:r,...n}=t,s=JSON.stringify([e,n]);let i=it.get(s);return void 0===i&&(i=new Intl.RelativeTimeFormat(e,t),it.set(s,i)),i}(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,r="always",n=!1){const s={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},i=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&i){const r="days"===e;switch(t){case 1:return r?"tomorrow":`next ${s[e][0]}`;case-1:return r?"yesterday":`last ${s[e][0]}`;case 0:return r?"today":`this ${s[e][0]}`}}const a=Object.is(t,-0)||t<0,o=Math.abs(t),l=1===o,u=s[e],c=n?l?u[1]:u[2]||u[1]:l?s[e][0]:e;return a?`${o} ${c} ago`:`in ${o} ${c}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const ft={firstDay:1,minimalDays:4,weekend:[6,7]};class yt{static fromOpts(e){return yt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,s=!1){const i=e||$t.defaultLocale,a=i||(s?"en-US":at||(at=(new Intl.DateTimeFormat).resolvedOptions().locale,at)),o=t||$t.defaultNumberingSystem,l=r||$t.defaultOutputCalendar,u=rr(n)||$t.defaultWeekSettings;return new yt(a,o,l,u,i)}static resetCache(){at=null,rt.clear(),st.clear(),it.clear(),ot.clear(),ut.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return yt.create(e,t,r,n)}constructor(e,t,r,n,s){const[i,a,o]=function(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const r=e.indexOf("-u-");if(-1===r)return[e];{let t,n;try{t=nt(e).resolvedOptions(),n=e}catch(s){const i=e.substring(0,r);t=nt(i).resolvedOptions(),n=i}const{numberingSystem:s,calendar:i}=t;return[n,s,i]}}(e);this.locale=i,this.numberingSystem=t||a||null,this.outputCalendar=r||o||null,this.weekSettings=n,this.intl=function(e,t,r){return r||t?(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===lt(e.locale).numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?yt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,rr(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return ct(this,e,xr,()=>{const r="ja"===this.intl||this.intl.startsWith("ja-"),n=(t&=!r)?{month:e,day:"numeric"}:{month:e},s=t?"format":"standalone";if(!this.monthsCache[s][e]){const t=r?e=>this.dtFormatter(e,n).format():e=>this.extract(e,n,"month");this.monthsCache[s][e]=function(e){const t=[];for(let r=1;r<=12;r++){const n=Ms.utc(2009,r,1);t.push(e(n))}return t}(t)}return this.monthsCache[s][e]})}weekdays(e,t=!1){return ct(this,e,Dr,()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=function(e){const t=[];for(let r=1;r<=7;r++){const n=Ms.utc(2016,11,13+r);t.push(e(n))}return t}(e=>this.extract(e,r,"weekday"))),this.weekdaysCache[n][e]})}meridiems(){return ct(this,void 0,()=>Ir,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ms.utc(2016,11,13,9),Ms.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return ct(this,e,Vr,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Ms.utc(-40,1,1),Ms.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,r){const n=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===r);return n?n.value:null}numberFormatter(e={}){return new dt(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new ht(e,this.intl,t)}relFormatter(e={}){return new mt(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const r=JSON.stringify([e,t]);let n=tt[r];return n||(n=new Intl.ListFormat(e,t),tt[r]=n),n}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||lt(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Xt()?function(e){let t=ut.get(e);if(!t){const r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,"minimalDays"in t||(t={...ft,...t}),ut.set(e,t)}return t}(this.locale):ft}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let gt=null;class pt extends Ye{static get utcInstance(){return null===gt&&(gt=new pt(0)),gt}static instance(e){return 0===e?pt.utcInstance:new pt(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new pt(pr(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${vr(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${vr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return vr(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class bt extends Ye{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function wt(e,t){if(Jt(e)||null===e)return t;if(e instanceof Ye)return e;if("string"==typeof e){const r=e.toLowerCase();return"default"===r?t:"local"===r||"system"===r?Be.instance:"utc"===r||"gmt"===r?pt.utcInstance:pt.parseSpecifier(r)||et.create(e)}return Bt(e)?pt.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new bt(e)}const vt={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},kt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Nt=vt.hanidec.replace(/[\[|\]]/g,"").split("");const St=new Map;function Tt({numberingSystem:e},t=""){const r=e||"latn";let n=St.get(r);void 0===n&&(n=new Map,St.set(r,n));let s=n.get(t);return void 0===s&&(s=new RegExp(`${vt[r]}${t}`),n.set(t,s)),s}let xt,Ot=()=>Date.now(),Ct="system",Et=null,Dt=null,It=null,Mt=60,_t=null;class $t{static get now(){return Ot}static set now(e){Ot=e}static set defaultZone(e){Ct=e}static get defaultZone(){return wt(Ct,Be.instance)}static get defaultLocale(){return Et}static set defaultLocale(e){Et=e}static get defaultNumberingSystem(){return Dt}static set defaultNumberingSystem(e){Dt=e}static get defaultOutputCalendar(){return It}static set defaultOutputCalendar(e){It=e}static get defaultWeekSettings(){return _t}static set defaultWeekSettings(e){_t=rr(e)}static get twoDigitCutoffYear(){return Mt}static set twoDigitCutoffYear(e){Mt=e%100}static get throwOnInvalid(){return xt}static set throwOnInvalid(e){xt=e}static resetCaches(){yt.resetCache(),et.resetCache(),Ms.resetCache(),St.clear()}}class Vt{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Lt=[0,31,59,90,120,151,181,212,243,273,304,334],Ft=[0,31,60,91,121,152,182,213,244,274,305,335];function Wt(e,t){return new Vt("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function At(e,t,r){const n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const s=n.getUTCDay();return 0===s?7:s}function zt(e,t,r){return r+(ur(e)?Ft:Lt)[t-1]}function jt(e,t){const r=ur(e)?Ft:Lt,n=r.findIndex(e=>e<t);return{month:n+1,day:t-r[n]}}function Zt(e,t){return(e-t+7)%7+1}function Rt(e,t=4,r=1){const{year:n,month:s,day:i}=e,a=zt(n,s,i),o=Zt(At(n,s,i),r);let l,u=Math.floor((a-o+14-t)/7);return u<1?(l=n-1,u=fr(l,t,r)):u>fr(n,t,r)?(l=n+1,u=1):l=n,{weekYear:l,weekNumber:u,weekday:o,...kr(e)}}function qt(e,t=4,r=1){const{weekYear:n,weekNumber:s,weekday:i}=e,a=Zt(At(n,1,t),r),o=cr(n);let l,u=7*s+i-a-7+t;u<1?(l=n-1,u+=cr(l)):u>o?(l=n+1,u-=cr(n)):l=n;const{month:c,day:d}=jt(l,u);return{year:l,month:c,day:d,...kr(e)}}function Ut(e){const{year:t,month:r,day:n}=e;return{year:t,ordinal:zt(t,r,n),...kr(e)}}function Pt(e){const{year:t,ordinal:r}=e,{month:n,day:s}=jt(t,r);return{year:t,month:n,day:s,...kr(e)}}function Gt(e,t){if(!Jt(e.localWeekday)||!Jt(e.localWeekNumber)||!Jt(e.localWeekYear)){if(!Jt(e.weekday)||!Jt(e.weekNumber)||!Jt(e.weekYear))throw new we("Cannot mix locale-based week fields with ISO-based week fields");return Jt(e.localWeekday)||(e.weekday=e.localWeekday),Jt(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),Jt(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function Ht(e){const t=Kt(e.year),r=nr(e.month,1,12),n=nr(e.day,1,dr(e.year,e.month));return t?r?!n&&Wt("day",e.day):Wt("month",e.month):Wt("year",e.year)}function Yt(e){const{hour:t,minute:r,second:n,millisecond:s}=e,i=nr(t,0,23)||24===t&&0===r&&0===n&&0===s,a=nr(r,0,59),o=nr(n,0,59),l=nr(s,0,999);return i?a?o?!l&&Wt("millisecond",s):Wt("second",n):Wt("minute",r):Wt("hour",t)}function Jt(e){return void 0===e}function Bt(e){return"number"==typeof e}function Kt(e){return"number"==typeof e&&e%1==0}function Qt(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function Xt(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function er(e,t,r){if(0!==e.length)return e.reduce((e,n)=>{const s=[t(n),n];return e&&r(e[0],s[0])===e[0]?e:s},null)[1]}function tr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function rr(e){if(null==e)return null;if("object"!=typeof e)throw new ke("Week settings must be an object");if(!nr(e.firstDay,1,7)||!nr(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!nr(e,1,7)))throw new ke("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function nr(e,t,r){return Kt(e)&&e>=t&&e<=r}function sr(e,t=2){let r;return r=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),r}function ir(e){return Jt(e)||null===e||""===e?void 0:parseInt(e,10)}function ar(e){return Jt(e)||null===e||""===e?void 0:parseFloat(e)}function or(e){if(!Jt(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function lr(e,t,r="round"){const n=10**t;switch(r){case"expand":return e>0?Math.ceil(e*n)/n:Math.floor(e*n)/n;case"trunc":return Math.trunc(e*n)/n;case"round":return Math.round(e*n)/n;case"floor":return Math.floor(e*n)/n;case"ceil":return Math.ceil(e*n)/n;default:throw new RangeError(`Value rounding ${r} is out of range`)}}function ur(e){return e%4==0&&(e%100!=0||e%400==0)}function cr(e){return ur(e)?366:365}function dr(e,t){const r=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===r?ur(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function hr(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function mr(e,t,r){return-Zt(At(e,1,t),r)+t-1}function fr(e,t=4,r=1){const n=mr(e,t,r),s=mr(e+1,t,r);return(cr(e)-n+s)/7}function yr(e){return e>99?e:e>$t.twoDigitCutoffYear?1900+e:2e3+e}function gr(e,t,r,n=null){const s=new Date(e),i={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(i.timeZone=n);const a={timeZoneName:t,...i},o=new Intl.DateTimeFormat(r,a).formatToParts(s).find(e=>"timezonename"===e.type.toLowerCase());return o?o.value:null}function pr(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);const n=parseInt(t,10)||0;return 60*r+(r<0||Object.is(r,-0)?-n:n)}function br(e){const t=Number(e);if("boolean"==typeof e||""===e||!Number.isFinite(t))throw new ke(`Invalid unit value ${e}`);return t}function wr(e,t){const r={};for(const n in e)if(tr(e,n)){const s=e[n];if(null==s)continue;r[t(n)]=br(s)}return r}function vr(e,t){const r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),s=e>=0?"+":"-";switch(t){case"short":return`${s}${sr(r,2)}:${sr(n,2)}`;case"narrow":return`${s}${r}${n>0?`:${n}`:""}`;case"techie":return`${s}${sr(r,2)}${sr(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function kr(e){return function(e,t){return t.reduce((t,r)=>(t[r]=e[r],t),{})}(e,["hour","minute","second","millisecond"])}const Nr=["January","February","March","April","May","June","July","August","September","October","November","December"],Sr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Tr=["J","F","M","A","M","J","J","A","S","O","N","D"];function xr(e){switch(e){case"narrow":return[...Tr];case"short":return[...Sr];case"long":return[...Nr];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Or=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Cr=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Er=["M","T","W","T","F","S","S"];function Dr(e){switch(e){case"narrow":return[...Er];case"short":return[...Cr];case"long":return[...Or];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ir=["AM","PM"],Mr=["Before Christ","Anno Domini"],_r=["BC","AD"],$r=["B","A"];function Vr(e){switch(e){case"narrow":return[...$r];case"short":return[..._r];case"long":return[...Mr];default:return null}}function Lr(e,t){let r="";for(const n of e)n.literal?r+=n.val:r+=t(n.val);return r}const Fr={D:Oe,DD:Ce,DDD:De,DDDD:Ie,t:Me,tt:_e,ttt:$e,tttt:Ve,T:Le,TT:Fe,TTT:We,TTTT:Ae,f:ze,ff:Ze,fff:Ue,ffff:Ge,F:je,FF:Re,FFF:Pe,FFFF:He};class Wr{static create(e,t={}){return new Wr(e,t)}static parseFormat(e){let t=null,r="",n=!1;const s=[];for(let i=0;i<e.length;i++){const a=e.charAt(i);"'"===a?((r.length>0||n)&&s.push({literal:n||/^\s+$/.test(r),val:""===r?"'":r}),t=null,r="",n=!n):n||a===t?r+=a:(r.length>0&&s.push({literal:/^\s+$/.test(r),val:r}),r=a,t=a)}return r.length>0&&s.push({literal:n||/^\s+$/.test(r),val:r}),s}static macroTokenToFormatOpts(e){return Fr[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,r=void 0){if(this.opts.forceSimple)return sr(e,t);const n={...this.opts};return t>0&&(n.padTo=t),r&&(n.signDisplay=r),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const r="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,s=(t,r)=>this.loc.extract(e,t,r),i=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",a=()=>r?function(e){return Ir[e.hour<12?0:1]}(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(t,n)=>r?function(e,t){return xr(t)[e.month-1]}(e,t):s(n?{month:t}:{month:t,day:"numeric"},"month"),l=(t,n)=>r?function(e,t){return Dr(t)[e.weekday-1]}(e,t):s(n?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),u=t=>{const r=Wr.macroTokenToFormatOpts(t);return r?this.formatWithSystemDefault(e,r):t},c=t=>r?function(e,t){return Vr(t)[e.year<0?0:1]}(e,t):s({era:t},"era");return Lr(Wr.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return i({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return i({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return i({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return a();case"d":return n?s({day:"numeric"},"day"):this.num(e.day);case"dd":return n?s({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return n?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?s({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return n?s({month:"numeric"},"month"):this.num(e.month);case"MM":return n?s({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return n?s({year:"numeric"},"year"):this.num(e.year);case"yy":return n?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?s({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return u(t)}})}formatDurationFromString(e,t){const r="negativeLargestOnly"===this.opts.signMode?-1:1,n=e=>{switch(e[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},s=Wr.parseFormat(t),i=s.reduce((e,{literal:t,val:r})=>t?e:e.concat(r),[]),a=e.shiftTo(...i.map(n).filter(e=>e));return Lr(s,((e,t)=>s=>{const i=n(s);if(i){const n=t.isNegativeDuration&&i!==t.largestUnit?r:1;let a;return a="negativeLargestOnly"===this.opts.signMode&&i!==t.largestUnit?"never":"all"===this.opts.signMode?"always":"auto",this.num(e.get(i)*n,s.length,a)}return s})(a,{isNegativeDuration:a<0,largestUnit:Object.keys(a.values)[0]}))}}const Ar=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function zr(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function jr(...e){return t=>e.reduce(([e,r,n],s)=>{const[i,a,o]=s(t,n);return[{...e,...i},a||r,o]},[{},null,1]).slice(0,2)}function Zr(e,...t){if(null==e)return[null,null];for(const[r,n]of t){const t=r.exec(e);if(t)return n(t)}return[null,null]}function Rr(...e){return(t,r)=>{const n={};let s;for(s=0;s<e.length;s++)n[e[s]]=ir(t[r+s]);return[n,null,r+s]}}const qr=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Ur=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Pr=RegExp(`${Ur.source}${`(?:${qr.source}?(?:\\[(${Ar.source})\\])?)?`}`),Gr=RegExp(`(?:[Tt]${Pr.source})?`),Hr=Rr("weekYear","weekNumber","weekDay"),Yr=Rr("year","ordinal"),Jr=RegExp(`${Ur.source} ?(?:${qr.source}|(${Ar.source}))?`),Br=RegExp(`(?: ${Jr.source})?`);function Kr(e,t,r){const n=e[t];return Jt(n)?r:ir(n)}function Qr(e,t){return[{hours:Kr(e,t,0),minutes:Kr(e,t+1,0),seconds:Kr(e,t+2,0),milliseconds:or(e[t+3])},null,t+4]}function Xr(e,t){const r=!e[t]&&!e[t+1],n=pr(e[t+1],e[t+2]);return[{},r?null:pt.instance(n),t+3]}function en(e,t){return[{},e[t]?et.create(e[t]):null,t+1]}const tn=RegExp(`^T?${Ur.source}$`),rn=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function nn(e){const[t,r,n,s,i,a,o,l,u]=e,c="-"===t[0],d=l&&"-"===l[0],h=(e,t=!1)=>void 0!==e&&(t||e&&c)?-e:e;return[{years:h(ar(r)),months:h(ar(n)),weeks:h(ar(s)),days:h(ar(i)),hours:h(ar(a)),minutes:h(ar(o)),seconds:h(ar(l),"-0"===l),milliseconds:h(or(u),d)}]}const sn={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function an(e,t,r,n,s,i,a){const o={year:2===t.length?yr(ir(t)):ir(t),month:Sr.indexOf(r)+1,day:ir(n),hour:ir(s),minute:ir(i)};return a&&(o.second=ir(a)),e&&(o.weekday=e.length>3?Or.indexOf(e)+1:Cr.indexOf(e)+1),o}const on=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ln(e){const[,t,r,n,s,i,a,o,l,u,c,d]=e,h=an(t,s,n,r,i,a,o);let m;return m=l?sn[l]:u?0:pr(c,d),[h,new pt(m)]}const un=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,cn=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,dn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function hn(e){const[,t,r,n,s,i,a,o]=e;return[an(t,s,n,r,i,a,o),pt.utcInstance]}function mn(e){const[,t,r,n,s,i,a,o]=e;return[an(t,o,r,n,s,i,a),pt.utcInstance]}const fn=zr(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Gr),yn=zr(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Gr),gn=zr(/(\d{4})-?(\d{3})/,Gr),pn=zr(Pr),bn=jr(function(e,t){return[{year:Kr(e,t),month:Kr(e,t+1,1),day:Kr(e,t+2,1)},null,t+3]},Qr,Xr,en),wn=jr(Hr,Qr,Xr,en),vn=jr(Yr,Qr,Xr,en),kn=jr(Qr,Xr,en);const Nn=jr(Qr);const Sn=zr(/(\d{4})-(\d\d)-(\d\d)/,Br),Tn=zr(Jr),xn=jr(Qr,Xr,en);const On="Invalid Duration",Cn={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},En={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...Cn},Dn=365.2425,In=30.436875,Mn={years:{quarters:4,months:12,weeks:52.1775,days:Dn,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:In,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...Cn},_n=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],$n=_n.slice(0).reverse();function Vn(e,t,r=!1){const n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new An(n)}function Ln(e,t){let r=t.milliseconds??0;for(const n of $n.slice(1))t[n]&&(r+=t[n]*e[n].milliseconds);return r}function Fn(e,t){const r=Ln(e,t)<0?-1:1;_n.reduceRight((n,s)=>{if(Jt(t[s]))return n;if(n){const i=t[n]*r,a=e[s][n],o=Math.floor(i/a);t[s]+=o*r,t[n]-=o*a*r}return s},null),_n.reduce((r,n)=>{if(Jt(t[n]))return r;if(r){const s=t[r]%1;t[r]-=s,t[n]+=s*e[r][n]}return n},null)}function Wn(e){const t={};for(const[r,n]of Object.entries(e))0!==n&&(t[r]=n);return t}class An{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let r=t?Mn:En;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||yt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return An.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new ke("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new An({values:wr(e,An.normalizeUnit),loc:yt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Bt(e))return An.fromMillis(e);if(An.isDuration(e))return e;if("object"==typeof e)return An.fromObject(e);throw new ke(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=function(e){return Zr(e,[rn,nn])}(e);return r?An.fromObject(r,t):An.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=function(e){return Zr(e,[tn,Nn])}(e);return r?An.fromObject(r,t):An.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new ke("need to specify a reason the Duration is invalid");const r=e instanceof Vt?e:new Vt(e,t);if($t.throwOnInvalid)throw new be(r);return new An({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new ve(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?Wr.create(this.loc,r).formatDurationFromString(this,e):On}toHuman(e={}){if(!this.isValid)return On;const t=!1!==e.showZeros,r=_n.map(r=>{const n=this.values[r];return Jt(n)||0===n&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(n)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(r)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=lr(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return Ms.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Ln(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=An.fromDurationLike(e),r={};for(const e of _n)(tr(t.values,e)||tr(this.values,e))&&(r[e]=t.get(e)+this.get(e));return Vn(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=An.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=br(e(this.values[r],r));return Vn(this,{values:t},!0)}get(e){return this[An.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return Vn(this,{values:{...this.values,...wr(e,An.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){return Vn(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:n,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Fn(this.matrix,e),Vn(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return Vn(this,{values:Wn(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>An.normalizeUnit(e));const t={},r={},n=this.toObject();let s;for(const i of _n)if(e.indexOf(i)>=0){s=i;let e=0;for(const t in r)e+=this.matrix[t][i]*r[t],r[t]=0;Bt(n[i])&&(e+=n[i]);const a=Math.trunc(e);t[i]=a,r[i]=(1e3*e-1e3*a)/1e3}else Bt(n[i])&&(r[i]=n[i]);for(const e in r)0!==r[e]&&(t[s]+=e===s?r[e]:r[e]/this.matrix[s][e]);return Fn(this.matrix,t),Vn(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return Vn(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;return Vn(this,{values:Wn(this.values)},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const r of _n)if(!t(this.values[r],e.values[r]))return!1;return!0}}const zn="Invalid Interval";class jn{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new ke("need to specify a reason the Interval is invalid");const r=e instanceof Vt?e:new Vt(e,t);if($t.throwOnInvalid)throw new pe(r);return new jn({invalid:r})}static fromDateTimes(e,t){const r=_s(e),n=_s(t),s=function(e,t){return e&&e.isValid?t&&t.isValid?t<e?jn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:jn.invalid("missing or invalid end"):jn.invalid("missing or invalid start")}(r,n);return null==s?new jn({start:r,end:n}):s}static after(e,t){const r=An.fromDurationLike(t),n=_s(e);return jn.fromDateTimes(n,n.plus(r))}static before(e,t){const r=An.fromDurationLike(t),n=_s(e);return jn.fromDateTimes(n.minus(r),n)}static fromISO(e,t){const[r,n]=(e||"").split("/",2);if(r&&n){let e,s,i,a;try{e=Ms.fromISO(r,t),s=e.isValid}catch(n){s=!1}try{i=Ms.fromISO(n,t),a=i.isValid}catch(n){a=!1}if(s&&a)return jn.fromDateTimes(e,i);if(s){const r=An.fromISO(n,t);if(r.isValid)return jn.after(e,r)}else if(a){const e=An.fromISO(r,t);if(e.isValid)return jn.before(i,e)}}return jn.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const r=this.start.startOf(e,t);let n;return n=t?.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end,n=n.startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?jn.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(_s).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[];let{s:n}=this,s=0;for(;n<this.e;){const e=t[s]||this.e,i=+e>+this.e?this.e:e;r.push(jn.fromDateTimes(n,i)),n=i,s+=1}return r}splitBy(e){const t=An.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let r,{s:n}=this,s=1;const i=[];for(;n<this.e;){const e=this.start.plus(t.mapUnits(e=>e*s));r=+e>+this.e?this.e:e,i.push(jn.fromDateTimes(n,r)),n=r,s+=1}return i}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e===+e.s}abutsEnd(e){return!!this.isValid&&+e.e===+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:jn.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return jn.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],r)=>t?t.overlaps(r)||t.abutsStart(r)?[e,t.union(r)]:[e.concat([t]),r]:[e,r],[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const n=[],s=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),i=Array.prototype.concat(...s).sort((e,t)=>e.time-t.time);for(const e of i)r+="s"===e.type?1:-1,1===r?t=e.time:(t&&+t!==+e.time&&n.push(jn.fromDateTimes(t,e.time)),t=null);return jn.merge(n)}difference(...e){return jn.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:zn}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=Oe,t={}){return this.isValid?Wr.create(this.s.loc.clone(t),e).formatInterval(this):zn}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:zn}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:zn}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:zn}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:zn}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):An.invalid(this.invalidReason)}mapEndpoints(e){return jn.fromDateTimes(e(this.s),e(this.e))}}class Zn{static hasDST(e=$t.defaultZone){const t=Ms.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return et.isValidZone(e)}static normalizeZone(e){return wt(e,$t.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||yt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||yt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||yt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||yt.create(t,r,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:s="gregory"}={}){return(n||yt.create(t,r,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||yt.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||yt.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return yt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return yt.create(t,null,"gregory").eras(e)}static features(){return{relative:Qt(),localeWeek:Xt()}}}function Rn(e,t){const r=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),n=r(t)-r(e);return Math.floor(An.fromMillis(n).as("days"))}function qn(e,t,r,n){let[s,i,a,o]=function(e,t,r){const n=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const r=Rn(e,t);return(r-r%7)/7}],["days",Rn]],s={},i=e;let a,o;for(const[l,u]of n)r.indexOf(l)>=0&&(a=l,s[l]=u(e,t),o=i.plus(s),o>t?(s[l]--,(e=i.plus(s))>t&&(o=e,s[l]--,e=i.plus(s))):e=o);return[e,s,o,a]}(e,t,r);const l=t-s,u=r.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===u.length&&(a<t&&(a=s.plus({[o]:1})),a!==s&&(i[o]=(i[o]||0)+l/(a-s)));const c=An.fromObject(i,n);return u.length>0?An.fromMillis(l,n).shiftTo(...u).plus(c):c}function Un(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);if(-1!==e[r].search(vt.hanidec))t+=Nt.indexOf(e[r]);else for(const e in kt){const[r,s]=kt[e];n>=r&&n<=s&&(t+=n-r)}}return parseInt(t,10)}return t}(e))}}const Pn=`[ ${String.fromCharCode(160)}]`,Gn=new RegExp(Pn,"g");function Hn(e){return e.replace(/\./g,"\\.?").replace(Gn,Pn)}function Yn(e){return e.replace(/\./g,"").replace(Gn," ").toLowerCase()}function Jn(e,t){return null===e?null:{regex:RegExp(e.map(Hn).join("|")),deser:([r])=>e.findIndex(e=>Yn(r)===Yn(e))+t}}function Bn(e,t){return{regex:e,deser:([,e,t])=>pr(e,t),groups:t}}function Kn(e){return{regex:e,deser:([e])=>e}}const Qn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let Xn=null;function es(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const r=ns(Wr.macroTokenToFormatOpts(e.val),t);return null==r||r.includes(void 0)?e:r}(e,t)))}class ts{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=es(Wr.parseFormat(t),e),this.units=this.tokens.map(t=>function(e,t){const r=Tt(t),n=Tt(t,"{2}"),s=Tt(t,"{3}"),i=Tt(t,"{4}"),a=Tt(t,"{6}"),o=Tt(t,"{1,2}"),l=Tt(t,"{1,3}"),u=Tt(t,"{1,6}"),c=Tt(t,"{1,9}"),d=Tt(t,"{2,4}"),h=Tt(t,"{4,6}"),m=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},f=(f=>{if(e.literal)return m(f);switch(f.val){case"G":return Jn(t.eras("short"),0);case"GG":return Jn(t.eras("long"),0);case"y":return Un(u);case"yy":case"kk":return Un(d,yr);case"yyyy":case"kkkk":return Un(i);case"yyyyy":return Un(h);case"yyyyyy":return Un(a);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Un(o);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Un(n);case"MMM":return Jn(t.months("short",!0),1);case"MMMM":return Jn(t.months("long",!0),1);case"LLL":return Jn(t.months("short",!1),1);case"LLLL":return Jn(t.months("long",!1),1);case"o":case"S":return Un(l);case"ooo":case"SSS":return Un(s);case"u":return Kn(c);case"uu":return Kn(o);case"uuu":case"E":case"c":return Un(r);case"a":return Jn(t.meridiems(),0);case"EEE":return Jn(t.weekdays("short",!1),1);case"EEEE":return Jn(t.weekdays("long",!1),1);case"ccc":return Jn(t.weekdays("short",!0),1);case"cccc":return Jn(t.weekdays("long",!0),1);case"Z":case"ZZ":return Bn(new RegExp(`([+-]${o.source})(?::(${n.source}))?`),2);case"ZZZ":return Bn(new RegExp(`([+-]${o.source})(${n.source})?`),2);case"z":return Kn(/[a-z_+-/]{1,256}?/i);case" ":return Kn(/[^\S\n\r]/);default:return m(f)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return f.token=e,f}(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){const[e,t]=[`^${(r=this.units).map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"")}$`,r];this.regex=RegExp(e,"i"),this.handlers=t}var r}explainFromTokens(e){if(this.isValid){const[t,r]=function(e,t,r){const n=e.match(t);if(n){const e={};let t=1;for(const s in r)if(tr(r,s)){const i=r[s],a=i.groups?i.groups+1:1;!i.literal&&i.token&&(e[i.token.val[0]]=i.deser(n.slice(t,t+a))),t+=a}return[n,e]}return[n,{}]}(e,this.regex,this.handlers),[n,s,i]=r?function(e){let t,r=null;return Jt(e.z)||(r=et.create(e.z)),Jt(e.Z)||(r||(r=new pt(e.Z)),t=e.Z),Jt(e.q)||(e.M=3*(e.q-1)+1),Jt(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),Jt(e.u)||(e.S=or(e.u)),[Object.keys(e).reduce((t,r)=>{const n=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(r);return n&&(t[n]=e[r]),t},{}),r,t]}(r):[null,null,void 0];if(tr(r,"a")&&tr(r,"H"))throw new we("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:r,result:n,zone:s,specificOffset:i}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function rs(e,t,r){return new ts(e,r).explainFromTokens(t)}function ns(e,t){if(!e)return null;const r=Wr.create(t,e).dtFormatter((Xn||(Xn=Ms.fromMillis(1555555555555)),Xn)),n=r.formatToParts(),s=r.resolvedOptions();return n.map(t=>function(e,t,r){const{type:n,value:s}=e;if("literal"===n){const e=/^\s+$/.test(s);return{literal:!e,val:e?" ":s}}const i=t[n];let a=n;"hour"===n&&(a=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":r.hour12?"hour12":"hour24");let o=Qn[a];if("object"==typeof o&&(o=o[i]),o)return{literal:!1,val:o}}(t,e,s))}const ss="Invalid DateTime",is=864e13;function as(e){return new Vt("unsupported zone",`the zone "${e.name}" is not supported`)}function os(e){return null===e.weekData&&(e.weekData=Rt(e.c)),e.weekData}function ls(e){return null===e.localWeekData&&(e.localWeekData=Rt(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function us(e,t){const r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Ms({...r,...t,old:r})}function cs(e,t,r){let n=e-60*t*1e3;const s=r.offset(n);if(t===s)return[n,t];n-=60*(s-t)*1e3;const i=r.offset(n);return s===i?[n,s]:[e-60*Math.min(s,i)*1e3,Math.max(s,i)]}function ds(e,t){const r=new Date(e+=60*t*1e3);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function hs(e,t,r){return cs(hr(e),t,r)}function ms(e,t){const r=e.o,n=e.c.year+Math.trunc(t.years),s=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),i={...e.c,year:n,month:s,day:Math.min(e.c.day,dr(n,s))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},a=An.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),o=hr(i);let[l,u]=cs(o,r,e.zone);return 0!==a&&(l+=a,u=e.zone.offset(l)),{ts:l,o:u}}function fs(e,t,r,n,s,i){const{setZone:a,zone:o}=r;if(e&&0!==Object.keys(e).length||t){const n=t||o,s=Ms.fromObject(e,{...r,zone:n,specificOffset:i});return a?s:s.setZone(o)}return Ms.invalid(new Vt("unparsable",`the input "${s}" can't be parsed as ${n}`))}function ys(e,t,r=!0){return e.isValid?Wr.create(yt.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function gs(e,t,r){const n=e.c.year>9999||e.c.year<0;let s="";if(n&&e.c.year>=0&&(s+="+"),s+=sr(e.c.year,n?6:4),"year"===r)return s;if(t){if(s+="-",s+=sr(e.c.month),"month"===r)return s;s+="-"}else if(s+=sr(e.c.month),"month"===r)return s;return s+=sr(e.c.day),s}function ps(e,t,r,n,s,i,a){let o=!r||0!==e.c.millisecond||0!==e.c.second,l="";switch(a){case"day":case"month":case"year":break;default:if(l+=sr(e.c.hour),"hour"===a)break;if(t){if(l+=":",l+=sr(e.c.minute),"minute"===a)break;o&&(l+=":",l+=sr(e.c.second))}else{if(l+=sr(e.c.minute),"minute"===a)break;o&&(l+=sr(e.c.second))}if("second"===a)break;!o||n&&0===e.c.millisecond||(l+=".",l+=sr(e.c.millisecond,3))}return s&&(e.isOffsetFixed&&0===e.offset&&!i?l+="Z":e.o<0?(l+="-",l+=sr(Math.trunc(-e.o/60)),l+=":",l+=sr(Math.trunc(-e.o%60))):(l+="+",l+=sr(Math.trunc(e.o/60)),l+=":",l+=sr(Math.trunc(e.o%60)))),i&&(l+="["+e.zone.ianaName+"]"),l}const bs={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},ws={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},vs={ordinal:1,hour:0,minute:0,second:0,millisecond:0},ks=["year","month","day","hour","minute","second","millisecond"],Ns=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Ss=["year","ordinal","hour","minute","second","millisecond"];function Ts(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new ve(e);return t}function xs(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Ts(e)}}function Os(e,t){const r=wt(t.zone,$t.defaultZone);if(!r.isValid)return Ms.invalid(as(r));const n=yt.fromObject(t);let s,i;if(Jt(e.year))s=$t.now();else{for(const t of ks)Jt(e[t])&&(e[t]=bs[t]);const t=Ht(e)||Yt(e);if(t)return Ms.invalid(t);const n=function(e){if(void 0===Ds&&(Ds=$t.now()),"iana"!==e.type)return e.offset(Ds);const t=e.name;let r=Is.get(t);return void 0===r&&(r=e.offset(Ds),Is.set(t,r)),r}(r);[s,i]=hs(e,n,r)}return new Ms({ts:s,zone:r,loc:n,o:i})}function Cs(e,t,r){const n=!!Jt(r.round)||r.round,s=Jt(r.rounding)?"trunc":r.rounding,i=(e,i)=>{e=lr(e,n||r.calendary?0:2,r.calendary?"round":s);return t.loc.clone(r).relFormatter(r).format(e,i)},a=n=>r.calendary?t.hasSame(e,n)?0:t.startOf(n).diff(e.startOf(n),n).get(n):t.diff(e,n).get(n);if(r.unit)return i(a(r.unit),r.unit);for(const e of r.units){const t=a(e);if(Math.abs(t)>=1)return i(t,e)}return i(e>t?-0:0,r.units[r.units.length-1])}function Es(e){let t,r={};return e.length>0&&"object"==typeof e[e.length-1]?(r=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[r,t]}let Ds;const Is=new Map;class Ms{constructor(e){const t=e.zone||$t.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new Vt("invalid input"):null)||(t.isValid?null:as(t));this.ts=Jt(e.ts)?$t.now():e.ts;let n=null,s=null;if(!r){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[n,s]=[e.old.c,e.old.o];else{const i=Bt(e.o)&&!e.old?e.o:t.offset(this.ts);n=ds(this.ts,i),r=Number.isNaN(n.year)?new Vt("invalid input"):null,n=r?null:n,s=r?null:i}}this._zone=t,this.loc=e.loc||yt.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=n,this.o=s,this.isLuxonDateTime=!0}static now(){return new Ms({})}static local(){const[e,t]=Es(arguments),[r,n,s,i,a,o,l]=t;return Os({year:r,month:n,day:s,hour:i,minute:a,second:o,millisecond:l},e)}static utc(){const[e,t]=Es(arguments),[r,n,s,i,a,o,l]=t;return e.zone=pt.utcInstance,Os({year:r,month:n,day:s,hour:i,minute:a,second:o,millisecond:l},e)}static fromJSDate(e,t={}){const r=(n=e,"[object Date]"===Object.prototype.toString.call(n)?e.valueOf():NaN);var n;if(Number.isNaN(r))return Ms.invalid("invalid input");const s=wt(t.zone,$t.defaultZone);return s.isValid?new Ms({ts:r,zone:s,loc:yt.fromObject(t)}):Ms.invalid(as(s))}static fromMillis(e,t={}){if(Bt(e))return e<-is||e>is?Ms.invalid("Timestamp out of range"):new Ms({ts:e,zone:wt(t.zone,$t.defaultZone),loc:yt.fromObject(t)});throw new ke(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Bt(e))return new Ms({ts:1e3*e,zone:wt(t.zone,$t.defaultZone),loc:yt.fromObject(t)});throw new ke("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=wt(t.zone,$t.defaultZone);if(!r.isValid)return Ms.invalid(as(r));const n=yt.fromObject(t),s=wr(e,xs),{minDaysInFirstWeek:i,startOfWeek:a}=Gt(s,n),o=$t.now(),l=Jt(t.specificOffset)?r.offset(o):t.specificOffset,u=!Jt(s.ordinal),c=!Jt(s.year),d=!Jt(s.month)||!Jt(s.day),h=c||d,m=s.weekYear||s.weekNumber;if((h||u)&&m)throw new we("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&u)throw new we("Can't mix ordinal dates with month/day");const f=m||s.weekday&&!h;let y,g,p=ds(o,l);f?(y=Ns,g=ws,p=Rt(p,i,a)):u?(y=Ss,g=vs,p=Ut(p)):(y=ks,g=bs);let b=!1;for(const e of y){Jt(s[e])?s[e]=b?g[e]:p[e]:b=!0}const w=f?function(e,t=4,r=1){const n=Kt(e.weekYear),s=nr(e.weekNumber,1,fr(e.weekYear,t,r)),i=nr(e.weekday,1,7);return n?s?!i&&Wt("weekday",e.weekday):Wt("week",e.weekNumber):Wt("weekYear",e.weekYear)}(s,i,a):u?function(e){const t=Kt(e.year),r=nr(e.ordinal,1,cr(e.year));return t?!r&&Wt("ordinal",e.ordinal):Wt("year",e.year)}(s):Ht(s),v=w||Yt(s);if(v)return Ms.invalid(v);const k=f?qt(s,i,a):u?Pt(s):s,[N,S]=hs(k,l,r),T=new Ms({ts:N,zone:r,o:S,loc:n});return s.weekday&&h&&e.weekday!==T.weekday?Ms.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${T.toISO()}`):T.isValid?T:Ms.invalid(T.invalid)}static fromISO(e,t={}){const[r,n]=function(e){return Zr(e,[fn,bn],[yn,wn],[gn,vn],[pn,kn])}(e);return fs(r,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,n]=function(e){return Zr(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[on,ln])}(e);return fs(r,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,n]=function(e){return Zr(e,[un,hn],[cn,hn],[dn,mn])}(e);return fs(r,n,t,"HTTP",t)}static fromFormat(e,t,r={}){if(Jt(e)||Jt(t))throw new ke("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:s=null}=r,i=yt.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0}),[a,o,l,u]=function(e,t,r){const{result:n,zone:s,specificOffset:i,invalidReason:a}=rs(e,t,r);return[n,s,i,a]}(i,e,t);return u?Ms.invalid(u):fs(a,o,r,`format ${t}`,e,l)}static fromString(e,t,r={}){return Ms.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,n]=function(e){return Zr(e,[Sn,bn],[Tn,xn])}(e);return fs(r,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new ke("need to specify a reason the DateTime is invalid");const r=e instanceof Vt?e:new Vt(e,t);if($t.throwOnInvalid)throw new ge(r);return new Ms({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const r=ns(e,yt.fromObject(t));return r?r.map(e=>e?e.val:null).join(""):null}static expandFormat(e,t={}){return es(Wr.parseFormat(e),yt.fromObject(t)).map(e=>e.val).join("")}static resetCache(){Ds=void 0,Is.clear()}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?os(this).weekYear:NaN}get weekNumber(){return this.isValid?os(this).weekNumber:NaN}get weekday(){return this.isValid?os(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?ls(this).weekday:NaN}get localWeekNumber(){return this.isValid?ls(this).weekNumber:NaN}get localWeekYear(){return this.isValid?ls(this).weekYear:NaN}get ordinal(){return this.isValid?Ut(this.c).ordinal:NaN}get monthShort(){return this.isValid?Zn.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Zn.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Zn.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Zn.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,r=hr(this.c),n=this.zone.offset(r-e),s=this.zone.offset(r+e),i=this.zone.offset(r-n*t),a=this.zone.offset(r-s*t);if(i===a)return[this];const o=r-i*t,l=r-a*t,u=ds(o,i),c=ds(l,a);return u.hour===c.hour&&u.minute===c.minute&&u.second===c.second&&u.millisecond===c.millisecond?[us(this,{ts:o}),us(this,{ts:l})]:[this]}get isInLeapYear(){return ur(this.year)}get daysInMonth(){return dr(this.year,this.month)}get daysInYear(){return this.isValid?cr(this.year):NaN}get weeksInWeekYear(){return this.isValid?fr(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?fr(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:n}=Wr.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:n}}toUTC(e=0,t={}){return this.setZone(pt.instance(e),t)}toLocal(){return this.setZone($t.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if((e=wt(e,$t.defaultZone)).equals(this.zone))return this;if(e.isValid){let n=this.ts;if(t||r){const t=e.offset(this.ts),r=this.toObject();[n]=hs(r,t,e)}return us(this,{ts:n,zone:e})}return Ms.invalid(as(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){return us(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=wr(e,xs),{minDaysInFirstWeek:r,startOfWeek:n}=Gt(t,this.loc),s=!Jt(t.weekYear)||!Jt(t.weekNumber)||!Jt(t.weekday),i=!Jt(t.ordinal),a=!Jt(t.year),o=!Jt(t.month)||!Jt(t.day),l=a||o,u=t.weekYear||t.weekNumber;if((l||i)&&u)throw new we("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&i)throw new we("Can't mix ordinal dates with month/day");let c;s?c=qt({...Rt(this.c,r,n),...t},r,n):Jt(t.ordinal)?(c={...this.toObject(),...t},Jt(t.day)&&(c.day=Math.min(dr(c.year,c.month),c.day))):c=Pt({...Ut(this.c),...t});const[d,h]=hs(c,this.o,this.zone);return us(this,{ts:d,o:h})}plus(e){if(!this.isValid)return this;return us(this,ms(this,An.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return us(this,ms(this,An.fromDurationLike(e).negate()))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const r={},n=An.normalizeUnit(e);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0}if("weeks"===n)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(r.weekNumber=this.weekNumber-1),r.weekday=e}else r.weekday=1;if("quarters"===n){const e=Math.ceil(this.month/3);r.month=3*(e-1)+1}return this.set(r)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?Wr.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ss}toLocaleString(e=Oe,t={}){return this.isValid?Wr.create(this.loc.clone(t),e).formatDateTime(this):ss}toLocaleParts(e={}){return this.isValid?Wr.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:r=!1,includeOffset:n=!0,extendedZone:s=!1,precision:i="milliseconds"}={}){if(!this.isValid)return null;const a="extended"===e;let o=gs(this,a,i=Ts(i));return ks.indexOf(i)>=3&&(o+="T"),o+=ps(this,a,t,r,n,s,i),o}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?gs(this,"extended"===e,Ts(t)):null}toISOWeekDate(){return ys(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:r=!0,includePrefix:n=!1,extendedZone:s=!1,format:i="extended",precision:a="milliseconds"}={}){if(!this.isValid)return null;return a=Ts(a),(n&&ks.indexOf(a)>=3?"T":"")+ps(this,"extended"===i,t,e,r,s,a)}toRFC2822(){return ys(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return ys(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?gs(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:r=!0}={}){let n="HH:mm:ss.SSS";return(t||e)&&(r&&(n+=" "),t?n+="z":e&&(n+="ZZ")),ys(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ss}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",r={}){if(!this.isValid||!e.isValid)return An.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...r},s=(o=t,Array.isArray(o)?o:[o]).map(An.normalizeUnit),i=e.valueOf()>this.valueOf(),a=qn(i?this:e,i?e:this,s,n);var o;return i?a.negate():a}diffNow(e="milliseconds",t={}){return this.diff(Ms.now(),e,t)}until(e){return this.isValid?jn.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;const n=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,r)<=n&&n<=s.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Ms.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0;let n=["years","months","days","hours","minutes","seconds"],s=e.unit;return Array.isArray(e.unit)&&(n=e.unit,s=void 0),Cs(t,this.plus(r),{...e,numeric:"always",units:n,unit:s})}toRelativeCalendar(e={}){return this.isValid?Cs(e.base||Ms.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Ms.isDateTime))throw new ke("min requires all arguments be DateTimes");return er(e,e=>e.valueOf(),Math.min)}static max(...e){if(!e.every(Ms.isDateTime))throw new ke("max requires all arguments be DateTimes");return er(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:n=null,numberingSystem:s=null}=r;return rs(yt.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,r={}){return Ms.fromFormatExplain(e,t,r)}static buildFormatParser(e,t={}){const{locale:r=null,numberingSystem:n=null}=t,s=yt.fromOpts({locale:r,numberingSystem:n,defaultToEN:!0});return new ts(s,e)}static fromFormatParser(e,t,r={}){if(Jt(e)||Jt(t))throw new ke("fromFormatParser requires an input string and a format parser");const{locale:n=null,numberingSystem:s=null}=r,i=yt.fromOpts({locale:n,numberingSystem:s,defaultToEN:!0});if(!i.equals(t.locale))throw new ke(`fromFormatParser called with a locale of ${i}, but the format parser was created for ${t.locale}`);const{result:a,zone:o,specificOffset:l,invalidReason:u}=t.explainFromTokens(e);return u?Ms.invalid(u):fs(a,o,r,`format ${t.format}`,e,l)}static get DATE_SHORT(){return Oe}static get DATE_MED(){return Ce}static get DATE_MED_WITH_WEEKDAY(){return Ee}static get DATE_FULL(){return De}static get DATE_HUGE(){return Ie}static get TIME_SIMPLE(){return Me}static get TIME_WITH_SECONDS(){return _e}static get TIME_WITH_SHORT_OFFSET(){return $e}static get TIME_WITH_LONG_OFFSET(){return Ve}static get TIME_24_SIMPLE(){return Le}static get TIME_24_WITH_SECONDS(){return Fe}static get TIME_24_WITH_SHORT_OFFSET(){return We}static get TIME_24_WITH_LONG_OFFSET(){return Ae}static get DATETIME_SHORT(){return ze}static get DATETIME_SHORT_WITH_SECONDS(){return je}static get DATETIME_MED(){return Ze}static get DATETIME_MED_WITH_SECONDS(){return Re}static get DATETIME_MED_WITH_WEEKDAY(){return qe}static get DATETIME_FULL(){return Ue}static get DATETIME_FULL_WITH_SECONDS(){return Pe}static get DATETIME_HUGE(){return Ge}static get DATETIME_HUGE_WITH_SECONDS(){return He}}function _s(e){if(Ms.isDateTime(e))return e;if(e&&e.valueOf&&Bt(e.valueOf()))return Ms.fromJSDate(e);if(e&&"object"==typeof e)return Ms.fromObject(e);throw new ke(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const $s="join-time",Vs="time-spent",Ls=(e,t)=>({type:"PAGE_VIEW",data:{pageId:e,userId:t}}),Fs=Ls,Ws=new E([(e,t)=>{"undefined"!=typeof window&&void 0!==window.dataLayer&&window.dataLayer.push(e)}]);function As({children:e}){return l(()=>{const e=Ms.local();return localStorage.setItem($s,JSON.stringify(e.toSeconds())),()=>{const e=Ms.local(),t=localStorage.getItem(Vs),r=localStorage.getItem($s);if(null===r)return;const n=parseFloat(r);if(Number.isNaN(n))return;const s=(null!==t?parseFloat(t):0)+(e.toSeconds()-n)/60;localStorage.setItem(Vs,JSON.stringify(s))}},[]),t(D,{tracker:Ws,children:e})}const zs=({children:e,onPress:r,disabled:n=!1,type:s="button",className:i="",variant:a="outline","data-testid":o})=>t(g,{type:s,onPress:r||(()=>{}),disabled:n,buttonClass:Y(a,n,`px-5 ${i}`),"data-testid":o,children:e}),js=({children:e,onPress:r,disabled:n=!1,type:s="submit",className:i="font-idd-primary-font-medium text-idd-primary-font-size",variant:a="primary","data-testid":o})=>t(g,{type:s,onPress:r||(()=>{}),disabled:n,buttonClass:Y(a,n,`px-5 text-idd-primary-font-size ${i}`),"data-testid":o,children:e});class Zs extends u{constructor(){super(...arguments),this.state={hasError:!1},this.handle_retry=()=>{var e,t;null===(t=(e=this.props).onRetry)||void 0===t||t.call(e),this.setState({hasError:!1,error:void 0})}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidUpdate(e){e.children!==this.props.children&&this.state.hasError&&this.setState({hasError:!1,error:void 0})}componentDidCatch(e,t){var r,n;console.error("ErrorBoundary caught an error:",e,t),null===(n=(r=this.props).onError)||void 0===n||n.call(r,e,t)}render(){var e;if(this.state.hasError&&this.state.error){const e=this.props.fallback;return"function"==typeof e?e(this.state.error):null!=e?e:this.render_default_fallback()}return null!==(e=this.props.children)&&void 0!==e?e:null}render_default_fallback(){return t("div",{className:"flex items-center justify-center h-full w-full p-4",role:"alert","aria-live":"assertive","aria-describedby":"error-boundary-message",children:e("div",{className:"text-center",id:"error-boundary-message",children:[t("h2",{className:"text-xl font-semibold mb-2",children:"Something went wrong"}),t("p",{className:"text-gray-600 mb-4",children:"An error occurred while loading this component."}),t(g,{type:"button",onPress:this.handle_retry,buttonClass:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600","aria-label":"Try again",children:"Try again"})]})})}}function Rs(e){return/^(?:\w+:)?\/\/([^\s.]+\.\S{2}|localhost[:?\d]*)\S*$/.test(e)}Zs.displayName="ErrorBoundary";const qs=n(({id:r,idsArray:n,onDelete:i=()=>{},onBlur:a=()=>{},link:u,className:c=""})=>{var d,h,m,p;const b=q(),w=f(b.style),[v,k]=o(w.colors["idd-primary-black"]),[N,T]=o({id:"",text:"",url:""});l(()=>{u&&(u.path&&u.path.length>0?T({id:u.id,text:u.text,url:u.path}):T(u))},[u]);return e("div",{className:`flex justify-between items-center ${c}`,onBlur:e=>{e.stopPropagation(),a(Object.assign(Object.assign({},N),{id:r}))},children:[t(y,{id:`link-${r}`,componentClass:"w-[45%]",type:"text",label:"Link Text",labelClass:"text-capitalize",showLabel:Boolean(null===(d=N.text)||void 0===d?void 0:d.length),placeholder:"Link Text",value:null!==(h=N.text)&&void 0!==h?h:"",inputClass:"ps-3",onChange:e=>{T(t=>Object.assign(Object.assign({},t),{text:e.target.value}))}}),t(y,{id:`url-${r}`,componentClass:"w-[45%]",type:"url",label:"URL",showLabel:Boolean(null===(m=N.url)||void 0===m?void 0:m.length),placeholder:"URL",value:null!==(p=N.url)&&void 0!==p?p:"",inputClass:"ps-3",onChange:e=>{T(t=>Object.assign(Object.assign({},t),{url:e.target.value}))}}),t(g,{id:`removeLink-${r}`,onPress:()=>{const e=n?n.filter(e=>e!==r):[];i(e)},onMouseEnter:()=>k(w.colors["idd-red"]),onFocus:()=>k(w.colors["idd-red"]),onMouseLeave:()=>k(w.colors["idd-primary-black"]),onBlur:()=>k(w.colors["idd-primary-black"]),isSecondary:!0,buttonClass:"flex items-center justify-center border-0 rounded-sm w-[1.5625rem] h-[1.5625rem] p-0",children:e(s,{children:[t("span",{className:"sr-only",children:"remove link"}),t(S,{wrapperClass:"flex justify-center items-center",color:v})]})})]})}),Us={signup:"bg-signup-theme",default:"bg-signup-theme"},Ps=({children:e,className:r,variant:n="signup"})=>{const s=[`${Us[n]} bg-cover bg-center bg-no-repeat`,null!=r?r:"flex items-center justify-center min-h-screen w-full p-5"].filter(Boolean).join(" ");return t(Zs,{children:t("div",{className:s,children:e})})};Ps.displayName="Layout";const Gs=({label:e,id:r,onChange:n,value:s,placeholder:i,type:a="text",readOnly:o=!1,disabled:l,required:u,onBlur:c,onFocus:d,error:h="",errorColor:m="",errorClass:g="font-idd-primary-font text-idd-primary-font-size !mb-0",isErrorOnlyColor:p=!0,inputWrapperClass:b="w-full h-[3.125rem] rounded-[0.3125rem] border border-idd-grey",inputClass:w="px-4"})=>{const v=q(),k=f(v.style).colors,N=o?"idd-grey":"idd-black",S=null==s||"string"==typeof s&&0===s.length?"idd-grey":"idd-black",T=`${o?"pointer-events-none":""} ${w}`,x=Object.assign(Object.assign({id:r,label:e,value:s,placeholder:i,type:a,readOnly:o,disabled:l,onBlur:c,onFocus:d,activeColor:k[N],inactiveColor:k[S],activeLabelColor:k[N],inactiveLabelColor:k[S],activeTextColor:k[N],inactiveTextColor:k[S],inputWrapperClass:b,inputClass:T,errors:h,errorColor:p?k[S]:m,errorClass:g,errorStyle:p?{color:k["idd-active-color"]}:{}},null!=n&&{onChange:n}),void 0!==u&&{required:u});return t(y,Object.assign({},x))};Gs.displayName="TextInput";const Hs={small:"max-w-md",medium:"max-w-lg",large:"max-w-2xl",full:"max-w-full mx-4"},Ys=e=>{var{children:r,isOpen:n,onClose:s,title:i="Modal",titleClass:a="sr-only",bodyClass:o="p-6",headerClass:l="flex items-center justify-between p-6 border-b border-gray-200",showCloseButton:u=!0,showSubmitButton:c=!1,submitText:d="Submit",size:h="medium",className:m="",onSubmit:f=()=>{}}=e,y=K(e,["children","isOpen","onClose","title","titleClass","bodyClass","headerClass","showCloseButton","showSubmitButton","submitText","size","className","onSubmit"]);if(!n)return null;const g=`bg-white rounded-lg shadow-xl ${Hs[h]} w-full ${m}`.trim(),p=Object.assign(Object.assign({},y),{title:i,titleClass:a,onCancel:s,xCancel:u,showCancelButton:!1,submitText:d,submitClass:c?"":"hidden",bodyClass:o,backdrop:!0,backdropCancel:!0,contentClass:g,headerClass:l,onSubmit:f});return t(b,Object.assign({},p,{children:r}))};Ys.displayName="Modal";const Js=r=>{var{children:n,title:s,subtitle:i,subtitleClass:a="text-sm text-gray-600",className:o="border-gray-200 rounded-lg",headerSize:l=w.H3,padding:u="medium",shadow:c="medium",border:d=!0,"data-testid":h}=r,m=K(r,["children","title","subtitle","subtitleClass","className","headerSize","padding","shadow","border","data-testid"]);const f=["bg-white",{none:"",small:"shadow-sm",medium:"shadow-md",large:"shadow-lg"}[c],d?"border":"",o].filter(Boolean).join(" "),y={none:"",small:"p-3",medium:"p-6",large:"p-8"}[u];return t(v,Object.assign({headerText:s,headerSize:l,containerClass:f,"data-testid":h},m,{children:e("div",{className:y,children:[i&&t("div",{className:a,children:i}),n]})}))};Js.displayName="Card";const Bs=[],Ks=c(void 0),Qs=({config:e,children:n})=>{const[s,i]=r.useState(e),a={config:s,updateConfig:e=>{i(t=>Object.assign(Object.assign({},t),e))}};return t(Ks.Provider,{value:a,children:n})},Xs=()=>{const e=d(Ks);if(!e)throw new Error("useDashboard must be used within a DashboardProvider");return e},ei=({plugins:r,current_plugin_id:n,on_select_plugin:s,tab_panel_id:i})=>{if(0===r.length)return null;return e("div",{className:"plugin-list mb-4","data-testid":"plugin-list",children:[t("h3",{id:"plugin-list-heading",className:"text-lg font-semibold mb-2",children:"Available Plugins:"}),t("div",{className:"flex flex-wrap gap-2",role:"tablist","aria-labelledby":"plugin-list-heading",onKeyDown:e=>{if("ArrowLeft"===e.key||"ArrowRight"===e.key){const t=r.findIndex(e=>e.id===n);if(t<0)return;const i="ArrowLeft"===e.key?t-1:t+1,a=r[i];a&&(e.preventDefault(),s(a.id))}},children:r.map(e=>{const r=n===e.id;return t("button",{id:`plugin-tab-${e.id}`,type:"button",role:"tab","aria-selected":r,"aria-controls":i,tabIndex:r?0:-1,onClick:()=>s(e.id),className:Y(r?"primary":"tertiary",!1,"px-3 py-1 rounded"),"data-testid":`plugin-list-item-${e.id}`,children:e.name},e.id)})})]})},ti=({plugins:e,current_plugin_id:r,current_tab_index:n,tab_panel_id:s})=>{if(!r||0===e.length)return null;const i=e.find(e=>e.id===r);if(!i||!i.tabs||0===i.tabs.length)return null;const a=i.tabs[n];return a&&a.content?t("div",{id:s,className:"plugin-content",role:"tabpanel","aria-label":a.name,"aria-labelledby":r?`plugin-tab-${r}`:void 0,children:a.content}):null},ri=({plugins:r,children:n})=>{var s;const a=i(()=>[...r].sort((e,t)=>e.order-t.order),[r]),[u,c]=o(()=>a.length>0?a[0].id:null),[d,m]=o(0),f=a.find(e=>e.id===u),y=(null===(s=null==f?void 0:f.tabs)||void 0===s?void 0:s.length)?Math.min(d,f.tabs.length-1):0;l(()=>{if(0===a.length)return void c(null);if(!a.some(e=>e.id===u))return c(a[0].id),void m(0);const e=a.find(e=>e.id===u),t=(null==e?void 0:e.tabs)?e.tabs.length-1:0;m(e=>e>t?Math.max(0,t):e)},[a,u]);const g=h();return e("div",{className:"plugin-manager",children:[n,t(ei,{plugins:a,current_plugin_id:u,on_select_plugin:e=>{c(e),m(0)},tab_panel_id:g}),t(ti,{plugins:a,current_plugin_id:u,current_tab_index:y,tab_panel_id:g})]})},ni=e=>Bs.flatMap(e=>Array.isArray(e)?e:[e]);function si(e){return Array.isArray(e)?e:[]}function ii(e,t){return si(e).filter(t)}function ai(e,t){return si(e).map(t)}function oi(e,t){return si(e).find(t)}function li(e,t){return si(e).some(t)}function ui(e){return si(e).length}function ci(e){return Array.isArray(e)&&e.length>0}function di(e,t){const r=si(e),n=si(t);return r.filter(e=>!n.includes(e))}function hi(e){return si(e).reduce((e,t)=>e.concat(Array.isArray(t)?hi(t):[t]),[])}const mi=(e,...t)=>Q(void 0,[e,...t],void 0,function*(e,t=5e3){return e.startsWith("data:")||e.startsWith("url(")?{exists:!0,fallbackUsed:!1}:new Promise(r=>{const n=new Image,s=setTimeout(()=>{r({exists:!1,error:"Asset loading timeout",fallbackUsed:!0})},t);n.onload=()=>{clearTimeout(s),r({exists:!0,fallbackUsed:!1})},n.onerror=()=>{clearTimeout(s),r({exists:!1,error:"Asset failed to load",fallbackUsed:!0})},n.src=e})}),fi=(e,t)=>Q(void 0,void 0,void 0,function*(){const r=e.map(e=>Q(void 0,void 0,void 0,function*(){return{path:e,result:yield mi(e,t)}}));return(yield Promise.all(r)).reduce((e,{path:t,result:r})=>(e[t]=r,e),{})}),yi=(e,t)=>{if(((null==t?void 0:t.fallbackUsed)||!1===(null==t?void 0:t.exists))&&e.fallback)return{backgroundColor:e.fallback,backgroundImage:"none"};return{backgroundImage:e.path.startsWith("url(")||e.path.startsWith("data:")?e.path:`url('${e.path}')`}},gi=(e,t)=>{const[r,n]=o({exists:!0,fallbackUsed:!1}),[s,i]=o(!0);return l(()=>{let r=!0;return Q(void 0,void 0,void 0,function*(){i(!0);const s=yield mi(e,t);r&&(n(s),i(!1))}),()=>{r=!1}},[e,t]),{result:r,isLoading:s}},pi={SIGNUP_THEME:"/signup-theme.png",LOGO_ENVIROME:"/logo-envirome.png",BVOC:"/bvoc.png",LOGO:"/logo.png"},bi={PRIMARY:"#ad0000",SECONDARY:"#0066cc",NEUTRAL:"#666666",SUCCESS:"#00A89D",WARNING:"#DD3150"},wi=()=>Q(void 0,void 0,void 0,function*(){return fi(Object.values(pi))}),vi=e=>{if("development"!==process.env.NODE_ENV)return;const t=Object.entries(e).filter(([,e])=>!e.exists).map(([e])=>e);t.length>0&&console.warn("⚠️ IDD Dashboard: Missing optional assets detected:",t,"\nSee https://github.com/integrativedesigndevelopment/idd-dashboard/blob/main/docs/guides/required-assets.md for details.")};function ki(e){let t="";if(e){const r=e;t=r.address_1&&r.address_1.length>0?r.address_1+", ":"",r.address_2&&r.address_2.length>0?t+=r.address_2+", ":t+="",r.city&&r.city.length>0?t+=r.city+", ":t+="",r.state&&r.state.length>0?t+=r.state:t+="",r.zip&&r.zip.length>0&&(t+=" "+r.zip)}return t}function Ni(e){return"EVALUATOR"===e?"MODERATOR":e}const Si=["a","b","i","em","strong","br","p","span"];function Ti(e){if(!e)return e;if("undefined"!=typeof window){return require("dompurify").sanitize(e,{ALLOWED_TAGS:Si})}return function(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}(e)}function xi(e,t){return e&&e.length>t?e.slice(0,t)+"...":e}function Oi(e){return/<[a-z][\s\S]*>/i.test(e)}function Ci(e,t){var r;for(let n=0;n<e.length;n++){const s=String(null!==(r=e[n])&&void 0!==r?r:""),i=Oi(s);t.push({text:s,has_links:i})}}const Ei=({type:e,style:r,text:n,items:s,orderedListStyle:i="",unorderedListStyle:a="",paragraphStyle:o=""})=>{if("list"===e){if("ordered"===r){const e=[];return s&&Array.isArray(s)&&Ci(s,e),t("ol",{className:i,children:e.map((e,r)=>e.has_links?t("li",{dangerouslySetInnerHTML:{__html:Ti(e.text)}},r):t("li",{children:e.text},r))})}{const e=[];return s&&Array.isArray(s)&&Ci(s,e),t("ul",{className:a,children:e.map((e,r)=>e.has_links?t("li",{dangerouslySetInnerHTML:{__html:Ti(e.text)}},r):t("li",{children:e.text},r))})}}if(n){const e=Oi(n);return t("p",e?{className:o,dangerouslySetInnerHTML:{__html:Ti(n)}}:{className:o,children:n})}return t("p",{className:o})},Di=()=>{const[e,t]=o({width:0,height:0});return l(()=>{function e(){t({width:window.innerWidth,height:window.innerHeight})}return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e},Ii=xi,Mi=di,_i=ki,$i=Ni,Vi=e=>e&&"string"==typeof e?e.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/<[^>]+>/g,"").replace(/javascript:/gi,"").replace(/on\w+\s*=/gi,"").trim():"",Li=e=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),Fi=e=>{try{return new URL(e),!0}catch(e){return!1}},Wi=e=>!e||0===e.trim().length,Ai=(e,t,r)=>{const n=e?e.length:0;return n>=t&&n<=r},zi=e=>/^[a-zA-Z0-9]+$/.test(e),ji=e=>/^[a-zA-Z]+$/.test(e),Zi=e=>/^\d+$/.test(e),Ri=e=>/^[\d\s\-\(\)\+]+$/.test(e)&&e.replace(/\D/g,"").length>=10,qi=e=>e.replace(/\s+/g," ").trim(),Ui=(e,t)=>t.test(e),Pi=e=>{const t=new Date(e);return!isNaN(t.getTime())},Gi=(e,t=[])=>({isValid:e,errors:t}),Hi=c(null),Yi=({children:e})=>{const r=h(),[n,s]=o([]),u=m(new Map),c=a(e=>{const t=u.current.get(e);t&&(clearTimeout(t),u.current.delete(e)),s(t=>t.filter(t=>t.id!==e))},[]),d=a((e,t="error",n=!0,i=1e4)=>{const a=`${r}-${Date.now()}-${Math.random().toString(36).slice(2,11)}`,o={id:a,type:t,message:e,timestamp:Date.now(),autoHide:n,duration:i},l={id:"",added:!1};if(s(r=>{const n=r.find(r=>r.message===e&&r.type===t);return n?(l.id=n.id,l.added=!1,r):(l.id=a,l.added=!0,[...r,o])}),l.added&&n&&i){const e=setTimeout(()=>{c(a)},i);u.current.set(a,e)}return l.id},[r,c]),f=a(()=>{u.current.forEach(e=>{clearTimeout(e)}),u.current.clear(),s([])},[]),y=a((e,t=!0)=>d(e,"error",t),[d]),g=a((e,t=!0)=>d(e,"success",t),[d]),p=a((e,t=!0)=>d(e,"warning",t),[d]),b=a((e,t=!0)=>d(e,"info",t),[d]);l(()=>()=>{u.current.forEach(e=>{clearTimeout(e)}),u.current.clear()},[]);const w=i(()=>({errors:n,addError:d,removeError:c,clearErrors:f,showError:y,showSuccess:g,showWarning:p,showInfo:b}),[n,d,c,f,y,g,p,b]);return t(Hi.Provider,{value:w,children:e})},Ji=()=>{const e=d(Hi);if(!e)throw new Error("useError must be used within an ErrorProvider");return e},Bi=()=>{const{showError:e}=Ji();return{handleError:a((t,r)=>{console.error("Error caught by boundary:",t,r),e("An unexpected error occurred. Please try again.")},[e])}},Ki=({error:r,onClose:n})=>e("div",{className:`text-white p-4 rounded-lg shadow-lg ring-2 ${(()=>{switch(r.type){case"success":return"ring-idd-green";case"warning":return"ring-idd-yellow";case"info":return"ring-idd-purple";default:return"ring-idd-active-color"}})()} flex items-start gap-3 max-w-md`,children:[t("div",{className:"flex-shrink-0 mt-0.5",children:(()=>{switch(r.type){case"success":return t(C,{});case"warning":return t(O,{});case"info":return t(x,{});default:return t(T,{})}})()}),t("div",{className:"flex-1 min-w-0",children:e("div",{className:"font-idd-primary-font-regular text-lg leading-relaxed",children:[t("span",{className:"font-idd-primary-font-bold text-lg",children:(()=>{switch(r.type){case"success":return"Success: ";case"warning":return"Warning: ";case"info":return"Info: ";default:return"Error: "}})()})," ",r.message]})}),t(g,{buttonClass:"border-0 bg-idd-transparent ms-auto",onPress:()=>n(r.id),"aria-label":"Close",children:t(S,{})})]}),Qi=()=>{const{errors:e,removeError:r}=Ji();return 0===e.length?null:t("div",{className:"fixed bottom-10 right-10 flex flex-col gap-3",style:{zIndex:1e3},children:e.map(e=>t("div",{className:"bg-idd-white mt-3",children:t(Ki,{error:e,onClose:r})},e.id))})};export{re as ActionTypes,As as ActivityProvider,zs as CancelActionButton,Js as Card,js as ConfirmActionButton,Ei as ContentItem,pi as DEFAULT_ASSET_PATHS,bi as DEFAULT_FALLBACK_COLORS,Qs as DashboardProvider,Zs as ErrorBoundary,Hi as ErrorContext,Yi as ErrorProvider,Ki as ErrorToast,Qi as ErrorToastContainer,B as FormField,qs as IDDLinkInputItem,Ps as Layout,X as Loader,Ys as Modal,U as Password,W as PasswordRequirements,I as PasswordStrength,V as PasswordStrengthBar,A as PasswordStrengthIndicator,ri as PluginManager,J as SimpleButton,ee as SubmitButton,te as TermsCheckbox,Gs as TextInput,G as buttonVariants,H as commonStyles,Gi as createValidationResult,z as defaultConfig,si as ensureArray,hi as flatten,Mi as getArraysDiff,yi as getBackgroundStyle,Y as getButtonStyles,R as getConfig,_i as getLocationString,ni as get_all_plugins,di as get_arrays_diff,ki as get_location_string,ji as isAlpha,zi as isAlphanumeric,Wi as isEmpty,Ai as isLengthValid,ci as isNonEmptyArray,Zi as isNumeric,Rs as isURL,Pi as isValidDate,Li as isValidEmail,Ri as isValidPhone,Fi as isValidUrl,$i as mapUserRole,Ni as map_user_role,Ui as matchesPattern,qi as normalizeWhitespace,Fs as pageViewEvent,Ls as page_view_event,ue as resetReducer,ii as safeFilter,oi as safeFind,ui as safeLength,ai as safeMap,li as safeSome,Vi as sanitizeInput,Z as setConfig,le as setCurrentItem,se as setCurrentPlugin,ce as setCurrentPluginAndTab,ae as setCurrentState,ie as setCurrentTab,de as setCurrentTabAndState,oe as setCurrentView,ne as setPlugins,he as setSetting,me as toggleCollapsed,fe as toggleNotifications,Ii as truncate,xi as truncate_str,gi as useAssetValidation,q as useConfig,Xs as useDashboard,Ji as useError,Bi as useErrorBoundary,P as useIDDTheme,Di as useWindowDimensions,mi as validateAsset,fi as validateAssets,wi as validateCommonAssets,vi as warnMissingAssets};
|
|
2
2
|
//# sourceMappingURL=index.esm.js.map
|