@buildbase/sdk 0.0.32 → 0.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,36 @@
1
1
  "use client";
2
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("lucide-react"),a=require("@radix-ui/react-alert-dialog"),r=require("@radix-ui/react-switch"),s=require("react-hook-form"),i=require("@radix-ui/react-slot"),o=require("@radix-ui/react-label"),c=require("class-variance-authority"),l=require("@radix-ui/react-icons"),u=require("@radix-ui/react-radio-group"),d=require("@radix-ui/react-scroll-area"),m=require("cmdk"),p=require("@radix-ui/react-popover"),h=require("@radix-ui/react-select"),g=require("@radix-ui/react-avatar"),f=require("@radix-ui/react-separator"),b=require("clsx"),x=require("tailwind-merge"),v=require("@radix-ui/react-dialog");function y(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}}),t.default=e,Object.freeze(t)}var w=y(t),S=y(a),k=y(r),N=y(o),j=y(u),A=y(d),C=y(p),E=y(h),T=y(g),P=y(f),_=y(v);function U(...e){return x.twMerge(b.clsx(e))}let I=!0;function D(e,...t){I&&function(){try{const e="undefined"!=typeof globalThis?globalThis:null;return"development"===e?.process?.env?.NODE_ENV}catch{return!1}}()&&console.error(e,...t)}function R(e,...t){console.error(e,...t)}function z(e){return e instanceof Error&&("AbortError"===e.name||"ERR_CANCELED"===e.code)}async function L(e,t){try{const n=await e.json();return n?.message||n?.error||t}catch{return t}}async function M(e){const t=await e.text();if(!t)throw new Error("Empty response body");try{return JSON.parse(t)}catch(e){throw new Error(`Invalid JSON response: ${t.substring(0,100)}${t.length>100?"...":""}`)}}async function B(e,t="Request failed"){if(!e.ok){let n=t;try{const t=await M(e);n=t.message||t.error||n}catch{n=function(e,t){const n={400:"Bad Request",401:"Unauthorized - Please check your session",403:"Forbidden - You do not have permission",404:"Resource not found",500:"Internal server error",502:"Bad Gateway",503:"Service unavailable"}[e.status]||e.statusText||t;return new Error(`${t} (${e.status}: ${n})`)}(e,t).message}throw new Error(n)}try{return await M(e)}catch(e){if(e instanceof Error&&e.message.includes("Invalid JSON"))throw e;throw new Error("Failed to parse response as JSON")}}class O extends Error{constructor(e,t,n,a){super(e),this.code=t,this.context=n,this.originalError=a,this.name="SDKError","undefined"!=typeof Error&&"captureStackTrace"in Error&&Error.captureStackTrace(this,O)}}const F=new class{constructor(){this.config={enableConsoleLogging:!0,showUserNotifications:!1}}configure(e){this.config={...this.config,...e},void 0!==e.enableConsoleLogging&&function(e){void 0!==e.enableLogging&&(I=e.enableLogging)}({enableLogging:e.enableConsoleLogging})}handleError(e,t={}){if(z(e))return;const n=e instanceof Error?e:new O("string"==typeof e?e:"An unknown error occurred","UNKNOWN_ERROR",t),a=n instanceof O?n:new O(n.message,"SDK_ERROR",t,n);if(this.config.enableConsoleLogging&&D(`[SDK Error] ${t.component||"Unknown"}:`,{message:a.message,code:a.code,context:a.context,originalError:a.originalError,stack:a.stack}),this.config.onError)try{this.config.onError(a,t)}catch(e){R("[SDK Error Handler] Error in custom error callback:",e)}this.config.showUserNotifications&&this.notifyUser(a,t)}notifyUser(e,t){"undefined"!=typeof window&&window.dispatchEvent&&window.dispatchEvent(new CustomEvent("sdk-error",{detail:{error:e,context:t}}))}wrapAsync(e,t){return(...n)=>e(...n).catch(e=>{throw this.handleError(e,t),e})}wrapSync(e,t){return(...n)=>{try{return e(...n)}catch(e){throw this.handleError(e,t),e}}}};function W(e,t={}){F.handleError(e,t)}function H(e,t={}){return!z(e)&&(F.handleError(e,t),!0)}class G extends t.Component{constructor(e){super(e),this.resetError=()=>{this.setState({hasError:!1,error:null})},this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){if(W(e,{component:"ErrorBoundary",action:"componentDidCatch",metadata:{componentStack:t.componentStack,errorBoundary:this.constructor.name}}),this.props.onError)try{this.props.onError(e,t)}catch(e){R("[SDK ErrorBoundary] Error in onError callback:",e)}}componentDidUpdate(e){this.state.hasError&&!1!==this.props.resetOnPropsChange&&e.children!==this.props.children&&this.resetError()}render(){return this.state.hasError&&this.state.error?this.props.fallback?"function"==typeof this.props.fallback?this.props.fallback(this.state.error,this.resetError):this.props.fallback:e.jsxs("div",{style:{padding:"1rem",border:"1px solid #ef4444",borderRadius:"0.5rem",backgroundColor:"#fef2f2",color:"#991b1b"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem 0",fontSize:"1rem",fontWeight:600},children:"Something went wrong"}),e.jsx("p",{style:{margin:"0 0 1rem 0",fontSize:"0.875rem"},children:this.state.error.message||"An unexpected error occurred"}),e.jsx("button",{onClick:this.resetError,style:{padding:"0.5rem 1rem",backgroundColor:"#ef4444",color:"white",border:"none",borderRadius:"0.25rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]}):this.props.children}}const $=()=>({type:"AUTHENTICATION_STARTED"}),V=()=>({type:"AUTHENTICATION_PROCESSING"}),K=()=>({type:"AUTHENTICATION_FAILED"}),Z=e=>({type:"SET_SESSION",payload:e}),q=()=>({type:"REMOVE_SESSION"});function J(e,n,a){const r=t.useRef(n),s=t.useRef(a),i=t.useRef(void 0),o=t.useRef(!1);return r.current=n,s.current=a,t.useMemo(()=>{const t=r.current(e);if(o.current){if(s.current?s.current(i.current,t):Object.is(i.current,t))return i.current}return i.current=t,o.current=!0,t},[e])}function Y({name:n,initialState:a,reducer:r,initializer:s}){const i=t.createContext(null),o=t.createContext(null),c=t.createContext(null),l=t.memo(({children:n})=>{const[l,u]=t.useReducer(r,a,s||(e=>e)),d=t.useMemo(()=>({state:l,dispatch:u}),[l,u]);return e.jsx(c.Provider,{value:d,children:e.jsx(i.Provider,{value:l,children:e.jsx(o.Provider,{value:u,children:n})})})});l.displayName=`${n}Provider`;const u=e=>new Error(`use${n}${e} must be used within a ${n}Provider. Make sure SaaSOSProvider is wrapping your application.`),d=()=>{const e=t.useContext(i);if(null===e)throw u("State");return e};return{Provider:l,useContext:()=>{const e=t.useContext(c);if(!e)throw u("Context");return e},useState:d,useDispatch:()=>{const e=t.useContext(o);if(null===e)throw u("Dispatch");return e},useSelector:(e,t)=>{const n=e||(e=>e);return J(d(),n,t)}}}var Q;function X(e){return{isAuthenticated:e===Q.authenticated,isLoading:e===Q.loading||e===Q.redirecting||e===Q.authenticating,isRedirecting:e===Q.redirecting}}function ee(e,t,n){return{...e,[t]:n}}function te(e,t){return{...e,...t}}!function(e){e.loading="loading",e.redirecting="redirecting",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(Q||(Q={}));const ne=()=>({session:null,status:Q.loading}),{Provider:ae,useState:re,useDispatch:se}=Y({name:"Auth",initialState:ne(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return ee(e,"status",Q.redirecting);case"AUTHENTICATION_PROCESSING":return ee(e,"status",Q.authenticating);case"AUTHENTICATION_FAILED":case"REMOVE_SESSION":return te(e,{session:null,status:Q.unauthenticated});case"SET_SESSION":return te(e,{session:t.payload,status:Q.authenticated});default:return e}},initializer:ne}),ie=ae,oe=re,ce=se,le=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),ue=e=>({type:"SET_SETTINGS",payload:e});var de;function me(e){return Boolean(e?.serverUrl&&e?.version&&e?.orgId)}!function(e){e.V1="v1"}(de||(de={}));const pe=()=>({serverUrl:"",version:de.V1,orgId:"",settings:null}),{Provider:he,useState:ge,useDispatch:fe}=Y({name:"OS",initialState:pe(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return te(e,t.payload);case"REMOVE_SAAS_OS_CONFIG":return pe();case"SET_SETTINGS":return ee(e,"settings",t.payload);default:return e}}}),be=he,xe=ge,ve=fe,ye=e=>({type:"SET_WORKSPACES",payload:e}),we=e=>({type:"ADD_WORKSPACE",payload:e}),Se=e=>({type:"UPDATE_WORKSPACE",payload:e}),ke=e=>({type:"REMOVE_WORKSPACE",payload:e}),Ne=e=>({type:"SET_ALL_FEATURES",payload:e}),je=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),Ae=()=>({type:"RESET_CURRENT_WORKSPACE"}),Ce=e=>({type:"SET_IS_INITIALIZED",payload:e}),Ee=e=>({type:"SET_LOADING",payload:e}),Te=e=>({type:"SET_ERROR",payload:e}),Pe=e=>({type:"SET_REFRESHING",payload:e}),_e=e=>({type:"SET_SWITCHING_TO_ID",payload:e}),{Provider:Ue,useState:Ie,useDispatch:De}=Y({name:"Workspace",initialState:{workspaces:[],loading:!1,error:null,currentWorkspace:null,refreshing:!1,switchingToId:null,isInitialized:!1,allFeatures:[]},reducer:(e,t)=>{switch(t.type){case"SET_WORKSPACES":return ee(e,"workspaces",t.payload);case"ADD_WORKSPACE":return ee(e,"workspaces",[...e.workspaces,t.payload]);case"UPDATE_WORKSPACE":return ee(e,"workspaces",e.workspaces.map(e=>e._id===t.payload._id?t.payload:e));case"REMOVE_WORKSPACE":return ee(e,"workspaces",e.workspaces.filter(e=>e._id!==t.payload));case"SET_ALL_FEATURES":return ee(e,"allFeatures",t.payload);case"SET_CURRENT_WORKSPACE":return ee(e,"currentWorkspace",t.payload);case"RESET_CURRENT_WORKSPACE":return ee(e,"currentWorkspace",null);case"SET_IS_INITIALIZED":return ee(e,"isInitialized",t.payload);case"SET_LOADING":return ee(e,"loading",t.payload);case"SET_ERROR":return ee(e,"error",t.payload);case"SET_REFRESHING":return ee(e,"refreshing",t.payload);case"SET_SWITCHING_TO_ID":return ee(e,"switchingToId",t.payload);default:return e}}}),Re=Ue,ze=Ie,Le=De,Me=t.memo(({children:t})=>e.jsx(be,{children:e.jsx(ie,{children:e.jsx(Re,{children:t})})}));function Be(e,n){const a=xe(),r=oe(),s=ze(),i=e||(e=>e);return J(t.useMemo(()=>({os:a,auth:r,workspaces:s}),[a,r,s]),i,n)}Me.displayName="SDKContextProvider";const Oe=new Set;function Fe(){Oe.forEach(e=>e())}const We=new Set;function He(){We.forEach(e=>e())}function Ge(e,t){const n=t&&t.cache?t.cache:Ye,a=t&&t.serializer?t.serializer:qe;return(t&&t.strategy?t.strategy:Ze)(e,{cache:n,serializer:a})}function $e(e,t,n,a){const r=null==(s=a)||"number"==typeof s||"boolean"==typeof s?a:n(a);var s;let i=t.get(r);return void 0===i&&(i=e.call(this,a),t.set(r,i)),i}function Ve(e,t,n){const a=Array.prototype.slice.call(arguments,3),r=n(a);let s=t.get(r);return void 0===s&&(s=e.apply(this,a),t.set(r,s)),s}function Ke(e,t,n,a,r){return n.bind(t,e,a,r)}function Ze(e,t){return Ke(e,this,1===e.length?$e:Ve,t.cache.create(),t.serializer)}const qe=function(){return JSON.stringify(arguments)};class Je{cache;constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const Ye={create:function(){return new Je}},Qe={variadic:function(e,t){return Ke(e,this,Ve,t.cache.create(),t.serializer)}},Xe=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function et(e){const t={};return e.replace(Xe,e=>{const n=e.length;switch(e[0]){case"G":t.era=4===n?"long":5===n?"narrow":"short";break;case"y":t.year=2===n?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][n-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][n-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===n?"long":5===n?"narrow":"short";break;case"e":if(n<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"c":if(n<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][n-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][n-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][n-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][n-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][n-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][n-1];break;case"s":t.second=["numeric","2-digit"][n-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=n<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}const tt=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function nt(e){return e.replace(/^(.*?)-/,"")}const at=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,rt=/^(@+)?(\+|#+)?[rs]?$/g,st=/(\*)(0+)|(#+)(0+)|(0+)/g,it=/^(0+)$/;function ot(e){const t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(rt,function(e,n,a){return"string"!=typeof a?(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length):"+"===a?t.minimumSignificantDigits=n.length:"#"===n[0]?t.maximumSignificantDigits=n.length:(t.minimumSignificantDigits=n.length,t.maximumSignificantDigits=n.length+("string"==typeof a?a.length:0)),""}),t}function ct(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function lt(e){let t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){const n=e.slice(0,2);if("+!"===n?(t.signDisplay="always",e=e.slice(2)):"+?"===n&&(t.signDisplay="exceptZero",e=e.slice(2)),!it.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function ut(e){const t=ct(e);return t||{}}function dt(e){let t={};for(const n of e){switch(n.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=n.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=nt(n.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...n.options.reduce((e,t)=>({...e,...ut(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...n.options.reduce((e,t)=>({...e,...ut(t)}),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(n.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(n.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");n.options[0].replace(st,function(e,n,a,r,s,i){if(n)t.minimumIntegerDigits=a.length;else{if(r&&s)throw new Error("We currently do not support maximum integer digits");if(i)throw new Error("We currently do not support exact integer digits")}return""});continue}if(it.test(n.stem)){t.minimumIntegerDigits=n.stem.length;continue}if(at.test(n.stem)){if(n.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");n.stem.replace(at,function(e,n,a,r,s,i){return"*"===a?t.minimumFractionDigits=n.length:r&&"#"===r[0]?t.maximumFractionDigits=r.length:s&&i?(t.minimumFractionDigits=s.length,t.maximumFractionDigits=s.length+i.length):(t.minimumFractionDigits=n.length,t.maximumFractionDigits=n.length),""});const e=n.options[0];"w"===e?t={...t,trailingZeroDisplay:"stripIfInteger"}:e&&(t={...t,...ot(e)});continue}if(rt.test(n.stem)){t={...t,...ot(n.stem)};continue}const e=ct(n.stem);e&&(t={...t,...e});const a=lt(n.stem);a&&(t={...t,...a})}return t}let mt=function(e){return e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag",e}({}),pt=function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e}({});function ht(e){return e.type===mt.literal}function gt(e){return e.type===mt.argument}function ft(e){return e.type===mt.number}function bt(e){return e.type===mt.date}function xt(e){return e.type===mt.time}function vt(e){return e.type===mt.select}function yt(e){return e.type===mt.plural}function wt(e){return e.type===mt.pound}function St(e){return e.type===mt.tag}function kt(e){return!(!e||"object"!=typeof e||e.type!==pt.number)}function Nt(e){return!(!e||"object"!=typeof e||e.type!==pt.dateTime)}let jt=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG",e}({});const At=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Ct={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GS:["H","h","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ku-SY":["H","hB"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function Et(e){let t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}const n=e.language;let a;"root"!==n&&(a=e.maximize().region);return(Ct[a||""]||Ct[n||""]||Ct[`${n}-001`]||Ct["001"])[0]}const Tt=new RegExp(`^${At.source}*`),Pt=new RegExp(`${At.source}*$`);function _t(e,t){return{start:e,end:t}}const Ut=!!Object.fromEntries,It=!!String.prototype.trimStart,Dt=!!String.prototype.trimEnd,Rt=Ut?Object.fromEntries:function(e){const t={};for(const[n,a]of e)t[n]=a;return t},zt=It?function(e){return e.trimStart()}:function(e){return e.replace(Tt,"")},Lt=Dt?function(e){return e.trimEnd()}:function(e){return e.replace(Pt,"")},Mt=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class Bt{message;position;locale;ignoreTag;requiresOtherClause;shouldParseSkeletons;constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(e,t,n){let a=[];for(;!this.isEOF();){const r=this.char();if(123===r){const t=this.parseArgument(e,n);if(t.err)return t;a.push(t.val)}else{if(125===r&&e>0)break;if(35!==r||"plural"!==t&&"selectordinal"!==t){if(60===r&&!this.ignoreTag&&47===this.peek()){if(n)break;return this.error(jt.UNMATCHED_CLOSING_TAG,_t(this.clonePosition(),this.clonePosition()))}if(60===r&&!this.ignoreTag&&Ot(this.peek()||0)){const n=this.parseTag(e,t);if(n.err)return n;a.push(n.val)}else{const n=this.parseLiteral(e,t);if(n.err)return n;a.push(n.val)}}else{const e=this.clonePosition();this.bump(),a.push({type:mt.pound,location:_t(e,this.clonePosition())})}}}return{val:a,err:null}}parseTag(e,t){const n=this.clonePosition();this.bump();const a=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:mt.literal,value:`<${a}/>`,location:_t(n,this.clonePosition())},err:null};if(this.bumpIf(">")){const r=this.parseMessage(e+1,t,!0);if(r.err)return r;const s=r.val,i=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Ot(this.char()))return this.error(jt.INVALID_TAG,_t(i,this.clonePosition()));const e=this.clonePosition();return a!==this.parseTagName()?this.error(jt.UNMATCHED_CLOSING_TAG,_t(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:mt.tag,value:a,children:s,location:_t(n,this.clonePosition())},err:null}:this.error(jt.INVALID_TAG,_t(i,this.clonePosition())))}return this.error(jt.UNCLOSED_TAG,_t(n,this.clonePosition()))}return this.error(jt.INVALID_TAG,_t(n,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&Ft(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){const n=this.clonePosition();let a="";for(;;){const n=this.tryParseQuote(t);if(n){a+=n;continue}const r=this.tryParseUnquoted(e,t);if(r){a+=r;continue}const s=this.tryParseLeftAngleBracket();if(!s)break;a+=s}const r=_t(n,this.clonePosition());return{val:{type:mt.literal,value:a,location:r},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Ot(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e}tryParseQuote(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();const t=[this.char()];for(this.bump();!this.isEOF();){const e=this.char();if(39===e){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;const n=this.char();return 60===n||123===n||35===n&&("plural"===t||"selectordinal"===t)||125===n&&e>0?null:(this.bump(),String.fromCodePoint(n))}parseArgument(e,t){const n=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(jt.EXPECT_ARGUMENT_CLOSING_BRACE,_t(n,this.clonePosition()));if(125===this.char())return this.bump(),this.error(jt.EMPTY_ARGUMENT,_t(n,this.clonePosition()));let a=this.parseIdentifierIfPossible().value;if(!a)return this.error(jt.MALFORMED_ARGUMENT,_t(n,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(jt.EXPECT_ARGUMENT_CLOSING_BRACE,_t(n,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:mt.argument,value:a,location:_t(n,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(jt.EXPECT_ARGUMENT_CLOSING_BRACE,_t(n,this.clonePosition())):this.parseArgumentOptions(e,t,a,n);default:return this.error(jt.MALFORMED_ARGUMENT,_t(n,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),n=function(e,t){return Mt.lastIndex=t,Mt.exec(e)[1]??""}(this.message,t),a=t+n.length;this.bumpTo(a);return{value:n,location:_t(e,this.clonePosition())}}parseArgumentOptions(e,t,n,a){let r=this.clonePosition(),s=this.parseIdentifierIfPossible().value,i=this.clonePosition();switch(s){case"":return this.error(jt.EXPECT_ARGUMENT_TYPE,_t(r,i));case"number":case"date":case"time":{this.bumpSpace();let e=null;if(this.bumpIf(",")){this.bumpSpace();const t=this.clonePosition(),n=this.parseSimpleArgStyleIfPossible();if(n.err)return n;const a=Lt(n.val);if(0===a.length)return this.error(jt.EXPECT_ARGUMENT_STYLE,_t(this.clonePosition(),this.clonePosition()));e={style:a,styleLocation:_t(t,this.clonePosition())}}const t=this.tryParseArgumentClose(a);if(t.err)return t;const r=_t(a,this.clonePosition());if(e&&e.style.startsWith("::")){let t=zt(e.style.slice(2));if("number"===s){const a=this.parseNumberSkeletonFromString(t,e.styleLocation);return a.err?a:{val:{type:mt.number,value:n,location:r,style:a.val},err:null}}{if(0===t.length)return this.error(jt.EXPECT_DATE_TIME_SKELETON,r);let a=t;this.locale&&(a=function(e,t){let n="";for(let a=0;a<e.length;a++){const r=e.charAt(a);if("j"===r){let s=0;for(;a+1<e.length&&e.charAt(a+1)===r;)s++,a++;let i=1+(1&s),o=s<2?1:3+(s>>1),c="a",l=Et(t);for("H"!=l&&"k"!=l||(o=0);o-- >0;)n+=c;for(;i-- >0;)n=l+n}else n+="J"===r?"H":r}return n}(t,this.locale));const i={type:pt.dateTime,pattern:a,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?et(a):{}};return{val:{type:"date"===s?mt.date:mt.time,value:n,location:r,style:i},err:null}}}return{val:{type:"number"===s?mt.number:"date"===s?mt.date:mt.time,value:n,location:r,style:e?.style??null},err:null}}case"plural":case"selectordinal":case"select":{const r=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(jt.EXPECT_SELECT_ARGUMENT_OPTIONS,_t(r,{...r}));this.bumpSpace();let i=this.parseIdentifierIfPossible(),o=0;if("select"!==s&&"offset"===i.value){if(!this.bumpIf(":"))return this.error(jt.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,_t(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(jt.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,jt.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),i=this.parseIdentifierIfPossible(),o=e.val}const c=this.tryParsePluralOrSelectOptions(e,s,t,i);if(c.err)return c;const l=this.tryParseArgumentClose(a);if(l.err)return l;const u=_t(a,this.clonePosition());return"select"===s?{val:{type:mt.select,value:n,options:Rt(c.val),location:u},err:null}:{val:{type:mt.plural,value:n,options:Rt(c.val),offset:o,pluralType:"plural"===s?"cardinal":"ordinal",location:u},err:null}}default:return this.error(jt.INVALID_ARGUMENT_TYPE,_t(r,i))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(jt.EXPECT_ARGUMENT_CLOSING_BRACE,_t(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0;const t=this.clonePosition();for(;!this.isEOF();){switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil("'"))return this.error(jt.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,_t(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let n=[];try{n=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");const t=e.split(tt).filter(e=>e.length>0),n=[];for(const e of t){let t=e.split("/");if(0===t.length)throw new Error("Invalid number skeleton");const[a,...r]=t;for(const e of r)if(0===e.length)throw new Error("Invalid number skeleton");n.push({stem:a,options:r})}return n}(e)}catch{return this.error(jt.INVALID_NUMBER_SKELETON,t)}return{val:{type:pt.number,tokens:n,location:t,parsedOptions:this.shouldParseSkeletons?dt(n):{}},err:null}}tryParsePluralOrSelectOptions(e,t,n,a){let r=!1;const s=[],i=new Set;let{value:o,location:c}=a;for(;;){if(0===o.length){const e=this.clonePosition();if("select"===t||!this.bumpIf("="))break;{const t=this.tryParseDecimalInteger(jt.EXPECT_PLURAL_ARGUMENT_SELECTOR,jt.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;c=_t(e,this.clonePosition()),o=this.message.slice(e.offset,this.offset())}}if(i.has(o))return this.error("select"===t?jt.DUPLICATE_SELECT_ARGUMENT_SELECTOR:jt.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===o&&(r=!0),this.bumpSpace();const a=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?jt.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:jt.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,_t(this.clonePosition(),this.clonePosition()));const l=this.parseMessage(e+1,t,n);if(l.err)return l;const u=this.tryParseArgumentClose(a);if(u.err)return u;s.push([o,{value:l.val,location:_t(a,this.clonePosition())}]),i.add(o),this.bumpSpace(),({value:o,location:c}=this.parseIdentifierIfPossible())}return 0===s.length?this.error("select"===t?jt.EXPECT_SELECT_ARGUMENT_SELECTOR:jt.EXPECT_PLURAL_ARGUMENT_SELECTOR,_t(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!r?this.error(jt.MISSING_OTHER_CLAUSE,_t(this.clonePosition(),this.clonePosition())):{val:s,err:null}}tryParseDecimalInteger(e,t){let n=1;const a=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(n=-1);let r=!1,s=0;for(;!this.isEOF();){const e=this.char();if(!(e>=48&&e<=57))break;r=!0,s=10*s+(e-48),this.bump()}const i=_t(a,this.clonePosition());return r?(s*=n,Number.isSafeInteger(s)?{val:s,err:null}:this.error(t,i)):this.error(e,i)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");const t=this.message.codePointAt(e);if(void 0===t)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;const e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){const t=this.offset(),n=this.message.indexOf(e,t);return n>=0?(this.bumpTo(n),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){const t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&Wt(this.char());)this.bump()}peek(){if(this.isEOF())return null;const e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}}function Ot(e){return e>=97&&e<=122||e>=65&&e<=90}function Ft(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Wt(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Ht(e){e.forEach(e=>{if(delete e.location,vt(e)||yt(e))for(const t in e.options)delete e.options[t].location,Ht(e.options[t].value);else ft(e)&&kt(e.style)||(bt(e)||xt(e))&&Nt(e.style)?delete e.style.location:St(e)&&Ht(e.children)})}function Gt(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const n=new Bt(e,t).parse();if(n.err){const e=SyntaxError(jt[n.err.kind]);throw e.location=n.err.location,e.originalMessage=n.err.message,e}return t?.captureLocation||Ht(n.val),n.val}let $t=function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e}({});class Vt extends Error{code;originalMessage;constructor(e,t,n){super(e),this.code=t,this.originalMessage=n}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}}class Kt extends Vt{constructor(e,t,n,a){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(n).join('", "')}"`,$t.INVALID_VALUE,a)}}class Zt extends Vt{constructor(e,t,n){super(`Value for "${e}" must be of type ${t}`,$t.INVALID_VALUE,n)}}class qt extends Vt{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,$t.MISSING_VALUE,t)}}let Jt=function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e}({});function Yt(e){return"function"==typeof e}function Qt(e,t,n,a,r,s,i){if(1===e.length&&ht(e[0]))return[{type:Jt.literal,value:e[0].value}];const o=[];for(const c of e){if(ht(c)){o.push({type:Jt.literal,value:c.value});continue}if(wt(c)){"number"==typeof s&&o.push({type:Jt.literal,value:n.getNumberFormat(t).format(s)});continue}const{value:e}=c;if(!r||!(e in r))throw new qt(e,i);let l=r[e];if(gt(c))l&&"string"!=typeof l&&"number"!=typeof l&&"bigint"!=typeof l||(l="string"==typeof l||"number"==typeof l||"bigint"==typeof l?String(l):""),o.push({type:"string"==typeof l?Jt.literal:Jt.object,value:l});else{if(bt(c)){const e="string"==typeof c.style?a.date[c.style]:Nt(c.style)?c.style.parsedOptions:void 0;o.push({type:Jt.literal,value:n.getDateTimeFormat(t,e).format(l)});continue}if(xt(c)){const e="string"==typeof c.style?a.time[c.style]:Nt(c.style)?c.style.parsedOptions:a.time.medium;o.push({type:Jt.literal,value:n.getDateTimeFormat(t,e).format(l)});continue}if(ft(c)){const e="string"==typeof c.style?a.number[c.style]:kt(c.style)?c.style.parsedOptions:void 0;if(e&&e.scale){const t=e.scale||1;if("bigint"==typeof l){if(!Number.isInteger(t))throw new TypeError(`Cannot apply fractional scale ${t} to bigint value. Scale must be an integer when formatting bigint.`);l*=BigInt(t)}else l*=t}o.push({type:Jt.literal,value:n.getNumberFormat(t,e).format(l)});continue}if(St(c)){const{children:e,value:l}=c,u=r[l];if(!Yt(u))throw new Zt(l,"function",i);let d=u(Qt(e,t,n,a,r,s).map(e=>e.value));Array.isArray(d)||(d=[d]),o.push(...d.map(e=>({type:"string"==typeof e?Jt.literal:Jt.object,value:e})))}if(vt(c)){const e=l,s=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!s)throw new Kt(c.value,l,Object.keys(c.options),i);o.push(...Qt(s.value,t,n,a,r));continue}if(yt(c)){const e=`=${l}`;let s=Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0;if(!s){if(!Intl.PluralRules)throw new Vt('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',$t.MISSING_INTL_API,i);const e="bigint"==typeof l?Number(l):l,a=n.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));s=(Object.prototype.hasOwnProperty.call(c.options,a)?c.options[a]:void 0)||c.options.other}if(!s)throw new Kt(c.value,l,Object.keys(c.options),i);const u="bigint"==typeof l?Number(l):l;o.push(...Qt(s.value,t,n,a,r,u-(c.offset||0)));continue}}}return(c=o).length<2?c:c.reduce((e,t)=>{const n=e[e.length-1];return n&&n.type===Jt.literal&&t.type===Jt.literal?n.value+=t.value:e.push(t),e},[]);var c}function Xt(e,t){return t?Object.keys(e).reduce((n,a)=>{var r,s;return n[a]=(r=e[a],(s=t[a])?{...r,...s,...Object.keys(r).reduce((e,t)=>(e[t]={...r[t],...s[t]},e),{})}:r),n},{...e}):e}function en(e){return{create:()=>({get:t=>e[t],set(t,n){e[t]=n}})}}class tn{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(e,t=tn.defaultLocale,n,a){if(this.locales=t,this.resolvedLocale=tn.resolveLocale(t),"string"==typeof e){if(this.message=e,!tn.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...t}=a||{};this.ast=tn.__parse(e,{...t,locale:this.resolvedLocale})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Xt(tn.formats,n),this.formatters=a&&a.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:Ge((...e)=>new Intl.NumberFormat(...e),{cache:en(e.number),strategy:Qe.variadic}),getDateTimeFormat:Ge((...e)=>new Intl.DateTimeFormat(...e),{cache:en(e.dateTime),strategy:Qe.variadic}),getPluralRules:Ge((...e)=>new Intl.PluralRules(...e),{cache:en(e.pluralRules),strategy:Qe.variadic})}}(this.formatterCache)}format=e=>{const t=this.formatToParts(e);if(1===t.length)return t[0].value;const n=t.reduce((e,t)=>(e.length&&t.type===Jt.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e),[]);return n.length<=1?n[0]||"":n};formatToParts=e=>Qt(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message);resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]});getAst=()=>this.ast;static memoizedDefaultLocale=null;static get defaultLocale(){return tn.memoizedDefaultLocale||(tn.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),tn.memoizedDefaultLocale}static resolveLocale=e=>{if(void 0===Intl.Locale)return;const t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])};static __parse=Gt;static formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}const nn={settings:{titles:{profile:"Account",general:"Workspace Settings",users:"Workspace Members",subscription:"Plan & Billing",usage:"Usage",features:"Workspace Features",notifications:"Notifications",danger:"Danger Zone"},sidebar:{account:"Account",workspace:"Workspace",profile:"Account",general:"Settings",users:"Members",subscription:"Plan & Billing",usage:"Usage",features:"Features",notifications:"Notifications",danger:"Danger Zone"},common:{refresh:"Refresh",refreshing:"Refreshing...",retry:"Retry",retrying:"Retrying...",save:"Save",saving:"Saving...",cancel:"Cancel",delete:"Delete",dismiss:"Dismiss",loading:"Loading...",success:"Success!",error:"Error",refreshAction:"{loading, select, true {Refreshing...} other {Refresh}}",retryAction:"{loading, select, true {Retrying...} other {Retry}}"}},subscription:{managePlan:"Manage your plan and billing",changePlan:"Change Plan",viewPricingPlans:"View Pricing Plans",viewPlans:"View Plans",upgradePlan:"Upgrade Now",subscribe:"Subscribe",currentPlan:"Current Plan",noSubscription:"You don't have an active subscription",choosePlan:"Choose Your Plan",choosePlanDescription:"Compare plans and select the one that fits your needs",planUpdateAvailable:"Plan update available",updateSuccess:"Subscription updated successfully!",updateFailed:"Update failed",cancelTitle:"Cancel Subscription",cancelConfirm:"Are you sure you want to cancel your subscription?",cancelKeep:"Keep Subscription",cancelButton:"Yes, Cancel Subscription",canceling:"Canceling...",cancelSuccess:"Subscription will be canceled at the end of the billing period.",cancelNotCharged:"You won't be charged again after cancellation",cancelResumeAnytime:"You can resume your subscription anytime before it ends",resumeTitle:"Resume Subscription",resumeConfirm:"Are you sure you want to resume your subscription?",resumeKeep:"Keep Canceled",resumeButton:"Yes, Resume Subscription",resuming:"Resuming...",resumeSuccess:"Subscription has been resumed.",managePayment:"Manage Payment",openingPortal:"Opening...",viewAllPlans:"View All Plans",scheduledCancellation:"Subscription scheduled for cancellation",paymentPastDue:"Payment past due",paymentPastDueDescription:"Please update your payment method to avoid service interruption.",subscriptionPaused:"Subscription paused",subscriptionPausedDescription:"Your subscription is currently paused. Resume to restore full access.",errorLoading:"Error loading subscription data",errorLoadingDescription:"Please check your connection and try again.",errorProcessing:"Failed to process subscription",errorCanceling:"Failed to cancel subscription",errorResuming:"Failed to resume subscription",invalidWorkspace:"Invalid workspace ID",billingInterval:{monthly:"Monthly",quarterly:"Quarterly",yearly:"Yearly",perMonth:"/month",perQuarter:"/quarter",perYear:"/year"},seats:{title:"Seats",members:"Members",included:"Included",billable:"Billable",perExtraSeat:"Per extra seat",limit:"Limit",includedSeats:"Included seats",maxSeats:"Max seats",freeWithBase:"Free with base price",allIncluded:"All included",extra:"extra",unlimited:"Unlimited"},items:{features:"Features",limits:"Limits",quotas:"Usage Quotas"},checkout:{upgrade:"Upgrade",downgrade:"Downgrade",switchTo:"Switch to",select:"Select"},status:{active:"Active",canceling:"Canceling",trial:"Trial",canceled:"Canceled",pastDue:"Past Due",paused:"Paused",deprecated:"Deprecated",unknown:"Unknown"},plan:"Plan",invoicesTab:"Invoices",changePlanButton:"Change Plan",noPlanAssigned:"No plan assigned",free:"Free",perSeatDisplay:"+ {price}/seat{interval}",estTotalDisplay:"Est. total: {total}{interval} ({count, plural, one {# extra seat} other {# extra seats}})",nextBillingDisplay:"Next billing: {date}",membersInWorkspace:"{count, plural, one {# member} other {# members}} in workspace",billingInCurrency:"Billing in {currency}",savingsPercent:"Save {percent, number}%",switchToInterval:"Switch to {interval}",seatPriceDisplay:"+ {price}/seat{interval} ({included} {includedLabel})",trialEnded:"Your trial has ended.",trialEndsIn:"Your trial ends in {days, plural, one {# day} other {# days}}.",onTrial:"You are on a trial.",upgradeToKeepAccess:"Upgrade to keep access.",viewInvoices:"View Invoices",cancelTrial:"Cancel Trial",dunningFinal:"Final warning: Subscription will be suspended",dunningSuspended:"Subscription suspended",dunningRecovery:"Payment recovery in progress",dunningSuspendedDescription:"Your subscription has been suspended due to repeated payment failures. Update your payment method to restore access.",dunningRecoveryDescription:"We were unable to process your payment. Please update your payment method to avoid losing access.",cancelEndDescription:"Your subscription will end on",cancelEndFallback:"Your subscription will be canceled at the end of the current billing period. You won't be charged again.",resumeChargeDate:"You will be charged again on",resumeChargeFallback:"the next billing date",resumeContinue:"Your subscription will continue automatically and you'll be billed according to your plan",resumeCancelAnytime:"You can cancel anytime before the next billing date if you change your mind",retainAccess:"You'll retain full access to this plan until",retainAccessFallback:"the end of your current billing period",noPlansAvailable:"No plan groups are available for this workspace. Please contact support if you believe this is an error.",noPlansAvailableHint:"No plan groups are available for this workspace.",startTrialDescription:"Try the full plan with no commitment. You can upgrade or cancel anytime.",noSubscriptionDescription:"Choose a plan to get started with your workspace",startFreeTrial:"Start Free Trial"},users:{title:"Workspace Members",adminOnly:"Only workspace admin can manage users and roles.",inviteByEmail:"Invite member by email",inviteButton:"Invite",inviting:"Inviting...",inviteSuccess:"User invited successfully",emailRequired:"Email is required",invalidEmail:"Invalid email address format",inviteFailed:"Failed to invite member",seatLimitReached:"Seat limit reached",memberLimitReached:"Member limit reached",role:"Role",you:"You",owner:"Owner",noMembers:"No members found in this workspace.",extraSeatCost:"Each additional member adds {price}/{interval, select, yearly {yr} quarterly {qtr} other {mo}} to your subscription",unknownUser:"Unknown User",seats:"Seats",members:"Members",included:"included",perExtraSeat:"/extra seat",maxMembers:"max members",available:"available",noMemberLimit:"No member limit",seatHeading:"{hasSeatPricing, select, true {Seats} other {Members}}",limitReached:"{reason, select, seat_limit_reached {Seat limit reached} other {Member limit reached}}",memberCount:"{count, plural, one {# member} other {# members}}",subscriptionRequired:"A subscription is required to invite members.",seatLimitMessage:"Your plan allows up to {maxUsers, number} members. Upgrade for more seats.",settingsLimitMessage:"This workspace allows up to {maxUsers, number} members.",memberLimitMessage:"Member limit of {maxUsers, number} reached.",selectRole:"Select a role",inviteAs:"Invite as {role}"},invoices:{title:"Billing History",description:"View and download your invoices",pay:"Pay",view:"View",viewDetails:"View Details",download:"PDF",errorLoading:"Error loading invoices",noInvoices:"No invoices yet. Subscribe to a plan to receive invoices.",noInvoicesWithSub:"No invoices with download option found",paidAmount:"Paid: {amount}",na:"N/A",status:{draft:"Draft",open:"Open",paid:"Paid",uncollectible:"Uncollectible",void:"Void"}},usage:{title:"Usage",description:"Monitor your resource consumption and quotas",totalResources:"Total Resources",overallUsage:"Overall Usage",inOverage:"In Overage",estOverageCost:"Est. Overage Cost",overageDetected:"Overage Detected",overageDescription:"Additional usage will be billed as overage on your next invoice.",overageUnits:"Overage units",rate:"Rate",billableBlocks:"Billable blocks",estimatedCharge:"Estimated charge",noData:"No quota usage data available for this workspace.",noDataHint:"Quotas will appear here once your plan includes metered resources.",used:"used",remaining:"remaining",overLimit:"over limit",percentUsed:"{percent, number}% used",availableRemaining:"{count} remaining",overLimitCount:"{count} over limit",overageWarning:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}} Additional usage will be billed as overage on your next invoice.",fullyUsed:"Fully used",renewingSoon:"renewing soon",almostFull:"Almost full",overage:"Overage",errorLoading:"Failed to load usage data",perUnit:"/ unit",perUnits:"/ units",rateDisplay:"{rate} {unitSize, plural, =1 {/ unit} other {/ {unitSize, number} units}}",resourcesExceeded:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}}",estOverageCharges:"Estimated overage charges this period: {amount}",overageRateDisplay:"Overage rate: {rate}",resetDateDisplay:"Usage resets on {date}",daysRemainingDisplay:"{count, plural, one {# day remaining} other {# days remaining}}"},profile:{email:"Email",name:"Name",language:"Language",country:"Country",currency:"Currency",timezone:"Timezone",profileImage:"Profile Image",success:"Profile saved successfully",nameMinLength:"Name must be at least 2 characters.",save:"Save",reset:"Reset"},general:{ownerOnly:"Only the workspace owner can change the workspace settings.",name:"Name",namePlaceholder:"My Awesome Workspace",nameMinLength:"Workspace name must be at least 2 characters.",billingCurrency:"Billing currency",icon:"Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",previewLabel:"Preview:",success:"Workspace settings saved successfully",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",updateWorkspace:"Update Workspace"},features:{title:"Workspace Features",ownerOnly:"Only the workspace owner can change the features.",noFeatures:"Workspace has no features to manage.",enabled:"enabled",disabled:"disabled",enabling:"Enabling",disabling:"Disabling",featureSuccess:"successfully",updateSuccess:"{feature} {enabled, select, true {enabled} other {disabled}} successfully",actionStatus:"{action, select, enabling {Enabling} disabling {Disabling} other {}}"},danger:{title:"Delete Workspace",adminOnly:"Only workspace admins can delete workspaces.",deleteWorkspace:"Delete Workspace",deleteConfirm:"Are you absolutely sure?",deleteWarning:"This action cannot be undone. This will permanently delete the workspace and all associated data.",deleting:"Deleting...",deleteDescription:"Once you delete a workspace, there is no going back. This will permanently delete the workspace and all of its data, including members, settings, and features.",deleteConfirmDescription:"This action cannot be undone. This will permanently delete the workspace and all of its data.",failedToDelete:"Failed to delete workspace"},notifications:{title:"Notification Preferences",permissionDenied:"Notification permission denied",notSupported:"Push notifications are not supported in this browser.",manageDescription:"Manage how you receive notifications from this workspace.",blocked:"Notifications Blocked",blockedDescription:"You previously blocked notifications for this site. To enable them, update your browser settings:",pushTitle:"Push Notifications",pushEnabledDescription:"You will receive browser notifications for important updates.",pushDisabledDescription:"Get notified about payment issues, trial expiry, and other important updates.",enabling:"Enabling...",disabling:"Disabling...",enable:"Enable",disable:"Disable",toggleAction:"{loading, select, true {{subscribed, select, true {Disabling...} other {Enabling...}}} other {{subscribed, select, true {Disable} other {Enable}}}}",pushDescription:"{subscribed, select, true {You will receive browser notifications for important updates.} other {Get notified about payment issues, trial expiry, and other important updates.}}",deviceNote:"Notifications are sent to this device. Enable on other devices separately.",unblock:{firefox:{step1:"Click the lock icon (or shield icon) in the address bar",step2:'Find "Notifications" in the permissions list',step3:'Change from "Blocked" to "Allow"',step4:"Reload this page"},safari:{step1:"Open Safari → Settings → Websites → Notifications",step2:"Find this website in the list",step3:'Change from "Deny" to "Allow"',step4:"Reload this page"},edge:{step1:"Click the lock icon in the address bar",step2:'Click "Permissions for this site"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"},chrome:{step1:"Click the lock icon (or tune icon) in the address bar",step2:'Click "Site settings"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"}}},quota:{includedOnly:"{count, number} included",includedWithOverage:"{count, number} included, then {price} / {unit}",unitFallback:"unit"},pricing:{title:"Choose Your Plan",description:"Compare plans and select the one that fits your needs",currency:"Currency",billingIn:"Billing in",noPlansCurrency:"No plans available for your billing currency.",noPlansCurrencyHint:"Something went wrong. Please contact support.",noPlans:"No plans available",free:"Free",included:"included",save:"Save",current:"Current",processing:"Processing...",unavailable:"Unavailable",selectCurrency:"Select billing currency",billingInterval:"Billing interval"},beta:{nameLabel:"Name",emailLabel:"Email",submitText:"Submit",submittingText:"Submitting...",errorMessage:"An error occurred",tryAgain:"Try Again",privacyConsent:"By submitting this form, you consent to our",privacyPolicy:"Privacy Policy",and:"and",termsOfService:"Terms of Service"},workspace:{switchTitle:"Switch Workspace",switchDescription:"Select a workspace to switch to or create a new one.",notLoggedIn:"Looks like you are not logged in. Please login to continue.",availableWorkspaces:"Available Workspaces ({count, number})",loadingWorkspaces:"Loading workspaces...",searchPlaceholder:"Search workspaces...",noWorkspacesFound:"No workspaces found",noWorkspacesAvailable:"No workspaces available",switchTo:"Switch to",membersCount:"{count, plural, one {# member} other {# members}}",createNew:"Create New Workspace",createTitle:"Create New Workspace",createDescription:"Create a new workspace to get started.",workspaceName:"Workspace Name",workspaceNamePlaceholder:"My Awesome Workspace",workspaceNameMinLength:"Workspace name must be at least 2 characters.",workspaceIcon:"Workspace Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",invalidUrl:"Please enter a valid URL",creating:"Creating...",createWorkspace:"Create Workspace"},dropdowns:{search:"Search...",chooseOption:"Choose option",chooseCountry:"Choose country",searchCountry:"Choose country...",chooseLanguage:"Choose language",searchLanguage:"Choose language...",chooseCurrency:"Choose currency",searchCurrency:"Choose currency...",chooseTimezone:"Choose timezone",searchTimezone:"Choose timezone..."},push:{failedToSubscribe:"Failed to subscribe to push notifications",failedToUnsubscribe:"Failed to unsubscribe from push notifications"},errors:{networkError:"Network error: Please check your internet connection",unauthorized:"Unauthorized - Please check your session",notFound:"Resource not found",generic:"An error occurred",fetchPlans:"Failed to fetch plans",fetchPlanGroup:"Failed to fetch plan group",fetchPlanGroupVersion:"Failed to fetch plan group version",fetchPlanGroupVersions:"Failed to fetch plan group versions",fetchSubscription:"Failed to fetch subscription",createCheckout:"Failed to create checkout session",updateSubscription:"Failed to update subscription",fetchInvoices:"Failed to fetch invoices",fetchInvoice:"Failed to fetch invoice",openBillingPortal:"Failed to open billing portal",cancelSubscription:"Failed to cancel subscription",resumeSubscription:"Failed to resume subscription",recordUsage:"Failed to record usage",fetchQuotaUsage:"Failed to fetch quota usage status",fetchAllQuotaUsage:"Failed to fetch all quota usage",fetchUsageLogs:"Failed to fetch usage logs"}},an={en:async()=>nn,es:async()=>(await Promise.resolve().then(function(){return fd})).es,fr:async()=>(await Promise.resolve().then(function(){return bd})).fr,de:async()=>(await Promise.resolve().then(function(){return xd})).de,ja:async()=>(await Promise.resolve().then(function(){return vd})).ja,zh:async()=>(await Promise.resolve().then(function(){return yd})).zh,hi:async()=>(await Promise.resolve().then(function(){return wd})).hi,ar:async()=>(await Promise.resolve().then(function(){return Sd})).ar},rn=["en","es","fr","de","ja","zh","hi","ar"];const sn={hi:"hi-u-nu-deva",ar:"ar-u-nu-arab"};const on=t.createContext({messages:nn,locale:"en",formattingLocale:"en"});function cn({locale:e="en",children:n}){const a=function(e){const t=e.toLowerCase().replace("_","-");if(rn.includes(t))return t;const n=t.split("-")[0];return rn.includes(n)?n:"en"}(e),[r,s]=t.useState(nn);t.useEffect(()=>{if("en"===a)return void s(nn);let e=!1;const t=an[a];return t&&t().then(t=>{e||s(t)}),()=>{e=!0}},[a]);const i=function(e){return sn[e]??e}(a),o=t.useMemo(()=>({messages:r,locale:a,formattingLocale:i}),[r,a,i]);return t.createElement(on.Provider,{value:o},n)}const ln=new Map,un=new Map,dn=new Map;function mn(e,t){return t?`${e}:${JSON.stringify(t)}`:e}const pn={getNumberFormat(e,t){const n=mn(e,t);let a=ln.get(n);return a||(a=new Intl.NumberFormat(e,t),ln.set(n,a)),a},getDateTimeFormat(e,t){const n=mn(e,t);let a=un.get(n);return a||(a=new Intl.DateTimeFormat(e,t),un.set(n,a)),a},getPluralRules(e,t){const n=mn(e,t);let a=dn.get(n);return a||(a=new Intl.PluralRules(e,t),dn.set(n,a)),a}},hn=new Map;function gn(){const{messages:e,locale:n,formattingLocale:a}=t.useContext(on),r=t.useMemo(()=>(t,n)=>{const r=t.split(".");let s=e;for(const e of r){if(!s||"object"!=typeof s||!(e in s))return t;s=s[e]}const i="string"==typeof s?s:t;if(!n)return i;try{const e=function(e,t){const n=`${t}:${e}`;let a=hn.get(n);return a||(a=new tn(e,t,void 0,{formatters:pn}),hn.set(n,a)),a}(i,a),t=e.format(n);return"string"==typeof t?t:String(t)}catch{return i.replace(/\{(\w+)\}/g,(e,t)=>String(n[t]??`{${t}}`))}},[e,a]),s="ar"===n?"rtl":"ltr",i=t.useMemo(()=>e=>e.toLocaleString(a),[a]),o=t.useMemo(()=>(e,t)=>{const n=(t??"").trim().toUpperCase();if(!n)return(e/100).toLocaleString(a,{minimumFractionDigits:2});try{return new Intl.NumberFormat(a,{style:"currency",currency:n,minimumFractionDigits:2}).format(e/100)}catch{return(e/100).toLocaleString(a,{minimumFractionDigits:2})}},[a]);return{t:r,locale:n,formattingLocale:a,dir:s,fmtNum:i,fmtCents:o,messages:e}}function fn(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return W(t,{component:"storage",action:"getStorageItem",metadata:{key:e}}),null}}function bn(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){W(t,{component:"storage",action:"setStorageItem",metadata:{key:e}})}}function xn(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){W(t,{component:"storage",action:"removeStorageItem",metadata:{key:e}})}}const vn="saas-session-id",yn="code";function wn(e){bn(vn,e)}function Sn(){return function(){if("undefined"==typeof window)return null;try{return fn(vn)}catch(e){return W(e,{component:"auth-utils",action:"getSessionId",metadata:{key:vn}}),null}}()}function kn(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(yn)}catch(e){return W(e,{component:"auth-utils",action:"getTokenFromUrl",metadata:{param:yn}}),null}}const Nn="SDK is not ready (missing serverUrl, version, or orgId)";class jn{constructor(e){this.serverUrl=e.serverUrl,this.version=e.version,this.orgId=e.orgId,this.requireOrgId=e.requireOrgId??!1,this.basePath=e.basePath??"public",this._sessionId=e.sessionId,this._timeout=e.timeout??3e4,this._maxRetries=e.maxRetries??0,this._debug=e.debug??!1,this._customHeaders=e.headers??{},this._onError=e.onError,this._fetch=e.fetch??globalThis.fetch}ensureReady(){if(!this.serverUrl?.trim()||!this.version)throw new Error(Nn);if(this.requireOrgId&&!this.orgId?.trim())throw new Error(Nn)}get baseUrl(){return this.ensureReady(),`${this.serverUrl}/api/${this.version}/${this.basePath}`}getAuthHeaders(){return this._sessionId?{"x-session-id":this._sessionId}:function(){const e=Sn(),t={};return e&&(t["x-session-id"]=e),t}()}url(e){const t=e.startsWith("/")?e.slice(1):e;return`${this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl}/${t}`}buildHeaders(e){const t={...this._customHeaders,...this.getAuthHeaders()};return e.headers&&Object.assign(t,e.headers),null==e.body||t["Content-Type"]||(t["Content-Type"]="application/json"),t}async executeFetch(e,t){const n=this.url(e),a=(t.method??"GET").toUpperCase(),r=this.buildHeaders(t),s={...t,headers:r};let i;if(this._timeout>0){const e=new AbortController;i=setTimeout(()=>e.abort(),this._timeout),s.signal=t.signal?AbortSignal.any([t.signal,e.signal]):e.signal}const o=async t=>{try{const e=this._fetch.bind(globalThis),r=await e(n,s);if(this._debug&&console.log(`[BuildBase] ${a} ${n} → ${r.status}`),r.status>=500&&t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}return r}catch(n){if(n instanceof Error&&"AbortError"===n.name){if(void 0!==i){const t=new Error(`Request timeout after ${this._timeout}ms: ${a} ${e}`);throw this._onError?.(t,{method:a,path:e}),t}throw n}if(t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Network error, retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}throw n instanceof Error&&this._onError?.(n,{method:a,path:e}),n}};try{return await o(0)}finally{void 0!==i&&clearTimeout(i)}}async fetchJson(e,t={},n="Request failed"){this.ensureReady();try{const a=await this.executeFetch(e,t);return await B(a,n)}catch(n){throw n instanceof Error&&this._onError?.(n,{method:(t.method??"GET").toUpperCase(),path:e}),n}}async fetchResponse(e,t={}){return this.ensureReady(),this.executeFetch(e,t)}}class An extends jn{constructor(e){super({...e,requireOrgId:!0})}async getWorkspaces(){return this.fetchJson("workspaces",{},"Failed to fetch workspaces")}async createWorkspace(e){return this.fetchJson("workspaces",{method:"POST",body:JSON.stringify(e)},"Failed to create workspace")}async updateWorkspace(e,t){return this.fetchJson(`workspaces/${e}`,{method:"PUT",body:JSON.stringify(t)},"Failed to update workspace")}async deleteWorkspace(e){return this.fetchJson(`workspaces/${e}`,{method:"DELETE"},"Failed to delete workspace")}async getWorkspaceUsers(e){return this.fetchJson(`workspaces/${e}/users`,{},"Failed to fetch workspace users")}async addUser(e,t){return this.fetchJson(`workspaces/${e}/users/add`,{method:"POST",body:JSON.stringify(t)},"Failed to invite member")}async removeUser(e,t){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"DELETE"},"Failed to remove user")}async updateUser(e,t,n){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"PATCH",body:JSON.stringify(n)},"Failed to update user")}async getFeatures(){return this.fetchJson("workspaces/features",{},"Failed to fetch features")}async updateFeature(e,t,n){return this.fetchJson(`workspaces/${e}/features`,{method:"PATCH",body:JSON.stringify({features:{[t]:n}})},"Failed to update feature")}async getWorkspace(e){return this.fetchJson(`workspaces/${e}`,{},"Failed to fetch workspace")}async getProfile(){return this.fetchJson("profile",{},"Failed to fetch profile")}async updateUserProfile(e){return this.fetchJson("profile",{method:"PATCH",body:JSON.stringify(e)},"Failed to update user profile")}async getCurrentSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription`);if(!t.ok){let e="Failed to fetch subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const n=await t.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch subscription");return n.data||n}return n}async getPlanGroup(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group`);if(!t.ok){let e="Failed to fetch plan group";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group found for this workspace":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group (${t.status}: ${t.statusText})`}throw new Error(e)}const n=await t.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch plan group");return n.data||n}return n}async getPlanGroupByVersion(e,t){const n=await this.fetchResponse(`workspaces/${e}/subscription/plan-group?groupVersionId=${encodeURIComponent(t)}`);if(!n.ok){let e="Failed to fetch plan group version";try{e=(await n.json()).message||e}catch{e=404===n.status?"Plan group version not found":401===n.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${n.status}: ${n.statusText})`}throw new Error(e)}const a=await n.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to fetch plan group version");return a.data||a}return a}async getPlanGroupVersions(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group/versions`);if(!t.ok){let e="Failed to fetch plan group versions";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group versions found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group versions (${t.status}: ${t.statusText})`}throw new Error(e)}const n=await t.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch plan group versions");return n.data||n}return n}async getPublicPlans(e){if(!this.orgId)throw new Error("orgId is required for getPublicPlans");const t=await this.fetchResponse(`${this.orgId}/plans/${encodeURIComponent(e)}`);if(!t.ok){let n="Failed to fetch plans";try{n=(await t.json()).message||n}catch{n=404===t.status?`Plans "${e}" not found`:`Failed to fetch plans (${t.status}: ${t.statusText})`}throw new Error(n)}const n=await t.json();if(void 0!==n.success&&!n.success)throw new Error(n.message||"Failed to fetch plans");return n.data??n}async getPlanGroupVersion(e){const t=await this.fetchResponse(`plan-group-versions/${e}`);if(!t.ok){let e="Failed to fetch plan group version";try{e=(await t.json()).message||e}catch{e=404===t.status?"Plan group version not found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${t.status}: ${t.statusText})`}throw new Error(e)}const n=await t.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch plan group version");return n.data||n}return n}async createCheckoutSession(e,t){const n=await this.fetchResponse(`workspaces/${e}/subscription/checkout`,{method:"POST",body:JSON.stringify(t)});if(!n.ok){let e="Failed to create checkout session";try{e=(await n.json()).message||e}catch{e=`Failed to create checkout session (${n.status}: ${n.statusText})`}throw new Error(e)}const a=await n.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to create checkout session");return a.data||a}return a}async updateSubscription(e,t){const n=await this.fetchResponse(`workspaces/${e}/subscription`,{method:"PATCH",body:JSON.stringify(t)});if(!n.ok){let e="Failed to update subscription";try{e=(await n.json()).message||e}catch{e=`Failed to update subscription (${n.status}: ${n.statusText})`}throw new Error(e)}const a=await n.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to update subscription");return a.data?.checkoutUrl||a.checkoutUrl,a.data||a}return a.checkoutUrl,a}async createBillingPortalSession(e,t){return this.fetchJson(`workspaces/${e}/subscription/billing-portal`,{method:"POST",body:JSON.stringify(t?{returnUrl:t}:{})})}async listInvoices(e,t=10,n){const a=new URLSearchParams;a.append("limit",t.toString()),n&&a.append("starting_after",n);const r=await this.fetchResponse(`workspaces/${e}/subscription/invoices?${a.toString()}`,{});if(!r.ok){let e="Failed to fetch invoices";try{e=(await r.json()).message||e}catch{e=404===r.status?"Workspace not found or no invoices available":401===r.status?"Unauthorized - Please check your session":`Failed to fetch invoices (${r.status}: ${r.statusText})`}throw new Error(e)}const s=await r.json();if(void 0!==s.success){if(!s.success)throw new Error(s.message||"Failed to fetch invoices");return s}return s}async getInvoice(e,t){const n=await this.fetchResponse(`workspaces/${e}/subscription/invoices/${t}`,{});if(!n.ok){let e="Failed to fetch invoice";try{e=(await n.json()).message||e}catch{e=404===n.status?"Invoice not found":401===n.status?"Unauthorized - Please check your session":`Failed to fetch invoice (${n.status}: ${n.statusText})`}throw new Error(e)}const a=await n.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to fetch invoice");return a}return a}async cancelSubscriptionAtPeriodEnd(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/cancel-at-period-end`,{method:"POST"});if(!t.ok){let e="Failed to cancel subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to cancel subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const n=await t.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to cancel subscription");return n.data||n}return n}async resumeSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/resume`,{method:"POST"});if(!t.ok){let e="Failed to resume subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to resume subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const n=await t.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to resume subscription");return n.data||n}return n}async recordUsage(e,t){const n=await this.fetchResponse(`workspaces/${e}/subscription/usage`,{method:"POST",body:JSON.stringify(t)});if(!n.ok){let e="Failed to record usage";try{e=(await n.json()).message||e}catch{e=`Failed to record usage (${n.status}: ${n.statusText})`}throw new Error(e)}const a=await n.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to record usage");return a.data||a}return a}async recordUsageBatch(e,t){const n=await this.fetchResponse(`workspaces/${e}/subscription/usage/batch`,{method:"POST",body:JSON.stringify(t)});if(!n.ok){let e="Failed to record batch usage";try{e=(await n.json()).message||e}catch{e=`Failed to record batch usage (${n.status}: ${n.statusText})`}throw new Error(e)}const a=await n.json();return a.data||a}async getQuotaUsageStatus(e,t){const n=await this.fetchResponse(`workspaces/${e}/subscription/usage/status?quotaSlug=${encodeURIComponent(t)}`);if(!n.ok){let e="Failed to fetch quota usage status";try{e=(await n.json()).message||e}catch{e=404===n.status?"Workspace not found or no subscription available":401===n.status?"Unauthorized - Please check your session":`Failed to fetch quota usage status (${n.status}: ${n.statusText})`}throw new Error(e)}const a=await n.json();if(void 0!==a.success){if(!a.success)throw new Error(a.message||"Failed to fetch quota usage status");return a.data||a}return a}async getAllQuotaUsage(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/usage/all`);if(!t.ok){let e="Failed to fetch all quota usage";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch all quota usage (${t.status}: ${t.statusText})`}throw new Error(e)}const n=await t.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch all quota usage");return n.data||n}return n}async getUsageLogs(e,t){const n=new URLSearchParams;t?.quotaSlug&&n.append("quotaSlug",t.quotaSlug),t?.from&&n.append("from",t.from),t?.to&&n.append("to",t.to),t?.source&&n.append("source",t.source),t?.page&&n.append("page",t.page.toString()),t?.limit&&n.append("limit",t.limit.toString());const a=n.toString(),r=`workspaces/${e}/subscription/usage/logs${a?`?${a}`:""}`,s=await this.fetchResponse(r);if(!s.ok){let e="Failed to fetch usage logs";try{e=(await s.json()).message||e}catch{e=404===s.status?"Workspace not found":401===s.status?"Unauthorized - Please check your session":`Failed to fetch usage logs (${s.status}: ${s.statusText})`}throw new Error(e)}const i=await s.json();if(void 0!==i.success){if(!i.success)throw new Error(i.message||"Failed to fetch usage logs");return i.data||i}return i}}function Cn(){const e=ce(),n=ve(),a=Le();return t.useMemo(()=>({auth:e,os:n,workspaces:a}),[e,n,a])}function En(e,n,a){t.useEffect(()=>{const t=new AbortController;return e(t.signal).catch(e=>{z(e)||(a?.onError?a.onError(e):W(e,{component:"useAsyncEffect",action:"effect",metadata:{note:"Unhandled rejection - consider passing onError"}}))}),()=>t.abort()},n)}class Tn extends jn{constructor(e){super({...e,requireOrgId:!0})}async getSettings(e){return this.fetchJson(`${this.orgId}/settings`,{signal:e},"Failed to fetch settings")}}function Pn(){return Be(e=>e.os)}let _n=null;function Un(){const e=Cn(),n=Pn(),{serverUrl:a,version:r,orgId:s,settings:i}=n,o=t.useMemo(()=>me(n)?new Tn({serverUrl:a,version:r,orgId:s}):null,[a,r,s]),c=t.useCallback(async t=>o?_n||(_n=(async()=>{try{const n=await o.getSettings(t);return e.os(ue(n)),n}catch(e){return H(e,{component:"useSaaSSettings",action:"getSettings",metadata:{serverUrl:a,version:r,orgId:s}}),null}finally{_n=null}})(),_n):null,[o,e,a,r,s]);return En(async e=>{i||me(n)&&await c(e)},[a,r,s],{onError:e=>H(e,{component:"useSaaSSettings",action:"fetchSettings",metadata:{serverUrl:a,version:r,orgId:s}})}),t.useMemo(()=>({settings:i,getSettings:c}),[i,c])}function In(){const e=Pn(),n=function(e){return t.useMemo(()=>new An(e),[e.serverUrl,e.version,e.orgId])}(e);return t.useMemo(()=>({os:e,api:n}),[e,n])}function Dn(e,t,n){return e instanceof Error?e.message:n(t)}const Rn=e=>{const{t:n}=gn(),{os:a,api:r}=In(),s=me(a),[i,o]=t.useState(null),[c,l]=t.useState(!1),[u,d]=t.useState(null),m=t.useCallback(async()=>{if(e&&s){l(!0),d(null);try{const t=await r.getPublicPlans(e);o(t)}catch(t){const a=Dn(t,"errors.fetchPlans",n);d(a),W(t,{component:"usePublicPlans",action:"fetchPlans",metadata:{slug:e}})}finally{l(!1)}}else o(null)},[r,e,s]);t.useEffect(()=>{m()},[m]);const p=e&&!s||c;return{items:i?.items??[],plans:i?.plans??[],notes:i?.notes,loading:p,error:u,refetch:m}},zn=e=>{const{t:n}=gn(),{api:a}=In(),[r,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await a.getCurrentSubscription(e);s(t)}catch(t){const a=Dn(t,"errors.fetchSubscription",n);l(a),W(t,{component:"useSubscription",action:"fetchSubscription",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[a,e]);return t.useEffect(()=>{u()},[u]),{subscription:r,loading:i,error:c,refetch:u}},Ln=(e,n)=>{const{t:a}=gn(),{api:r}=In(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e){c(!0),u(null);try{const t=n?await r.getPlanGroupByVersion(e,n):await r.getPlanGroup(e);i(t)}catch(t){const r=Dn(t,"errors.fetchPlanGroup",a);u(r),W(t,{component:"usePlanGroup",action:"fetchPlanGroup",metadata:{workspaceId:e,groupVersionId:n}})}finally{c(!1)}}else i(null)},[r,e,n]);return t.useEffect(()=>{d()},[d]),{planGroup:s,loading:o,error:l,refetch:d}},Mn=e=>{const{t:n}=gn(),{api:a}=In(),[r,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await a.getPlanGroupVersions(e);s(t)}catch(t){const a=Dn(t,"errors.fetchPlanGroupVersions",n);l(a),W(t,{component:"usePlanGroupVersions",action:"fetchVersions",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[a,e]);return t.useEffect(()=>{u()},[u]),{versions:r,loading:i,error:c,refetch:u}},Bn=e=>{const{t:n}=gn(),{api:a}=In(),[r,s]=t.useState(!1),[i,o]=t.useState(null);return{createCheckoutSession:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const n=await a.createCheckoutSession(e,t);return"trial_started"===n.type&&(He(),Fe()),n}catch(a){const r=Dn(a,"errors.createCheckout",n);throw o(r),W(a,{component:"useCreateCheckoutSession",action:"createCheckoutSession",metadata:{workspaceId:e,request:t}}),a}finally{s(!1)}},[a,e]),loading:r,error:i}},On=e=>{const{t:n}=gn(),{api:a}=In(),[r,s]=t.useState(!1),[i,o]=t.useState(null);return{updateSubscription:t.useCallback(async(t,r)=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const n={planVersionId:t,...r?.billingInterval&&{billingInterval:r.billingInterval},...r?.successUrl&&{successUrl:r.successUrl},...r?.cancelUrl&&{cancelUrl:r.cancelUrl}},s=await a.updateSubscription(e,n);return He(),s}catch(a){const s=Dn(a,"errors.updateSubscription",n);throw o(s),W(a,{component:"useUpdateSubscription",action:"updateSubscription",metadata:{workspaceId:e,planVersionId:t,options:r}}),a}finally{s(!1)}},[a,e]),loading:r,error:i}},Fn=(e,n)=>{const a=zn(e),r=Ln(e,n),s=On(e),i=t.useCallback(async()=>{await Promise.all([a.refetch(),r.refetch()])},[a.refetch,r.refetch]);return{subscription:a.subscription,planGroup:r.planGroup,loading:a.loading||r.loading||s.loading,error:a.error||r.error||s.error,updateSubscription:s.updateSubscription,refetch:i}},Wn=(e,n=10,a)=>{const{t:r}=gn(),{api:s}=In(),[i,o]=t.useState([]),[c,l]=t.useState(!1),[u,d]=t.useState(!1),[m,p]=t.useState(null),h=t.useCallback(async()=>{if(!e)return o([]),void l(!1);d(!0),p(null);try{const t=await s.listInvoices(e,n,a);o(t.invoices||[]),l(t.has_more||!1)}catch(t){const s=Dn(t,"errors.fetchInvoices",r);p(s),W(t,{component:"useInvoices",action:"fetchInvoices",metadata:{workspaceId:e,limit:n,startingAfter:a}})}finally{d(!1)}},[s,e,n,a]);return t.useEffect(()=>{h()},[h]),{invoices:i,hasMore:c,loading:u,error:m,refetch:h}},Hn=e=>{const{t:n}=gn(),{api:a}=In(),[r,s]=t.useState(!1),[i,o]=t.useState(null);return{openBillingPortal:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const n=t||window.location.href,r=await a.createBillingPortalSession(e,n);return r.url&&window.open(r.url,"_blank","noopener,noreferrer"),r}catch(t){const a=Dn(t,"errors.openBillingPortal",n);throw o(a),W(t,{component:"useBillingPortal",action:"openBillingPortal",metadata:{workspaceId:e}}),t}finally{s(!1)}},[e,a]),loading:r,error:i}},Gn=e=>{const{t:n}=gn(),{api:a}=In(),[r,s]=t.useState(!1),[i,o]=t.useState(null);return{cancelSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const t=await a.cancelSubscriptionAtPeriodEnd(e);return He(),t}catch(t){const a=Dn(t,"errors.cancelSubscription",n);throw o(a),W(t,{component:"useCancelSubscription",action:"cancelSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[a,e]),loading:r,error:i}},$n=e=>{const{t:n}=gn(),{api:a}=In(),[r,s]=t.useState(!1),[i,o]=t.useState(null);return{resumeSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const t=await a.resumeSubscription(e);return He(),t}catch(t){const a=Dn(t,"errors.resumeSubscription",n);throw o(a),W(t,{component:"useResumeSubscription",action:"resumeSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[a,e]),loading:r,error:i}},Vn=e=>{const{t:n}=gn(),{api:a}=In(),[r,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await a.getAllQuotaUsage(e);s(t.quotas)}catch(t){const a=Dn(t,"errors.fetchAllQuotaUsage",n);l(a),W(t,{component:"useAllQuotaUsage",action:"fetchAllUsage",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[a,e]);return t.useEffect(()=>{u()},[u]),{quotas:r,loading:i,error:c,refetch:u}},Kn=t.createContext(null);Kn.displayName="SubscriptionContext";const Zn=t.memo(function({children:n}){const a=Be(e=>e.workspaces.currentWorkspace),{subscription:r,loading:s,error:i,refetch:o}=zn(a?._id);t.useEffect(()=>{return e=o,We.add(e),()=>{We.delete(e)};var e},[o]);const c=t.useMemo(()=>({response:r,loading:s,error:i,refetch:o}),[r,s,i,o]);return e.jsx(Kn.Provider,{value:c,children:n})});function qn(){const e=t.useContext(Kn);if(null===e)throw new Error("useSubscriptionContext must be used within SubscriptionContextProvider. Make sure SubscriptionContextProvider is wrapping your application (or the tree that uses subscription gates).");return e}Zn.displayName="SubscriptionContextProvider";const Jn={Monthly:"monthly",Yearly:"yearly",Quarterly:"quarterly"},Yn="active",Qn="trialing",Xn="canceled",ea="past_due",ta="paused",na="draft",aa="open",ra="paid",sa="uncollectible",ia="void",oa="feature",ca="limit",la="quota",ua="none",da="final",ma="suspended";function pa(e,t){const n=e.pricingVariants;if(!n?.length)return null;const a=t.toLowerCase();return n.find(e=>e.currency?.toLowerCase()===a)??null}function ha(e,t,n){const a=pa(e,t);if(!a?.basePricing)return null;const r=a.basePricing[n];return null!=r?r:null}function ga(e,t,n,a){const r=pa(e,t),s=r?.quotaOverages?.[n];if(s)return s[a]}function fa(e,t,n,a){const r=e.quotas?.[n];if(null==r)return null;const s=r[a];if(!s)return null;const i=ga(e,t,n,a);return{included:s.included,...void 0!==s.unitSize&&{unitSize:s.unitSize},...void 0!==i&&{overage:i}}}function ba(e,t){if(!e)return null;for(const n of t){const t=n.pricingVariants;if(t?.length)for(const n of t){const t=n.stripePrices;if(t){if(t.monthlyPriceId===e||t.monthly===e)return{interval:"monthly",currency:n.currency};if(t.yearlyPriceId===e||t.yearly===e)return{interval:"yearly",currency:n.currency};if(t.quarterlyPriceId===e)return{interval:"quarterly",currency:n.currency}}}}return null}function xa(e,t){const n=pa(e,t);return n?.seatPricing?.enabled?n.seatPricing:null}function va(e,t,n){const a=xa(e,t);return a?.perSeat?a.perSeat[n]??null:null}function ya(e){const{planVersion:t,currency:n="usd",settingsMaxUsers:a}=e;if(t){const e=xa(t,n);if(e)return{maxUsers:e.maxSeats??0,source:"seat_pricing",includedSeats:e.includedSeats??0,hasSeatPricing:!0}}return null!=a&&a>0?{maxUsers:a,source:"settings",includedSeats:0,hasSeatPricing:!1}:{maxUsers:0,source:"none",includedSeats:0,hasSeatPricing:!1}}function wa(e){const{memberCount:t,maxUsersConfig:n,hasSubscription:a=!0,requireSubscription:r=!1}=e;if(r&&!a)return{canInvite:!1,blockReason:"no_subscription",blockMessageKey:"users.subscriptionRequired",blockMessageValues:{}};const{maxUsers:s,source:i}=n;if(s<=0)return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null};if(t>=s){return{canInvite:!1,blockReason:{seat_pricing:"seat_limit_reached",settings:"settings_user_limit_reached"}[i]??"seat_limit_reached",blockMessageKey:{seat_pricing:"users.seatLimitMessage",settings:"users.settingsLimitMessage"}[i]??"users.memberLimitMessage",blockMessageValues:{maxUsers:s}}}return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null}}const Sa="user:created",ka="user:updated",Na="workspace:changed",ja="workspace:updated",Aa="workspace:user-added",Ca="workspace:user-removed",Ea="workspace:user-role-changed",Ta="workspace:created",Pa="workspace:deleted";const _a=new class{constructor(){this.callbacks=null}setCallbacks(e){this.callbacks=e}getCallbacks(){return this.callbacks}async emit(e,t){if(this.callbacks?.handleEvent)try{await this.callbacks.handleEvent(e,t)}catch(t){W(t,{component:"EventEmitter",action:"emit",metadata:{eventType:e}})}}async emitUserCreated(e){await this.emit(Sa,{user:e})}async emitUserUpdated(e,t){await this.emit(ka,{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit(Na,{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit(ja,{workspace:e})}async emitWorkspaceUserAdded(e,t,n){await this.emit(Aa,{userId:e,workspace:t,role:n})}async emitWorkspaceUserRemoved(e,t,n){await this.emit(Ca,{userId:e,workspace:t,role:n})}async emitWorkspaceUserRoleChanged(e,t,n,a){await this.emit(Ea,{userId:e,workspace:t,previousRole:n,newRole:a})}async emitWorkspaceCreated(e){await this.emit(Ta,{workspace:e})}async emitWorkspaceDeleted(e){await this.emit(Pa,{workspace:e})}},Ua="saas-workspace-current",Ia=e=>{e?bn(Ua,e._id):xn(Ua)},Da=()=>fn(Ua),Ra=()=>{xn(Ua)},za=(e,t)=>!!e&&t.some(t=>t._id===e);function La(e,t){if(!t)return!1;const n=(a=e.createdBy)?"string"==typeof a?a:"object"==typeof a&&"_id"in a&&"string"==typeof a._id?a._id:null:null;var a;return null!==n&&n===t}function Ma(e,t){if(!t||!e.users||!Array.isArray(e.users))return null;const n=e.users.find(e=>"string"==typeof e?e===t:"object"==typeof e&&null!==e&&"_id"in e&&e._id===t);return n&&"object"==typeof n&&"role"in n&&"string"==typeof n.role?n.role:null}const Ba=()=>{const e=Cn(),{os:n,api:a}=In(),{settings:r}=Un(),s=Be(e=>e.workspaces),i=Be(e=>e.auth.session?.user),o=t.useCallback((t,n)=>{if((!(t._id===s.currentWorkspace?._id)||n?.forceEmit)&&t){const n=s.currentWorkspace;Ia(t),e.workspaces(je(t)),_a.emitWorkspaceChanged(t,n).catch(e=>{W(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceChanged",metadata:{workspaceId:t._id}})})}},[s.currentWorkspace,e]),c=t.useCallback(async(t,a)=>{const r=++m.current;e.workspaces(_e(t._id));try{const e=n.auth?.callbacks?.onWorkspaceChange;if(e){const n=Ma(t,i?.id);try{await e({workspace:t,user:i??null,role:n})}catch(e){throw W(e,{component:"useSaaSWorkspaces",action:"onWorkspaceChange",metadata:{workspaceId:t._id}}),e}if(r!==m.current)return}o(t,a)}finally{r===m.current&&e.workspaces(_e(null))}},[e,n.auth?.callbacks?.onWorkspaceChange,o,i]);t.useEffect(()=>{if(!s.isInitialized){const t=Da();if(e.workspaces(Ce(!0)),t){const e=s.workspaces.find(e=>e._id===t);e&&c(e,{forceEmit:!0}).catch(()=>{})}}},[s.isInitialized,s.workspaces,s.currentWorkspace,e,c]);const l=t.useCallback(()=>{Ra(),e.workspaces(Ae())},[e]),u=t.useRef(!1),d=t.useRef(!1),m=t.useRef(0),p=t.useCallback(async()=>{if(!s.loading&&!u.current){u.current=!0,e.workspaces(Ee(!0)),e.workspaces(Te(null));try{const t=await a.getWorkspaces();if(e.workspaces(ye(t)),t.length>0){const e=Da();if(e&&za(e,t)){const n=t.find(t=>t._id===e);if(n)try{await c(n,{forceEmit:!0})}catch{}}else{const e=t[0];try{await c(e,{forceEmit:!0})}catch{}}}}catch(t){e.workspaces(Te(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(Ee(!1)),u.current=!1}}},[a,s.loading,e,c]),h=t.useCallback(async()=>{if(!s.refreshing&&!u.current){u.current=!0,e.workspaces(Pe(!0));try{const t=await a.getWorkspaces();e.workspaces(ye(t))}catch(e){}finally{e.workspaces(Pe(!1)),u.current=!1}}},[a,s.refreshing,e]),g=t.useCallback(async(t,n)=>{const r=await a.createWorkspace({name:t,image:n});e.workspaces(we(r)),_a.emitWorkspaceCreated(r).catch(e=>{W(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:r._id}})})},[a,e]),f=t.useCallback(async(t,n)=>{const r=await a.updateWorkspace(t._id,n);e.workspaces(Se(r)),_a.emitWorkspaceUpdated(r).catch(e=>{W(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceUpdated",metadata:{workspaceId:r._id}})})},[a,e]),b=t.useCallback(async()=>{if(d.current)return s.allFeatures.length>0?s.allFeatures:null;if(s.allFeatures.length>0)return s.allFeatures;d.current=!0;try{const t=await a.getFeatures();return e.workspaces(Ne(t)),t}catch(e){return W(e,{component:"useSaaSWorkspaces",action:"getFeatures"}),null}finally{d.current=!1}},[a,e,s.allFeatures]),x=t.useCallback(async(e,t,n)=>await a.updateFeature(e,t,n),[a]);t.useEffect(()=>{if(!s.currentWorkspace?._id||0===s.workspaces.length)return;const t=s.currentWorkspace._id,n=s.workspaces.find(e=>e._id===t);if(n)n!==s.currentWorkspace&&(Ia(n),e.workspaces(je(n)));else if(s.workspaces.length>0){const e=s.workspaces[0];e._id!==t&&c(e).catch(()=>{})}},[s.workspaces,s.currentWorkspace,e,c]);const v=t.useCallback(async e=>await a.getWorkspaceUsers(e),[a]),y=t.useCallback(async(e,t,n)=>{const i=s.workspaces.find(t=>t._id===e);if(i){const e=ya({settingsMaxUsers:r?.workspace?.maxWorkspaceUsers}),t=wa({memberCount:i.users?.length??0,maxUsersConfig:e});if(!t.canInvite)throw new Error(t.blockMessageKey||"users.memberLimitReached")}const o=await a.addUser(e,{email:t,role:n});return i&&_a.emitWorkspaceUserAdded(o.userId,i,n).catch(t=>{W(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:n}})}),h().catch(()=>{}),He(),o},[a,s.workspaces,h,r]),w=t.useCallback(async(e,t)=>{const n=s.workspaces.find(t=>t._id===e);if(n&&La(n,t))throw new Error("Cannot remove the workspace owner");const r=(await a.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t),i=await a.removeUser(e,t);if(n&&r){const t=r.role;_a.emitWorkspaceUserRemoved(i.userId,n,t).catch(n=>{W(n,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:i.userId,role:t}})})}return h().catch(()=>{}),He(),i},[a,s.workspaces,h]),S=t.useCallback(async(e,t,n)=>{if(n.role){const n=s.workspaces.find(t=>t._id===e);if(n&&La(n,t))throw new Error("Cannot change the role of the workspace owner")}let r;if(n.role){const n=(await a.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t);r=n?.role}const i=await a.updateUser(e,t,n);return n.role&&r&&r!==n.role&&_a.emitWorkspaceUserRoleChanged(i.userId,i.workspace,r,n.role).catch(a=>{W(a,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRoleChanged",metadata:{workspaceId:e,userId:t,previousRole:r,newRole:n.role}})}),i},[a,s.workspaces]),k=t.useCallback(async e=>{const t=await a.getProfile().catch(()=>null),n=await a.updateUserProfile(e);return _a.emitUserUpdated(n,t||void 0).catch(e=>{W(e,{component:"useSaaSWorkspaces",action:"emitUserUpdated",metadata:{userId:n._id}})}),n},[a]),N=t.useCallback(async()=>await a.getProfile(),[a]),j=t.useCallback(async e=>await a.getWorkspace(e),[a]),A=t.useCallback(async t=>{if(!i)throw new Error("User must be authenticated to delete a workspace");const n=s.workspaces.find(e=>e._id===t);if(!n)throw new Error("Workspace not found");if(!La(n,i.id))throw new Error("Only the workspace creator can delete the workspace");const r=await a.deleteWorkspace(t);return e.workspaces(ke(t)),s.currentWorkspace?._id===t&&(Ra(),e.workspaces(Ae())),n&&_a.emitWorkspaceDeleted(n).catch(e=>{W(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceDeleted",metadata:{workspaceId:t}})}),r},[a,s.workspaces,s.currentWorkspace,e,i]);return{workspaces:s.workspaces,loading:s.loading,error:s.error,fetchWorkspaces:p,refreshWorkspaces:h,refreshing:s.refreshing,currentWorkspace:s.currentWorkspace,setCurrentWorkspace:o,switchToWorkspace:c,resetCurrentWorkspace:l,createWorkspace:g,allFeatures:s.allFeatures,getFeatures:b,updateFeature:x,getWorkspace:j,updateWorkspace:f,getUsers:v,addUser:y,removeUser:w,updateUser:S,getProfile:N,updateUserProfile:k,deleteWorkspace:A,switching:null!==s.switchingToId,switchingToId:s.switchingToId}},Oa=t.createContext(null);Oa.displayName="QuotaUsageContext";const Fa=t.memo(function({children:n}){const{currentWorkspace:a}=Ba(),{quotas:r,loading:s,error:i,refetch:o}=Vn(a?._id);t.useEffect(()=>{return e=o,Oe.add(e),()=>{Oe.delete(e)};var e},[o]);const c=t.useMemo(()=>({quotas:r,loading:s,error:i,refetch:o}),[r,s,i,o]);return e.jsx(Oa.Provider,{value:c,children:n})});function Wa(){const e=t.useContext(Oa);if(null===e)throw new Error("useQuotaUsageContext must be used within QuotaUsageContextProvider. Make sure QuotaUsageContextProvider is wrapping your application (or the tree that uses quota gates).");return e}Fa.displayName="QuotaUsageContextProvider";class Ha extends jn{constructor(e){super(e)}async requestAuth(e){const t=`${this.serverUrl}/api/${this.version}/auth/request`,n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok){let e="Failed to initiate authentication";try{e=(await n.json()).message||e}catch{e=`Failed to initiate authentication (${n.status}: ${n.statusText})`}throw new Error(e)}return n.json()}async getProfile(e,t){return this.fetchJson("profile",{headers:{"x-session-id":e},signal:t},"Failed to fetch user profile")}}function Ga(e,t="/"){const n=function(e){if(!e||"string"!=typeof e)return null;try{const t=new URL(e);return"https:"===t.protocol?e:"http:"!==t.protocol||"localhost"!==t.hostname&&"127.0.0.1"!==t.hostname&&"::1"!==t.hostname?null:e}catch{return null}}(e);window.location.href=n||t}const $a=c.cva("inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"underline-offset-4 hover:underline text-primary"},withIcon:{true:"flex"},fullWidth:{true:"w-full"},size:{default:"h-9 py-2 px-4 text-sm",sm:"h-8 px-3 text-xs",lg:"h-10 px-6 text-base",icon:"h-9 w-9"}},compoundVariants:[{size:"lg",withIcon:!0,className:"gap-x-1.5"},{size:"default",withIcon:!0,className:"gap-x-1"},{size:"sm",withIcon:!0,className:"gap-x-0.5"}],defaultVariants:{variant:"default",size:"default"}}),Va=w.forwardRef(({className:t,variant:a,progress:r,size:s,startIcon:o,endIcon:c,asChild:l=!1,...u},d)=>{const m=l?i.Slot:"button",p=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(s);return e.jsxs(m,{disabled:r||u.disabled,className:U($a({variant:a,size:s,withIcon:null!=r||null!=o||null!=c,className:t})),ref:d,...u,children:[r&&e.jsx(n.Loader2,{size:p,className:"animate-spin"}),o&&w.cloneElement(o,{size:p}),u.children,c&&w.cloneElement(c,{size:p})]})});Va.displayName="Button";const Ka=t.createContext({container:null,setContainer:()=>{}}),Za=t.memo(({children:n})=>{const[a,r]=t.useState(null),s=t.useMemo(()=>({container:a,setContainer:r}),[a]),i=t.useMemo(()=>n,[n]);return e.jsxs(Ka.Provider,{value:s,children:[i,e.jsx("div",{ref:r,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});Za.displayName="PortalProvider";const qa=_.Root,Ja=_.Trigger,Ya=_.Portal,Qa=w.forwardRef(({className:t,...n},a)=>e.jsx(_.Overlay,{ref:a,className:U("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n}));Qa.displayName=_.Overlay.displayName;const Xa=w.forwardRef(({className:t,children:n,...a},r)=>{const{container:s}=w.useContext(Ka);return e.jsxs(Ya,{container:s,children:[e.jsx(Qa,{}),e.jsxs(_.Content,{ref:r,className:U("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...a,children:[n,e.jsxs(_.Close,{className:"absolute right-4 rtl:right-auto rtl:left-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(l.Cross2Icon,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});Xa.displayName=_.Content.displayName;const er=({className:t,...n})=>e.jsx("div",{className:U("flex flex-col space-y-1.5 text-center sm:text-start",t),...n});er.displayName="DialogHeader";const tr=w.forwardRef(({className:t,...n},a)=>e.jsx(_.Title,{ref:a,className:U("text-lg font-semibold leading-none tracking-tight",t),...n}));tr.displayName=_.Title.displayName;const nr=w.forwardRef(({className:t,...n},a)=>e.jsx(_.Description,{ref:a,className:U("text-sm text-muted-foreground",t),...n}));nr.displayName=_.Description.displayName;const ar=S.Root,rr=S.Trigger,sr=S.Portal,ir=w.forwardRef(({className:t,...n},a)=>e.jsx(S.Overlay,{className:U("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...n,ref:a}));ir.displayName=S.Overlay.displayName;const or=w.forwardRef(({className:t,...n},a)=>{const{container:r}=w.useContext(Ka);return e.jsxs(sr,{container:r,children:[e.jsx(ir,{}),e.jsx(S.Content,{ref:a,className:U("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...n})]})});or.displayName=S.Content.displayName;const cr=({className:t,...n})=>e.jsx("div",{className:U("flex flex-col space-y-2 text-center sm:text-start",t),...n});cr.displayName="AlertDialogHeader";const lr=({className:t,...n})=>e.jsx("div",{className:U("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...n});lr.displayName="AlertDialogFooter";const ur=w.forwardRef(({className:t,...n},a)=>e.jsx(S.Title,{ref:a,className:U("text-lg font-semibold",t),...n}));ur.displayName=S.Title.displayName;const dr=w.forwardRef(({className:t,...n},a)=>e.jsx(S.Description,{ref:a,className:U("text-sm text-muted-foreground",t),...n}));dr.displayName=S.Description.displayName;const mr=w.forwardRef(({className:t,...n},a)=>e.jsx(S.Action,{ref:a,className:U($a(),t),...n}));mr.displayName=S.Action.displayName;const pr=w.forwardRef(({className:t,...n},a)=>e.jsx(S.Cancel,{ref:a,className:U($a({variant:"outline"}),"mt-2 sm:mt-0",t),...n}));function hr({className:t,...n}){return e.jsx("div",{className:U("animate-pulse rounded-md bg-primary/10",t),...n})}function gr(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(hr,{className:"h-10 w-full"}),e.jsx(hr,{className:"h-10 w-full"}),e.jsx(hr,{className:"h-10 w-full"})]})}pr.displayName=S.Cancel.displayName;const fr=({workspace:a})=>{const[r,s]=t.useState(!1),{deleteWorkspace:i}=Ba(),{user:o}=wu(),{settings:c}=Un(),{t:l}=gn();if(1===(c?.workspace?.maxWorkspacesPerUser??0))return null;if(!a)return e.jsx(gr,{});const u=Ma(a,o?.id??null);return"admin"===u?.toLowerCase()?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:l("danger.title")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:l("danger.deleteDescription")})]}),e.jsxs(ar,{children:[e.jsx(rr,{asChild:!0,children:e.jsxs(Va,{variant:"destructive",disabled:r,progress:r,children:[e.jsx(n.Trash2,{className:"h-4 w-4 me-2"}),l("danger.deleteWorkspace")]})}),e.jsxs(or,{children:[e.jsxs(cr,{children:[e.jsx(ur,{children:l("danger.deleteConfirm")}),e.jsx(dr,{children:l("danger.deleteConfirmDescription")})]}),e.jsxs(lr,{children:[e.jsx(pr,{disabled:r,children:l("settings.common.cancel")}),e.jsx(mr,{onClick:async()=>{s(!0);try{await i(a._id)}catch(e){W(e,{component:"WorkspaceSettingsDanger",action:"handleDeleteWorkspace",metadata:{workspaceId:a._id}}),alert(e instanceof Error?e.message:l("danger.failedToDelete"))}finally{s(!1)}},disabled:r,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:r?e.jsxs(e.Fragment,{children:[e.jsx(n.Loader2,{className:"me-2 h-4 w-4 animate-spin"}),l("danger.deleting")]}):l("danger.deleteWorkspace")})]})]})]})]}):e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"text-red-500",children:l("danger.adminOnly")})})},br=w.forwardRef(({className:t,...n},a)=>e.jsx(k.Root,{className:U("peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...n,ref:a,children:e.jsx(k.Thumb,{className:U("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));br.displayName=k.Root.displayName;const xr=({workspaceId:a})=>{const{t:r}=gn(),{allFeatures:s,updateFeature:i,getWorkspace:o}=Ba(),{user:c}=wu(),[l,u]=t.useState({}),[d,m]=t.useState(null),[p,h]=t.useState(null),g=t.useRef(null);if(t.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]),t.useEffect(()=>{o(a).then(h)},[a]),!p)return e.jsx(gr,{});const f=La(p,c?.id??null);return e.jsxs("div",{children:[d&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:r("settings.common.success")}),e.jsx("p",{className:"text-sm",children:d})]}),e.jsxs("div",{className:"flex flex-col gap-y-3.5 pe-4",children:[!f&&e.jsx("div",{className:"text-red-500",children:r("features.ownerOnly")}),!s.length&&e.jsx("div",{className:"text-muted-foreground",children:r("features.noFeatures")}),s.length>0&&e.jsx("div",{className:"flex flex-col gap-y-3.5",children:s.map(t=>{const a=p?.features?.[t.slug],o=null!==l[t.slug]&&void 0!==l[t.slug],c=l[t.slug],d=r("features.actionStatus",{action:!0===c?"enabling":!1===c?"disabling":"none"});return e.jsxs("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e.jsxs("div",{className:"flex gap-x-2 flex-col",children:[e.jsx("h3",{className:"font-medium text-ellipsis",children:t.name}),e.jsx("p",{className:"text-muted-foreground",children:t.description})]}),o?e.jsxs("div",{className:"flex items-center gap-x-1",children:[e.jsx(n.Loader2,{className:"h-4 w-4 animate-spin text-gray-500"}),e.jsxs("span",{className:"text-sm text-gray-600",children:[d,"..."]})]}):e.jsx(br,{disabled:!f,checked:a??t.defaultValue,onCheckedChange:e=>async function(e,t){if(p){u(n=>({...n,[e]:t})),m(null);try{const n=await i(p._id,e,t);h(n);const a=s.find(t=>t.slug===e);m(r("features.updateSuccess",{feature:a?.name||"Feature",enabled:String(t)})),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{m(null)},5e3)}catch(t){W(t,{component:"WorkspaceSettingsFeatures",action:"updateFeature",metadata:{workspaceId:p._id,featureKey:e}})}finally{u(t=>({...t,[e]:null}))}}}(t.slug,e)})]},t._id)})})]})]})},vr=(e,t,n)=>{if(e&&"reportValidity"in e){const a=s.get(n,t);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},yr=(e,t)=>{for(const n in t.fields){const a=t.fields[n];a&&a.ref&&"reportValidity"in a.ref?vr(a.ref,n,e):a&&a.refs&&a.refs.forEach(t=>vr(t,n,e))}},wr=(e,t)=>{t.shouldUseNativeValidation&&yr(e,t);const n={};for(const a in e){const r=s.get(t.fields,a),i=Object.assign(e[a]||{},{ref:r&&r.ref});if(Sr(t.names||Object.keys(e),a)){const e=Object.assign({},s.get(n,a));s.set(e,"root",i),s.set(n,a,e)}else s.set(n,a,i)}return n},Sr=(e,t)=>{const n=kr(t);return e.some(e=>kr(e).match(`^${n}\\.\\d+`))};function kr(e){return e.replace(/\]|\[/g,"")}function Nr(e,t,n){function a(n,a){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:a,constr:i,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,a);const r=i.prototype,s=Object.keys(r);for(let e=0;e<s.length;e++){const t=s[e];t in n||(n[t]=r[t].bind(n))}}const r=n?.Parent??Object;class s extends r{}function i(e){var t;const r=n?.Parent?new s:this;a(r,e),(t=r._zod).deferred??(t.deferred=[]);for(const e of r._zod.deferred)e();return r}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(i,"init",{value:a}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class jr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ar extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Cr={};function Er(e){return Cr}function Tr(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function Pr(e,t){return"bigint"==typeof t?t.toString():t}function _r(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ur(e){return null==e}function Ir(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const Dr=Symbol("evaluating");function Rr(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Dr)return void 0===a&&(a=Dr,a=n()),a},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function zr(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Lr(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Mr(e){return JSON.stringify(e)}const Br="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Or(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Fr=_r(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Wr(e){if(!1===Or(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==Or(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function Hr(e){return Wr(e)?{...e}:Array.isArray(e)?[...e]:e}const Gr=new Set(["string","number","symbol"]);function $r(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Vr(e,t,n){const a=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(a._zod.parent=e),a}function Kr(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function Zr(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function qr(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Jr(e){return"string"==typeof e?e:e?.message}function Yr(e,t,n){const a={...e,path:e.path??[]};if(!e.message){const r=Jr(e.inst?._zod.def?.error?.(e))??Jr(t?.error?.(e))??Jr(n.customError?.(e))??Jr(n.localeError?.(e))??"Invalid input";a.message=r}return delete a.inst,delete a.continue,t?.reportInput||delete a.input,a}function Qr(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Xr(...e){const[t,n,a]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:a}:{...t}}const es=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Pr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ts=Nr("$ZodError",es),ns=Nr("$ZodError",es,{Parent:Error});const as=e=>(t,n,a,r)=>{const s=a?Object.assign(a,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise)throw new jr;if(i.issues.length){const t=new(r?.Err??e)(i.issues.map(e=>Yr(e,s,Er())));throw Br(t,r?.callee),t}return i.value},rs=as(ns),ss=e=>async(t,n,a,r)=>{const s=a?Object.assign(a,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(r?.Err??e)(i.issues.map(e=>Yr(e,s,Er())));throw Br(t,r?.callee),t}return i.value},is=ss(ns),os=e=>(t,n,a)=>{const r=a?{...a,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},r);if(s instanceof Promise)throw new jr;return s.issues.length?{success:!1,error:new(e??ts)(s.issues.map(e=>Yr(e,r,Er())))}:{success:!0,data:s.value}},cs=os(ns),ls=e=>async(t,n,a)=>{const r=a?Object.assign(a,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(e=>Yr(e,r,Er())))}:{success:!0,data:s.value}},us=ls(ns),ds=e=>(t,n,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return as(e)(t,n,r)},ms=e=>(t,n,a)=>as(e)(t,n,a),ps=e=>async(t,n,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ss(e)(t,n,r)},hs=e=>async(t,n,a)=>ss(e)(t,n,a),gs=e=>(t,n,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return os(e)(t,n,r)},fs=e=>(t,n,a)=>os(e)(t,n,a),bs=e=>async(t,n,a)=>{const r=a?Object.assign(a,{direction:"backward"}):{direction:"backward"};return ls(e)(t,n,r)},xs=e=>async(t,n,a)=>ls(e)(t,n,a),vs=/^[cC][^\s-]{8,}$/,ys=/^[0-9a-z]+$/,ws=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Ss=/^[0-9a-vA-V]{20}$/,ks=/^[A-Za-z0-9]{27}$/,Ns=/^[a-zA-Z0-9_-]{21}$/,js=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,As=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Cs=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Es=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Ts=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ps=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,_s=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Us=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Is=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ds=/^[A-Za-z0-9_-]*$/,Rs=/^\+[1-9]\d{6,14}$/,zs="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ls=new RegExp(`^${zs}$`);function Ms(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const Bs=/^[^A-Z]*$/,Os=/^[^a-z]*$/,Fs=Nr("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ws=Nr("$ZodCheckMaxLength",(e,t)=>{var n;Fs.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ur(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const a=n.value;if(a.length<=t.maximum)return;const r=Qr(a);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),Hs=Nr("$ZodCheckMinLength",(e,t)=>{var n;Fs.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ur(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const a=n.value;if(a.length>=t.minimum)return;const r=Qr(a);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:a,inst:e,continue:!t.abort})}}),Gs=Nr("$ZodCheckLengthEquals",(e,t)=>{var n;Fs.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!Ur(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const a=n.value,r=a.length;if(r===t.length)return;const s=Qr(a),i=r>t.length;n.issues.push({origin:s,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),$s=Nr("$ZodCheckStringFormat",(e,t)=>{var n,a;Fs.init(e,t),e._zod.onattach.push(e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),Vs=Nr("$ZodCheckRegex",(e,t)=>{$s.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ks=Nr("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bs),$s.init(e,t)}),Zs=Nr("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Os),$s.init(e,t)}),qs=Nr("$ZodCheckIncludes",(e,t)=>{Fs.init(e,t);const n=$r(t.includes),a=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(a)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Js=Nr("$ZodCheckStartsWith",(e,t)=>{Fs.init(e,t);const n=new RegExp(`^${$r(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Ys=Nr("$ZodCheckEndsWith",(e,t)=>{Fs.init(e,t);const n=new RegExp(`.*${$r(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Qs=Nr("$ZodCheckOverwrite",(e,t)=>{Fs.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Xs{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),a=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of a)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const ei={major:4,minor:3,patch:6},ti=Nr("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ei;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const t of a)for(const n of t._zod.onattach)n(e);if(0===a.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let a,r=Zr(e);for(const s of t){if(s._zod.def.when){if(!s._zod.def.when(e))continue}else if(r)continue;const t=e.issues.length,i=s._zod.check(e);if(i instanceof Promise&&!1===n?.async)throw new jr;if(a||i instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(r||(r=Zr(e,t)))});else{if(e.issues.length===t)continue;r||(r=Zr(e,t))}}return a?a.then(()=>e):e},n=(n,r,s)=>{if(Zr(n))return n.aborted=!0,n;const i=t(r,a,s);if(i instanceof Promise){if(!1===s.async)throw new jr;return i.then(t=>e._zod.parse(t,s))}return e._zod.parse(i,s)};e._zod.run=(r,s)=>{if(s.skipChecks)return e._zod.parse(r,s);if("backward"===s.direction){const t=e._zod.parse({value:r.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,s)):n(t,r,s)}const i=e._zod.parse(r,s);if(i instanceof Promise){if(!1===s.async)throw new jr;return i.then(e=>t(e,a,s))}return t(i,a,s)}}Rr(e,"~standard",()=>({validate:t=>{try{const n=cs(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return us(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),ni=Nr("$ZodString",(e,t)=>{var n;ti.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch(a){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ai=Nr("$ZodStringFormat",(e,t)=>{$s.init(e,t),ni.init(e,t)}),ri=Nr("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=As),ai.init(e,t)}),si=Nr("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Cs(e))}else t.pattern??(t.pattern=Cs());ai.init(e,t)}),ii=Nr("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Es),ai.init(e,t)}),oi=Nr("$ZodURL",(e,t)=>{ai.init(e,t),e._zod.check=n=>{try{const a=n.value.trim(),r=new URL(a);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=r.href:n.value=a)}catch(a){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ci=Nr("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ai.init(e,t)}),li=Nr("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ns),ai.init(e,t)}),ui=Nr("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=vs),ai.init(e,t)}),di=Nr("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ys),ai.init(e,t)}),mi=Nr("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ws),ai.init(e,t)}),pi=Nr("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Ss),ai.init(e,t)}),hi=Nr("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ks),ai.init(e,t)}),gi=Nr("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Ms({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${zs}T(?:${a})$`)}(t)),ai.init(e,t)}),fi=Nr("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ls),ai.init(e,t)}),bi=Nr("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Ms(t)}$`)),ai.init(e,t)}),xi=Nr("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=js),ai.init(e,t)}),vi=Nr("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ts),ai.init(e,t),e._zod.bag.format="ipv4"}),yi=Nr("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ps),ai.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),wi=Nr("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=_s),ai.init(e,t)}),Si=Nr("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Us),ai.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(2!==a.length)throw new Error;const[e,t]=a;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function ki(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Ni=Nr("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Is),ai.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{ki(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const ji=Nr("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ds),ai.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!Ds.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return ki(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Ai=Nr("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Rs),ai.init(e,t)});const Ci=Nr("$ZodJWT",(e,t)=>{ai.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[a]=n;if(!a)return!1;const r=JSON.parse(atob(a));return!("typ"in r&&"JWT"!==r?.typ||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Ei=Nr("$ZodUnknown",(e,t)=>{ti.init(e,t),e._zod.parse=e=>e}),Ti=Nr("$ZodNever",(e,t)=>{ti.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Pi(e,t,n){e.issues.length&&t.issues.push(...qr(n,e.issues)),t.value[n]=e.value}const _i=Nr("$ZodArray",(e,t)=>{ti.init(e,t),e._zod.parse=(n,a)=>{const r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);const s=[];for(let e=0;e<r.length;e++){const i=r[e],o=t.element._zod.run({value:i,issues:[]},a);o instanceof Promise?s.push(o.then(t=>Pi(t,n,e))):Pi(o,n,e)}return s.length?Promise.all(s).then(()=>n):n}});function Ui(e,t,n,a,r){if(e.issues.length){if(r&&!(n in a))return;t.issues.push(...qr(n,e.issues))}void 0===e.value?n in a&&(t.value[n]=void 0):t.value[n]=e.value}function Ii(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(a=e.shape,Object.keys(a).filter(e=>"optional"===a[e]._zod.optin&&"optional"===a[e]._zod.optout));var a;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Di(e,t,n,a,r,s){const i=[],o=r.keySet,c=r.catchall._zod,l=c.def.type,u="optional"===c.optout;for(const r in t){if(o.has(r))continue;if("never"===l){i.push(r);continue}const s=c.run({value:t[r],issues:[]},a);s instanceof Promise?e.push(s.then(e=>Ui(e,n,r,t,u))):Ui(s,n,r,t,u)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const Ri=Nr("$ZodObject",(e,t)=>{ti.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const a=_r(()=>Ii(t));Rr(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const a=e[t]._zod;if(a.values){n[t]??(n[t]=new Set);for(const e of a.values)n[t].add(e)}}return n});const r=Or,s=t.catchall;let i;e._zod.parse=(t,n)=>{i??(i=a.value);const o=t.value;if(!r(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};const c=[],l=i.shape;for(const e of i.keys){const a=l[e],r="optional"===a._zod.optout,s=a._zod.run({value:o[e],issues:[]},n);s instanceof Promise?c.push(s.then(n=>Ui(n,t,e,o,r))):Ui(s,t,e,o,r)}return s?Di(c,o,t,n,a.value,e):c.length?Promise.all(c).then(()=>t):t}}),zi=Nr("$ZodObjectJIT",(e,t)=>{Ri.init(e,t);const n=e._zod.parse,a=_r(()=>Ii(t));let r;const s=Or,i=!Cr.jitless,o=i&&Fr.value,c=t.catchall;let l;e._zod.parse=(u,d)=>{l??(l=a.value);const m=u.value;return s(m)?i&&o&&!1===d?.async&&!0!==d.jitless?(r||(r=(e=>{const t=new Xs(["shape","payload","ctx"]),n=a.value,r=e=>{const t=Mr(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const s=Object.create(null);let i=0;for(const e of n.keys)s[e]="key_"+i++;t.write("const newResult = {};");for(const a of n.keys){const n=s[a],i=Mr(a),o=e[a],c="optional"===o?._zod?.optout;t.write(`const ${n} = ${r(a)};`),c?t.write(`\n if (${n}.issues.length) {\n if (${i} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n \n `):t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const o=t.compile();return(t,n)=>o(e,t,n)})(t.shape)),u=r(u,d),c?Di([],m,u,d,l,e):u):n(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),u)}});function Li(e,t,n,a){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const r=e.filter(e=>!Zr(e));return 1===r.length?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Yr(e,a,Er())))}),t)}const Mi=Nr("$ZodUnion",(e,t)=>{ti.init(e,t),Rr(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Rr(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Rr(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Rr(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>Ir(e.source)).join("|")})$`)}});const n=1===t.options.length,a=t.options[0]._zod.run;e._zod.parse=(r,s)=>{if(n)return a(r,s);let i=!1;const o=[];for(const e of t.options){const t=e._zod.run({value:r.value,issues:[]},s);if(t instanceof Promise)o.push(t),i=!0;else{if(0===t.issues.length)return t;o.push(t)}}return i?Promise.all(o).then(t=>Li(t,r,e,s)):Li(o,r,e,s)}}),Bi=Nr("$ZodIntersection",(e,t)=>{ti.init(e,t),e._zod.parse=(e,n)=>{const a=e.value,r=t.left._zod.run({value:a,issues:[]},n),s=t.right._zod.run({value:a,issues:[]},n);return r instanceof Promise||s instanceof Promise?Promise.all([r,s]).then(([t,n])=>Fi(e,t,n)):Fi(e,r,s)}});function Oi(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(Wr(e)&&Wr(t)){const n=Object.keys(t),a=Object.keys(e).filter(e=>-1!==n.indexOf(e)),r={...e,...t};for(const n of a){const a=Oi(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r[n]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const r=Oi(e[a],t[a]);if(!r.valid)return{valid:!1,mergeErrorPath:[a,...r.mergeErrorPath]};n.push(r.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Fi(e,t,n){const a=new Map;let r;for(const n of t.issues)if("unrecognized_keys"===n.code){r??(r=n);for(const e of n.keys)a.has(e)||a.set(e,{}),a.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)a.has(e)||a.set(e,{}),a.get(e).r=!0;else e.issues.push(t);const s=[...a].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length&&r&&e.issues.push({...r,keys:s}),Zr(e))return e;const i=Oi(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Wi=Nr("$ZodEnum",(e,t)=>{ti.init(e,t);const n=Tr(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(e=>Gr.has(typeof e)).map(e=>"string"==typeof e?$r(e):e.toString()).join("|")})$`),e._zod.parse=(t,r)=>{const s=t.value;return a.has(s)||t.issues.push({code:"invalid_value",values:n,input:s,inst:e}),t}}),Hi=Nr("$ZodTransform",(e,t)=>{ti.init(e,t),e._zod.parse=(n,a)=>{if("backward"===a.direction)throw new Ar(e.constructor.name);const r=t.transform(n.value,n);if(a.async){return(r instanceof Promise?r:Promise.resolve(r)).then(e=>(n.value=e,n))}if(r instanceof Promise)throw new jr;return n.value=r,n}});function Gi(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const $i=Nr("$ZodOptional",(e,t)=>{ti.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Rr(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Rr(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ir(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then(t=>Gi(t,e.value)):Gi(a,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Vi=Nr("$ZodExactOptional",(e,t)=>{$i.init(e,t),Rr(e._zod,"values",()=>t.innerType._zod.values),Rr(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ki=Nr("$ZodNullable",(e,t)=>{ti.init(e,t),Rr(e._zod,"optin",()=>t.innerType._zod.optin),Rr(e._zod,"optout",()=>t.innerType._zod.optout),Rr(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Ir(e.source)}|null)$`):void 0}),Rr(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)}),Zi=Nr("$ZodDefault",(e,t)=>{ti.init(e,t),e._zod.optin="optional",Rr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then(e=>qi(e,t)):qi(a,t)}});function qi(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Ji=Nr("$ZodPrefault",(e,t)=>{ti.init(e,t),e._zod.optin="optional",Rr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Yi=Nr("$ZodNonOptional",(e,t)=>{ti.init(e,t),Rr(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(n,a)=>{const r=t.innerType._zod.run(n,a);return r instanceof Promise?r.then(t=>Qi(t,e)):Qi(r,e)}});function Qi(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Xi=Nr("$ZodCatch",(e,t)=>{ti.init(e,t),Rr(e._zod,"optin",()=>t.innerType._zod.optin),Rr(e._zod,"optout",()=>t.innerType._zod.optout),Rr(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then(a=>(e.value=a.value,a.issues.length&&(e.value=t.catchValue({...e,error:{issues:a.issues.map(e=>Yr(e,n,Er()))},input:e.value}),e.issues=[]),e)):(e.value=a.value,a.issues.length&&(e.value=t.catchValue({...e,error:{issues:a.issues.map(e=>Yr(e,n,Er()))},input:e.value}),e.issues=[]),e)}}),eo=Nr("$ZodPipe",(e,t)=>{ti.init(e,t),Rr(e._zod,"values",()=>t.in._zod.values),Rr(e._zod,"optin",()=>t.in._zod.optin),Rr(e._zod,"optout",()=>t.out._zod.optout),Rr(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const a=t.out._zod.run(e,n);return a instanceof Promise?a.then(e=>to(e,t.in,n)):to(a,t.in,n)}const a=t.in._zod.run(e,n);return a instanceof Promise?a.then(e=>to(e,t.out,n)):to(a,t.out,n)}});function to(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const no=Nr("$ZodReadonly",(e,t)=>{ti.init(e,t),Rr(e._zod,"propValues",()=>t.innerType._zod.propValues),Rr(e._zod,"values",()=>t.innerType._zod.values),Rr(e._zod,"optin",()=>t.innerType?._zod?.optin),Rr(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then(ao):ao(a)}});function ao(e){return e.value=Object.freeze(e.value),e}const ro=Nr("$ZodCustom",(e,t)=>{Fs.init(e,t),ti.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const a=n.value,r=t.fn(a);if(r instanceof Promise)return r.then(t=>so(t,n,a,e));so(r,n,a,e)}});function so(e,t,n,a){if(!e){const e={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(e.params=a._zod.def.params),t.issues.push(Xr(e))}}var io;class oo{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const a={...n,...this._map.get(e)};return Object.keys(a).length?a:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(io=globalThis).__zod_globalRegistry??(io.__zod_globalRegistry=new oo);const co=globalThis.__zod_globalRegistry;function lo(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Kr(t)})}function uo(e,t){return new Ws({check:"max_length",...Kr(t),maximum:e})}function mo(e,t){return new Hs({check:"min_length",...Kr(t),minimum:e})}function po(e,t){return new Gs({check:"length_equals",...Kr(t),length:e})}function ho(e){return new Qs({check:"overwrite",tx:e})}function go(e){const t=function(e,t){const n=new Fs({check:"custom",...Kr(t)});return n._zod.check=e,n}(n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(Xr(e,n.value,t._zod.def));else{const a=e;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=n.value),a.inst??(a.inst=t),a.continue??(a.continue=!t._zod.def.abort),n.issues.push(Xr(a))}},e(n.value,n)));return t}function fo(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??co,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function bo(e,t,n={path:[],schemaPath:[]}){var a;const r=e._zod.def,s=t.seen.get(e);if(s){s.count++;return n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema}const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const o=e._zod.toJSONSchema?.();if(o)i.schema=o;else{const a={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,a);else{const n=i.schema,s=t.processors[r.type];if(!s)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);s(e,t,n,a)}const s=e._zod.parent;s&&(i.ref||(i.ref=s),bo(s,t,a),t.seen.get(s).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(i.schema,c),"input"===t.io&&yo(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&i.schema._prefault&&((a=i.schema).default??(a.default=i.schema._prefault)),delete i.schema._prefault;return t.seen.get(e).schema}function xo(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=a.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(n,t[0])}}const r=t=>{if(t[1].schema.$ref)return;const a=t[1],{ref:r,defId:s}=(t=>{const a="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,r=e.external.uri??(e=>e);if(n)return{ref:r(n)};const s=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=s,{defId:s,ref:`${r("__shared")}#/${a}/${s}`}}if(t[1]===n)return{ref:"#"};const r=`#/${a}/`,s=t[1].schema.id??"__schema"+e.counter++;return{defId:s,ref:r+s}})(t);a.def={...a.schema},s&&(a.defId=s);const i=a.schema;for(const e in i)delete i[e];i.$ref=r};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const a=n[1];if(t===n[0]){r(n);continue}if(e.external){const a=e.external.registry.get(n[0])?.id;if(t!==n[0]&&a){r(n);continue}}const s=e.metadataRegistry.get(n[0])?.id;s?r(n):(a.cycle||a.count>1&&"ref"===e.reused)&&r(n)}}function vo(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=t=>{const n=e.seen.get(t);if(null===n.ref)return;const r=n.def??n.schema,s={...r},i=n.ref;if(n.ref=null,i){a(i);const n=e.seen.get(i),o=n.schema;!o.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(r,o):(r.allOf=r.allOf??[],r.allOf.push(o)),Object.assign(r,s);if(t._zod.parent===i)for(const e in r)"$ref"!==e&&"allOf"!==e&&(e in s||delete r[e]);if(o.$ref&&n.def)for(const e in r)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(r[e])===JSON.stringify(n.def[e])&&delete r[e]}const o=t._zod.parent;if(o&&o!==i){a(o);const t=e.seen.get(o);if(t?.schema.$ref&&(r.$ref=t.schema.$ref,t.def))for(const e in r)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(r[e])===JSON.stringify(t.def[e])&&delete r[e]}e.override({zodSchema:t,jsonSchema:r,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())a(t[0]);const r={};if("draft-2020-12"===e.target?r.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?r.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(n)}Object.assign(r,n.def??n.schema);const s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?r.$defs=s:r.definitions=s);try{const n=JSON.parse(JSON.stringify(r));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:wo(t,"input",e.processors),output:wo(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function yo(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if("transform"===a.type)return!0;if("array"===a.type)return yo(a.element,n);if("set"===a.type)return yo(a.valueType,n);if("lazy"===a.type)return yo(a.getter(),n);if("promise"===a.type||"optional"===a.type||"nonoptional"===a.type||"nullable"===a.type||"readonly"===a.type||"default"===a.type||"prefault"===a.type)return yo(a.innerType,n);if("intersection"===a.type)return yo(a.left,n)||yo(a.right,n);if("record"===a.type||"map"===a.type)return yo(a.keyType,n)||yo(a.valueType,n);if("pipe"===a.type)return yo(a.in,n)||yo(a.out,n);if("object"===a.type){for(const e in a.shape)if(yo(a.shape[e],n))return!0;return!1}if("union"===a.type){for(const e of a.options)if(yo(e,n))return!0;return!1}if("tuple"===a.type){for(const e of a.items)if(yo(e,n))return!0;return!(!a.rest||!yo(a.rest,n))}return!1}const wo=(e,t,n={})=>a=>{const{libraryOptions:r,target:s}=a??{},i=fo({...r??{},target:s,io:t,processors:n});return bo(e,i),xo(i,e),vo(i,e)},So={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ko=(e,t,n,a)=>{const r=e._zod.def;bo(r.innerType,t,a);t.seen.get(e).ref=r.innerType};function No(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function jo(e,t){for(var n={};e.length;){var a=e[0],r=a.code,i=a.message,o=a.path.join(".");if(!n[o])if("unionErrors"in a){var c=a.unionErrors[0].errors[0];n[o]={message:c.message,type:c.code}}else n[o]={message:i,type:r};if("unionErrors"in a&&a.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=n[o].types,u=l&&l[a.code];n[o]=s.appendErrors(o,t,n,r,u?[].concat(u,a.message):a.message)}e.shift()}return n}function Ao(e,t){for(var n={};e.length;){var a=e[0],r=a.code,i=a.message,o=a.path.join(".");if(!n[o])if("invalid_union"===a.code&&a.errors.length>0){var c=a.errors[0][0];n[o]={message:c.message,type:c.code}}else n[o]={message:i,type:r};if("invalid_union"===a.code&&a.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var l=n[o].types,u=l&&l[a.code];n[o]=s.appendErrors(o,t,n,r,u?[].concat(u,a.message):a.message)}e.shift()}return n}function Co(e,t,n){if(void 0===n&&(n={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(a,r,s){try{return Promise.resolve(No(function(){return Promise.resolve(e["sync"===n.mode?"parse":"parseAsync"](a,t)).then(function(e){return s.shouldUseNativeValidation&&yr({},s),{errors:{},values:n.raw?Object.assign({},a):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:wr(jo(e.errors,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(a,r,s){try{return Promise.resolve(No(function(){return Promise.resolve(("sync"===n.mode?rs:is)(e,a,t)).then(function(e){return s.shouldUseNativeValidation&&yr({},s),{errors:{},values:n.raw?Object.assign({},a):e}})},function(e){if(function(e){return e instanceof ts}(e))return{values:{},errors:wr(Ao(e.issues,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}const Eo=Nr("ZodISODateTime",(e,t)=>{gi.init(e,t),Xo.init(e,t)});function To(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Kr(t)})}(Eo,e)}const Po=Nr("ZodISODate",(e,t)=>{fi.init(e,t),Xo.init(e,t)});function _o(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Kr(t)})}(Po,e)}const Uo=Nr("ZodISOTime",(e,t)=>{bi.init(e,t),Xo.init(e,t)});function Io(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Kr(t)})}(Uo,e)}const Do=Nr("ZodISODuration",(e,t)=>{xi.init(e,t),Xo.init(e,t)});function Ro(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Kr(t)})}(Do,e)}const zo=Nr("ZodError",(e,t)=>{ts.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},a=e=>{for(const r of e.issues)if("invalid_union"===r.code&&r.errors.length)r.errors.map(e=>a({issues:e}));else if("invalid_key"===r.code)a({issues:r.issues});else if("invalid_element"===r.code)a({issues:r.issues});else if(0===r.path.length)n._errors.push(t(r));else{let e=n,a=0;for(;a<r.path.length;){const n=r.path[a];a===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],a++}}};return a(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},a=[];for(const r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):a.push(t(r));return{formErrors:a,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Pr,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Pr,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Lo=as(zo),Mo=ss(zo),Bo=os(zo),Oo=ls(zo),Fo=ds(zo),Wo=ms(zo),Ho=ps(zo),Go=hs(zo),$o=gs(zo),Vo=fs(zo),Ko=bs(zo),Zo=xs(zo),qo=Nr("ZodType",(e,t)=>(ti.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:wo(e,"input"),output:wo(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const a=fo({...n,processors:t});return bo(e,a),xo(a,e),vo(a,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Lr(t,{checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>Vr(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>Lo(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Bo(e,t,n),e.parseAsync=async(t,n)=>Mo(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Oo(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Fo(e,t,n),e.decode=(t,n)=>Wo(e,t,n),e.encodeAsync=async(t,n)=>Ho(e,t,n),e.decodeAsync=async(t,n)=>Go(e,t,n),e.safeEncode=(t,n)=>$o(e,t,n),e.safeDecode=(t,n)=>Vo(e,t,n),e.safeEncodeAsync=async(t,n)=>Ko(e,t,n),e.safeDecodeAsync=async(t,n)=>Zo(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Kr(n)})}(Wc,e,t)}(t,n)),e.superRefine=t=>e.check(go(t)),e.overwrite=t=>e.check(ho(t)),e.optional=()=>_c(e),e.exactOptional=()=>new Uc({type:"optional",innerType:e}),e.nullable=()=>Dc(e),e.nullish=()=>_c(Dc(e)),e.nonoptional=t=>function(e,t){return new Lc({type:"nonoptional",innerType:e,...Kr(t)})}(e,t),e.array=()=>{return function(e,t,n){return new e({type:"array",element:t,...Kr(n)})}(kc,e,t);var t},e.or=t=>{return new Ac({type:"union",options:[e,t],...Kr(n)});var n},e.and=t=>new Cc({type:"intersection",left:e,right:t}),e.transform=t=>Oc(e,new Tc({type:"transform",transform:t})),e.default=t=>{return n=t,new Rc({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():Hr(n)}});var n},e.prefault=t=>{return n=t,new zc({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():Hr(n)}});var n},e.catch=t=>{return new Mc({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>Oc(e,t),e.readonly=()=>new Fc({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return co.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>co.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return co.get(e);const n=e.clone();return co.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Jo=Nr("_ZodString",(e,t)=>{ni.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n)=>{const a=n;a.type="string";const{minimum:r,maximum:s,format:i,patterns:o,contentEncoding:c}=e._zod.bag;if("number"==typeof r&&(a.minLength=r),"number"==typeof s&&(a.maxLength=s),i&&(a.format=So[i]??i,""===a.format&&delete a.format,"time"===i&&delete a.format),c&&(a.contentEncoding=c),o&&o.size>0){const e=[...o];1===e.length?a.pattern=e[0].source:e.length>1&&(a.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new Vs({check:"string_format",format:"regex",...Kr(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new qs({check:"string_format",format:"includes",...Kr(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Js({check:"string_format",format:"starts_with",...Kr(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ys({check:"string_format",format:"ends_with",...Kr(t),suffix:e})}(...t)),e.min=(...t)=>e.check(mo(...t)),e.max=(...t)=>e.check(uo(...t)),e.length=(...t)=>e.check(po(...t)),e.nonempty=(...t)=>e.check(mo(1,...t)),e.lowercase=t=>e.check(function(e){return new Ks({check:"string_format",format:"lowercase",...Kr(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Zs({check:"string_format",format:"uppercase",...Kr(e)})}(t)),e.trim=()=>e.check(ho(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return ho(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(ho(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(ho(e=>e.toUpperCase())),e.slugify=()=>e.check(ho(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),Yo=Nr("ZodString",(e,t)=>{ni.init(e,t),Jo.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Kr(t)})}(ec,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Kr(t)})}(ac,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Kr(t)})}(xc,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Kr(t)})}(rc,t)),e.guid=t=>e.check(lo(tc,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Kr(t)})}(nc,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Kr(t)})}(nc,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Kr(t)})}(nc,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Kr(t)})}(nc,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Kr(t)})}(sc,t)),e.guid=t=>e.check(lo(tc,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Kr(t)})}(ic,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Kr(t)})}(oc,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Kr(t)})}(cc,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Kr(t)})}(gc,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Kr(t)})}(fc,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Kr(t)})}(lc,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Kr(t)})}(uc,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Kr(t)})}(dc,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Kr(t)})}(mc,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Kr(t)})}(pc,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Kr(t)})}(hc,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Kr(t)})}(bc,t)),e.datetime=t=>e.check(To(t)),e.date=t=>e.check(_o(t)),e.time=t=>e.check(Io(t)),e.duration=t=>e.check(Ro(t))});function Qo(e){return function(e,t){return new e({type:"string",...Kr(t)})}(Yo,e)}const Xo=Nr("ZodStringFormat",(e,t)=>{ai.init(e,t),Jo.init(e,t)}),ec=Nr("ZodEmail",(e,t)=>{ii.init(e,t),Xo.init(e,t)}),tc=Nr("ZodGUID",(e,t)=>{ri.init(e,t),Xo.init(e,t)}),nc=Nr("ZodUUID",(e,t)=>{si.init(e,t),Xo.init(e,t)}),ac=Nr("ZodURL",(e,t)=>{oi.init(e,t),Xo.init(e,t)}),rc=Nr("ZodEmoji",(e,t)=>{ci.init(e,t),Xo.init(e,t)}),sc=Nr("ZodNanoID",(e,t)=>{li.init(e,t),Xo.init(e,t)}),ic=Nr("ZodCUID",(e,t)=>{ui.init(e,t),Xo.init(e,t)}),oc=Nr("ZodCUID2",(e,t)=>{di.init(e,t),Xo.init(e,t)}),cc=Nr("ZodULID",(e,t)=>{mi.init(e,t),Xo.init(e,t)}),lc=Nr("ZodXID",(e,t)=>{pi.init(e,t),Xo.init(e,t)}),uc=Nr("ZodKSUID",(e,t)=>{hi.init(e,t),Xo.init(e,t)}),dc=Nr("ZodIPv4",(e,t)=>{vi.init(e,t),Xo.init(e,t)}),mc=Nr("ZodIPv6",(e,t)=>{yi.init(e,t),Xo.init(e,t)}),pc=Nr("ZodCIDRv4",(e,t)=>{wi.init(e,t),Xo.init(e,t)}),hc=Nr("ZodCIDRv6",(e,t)=>{Si.init(e,t),Xo.init(e,t)}),gc=Nr("ZodBase64",(e,t)=>{Ni.init(e,t),Xo.init(e,t)}),fc=Nr("ZodBase64URL",(e,t)=>{ji.init(e,t),Xo.init(e,t)}),bc=Nr("ZodE164",(e,t)=>{Ai.init(e,t),Xo.init(e,t)}),xc=Nr("ZodJWT",(e,t)=>{Ci.init(e,t),Xo.init(e,t)}),vc=Nr("ZodUnknown",(e,t)=>{Ei.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function yc(){return new vc({type:"unknown"})}const wc=Nr("ZodNever",(e,t)=>{Ti.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function Sc(e){return function(e,t){return new e({type:"never",...Kr(t)})}(wc,e)}const kc=Nr("ZodArray",(e,t)=>{_i.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n,a)=>{const r=n,s=e._zod.def,{minimum:i,maximum:o}=e._zod.bag;"number"==typeof i&&(r.minItems=i),"number"==typeof o&&(r.maxItems=o),r.type="array",r.items=bo(s.element,t,{...a,path:[...a.path,"items"]})})(e,t,n,a),e.element=t.element,e.min=(t,n)=>e.check(mo(t,n)),e.nonempty=t=>e.check(mo(1,t)),e.max=(t,n)=>e.check(uo(t,n)),e.length=(t,n)=>e.check(po(t,n)),e.unwrap=()=>e.element});const Nc=Nr("ZodObject",(e,t)=>{zi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n,a)=>{const r=n,s=e._zod.def;r.type="object",r.properties={};const i=s.shape;for(const e in i)r.properties[e]=bo(i[e],t,{...a,path:[...a.path,"properties",e]});const o=new Set(Object.keys(i)),c=new Set([...o].filter(e=>{const n=s.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));c.size>0&&(r.required=Array.from(c)),"never"===s.catchall?._zod.def.type?r.additionalProperties=!1:s.catchall?s.catchall&&(r.additionalProperties=bo(s.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,n,a),Rr(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Ec({type:"enum",entries:n,...Kr(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:yc()}),e.loose=()=>e.clone({...e._zod.def,catchall:yc()}),e.strict=()=>e.clone({...e._zod.def,catchall:Sc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Wr(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const a=Lr(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return zr(this,"shape",n),n}});return Vr(e,a)}(e,t),e.safeExtend=t=>function(e,t){if(!Wr(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Lr(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return zr(this,"shape",n),n}});return Vr(e,n)}(e,t),e.merge=t=>function(e,t){const n=Lr(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return zr(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Vr(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return Vr(e,Lr(e._zod.def,{get shape(){const e={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(e[a]=n.shape[a])}return zr(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=Lr(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete a[e]}return zr(this,"shape",a),a},checks:[]});return Vr(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const a=t._zod.def.checks;if(a&&a.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=Lr(t._zod.def,{get shape(){const a=t._zod.def.shape,r={...a};if(n)for(const t in n){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=e?new e({type:"optional",innerType:a[t]}):a[t])}else for(const t in a)r[t]=e?new e({type:"optional",innerType:a[t]}):a[t];return zr(this,"shape",r),r},checks:[]});return Vr(t,r)}(Pc,e,t[0]),e.required=(...t)=>function(e,t,n){const a=Lr(t._zod.def,{get shape(){const a=t._zod.def.shape,r={...a};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=new e({type:"nonoptional",innerType:a[t]}))}else for(const t in a)r[t]=new e({type:"nonoptional",innerType:a[t]});return zr(this,"shape",r),r}});return Vr(t,a)}(Lc,e,t[0])});function jc(e,t){const n={type:"object",shape:e??{},...Kr(t)};return new Nc(n)}const Ac=Nr("ZodUnion",(e,t)=>{Mi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n,a)=>{const r=e._zod.def,s=!1===r.inclusive,i=r.options.map((e,n)=>bo(e,t,{...a,path:[...a.path,s?"oneOf":"anyOf",n]}));s?n.oneOf=i:n.anyOf=i})(e,t,n,a),e.options=t.options});const Cc=Nr("ZodIntersection",(e,t)=>{Bi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n,a)=>{const r=e._zod.def,s=bo(r.left,t,{...a,path:[...a.path,"allOf",0]}),i=bo(r.right,t,{...a,path:[...a.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length,c=[...o(s)?s.allOf:[s],...o(i)?i.allOf:[i]];n.allOf=c})(e,t,n,a)});const Ec=Nr("ZodEnum",(e,t)=>{Wi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n)=>{const a=Tr(e._zod.def.entries);a.every(e=>"number"==typeof e)&&(n.type="number"),a.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=a})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,a)=>{const r={};for(const a of e){if(!n.has(a))throw new Error(`Key ${a} not found in enum`);r[a]=t.entries[a]}return new Ec({...t,checks:[],...Kr(a),entries:r})},e.exclude=(e,a)=>{const r={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete r[t]}return new Ec({...t,checks:[],...Kr(a),entries:r})}});const Tc=Nr("ZodTransform",(e,t)=>{Hi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,a)=>{if("backward"===a.direction)throw new Ar(e.constructor.name);n.addIssue=a=>{if("string"==typeof a)n.issues.push(Xr(a,n.value,t));else{const t=a;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(Xr(t))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then(e=>(n.value=e,n)):(n.value=r,n)}});const Pc=Nr("ZodOptional",(e,t)=>{$i.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>ko(e,t,0,a),e.unwrap=()=>e._zod.def.innerType});function _c(e){return new Pc({type:"optional",innerType:e})}const Uc=Nr("ZodExactOptional",(e,t)=>{Vi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>ko(e,t,0,a),e.unwrap=()=>e._zod.def.innerType});const Ic=Nr("ZodNullable",(e,t)=>{Ki.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n,a)=>{const r=e._zod.def,s=bo(r.innerType,t,a),i=t.seen.get(e);"openapi-3.0"===t.target?(i.ref=r.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]})(e,t,n,a),e.unwrap=()=>e._zod.def.innerType});function Dc(e){return new Ic({type:"nullable",innerType:e})}const Rc=Nr("ZodDefault",(e,t)=>{Zi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n,a)=>{const r=e._zod.def;bo(r.innerType,t,a),t.seen.get(e).ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))})(e,t,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const zc=Nr("ZodPrefault",(e,t)=>{Ji.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n,a)=>{const r=e._zod.def;bo(r.innerType,t,a),t.seen.get(e).ref=r.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))})(e,t,n,a),e.unwrap=()=>e._zod.def.innerType});const Lc=Nr("ZodNonOptional",(e,t)=>{Yi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n,a)=>{const r=e._zod.def;bo(r.innerType,t,a),t.seen.get(e).ref=r.innerType})(e,t,0,a),e.unwrap=()=>e._zod.def.innerType});const Mc=Nr("ZodCatch",(e,t)=>{Xi.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n,a)=>{const r=e._zod.def;let s;bo(r.innerType,t,a),t.seen.get(e).ref=r.innerType;try{s=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=s})(e,t,n,a),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const Bc=Nr("ZodPipe",(e,t)=>{eo.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n,a)=>{const r=e._zod.def,s="input"===t.io?"transform"===r.in._zod.def.type?r.out:r.in:r.out;bo(s,t,a),t.seen.get(e).ref=s})(e,t,0,a),e.in=t.in,e.out=t.out});function Oc(e,t){return new Bc({type:"pipe",in:e,out:t})}const Fc=Nr("ZodReadonly",(e,t)=>{no.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(t,n,a)=>((e,t,n,a)=>{const r=e._zod.def;bo(r.innerType,t,a),t.seen.get(e).ref=r.innerType,n.readOnly=!0})(e,t,n,a),e.unwrap=()=>e._zod.def.innerType});const Wc=Nr("ZodCustom",(e,t)=>{ro.init(e,t),qo.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});const Hc={usd:"$",eur:"€",gbp:"£",jpy:"¥",cad:"CA$",aud:"A$",chf:"CHF",cny:"¥",hkd:"HK$",sgd:"S$",inr:"₹",mxn:"MX$",brl:"R$",nzd:"NZ$",sek:"kr",nok:"kr",dkk:"kr",pln:"zł",thb:"฿"},Gc={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function $c(e){return e&&e.trim()?Gc[e.trim().toLowerCase()]??"":""}function Vc(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return Hc[t]??t.toUpperCase()}["usd","eur","gbp","jpy","cad","aud","chf","cny","hkd","sgd","inr","mxn","brl","nzd","sek","nok","dkk","pln","thb"].map(e=>({value:e,label:`${e.toUpperCase()} (${Vc(e)})`}));const Kc=c.cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Zc=w.forwardRef(({className:t,...n},a)=>e.jsx(N.Root,{ref:a,className:U(Kc(),t),...n}));Zc.displayName=N.Root.displayName;const qc=s.FormProvider,Jc=w.createContext({}),Yc=({...t})=>e.jsx(Jc.Provider,{value:{name:t.name},children:e.jsx(s.Controller,{...t})}),Qc=()=>{const e=w.useContext(Jc),t=w.useContext(Xc),{getFieldState:n,formState:a}=s.useFormContext(),r=n(e.name,a);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...r}},Xc=w.createContext({}),el=w.forwardRef(({className:t,...n},a)=>{const r=w.useId();return e.jsx(Xc.Provider,{value:{id:r},children:e.jsx("div",{ref:a,className:U("space-y-2",t),...n})})});el.displayName="FormItem";const tl=w.forwardRef(({className:t,...n},a)=>{const{error:r,formItemId:s}=Qc();return e.jsx(Zc,{ref:a,className:U(r&&"text-destructive",t),htmlFor:s,...n})});tl.displayName="FormLabel";const nl=w.forwardRef(({...t},n)=>{const{error:a,formItemId:r,formDescriptionId:s,formMessageId:o}=Qc();return e.jsx(i.Slot,{ref:n,id:r,"aria-describedby":a?`${s} ${o}`:`${s}`,"aria-invalid":!!a,...t})});nl.displayName="FormControl";const al=w.forwardRef(({className:t,...n},a)=>{const{formDescriptionId:r}=Qc();return e.jsx("p",{ref:a,id:r,className:U("text-sm text-muted-foreground",t),...n})});al.displayName="FormDescription";const rl=w.forwardRef(({className:t,children:n,...a},r)=>{const{error:s,formMessageId:i}=Qc(),o=s?String(s?.message):n;return o?e.jsx("p",{ref:r,id:i,className:U("text-sm font-medium text-destructive",t),...a,children:o}):null});rl.displayName="FormMessage";const sl=w.forwardRef(({className:t,type:n,...a},r)=>e.jsx("input",{type:n,className:U("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...a}));sl.displayName="Input";const il=w.forwardRef(({className:t,...n},a)=>e.jsx(j.Root,{className:U("grid gap-2",t),...n,ref:a}));il.displayName=j.Root.displayName;const ol=w.forwardRef(({className:t,...n},a)=>e.jsx(j.Item,{ref:a,className:U("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:e.jsx(j.Indicator,{className:"flex items-center justify-center",children:e.jsx(l.CheckIcon,{className:"h-3.5 w-3.5 fill-primary"})})}));ol.displayName=j.Item.displayName;const cl=w.forwardRef(({className:t,children:n,...a},r)=>e.jsxs(A.Root,{ref:r,className:U("relative overflow-hidden",t),...a,children:[e.jsx(A.Viewport,{className:"h-full w-full rounded-[inherit]",children:n}),e.jsx(ll,{}),e.jsx(A.Corner,{})]}));cl.displayName=A.Root.displayName;const ll=w.forwardRef(({className:t,orientation:n="vertical",...a},r)=>e.jsx(A.ScrollAreaScrollbar,{ref:r,orientation:n,className:U("flex touch-none select-none transition-colors","vertical"===n&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===n&&"h-2.5 border-t border-t-transparent p-[1px]",t),...a,children:e.jsx(A.ScrollAreaThumb,{className:U("relative rounded-full bg-border","vertical"===n&&"flex-1")})}));function ul(e){return`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" alignment-baseline="middle" text-anchor="middle" font-size="50" font-family="sans-serif">${e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}</text></svg>`}ll.displayName=A.ScrollAreaScrollbar.displayName;const dl=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑‍💻","👨‍💻","👩‍💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨‍💼","👩‍💼","👨‍🏫","👩‍🏫","👨‍🔬","👩‍🔬","👨‍🎨","👩‍🎨","👨‍🔧","👩‍🔧","👨‍🚀","👩‍🚀","👨‍⚖️","👩‍⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️‍🌈","🎟️","🎫"],ml=({workspace:a})=>{const{t:r}=gn(),{updateWorkspace:i}=Ba(),{user:o}=wu(),[c,l]=t.useState(!1),[u,d]=t.useState("emoji"),[m,p]=t.useState(),[h,g]=t.useState(null),f=t.useRef(null);t.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const b=jc({name:Qo().min(2,{message:r("general.nameMinLength")}),image:Qo().optional()}),x=s.useForm({resolver:Co(b),defaultValues:{name:a.name||"",image:a.image||""}});if(!a)return e.jsx(gr,{});const v=La(a,o?.id??null);return e.jsxs("div",{children:[h&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:r("settings.common.success")}),e.jsx("p",{className:"text-sm",children:h})]}),!v&&e.jsx("div",{className:"text-red-500",children:r("general.ownerOnly")}),e.jsx(qc,{...x,children:e.jsxs("form",{onSubmit:x.handleSubmit(async function(e){l(!0),g(null);try{await i(a,e),g(r("general.success")),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>{g(null)},5e3)}catch(e){W(e,{component:"WorkspaceSettingsGeneral",action:"updateWorkspace",metadata:{workspaceId:a._id}})}finally{l(!1)}}),className:"space-y-6",children:[e.jsx(Yc,{control:x.control,name:"name",render:({field:t})=>e.jsxs(el,{children:[e.jsx(tl,{children:r("general.name")}),e.jsx(nl,{children:e.jsx(sl,{placeholder:r("general.namePlaceholder"),...t,disabled:!v})}),e.jsx(rl,{})]})}),a.billingCurrency?.trim()&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Zc,{className:"text-sm font-medium text-muted-foreground",children:r("general.billingCurrency")}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[$c(a.billingCurrency)&&e.jsx("span",{className:"text-base",children:$c(a.billingCurrency)}),e.jsx("span",{children:a.billingCurrency.trim().toUpperCase()})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Zc,{className:"text-sm font-medium",children:r("general.icon")}),e.jsx(al,{children:r("general.iconDescription")})]}),e.jsxs(il,{value:u,disabled:!v,onValueChange:e=>d(e),className:"flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ol,{value:"emoji",id:"emoji"}),e.jsxs(Zc,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(n.Smile,{className:"h-4 w-4"}),r("general.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ol,{value:"url",id:"url"}),e.jsxs(Zc,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(n.ImageIcon,{className:"h-4 w-4"}),r("general.customImageUrl")]})]})]}),"emoji"===u&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:r("general.previewLabel")}),e.jsxs("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[m&&e.jsx("span",{className:"text-2xl",children:m}),!m&&x.watch("image")?.trim()&&e.jsx("img",{src:x.watch("image")||void 0,alt:"Workspace preview"})]})]}),v&&e.jsx(cl,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:dl.map((t,n)=>e.jsx("button",{type:"button",onClick:()=>(e=>{p(e),x.setValue("image",ul(e))})(t),disabled:!v,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(m===t?"bg-primary text-primary-foreground":""),children:t},n))})})]}),"url"===u&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(Yc,{control:x.control,name:"image",render:({field:t})=>e.jsxs(el,{children:[e.jsx(tl,{children:r("general.imageUrl")}),e.jsx(nl,{children:e.jsx(sl,{placeholder:r("general.imageUrlPlaceholder"),...t,disabled:!v})}),e.jsx(al,{children:r("general.imageUrlDescription")}),e.jsx(rl,{})]})}),x.watch("image")&&x.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:r("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:x.watch("image")||void 0,className:"w-full h-full object-cover",alt:"Workspace preview"})})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 pt-4",children:v&&e.jsx(Va,{type:"submit",disabled:c,progress:c,children:r("general.updateWorkspace")})})]})})]})},pl=w.forwardRef(({className:t,...n},a)=>e.jsx(m.Command,{ref:a,className:U("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...n}));pl.displayName=m.Command.displayName;const hl=w.forwardRef(({className:t,...n},a)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(l.MagnifyingGlassIcon,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(m.Command.Input,{ref:a,className:U("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...n})]}));hl.displayName=m.Command.Input.displayName;const gl=w.forwardRef(({className:t,...n},a)=>e.jsx(m.Command.List,{ref:a,className:U("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...n}));gl.displayName=m.Command.List.displayName;w.forwardRef((t,n)=>e.jsx(m.Command.Empty,{ref:n,className:"py-6 text-center text-sm",...t})).displayName=m.Command.Empty.displayName;const fl=w.forwardRef(({className:t,...n},a)=>e.jsx(m.Command.Group,{ref:a,className:U("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...n}));fl.displayName=m.Command.Group.displayName;w.forwardRef(({className:t,...n},a)=>e.jsx(m.Command.Separator,{ref:a,className:U("-mx-1 h-px bg-border",t),...n})).displayName=m.Command.Separator.displayName;const bl=w.forwardRef(({className:t,...n},a)=>e.jsx(m.Command.Item,{ref:a,className:U("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n}));bl.displayName=m.Command.Item.displayName;const xl=C.Root,vl=C.Trigger,yl=w.forwardRef(({className:t,align:n="center",sideOffset:a=4,...r},s)=>{const{container:i}=w.useContext(Ka);return e.jsx(C.Portal,{container:i,children:e.jsx(C.Content,{ref:s,align:n,sideOffset:a,className:U("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r})})});function wl({options:a,value:r,onChange:s,placeholder:i="Search...",emptyLabel:o="Choose option"}){const[c,l]=t.useState(r??""),[u,d]=t.useState(!1);t.useEffect(()=>{void 0!==r&&l(r)},[r]);const m=a.find(e=>e.value===c);return e.jsxs(xl,{open:u,onOpenChange:d,children:[e.jsx(vl,{asChild:!0,children:e.jsxs(Va,{variant:"outline",role:"combobox","aria-expanded":u,className:"justify-between overflow-hidden text-ellipsis",children:[m?e.jsxs("div",{children:[String(m.label).trim(),m.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:m.icon})]}):e.jsx("span",{className:"text-muted-foreground",children:o}),e.jsx(n.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(yl,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(pl,{children:[e.jsx(hl,{placeholder:i}),e.jsx(gl,{children:e.jsx(fl,{children:a.map(t=>e.jsxs(bl,{className:U("whitespace-nowrap text-start",{"text-green-500":c===t.value}),value:t.value,defaultValue:t.value,onSelect:()=>{return e=t.value,l(e),s?.(e),void d(!1);var e},children:[c===t.value&&e.jsx(n.CheckCheck,{className:U("me-2 h-4 w-4 text-green-400",c===t.value?"opacity-100":"opacity-0")}),String(t.label).trim(),t.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:t.icon})]},t.value))})})]})})]})}yl.displayName=C.Content.displayName;const Sl={USD:"$",EUR:"€",JPY:"¥",GBP:"£",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"¥",SEK:"kr",NZD:"NZ$",INR:"₹",RUB:"₽",KRW:"₩",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"₺",IDR:"Rp",PLN:"zł",THB:"฿",ILS:"₪",PHP:"₱",MYR:"RM",CZK:"Kč",HUF:"Ft",DKK:"kr",PKR:"₨",EGP:"£",NGN:"₦",BDT:"৳",UAH:"₴",KZT:"₸",VND:"₫",ARS:"$",BGN:"лв",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"د.م.",MNT:"₮",NPR:"रू",RSD:"дин.",SAR:"ر.س",TWD:"NT$",UYU:"$U",YER:"﷼",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ب.د",KWD:"د.ك",OMR:"ر.ع.",BND:"B$",KPW:"₩",GHS:"₵",SYP:"ل.س",SLL:"Le",SSP:"£",AFN:"؋",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"₾",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"£",WST:"T",PGK:"K",KGS:"лв",AZN:"₼",QAR:"ر.ق",XOF:"CFA",XPF:"CFP"},kl={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},Nl=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=kl[e.code]||"USD",n=Sl[t]||"";return{value:e.code,flag:(a=e.code,a.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:n};var a});function jl({value:t,onChange:n}){const{t:a}=gn(),r=Nl.map(e=>({value:e.value,label:e.text,icon:e.flag}));return e.jsx(wl,{options:r,value:t,onChange:n,placeholder:a("dropdowns.searchCountry"),emptyLabel:a("dropdowns.chooseCountry")})}const Al=Nl.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),Cl=Array.from(new Set(Al.map(e=>e.value))).map(e=>Al.find(t=>t.value===e)).filter(e=>void 0!==e);function El({value:t,onChange:n}){const{t:a}=gn(),r=Cl.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return e.jsx(wl,{options:r,value:t,onChange:n,placeholder:a("dropdowns.searchCurrency"),emptyLabel:a("dropdowns.chooseCurrency")})}let Tl=[{code:"en",label:"English",flag:"🇬🇧"},{code:"en-GB",label:"English (United Kingdom)",flag:"🇬🇧"},{code:"en-US",label:"English (United States)",flag:"🇺🇸"},{code:"en-AU",label:"English (Australia)",flag:"🇦🇺"},{code:"en-CA",label:"English (Canada)",flag:"🇨🇦"},{code:"en-NZ",label:"English (New Zealand)",flag:"🇳🇿"},{code:"es",label:"Spanish",flag:"🇪🇸"},{code:"es-ES",label:"Spanish (Spain)",flag:"🇪🇸"},{code:"es-MX",label:"Spanish (Mexico)",flag:"🇲🇽"},{code:"fr",label:"French",flag:"🇫🇷"},{code:"fr-FR",label:"French (France)",flag:"🇫🇷"},{code:"de",label:"German",flag:"🇩🇪"},{code:"de-DE",label:"German (Germany)",flag:"🇩🇪"},{code:"it",label:"Italian",flag:"🇮🇹"},{code:"it-IT",label:"Italian (Italy)",flag:"🇮🇹"},{code:"pt",label:"Portuguese",flag:"🇵🇹"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"🇵🇹"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"🇧🇷"},{code:"ru",label:"Russian",flag:"🇷🇺"},{code:"ru-RU",label:"Russian (Russia)",flag:"🇷🇺"},{code:"zh",label:"Chinese",flag:"🇨🇳"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"🇨🇳"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"🇹🇼"},{code:"ja",label:"Japanese",flag:"🇯🇵"},{code:"ja-JP",label:"Japanese (Japan)",flag:"🇯🇵"},{code:"ko",label:"Korean",flag:"🇰🇷"},{code:"ko-KR",label:"Korean (South Korea)",flag:"🇰🇷"},{code:"ar",label:"Arabic",flag:"🇸🇦"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"🇸🇦"},{code:"hi",label:"Hindi",flag:"🇮🇳"},{code:"hi-IN",label:"Hindi (India)",flag:"🇮🇳"},{code:"bn",label:"Bengali",flag:"🇮🇳"},{code:"bn-IN",label:"Bengali (India)",flag:"🇮🇳"},{code:"gu",label:"Gujarati",flag:"🇮🇳"},{code:"gu-IN",label:"Gujarati (India)",flag:"🇮🇳"},{code:"ta",label:"Tamil",flag:"🇮🇳"},{code:"ta-IN",label:"Tamil (India)",flag:"🇮🇳"},{code:"te",label:"Telugu",flag:"🇮🇳"},{code:"te-IN",label:"Telugu (India)",flag:"🇮🇳"},{code:"ml",label:"Malayalam",flag:"🇮🇳"},{code:"ml-IN",label:"Malayalam (India)",flag:"🇮🇳"},{code:"kn",label:"Kannada",flag:"🇮🇳"},{code:"kn-IN",label:"Kannada (India)",flag:"🇮🇳"},{code:"mr",label:"Marathi",flag:"🇮🇳"},{code:"mr-IN",label:"Marathi (India)",flag:"🇮🇳"},{code:"pa",label:"Punjabi",flag:"🇮🇳"},{code:"pa-IN",label:"Punjabi (India)",flag:"🇮🇳"},{code:"ur",label:"Urdu",flag:"🇮🇳"},{code:"ur-IN",label:"Urdu (India)",flag:"🇮🇳"},{code:"or",label:"Odia",flag:"🇮🇳"},{code:"or-IN",label:"Odia (India)",flag:"🇮🇳"},{code:"as",label:"Assamese",flag:"🇮🇳"},{code:"as-IN",label:"Assamese (India)",flag:"🇮🇳"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"🇭🇰"},{code:"nl",label:"Dutch",flag:"🇳🇱"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"🇳🇱"},{code:"pl",label:"Polish",flag:"🇵🇱"},{code:"pl-PL",label:"Polish (Poland)",flag:"🇵🇱"},{code:"sv",label:"Swedish",flag:"🇸🇪"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"🇸🇪"},{code:"da",label:"Danish",flag:"🇩🇰"},{code:"da-DK",label:"Danish (Denmark)",flag:"🇩🇰"},{code:"no",label:"Norwegian",flag:"🇳🇴"},{code:"no-NO",label:"Norwegian (Norway)",flag:"🇳🇴"},{code:"fi",label:"Finnish",flag:"🇫🇮"},{code:"fi-FI",label:"Finnish (Finland)",flag:"🇫🇮"},{code:"tr",label:"Turkish",flag:"🇹🇷"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"🇹🇷"},{code:"cs",label:"Czech",flag:"🇨🇿"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"🇨🇿"},{code:"sk",label:"Slovak",flag:"🇸🇰"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"🇸🇰"},{code:"hu",label:"Hungarian",flag:"🇭🇺"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"🇭🇺"},{code:"ro",label:"Romanian",flag:"🇷🇴"},{code:"ro-RO",label:"Romanian (Romania)",flag:"🇷🇴"},{code:"el",label:"Greek",flag:"🇬🇷"},{code:"el-GR",label:"Greek (Greece)",flag:"🇬🇷"},{code:"th",label:"Thai",flag:"🇹🇭"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"},{code:"id",label:"Indonesian",flag:"🇮🇩"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"🇮🇩"},{code:"ms",label:"Malay",flag:"🇲🇾"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"🇲🇾"},{code:"vi",label:"Vietnamese",flag:"🇻🇳"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"🇻🇳"},{code:"he",label:"Hebrew",flag:"🇮🇱"},{code:"he-IL",label:"Hebrew (Israel)",flag:"🇮🇱"}];Tl=Tl.filter((e,t,n)=>t===n.findIndex(t=>t.code===e.code&&t.label===e.label)),Tl.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const Pl=Tl.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,n)=>t===n.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function _l({value:t,onChange:n}){const{t:a}=gn(),r=Pl.map(e=>({value:e.value,label:e.label,icon:e.flag}));return e.jsx(wl,{options:r,value:t,onChange:n,placeholder:a("dropdowns.searchLanguage"),emptyLabel:a("dropdowns.chooseLanguage")})}const Ul=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let n=t.utc;for(let a=0;a<n.length;a++){const r=n[a],s=t.text;let i=s.substring(s.indexOf("(")+1,s.indexOf(")"));-1!==i.indexOf("UTC")&&e.push({value:r,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${i}) ${r}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,n)=>t===n.findIndex(t=>t.value===e.value));function Il({value:t,onChange:n}){const{t:a}=gn(),r=Ul.map(e=>({value:e.value,label:e.text}));return e.jsx(wl,{options:r,value:t,onChange:n,placeholder:a("dropdowns.searchTimezone"),emptyLabel:a("dropdowns.chooseTimezone")})}const Dl=({workspace:n})=>{const{t:a}=gn(),{updateUserProfile:r,getProfile:i}=Ba(),[o,c]=t.useState(!1),[l,u]=t.useState(),[d,m]=t.useState(0),[p,h]=t.useState(null),g=t.useRef(null);t.useEffect(()=>()=>{g.current&&clearTimeout(g.current)},[]);const f=jc({name:Qo().min(2,{message:a("profile.nameMinLength")}),country:Qo().optional(),timezone:Qo().optional(),language:Qo().optional(),currency:Qo().optional()}),b=s.useForm({resolver:Co(f),defaultValues:{name:l?.name||"",country:l?.country||"",timezone:l?.timezone||"",language:l?.language||"",currency:l?.currency||""}});return t.useEffect(()=>{i().then(e=>{u(e),b.setValue("name",e.name),b.setValue("country",e.country),b.setValue("timezone",e.timezone),b.setValue("language",e.language),b.setValue("currency",e.currency)})},[d]),l?e.jsxs("div",{children:[p&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:a("settings.common.success")}),e.jsx("p",{className:"text-sm",children:p})]}),e.jsx("div",{className:"space-y-4",children:e.jsx(qc,{...b,children:e.jsxs("form",{onSubmit:b.handleSubmit(async function(e){c(!0),h(null);try{await r({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),h(a("profile.success")),g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{h(null)},5e3)}catch(e){W(e,{component:"WorkspaceSettingsProfile",action:"updateUserProfile",metadata:{workspaceId:n._id}})}finally{c(!1)}}),className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:a("profile.email")}),e.jsx(sl,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:l?.email})]}),e.jsx(Yc,{disabled:o,control:b.control,name:"name",render:({field:t})=>e.jsxs(el,{children:[e.jsx(tl,{children:a("profile.name")}),e.jsx(nl,{children:e.jsx(sl,{...t})}),e.jsx(rl,{})]})}),e.jsxs("div",{className:"flex gap-y-2 my-4 flex-col",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:a("profile.language")}),e.jsx(_l,{value:b.watch("language"),onChange:e=>{b.setValue("language",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:a("profile.country")}),e.jsx(jl,{value:b.watch("country"),onChange:e=>{b.setValue("country",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:a("profile.currency")}),e.jsx(El,{value:b.watch("currency"),onChange:e=>{b.setValue("currency",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:a("profile.timezone")}),e.jsx(Il,{value:b.watch("timezone"),onChange:e=>{b.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(Va,{type:"submit",progress:o,disabled:o,children:a("profile.save")}),e.jsx(Va,{type:"button",variant:"outline",onClick:()=>{m(e=>e+1)},disabled:o,children:a("profile.reset")})]})]})})}),l?.image&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:a("profile.profileImage")}),e.jsx("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e.jsx("img",{src:l.image,alt:l.name,className:"w-full h-full object-cover"})})]})]}):e.jsx(gr,{})},Rl="bb";function zl(e,t){let n;try{const e=t||("undefined"!=typeof window?window.location.href:"https://localhost");n=new URL(e),n.search=""}catch{n=new URL("https://localhost")}return n.searchParams.set(Rl,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),n.toString()}function Ll(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(Rl);if(!e)return null;const t=function(e){const t={};if(!e)return t;const n=e.split(",");for(const e of n){const n=e.indexOf(":");if(-1===n)continue;const a=decodeURIComponent(e.slice(0,n)),r=decodeURIComponent(e.slice(n+1));a&&(t[a]=r)}return t}(e);return Object.keys(t).length>0?t:null}catch{return null}}function Ml(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(Rl)&&(e.searchParams.delete(Rl),window.history.replaceState({},"",e.toString()))}catch{}}function Bl(e,t){if(null==e)return null;const n=e[t??"monthly"];return n?{included:n.included,...void 0!==n.overage&&{overage:n.overage},...void 0!==n.unitSize&&{unitSize:n.unitSize}}:null}function Ol(e,t,n={}){if(null==e)return null;const{overageInCents:a=!0,currency:r,locale:s="en"}=n,{included:i,overage:o}=e;if(null==o)return{included:i,hasOverage:!1,price:"",unit:""};const c=a?o/100:o,l=(r??"").trim().toUpperCase();let u;if(l&&"number"==typeof c&&Number.isFinite(c))try{u=new Intl.NumberFormat(s,{style:"currency",currency:l,minimumFractionDigits:2}).format(c)}catch{u=`${n.currencySymbol??Vc(r??"")}${c.toFixed(2)}`}else{u=`${n.currencySymbol??Vc(r??"")}${"number"==typeof c?c.toFixed(2):String(o)}`}return{included:i,hasOverage:!0,price:u,unit:t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?`${e.unitSize.toLocaleString(s)} ${t}`:t||""}}const Fl="personal",Wl=(e,t,n="en-US")=>{const a=(t??"").trim();return a?new Intl.NumberFormat(n,{style:"currency",currency:a.toUpperCase(),minimumFractionDigits:2}).format(e/100):(e/100).toFixed(2)},Hl=(e,t="en-US")=>e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):"",Gl=e=>{switch(e){case ra:return"bg-green-100 text-green-800";case aa:return"bg-yellow-100 text-yellow-800";case na:return"bg-gray-100 text-gray-800";case sa:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},$l=({workspaceId:t,hasActiveSubscription:a=!1,onViewPricingPlans:r,limit:s=20})=>{const{t:i,formattingLocale:o}=gn(),{invoices:c,loading:l,error:u,refetch:d}=Wn(t,s),m=c.length>0;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:i("invoices.title")}),e.jsx("p",{className:"text-sm text-gray-600",children:i("invoices.description")})]}),e.jsx(Va,{variant:"ghost",size:"sm",progress:l,onClick:d,disabled:l,children:i("settings.common.refreshAction",{loading:String(l)})})]}),u&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:i("invoices.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:u})]}),e.jsx(Va,{variant:"outline",size:"sm",onClick:d,disabled:l,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.retryAction",{loading:String(l)})})]}),l&&!m?e.jsx("div",{className:"border rounded-lg p-6",children:e.jsx(gr,{})}):m?e.jsx("div",{className:"space-y-2",children:c.map(t=>{const a=(e=>{switch(e.status){case na:case aa:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case ra:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case sa:case ia:return{textKey:"invoices.viewDetails",color:"bg-gray-600 hover:bg-gray-700"};default:return{textKey:"invoices.view",color:"bg-gray-600 hover:bg-gray-700"}}})(t);return e.jsxs("div",{className:"border rounded-lg bg-white hover:shadow-sm transition-shadow p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900 truncate min-w-0",children:t.description||t.number||t.id.slice(-8)}),e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0 ${Gl(t.status)}`,children:i(`invoices.status.${t.status}`)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5 text-sm text-gray-600 mb-2.5",children:[e.jsx("span",{className:"font-medium text-gray-900",children:Wl(t.amount_due,t.currency,o)}),t.created&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-300 hidden sm:inline",children:"·"}),e.jsx("span",{children:Hl(t.created,o)})]}),t.amount_paid>0&&t.amount_due>0&&e.jsx("span",{className:"text-xs text-gray-500",children:i("invoices.paidAmount",{amount:Wl(t.amount_paid,t.currency,o)})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Va,{size:"sm",disabled:!t.hosted_invoice_url,onClick:()=>t.hosted_invoice_url&&window.open(t.hosted_invoice_url,"_blank","noopener,noreferrer"),className:a.color,children:[i(a.textKey),e.jsx(n.ExternalLink,{className:"h-3 w-3 ms-1.5"})]}),t.invoice_pdf&&e.jsxs(Va,{size:"sm",variant:"outline",onClick:()=>window.open(t.invoice_pdf,"_blank","noopener,noreferrer"),children:[e.jsx(n.Download,{className:"h-3 w-3 me-1.5"}),i("invoices.download")]})]})]},t.id)})}):e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsx(n.FileText,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-sm text-gray-500",children:i(a?"invoices.noInvoicesWithSub":"invoices.noInvoices")}),!a&&r&&e.jsx(Va,{size:"sm",className:"mt-4",onClick:r,children:i("subscription.viewPricingPlans")})]})]})},Vl=t.lazy(()=>Promise.resolve().then(function(){return jd}).then(e=>({default:e.default}))),Kl=(e,t)=>{if(!t)return"";try{const n=new Date(t);return isNaN(n.getTime())?"":new Intl.DateTimeFormat(e,{month:"long",day:"numeric",year:"numeric"}).format(n)}catch{return""}},Zl=({workspace:a})=>{const r=a._id?.toString(),{t:s,formattingLocale:i,fmtNum:o,fmtCents:c}=gn(),{settings:l}=Un(),u=l?.workspace?.mode===Fl,{subscription:d,loading:m,error:p,updateSubscription:h,refetch:g}=Fn(r),{createCheckoutSession:f}=Bn(r),{cancelSubscription:b,loading:x}=Gn(r),{resumeSubscription:v,loading:y}=$n(r),{openBillingPortal:w,loading:S}=Hn(r),{versions:k,loading:N,error:j,refetch:A}=Mn(r),C=m||N,E=p||j,{currentVersion:T,latestVersion:P,isDeprecated:_,plansToShow:U}=t.useMemo(()=>{const e=k?.currentVersion,t=k?.availableVersions||[],n=null!=d?.subscription;let a=null;t.length>0?a=t.reduce((e,t)=>t.version>e.version?t:e):e&&(a=e);const r=!!(n&&a&&e)&&a.version>e.version;return{currentVersion:e,latestVersion:a,hasNewerVersion:r,isDeprecated:r&&n,plansToShow:a?.plans&&a.plans.length>0?a.plans:[]}},[k,d?.subscription]),[I,D]=t.useState(!1),[R,z]=t.useState(null),[L,M]=t.useState(null),B=t.useRef(null),[O,F]=t.useState(!1),[W,H]=t.useState(!1);t.useEffect(()=>()=>{B.current&&clearTimeout(B.current)},[]);const[G,$]=t.useState(!1),[V,K]=t.useState("subscription"),Z=async()=>{await Promise.all([g(),A()])},q=t.useMemo(()=>ba(d?.subscription?.stripePriceId,U??[]),[d?.subscription?.stripePriceId,U]);if(C&&!d&&!k)return e.jsx(gr,{});const J=d?.planVersion?._id||null;return r?e.jsxs("div",{className:"space-y-6",children:[E&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("subscription.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:E}),e.jsx("p",{className:"text-xs mt-2 text-red-600",children:s("subscription.errorLoadingDescription")})]}),e.jsx(Va,{variant:"outline",size:"sm",onClick:Z,disabled:C,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.retryAction",{loading:String(C)})})]}),R&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("subscription.updateFailed")}),e.jsx("p",{className:"text-sm mt-1",children:R})]}),e.jsx(Va,{variant:"outline",size:"sm",onClick:()=>z(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.dismiss")})]}),L&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("settings.common.success")}),e.jsx("p",{className:"text-sm mt-1",children:L})]}),e.jsx(Va,{variant:"outline",size:"sm",onClick:()=>M(null),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:s("settings.common.dismiss")})]}),e.jsx("div",{className:"border-b border-gray-200",children:e.jsxs("nav",{className:"-mb-px flex gap-6","aria-label":"Subscription tabs",children:[e.jsx("button",{type:"button",onClick:()=>K("subscription"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("subscription"===V?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:s("subscription.plan")}),e.jsx("button",{type:"button",onClick:()=>K("invoices"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("invoices"===V?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:s("subscription.invoicesTab")})]})}),"subscription"===V&&e.jsxs(e.Fragment,{children:[C&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(n.Loader2,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:s("settings.common.loading")})]}),_&&d?.subscription&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-4 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(n.AlertTriangle,{className:"h-4 w-4 text-amber-600 shrink-0"}),e.jsxs("span",{className:"text-sm text-amber-800",children:[e.jsx("span",{className:"font-medium",children:s("subscription.planUpdateAvailable")}),e.jsxs("span",{className:"text-amber-600",children:[" ","— v",T?.version||"?"," → v",P?.version||"?"]})]})]}),e.jsx(Va,{size:"sm",variant:"outline",className:"shrink-0 border-amber-300 text-amber-700 hover:bg-amber-100",onClick:()=>F(!0),children:s("subscription.viewPlans")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("p",{className:"text-sm text-gray-600",children:s("subscription.managePlan")})}),e.jsxs("div",{className:"flex items-center gap-2",children:[(()=>{const t=d?.subscription?.subscriptionStatus===Xn,n=d?.subscription?.cancelAtPeriodEnd;return n||x?null:t&&U&&U.length>0?e.jsx(Va,{size:"sm",onClick:()=>F(!0),children:s("subscription.viewPricingPlans")}):d?.subscription&&!t?e.jsx(Va,{variant:"outline",size:"sm",onClick:()=>F(!0),children:s("subscription.changePlanButton")}):!d?.subscription&&U&&U.length>0?e.jsx(Va,{size:"sm",onClick:()=>F(!0),children:s("subscription.viewPricingPlans")}):null})(),e.jsx(Va,{variant:"ghost",size:"sm",progress:C,onClick:Z,disabled:C||I,children:s("settings.common.refreshAction",{loading:String(C)})})]})]}),d?.subscription?(()=>{const t=ba(d.subscription.stripePriceId,U??[]),r=t?.interval??null,l=t?.currency??d.plan?.currency??a?.billingCurrency??"",m=r&&d.planVersion?ha(d.planVersion,l,r):null,p=l,h=d.planVersion?xa(d.planVersion,l):null,g=h&&r?va(d.planVersion,l,r):null,f=Array.isArray(a?.users)?a.users.length:1,b=h?.includedSeats??0,v=Math.max(0,f-b),k=null!=m?0===m?s("subscription.free"):c(m,p):null,N=r===Jn.Monthly?s("subscription.billingInterval.perMonth"):r===Jn.Quarterly?s("subscription.billingInterval.perQuarter"):r===Jn.Yearly?s("subscription.billingInterval.perYear"):"";return e.jsxs("div",{className:"border rounded-lg overflow-hidden "+(_?"border-amber-300":"border-gray-200"),children:[d.subscription.subscriptionStatus===Qn&&(()=>{const t=d.subscription.trialEnd||d.subscription.stripeCurrentPeriodEnd,n=t?new Date(t):null,a=n&&!isNaN(n.getTime())?n:null,r=a?Math.max(0,Math.ceil((a.getTime()-Date.now())/864e5)):null,i=null!==r&&r<=3;return e.jsxs("div",{className:"px-4 py-3 sm:px-5 text-sm flex flex-col sm:flex-row sm:items-center justify-between gap-2 "+(i?"bg-amber-50 text-amber-800 border-b border-amber-200":"bg-blue-50 text-blue-800 border-b border-blue-200"),children:[e.jsxs("span",{children:[null!==r&&r<=0?s("subscription.trialEnded"):null!==r?s("subscription.trialEndsIn",{days:r}):s("subscription.onTrial")," ",s("subscription.upgradeToKeepAccess")]}),e.jsx(Va,{size:"sm",variant:i?"default":"outline",className:"shrink-0 "+(i?"":"border-blue-300 text-blue-700 hover:bg-blue-100"),onClick:()=>F(!0),children:s("subscription.upgradePlan")})]})})(),e.jsxs("div",{className:"p-4 sm:p-5 "+(_?"bg-amber-50/50":"bg-gray-50/50"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:d.plan?.name||s("subscription.noPlanAssigned")}),e.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium "+(d.subscription.subscriptionStatus===Yn?d.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":d.subscription.subscriptionStatus===Qn?"bg-blue-100 text-blue-800":d.subscription.subscriptionStatus===Xn?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[d.subscription.subscriptionStatus===Yn&&(d.subscription.cancelAtPeriodEnd?s("subscription.status.canceling"):s("subscription.status.active")),d.subscription.subscriptionStatus===Qn&&s("subscription.status.trial"),d.subscription.subscriptionStatus===Xn&&s("subscription.status.canceled"),d.subscription.subscriptionStatus===ea&&s("subscription.status.pastDue")]}),d.subscription.subscriptionStatus===Qn&&Kl(i,d.subscription.trialEnd||d.subscription.stripeCurrentPeriodEnd)&&e.jsxs("span",{className:"text-xs text-gray-500",children:["(ends"," ",Kl(i,d.subscription.trialEnd||d.subscription.stripeCurrentPeriodEnd),")"]}),_&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-100 text-amber-800",children:[e.jsx(n.AlertTriangle,{className:"h-3 w-3"}),s("subscription.status.deprecated")]})]}),d.plan?.description&&e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:d.plan.description}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-gray-900",children:k||s("invoices.na")}),k&&k!==s("subscription.free")&&N&&e.jsx("span",{className:"text-sm text-gray-500",children:N})]}),h&&g&&g>0&&!u&&e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:s("subscription.perSeatDisplay",{price:c(g,p),interval:N})}),!u&&h&&g&&g>0&&v>0&&k&&k!==s("subscription.free")&&null!=m&&e.jsx("div",{className:"text-xs text-gray-500 mt-1 pt-1 border-t border-gray-200",children:s("subscription.estTotalDisplay",{total:c(m+g*v,p),interval:N,count:v})})]}),(d.subscription.subscriptionStatus===Yn||d.subscription.subscriptionStatus===Qn)&&!d.subscription.cancelAtPeriodEnd&&Kl(i,d.subscription.stripeCurrentPeriodEnd)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(n.Calendar,{className:"h-3.5 w-3.5 flex-shrink-0"}),e.jsx("span",{children:s("subscription.nextBillingDisplay",{date:Kl(i,d.subscription.stripeCurrentPeriodEnd)??""})})]})]}),_&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["Version ",T?.version||s("invoices.na")]}),(d.subscription.subscriptionStatus===Yn||d.subscription.subscriptionStatus===Qn||d.subscription.subscriptionStatus===ea)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-4 pt-4 border-t border-gray-200",children:[d.subscription&&e.jsx(Va,{variant:"outline",size:"sm",onClick:()=>w(),disabled:S,progress:S,children:s(S?"subscription.openingPortal":"subscription.managePayment")}),(d.subscription.subscriptionStatus===Yn||d.subscription.subscriptionStatus===Qn)&&e.jsx(e.Fragment,{children:d.subscription.subscriptionStatus===Yn&&d.subscription.cancelAtPeriodEnd?e.jsx(Va,{variant:"outline",size:"sm",onClick:()=>$(!0),disabled:I||x||y,progress:y,children:s("subscription.resumeTitle")}):e.jsx(Va,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",onClick:()=>H(!0),disabled:I||x||y,progress:x||I,children:x||I?s("subscription.canceling"):d.subscription.subscriptionStatus===Qn?s("subscription.cancelTrial"):s("subscription.cancelTitle")})})]})]}),d.subscription.subscriptionStatus===ea&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(n.AlertTriangle,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:s("subscription.paymentPastDue")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:s("subscription.paymentPastDueDescription")}),e.jsx(Va,{variant:"outline",size:"sm",className:"mt-2 border-red-200 text-red-700 hover:bg-red-100",onClick:()=>K("invoices"),children:s("subscription.viewInvoices")})]})]})}),d.subscription.subscriptionStatus===ea&&d.subscription.dunningState&&d.subscription.dunningState!==ua&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(n.AlertTriangle,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:d.subscription.dunningState===da?s("subscription.dunningFinal"):d.subscription.dunningState===ma?s("subscription.dunningSuspended"):s("subscription.dunningRecovery")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:d.subscription.dunningState===ma?s("subscription.dunningSuspendedDescription"):s("subscription.dunningRecoveryDescription")})]})]})}),d.subscription.subscriptionStatus===ta&&e.jsx("div",{className:"px-5 py-3 bg-blue-50 border-t border-blue-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(n.Calendar,{className:"h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-blue-800",children:s("subscription.subscriptionPaused")}),e.jsx("p",{className:"text-sm text-blue-700 mt-0.5",children:s("subscription.subscriptionPausedDescription")})]})]})}),d.subscription.cancelAtPeriodEnd&&e.jsx("div",{className:"px-5 py-3 bg-amber-50 border-t border-amber-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(n.Calendar,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-amber-800",children:s("subscription.scheduledCancellation")}),e.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:Kl(i,d.subscription.stripeCurrentPeriodEnd)?e.jsxs(e.Fragment,{children:[s("subscription.cancelEndDescription")," ",e.jsx("span",{className:"font-medium",children:Kl(i,d.subscription.stripeCurrentPeriodEnd)}),"."]}):s("subscription.cancelEndFallback")})]})]})}),d.planVersion&&(()=>{const t=((e,t,n=Jn.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const a=[],r=[],s=[];return e.subscriptionItems.forEach(i=>{const o=i.slug;if(i.type===oa){const t=e.features?.[o]??!1;a.push({item:i,enabled:t})}else if(i.type===ca){const t=e.limits?.[o]??0;r.push({item:i,value:t})}else if(i.type===la){const a=t&&e.pricingVariants?.length?fa(e,t,o,n):Bl(e.quotas?.[o],n);null!=a&&s.push({item:i,value:a})}}),{features:a,limits:r,quotas:s}})(d.planVersion,l,r??"monthly");return t.features.length>0||t.limits.length>0||t.quotas.length>0?e.jsx("div",{className:"px-4 py-4 sm:px-5 sm:py-5 border-t border-gray-100",children:e.jsxs("div",{className:"space-y-5",children:[t.features.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:s("subscription.items.features")}),e.jsx("ul",{className:"space-y-1.5",children:t.features.sort(e=>e.enabled?-1:1).map(({item:t,enabled:n})=>e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"w-4 text-center shrink-0 "+(n?"text-green-500":"text-gray-300"),children:n?"✓":"✕"}),e.jsx("span",{className:n?"text-gray-700":"text-gray-400",children:t.name})]},t._id))})]}),t.limits.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:s("subscription.items.limits")}),e.jsx("ul",{className:"space-y-1.5",children:t.limits.map(({item:t,value:n})=>e.jsxs("li",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900",children:n})]},t._id))})]}),t.quotas.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:s("subscription.items.quotas")}),e.jsx("ul",{className:"space-y-1.5",children:t.quotas.map(({item:t,value:n})=>{const a=Ol(n,t.name.toLowerCase(),{currency:l,locale:i}),r=a?a.hasOverage?s("quota.includedWithOverage",{count:a.included,price:a.price,unit:a.unit}):s("quota.includedOnly",{count:a.included}):"—";return e.jsx("li",{className:"text-sm",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-0.5",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900 text-xs sm:text-sm",children:r})]})},t._id)})})]}),h&&!u&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:s("subscription.seats.title")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:s("subscription.seats.members")}),e.jsx("span",{className:"font-semibold text-gray-900",children:o(f)})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:s("subscription.seats.included")}),e.jsx("span",{className:"text-gray-900",children:o(b)})]}),v>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:s("subscription.seats.billable")}),e.jsxs("span",{className:"font-medium text-amber-600",children:[o(v)," ",s("subscription.seats.extra")]})]}),g&&g>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:s("subscription.seats.perExtraSeat")}),e.jsxs("span",{className:"text-gray-900",children:[c(g,l),N]})]}),h.maxSeats>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:s("subscription.seats.limit")}),e.jsx("span",{className:"text-gray-900",children:o(h.maxSeats)})]})]})]})]})}):null})()]})})():a.pendingOnboarding?e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(n.CreditCard,{className:"h-12 w-12 mx-auto mb-3 text-blue-400"}),e.jsx("p",{className:"text-lg font-medium text-gray-700",children:s("subscription.startFreeTrial")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:s("subscription.startTrialDescription")})]}),e.jsx(Va,{size:"sm",progress:I,onClick:async()=>{try{D(!0);const e=await f({planVersionId:a.pendingOnboarding?.planVersionId??""});e&&"checkoutUrl"in e&&e.checkoutUrl&&Ga(e.checkoutUrl)}catch(e){}finally{D(!1)}},children:s("subscription.startFreeTrial")}),U&&U.length>0&&e.jsx(Va,{variant:"ghost",size:"sm",className:"ms-2",onClick:()=>F(!0),children:s("subscription.viewAllPlans")})]}):e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(n.CreditCard,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-lg font-medium text-gray-700",children:s("subscription.noSubscription")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:s("subscription.noSubscriptionDescription")})]}),U&&U.length>0&&e.jsx(Va,{size:"sm",onClick:()=>F(!0),children:s("subscription.viewPricingPlans")})]})]}),!k&&!C&&e.jsxs("div",{className:"border rounded-lg p-4 text-center",children:[e.jsxs("div",{className:"text-gray-500 mb-2",children:[e.jsx("p",{className:"font-medium",children:s("subscription.errorLoading")}),E&&e.jsxs("p",{className:"text-sm mt-2 text-red-600",children:["Error: ",E]}),!E&&e.jsx("p",{className:"text-sm mt-2",children:s("subscription.noPlansAvailable")})]}),e.jsx(Va,{variant:"outline",size:"sm",progress:C,onClick:Z,disabled:C,className:"mt-4",children:s("settings.common.refreshAction",{loading:String(C)})})]})]}),"invoices"===V&&e.jsxs(e.Fragment,{children:[C&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(n.Loader2,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:s("settings.common.loading")})]}),e.jsx($l,{workspaceId:r,hasActiveSubscription:null!==d?.subscription,onViewPricingPlans:()=>K("subscription"),limit:20})]}),U&&U.length>0&&e.jsx(t.Suspense,{fallback:O?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(n.Loader2,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:s("settings.common.loading")})]})}):null,children:e.jsx(Vl,{open:O,onOpenChange:F,planVersions:U,currentPlanVersionId:J||null,currentStripePriceId:d?.subscription?.stripePriceId,billingCurrency:a.billingCurrency,currentMemberCount:Array.isArray(a?.users)?a.users.length:void 0,onSelectPlan:async(e,t=Jn.Monthly,n)=>{if(!r)return;const i=U?.find(t=>t._id===e),o=n??q?.currency??d?.plan?.currency??a?.billingCurrency??"",c=i?function(e,t,n){const a=pa(e,t);if(!a?.stripePrices)return null;const r=n===Jn.Monthly?"monthlyPriceId":n===Jn.Yearly?"yearlyPriceId":"quarterlyPriceId",s=n===Jn.Monthly?"monthly":n===Jn.Yearly?"yearly":void 0;return a.stripePrices[r]??(s?a.stripePrices[s]:void 0)??null}(i,o,t):null,l=d?.subscription?.stripePriceId;if(!c||!l||c!==l){D(!0),z(null),M(null);try{const{successUrl:n,cancelUrl:a}=function(e){const t="undefined"!=typeof window?window.location.href:void 0;return{successUrl:zl({action:"checkout",status:"success",ws:e,screen:"subscription"},t),cancelUrl:zl({action:"checkout",status:"cancel",ws:e,screen:"subscription"},t)}}(r);let i;const c=d?.subscription?.subscriptionStatus===Xn;if(i=d?.subscription&&!c?await h(e,{billingInterval:t,successUrl:n,cancelUrl:a}):await f({planVersionId:e,billingInterval:t,currency:o||void 0,successUrl:n,cancelUrl:a}),i&&"checkoutUrl"in i&&i.checkoutUrl)return void Ga(i.checkoutUrl);M(s("subscription.updateSuccess")),await Z()}catch(e){const t=e instanceof Error?e.message:s("subscription.errorProcessing");z(t)}finally{D(!1),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{z(null),M(null)},5e3)}}},loading:I||C})}),e.jsx(ar,{open:G,onOpenChange:$,children:e.jsxs(or,{children:[e.jsxs(cr,{children:[e.jsx(ur,{children:s("subscription.resumeTitle")}),e.jsx(dr,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:s("subscription.resumeConfirm")}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(n.AlertTriangle,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[s("subscription.resumeChargeDate")," ",d?.subscription?.stripeCurrentPeriodEnd&&Kl(i,d.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:Kl(i,d.subscription.stripeCurrentPeriodEnd)}):s("subscription.resumeChargeFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-amber-600 mt-0.5",children:"•"}),e.jsx("span",{children:s("subscription.resumeContinue")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:s("subscription.resumeCancelAnytime")})]})]})]})})]}),e.jsxs(lr,{children:[e.jsx(pr,{disabled:y,children:s("subscription.resumeKeep")}),e.jsx(mr,{onClick:async()=>{if(r){$(!1),D(!0),z(null),M(null);try{await v(),M(s("subscription.resumeSuccess")),await Z()}catch(e){const t=e instanceof Error?e.message:s("subscription.errorResuming");z(t)}finally{D(!1),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{z(null),M(null)},5e3)}}},disabled:y,children:s(y?"subscription.resuming":"subscription.resumeButton")})]})]})}),e.jsx(ar,{open:W,onOpenChange:H,children:e.jsxs(or,{children:[e.jsxs(cr,{children:[e.jsx(ur,{children:s("subscription.cancelTitle")}),e.jsx(dr,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:s("subscription.cancelConfirm")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsxs("span",{children:[s("subscription.retainAccess")," ",d?.subscription?.stripeCurrentPeriodEnd&&Kl(i,d.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:Kl(i,d.subscription.stripeCurrentPeriodEnd)}):s("subscription.retainAccessFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsx("span",{children:s("subscription.cancelNotCharged")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:s("subscription.cancelResumeAnytime")})]})]})]})})]}),e.jsxs(lr,{children:[e.jsx(pr,{disabled:x,children:s("subscription.cancelKeep")}),e.jsx(mr,{onClick:async()=>{if(r){H(!1),D(!0),z(null),M(null);try{await b(),M(s("subscription.cancelSuccess")),await Z()}catch(e){const t=e instanceof Error?e.message:s("subscription.errorCanceling");z(t)}finally{D(!1),B.current&&clearTimeout(B.current),B.current=setTimeout(()=>{z(null),M(null)},5e3)}}},disabled:x,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:s(x?"subscription.canceling":"subscription.cancelButton")})]})]})})]}):e.jsx("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:e.jsx("p",{children:s("subscription.invalidWorkspace")})})};function ql(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Jl(e,t,n){return t+e.toLocaleString(n,{minimumFractionDigits:2,maximumFractionDigits:2})}function Yl(e){try{const t=new Date(e);if(isNaN(t.getTime()))return null;const n=new Date;return Math.ceil((t.getTime()-n.getTime())/864e5)}catch{return null}}const Ql=()=>{const{quotas:a,loading:r,error:s,refetch:i}=Wa(),{t:o,formattingLocale:c,fmtNum:l}=gn(),u=(e,t)=>Jl(e,t,c),{response:d}=qn(),[m,p]=t.useState(!1),h=t.useMemo(()=>{const e={};if(!d?.planVersion||!d?.subscription)return e;const t=d.planVersion,n=d.subscription,r=n.billingInterval??"monthly",s=n.plan?.currency??"usd",i=Vc(s);if(!a)return e;for(const n of Object.keys(a)){const o=ga(t,s,n,r);if(null==o||o<=0)continue;const c=t.quotas?.[n],l=c?.[r],u=l?.unitSize??1,d=a[n].overage,m=(u>1?Math.ceil(d/u):d)*o/100;e[n]={overageCents:o,unitSize:u,currency:s,currencySymbol:i,estimatedCost:m}}return e},[d,a]),g=t.useMemo(()=>{const e=d?.subscription?.stripeCurrentPeriodEnd;if(!e)return null;const t=function(e,t="en-US"){try{const n=new Date(e);return isNaN(n.getTime())?"":new Intl.DateTimeFormat(t,{month:"short",day:"numeric",year:"numeric"}).format(n)}catch{return""}}(e,c);return t?{endDate:t,daysRemaining:Yl(e)}:null},[d,c]),f=async()=>{p(!0);try{await i()}finally{p(!1)}};if(r&&!a)return e.jsx(gr,{});if(s)return e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:o("usage.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:s})]}),e.jsx(Va,{variant:"outline",size:"sm",onClick:f,disabled:m,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:o("settings.common.retryAction",{loading:String(m)})})]});const b=function(e){return[...e].sort(([,e],[,t])=>{if(e.hasOverage&&!t.hasOverage)return-1;if(!e.hasOverage&&t.hasOverage)return 1;const n=e.included>0?e.consumed/e.included:e.consumed>0?1:0;return(t.included>0?t.consumed/t.included:t.consumed>0?1:0)-n})}(a?Object.entries(a):[]);if(0===b.length)return e.jsxs("div",{className:"border rounded-lg p-8 text-center",children:[e.jsx(n.BarChart3,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-gray-600",children:o("usage.noData")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:o("usage.noDataHint")})]});const x=b.filter(([,e])=>e.hasOverage).length,v=b.length>0?Math.round(b.reduce((e,[,t])=>e+(t.included>0?t.consumed/t.included*100:0),0)/b.length):0,y=Object.values(h).reduce((e,t)=>e+t.estimatedCost,0),w=Object.values(h)[0]?.currencySymbol??"$";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-gray-600",children:o("usage.description")}),e.jsxs(Va,{variant:"ghost",size:"sm",onClick:f,disabled:m,children:[e.jsx(n.RefreshCw,{className:U("h-3.5 w-3.5 me-1.5",m&&"animate-spin")}),o("settings.common.refreshAction",{loading:String(m)})]})]}),g&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(n.Calendar,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e.jsxs("span",{children:[o("usage.resetDateDisplay",{date:g.endDate}),null!==g.daysRemaining&&g.daysRemaining>0&&e.jsxs("span",{className:"text-gray-500",children:[" (",o("usage.daysRemainingDisplay",{count:g.daysRemaining}),")"]}),null!==g.daysRemaining&&g.daysRemaining<=0&&e.jsxs("span",{className:"text-amber-600 font-medium",children:[" (",o("usage.renewingSoon"),")"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 sm:gap-3",children:[e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:o("usage.totalResources")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:l(b.length)})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:o("usage.overallUsage")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:l(v)+"%"})]}),e.jsxs("div",{className:U("border rounded-lg p-3 sm:p-4",x>0?"border-red-200 bg-red-50":"border-gray-200"),children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:o("usage.inOverage")}),e.jsx("p",{className:U("text-lg sm:text-xl font-semibold mt-1",x>0?"text-red-600":"text-gray-900"),children:l(x)})]}),x>0&&y>0&&e.jsxs("div",{className:"border border-red-200 bg-red-50 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:o("usage.estOverageCost")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold mt-1 text-red-600",children:u(y,w)})]})]}),x>0&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(n.AlertTriangle,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5 hidden sm:block"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-sm font-semibold text-amber-800 mb-1",children:o("usage.overageDetected")}),e.jsx("p",{className:"text-sm text-amber-700",children:o("usage.overageWarning",{count:x})}),y>0&&e.jsx("p",{className:"text-sm text-amber-700 font-medium mt-1",children:o("usage.estOverageCharges",{amount:u(y,w)})})]})]})}),e.jsx("div",{className:"space-y-3",children:b.map(([t,n])=>{const a=(r=n.consumed,(s=n.included)<=0?r>0?100:0:Math.min(r/s*100,100));var r,s;const i=function(e,t){return t?{bar:"bg-red-500",bg:"bg-red-100",badge:"bg-red-100",badgeText:"text-red-800"}:e>=90?{bar:"bg-amber-500",bg:"bg-amber-100",badge:"bg-amber-100",badgeText:"text-amber-800"}:e>=75?{bar:"bg-yellow-500",bg:"bg-yellow-100",badge:"bg-yellow-100",badgeText:"text-yellow-800"}:{bar:"bg-blue-500",bg:"bg-blue-100",badge:"bg-blue-100",badgeText:"text-blue-800"}}(a,n.hasOverage),o=h[t];return e.jsx(Xl,{slug:t,quota:n,percent:a,colors:i,pricing:o},t)})})]})};function Xl({slug:t,quota:n,percent:a,colors:r,pricing:s}){const{t:i,formattingLocale:o}=gn(),c=e=>function(e,t){return e>=1e6?(e/1e6).toLocaleString(t,{maximumFractionDigits:1})+"M":e>=1e3?(e/1e3).toLocaleString(t,{maximumFractionDigits:1})+"K":e.toLocaleString(t)}(e,o),l=(e,t)=>Jl(e,t,o);return e.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 sm:p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-1 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 truncate",children:ql(t)}),n.hasOverage&&e.jsx("span",{className:U("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",r.badge,r.badgeText),children:i("usage.overage")}),!n.hasOverage&&a>=90&&e.jsx("span",{className:U("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",r.badge,r.badgeText),children:i("usage.almostFull")})]}),e.jsxs("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[c(n.consumed)," / ",c(n.included)]})]}),e.jsx("div",{className:U("h-2 rounded-full w-full",r.bg),children:e.jsx("div",{className:U("h-2 rounded-full transition-all duration-500",r.bar),style:{width:`${a}%`}})}),e.jsxs("div",{className:"flex items-center justify-between mt-2 text-xs text-gray-500",children:[e.jsx("span",{children:i("usage.percentUsed",{percent:Math.round(a)})}),e.jsx("span",{children:n.available>0?i("usage.availableRemaining",{count:c(n.available)}):n.hasOverage?i("usage.overLimitCount",{count:c(n.overage)}):i("usage.fullyUsed")})]}),n.hasOverage&&s&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.overageUnits")}),e.jsx("span",{className:"font-medium text-gray-900",children:c(n.overage)})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.rate")}),e.jsx("span",{className:"font-medium text-gray-900",children:i("usage.rateDisplay",{rate:l(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})]}),s.unitSize>1&&e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.billableBlocks")}),e.jsx("span",{className:"font-medium text-gray-900",children:Math.ceil(n.overage/s.unitSize).toLocaleString(o)})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs pt-2 border-t border-gray-200",children:[e.jsx("span",{className:"font-medium text-red-600",children:i("usage.estimatedCharge")}),e.jsx("span",{className:"font-semibold text-red-600",children:l(s.estimatedCost,s.currencySymbol)})]})]}),!n.hasOverage&&s&&e.jsx("div",{className:"mt-2 text-xs text-gray-500",children:i("usage.overageRateDisplay",{rate:i("usage.rateDisplay",{rate:l(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})})]})}const eu=E.Root,tu=w.forwardRef(({className:t,children:n,...a},r)=>e.jsxs(E.Trigger,{ref:r,className:U("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:[n,e.jsx(E.Icon,{asChild:!0,children:e.jsx(l.CaretSortIcon,{className:"h-4 w-4 opacity-50"})})]}));tu.displayName=E.Trigger.displayName;const nu=w.forwardRef(({className:t,children:n,position:a="popper",...r},s)=>{const{container:i}=w.useContext(Ka);return e.jsx(E.Portal,{container:i,children:e.jsx(E.Content,{ref:s,className:U("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===a&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,...r,children:e.jsx(E.Viewport,{className:U("p-1","popper"===a&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n})})})});nu.displayName=E.Content.displayName;w.forwardRef(({className:t,...n},a)=>e.jsx(E.Label,{ref:a,className:U("px-2 py-1.5 text-sm font-semibold",t),...n})).displayName=E.Label.displayName;const au=w.forwardRef(({className:t,children:n,...a},r)=>e.jsxs(E.Item,{ref:r,className:U("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 ps-2 pe-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[e.jsx("span",{className:"absolute end-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(E.ItemIndicator,{children:e.jsx(l.CheckIcon,{className:"h-4 w-4"})})}),e.jsx(E.ItemText,{children:n})]}));au.displayName=E.Item.displayName;function ru(e,n){const{response:a}=qn();return t.useMemo(()=>{if(!e)return{hasSeatPricing:!1,memberCount:0,includedSeats:0,maxUsers:0,maxSeats:0,limitSource:"none",billableSeats:0,availableSeats:1/0,isAtMax:!1,isNearMax:!1,perSeatPriceCents:null,currency:"",canInvite:!0,inviteBlockReason:null,inviteBlockMessageKey:null,inviteBlockMessageValues:null};const t=e.users?.length??0,r=a?.planVersion,s=a?.subscription,i=e.billingCurrency||"usd",o=ya({planVersion:r,currency:i,settingsMaxUsers:n?.settingsMaxUsers}),{maxUsers:c,hasSeatPricing:l,includedSeats:u}=o,d=l?Math.max(0,t-u):0,m=c>0?Math.max(0,c-t):1/0,p=c>0&&t>=c,h=c>0&&t>=.8*c&&!p,g=l&&r?va(r,i,s?.billingInterval??"monthly"):null,f=wa({memberCount:t,maxUsersConfig:o});return{hasSeatPricing:l,memberCount:t,includedSeats:u,maxUsers:c,maxSeats:c,limitSource:o.source,billableSeats:d,availableSeats:m,isAtMax:p,isNearMax:h,perSeatPriceCents:g,currency:i,canInvite:f.canInvite,inviteBlockReason:f.blockReason,inviteBlockMessageKey:f.blockMessageKey,inviteBlockMessageValues:f.blockMessageValues}},[a,e,n?.settingsMaxUsers])}w.forwardRef(({className:t,...n},a)=>e.jsx(E.Separator,{ref:a,className:U("-mx-1 my-1 h-px bg-muted",t),...n})).displayName=E.Separator.displayName;const su=({workspace:a})=>{const{user:r}=wu(),{t:s,fmtNum:i,fmtCents:o}=gn(),[c,l]=t.useState(0),[u,d]=t.useState(!1),[m,p]=t.useState([]),[g,f]=t.useState(null),{getUsers:b,removeUser:x,updateUser:v}=Ba(),{settings:y}=Un(),{response:w}=qn(),S=ru(a,{settingsMaxUsers:y?.workspace?.maxWorkspaceUsers});t.useEffect(()=>{a&&(d(!0),b(a._id).then(e=>{p(e)}).catch(e=>{W(e,{component:"WorkspaceSettingsUsers",action:"getUsers",metadata:{workspaceId:a._id}})}).finally(()=>{d(!1)}))},[a,c]);const k=()=>{l(e=>e+1)};if(u||!a)return e.jsx(gr,{});const N=e=>"string"==typeof e?{name:s("users.unknownUser"),email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},j=m.map(e=>({...e,...N(e.user)})),A=m.find(e=>("string"==typeof e.user?e.user:e.user._id)===r?.id)?.role,C="admin"===A,{hasSeatPricing:E,includedSeats:T,maxUsers:P,canInvite:_,inviteBlockReason:U,inviteBlockMessageKey:I,inviteBlockMessageValues:D,perSeatPriceCents:R,currency:z}=S,L=m.length,M=w?.subscription?.billingInterval??"monthly",B=E&&L>=T;return e.jsxs("div",{children:[!C&&e.jsx("div",{className:"text-red-500",children:s("users.adminOnly")}),C&&!1!==y?.workspace?.canInviteMembers&&e.jsx("div",{className:"mb-4",children:_?e.jsxs("div",{children:[e.jsx(iu,{onInvite:k,workspaceId:a._id}),B&&R&&R>0&&e.jsx("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-amber-600 bg-amber-50 px-3 py-1.5 rounded-md",children:e.jsx("span",{children:s("users.extraSeatCost",{price:o(R,z),interval:M})})})]}):e.jsx("div",{className:"flex items-center justify-between p-3 bg-red-50 border border-red-100 rounded-md",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-700",children:s("users.limitReached",{reason:U??"member_limit_reached"})}),e.jsx("p",{className:"text-xs text-red-600 mt-0.5",children:I?s(I,D??void 0):""})]})})}),(E||P>0)&&e.jsxs("div",{className:"mb-4 rounded-lg border bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:s("users.seatHeading",{hasSeatPricing:String(E)})}),P>0&&e.jsxs("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full "+(L>=P?"bg-red-100 text-red-700":L>=.8*P?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),children:[i(L)," / ",i(P)]})]}),P>0&&e.jsx("div",{className:"w-full h-1.5 bg-gray-200 rounded-full mb-3",children:e.jsx("div",{className:"h-1.5 rounded-full transition-all "+(L>=P?"bg-red-500":L>=.8*P?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,L/P*100)}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[e.jsx("div",{children:E?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:i(T)})," ",s("users.included"),R&&R>0&&e.jsxs("span",{className:"text-gray-400",children:[" · ",o(R,z),s("users.perExtraSeat")]})]}):e.jsxs("span",{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:i(P)})," ",s("users.maxMembers")]})}),P>0?e.jsxs("span",{children:[i(Math.max(0,P-L))," ",s("users.available")]}):e.jsx("span",{className:"text-gray-400",children:s("users.noMemberLimit")})]})]}),e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("div",{className:"text-sm text-gray-600",children:s("users.memberCount",{count:L})})}),e.jsx("div",{children:e.jsx(Va,{variant:"ghost",size:"sm",onClick:k,progress:u,children:s("settings.common.refreshAction",{loading:String(u)})})})]}),e.jsx("ul",{className:"space-y-2",children:j.map((t,i)=>{const o=t.id===r?.id,c=("object"==typeof a.createdBy&&null!==a.createdBy?a.createdBy._id:a.createdBy)===t.id;return e.jsxs("li",{className:"border rounded p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium shrink-0",children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[o&&e.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded",children:s("users.you")}),c&&e.jsx("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-0.5 rounded",children:s("users.owner")})]})]}),C&&e.jsxs("div",{className:"flex items-center gap-2 mt-2 pt-2 border-t border-gray-100 sm:mt-0 sm:pt-0 sm:border-0",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-initial",children:[e.jsxs(eu,{disabled:o||!C||c||g===t.id,value:t.role,onValueChange:e=>{return n=a._id,r=t.id,s=e,void(La(a,r)?W(new Error("Cannot change the role of the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:r,role:s}}):(f(r),v(n,r,{role:s}).then(()=>{k()}).catch(e=>{W(e,{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:r,role:s}})}).finally(()=>{f(null)})));var n,r,s},children:[e.jsx(tu,{children:e.jsx(h.SelectValue,{placeholder:s("users.selectRole")})}),e.jsx(nu,{children:a?.roles.map(t=>e.jsx(au,{value:t,children:t},t))})]}),g===t.id&&e.jsx("div",{className:"absolute end-8 top-1/2 -translate-y-1/2 pointer-events-none",children:e.jsx(n.Loader2,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!o&&!c&&e.jsx(Va,{variant:"destructive",size:"sm",startIcon:e.jsx(n.TrashIcon,{}),onClick:()=>{return e=t.id,void(La(a,e)?W(new Error("Cannot remove the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:a._id,userId:e}}):x(a._id,e).then(()=>{k()}).catch(t=>{W(t,{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:a._id,userId:e}})}));var e}})]})]},i)})}),0===m.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:s("users.noMembers")})]})};function iu({onInvite:n,workspaceId:a}){const{t:r}=gn(),{addUser:s,getWorkspace:i}=Ba(),{settings:o}=Un(),[c,l]=t.useState(""),[u,d]=t.useState("admin"),[m,p]=t.useState(!1),[g,f]=t.useState(null),[b,x]=t.useState(null),[v,y]=t.useState(null),w=t.useRef(null),S=o?.workspace.roles??v?.roles??[];t.useEffect(()=>()=>{w.current&&clearTimeout(w.current)},[]),t.useEffect(()=>{a&&i(a).then(y)},[a]);const k=()=>{f(null),x(null),l(""),d("admin")};return e.jsxs("div",{className:"flex gap-2 flex-col gap-y-2",children:[g&&e.jsx("div",{className:"text-red-500",children:g}),b&&e.jsx("div",{className:"text-green-500",children:b}),e.jsxs("div",{children:[e.jsx(Zc,{children:r("users.inviteByEmail")}),e.jsx(sl,{type:"email",value:c,onChange:e=>l(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(Zc,{children:r("users.role")}),e.jsxs(eu,{value:u,onValueChange:d,children:[e.jsx(tu,{children:e.jsx(h.SelectValue,{placeholder:r("users.selectRole")})}),e.jsx(nu,{children:S.map(t=>e.jsx(au,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(Va,{progress:m,onClick:async()=>{const e=c.trim();if(!e)return void f(r("users.emailRequired"));/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(p(!0),await s(a,e,u).then(()=>{x(r("users.inviteSuccess")),n?.()}).catch(t=>{W(t,{component:"InviteMember",action:"addUser",metadata:{workspaceId:a,email:e,role:u}}),f(t instanceof Error?t.message:r("users.inviteFailed"))}).finally(()=>{p(!1),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{k()},6e3)})):f(r("users.invalidEmail"))},disabled:m||!c||!u,children:m?r("users.inviting"):r("users.inviteAs",{role:u})})})]})}const ou={firefox:4,safari:4,edge:4,chrome:4},cu=()=>{const{isSupported:a,permission:r,isSubscribed:s,loading:i,error:o,subscribe:c,unsubscribe:l}=Au(),{t:u}=gn(),d=t.useMemo(()=>function(){const e="undefined"!=typeof navigator?navigator.userAgent:"";return e.includes("Firefox")?"firefox":e.includes("Safari")&&!e.includes("Chrome")?"safari":e.includes("Edg")?"edge":"chrome"}(),[]),m=ou[d];return a?e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-sm text-gray-600",children:u("notifications.manageDescription")}),o&&"denied"!==r&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:o}),"denied"===r&&e.jsx("div",{className:"border border-amber-200 bg-amber-50 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(n.ShieldAlert,{className:"h-5 w-5 text-amber-600 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-amber-800",children:u("notifications.blocked")}),e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:u("notifications.blockedDescription")}),e.jsx("ol",{className:"text-xs text-amber-700 mt-2 space-y-1 list-decimal list-inside",children:Array.from({length:m},(t,n)=>e.jsx("li",{children:u(`notifications.unblock.${d}.step${n+1}`)},n))})]})]})}),"denied"!==r&&e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 p-2 rounded-lg "+(s?"bg-green-100":"bg-gray-100"),children:s?e.jsx(n.Bell,{className:"h-4 w-4 text-green-600"}):e.jsx(n.BellOff,{className:"h-4 w-4 text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900",children:u("notifications.pushTitle")}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:u("notifications.pushDescription",{subscribed:String(s)})})]})]}),e.jsx(Va,{variant:s?"outline":"default",size:"sm",className:"shrink-0",onClick:s?l:c,disabled:i,progress:i,children:u("notifications.toggleAction",{loading:String(i),subscribed:String(s)})})]}),s&&e.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 text-xs text-gray-500",children:u("notifications.deviceNote")})]})]}):e.jsx("div",{className:"text-sm text-gray-500",children:u("notifications.notSupported")})},lu=({workspace:t,section:a,setSection:r})=>{const{t:s}=gn(),{user:i}=wu(),{settings:o}=Un(),c=o?.workspace?.mode===Fl,l=("object"==typeof t.createdBy&&null!==t.createdBy?t.createdBy._id:t.createdBy)===i?.id,u=Ma(t,i?.id??null),d=l||"admin"===u?.toLowerCase();return e.jsxs("div",{className:"w-44 sm:w-56 h-full flex flex-col space-y-4 sm:space-y-6 shrink-0",children:[t&&e.jsx("div",{className:"border-b p-2 py-4",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[t.image&&t.image.trim()&&e.jsx("div",{className:"bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",style:{width:"40px",height:"40px",minWidth:"40px",minHeight:"40px"},children:e.jsx("img",{src:t.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"},alt:t.name})}),e.jsxs("div",{className:U("flex-1 min-w-0",t.image?"":"ps-2"),children:[e.jsx("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e.jsx(uu,{title:s("settings.sidebar.account"),children:e.jsx(du,{activeSection:a,icon:e.jsx(n.UserIcon,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.profile"),section:mu.Profile,onClick:()=>r(mu.Profile)})}),e.jsxs(uu,{title:s("settings.sidebar.workspace"),children:[e.jsx(du,{activeSection:a,icon:e.jsx(n.SettingsIcon,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.general"),section:mu.General,onClick:()=>r(mu.General)}),!c&&e.jsx(du,{activeSection:a,icon:e.jsx(n.UsersIcon,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.users"),section:mu.Users,onClick:()=>r(mu.Users)}),e.jsx(du,{activeSection:a,icon:e.jsx(n.CreditCard,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.subscription"),section:mu.Subscription,onClick:()=>r(mu.Subscription)}),e.jsx(du,{activeSection:a,icon:e.jsx(n.BarChart3,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.usage"),section:mu.Usage,onClick:()=>r(mu.Usage)}),e.jsx(du,{activeSection:a,icon:e.jsx(n.ToggleRight,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.features"),section:mu.Features,onClick:()=>r(mu.Features)}),e.jsx(du,{activeSection:a,icon:e.jsx(n.Bell,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.notifications"),section:mu.Notifications,onClick:()=>r(mu.Notifications)}),d&&!c&&e.jsx(du,{activeSection:a,icon:e.jsx(n.AlertTriangle,{className:"h-3.5 w-3.5"}),label:s("settings.sidebar.danger"),section:mu.Danger,onClick:()=>r(mu.Danger)})]})]})};function uu({title:t,children:n}){return e.jsxs("div",{className:"px-2 flex flex-col space-y-1",children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:t}),n]})}function du({icon:t,label:n,section:a,onClick:r,activeSection:s}){return e.jsxs("button",{className:U("flex w-full text-start px-2 py-1 rounded text-sm items-center gap-x-1",a===s?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>r(a),children:[t,n]})}const mu={Profile:"profile",General:"general",Users:"users",Subscription:"subscription",Usage:"usage",Features:"features",Notifications:"notifications",Danger:"danger"},pu=new Set(Object.values(mu)),hu={[mu.Profile]:"settings.titles.profile",[mu.General]:"settings.titles.general",[mu.Users]:"settings.titles.users",[mu.Subscription]:"settings.titles.subscription",[mu.Usage]:"settings.titles.usage",[mu.Features]:"settings.titles.features",[mu.Notifications]:"settings.titles.notifications",[mu.Danger]:"settings.titles.danger"},gu=({workspace:a,onClose:r,open:s,onOpenChange:i,defaultSection:o=mu.Profile,section:c,onSectionChange:l,showTrigger:u=!0,trigger:d})=>{const{t:m,dir:p}=gn(),[h,g]=t.useState(!1),[f,b]=t.useState(o),x=void 0!==s?s:h,v=i||g,y=void 0!==c?c:f,w=l||b;if(!a)return null;const S=e.jsx(Va,{variant:"outline",size:"icon",children:e.jsx(n.Settings,{className:"h-4 w-4"})});return e.jsxs(qa,{open:x,onOpenChange:e=>{v(e),!e&&r&&r()},children:[u&&e.jsx(Ja,{asChild:!0,children:d||S}),e.jsxs(Xa,{dir:p,className:"flex max-w-2xl min-w-full sm:min-w-[800px] p-0 m-0 bg-muted sm:min-h-[600px] min-h-full gap-x-0 space-x-0",children:[e.jsx(nr,{className:"sr-only",children:m(hu[y])}),e.jsx(lu,{workspace:a,section:y,setSection:w}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsx(tr,{className:"text-xl font-bold mb-4",children:m(hu[y])}),e.jsxs("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[y===mu.Profile&&e.jsx(Dl,{workspace:a}),y===mu.General&&e.jsx(ml,{workspace:a}),y===mu.Users&&e.jsx(su,{workspace:a}),y===mu.Subscription&&e.jsx(Zl,{workspace:a}),y===mu.Usage&&e.jsx(Ql,{}),y===mu.Features&&e.jsx(xr,{workspaceId:a._id?.toString()}),y===mu.Notifications&&e.jsx(cu,{}),y===mu.Danger&&e.jsx(fr,{workspace:a})]})]})]})]})};var fu=Object.freeze({__proto__:null,SETTINGS_SCREENS:pu,SettingsScreen:mu,WorkspaceSettingsDialog:gu,default:gu});const bu=new class{constructor(){this.listeners=new Set,this.currentState={open:!1,section:mu.Profile}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getState(){return{...this.currentState}}openWorkspaceSettings(e){this.currentState={open:!0,section:e||mu.Profile},this.notifyListeners()}closeSettings(){this.currentState={...this.currentState,open:!1},this.notifyListeners()}setSection(e){this.currentState={...this.currentState,section:e},this.notifyListeners()}notifyListeners(){this.listeners.forEach(e=>{e(this.currentState.open,this.currentState.section)})}};function xu(e,t,n){const a=e._id||e.id;if(!a||"string"!=typeof a)throw new Error("User data missing required ID field");if(!e.email||"string"!=typeof e.email)throw new Error("User data missing required email field");return{id:a,name:e.name||"",org:t,email:e.email,emailVerified:!0,clientId:n,role:e.role||"",image:e.image}}function vu(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function yu(){return Be(e=>e.auth)}function wu(){const{t:e}=gn(),n=Cn(),a=yu(),r=Pn(),{serverUrl:s,orgId:i,auth:o}=r,{resetCurrentWorkspace:c,currentWorkspace:l}=Ba(),u=t.useMemo(()=>new Ha({serverUrl:s,version:r.version}),[s,r.version]),d=t.useCallback(async()=>{n.auth($());try{const t=await u.requestAuth({orgId:i,clientId:o?.clientId??"",redirect:{success:o?.redirectUrl||window.location.href,error:o?.redirectUrl||window.location.href}});if(!t.success)throw n.auth(K()),new Error(t.message||e("errors.generic"));Ga(t.data.redirectUrl)}catch(e){throw n.auth(K()),W(e,{component:"useSaaSAuth",action:"signIn"}),e}},[u,i,o,n]),m=t.useCallback(async()=>{try{o?.callbacks?.onSignOut&&"function"==typeof o.callbacks.onSignOut&&await o.callbacks.onSignOut()}catch(e){W(e,{component:"useSaaSAuth",action:"signOut"})}finally{xn(vn),n.auth(q()),c()}},[n,c,o?.callbacks?.onSignOut]),p=t.useCallback(e=>{l?bu.openWorkspaceSettings(e):W(new Error("Cannot open settings: No current workspace"),{component:"useSaaSAuth",action:"openWorkspaceSettings"})},[l]),h=t.useMemo(()=>X(a.status),[a.status]);return t.useMemo(()=>({user:a.session?.user,session:a.session,status:a.status,...h,signIn:d,signOut:m,openWorkspaceSettings:p}),[a.session,a.status,h,d,m,p])}class Su extends jn{constructor(e){super({...e,requireOrgId:!0})}async getVapidPublicKey(){return this.fetchJson("push/vapid-public-key")}async subscribe(e,t){await this.fetchJson("push/subscribe",{method:"POST",body:JSON.stringify({endpoint:e.endpoint,keys:e.keys,userAgent:t})})}async unsubscribe(e){await this.fetchJson("push/unsubscribe",{method:"DELETE",body:JSON.stringify({endpoint:e})})}}const ku=t.createContext(null);function Nu(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),n=atob(t),a=new Uint8Array(n.length);for(let e=0;e<n.length;e++)a[e]=n.charCodeAt(e);return a}const ju=t.memo(function({children:n,serviceWorkerPath:a="/push-sw.js",autoSubscribe:r=!1}){const{t:s}=gn(),i=Pn(),{isAuthenticated:o}=wu(),c=t.useMemo(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=t.useMemo(()=>new Su({serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}),[i.serverUrl,i.version,i.orgId]),[u,d]=t.useState({permission:c?Notification.permission:"default",isSubscribed:!1,isSupported:c,loading:!1,error:null});t.useEffect(()=>{if(!o||!c)return;let e=!1;return(async()=>{try{const t=await navigator.serviceWorker.getRegistration(a);if(e)return;if(!t)return void d(e=>({...e,isSubscribed:!1}));const n=await t.pushManager.getSubscription();if(e)return;d(e=>({...e,isSubscribed:!!n,permission:Notification.permission}))}catch{e||d(e=>({...e,isSubscribed:!1}))}})(),()=>{e=!0}},[o,c,a]);const m=t.useCallback(async()=>{if(!c)return!1;const e=await Notification.requestPermission();return d(t=>({...t,permission:e})),"granted"===e},[c]),p=t.useCallback(async()=>{if(c&&o){d(e=>({...e,loading:!0,error:null}));try{if(!await m())return void d(e=>({...e,loading:!1,error:s("notifications.permissionDenied")}));const{publicKey:e}=await l.getVapidPublicKey(),t=await navigator.serviceWorker.register(a);await navigator.serviceWorker.ready;const n=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Nu(e)})).toJSON();await l.subscribe({endpoint:n.endpoint,keys:{p256dh:n.keys.p256dh,auth:n.keys.auth}},navigator.userAgent),d(e=>({...e,isSubscribed:!0,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToSubscribe");d(e=>({...e,loading:!1,error:t})),W(e,{component:"PushNotificationProvider",action:"subscribe"})}}},[c,o,l,a,m]),h=t.useCallback(async()=>{if(c){d(e=>({...e,loading:!0,error:null}));try{const e=await navigator.serviceWorker.getRegistration(a);if(e){const t=await e.pushManager.getSubscription();if(t){const e=t.endpoint;await t.unsubscribe(),await l.unsubscribe(e)}}d(e=>({...e,isSubscribed:!1,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToUnsubscribe");d(e=>({...e,loading:!1,error:t})),W(e,{component:"PushNotificationProvider",action:"unsubscribe"})}}},[c,l,a]),g=t.useMemo(()=>({...u,requestPermission:m,subscribe:p,unsubscribe:h}),[u,m,p,h]);return e.jsx(ku.Provider,{value:g,children:n})});function Au(){const e=t.useContext(ku);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}let Cu=!1,Eu=null;const Tu=t.memo(({children:n,callbacks:a})=>{const r=Cn(),s=yu(),i=Pn(),o=X(s.status).isAuthenticated,c=t.useRef(!1),l=t.useRef(null);t.useEffect(()=>{o||(Cu=!1,Eu=null)},[]);const u=t.useCallback(async e=>{try{if(a?.handleAuthentication){const{sessionId:t}=await a.handleAuthentication(e);if(!t||"string"!=typeof t||""===t.trim())throw new Error("Invalid sessionId received from authentication callback");const n=i;if(!me(n))throw new Error("OS configuration is not available");const{serverUrl:s,version:o,orgId:c}=n,l=new Ha({serverUrl:s,version:o}),u=await l.getProfile(t),d=vu(xu(u,c,n.auth?.clientId||""),t);wn(d.sessionId),r.auth(Z(d)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(yn),window.history.replaceState({},"",e.toString())}catch(e){W(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:yn}})}}()}}catch(t){throw W(t,{component:"AuthProviderWrapper",action:"handleAuthRedirect",metadata:{hasCode:!!e}}),r.auth(K()),t}},[r,a,i]);return t.useEffect(()=>{if("undefined"==typeof window)return;if(o)return;if(Cu)return;if(Eu)return;if(!me(i))return;if(kn())return;if(!a?.getSession)return Cu=!0,void r.auth(K());const e=a.getSession,{serverUrl:t,version:n,orgId:s}=i,c=i.auth?.clientId||"";Eu=(async()=>{let i=null;try{i=await e()}catch(e){W(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!i)return Cu=!0,r.auth(K()),void a?.onSessionExpired?.("missing");try{const e=new Ha({serverUrl:t,version:n}),a=await e.getProfile(i),o=vu(xu(a,s,c),i);wn(o.sessionId),Cu=!0,r.auth(Z(o))}catch(e){W(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),Cu=!0,r.auth(K()),a?.onSessionExpired?.("expired")}finally{Eu=null}})()},[o,r,i,a]),t.useEffect(()=>{const e=kn();if(!e)return;if(c.current||l.current===e)return;if(!me(i))return;c.current=!0,l.current=e;let t=!1;return r.auth(V()),u(e).then(()=>{t||(l.current=null)}).catch(e=>{t||(W(e,{component:"AuthProviderWrapper",action:"handleAuthRedirectEffect",metadata:{hasCode:!0}}),l.current=null)}).finally(()=>{c.current=!1}),()=>{t=!0}},[u,i.serverUrl,i.version,i.orgId]),e.jsx(e.Fragment,{children:n})});Tu.displayName="AuthProviderWrapper";const Pu=t.memo(({config:n,auth:a,children:r})=>{const s=Cn(),i=Pn(),o=t.useMemo(()=>({clientId:a?.clientId||"",redirectUrl:a?.redirectUrl||"",callbacks:a?.callbacks}),[a?.clientId,a?.redirectUrl,a?.callbacks]);t.useEffect(()=>{s.os(le({...n,auth:o}))},[n,o,s]);const c=t.useMemo(()=>me(i)?new Tn(i):null,[i.serverUrl,i.version,i.orgId]);return En(async e=>{if(!c||i.settings)return;const t=await c.getSettings(e);s.os(ue(t))},[c,i.settings,s],{onError:e=>W(e,{component:"ContextConfigProvider",action:"fetchSettings",metadata:{serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}})}),e.jsx(e.Fragment,{children:r})});Pu.displayName="ContextConfigProvider";class _u extends jn{constructor(e){super(e)}async getAttributes(e){const t=await this.fetchResponse("users/attributes",{signal:e});if(!t.ok)throw new Error(await L(t,"Failed to fetch user attributes"));const n=await t.json();return n&&"object"==typeof n&&!Array.isArray(n)?n:{}}async updateAttributes(e){return this.fetchJson("users/attributes",{method:"PATCH",body:JSON.stringify({attributes:e})},"Failed to update user attributes")}async updateAttribute(e,t){return this.fetchJson(`users/attributes/${e}`,{method:"PATCH",body:JSON.stringify({value:t})},"Failed to update user attribute")}async getFeatures(e){const t=await this.fetchResponse("users/features",{signal:e});if(!t.ok)throw new Error(await L(t,"Failed to fetch user features"));const n=await t.json();return"object"==typeof n&&null!==n?n:{}}}const Uu=t.createContext(void 0),Iu=t.memo(({children:n})=>{const{t:a}=gn(),r=Pn(),s=function(){const e=Pn();return t.useMemo(()=>new _u(e),[e.serverUrl,e.version])}(),{isAuthenticated:i}=wu(),{serverUrl:o,version:c}=r,[l,u]=t.useState({}),[d,m]=t.useState({}),[p,h]=t.useState(!1),[g,f]=t.useState(null),b=t.useCallback(async e=>{if(o&&c&&i)try{const t=await s.getAttributes(e);u(t)}catch(e){if(z(e))return;const t=e instanceof Error?e:new Error(a("errors.generic"));f(t),W(e,{component:"UserProvider",action:"fetchAttributes"})}else u({})},[s,o,c,i]),x=t.useCallback(async()=>{if(o&&c&&i){h(!0),f(null);try{await b()}finally{h(!1)}}},[o,c,i,b]),v=t.useCallback(async e=>{h(!0),f(null);try{const t=await s.updateAttributes(e);return await b(),t}catch(t){const n=t instanceof Error?t:new Error(a("errors.generic"));throw f(n),W(t,{component:"UserProvider",action:"updateAttributes",metadata:{updates:e}}),t}finally{h(!1)}},[s,b]),y=t.useCallback(async(e,t)=>{h(!0),f(null);try{const n=await s.updateAttribute(e,t);return await b(),n}catch(n){const r=n instanceof Error?n:new Error(a("errors.generic"));throw f(r),W(n,{component:"UserProvider",action:"updateAttribute",metadata:{attributeKey:e,value:t}}),n}finally{h(!1)}},[s,b]),w=t.useCallback(async e=>{if(o&&c&&i)try{const t=await s.getFeatures(e);m(t)}catch(e){if(z(e))return;const t=e instanceof Error?e:new Error(a("errors.generic"));f(t),W(e,{component:"UserProvider",action:"fetchFeatures"})}else m({})},[s,o,c,i]),S=t.useCallback(async()=>{if(o&&c&&i){h(!0),f(null);try{await w()}finally{h(!1)}}},[o,c,i,w]);En(async e=>{if(!i||!o||!c)return u({}),void m({});h(!0),f(null);try{await Promise.all([b(e),w(e)])}finally{h(!1)}},[i,o,c,b,w],{onError:e=>W(e,{component:"UserProvider",action:"initialFetch",metadata:{step:"fetchAttributesAndFeatures"}})});const k=t.useMemo(()=>({attributes:l,features:d,isLoading:p,error:g,updateAttributes:v,updateAttribute:y,refreshAttributes:x,refreshFeatures:S}),[l,d,p,g,v,y,x,S]);return e.jsx(Uu.Provider,{value:k,children:n})});Iu.displayName="UserProvider";const Du=t.lazy(()=>Promise.resolve().then(function(){return fu}).then(e=>({default:e.default})));const Ru=({children:n})=>{const{currentWorkspace:a,switchToWorkspace:r,workspaces:s}=Ba(),[i,o]=t.useState(!1),[c,l]=t.useState(mu.Profile),u=t.useRef(!1);return t.useEffect(()=>{const e=bu.getState();o(e.open),l(e.section);return bu.subscribe((e,t)=>{o(e),l(t)})},[]),t.useEffect(()=>{if(u.current)return;if(!a)return;const e=Ll();if(!e)return;const t=function(e){if(e.screen&&pu.has(e.screen))return e.screen;switch(e.action){case"checkout":case"billing":return mu.Subscription;default:return null}}(e);if(!t)return u.current=!0,void Ml();const n=e.ws;if(n&&n!==a._id){const e=s.find(e=>e._id===n);return e?void r(e).catch(()=>{u.current=!0,Ml()}):(u.current=!0,void Ml())}u.current=!0,bu.openWorkspaceSettings(t),Ml()},[a,s,r]),e.jsxs(e.Fragment,{children:[n,a&&i&&e.jsx(t.Suspense,{fallback:null,children:e.jsx(Du,{workspace:a,open:i,onOpenChange:e=>{e||bu.closeSettings()},section:c,onSectionChange:e=>{bu.setSection(e)},showTrigger:!1})})]})},zu=(e,t,n)=>{if(t!==de.V1)throw new Error(`Invalid version: "${t}". Only "${de.V1}" is currently supported.`);if(!e||"string"!=typeof e)throw new Error("serverUrl is required and must be a string");if(!(e=>{try{return new URL(e),!0}catch{return!1}})(e))throw new Error(`Invalid serverUrl: "${e}". Must be a valid URL.`);if(!n||"string"!=typeof n)throw new Error("orgId is required and must be a string");if(!/^[0-9a-fA-F]{24}$/.test(n))throw new Error(`Invalid orgId: "${n}". Must be a valid MongoDB ObjectId (24 hexadecimal characters).`)},Lu=t.memo(({serverUrl:n,version:a,orgId:r,auth:s,locale:i,children:o})=>{zu(n,a,r);const c=t.useMemo(()=>({serverUrl:n,version:a,orgId:r}),[n,a,r]),l=t.useMemo(()=>s?.callbacks,[s?.callbacks?.handleAuthentication,s?.callbacks?.onSignOut,s?.callbacks?.handleEvent,s?.callbacks?.onWorkspaceChange]),u=s?.callbacks?.handleEvent;return t.useEffect(()=>(_a.setCallbacks(u?{handleEvent:u}:null),()=>{_a.setCallbacks(null)}),[u]),e.jsx(cn,{locale:i,children:e.jsx(Me,{children:e.jsx(Tu,{callbacks:l,children:e.jsx(Za,{children:e.jsx(Pu,{config:c,auth:s,children:e.jsx(Iu,{children:e.jsx(Zn,{children:e.jsx(Fa,{children:e.jsx(ju,{children:e.jsx(Ru,{children:o})})})})})})})})})})});Lu.displayName="SaaSOSProviderInner";const Mu=({children:t,...n})=>e.jsx(G,{children:e.jsx(Lu,{...n,children:t})});Mu.displayName="SaaSOSProvider";const Bu=e=>{const{children:t}=e,{status:n}=wu();return n!==Q.authenticated?null:t},Ou=e=>{const{children:t}=e,{status:n}=wu();return n!==Q.unauthenticated?null:t};Bu.displayName="WhenAuthenticated",Ou.displayName="WhenUnauthenticated";const Fu=e=>{const{children:t,fallback:n,roles:a}=e,{user:r}=wu();return a.includes(r?.role??"")?t:n||null},Wu=e=>{const{children:t,fallback:n,roles:a}=e,{user:r}=wu(),{currentWorkspace:s}=Ba(),i=s?.users.find(e=>e._id===r?.id);return i&&a.includes(i?.role??"")?t:n||null};function Hu(){const e=t.useContext(Uu);if(void 0===e)throw new Error("useUserFeatures must be used within a UserProvider");return{features:e.features,isLoading:e.isLoading,error:e.error,refreshFeatures:e.refreshFeatures,isFeatureEnabled:t=>Boolean(e.features[t])}}Fu.displayName="WhenRoles",Wu.displayName="WhenWorkspaceRoles";const Gu=e=>{const{children:t,slug:n}=e,{currentWorkspace:a}=Ba(),r=a?.features?.[n];return r?t:null},$u=e=>{const{children:t,slug:n}=e,{currentWorkspace:a}=Ba(),r=a?.features?.[n];return r?null:t},Vu=e=>{const{children:t,slug:n}=e,{isFeatureEnabled:a}=Hu();return a(n)?t:null},Ku=e=>{const{children:t,slug:n}=e,{isFeatureEnabled:a}=Hu();return a(n)?null:t};Gu.displayName="WhenWorkspaceFeatureEnabled",$u.displayName="WhenWorkspaceFeatureDisabled",Vu.displayName="WhenUserFeatureEnabled",Ku.displayName="WhenUserFeatureDisabled";const Zu=e=>{const{children:t,loadingComponent:n,fallbackComponent:a}=e,{response:r,loading:s}=qn();return s?n??null:r?.subscription?t:a??null},qu=e=>{const{children:t,loadingComponent:n,fallbackComponent:a}=e,{response:r,loading:s}=qn();return s?n??null:r?.subscription?a??null:t},Ju=e=>{const{children:t,plans:n,loadingComponent:a,fallbackComponent:r}=e,{response:s,loading:i}=qn();if(i)return a??null;if(!s?.subscription)return r??null;const o=s.plan??s.subscription?.plan;if(!o)return r??null;const c=n.map(e=>e.trim().toLowerCase()),l=(o.slug??"").toLowerCase();return c.includes(l)?t:r??null},Yu=e=>{const{children:t,loadingComponent:n,fallbackComponent:a}=e,{response:r,loading:s}=qn();return s?n??null:"trialing"!==r?.subscription?.subscriptionStatus?a??null:t},Qu=e=>{const{children:t,loadingComponent:n,fallbackComponent:a}=e,{response:r,loading:s}=qn();return s?n??null:r?.subscription?.subscriptionStatus===Qn?a??null:t},Xu=e=>{const{children:t,loadingComponent:n,fallbackComponent:a,daysThreshold:r=3}=e,{response:s,loading:i}=qn();if(i)return n??null;const o=s?.subscription;if(!o||"trialing"!==o.subscriptionStatus)return a??null;const c=o.trialEnd||o.stripeCurrentPeriodEnd;if(!c)return a??null;const l=new Date(c);if(isNaN(l.getTime()))return a??null;return Math.max(0,Math.ceil((l.getTime()-Date.now())/864e5))>r?a??null:t};Zu.displayName="WhenSubscription",qu.displayName="WhenNoSubscription",Ju.displayName="WhenSubscriptionToPlans",Yu.displayName="WhenTrialing",Qu.displayName="WhenNotTrialing",Xu.displayName="WhenTrialEnding";const ed=e=>{const{slug:t,children:n,loadingComponent:a,fallbackComponent:r}=e,{quotas:s,loading:i}=Wa();if(i)return a??null;const o=s?.[t];return o?o.available<=0?r??null:n:r??null},td=e=>{const{slug:t,children:n,loadingComponent:a,fallbackComponent:r}=e,{quotas:s,loading:i}=Wa();if(i)return a??null;const o=s?.[t];return o?o.available>0?r??null:n:r??null},nd=e=>{const{slug:t,children:n,loadingComponent:a,fallbackComponent:r}=e,{quotas:s,loading:i}=Wa();if(i)return a??null;const o=s?.[t];return o&&o.hasOverage?n:r??null},ad=e=>{const{slug:t,threshold:n,children:a,loadingComponent:r,fallbackComponent:s}=e,{quotas:i,loading:o}=Wa();if(o)return r??null;const c=i?.[t];if(!c)return s??null;return(c.included>0?c.consumed/c.included*100:c.consumed>0?100:0)<n?s??null:a};function rd(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}ed.displayName="WhenQuotaAvailable",td.displayName="WhenQuotaExhausted",nd.displayName="WhenQuotaOverage",ad.displayName="WhenQuotaThreshold";const sd=w.forwardRef(({className:t,...n},a)=>e.jsx(T.Root,{ref:a,className:U("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...n}));sd.displayName=T.Root.displayName;const id=w.forwardRef(({className:t,...n},a)=>e.jsx(T.Image,{ref:a,className:U("aspect-square h-full w-full",t),...n}));id.displayName=T.Image.displayName;const od=w.forwardRef(({className:t,...n},a)=>e.jsx(T.Fallback,{ref:a,className:U("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...n}));od.displayName=T.Fallback.displayName;const cd=w.forwardRef(({className:t,orientation:n="horizontal",decorative:a=!0,...r},s)=>e.jsx(P.Root,{ref:s,decorative:a,orientation:n,className:U("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",t),...r}));function ld(t){const{t:a}=gn(),{workspace:r,setCurrentWorkspace:s,setOpen:i,workspacesToUse:o,switchingToId:c}=t,l=t.isCurrentWorkspace??!1,u=c===r._id,d=r.subscription??null,m=null!=d&&"object"==typeof d?d.plan??null:null,p=m?.name??"";return e.jsxs("div",{className:U("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":l}),children:[e.jsxs(sd,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(id,{src:r.image&&r.image.trim()?r.image:void 0})}),e.jsx(od,{children:(h=r.name,h.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e.jsxs("div",{className:"flex-1 min-w-0 max-w-full",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:r.name})}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(n.Users,{className:"h-3 w-3"}),e.jsx("span",{children:a("workspace.membersCount",{count:r.users?.length||0})})]}),p&&e.jsx("div",{className:"max-w-fit",children:e.jsx("div",{className:"flex items-center gap-1 text-sm text-muted-foreground bg-green-500 text-white rounded-full px-2 py-0.5",children:e.jsx("span",{className:"text-xs",children:p})})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[l?null:e.jsx(Va,{size:"sm",disabled:null!==c||u,progress:u,onClick:()=>{t.switchToWorkspace(r).then(()=>i(!1)).catch(e=>{W(e,{component:"WorkspaceItem",action:"switchToWorkspace",metadata:{workspaceId:r._id}})})},children:a("workspace.switchTo")}),e.jsx(gu,{workspace:r,onClose:()=>{if(l){const e=o.findIndex(e=>e._id?.toString()===r._id?.toString());-1!==e&&s(o[e])}}})]})]});var h}function ud(a){const{t:r,dir:i}=gn(),{switching:o}=Ba(),[c,l]=t.useState(!1),[u,d]=t.useState("emoji"),[m,p]=t.useState("🏢"),[h,g]=t.useState(!1),{createWorkspace:f}=Ba(),b=jc({name:Qo().min(2,{message:r("workspace.workspaceNameMinLength")}),image:Qo().optional()}),x=s.useForm({resolver:Co(b),defaultValues:{name:"",image:""}});return e.jsxs(qa,{open:c,onOpenChange:l,children:[e.jsx(Ja,{asChild:!0,children:e.jsxs(Va,{className:"w-full rounded-none",disabled:o,children:[e.jsx(n.Plus,{className:"h-4 w-4 me-2"}),r("workspace.createNew")]})}),e.jsxs(Xa,{dir:i,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(er,{children:[e.jsx(tr,{children:r("workspace.createTitle")}),e.jsx(nr,{children:r("workspace.createDescription")})]}),e.jsx(qc,{...x,children:e.jsxs("form",{onSubmit:x.handleSubmit(async function(e){let t="";if("emoji"===u)t=ul(m);else if("url"===u&&e.image)try{new URL(e.image),t=e.image}catch{return void x.setError("image",{message:r("workspace.invalidUrl")})}g(!0);try{await f(e.name,t),l(!1),x.reset(),p("🏢"),d("emoji"),a?.onCreated?.()}catch(t){W(t,{component:"WorkspaceProvider",action:"createWorkspace",metadata:{name:e.name}})}finally{g(!1)}}),children:[e.jsx(Yc,{control:x.control,name:"name",render:({field:t})=>e.jsxs(el,{children:[e.jsx(tl,{children:r("workspace.workspaceName")}),e.jsx(nl,{children:e.jsx(sl,{placeholder:r("workspace.workspaceNamePlaceholder"),...t})}),e.jsx(rl,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(Zc,{className:"text-sm font-medium",children:r("workspace.workspaceIcon")}),e.jsx(al,{children:r("workspace.iconDescription")})]}),e.jsxs(il,{value:u,onValueChange:e=>d(e),className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(ol,{value:"emoji",id:"emoji"}),e.jsxs(Zc,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(n.Smile,{className:"h-4 w-4"}),r("workspace.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(ol,{value:"url",id:"url"}),e.jsxs(Zc,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(n.Image,{className:"h-4 w-4"}),r("workspace.customImageUrl")]})]})]}),"emoji"===u&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:r("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:m})]}),e.jsx(cl,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:dl.map((t,n)=>e.jsx("button",{type:"button",onClick:()=>(e=>{p(e),x.setValue("image",ul(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(m===t?"bg-primary text-primary-foreground":""),children:t},n))})})]}),"url"===u&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(Yc,{control:x.control,name:"image",render:({field:t})=>e.jsxs(el,{children:[e.jsx(tl,{children:r("workspace.imageUrl")}),e.jsx(nl,{children:e.jsx(sl,{placeholder:r("workspace.imageUrlPlaceholder"),...t})}),e.jsx(al,{children:r("workspace.imageUrlDescription")}),e.jsx(rl,{})]})}),x.watch("image")&&x.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:r("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:x.watch("image")||void 0,alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(Va,{type:"button",variant:"outline",onClick:()=>{l(!1),x.reset(),p("🏢"),d("emoji")},disabled:h,children:r("settings.common.cancel")}),e.jsx(Va,{type:"submit",disabled:h,children:h?e.jsxs(e.Fragment,{children:[e.jsx(n.Loader2,{className:"me-2 h-4 w-4 animate-spin"}),r("workspace.creating")]}):r("workspace.createWorkspace")})]})]})})]})]})}cd.displayName=P.Root.displayName;class dd extends jn{constructor(e){super({...e,basePath:"beta",requireOrgId:!0})}getAuthHeaders(){return{}}async fetchConfig(){return this.fetchJson(`config?orgId=${encodeURIComponent(this.orgId)}`,{},"Failed to fetch beta form configuration")}async submitBetaUser(e){return this.fetchJson("submit",{method:"POST",body:JSON.stringify(e)},"Failed to submit beta user request")}}let md=class{constructor(e){this.api=new dd(e),this.orgId=e.orgId}async fetchConfig(){return this.api.fetchConfig()}async submitBetaUser(e){const t=e?.context??{},n=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),a=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),r=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),s=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0);return this.api.submitBetaUser({orgId:this.orgId,formData:{...e,country:n,language:a,timezone:r,currency:s}})}};const pd=jc({name:Qo().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[\p{L}\p{M}\s'-]*$/u,"Name can only contain letters and spaces"),email:Qo().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")});function hd({screen:t}){return e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsx("p",{className:"text-2xl font-bold",children:t?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function gd({logo:t}){return"string"==typeof t?e.jsx("img",{src:t,alt:"Logo",className:"max-h-24"}):e.jsx("img",{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}var fd=Object.freeze({__proto__:null,es:{settings:{titles:{profile:"Cuenta",general:"Configuración del espacio de trabajo",users:"Miembros del espacio de trabajo",subscription:"Plan y facturación",usage:"Uso",features:"Funciones del espacio de trabajo",notifications:"Notificaciones",danger:"Zona de peligro"},sidebar:{account:"Cuenta",workspace:"Espacio de trabajo",profile:"Cuenta",general:"Configuración",users:"Miembros",subscription:"Plan y facturación",usage:"Uso",features:"Funciones",notifications:"Notificaciones",danger:"Zona de peligro"},common:{refresh:"Actualizar",refreshing:"Actualizando...",retry:"Reintentar",retrying:"Reintentando...",save:"Guardar",saving:"Guardando...",cancel:"Cancelar",delete:"Eliminar",dismiss:"Descartar",loading:"Cargando...",success:"¡Éxito!",error:"Error",refreshAction:"{loading, select, true {Actualizando...} other {Actualizar}}",retryAction:"{loading, select, true {Reintentando...} other {Reintentar}}"}},subscription:{managePlan:"Administra tu plan y facturación",changePlan:"Cambiar plan",viewPricingPlans:"Ver planes de precios",viewPlans:"Ver planes",upgradePlan:"Mejorar ahora",subscribe:"Suscribirse",currentPlan:"Plan actual",noSubscription:"No tienes una suscripción activa",choosePlan:"Elige tu plan",choosePlanDescription:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",planUpdateAvailable:"Actualización de plan disponible",updateSuccess:"¡Suscripción actualizada correctamente!",updateFailed:"Error en la actualización",cancelTitle:"Cancelar suscripción",cancelConfirm:"¿Estás seguro de que deseas cancelar tu suscripción?",cancelKeep:"Mantener suscripción",cancelButton:"Sí, cancelar suscripción",canceling:"Cancelando...",cancelSuccess:"La suscripción se cancelará al final del período de facturación.",cancelNotCharged:"No se te cobrará de nuevo después de la cancelación",cancelResumeAnytime:"Puedes reanudar tu suscripción en cualquier momento antes de que termine",resumeTitle:"Reanudar suscripción",resumeConfirm:"¿Estás seguro de que deseas reanudar tu suscripción?",resumeKeep:"Mantener cancelada",resumeButton:"Sí, reanudar suscripción",resuming:"Reanudando...",resumeSuccess:"La suscripción ha sido reanudada.",managePayment:"Administrar pago",openingPortal:"Abriendo...",viewAllPlans:"Ver todos los planes",scheduledCancellation:"Cancelación de suscripción programada",paymentPastDue:"Pago vencido",paymentPastDueDescription:"Por favor, actualiza tu método de pago para evitar la interrupción del servicio.",subscriptionPaused:"Suscripción pausada",subscriptionPausedDescription:"Tu suscripción está actualmente pausada. Reanúdala para restaurar el acceso completo.",errorLoading:"Error al cargar los datos de la suscripción",errorLoadingDescription:"Por favor, verifica tu conexión e inténtalo de nuevo.",errorProcessing:"Error al procesar la suscripción",errorCanceling:"Error al cancelar la suscripción",errorResuming:"Error al reanudar la suscripción",invalidWorkspace:"ID de espacio de trabajo no válido",billingInterval:{monthly:"Mensual",quarterly:"Trimestral",yearly:"Anual",perMonth:"/mes",perQuarter:"/trimestre",perYear:"/año"},seats:{title:"Puestos",members:"Miembros",included:"Incluidos",billable:"Facturables",perExtraSeat:"Por puesto adicional",limit:"Límite",includedSeats:"Puestos incluidos",maxSeats:"Máx. puestos",freeWithBase:"Gratis con el precio base",allIncluded:"Todos incluidos",extra:"adicional",unlimited:"Ilimitado"},items:{features:"Funciones",limits:"Límites",quotas:"Cuotas de uso"},checkout:{upgrade:"Mejorar",downgrade:"Reducir",switchTo:"Cambiar a",select:"Seleccionar"},status:{active:"Activa",canceling:"Cancelando",trial:"Prueba",canceled:"Cancelada",pastDue:"Vencida",paused:"Pausada",deprecated:"Obsoleta",unknown:"Desconocida"},plan:"Plan",invoicesTab:"Facturas",changePlanButton:"Cambiar plan",noPlanAssigned:"Sin plan asignado",free:"Gratis",perSeatDisplay:"+ {price}/puesto{interval}",estTotalDisplay:"Total est.: {total}{interval} ({count, plural, one {# puesto adicional} other {# puestos adicionales}})",nextBillingDisplay:"Próxima facturación: {date}",membersInWorkspace:"{count, plural, one {# miembro} other {# miembros}} en el espacio de trabajo",billingInCurrency:"Facturación en {currency}",savingsPercent:"Ahorra {percent, number}%",switchToInterval:"Cambiar a {interval}",seatPriceDisplay:"+ {price}/puesto{interval} ({included} {includedLabel})",trialEnded:"Tu período de prueba ha terminado.",trialEndsIn:"Tu período de prueba termina en {days, plural, one {# día} other {# días}}.",onTrial:"Estás en un período de prueba.",upgradeToKeepAccess:"Mejora tu plan para mantener el acceso.",viewInvoices:"Ver facturas",cancelTrial:"Cancelar prueba",dunningFinal:"Última advertencia: La suscripción será suspendida",dunningSuspended:"Suscripción suspendida",dunningRecovery:"Recuperación de pago en curso",dunningSuspendedDescription:"Tu suscripción ha sido suspendida debido a fallos de pago repetidos. Actualiza tu método de pago para restaurar el acceso.",dunningRecoveryDescription:"No pudimos procesar tu pago. Por favor, actualiza tu método de pago para no perder el acceso.",cancelEndDescription:"Tu suscripción terminará el",cancelEndFallback:"Tu suscripción se cancelará al final del período de facturación actual. No se te cobrará de nuevo.",resumeChargeDate:"Se te cobrará de nuevo el",resumeChargeFallback:"la próxima fecha de facturación",resumeContinue:"Tu suscripción continuará automáticamente y se te facturará según tu plan",resumeCancelAnytime:"Puedes cancelar en cualquier momento antes de la próxima fecha de facturación si cambias de opinión",retainAccess:"Mantendrás acceso completo a este plan hasta",retainAccessFallback:"el final de tu período de facturación actual",noPlansAvailable:"No hay grupos de planes disponibles para este espacio de trabajo. Por favor, contacta a soporte si crees que esto es un error.",noPlansAvailableHint:"No hay grupos de planes disponibles para este espacio de trabajo.",startTrialDescription:"Prueba el plan completo sin compromiso. Puedes mejorar o cancelar en cualquier momento.",noSubscriptionDescription:"Elige un plan para comenzar con tu espacio de trabajo",startFreeTrial:"Comenzar prueba gratuita"},users:{title:"Miembros del espacio de trabajo",adminOnly:"Solo el administrador del espacio de trabajo puede gestionar usuarios y roles.",inviteByEmail:"Invitar miembro por correo electrónico",inviteButton:"Invitar",inviting:"Invitando...",inviteSuccess:"Usuario invitado correctamente",emailRequired:"El correo electrónico es obligatorio",invalidEmail:"Formato de dirección de correo electrónico no válido",inviteFailed:"Error al invitar al miembro",seatLimitReached:"Límite de puestos alcanzado",memberLimitReached:"Límite de miembros alcanzado",role:"Rol",you:"Tú",owner:"Propietario",noMembers:"No se encontraron miembros en este espacio de trabajo.",extraSeatCost:"Cada miembro adicional añade {price}/{interval, select, yearly {año} quarterly {trim.} other {mes}} a tu suscripción",unknownUser:"Usuario desconocido",seats:"Puestos",members:"Miembros",included:"incluidos",perExtraSeat:"/puesto adicional",maxMembers:"máx. miembros",available:"disponibles",noMemberLimit:"Sin límite de miembros",seatHeading:"{hasSeatPricing, select, true {Puestos} other {Miembros}}",limitReached:"{reason, select, seat_limit_reached {Límite de puestos alcanzado} other {Límite de miembros alcanzado}}",memberCount:"{count, plural, one {# miembro} other {# miembros}}",subscriptionRequired:"Se requiere una suscripción para invitar miembros.",seatLimitMessage:"Tu plan permite hasta {maxUsers, number} miembros. Mejora tu plan para más puestos.",settingsLimitMessage:"Este espacio de trabajo permite hasta {maxUsers, number} miembros.",memberLimitMessage:"Límite de miembros de {maxUsers, number} alcanzado.",selectRole:"Seleccionar un rol",inviteAs:"Invitar como {role}"},invoices:{title:"Historial de facturación",description:"Ver y descargar tus facturas",pay:"Pagar",view:"Ver",viewDetails:"Ver detalles",download:"PDF",errorLoading:"Error al cargar las facturas",noInvoices:"Aún no hay facturas. Suscríbete a un plan para recibir facturas.",noInvoicesWithSub:"No se encontraron facturas con opción de descarga",paidAmount:"Pagado: {amount}",na:"N/D",status:{draft:"Borrador",open:"Abierta",paid:"Pagada",uncollectible:"Incobrable",void:"Anulada"}},usage:{title:"Uso",description:"Monitorea tu consumo de recursos y cuotas",totalResources:"Total de recursos",overallUsage:"Uso general",inOverage:"En exceso",estOverageCost:"Costo est. por exceso",overageDetected:"Exceso detectado",overageDescription:"El uso adicional se facturará como exceso en tu próxima factura.",overageUnits:"Unidades en exceso",rate:"Tarifa",billableBlocks:"Bloques facturables",estimatedCharge:"Cargo estimado",noData:"No hay datos de uso de cuotas disponibles para este espacio de trabajo.",noDataHint:"Las cuotas aparecerán aquí una vez que tu plan incluya recursos medidos.",used:"usado",remaining:"restante",overLimit:"sobre el límite",percentUsed:"{percent, number}% usado",availableRemaining:"{count} restantes",overLimitCount:"{count} sobre el límite",overageWarning:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}} El uso adicional se facturará como exceso en tu próxima factura.",fullyUsed:"Completamente usado",renewingSoon:"se renueva pronto",almostFull:"Casi lleno",overage:"Exceso",errorLoading:"Error al cargar los datos de uso",perUnit:"/ unidad",perUnits:"/ unidades",rateDisplay:"{rate} {unitSize, plural, =1 {/ unidad} other {/ {unitSize, number} unidades}}",resourcesExceeded:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}}",estOverageCharges:"Cargos estimados por exceso este período: {amount}",overageRateDisplay:"Tarifa de exceso: {rate}",resetDateDisplay:"El uso se restablece el {date}",daysRemainingDisplay:"{count, plural, one {# día restante} other {# días restantes}}"},profile:{email:"Correo electrónico",name:"Nombre",language:"Idioma",country:"País",currency:"Moneda",timezone:"Zona horaria",profileImage:"Imagen de perfil",success:"Perfil guardado correctamente",nameMinLength:"El nombre debe tener al menos 2 caracteres.",save:"Guardar",reset:"Restablecer"},general:{ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar la configuración.",name:"Nombre",namePlaceholder:"Mi espacio de trabajo",nameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",billingCurrency:"Moneda de facturación",icon:"Icono",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",previewLabel:"Vista previa:",success:"Configuración del espacio de trabajo guardada correctamente",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",updateWorkspace:"Actualizar espacio de trabajo"},features:{title:"Funciones del espacio de trabajo",ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar las funciones.",noFeatures:"El espacio de trabajo no tiene funciones para gestionar.",enabled:"habilitada",disabled:"deshabilitada",enabling:"Habilitando",disabling:"Deshabilitando",featureSuccess:"correctamente",updateSuccess:"{feature} {enabled, select, true {habilitada} other {deshabilitada}} correctamente",actionStatus:"{action, select, enabling {Habilitando} disabling {Deshabilitando} other {}}"},danger:{title:"Eliminar espacio de trabajo",adminOnly:"Solo los administradores pueden eliminar espacios de trabajo.",deleteWorkspace:"Eliminar espacio de trabajo",deleteConfirm:"¿Estás completamente seguro?",deleteWarning:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos los datos asociados.",deleting:"Eliminando...",deleteDescription:"Una vez que elimines un espacio de trabajo, no hay vuelta atrás. Esto eliminará permanentemente el espacio de trabajo y todos sus datos, incluidos miembros, configuración y funciones.",deleteConfirmDescription:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos sus datos.",failedToDelete:"Error al eliminar el espacio de trabajo"},notifications:{title:"Preferencias de notificaciones",permissionDenied:"Permiso de notificaciones denegado",notSupported:"Las notificaciones push no son compatibles con este navegador.",manageDescription:"Administra cómo recibes notificaciones de este espacio de trabajo.",blocked:"Notificaciones bloqueadas",blockedDescription:"Previamente bloqueaste las notificaciones para este sitio. Para habilitarlas, actualiza la configuración de tu navegador:",pushTitle:"Notificaciones push",pushEnabledDescription:"Recibirás notificaciones del navegador para actualizaciones importantes.",pushDisabledDescription:"Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.",enabling:"Habilitando...",disabling:"Deshabilitando...",enable:"Habilitar",disable:"Deshabilitar",toggleAction:"{loading, select, true {{subscribed, select, true {Deshabilitando...} other {Habilitando...}}} other {{subscribed, select, true {Deshabilitar} other {Habilitar}}}}",pushDescription:"{subscribed, select, true {Recibirás notificaciones del navegador para actualizaciones importantes.} other {Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.}}",deviceNote:"Las notificaciones se envían a este dispositivo. Habilítalas en otros dispositivos por separado.",unblock:{firefox:{step1:"Haz clic en el icono del candado (o del escudo) en la barra de direcciones",step2:'Busca "Notificaciones" en la lista de permisos',step3:'Cambia de "Bloqueado" a "Permitir"',step4:"Recarga esta página"},safari:{step1:"Abre Safari → Configuración → Sitios web → Notificaciones",step2:"Busca este sitio web en la lista",step3:'Cambia de "Denegar" a "Permitir"',step4:"Recarga esta página"},edge:{step1:"Haz clic en el icono del candado en la barra de direcciones",step2:'Haz clic en "Permisos para este sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"},chrome:{step1:"Haz clic en el icono del candado (o del ajuste) en la barra de direcciones",step2:'Haz clic en "Configuración del sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"}}},quota:{includedOnly:"{count, number} incluidos",includedWithOverage:"{count, number} incluidos, luego {price} / {unit}",unitFallback:"unidad"},pricing:{title:"Elige tu plan",description:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",currency:"Moneda",billingIn:"Facturación en",noPlansCurrency:"No hay planes disponibles para tu moneda de facturación.",noPlansCurrencyHint:"Algo salió mal. Por favor, contacta a soporte.",noPlans:"No hay planes disponibles",free:"Gratis",included:"incluido",save:"Ahorra",current:"Actual",processing:"Procesando...",unavailable:"No disponible",selectCurrency:"Seleccionar moneda de facturación",billingInterval:"Intervalo de facturación"},beta:{nameLabel:"Nombre",emailLabel:"Correo electrónico",submitText:"Enviar",submittingText:"Enviando...",errorMessage:"Ocurrió un error",tryAgain:"Intentar de nuevo",privacyConsent:"Al enviar este formulario, aceptas nuestra",privacyPolicy:"Política de privacidad",and:"y",termsOfService:"Términos de servicio"},workspace:{switchTitle:"Cambiar espacio de trabajo",switchDescription:"Selecciona un espacio de trabajo o crea uno nuevo.",notLoggedIn:"Parece que no has iniciado sesión. Por favor, inicia sesión para continuar.",availableWorkspaces:"Espacios de trabajo disponibles ({count, number})",loadingWorkspaces:"Cargando espacios de trabajo...",searchPlaceholder:"Buscar espacios de trabajo...",noWorkspacesFound:"No se encontraron espacios de trabajo",noWorkspacesAvailable:"No hay espacios de trabajo disponibles",switchTo:"Cambiar a",membersCount:"{count, plural, one {# miembro} other {# miembros}}",createNew:"Crear nuevo espacio de trabajo",createTitle:"Crear nuevo espacio de trabajo",createDescription:"Crea un nuevo espacio de trabajo para comenzar.",workspaceName:"Nombre del espacio de trabajo",workspaceNamePlaceholder:"Mi espacio de trabajo",workspaceNameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",workspaceIcon:"Icono del espacio de trabajo",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",invalidUrl:"Por favor, introduce una URL válida",creating:"Creando...",createWorkspace:"Crear espacio de trabajo"},dropdowns:{search:"Buscar...",chooseOption:"Elegir opción",chooseCountry:"Elegir país",searchCountry:"Elegir país...",chooseLanguage:"Elegir idioma",searchLanguage:"Elegir idioma...",chooseCurrency:"Elegir moneda",searchCurrency:"Elegir moneda...",chooseTimezone:"Elegir zona horaria",searchTimezone:"Elegir zona horaria..."},push:{failedToSubscribe:"Error al suscribirse a las notificaciones push",failedToUnsubscribe:"Error al cancelar la suscripción a las notificaciones push"},errors:{networkError:"Error de red: Por favor, verifica tu conexión a internet",unauthorized:"No autorizado — Por favor, verifica tu sesión",notFound:"Recurso no encontrado",generic:"Ocurrió un error",fetchPlans:"Error al obtener los planes",fetchPlanGroup:"Error al obtener el grupo de planes",fetchPlanGroupVersion:"Error al obtener la versión del grupo de planes",fetchPlanGroupVersions:"Error al obtener las versiones del grupo de planes",fetchSubscription:"Error al obtener la suscripción",createCheckout:"Error al crear la sesión de pago",updateSubscription:"Error al actualizar la suscripción",fetchInvoices:"Error al obtener las facturas",fetchInvoice:"Error al obtener la factura",openBillingPortal:"Error al abrir el portal de facturación",cancelSubscription:"Error al cancelar la suscripción",resumeSubscription:"Error al reanudar la suscripción",recordUsage:"Error al registrar el uso",fetchQuotaUsage:"Error al obtener el estado de uso de cuotas",fetchAllQuotaUsage:"Error al obtener todo el uso de cuotas",fetchUsageLogs:"Error al obtener los registros de uso"}}});var bd=Object.freeze({__proto__:null,fr:{settings:{titles:{profile:"Compte",general:"Paramètres de l'espace de travail",users:"Membres de l'espace de travail",subscription:"Plan et facturation",usage:"Utilisation",features:"Fonctionnalités de l'espace de travail",notifications:"Notifications",danger:"Zone de danger"},sidebar:{account:"Compte",workspace:"Espace de travail",profile:"Compte",general:"Paramètres",users:"Membres",subscription:"Plan et facturation",usage:"Utilisation",features:"Fonctionnalités",notifications:"Notifications",danger:"Zone de danger"},common:{refresh:"Actualiser",refreshing:"Actualisation...",retry:"Réessayer",retrying:"Nouvelle tentative...",save:"Enregistrer",saving:"Enregistrement...",cancel:"Annuler",delete:"Supprimer",dismiss:"Ignorer",loading:"Chargement...",success:"Succès !",error:"Erreur",refreshAction:"{loading, select, true {Actualisation...} other {Actualiser}}",retryAction:"{loading, select, true {Nouvelle tentative...} other {Réessayer}}"}},subscription:{managePlan:"Gérez votre plan et votre facturation",changePlan:"Changer de plan",viewPricingPlans:"Voir les plans tarifaires",viewPlans:"Voir les plans",upgradePlan:"Mettre à niveau",subscribe:"S'abonner",currentPlan:"Plan actuel",noSubscription:"Vous n'avez pas d'abonnement actif",choosePlan:"Choisissez votre plan",choosePlanDescription:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",planUpdateAvailable:"Mise à jour du plan disponible",updateSuccess:"Abonnement mis à jour avec succès !",updateFailed:"Échec de la mise à jour",cancelTitle:"Annuler l'abonnement",cancelConfirm:"Êtes-vous sûr de vouloir annuler votre abonnement ?",cancelKeep:"Conserver l'abonnement",cancelButton:"Oui, annuler l'abonnement",canceling:"Annulation...",cancelSuccess:"L'abonnement sera annulé à la fin de la période de facturation.",cancelNotCharged:"Vous ne serez plus facturé après l'annulation",cancelResumeAnytime:"Vous pouvez reprendre votre abonnement à tout moment avant qu'il ne se termine",resumeTitle:"Reprendre l'abonnement",resumeConfirm:"Êtes-vous sûr de vouloir reprendre votre abonnement ?",resumeKeep:"Maintenir annulé",resumeButton:"Oui, reprendre l'abonnement",resuming:"Reprise...",resumeSuccess:"L'abonnement a été repris.",managePayment:"Gérer le paiement",openingPortal:"Ouverture...",viewAllPlans:"Voir tous les plans",scheduledCancellation:"Annulation de l'abonnement programmée",paymentPastDue:"Paiement en retard",paymentPastDueDescription:"Veuillez mettre à jour votre moyen de paiement pour éviter une interruption de service.",subscriptionPaused:"Abonnement suspendu",subscriptionPausedDescription:"Votre abonnement est actuellement suspendu. Reprenez-le pour restaurer l'accès complet.",errorLoading:"Erreur lors du chargement des données d'abonnement",errorLoadingDescription:"Veuillez vérifier votre connexion et réessayer.",errorProcessing:"Échec du traitement de l'abonnement",errorCanceling:"Échec de l'annulation de l'abonnement",errorResuming:"Échec de la reprise de l'abonnement",invalidWorkspace:"ID d'espace de travail invalide",billingInterval:{monthly:"Mensuel",quarterly:"Trimestriel",yearly:"Annuel",perMonth:"/mois",perQuarter:"/trimestre",perYear:"/an"},seats:{title:"Sièges",members:"Membres",included:"Inclus",billable:"Facturables",perExtraSeat:"Par siège supplémentaire",limit:"Limite",includedSeats:"Sièges inclus",maxSeats:"Sièges max.",freeWithBase:"Gratuit avec le prix de base",allIncluded:"Tous inclus",extra:"supplémentaire",unlimited:"Illimité"},items:{features:"Fonctionnalités",limits:"Limites",quotas:"Quotas d'utilisation"},checkout:{upgrade:"Mettre à niveau",downgrade:"Rétrograder",switchTo:"Passer à",select:"Sélectionner"},status:{active:"Actif",canceling:"En annulation",trial:"Essai",canceled:"Annulé",pastDue:"En retard",paused:"Suspendu",deprecated:"Obsolète",unknown:"Inconnu"},plan:"Plan",invoicesTab:"Factures",changePlanButton:"Changer de plan",noPlanAssigned:"Aucun plan attribué",free:"Gratuit",perSeatDisplay:"+ {price}/siège{interval}",estTotalDisplay:"Total est. : {total}{interval} ({count, plural, one {# siège supplémentaire} other {# sièges supplémentaires}})",nextBillingDisplay:"Prochaine facturation : {date}",membersInWorkspace:"{count, plural, one {# membre} other {# membres}} dans l'espace de travail",billingInCurrency:"Facturation en {currency}",savingsPercent:"Économisez {percent, number}%",switchToInterval:"Passer à {interval}",seatPriceDisplay:"+ {price}/siège{interval} ({included} {includedLabel})",trialEnded:"Votre période d'essai est terminée.",trialEndsIn:"Votre période d'essai se termine dans {days, plural, one {# jour} other {# jours}}.",onTrial:"Vous êtes en période d'essai.",upgradeToKeepAccess:"Mettez à niveau pour conserver l'accès.",viewInvoices:"Voir les factures",cancelTrial:"Annuler l'essai",dunningFinal:"Dernier avertissement : l'abonnement sera suspendu",dunningSuspended:"Abonnement suspendu",dunningRecovery:"Récupération de paiement en cours",dunningSuspendedDescription:"Votre abonnement a été suspendu en raison d'échecs de paiement répétés. Mettez à jour votre moyen de paiement pour restaurer l'accès.",dunningRecoveryDescription:"Nous n'avons pas pu traiter votre paiement. Veuillez mettre à jour votre moyen de paiement pour ne pas perdre l'accès.",cancelEndDescription:"Votre abonnement prendra fin le",cancelEndFallback:"Votre abonnement sera annulé à la fin de la période de facturation en cours. Vous ne serez plus facturé.",resumeChargeDate:"Vous serez de nouveau facturé le",resumeChargeFallback:"la prochaine date de facturation",resumeContinue:"Votre abonnement continuera automatiquement et vous serez facturé selon votre plan",resumeCancelAnytime:"Vous pouvez annuler à tout moment avant la prochaine date de facturation si vous changez d'avis",retainAccess:"Vous conserverez l'accès complet à ce plan jusqu'au",retainAccessFallback:"la fin de votre période de facturation actuelle",noPlansAvailable:"Aucun groupe de plans n'est disponible pour cet espace de travail. Veuillez contacter le support si vous pensez qu'il s'agit d'une erreur.",noPlansAvailableHint:"Aucun groupe de plans n'est disponible pour cet espace de travail.",startTrialDescription:"Essayez le plan complet sans engagement. Vous pouvez mettre à niveau ou annuler à tout moment.",noSubscriptionDescription:"Choisissez un plan pour commencer avec votre espace de travail",startFreeTrial:"Commencer l'essai gratuit"},users:{title:"Membres de l'espace de travail",adminOnly:"Seul l'administrateur de l'espace de travail peut gérer les utilisateurs et les rôles.",inviteByEmail:"Inviter un membre par e-mail",inviteButton:"Inviter",inviting:"Invitation...",inviteSuccess:"Utilisateur invité avec succès",emailRequired:"L'adresse e-mail est obligatoire",invalidEmail:"Format d'adresse e-mail invalide",inviteFailed:"Échec de l'invitation du membre",seatLimitReached:"Limite de sièges atteinte",memberLimitReached:"Limite de membres atteinte",role:"Rôle",you:"Vous",owner:"Propriétaire",noMembers:"Aucun membre trouvé dans cet espace de travail.",extraSeatCost:"Chaque membre supplémentaire ajoute {price}/{interval, select, yearly {an} quarterly {trim.} other {mois}} à votre abonnement",unknownUser:"Utilisateur inconnu",seats:"Sièges",members:"Membres",included:"inclus",perExtraSeat:"/siège supplémentaire",maxMembers:"membres max.",available:"disponibles",noMemberLimit:"Pas de limite de membres",seatHeading:"{hasSeatPricing, select, true {Sièges} other {Membres}}",limitReached:"{reason, select, seat_limit_reached {Limite de sièges atteinte} other {Limite de membres atteinte}}",memberCount:"{count, plural, one {# membre} other {# membres}}",subscriptionRequired:"Un abonnement est requis pour inviter des membres.",seatLimitMessage:"Votre plan autorise jusqu'à {maxUsers, number} membres. Mettez à niveau pour plus de sièges.",settingsLimitMessage:"Cet espace de travail autorise jusqu'à {maxUsers, number} membres.",memberLimitMessage:"Limite de membres de {maxUsers, number} atteinte.",selectRole:"Sélectionner un rôle",inviteAs:"Inviter en tant que {role}"},invoices:{title:"Historique de facturation",description:"Consultez et téléchargez vos factures",pay:"Payer",view:"Voir",viewDetails:"Voir les détails",download:"PDF",errorLoading:"Erreur lors du chargement des factures",noInvoices:"Pas encore de factures. Abonnez-vous à un plan pour recevoir des factures.",noInvoicesWithSub:"Aucune facture avec option de téléchargement trouvée",paidAmount:"Payé : {amount}",na:"N/D",status:{draft:"Brouillon",open:"Ouverte",paid:"Payée",uncollectible:"Irrécouvrable",void:"Annulée"}},usage:{title:"Utilisation",description:"Surveillez votre consommation de ressources et vos quotas",totalResources:"Total des ressources",overallUsage:"Utilisation globale",inOverage:"En dépassement",estOverageCost:"Coût est. de dépassement",overageDetected:"Dépassement détecté",overageDescription:"L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",overageUnits:"Unités en dépassement",rate:"Tarif",billableBlocks:"Blocs facturables",estimatedCharge:"Charge estimée",noData:"Aucune donnée d'utilisation de quotas disponible pour cet espace de travail.",noDataHint:"Les quotas apparaîtront ici une fois que votre plan inclura des ressources mesurées.",used:"utilisé",remaining:"restant",overLimit:"au-dessus de la limite",percentUsed:"{percent, number}% utilisé",availableRemaining:"{count} restants",overLimitCount:"{count} au-dessus de la limite",overageWarning:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}} L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",fullyUsed:"Entièrement utilisé",renewingSoon:"renouvellement imminent",almostFull:"Presque plein",overage:"Dépassement",errorLoading:"Échec du chargement des données d'utilisation",perUnit:"/ unité",perUnits:"/ unités",rateDisplay:"{rate} {unitSize, plural, =1 {/ unité} other {/ {unitSize, number} unités}}",resourcesExceeded:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}}",estOverageCharges:"Charges de dépassement estimées pour cette période : {amount}",overageRateDisplay:"Tarif de dépassement : {rate}",resetDateDisplay:"L'utilisation se réinitialise le {date}",daysRemainingDisplay:"{count, plural, one {# jour restant} other {# jours restants}}"},profile:{email:"E-mail",name:"Nom",language:"Langue",country:"Pays",currency:"Devise",timezone:"Fuseau horaire",profileImage:"Image de profil",success:"Profil enregistré avec succès",nameMinLength:"Le nom doit comporter au moins 2 caractères.",save:"Enregistrer",reset:"Réinitialiser"},general:{ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les paramètres.",name:"Nom",namePlaceholder:"Mon espace de travail",nameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",billingCurrency:"Devise de facturation",icon:"Icône",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",previewLabel:"Aperçu :",success:"Paramètres de l'espace de travail enregistrés avec succès",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",updateWorkspace:"Mettre à jour l'espace de travail"},features:{title:"Fonctionnalités de l'espace de travail",ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les fonctionnalités.",noFeatures:"L'espace de travail n'a pas de fonctionnalités à gérer.",enabled:"activée",disabled:"désactivée",enabling:"Activation",disabling:"Désactivation",featureSuccess:"avec succès",updateSuccess:"{feature} {enabled, select, true {activée} other {désactivée}} avec succès",actionStatus:"{action, select, enabling {Activation} disabling {Désactivation} other {}}"},danger:{title:"Supprimer l'espace de travail",adminOnly:"Seuls les administrateurs peuvent supprimer les espaces de travail.",deleteWorkspace:"Supprimer l'espace de travail",deleteConfirm:"Êtes-vous absolument sûr ?",deleteWarning:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes les données associées.",deleting:"Suppression...",deleteDescription:"Une fois l'espace de travail supprimé, il n'y a pas de retour en arrière. Cela supprimera définitivement l'espace de travail et toutes ses données, y compris les membres, les paramètres et les fonctionnalités.",deleteConfirmDescription:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes ses données.",failedToDelete:"Échec de la suppression de l'espace de travail"},notifications:{title:"Préférences de notifications",permissionDenied:"Autorisation de notifications refusée",notSupported:"Les notifications push ne sont pas prises en charge par ce navigateur.",manageDescription:"Gérez la façon dont vous recevez les notifications de cet espace de travail.",blocked:"Notifications bloquées",blockedDescription:"Vous avez précédemment bloqué les notifications pour ce site. Pour les activer, mettez à jour les paramètres de votre navigateur :",pushTitle:"Notifications push",pushEnabledDescription:"Vous recevrez des notifications du navigateur pour les mises à jour importantes.",pushDisabledDescription:"Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.",enabling:"Activation...",disabling:"Désactivation...",enable:"Activer",disable:"Désactiver",toggleAction:"{loading, select, true {{subscribed, select, true {Désactivation...} other {Activation...}}} other {{subscribed, select, true {Désactiver} other {Activer}}}}",pushDescription:"{subscribed, select, true {Vous recevrez des notifications du navigateur pour les mises à jour importantes.} other {Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.}}",deviceNote:"Les notifications sont envoyées à cet appareil. Activez-les sur vos autres appareils séparément.",unblock:{firefox:{step1:"Cliquez sur l'icône du cadenas (ou du bouclier) dans la barre d'adresse",step2:'Trouvez "Notifications" dans la liste des autorisations',step3:'Changez de "Bloqué" à "Autoriser"',step4:"Rechargez cette page"},safari:{step1:"Ouvrez Safari → Réglages → Sites web → Notifications",step2:"Trouvez ce site web dans la liste",step3:'Changez de "Refuser" à "Autoriser"',step4:"Rechargez cette page"},edge:{step1:"Cliquez sur l'icône du cadenas dans la barre d'adresse",step2:'Cliquez sur "Autorisations pour ce site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"},chrome:{step1:"Cliquez sur l'icône du cadenas (ou de réglage) dans la barre d'adresse",step2:'Cliquez sur "Paramètres du site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"}}},quota:{includedOnly:"{count, number} inclus",includedWithOverage:"{count, number} inclus, puis {price} / {unit}",unitFallback:"unité"},pricing:{title:"Choisissez votre plan",description:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",currency:"Devise",billingIn:"Facturation en",noPlansCurrency:"Aucun plan disponible pour votre devise de facturation.",noPlansCurrencyHint:"Une erreur s'est produite. Veuillez contacter le support.",noPlans:"Aucun plan disponible",free:"Gratuit",included:"inclus",save:"Économisez",current:"Actuel",processing:"Traitement...",unavailable:"Indisponible",selectCurrency:"Sélectionner la devise de facturation",billingInterval:"Intervalle de facturation"},beta:{nameLabel:"Nom",emailLabel:"E-mail",submitText:"Envoyer",submittingText:"Envoi...",errorMessage:"Une erreur s'est produite",tryAgain:"Réessayer",privacyConsent:"En soumettant ce formulaire, vous acceptez notre",privacyPolicy:"Politique de confidentialité",and:"et",termsOfService:"Conditions d'utilisation"},workspace:{switchTitle:"Changer d'espace de travail",switchDescription:"Sélectionnez un espace de travail ou créez-en un nouveau.",notLoggedIn:"Il semble que vous n'êtes pas connecté. Veuillez vous connecter pour continuer.",availableWorkspaces:"Espaces de travail disponibles ({count, number})",loadingWorkspaces:"Chargement des espaces de travail...",searchPlaceholder:"Rechercher des espaces de travail...",noWorkspacesFound:"Aucun espace de travail trouvé",noWorkspacesAvailable:"Aucun espace de travail disponible",switchTo:"Passer à",membersCount:"{count, plural, one {# membre} other {# membres}}",createNew:"Créer un nouvel espace de travail",createTitle:"Créer un nouvel espace de travail",createDescription:"Créez un nouvel espace de travail pour commencer.",workspaceName:"Nom de l'espace de travail",workspaceNamePlaceholder:"Mon espace de travail",workspaceNameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",workspaceIcon:"Icône de l'espace de travail",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",invalidUrl:"Veuillez entrer une URL valide",creating:"Création...",createWorkspace:"Créer l'espace de travail"},dropdowns:{search:"Rechercher...",chooseOption:"Choisir une option",chooseCountry:"Choisir un pays",searchCountry:"Choisir un pays...",chooseLanguage:"Choisir une langue",searchLanguage:"Choisir une langue...",chooseCurrency:"Choisir une devise",searchCurrency:"Choisir une devise...",chooseTimezone:"Choisir un fuseau horaire",searchTimezone:"Choisir un fuseau horaire..."},push:{failedToSubscribe:"Échec de l'abonnement aux notifications push",failedToUnsubscribe:"Échec de la désinscription des notifications push"},errors:{networkError:"Erreur réseau : Veuillez vérifier votre connexion Internet",unauthorized:"Non autorisé — Veuillez vérifier votre session",notFound:"Ressource introuvable",generic:"Une erreur s'est produite",fetchPlans:"Échec de la récupération des plans",fetchPlanGroup:"Échec de la récupération du groupe de plans",fetchPlanGroupVersion:"Échec de la récupération de la version du groupe de plans",fetchPlanGroupVersions:"Échec de la récupération des versions du groupe de plans",fetchSubscription:"Échec de la récupération de l'abonnement",createCheckout:"Échec de la création de la session de paiement",updateSubscription:"Échec de la mise à jour de l'abonnement",fetchInvoices:"Échec de la récupération des factures",fetchInvoice:"Échec de la récupération de la facture",openBillingPortal:"Échec de l'ouverture du portail de facturation",cancelSubscription:"Échec de l'annulation de l'abonnement",resumeSubscription:"Échec de la reprise de l'abonnement",recordUsage:"Échec de l'enregistrement de l'utilisation",fetchQuotaUsage:"Échec de la récupération du statut d'utilisation des quotas",fetchAllQuotaUsage:"Échec de la récupération de toute l'utilisation des quotas",fetchUsageLogs:"Échec de la récupération des journaux d'utilisation"}}});var xd=Object.freeze({__proto__:null,de:{settings:{titles:{profile:"Konto",general:"Arbeitsbereich-Einstellungen",users:"Arbeitsbereich-Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",features:"Arbeitsbereich-Funktionen",notifications:"Benachrichtigungen",danger:"Gefahrenzone"},sidebar:{account:"Konto",workspace:"Arbeitsbereich",profile:"Konto",general:"Einstellungen",users:"Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",features:"Funktionen",notifications:"Benachrichtigungen",danger:"Gefahrenzone"},common:{refresh:"Aktualisieren",refreshing:"Wird aktualisiert...",retry:"Erneut versuchen",retrying:"Wird erneut versucht...",save:"Speichern",saving:"Wird gespeichert...",cancel:"Abbrechen",delete:"Löschen",dismiss:"Verwerfen",loading:"Wird geladen...",success:"Erfolg!",error:"Fehler",refreshAction:"{loading, select, true {Wird aktualisiert...} other {Aktualisieren}}",retryAction:"{loading, select, true {Wird erneut versucht...} other {Erneut versuchen}}"}},subscription:{managePlan:"Verwalte deinen Plan und deine Abrechnung",changePlan:"Plan ändern",viewPricingPlans:"Preispläne ansehen",viewPlans:"Pläne ansehen",upgradePlan:"Jetzt upgraden",subscribe:"Abonnieren",currentPlan:"Aktueller Plan",noSubscription:"Du hast kein aktives Abonnement",choosePlan:"Wähle deinen Plan",choosePlanDescription:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",planUpdateAvailable:"Plan-Update verfügbar",updateSuccess:"Abonnement erfolgreich aktualisiert!",updateFailed:"Aktualisierung fehlgeschlagen",cancelTitle:"Abonnement kündigen",cancelConfirm:"Bist du sicher, dass du dein Abonnement kündigen möchtest?",cancelKeep:"Abonnement behalten",cancelButton:"Ja, Abonnement kündigen",canceling:"Wird gekündigt...",cancelSuccess:"Das Abonnement wird zum Ende des Abrechnungszeitraums gekündigt.",cancelNotCharged:"Nach der Kündigung wird dir nichts mehr berechnet",cancelResumeAnytime:"Du kannst dein Abonnement jederzeit vor Ablauf wieder aufnehmen",resumeTitle:"Abonnement fortsetzen",resumeConfirm:"Bist du sicher, dass du dein Abonnement fortsetzen möchtest?",resumeKeep:"Gekündigt lassen",resumeButton:"Ja, Abonnement fortsetzen",resuming:"Wird fortgesetzt...",resumeSuccess:"Das Abonnement wurde fortgesetzt.",managePayment:"Zahlung verwalten",openingPortal:"Wird geöffnet...",viewAllPlans:"Alle Pläne ansehen",scheduledCancellation:"Kündigung des Abonnements geplant",paymentPastDue:"Zahlung überfällig",paymentPastDueDescription:"Bitte aktualisiere deine Zahlungsmethode, um eine Dienstunterbrechung zu vermeiden.",subscriptionPaused:"Abonnement pausiert",subscriptionPausedDescription:"Dein Abonnement ist derzeit pausiert. Setze es fort, um den vollen Zugang wiederherzustellen.",errorLoading:"Fehler beim Laden der Abonnementdaten",errorLoadingDescription:"Bitte überprüfe deine Verbindung und versuche es erneut.",errorProcessing:"Abonnement konnte nicht verarbeitet werden",errorCanceling:"Abonnement konnte nicht gekündigt werden",errorResuming:"Abonnement konnte nicht fortgesetzt werden",invalidWorkspace:"Ungültige Arbeitsbereich-ID",billingInterval:{monthly:"Monatlich",quarterly:"Vierteljährlich",yearly:"Jährlich",perMonth:"/Monat",perQuarter:"/Quartal",perYear:"/Jahr"},seats:{title:"Plätze",members:"Mitglieder",included:"Enthalten",billable:"Abrechenbar",perExtraSeat:"Pro zusätzlichem Platz",limit:"Limit",includedSeats:"Enthaltene Plätze",maxSeats:"Max. Plätze",freeWithBase:"Im Grundpreis enthalten",allIncluded:"Alle enthalten",extra:"zusätzlich",unlimited:"Unbegrenzt"},items:{features:"Funktionen",limits:"Limits",quotas:"Nutzungskontingente"},checkout:{upgrade:"Upgraden",downgrade:"Downgraden",switchTo:"Wechseln zu",select:"Auswählen"},status:{active:"Aktiv",canceling:"Wird gekündigt",trial:"Testversion",canceled:"Gekündigt",pastDue:"Überfällig",paused:"Pausiert",deprecated:"Veraltet",unknown:"Unbekannt"},plan:"Plan",invoicesTab:"Rechnungen",changePlanButton:"Plan ändern",noPlanAssigned:"Kein Plan zugewiesen",free:"Kostenlos",perSeatDisplay:"+ {price}/Platz{interval}",estTotalDisplay:"Geschätztes Gesamt: {total}{interval} ({count, plural, one {# zusätzlicher Platz} other {# zusätzliche Plätze}})",nextBillingDisplay:"Nächste Abrechnung: {date}",membersInWorkspace:"{count, plural, one {# Mitglied} other {# Mitglieder}} im Arbeitsbereich",billingInCurrency:"Abrechnung in {currency}",savingsPercent:"{percent, number}% sparen",switchToInterval:"Zu {interval} wechseln",seatPriceDisplay:"+ {price}/Platz{interval} ({included} {includedLabel})",trialEnded:"Deine Testversion ist abgelaufen.",trialEndsIn:"Deine Testversion endet in {days, plural, one {# Tag} other {# Tagen}}.",onTrial:"Du befindest dich in der Testversion.",upgradeToKeepAccess:"Upgrade, um den Zugang zu behalten.",viewInvoices:"Rechnungen ansehen",cancelTrial:"Testversion abbrechen",dunningFinal:"Letzte Warnung: Abonnement wird ausgesetzt",dunningSuspended:"Abonnement ausgesetzt",dunningRecovery:"Zahlungswiederherstellung läuft",dunningSuspendedDescription:"Dein Abonnement wurde aufgrund wiederholter Zahlungsfehler ausgesetzt. Aktualisiere deine Zahlungsmethode, um den Zugang wiederherzustellen.",dunningRecoveryDescription:"Wir konnten deine Zahlung nicht verarbeiten. Bitte aktualisiere deine Zahlungsmethode, um den Zugang nicht zu verlieren.",cancelEndDescription:"Dein Abonnement endet am",cancelEndFallback:"Dein Abonnement wird zum Ende des aktuellen Abrechnungszeitraums gekündigt. Dir wird nichts mehr berechnet.",resumeChargeDate:"Dir wird erneut berechnet am",resumeChargeFallback:"dem nächsten Abrechnungsdatum",resumeContinue:"Dein Abonnement wird automatisch fortgesetzt und gemäß deinem Plan abgerechnet",resumeCancelAnytime:"Du kannst jederzeit vor dem nächsten Abrechnungsdatum kündigen, wenn du es dir anders überlegst",retainAccess:"Du behältst den vollen Zugang zu diesem Plan bis",retainAccessFallback:"zum Ende deines aktuellen Abrechnungszeitraums",noPlansAvailable:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar. Bitte kontaktiere den Support, wenn du glaubst, dass dies ein Fehler ist.",noPlansAvailableHint:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar.",startTrialDescription:"Teste den vollständigen Plan ohne Verpflichtung. Du kannst jederzeit upgraden oder kündigen.",noSubscriptionDescription:"Wähle einen Plan, um mit deinem Arbeitsbereich loszulegen",startFreeTrial:"Kostenlose Testversion starten"},users:{title:"Arbeitsbereich-Mitglieder",adminOnly:"Nur der Arbeitsbereich-Administrator kann Benutzer und Rollen verwalten.",inviteByEmail:"Mitglied per E-Mail einladen",inviteButton:"Einladen",inviting:"Wird eingeladen...",inviteSuccess:"Benutzer erfolgreich eingeladen",emailRequired:"E-Mail-Adresse ist erforderlich",invalidEmail:"Ungültiges E-Mail-Adressformat",inviteFailed:"Einladung des Mitglieds fehlgeschlagen",seatLimitReached:"Platzlimit erreicht",memberLimitReached:"Mitgliederlimit erreicht",role:"Rolle",you:"Du",owner:"Eigentümer",noMembers:"Keine Mitglieder in diesem Arbeitsbereich gefunden.",extraSeatCost:"Jedes zusätzliche Mitglied fügt {price}/{interval, select, yearly {Jahr} quarterly {Quartal} other {Monat}} zu deinem Abonnement hinzu",unknownUser:"Unbekannter Benutzer",seats:"Plätze",members:"Mitglieder",included:"enthalten",perExtraSeat:"/zusätzlicher Platz",maxMembers:"max. Mitglieder",available:"verfügbar",noMemberLimit:"Kein Mitgliederlimit",seatHeading:"{hasSeatPricing, select, true {Plätze} other {Mitglieder}}",limitReached:"{reason, select, seat_limit_reached {Platzlimit erreicht} other {Mitgliederlimit erreicht}}",memberCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",subscriptionRequired:"Ein Abonnement ist erforderlich, um Mitglieder einzuladen.",seatLimitMessage:"Dein Plan erlaubt bis zu {maxUsers, number} Mitglieder. Upgrade für mehr Plätze.",settingsLimitMessage:"Dieser Arbeitsbereich erlaubt bis zu {maxUsers, number} Mitglieder.",memberLimitMessage:"Mitgliederlimit von {maxUsers, number} erreicht.",selectRole:"Rolle auswählen",inviteAs:"Einladen als {role}"},invoices:{title:"Abrechnungsverlauf",description:"Rechnungen ansehen und herunterladen",pay:"Bezahlen",view:"Ansehen",viewDetails:"Details ansehen",download:"PDF",errorLoading:"Fehler beim Laden der Rechnungen",noInvoices:"Noch keine Rechnungen. Abonniere einen Plan, um Rechnungen zu erhalten.",noInvoicesWithSub:"Keine Rechnungen mit Download-Option gefunden",paidAmount:"Bezahlt: {amount}",na:"k. A.",status:{draft:"Entwurf",open:"Offen",paid:"Bezahlt",uncollectible:"Uneinbringlich",void:"Storniert"}},usage:{title:"Nutzung",description:"Überwache deinen Ressourcenverbrauch und deine Kontingente",totalResources:"Ressourcen gesamt",overallUsage:"Gesamtnutzung",inOverage:"Im Überschuss",estOverageCost:"Geschätzte Überschusskosten",overageDetected:"Überschuss erkannt",overageDescription:"Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",overageUnits:"Überschusseinheiten",rate:"Tarif",billableBlocks:"Abrechenbare Blöcke",estimatedCharge:"Geschätzte Kosten",noData:"Keine Kontingentnutzungsdaten für diesen Arbeitsbereich verfügbar.",noDataHint:"Kontingente erscheinen hier, sobald dein Plan gemessene Ressourcen enthält.",used:"genutzt",remaining:"verbleibend",overLimit:"über dem Limit",percentUsed:"{percent, number}% genutzt",availableRemaining:"{count} verbleibend",overLimitCount:"{count} über dem Limit",overageWarning:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}} Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",fullyUsed:"Vollständig genutzt",renewingSoon:"wird bald erneuert",almostFull:"Fast voll",overage:"Überschuss",errorLoading:"Nutzungsdaten konnten nicht geladen werden",perUnit:"/ Einheit",perUnits:"/ Einheiten",rateDisplay:"{rate} {unitSize, plural, =1 {/ Einheit} other {/ {unitSize, number} Einheiten}}",resourcesExceeded:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}}",estOverageCharges:"Geschätzte Überschusskosten in diesem Zeitraum: {amount}",overageRateDisplay:"Überschusstarif: {rate}",resetDateDisplay:"Nutzung wird zurückgesetzt am {date}",daysRemainingDisplay:"{count, plural, one {# Tag verbleibend} other {# Tage verbleibend}}"},profile:{email:"E-Mail",name:"Name",language:"Sprache",country:"Land",currency:"Währung",timezone:"Zeitzone",profileImage:"Profilbild",success:"Profil erfolgreich gespeichert",nameMinLength:"Der Name muss mindestens 2 Zeichen lang sein.",save:"Speichern",reset:"Zurücksetzen"},general:{ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Einstellungen ändern.",name:"Name",namePlaceholder:"Mein Arbeitsbereich",nameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",billingCurrency:"Abrechnungswährung",icon:"Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",previewLabel:"Vorschau:",success:"Arbeitsbereich-Einstellungen erfolgreich gespeichert",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",updateWorkspace:"Arbeitsbereich aktualisieren"},features:{title:"Arbeitsbereich-Funktionen",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Funktionen ändern.",noFeatures:"Der Arbeitsbereich hat keine zu verwaltenden Funktionen.",enabled:"aktiviert",disabled:"deaktiviert",enabling:"Wird aktiviert",disabling:"Wird deaktiviert",featureSuccess:"erfolgreich",updateSuccess:"{feature} erfolgreich {enabled, select, true {aktiviert} other {deaktiviert}}",actionStatus:"{action, select, enabling {Wird aktiviert} disabling {Wird deaktiviert} other {}}"},danger:{title:"Arbeitsbereich löschen",adminOnly:"Nur Administratoren können Arbeitsbereiche löschen.",deleteWorkspace:"Arbeitsbereich löschen",deleteConfirm:"Bist du dir absolut sicher?",deleteWarning:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle zugehörigen Daten werden dauerhaft gelöscht.",deleting:"Wird gelöscht...",deleteDescription:"Sobald du einen Arbeitsbereich löschst, gibt es kein Zurück. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht, einschließlich Mitglieder, Einstellungen und Funktionen.",deleteConfirmDescription:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht.",failedToDelete:"Arbeitsbereich konnte nicht gelöscht werden"},notifications:{title:"Benachrichtigungseinstellungen",permissionDenied:"Benachrichtigungsberechtigung verweigert",notSupported:"Push-Benachrichtigungen werden in diesem Browser nicht unterstützt.",manageDescription:"Verwalte, wie du Benachrichtigungen von diesem Arbeitsbereich erhältst.",blocked:"Benachrichtigungen blockiert",blockedDescription:"Du hast Benachrichtigungen für diese Seite zuvor blockiert. Um sie zu aktivieren, aktualisiere deine Browsereinstellungen:",pushTitle:"Push-Benachrichtigungen",pushEnabledDescription:"Du erhältst Browser-Benachrichtigungen für wichtige Updates.",pushDisabledDescription:"Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.",enabling:"Wird aktiviert...",disabling:"Wird deaktiviert...",enable:"Aktivieren",disable:"Deaktivieren",toggleAction:"{loading, select, true {{subscribed, select, true {Wird deaktiviert...} other {Wird aktiviert...}}} other {{subscribed, select, true {Deaktivieren} other {Aktivieren}}}}",pushDescription:"{subscribed, select, true {Du erhältst Browser-Benachrichtigungen für wichtige Updates.} other {Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.}}",deviceNote:"Benachrichtigungen werden an dieses Gerät gesendet. Aktiviere sie auf anderen Geräten separat.",unblock:{firefox:{step1:"Klicke auf das Schloss-Symbol (oder Schild-Symbol) in der Adressleiste",step2:'Finde "Benachrichtigungen" in der Berechtigungsliste',step3:'Ändere von "Blockiert" zu "Erlauben"',step4:"Lade diese Seite neu"},safari:{step1:"Öffne Safari → Einstellungen → Websites → Benachrichtigungen",step2:"Finde diese Website in der Liste",step3:'Ändere von "Ablehnen" zu "Erlauben"',step4:"Lade diese Seite neu"},edge:{step1:"Klicke auf das Schloss-Symbol in der Adressleiste",step2:'Klicke auf "Berechtigungen für diese Website"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"},chrome:{step1:"Klicke auf das Schloss-Symbol (oder Einstellungssymbol) in der Adressleiste",step2:'Klicke auf "Website-Einstellungen"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"}}},quota:{includedOnly:"{count, number} enthalten",includedWithOverage:"{count, number} enthalten, dann {price} / {unit}",unitFallback:"Einheit"},pricing:{title:"Wähle deinen Plan",description:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",currency:"Währung",billingIn:"Abrechnung in",noPlansCurrency:"Keine Pläne für deine Abrechnungswährung verfügbar.",noPlansCurrencyHint:"Etwas ist schiefgelaufen. Bitte kontaktiere den Support.",noPlans:"Keine Pläne verfügbar",free:"Kostenlos",included:"enthalten",save:"Sparen",current:"Aktuell",processing:"Wird verarbeitet...",unavailable:"Nicht verfügbar",selectCurrency:"Abrechnungswährung auswählen",billingInterval:"Abrechnungsintervall"},beta:{nameLabel:"Name",emailLabel:"E-Mail",submitText:"Absenden",submittingText:"Wird gesendet...",errorMessage:"Ein Fehler ist aufgetreten",tryAgain:"Erneut versuchen",privacyConsent:"Mit dem Absenden dieses Formulars stimmst du unserer",privacyPolicy:"Datenschutzrichtlinie",and:"und",termsOfService:"Nutzungsbedingungen"},workspace:{switchTitle:"Arbeitsbereich wechseln",switchDescription:"Wähle einen Arbeitsbereich aus oder erstelle einen neuen.",notLoggedIn:"Es sieht so aus, als wärst du nicht eingeloggt. Bitte melde dich an, um fortzufahren.",availableWorkspaces:"Verfügbare Arbeitsbereiche ({count, number})",loadingWorkspaces:"Arbeitsbereiche werden geladen...",searchPlaceholder:"Arbeitsbereiche suchen...",noWorkspacesFound:"Keine Arbeitsbereiche gefunden",noWorkspacesAvailable:"Keine Arbeitsbereiche verfügbar",switchTo:"Wechseln zu",membersCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",createNew:"Neuen Arbeitsbereich erstellen",createTitle:"Neuen Arbeitsbereich erstellen",createDescription:"Erstelle einen neuen Arbeitsbereich, um loszulegen.",workspaceName:"Name des Arbeitsbereichs",workspaceNamePlaceholder:"Mein Arbeitsbereich",workspaceNameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",workspaceIcon:"Arbeitsbereich-Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",invalidUrl:"Bitte gib eine gültige URL ein",creating:"Wird erstellt...",createWorkspace:"Arbeitsbereich erstellen"},dropdowns:{search:"Suchen...",chooseOption:"Option wählen",chooseCountry:"Land wählen",searchCountry:"Land wählen...",chooseLanguage:"Sprache wählen",searchLanguage:"Sprache wählen...",chooseCurrency:"Währung wählen",searchCurrency:"Währung wählen...",chooseTimezone:"Zeitzone wählen",searchTimezone:"Zeitzone wählen..."},push:{failedToSubscribe:"Push-Benachrichtigungen konnten nicht abonniert werden",failedToUnsubscribe:"Push-Benachrichtigungen konnten nicht abbestellt werden"},errors:{networkError:"Netzwerkfehler: Bitte überprüfe deine Internetverbindung",unauthorized:"Nicht autorisiert — Bitte überprüfe deine Sitzung",notFound:"Ressource nicht gefunden",generic:"Ein Fehler ist aufgetreten",fetchPlans:"Pläne konnten nicht abgerufen werden",fetchPlanGroup:"Plangruppe konnte nicht abgerufen werden",fetchPlanGroupVersion:"Plangruppenversion konnte nicht abgerufen werden",fetchPlanGroupVersions:"Plangruppenversionen konnten nicht abgerufen werden",fetchSubscription:"Abonnement konnte nicht abgerufen werden",createCheckout:"Checkout-Sitzung konnte nicht erstellt werden",updateSubscription:"Abonnement konnte nicht aktualisiert werden",fetchInvoices:"Rechnungen konnten nicht abgerufen werden",fetchInvoice:"Rechnung konnte nicht abgerufen werden",openBillingPortal:"Abrechnungsportal konnte nicht geöffnet werden",cancelSubscription:"Abonnement konnte nicht gekündigt werden",resumeSubscription:"Abonnement konnte nicht fortgesetzt werden",recordUsage:"Nutzung konnte nicht erfasst werden",fetchQuotaUsage:"Kontingentnutzungsstatus konnte nicht abgerufen werden",fetchAllQuotaUsage:"Gesamte Kontingentnutzung konnte nicht abgerufen werden",fetchUsageLogs:"Nutzungsprotokolle konnten nicht abgerufen werden"}}});var vd=Object.freeze({__proto__:null,ja:{settings:{titles:{profile:"アカウント",general:"ワークスペース設定",users:"ワークスペースメンバー",subscription:"プランと請求",usage:"使用状況",features:"ワークスペース機能",notifications:"通知",danger:"危険ゾーン"},sidebar:{account:"アカウント",workspace:"ワークスペース",profile:"アカウント",general:"設定",users:"メンバー",subscription:"プランと請求",usage:"使用状況",features:"機能",notifications:"通知",danger:"危険ゾーン"},common:{refresh:"更新",refreshing:"更新中...",retry:"再試行",retrying:"再試行中...",save:"保存",saving:"保存中...",cancel:"キャンセル",delete:"削除",dismiss:"閉じる",loading:"読み込み中...",success:"成功しました!",error:"エラー",refreshAction:"{loading, select, true {更新中...} other {更新}}",retryAction:"{loading, select, true {再試行中...} other {再試行}}"}},subscription:{managePlan:"プランと請求を管理",changePlan:"プランを変更",viewPricingPlans:"料金プランを見る",viewPlans:"プランを見る",upgradePlan:"今すぐアップグレード",subscribe:"登録する",currentPlan:"現在のプラン",noSubscription:"有効なサブスクリプションがありません",choosePlan:"プランを選択",choosePlanDescription:"プランを比較して、ニーズに合ったものを選択してください",planUpdateAvailable:"プランの更新が利用可能です",updateSuccess:"サブスクリプションが正常に更新されました!",updateFailed:"更新に失敗しました",cancelTitle:"サブスクリプションをキャンセル",cancelConfirm:"サブスクリプションをキャンセルしてもよろしいですか?",cancelKeep:"サブスクリプションを維持",cancelButton:"はい、キャンセルします",canceling:"キャンセル中...",cancelSuccess:"サブスクリプションは請求期間の終了時にキャンセルされます。",cancelNotCharged:"キャンセル後は課金されません",cancelResumeAnytime:"終了前であればいつでもサブスクリプションを再開できます",resumeTitle:"サブスクリプションを再開",resumeConfirm:"サブスクリプションを再開してもよろしいですか?",resumeKeep:"キャンセルのまま維持",resumeButton:"はい、再開します",resuming:"再開中...",resumeSuccess:"サブスクリプションが再開されました。",managePayment:"支払いを管理",openingPortal:"開いています...",viewAllPlans:"すべてのプランを見る",scheduledCancellation:"サブスクリプションのキャンセルが予定されています",paymentPastDue:"支払い期限超過",paymentPastDueDescription:"サービスの中断を避けるため、お支払い方法を更新してください。",subscriptionPaused:"サブスクリプション一時停止中",subscriptionPausedDescription:"サブスクリプションは現在一時停止中です。再開してフルアクセスを復元してください。",errorLoading:"サブスクリプションデータの読み込みエラー",errorLoadingDescription:"接続を確認して、もう一度お試しください。",errorProcessing:"サブスクリプションの処理に失敗しました",errorCanceling:"サブスクリプションのキャンセルに失敗しました",errorResuming:"サブスクリプションの再開に失敗しました",invalidWorkspace:"無効なワークスペースID",billingInterval:{monthly:"月額",quarterly:"四半期",yearly:"年額",perMonth:"/月",perQuarter:"/四半期",perYear:"/年"},seats:{title:"シート",members:"メンバー",included:"含まれる",billable:"課金対象",perExtraSeat:"追加シートあたり",limit:"上限",includedSeats:"含まれるシート数",maxSeats:"最大シート数",freeWithBase:"基本料金に含まれる",allIncluded:"すべて含まれる",extra:"追加",unlimited:"無制限"},items:{features:"機能",limits:"制限",quotas:"使用量クォータ"},checkout:{upgrade:"アップグレード",downgrade:"ダウングレード",switchTo:"切り替え",select:"選択"},status:{active:"有効",canceling:"キャンセル中",trial:"トライアル",canceled:"キャンセル済み",pastDue:"期限超過",paused:"一時停止中",deprecated:"非推奨",unknown:"不明"},plan:"プラン",invoicesTab:"請求書",changePlanButton:"プランを変更",noPlanAssigned:"プランが割り当てられていません",free:"無料",perSeatDisplay:"+ {price}/シート{interval}",estTotalDisplay:"推定合計: {total}{interval} ({count, plural, one {追加シート #} other {追加シート #}})",nextBillingDisplay:"次回請求日: {date}",membersInWorkspace:"ワークスペースに{count, plural, one {# メンバー} other {# メンバー}}",billingInCurrency:"{currency}で請求",savingsPercent:"{percent, number}%お得",switchToInterval:"{interval}に切り替え",seatPriceDisplay:"+ {price}/シート{interval} ({included} {includedLabel})",trialEnded:"トライアル期間が終了しました。",trialEndsIn:"トライアル期間は{days, plural, one {# 日} other {# 日}}で終了します。",onTrial:"トライアル期間中です。",upgradeToKeepAccess:"アクセスを維持するにはアップグレードしてください。",viewInvoices:"請求書を見る",cancelTrial:"トライアルをキャンセル",dunningFinal:"最終警告:サブスクリプションが停止されます",dunningSuspended:"サブスクリプションが停止されました",dunningRecovery:"支払い回収中",dunningSuspendedDescription:"支払いの失敗が繰り返されたため、サブスクリプションが停止されました。アクセスを復元するには、お支払い方法を更新してください。",dunningRecoveryDescription:"お支払いを処理できませんでした。アクセスを失わないよう、お支払い方法を更新してください。",cancelEndDescription:"サブスクリプションの終了日:",cancelEndFallback:"サブスクリプションは現在の請求期間の終了時にキャンセルされます。以降の課金はありません。",resumeChargeDate:"次回の課金日:",resumeChargeFallback:"次回の請求日",resumeContinue:"サブスクリプションは自動的に継続され、プランに基づいて請求されます",resumeCancelAnytime:"次回の請求日前であれば、いつでもキャンセルできます",retainAccess:"このプランへのフルアクセスは次の日まで維持されます:",retainAccessFallback:"現在の請求期間の終了まで",noPlansAvailable:"このワークスペースで利用可能なプラングループがありません。エラーだと思われる場合は、サポートにお問い合わせください。",noPlansAvailableHint:"このワークスペースで利用可能なプラングループがありません。",startTrialDescription:"コミットなしでフルプランをお試しください。いつでもアップグレードまたはキャンセルできます。",noSubscriptionDescription:"ワークスペースを始めるにはプランを選択してください",startFreeTrial:"無料トライアルを開始"},users:{title:"ワークスペースメンバー",adminOnly:"ワークスペース管理者のみがユーザーとロールを管理できます。",inviteByEmail:"メールでメンバーを招待",inviteButton:"招待",inviting:"招待中...",inviteSuccess:"ユーザーが正常に招待されました",emailRequired:"メールアドレスは必須です",invalidEmail:"メールアドレスの形式が無効です",inviteFailed:"メンバーの招待に失敗しました",seatLimitReached:"シート上限に達しました",memberLimitReached:"メンバー上限に達しました",role:"ロール",you:"あなた",owner:"オーナー",noMembers:"このワークスペースにメンバーが見つかりません。",extraSeatCost:"追加メンバーごとにサブスクリプションに{price}/{interval, select, yearly {年} quarterly {四半期} other {月}}が追加されます",unknownUser:"不明なユーザー",seats:"シート",members:"メンバー",included:"含まれる",perExtraSeat:"/追加シート",maxMembers:"最大メンバー数",available:"利用可能",noMemberLimit:"メンバー制限なし",seatHeading:"{hasSeatPricing, select, true {シート} other {メンバー}}",limitReached:"{reason, select, seat_limit_reached {シート上限に達しました} other {メンバー上限に達しました}}",memberCount:"{count, plural, one {# メンバー} other {# メンバー}}",subscriptionRequired:"メンバーを招待するにはサブスクリプションが必要です。",seatLimitMessage:"プランでは最大{maxUsers, number}メンバーまで許可されています。シートを増やすにはアップグレードしてください。",settingsLimitMessage:"このワークスペースでは最大{maxUsers, number}メンバーまで許可されています。",memberLimitMessage:"メンバー上限の{maxUsers, number}に達しました。",selectRole:"ロールを選択",inviteAs:"{role}として招待"},invoices:{title:"請求履歴",description:"請求書の確認とダウンロード",pay:"支払う",view:"表示",viewDetails:"詳細を表示",download:"PDF",errorLoading:"請求書の読み込みエラー",noInvoices:"請求書はまだありません。プランに登録すると請求書が発行されます。",noInvoicesWithSub:"ダウンロード可能な請求書が見つかりません",paidAmount:"支払済: {amount}",na:"該当なし",status:{draft:"下書き",open:"未払い",paid:"支払済",uncollectible:"回収不能",void:"無効"}},usage:{title:"使用状況",description:"リソース消費量とクォータを監視",totalResources:"合計リソース",overallUsage:"全体の使用状況",inOverage:"超過中",estOverageCost:"推定超過コスト",overageDetected:"超過を検出",overageDescription:"追加使用分は次回の請求書で超過分として課金されます。",overageUnits:"超過ユニット",rate:"料金",billableBlocks:"課金対象ブロック",estimatedCharge:"推定料金",noData:"このワークスペースのクォータ使用データがありません。",noDataHint:"プランに従量制リソースが含まれると、ここにクォータが表示されます。",used:"使用済み",remaining:"残り",overLimit:"上限超過",percentUsed:"{percent, number}%使用済み",availableRemaining:"残り{count}",overLimitCount:"{count}が上限超過",overageWarning:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}追加使用分は次回の請求書で超過分として課金されます。",fullyUsed:"全量使用済み",renewingSoon:"まもなく更新",almostFull:"ほぼ上限",overage:"超過",errorLoading:"使用状況データの読み込みに失敗しました",perUnit:"/ ユニット",perUnits:"/ ユニット",rateDisplay:"{rate} {unitSize, plural, =1 {/ ユニット} other {/ {unitSize, number} ユニット}}",resourcesExceeded:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}",estOverageCharges:"この期間の推定超過料金: {amount}",overageRateDisplay:"超過料金: {rate}",resetDateDisplay:"使用量は{date}にリセットされます",daysRemainingDisplay:"{count, plural, one {残り # 日} other {残り # 日}}"},profile:{email:"メールアドレス",name:"名前",language:"言語",country:"国",currency:"通貨",timezone:"タイムゾーン",profileImage:"プロフィール画像",success:"プロフィールが正常に保存されました",nameMinLength:"名前は2文字以上で入力してください。",save:"保存",reset:"リセット"},general:{ownerOnly:"ワークスペースのオーナーのみが設定を変更できます。",name:"名前",namePlaceholder:"マイワークスペース",nameMinLength:"ワークスペース名は2文字以上で入力してください。",billingCurrency:"請求通貨",icon:"アイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",previewLabel:"プレビュー:",success:"ワークスペース設定が正常に保存されました",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",updateWorkspace:"ワークスペースを更新"},features:{title:"ワークスペース機能",ownerOnly:"ワークスペースのオーナーのみが機能を変更できます。",noFeatures:"ワークスペースに管理可能な機能がありません。",enabled:"有効",disabled:"無効",enabling:"有効化中",disabling:"無効化中",featureSuccess:"成功",updateSuccess:"{feature}が正常に{enabled, select, true {有効化} other {無効化}}されました",actionStatus:"{action, select, enabling {有効化中} disabling {無効化中} other {}}"},danger:{title:"ワークスペースを削除",adminOnly:"管理者のみがワークスペースを削除できます。",deleteWorkspace:"ワークスペースを削除",deleteConfirm:"本当によろしいですか?",deleteWarning:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",deleting:"削除中...",deleteDescription:"ワークスペースを削除すると元に戻すことはできません。ワークスペースとメンバー、設定、機能を含むすべてのデータが完全に削除されます。",deleteConfirmDescription:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",failedToDelete:"ワークスペースの削除に失敗しました"},notifications:{title:"通知設定",permissionDenied:"通知の権限が拒否されました",notSupported:"このブラウザではプッシュ通知はサポートされていません。",manageDescription:"このワークスペースからの通知の受信方法を管理します。",blocked:"通知がブロックされています",blockedDescription:"このサイトの通知を以前ブロックしました。有効にするには、ブラウザの設定を更新してください:",pushTitle:"プッシュ通知",pushEnabledDescription:"重要な更新についてブラウザ通知を受信します。",pushDisabledDescription:"支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。",enabling:"有効化中...",disabling:"無効化中...",enable:"有効にする",disable:"無効にする",toggleAction:"{loading, select, true {{subscribed, select, true {無効化中...} other {有効化中...}}} other {{subscribed, select, true {無効にする} other {有効にする}}}}",pushDescription:"{subscribed, select, true {重要な更新についてブラウザ通知を受信します。} other {支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。}}",deviceNote:"通知はこのデバイスに送信されます。他のデバイスでは個別に有効にしてください。",unblock:{firefox:{step1:"アドレスバーの鍵アイコン(またはシールドアイコン)をクリック",step2:"権限リストで「通知」を見つける",step3:"「ブロック」から「許可」に変更",step4:"このページを再読み込み"},safari:{step1:"Safari → 設定 → Webサイト → 通知 を開く",step2:"リストからこのWebサイトを見つける",step3:"「拒否」から「許可」に変更",step4:"このページを再読み込み"},edge:{step1:"アドレスバーの鍵アイコンをクリック",step2:"「このサイトの権限」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"},chrome:{step1:"アドレスバーの鍵アイコン(またはチューンアイコン)をクリック",step2:"「サイトの設定」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"}}},quota:{includedOnly:"{count, number}件含まれる",includedWithOverage:"{count, number}件含まれる、以降{price} / {unit}",unitFallback:"ユニット"},pricing:{title:"プランを選択",description:"プランを比較して、ニーズに合ったものを選択してください",currency:"通貨",billingIn:"請求通貨",noPlansCurrency:"お使いの請求通貨で利用可能なプランがありません。",noPlansCurrencyHint:"エラーが発生しました。サポートにお問い合わせください。",noPlans:"利用可能なプランがありません",free:"無料",included:"含まれる",save:"お得",current:"現在",processing:"処理中...",unavailable:"利用不可",selectCurrency:"請求通貨を選択",billingInterval:"請求間隔"},beta:{nameLabel:"名前",emailLabel:"メールアドレス",submitText:"送信",submittingText:"送信中...",errorMessage:"エラーが発生しました",tryAgain:"再試行",privacyConsent:"このフォームを送信することで、以下に同意したことになります:",privacyPolicy:"プライバシーポリシー",and:"および",termsOfService:"利用規約"},workspace:{switchTitle:"ワークスペースを切り替え",switchDescription:"ワークスペースを選択するか、新しく作成してください。",notLoggedIn:"ログインしていないようです。続行するにはログインしてください。",availableWorkspaces:"利用可能なワークスペース ({count, number})",loadingWorkspaces:"ワークスペースを読み込み中...",searchPlaceholder:"ワークスペースを検索...",noWorkspacesFound:"ワークスペースが見つかりません",noWorkspacesAvailable:"利用可能なワークスペースがありません",switchTo:"切り替え",membersCount:"{count, plural, one {# メンバー} other {# メンバー}}",createNew:"新しいワークスペースを作成",createTitle:"新しいワークスペースを作成",createDescription:"新しいワークスペースを作成して始めましょう。",workspaceName:"ワークスペース名",workspaceNamePlaceholder:"マイワークスペース",workspaceNameMinLength:"ワークスペース名は2文字以上で入力してください。",workspaceIcon:"ワークスペースアイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",invalidUrl:"有効なURLを入力してください",creating:"作成中...",createWorkspace:"ワークスペースを作成"},dropdowns:{search:"検索...",chooseOption:"オプションを選択",chooseCountry:"国を選択",searchCountry:"国を選択...",chooseLanguage:"言語を選択",searchLanguage:"言語を選択...",chooseCurrency:"通貨を選択",searchCurrency:"通貨を選択...",chooseTimezone:"タイムゾーンを選択",searchTimezone:"タイムゾーンを選択..."},push:{failedToSubscribe:"プッシュ通知の登録に失敗しました",failedToUnsubscribe:"プッシュ通知の解除に失敗しました"},errors:{networkError:"ネットワークエラー:インターネット接続を確認してください",unauthorized:"認証エラー — セッションを確認してください",notFound:"リソースが見つかりません",generic:"エラーが発生しました",fetchPlans:"プランの取得に失敗しました",fetchPlanGroup:"プラングループの取得に失敗しました",fetchPlanGroupVersion:"プラングループバージョンの取得に失敗しました",fetchPlanGroupVersions:"プラングループバージョン一覧の取得に失敗しました",fetchSubscription:"サブスクリプションの取得に失敗しました",createCheckout:"チェックアウトセッションの作成に失敗しました",updateSubscription:"サブスクリプションの更新に失敗しました",fetchInvoices:"請求書の取得に失敗しました",fetchInvoice:"請求書の取得に失敗しました",openBillingPortal:"請求ポータルを開けませんでした",cancelSubscription:"サブスクリプションのキャンセルに失敗しました",resumeSubscription:"サブスクリプションの再開に失敗しました",recordUsage:"使用量の記録に失敗しました",fetchQuotaUsage:"クォータ使用状況の取得に失敗しました",fetchAllQuotaUsage:"全クォータ使用状況の取得に失敗しました",fetchUsageLogs:"使用ログの取得に失敗しました"}}});var yd=Object.freeze({__proto__:null,zh:{settings:{titles:{profile:"账户",general:"工作区设置",users:"工作区成员",subscription:"套餐与账单",usage:"用量",features:"工作区功能",notifications:"通知",danger:"危险区域"},sidebar:{account:"账户",workspace:"工作区",profile:"账户",general:"设置",users:"成员",subscription:"套餐与账单",usage:"用量",features:"功能",notifications:"通知",danger:"危险区域"},common:{refresh:"刷新",refreshing:"正在刷新...",retry:"重试",retrying:"正在重试...",save:"保存",saving:"正在保存...",cancel:"取消",delete:"删除",dismiss:"关闭",loading:"正在加载...",success:"操作成功!",error:"错误",refreshAction:"{loading, select, true {正在刷新...} other {刷新}}",retryAction:"{loading, select, true {正在重试...} other {重试}}"}},subscription:{managePlan:"管理您的套餐和账单",changePlan:"更改套餐",viewPricingPlans:"查看价格方案",viewPlans:"查看套餐",upgradePlan:"立即升级",subscribe:"订阅",currentPlan:"当前套餐",noSubscription:"您没有有效的订阅",choosePlan:"选择您的套餐",choosePlanDescription:"比较各套餐,选择最适合您需求的方案",planUpdateAvailable:"套餐更新可用",updateSuccess:"订阅已成功更新!",updateFailed:"更新失败",cancelTitle:"取消订阅",cancelConfirm:"您确定要取消订阅吗?",cancelKeep:"保留订阅",cancelButton:"是的,取消订阅",canceling:"正在取消...",cancelSuccess:"订阅将在当前计费周期结束时取消。",cancelNotCharged:"取消后将不再收费",cancelResumeAnytime:"您可以在订阅结束前随时恢复",resumeTitle:"恢复订阅",resumeConfirm:"您确定要恢复订阅吗?",resumeKeep:"保持取消状态",resumeButton:"是的,恢复订阅",resuming:"正在恢复...",resumeSuccess:"订阅已恢复。",managePayment:"管理支付方式",openingPortal:"正在打开...",viewAllPlans:"查看所有套餐",scheduledCancellation:"订阅已安排取消",paymentPastDue:"付款逾期",paymentPastDueDescription:"请更新您的支付方式以避免服务中断。",subscriptionPaused:"订阅已暂停",subscriptionPausedDescription:"您的订阅当前已暂停。恢复订阅以获得完整访问权限。",errorLoading:"加载订阅数据时出错",errorLoadingDescription:"请检查您的网络连接并重试。",errorProcessing:"订阅处理失败",errorCanceling:"取消订阅失败",errorResuming:"恢复订阅失败",invalidWorkspace:"无效的工作区 ID",billingInterval:{monthly:"月付",quarterly:"季付",yearly:"年付",perMonth:"/月",perQuarter:"/季",perYear:"/年"},seats:{title:"席位",members:"成员",included:"包含",billable:"计费",perExtraSeat:"每增加一个席位",limit:"上限",includedSeats:"包含席位数",maxSeats:"最大席位数",freeWithBase:"包含在基础价格中",allIncluded:"全部包含",extra:"额外",unlimited:"不限"},items:{features:"功能",limits:"限制",quotas:"用量配额"},checkout:{upgrade:"升级",downgrade:"降级",switchTo:"切换至",select:"选择"},status:{active:"有效",canceling:"取消中",trial:"试用",canceled:"已取消",pastDue:"逾期",paused:"已暂停",deprecated:"已弃用",unknown:"未知"},plan:"套餐",invoicesTab:"账单",changePlanButton:"更改套餐",noPlanAssigned:"未分配套餐",free:"免费",perSeatDisplay:"+ {price}/席位{interval}",estTotalDisplay:"预估总计:{total}{interval}({count, plural, one {# 个额外席位} other {# 个额外席位}})",nextBillingDisplay:"下次计费日:{date}",membersInWorkspace:"工作区有 {count, plural, one {# 名成员} other {# 名成员}}",billingInCurrency:"以{currency}计费",savingsPercent:"节省 {percent, number}%",switchToInterval:"切换至{interval}",seatPriceDisplay:"+ {price}/席位{interval}({included} {includedLabel})",trialEnded:"您的试用期已结束。",trialEndsIn:"您的试用期将在 {days, plural, one {# 天} other {# 天}}后结束。",onTrial:"您正在试用中。",upgradeToKeepAccess:"升级以保留访问权限。",viewInvoices:"查看账单",cancelTrial:"取消试用",dunningFinal:"最终警告:订阅将被暂停",dunningSuspended:"订阅已暂停",dunningRecovery:"付款恢复中",dunningSuspendedDescription:"由于多次付款失败,您的订阅已被暂停。请更新支付方式以恢复访问权限。",dunningRecoveryDescription:"我们无法处理您的付款。请更新您的支付方式以避免失去访问权限。",cancelEndDescription:"您的订阅将于以下日期结束:",cancelEndFallback:"您的订阅将在当前计费周期结束时取消,之后将不再收费。",resumeChargeDate:"将于以下日期再次收费:",resumeChargeFallback:"下一个计费日",resumeContinue:"您的订阅将自动继续,并按照套餐计费",resumeCancelAnytime:"如果您改变主意,可以在下一个计费日之前随时取消",retainAccess:"您将保留此套餐的完整访问权限直到",retainAccessFallback:"当前计费周期结束",noPlansAvailable:"此工作区没有可用的套餐组。如果您认为这是一个错误,请联系客服。",noPlansAvailableHint:"此工作区没有可用的套餐组。",startTrialDescription:"免费试用完整套餐,无需承诺。您可以随时升级或取消。",noSubscriptionDescription:"选择一个套餐来开始使用您的工作区",startFreeTrial:"开始免费试用"},users:{title:"工作区成员",adminOnly:"只有工作区管理员才能管理用户和角色。",inviteByEmail:"通过电子邮件邀请成员",inviteButton:"邀请",inviting:"正在邀请...",inviteSuccess:"用户邀请成功",emailRequired:"电子邮件为必填项",invalidEmail:"电子邮件地址格式无效",inviteFailed:"邀请成员失败",seatLimitReached:"已达到席位上限",memberLimitReached:"已达到成员上限",role:"角色",you:"您",owner:"拥有者",noMembers:"此工作区未找到成员。",extraSeatCost:"每增加一名成员将增加{price}/{interval, select, yearly {年} quarterly {季} other {月}}的订阅费用",unknownUser:"未知用户",seats:"席位",members:"成员",included:"包含",perExtraSeat:"/额外席位",maxMembers:"最大成员数",available:"可用",noMemberLimit:"无成员限制",seatHeading:"{hasSeatPricing, select, true {席位} other {成员}}",limitReached:"{reason, select, seat_limit_reached {已达到席位上限} other {已达到成员上限}}",memberCount:"{count, plural, one {# 名成员} other {# 名成员}}",subscriptionRequired:"邀请成员需要有效订阅。",seatLimitMessage:"您的套餐最多允许 {maxUsers, number} 名成员。升级以获得更多席位。",settingsLimitMessage:"此工作区最多允许 {maxUsers, number} 名成员。",memberLimitMessage:"已达到成员上限 {maxUsers, number}。",selectRole:"选择角色",inviteAs:"以{role}身份邀请"},invoices:{title:"账单历史",description:"查看和下载您的账单",pay:"支付",view:"查看",viewDetails:"查看详情",download:"PDF",errorLoading:"加载账单时出错",noInvoices:"暂无账单。订阅套餐后将生成账单。",noInvoicesWithSub:"未找到可下载的账单",paidAmount:"已支付:{amount}",na:"不适用",status:{draft:"草稿",open:"待支付",paid:"已支付",uncollectible:"无法收回",void:"已作废"}},usage:{title:"用量",description:"监控您的资源消耗和配额",totalResources:"总资源",overallUsage:"总体用量",inOverage:"超额中",estOverageCost:"预估超额费用",overageDetected:"检测到超额",overageDescription:"额外用量将作为超额部分在下次账单中收取。",overageUnits:"超额单位",rate:"费率",billableBlocks:"计费块",estimatedCharge:"预估费用",noData:"此工作区没有可用的配额使用数据。",noDataHint:"当您的套餐包含计量资源时,配额将在此处显示。",used:"已使用",remaining:"剩余",overLimit:"超出上限",percentUsed:"已使用 {percent, number}%",availableRemaining:"剩余 {count}",overLimitCount:"{count} 超出上限",overageWarning:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}额外用量将作为超额部分在下次账单中收取。",fullyUsed:"已全部使用",renewingSoon:"即将续期",almostFull:"即将用完",overage:"超额",errorLoading:"加载用量数据失败",perUnit:"/ 单位",perUnits:"/ 单位",rateDisplay:"{rate} {unitSize, plural, =1 {/ 单位} other {/ {unitSize, number} 单位}}",resourcesExceeded:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}",estOverageCharges:"本期预估超额费用:{amount}",overageRateDisplay:"超额费率:{rate}",resetDateDisplay:"用量将于 {date} 重置",daysRemainingDisplay:"{count, plural, one {剩余 # 天} other {剩余 # 天}}"},profile:{email:"电子邮件",name:"姓名",language:"语言",country:"国家/地区",currency:"货币",timezone:"时区",profileImage:"头像",success:"个人资料保存成功",nameMinLength:"姓名至少需要2个字符。",save:"保存",reset:"重置"},general:{ownerOnly:"只有工作区拥有者才能更改设置。",name:"名称",namePlaceholder:"我的工作区",nameMinLength:"工作区名称至少需要2个字符。",billingCurrency:"计费货币",icon:"图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",previewLabel:"预览:",success:"工作区设置保存成功",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",updateWorkspace:"更新工作区"},features:{title:"工作区功能",ownerOnly:"只有工作区拥有者才能更改功能。",noFeatures:"工作区没有可管理的功能。",enabled:"已启用",disabled:"已禁用",enabling:"正在启用",disabling:"正在禁用",featureSuccess:"成功",updateSuccess:"{feature}已成功{enabled, select, true {启用} other {禁用}}",actionStatus:"{action, select, enabling {正在启用} disabling {正在禁用} other {}}"},danger:{title:"删除工作区",adminOnly:"只有管理员才能删除工作区。",deleteWorkspace:"删除工作区",deleteConfirm:"您确定吗?",deleteWarning:"此操作不可撤销。这将永久删除工作区及所有相关数据。",deleting:"正在删除...",deleteDescription:"一旦删除工作区,将无法恢复。这将永久删除工作区及其所有数据,包括成员、设置和功能。",deleteConfirmDescription:"此操作不可撤销。这将永久删除工作区及所有相关数据。",failedToDelete:"删除工作区失败"},notifications:{title:"通知偏好设置",permissionDenied:"通知权限被拒绝",notSupported:"此浏览器不支持推送通知。",manageDescription:"管理您从此工作区接收通知的方式。",blocked:"通知已被阻止",blockedDescription:"您之前阻止了此网站的通知。要启用通知,请更新浏览器设置:",pushTitle:"推送通知",pushEnabledDescription:"您将收到重要更新的浏览器通知。",pushDisabledDescription:"接收有关付款问题、试用到期和其他重要更新的通知。",enabling:"正在启用...",disabling:"正在禁用...",enable:"启用",disable:"禁用",toggleAction:"{loading, select, true {{subscribed, select, true {正在禁用...} other {正在启用...}}} other {{subscribed, select, true {禁用} other {启用}}}}",pushDescription:"{subscribed, select, true {您将收到重要更新的浏览器通知。} other {接收有关付款问题、试用到期和其他重要更新的通知。}}",deviceNote:"通知将发送到此设备。请在其他设备上单独启用。",unblock:{firefox:{step1:"点击地址栏中的锁形图标(或盾形图标)",step2:'在权限列表中找到"通知"',step3:'将"阻止"更改为"允许"',step4:"重新加载此页面"},safari:{step1:"打开 Safari → 设置 → 网站 → 通知",step2:"在列表中找到此网站",step3:'将"拒绝"更改为"允许"',step4:"重新加载此页面"},edge:{step1:"点击地址栏中的锁形图标",step2:'点击"此站点的权限"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"},chrome:{step1:"点击地址栏中的锁形图标(或调节图标)",step2:'点击"网站设置"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"}}},quota:{includedOnly:"包含 {count, number} 个",includedWithOverage:"包含 {count, number} 个,之后 {price} / {unit}",unitFallback:"单位"},pricing:{title:"选择您的套餐",description:"比较各套餐,选择最适合您需求的方案",currency:"货币",billingIn:"计费货币",noPlansCurrency:"没有适用于您的计费货币的套餐。",noPlansCurrencyHint:"出现错误,请联系客服。",noPlans:"没有可用的套餐",free:"免费",included:"包含",save:"节省",current:"当前",processing:"正在处理...",unavailable:"不可用",selectCurrency:"选择计费货币",billingInterval:"计费周期"},beta:{nameLabel:"姓名",emailLabel:"电子邮件",submitText:"提交",submittingText:"正在提交...",errorMessage:"发生错误",tryAgain:"重试",privacyConsent:"提交此表单即表示您同意我们的",privacyPolicy:"隐私政策",and:"和",termsOfService:"服务条款"},workspace:{switchTitle:"切换工作区",switchDescription:"选择一个工作区或创建新的工作区。",notLoggedIn:"您似乎尚未登录。请登录后继续。",availableWorkspaces:"可用工作区 ({count, number})",loadingWorkspaces:"正在加载工作区...",searchPlaceholder:"搜索工作区...",noWorkspacesFound:"未找到工作区",noWorkspacesAvailable:"没有可用的工作区",switchTo:"切换至",membersCount:"{count, plural, one {# 名成员} other {# 名成员}}",createNew:"创建新工作区",createTitle:"创建新工作区",createDescription:"创建一个新的工作区来开始使用。",workspaceName:"工作区名称",workspaceNamePlaceholder:"我的工作区",workspaceNameMinLength:"工作区名称至少需要2个字符。",workspaceIcon:"工作区图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",invalidUrl:"请输入有效的 URL",creating:"正在创建...",createWorkspace:"创建工作区"},dropdowns:{search:"搜索...",chooseOption:"选择选项",chooseCountry:"选择国家/地区",searchCountry:"选择国家/地区...",chooseLanguage:"选择语言",searchLanguage:"选择语言...",chooseCurrency:"选择货币",searchCurrency:"选择货币...",chooseTimezone:"选择时区",searchTimezone:"选择时区..."},push:{failedToSubscribe:"订阅推送通知失败",failedToUnsubscribe:"取消订阅推送通知失败"},errors:{networkError:"网络错误:请检查您的网络连接",unauthorized:"未授权 — 请检查您的会话",notFound:"资源未找到",generic:"发生错误",fetchPlans:"获取套餐失败",fetchPlanGroup:"获取套餐组失败",fetchPlanGroupVersion:"获取套餐组版本失败",fetchPlanGroupVersions:"获取套餐组版本列表失败",fetchSubscription:"获取订阅信息失败",createCheckout:"创建结账会话失败",updateSubscription:"更新订阅失败",fetchInvoices:"获取账单失败",fetchInvoice:"获取账单失败",openBillingPortal:"打开账单门户失败",cancelSubscription:"取消订阅失败",resumeSubscription:"恢复订阅失败",recordUsage:"记录用量失败",fetchQuotaUsage:"获取配额使用状态失败",fetchAllQuotaUsage:"获取所有配额使用情况失败",fetchUsageLogs:"获取使用日志失败"}}});var wd=Object.freeze({__proto__:null,hi:{settings:{titles:{profile:"खाता",general:"वर्कस्पेस सेटिंग्स",users:"वर्कस्पेस सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",features:"वर्कस्पेस फ़ीचर्स",notifications:"सूचनाएँ",danger:"खतरनाक ज़ोन"},sidebar:{account:"खाता",workspace:"वर्कस्पेस",profile:"खाता",general:"सेटिंग्स",users:"सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",features:"फ़ीचर्स",notifications:"सूचनाएँ",danger:"खतरनाक ज़ोन"},common:{refresh:"रीफ़्रेश",refreshing:"रीफ़्रेश हो रहा है...",retry:"पुनः प्रयास",retrying:"पुनः प्रयास हो रहा है...",save:"सहेजें",saving:"सहेजा जा रहा है...",cancel:"रद्द करें",delete:"हटाएँ",dismiss:"खारिज करें",loading:"लोड हो रहा है...",success:"सफल!",error:"त्रुटि",refreshAction:"{loading, select, true {रीफ़्रेश हो रहा है...} other {रीफ़्रेश}}",retryAction:"{loading, select, true {पुनः प्रयास हो रहा है...} other {पुनः प्रयास}}"}},subscription:{managePlan:"अपना प्लान और बिलिंग प्रबंधित करें",changePlan:"प्लान बदलें",viewPricingPlans:"मूल्य निर्धारण प्लान देखें",viewPlans:"प्लान देखें",upgradePlan:"अभी अपग्रेड करें",subscribe:"सदस्यता लें",currentPlan:"वर्तमान प्लान",noSubscription:"आपके पास कोई सक्रिय सदस्यता नहीं है",choosePlan:"अपना प्लान चुनें",choosePlanDescription:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",planUpdateAvailable:"प्लान अपडेट उपलब्ध है",updateSuccess:"सदस्यता सफलतापूर्वक अपडेट हो गई!",updateFailed:"अपडेट विफल",cancelTitle:"सदस्यता रद्द करें",cancelConfirm:"क्या आप वाकई अपनी सदस्यता रद्द करना चाहते हैं?",cancelKeep:"सदस्यता बनाए रखें",cancelButton:"हाँ, सदस्यता रद्द करें",canceling:"रद्द किया जा रहा है...",cancelSuccess:"बिलिंग अवधि के अंत में सदस्यता रद्द कर दी जाएगी।",cancelNotCharged:"रद्द करने के बाद आपसे दोबारा शुल्क नहीं लिया जाएगा",cancelResumeAnytime:"आप सदस्यता समाप्त होने से पहले कभी भी इसे फिर से शुरू कर सकते हैं",resumeTitle:"सदस्यता फिर से शुरू करें",resumeConfirm:"क्या आप वाकई अपनी सदस्यता फिर से शुरू करना चाहते हैं?",resumeKeep:"रद्द रखें",resumeButton:"हाँ, सदस्यता फिर से शुरू करें",resuming:"फिर से शुरू हो रहा है...",resumeSuccess:"सदस्यता फिर से शुरू हो गई है।",managePayment:"भुगतान प्रबंधित करें",openingPortal:"खोला जा रहा है...",viewAllPlans:"सभी प्लान देखें",scheduledCancellation:"सदस्यता रद्द करने के लिए निर्धारित",paymentPastDue:"भुगतान अतिदेय",paymentPastDueDescription:"सेवा में रुकावट से बचने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",subscriptionPaused:"सदस्यता रुकी हुई है",subscriptionPausedDescription:"आपकी सदस्यता वर्तमान में रुकी हुई है। पूर्ण पहुँच बहाल करने के लिए फिर से शुरू करें।",errorLoading:"सदस्यता डेटा लोड करने में त्रुटि",errorLoadingDescription:"कृपया अपना कनेक्शन जाँचें और पुनः प्रयास करें।",errorProcessing:"सदस्यता प्रोसेस करने में विफल",errorCanceling:"सदस्यता रद्द करने में विफल",errorResuming:"सदस्यता फिर से शुरू करने में विफल",invalidWorkspace:"अमान्य वर्कस्पेस ID",billingInterval:{monthly:"मासिक",quarterly:"तिमाही",yearly:"वार्षिक",perMonth:"/माह",perQuarter:"/तिमाही",perYear:"/वर्ष"},seats:{title:"सीटें",members:"सदस्य",included:"शामिल",billable:"बिल योग्य",perExtraSeat:"प्रति अतिरिक्त सीट",limit:"सीमा",includedSeats:"शामिल सीटें",maxSeats:"अधिकतम सीटें",freeWithBase:"मूल कीमत में मुफ़्त",allIncluded:"सभी शामिल",extra:"अतिरिक्त",unlimited:"असीमित"},items:{features:"फ़ीचर्स",limits:"सीमाएँ",quotas:"उपयोग कोटा"},checkout:{upgrade:"अपग्रेड",downgrade:"डाउनग्रेड",switchTo:"बदलें",select:"चुनें"},status:{active:"सक्रिय",canceling:"रद्द हो रहा है",trial:"ट्रायल",canceled:"रद्द",pastDue:"अतिदेय",paused:"रुका हुआ",deprecated:"पुराना",unknown:"अज्ञात"},plan:"प्लान",invoicesTab:"चालान",changePlanButton:"प्लान बदलें",noPlanAssigned:"कोई प्लान नहीं",free:"मुफ़्त",perSeatDisplay:"+ {price}/सीट{interval}",estTotalDisplay:"अनुमानित कुल: {total}{interval} ({count, plural, one {# अतिरिक्त सीट} other {# अतिरिक्त सीटें}})",nextBillingDisplay:"अगली बिलिंग: {date}",membersInWorkspace:"वर्कस्पेस में {count, plural, one {# सदस्य} other {# सदस्य}}",billingInCurrency:"{currency} में बिलिंग",savingsPercent:"{percent, number}% बचाएँ",switchToInterval:"{interval} पर बदलें",seatPriceDisplay:"+ {price}/सीट{interval} ({included} {includedLabel})",trialEnded:"आपका ट्रायल समाप्त हो गया है।",trialEndsIn:"आपका ट्रायल {days, plural, one {# दिन} other {# दिनों}} में समाप्त होगा।",onTrial:"आप ट्रायल पर हैं।",upgradeToKeepAccess:"पहुँच बनाए रखने के लिए अपग्रेड करें।",viewInvoices:"चालान देखें",cancelTrial:"ट्रायल रद्द करें",dunningFinal:"अंतिम चेतावनी: सदस्यता निलंबित की जाएगी",dunningSuspended:"सदस्यता निलंबित",dunningRecovery:"भुगतान वसूली प्रक्रिया चल रही है",dunningSuspendedDescription:"बार-बार भुगतान विफल होने के कारण आपकी सदस्यता निलंबित कर दी गई है। पहुँच बहाल करने के लिए अपना भुगतान तरीका अपडेट करें।",dunningRecoveryDescription:"हम आपका भुगतान प्रोसेस करने में असमर्थ रहे। पहुँच न खोने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",cancelEndDescription:"आपकी सदस्यता इस तारीख को समाप्त होगी",cancelEndFallback:"वर्तमान बिलिंग अवधि के अंत में आपकी सदस्यता रद्द कर दी जाएगी। आपसे दोबारा शुल्क नहीं लिया जाएगा।",resumeChargeDate:"आपसे फिर से शुल्क लिया जाएगा",resumeChargeFallback:"अगली बिलिंग तिथि",resumeContinue:"आपकी सदस्यता स्वचालित रूप से जारी रहेगी और आपसे आपके प्लान के अनुसार बिल लिया जाएगा",resumeCancelAnytime:"अगर आप अपना मन बदलते हैं तो अगली बिलिंग तिथि से पहले कभी भी रद्द कर सकते हैं",retainAccess:"आपके पास इस प्लान की पूर्ण पहुँच बनी रहेगी",retainAccessFallback:"आपकी वर्तमान बिलिंग अवधि के अंत तक",noPlansAvailable:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है। अगर आपको लगता है कि यह त्रुटि है तो कृपया सहायता से संपर्क करें।",noPlansAvailableHint:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है।",startTrialDescription:"बिना किसी प्रतिबद्धता के पूरा प्लान आज़माएँ। आप कभी भी अपग्रेड या रद्द कर सकते हैं।",noSubscriptionDescription:"अपने वर्कस्पेस के लिए एक प्लान चुनें",startFreeTrial:"मुफ़्त ट्रायल शुरू करें"},users:{title:"वर्कस्पेस सदस्य",adminOnly:"केवल वर्कस्पेस एडमिन ही उपयोगकर्ताओं और भूमिकाओं को प्रबंधित कर सकते हैं।",inviteByEmail:"ईमेल से सदस्य आमंत्रित करें",inviteButton:"आमंत्रित करें",inviting:"आमंत्रित किया जा रहा है...",inviteSuccess:"उपयोगकर्ता सफलतापूर्वक आमंत्रित किया गया",emailRequired:"ईमेल आवश्यक है",invalidEmail:"अमान्य ईमेल पता प्रारूप",inviteFailed:"सदस्य को आमंत्रित करने में विफल",seatLimitReached:"सीट सीमा पूरी हो गई",memberLimitReached:"सदस्य सीमा पूरी हो गई",role:"भूमिका",you:"आप",owner:"मालिक",noMembers:"इस वर्कस्पेस में कोई सदस्य नहीं मिला।",extraSeatCost:"प्रत्येक अतिरिक्त सदस्य आपकी सदस्यता में {price}/{interval, select, yearly {वर्ष} quarterly {तिमाही} other {माह}} जोड़ता है",unknownUser:"अज्ञात उपयोगकर्ता",seats:"सीटें",members:"सदस्य",included:"शामिल",perExtraSeat:"/अतिरिक्त सीट",maxMembers:"अधिकतम सदस्य",available:"उपलब्ध",noMemberLimit:"कोई सदस्य सीमा नहीं",seatHeading:"{hasSeatPricing, select, true {सीटें} other {सदस्य}}",limitReached:"{reason, select, seat_limit_reached {सीट सीमा पूरी हो गई} other {सदस्य सीमा पूरी हो गई}}",memberCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",subscriptionRequired:"सदस्यों को आमंत्रित करने के लिए सदस्यता आवश्यक है।",seatLimitMessage:"आपका प्लान अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है। अधिक सीटों के लिए अपग्रेड करें।",settingsLimitMessage:"यह वर्कस्पेस अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है।",memberLimitMessage:"{maxUsers, number} सदस्यों की सीमा पूरी हो गई है।",selectRole:"भूमिका चुनें",inviteAs:"{role} के रूप में आमंत्रित करें"},invoices:{title:"बिलिंग इतिहास",description:"अपने चालान देखें और डाउनलोड करें",pay:"भुगतान करें",view:"देखें",viewDetails:"विवरण देखें",download:"PDF",errorLoading:"चालान लोड करने में त्रुटि",noInvoices:"अभी कोई चालान नहीं। चालान प्राप्त करने के लिए एक प्लान की सदस्यता लें।",noInvoicesWithSub:"डाउनलोड विकल्प वाला कोई चालान नहीं मिला",paidAmount:"भुगतान किया: {amount}",na:"लागू नहीं",status:{draft:"ड्राफ़्ट",open:"खुला",paid:"भुगतान हो गया",uncollectible:"अप्राप्य",void:"शून्य"}},usage:{title:"उपयोग",description:"अपने संसाधन उपभोग और कोटा की निगरानी करें",totalResources:"कुल संसाधन",overallUsage:"समग्र उपयोग",inOverage:"अतिरिक्त उपयोग में",estOverageCost:"अनुमानित अतिरिक्त लागत",overageDetected:"अतिरिक्त उपयोग पाया गया",overageDescription:"अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",overageUnits:"अतिरिक्त इकाइयाँ",rate:"दर",billableBlocks:"बिल योग्य ब्लॉक",estimatedCharge:"अनुमानित शुल्क",noData:"इस वर्कस्पेस के लिए कोई कोटा उपयोग डेटा उपलब्ध नहीं है।",noDataHint:"जब आपके प्लान में मीटर्ड संसाधन शामिल होंगे तो कोटा यहाँ दिखाई देंगे।",used:"उपयोग किया",remaining:"शेष",overLimit:"सीमा से अधिक",percentUsed:"{percent, number}% उपयोग किया",availableRemaining:"{count} शेष",overLimitCount:"{count} सीमा से अधिक",overageWarning:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}} अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",fullyUsed:"पूरी तरह उपयोग किया",renewingSoon:"जल्द नवीनीकरण",almostFull:"लगभग भरा",overage:"अतिरिक्त",errorLoading:"उपयोग डेटा लोड करने में विफल",perUnit:"/ इकाई",perUnits:"/ इकाइयाँ",rateDisplay:"{rate} {unitSize, plural, =1 {/ इकाई} other {/ {unitSize, number} इकाइयाँ}}",resourcesExceeded:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}}",estOverageCharges:"इस अवधि का अनुमानित अतिरिक्त शुल्क: {amount}",overageRateDisplay:"अतिरिक्त दर: {rate}",resetDateDisplay:"उपयोग {date} को रीसेट होगा",daysRemainingDisplay:"{count, plural, one {# दिन शेष} other {# दिन शेष}}"},profile:{email:"ईमेल",name:"नाम",language:"भाषा",country:"देश",currency:"मुद्रा",timezone:"समय क्षेत्र",profileImage:"प्रोफ़ाइल छवि",success:"प्रोफ़ाइल सफलतापूर्वक सहेजी गई",nameMinLength:"नाम कम से कम 2 अक्षरों का होना चाहिए।",save:"सहेजें",reset:"रीसेट"},general:{ownerOnly:"केवल वर्कस्पेस का मालिक ही वर्कस्पेस सेटिंग्स बदल सकता है।",name:"नाम",namePlaceholder:"मेरा शानदार वर्कस्पेस",nameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",billingCurrency:"बिलिंग मुद्रा",icon:"आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",previewLabel:"पूर्वावलोकन:",success:"वर्कस्पेस सेटिंग्स सफलतापूर्वक सहेजी गईं",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",updateWorkspace:"वर्कस्पेस अपडेट करें"},features:{title:"वर्कस्पेस फ़ीचर्स",ownerOnly:"केवल वर्कस्पेस का मालिक ही फ़ीचर्स बदल सकता है।",noFeatures:"प्रबंधित करने के लिए कोई फ़ीचर नहीं है।",enabled:"सक्रिय",disabled:"निष्क्रिय",enabling:"सक्रिय किया जा रहा है",disabling:"निष्क्रिय किया जा रहा है",featureSuccess:"सफलतापूर्वक",updateSuccess:"{feature} सफलतापूर्वक {enabled, select, true {सक्रिय} other {निष्क्रिय}} किया गया",actionStatus:"{action, select, enabling {सक्रिय किया जा रहा है} disabling {निष्क्रिय किया जा रहा है} other {}}"},danger:{title:"वर्कस्पेस हटाएँ",adminOnly:"केवल वर्कस्पेस एडमिन ही वर्कस्पेस हटा सकते हैं।",deleteWorkspace:"वर्कस्पेस हटाएँ",deleteConfirm:"क्या आप बिल्कुल सुनिश्चित हैं?",deleteWarning:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और सभी संबंधित डेटा को स्थायी रूप से हटा देगी।",deleting:"हटाया जा रहा है...",deleteDescription:"एक बार वर्कस्पेस हटाने के बाद वापस नहीं जा सकते। यह वर्कस्पेस और उसका सभी डेटा स्थायी रूप से हटा देगा, जिसमें सदस्य, सेटिंग्स और फ़ीचर्स शामिल हैं।",deleteConfirmDescription:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और उसके सभी डेटा को स्थायी रूप से हटा देगी।",failedToDelete:"वर्कस्पेस हटाने में विफल"},notifications:{title:"सूचना प्राथमिकताएँ",permissionDenied:"सूचना अनुमति अस्वीकृत",notSupported:"इस ब्राउज़र में पुश सूचनाएँ समर्थित नहीं हैं।",manageDescription:"प्रबंधित करें कि आप इस वर्कस्पेस से कैसे सूचनाएँ प्राप्त करते हैं।",blocked:"सूचनाएँ अवरुद्ध हैं",blockedDescription:"आपने पहले इस साइट के लिए सूचनाएँ अवरुद्ध की थीं। उन्हें सक्रिय करने के लिए अपनी ब्राउज़र सेटिंग्स अपडेट करें:",pushTitle:"पुश सूचनाएँ",pushEnabledDescription:"आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।",pushDisabledDescription:"भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।",enabling:"सक्रिय किया जा रहा है...",disabling:"निष्क्रिय किया जा रहा है...",enable:"सक्रिय करें",disable:"निष्क्रिय करें",toggleAction:"{loading, select, true {{subscribed, select, true {निष्क्रिय किया जा रहा है...} other {सक्रिय किया जा रहा है...}}} other {{subscribed, select, true {निष्क्रिय करें} other {सक्रिय करें}}}}",pushDescription:"{subscribed, select, true {आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।} other {भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।}}",deviceNote:"सूचनाएँ इस डिवाइस पर भेजी जाती हैं। अन्य डिवाइसों पर अलग से सक्रिय करें।",unblock:{firefox:{step1:"एड्रेस बार में लॉक आइकन (या शील्ड आइकन) पर क्लिक करें",step2:'अनुमतियों की सूची में "Notifications" खोजें',step3:'"Blocked" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},safari:{step1:"Safari → Settings → Websites → Notifications खोलें",step2:"सूची में यह वेबसाइट खोजें",step3:'"Deny" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},edge:{step1:"एड्रेस बार में लॉक आइकन पर क्लिक करें",step2:'"Permissions for this site" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"},chrome:{step1:"एड्रेस बार में लॉक आइकन (या ट्यून आइकन) पर क्लिक करें",step2:'"Site settings" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"}}},quota:{includedOnly:"{count, number} शामिल",includedWithOverage:"{count, number} शामिल, फिर {price} / {unit}",unitFallback:"इकाई"},pricing:{title:"अपना प्लान चुनें",description:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",currency:"मुद्रा",billingIn:"बिलिंग",noPlansCurrency:"आपकी बिलिंग मुद्रा के लिए कोई प्लान उपलब्ध नहीं है।",noPlansCurrencyHint:"कुछ गलत हो गया। कृपया सहायता से संपर्क करें।",noPlans:"कोई प्लान उपलब्ध नहीं",free:"मुफ़्त",included:"शामिल",save:"बचाएँ",current:"वर्तमान",processing:"प्रोसेस हो रहा है...",unavailable:"अनुपलब्ध",selectCurrency:"बिलिंग मुद्रा चुनें",billingInterval:"बिलिंग अवधि"},beta:{nameLabel:"नाम",emailLabel:"ईमेल",submitText:"जमा करें",submittingText:"जमा किया जा रहा है...",errorMessage:"एक त्रुटि हुई",tryAgain:"पुनः प्रयास करें",privacyConsent:"यह फ़ॉर्म जमा करके, आप हमारी",privacyPolicy:"गोपनीयता नीति",and:"और",termsOfService:"सेवा की शर्तों"},workspace:{switchTitle:"वर्कस्पेस बदलें",switchDescription:"एक वर्कस्पेस चुनें या नया बनाएँ।",notLoggedIn:"ऐसा लगता है कि आपने लॉगिन नहीं किया है। जारी रखने के लिए कृपया लॉगिन करें।",availableWorkspaces:"उपलब्ध वर्कस्पेस ({count, number})",loadingWorkspaces:"वर्कस्पेस लोड हो रहे हैं...",searchPlaceholder:"वर्कस्पेस खोजें...",noWorkspacesFound:"कोई वर्कस्पेस नहीं मिला",noWorkspacesAvailable:"कोई वर्कस्पेस उपलब्ध नहीं",switchTo:"बदलें",membersCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",createNew:"नया वर्कस्पेस बनाएँ",createTitle:"नया वर्कस्पेस बनाएँ",createDescription:"शुरू करने के लिए एक नया वर्कस्पेस बनाएँ।",workspaceName:"वर्कस्पेस का नाम",workspaceNamePlaceholder:"मेरा शानदार वर्कस्पेस",workspaceNameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",workspaceIcon:"वर्कस्पेस आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",invalidUrl:"कृपया एक मान्य URL दर्ज करें",creating:"बनाया जा रहा है...",createWorkspace:"वर्कस्पेस बनाएँ"},dropdowns:{search:"खोजें...",chooseOption:"विकल्प चुनें",chooseCountry:"देश चुनें",searchCountry:"देश चुनें...",chooseLanguage:"भाषा चुनें",searchLanguage:"भाषा चुनें...",chooseCurrency:"मुद्रा चुनें",searchCurrency:"मुद्रा चुनें...",chooseTimezone:"समय क्षेत्र चुनें",searchTimezone:"समय क्षेत्र चुनें..."},push:{failedToSubscribe:"पुश सूचनाओं की सदस्यता लेने में विफल",failedToUnsubscribe:"पुश सूचनाओं की सदस्यता रद्द करने में विफल"},errors:{networkError:"नेटवर्क त्रुटि: कृपया अपना इंटरनेट कनेक्शन जाँचें",unauthorized:"अनधिकृत - कृपया अपना सत्र जाँचें",notFound:"संसाधन नहीं मिला",generic:"एक त्रुटि हुई",fetchPlans:"प्लान लाने में विफल",fetchPlanGroup:"प्लान ग्रुप लाने में विफल",fetchPlanGroupVersion:"प्लान ग्रुप वर्शन लाने में विफल",fetchPlanGroupVersions:"प्लान ग्रुप वर्शन लाने में विफल",fetchSubscription:"सदस्यता लाने में विफल",createCheckout:"चेकआउट सत्र बनाने में विफल",updateSubscription:"सदस्यता अपडेट करने में विफल",fetchInvoices:"चालान लाने में विफल",fetchInvoice:"चालान लाने में विफल",openBillingPortal:"बिलिंग पोर्टल खोलने में विफल",cancelSubscription:"सदस्यता रद्द करने में विफल",resumeSubscription:"सदस्यता फिर से शुरू करने में विफल",recordUsage:"उपयोग दर्ज करने में विफल",fetchQuotaUsage:"कोटा उपयोग स्थिति लाने में विफल",fetchAllQuotaUsage:"सभी कोटा उपयोग लाने में विफल",fetchUsageLogs:"उपयोग लॉग लाने में विफल"}}});var Sd=Object.freeze({__proto__:null,ar:{settings:{titles:{profile:"الحساب",general:"إعدادات مساحة العمل",users:"أعضاء مساحة العمل",subscription:"الخطة والفوترة",usage:"الاستخدام",features:"ميزات مساحة العمل",notifications:"الإشعارات",danger:"منطقة الخطر"},sidebar:{account:"الحساب",workspace:"مساحة العمل",profile:"الحساب",general:"الإعدادات",users:"الأعضاء",subscription:"الخطة والفوترة",usage:"الاستخدام",features:"الميزات",notifications:"الإشعارات",danger:"منطقة الخطر"},common:{refresh:"تحديث",refreshing:"جارٍ التحديث...",retry:"إعادة المحاولة",retrying:"جارٍ إعادة المحاولة...",save:"حفظ",saving:"جارٍ الحفظ...",cancel:"إلغاء",delete:"حذف",dismiss:"تجاهل",loading:"جارٍ التحميل...",success:"تم بنجاح!",error:"خطأ",refreshAction:"{loading, select, true {جارٍ التحديث...} other {تحديث}}",retryAction:"{loading, select, true {جارٍ إعادة المحاولة...} other {إعادة المحاولة}}"}},subscription:{managePlan:"إدارة خطتك وفوترتك",changePlan:"تغيير الخطة",viewPricingPlans:"عرض خطط الأسعار",viewPlans:"عرض الخطط",upgradePlan:"ترقية الآن",subscribe:"اشتراك",currentPlan:"الخطة الحالية",noSubscription:"ليس لديك اشتراك نشط",choosePlan:"اختر خطتك",choosePlanDescription:"قارن بين الخطط واختر ما يناسب احتياجاتك",planUpdateAvailable:"تحديث الخطة متوفر",updateSuccess:"تم تحديث الاشتراك بنجاح!",updateFailed:"فشل التحديث",cancelTitle:"إلغاء الاشتراك",cancelConfirm:"هل أنت متأكد من رغبتك في إلغاء اشتراكك؟",cancelKeep:"الاحتفاظ بالاشتراك",cancelButton:"نعم، إلغاء الاشتراك",canceling:"جارٍ الإلغاء...",cancelSuccess:"سيتم إلغاء الاشتراك في نهاية فترة الفوترة.",cancelNotCharged:"لن يتم تحصيل رسوم منك مرة أخرى بعد الإلغاء",cancelResumeAnytime:"يمكنك استئناف اشتراكك في أي وقت قبل انتهائه",resumeTitle:"استئناف الاشتراك",resumeConfirm:"هل أنت متأكد من رغبتك في استئناف اشتراكك؟",resumeKeep:"إبقاء الإلغاء",resumeButton:"نعم، استئناف الاشتراك",resuming:"جارٍ الاستئناف...",resumeSuccess:"تم استئناف الاشتراك.",managePayment:"إدارة الدفع",openingPortal:"جارٍ الفتح...",viewAllPlans:"عرض جميع الخطط",scheduledCancellation:"تم جدولة إلغاء الاشتراك",paymentPastDue:"الدفع متأخر",paymentPastDueDescription:"يرجى تحديث طريقة الدفع لتجنب انقطاع الخدمة.",subscriptionPaused:"الاشتراك موقوف",subscriptionPausedDescription:"اشتراكك موقوف حالياً. استأنف لاستعادة الوصول الكامل.",errorLoading:"خطأ في تحميل بيانات الاشتراك",errorLoadingDescription:"يرجى التحقق من اتصالك والمحاولة مرة أخرى.",errorProcessing:"فشل في معالجة الاشتراك",errorCanceling:"فشل في إلغاء الاشتراك",errorResuming:"فشل في استئناف الاشتراك",invalidWorkspace:"معرّف مساحة العمل غير صالح",billingInterval:{monthly:"شهري",quarterly:"ربع سنوي",yearly:"سنوي",perMonth:"/شهر",perQuarter:"/ربع سنة",perYear:"/سنة"},seats:{title:"المقاعد",members:"الأعضاء",included:"مشمول",billable:"قابل للفوترة",perExtraSeat:"لكل مقعد إضافي",limit:"الحد",includedSeats:"المقاعد المشمولة",maxSeats:"الحد الأقصى للمقاعد",freeWithBase:"مجاني مع السعر الأساسي",allIncluded:"الكل مشمول",extra:"إضافي",unlimited:"غير محدود"},items:{features:"الميزات",limits:"الحدود",quotas:"حصص الاستخدام"},checkout:{upgrade:"ترقية",downgrade:"تخفيض",switchTo:"التبديل إلى",select:"اختيار"},status:{active:"نشط",canceling:"جارٍ الإلغاء",trial:"تجريبي",canceled:"ملغى",pastDue:"متأخر",paused:"موقوف",deprecated:"قديم",unknown:"غير معروف"},plan:"الخطة",invoicesTab:"الفواتير",changePlanButton:"تغيير الخطة",noPlanAssigned:"لم يتم تعيين خطة",free:"مجاني",perSeatDisplay:"+ {price}/مقعد{interval}",estTotalDisplay:"الإجمالي التقديري: {total}{interval} ({count, plural, zero {بدون مقاعد إضافية} one {مقعد إضافي واحد} two {مقعدان إضافيان} few {# مقاعد إضافية} many {# مقعداً إضافياً} other {# مقعد إضافي}})",nextBillingDisplay:"الفوترة التالية: {date}",membersInWorkspace:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}} في مساحة العمل",billingInCurrency:"الفوترة بـ {currency}",savingsPercent:"وفّر {percent, number}%",switchToInterval:"التبديل إلى {interval}",seatPriceDisplay:"+ {price}/مقعد{interval} ({included} {includedLabel})",trialEnded:"انتهت فترتك التجريبية.",trialEndsIn:"تنتهي فترتك التجريبية خلال {days, plural, zero {اليوم} one {يوم واحد} two {يومين} few {# أيام} many {# يوماً} other {# يوم}}.",onTrial:"أنت في فترة تجريبية.",upgradeToKeepAccess:"قم بالترقية للحفاظ على الوصول.",viewInvoices:"عرض الفواتير",cancelTrial:"إلغاء التجربة",dunningFinal:"تحذير أخير: سيتم تعليق الاشتراك",dunningSuspended:"الاشتراك معلق",dunningRecovery:"جارٍ استرداد الدفع",dunningSuspendedDescription:"تم تعليق اشتراكك بسبب فشل الدفع المتكرر. حدّث طريقة الدفع لاستعادة الوصول.",dunningRecoveryDescription:"لم نتمكن من معالجة دفعتك. يرجى تحديث طريقة الدفع لتجنب فقدان الوصول.",cancelEndDescription:"سينتهي اشتراكك في",cancelEndFallback:"سيتم إلغاء اشتراكك في نهاية فترة الفوترة الحالية. لن يتم تحصيل رسوم منك مرة أخرى.",resumeChargeDate:"سيتم تحصيل الرسوم منك مرة أخرى في",resumeChargeFallback:"تاريخ الفوترة التالي",resumeContinue:"سيستمر اشتراكك تلقائياً وسيتم فوترتك وفقاً لخطتك",resumeCancelAnytime:"يمكنك الإلغاء في أي وقت قبل تاريخ الفوترة التالي إذا غيرت رأيك",retainAccess:"ستحتفظ بالوصول الكامل إلى هذه الخطة حتى",retainAccessFallback:"نهاية فترة الفوترة الحالية",noPlansAvailable:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه. يرجى الاتصال بالدعم إذا كنت تعتقد أن هذا خطأ.",noPlansAvailableHint:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه.",startTrialDescription:"جرب الخطة الكاملة بدون التزام. يمكنك الترقية أو الإلغاء في أي وقت.",noSubscriptionDescription:"اختر خطة للبدء مع مساحة العمل الخاصة بك",startFreeTrial:"ابدأ التجربة المجانية"},users:{title:"أعضاء مساحة العمل",adminOnly:"فقط مدير مساحة العمل يمكنه إدارة المستخدمين والأدوار.",inviteByEmail:"دعوة عضو عبر البريد الإلكتروني",inviteButton:"دعوة",inviting:"جارٍ الدعوة...",inviteSuccess:"تمت دعوة المستخدم بنجاح",emailRequired:"البريد الإلكتروني مطلوب",invalidEmail:"صيغة البريد الإلكتروني غير صالحة",inviteFailed:"فشل في دعوة العضو",seatLimitReached:"تم الوصول لحد المقاعد",memberLimitReached:"تم الوصول لحد الأعضاء",role:"الدور",you:"أنت",owner:"المالك",noMembers:"لم يتم العثور على أعضاء في مساحة العمل هذه.",extraSeatCost:"كل عضو إضافي يضيف {price}/{interval, select, yearly {سنة} quarterly {ربع سنة} other {شهر}} لاشتراكك",unknownUser:"مستخدم غير معروف",seats:"المقاعد",members:"الأعضاء",included:"مشمول",perExtraSeat:"/مقعد إضافي",maxMembers:"الحد الأقصى للأعضاء",available:"متاح",noMemberLimit:"لا حد للأعضاء",seatHeading:"{hasSeatPricing, select, true {المقاعد} other {الأعضاء}}",limitReached:"{reason, select, seat_limit_reached {تم الوصول لحد المقاعد} other {تم الوصول لحد الأعضاء}}",memberCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",subscriptionRequired:"الاشتراك مطلوب لدعوة الأعضاء.",seatLimitMessage:"خطتك تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}. قم بالترقية للحصول على مقاعد إضافية.",settingsLimitMessage:"مساحة العمل هذه تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}.",memberLimitMessage:"تم الوصول لحد الأعضاء: {maxUsers, number}.",selectRole:"اختر دوراً",inviteAs:"دعوة كـ {role}"},invoices:{title:"سجل الفوترة",description:"عرض وتحميل فواتيرك",pay:"دفع",view:"عرض",viewDetails:"عرض التفاصيل",download:"PDF",errorLoading:"خطأ في تحميل الفواتير",noInvoices:"لا توجد فواتير بعد. اشترك في خطة لاستلام الفواتير.",noInvoicesWithSub:"لم يتم العثور على فواتير مع خيار التحميل",paidAmount:"المدفوع: {amount}",na:"غ/م",status:{draft:"مسودة",open:"مفتوح",paid:"مدفوع",uncollectible:"غير قابل للتحصيل",void:"ملغى"}},usage:{title:"الاستخدام",description:"راقب استهلاك مواردك وحصصك",totalResources:"إجمالي الموارد",overallUsage:"الاستخدام الإجمالي",inOverage:"تجاوز الحد",estOverageCost:"التكلفة التقديرية للتجاوز",overageDetected:"تم اكتشاف تجاوز",overageDescription:"سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",overageUnits:"وحدات التجاوز",rate:"المعدل",billableBlocks:"الكتل القابلة للفوترة",estimatedCharge:"الرسوم التقديرية",noData:"لا تتوفر بيانات استخدام الحصص لمساحة العمل هذه.",noDataHint:"ستظهر الحصص هنا عندما تتضمن خطتك موارد مقاسة.",used:"مستخدم",remaining:"متبقٍ",overLimit:"فوق الحد",percentUsed:"{percent, number}% مستخدم",availableRemaining:"{count} متبقٍ",overLimitCount:"{count} فوق الحد",overageWarning:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}} سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",fullyUsed:"مستخدم بالكامل",renewingSoon:"يتجدد قريباً",almostFull:"ممتلئ تقريباً",overage:"تجاوز",errorLoading:"فشل في تحميل بيانات الاستخدام",perUnit:"/ وحدة",perUnits:"/ وحدات",rateDisplay:"{rate} {unitSize, plural, =1 {/ وحدة} other {/ {unitSize, number} وحدة}}",resourcesExceeded:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}}",estOverageCharges:"الرسوم التقديرية للتجاوز في هذه الفترة: {amount}",overageRateDisplay:"معدل التجاوز: {rate}",resetDateDisplay:"يتم إعادة تعيين الاستخدام في {date}",daysRemainingDisplay:"{count, plural, zero {اليوم} one {يوم واحد متبقٍ} two {يومان متبقيان} few {# أيام متبقية} many {# يوماً متبقياً} other {# يوم متبقٍ}}"},profile:{email:"البريد الإلكتروني",name:"الاسم",language:"اللغة",country:"البلد",currency:"العملة",timezone:"المنطقة الزمنية",profileImage:"صورة الملف الشخصي",success:"تم حفظ الملف الشخصي بنجاح",nameMinLength:"يجب أن يتكون الاسم من حرفين على الأقل.",save:"حفظ",reset:"إعادة تعيين"},general:{ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير إعدادات مساحة العمل.",name:"الاسم",namePlaceholder:"مساحة العمل الرائعة",nameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",billingCurrency:"عملة الفوترة",icon:"الأيقونة",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",previewLabel:"معاينة:",success:"تم حفظ إعدادات مساحة العمل بنجاح",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",updateWorkspace:"تحديث مساحة العمل"},features:{title:"ميزات مساحة العمل",ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير الميزات.",noFeatures:"لا توجد ميزات لإدارتها.",enabled:"مفعّل",disabled:"معطّل",enabling:"جارٍ التفعيل",disabling:"جارٍ التعطيل",featureSuccess:"بنجاح",updateSuccess:"تم {enabled, select, true {تفعيل} other {تعطيل}} {feature} بنجاح",actionStatus:"{action, select, enabling {جارٍ التفعيل} disabling {جارٍ التعطيل} other {}}"},danger:{title:"حذف مساحة العمل",adminOnly:"فقط مديرو مساحة العمل يمكنهم حذف مساحات العمل.",deleteWorkspace:"حذف مساحة العمل",deleteConfirm:"هل أنت متأكد تماماً؟",deleteWarning:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع البيانات المرتبطة نهائياً.",deleting:"جارٍ الحذف...",deleteDescription:"بمجرد حذف مساحة العمل لا يمكن العودة. سيتم حذف مساحة العمل وجميع بياناتها نهائياً، بما في ذلك الأعضاء والإعدادات والميزات.",deleteConfirmDescription:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع بياناتها نهائياً.",failedToDelete:"فشل في حذف مساحة العمل"},notifications:{title:"تفضيلات الإشعارات",permissionDenied:"تم رفض إذن الإشعارات",notSupported:"الإشعارات الفورية غير مدعومة في هذا المتصفح.",manageDescription:"أدِر كيفية تلقي الإشعارات من مساحة العمل هذه.",blocked:"الإشعارات محظورة",blockedDescription:"لقد حظرت الإشعارات لهذا الموقع سابقاً. لتفعيلها، حدّث إعدادات متصفحك:",pushTitle:"الإشعارات الفورية",pushEnabledDescription:"ستتلقى إشعارات المتصفح للتحديثات المهمة.",pushDisabledDescription:"احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.",enabling:"جارٍ التفعيل...",disabling:"جارٍ التعطيل...",enable:"تفعيل",disable:"تعطيل",toggleAction:"{loading, select, true {{subscribed, select, true {جارٍ التعطيل...} other {جارٍ التفعيل...}}} other {{subscribed, select, true {تعطيل} other {تفعيل}}}}",pushDescription:"{subscribed, select, true {ستتلقى إشعارات المتصفح للتحديثات المهمة.} other {احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.}}",deviceNote:"يتم إرسال الإشعارات إلى هذا الجهاز. فعّلها على الأجهزة الأخرى بشكل منفصل.",unblock:{firefox:{step1:"انقر على أيقونة القفل (أو الدرع) في شريط العنوان",step2:'ابحث عن "Notifications" في قائمة الأذونات',step3:'غيّر من "Blocked" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},safari:{step1:"افتح Safari ← الإعدادات ← مواقع الويب ← الإشعارات",step2:"ابحث عن هذا الموقع في القائمة",step3:'غيّر من "Deny" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},edge:{step1:"انقر على أيقونة القفل في شريط العنوان",step2:'انقر على "Permissions for this site"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"},chrome:{step1:"انقر على أيقونة القفل (أو الضبط) في شريط العنوان",step2:'انقر على "Site settings"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"}}},quota:{includedOnly:"{count, number} مشمول",includedWithOverage:"{count, number} مشمول، ثم {price} / {unit}",unitFallback:"وحدة"},pricing:{title:"اختر خطتك",description:"قارن بين الخطط واختر ما يناسب احتياجاتك",currency:"العملة",billingIn:"الفوترة بـ",noPlansCurrency:"لا توجد خطط متاحة لعملة الفوترة الخاصة بك.",noPlansCurrencyHint:"حدث خطأ ما. يرجى الاتصال بالدعم.",noPlans:"لا توجد خطط متاحة",free:"مجاني",included:"مشمول",save:"وفّر",current:"الحالي",processing:"جارٍ المعالجة...",unavailable:"غير متاح",selectCurrency:"اختر عملة الفوترة",billingInterval:"فترة الفوترة"},beta:{nameLabel:"الاسم",emailLabel:"البريد الإلكتروني",submitText:"إرسال",submittingText:"جارٍ الإرسال...",errorMessage:"حدث خطأ",tryAgain:"حاول مرة أخرى",privacyConsent:"بإرسال هذا النموذج، فإنك توافق على",privacyPolicy:"سياسة الخصوصية",and:"و",termsOfService:"شروط الخدمة"},workspace:{switchTitle:"تبديل مساحة العمل",switchDescription:"اختر مساحة عمل للتبديل إليها أو أنشئ واحدة جديدة.",notLoggedIn:"يبدو أنك لم تسجل الدخول. يرجى تسجيل الدخول للمتابعة.",availableWorkspaces:"مساحات العمل المتاحة ({count, number})",loadingWorkspaces:"جارٍ تحميل مساحات العمل...",searchPlaceholder:"بحث في مساحات العمل...",noWorkspacesFound:"لم يتم العثور على مساحات عمل",noWorkspacesAvailable:"لا تتوفر مساحات عمل",switchTo:"التبديل إلى",membersCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",createNew:"إنشاء مساحة عمل جديدة",createTitle:"إنشاء مساحة عمل جديدة",createDescription:"أنشئ مساحة عمل جديدة للبدء.",workspaceName:"اسم مساحة العمل",workspaceNamePlaceholder:"مساحة العمل الرائعة",workspaceNameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",workspaceIcon:"أيقونة مساحة العمل",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",invalidUrl:"يرجى إدخال رابط صالح",creating:"جارٍ الإنشاء...",createWorkspace:"إنشاء مساحة العمل"},dropdowns:{search:"بحث...",chooseOption:"اختر خياراً",chooseCountry:"اختر البلد",searchCountry:"اختر البلد...",chooseLanguage:"اختر اللغة",searchLanguage:"اختر اللغة...",chooseCurrency:"اختر العملة",searchCurrency:"اختر العملة...",chooseTimezone:"اختر المنطقة الزمنية",searchTimezone:"اختر المنطقة الزمنية..."},push:{failedToSubscribe:"فشل في الاشتراك في الإشعارات الفورية",failedToUnsubscribe:"فشل في إلغاء الاشتراك من الإشعارات الفورية"},errors:{networkError:"خطأ في الشبكة: يرجى التحقق من اتصالك بالإنترنت",unauthorized:"غير مصرح - يرجى التحقق من جلستك",notFound:"المورد غير موجود",generic:"حدث خطأ",fetchPlans:"فشل في جلب الخطط",fetchPlanGroup:"فشل في جلب مجموعة الخطط",fetchPlanGroupVersion:"فشل في جلب إصدار مجموعة الخطط",fetchPlanGroupVersions:"فشل في جلب إصدارات مجموعة الخطط",fetchSubscription:"فشل في جلب الاشتراك",createCheckout:"فشل في إنشاء جلسة الدفع",updateSubscription:"فشل في تحديث الاشتراك",fetchInvoices:"فشل في جلب الفواتير",fetchInvoice:"فشل في جلب الفاتورة",openBillingPortal:"فشل في فتح بوابة الفوترة",cancelSubscription:"فشل في إلغاء الاشتراك",resumeSubscription:"فشل في استئناف الاشتراك",recordUsage:"فشل في تسجيل الاستخدام",fetchQuotaUsage:"فشل في جلب حالة استخدام الحصص",fetchAllQuotaUsage:"فشل في جلب جميع استخدامات الحصص",fetchUsageLogs:"فشل في جلب سجلات الاستخدام"}}});const kd={[Jn.Monthly]:"subscription.billingInterval.perMonth",[Jn.Quarterly]:"subscription.billingInterval.perQuarter",[Jn.Yearly]:"subscription.billingInterval.perYear"},Nd=(e,t,n)=>{if(!e||0===e)return null;let a;switch(n){case Jn.Yearly:a=t/12;break;case Jn.Quarterly:a=t/3;break;default:return null}const r=(e-a)/e*100;return r>0?Math.round(r):null};var jd=Object.freeze({__proto__:null,default:({open:n,onOpenChange:a,planVersions:r,currentPlanVersionId:s,currentStripePriceId:i,billingCurrency:o,currentMemberCount:c,onSelectPlan:l,loading:u=!1})=>{const[d,m]=t.useState(!1),{t:p,formattingLocale:h,dir:g,fmtNum:f,fmtCents:b}=gn(),{settings:x}=Un(),v=x?.workspace?.mode===Fl,y=(e,t)=>null==e||0===e?"":b(e,t),w=e=>p(kd[e]??kd[Jn.Monthly]),[S,k]=t.useState(null),N=t.useRef(!1),j=t.useMemo(()=>ba(i,r),[i,r]),A=j?.interval??null,C=j?.currency??null,E=t.useMemo(()=>function(e){const t=new Set;for(const n of e)n.pricingVariants?.forEach(e=>{e.currency&&t.add(e.currency.toLowerCase())});return Array.from(t).sort()}(r),[r]),T=t.useMemo(()=>{const e=o?.trim().toLowerCase();return e?E.includes(e)?[e]:[]:E},[o,E]),[P,_]=t.useState(A||Jn.Monthly),[U,I]=t.useState(()=>C&&T.includes(C)?C:T.length>0?T[0]:""),D=o?.trim()||U;t.useEffect(()=>{n&&(_(A||Jn.Monthly),C&&T.includes(C)?I(C):T.length>0&&!T.includes(U)&&I(T[0]))},[n,A,C,T]);const R=t.useMemo(()=>[...r].sort((e,t)=>e.version-t.version),[r]),z=(e=>{const t=new Map;return e.forEach(e=>{e.subscriptionItems?.forEach(e=>{t.has(e._id)||t.set(e._id,e)})}),Array.from(t.values())})(R),L=z.filter(e=>e.type===oa),M=z.filter(e=>e.type===ca),B=z.filter(e=>e.type===la),O=async e=>{if(!(e===s&&A===P||u||d||N.current)){N.current=!0,m(!0),k(e);try{await l(e,P,D),a(!1)}catch(e){}finally{N.current=!1,m(!1),k(null)}}},F=e=>ha(e,D,P),W=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===D.toLowerCase()),H=u||d,G=e=>{switch(e){case Jn.Monthly:return p("subscription.billingInterval.monthly");case Jn.Quarterly:return p("subscription.billingInterval.quarterly");case Jn.Yearly:return p("subscription.billingInterval.yearly");default:return p("subscription.billingInterval.monthly")}},$=e=>{const t=e._id===s,n=A===P;if(t&&n)return{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0};if(t&&!n)return{labelKey:"_dynamic",dynamicLabel:p("subscription.switchToInterval",{interval:G(P)}),variant:"default",disabled:!1};if(!s)return{labelKey:"subscription.subscribe",variant:"default",disabled:!1};const a=R.findIndex(e=>e._id===s),r=R.findIndex(t=>t._id===e._id);return-1===a||-1===r?{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}:r<a?{labelKey:"subscription.checkout.downgrade",variant:"outline",disabled:!1}:r>a?{labelKey:"subscription.checkout.upgrade",variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}},V=(e,t,n=Jn.Monthly)=>{if(t.type===oa)return e.features?.[t.slug]??!1;if(t.type===ca)return e.limits?.[t.slug]??null;if(t.type===la){const a=fa(e,D,t.slug,n);return a||Bl(e.quotas?.[t.slug],n)}return null},K=(e,t,n)=>{if(t.type===oa)return!0===e?"✓":"—";if(t.type===ca)return null!=e?String(e):"—";if(t.type===la){const a=Ol("object"==typeof e&&null!==e&&"included"in e?e:null,t.name.toLowerCase(),{currency:n,locale:h});return a?a.hasOverage?p("quota.includedWithOverage",{count:a.included,price:a.price,unit:a.unit}):p("quota.includedOnly",{count:a.included}):"—"}return"—"};return e.jsx(qa,{open:n,onOpenChange:a,children:e.jsxs(Xa,{dir:g,className:"inset-0 w-screen h-screen max-w-none rounded-none translate-x-0 translate-y-0 p-0 flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 px-4 py-4 sm:px-6 sm:py-6 border-b space-y-3 sm:space-y-4",children:[e.jsxs("div",{children:[e.jsx(tr,{className:"text-xl sm:text-2xl font-bold",children:p("pricing.title")}),e.jsx(nr,{className:"mt-1 text-sm",children:p("subscription.choosePlanDescription")})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[!o?.trim()&&T.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-slate-600",children:p("pricing.currency")}),e.jsx("select",{"aria-label":p("pricing.selectCurrency"),value:U,onChange:e=>I(e.target.value),className:"rounded-md border border-slate-200 bg-white px-3 py-2 text-sm font-medium text-slate-900 shadow-sm focus:outline-none focus:ring-2 focus:ring-primary",children:T.map(t=>{const n=$c(t);return e.jsx("option",{value:t,children:n?`${n} ${t.toUpperCase()}`:t.toUpperCase()},t)})})]}),o?.trim()&&e.jsx("span",{className:"text-xs text-slate-500",children:p("subscription.billingInCurrency",{currency:o.toUpperCase()})})]}),e.jsx("div",{className:"flex items-center gap-0.5 sm:gap-1 p-1 bg-slate-100 rounded-lg w-full sm:w-auto",role:"group","aria-label":p("pricing.billingInterval"),children:[Jn.Monthly,Jn.Quarterly,Jn.Yearly].map(t=>{const n=A===t;return e.jsx("button",{onClick:()=>_(t),"aria-pressed":P===t,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(P===t?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:text-slate-900"),children:e.jsxs("span",{className:"flex items-center justify-center gap-1 sm:gap-1.5",children:[t===Jn.Monthly&&p("subscription.billingInterval.monthly"),t===Jn.Quarterly&&p("subscription.billingInterval.quarterly"),t===Jn.Yearly&&p("subscription.billingInterval.yearly"),t===Jn.Yearly&&e.jsx("span",{className:"text-[10px] sm:text-xs px-1 sm:px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold",children:p("pricing.save")}),n&&s&&e.jsx("span",{className:"hidden sm:inline text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded-full font-semibold",children:p("pricing.current")})]})},t)})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:o?.trim()&&0===T.length?e.jsxs("div",{className:"text-center py-12 px-4",children:[e.jsx("p",{className:"text-slate-600 font-medium",children:p("pricing.noPlansCurrency")}),e.jsx("p",{className:"text-slate-500 text-sm mt-2",children:p("pricing.noPlansCurrencyHint")})]}):0===R.length?e.jsx("div",{className:"text-center py-12 text-gray-500",children:e.jsx("p",{children:p("pricing.noPlans")})}):e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden bg-white",children:[e.jsx("div",{className:"md:hidden overflow-auto h-full",style:{maxHeight:"calc(100vh - 13rem)"},children:e.jsx("div",{className:"p-4 space-y-4",children:R.map(t=>{const n=t._id===s,a=$(t),r=H&&t._id===S,i=F(t),o=W(t),l=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===D.toLowerCase())?D:t.plan?.currency??D??"",u=ha(t,D,Jn.Monthly)??0,d=P!==Jn.Monthly&&null!==i?Nd(u,i,P):null,m=xa(t,D),h=m?va(t,D,P):null;return e.jsxs("div",{className:"rounded-xl border-2 p-4 "+(n?"border-blue-500 bg-blue-50/30":"border-slate-200 bg-white"),children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900",children:t.plan.name}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:t.plan.description})]}),n&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:p("pricing.current")})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:o&&null!==i||o?y(i,l)||p("pricing.free"):"—"}),null!==i&&i>0&&o&&e.jsx("span",{className:"text-sm text-slate-500",children:w(P)})]}),null!==d&&d>0&&o&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium",children:p("subscription.savingsPercent",{percent:d})}),m?.enabled&&h&&h>0&&!v&&e.jsx("div",{className:"text-xs text-slate-500 mt-1",children:p("subscription.seatPriceDisplay",{price:b(h,l),interval:w(P),included:f(m.includedSeats),includedLabel:p("pricing.included")})})]}),L.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:p("subscription.items.features")}),e.jsx("div",{className:"space-y-1",children:L.map(n=>{const a=V(t,n,P),r=n.type===oa&&!0===a;return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[n.type===oa?r?e.jsx("span",{className:"text-emerald-500 text-xs",children:"✓"}):e.jsx("span",{className:"text-slate-300 text-xs",children:"✕"}):null,e.jsx("span",{className:r?"text-slate-700":"text-slate-400",children:n.name})]},n._id)})})]}),M.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:p("subscription.items.limits")}),e.jsx("div",{className:"space-y-1",children:M.map(n=>{const a=V(t,n,P);return e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-slate-600",children:n.name}),e.jsx("span",{className:"font-medium text-slate-700",children:"number"==typeof a?f(a):"—"})]},n._id)})})]}),m?.enabled&&!v&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-emerald-600 uppercase tracking-wider mb-1.5",children:p("subscription.seats.title")}),e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:p("subscription.seats.included")}),e.jsx("span",{className:"font-medium",children:f(m.includedSeats||0)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:p("subscription.seats.maxSeats")}),e.jsx("span",{className:"font-medium",children:m.maxSeats>0?f(m.maxSeats):p("subscription.seats.unlimited")})]}),null!=c&&c>0&&(()=>{const t=Math.max(0,c-(m.includedSeats||0));return e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:p("subscription.seats.billable")}),e.jsx("span",{className:"font-medium "+(0===t?"text-emerald-600":"text-amber-600"),children:0===t?p("subscription.seats.allIncluded"):`${f(t)} ${p("subscription.seats.extra")}`})]})})()]})]}),e.jsx(Va,{className:"w-full mt-2",variant:a.variant,disabled:a.disabled||H||!o,progress:r,onClick:()=>O(t._id),children:r?p("pricing.processing"):o?a.dynamicLabel??p(a.labelKey):p("pricing.unavailable")})]},t._id)})})}),e.jsx("div",{className:"hidden md:block overflow-auto h-full",style:{maxHeight:"calc(100vh - 12rem)"},children:e.jsxs("table",{className:"w-full border-separate border-spacing-0",style:{minWidth:280+200*R.length+"px",borderCollapse:"separate"},children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:280,minWidth:280}}),R.map(t=>e.jsx("col",{style:{width:200,minWidth:200}},t._id))]}),e.jsx("thead",{children:e.jsxs("tr",{className:"align-top",children:[e.jsx("th",{className:"sticky top-0 start-0 z-30 p-0 bg-white text-start"}),R.map(t=>{const n=t._id===s,a=$(t),r=H&&t._id===S,i=F(t),o=ha(t,D,Jn.Monthly)??0,c=P!==Jn.Monthly&&null!==i?Nd(o,i,P):null,l=W(t),u=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===D.toLowerCase())?D:t.plan?.currency??D??"";return e.jsx("th",{className:"sticky top-0 z-20 border-b border-slate-200 p-3 shadow-[0_2px_4px_-2px_rgba(0,0,0,0.06)] "+(t._id===s?"bg-blue-50/80":"bg-white"),children:e.jsxs("div",{className:"flex h-full flex-col gap-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 truncate",children:t.plan.name}),n&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:p("pricing.current")})]}),e.jsxs("div",{className:"flex flex-col items-start",children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:l&&null!==i||l?y(i,u)||p("pricing.free"):"—"}),null!==i&&i>0&&l&&e.jsx("span",{className:"text-sm text-slate-500",children:w(P)})]}),null!==c&&c>0&&l&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium mt-0.5",children:p("subscription.savingsPercent",{percent:c})}),(()=>{if(v)return null;const n=xa(t,D);if(!n)return null;const a=va(t,D,P);return!a||a<=0?null:e.jsx("div",{className:"text-xs text-slate-500 mt-1 border-t border-slate-100 pt-1",children:e.jsx("span",{children:p("subscription.seatPriceDisplay",{price:b(a,u),interval:w(P),included:f(n.includedSeats),includedLabel:p("pricing.included")})})})})()]}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 line-clamp-2 leading-relaxed text-start",children:t.plan.description}),e.jsx(Va,{className:"mt-auto w-full",variant:a.variant,disabled:a.disabled||H||!l,progress:r,onClick:()=>O(t._id),children:r?p("pricing.processing"):l?a.dynamicLabel??p(a.labelKey):p("pricing.unavailable")})]})},t._id)})]})}),e.jsxs("tbody",{children:[L.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:p("subscription.items.features")}),e.jsx("td",{colSpan:R.length,className:"border-t border-slate-200 bg-slate-100"})]}),L.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),R.map(n=>{const a=V(n,t,P),r=n.pricingVariants?.length?D:n.plan?.currency??D??"",i=K(a,t,r),o=t.type===oa&&!0===a;return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(n._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+(o?"text-emerald-600":"—"===i?"text-slate-400":"text-slate-700"),children:i})},n._id)})]},t._id))]}),M.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:p("subscription.items.limits")}),e.jsx("td",{colSpan:R.length,className:"border-t border-slate-200 bg-slate-100"})]}),M.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),R.map(n=>{const a=V(n,t,P),r=n.pricingVariants?.length?D:n.plan?.currency??D??"",i=K(a,t,r);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(n._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},n._id)})]},t._id))]}),B.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:p("subscription.items.quotas")}),e.jsx("td",{colSpan:R.length,className:"border-t border-slate-200 bg-slate-100"})]}),B.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),R.map(n=>{const a=V(n,t,P),r=n.pricingVariants?.length?D:n.plan?.currency??D??"",i=K(a,t,r);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(n._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},n._id)})]},t._id))]}),!v&&R.some(e=>{const t=xa(e,D);return t?.enabled})&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-emerald-200 bg-emerald-50 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-emerald-700 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:p("subscription.seats.title")}),e.jsx("td",{colSpan:R.length,className:"border-t border-emerald-200 bg-emerald-50"})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:p("subscription.seats.includedSeats")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:p("subscription.seats.freeWithBase")})]}),R.map(t=>{const n=xa(t,D);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:n?.enabled?f(n.includedSeats||0):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:p("subscription.seats.maxSeats")})}),R.map(t=>{const n=xa(t,D);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:n?.enabled?n.maxSeats>0?f(n.maxSeats):p("subscription.seats.unlimited"):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:p("subscription.seats.perExtraSeat")})}),R.map(t=>{const n=va(t,D,P),a=t.pricingVariants?.length?D:t.plan?.currency??D??"";return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:n&&n>0?`${b(n,a)}${w(P)}`:"—"})},t._id)})]}),null!=c&&c>0&&e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:p("subscription.seats.billable")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:p("subscription.membersInWorkspace",{count:c})})]}),R.map(t=>{const n=xa(t,D);if(!n?.enabled)return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},t._id);const a=n.includedSeats||0,r=Math.max(0,c-a);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:0===r?e.jsx("span",{className:"text-sm font-medium text-emerald-600",children:p("subscription.seats.allIncluded")}):e.jsxs("span",{className:"text-sm font-medium text-amber-600",children:[f(r)," ",p("subscription.seats.extra")]})},t._id)})]})]})]})]})})]})})]})})}});exports.BetaForm=({onSuccess:n,onError:a,className:r="w-full",fieldClassName:i="flex flex-col gap-1.5 w-full",autoFocus:o=!0,showSuccessMessage:c=!0,hideLogo:l=!1,hideTitles:u=!1})=>{const{t:d}=gn(),[m,p]=t.useState(!1),[h,g]=t.useState(!1),{submitBetaForm:f,isLoading:b,isSubmitting:x,error:v,config:y,success:w,message:S}=(()=>{const{t:e}=gn(),n=Pn(),[a,r]=t.useState(null),[s,i]=t.useState(!0),[o,c]=t.useState(!1),[l,u]=t.useState(null),[d,m]=t.useState(!1),[p,h]=t.useState(null);return t.useEffect(()=>{let t=!1;return(async()=>{i(!0),u(null);try{const e=new md(n),a=await e.fetchConfig();t||r(a)}catch(n){t||u(n instanceof Error?n.message:e("beta.errorMessage"))}finally{t||i(!1)}})(),()=>{t=!0}},[n]),{isLoading:s,isSubmitting:o,config:a,error:l,success:d,message:p,submitBetaForm:t.useCallback(async t=>{if(!n){const t=e("errors.generic");return u(t),{success:!1,message:t}}try{c(!0),u(null),m(!1),h(null);const e=new md(n),a=await e.submitBetaUser({name:t.name||"",email:t.email}),r="success"===a.status;return m(r),h(a.message),{success:r,message:a.message}}catch(t){const n=t instanceof Error?t.message:e("beta.errorMessage");return u(n),m(!1),h(n),{success:!1,message:n}}finally{c(!1)}},[n])}})();t.useEffect(()=>{w&&c&&(p(!0),g(!0)),v&&g(!0)},[w,c,v]);const k=s.useForm({resolver:Co(pd),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});t.useEffect(()=>{o&&k.setFocus("name")},[o,k]);const N=k.formState.isValid&&!x;return e.jsx("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:b?e.jsxs("div",{className:U("flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",r),children:[e.jsx(hr,{className:"h-24 w-24 rounded-lg"}),e.jsx(hr,{className:"h-6 w-32"}),e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(hr,{className:"h-4 w-16"}),e.jsx(hr,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(hr,{className:"h-4 w-16"}),e.jsx(hr,{className:"h-10 w-full"})]}),e.jsx(hr,{className:"h-10 w-full"})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",children:[!l&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[y?.logo&&e.jsx(gd,{logo:y?.logo}),y?.name&&e.jsx("div",{children:y?.name})]}),e.jsx(s.FormProvider,{...k,children:e.jsxs("form",{onSubmit:k.handleSubmit(async e=>{try{const t=await f(e);t.success?(n?.(),k.reset(),c&&p(!0),g(!0)):(a?.(t.message),g(!0))}catch(e){a?.(e instanceof Error?e.message:d("beta.errorMessage")),g(!0)}}),className:r,noValidate:!0,"aria-busy":x,children:[!h&&e.jsxs(e.Fragment,{children:[!u&&y?.screen?.register&&e.jsx(hd,{screen:y?.screen?.register}),e.jsx(Yc,{control:k.control,name:"name",render:({field:t})=>e.jsxs(el,{className:i,children:[e.jsx(tl,{children:d("beta.nameLabel")}),e.jsx(nl,{children:e.jsx(sl,{...t})}),e.jsx(al,{}),e.jsx(rl,{})]})}),e.jsx(Yc,{control:k.control,name:"email",render:({field:t})=>e.jsxs(el,{className:i,children:[e.jsx(tl,{children:d("beta.emailLabel")}),e.jsx(nl,{children:e.jsx(sl,{...t})}),e.jsx(al,{}),e.jsx(rl,{})]})}),e.jsx(Va,{type:"submit",disabled:!N,className:i,children:d(x?"beta.submittingText":"beta.submitText")})]}),h&&v&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsxs("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e.jsx("span",{className:"text-4xl mb-2",role:"img","aria-label":d("settings.common.error"),children:"❗"}),v]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(Va,{type:"button",onClick:()=>{g(!1),k.reset()},className:i,children:d("beta.tryAgain")})})]}),h&&m&&S&&e.jsx("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:y?.screen?.thankYou&&e.jsx(hd,{screen:y?.screen?.thankYou})})]})}),!h&&e.jsx("div",{children:e.jsxs("div",{children:[d("beta.privacyConsent")," ",e.jsx("a",{href:y?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:d("beta.privacyPolicy")})," ",d("beta.and")," ",e.jsx("a",{href:y?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:d("beta.termsOfService")}),"."]})})]})})},exports.PricingPage=function({slug:t,children:n,loadingFallback:a,errorFallback:r}){const{items:s,plans:i,notes:o,loading:c,error:l,refetch:u}=Rn(t);return c?void 0!==a?e.jsx(e.Fragment,{children:a}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(hr,{className:"h-8 w-48"}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(t=>e.jsx(hr,{className:"h-64 rounded-lg"},t))})]}):l?r?e.jsx(e.Fragment,{children:r(l)}):e.jsx("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:l}):e.jsx(e.Fragment,{children:n({loading:c,error:l,items:s,plans:i,notes:o,refetch:u})})},exports.PushNotificationProvider=ju,exports.QuotaUsageContextProvider=Fa,exports.SETTINGS_SCREENS=pu,exports.SUPPORTED_LOCALES=rn,exports.SaaSOSProvider=Mu,exports.SettingsScreen=mu,exports.SubscriptionContextProvider=Zn,exports.WhenAuthenticated=Bu,exports.WhenNoSubscription=qu,exports.WhenNotTrialing=Qu,exports.WhenQuotaAvailable=ed,exports.WhenQuotaExhausted=td,exports.WhenQuotaOverage=nd,exports.WhenQuotaThreshold=ad,exports.WhenRoles=Fu,exports.WhenSubscription=Zu,exports.WhenSubscriptionToPlans=Ju,exports.WhenTrialEnding=Xu,exports.WhenTrialing=Yu,exports.WhenUnauthenticated=Ou,exports.WhenUserFeatureDisabled=Ku,exports.WhenUserFeatureEnabled=Vu,exports.WhenWorkspaceFeatureDisabled=$u,exports.WhenWorkspaceFeatureEnabled=Gu,exports.WhenWorkspaceRoles=Wu,exports.WorkspaceSwitcher=function(a){const{t:r,dir:s}=gn(),{isAuthenticated:i,user:o}=wu(),c=me(Pn()),{workspaces:l,currentWorkspace:u,loading:d,refreshing:m,switchingToId:p,fetchWorkspaces:h,getFeatures:g,refreshWorkspaces:f,setCurrentWorkspace:b,switchToWorkspace:x}=Ba(),{settings:v}=Un(),[y,w]=t.useState(!1),[S,k]=t.useState(0),[N,j]=t.useState(""),A=d||m;t.useEffect(()=>{i&&c&&(0===l.length?(h(),g()):g())},[i,c]),t.useEffect(()=>{i&&c&&S>0&&f()},[S,i,c]);const C=l,E=C.filter(e=>e._id!==u?._id).filter(e=>e.name.toLowerCase().includes(N.toLowerCase())),T=v?.workspace?.canCreateWorkspace??!0,P=v?.workspace?.showSwitcher??!0,_=v?.workspace?.maxWorkspacesPerUser??0,U=C?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===o?.id?.toString()).length??0,I=!1!==T&&(0===_||U<_);return t.useEffect(()=>{!P&&l.length>0&&!u&&x(l[0]).catch(()=>{})},[P,l,u]),!P&&u?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>w(!0),children:a.trigger?.(A,u)}),e.jsx(gu,{workspace:u,open:y,onOpenChange:w,showTrigger:!1})]}):e.jsxs(qa,{open:y,onOpenChange:w,children:[e.jsx(Ja,{children:a.trigger?.(A,u)}),e.jsxs(Xa,{dir:s,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(er,{dir:s,children:[e.jsxs(tr,{className:"flex items-center gap-2",children:[e.jsx(n.Building2,{className:"h-5 w-5"}),r("workspace.switchTitle")]}),e.jsx(nr,{children:r("workspace.switchDescription")})]}),!o&&e.jsx("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:r("workspace.notLoggedIn")})}),o&&e.jsxs("div",{dir:s,className:"flex flex-col gap-4",children:[u&&e.jsx(ld,{workspace:u,isCurrentWorkspace:!0,switchToWorkspace:x,switchingToId:p,onClose:()=>w(!1),setCurrentWorkspace:b,setOpen:w,workspacesToUse:C}),e.jsx(cd,{}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:r("workspace.availableWorkspaces",{count:E.length})}),e.jsx("div",{children:e.jsx(Va,{progress:m,disabled:m,variant:"ghost",onClick:function(){i&&c&&k(e=>e+1)},startIcon:e.jsx(n.RefreshCcw,{}),children:r("settings.common.refreshAction",{loading:String(m)})})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(n.Search,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(sl,{placeholder:r("workspace.searchPlaceholder"),value:N,onChange:e=>j(e.target.value),className:"ps-10"})]}),d?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(n.Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ms-2 text-sm text-muted-foreground",children:r("workspace.loadingWorkspaces")})]}):0===E.length?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(n.Building2,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:r(N?"workspace.noWorkspacesFound":"workspace.noWorkspacesAvailable")})]}):e.jsx(cl,{className:"h-64",dir:s,children:e.jsx("div",{dir:s,className:"flex flex-col gap-2 my-2.5",children:E.map(t=>{const n=t._id===u?._id;return e.jsx(ld,{workspace:t,isCurrentWorkspace:n,switchToWorkspace:x,switchingToId:p,onClose:()=>w(!1),setCurrentWorkspace:b,setOpen:w,workspacesToUse:C},t._id)})})})]}),I&&e.jsxs(e.Fragment,{children:[e.jsx(cd,{}),e.jsx(ud,{onCreated:()=>{h()}})]})]})]})]})},exports.useAllQuotaUsage=Vn,exports.useBillingPortal=Hn,exports.useCancelSubscription=Gn,exports.useCreateCheckoutSession=Bn,exports.useInvoice=(e,n)=>{const{t:a}=gn(),{api:r}=In(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e&&n){c(!0),u(null);try{const t=await r.getInvoice(e,n);i(t.invoice)}catch(t){const r=Dn(t,"errors.fetchInvoice",a);u(r),W(t,{component:"useInvoice",action:"fetchInvoice",metadata:{workspaceId:e,invoiceId:n}})}finally{c(!1)}}else i(null)},[r,e,n]);return t.useEffect(()=>{d()},[d]),{invoice:s,loading:o,error:l,refetch:d}},exports.useInvoices=Wn,exports.usePlanGroup=Ln,exports.usePlanGroupVersions=Mn,exports.usePublicPlanGroupVersion=e=>{const{t:n}=gn(),{api:a}=In(),[r,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await a.getPlanGroupVersion(e);s(t)}catch(t){const a=Dn(t,"errors.fetchPlanGroupVersion",n);l(a),W(t,{component:"usePublicPlanGroupVersion",action:"fetchVersion",metadata:{groupVersionId:e}})}finally{o(!1)}}else s(null)},[a,e]);return t.useEffect(()=>{u()},[u]),{planGroupVersion:r,loading:i,error:c,refetch:u}},exports.usePublicPlans=Rn,exports.usePushNotifications=Au,exports.useQuotaUsageContext=Wa,exports.useQuotaUsageStatus=(e,n)=>{const{t:a}=gn(),{api:r}=In(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e&&n){c(!0),u(null);try{const t=await r.getQuotaUsageStatus(e,n);i(t)}catch(t){const r=Dn(t,"errors.fetchQuotaUsage",a);u(r),W(t,{component:"useQuotaUsageStatus",action:"fetchStatus",metadata:{workspaceId:e,quotaSlug:n}})}finally{c(!1)}}else i(null)},[r,e,n]);return t.useEffect(()=>{d()},[d]),{status:s,loading:o,error:l,refetch:d}},exports.useRecordUsage=e=>{const{t:n}=gn(),{api:a}=In(),[r,s]=t.useState(!1),[i,o]=t.useState(null);return{recordUsage:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const n=await a.recordUsage(e,t);return Fe(),n}catch(a){const r=Dn(a,"errors.recordUsage",n);throw o(r),W(a,{component:"useRecordUsage",action:"recordUsage",metadata:{workspaceId:e,request:t}}),a}finally{s(!1)}},[a,e]),loading:r,error:i}},exports.useResumeSubscription=$n,exports.useSaaSAuth=wu,exports.useSaaSOs=Pn,exports.useSaaSSettings=Un,exports.useSaaSWorkspaces=Ba,exports.useSeatStatus=ru,exports.useSubscription=zn,exports.useSubscriptionContext=qn,exports.useSubscriptionManagement=Fn,exports.useTranslation=gn,exports.useTrialStatus=function(){const{response:e}=qn();return t.useMemo(()=>{const t=e?.subscription;if(!t||"trialing"!==t.subscriptionStatus)return{isTrialing:!1,daysRemaining:0,trialEndsAt:null,trialStartedAt:null,isTrialEnding:!1};const n=rd(t.trialEnd)??rd(t.stripeCurrentPeriodEnd),a=rd(t.trialStart),r=n?Math.max(0,Math.ceil((n.getTime()-Date.now())/864e5)):0;return{isTrialing:!0,daysRemaining:r,trialEndsAt:n,trialStartedAt:a,isTrialEnding:r<=3}},[e])},exports.useUpdateSubscription=On,exports.useUsageLogs=(e,n,a)=>{const{t:r}=gn(),{api:s}=In(),[i,o]=t.useState([]),[c,l]=t.useState(0),[u,d]=t.useState(0),[m,p]=t.useState(1),[h,g]=t.useState(!1),[f,b]=t.useState(!1),[x,v]=t.useState(!1),[y,w]=t.useState(null),S=a?.from,k=a?.to,N=a?.source,j=a?.page,A=a?.limit,C=t.useCallback(async()=>{if(!e)return o([]),l(0),d(0),p(1),g(!1),void b(!1);v(!0),w(null);try{const t={...n&&{quotaSlug:n},...S&&{from:S},...k&&{to:k},...N&&{source:N},...j&&{page:j},...A&&{limit:A}},a=await s.getUsageLogs(e,t);o(a.docs||[]),l(a.totalDocs||0),d(a.totalPages||0),p(a.page||1),g(a.hasNextPage||!1),b(a.hasPrevPage||!1)}catch(t){const a=Dn(t,"errors.fetchUsageLogs",r);w(a),W(t,{component:"useUsageLogs",action:"fetchLogs",metadata:{workspaceId:e,quotaSlug:n}})}finally{v(!1)}},[s,e,n,S,k,N,j,A]);return t.useEffect(()=>{C()},[C]),{logs:i,totalDocs:c,totalPages:u,page:m,hasNextPage:h,hasPrevPage:f,loading:x,error:y,refetch:C}},exports.useUserAttributes=function(){const e=t.useContext(Uu);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e},exports.useUserFeatures=Hu;
2
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("react-dom");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}}),t.default=e,Object.freeze(t)}var a=n(t),s=n(r);function i(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=i(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function o(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=i(e))&&(n&&(n+=" "),n+=t);return n}const c=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),l="-",u=[],d=e=>{const t=h(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return m(e);const r=e.split(l),n=""===r[0]&&r.length>1?1:0;return p(r,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=n[e],a=r[e];return t?a?((e,t)=>{const r=new Array(e.length+t.length);for(let t=0;t<e.length;t++)r[t]=e[t];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r})(a,t):t:a||u}return r[e]||u}}},p=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const n=e[t],a=r.nextPart.get(n);if(a){const r=p(e,t+1,a);if(r)return r}const s=r.validators;if(null===s)return;const i=0===t?e.join(l):e.slice(t).join(l),o=s.length;for(let e=0;e<o;e++){const t=s[e];if(t.validator(i))return t.classGroupId}},m=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?"arbitrary.."+n:void 0})(),h=e=>{const{theme:t,classGroups:r}=e;return f(r,t)},f=(e,t)=>{const r=c();for(const n in e){const a=e[n];g(a,r,n,t)}return r},g=(e,t,r,n)=>{const a=e.length;for(let s=0;s<a;s++){const a=e[s];b(a,t,r,n)}},b=(e,t,r,n)=>{"string"!=typeof e?"function"!=typeof e?x(e,t,r,n):y(e,t,r,n):v(e,t,r)},v=(e,t,r)=>{(""===e?t:w(t,e)).classGroupId=r},y=(e,t,r,n)=>{S(e)?g(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},x=(e,t,r,n)=>{const a=Object.entries(e),s=a.length;for(let e=0;e<s;e++){const[s,i]=a[e];g(i,w(t,s),r,n)}},w=(e,t)=>{let r=e;const n=t.split(l),a=n.length;for(let e=0;e<a;e++){const t=n[e];let a=r.nextPart.get(t);a||(a=c(),r.nextPart.set(t,a)),r=a}return r},S=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,k=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const a=(a,s)=>{r[a]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(a(e,t),t):void 0},set(e,t){e in r?r[e]=t:a(e,t)}}},E=[],C=(e,t,r,n,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:a}),N=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,a=0,s=0;const i=e.length;for(let o=0;o<i;o++){const i=e[o];if(0===n&&0===a){if(":"===i){t.push(e.slice(s,o)),s=o+1;continue}if("/"===i){r=o;continue}}"["===i?n++:"]"===i?n--:"("===i?a++:")"===i&&a--}const o=0===t.length?e:e.slice(s);let c=o,l=!1;o.endsWith("!")?(c=o.slice(0,-1),l=!0):o.startsWith("!")&&(c=o.slice(1),l=!0);return C(t,l,c,r&&r>s?r-s:void 0)};if(t){const e=t+":",r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):C(E,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},A=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let n=[];for(let a=0;a<e.length;a++){const s=e[a],i="["===s[0],o=t.has(s);i||o?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(s)):n.push(s)}return n.length>0&&(n.sort(),r.push(...n)),r}},j=/\s+/,P=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=P(e[n]))&&(r&&(r+=" "),r+=t);return r},T=(e,...t)=>{let r,n,a,s;const i=e=>{const t=n(e);if(t)return t;const s=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:s}=t,i=[],o=e.trim().split(j);let c="";for(let e=o.length-1;e>=0;e-=1){const t=o[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:m}=r(t);if(l){c=t+(c.length>0?" "+c:c);continue}let h=!!m,f=n(h?p.substring(0,m):p);if(!f){if(!h){c=t+(c.length>0?" "+c:c);continue}if(f=n(p),!f){c=t+(c.length>0?" "+c:c);continue}h=!1}const g=0===u.length?"":1===u.length?u[0]:s(u).join(":"),b=d?g+"!":g,v=b+f;if(i.indexOf(v)>-1)continue;i.push(v);const y=a(f,h);for(let e=0;e<y.length;++e){const t=y[e];i.push(b+t)}c=t+(c.length>0?" "+c:c)}return c})(e,r);return a(e,s),s};return s=o=>{const c=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:k(e.cacheSize),parseClassName:N(e),sortModifiers:A(e),...d(e)}))(c),n=r.cache.get,a=r.cache.set,s=i,i(o)},(...e)=>s(((...e)=>{let t,r,n=0,a="";for(;n<e.length;)(t=e[n++])&&(r=P(t))&&(a&&(a+=" "),a+=r);return a})(...e))},_=[],R=e=>{const t=t=>t[e]||_;return t.isThemeGetter=!0,t},D=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,U=/^\d+\/\d+$/,M=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,L=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,O=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,F=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,B=e=>U.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),V=e=>!!e&&Number.isInteger(Number(e)),H=e=>e.endsWith("%")&&W(e.slice(0,-1)),G=e=>M.test(e),$=()=>!0,K=e=>L.test(e)&&!O.test(e),q=()=>!1,Z=e=>z.test(e),J=e=>F.test(e),Y=e=>!Q(e)&&!se(e),X=e=>pe(e,ge,q),Q=e=>D.test(e),ee=e=>pe(e,be,K),te=e=>pe(e,ve,W),re=e=>pe(e,he,q),ne=e=>pe(e,fe,J),ae=e=>pe(e,xe,Z),se=e=>I.test(e),ie=e=>me(e,be),oe=e=>me(e,ye),ce=e=>me(e,he),le=e=>me(e,ge),ue=e=>me(e,fe),de=e=>me(e,xe,!0),pe=(e,t,r)=>{const n=D.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},me=(e,t,r=!1)=>{const n=I.exec(e);return!!n&&(n[1]?t(n[1]):r)},he=e=>"position"===e||"percentage"===e,fe=e=>"image"===e||"url"===e,ge=e=>"length"===e||"size"===e||"bg-size"===e,be=e=>"length"===e,ve=e=>"number"===e,ye=e=>"family-name"===e,xe=e=>"shadow"===e,we=T(()=>{const e=R("color"),t=R("font"),r=R("text"),n=R("font-weight"),a=R("tracking"),s=R("leading"),i=R("breakpoint"),o=R("container"),c=R("spacing"),l=R("radius"),u=R("shadow"),d=R("inset-shadow"),p=R("text-shadow"),m=R("drop-shadow"),h=R("blur"),f=R("perspective"),g=R("aspect"),b=R("ease"),v=R("animate"),y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",se,Q],x=()=>[se,Q,c],w=()=>[B,"full","auto",...x()],S=()=>[V,"none","subgrid",se,Q],k=()=>["auto",{span:["full",V,se,Q]},V,se,Q],E=()=>[V,"auto",se,Q],C=()=>["auto","min","max","fr",se,Q],N=()=>["auto",...x()],A=()=>[B,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],j=()=>[e,se,Q],P=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",ce,re,{position:[se,Q]}],T=()=>["auto","cover","contain",le,X,{size:[se,Q]}],_=()=>[H,ie,ee],D=()=>["","none","full",l,se,Q],I=()=>["",W,ie,ee],U=()=>[W,H,ce,re],M=()=>["","none",h,se,Q],L=()=>["none",W,se,Q],O=()=>["none",W,se,Q],z=()=>[W,se,Q],F=()=>[B,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[G],breakpoint:[G],color:[$],container:[G],"drop-shadow":[G],ease:["in","out","in-out"],font:[Y],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[G],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[G],shadow:[G],spacing:["px",W],text:[G],"text-shadow":[G],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",B,Q,se,g]}],container:["container"],columns:[{columns:[W,Q,se,o]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:y()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[V,"auto",se,Q]}],basis:[{basis:[B,"full","auto",o,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[W,B,"auto","initial","none",Q]}],grow:[{grow:["",W,se,Q]}],shrink:[{shrink:["",W,se,Q]}],order:[{order:[V,"first","last","none",se,Q]}],"grid-cols":[{"grid-cols":S()}],"col-start-end":[{col:k()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:A()}],w:[{w:[o,"screen",...A()]}],"min-w":[{"min-w":[o,"screen","none",...A()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[i]},...A()]}],h:[{h:["screen","lh",...A()]}],"min-h":[{"min-h":["screen","lh","none",...A()]}],"max-h":[{"max-h":["screen","lh",...A()]}],"font-size":[{text:["base",r,ie,ee]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,se,te]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",H,Q]}],"font-family":[{font:[oe,Q,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,se,Q]}],"line-clamp":[{"line-clamp":[W,"none",se,te]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",se,Q]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",se,Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:j()}],"text-color":[{text:j()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[W,"from-font","auto",se,ee]}],"text-decoration-color":[{decoration:j()}],"underline-offset":[{"underline-offset":[W,"auto",se,Q]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se,Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",se,Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:T()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},V,se,Q],radial:["",se,Q],conic:[V,se,Q]},ue,ne]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:_()}],"gradient-via-pos":[{via:_()}],"gradient-to-pos":[{to:_()}],"gradient-from":[{from:j()}],"gradient-via":[{via:j()}],"gradient-to":[{to:j()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:j()}],"border-color-x":[{"border-x":j()}],"border-color-y":[{"border-y":j()}],"border-color-s":[{"border-s":j()}],"border-color-e":[{"border-e":j()}],"border-color-t":[{"border-t":j()}],"border-color-r":[{"border-r":j()}],"border-color-b":[{"border-b":j()}],"border-color-l":[{"border-l":j()}],"divide-color":[{divide:j()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[W,se,Q]}],"outline-w":[{outline:["",W,ie,ee]}],"outline-color":[{outline:j()}],shadow:[{shadow:["","none",u,de,ae]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",d,de,ae]}],"inset-shadow-color":[{"inset-shadow":j()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:j()}],"ring-offset-w":[{"ring-offset":[W,ee]}],"ring-offset-color":[{"ring-offset":j()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":j()}],"text-shadow":[{"text-shadow":["none",p,de,ae]}],"text-shadow-color":[{"text-shadow":j()}],opacity:[{opacity:[W,se,Q]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":U()}],"mask-image-linear-to-pos":[{"mask-linear-to":U()}],"mask-image-linear-from-color":[{"mask-linear-from":j()}],"mask-image-linear-to-color":[{"mask-linear-to":j()}],"mask-image-t-from-pos":[{"mask-t-from":U()}],"mask-image-t-to-pos":[{"mask-t-to":U()}],"mask-image-t-from-color":[{"mask-t-from":j()}],"mask-image-t-to-color":[{"mask-t-to":j()}],"mask-image-r-from-pos":[{"mask-r-from":U()}],"mask-image-r-to-pos":[{"mask-r-to":U()}],"mask-image-r-from-color":[{"mask-r-from":j()}],"mask-image-r-to-color":[{"mask-r-to":j()}],"mask-image-b-from-pos":[{"mask-b-from":U()}],"mask-image-b-to-pos":[{"mask-b-to":U()}],"mask-image-b-from-color":[{"mask-b-from":j()}],"mask-image-b-to-color":[{"mask-b-to":j()}],"mask-image-l-from-pos":[{"mask-l-from":U()}],"mask-image-l-to-pos":[{"mask-l-to":U()}],"mask-image-l-from-color":[{"mask-l-from":j()}],"mask-image-l-to-color":[{"mask-l-to":j()}],"mask-image-x-from-pos":[{"mask-x-from":U()}],"mask-image-x-to-pos":[{"mask-x-to":U()}],"mask-image-x-from-color":[{"mask-x-from":j()}],"mask-image-x-to-color":[{"mask-x-to":j()}],"mask-image-y-from-pos":[{"mask-y-from":U()}],"mask-image-y-to-pos":[{"mask-y-to":U()}],"mask-image-y-from-color":[{"mask-y-from":j()}],"mask-image-y-to-color":[{"mask-y-to":j()}],"mask-image-radial":[{"mask-radial":[se,Q]}],"mask-image-radial-from-pos":[{"mask-radial-from":U()}],"mask-image-radial-to-pos":[{"mask-radial-to":U()}],"mask-image-radial-from-color":[{"mask-radial-from":j()}],"mask-image-radial-to-color":[{"mask-radial-to":j()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":U()}],"mask-image-conic-to-pos":[{"mask-conic-to":U()}],"mask-image-conic-from-color":[{"mask-conic-from":j()}],"mask-image-conic-to-color":[{"mask-conic-to":j()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:T()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,Q]}],filter:[{filter:["","none",se,Q]}],blur:[{blur:M()}],brightness:[{brightness:[W,se,Q]}],contrast:[{contrast:[W,se,Q]}],"drop-shadow":[{"drop-shadow":["","none",m,de,ae]}],"drop-shadow-color":[{"drop-shadow":j()}],grayscale:[{grayscale:["",W,se,Q]}],"hue-rotate":[{"hue-rotate":[W,se,Q]}],invert:[{invert:["",W,se,Q]}],saturate:[{saturate:[W,se,Q]}],sepia:[{sepia:["",W,se,Q]}],"backdrop-filter":[{"backdrop-filter":["","none",se,Q]}],"backdrop-blur":[{"backdrop-blur":M()}],"backdrop-brightness":[{"backdrop-brightness":[W,se,Q]}],"backdrop-contrast":[{"backdrop-contrast":[W,se,Q]}],"backdrop-grayscale":[{"backdrop-grayscale":["",W,se,Q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,se,Q]}],"backdrop-invert":[{"backdrop-invert":["",W,se,Q]}],"backdrop-opacity":[{"backdrop-opacity":[W,se,Q]}],"backdrop-saturate":[{"backdrop-saturate":[W,se,Q]}],"backdrop-sepia":[{"backdrop-sepia":["",W,se,Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",se,Q]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[W,"initial",se,Q]}],ease:[{ease:["linear","initial",b,se,Q]}],delay:[{delay:[W,se,Q]}],animate:[{animate:["none",v,se,Q]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,se,Q]}],"perspective-origin":[{"perspective-origin":y()}],rotate:[{rotate:L()}],"rotate-x":[{"rotate-x":L()}],"rotate-y":[{"rotate-y":L()}],"rotate-z":[{"rotate-z":L()}],scale:[{scale:O()}],"scale-x":[{"scale-x":O()}],"scale-y":[{"scale-y":O()}],"scale-z":[{"scale-z":O()}],"scale-3d":["scale-3d"],skew:[{skew:z()}],"skew-x":[{"skew-x":z()}],"skew-y":[{"skew-y":z()}],transform:[{transform:[se,Q,"","none","gpu","cpu"]}],"transform-origin":[{origin:y()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":["translate-none"],accent:[{accent:j()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:j()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",se,Q]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",se,Q]}],fill:[{fill:["none",...j()]}],"stroke-w":[{stroke:[W,ie,ee,te]}],stroke:[{stroke:["none",...j()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Se(...e){return we(o(e))}let ke=!0;function Ee(e,...t){ke&&function(){try{const e="undefined"!=typeof globalThis?globalThis:null;return"development"===e?.process?.env?.NODE_ENV}catch{return!1}}()&&console.error(e,...t)}function Ce(e,...t){console.error(e,...t)}function Ne(e){return e instanceof Error&&("AbortError"===e.name||"ERR_CANCELED"===e.code)}async function Ae(e,t){try{const r=await e.json();return r?.message||r?.error||t}catch{return t}}async function je(e){const t=await e.text();if(!t)throw new Error("Empty response body");try{return JSON.parse(t)}catch(e){throw new Error(`Invalid JSON response: ${t.substring(0,100)}${t.length>100?"...":""}`)}}async function Pe(e,t="Request failed"){if(!e.ok){let r=t;try{const t=await je(e);r=t.message||t.error||r}catch{r=function(e,t){const r={400:"Bad Request",401:"Unauthorized - Please check your session",403:"Forbidden - You do not have permission",404:"Resource not found",500:"Internal server error",502:"Bad Gateway",503:"Service unavailable"}[e.status]||e.statusText||t;return new Error(`${t} (${e.status}: ${r})`)}(e,t).message}throw new Error(r)}try{return await je(e)}catch(e){if(e instanceof Error&&e.message.includes("Invalid JSON"))throw e;throw new Error("Failed to parse response as JSON")}}class Te extends Error{constructor(e,t,r,n){super(e),this.code=t,this.context=r,this.originalError=n,this.name="SDKError","undefined"!=typeof Error&&"captureStackTrace"in Error&&Error.captureStackTrace(this,Te)}}const _e=new class{constructor(){this.config={enableConsoleLogging:!0,showUserNotifications:!1}}configure(e){this.config={...this.config,...e},void 0!==e.enableConsoleLogging&&function(e){void 0!==e.enableLogging&&(ke=e.enableLogging)}({enableLogging:e.enableConsoleLogging})}handleError(e,t={}){if(Ne(e))return;const r=e instanceof Error?e:new Te("string"==typeof e?e:"An unknown error occurred","UNKNOWN_ERROR",t),n=r instanceof Te?r:new Te(r.message,"SDK_ERROR",t,r);if(this.config.enableConsoleLogging&&Ee(`[SDK Error] ${t.component||"Unknown"}:`,{message:n.message,code:n.code,context:n.context,originalError:n.originalError,stack:n.stack}),this.config.onError)try{this.config.onError(n,t)}catch(e){Ce("[SDK Error Handler] Error in custom error callback:",e)}this.config.showUserNotifications&&this.notifyUser(n,t)}notifyUser(e,t){"undefined"!=typeof window&&window.dispatchEvent&&window.dispatchEvent(new CustomEvent("sdk-error",{detail:{error:e,context:t}}))}wrapAsync(e,t){return(...r)=>e(...r).catch(e=>{throw this.handleError(e,t),e})}wrapSync(e,t){return(...r)=>{try{return e(...r)}catch(e){throw this.handleError(e,t),e}}}};function Re(e,t={}){_e.handleError(e,t)}function De(e,t={}){return!Ne(e)&&(_e.handleError(e,t),!0)}class Ie extends t.Component{constructor(e){super(e),this.resetError=()=>{this.setState({hasError:!1,error:null})},this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){if(Re(e,{component:"ErrorBoundary",action:"componentDidCatch",metadata:{componentStack:t.componentStack,errorBoundary:this.constructor.name}}),this.props.onError)try{this.props.onError(e,t)}catch(e){Ce("[SDK ErrorBoundary] Error in onError callback:",e)}}componentDidUpdate(e){this.state.hasError&&!1!==this.props.resetOnPropsChange&&e.children!==this.props.children&&this.resetError()}render(){return this.state.hasError&&this.state.error?this.props.fallback?"function"==typeof this.props.fallback?this.props.fallback(this.state.error,this.resetError):this.props.fallback:e.jsxs("div",{style:{padding:"1rem",border:"1px solid #ef4444",borderRadius:"0.5rem",backgroundColor:"#fef2f2",color:"#991b1b"},children:[e.jsx("h3",{style:{margin:"0 0 0.5rem 0",fontSize:"1rem",fontWeight:600},children:"Something went wrong"}),e.jsx("p",{style:{margin:"0 0 1rem 0",fontSize:"0.875rem"},children:this.state.error.message||"An unexpected error occurred"}),e.jsx("button",{onClick:this.resetError,style:{padding:"0.5rem 1rem",backgroundColor:"#ef4444",color:"white",border:"none",borderRadius:"0.25rem",cursor:"pointer",fontSize:"0.875rem"},children:"Try again"})]}):this.props.children}}const Ue=()=>({type:"AUTHENTICATION_STARTED"}),Me=()=>({type:"AUTHENTICATION_PROCESSING"}),Le=()=>({type:"AUTHENTICATION_FAILED"}),Oe=e=>({type:"SET_SESSION",payload:e}),ze=()=>({type:"REMOVE_SESSION"});function Fe(e,r,n){const a=t.useRef(r),s=t.useRef(n),i=t.useRef(void 0),o=t.useRef(!1);return a.current=r,s.current=n,t.useMemo(()=>{const t=a.current(e);if(o.current){if(s.current?s.current(i.current,t):Object.is(i.current,t))return i.current}return i.current=t,o.current=!0,t},[e])}function Be({name:r,initialState:n,reducer:a,initializer:s}){const i=t.createContext(null),o=t.createContext(null),c=t.createContext(null),l=t.memo(({children:r})=>{const[l,u]=t.useReducer(a,n,s||(e=>e)),d=t.useMemo(()=>({state:l,dispatch:u}),[l,u]);return e.jsx(c.Provider,{value:d,children:e.jsx(i.Provider,{value:l,children:e.jsx(o.Provider,{value:u,children:r})})})});l.displayName=`${r}Provider`;const u=e=>new Error(`use${r}${e} must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`),d=()=>{const e=t.useContext(i);if(null===e)throw u("State");return e};return{Provider:l,useContext:()=>{const e=t.useContext(c);if(!e)throw u("Context");return e},useState:d,useDispatch:()=>{const e=t.useContext(o);if(null===e)throw u("Dispatch");return e},useSelector:(e,t)=>{const r=e||(e=>e);return Fe(d(),r,t)}}}var We;function Ve(e){return{isAuthenticated:e===We.authenticated,isLoading:e===We.loading||e===We.redirecting||e===We.authenticating,isRedirecting:e===We.redirecting}}function He(e,t,r){return{...e,[t]:r}}function Ge(e,t){return{...e,...t}}!function(e){e.loading="loading",e.redirecting="redirecting",e.authenticated="authenticated",e.unauthenticated="unauthenticated",e.authenticating="authenticating"}(We||(We={}));const $e=()=>({session:null,status:We.loading}),{Provider:Ke,useState:qe,useDispatch:Ze}=Be({name:"Auth",initialState:$e(),reducer:(e,t)=>{switch(t.type){case"AUTHENTICATION_STARTED":return He(e,"status",We.redirecting);case"AUTHENTICATION_PROCESSING":return He(e,"status",We.authenticating);case"AUTHENTICATION_FAILED":case"REMOVE_SESSION":return Ge(e,{session:null,status:We.unauthenticated});case"SET_SESSION":return Ge(e,{session:t.payload,status:We.authenticated});default:return e}},initializer:$e}),Je=Ke,Ye=qe,Xe=Ze,Qe=e=>({type:"SET_SAAS_OS_CONFIG",payload:e}),et=e=>({type:"SET_SETTINGS",payload:e});var tt;function rt(e){return Boolean(e?.serverUrl&&e?.version&&e?.orgId)}!function(e){e.V1="v1"}(tt||(tt={}));const nt=()=>({serverUrl:"",version:tt.V1,orgId:"",settings:null}),{Provider:at,useState:st,useDispatch:it}=Be({name:"OS",initialState:nt(),reducer:(e,t)=>{switch(t.type){case"SET_SAAS_OS_CONFIG":return Ge(e,t.payload);case"REMOVE_SAAS_OS_CONFIG":return nt();case"SET_SETTINGS":return He(e,"settings",t.payload);default:return e}}}),ot=at,ct=st,lt=it,ut=e=>({type:"SET_WORKSPACES",payload:e}),dt=e=>({type:"ADD_WORKSPACE",payload:e}),pt=e=>({type:"UPDATE_WORKSPACE",payload:e}),mt=e=>({type:"REMOVE_WORKSPACE",payload:e}),ht=e=>({type:"SET_ALL_FEATURES",payload:e}),ft=e=>({type:"SET_CURRENT_WORKSPACE",payload:e}),gt=()=>({type:"RESET_CURRENT_WORKSPACE"}),bt=e=>({type:"SET_IS_INITIALIZED",payload:e}),vt=e=>({type:"SET_LOADING",payload:e}),yt=e=>({type:"SET_ERROR",payload:e}),xt=e=>({type:"SET_REFRESHING",payload:e}),wt=e=>({type:"SET_SWITCHING_TO_ID",payload:e}),{Provider:St,useState:kt,useDispatch:Et}=Be({name:"Workspace",initialState:{workspaces:[],loading:!1,error:null,currentWorkspace:null,refreshing:!1,switchingToId:null,isInitialized:!1,allFeatures:[]},reducer:(e,t)=>{switch(t.type){case"SET_WORKSPACES":return He(e,"workspaces",t.payload);case"ADD_WORKSPACE":return He(e,"workspaces",[...e.workspaces,t.payload]);case"UPDATE_WORKSPACE":return He(e,"workspaces",e.workspaces.map(e=>e._id===t.payload._id?t.payload:e));case"REMOVE_WORKSPACE":return He(e,"workspaces",e.workspaces.filter(e=>e._id!==t.payload));case"SET_ALL_FEATURES":return He(e,"allFeatures",t.payload);case"SET_CURRENT_WORKSPACE":return He(e,"currentWorkspace",t.payload);case"RESET_CURRENT_WORKSPACE":return He(e,"currentWorkspace",null);case"SET_IS_INITIALIZED":return He(e,"isInitialized",t.payload);case"SET_LOADING":return He(e,"loading",t.payload);case"SET_ERROR":return He(e,"error",t.payload);case"SET_REFRESHING":return He(e,"refreshing",t.payload);case"SET_SWITCHING_TO_ID":return He(e,"switchingToId",t.payload);default:return e}}}),Ct=St,Nt=kt,At=Et,jt=t.memo(({children:t})=>e.jsx(ot,{children:e.jsx(Je,{children:e.jsx(Ct,{children:t})})}));function Pt(e,r){const n=ct(),a=Ye(),s=Nt(),i=e||(e=>e);return Fe(t.useMemo(()=>({os:n,auth:a,workspaces:s}),[n,a,s]),i,r)}jt.displayName="SDKContextProvider";const Tt=new Set;function _t(){Tt.forEach(e=>e())}const Rt=new Set;function Dt(){Rt.forEach(e=>e())}function It(e,t){const r=t&&t.cache?t.cache:Bt,n=t&&t.serializer?t.serializer:zt;return(t&&t.strategy?t.strategy:Ot)(e,{cache:r,serializer:n})}function Ut(e,t,r,n){const a=null==(s=n)||"number"==typeof s||"boolean"==typeof s?n:r(n);var s;let i=t.get(a);return void 0===i&&(i=e.call(this,n),t.set(a,i)),i}function Mt(e,t,r){const n=Array.prototype.slice.call(arguments,3),a=r(n);let s=t.get(a);return void 0===s&&(s=e.apply(this,n),t.set(a,s)),s}function Lt(e,t,r,n,a){return r.bind(t,e,n,a)}function Ot(e,t){return Lt(e,this,1===e.length?Ut:Mt,t.cache.create(),t.serializer)}const zt=function(){return JSON.stringify(arguments)};class Ft{cache;constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const Bt={create:function(){return new Ft}},Wt={variadic:function(e,t){return Lt(e,this,Mt,t.cache.create(),t.serializer)}},Vt=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function Ht(e){const t={};return e.replace(Vt,e=>{const r=e.length;switch(e[0]){case"G":t.era=4===r?"long":5===r?"narrow":"short";break;case"y":t.year=2===r?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw new RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":t.month=["numeric","2-digit","short","long","narrow"][r-1];break;case"w":case"W":throw new RangeError("`w/W` (week) patterns are not supported");case"d":t.day=["numeric","2-digit"][r-1];break;case"D":case"F":case"g":throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":t.weekday=4===r?"long":5===r?"narrow":"short";break;case"e":if(r<4)throw new RangeError("`e..eee` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"c":if(r<4)throw new RangeError("`c..ccc` (weekday) patterns are not supported");t.weekday=["short","long","narrow","short"][r-4];break;case"a":t.hour12=!0;break;case"b":case"B":throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":t.hourCycle="h12",t.hour=["numeric","2-digit"][r-1];break;case"H":t.hourCycle="h23",t.hour=["numeric","2-digit"][r-1];break;case"K":t.hourCycle="h11",t.hour=["numeric","2-digit"][r-1];break;case"k":t.hourCycle="h24",t.hour=["numeric","2-digit"][r-1];break;case"j":case"J":case"C":throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":t.minute=["numeric","2-digit"][r-1];break;case"s":t.second=["numeric","2-digit"][r-1];break;case"S":case"A":throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":t.timeZoneName=r<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),t}const Gt=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function $t(e){return e.replace(/^(.*?)-/,"")}const Kt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,qt=/^(@+)?(\+|#+)?[rs]?$/g,Zt=/(\*)(0+)|(#+)(0+)|(0+)/g,Jt=/^(0+)$/;function Yt(e){const t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(qt,function(e,r,n){return"string"!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):"+"===n?t.minimumSignificantDigits=r.length:"#"===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+("string"==typeof n?n.length:0)),""}),t}function Xt(e){switch(e){case"sign-auto":return{signDisplay:"auto"};case"sign-accounting":case"()":return{currencySign:"accounting"};case"sign-always":case"+!":return{signDisplay:"always"};case"sign-accounting-always":case"()!":return{signDisplay:"always",currencySign:"accounting"};case"sign-except-zero":case"+?":return{signDisplay:"exceptZero"};case"sign-accounting-except-zero":case"()?":return{signDisplay:"exceptZero",currencySign:"accounting"};case"sign-never":case"+_":return{signDisplay:"never"}}}function Qt(e){let t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){const r=e.slice(0,2);if("+!"===r?(t.signDisplay="always",e=e.slice(2)):"+?"===r&&(t.signDisplay="exceptZero",e=e.slice(2)),!Jt.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function er(e){const t=Xt(e);return t||{}}function tr(e){let t={};for(const r of e){switch(r.stem){case"percent":case"%":t.style="percent";continue;case"%x100":t.style="percent",t.scale=100;continue;case"currency":t.style="currency",t.currency=r.options[0];continue;case"group-off":case",_":t.useGrouping=!1;continue;case"precision-integer":case".":t.maximumFractionDigits=0;continue;case"measure-unit":case"unit":t.style="unit",t.unit=$t(r.options[0]);continue;case"compact-short":case"K":t.notation="compact",t.compactDisplay="short";continue;case"compact-long":case"KK":t.notation="compact",t.compactDisplay="long";continue;case"scientific":t={...t,notation:"scientific",...r.options.reduce((e,t)=>({...e,...er(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...r.options.reduce((e,t)=>({...e,...er(t)}),{})};continue;case"notation-simple":t.notation="standard";continue;case"unit-width-narrow":t.currencyDisplay="narrowSymbol",t.unitDisplay="narrow";continue;case"unit-width-short":t.currencyDisplay="code",t.unitDisplay="short";continue;case"unit-width-full-name":t.currencyDisplay="name",t.unitDisplay="long";continue;case"unit-width-iso-code":t.currencyDisplay="symbol";continue;case"scale":t.scale=parseFloat(r.options[0]);continue;case"rounding-mode-floor":t.roundingMode="floor";continue;case"rounding-mode-ceiling":t.roundingMode="ceil";continue;case"rounding-mode-down":t.roundingMode="trunc";continue;case"rounding-mode-up":t.roundingMode="expand";continue;case"rounding-mode-half-even":t.roundingMode="halfEven";continue;case"rounding-mode-half-down":t.roundingMode="halfTrunc";continue;case"rounding-mode-half-up":t.roundingMode="halfExpand";continue;case"integer-width":if(r.options.length>1)throw new RangeError("integer-width stems only accept a single optional option");r.options[0].replace(Zt,function(e,r,n,a,s,i){if(r)t.minimumIntegerDigits=n.length;else{if(a&&s)throw new Error("We currently do not support maximum integer digits");if(i)throw new Error("We currently do not support exact integer digits")}return""});continue}if(Jt.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(Kt.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Kt,function(e,r,n,a,s,i){return"*"===n?t.minimumFractionDigits=r.length:a&&"#"===a[0]?t.maximumFractionDigits=a.length:s&&i?(t.minimumFractionDigits=s.length,t.maximumFractionDigits=s.length+i.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),""});const e=r.options[0];"w"===e?t={...t,trailingZeroDisplay:"stripIfInteger"}:e&&(t={...t,...Yt(e)});continue}if(qt.test(r.stem)){t={...t,...Yt(r.stem)};continue}const e=Xt(r.stem);e&&(t={...t,...e});const n=Qt(r.stem);n&&(t={...t,...n})}return t}let rr=function(e){return e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag",e}({}),nr=function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e}({});function ar(e){return e.type===rr.literal}function sr(e){return e.type===rr.argument}function ir(e){return e.type===rr.number}function or(e){return e.type===rr.date}function cr(e){return e.type===rr.time}function lr(e){return e.type===rr.select}function ur(e){return e.type===rr.plural}function dr(e){return e.type===rr.pound}function pr(e){return e.type===rr.tag}function mr(e){return!(!e||"object"!=typeof e||e.type!==nr.number)}function hr(e){return!(!e||"object"!=typeof e||e.type!==nr.dateTime)}let fr=function(e){return e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG",e}({});const gr=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,br={"001":["H","h"],419:["h","H","hB","hb"],AC:["H","h","hb","hB"],AD:["H","hB"],AE:["h","hB","hb","H"],AF:["H","hb","hB","h"],AG:["h","hb","H","hB"],AI:["H","h","hb","hB"],AL:["h","H","hB"],AM:["H","hB"],AO:["H","hB"],AR:["h","H","hB","hb"],AS:["h","H"],AT:["H","hB"],AU:["h","hb","H","hB"],AW:["H","hB"],AX:["H"],AZ:["H","hB","h"],BA:["H","hB","h"],BB:["h","hb","H","hB"],BD:["h","hB","H"],BE:["H","hB"],BF:["H","hB"],BG:["H","hB","h"],BH:["h","hB","hb","H"],BI:["H","h"],BJ:["H","hB"],BL:["H","hB"],BM:["h","hb","H","hB"],BN:["hb","hB","h","H"],BO:["h","H","hB","hb"],BQ:["H"],BR:["H","hB"],BS:["h","hb","H","hB"],BT:["h","H"],BW:["H","h","hb","hB"],BY:["H","h"],BZ:["H","h","hb","hB"],CA:["h","hb","H","hB"],CC:["H","h","hb","hB"],CD:["hB","H"],CF:["H","h","hB"],CG:["H","hB"],CH:["H","hB","h"],CI:["H","hB"],CK:["H","h","hb","hB"],CL:["h","H","hB","hb"],CM:["H","h","hB"],CN:["H","hB","hb","h"],CO:["h","H","hB","hb"],CP:["H"],CR:["h","H","hB","hb"],CU:["h","H","hB","hb"],CV:["H","hB"],CW:["H","hB"],CX:["H","h","hb","hB"],CY:["h","H","hb","hB"],CZ:["H"],DE:["H","hB"],DG:["H","h","hb","hB"],DJ:["h","H"],DK:["H"],DM:["h","hb","H","hB"],DO:["h","H","hB","hb"],DZ:["h","hB","hb","H"],EA:["H","h","hB","hb"],EC:["h","H","hB","hb"],EE:["H","hB"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],ER:["h","H"],ES:["H","hB","h","hb"],ET:["hB","hb","h","H"],FI:["H"],FJ:["h","hb","H","hB"],FK:["H","h","hb","hB"],FM:["h","hb","H","hB"],FO:["H","h"],FR:["H","hB"],GA:["H","hB"],GB:["H","h","hb","hB"],GD:["h","hb","H","hB"],GE:["H","hB","h"],GF:["H","hB"],GG:["H","h","hb","hB"],GH:["h","H"],GI:["H","h","hb","hB"],GL:["H","h"],GM:["h","hb","H","hB"],GN:["H","hB"],GP:["H","hB"],GQ:["H","hB","h","hb"],GR:["h","H","hb","hB"],GS:["H","h","hb","hB"],GT:["h","H","hB","hb"],GU:["h","hb","H","hB"],GW:["H","hB"],GY:["h","hb","H","hB"],HK:["h","hB","hb","H"],HN:["h","H","hB","hb"],HR:["H","hB"],HU:["H","h"],IC:["H","h","hB","hb"],ID:["H"],IE:["H","h","hb","hB"],IL:["H","hB"],IM:["H","h","hb","hB"],IN:["h","H"],IO:["H","h","hb","hB"],IQ:["h","hB","hb","H"],IR:["hB","H"],IS:["H"],IT:["H","hB"],JE:["H","h","hb","hB"],JM:["h","hb","H","hB"],JO:["h","hB","hb","H"],JP:["H","K","h"],KE:["hB","hb","H","h"],KG:["H","h","hB","hb"],KH:["hB","h","H","hb"],KI:["h","hb","H","hB"],KM:["H","h","hB","hb"],KN:["h","hb","H","hB"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],KW:["h","hB","hb","H"],KY:["h","hb","H","hB"],KZ:["H","hB"],LA:["H","hb","hB","h"],LB:["h","hB","hb","H"],LC:["h","hb","H","hB"],LI:["H","hB","h"],LK:["H","h","hB","hb"],LR:["h","hb","H","hB"],LS:["h","H"],LT:["H","h","hb","hB"],LU:["H","h","hB"],LV:["H","hB","hb","h"],LY:["h","hB","hb","H"],MA:["H","h","hB","hb"],MC:["H","hB"],MD:["H","hB"],ME:["H","hB","h"],MF:["H","hB"],MG:["H","h"],MH:["h","hb","H","hB"],MK:["H","h","hb","hB"],ML:["H"],MM:["hB","hb","H","h"],MN:["H","h","hb","hB"],MO:["h","hB","hb","H"],MP:["h","hb","H","hB"],MQ:["H","hB"],MR:["h","hB","hb","H"],MS:["H","h","hb","hB"],MT:["H","h"],MU:["H","h"],MV:["H","h"],MW:["h","hb","H","hB"],MX:["h","H","hB","hb"],MY:["hb","hB","h","H"],MZ:["H","hB"],NA:["h","H","hB","hb"],NC:["H","hB"],NE:["H"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NI:["h","H","hB","hb"],NL:["H","hB"],NO:["H","h"],NP:["H","h","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],NZ:["h","hb","H","hB"],OM:["h","hB","hb","H"],PA:["h","H","hB","hb"],PE:["h","H","hB","hb"],PF:["H","h","hB"],PG:["h","H"],PH:["h","hB","hb","H"],PK:["h","hB","H"],PL:["H","h"],PM:["H","hB"],PN:["H","h","hb","hB"],PR:["h","H","hB","hb"],PS:["h","hB","hb","H"],PT:["H","hB"],PW:["h","H"],PY:["h","H","hB","hb"],QA:["h","hB","hb","H"],RE:["H","hB"],RO:["H","hB"],RS:["H","hB","h"],RU:["H"],RW:["H","h"],SA:["h","hB","hb","H"],SB:["h","hb","H","hB"],SC:["H","h","hB"],SD:["h","hB","hb","H"],SE:["H"],SG:["h","hb","H","hB"],SH:["H","h","hb","hB"],SI:["H","hB"],SJ:["H"],SK:["H"],SL:["h","hb","H","hB"],SM:["H","h","hB"],SN:["H","h","hB"],SO:["h","H"],SR:["H","hB"],SS:["h","hb","H","hB"],ST:["H","hB"],SV:["h","H","hB","hb"],SX:["H","h","hb","hB"],SY:["h","hB","hb","H"],SZ:["h","hb","H","hB"],TA:["H","h","hb","hB"],TC:["h","hb","H","hB"],TD:["h","H","hB"],TF:["H","h","hB"],TG:["H","hB"],TH:["H","h"],TJ:["H","h"],TL:["H","hB","hb","h"],TM:["H","h"],TN:["h","hB","hb","H"],TO:["h","H"],TR:["H","hB"],TT:["h","hb","H","hB"],TW:["hB","hb","h","H"],TZ:["hB","hb","H","h"],UA:["H","hB","h"],UG:["hB","hb","H","h"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],UY:["h","H","hB","hb"],UZ:["H","hB","h"],VA:["H","h","hB"],VC:["h","hb","H","hB"],VE:["h","H","hB","hb"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],VN:["H","h"],VU:["h","H"],WF:["H","hB"],WS:["h","H"],XK:["H","hB","h"],YE:["h","hB","hb","H"],YT:["H","hB"],ZA:["H","h","hb","hB"],ZM:["h","hb","H","hB"],ZW:["H","h"],"af-ZA":["H","h","hB","hb"],"ar-001":["h","hB","hb","H"],"ca-ES":["H","h","hB"],"en-001":["h","hb","H","hB"],"en-HK":["h","hb","H","hB"],"en-IL":["H","h","hb","hB"],"en-MY":["h","hb","H","hB"],"es-BR":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"gu-IN":["hB","hb","h","H"],"hi-IN":["hB","h","H"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],"kn-IN":["hB","h","H"],"ku-SY":["H","hB"],"ml-IN":["hB","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],"ta-IN":["hB","h","hb","H"],"te-IN":["hB","h","H"],"zu-ZA":["H","hB","hb","h"]};function vr(e){let t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}const r=e.language;let n;"root"!==r&&(n=e.maximize().region);return(br[n||""]||br[r||""]||br[`${r}-001`]||br["001"])[0]}const yr=new RegExp(`^${gr.source}*`),xr=new RegExp(`${gr.source}*$`);function wr(e,t){return{start:e,end:t}}const Sr=!!Object.fromEntries,kr=!!String.prototype.trimStart,Er=!!String.prototype.trimEnd,Cr=Sr?Object.fromEntries:function(e){const t={};for(const[r,n]of e)t[r]=n;return t},Nr=kr?function(e){return e.trimStart()}:function(e){return e.replace(yr,"")},Ar=Er?function(e){return e.trimEnd()}:function(e){return e.replace(xr,"")},jr=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class Pr{message;position;locale;ignoreTag;requiresOtherClause;shouldParseSkeletons;constructor(e,t={}){this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)}parseMessage(e,t,r){let n=[];for(;!this.isEOF();){const a=this.char();if(123===a){const t=this.parseArgument(e,r);if(t.err)return t;n.push(t.val)}else{if(125===a&&e>0)break;if(35!==a||"plural"!==t&&"selectordinal"!==t){if(60===a&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(fr.UNMATCHED_CLOSING_TAG,wr(this.clonePosition(),this.clonePosition()))}if(60===a&&!this.ignoreTag&&Tr(this.peek()||0)){const r=this.parseTag(e,t);if(r.err)return r;n.push(r.val)}else{const r=this.parseLiteral(e,t);if(r.err)return r;n.push(r.val)}}else{const e=this.clonePosition();this.bump(),n.push({type:rr.pound,location:wr(e,this.clonePosition())})}}}return{val:n,err:null}}parseTag(e,t){const r=this.clonePosition();this.bump();const n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:rr.literal,value:`<${n}/>`,location:wr(r,this.clonePosition())},err:null};if(this.bumpIf(">")){const a=this.parseMessage(e+1,t,!0);if(a.err)return a;const s=a.val,i=this.clonePosition();if(this.bumpIf("</")){if(this.isEOF()||!Tr(this.char()))return this.error(fr.INVALID_TAG,wr(i,this.clonePosition()));const e=this.clonePosition();return n!==this.parseTagName()?this.error(fr.UNMATCHED_CLOSING_TAG,wr(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:rr.tag,value:n,children:s,location:wr(r,this.clonePosition())},err:null}:this.error(fr.INVALID_TAG,wr(i,this.clonePosition())))}return this.error(fr.UNCLOSED_TAG,wr(r,this.clonePosition()))}return this.error(fr.INVALID_TAG,wr(r,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&_r(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){const r=this.clonePosition();let n="";for(;;){const r=this.tryParseQuote(t);if(r){n+=r;continue}const a=this.tryParseUnquoted(e,t);if(a){n+=a;continue}const s=this.tryParseLeftAngleBracket();if(!s)break;n+=s}const a=wr(r,this.clonePosition());return{val:{type:rr.literal,value:n,location:a},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Tr(e=this.peek()||0)||47===e)?null:(this.bump(),"<");var e}tryParseQuote(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();const t=[this.char()];for(this.bump();!this.isEOF();){const e=this.char();if(39===e){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;const r=this.char();return 60===r||123===r||35===r&&("plural"===t||"selectordinal"===t)||125===r&&e>0?null:(this.bump(),String.fromCodePoint(r))}parseArgument(e,t){const r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(fr.EMPTY_ARGUMENT,wr(r,this.clonePosition()));let n=this.parseIdentifierIfPossible().value;if(!n)return this.error(fr.MALFORMED_ARGUMENT,wr(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:rr.argument,value:n,location:wr(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(fr.MALFORMED_ARGUMENT,wr(r,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),r=function(e,t){return jr.lastIndex=t,jr.exec(e)[1]??""}(this.message,t),n=t+r.length;this.bumpTo(n);return{value:r,location:wr(e,this.clonePosition())}}parseArgumentOptions(e,t,r,n){let a=this.clonePosition(),s=this.parseIdentifierIfPossible().value,i=this.clonePosition();switch(s){case"":return this.error(fr.EXPECT_ARGUMENT_TYPE,wr(a,i));case"number":case"date":case"time":{this.bumpSpace();let e=null;if(this.bumpIf(",")){this.bumpSpace();const t=this.clonePosition(),r=this.parseSimpleArgStyleIfPossible();if(r.err)return r;const n=Ar(r.val);if(0===n.length)return this.error(fr.EXPECT_ARGUMENT_STYLE,wr(this.clonePosition(),this.clonePosition()));e={style:n,styleLocation:wr(t,this.clonePosition())}}const t=this.tryParseArgumentClose(n);if(t.err)return t;const a=wr(n,this.clonePosition());if(e&&e.style.startsWith("::")){let t=Nr(e.style.slice(2));if("number"===s){const n=this.parseNumberSkeletonFromString(t,e.styleLocation);return n.err?n:{val:{type:rr.number,value:r,location:a,style:n.val},err:null}}{if(0===t.length)return this.error(fr.EXPECT_DATE_TIME_SKELETON,a);let n=t;this.locale&&(n=function(e,t){let r="";for(let n=0;n<e.length;n++){const a=e.charAt(n);if("j"===a){let s=0;for(;n+1<e.length&&e.charAt(n+1)===a;)s++,n++;let i=1+(1&s),o=s<2?1:3+(s>>1),c="a",l=vr(t);for("H"!=l&&"k"!=l||(o=0);o-- >0;)r+=c;for(;i-- >0;)r=l+r}else r+="J"===a?"H":a}return r}(t,this.locale));const i={type:nr.dateTime,pattern:n,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?Ht(n):{}};return{val:{type:"date"===s?rr.date:rr.time,value:r,location:a,style:i},err:null}}}return{val:{type:"number"===s?rr.number:"date"===s?rr.date:rr.time,value:r,location:a,style:e?.style??null},err:null}}case"plural":case"selectordinal":case"select":{const a=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(fr.EXPECT_SELECT_ARGUMENT_OPTIONS,wr(a,{...a}));this.bumpSpace();let i=this.parseIdentifierIfPossible(),o=0;if("select"!==s&&"offset"===i.value){if(!this.bumpIf(":"))return this.error(fr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,wr(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(fr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,fr.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),i=this.parseIdentifierIfPossible(),o=e.val}const c=this.tryParsePluralOrSelectOptions(e,s,t,i);if(c.err)return c;const l=this.tryParseArgumentClose(n);if(l.err)return l;const u=wr(n,this.clonePosition());return"select"===s?{val:{type:rr.select,value:r,options:Cr(c.val),location:u},err:null}:{val:{type:rr.plural,value:r,options:Cr(c.val),offset:o,pluralType:"plural"===s?"cardinal":"ordinal",location:u},err:null}}default:return this.error(fr.INVALID_ARGUMENT_TYPE,wr(a,i))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(fr.EXPECT_ARGUMENT_CLOSING_BRACE,wr(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0;const t=this.clonePosition();for(;!this.isEOF();){switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil("'"))return this.error(fr.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,wr(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let r=[];try{r=function(e){if(0===e.length)throw new Error("Number skeleton cannot be empty");const t=e.split(Gt).filter(e=>e.length>0),r=[];for(const e of t){let t=e.split("/");if(0===t.length)throw new Error("Invalid number skeleton");const[n,...a]=t;for(const e of a)if(0===e.length)throw new Error("Invalid number skeleton");r.push({stem:n,options:a})}return r}(e)}catch{return this.error(fr.INVALID_NUMBER_SKELETON,t)}return{val:{type:nr.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?tr(r):{}},err:null}}tryParsePluralOrSelectOptions(e,t,r,n){let a=!1;const s=[],i=new Set;let{value:o,location:c}=n;for(;;){if(0===o.length){const e=this.clonePosition();if("select"===t||!this.bumpIf("="))break;{const t=this.tryParseDecimalInteger(fr.EXPECT_PLURAL_ARGUMENT_SELECTOR,fr.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;c=wr(e,this.clonePosition()),o=this.message.slice(e.offset,this.offset())}}if(i.has(o))return this.error("select"===t?fr.DUPLICATE_SELECT_ARGUMENT_SELECTOR:fr.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===o&&(a=!0),this.bumpSpace();const n=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?fr.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:fr.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,wr(this.clonePosition(),this.clonePosition()));const l=this.parseMessage(e+1,t,r);if(l.err)return l;const u=this.tryParseArgumentClose(n);if(u.err)return u;s.push([o,{value:l.val,location:wr(n,this.clonePosition())}]),i.add(o),this.bumpSpace(),({value:o,location:c}=this.parseIdentifierIfPossible())}return 0===s.length?this.error("select"===t?fr.EXPECT_SELECT_ARGUMENT_SELECTOR:fr.EXPECT_PLURAL_ARGUMENT_SELECTOR,wr(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(fr.MISSING_OTHER_CLAUSE,wr(this.clonePosition(),this.clonePosition())):{val:s,err:null}}tryParseDecimalInteger(e,t){let r=1;const n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(r=-1);let a=!1,s=0;for(;!this.isEOF();){const e=this.char();if(!(e>=48&&e<=57))break;a=!0,s=10*s+(e-48),this.bump()}const i=wr(n,this.clonePosition());return a?(s*=r,Number.isSafeInteger(s)?{val:s,err:null}:this.error(t,i)):this.error(e,i)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");const t=this.message.codePointAt(e);if(void 0===t)throw Error(`Offset ${e} is at invalid UTF-16 code unit boundary`);return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;const e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){const t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error(`targetOffset ${e} must be greater than or equal to the current offset ${this.offset()}`);for(e=Math.min(e,this.message.length);;){const t=this.offset();if(t===e)break;if(t>e)throw Error(`targetOffset ${e} is at invalid UTF-16 code unit boundary`);if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&Rr(this.char());)this.bump()}peek(){if(this.isEOF())return null;const e=this.char(),t=this.offset();return this.message.charCodeAt(t+(e>=65536?2:1))??null}}function Tr(e){return e>=97&&e<=122||e>=65&&e<=90}function _r(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Rr(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Dr(e){e.forEach(e=>{if(delete e.location,lr(e)||ur(e))for(const t in e.options)delete e.options[t].location,Dr(e.options[t].value);else ir(e)&&mr(e.style)||(or(e)||cr(e))&&hr(e.style)?delete e.style.location:pr(e)&&Dr(e.children)})}function Ir(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const r=new Pr(e,t).parse();if(r.err){const e=SyntaxError(fr[r.err.kind]);throw e.location=r.err.location,e.originalMessage=r.err.message,e}return t?.captureLocation||Dr(r.val),r.val}let Ur=function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e}({});class Mr extends Error{code;originalMessage;constructor(e,t,r){super(e),this.code=t,this.originalMessage=r}toString(){return`[formatjs Error: ${this.code}] ${this.message}`}}class Lr extends Mr{constructor(e,t,r,n){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(r).join('", "')}"`,Ur.INVALID_VALUE,n)}}class Or extends Mr{constructor(e,t,r){super(`Value for "${e}" must be of type ${t}`,Ur.INVALID_VALUE,r)}}class zr extends Mr{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,Ur.MISSING_VALUE,t)}}let Fr=function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e}({});function Br(e){return"function"==typeof e}function Wr(e,t,r,n,a,s,i){if(1===e.length&&ar(e[0]))return[{type:Fr.literal,value:e[0].value}];const o=[];for(const c of e){if(ar(c)){o.push({type:Fr.literal,value:c.value});continue}if(dr(c)){"number"==typeof s&&o.push({type:Fr.literal,value:r.getNumberFormat(t).format(s)});continue}const{value:e}=c;if(!a||!(e in a))throw new zr(e,i);let l=a[e];if(sr(c))l&&"string"!=typeof l&&"number"!=typeof l&&"bigint"!=typeof l||(l="string"==typeof l||"number"==typeof l||"bigint"==typeof l?String(l):""),o.push({type:"string"==typeof l?Fr.literal:Fr.object,value:l});else{if(or(c)){const e="string"==typeof c.style?n.date[c.style]:hr(c.style)?c.style.parsedOptions:void 0;o.push({type:Fr.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(cr(c)){const e="string"==typeof c.style?n.time[c.style]:hr(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:Fr.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(ir(c)){const e="string"==typeof c.style?n.number[c.style]:mr(c.style)?c.style.parsedOptions:void 0;if(e&&e.scale){const t=e.scale||1;if("bigint"==typeof l){if(!Number.isInteger(t))throw new TypeError(`Cannot apply fractional scale ${t} to bigint value. Scale must be an integer when formatting bigint.`);l*=BigInt(t)}else l*=t}o.push({type:Fr.literal,value:r.getNumberFormat(t,e).format(l)});continue}if(pr(c)){const{children:e,value:l}=c,u=a[l];if(!Br(u))throw new Or(l,"function",i);let d=u(Wr(e,t,r,n,a,s).map(e=>e.value));Array.isArray(d)||(d=[d]),o.push(...d.map(e=>({type:"string"==typeof e?Fr.literal:Fr.object,value:e})))}if(lr(c)){const e=l,s=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!s)throw new Lr(c.value,l,Object.keys(c.options),i);o.push(...Wr(s.value,t,r,n,a));continue}if(ur(c)){const e=`=${l}`;let s=Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0;if(!s){if(!Intl.PluralRules)throw new Mr('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Ur.MISSING_INTL_API,i);const e="bigint"==typeof l?Number(l):l,n=r.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));s=(Object.prototype.hasOwnProperty.call(c.options,n)?c.options[n]:void 0)||c.options.other}if(!s)throw new Lr(c.value,l,Object.keys(c.options),i);const u="bigint"==typeof l?Number(l):l;o.push(...Wr(s.value,t,r,n,a,u-(c.offset||0)));continue}}}return(c=o).length<2?c:c.reduce((e,t)=>{const r=e[e.length-1];return r&&r.type===Fr.literal&&t.type===Fr.literal?r.value+=t.value:e.push(t),e},[]);var c}function Vr(e,t){return t?Object.keys(e).reduce((r,n)=>{var a,s;return r[n]=(a=e[n],(s=t[n])?{...a,...s,...Object.keys(a).reduce((e,t)=>(e[t]={...a[t],...s[t]},e),{})}:a),r},{...e}):e}function Hr(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}class Gr{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(e,t=Gr.defaultLocale,r,n){if(this.locales=t,this.resolvedLocale=Gr.resolveLocale(t),"string"==typeof e){if(this.message=e,!Gr.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...t}=n||{};this.ast=Gr.__parse(e,{...t,locale:this.resolvedLocale})}else this.ast=e;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=Vr(Gr.formats,r),this.formatters=n&&n.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:It((...e)=>new Intl.NumberFormat(...e),{cache:Hr(e.number),strategy:Wt.variadic}),getDateTimeFormat:It((...e)=>new Intl.DateTimeFormat(...e),{cache:Hr(e.dateTime),strategy:Wt.variadic}),getPluralRules:It((...e)=>new Intl.PluralRules(...e),{cache:Hr(e.pluralRules),strategy:Wt.variadic})}}(this.formatterCache)}format=e=>{const t=this.formatToParts(e);if(1===t.length)return t[0].value;const r=t.reduce((e,t)=>(e.length&&t.type===Fr.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e),[]);return r.length<=1?r[0]||"":r};formatToParts=e=>Wr(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message);resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]});getAst=()=>this.ast;static memoizedDefaultLocale=null;static get defaultLocale(){return Gr.memoizedDefaultLocale||(Gr.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),Gr.memoizedDefaultLocale}static resolveLocale=e=>{if(void 0===Intl.Locale)return;const t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale("string"==typeof e?e:e[0])};static __parse=Ir;static formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}}}const $r={settings:{titles:{profile:"Account",general:"Workspace Settings",users:"Workspace Members",subscription:"Plan & Billing",usage:"Usage",features:"Workspace Features",notifications:"Notifications",danger:"Danger Zone"},sidebar:{account:"Account",workspace:"Workspace",profile:"Account",general:"Settings",users:"Members",subscription:"Plan & Billing",usage:"Usage",features:"Features",notifications:"Notifications",danger:"Danger Zone"},common:{refresh:"Refresh",refreshing:"Refreshing...",retry:"Retry",retrying:"Retrying...",save:"Save",saving:"Saving...",cancel:"Cancel",delete:"Delete",dismiss:"Dismiss",loading:"Loading...",success:"Success!",error:"Error",refreshAction:"{loading, select, true {Refreshing...} other {Refresh}}",retryAction:"{loading, select, true {Retrying...} other {Retry}}"}},subscription:{managePlan:"Manage your plan and billing",changePlan:"Change Plan",viewPricingPlans:"View Pricing Plans",viewPlans:"View Plans",upgradePlan:"Upgrade Now",subscribe:"Subscribe",currentPlan:"Current Plan",noSubscription:"You don't have an active subscription",choosePlan:"Choose Your Plan",choosePlanDescription:"Compare plans and select the one that fits your needs",planUpdateAvailable:"Plan update available",updateSuccess:"Subscription updated successfully!",updateFailed:"Update failed",cancelTitle:"Cancel Subscription",cancelConfirm:"Are you sure you want to cancel your subscription?",cancelKeep:"Keep Subscription",cancelButton:"Yes, Cancel Subscription",canceling:"Canceling...",cancelSuccess:"Subscription will be canceled at the end of the billing period.",cancelNotCharged:"You won't be charged again after cancellation",cancelResumeAnytime:"You can resume your subscription anytime before it ends",resumeTitle:"Resume Subscription",resumeConfirm:"Are you sure you want to resume your subscription?",resumeKeep:"Keep Canceled",resumeButton:"Yes, Resume Subscription",resuming:"Resuming...",resumeSuccess:"Subscription has been resumed.",managePayment:"Manage Payment",openingPortal:"Opening...",viewAllPlans:"View All Plans",scheduledCancellation:"Subscription scheduled for cancellation",paymentPastDue:"Payment past due",paymentPastDueDescription:"Please update your payment method to avoid service interruption.",subscriptionPaused:"Subscription paused",subscriptionPausedDescription:"Your subscription is currently paused. Resume to restore full access.",errorLoading:"Error loading subscription data",errorLoadingDescription:"Please check your connection and try again.",errorProcessing:"Failed to process subscription",errorCanceling:"Failed to cancel subscription",errorResuming:"Failed to resume subscription",invalidWorkspace:"Invalid workspace ID",billingInterval:{monthly:"Monthly",quarterly:"Quarterly",yearly:"Yearly",perMonth:"/month",perQuarter:"/quarter",perYear:"/year"},seats:{title:"Seats",members:"Members",included:"Included",billable:"Billable",perExtraSeat:"Per extra seat",limit:"Limit",includedSeats:"Included seats",maxSeats:"Max seats",freeWithBase:"Free with base price",allIncluded:"All included",extra:"extra",unlimited:"Unlimited"},items:{features:"Features",limits:"Limits",quotas:"Usage Quotas"},checkout:{upgrade:"Upgrade",downgrade:"Downgrade",switchTo:"Switch to",select:"Select"},status:{active:"Active",canceling:"Canceling",trial:"Trial",canceled:"Canceled",pastDue:"Past Due",paused:"Paused",deprecated:"Deprecated",unknown:"Unknown"},plan:"Plan",invoicesTab:"Invoices",changePlanButton:"Change Plan",noPlanAssigned:"No plan assigned",free:"Free",perSeatDisplay:"+ {price}/seat{interval}",estTotalDisplay:"Est. total: {total}{interval} ({count, plural, one {# extra seat} other {# extra seats}})",nextBillingDisplay:"Next billing: {date}",membersInWorkspace:"{count, plural, one {# member} other {# members}} in workspace",billingInCurrency:"Billing in {currency}",savingsPercent:"Save {percent, number}%",switchToInterval:"Switch to {interval}",seatPriceDisplay:"+ {price}/seat{interval} ({included} {includedLabel})",trialEnded:"Your trial has ended.",trialEndsIn:"Your trial ends in {days, plural, one {# day} other {# days}}.",onTrial:"You are on a trial.",upgradeToKeepAccess:"Upgrade to keep access.",viewInvoices:"View Invoices",cancelTrial:"Cancel Trial",dunningFinal:"Final warning: Subscription will be suspended",dunningSuspended:"Subscription suspended",dunningRecovery:"Payment recovery in progress",dunningSuspendedDescription:"Your subscription has been suspended due to repeated payment failures. Update your payment method to restore access.",dunningRecoveryDescription:"We were unable to process your payment. Please update your payment method to avoid losing access.",cancelEndDescription:"Your subscription will end on",cancelEndFallback:"Your subscription will be canceled at the end of the current billing period. You won't be charged again.",resumeChargeDate:"You will be charged again on",resumeChargeFallback:"the next billing date",resumeContinue:"Your subscription will continue automatically and you'll be billed according to your plan",resumeCancelAnytime:"You can cancel anytime before the next billing date if you change your mind",retainAccess:"You'll retain full access to this plan until",retainAccessFallback:"the end of your current billing period",noPlansAvailable:"No plan groups are available for this workspace. Please contact support if you believe this is an error.",noPlansAvailableHint:"No plan groups are available for this workspace.",startTrialDescription:"Try the full plan with no commitment. You can upgrade or cancel anytime.",noSubscriptionDescription:"Choose a plan to get started with your workspace",startFreeTrial:"Start Free Trial"},users:{title:"Workspace Members",adminOnly:"Only workspace admin can manage users and roles.",inviteByEmail:"Invite member by email",inviteButton:"Invite",inviting:"Inviting...",inviteSuccess:"User invited successfully",emailRequired:"Email is required",invalidEmail:"Invalid email address format",inviteFailed:"Failed to invite member",seatLimitReached:"Seat limit reached",memberLimitReached:"Member limit reached",role:"Role",you:"You",owner:"Owner",noMembers:"No members found in this workspace.",extraSeatCost:"Each additional member adds {price}/{interval, select, yearly {yr} quarterly {qtr} other {mo}} to your subscription",unknownUser:"Unknown User",seats:"Seats",members:"Members",included:"included",perExtraSeat:"/extra seat",maxMembers:"max members",available:"available",noMemberLimit:"No member limit",seatHeading:"{hasSeatPricing, select, true {Seats} other {Members}}",limitReached:"{reason, select, seat_limit_reached {Seat limit reached} other {Member limit reached}}",memberCount:"{count, plural, one {# member} other {# members}}",subscriptionRequired:"A subscription is required to invite members.",seatLimitMessage:"Your plan allows up to {maxUsers, number} members. Upgrade for more seats.",settingsLimitMessage:"This workspace allows up to {maxUsers, number} members.",memberLimitMessage:"Member limit of {maxUsers, number} reached.",selectRole:"Select a role",inviteAs:"Invite as {role}"},invoices:{title:"Billing History",description:"View and download your invoices",pay:"Pay",view:"View",viewDetails:"View Details",download:"PDF",errorLoading:"Error loading invoices",noInvoices:"No invoices yet. Subscribe to a plan to receive invoices.",noInvoicesWithSub:"No invoices with download option found",paidAmount:"Paid: {amount}",na:"N/A",status:{draft:"Draft",open:"Open",paid:"Paid",uncollectible:"Uncollectible",void:"Void"}},usage:{title:"Usage",description:"Monitor your resource consumption and quotas",totalResources:"Total Resources",overallUsage:"Overall Usage",inOverage:"In Overage",estOverageCost:"Est. Overage Cost",overageDetected:"Overage Detected",overageDescription:"Additional usage will be billed as overage on your next invoice.",overageUnits:"Overage units",rate:"Rate",billableBlocks:"Billable blocks",estimatedCharge:"Estimated charge",noData:"No quota usage data available for this workspace.",noDataHint:"Quotas will appear here once your plan includes metered resources.",used:"used",remaining:"remaining",overLimit:"over limit",percentUsed:"{percent, number}% used",availableRemaining:"{count} remaining",overLimitCount:"{count} over limit",overageWarning:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}} Additional usage will be billed as overage on your next invoice.",fullyUsed:"Fully used",renewingSoon:"renewing soon",almostFull:"Almost full",overage:"Overage",errorLoading:"Failed to load usage data",perUnit:"/ unit",perUnits:"/ units",rateDisplay:"{rate} {unitSize, plural, =1 {/ unit} other {/ {unitSize, number} units}}",resourcesExceeded:"{count, plural, one {# resource has exceeded the included quota.} other {# resources have exceeded the included quota.}}",estOverageCharges:"Estimated overage charges this period: {amount}",overageRateDisplay:"Overage rate: {rate}",resetDateDisplay:"Usage resets on {date}",daysRemainingDisplay:"{count, plural, one {# day remaining} other {# days remaining}}"},profile:{email:"Email",name:"Name",language:"Language",country:"Country",currency:"Currency",timezone:"Timezone",profileImage:"Profile Image",success:"Profile saved successfully",nameMinLength:"Name must be at least 2 characters.",save:"Save",reset:"Reset"},general:{ownerOnly:"Only the workspace owner can change the workspace settings.",name:"Name",namePlaceholder:"My Awesome Workspace",nameMinLength:"Workspace name must be at least 2 characters.",billingCurrency:"Billing currency",icon:"Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",previewLabel:"Preview:",success:"Workspace settings saved successfully",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",updateWorkspace:"Update Workspace"},features:{title:"Workspace Features",ownerOnly:"Only the workspace owner can change the features.",noFeatures:"Workspace has no features to manage.",enabled:"enabled",disabled:"disabled",enabling:"Enabling",disabling:"Disabling",featureSuccess:"successfully",updateSuccess:"{feature} {enabled, select, true {enabled} other {disabled}} successfully",actionStatus:"{action, select, enabling {Enabling} disabling {Disabling} other {}}"},danger:{title:"Delete Workspace",adminOnly:"Only workspace admins can delete workspaces.",deleteWorkspace:"Delete Workspace",deleteConfirm:"Are you absolutely sure?",deleteWarning:"This action cannot be undone. This will permanently delete the workspace and all associated data.",deleting:"Deleting...",deleteDescription:"Once you delete a workspace, there is no going back. This will permanently delete the workspace and all of its data, including members, settings, and features.",deleteConfirmDescription:"This action cannot be undone. This will permanently delete the workspace and all of its data.",failedToDelete:"Failed to delete workspace"},notifications:{title:"Notification Preferences",permissionDenied:"Notification permission denied",notSupported:"Push notifications are not supported in this browser.",manageDescription:"Manage how you receive notifications from this workspace.",blocked:"Notifications Blocked",blockedDescription:"You previously blocked notifications for this site. To enable them, update your browser settings:",pushTitle:"Push Notifications",pushEnabledDescription:"You will receive browser notifications for important updates.",pushDisabledDescription:"Get notified about payment issues, trial expiry, and other important updates.",enabling:"Enabling...",disabling:"Disabling...",enable:"Enable",disable:"Disable",toggleAction:"{loading, select, true {{subscribed, select, true {Disabling...} other {Enabling...}}} other {{subscribed, select, true {Disable} other {Enable}}}}",pushDescription:"{subscribed, select, true {You will receive browser notifications for important updates.} other {Get notified about payment issues, trial expiry, and other important updates.}}",deviceNote:"Notifications are sent to this device. Enable on other devices separately.",unblock:{firefox:{step1:"Click the lock icon (or shield icon) in the address bar",step2:'Find "Notifications" in the permissions list',step3:'Change from "Blocked" to "Allow"',step4:"Reload this page"},safari:{step1:"Open Safari → Settings → Websites → Notifications",step2:"Find this website in the list",step3:'Change from "Deny" to "Allow"',step4:"Reload this page"},edge:{step1:"Click the lock icon in the address bar",step2:'Click "Permissions for this site"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"},chrome:{step1:"Click the lock icon (or tune icon) in the address bar",step2:'Click "Site settings"',step3:'Set "Notifications" to "Allow"',step4:"Reload this page"}}},quota:{includedOnly:"{count, number} included",includedWithOverage:"{count, number} included, then {price} / {unit}",unitFallback:"unit"},pricing:{title:"Choose Your Plan",description:"Compare plans and select the one that fits your needs",currency:"Currency",billingIn:"Billing in",noPlansCurrency:"No plans available for your billing currency.",noPlansCurrencyHint:"Something went wrong. Please contact support.",noPlans:"No plans available",free:"Free",included:"included",save:"Save",current:"Current",processing:"Processing...",unavailable:"Unavailable",selectCurrency:"Select billing currency",billingInterval:"Billing interval"},beta:{nameLabel:"Name",emailLabel:"Email",submitText:"Submit",submittingText:"Submitting...",errorMessage:"An error occurred",tryAgain:"Try Again",privacyConsent:"By submitting this form, you consent to our",privacyPolicy:"Privacy Policy",and:"and",termsOfService:"Terms of Service"},workspace:{switchTitle:"Switch Workspace",switchDescription:"Select a workspace to switch to or create a new one.",notLoggedIn:"Looks like you are not logged in. Please login to continue.",availableWorkspaces:"Available Workspaces ({count, number})",loadingWorkspaces:"Loading workspaces...",searchPlaceholder:"Search workspaces...",noWorkspacesFound:"No workspaces found",noWorkspacesAvailable:"No workspaces available",switchTo:"Switch to",membersCount:"{count, plural, one {# member} other {# members}}",createNew:"Create New Workspace",createTitle:"Create New Workspace",createDescription:"Create a new workspace to get started.",workspaceName:"Workspace Name",workspaceNamePlaceholder:"My Awesome Workspace",workspaceNameMinLength:"Workspace name must be at least 2 characters.",workspaceIcon:"Workspace Icon",iconDescription:"Choose an emoji or upload a custom image for your workspace.",chooseEmoji:"Choose Emoji",customImageUrl:"Custom Image URL",imageUrl:"Image URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"Enter a valid URL for your workspace image. Supports PNG, JPG, and SVG formats.",invalidUrl:"Please enter a valid URL",creating:"Creating...",createWorkspace:"Create Workspace"},dropdowns:{search:"Search...",chooseOption:"Choose option",chooseCountry:"Choose country",searchCountry:"Choose country...",chooseLanguage:"Choose language",searchLanguage:"Choose language...",chooseCurrency:"Choose currency",searchCurrency:"Choose currency...",chooseTimezone:"Choose timezone",searchTimezone:"Choose timezone..."},push:{failedToSubscribe:"Failed to subscribe to push notifications",failedToUnsubscribe:"Failed to unsubscribe from push notifications"},errors:{networkError:"Network error: Please check your internet connection",unauthorized:"Unauthorized - Please check your session",notFound:"Resource not found",generic:"An error occurred",fetchPlans:"Failed to fetch plans",fetchPlanGroup:"Failed to fetch plan group",fetchPlanGroupVersion:"Failed to fetch plan group version",fetchPlanGroupVersions:"Failed to fetch plan group versions",fetchSubscription:"Failed to fetch subscription",createCheckout:"Failed to create checkout session",updateSubscription:"Failed to update subscription",fetchInvoices:"Failed to fetch invoices",fetchInvoice:"Failed to fetch invoice",openBillingPortal:"Failed to open billing portal",cancelSubscription:"Failed to cancel subscription",resumeSubscription:"Failed to resume subscription",recordUsage:"Failed to record usage",fetchQuotaUsage:"Failed to fetch quota usage status",fetchAllQuotaUsage:"Failed to fetch all quota usage",fetchUsageLogs:"Failed to fetch usage logs"}},Kr={en:async()=>$r,es:async()=>(await Promise.resolve().then(function(){return FE})).es,fr:async()=>(await Promise.resolve().then(function(){return BE})).fr,de:async()=>(await Promise.resolve().then(function(){return WE})).de,ja:async()=>(await Promise.resolve().then(function(){return VE})).ja,zh:async()=>(await Promise.resolve().then(function(){return HE})).zh,hi:async()=>(await Promise.resolve().then(function(){return GE})).hi,ar:async()=>(await Promise.resolve().then(function(){return $E})).ar},qr=["en","es","fr","de","ja","zh","hi","ar"];const Zr={hi:"hi-u-nu-deva",ar:"ar-u-nu-arab"};const Jr=t.createContext({messages:$r,locale:"en",formattingLocale:"en"});function Yr({locale:e="en",children:r}){const n=function(e){const t=e.toLowerCase().replace("_","-");if(qr.includes(t))return t;const r=t.split("-")[0];return qr.includes(r)?r:"en"}(e),[a,s]=t.useState($r);t.useEffect(()=>{if("en"===n)return void s($r);let e=!1;const t=Kr[n];return t&&t().then(t=>{e||s(t)}),()=>{e=!0}},[n]);const i=function(e){return Zr[e]??e}(n),o=t.useMemo(()=>({messages:a,locale:n,formattingLocale:i}),[a,n,i]);return t.createElement(Jr.Provider,{value:o},r)}const Xr=new Map,Qr=new Map,en=new Map;function tn(e,t){return t?`${e}:${JSON.stringify(t)}`:e}const rn={getNumberFormat(e,t){const r=tn(e,t);let n=Xr.get(r);return n||(n=new Intl.NumberFormat(e,t),Xr.set(r,n)),n},getDateTimeFormat(e,t){const r=tn(e,t);let n=Qr.get(r);return n||(n=new Intl.DateTimeFormat(e,t),Qr.set(r,n)),n},getPluralRules(e,t){const r=tn(e,t);let n=en.get(r);return n||(n=new Intl.PluralRules(e,t),en.set(r,n)),n}},nn=new Map;function an(){const{messages:e,locale:r,formattingLocale:n}=t.useContext(Jr),a=t.useMemo(()=>(t,r)=>{const a=t.split(".");let s=e;for(const e of a){if(!s||"object"!=typeof s||!(e in s))return t;s=s[e]}const i="string"==typeof s?s:t;if(!r)return i;try{const e=function(e,t){const r=`${t}:${e}`;let n=nn.get(r);return n||(n=new Gr(e,t,void 0,{formatters:rn}),nn.set(r,n)),n}(i,n),t=e.format(r);return"string"==typeof t?t:String(t)}catch{return i.replace(/\{(\w+)\}/g,(e,t)=>String(r[t]??`{${t}}`))}},[e,n]),s="ar"===r?"rtl":"ltr",i=t.useMemo(()=>e=>e.toLocaleString(n),[n]),o=t.useMemo(()=>(e,t)=>{const r=(t??"").trim().toUpperCase();if(!r)return(e/100).toLocaleString(n,{minimumFractionDigits:2});try{return new Intl.NumberFormat(n,{style:"currency",currency:r,minimumFractionDigits:2}).format(e/100)}catch{return(e/100).toLocaleString(n,{minimumFractionDigits:2})}},[n]);return{t:a,locale:r,formattingLocale:n,dir:s,fmtNum:i,fmtCents:o,messages:e}}function sn(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return Re(t,{component:"storage",action:"getStorageItem",metadata:{key:e}}),null}}function on(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){Re(t,{component:"storage",action:"setStorageItem",metadata:{key:e}})}}function cn(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){Re(t,{component:"storage",action:"removeStorageItem",metadata:{key:e}})}}const ln="saas-session-id",un="code";function dn(e){on(ln,e)}function pn(){return function(){if("undefined"==typeof window)return null;try{return sn(ln)}catch(e){return Re(e,{component:"auth-utils",action:"getSessionId",metadata:{key:ln}}),null}}()}function mn(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(un)}catch(e){return Re(e,{component:"auth-utils",action:"getTokenFromUrl",metadata:{param:un}}),null}}const hn="SDK is not ready (missing serverUrl, version, or orgId)";class fn{constructor(e){this.serverUrl=e.serverUrl,this.version=e.version,this.orgId=e.orgId,this.requireOrgId=e.requireOrgId??!1,this.basePath=e.basePath??"public",this._sessionId=e.sessionId,this._timeout=e.timeout??3e4,this._maxRetries=e.maxRetries??0,this._debug=e.debug??!1,this._customHeaders=e.headers??{},this._onError=e.onError,this._fetch=e.fetch??globalThis.fetch}ensureReady(){if(!this.serverUrl?.trim()||!this.version)throw new Error(hn);if(this.requireOrgId&&!this.orgId?.trim())throw new Error(hn)}get baseUrl(){return this.ensureReady(),`${this.serverUrl}/api/${this.version}/${this.basePath}`}getAuthHeaders(){return this._sessionId?{"x-session-id":this._sessionId}:function(){const e=pn(),t={};return e&&(t["x-session-id"]=e),t}()}url(e){const t=e.startsWith("/")?e.slice(1):e;return`${this.baseUrl.endsWith("/")?this.baseUrl.slice(0,-1):this.baseUrl}/${t}`}buildHeaders(e){const t={...this._customHeaders,...this.getAuthHeaders()};return e.headers&&Object.assign(t,e.headers),null==e.body||t["Content-Type"]||(t["Content-Type"]="application/json"),t}async executeFetch(e,t){const r=this.url(e),n=(t.method??"GET").toUpperCase(),a=this.buildHeaders(t),s={...t,headers:a};let i;if(this._timeout>0){const e=new AbortController;i=setTimeout(()=>e.abort(),this._timeout),s.signal=t.signal?AbortSignal.any([t.signal,e.signal]):e.signal}const o=async t=>{try{const e=this._fetch.bind(globalThis),a=await e(r,s);if(this._debug&&console.log(`[BuildBase] ${n} ${r} → ${a.status}`),a.status>=500&&t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}return a}catch(r){if(r instanceof Error&&"AbortError"===r.name){if(void 0!==i){const t=new Error(`Request timeout after ${this._timeout}ms: ${n} ${e}`);throw this._onError?.(t,{method:n,path:e}),t}throw r}if(t<this._maxRetries){const e=Math.min(1e3*Math.pow(2,t),1e4);return this._debug&&console.log(`[BuildBase] Network error, retrying in ${e}ms (attempt ${t+1}/${this._maxRetries})`),await new Promise(t=>setTimeout(t,e)),o(t+1)}throw r instanceof Error&&this._onError?.(r,{method:n,path:e}),r}};try{return await o(0)}finally{void 0!==i&&clearTimeout(i)}}async fetchJson(e,t={},r="Request failed"){this.ensureReady();try{const n=await this.executeFetch(e,t);return await Pe(n,r)}catch(r){throw r instanceof Error&&this._onError?.(r,{method:(t.method??"GET").toUpperCase(),path:e}),r}}async fetchResponse(e,t={}){return this.ensureReady(),this.executeFetch(e,t)}}class gn extends fn{constructor(e){super({...e,requireOrgId:!0})}async getWorkspaces(){return this.fetchJson("workspaces",{},"Failed to fetch workspaces")}async createWorkspace(e){return this.fetchJson("workspaces",{method:"POST",body:JSON.stringify(e)},"Failed to create workspace")}async updateWorkspace(e,t){return this.fetchJson(`workspaces/${e}`,{method:"PUT",body:JSON.stringify(t)},"Failed to update workspace")}async deleteWorkspace(e){return this.fetchJson(`workspaces/${e}`,{method:"DELETE"},"Failed to delete workspace")}async getWorkspaceUsers(e){return this.fetchJson(`workspaces/${e}/users`,{},"Failed to fetch workspace users")}async addUser(e,t){return this.fetchJson(`workspaces/${e}/users/add`,{method:"POST",body:JSON.stringify(t)},"Failed to invite member")}async removeUser(e,t){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"DELETE"},"Failed to remove user")}async updateUser(e,t,r){return this.fetchJson(`workspaces/${e}/users/${t}`,{method:"PATCH",body:JSON.stringify(r)},"Failed to update user")}async getFeatures(){return this.fetchJson("workspaces/features",{},"Failed to fetch features")}async updateFeature(e,t,r){return this.fetchJson(`workspaces/${e}/features`,{method:"PATCH",body:JSON.stringify({features:{[t]:r}})},"Failed to update feature")}async getWorkspace(e){return this.fetchJson(`workspaces/${e}`,{},"Failed to fetch workspace")}async getProfile(){return this.fetchJson("profile",{},"Failed to fetch profile")}async updateUserProfile(e){return this.fetchJson("profile",{method:"PATCH",body:JSON.stringify(e)},"Failed to update user profile")}async getCurrentSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription`);if(!t.ok){let e="Failed to fetch subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch subscription");return r.data||r}return r}async getPlanGroup(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group`);if(!t.ok){let e="Failed to fetch plan group";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group found for this workspace":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group");return r.data||r}return r}async getPlanGroupByVersion(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/plan-group?groupVersionId=${encodeURIComponent(t)}`);if(!r.ok){let e="Failed to fetch plan group version";try{e=(await r.json()).message||e}catch{e=404===r.status?"Plan group version not found":401===r.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch plan group version");return n.data||n}return n}async getPlanGroupVersions(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group/versions`);if(!t.ok){let e="Failed to fetch plan group versions";try{e=(await t.json()).message||e}catch{e=404===t.status?"No plan group versions found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group versions (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group versions");return r.data||r}return r}async getPublicPlans(e){if(!this.orgId)throw new Error("orgId is required for getPublicPlans");const t=await this.fetchResponse(`${this.orgId}/plans/${encodeURIComponent(e)}`);if(!t.ok){let r="Failed to fetch plans";try{r=(await t.json()).message||r}catch{r=404===t.status?`Plans "${e}" not found`:`Failed to fetch plans (${t.status}: ${t.statusText})`}throw new Error(r)}const r=await t.json();if(void 0!==r.success&&!r.success)throw new Error(r.message||"Failed to fetch plans");return r.data??r}async getPlanGroupVersion(e){const t=await this.fetchResponse(`plan-group-versions/${e}`);if(!t.ok){let e="Failed to fetch plan group version";try{e=(await t.json()).message||e}catch{e=404===t.status?"Plan group version not found":401===t.status?"Unauthorized - Please check your session":`Failed to fetch plan group version (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch plan group version");return r.data||r}return r}async createCheckoutSession(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/checkout`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to create checkout session";try{e=(await r.json()).message||e}catch{e=`Failed to create checkout session (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to create checkout session");return n.data||n}return n}async updateSubscription(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription`,{method:"PATCH",body:JSON.stringify(t)});if(!r.ok){let e="Failed to update subscription";try{e=(await r.json()).message||e}catch{e=`Failed to update subscription (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to update subscription");return n.data?.checkoutUrl||n.checkoutUrl,n.data||n}return n.checkoutUrl,n}async createBillingPortalSession(e,t){return this.fetchJson(`workspaces/${e}/subscription/billing-portal`,{method:"POST",body:JSON.stringify(t?{returnUrl:t}:{})})}async listInvoices(e,t=10,r){const n=new URLSearchParams;n.append("limit",t.toString()),r&&n.append("starting_after",r);const a=await this.fetchResponse(`workspaces/${e}/subscription/invoices?${n.toString()}`,{});if(!a.ok){let e="Failed to fetch invoices";try{e=(await a.json()).message||e}catch{e=404===a.status?"Workspace not found or no invoices available":401===a.status?"Unauthorized - Please check your session":`Failed to fetch invoices (${a.status}: ${a.statusText})`}throw new Error(e)}const s=await a.json();if(void 0!==s.success){if(!s.success)throw new Error(s.message||"Failed to fetch invoices");return s}return s}async getInvoice(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/invoices/${t}`,{});if(!r.ok){let e="Failed to fetch invoice";try{e=(await r.json()).message||e}catch{e=404===r.status?"Invoice not found":401===r.status?"Unauthorized - Please check your session":`Failed to fetch invoice (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch invoice");return n}return n}async cancelSubscriptionAtPeriodEnd(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/cancel-at-period-end`,{method:"POST"});if(!t.ok){let e="Failed to cancel subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to cancel subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to cancel subscription");return r.data||r}return r}async resumeSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/resume`,{method:"POST"});if(!t.ok){let e="Failed to resume subscription";try{e=(await t.json()).message||e}catch{e=404===t.status?"Subscription not found":401===t.status?"Unauthorized - Please check your session":`Failed to resume subscription (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to resume subscription");return r.data||r}return r}async recordUsage(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to record usage";try{e=(await r.json()).message||e}catch{e=`Failed to record usage (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to record usage");return n.data||n}return n}async recordUsageBatch(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/batch`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){let e="Failed to record batch usage";try{e=(await r.json()).message||e}catch{e=`Failed to record batch usage (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();return n.data||n}async getQuotaUsageStatus(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/status?quotaSlug=${encodeURIComponent(t)}`);if(!r.ok){let e="Failed to fetch quota usage status";try{e=(await r.json()).message||e}catch{e=404===r.status?"Workspace not found or no subscription available":401===r.status?"Unauthorized - Please check your session":`Failed to fetch quota usage status (${r.status}: ${r.statusText})`}throw new Error(e)}const n=await r.json();if(void 0!==n.success){if(!n.success)throw new Error(n.message||"Failed to fetch quota usage status");return n.data||n}return n}async getAllQuotaUsage(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/usage/all`);if(!t.ok){let e="Failed to fetch all quota usage";try{e=(await t.json()).message||e}catch{e=404===t.status?"Workspace not found or no subscription available":401===t.status?"Unauthorized - Please check your session":`Failed to fetch all quota usage (${t.status}: ${t.statusText})`}throw new Error(e)}const r=await t.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||"Failed to fetch all quota usage");return r.data||r}return r}async getUsageLogs(e,t){const r=new URLSearchParams;t?.quotaSlug&&r.append("quotaSlug",t.quotaSlug),t?.from&&r.append("from",t.from),t?.to&&r.append("to",t.to),t?.source&&r.append("source",t.source),t?.page&&r.append("page",t.page.toString()),t?.limit&&r.append("limit",t.limit.toString());const n=r.toString(),a=`workspaces/${e}/subscription/usage/logs${n?`?${n}`:""}`,s=await this.fetchResponse(a);if(!s.ok){let e="Failed to fetch usage logs";try{e=(await s.json()).message||e}catch{e=404===s.status?"Workspace not found":401===s.status?"Unauthorized - Please check your session":`Failed to fetch usage logs (${s.status}: ${s.statusText})`}throw new Error(e)}const i=await s.json();if(void 0!==i.success){if(!i.success)throw new Error(i.message||"Failed to fetch usage logs");return i.data||i}return i}}function bn(){const e=Xe(),r=lt(),n=At();return t.useMemo(()=>({auth:e,os:r,workspaces:n}),[e,r,n])}function vn(e,r,n){t.useEffect(()=>{const t=new AbortController;return e(t.signal).catch(e=>{Ne(e)||(n?.onError?n.onError(e):Re(e,{component:"useAsyncEffect",action:"effect",metadata:{note:"Unhandled rejection - consider passing onError"}}))}),()=>t.abort()},r)}class yn extends fn{constructor(e){super({...e,requireOrgId:!0})}async getSettings(e){return this.fetchJson(`${this.orgId}/settings`,{signal:e},"Failed to fetch settings")}}function xn(){return Pt(e=>e.os)}let wn=null;function Sn(){const e=bn(),r=xn(),{serverUrl:n,version:a,orgId:s,settings:i}=r,o=t.useMemo(()=>rt(r)?new yn({serverUrl:n,version:a,orgId:s}):null,[n,a,s]),c=t.useCallback(async t=>o?wn||(wn=(async()=>{try{const r=await o.getSettings(t);return e.os(et(r)),r}catch(e){return De(e,{component:"useSaaSSettings",action:"getSettings",metadata:{serverUrl:n,version:a,orgId:s}}),null}finally{wn=null}})(),wn):null,[o,e,n,a,s]);return vn(async e=>{i||rt(r)&&await c(e)},[n,a,s],{onError:e=>De(e,{component:"useSaaSSettings",action:"fetchSettings",metadata:{serverUrl:n,version:a,orgId:s}})}),t.useMemo(()=>({settings:i,getSettings:c}),[i,c])}function kn(){const e=xn(),r=function(e){return t.useMemo(()=>new gn(e),[e.serverUrl,e.version,e.orgId])}(e);return t.useMemo(()=>({os:e,api:r}),[e,r])}function En(e,t,r){return e instanceof Error?e.message:r(t)}const Cn=e=>{const{t:r}=an(),{os:n,api:a}=kn(),s=rt(n),[i,o]=t.useState(null),[c,l]=t.useState(!1),[u,d]=t.useState(null),p=t.useCallback(async()=>{if(e&&s){l(!0),d(null);try{const t=await a.getPublicPlans(e);o(t)}catch(t){const n=En(t,"errors.fetchPlans",r);d(n),Re(t,{component:"usePublicPlans",action:"fetchPlans",metadata:{slug:e}})}finally{l(!1)}}else o(null)},[a,e,s]);t.useEffect(()=>{p()},[p]);const m=e&&!s||c;return{items:i?.items??[],plans:i?.plans??[],notes:i?.notes,loading:m,error:u,refetch:p}},Nn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCurrentSubscription(e);s(t)}catch(t){const n=En(t,"errors.fetchSubscription",r);l(n),Re(t,{component:"useSubscription",action:"fetchSubscription",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{subscription:a,loading:i,error:c,refetch:u}},An=(e,r)=>{const{t:n}=an(),{api:a}=kn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e){c(!0),u(null);try{const t=r?await a.getPlanGroupByVersion(e,r):await a.getPlanGroup(e);i(t)}catch(t){const a=En(t,"errors.fetchPlanGroup",n);u(a),Re(t,{component:"usePlanGroup",action:"fetchPlanGroup",metadata:{workspaceId:e,groupVersionId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{d()},[d]),{planGroup:s,loading:o,error:l,refetch:d}},jn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersions(e);s(t)}catch(t){const n=En(t,"errors.fetchPlanGroupVersions",r);l(n),Re(t,{component:"usePlanGroupVersions",action:"fetchVersions",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{versions:a,loading:i,error:c,refetch:u}},Pn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{createCheckoutSession:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=await n.createCheckoutSession(e,t);return"trial_started"===r.type&&(Dt(),_t()),r}catch(n){const a=En(n,"errors.createCheckout",r);throw o(a),Re(n,{component:"useCreateCheckoutSession",action:"createCheckoutSession",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},Tn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null),c=t.useCallback(async(t,a)=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r={planVersionId:t,...a?.billingInterval&&{billingInterval:a.billingInterval},...a?.successUrl&&{successUrl:a.successUrl},...a?.cancelUrl&&{cancelUrl:a.cancelUrl}},s=await n.updateSubscription(e,r);return Dt(),s}catch(n){const s=En(n,"errors.updateSubscription",r);throw o(s),Re(n,{component:"useUpdateSubscription",action:"updateSubscription",metadata:{workspaceId:e,planVersionId:t,options:a}}),n}finally{s(!1)}},[n,e]);return{updateSubscription:c,loading:a,error:i}},_n=(e,r)=>{const n=Nn(e),a=An(e,r),s=Tn(e),i=t.useCallback(async()=>{await Promise.all([n.refetch(),a.refetch()])},[n.refetch,a.refetch]);return{subscription:n.subscription,planGroup:a.planGroup,loading:n.loading||a.loading||s.loading,error:n.error||a.error||s.error,updateSubscription:s.updateSubscription,refetch:i}},Rn=(e,r=10,n)=>{const{t:a}=an(),{api:s}=kn(),[i,o]=t.useState([]),[c,l]=t.useState(!1),[u,d]=t.useState(!1),[p,m]=t.useState(null),h=t.useCallback(async()=>{if(!e)return o([]),void l(!1);d(!0),m(null);try{const t=await s.listInvoices(e,r,n);o(t.invoices||[]),l(t.has_more||!1)}catch(t){const s=En(t,"errors.fetchInvoices",a);m(s),Re(t,{component:"useInvoices",action:"fetchInvoices",metadata:{workspaceId:e,limit:r,startingAfter:n}})}finally{d(!1)}},[s,e,r,n]);return t.useEffect(()=>{h()},[h]),{invoices:i,hasMore:c,loading:u,error:p,refetch:h}},Dn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{openBillingPortal:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=t||window.location.href,a=await n.createBillingPortalSession(e,r);return a.url&&window.open(a.url,"_blank","noopener,noreferrer"),a}catch(t){const n=En(t,"errors.openBillingPortal",r);throw o(n),Re(t,{component:"useBillingPortal",action:"openBillingPortal",metadata:{workspaceId:e}}),t}finally{s(!1)}},[e,n]),loading:a,error:i}},In=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{cancelSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const t=await n.cancelSubscriptionAtPeriodEnd(e);return Dt(),t}catch(t){const n=En(t,"errors.cancelSubscription",r);throw o(n),Re(t,{component:"useCancelSubscription",action:"cancelSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},Un=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{resumeSubscription:t.useCallback(async()=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const t=await n.resumeSubscription(e);return Dt(),t}catch(t){const n=En(t,"errors.resumeSubscription",r);throw o(n),Re(t,{component:"useResumeSubscription",action:"resumeSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},Mn=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getAllQuotaUsage(e);s(t.quotas)}catch(t){const n=En(t,"errors.fetchAllQuotaUsage",r);l(n),Re(t,{component:"useAllQuotaUsage",action:"fetchAllUsage",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{quotas:a,loading:i,error:c,refetch:u}},Ln=t.createContext(null);Ln.displayName="SubscriptionContext";const On=t.memo(function({children:r}){const n=Pt(e=>e.workspaces.currentWorkspace),{subscription:a,loading:s,error:i,refetch:o}=Nn(n?._id);t.useEffect(()=>{return e=o,Rt.add(e),()=>{Rt.delete(e)};var e},[o]);const c=t.useMemo(()=>({response:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(Ln.Provider,{value:c,children:r})});function zn(){const e=t.useContext(Ln);if(null===e)throw new Error("useSubscriptionContext must be used within SubscriptionContextProvider. Make sure SubscriptionContextProvider is wrapping your application (or the tree that uses subscription gates).");return e}On.displayName="SubscriptionContextProvider";const Fn={Monthly:"monthly",Yearly:"yearly",Quarterly:"quarterly"},Bn="active",Wn="trialing",Vn="canceled",Hn="past_due",Gn="paused",$n="draft",Kn="open",qn="paid",Zn="uncollectible",Jn="void",Yn="feature",Xn="limit",Qn="quota",ea="none",ta="final",ra="suspended";function na(e,t){const r=e.pricingVariants;if(!r?.length)return null;const n=t.toLowerCase();return r.find(e=>e.currency?.toLowerCase()===n)??null}function aa(e,t,r){const n=na(e,t);if(!n?.basePricing)return null;const a=n.basePricing[r];return null!=a?a:null}function sa(e,t,r,n){const a=na(e,t),s=a?.quotaOverages?.[r];if(s)return s[n]}function ia(e,t,r,n){const a=e.quotas?.[r];if(null==a)return null;const s=a[n];if(!s)return null;const i=sa(e,t,r,n);return{included:s.included,...void 0!==s.unitSize&&{unitSize:s.unitSize},...void 0!==i&&{overage:i}}}function oa(e,t){if(!e)return null;for(const r of t){const t=r.pricingVariants;if(t?.length)for(const r of t){const t=r.stripePrices;if(t){if(t.monthlyPriceId===e||t.monthly===e)return{interval:"monthly",currency:r.currency};if(t.yearlyPriceId===e||t.yearly===e)return{interval:"yearly",currency:r.currency};if(t.quarterlyPriceId===e)return{interval:"quarterly",currency:r.currency}}}}return null}function ca(e,t){const r=na(e,t);return r?.seatPricing?.enabled?r.seatPricing:null}function la(e,t,r){const n=ca(e,t);return n?.perSeat?n.perSeat[r]??null:null}function ua(e){const{planVersion:t,currency:r="usd",settingsMaxUsers:n}=e;if(t){const e=ca(t,r);if(e)return{maxUsers:e.maxSeats??0,source:"seat_pricing",includedSeats:e.includedSeats??0,hasSeatPricing:!0}}return null!=n&&n>0?{maxUsers:n,source:"settings",includedSeats:0,hasSeatPricing:!1}:{maxUsers:0,source:"none",includedSeats:0,hasSeatPricing:!1}}function da(e){const{memberCount:t,maxUsersConfig:r,hasSubscription:n=!0,requireSubscription:a=!1}=e;if(a&&!n)return{canInvite:!1,blockReason:"no_subscription",blockMessageKey:"users.subscriptionRequired",blockMessageValues:{}};const{maxUsers:s,source:i}=r;if(s<=0)return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null};if(t>=s){return{canInvite:!1,blockReason:{seat_pricing:"seat_limit_reached",settings:"settings_user_limit_reached"}[i]??"seat_limit_reached",blockMessageKey:{seat_pricing:"users.seatLimitMessage",settings:"users.settingsLimitMessage"}[i]??"users.memberLimitMessage",blockMessageValues:{maxUsers:s}}}return{canInvite:!0,blockReason:null,blockMessageKey:null,blockMessageValues:null}}const pa="user:created",ma="user:updated",ha="workspace:changed",fa="workspace:updated",ga="workspace:user-added",ba="workspace:user-removed",va="workspace:user-role-changed",ya="workspace:created",xa="workspace:deleted";const wa=new class{constructor(){this.callbacks=null}setCallbacks(e){this.callbacks=e}getCallbacks(){return this.callbacks}async emit(e,t){if(this.callbacks?.handleEvent)try{await this.callbacks.handleEvent(e,t)}catch(t){Re(t,{component:"EventEmitter",action:"emit",metadata:{eventType:e}})}}async emitUserCreated(e){await this.emit(pa,{user:e})}async emitUserUpdated(e,t){await this.emit(ma,{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit(ha,{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit(fa,{workspace:e})}async emitWorkspaceUserAdded(e,t,r){await this.emit(ga,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRemoved(e,t,r){await this.emit(ba,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRoleChanged(e,t,r,n){await this.emit(va,{userId:e,workspace:t,previousRole:r,newRole:n})}async emitWorkspaceCreated(e){await this.emit(ya,{workspace:e})}async emitWorkspaceDeleted(e){await this.emit(xa,{workspace:e})}},Sa="saas-workspace-current",ka=e=>{e?on(Sa,e._id):cn(Sa)},Ea=()=>sn(Sa),Ca=()=>{cn(Sa)},Na=(e,t)=>!!e&&t.some(t=>t._id===e);function Aa(e,t){if(!t)return!1;const r=(n=e.createdBy)?"string"==typeof n?n:"object"==typeof n&&"_id"in n&&"string"==typeof n._id?n._id:null:null;var n;return null!==r&&r===t}function ja(e,t){if(!t||!e.users||!Array.isArray(e.users))return null;const r=e.users.find(e=>"string"==typeof e?e===t:"object"==typeof e&&null!==e&&"_id"in e&&e._id===t);return r&&"object"==typeof r&&"role"in r&&"string"==typeof r.role?r.role:null}const Pa=()=>{const e=bn(),{os:r,api:n}=kn(),{settings:a}=Sn(),s=Pt(e=>e.workspaces),i=Pt(e=>e.auth.session?.user),o=t.useCallback((t,r)=>{if((!(t._id===s.currentWorkspace?._id)||r?.forceEmit)&&t){const r=s.currentWorkspace;ka(t),e.workspaces(ft(t)),wa.emitWorkspaceChanged(t,r).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceChanged",metadata:{workspaceId:t._id}})})}},[s.currentWorkspace,e]),c=t.useCallback(async(t,n)=>{const a=++p.current;e.workspaces(wt(t._id));try{const e=r.auth?.callbacks?.onWorkspaceChange;if(e){const r=ja(t,i?.id);try{await e({workspace:t,user:i??null,role:r})}catch(e){throw Re(e,{component:"useSaaSWorkspaces",action:"onWorkspaceChange",metadata:{workspaceId:t._id}}),e}if(a!==p.current)return}o(t,n)}finally{a===p.current&&e.workspaces(wt(null))}},[e,r.auth?.callbacks?.onWorkspaceChange,o,i]);t.useEffect(()=>{if(!s.isInitialized){const t=Ea();if(e.workspaces(bt(!0)),t){const e=s.workspaces.find(e=>e._id===t);e&&c(e,{forceEmit:!0}).catch(()=>{})}}},[s.isInitialized,s.workspaces,s.currentWorkspace,e,c]);const l=t.useCallback(()=>{Ca(),e.workspaces(gt())},[e]),u=t.useRef(!1),d=t.useRef(!1),p=t.useRef(0),m=t.useCallback(async()=>{if(!s.loading&&!u.current){u.current=!0,e.workspaces(vt(!0)),e.workspaces(yt(null));try{const t=await n.getWorkspaces();if(e.workspaces(ut(t)),t.length>0){const e=Ea();if(e&&Na(e,t)){const r=t.find(t=>t._id===e);if(r)try{await c(r,{forceEmit:!0})}catch{}}else{const e=t[0];try{await c(e,{forceEmit:!0})}catch{}}}}catch(t){e.workspaces(yt(t instanceof Error?t.message:"Failed to fetch workspaces"))}finally{e.workspaces(vt(!1)),u.current=!1}}},[n,s.loading,e,c]),h=t.useCallback(async()=>{if(!s.refreshing&&!u.current){u.current=!0,e.workspaces(xt(!0));try{const t=await n.getWorkspaces();e.workspaces(ut(t))}catch(e){}finally{e.workspaces(xt(!1)),u.current=!1}}},[n,s.refreshing,e]),f=t.useCallback(async(t,r)=>{const a=await n.createWorkspace({name:t,image:r});e.workspaces(dt(a)),wa.emitWorkspaceCreated(a).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:a._id}})})},[n,e]),g=t.useCallback(async(t,r)=>{const a=await n.updateWorkspace(t._id,r);e.workspaces(pt(a)),wa.emitWorkspaceUpdated(a).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceUpdated",metadata:{workspaceId:a._id}})})},[n,e]),b=t.useCallback(async()=>{if(d.current)return s.allFeatures.length>0?s.allFeatures:null;if(s.allFeatures.length>0)return s.allFeatures;d.current=!0;try{const t=await n.getFeatures();return e.workspaces(ht(t)),t}catch(e){return Re(e,{component:"useSaaSWorkspaces",action:"getFeatures"}),null}finally{d.current=!1}},[n,e,s.allFeatures]),v=t.useCallback(async(e,t,r)=>await n.updateFeature(e,t,r),[n]);t.useEffect(()=>{if(!s.currentWorkspace?._id||0===s.workspaces.length)return;const t=s.currentWorkspace._id,r=s.workspaces.find(e=>e._id===t);if(r)r!==s.currentWorkspace&&(ka(r),e.workspaces(ft(r)));else if(s.workspaces.length>0){const e=s.workspaces[0];e._id!==t&&c(e).catch(()=>{})}},[s.workspaces,s.currentWorkspace,e,c]);const y=t.useCallback(async e=>await n.getWorkspaceUsers(e),[n]),x=t.useCallback(async(e,t,r)=>{const i=s.workspaces.find(t=>t._id===e);if(i){const e=ua({settingsMaxUsers:a?.workspace?.maxWorkspaceUsers}),t=da({memberCount:i.users?.length??0,maxUsersConfig:e});if(!t.canInvite)throw new Error(t.blockMessageKey||"users.memberLimitReached")}const o=await n.addUser(e,{email:t,role:r});return i&&wa.emitWorkspaceUserAdded(o.userId,i,r).catch(t=>{Re(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:r}})}),h().catch(()=>{}),Dt(),o},[n,s.workspaces,h,a]),w=t.useCallback(async(e,t)=>{const r=s.workspaces.find(t=>t._id===e);if(r&&Aa(r,t))throw new Error("Cannot remove the workspace owner");const a=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t),i=await n.removeUser(e,t);if(r&&a){const t=a.role;wa.emitWorkspaceUserRemoved(i.userId,r,t).catch(r=>{Re(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:i.userId,role:t}})})}return h().catch(()=>{}),Dt(),i},[n,s.workspaces,h]),S=t.useCallback(async(e,t,r)=>{if(r.role){const r=s.workspaces.find(t=>t._id===e);if(r&&Aa(r,t))throw new Error("Cannot change the role of the workspace owner")}let a;if(r.role){const r=(await n.getWorkspaceUsers(e).catch(()=>[])).find(e=>("string"==typeof e.user?e.user:e.user._id)===t);a=r?.role}const i=await n.updateUser(e,t,r);return r.role&&a&&a!==r.role&&wa.emitWorkspaceUserRoleChanged(i.userId,i.workspace,a,r.role).catch(n=>{Re(n,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRoleChanged",metadata:{workspaceId:e,userId:t,previousRole:a,newRole:r.role}})}),i},[n,s.workspaces]),k=t.useCallback(async e=>{const t=await n.getProfile().catch(()=>null),r=await n.updateUserProfile(e);return wa.emitUserUpdated(r,t||void 0).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitUserUpdated",metadata:{userId:r._id}})}),r},[n]),E=t.useCallback(async()=>await n.getProfile(),[n]),C=t.useCallback(async e=>await n.getWorkspace(e),[n]),N=t.useCallback(async t=>{if(!i)throw new Error("User must be authenticated to delete a workspace");const r=s.workspaces.find(e=>e._id===t);if(!r)throw new Error("Workspace not found");if(!Aa(r,i.id))throw new Error("Only the workspace creator can delete the workspace");const a=await n.deleteWorkspace(t);return e.workspaces(mt(t)),s.currentWorkspace?._id===t&&(Ca(),e.workspaces(gt())),r&&wa.emitWorkspaceDeleted(r).catch(e=>{Re(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceDeleted",metadata:{workspaceId:t}})}),a},[n,s.workspaces,s.currentWorkspace,e,i]);return{workspaces:s.workspaces,loading:s.loading,error:s.error,fetchWorkspaces:m,refreshWorkspaces:h,refreshing:s.refreshing,currentWorkspace:s.currentWorkspace,setCurrentWorkspace:o,switchToWorkspace:c,resetCurrentWorkspace:l,createWorkspace:f,allFeatures:s.allFeatures,getFeatures:b,updateFeature:v,getWorkspace:C,updateWorkspace:g,getUsers:y,addUser:x,removeUser:w,updateUser:S,getProfile:E,updateUserProfile:k,deleteWorkspace:N,switching:null!==s.switchingToId,switchingToId:s.switchingToId}},Ta=t.createContext(null);Ta.displayName="QuotaUsageContext";const _a=t.memo(function({children:r}){const{currentWorkspace:n}=Pa(),{quotas:a,loading:s,error:i,refetch:o}=Mn(n?._id);t.useEffect(()=>{return e=o,Tt.add(e),()=>{Tt.delete(e)};var e},[o]);const c=t.useMemo(()=>({quotas:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(Ta.Provider,{value:c,children:r})});function Ra(){const e=t.useContext(Ta);if(null===e)throw new Error("useQuotaUsageContext must be used within QuotaUsageContextProvider. Make sure QuotaUsageContextProvider is wrapping your application (or the tree that uses quota gates).");return e}_a.displayName="QuotaUsageContextProvider";class Da extends fn{constructor(e){super(e)}async requestAuth(e){const t=`${this.serverUrl}/api/${this.version}/auth/request`,r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok){let e="Failed to initiate authentication";try{e=(await r.json()).message||e}catch{e=`Failed to initiate authentication (${r.status}: ${r.statusText})`}throw new Error(e)}return r.json()}async getProfile(e,t){return this.fetchJson("profile",{headers:{"x-session-id":e},signal:t},"Failed to fetch user profile")}}function Ia(e,t="/"){const r=function(e){if(!e||"string"!=typeof e)return null;try{const t=new URL(e);return"https:"===t.protocol?e:"http:"!==t.protocol||"localhost"!==t.hostname&&"127.0.0.1"!==t.hostname&&"::1"!==t.hostname?null:e}catch{return null}}(e);window.location.href=r||t}
3
+ /**
4
+ * @license lucide-react v0.544.0 - ISC
5
+ *
6
+ * This source code is licensed under the ISC license.
7
+ * See the LICENSE file in the root directory of this source tree.
8
+ */const Ua=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ma=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},La=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),Oa=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
9
+ /**
10
+ * @license lucide-react v0.544.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ var za={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};
16
+ /**
17
+ * @license lucide-react v0.544.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Fa=t.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:i,iconNode:o,...c},l)=>t.createElement("svg",{ref:l,...za,width:r,height:r,stroke:e,strokeWidth:a?24*Number(n)/Number(r):n,className:La("lucide",s),...!i&&!Oa(c)&&{"aria-hidden":"true"},...c},[...o.map(([e,r])=>t.createElement(e,r)),...Array.isArray(i)?i:[i]])),Ba=(e,r)=>{const n=t.forwardRef(({className:n,...a},s)=>t.createElement(Fa,{ref:s,iconNode:r,className:La(`lucide-${Ua(Ma(e))}`,`lucide-${e}`,n),...a}));return n.displayName=Ma(e),n},Wa=Ba("bell-off",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]),Va=Ba("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),Ha=Ba("building-2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]),Ga=Ba("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),$a=Ba("chart-column",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]),Ka=Ba("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),qa=Ba("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Za=Ba("credit-card",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]),Ja=Ba("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),Ya=Ba("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),Xa=Ba("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),Qa=Ba("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),es=Ba("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),ts=Ba("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),rs=Ba("refresh-ccw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]),ns=Ba("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),as=Ba("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),ss=Ba("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),is=Ba("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]),os=Ba("smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]),cs=Ba("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),ls=Ba("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),us=Ba("trash",[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),ds=Ba("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),ps=Ba("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),ms=Ba("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);
22
+ /**
23
+ * @license lucide-react v0.544.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */function hs(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function fs(...e){return t=>{let r=!1;const n=e.map(e=>{const n=hs(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():hs(e[t],null)}}}}function gs(...e){return a.useCallback(fs(...e),e)}var bs=Symbol.for("react.lazy"),vs=a[" use ".trim().toString()];function ys(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===bs&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function xs(t){const r=Ss(t),n=a.forwardRef((t,n)=>{let{children:s,...i}=t;ys(s)&&"function"==typeof vs&&(s=vs(s._payload));const o=a.Children.toArray(s),c=o.find(Es);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}var ws=xs("Slot");function Ss(e){const t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(ys(r)&&"function"==typeof vs&&(r=vs(r._payload)),a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?fs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ks=Symbol("radix.slottable");function Es(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ks}const Cs=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Ns=o,As=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Ns(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:s}=t,i=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==s?void 0:s[e];if(null===t)return null;const i=Cs(t)||Cs(n);return a[e][i]}),o=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),c=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...s,...o}[t]):{...s,...o}[t]===r})?[...e,r,n]:e},[]);return Ns(e,i,c,null==r?void 0:r.class,null==r?void 0:r.className)},js=As("inline-flex items-center justify-center rounded-full font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:opacity-50 disabled:pointer-events-none ring-offset-background",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"underline-offset-4 hover:underline text-primary"},withIcon:{true:"flex"},fullWidth:{true:"w-full"},size:{default:"h-9 py-2 px-4 text-sm",sm:"h-8 px-3 text-xs",lg:"h-10 px-6 text-base",icon:"h-9 w-9"}},compoundVariants:[{size:"lg",withIcon:!0,className:"gap-x-1.5"},{size:"default",withIcon:!0,className:"gap-x-1"},{size:"sm",withIcon:!0,className:"gap-x-0.5"}],defaultVariants:{variant:"default",size:"default"}}),Ps=a.forwardRef(({className:t,variant:r,progress:n,size:s,startIcon:i,endIcon:o,asChild:c=!1,...l},u)=>{const d=c?ws:"button",p=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(s);return e.jsxs(d,{disabled:n||l.disabled,className:Se(js({variant:r,size:s,withIcon:null!=n||null!=i||null!=o,className:t})),ref:u,...l,children:[n&&e.jsx(es,{size:p,className:"animate-spin"}),i&&a.cloneElement(i,{size:p}),l.children,o&&a.cloneElement(o,{size:p})]})});function Ts(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function _s(t,r=[]){let n=[];const s=()=>{const e=n.map(e=>a.createContext(e));return function(r){const n=r?.[t]||e;return a.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return s.scopeName=t,[function(r,s){const i=a.createContext(s),o=n.length;n=[...n,s];const c=r=>{const{scope:n,children:s,...c}=r,l=n?.[t]?.[o]||i,u=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:u,children:s})};return c.displayName=r+"Provider",[c,function(e,n){const c=n?.[t]?.[o]||i,l=a.useContext(c);if(l)return l;if(void 0!==s)return s;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},Rs(s,...r)]}function Rs(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}Ps.displayName="Button";var Ds=globalThis?.document?a.useLayoutEffect:()=>{},Is=a[" useId ".trim().toString()]||(()=>{}),Us=0;function Ms(e){const[t,r]=a.useState(Is());return Ds(()=>{r(e=>e??String(Us++))},[e]),e||(t?`radix-${t}`:"")}var Ls=a[" useInsertionEffect ".trim().toString()]||Ds;function Os({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,i,o]=function({defaultProp:e,onChange:t}){const[r,n]=a.useState(e),s=a.useRef(r),i=a.useRef(t);return Ls(()=>{i.current=t},[t]),a.useEffect(()=>{s.current!==r&&(i.current?.(r),s.current=r)},[r,s]),[r,n,i]}({defaultProp:t,onChange:r}),c=void 0!==e,l=c?e:s;{const t=a.useRef(void 0!==e);a.useEffect(()=>{const e=t.current;if(e!==c){const t=e?"controlled":"uncontrolled",r=c?"controlled":"uncontrolled";console.warn(`${n} is changing from ${t} to ${r}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=c},[c,n])}const u=a.useCallback(t=>{if(c){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&o.current?.(r)}else i(t)},[c,e,i,o]);return[l,u]}function zs(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?fs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Fs=Symbol("radix.slottable");function Bs(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Fs}var Ws=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=function(t){const r=zs(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Bs);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{});function Vs(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}var Hs,Gs="dismissableLayer.update",$s="dismissableLayer.pointerDownOutside",Ks="dismissableLayer.focusOutside",qs=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zs=a.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...u}=t,d=a.useContext(qs),[p,m]=a.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=a.useState({}),g=gs(r,e=>m(e)),b=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(v),x=p?b.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=y,k=function(e,t=globalThis?.document){const r=Vs(e),n=a.useRef(!1),s=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Ys($s,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",s.current),s.current=n,t.addEventListener("click",s.current,{once:!0})):n()}else t.removeEventListener("click",s.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));S&&!r&&(i?.(e),c?.(e),e.defaultPrevented||l?.())},h),E=function(e,t=globalThis?.document){const r=Vs(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){Ys(Ks,r,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const r=Vs(e);a.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{x===d.layers.size-1&&(s?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),a.useEffect(()=>{if(p)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Hs=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Js(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Hs)}},[p,h,n,d]),a.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Js())},[p,d]),a.useEffect(()=>{const e=()=>f({});return document.addEventListener(Gs,e),()=>document.removeEventListener(Gs,e)},[]),e.jsx(Ws.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:Ts(t.onFocusCapture,E.onFocusCapture),onBlurCapture:Ts(t.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Ts(t.onPointerDownCapture,k.onPointerDownCapture)})});Zs.displayName="DismissableLayer";function Js(){const e=new CustomEvent(Gs);document.dispatchEvent(e)}function Ys(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?function(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}a.forwardRef((t,r)=>{const n=a.useContext(qs),s=a.useRef(null),i=gs(r,s);return a.useEffect(()=>{const e=s.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(Ws.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var Xs="focusScope.autoFocusOnMount",Qs="focusScope.autoFocusOnUnmount",ei={bubbles:!1,cancelable:!0},ti=a.forwardRef((t,r)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=t,[l,u]=a.useState(null),d=Vs(i),p=Vs(o),m=a.useRef(null),h=gs(r,e=>u(e)),f=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(s){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?m.current=t:si(m.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||si(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&si(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[s,l,f.paused]),a.useEffect(()=>{if(l){ii.add(f);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(Xs,ei);l.addEventListener(Xs,d),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(si(n,{select:t}),document.activeElement!==r)return}((e=ri(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&si(l))}return()=>{l.removeEventListener(Xs,d),setTimeout(()=>{const e=new CustomEvent(Qs,ei);l.addEventListener(Qs,p),l.dispatchEvent(e),e.defaultPrevented||si(t??document.body,{select:!0}),l.removeEventListener(Qs,p),ii.remove(f)},0)}}var e},[l,d,p,f]);const g=a.useCallback(e=>{if(!n&&!s)return;if(f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[a,s]=function(e){const t=ri(e),r=ni(t,e),n=ni(t.reverse(),e);return[r,n]}(t);a&&s?e.shiftKey||r!==s?e.shiftKey&&r===a&&(e.preventDefault(),n&&si(s,{select:!0})):(e.preventDefault(),n&&si(a,{select:!0})):r===t&&e.preventDefault()}},[n,s,f.paused]);return e.jsx(Ws.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});function ri(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function ni(e,t){for(const r of e)if(!ai(r,{upTo:t}))return r}function ai(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function si(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}ti.displayName="FocusScope";var ii=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=oi(e,t),e.unshift(t)},remove(t){e=oi(e,t),e[0]?.resume()}}}();function oi(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var ci=a.forwardRef((t,n)=>{const{container:s,...i}=t,[o,c]=a.useState(!1);Ds(()=>c(!0),[]);const l=s||o&&globalThis?.document?.body;return l?r.createPortal(e.jsx(Ws.div,{...i,ref:n}),l):null});ci.displayName="Portal";var li=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=a.useState(),n=a.useRef(null),s=a.useRef(e),i=a.useRef("none"),o=e?"mounted":"unmounted",[c,l]=function(e,t){return a.useReducer((e,r)=>t[e][r]??e,e)}(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const e=ui(n.current);i.current="mounted"===c?e:"none"},[c]),Ds(()=>{const t=n.current,r=s.current;if(r!==e){const n=i.current,a=ui(t);if(e)l("MOUNT");else if("none"===a||"none"===t?.display)l("UNMOUNT");else{l(r&&n!==a?"ANIMATION_OUT":"UNMOUNT")}s.current=e}},[e,l]),Ds(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const i=ui(n.current).includes(CSS.escape(a.animationName));if(a.target===t&&i&&(l("ANIMATION_END"),!s.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},o=e=>{e.target===t&&(i.current=ui(n.current))};return t.addEventListener("animationstart",o),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",o),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),s="function"==typeof r?r({present:n.isPresent}):a.Children.only(r),i=gs(n.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(s));return"function"==typeof r||n.isPresent?a.cloneElement(s,{ref:i}):null};function ui(e){return e?.animationName||"none"}li.displayName="Presence";var di=0;function pi(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??mi()),document.body.insertAdjacentElement("beforeend",e[1]??mi()),di++,()=>{1===di&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),di--}},[])}function mi(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var hi=function(){return hi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},hi.apply(this,arguments)};function fi(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 a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}"function"==typeof SuppressedError&&SuppressedError;var gi="right-scroll-bar-position",bi="width-before-scroll-bar";function vi(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var yi="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,xi=new WeakMap;function wi(e,r){var n,a,s,i=(n=null,a=function(t){return e.forEach(function(e){return vi(e,t)})},(s=t.useState(function(){return{value:n,callback:a,facade:{get current(){return s.value},set current(e){var t=s.value;t!==e&&(s.value=e,s.callback(e,t))}}}})[0]).callback=a,s.facade);return yi(function(){var t=xi.get(i);if(t){var r=new Set(t),n=new Set(e),a=i.current;r.forEach(function(e){n.has(e)||vi(e,null)}),n.forEach(function(e){r.has(e)||vi(e,a)})}xi.set(i,e)},[e]),i}function Si(e){return e}var ki=function(e){var t=e.sideCar,r=fi(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return a.createElement(n,hi({},r))};ki.isSideCarExport=!0;var Ei=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=Si);var r=[],n=!1;return{read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var a=t(e,n);return r.push(a),function(){r=r.filter(function(e){return e!==a})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var a=r;r=[],a.forEach(e),t=r}var s=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(s)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}}}(null);return t.options=hi({async:!0,ssr:!1},e),t}(),Ci=function(){},Ni=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:Ci,onWheelCapture:Ci,onTouchMoveCapture:Ci}),s=n[0],i=n[1],o=e.forwardProps,c=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,m=e.sideCar,h=e.noRelative,f=e.noIsolation,g=e.inert,b=e.allowPinchZoom,v=e.as,y=void 0===v?"div":v,x=e.gapMode,w=fi(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=wi([r,t]),E=hi(hi({},w),s);return a.createElement(a.Fragment,null,d&&a.createElement(S,{sideCar:Ei,removeScrollBar:u,shards:p,noRelative:h,noIsolation:f,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:x}),o?a.cloneElement(a.Children.only(c),hi(hi({},E),{ref:k})):a.createElement(y,hi({},E,{className:l,ref:k}),c))});Ni.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Ni.classNames={fullWidth:bi,zeroRight:gi};function Ai(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var ji=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=Ai())&&(a=r,(n=t).styleSheet?n.styleSheet.cssText=a:n.appendChild(document.createTextNode(a)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Pi=function(){var e,t=(e=ji(),function(t,r){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])});return function(e){var r=e.styles,n=e.dynamic;return t(r,n),null}},Ti={left:0,top:0,right:0,gap:0},_i=function(e){return parseInt(e||"",10)||0},Ri=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Ti;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],a=t["padding"===e?"paddingRight":"marginRight"];return[_i(r),_i(n),_i(a)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Di=Pi(),Ii="data-scroll-locked",Ui=function(e,t,r,n){var a=e.left,s=e.top,i=e.right,o=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(o,"px ").concat(n,";\n }\n body[").concat(Ii,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(a,"px;\n padding-top: ").concat(s,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(o,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(o,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(gi," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(bi," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(gi," .").concat(gi," {\n right: 0 ").concat(n,";\n }\n \n .").concat(bi," .").concat(bi," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Ii,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},Mi=function(){var e=parseInt(document.body.getAttribute(Ii)||"0",10);return isFinite(e)?e:0},Li=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=void 0===n?"margin":n;a.useEffect(function(){return document.body.setAttribute(Ii,(Mi()+1).toString()),function(){var e=Mi()-1;e<=0?document.body.removeAttribute(Ii):document.body.setAttribute(Ii,e.toString())}},[]);var i=a.useMemo(function(){return Ri(s)},[s]);return a.createElement(Di,{styles:Ui(i,!t,s,r?"":"!important")})},Oi=!1;if("undefined"!=typeof window)try{var zi=Object.defineProperty({},"passive",{get:function(){return Oi=!0,!0}});window.addEventListener("test",zi,zi),window.removeEventListener("test",zi,zi)}catch(e){Oi=!1}var Fi=!!Oi&&{passive:!1},Bi=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Wi=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Vi(e,n)){var a=Hi(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Vi=function(e,t){return"v"===e?function(e){return Bi(e,"overflowY")}(t):function(e){return Bi(e,"overflowX")}(t)},Hi=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},Gi=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$i=function(e){return[e.deltaX,e.deltaY]},Ki=function(e){return e&&"current"in e?e.current:e},qi=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Zi=0,Ji=[];function Yi(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Xi,Qi=(Xi=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),s=a.useState(Zi++)[0],i=a.useState(Pi)[0],o=a.useRef(e);a.useEffect(function(){o.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var t=function(e,t,r){if(r||2===arguments.length)for(var n,a=0,s=t.length;a<s;a++)!n&&a in t||(n||(n=Array.prototype.slice.call(t,0,a)),n[a]=t[a]);return e.concat(n||Array.prototype.slice.call(t))}([e.lockRef.current],(e.shards||[]).map(Ki),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!o.current.allowPinchZoom;var a,s=Gi(e),i=r.current,c="deltaX"in e?e.deltaX:i[0]-s[0],l="deltaY"in e?e.deltaY:i[1]-s[1],u=e.target,d=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=window.getSelection(),m=p&&p.anchorNode;if(m&&(m===u||m.contains(u)))return!1;var h=Wi(d,u);if(!h)return!0;if(h?a=d:(a="v"===d?"h":"v",h=Wi(d,u)),!h)return!1;if(!n.current&&"changedTouches"in e&&(c||l)&&(n.current=a),!a)return!0;var f=n.current||a;return function(e,t,r,n){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),s=a*n,i=r.target,o=t.contains(i),c=!1,l=s>0,u=0,d=0;do{if(!i)break;var p=Hi(e,i),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Vi(e,i)&&(u+=h,d+=m);var f=i.parentNode;i=f&&f.nodeType===Node.DOCUMENT_FRAGMENT_NODE?f.host:f}while(!o&&i!==document.body||o&&(t.contains(i)||t===i));return(l&&Math.abs(u)<1||!l&&Math.abs(d)<1)&&(c=!0),c}(f,t,e,"h"===f?c:l)},[]),l=a.useCallback(function(e){var r=e;if(Ji.length&&Ji[Ji.length-1]===i){var n="deltaY"in r?$i(r):Gi(r),a=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&(t=e.delta,a=n,t[0]===a[0]&&t[1]===a[1]);var t,a})[0];if(a&&a.should)r.cancelable&&r.preventDefault();else if(!a){var s=(o.current.shards||[]).map(Ki).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?c(r,s[0]):!o.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=a.useCallback(function(e,r,n,a){var s={name:e,delta:r,target:n,should:a,shadowParent:Yi(n)};t.current.push(s),setTimeout(function(){t.current=t.current.filter(function(e){return e!==s})},1)},[]),d=a.useCallback(function(e){r.current=Gi(e),n.current=void 0},[]),p=a.useCallback(function(t){u(t.type,$i(t),t.target,c(t,e.lockRef.current))},[]),m=a.useCallback(function(t){u(t.type,Gi(t),t.target,c(t,e.lockRef.current))},[]);a.useEffect(function(){return Ji.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Fi),document.addEventListener("touchmove",l,Fi),document.addEventListener("touchstart",d,Fi),function(){Ji=Ji.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Fi),document.removeEventListener("touchmove",l,Fi),document.removeEventListener("touchstart",d,Fi)}},[]);var h=e.removeScrollBar,f=e.inert;return a.createElement(a.Fragment,null,f?a.createElement(i,{styles:qi(s)}):null,h?a.createElement(Li,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},Ei.useMedium(Xi),ki),eo=a.forwardRef(function(e,t){return a.createElement(Ni,hi({},e,{ref:t,sideCar:Qi}))});eo.classNames=Ni.classNames;var to=new WeakMap,ro=new WeakMap,no={},ao=0,so=function(e){return e&&(e.host||so(e.parentNode))},io=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=so(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);no[r]||(no[r]=new WeakMap);var s=no[r],i=[],o=new Set,c=new Set(a),l=function(e){e&&!o.has(e)&&(o.add(e),l(e.parentNode))};a.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(o.has(e))u(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,c=(to.get(e)||0)+1,l=(s.get(e)||0)+1;to.set(e,c),s.set(e,l),i.push(e),1===c&&a&&ro.set(e,!0),1===l&&e.setAttribute(r,"true"),a||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),o.clear(),ao++,function(){i.forEach(function(e){var t=to.get(e)-1,a=s.get(e)-1;to.set(e,t),s.set(e,a),t||(ro.has(e)||e.removeAttribute(n),ro.delete(e)),a||e.removeAttribute(r)}),--ao||(to=new WeakMap,to=new WeakMap,ro=new WeakMap,no={})}},oo=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),io(n,a,r,"aria-hidden")):function(){return null}};function co(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?fs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lo=Symbol("radix.slottable");function uo(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===lo}var po="Dialog",[mo,ho]=_s(po),[fo,go]=mo(po),bo=t=>{const{__scopeDialog:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!0}=t,l=a.useRef(null),u=a.useRef(null),[d,p]=Os({prop:s,defaultProp:i??!1,onChange:o,caller:po});return e.jsx(fo,{scope:r,triggerRef:l,contentRef:u,contentId:Ms(),titleId:Ms(),descriptionId:Ms(),open:d,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:c,children:n})};bo.displayName=po;var vo="DialogTrigger",yo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=go(vo,n),i=gs(r,s.triggerRef);return e.jsx(Ws.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":zo(s.open),...a,ref:i,onClick:Ts(t.onClick,s.onOpenToggle)})});yo.displayName=vo;var xo="DialogPortal",[wo,So]=mo(xo,{forceMount:void 0}),ko=t=>{const{__scopeDialog:r,forceMount:n,children:s,container:i}=t,o=go(xo,r);return e.jsx(wo,{scope:r,forceMount:n,children:a.Children.map(s,t=>e.jsx(li,{present:n||o.open,children:e.jsx(ci,{asChild:!0,container:i,children:t})}))})};ko.displayName=xo;var Eo="DialogOverlay",Co=a.forwardRef((t,r)=>{const n=So(Eo,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=go(Eo,t.__scopeDialog);return i.modal?e.jsx(li,{present:a||i.open,children:e.jsx(Ao,{...s,ref:r})}):null});Co.displayName=Eo;var No=function(t){const r=co(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(uo);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("DialogOverlay.RemoveScroll"),Ao=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=go(Eo,n);return e.jsx(eo,{as:No,allowPinchZoom:!0,shards:[s.contentRef],children:e.jsx(Ws.div,{"data-state":zo(s.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),jo="DialogContent",Po=a.forwardRef((t,r)=>{const n=So(jo,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=go(jo,t.__scopeDialog);return e.jsx(li,{present:a||i.open,children:i.modal?e.jsx(To,{...s,ref:r}):e.jsx(_o,{...s,ref:r})})});Po.displayName=jo;var To=a.forwardRef((t,r)=>{const n=go(jo,t.__scopeDialog),s=a.useRef(null),i=gs(r,n.contentRef,s);return a.useEffect(()=>{const e=s.current;if(e)return oo(e)},[]),e.jsx(Ro,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ts(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ts(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Ts(t.onFocusOutside,e=>e.preventDefault())})}),_o=a.forwardRef((t,r)=>{const n=go(jo,t.__scopeDialog),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(Ro,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(s.current||n.triggerRef.current?.focus(),e.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(s.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),Ro=a.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=t,l=go(jo,n),u=a.useRef(null),d=gs(r,u);return pi(),e.jsxs(e.Fragment,{children:[e.jsx(ti,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:e.jsx(Zs,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":zo(l.open),...c,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Vo,{titleId:l.titleId}),e.jsx(Ho,{contentRef:u,descriptionId:l.descriptionId})]})]})}),Do="DialogTitle",Io=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=go(Do,n);return e.jsx(Ws.h2,{id:s.titleId,...a,ref:r})});Io.displayName=Do;var Uo="DialogDescription",Mo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=go(Uo,n);return e.jsx(Ws.p,{id:s.descriptionId,...a,ref:r})});Mo.displayName=Uo;var Lo="DialogClose",Oo=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=go(Lo,n);return e.jsx(Ws.button,{type:"button",...a,ref:r,onClick:Ts(t.onClick,()=>s.onOpenChange(!1))})});function zo(e){return e?"open":"closed"}Oo.displayName=Lo;var Fo="DialogTitleWarning",[Bo,Wo]=function(t,r){const n=a.createContext(r),s=t=>{const{children:r,...s}=t,i=a.useMemo(()=>s,Object.values(s));return e.jsx(n.Provider,{value:i,children:r})};return s.displayName=t+"Provider",[s,function(e){const s=a.useContext(n);if(s)return s;if(void 0!==r)return r;throw new Error(`\`${e}\` must be used within \`${t}\``)}]}(Fo,{contentName:jo,titleName:Do,docsSlug:"dialog"}),Vo=({titleId:e})=>{const t=Wo(Fo),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{if(e){document.getElementById(e)||console.error(r)}},[r,e]),null},Ho=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Wo("DialogDescriptionWarning").contentName}}.`;return a.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");if(t&&n){document.getElementById(t)||console.warn(r)}},[r,e,t]),null},Go=bo,$o=yo,Ko=ko,qo=Co,Zo=Po,Jo=Io,Yo=Mo,Xo=Oo;function Qo(e,t){if(null==e)return{};var r,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}var ec=["color"],tc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Qo(e,ec);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),rc=["color"],nc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Qo(e,rc);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),ac=["color"],sc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Qo(e,ac);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))}),ic=["color"],oc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Qo(e,ic);return t.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s,{ref:r}),t.createElement("path",{d:"M10 6.5C10 8.433 8.433 10 6.5 10C4.567 10 3 8.433 3 6.5C3 4.567 4.567 3 6.5 3C8.433 3 10 4.567 10 6.5ZM9.30884 10.0159C8.53901 10.6318 7.56251 11 6.5 11C4.01472 11 2 8.98528 2 6.5C2 4.01472 4.01472 2 6.5 2C8.98528 2 11 4.01472 11 6.5C11 7.56251 10.6318 8.53901 10.0159 9.30884L12.8536 12.1464C13.0488 12.3417 13.0488 12.6583 12.8536 12.8536C12.6583 13.0488 12.3417 13.0488 12.1464 12.8536L9.30884 10.0159Z",fill:a,fillRule:"evenodd",clipRule:"evenodd"}))});const cc=t.createContext({container:null,setContainer:()=>{}}),lc=t.memo(({children:r})=>{const[n,a]=t.useState(null),s=t.useMemo(()=>({container:n,setContainer:a}),[n]),i=t.useMemo(()=>r,[r]);return e.jsxs(cc.Provider,{value:s,children:[i,e.jsx("div",{ref:a,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});lc.displayName="PortalProvider";const uc=Go,dc=$o,pc=Ko,mc=a.forwardRef(({className:t,...r},n)=>e.jsx(qo,{ref:n,className:Se("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r}));mc.displayName=qo.displayName;const hc=a.forwardRef(({className:t,children:r,...n},s)=>{const{container:i}=a.useContext(cc);return e.jsxs(pc,{container:i,children:[e.jsx(mc,{}),e.jsxs(Zo,{ref:s,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...n,children:[r,e.jsxs(Xo,{className:"absolute right-4 rtl:right-auto rtl:left-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(sc,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});hc.displayName=Zo.displayName;const fc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-start",t),...r});fc.displayName="DialogHeader";const gc=a.forwardRef(({className:t,...r},n)=>e.jsx(Jo,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",t),...r}));gc.displayName=Jo.displayName;const bc=a.forwardRef(({className:t,...r},n)=>e.jsx(Yo,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));bc.displayName=Yo.displayName;var vc=Symbol("radix.slottable");var yc="AlertDialog",[xc]=_s(yc,[ho]),wc=ho(),Sc=t=>{const{__scopeAlertDialog:r,...n}=t,a=wc(r);return e.jsx(Go,{...a,...n,modal:!0})};Sc.displayName=yc;var kc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=wc(n);return e.jsx($o,{...s,...a,ref:r})});kc.displayName="AlertDialogTrigger";var Ec=t=>{const{__scopeAlertDialog:r,...n}=t,a=wc(r);return e.jsx(Ko,{...a,...n})};Ec.displayName="AlertDialogPortal";var Cc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=wc(n);return e.jsx(qo,{...s,...a,ref:r})});Cc.displayName="AlertDialogOverlay";var Nc="AlertDialogContent",[Ac,jc]=xc(Nc),Pc=function(t){const r=({children:t})=>e.jsx(e.Fragment,{children:t});return r.displayName=`${t}.Slottable`,r.__radixId=vc,r}("AlertDialogContent"),Tc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,children:s,...i}=t,o=wc(n),c=a.useRef(null),l=gs(r,c),u=a.useRef(null);return e.jsx(Bo,{contentName:Nc,titleName:_c,docsSlug:"alert-dialog",children:e.jsx(Ac,{scope:n,cancelRef:u,children:e.jsxs(Zo,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:Ts(i.onOpenAutoFocus,e=>{e.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Pc,{children:s}),e.jsx(Oc,{contentRef:c})]})})})});Tc.displayName=Nc;var _c="AlertDialogTitle",Rc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=wc(n);return e.jsx(Jo,{...s,...a,ref:r})});Rc.displayName=_c;var Dc="AlertDialogDescription",Ic=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=wc(n);return e.jsx(Yo,{...s,...a,ref:r})});Ic.displayName=Dc;var Uc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=wc(n);return e.jsx(Xo,{...s,...a,ref:r})});Uc.displayName="AlertDialogAction";var Mc="AlertDialogCancel",Lc=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,{cancelRef:s}=jc(Mc,n),i=wc(n),o=gs(r,s);return e.jsx(Xo,{...i,...a,ref:o})});Lc.displayName=Mc;var Oc=({contentRef:e})=>{const t=`\`${Nc}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Nc}\` by passing a \`${Dc}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Nc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return a.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},zc=Cc,Fc=Tc,Bc=Uc,Wc=Lc,Vc=Rc,Hc=Ic;const Gc=Sc,$c=kc,Kc=Ec,qc=a.forwardRef(({className:t,...r},n)=>e.jsx(zc,{className:Se("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...r,ref:n}));qc.displayName=zc.displayName;const Zc=a.forwardRef(({className:t,...r},n)=>{const{container:s}=a.useContext(cc);return e.jsxs(Kc,{container:s,children:[e.jsx(qc,{}),e.jsx(Fc,{ref:n,className:Se("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",t),...r})]})});Zc.displayName=Fc.displayName;const Jc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-start",t),...r});Jc.displayName="AlertDialogHeader";const Yc=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});Yc.displayName="AlertDialogFooter";const Xc=a.forwardRef(({className:t,...r},n)=>e.jsx(Vc,{ref:n,className:Se("text-lg font-semibold",t),...r}));Xc.displayName=Vc.displayName;const Qc=a.forwardRef(({className:t,...r},n)=>e.jsx(Hc,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));Qc.displayName=Hc.displayName;const el=a.forwardRef(({className:t,...r},n)=>e.jsx(Bc,{ref:n,className:Se(js(),t),...r}));el.displayName=Bc.displayName;const tl=a.forwardRef(({className:t,...r},n)=>e.jsx(Wc,{ref:n,className:Se(js({variant:"outline"}),"mt-2 sm:mt-0",t),...r}));function rl({className:t,...r}){return e.jsx("div",{className:Se("animate-pulse rounded-md bg-primary/10",t),...r})}function nl(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(rl,{className:"h-10 w-full"}),e.jsx(rl,{className:"h-10 w-full"}),e.jsx(rl,{className:"h-10 w-full"})]})}tl.displayName=Wc.displayName;const al=({workspace:r})=>{const[n,a]=t.useState(!1),{deleteWorkspace:s}=Pa(),{user:i}=hk(),{settings:o}=Sn(),{t:c}=an();if(1===(o?.workspace?.maxWorkspacesPerUser??0))return null;if(!r)return e.jsx(nl,{});const l=ja(r,i?.id??null);return"admin"===l?.toLowerCase()?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-destructive",children:c("danger.title")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:c("danger.deleteDescription")})]}),e.jsxs(Gc,{children:[e.jsx($c,{asChild:!0,children:e.jsxs(Ps,{variant:"destructive",disabled:n,progress:n,children:[e.jsx(ls,{className:"h-4 w-4 me-2"}),c("danger.deleteWorkspace")]})}),e.jsxs(Zc,{children:[e.jsxs(Jc,{children:[e.jsx(Xc,{children:c("danger.deleteConfirm")}),e.jsx(Qc,{children:c("danger.deleteConfirmDescription")})]}),e.jsxs(Yc,{children:[e.jsx(tl,{disabled:n,children:c("settings.common.cancel")}),e.jsx(el,{onClick:async()=>{a(!0);try{await s(r._id)}catch(e){Re(e,{component:"WorkspaceSettingsDanger",action:"handleDeleteWorkspace",metadata:{workspaceId:r._id}}),alert(e instanceof Error?e.message:c("danger.failedToDelete"))}finally{a(!1)}},disabled:n,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:n?e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"me-2 h-4 w-4 animate-spin"}),c("danger.deleting")]}):c("danger.deleteWorkspace")})]})]})]})]}):e.jsx("div",{className:"space-y-4",children:e.jsx("div",{className:"text-red-500",children:c("danger.adminOnly")})})};function sl(e){const t=a.useRef({value:e,previous:e});return a.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function il(e){const[t,r]=a.useState(void 0);return Ds(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let a,s;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;a=t.inlineSize,s=t.blockSize}else a=e.offsetWidth,s=e.offsetHeight;r({width:a,height:s})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}var ol="Switch",[cl]=_s(ol),[ll,ul]=cl(ol),dl=a.forwardRef((t,r)=>{const{__scopeSwitch:n,name:s,checked:i,defaultChecked:o,required:c,disabled:l,value:u="on",onCheckedChange:d,form:p,...m}=t,[h,f]=a.useState(null),g=gs(r,e=>f(e)),b=a.useRef(!1),v=!h||(p||!!h.closest("form")),[y,x]=Os({prop:i,defaultProp:o??!1,onChange:d,caller:ol});return e.jsxs(ll,{scope:n,checked:y,disabled:l,children:[e.jsx(Ws.button,{type:"button",role:"switch","aria-checked":y,"aria-required":c,"data-state":fl(y),"data-disabled":l?"":void 0,disabled:l,value:u,...m,ref:g,onClick:Ts(t.onClick,e=>{x(e=>!e),v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),v&&e.jsx(hl,{control:h,bubbles:!b.current,name:s,value:u,checked:y,required:c,disabled:l,form:p,style:{transform:"translateX(-100%)"}})]})});dl.displayName=ol;var pl="SwitchThumb",ml=a.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,s=ul(pl,n);return e.jsx(Ws.span,{"data-state":fl(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:r})});ml.displayName=pl;var hl=a.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=gs(c,o),u=sl(n),d=il(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[u,n,s]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function fl(e){return e?"checked":"unchecked"}hl.displayName="SwitchBubbleInput";var gl=dl,bl=ml;const vl=a.forwardRef(({className:t,...r},n)=>e.jsx(gl,{className:Se("peer inline-flex h-[20px] w-[36px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...r,ref:n,children:e.jsx(bl,{className:Se("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));vl.displayName=gl.displayName;const yl=({workspaceId:r})=>{const{t:n}=an(),{allFeatures:a,updateFeature:s,getWorkspace:i}=Pa(),{user:o}=hk(),[c,l]=t.useState({}),[u,d]=t.useState(null),[p,m]=t.useState(null),h=t.useRef(null);if(t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]),t.useEffect(()=>{i(r).then(m)},[r]),!p)return e.jsx(nl,{});const f=Aa(p,o?.id??null);return e.jsxs("div",{children:[u&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:u})]}),e.jsxs("div",{className:"flex flex-col gap-y-3.5 pe-4",children:[!f&&e.jsx("div",{className:"text-red-500",children:n("features.ownerOnly")}),!a.length&&e.jsx("div",{className:"text-muted-foreground",children:n("features.noFeatures")}),a.length>0&&e.jsx("div",{className:"flex flex-col gap-y-3.5",children:a.map(t=>{const r=p?.features?.[t.slug],i=null!==c[t.slug]&&void 0!==c[t.slug],o=c[t.slug],u=n("features.actionStatus",{action:!0===o?"enabling":!1===o?"disabling":"none"});return e.jsxs("div",{className:"flex items-center gap-x-2 justify-between w-full",children:[e.jsxs("div",{className:"flex gap-x-2 flex-col",children:[e.jsx("h3",{className:"font-medium text-ellipsis",children:t.name}),e.jsx("p",{className:"text-muted-foreground",children:t.description})]}),i?e.jsxs("div",{className:"flex items-center gap-x-1",children:[e.jsx(es,{className:"h-4 w-4 animate-spin text-gray-500"}),e.jsxs("span",{className:"text-sm text-gray-600",children:[u,"..."]})]}):e.jsx(vl,{disabled:!f,checked:r??t.defaultValue,onCheckedChange:e=>async function(e,t){if(p){l(r=>({...r,[e]:t})),d(null);try{const r=await s(p._id,e,t);m(r);const i=a.find(t=>t.slug===e);d(n("features.updateSuccess",{feature:i?.name||"Feature",enabled:String(t)})),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{d(null)},5e3)}catch(t){Re(t,{component:"WorkspaceSettingsFeatures",action:"updateFeature",metadata:{workspaceId:p._id,featureKey:e}})}finally{l(t=>({...t,[e]:null}))}}}(t.slug,e)})]},t._id)})})]})]})};var xl=e=>"checkbox"===e.type,wl=e=>e instanceof Date,Sl=e=>null==e;const kl=e=>"object"==typeof e;var El=e=>!Sl(e)&&!Array.isArray(e)&&kl(e)&&!wl(e),Cl=e=>El(e)&&e.target?xl(e.target)?e.target.checked:e.target.value:e,Nl=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Al="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function jl(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(Al&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||El(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return El(t)&&t.hasOwnProperty("isPrototypeOf")})(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=jl(e[t]));return n}var Pl=e=>/^\w*$/.test(e),Tl=e=>void 0===e,_l=e=>Array.isArray(e)?e.filter(Boolean):[],Rl=e=>_l(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Dl=(e,t,r)=>{if(!t||!El(e))return r;const n=(Pl(t)?[t]:Rl(t)).reduce((e,t)=>Sl(e)?e:e[t],e);return Tl(n)||n===e?Tl(e[t])?r:e[t]:n},Il=e=>"boolean"==typeof e,Ul=e=>"function"==typeof e,Ml=(e,t,r)=>{let n=-1;const a=Pl(t)?[t]:Rl(t),s=a.length,i=s-1;for(;++n<s;){const t=a[n];let s=r;if(n!==i){const r=e[t];s=El(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=s,e=e[t]}};const Ll="blur",Ol="focusout",zl="change",Fl="onBlur",Bl="onChange",Wl="onSubmit",Vl="onTouched",Hl="all",Gl="max",$l="min",Kl="maxLength",ql="minLength",Zl="pattern",Jl="required",Yl="validate",Xl=t.createContext(null);Xl.displayName="HookFormControlContext";const Ql=()=>t.useContext(Xl);var eu=(e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(a,s,{get:()=>{const a=s;return t._proxyFormState[a]!==Hl&&(t._proxyFormState[a]=!n||Hl),r&&(r[a]=!0),e[a]}});return a};const tu="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var ru=e=>"string"==typeof e,nu=(e,t,r,n,a)=>ru(e)?(n&&t.watch.add(e),Dl(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),Dl(r,e))):(n&&(t.watchAll=!0),r),au=e=>Sl(e)||!kl(e);function su(e,t,r=new WeakSet){if(au(e)||au(t))return Object.is(e,t);if(wl(e)&&wl(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const s of n){const n=e[s];if(!a.includes(s))return!1;if("ref"!==s){const e=t[s];if(wl(n)&&wl(e)||El(n)&&El(e)||Array.isArray(n)&&Array.isArray(e)?!su(n,e,r):!Object.is(n,e))return!1}}return!0}function iu(e){const r=Ql(),{name:n,disabled:a,control:s=r,shouldUnregister:i,defaultValue:o,exact:c=!0}=e,l=Nl(s._names.array,n),u=t.useMemo(()=>Dl(s._formValues,n,Dl(s._defaultValues,n,o)),[s,n,o]),d=function(e){const r=Ql(),{control:n=r,name:a,defaultValue:s,disabled:i,exact:o,compute:c}=e||{},l=t.useRef(s),u=t.useRef(c),d=t.useRef(void 0),p=t.useRef(n),m=t.useRef(a);u.current=c;const[h,f]=t.useState(()=>{const e=n._getWatch(a,l.current);return u.current?u.current(e):e}),g=t.useCallback(e=>{const t=nu(a,n._names,e||n._formValues,!1,l.current);return u.current?u.current(t):t},[n._formValues,n._names,a]),b=t.useCallback(e=>{if(!i){const t=nu(a,n._names,e||n._formValues,!1,l.current);if(u.current){const e=u.current(t);su(e,d.current)||(f(e),d.current=e)}else f(t)}},[n._formValues,n._names,i,a]);tu(()=>(p.current===n&&su(m.current,a)||(p.current=n,m.current=a,b()),n._subscribe({name:a,formState:{values:!0},exact:o,callback:e=>{b(e.values)}})),[n,o,a,b]),t.useEffect(()=>n._removeUnmounted());const v=p.current!==n,y=m.current,x=t.useMemo(()=>{if(i)return null;const e=!v&&!su(y,a);return v||e?g():null},[i,v,a,y,g]);return null!==x?x:h}({control:s,name:n,defaultValue:u,exact:c}),p=function(e){const r=Ql(),{control:n=r,disabled:a,name:s,exact:i}=e||{},[o,c]=t.useState(n._formState),l=t.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return tu(()=>n._subscribe({name:s,formState:l.current,exact:i,callback:e=>{!a&&c({...n._formState,...e})}}),[s,a,i]),t.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),t.useMemo(()=>eu(o,n,l.current,!1),[o,n])}({control:s,name:n,exact:c}),m=t.useRef(e),h=t.useRef(void 0),f=t.useRef(s.register(n,{...e.rules,value:d,...Il(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Dl(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Dl(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Dl(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Dl(p.validatingFields,n)},error:{enumerable:!0,get:()=>Dl(p.errors,n)}}),[p,n]),b=t.useCallback(e=>f.current.onChange({target:{value:Cl(e),name:n},type:zl}),[n]),v=t.useCallback(()=>f.current.onBlur({target:{value:Dl(s._formValues,n),name:n},type:Ll}),[n,s._formValues]),y=t.useCallback(e=>{const t=Dl(s._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>Ul(e.focus)&&e.focus(),select:()=>Ul(e.select)&&e.select(),setCustomValidity:t=>Ul(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>Ul(e.reportValidity)&&e.reportValidity()})},[s._fields,n]),x=t.useMemo(()=>({name:n,value:d,...Il(a)||p.disabled?{disabled:p.disabled||a}:{},onChange:b,onBlur:v,ref:y}),[n,a,p.disabled,b,v,y,d]);return t.useEffect(()=>{const e=s._options.shouldUnregister||i,t=h.current;t&&t!==n&&!l&&s.unregister(t),s.register(n,{...m.current.rules,...Il(m.current.disabled)?{disabled:m.current.disabled}:{}});const r=(e,t)=>{const r=Dl(s._fields,e);r&&r._f&&(r._f.mount=t)};if(r(n,!0),e){const e=jl(Dl(s._options.defaultValues,n,m.current.defaultValue));Ml(s._defaultValues,n,e),Tl(Dl(s._formValues,n))&&Ml(s._formValues,n,e)}return!l&&s.register(n),h.current=n,()=>{(l?e&&!s._state.action:e)?s.unregister(n):r(n,!1)}},[n,s,l,i]),t.useEffect(()=>{s._setDisabledField({disabled:a,name:n})},[a,n,s]),t.useMemo(()=>({field:x,formState:p,fieldState:g}),[x,p,g])}const ou=e=>e.render(iu(e)),cu=t.createContext(null);cu.displayName="HookFormContext";const lu=e=>{const{children:r,watch:n,getValues:a,getFieldState:s,setError:i,clearErrors:o,setValue:c,trigger:l,formState:u,resetField:d,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}=e;return t.createElement(cu.Provider,{value:t.useMemo(()=>({watch:n,getValues:a,getFieldState:s,setError:i,clearErrors:o,setValue:c,trigger:l,formState:u,resetField:d,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}),[o,f,u,s,a,m,g,p,d,i,b,c,v,l,h,n])},t.createElement(Xl.Provider,{value:f},r))};var uu=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},du=e=>Array.isArray(e)?e:[e],pu=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function mu(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],s=t[n];if(a&&El(a)&&s){const e=mu(a,s);El(e)&&(r[n]=e)}else e[n]&&(r[n]=s)}return r}var hu=e=>El(e)&&!Object.keys(e).length,fu=e=>"file"===e.type,gu=e=>{if(!Al)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},bu=e=>"select-multiple"===e.type,vu=e=>"radio"===e.type,yu=e=>gu(e)&&e.isConnected;function xu(e,t){const r=Array.isArray(t)?t:Pl(t)?[t]:Rl(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Tl(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,s=r[a];return n&&delete n[s],0!==a&&(El(n)&&hu(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Tl(e[t]))return!1;return!0}(n))&&xu(e,r.slice(0,-1)),e}function wu(e){return Array.isArray(e)||El(e)&&!(e=>{for(const t in e)if(Ul(e[t]))return!0;return!1})(e)}function Su(e,t={}){for(const r in e){const n=e[r];wu(n)?(t[r]=Array.isArray(n)?[]:{},Su(n,t[r])):Tl(n)||(t[r]=!0)}return t}function ku(e,t,r){r||(r=Su(t));for(const n in e){const a=e[n];if(wu(a))Tl(t)||au(r[n])?r[n]=Su(a,Array.isArray(a)?[]:{}):ku(a,Sl(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!su(a,e)}}return r}const Eu={value:!1,isValid:!1},Cu={value:!0,isValid:!0};var Nu=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Tl(e[0].attributes.value)?Tl(e[0].value)||""===e[0].value?Cu:{value:e[0].value,isValid:!0}:Cu:Eu}return Eu},Au=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Tl(e)?e:t?""===e?NaN:e?+e:e:r&&ru(e)?new Date(e):n?n(e):e;const ju={isValid:!1,value:null};var Pu=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,ju):ju;function Tu(e){const t=e.ref;return fu(t)?t.files:vu(t)?Pu(e.refs).value:bu(t)?[...t.selectedOptions].map(({value:e})=>e):xl(t)?Nu(e.refs).value:Au(Tl(t.value)?e.ref.value:t.value,e)}var _u=e=>e instanceof RegExp,Ru=e=>Tl(e)?e:_u(e)?e.source:El(e)?_u(e.value)?e.value.source:e.value:e,Du=e=>({isOnSubmit:!e||e===Wl,isOnBlur:e===Fl,isOnChange:e===Bl,isOnAll:e===Hl,isOnTouch:e===Vl});const Iu="AsyncFunction";var Uu=e=>!!e&&!!e.validate&&!!(Ul(e.validate)&&e.validate.constructor.name===Iu||El(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Iu)),Mu=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Lu=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=Dl(e,a);if(r){const{_f:e,...s}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(Lu(s,t))break}else if(El(s)&&Lu(s,t))break}}};function Ou(e,t,r){const n=Dl(e,r);if(n||Pl(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),s=Dl(t,n),i=Dl(e,n);if(s&&!Array.isArray(s)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};a.pop()}return{name:r}}var zu=(e,t,r)=>{const n=du(Dl(e,r));return Ml(n,"root",t[r]),Ml(e,r,n),e};function Fu(e,t,r="validate"){if(ru(e)||Array.isArray(e)&&e.every(ru)||Il(e)&&!e)return{type:r,message:ru(e)?e:"",ref:t}}var Bu=e=>El(e)&&!_u(e)?e:{value:e,message:""},Wu=async(e,t,r,n,a,s)=>{const{ref:i,refs:o,required:c,maxLength:l,minLength:u,min:d,max:p,pattern:m,validate:h,name:f,valueAsNumber:g,mount:b}=e._f,v=Dl(r,f);if(!b||t.has(f))return{};const y=o?o[0]:i,x=e=>{a&&y.reportValidity&&(y.setCustomValidity(Il(e)?"":e||""),y.reportValidity())},w={},S=vu(i),k=xl(i),E=S||k,C=(g||fu(i))&&Tl(i.value)&&Tl(v)||gu(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,N=uu.bind(null,f,n,w),A=(e,t,r,n=Kl,a=ql)=>{const s=e?t:r;w[f]={type:e?n:a,message:s,ref:i,...N(e?n:a,s)}};if(s?!Array.isArray(v)||!v.length:c&&(!E&&(C||Sl(v))||Il(v)&&!v||k&&!Nu(o).isValid||S&&!Pu(o).isValid)){const{value:e,message:t}=ru(c)?{value:!!c,message:c}:Bu(c);if(e&&(w[f]={type:Jl,message:t,ref:y,...N(Jl,t)},!n))return x(t),w}if(!(C||Sl(d)&&Sl(p))){let e,t;const r=Bu(p),a=Bu(d);if(Sl(v)||isNaN(v)){const n=i.valueAsDate||new Date(v),s=e=>new Date((new Date).toDateString()+" "+e),o="time"==i.type,c="week"==i.type;ru(r.value)&&v&&(e=o?s(v)>s(r.value):c?v>r.value:n>new Date(r.value)),ru(a.value)&&v&&(t=o?s(v)<s(a.value):c?v<a.value:n<new Date(a.value))}else{const n=i.valueAsNumber||(v?+v:v);Sl(r.value)||(e=n>r.value),Sl(a.value)||(t=n<a.value)}if((e||t)&&(A(!!e,r.message,a.message,Gl,$l),!n))return x(w[f].message),w}if((l||u)&&!C&&(ru(v)||s&&Array.isArray(v))){const e=Bu(l),t=Bu(u),r=!Sl(e.value)&&v.length>+e.value,a=!Sl(t.value)&&v.length<+t.value;if((r||a)&&(A(r,e.message,t.message),!n))return x(w[f].message),w}if(m&&!C&&ru(v)){const{value:e,message:t}=Bu(m);if(_u(e)&&!v.match(e)&&(w[f]={type:Zl,message:t,ref:i,...N(Zl,t)},!n))return x(t),w}if(h)if(Ul(h)){const e=Fu(await h(v,r),y);if(e&&(w[f]={...e,...N(Yl,e.message)},!n))return x(e.message),w}else if(El(h)){let e={};for(const t in h){if(!hu(e)&&!n)break;const a=Fu(await h[t](v,r),y,t);a&&(e={...a,...N(t,a.message)},x(a.message),n&&(w[f]=e))}if(!hu(e)&&(w[f]={ref:y,...e},!n))return w}return x(!0),w};const Vu={mode:Wl,reValidateMode:Bl,shouldFocusError:!0};function Hu(e={}){let t,r={...Vu,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ul(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},s=(El(r.defaultValues)||El(r.values))&&jl(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:jl(s),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},c={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...u};let p={...d};const m={array:pu(),state:pu()},h=r.criteriaMode===Hl,f=async e=>{if(!o.keepIsValid&&!r.disabled&&(d.isValid||p.isValid||e)){let e;r.resolver?(e=hu((await x()).errors),g()):e=await w(a,!0),e!==n.isValid&&m.state.next({isValid:e})}},g=(e,t)=>{!r.disabled&&(d.isValidating||d.validatingFields||p.isValidating||p.validatingFields)&&((e||Array.from(c.mount)).forEach(e=>{e&&(t?Ml(n.validatingFields,e,t):xu(n.validatingFields,e))}),m.state.next({validatingFields:n.validatingFields,isValidating:!hu(n.validatingFields)}))},b=(e,t,r,n)=>{const c=Dl(a,e);if(c){const a=Dl(i,e,Tl(r)?Dl(s,e):r);Tl(a)||n&&n.defaultChecked||t?Ml(i,e,t?a:Tu(c._f)):E(e,a),o.mount&&!o.action&&f()}},v=(e,t,a,i,o)=>{let c=!1,l=!1;const u={name:e};if(!r.disabled){if(!a||i){(d.isDirty||p.isDirty)&&(l=n.isDirty,n.isDirty=u.isDirty=S(),c=l!==u.isDirty);const r=su(Dl(s,e),t);l=!!Dl(n.dirtyFields,e),r?xu(n.dirtyFields,e):Ml(n.dirtyFields,e,!0),u.dirtyFields=n.dirtyFields,c=c||(d.dirtyFields||p.dirtyFields)&&l!==!r}if(a){const t=Dl(n.touchedFields,e);t||(Ml(n.touchedFields,e,a),u.touchedFields=n.touchedFields,c=c||(d.touchedFields||p.touchedFields)&&t!==a)}c&&o&&m.state.next(u)}return c?u:{}},y=(e,a,s,i)=>{const o=Dl(n.errors,e),c=(d.isValid||p.isValid)&&Il(a)&&n.isValid!==a;var u;if(r.delayError&&s?(u=()=>((e,t)=>{Ml(n.errors,e,t),m.state.next({errors:n.errors})})(e,s),t=e=>{clearTimeout(l),l=setTimeout(u,e)},t(r.delayError)):(clearTimeout(l),t=null,s?Ml(n.errors,e,s):xu(n.errors,e)),(s?!su(o,s):o)||!hu(i)||c){const t={...i,...c&&Il(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},m.state.next(t)}},x=async e=>{g(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=Dl(t,r);e&&Ml(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||c.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return t},w=async(t,a,s={valid:!0})=>{for(const o in t){const l=t[o];if(l){const{_f:t,...o}=l;if(t){const o=c.array.has(t.name),u=l._f&&Uu(l._f);u&&d.validatingFields&&g([t.name],!0);const p=await Wu(l,c.disabled,i,h,r.shouldUseNativeValidation&&!a,o);if(u&&d.validatingFields&&g([t.name]),p[t.name]&&(s.valid=!1,a||e.shouldUseNativeValidation))break;!a&&(Dl(p,t.name)?o?zu(n.errors,p,t.name):Ml(n.errors,t.name,p[t.name]):xu(n.errors,t.name))}!hu(o)&&await w(o,a,s)}}return s.valid},S=(e,t)=>!r.disabled&&(e&&t&&Ml(i,e,t),!su(T(),s)),k=(e,t,r)=>nu(e,c,{...o.mount?i:Tl(t)?s:ru(e)?{[e]:t}:t},r,t),E=(e,t,r={})=>{const n=Dl(a,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&Ml(i,e,Au(t,r)),s=gu(r.ref)&&Sl(t)?"":t,bu(r.ref)?[...r.ref.options].forEach(e=>e.selected=s.includes(e.value)):r.refs?xl(r.ref)?r.refs.forEach(e=>{e.defaultChecked&&e.disabled||(Array.isArray(s)?e.checked=!!s.find(t=>t===e.value):e.checked=s===e.value||!!s)}):r.refs.forEach(e=>e.checked=e.value===s):fu(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||m.state.next({name:e,values:jl(i)})))}(r.shouldDirty||r.shouldTouch)&&v(e,s,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&P(e)},C=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const s=t[n],i=e+"."+n,o=Dl(a,i);(c.array.has(e)||El(s)||o&&!o._f)&&!wl(s)?C(i,s,r):E(i,s,r)}},N=(e,t,r={})=>{const l=Dl(a,e),u=c.array.has(e),h=jl(t);Ml(i,e,h),u?(m.array.next({name:e,values:jl(i)}),(d.isDirty||d.dirtyFields||p.isDirty||p.dirtyFields)&&r.shouldDirty&&m.state.next({name:e,dirtyFields:ku(s,i),isDirty:S(e,h)})):!l||l._f||Sl(h)?E(e,h,r):C(e,h,r),Mu(e,c)?m.state.next({...n,name:e,values:jl(i)}):m.state.next({name:o.mount?e:void 0,values:jl(i)})},A=async e=>{o.mount=!0;const s=e.target;let l=s.name,u=!0;const b=Dl(a,l),S=e=>{u=Number.isNaN(e)||wl(e)&&isNaN(e.getTime())||su(e,Dl(i,l,e))},k=Du(r.mode),E=Du(r.reValidateMode);if(b){let o,C;const N=s.type?Tu(b._f):Cl(e),A=e.type===Ll||e.type===Ol,j=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(b._f)&&!r.resolver&&!Dl(n.errors,l)&&!b._f.deps||((e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e))(A,Dl(n.touchedFields,l),n.isSubmitted,E,k),T=Mu(l,c,A);Ml(i,l,N),A?s&&s.readOnly||(b._f.onBlur&&b._f.onBlur(e),t&&t(0)):b._f.onChange&&b._f.onChange(e);const _=v(l,N,A),R=!hu(_)||T;if(!A&&m.state.next({name:l,type:e.type,values:jl(i)}),j)return(d.isValid||p.isValid)&&("onBlur"===r.mode?A&&f():A||f()),R&&m.state.next({name:l,...T?{}:_});if(!A&&T&&m.state.next({...n}),r.resolver){const{errors:e}=await x([l]);if(g([l]),S(N),u){const t=Ou(n.errors,a,l),r=Ou(e,a,t.name||l);o=r.error,l=r.name,C=hu(e)}}else g([l],!0),o=(await Wu(b,c.disabled,i,h,r.shouldUseNativeValidation))[l],g([l]),S(N),u&&(o?C=!1:(d.isValid||p.isValid)&&(C=await w(a,!0)));u&&(b._f.deps&&(!Array.isArray(b._f.deps)||b._f.deps.length>0)&&P(b._f.deps),y(l,C,o,_))}},j=(e,t)=>{if(Dl(n.errors,t)&&e.focus)return e.focus(),1},P=async(e,t={})=>{let s,i;const o=du(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await x(e);if(g(e),e)for(const r of e){const e=Dl(t,r);e?Ml(n.errors,r,e):xu(n.errors,r)}else n.errors=t;return t})(Tl(e)?e:o);s=hu(t),i=e?!o.some(e=>Dl(t,e)):s}else e?(i=(await Promise.all(o.map(async e=>{const t=Dl(a,e);return await w(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&f()):i=s=await w(a);return m.state.next({...!ru(e)||(d.isValid||p.isValid)&&s!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:s}:{},errors:n.errors}),t.shouldFocus&&!i&&Lu(a,j,e?o:c.mount),i},T=(e,t)=>{let r={...o.mount?i:s};return t&&(r=mu(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),Tl(e)?r:ru(e)?Dl(r,e):e.map(e=>Dl(r,e))},_=(e,t)=>({invalid:!!Dl((t||n).errors,e),isDirty:!!Dl((t||n).dirtyFields,e),error:Dl((t||n).errors,e),isValidating:!!Dl(n.validatingFields,e),isTouched:!!Dl((t||n).touchedFields,e)}),R=(e,t,r)=>{const s=(Dl(a,e,{_f:{}})._f||{}).ref,i=Dl(n.errors,e)||{},{ref:o,message:c,type:l,...u}=i;Ml(n.errors,e,{...u,...t,ref:s}),m.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&s&&s.focus&&s.focus()},D=e=>m.state.subscribe({next:t=>{var r,a,o;r=e.name,a=t.name,o=e.exact,r&&a&&r!==a&&!du(r).some(e=>e&&(o?e===a:e.startsWith(a)||a.startsWith(e)))||!((e,t,r,n)=>{r(e);const{name:a,...s}=e;return hu(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(e=>t[e]===(!n||Hl))})(t,e.formState||d,B,e.reRenderRoot)||e.callback({values:{...i},...n,...t,defaultValues:s})}}).unsubscribe,I=(e,t={})=>{for(const o of e?du(e):c.mount)c.mount.delete(o),c.array.delete(o),t.keepValue||(xu(a,o),xu(i,o)),!t.keepError&&xu(n.errors,o),!t.keepDirty&&xu(n.dirtyFields,o),!t.keepTouched&&xu(n.touchedFields,o),!t.keepIsValidating&&xu(n.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&xu(s,o);m.state.next({values:jl(i)}),m.state.next({...n,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&f()},U=({disabled:e,name:t})=>{if(Il(e)&&o.mount||e||c.disabled.has(t)){const r=c.disabled.has(t)!==!!e;e?c.disabled.add(t):c.disabled.delete(t),r&&o.mount&&!o.action&&f()}},M=(e,t={})=>{let n=Dl(a,e);const i=Il(t.disabled)||Il(r.disabled);return Ml(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),n?U({disabled:Il(t.disabled)?t.disabled:r.disabled,name:e}):b(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:Ru(t.min),max:Ru(t.max),minLength:Ru(t.minLength),maxLength:Ru(t.maxLength),pattern:Ru(t.pattern)}:{},name:e,onChange:A,onBlur:A,ref:i=>{if(i){M(e,t),n=Dl(a,e);const r=Tl(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,o=(e=>vu(e)||xl(e))(r),c=n._f.refs||[];if(o?c.find(e=>e===r):r===n._f.ref)return;Ml(a,e,{_f:{...n._f,...o?{refs:[...c.filter(yu),r,...Array.isArray(Dl(s,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),b(e,!1,void 0,r)}else n=Dl(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!Nl(c.array,e)||!o.action)&&c.unMount.add(e)}}},L=()=>r.shouldFocusError&&Lu(a,j,c.mount),O=(e,t)=>async s=>{let o;s&&(s.preventDefault&&s.preventDefault(),s.persist&&s.persist());let l=jl(i);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();g(),n.errors=e,l=jl(t)}else await w(a);if(c.disabled.size)for(const e of c.disabled)xu(l,e);if(xu(n.errors,"root"),hu(n.errors)){m.state.next({errors:{}});try{await e(l,s)}catch(e){o=e}}else t&&await t({...n.errors},s),L(),setTimeout(L);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:hu(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},z=(e,t={})=>{const l=e?jl(e):s,u=jl(l),p=hu(e),h=p?s:u;if(t.keepDefaultValues||(s=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(ku(s,i))]);for(const t of Array.from(e)){const e=Dl(n.dirtyFields,t),r=Dl(i,t),a=Dl(h,t);e&&!Tl(r)?Ml(h,t,r):e||Tl(a)||N(t,a)}}else{if(Al&&Tl(e))for(const e of c.mount){const t=Dl(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(gu(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)N(e,Dl(h,e));else a={}}i=r.shouldUnregister?t.keepDefaultValues?jl(s):{}:jl(h),m.array.next({values:{...h}}),m.state.next({values:{...h}})}c={mount:t.keepDirtyValues?c.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!d.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!r.shouldUnregister&&!hu(h),o.watch=!!r.shouldUnregister,o.keepIsValid=!!t.keepIsValid,o.action=!1,t.keepErrors||(n.errors={}),m.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!p&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||su(e,s))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?{}:t.keepDirtyValues?t.keepDefaultValues&&i?ku(s,i):n.dirtyFields:t.keepDefaultValues&&e?ku(s,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1,defaultValues:s})},F=(e,t)=>z(Ul(e)?e(i):e,{...r.resetOptions,...t}),B=e=>{n={...n,...e}},W={control:{register:M,unregister:I,getFieldState:_,handleSubmit:O,setError:R,_subscribe:D,_runSchema:x,_updateIsValidating:g,_focusError:L,_getWatch:k,_getDirty:S,_setValid:f,_setFieldArray:(e,t=[],c,l,u=!0,h=!0)=>{if(l&&c&&!r.disabled){if(o.action=!0,h&&Array.isArray(Dl(a,e))){const t=c(Dl(a,e),l.argA,l.argB);u&&Ml(a,e,t)}if(h&&Array.isArray(Dl(n.errors,e))){const t=c(Dl(n.errors,e),l.argA,l.argB);u&&Ml(n.errors,e,t),((e,t)=>{!_l(Dl(e,t)).length&&xu(e,t)})(n.errors,e)}if((d.touchedFields||p.touchedFields)&&h&&Array.isArray(Dl(n.touchedFields,e))){const t=c(Dl(n.touchedFields,e),l.argA,l.argB);u&&Ml(n.touchedFields,e,t)}(d.dirtyFields||p.dirtyFields)&&(n.dirtyFields=ku(s,i)),m.state.next({name:e,isDirty:S(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ml(i,e,t)},_setDisabledField:U,_setErrors:e=>{n.errors=e,m.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>_l(Dl(o.mount?i:s,e,r.shouldUnregister?Dl(s,e,[]):[])),_reset:z,_resetDefaultValues:()=>Ul(r.defaultValues)&&r.defaultValues().then(e=>{F(e,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of c.unMount){const t=Dl(a,e);t&&(t._f.refs?t._f.refs.every(e=>!yu(e)):!yu(t._f.ref))&&I(e)}c.unMount=new Set},_disableForm:e=>{Il(e)&&(m.state.next({disabled:e}),Lu(a,(t,r)=>{const n=Dl(a,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:m,_proxyFormState:d,get _fields(){return a},get _formValues(){return i},get _state(){return o},set _state(e){o=e},get _defaultValues(){return s},get _names(){return c},set _names(e){c=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(o.mount=!0,p={...p,...e.formState},D({...e,formState:{...u,...e.formState}})),trigger:P,register:M,handleSubmit:O,watch:(e,t)=>Ul(e)?m.state.subscribe({next:r=>"values"in r&&e(k(void 0,t),r)}):k(e,t,!0),setValue:N,getValues:T,reset:F,resetField:(e,t={})=>{Dl(a,e)&&(Tl(t.defaultValue)?N(e,jl(Dl(s,e))):(N(e,t.defaultValue),Ml(s,e,jl(t.defaultValue))),t.keepTouched||xu(n.touchedFields,e),t.keepDirty||(xu(n.dirtyFields,e),n.isDirty=t.defaultValue?S(e,jl(Dl(s,e))):S()),t.keepError||(xu(n.errors,e),d.isValid&&f()),m.state.next({...n}))},clearErrors:e=>{e&&du(e).forEach(e=>xu(n.errors,e)),m.state.next({errors:e?n.errors:{}})},unregister:I,setError:R,setFocus:(e,t={})=>{const r=Dl(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&Ul(e.select)&&e.select()})}},getFieldState:_};return{...W,formControl:W}}function Gu(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,s]=t.useState({isDirty:!1,isValidating:!1,isLoading:Ul(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Ul(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!Ul(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=Hu(e);r.current={...n,formState:a}}const i=r.current.control;return i._options=e,tu(()=>{const e=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState}),reRenderRoot:!0});return s(e=>({...e,isReady:!0})),i._formState.isReady=!0,e},[i]),t.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),t.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),t.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),t.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),t.useEffect(()=>{if(i._proxyFormState.isDirty){const e=i._getDirty();e!==a.isDirty&&i._subjects.state.next({isDirty:e})}},[i,a.isDirty]),t.useEffect(()=>{var t;e.values&&!su(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),(null===(t=i._options.resetOptions)||void 0===t?void 0:t.keepIsValid)||i._setValid(),n.current=e.values,s(e=>({...e}))):i._resetDefaultValues()},[i,e.values]),t.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),r.current.formState=t.useMemo(()=>eu(a,i),[i,a]),r.current}const $u=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Dl(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Ku=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?$u(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>$u(t,r,e))}},qu=(e,t)=>{t.shouldUseNativeValidation&&Ku(e,t);const r={};for(const n in e){const a=Dl(t.fields,n),s=Object.assign(e[n]||{},{ref:a&&a.ref});if(Zu(t.names||Object.keys(e),n)){const e=Object.assign({},Dl(r,n));Ml(e,"root",s),Ml(r,n,e)}else Ml(r,n,s)}return r},Zu=(e,t)=>{const r=Ju(t);return e.some(e=>Ju(e).match(`^${r}\\.\\d+`))};function Ju(e){return e.replace(/\]|\[/g,"")}function Yu(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:i,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);const a=i.prototype,s=Object.keys(a);for(let e=0;e<s.length;e++){const t=s[e];t in r||(r[t]=a[t].bind(r))}}const a=r?.Parent??Object;class s extends a{}function i(e){var t;const a=r?.Parent?new s:this;n(a,e),(t=a._zod).deferred??(t.deferred=[]);for(const e of a._zod.deferred)e();return a}return Object.defineProperty(s,"name",{value:e}),Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:t=>!!(r?.Parent&&t instanceof r.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Xu extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Qu extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const ed={};function td(e){return ed}function rd(e){const t=Object.values(e).filter(e=>"number"==typeof e),r=Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t);return r}function nd(e,t){return"bigint"==typeof t?t.toString():t}function ad(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function sd(e){return null==e}function id(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const od=Symbol("evaluating");function cd(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==od)return void 0===n&&(n=od,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function ld(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function ud(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function dd(e){return JSON.stringify(e)}const pd="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function md(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const hd=ad(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function fd(e){if(!1===md(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const r=t.prototype;return!1!==md(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function gd(e){return fd(e)?{...e}:Array.isArray(e)?[...e]:e}const bd=new Set(["string","number","symbol"]);function vd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function yd(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function xd(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function wd(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(!0!==e.issues[r]?.continue)return!0;return!1}function Sd(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function kd(e){return"string"==typeof e?e:e?.message}function Ed(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=kd(e.inst?._zod.def?.error?.(e))??kd(t?.error?.(e))??kd(r.customError?.(e))??kd(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Cd(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Nd(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const Ad=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,nd,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},jd=Yu("$ZodError",Ad),Pd=Yu("$ZodError",Ad,{Parent:Error});const Td=e=>(t,r,n,a)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise)throw new Xu;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>Ed(e,s,td())));throw pd(t,a?.callee),t}return i.value},_d=Td(Pd),Rd=e=>async(t,r,n,a)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},s);if(i instanceof Promise&&(i=await i),i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>Ed(e,s,td())));throw pd(t,a?.callee),t}return i.value},Dd=Rd(Pd),Id=e=>(t,r,n)=>{const a=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},a);if(s instanceof Promise)throw new Xu;return s.issues.length?{success:!1,error:new(e??jd)(s.issues.map(e=>Ed(e,a,td())))}:{success:!0,data:s.value}},Ud=Id(Pd),Md=e=>async(t,r,n)=>{const a=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},a);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(e=>Ed(e,a,td())))}:{success:!0,data:s.value}},Ld=Md(Pd),Od=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Td(e)(t,r,a)},zd=e=>(t,r,n)=>Td(e)(t,r,n),Fd=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Rd(e)(t,r,a)},Bd=e=>async(t,r,n)=>Rd(e)(t,r,n),Wd=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Id(e)(t,r,a)},Vd=e=>(t,r,n)=>Id(e)(t,r,n),Hd=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Md(e)(t,r,a)},Gd=e=>async(t,r,n)=>Md(e)(t,r,n),$d=/^[cC][^\s-]{8,}$/,Kd=/^[0-9a-z]+$/,qd=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Zd=/^[0-9a-vA-V]{20}$/,Jd=/^[A-Za-z0-9]{27}$/,Yd=/^[a-zA-Z0-9_-]{21}$/,Xd=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Qd=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ep=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,tp=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const rp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,np=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ap=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,sp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ip=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,op=/^[A-Za-z0-9_-]*$/,cp=/^\+[1-9]\d{6,14}$/,lp="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",up=new RegExp(`^${lp}$`);function dp(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const pp=/^[^A-Z]*$/,mp=/^[^a-z]*$/,hp=Yu("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),fp=Yu("$ZodCheckMaxLength",(e,t)=>{var r;hp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!sd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;if(n.length<=t.maximum)return;const a=Cd(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),gp=Yu("$ZodCheckMinLength",(e,t)=>{var r;hp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!sd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const a=Cd(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),bp=Yu("$ZodCheckLengthEquals",(e,t)=>{var r;hp.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!sd(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{const n=r.value,a=n.length;if(a===t.length)return;const s=Cd(n),i=a>t.length;r.issues.push({origin:s,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),vp=Yu("$ZodCheckStringFormat",(e,t)=>{var r,n;hp.init(e,t),e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),yp=Yu("$ZodCheckRegex",(e,t)=>{vp.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),xp=Yu("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=pp),vp.init(e,t)}),wp=Yu("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=mp),vp.init(e,t)}),Sp=Yu("$ZodCheckIncludes",(e,t)=>{hp.init(e,t);const r=vd(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),kp=Yu("$ZodCheckStartsWith",(e,t)=>{hp.init(e,t);const r=new RegExp(`^${vd(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Ep=Yu("$ZodCheckEndsWith",(e,t)=>{hp.init(e,t);const r=new RegExp(`.*${vd(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Cp=Yu("$ZodCheckOverwrite",(e,t)=>{hp.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Np{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length)),n=t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e);for(const e of n)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Ap={major:4,minor:3,patch:6},jp=Yu("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ap;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const t of n)for(const r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,r)=>{let n,a=wd(e);for(const s of t){if(s._zod.def.when){if(!s._zod.def.when(e))continue}else if(a)continue;const t=e.issues.length,i=s._zod.check(e);if(i instanceof Promise&&!1===r?.async)throw new Xu;if(n||i instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(a||(a=wd(e,t)))});else{if(e.issues.length===t)continue;a||(a=wd(e,t))}}return n?n.then(()=>e):e},r=(r,a,s)=>{if(wd(r))return r.aborted=!0,r;const i=t(a,n,s);if(i instanceof Promise){if(!1===s.async)throw new Xu;return i.then(t=>e._zod.parse(t,s))}return e._zod.parse(i,s)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if("backward"===s.direction){const t=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,a,s)):r(t,a,s)}const i=e._zod.parse(a,s);if(i instanceof Promise){if(!1===s.async)throw new Xu;return i.then(e=>t(e,n,s))}return t(i,n,s)}}cd(e,"~standard",()=>({validate:t=>{try{const r=Ud(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return Ld(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Pp=Yu("$ZodString",(e,t)=>{var r;jp.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(r=e._zod.bag,new RegExp(`^${r?`[\\s\\S]{${r?.minimum??0},${r?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Tp=Yu("$ZodStringFormat",(e,t)=>{vp.init(e,t),Pp.init(e,t)}),_p=Yu("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Qd),Tp.init(e,t)}),Rp=Yu("$ZodUUID",(e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ep(e))}else t.pattern??(t.pattern=ep());Tp.init(e,t)}),Dp=Yu("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=tp),Tp.init(e,t)}),Ip=Yu("$ZodURL",(e,t)=>{Tp.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),a=new URL(n);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),void(t.normalize?r.value=a.href:r.value=n)}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Up=Yu("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Tp.init(e,t)}),Mp=Yu("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Yd),Tp.init(e,t)}),Lp=Yu("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=$d),Tp.init(e,t)}),Op=Yu("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Kd),Tp.init(e,t)}),zp=Yu("$ZodULID",(e,t)=>{t.pattern??(t.pattern=qd),Tp.init(e,t)}),Fp=Yu("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Zd),Tp.init(e,t)}),Bp=Yu("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Jd),Tp.init(e,t)}),Wp=Yu("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=dp({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${lp}T(?:${n})$`)}(t)),Tp.init(e,t)}),Vp=Yu("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=up),Tp.init(e,t)}),Hp=Yu("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${dp(t)}$`)),Tp.init(e,t)}),Gp=Yu("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Xd),Tp.init(e,t)}),$p=Yu("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=rp),Tp.init(e,t),e._zod.bag.format="ipv4"}),Kp=Yu("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=np),Tp.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),qp=Yu("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ap),Tp.init(e,t)}),Zp=Yu("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=sp),Tp.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(2!==n.length)throw new Error;const[e,t]=n;if(!t)throw new Error;const r=Number(t);if(`${r}`!==t)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Jp(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const Yp=Yu("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ip),Tp.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Jp(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const Xp=Yu("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=op),Tp.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{(function(e){if(!op.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return Jp(t.padEnd(4*Math.ceil(t.length/4),"="))})(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Qp=Yu("$ZodE164",(e,t)=>{t.pattern??(t.pattern=cp),Tp.init(e,t)});const em=Yu("$ZodJWT",(e,t)=>{Tp.init(e,t),e._zod.check=r=>{(function(e,t=null){try{const r=e.split(".");if(3!==r.length)return!1;const[n]=r;if(!n)return!1;const a=JSON.parse(atob(n));return!("typ"in a&&"JWT"!==a?.typ||!a.alg||t&&(!("alg"in a)||a.alg!==t))}catch{return!1}})(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),tm=Yu("$ZodUnknown",(e,t)=>{jp.init(e,t),e._zod.parse=e=>e}),rm=Yu("$ZodNever",(e,t)=>{jp.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function nm(e,t,r){e.issues.length&&t.issues.push(...Sd(r,e.issues)),t.value[r]=e.value}const am=Yu("$ZodArray",(e,t)=>{jp.init(e,t),e._zod.parse=(r,n)=>{const a=r.value;if(!Array.isArray(a))return r.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),r;r.value=Array(a.length);const s=[];for(let e=0;e<a.length;e++){const i=a[e],o=t.element._zod.run({value:i,issues:[]},n);o instanceof Promise?s.push(o.then(t=>nm(t,r,e))):nm(o,r,e)}return s.length?Promise.all(s).then(()=>r):r}});function sm(e,t,r,n,a){if(e.issues.length){if(a&&!(r in n))return;t.issues.push(...Sd(r,e.issues))}void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function im(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const r=(n=e.shape,Object.keys(n).filter(e=>"optional"===n[e]._zod.optin&&"optional"===n[e]._zod.optout));var n;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function om(e,t,r,n,a,s){const i=[],o=a.keySet,c=a.catchall._zod,l=c.def.type,u="optional"===c.optout;for(const a in t){if(o.has(a))continue;if("never"===l){i.push(a);continue}const s=c.run({value:t[a],issues:[]},n);s instanceof Promise?e.push(s.then(e=>sm(e,r,a,t,u))):sm(s,r,a,t,u)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const cm=Yu("$ZodObject",(e,t)=>{jp.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!r?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}const n=ad(()=>im(t));cd(e._zod,"propValues",()=>{const e=t.shape,r={};for(const t in e){const n=e[t]._zod;if(n.values){r[t]??(r[t]=new Set);for(const e of n.values)r[t].add(e)}}return r});const a=md,s=t.catchall;let i;e._zod.parse=(t,r)=>{i??(i=n.value);const o=t.value;if(!a(o))return t.issues.push({expected:"object",code:"invalid_type",input:o,inst:e}),t;t.value={};const c=[],l=i.shape;for(const e of i.keys){const n=l[e],a="optional"===n._zod.optout,s=n._zod.run({value:o[e],issues:[]},r);s instanceof Promise?c.push(s.then(r=>sm(r,t,e,o,a))):sm(s,t,e,o,a)}return s?om(c,o,t,r,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),lm=Yu("$ZodObjectJIT",(e,t)=>{cm.init(e,t);const r=e._zod.parse,n=ad(()=>im(t));let a;const s=md,i=!ed.jitless,o=i&&hd.value,c=t.catchall;let l;e._zod.parse=(u,d)=>{l??(l=n.value);const p=u.value;return s(p)?i&&o&&!1===d?.async&&!0!==d.jitless?(a||(a=(e=>{const t=new Np(["shape","payload","ctx"]),r=n.value,a=e=>{const t=dd(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const s=Object.create(null);let i=0;for(const e of r.keys)s[e]="key_"+i++;t.write("const newResult = {};");for(const n of r.keys){const r=s[n],i=dd(n),o=e[n],c="optional"===o?._zod?.optout;t.write(`const ${r} = ${a(n)};`),c?t.write(`\n if (${r}.issues.length) {\n if (${i} in input) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${r}.value;\n }\n \n `):t.write(`\n if (${r}.issues.length) {\n payload.issues = payload.issues.concat(${r}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${i}, ...iss.path] : [${i}]\n })));\n }\n \n if (${r}.value === undefined) {\n if (${i} in input) {\n newResult[${i}] = undefined;\n }\n } else {\n newResult[${i}] = ${r}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const o=t.compile();return(t,r)=>o(e,t,r)})(t.shape)),u=a(u,d),c?om([],p,u,d,l,e):u):r(u,d):(u.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),u)}});function um(e,t,r,n){for(const r of e)if(0===r.issues.length)return t.value=r.value,t;const a=e.filter(e=>!wd(e));return 1===a.length?(t.value=a[0].value,a[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>Ed(e,n,td())))}),t)}const dm=Yu("$ZodUnion",(e,t)=>{jp.init(e,t),cd(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),cd(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),cd(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),cd(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>id(e.source)).join("|")})$`)}});const r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(a,s)=>{if(r)return n(a,s);let i=!1;const o=[];for(const e of t.options){const t=e._zod.run({value:a.value,issues:[]},s);if(t instanceof Promise)o.push(t),i=!0;else{if(0===t.issues.length)return t;o.push(t)}}return i?Promise.all(o).then(t=>um(t,a,e,s)):um(o,a,e,s)}}),pm=Yu("$ZodIntersection",(e,t)=>{jp.init(e,t),e._zod.parse=(e,r)=>{const n=e.value,a=t.left._zod.run({value:n,issues:[]},r),s=t.right._zod.run({value:n,issues:[]},r);return a instanceof Promise||s instanceof Promise?Promise.all([a,s]).then(([t,r])=>hm(e,t,r)):hm(e,a,s)}});function mm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(fd(e)&&fd(t)){const r=Object.keys(t),n=Object.keys(e).filter(e=>-1!==r.indexOf(e)),a={...e,...t};for(const r of n){const n=mm(e[r],t[r]);if(!n.valid)return{valid:!1,mergeErrorPath:[r,...n.mergeErrorPath]};a[r]=n.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const a=mm(e[n],t[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function hm(e,t,r){const n=new Map;let a;for(const r of t.issues)if("unrecognized_keys"===r.code){a??(a=r);for(const e of r.keys)n.has(e)||n.set(e,{}),n.get(e).l=!0}else e.issues.push(r);for(const t of r.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)n.has(e)||n.set(e,{}),n.get(e).r=!0;else e.issues.push(t);const s=[...n].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length&&a&&e.issues.push({...a,keys:s}),wd(e))return e;const i=mm(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const fm=Yu("$ZodEnum",(e,t)=>{jp.init(e,t);const r=rd(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>bd.has(typeof e)).map(e=>"string"==typeof e?vd(e):e.toString()).join("|")})$`),e._zod.parse=(t,a)=>{const s=t.value;return n.has(s)||t.issues.push({code:"invalid_value",values:r,input:s,inst:e}),t}}),gm=Yu("$ZodTransform",(e,t)=>{jp.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Qu(e.constructor.name);const a=t.transform(r.value,r);if(n.async){return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(r.value=e,r))}if(a instanceof Promise)throw new Xu;return r.value=a,r}});function bm(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const vm=Yu("$ZodOptional",(e,t)=>{jp.init(e,t),e._zod.optin="optional",e._zod.optout="optional",cd(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),cd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${id(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>bm(t,e.value)):bm(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),ym=Yu("$ZodExactOptional",(e,t)=>{vm.init(e,t),cd(e._zod,"values",()=>t.innerType._zod.values),cd(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),xm=Yu("$ZodNullable",(e,t)=>{jp.init(e,t),cd(e._zod,"optin",()=>t.innerType._zod.optin),cd(e._zod,"optout",()=>t.innerType._zod.optout),cd(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${id(e.source)}|null)$`):void 0}),cd(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),wm=Yu("$ZodDefault",(e,t)=>{jp.init(e,t),e._zod.optin="optional",cd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>Sm(e,t)):Sm(n,t)}});function Sm(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const km=Yu("$ZodPrefault",(e,t)=>{jp.init(e,t),e._zod.optin="optional",cd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),Em=Yu("$ZodNonOptional",(e,t)=>{jp.init(e,t),cd(e._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{const a=t.innerType._zod.run(r,n);return a instanceof Promise?a.then(t=>Cm(t,e)):Cm(a,e)}});function Cm(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Nm=Yu("$ZodCatch",(e,t)=>{jp.init(e,t),cd(e._zod,"optin",()=>t.innerType._zod.optin),cd(e._zod,"optout",()=>t.innerType._zod.optout),cd(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>Ed(e,r,td()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>Ed(e,r,td()))},input:e.value}),e.issues=[]),e)}}),Am=Yu("$ZodPipe",(e,t)=>{jp.init(e,t),cd(e._zod,"values",()=>t.in._zod.values),cd(e._zod,"optin",()=>t.in._zod.optin),cd(e._zod,"optout",()=>t.out._zod.optout),cd(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){const n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>jm(e,t.in,r)):jm(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>jm(e,t.out,r)):jm(n,t.out,r)}});function jm(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Pm=Yu("$ZodReadonly",(e,t)=>{jp.init(e,t),cd(e._zod,"propValues",()=>t.innerType._zod.propValues),cd(e._zod,"values",()=>t.innerType._zod.values),cd(e._zod,"optin",()=>t.innerType?._zod?.optin),cd(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);const n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(Tm):Tm(n)}});function Tm(e){return e.value=Object.freeze(e.value),e}const _m=Yu("$ZodCustom",(e,t)=>{hp.init(e,t),jp.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{const n=r.value,a=t.fn(n);if(a instanceof Promise)return a.then(t=>Rm(t,r,n,e));Rm(a,r,n,e)}});function Rm(e,t,r,n){if(!e){const e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(Nd(e))}}var Dm;class Im{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const r={...this.get(t)??{}};delete r.id;const n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(Dm=globalThis).__zod_globalRegistry??(Dm.__zod_globalRegistry=new Im);const Um=globalThis.__zod_globalRegistry;function Mm(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...xd(t)})}function Lm(e,t){return new fp({check:"max_length",...xd(t),maximum:e})}function Om(e,t){return new gp({check:"min_length",...xd(t),minimum:e})}function zm(e,t){return new bp({check:"length_equals",...xd(t),length:e})}function Fm(e){return new Cp({check:"overwrite",tx:e})}function Bm(e){const t=function(e,t){const r=new hp({check:"custom",...xd(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(Nd(e,r.value,t._zod.def));else{const n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(Nd(n))}},e(r.value,r)));return t}function Wm(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Um,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Vm(e,t,r={path:[],schemaPath:[]}){var n;const a=e._zod.def,s=t.seen.get(e);if(s){s.count++;return r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema}const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const o=e._zod.toJSONSchema?.();if(o)i.schema=o;else{const n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,n);else{const r=i.schema,s=t.processors[a.type];if(!s)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);s(e,t,r,n)}const s=e._zod.parent;s&&(i.ref||(i.ref=s),Vm(s,t,n),t.seen.get(s).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(i.schema,c),"input"===t.io&&$m(e)&&(delete i.schema.examples,delete i.schema.default),"input"===t.io&&i.schema._prefault&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault;return t.seen.get(e).schema}function Hm(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const t of e.seen.entries()){const r=e.metadataRegistry.get(t[0])?.id;if(r){const e=n.get(r);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}const a=t=>{if(t[1].schema.$ref)return;const n=t[1],{ref:a,defId:s}=(t=>{const n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const r=e.external.registry.get(t[0])?.id,a=e.external.uri??(e=>e);if(r)return{ref:a(r)};const s=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=s,{defId:s,ref:`${a("__shared")}#/${n}/${s}`}}if(t[1]===r)return{ref:"#"};const a=`#/${n}/`,s=t[1].schema.id??"__schema"+e.counter++;return{defId:s,ref:a+s}})(t);n.def={...n.schema},s&&(n.defId=s);const i=n.schema;for(const e in i)delete i[e];i.$ref=a};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const r of e.seen.entries()){const n=r[1];if(t===r[0]){a(r);continue}if(e.external){const n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){a(r);continue}}const s=e.metadataRegistry.get(r[0])?.id;s?a(r):(n.cycle||n.count>1&&"ref"===e.reused)&&a(r)}}function Gm(e,t){const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=t=>{const r=e.seen.get(t);if(null===r.ref)return;const a=r.def??r.schema,s={...a},i=r.ref;if(r.ref=null,i){n(i);const r=e.seen.get(i),o=r.schema;!o.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(a,o):(a.allOf=a.allOf??[],a.allOf.push(o)),Object.assign(a,s);if(t._zod.parent===i)for(const e in a)"$ref"!==e&&"allOf"!==e&&(e in s||delete a[e]);if(o.$ref&&r.def)for(const e in a)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(a[e])===JSON.stringify(r.def[e])&&delete a[e]}const o=t._zod.parent;if(o&&o!==i){n(o);const t=e.seen.get(o);if(t?.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(const e in a)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:r.path??[]})};for(const t of[...e.seen.entries()].reverse())n(t[0]);const a={};if("draft-2020-12"===e.target?a.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?a.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?a.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const r=e.external.registry.get(t)?.id;if(!r)throw new Error("Schema is missing an `id` property");a.$id=e.external.uri(r)}Object.assign(a,r.def??r.schema);const s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?a.$defs=s:a.definitions=s);try{const r=JSON.parse(JSON.stringify(a));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:Km(t,"input",e.processors),output:Km(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw new Error("Error converting schema to JSON.")}}function $m(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if("transform"===n.type)return!0;if("array"===n.type)return $m(n.element,r);if("set"===n.type)return $m(n.valueType,r);if("lazy"===n.type)return $m(n.getter(),r);if("promise"===n.type||"optional"===n.type||"nonoptional"===n.type||"nullable"===n.type||"readonly"===n.type||"default"===n.type||"prefault"===n.type)return $m(n.innerType,r);if("intersection"===n.type)return $m(n.left,r)||$m(n.right,r);if("record"===n.type||"map"===n.type)return $m(n.keyType,r)||$m(n.valueType,r);if("pipe"===n.type)return $m(n.in,r)||$m(n.out,r);if("object"===n.type){for(const e in n.shape)if($m(n.shape[e],r))return!0;return!1}if("union"===n.type){for(const e of n.options)if($m(e,r))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if($m(e,r))return!0;return!(!n.rest||!$m(n.rest,r))}return!1}const Km=(e,t,r={})=>n=>{const{libraryOptions:a,target:s}=n??{},i=Wm({...a??{},target:s,io:t,processors:r});return Vm(e,i),Hm(i,e),Gm(i,e)},qm={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zm=(e,t,r,n)=>{const a=e._zod.def;Vm(a.innerType,t,n);t.seen.get(e).ref=a.innerType};function Jm(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function Ym(e,t){for(var r={};e.length;){var n=e[0],a=n.code,s=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];r[i]={message:o.message,type:o.code}}else r[i]={message:s,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=r[i].types,l=c&&c[n.code];r[i]=uu(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function Xm(e,t){for(var r={};e.length;){var n=e[0],a=n.code,s=n.message,i=n.path.join(".");if(!r[i])if("invalid_union"===n.code&&n.errors.length>0){var o=n.errors[0][0];r[i]={message:o.message,type:o.code}}else r[i]={message:s,type:a};if("invalid_union"===n.code&&n.errors.forEach(function(t){return t.forEach(function(t){return e.push(t)})}),t){var c=r[i].types,l=c&&c[n.code];r[i]=uu(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function Qm(e,t,r){if(void 0===r&&(r={}),function(e){return"_def"in e&&"object"==typeof e._def&&"typeName"in e._def}(e))return function(n,a,s){try{return Promise.resolve(Jm(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return s.shouldUseNativeValidation&&Ku({},s),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return Array.isArray(null==e?void 0:e.issues)}(e))return{values:{},errors:qu(Ym(e.errors,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return"_zod"in e&&"object"==typeof e._zod}(e))return function(n,a,s){try{return Promise.resolve(Jm(function(){return Promise.resolve(("sync"===r.mode?_d:Dd)(e,n,t)).then(function(e){return s.shouldUseNativeValidation&&Ku({},s),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof jd}(e))return{values:{},errors:qu(Xm(e.issues,!s.shouldUseNativeValidation&&"all"===s.criteriaMode),s)};throw e}))}catch(e){return Promise.reject(e)}};throw new Error("Invalid input: not a Zod schema")}const eh=Yu("ZodISODateTime",(e,t)=>{Wp.init(e,t),Ch.init(e,t)});function th(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...xd(t)})}(eh,e)}const rh=Yu("ZodISODate",(e,t)=>{Vp.init(e,t),Ch.init(e,t)});function nh(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...xd(t)})}(rh,e)}const ah=Yu("ZodISOTime",(e,t)=>{Hp.init(e,t),Ch.init(e,t)});function sh(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...xd(t)})}(ah,e)}const ih=Yu("ZodISODuration",(e,t)=>{Gp.init(e,t),Ch.init(e,t)});function oh(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...xd(t)})}(ih,e)}const ch=Yu("ZodError",(e,t)=>{jd.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const r={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code&&a.errors.length)a.errors.map(e=>n({issues:e}));else if("invalid_key"===a.code)n({issues:a.issues});else if("invalid_element"===a.code)n({issues:a.issues});else if(0===a.path.length)r._errors.push(t(a));else{let e=r,n=0;for(;n<a.path.length;){const r=a.path[n];n===a.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(a))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(e),r}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const r={},n=[];for(const a of e.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,nd,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,nd,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),lh=Td(ch),uh=Rd(ch),dh=Id(ch),ph=Md(ch),mh=Od(ch),hh=zd(ch),fh=Fd(ch),gh=Bd(ch),bh=Wd(ch),vh=Vd(ch),yh=Hd(ch),xh=Gd(ch),wh=Yu("ZodType",(e,t)=>(jp.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Km(e,"input"),output:Km(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{const n=Wm({...r,processors:t});return Vm(e,n),Hm(n,e),Gm(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(ud(t,{checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,r)=>yd(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>lh(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>dh(e,t,r),e.parseAsync=async(t,r)=>uh(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>ph(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>mh(e,t,r),e.decode=(t,r)=>hh(e,t,r),e.encodeAsync=async(t,r)=>fh(e,t,r),e.decodeAsync=async(t,r)=>gh(e,t,r),e.safeEncode=(t,r)=>bh(e,t,r),e.safeDecode=(t,r)=>vh(e,t,r),e.safeEncodeAsync=async(t,r)=>yh(e,t,r),e.safeDecodeAsync=async(t,r)=>xh(e,t,r),e.refine=(t,r)=>e.check(function(e,t={}){return function(e,t,r){return new e({type:"custom",check:"custom",fn:t,...xd(r)})}(ff,e,t)}(t,r)),e.superRefine=t=>e.check(Bm(t)),e.overwrite=t=>e.check(Fm(t)),e.optional=()=>nf(e),e.exactOptional=()=>new af({type:"optional",innerType:e}),e.nullable=()=>of(e),e.nullish=()=>nf(of(e)),e.nonoptional=t=>function(e,t){return new uf({type:"nonoptional",innerType:e,...xd(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...xd(r)})}(Zh,e,t);var t},e.or=t=>function(e,t){return new Xh({type:"union",options:e,...xd(t)})}([e,t]),e.and=t=>new Qh({type:"intersection",left:e,right:t}),e.transform=t=>mf(e,new tf({type:"transform",transform:t})),e.default=t=>{return r=t,new cf({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():gd(r)}});var r},e.prefault=t=>{return r=t,new lf({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():gd(r)}});var r},e.catch=t=>{return new df({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>mf(e,t),e.readonly=()=>new hf({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return Um.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>Um.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Um.get(e);const r=e.clone();return Um.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Sh=Yu("_ZodString",(e,t)=>{Pp.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=r;n.type="string";const{minimum:a,maximum:s,format:i,patterns:o,contentEncoding:c}=e._zod.bag;if("number"==typeof a&&(n.minLength=a),"number"==typeof s&&(n.maxLength=s),i&&(n.format=qm[i]??i,""===n.format&&delete n.format,"time"===i&&delete n.format),c&&(n.contentEncoding=c),o&&o.size>0){const e=[...o];1===e.length?n.pattern=e[0].source:e.length>1&&(n.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}})(e,t,r);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new yp({check:"string_format",format:"regex",...xd(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Sp({check:"string_format",format:"includes",...xd(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new kp({check:"string_format",format:"starts_with",...xd(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Ep({check:"string_format",format:"ends_with",...xd(t),suffix:e})}(...t)),e.min=(...t)=>e.check(Om(...t)),e.max=(...t)=>e.check(Lm(...t)),e.length=(...t)=>e.check(zm(...t)),e.nonempty=(...t)=>e.check(Om(1,...t)),e.lowercase=t=>e.check(function(e){return new xp({check:"string_format",format:"lowercase",...xd(e)})}(t)),e.uppercase=t=>e.check(function(e){return new wp({check:"string_format",format:"uppercase",...xd(e)})}(t)),e.trim=()=>e.check(Fm(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return Fm(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(Fm(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(Fm(e=>e.toUpperCase())),e.slugify=()=>e.check(Fm(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),kh=Yu("ZodString",(e,t)=>{Pp.init(e,t),Sh.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...xd(t)})}(Nh,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...xd(t)})}(Ph,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...xd(t)})}(Hh,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...xd(t)})}(Th,t)),e.guid=t=>e.check(Mm(Ah,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...xd(t)})}(jh,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...xd(t)})}(jh,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...xd(t)})}(jh,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...xd(t)})}(jh,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...xd(t)})}(_h,t)),e.guid=t=>e.check(Mm(Ah,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...xd(t)})}(Rh,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...xd(t)})}(Dh,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...xd(t)})}(Ih,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...xd(t)})}(Bh,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...xd(t)})}(Wh,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...xd(t)})}(Uh,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...xd(t)})}(Mh,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...xd(t)})}(Lh,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...xd(t)})}(Oh,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...xd(t)})}(zh,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...xd(t)})}(Fh,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...xd(t)})}(Vh,t)),e.datetime=t=>e.check(th(t)),e.date=t=>e.check(nh(t)),e.time=t=>e.check(sh(t)),e.duration=t=>e.check(oh(t))});function Eh(e){return function(e,t){return new e({type:"string",...xd(t)})}(kh,e)}const Ch=Yu("ZodStringFormat",(e,t)=>{Tp.init(e,t),Sh.init(e,t)}),Nh=Yu("ZodEmail",(e,t)=>{Dp.init(e,t),Ch.init(e,t)}),Ah=Yu("ZodGUID",(e,t)=>{_p.init(e,t),Ch.init(e,t)}),jh=Yu("ZodUUID",(e,t)=>{Rp.init(e,t),Ch.init(e,t)}),Ph=Yu("ZodURL",(e,t)=>{Ip.init(e,t),Ch.init(e,t)}),Th=Yu("ZodEmoji",(e,t)=>{Up.init(e,t),Ch.init(e,t)}),_h=Yu("ZodNanoID",(e,t)=>{Mp.init(e,t),Ch.init(e,t)}),Rh=Yu("ZodCUID",(e,t)=>{Lp.init(e,t),Ch.init(e,t)}),Dh=Yu("ZodCUID2",(e,t)=>{Op.init(e,t),Ch.init(e,t)}),Ih=Yu("ZodULID",(e,t)=>{zp.init(e,t),Ch.init(e,t)}),Uh=Yu("ZodXID",(e,t)=>{Fp.init(e,t),Ch.init(e,t)}),Mh=Yu("ZodKSUID",(e,t)=>{Bp.init(e,t),Ch.init(e,t)}),Lh=Yu("ZodIPv4",(e,t)=>{$p.init(e,t),Ch.init(e,t)}),Oh=Yu("ZodIPv6",(e,t)=>{Kp.init(e,t),Ch.init(e,t)}),zh=Yu("ZodCIDRv4",(e,t)=>{qp.init(e,t),Ch.init(e,t)}),Fh=Yu("ZodCIDRv6",(e,t)=>{Zp.init(e,t),Ch.init(e,t)}),Bh=Yu("ZodBase64",(e,t)=>{Yp.init(e,t),Ch.init(e,t)}),Wh=Yu("ZodBase64URL",(e,t)=>{Xp.init(e,t),Ch.init(e,t)}),Vh=Yu("ZodE164",(e,t)=>{Qp.init(e,t),Ch.init(e,t)}),Hh=Yu("ZodJWT",(e,t)=>{em.init(e,t),Ch.init(e,t)}),Gh=Yu("ZodUnknown",(e,t)=>{tm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function $h(){return new Gh({type:"unknown"})}const Kh=Yu("ZodNever",(e,t)=>{rm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r)=>{r.not={}})(0,0,t)});function qh(e){return function(e,t){return new e({type:"never",...xd(t)})}(Kh,e)}const Zh=Yu("ZodArray",(e,t)=>{am.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,s=e._zod.def,{minimum:i,maximum:o}=e._zod.bag;"number"==typeof i&&(a.minItems=i),"number"==typeof o&&(a.maxItems=o),a.type="array",a.items=Vm(s.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(Om(t,r)),e.nonempty=t=>e.check(Om(1,t)),e.max=(t,r)=>e.check(Lm(t,r)),e.length=(t,r)=>e.check(zm(t,r)),e.unwrap=()=>e.element});const Jh=Yu("ZodObject",(e,t)=>{lm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=r,s=e._zod.def;a.type="object",a.properties={};const i=s.shape;for(const e in i)a.properties[e]=Vm(i[e],t,{...n,path:[...n.path,"properties",e]});const o=new Set(Object.keys(i)),c=new Set([...o].filter(e=>{const r=s.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));c.size>0&&(a.required=Array.from(c)),"never"===s.catchall?._zod.def.type?a.additionalProperties=!1:s.catchall?s.catchall&&(a.additionalProperties=Vm(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(a.additionalProperties=!1)})(e,t,r,n),cd(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new ef({type:"enum",entries:r,...xd(t)})}(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:$h()}),e.loose=()=>e.clone({...e._zod.def,catchall:$h()}),e.strict=()=>e.clone({...e._zod.def,catchall:qh()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!fd(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const r=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=ud(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return ld(this,"shape",r),r}});return yd(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!fd(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=ud(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return ld(this,"shape",r),r}});return yd(e,r)}(e,t),e.merge=t=>function(e,t){const r=ud(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return ld(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return yd(e,r)}(e,t),e.pick=t=>function(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return yd(e,ud(e._zod.def,{get shape(){const e={};for(const n in t){if(!(n in r.shape))throw new Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return ld(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=ud(e._zod.def,{get shape(){const n={...e._zod.def.shape};for(const e in t){if(!(e in r.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return ld(this,"shape",n),n},checks:[]});return yd(e,a)}(e,t),e.partial=(...t)=>function(e,t,r){const n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=ud(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in n))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(const t in n)a[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return ld(this,"shape",a),a},checks:[]});return yd(t,a)}(rf,e,t[0]),e.required=(...t)=>function(e,t,r){const n=ud(t._zod.def,{get shape(){const n=t._zod.def.shape,a={...n};if(r)for(const t in r){if(!(t in a))throw new Error(`Unrecognized key: "${t}"`);r[t]&&(a[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(const t in n)a[t]=new e({type:"nonoptional",innerType:n[t]});return ld(this,"shape",a),a}});return yd(t,n)}(uf,e,t[0])});function Yh(e,t){const r={type:"object",shape:e??{},...xd(t)};return new Jh(r)}const Xh=Yu("ZodUnion",(e,t)=>{dm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=!1===a.inclusive,i=a.options.map((e,r)=>Vm(e,t,{...n,path:[...n.path,s?"oneOf":"anyOf",r]}));s?r.oneOf=i:r.anyOf=i})(e,t,r,n),e.options=t.options});const Qh=Yu("ZodIntersection",(e,t)=>{pm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=Vm(a.left,t,{...n,path:[...n.path,"allOf",0]}),i=Vm(a.right,t,{...n,path:[...n.path,"allOf",1]}),o=e=>"allOf"in e&&1===Object.keys(e).length,c=[...o(s)?s.allOf:[s],...o(i)?i.allOf:[i]];r.allOf=c})(e,t,r,n)});const ef=Yu("ZodEnum",(e,t)=>{fm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=rd(e._zod.def.entries);n.every(e=>"number"==typeof e)&&(r.type="number"),n.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=n})(e,0,r),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{const a={};for(const n of e){if(!r.has(n))throw new Error(`Key ${n} not found in enum`);a[n]=t.entries[n]}return new ef({...t,checks:[],...xd(n),entries:a})},e.exclude=(e,n)=>{const a={...t.entries};for(const t of e){if(!r.has(t))throw new Error(`Key ${t} not found in enum`);delete a[t]}return new ef({...t,checks:[],...xd(n),entries:a})}});const tf=Yu("ZodTransform",(e,t)=>{gm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new Qu(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(Nd(n,r.value,t));else{const t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),r.issues.push(Nd(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const rf=Yu("ZodOptional",(e,t)=>{vm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>Zm(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function nf(e){return new rf({type:"optional",innerType:e})}const af=Yu("ZodExactOptional",(e,t)=>{ym.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>Zm(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const sf=Yu("ZodNullable",(e,t)=>{xm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=Vm(a.innerType,t,n),i=t.seen.get(e);"openapi-3.0"===t.target?(i.ref=a.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function of(e){return new sf({type:"nullable",innerType:e})}const cf=Yu("ZodDefault",(e,t)=>{wm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Vm(a.innerType,t,n),t.seen.get(e).ref=a.innerType,r.default=JSON.parse(JSON.stringify(a.defaultValue))})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const lf=Yu("ZodPrefault",(e,t)=>{km.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Vm(a.innerType,t,n),t.seen.get(e).ref=a.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(a.defaultValue)))})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});const uf=Yu("ZodNonOptional",(e,t)=>{Em.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Vm(a.innerType,t,n),t.seen.get(e).ref=a.innerType})(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const df=Yu("ZodCatch",(e,t)=>{Nm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;let s;Vm(a.innerType,t,n),t.seen.get(e).ref=a.innerType;try{s=a.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=s})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const pf=Yu("ZodPipe",(e,t)=>{Am.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s="input"===t.io?"transform"===a.in._zod.def.type?a.out:a.in:a.out;Vm(s,t,n),t.seen.get(e).ref=s})(e,t,0,n),e.in=t.in,e.out=t.out});function mf(e,t){return new pf({type:"pipe",in:e,out:t})}const hf=Yu("ZodReadonly",(e,t)=>{Pm.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;Vm(a.innerType,t,n),t.seen.get(e).ref=a.innerType,r.readOnly=!0})(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});const ff=Yu("ZodCustom",(e,t)=>{_m.init(e,t),wh.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)});const gf={usd:"$",eur:"€",gbp:"£",jpy:"¥",cad:"CA$",aud:"A$",chf:"CHF",cny:"¥",hkd:"HK$",sgd:"S$",inr:"₹",mxn:"MX$",brl:"R$",nzd:"NZ$",sek:"kr",nok:"kr",dkk:"kr",pln:"zł",thb:"฿"},bf={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function vf(e){return e&&e.trim()?bf[e.trim().toLowerCase()]??"":""}function yf(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return gf[t]??t.toUpperCase()}["usd","eur","gbp","jpy","cad","aud","chf","cny","hkd","sgd","inr","mxn","brl","nzd","sek","nok","dkk","pln","thb"].map(e=>({value:e,label:`${e.toUpperCase()} (${yf(e)})`}));var xf=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=xs(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),wf=a.forwardRef((t,r)=>e.jsx(xf.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));wf.displayName="Label";var Sf=wf;const kf=As("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ef=a.forwardRef(({className:t,...r},n)=>e.jsx(Sf,{ref:n,className:Se(kf(),t),...r}));Ef.displayName=Sf.displayName;const Cf=lu,Nf=a.createContext({}),Af=({...t})=>e.jsx(Nf.Provider,{value:{name:t.name},children:e.jsx(ou,{...t})}),jf=()=>{const e=a.useContext(Nf),r=a.useContext(Pf),{getFieldState:n,formState:s}=t.useContext(cu),i=n(e.name,s);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=r;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...i}},Pf=a.createContext({}),Tf=a.forwardRef(({className:t,...r},n)=>{const s=a.useId();return e.jsx(Pf.Provider,{value:{id:s},children:e.jsx("div",{ref:n,className:Se("space-y-2",t),...r})})});Tf.displayName="FormItem";const _f=a.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:s}=jf();return e.jsx(Ef,{ref:n,className:Se(a&&"text-destructive",t),htmlFor:s,...r})});_f.displayName="FormLabel";const Rf=a.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:s,formMessageId:i}=jf();return e.jsx(ws,{ref:r,id:a,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});Rf.displayName="FormControl";const Df=a.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=jf();return e.jsx("p",{ref:n,id:a,className:Se("text-sm text-muted-foreground",t),...r})});Df.displayName="FormDescription";const If=a.forwardRef(({className:t,children:r,...n},a)=>{const{error:s,formMessageId:i}=jf(),o=s?String(s?.message):r;return o?e.jsx("p",{ref:a,id:i,className:Se("text-sm font-medium text-destructive",t),...n,children:o}):null});If.displayName="FormMessage";const Uf=a.forwardRef(({className:t,type:r,...n},a)=>e.jsx("input",{type:r,className:Se("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),ref:a,...n}));function Mf(t){const r=Lf(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(zf);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}function Lf(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?fs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Uf.displayName="Input";var Of=Symbol("radix.slottable");function zf(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Of}function Ff(r){const n=r+"CollectionProvider",[a,s]=_s(n),[i,o]=a(n,{collectionRef:{current:null},itemMap:new Map}),c=r=>{const{scope:n,children:a}=r,s=t.useRef(null),o=t.useRef(new Map).current;return e.jsx(i,{scope:n,itemMap:o,collectionRef:s,children:a})};c.displayName=n;const l=r+"CollectionSlot",u=Mf(l),d=t.forwardRef((t,r)=>{const{scope:n,children:a}=t,s=gs(r,o(l,n).collectionRef);return e.jsx(u,{ref:s,children:a})});d.displayName=l;const p=r+"CollectionItemSlot",m="data-radix-collection-item",h=Mf(p),f=t.forwardRef((r,n)=>{const{scope:a,children:s,...i}=r,c=t.useRef(null),l=gs(n,c),u=o(p,a);return t.useEffect(()=>(u.itemMap.set(c,{ref:c,...i}),()=>{u.itemMap.delete(c)})),e.jsx(h,{[m]:"",ref:l,children:s})});return f.displayName=p,[{Provider:c,Slot:d,ItemSlot:f},function(e){const n=o(r+"CollectionConsumer",e),a=t.useCallback(()=>{const e=n.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${m}]`)),r=Array.from(n.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current));return r},[n.collectionRef,n.itemMap]);return a},s]}var Bf=a.createContext(void 0);function Wf(e){const t=a.useContext(Bf);return e||t||"ltr"}var Vf="rovingFocusGroup.onEntryFocus",Hf={bubbles:!1,cancelable:!0},Gf="RovingFocusGroup",[$f,Kf,qf]=Ff(Gf),[Zf,Jf]=_s(Gf,[qf]),[Yf,Xf]=Zf(Gf),Qf=a.forwardRef((t,r)=>e.jsx($f.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx($f.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(eg,{...t,ref:r})})}));Qf.displayName=Gf;var eg=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=t,h=a.useRef(null),f=gs(r,h),g=Wf(o),[b,v]=Os({prop:c,defaultProp:l??null,onChange:u,caller:Gf}),[y,x]=a.useState(!1),w=Vs(d),S=Kf(n),k=a.useRef(!1),[E,C]=a.useState(0);return a.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(Vf,w),()=>e.removeEventListener(Vf,w)},[w]),e.jsx(Yf,{scope:n,orientation:s,dir:g,loop:i,currentTabStopId:b,onItemFocus:a.useCallback(e=>v(e),[v]),onItemShiftTab:a.useCallback(()=>x(!0),[]),onFocusableItemAdd:a.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>C(e=>e-1),[]),children:e.jsx(Ws.div,{tabIndex:y||0===E?-1:0,"data-orientation":s,...m,ref:f,style:{outline:"none",...t.style},onMouseDown:Ts(t.onMouseDown,()=>{k.current=!0}),onFocus:Ts(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(Vf,Hf);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);ag([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}k.current=!1}),onBlur:Ts(t.onBlur,()=>x(!1))})})}),tg="RovingFocusGroupItem",rg=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:o,children:c,...l}=t,u=Ms(),d=o||u,p=Xf(tg,n),m=p.currentTabStopId===d,h=Kf(n),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:b}=p;return a.useEffect(()=>{if(s)return f(),()=>g()},[s,f,g]),e.jsx($f.ItemSlot,{scope:n,id:d,focusable:s,active:i,children:e.jsx(Ws.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:r,onMouseDown:Ts(t.onMouseDown,e=>{s?p.onItemFocus(d):e.preventDefault()}),onFocus:Ts(t.onFocus,()=>p.onItemFocus(d)),onKeyDown:Ts(t.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)?void 0:ng[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=h().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>ag(r))}}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=b}):c})})});rg.displayName=tg;var ng={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ag(e,t=!1){const r=document.activeElement;for(const n of e){if(n===r)return;if(n.focus({preventScroll:t}),document.activeElement!==r)return}}var sg=Qf,ig=rg,og="Radio",[cg,lg]=_s(og),[ug,dg]=cg(og),pg=a.forwardRef((t,r)=>{const{__scopeRadio:n,name:s,checked:i=!1,required:o,disabled:c,value:l="on",onCheck:u,form:d,...p}=t,[m,h]=a.useState(null),f=gs(r,e=>h(e)),g=a.useRef(!1),b=!m||(d||!!m.closest("form"));return e.jsxs(ug,{scope:n,checked:i,disabled:c,children:[e.jsx(Ws.button,{type:"button",role:"radio","aria-checked":i,"data-state":gg(i),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:f,onClick:Ts(t.onClick,e=>{i||u?.(),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&e.jsx(fg,{control:m,bubbles:!g.current,name:s,value:l,checked:i,required:o,disabled:c,form:d,style:{transform:"translateX(-100%)"}})]})});pg.displayName=og;var mg="RadioIndicator",hg=a.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...s}=t,i=dg(mg,n);return e.jsx(li,{present:a||i.checked,children:e.jsx(Ws.span,{"data-state":gg(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:r})})});hg.displayName=mg;var fg=a.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=gs(c,o),u=sl(n),d=il(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[u,n,s]),e.jsx(Ws.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function gg(e){return e?"checked":"unchecked"}fg.displayName="RadioBubbleInput";var bg=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],vg="RadioGroup",[yg]=_s(vg,[Jf,lg]),xg=Jf(),wg=lg(),[Sg,kg]=yg(vg),Eg=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:s,value:i,required:o=!1,disabled:c=!1,orientation:l,dir:u,loop:d=!0,onValueChange:p,...m}=t,h=xg(n),f=Wf(u),[g,b]=Os({prop:i,defaultProp:s??null,onChange:p,caller:vg});return e.jsx(Sg,{scope:n,name:a,required:o,disabled:c,value:g,onValueChange:b,children:e.jsx(sg,{asChild:!0,...h,orientation:l,dir:f,loop:d,children:e.jsx(Ws.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:f,...m,ref:r})})})});Eg.displayName=vg;var Cg="RadioGroupItem",Ng=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:s,...i}=t,o=kg(Cg,n),c=o.disabled||s,l=xg(n),u=wg(n),d=a.useRef(null),p=gs(r,d),m=o.value===i.value,h=a.useRef(!1);return a.useEffect(()=>{const e=e=>{bg.includes(e.key)&&(h.current=!0)},t=()=>h.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),e.jsx(ig,{asChild:!0,...l,focusable:!c,active:m,children:e.jsx(pg,{disabled:c,required:o.required,checked:m,...u,...i,name:o.name,ref:p,onCheck:()=>o.onValueChange(i.value),onKeyDown:Ts(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Ts(i.onFocus,()=>{h.current&&d.current?.click()})})})});Ng.displayName=Cg;var Ag=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,s=wg(n);return e.jsx(hg,{...s,...a,ref:r})});Ag.displayName="RadioGroupIndicator";var jg=Eg,Pg=Ng,Tg=Ag;const _g=a.forwardRef(({className:t,...r},n)=>e.jsx(jg,{className:Se("grid gap-2",t),...r,ref:n}));_g.displayName=jg.displayName;const Rg=a.forwardRef(({className:t,...r},n)=>e.jsx(Pg,{ref:n,className:Se("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:e.jsx(Tg,{className:"flex items-center justify-center",children:e.jsx(nc,{className:"h-3.5 w-3.5 fill-primary"})})}));function Dg(e,[t,r]){return Math.min(r,Math.max(t,e))}Rg.displayName=Pg.displayName;var Ig="ScrollArea",[Ug]=_s(Ig),[Mg,Lg]=Ug(Ig),Og=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,type:s="hover",dir:i,scrollHideDelay:o=600,...c}=t,[l,u]=a.useState(null),[d,p]=a.useState(null),[m,h]=a.useState(null),[f,g]=a.useState(null),[b,v]=a.useState(null),[y,x]=a.useState(0),[w,S]=a.useState(0),[k,E]=a.useState(!1),[C,N]=a.useState(!1),A=gs(r,e=>u(e)),j=Wf(i);return e.jsx(Mg,{scope:n,type:s,dir:j,scrollHideDelay:o,scrollArea:l,viewport:d,onViewportChange:p,content:m,onContentChange:h,scrollbarX:f,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:E,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:C,onScrollbarYEnabledChange:N,onCornerWidthChange:x,onCornerHeightChange:S,children:e.jsx(Ws.div,{dir:j,...c,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...t.style}})})});Og.displayName=Ig;var zg="ScrollAreaViewport",Fg=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:s,nonce:i,...o}=t,c=Lg(zg,n),l=gs(r,a.useRef(null),c.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),e.jsx(Ws.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})});Fg.displayName=zg;var Bg="ScrollAreaScrollbar",Wg=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Lg(Bg,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=i,l="horizontal"===t.orientation;return a.useEffect(()=>(l?o(!0):c(!0),()=>{l?o(!1):c(!1)}),[l,o,c]),"hover"===i.type?e.jsx(Vg,{...s,ref:r,forceMount:n}):"scroll"===i.type?e.jsx(Hg,{...s,ref:r,forceMount:n}):"auto"===i.type?e.jsx(Gg,{...s,ref:r,forceMount:n}):"always"===i.type?e.jsx($g,{...s,ref:r}):null});Wg.displayName=Bg;var Vg=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Lg(Bg,t.__scopeScrollArea),[o,c]=a.useState(!1);return a.useEffect(()=>{const e=i.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),c(!0)},n=()=>{t=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[i.scrollArea,i.scrollHideDelay]),e.jsx(li,{present:n||o,children:e.jsx(Gg,{"data-state":o?"visible":"hidden",...s,ref:r})})}),Hg=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Lg(Bg,t.__scopeScrollArea),o="horizontal"===t.orientation,c=db(()=>u("SCROLL_END"),100),[l,u]=(d="hidden",p={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},a.useReducer((e,t)=>p[e][t]??e,d));var d,p;return a.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>u("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,i.scrollHideDelay,u]),a.useEffect(()=>{const e=i.viewport,t=o?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(u("SCROLL"),c()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[i.viewport,o,u,c]),e.jsx(li,{present:n||"hidden"!==l,children:e.jsx($g,{"data-state":"hidden"===l?"hidden":"visible",...s,ref:r,onPointerEnter:Ts(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ts(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),Gg=a.forwardRef((t,r)=>{const n=Lg(Bg,t.__scopeScrollArea),{forceMount:s,...i}=t,[o,c]=a.useState(!1),l="horizontal"===t.orientation,u=db(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;c(l?e:t)}},10);return pb(n.viewport,u),pb(n.content,u),e.jsx(li,{present:s||o,children:e.jsx($g,{"data-state":o?"visible":"hidden",...i,ref:r})})}),$g=a.forwardRef((t,r)=>{const{orientation:n="vertical",...s}=t,i=Lg(Bg,t.__scopeScrollArea),o=a.useRef(null),c=a.useRef(0),[l,u]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=sb(l.viewport,l.content),p={...s,sizes:l,onSizesChange:u,hasThumb:Boolean(d>0&&d<1),onThumbChange:e=>o.current=e,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:e=>c.current=e};function m(e,t){return function(e,t,r,n="ltr"){const a=ib(r),s=a/2,i=t||s,o=a-i,c=r.scrollbar.paddingStart+i,l=r.scrollbar.size-r.scrollbar.paddingEnd-o,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return cb([c,l],d)(e)}(e,c.current,l,t)}return"horizontal"===n?e.jsx(Kg,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=ob(i.viewport.scrollLeft,l,i.dir);o.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=m(e,i.dir))}}):"vertical"===n?e.jsx(qg,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=ob(i.viewport.scrollTop,l);o.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=m(e))}}):null}),Kg=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=Lg(Bg,t.__scopeScrollArea),[c,l]=a.useState(),u=a.useRef(null),d=gs(r,u,o.onScrollbarXChange);return a.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(Yg,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{bottom:0,left:"rtl"===o.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===o.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":ib(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.x),onDragScroll:e=>t.onDragScroll(e.x),onWheelScroll:(e,r)=>{if(o.viewport){const n=o.viewport.scrollLeft+e.deltaX;t.onWheelScroll(n),lb(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&o.viewport&&c&&s({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:ab(c.paddingLeft),paddingEnd:ab(c.paddingRight)}})}})}),qg=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=Lg(Bg,t.__scopeScrollArea),[c,l]=a.useState(),u=a.useRef(null),d=gs(r,u,o.onScrollbarYChange);return a.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),e.jsx(Yg,{"data-orientation":"vertical",...i,ref:d,sizes:n,style:{top:0,right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":ib(n)+"px",...t.style},onThumbPointerDown:e=>t.onThumbPointerDown(e.y),onDragScroll:e=>t.onDragScroll(e.y),onWheelScroll:(e,r)=>{if(o.viewport){const n=o.viewport.scrollTop+e.deltaY;t.onWheelScroll(n),lb(n,r)&&e.preventDefault()}},onResize:()=>{u.current&&o.viewport&&c&&s({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:ab(c.paddingTop),paddingEnd:ab(c.paddingBottom)}})}})}),[Zg,Jg]=Ug(Bg),Yg=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,sizes:s,hasThumb:i,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:m,...h}=t,f=Lg(Bg,n),[g,b]=a.useState(null),v=gs(r,e=>b(e)),y=a.useRef(null),x=a.useRef(""),w=f.viewport,S=s.content-s.viewport,k=Vs(p),E=Vs(u),C=db(m,10);function N(e){if(y.current){const t=e.clientX-y.current.left,r=e.clientY-y.current.top;d({x:t,y:r})}}return a.useEffect(()=>{const e=e=>{const t=e.target,r=g?.contains(t);r&&k(e,S)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[w,g,S,k]),a.useEffect(E,[s,E]),pb(g,C),pb(f.content,C),e.jsx(Zg,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:Vs(o),onThumbPointerUp:Vs(c),onThumbPositionChange:E,onThumbPointerDown:Vs(l),children:e.jsx(Ws.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:Ts(t.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),y.current=g.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",f.viewport&&(f.viewport.style.scrollBehavior="auto"),N(e)}}),onPointerMove:Ts(t.onPointerMove,N),onPointerUp:Ts(t.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=x.current,f.viewport&&(f.viewport.style.scrollBehavior=""),y.current=null})})})}),Xg="ScrollAreaThumb",Qg=a.forwardRef((t,r)=>{const{forceMount:n,...a}=t,s=Jg(Xg,t.__scopeScrollArea);return e.jsx(li,{present:n||s.hasThumb,children:e.jsx(eb,{ref:r,...a})})}),eb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:s,...i}=t,o=Lg(Xg,n),c=Jg(Xg,n),{onThumbPositionChange:l}=c,u=gs(r,e=>c.onThumbChange(e)),d=a.useRef(void 0),p=db(()=>{d.current&&(d.current(),d.current=void 0)},100);return a.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(p(),!d.current){const t=ub(e,l);d.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),e.jsx(Ws.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:Ts(t.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;c.onThumbPointerDown({x:r,y:n})}),onPointerUp:Ts(t.onPointerUp,c.onThumbPointerUp)})});Qg.displayName=Xg;var tb="ScrollAreaCorner",rb=a.forwardRef((t,r)=>{const n=Lg(tb,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e.jsx(nb,{...t,ref:r}):null});rb.displayName=tb;var nb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,...s}=t,i=Lg(tb,n),[o,c]=a.useState(0),[l,u]=a.useState(0),d=Boolean(o&&l);return pb(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),u(e)}),pb(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),d?e.jsx(Ws.div,{...s,ref:r,style:{width:o,height:l,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null});function ab(e){return e?parseInt(e,10):0}function sb(e,t){const r=e/t;return isNaN(r)?0:r}function ib(e){const t=sb(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function ob(e,t,r="ltr"){const n=ib(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-a,i=t.content-t.viewport,o=s-n,c=Dg(e,"ltr"===r?[0,i]:[-1*i,0]);return cb([0,i],[0,o])(c)}function cb(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function lb(e,t){return e>0&&e<t}var ub=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function a(){const s={left:e.scrollLeft,top:e.scrollTop},i=r.left!==s.left,o=r.top!==s.top;(i||o)&&t(),r=s,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function db(e,t){const r=Vs(e),n=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),a.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function pb(e,t){const r=Vs(t);Ds(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var mb=Og,hb=Fg,fb=rb;const gb=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(mb,{ref:a,className:Se("relative overflow-hidden",t),...n,children:[e.jsx(hb,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(bb,{}),e.jsx(fb,{})]}));gb.displayName=mb.displayName;const bb=a.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e.jsx(Wg,{ref:a,orientation:r,className:Se("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 border-t border-t-transparent p-[1px]",t),...n,children:e.jsx(Qg,{className:Se("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));function vb(e){return`data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50%" y="50%" dominant-baseline="middle" alignment-baseline="middle" text-anchor="middle" font-size="50" font-family="sans-serif">${e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}</text></svg>`}bb.displayName=Wg.displayName;const yb=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑‍💻","👨‍💻","👩‍💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨‍💼","👩‍💼","👨‍🏫","👩‍🏫","👨‍🔬","👩‍🔬","👨‍🎨","👩‍🎨","👨‍🔧","👩‍🔧","👨‍🚀","👩‍🚀","👨‍⚖️","👩‍⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️‍🌈","🎟️","🎫"],xb=({workspace:r})=>{const{t:n}=an(),{updateWorkspace:a}=Pa(),{user:s}=hk(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[u,d]=t.useState(),[p,m]=t.useState(null),h=t.useRef(null);t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const f=Gu({resolver:Qm(Yh({name:Eh().min(2,{message:n("general.nameMinLength")}),image:Eh().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx(nl,{});const g=Aa(r,s?.id??null);return e.jsxs("div",{children:[p&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:p})]}),!g&&e.jsx("div",{className:"text-red-500",children:n("general.ownerOnly")}),e.jsx(Cf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){o(!0),m(null);try{await a(r,e),m(n("general.success")),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{m(null)},5e3)}catch(e){Re(e,{component:"WorkspaceSettingsGeneral",action:"updateWorkspace",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-6",children:[e.jsx(Af,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Tf,{children:[e.jsx(_f,{children:n("general.name")}),e.jsx(Rf,{children:e.jsx(Uf,{placeholder:n("general.namePlaceholder"),...t,disabled:!g})}),e.jsx(If,{})]})}),r.billingCurrency?.trim()&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Ef,{className:"text-sm font-medium text-muted-foreground",children:n("general.billingCurrency")}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[vf(r.billingCurrency)&&e.jsx("span",{className:"text-base",children:vf(r.billingCurrency)}),e.jsx("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Ef,{className:"text-sm font-medium",children:n("general.icon")}),e.jsx(Df,{children:n("general.iconDescription")})]}),e.jsxs(_g,{value:c,disabled:!g,onValueChange:e=>l(e),className:"flex flex-col space-y-3",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Rg,{value:"emoji",id:"emoji"}),e.jsxs(Ef,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(os,{className:"h-4 w-4"}),n("general.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Rg,{value:"url",id:"url"}),e.jsxs(Ef,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Qa,{className:"h-4 w-4"}),n("general.customImageUrl")]})]})]}),"emoji"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsxs("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:[u&&e.jsx("span",{className:"text-2xl",children:u}),!u&&f.watch("image")?.trim()&&e.jsx("img",{src:f.watch("image")||void 0,alt:"Workspace preview"})]})]}),g&&e.jsx(gb,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:yb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",vb(e))})(t),disabled:!g,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(u===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(Af,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Tf,{children:[e.jsx(_f,{children:n("general.imageUrl")}),e.jsx(Rf,{children:e.jsx(Uf,{placeholder:n("general.imageUrlPlaceholder"),...t,disabled:!g})}),e.jsx(Df,{children:n("general.imageUrlDescription")}),e.jsx(If,{})]})}),f.watch("image")&&f.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image")||void 0,className:"w-full h-full object-cover",alt:"Workspace preview"})})]})]})]}),e.jsx("div",{className:"flex justify-end gap-3 pt-4",children:g&&e.jsx(Ps,{type:"submit",disabled:i,progress:i,children:n("general.updateWorkspace")})})]})})]})};var wb=.999,Sb=/[\\\/_+.#"@\[\(\{&]/,kb=/[\\\/_+.#"@\[\(\{&]/g,Eb=/[\s-]/,Cb=/[\s-]/g;function Nb(e,t,r,n,a,s,i){if(s===t.length)return a===e.length?1:.99;var o=`${a},${s}`;if(void 0!==i[o])return i[o];for(var c,l,u,d,p=n.charAt(s),m=r.indexOf(p,a),h=0;m>=0;)(c=Nb(e,t,r,n,m+1,s+1,i))>h&&(m===a?c*=1:Sb.test(e.charAt(m-1))?(c*=.8,(u=e.slice(a,m-1).match(kb))&&a>0&&(c*=Math.pow(wb,u.length))):Eb.test(e.charAt(m-1))?(c*=.9,(d=e.slice(a,m-1).match(Cb))&&a>0&&(c*=Math.pow(wb,d.length))):(c*=.17,a>0&&(c*=Math.pow(wb,m-a))),e.charAt(m)!==t.charAt(s)&&(c*=.9999)),(c<.1&&r.charAt(m-1)===n.charAt(s+1)||n.charAt(s+1)===n.charAt(s)&&r.charAt(m-1)!==n.charAt(s))&&(.1*(l=Nb(e,t,r,n,m+1,s+2,i))>c&&(c=.1*l)),c>h&&(h=c),m=r.indexOf(p,m+1);return i[o]=h,h}function Ab(e){return e.toLowerCase().replace(Cb," ")}function jb(e,t,r){return Nb(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,Ab(e),Ab(t),0,0,{})}var Pb='[cmdk-group=""]',Tb='[cmdk-group-items=""]',_b='[cmdk-item=""]',Rb=`${_b}:not([aria-disabled="true"])`,Db="cmdk-item-select",Ib="data-value",Ub=(e,t,r)=>jb(e,t,r),Mb=a.createContext(void 0),Lb=()=>a.useContext(Mb),Ob=a.createContext(void 0),zb=()=>a.useContext(Ob),Fb=a.createContext(void 0),Bb=a.forwardRef((e,t)=>{let r=tv(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=tv(()=>new Set),s=tv(()=>new Map),i=tv(()=>new Map),o=tv(()=>new Set),c=Qb(e),{label:l,children:u,value:d,onValueChange:p,filter:m,shouldFilter:h,loop:f,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,y=Ms(),x=Ms(),w=Ms(),S=a.useRef(null),k=av();ev(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,E.emit()}},[d]),ev(()=>{k(6,T)},[]);let E=a.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var a,s,i,o;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)P(),A(),k(1,j);else if("value"===e){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let e=document.getElementById(w);e?e.focus():null==(a=document.getElementById(y))||a.focus()}if(k(7,()=>{var e;r.current.selectedItemId=null==(e=_())?void 0:e.id,E.emit()}),n||k(5,T),void 0!==(null==(s=c.current)?void 0:s.value)){let e=null!=t?t:"";return void(null==(o=(i=c.current).onValueChange)||o.call(i,e))}}E.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),C=a.useMemo(()=>({value:(e,t,n)=>{var a;t!==(null==(a=i.current.get(e))?void 0:a.value)&&(i.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,N(t,n)),k(2,()=>{A(),E.emit()}))},item:(e,t)=>(n.current.add(e),t&&(s.current.has(t)?s.current.get(t).add(e):s.current.set(t,new Set([e]))),k(3,()=>{P(),A(),r.current.value||j(),E.emit()}),()=>{i.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=_();k(4,()=>{P(),(null==t?void 0:t.getAttribute("id"))===e&&j(),E.emit()})}),group:e=>(s.current.has(e)||s.current.set(e,new Set),()=>{i.current.delete(e),s.current.delete(e)}),filter:()=>c.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:y,inputId:w,labelId:x,listInnerRef:S}),[]);function N(e,t){var n,a;let s=null!=(a=null==(n=c.current)?void 0:n.filter)?a:Ub;return e?s(e,r.current.search,t):0}function A(){if(!r.current.search||!1===c.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=s.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=S.current;R().sort((t,r)=>{var n,a;let s=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(a=e.get(s))?a:0)}).forEach(e=>{let t=e.closest(Tb);t?t.appendChild(e.parentElement===t?e:e.closest(`${Tb} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Tb} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${Pb}[${Ib}="${encodeURIComponent(e[0])}"]`);null==r||r.parentElement.appendChild(r)})}function j(){let e=R().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(Ib);E.setState("value",t||void 0)}function P(){var e,t,a,o;if(!r.current.search||!1===c.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let l=0;for(let s of n.current){let n=N(null!=(t=null==(e=i.current.get(s))?void 0:e.value)?t:"",null!=(o=null==(a=i.current.get(s))?void 0:a.keywords)?o:[]);r.current.filtered.items.set(s,n),n>0&&l++}for(let[e,t]of s.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=l}function T(){var e,t,r;let n=_();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Pb))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function _(){var e;return null==(e=S.current)?void 0:e.querySelector(`${_b}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(Rb))||[])}function D(e){let t=R()[e];t&&E.setState("value",t.getAttribute(Ib))}function I(e){var t;let r=_(),n=R(),a=n.findIndex(e=>e===r),s=n[a+e];null!=(t=c.current)&&t.loop&&(s=a+e<0?n[n.length-1]:a+e===n.length?n[0]:n[a+e]),s&&E.setState("value",s.getAttribute(Ib))}function U(e){let t,r=_(),n=null==r?void 0:r.closest(Pb);for(;n&&!t;)n=e>0?Yb(n,Pb):Xb(n,Pb),t=null==n?void 0:n.querySelector(Rb);t?E.setState("value",t.getAttribute(Ib)):I(e)}let M=()=>D(R().length-1),L=e=>{e.preventDefault(),e.metaKey?M():e.altKey?U(1):I(1)},O=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?U(-1):I(-1)};return a.createElement(Ws.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;null==(t=v.onKeyDown)||t.call(v,e);let r=e.nativeEvent.isComposing||229===e.keyCode;if(!e.defaultPrevented&&!r)switch(e.key){case"n":case"j":b&&e.ctrlKey&&L(e);break;case"ArrowDown":L(e);break;case"p":case"k":b&&e.ctrlKey&&O(e);break;case"ArrowUp":O(e);break;case"Home":e.preventDefault(),D(0);break;case"End":e.preventDefault(),M();break;case"Enter":{e.preventDefault();let t=_();if(t){let e=new Event(Db);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:iv},l),sv(e,e=>a.createElement(Ob.Provider,{value:E},a.createElement(Mb.Provider,{value:C},e))))}),Wb=a.forwardRef((e,t)=>{var r,n;let s=Ms(),i=a.useRef(null),o=a.useContext(Fb),c=Lb(),l=Qb(e),u=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==o?void 0:o.forceMount;ev(()=>{if(!u)return c.item(s,null==o?void 0:o.id)},[u]);let d=nv(s,i,[e.value,e.children,i],e.keywords),p=zb(),m=rv(e=>e.value&&e.value===d.current),h=rv(e=>!(!u&&!1!==c.filter())||(!e.search||e.filtered.items.get(s)>0));function f(){var e,t;g(),null==(t=(e=l.current).onSelect)||t.call(e,d.current)}function g(){p.setState("value",d.current,!0)}if(a.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(Db,f),()=>t.removeEventListener(Db,f)},[h,e.onSelect,e.disabled]),!h)return null;let{disabled:b,value:v,onSelect:y,forceMount:x,keywords:w,...S}=e;return a.createElement(Ws.div,{ref:fs(i,t),...S,id:s,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!m,"data-disabled":!!b,"data-selected":!!m,onPointerMove:b||c.getDisablePointerSelection()?void 0:g,onClick:b?void 0:f},e.children)}),Vb=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=Ms(),c=a.useRef(null),l=a.useRef(null),u=Ms(),d=Lb(),p=rv(e=>!(!s&&!1!==d.filter())||(!e.search||e.filtered.groups.has(o)));ev(()=>d.group(o),[]),nv(o,c,[e.value,e.heading,l]);let m=a.useMemo(()=>({id:o,forceMount:s}),[s]);return a.createElement(Ws.div,{ref:fs(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&a.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),sv(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},a.createElement(Fb.Provider,{value:m},e))))}),Hb=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=a.useRef(null),i=rv(e=>!e.search);return r||i?a.createElement(Ws.div,{ref:fs(s,t),...n,"cmdk-separator":"",role:"separator"}):null}),Gb=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=null!=e.value,i=zb(),o=rv(e=>e.search),c=rv(e=>e.selectedItemId),l=Lb();return a.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),a.createElement(Ws.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":c,id:l.inputId,type:"text",value:s?e.value:o,onChange:e=>{s||i.setState("search",e.target.value),null==r||r(e.target.value)}})}),$b=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=a.useRef(null),o=a.useRef(null),c=rv(e=>e.selectedItemId),l=Lb();return a.useEffect(()=>{if(o.current&&i.current){let e,t=o.current,r=i.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),a.createElement(Ws.div,{ref:fs(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":n,id:l.listId},sv(e,e=>a.createElement("div",{ref:fs(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),Kb=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...c}=e;return a.createElement(Go,{open:r,onOpenChange:n},a.createElement(Ko,{container:o},a.createElement(qo,{"cmdk-overlay":"",className:s}),a.createElement(Zo,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(Bb,{ref:t,...c}))))}),qb=a.forwardRef((e,t)=>rv(e=>0===e.filtered.count)?a.createElement(Ws.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Zb=a.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return a.createElement(Ws.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},sv(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),Jb=Object.assign(Bb,{List:$b,Item:Wb,Input:Gb,Group:Vb,Separator:Hb,Dialog:Kb,Empty:qb,Loading:Zb});function Yb(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Xb(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Qb(e){let t=a.useRef(e);return ev(()=>{t.current=e}),t}var ev="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function tv(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function rv(e){let t=zb(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function nv(e,t,r,n=[]){let s=a.useRef(),i=Lb();return ev(()=>{var a;let o=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():s.current}})(),c=n.map(e=>e.trim());i.value(e,o,c),null==(a=t.current)||a.setAttribute(Ib,o),s.current=o}),s}var av=()=>{let[e,t]=a.useState(),r=tv(()=>new Map);return ev(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function sv({asChild:e,children:t},r){return e&&a.isValidElement(t)?a.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var iv={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const ov=a.forwardRef(({className:t,...r},n)=>e.jsx(Jb,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));ov.displayName=Jb.displayName;const cv=a.forwardRef(({className:t,...r},n)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(oc,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(Jb.Input,{ref:n,className:Se("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",t),...r})]}));cv.displayName=Jb.Input.displayName;const lv=a.forwardRef(({className:t,...r},n)=>e.jsx(Jb.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));lv.displayName=Jb.List.displayName;a.forwardRef((t,r)=>e.jsx(Jb.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=Jb.Empty.displayName;const uv=a.forwardRef(({className:t,...r},n)=>e.jsx(Jb.Group,{ref:n,className:Se("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",t),...r}));uv.displayName=Jb.Group.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(Jb.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",t),...r})).displayName=Jb.Separator.displayName;const dv=a.forwardRef(({className:t,...r},n)=>e.jsx(Jb.Item,{ref:n,className:Se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r}));dv.displayName=Jb.Item.displayName;const pv=["top","right","bottom","left"],mv=Math.min,hv=Math.max,fv=Math.round,gv=Math.floor,bv=e=>({x:e,y:e}),vv={left:"right",right:"left",bottom:"top",top:"bottom"},yv={start:"end",end:"start"};function xv(e,t,r){return hv(e,mv(t,r))}function wv(e,t){return"function"==typeof e?e(t):e}function Sv(e){return e.split("-")[0]}function kv(e){return e.split("-")[1]}function Ev(e){return"x"===e?"y":"x"}function Cv(e){return"y"===e?"height":"width"}const Nv=new Set(["top","bottom"]);function Av(e){return Nv.has(Sv(e))?"y":"x"}function jv(e){return Ev(Av(e))}function Pv(e){return e.replace(/start|end/g,e=>yv[e])}const Tv=["left","right"],_v=["right","left"],Rv=["top","bottom"],Dv=["bottom","top"];function Iv(e,t,r,n){const a=kv(e);let s=function(e,t,r){switch(e){case"top":case"bottom":return r?t?_v:Tv:t?Tv:_v;case"left":case"right":return t?Rv:Dv;default:return[]}}(Sv(e),"start"===r,n);return a&&(s=s.map(e=>e+"-"+a),t&&(s=s.concat(s.map(Pv)))),s}function Uv(e){return e.replace(/left|right|bottom|top/g,e=>vv[e])}function Mv(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Lv(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function Ov(e,t,r){let{reference:n,floating:a}=e;const s=Av(t),i=jv(t),o=Cv(i),c=Sv(t),l="y"===s,u=n.x+n.width/2-a.width/2,d=n.y+n.height/2-a.height/2,p=n[o]/2-a[o]/2;let m;switch(c){case"top":m={x:u,y:n.y-a.height};break;case"bottom":m={x:u,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:d};break;case"left":m={x:n.x-a.width,y:d};break;default:m={x:n.x,y:n.y}}switch(kv(t)){case"start":m[i]-=p*(r&&l?-1:1);break;case"end":m[i]+=p*(r&&l?-1:1)}return m}async function zv(e,t){var r;void 0===t&&(t={});const{x:n,y:a,platform:s,rects:i,elements:o,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:m=0}=wv(t,e),h=Mv(m),f=o[p?"floating"===d?"reference":"floating":d],g=Lv(await s.getClippingRect({element:null==(r=await(null==s.isElement?void 0:s.isElement(f)))||r?f:f.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(o.floating)),boundary:l,rootBoundary:u,strategy:c})),b="floating"===d?{x:n,y:a,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==s.getOffsetParent?void 0:s.getOffsetParent(o.floating)),y=await(null==s.isElement?void 0:s.isElement(v))&&await(null==s.getScale?void 0:s.getScale(v))||{x:1,y:1},x=Lv(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:b,offsetParent:v,strategy:c}):b);return{top:(g.top-x.top+h.top)/y.y,bottom:(x.bottom-g.bottom+h.bottom)/y.y,left:(g.left-x.left+h.left)/y.x,right:(x.right-g.right+h.right)/y.x}}function Fv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Bv(e){return pv.some(t=>e[t]>=0)}const Wv=new Set(["left","top"]);function Vv(){return"undefined"!=typeof window}function Hv(e){return Kv(e)?(e.nodeName||"").toLowerCase():"#document"}function Gv(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function $v(e){var t;return null==(t=(Kv(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Kv(e){return!!Vv()&&(e instanceof Node||e instanceof Gv(e).Node)}function qv(e){return!!Vv()&&(e instanceof Element||e instanceof Gv(e).Element)}function Zv(e){return!!Vv()&&(e instanceof HTMLElement||e instanceof Gv(e).HTMLElement)}function Jv(e){return!(!Vv()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Gv(e).ShadowRoot)}const Yv=new Set(["inline","contents"]);function Xv(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=uy(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Yv.has(a)}const Qv=new Set(["table","td","th"]);function ey(e){return Qv.has(Hv(e))}const ty=[":popover-open",":modal"];function ry(e){return ty.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ny=["transform","translate","scale","rotate","perspective"],ay=["transform","translate","scale","rotate","perspective","filter"],sy=["paint","layout","strict","content"];function iy(e){const t=oy(),r=qv(e)?uy(e):e;return ny.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||ay.some(e=>(r.willChange||"").includes(e))||sy.some(e=>(r.contain||"").includes(e))}function oy(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const cy=new Set(["html","body","#document"]);function ly(e){return cy.has(Hv(e))}function uy(e){return Gv(e).getComputedStyle(e)}function dy(e){return qv(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function py(e){if("html"===Hv(e))return e;const t=e.assignedSlot||e.parentNode||Jv(e)&&e.host||$v(e);return Jv(t)?t.host:t}function my(e){const t=py(e);return ly(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zv(t)&&Xv(t)?t:my(t)}function hy(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=my(e),s=a===(null==(n=e.ownerDocument)?void 0:n.body),i=Gv(a);if(s){const e=fy(i);return t.concat(i,i.visualViewport||[],Xv(a)?a:[],e&&r?hy(e):[])}return t.concat(a,hy(a,[],r))}function fy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gy(e){const t=uy(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Zv(e),s=a?e.offsetWidth:r,i=a?e.offsetHeight:n,o=fv(r)!==s||fv(n)!==i;return o&&(r=s,n=i),{width:r,height:n,$:o}}function by(e){return qv(e)?e:e.contextElement}function vy(e){const t=by(e);if(!Zv(t))return bv(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=gy(t);let i=(s?fv(r.width):r.width)/n,o=(s?fv(r.height):r.height)/a;return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}const yy=bv(0);function xy(e){const t=Gv(e);return oy()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:yy}function wy(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),s=by(e);let i=bv(1);t&&(n?qv(n)&&(i=vy(n)):i=vy(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==Gv(e))&&t}(s,r,n)?xy(s):bv(0);let c=(a.left+o.x)/i.x,l=(a.top+o.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(s){const e=Gv(s),t=n&&qv(n)?Gv(n):n;let r=e,a=fy(r);for(;a&&n&&t!==r;){const e=vy(a),t=a.getBoundingClientRect(),n=uy(a),s=t.left+(a.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=s,l+=i,r=Gv(a),a=fy(r)}}return Lv({width:u,height:d,x:c,y:l})}function Sy(e,t){const r=dy(e).scrollLeft;return t?t.left+r:wy($v(e)).left+r}function ky(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Sy(e,r),y:r.top+t.scrollTop}}const Ey=new Set(["absolute","fixed"]);function Cy(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=Gv(e),n=$v(e),a=r.visualViewport;let s=n.clientWidth,i=n.clientHeight,o=0,c=0;if(a){s=a.width,i=a.height;const e=oy();(!e||e&&"fixed"===t)&&(o=a.offsetLeft,c=a.offsetTop)}const l=Sy(n);if(l<=0){const e=n.ownerDocument,t=e.body,r=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,i=Math.abs(n.clientWidth-t.clientWidth-a);i<=25&&(s-=i)}else l<=25&&(s+=l);return{width:s,height:i,x:o,y:c}}(e,r);else if("document"===t)n=function(e){const t=$v(e),r=dy(e),n=e.ownerDocument.body,a=hv(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=hv(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Sy(e);const o=-r.scrollTop;return"rtl"===uy(n).direction&&(i+=hv(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:i,y:o}}($v(e));else if(qv(t))n=function(e,t){const r=wy(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=Zv(e)?vy(e):bv(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:a*s.x,y:n*s.y}}(t,r);else{const r=xy(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Lv(n)}function Ny(e,t){const r=py(e);return!(r===t||!qv(r)||ly(r))&&("fixed"===uy(r).position||Ny(r,t))}function Ay(e,t,r){const n=Zv(t),a=$v(t),s="fixed"===r,i=wy(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const c=bv(0);function l(){c.x=Sy(a)}if(n||!n&&!s)if(("body"!==Hv(t)||Xv(a))&&(o=dy(t)),n){const e=wy(t,!0,s,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&l();s&&!n&&a&&l();const u=!a||n||s?bv(0):ky(a,o);return{x:i.left+o.scrollLeft-c.x-u.x,y:i.top+o.scrollTop-c.y-u.y,width:i.width,height:i.height}}function jy(e){return"static"===uy(e).position}function Py(e,t){if(!Zv(e)||"fixed"===uy(e).position)return null;if(t)return t(e);let r=e.offsetParent;return $v(e)===r&&(r=r.ownerDocument.body),r}function Ty(e,t){const r=Gv(e);if(ry(e))return r;if(!Zv(e)){let t=py(e);for(;t&&!ly(t);){if(qv(t)&&!jy(t))return t;t=py(t)}return r}let n=Py(e,t);for(;n&&ey(n)&&jy(n);)n=Py(n,t);return n&&ly(n)&&jy(n)&&!iy(n)?r:n||function(e){let t=py(e);for(;Zv(t)&&!ly(t);){if(iy(t))return t;if(ry(t))return null;t=py(t)}return null}(e)||r}const _y={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s="fixed"===a,i=$v(n),o=!!t&&ry(t.floating);if(n===i||o&&s)return r;let c={scrollLeft:0,scrollTop:0},l=bv(1);const u=bv(0),d=Zv(n);if((d||!d&&!s)&&(("body"!==Hv(n)||Xv(i))&&(c=dy(n)),Zv(n))){const e=wy(n);l=vy(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const p=!i||d||s?bv(0):ky(i,c);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+u.x+p.x,y:r.y*l.y-c.scrollTop*l.y+u.y+p.y}},getDocumentElement:$v,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const s=[..."clippingAncestors"===r?ry(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=hy(e,[],!1).filter(e=>qv(e)&&"body"!==Hv(e)),a=null;const s="fixed"===uy(e).position;let i=s?py(e):e;for(;qv(i)&&!ly(i);){const t=uy(i),r=iy(i);r||"fixed"!==t.position||(a=null),(s?!r&&!a:!r&&"static"===t.position&&a&&Ey.has(a.position)||Xv(i)&&!r&&Ny(e,i))?n=n.filter(e=>e!==i):a=t,i=py(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=s[0],o=s.reduce((e,r)=>{const n=Cy(t,r,a);return e.top=hv(n.top,e.top),e.right=mv(n.right,e.right),e.bottom=mv(n.bottom,e.bottom),e.left=hv(n.left,e.left),e},Cy(t,i,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:Ty,getElementRects:async function(e){const t=this.getOffsetParent||Ty,r=this.getDimensions,n=await r(e.floating);return{reference:Ay(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=gy(e);return{width:t,height:r}},getScale:vy,isElement:qv,isRTL:function(e){return"rtl"===uy(e).direction}};function Ry(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Dy(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:c=!1}=n,l=by(e),u=a||s?[...l?hy(l):[],...hy(t)]:[];u.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),s&&e.addEventListener("resize",r)});const d=l&&o?function(e,t){let r,n=null;const a=$v(e);function s(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(o,c){void 0===o&&(o=!1),void 0===c&&(c=1),s();const l=e.getBoundingClientRect(),{left:u,top:d,width:p,height:m}=l;if(o||t(),!p||!m)return;const h={rootMargin:-gv(d)+"px "+-gv(a.clientWidth-(u+p))+"px "+-gv(a.clientHeight-(d+m))+"px "+-gv(u)+"px",threshold:hv(0,mv(1,c))||1};let f=!0;function g(t){const n=t[0].intersectionRatio;if(n!==c){if(!f)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||Ry(l,e.getBoundingClientRect())||i(),f=!1}try{n=new IntersectionObserver(g,{...h,root:a.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),s}(l,r):null;let p,m=-1,h=null;i&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),l&&!c&&h.observe(l),h.observe(t));let f=c?wy(e):null;return c&&function t(){const n=wy(e);f&&!Ry(f,n)&&r();f=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",r),s&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Iy=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:s,placement:i,middlewareData:o}=t,c=await async function(e,t){const{placement:r,platform:n,elements:a}=e,s=await(null==n.isRTL?void 0:n.isRTL(a.floating)),i=Sv(r),o=kv(r),c="y"===Av(r),l=Wv.has(i)?-1:1,u=s&&c?-1:1,d=wv(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&"number"==typeof h&&(m="end"===o?-1*h:h),c?{x:m*u,y:p*l}:{x:p*l,y:m*u}}(t,e);return i===(null==(r=o.offset)?void 0:r.placement)&&null!=(n=o.arrow)&&n.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},Uy=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a,platform:s}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:c={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=wv(e,t),u={x:r,y:n},d=await s.detectOverflow(t,l),p=Av(Sv(a)),m=Ev(p);let h=u[m],f=u[p];if(i){const e="y"===m?"bottom":"right";h=xv(h+d["y"===m?"top":"left"],h,h-d[e])}if(o){const e="y"===p?"bottom":"right";f=xv(f+d["y"===p?"top":"left"],f,f-d[e])}const g=c.fn({...t,[m]:h,[p]:f});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[m]:i,[p]:o}}}}}},My=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:a,middlewareData:s,rects:i,initialPlacement:o,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=!0,...g}=wv(e,t);if(null!=(r=s.arrow)&&r.alignmentOffset)return{};const b=Sv(a),v=Av(o),y=Sv(o)===o,x=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=p||(y||!f?[Uv(o)]:function(e){const t=Uv(e);return[Pv(e),t,Pv(t)]}(o)),S="none"!==h;!p&&S&&w.push(...Iv(o,f,h,x));const k=[o,...w],E=await c.detectOverflow(t,g),C=[];let N=(null==(n=s.flip)?void 0:n.overflows)||[];if(u&&C.push(E[b]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=kv(e),a=jv(e),s=Cv(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Uv(i)),[i,Uv(i)]}(a,i,x);C.push(E[e[0]],E[e[1]])}if(N=[...N,{placement:a,overflows:C}],!C.every(e=>e<=0)){var A,j;const e=((null==(A=s.flip)?void 0:A.index)||0)+1,t=k[e];if(t){if(!("alignment"===d&&v!==Av(t))||N.every(e=>Av(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:N},reset:{placement:t}}}let r=null==(j=N.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:j.placement;if(!r)switch(m){case"bestFit":{var P;const e=null==(P=N.filter(e=>{if(S){const t=Av(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(r=e);break}case"initialPlacement":r=o}if(a!==r)return{reset:{placement:r}}}return{}}}},Ly=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:s,platform:i,elements:o}=t,{apply:c=()=>{},...l}=wv(e,t),u=await i.detectOverflow(t,l),d=Sv(a),p=kv(a),m="y"===Av(a),{width:h,height:f}=s.floating;let g,b;"top"===d||"bottom"===d?(g=d,b=p===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(b=d,g="end"===p?"top":"bottom");const v=f-u.top-u.bottom,y=h-u.left-u.right,x=mv(f-u[g],v),w=mv(h-u[b],y),S=!t.middlewareData.shift;let k=x,E=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(E=y),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=v),S&&!p){const e=hv(u.left,0),t=hv(u.right,0),r=hv(u.top,0),n=hv(u.bottom,0);m?E=h-2*(0!==e||0!==t?e+t:hv(u.left,u.right)):k=f-2*(0!==r||0!==n?r+n:hv(u.top,u.bottom))}await c({...t,availableWidth:E,availableHeight:k});const C=await i.getDimensions(o.floating);return h!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},Oy=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...s}=wv(e,t);switch(a){case"referenceHidden":{const e=Fv(await n.detectOverflow(t,{...s,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Bv(e)}}}case"escaped":{const e=Fv(await n.detectOverflow(t,{...s,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:Bv(e)}}}default:return{}}}}},zy=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:s,platform:i,elements:o,middlewareData:c}=t,{element:l,padding:u=0}=wv(e,t)||{};if(null==l)return{};const d=Mv(u),p={x:r,y:n},m=jv(a),h=Cv(m),f=await i.getDimensions(l),g="y"===m,b=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",x=s.reference[h]+s.reference[m]-p[m]-s.floating[h],w=p[m]-s.reference[m],S=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l));let k=S?S[y]:0;k&&await(null==i.isElement?void 0:i.isElement(S))||(k=o.floating[y]||s.floating[h]);const E=x/2-w/2,C=k/2-f[h]/2-1,N=mv(d[b],C),A=mv(d[v],C),j=N,P=k-f[h]-A,T=k/2-f[h]/2+E,_=xv(j,T,P),R=!c.arrow&&null!=kv(a)&&T!==_&&s.reference[h]/2-(T<j?N:A)-f[h]/2<0,D=R?T<j?T-j:T-P:0;return{[m]:p[m]+D,data:{[m]:_,centerOffset:T-_-D,...R&&{alignmentOffset:D}},reset:R}}}),Fy=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:s,middlewareData:i}=t,{offset:o=0,mainAxis:c=!0,crossAxis:l=!0}=wv(e,t),u={x:r,y:n},d=Av(a),p=Ev(d);let m=u[p],h=u[d];const f=wv(o,t),g="number"==typeof f?{mainAxis:f,crossAxis:0}:{mainAxis:0,crossAxis:0,...f};if(c){const e="y"===p?"height":"width",t=s.reference[p]-s.floating[e]+g.mainAxis,r=s.reference[p]+s.reference[e]-g.mainAxis;m<t?m=t:m>r&&(m=r)}if(l){var b,v;const e="y"===p?"width":"height",t=Wv.has(Sv(a)),r=s.reference[d]-s.floating[e]+(t&&(null==(b=i.offset)?void 0:b[d])||0)+(t?0:g.crossAxis),n=s.reference[d]+s.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[p]:m,[d]:h}}}},By=(e,t,r)=>{const n=new Map,a={platform:_y,...r},s={...a.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:s=[],platform:i}=r,o=s.filter(Boolean),c=await(null==i.isRTL?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=Ov(l,n,c),p=n,m={},h=0;for(let r=0;r<o.length;r++){var f;const{name:s,fn:g}=o[r],{x:b,y:v,data:y,reset:x}=await g({x:u,y:d,initialPlacement:n,placement:p,strategy:a,middlewareData:m,rects:l,platform:{...i,detectOverflow:null!=(f=i.detectOverflow)?f:zv},elements:{reference:e,floating:t}});u=null!=b?b:u,d=null!=v?v:d,m={...m,[s]:{...m[s],...y}},x&&h<=50&&(h++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(l=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):x.rects),({x:u,y:d}=Ov(l,p,c))),r=-1)}return{x:u,y:d,placement:p,strategy:a,middlewareData:m}})(e,t,{...a,platform:s})};var Wy="undefined"!=typeof document?t.useLayoutEffect:function(){};function Vy(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!Vy(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;0!==n--;){const r=a[n];if(("_owner"!==r||!e.$$typeof)&&!Vy(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function Hy(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gy(e,t){const r=Hy(e);return Math.round(t*r)/r}function $y(e){const t=a.useRef(e);return Wy(()=>{t.current=e}),t}const Ky=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(a=r,{}.hasOwnProperty.call(a,"current"))?null!=r.current?zy({element:r.current,padding:n}).fn(t):{}:r?zy({element:r,padding:n}).fn(t):{};var a}}),qy=(e,t)=>({...Iy(e),options:[e,t]}),Zy=(e,t)=>({...Uy(e),options:[e,t]}),Jy=(e,t)=>({...Fy(e),options:[e,t]}),Yy=(e,t)=>({...My(e),options:[e,t]}),Xy=(e,t)=>({...Ly(e),options:[e,t]}),Qy=(e,t)=>({...Oy(e),options:[e,t]}),ex=(e,t)=>({...Ky(e),options:[e,t]});var tx=a.forwardRef((t,r)=>{const{children:n,width:a=10,height:s=5,...i}=t;return e.jsx(Ws.svg,{...i,ref:r,width:a,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:e.jsx("polygon",{points:"0,0 30,0 15,10"})})});tx.displayName="Arrow";var rx=tx,nx="Popper",[ax,sx]=_s(nx),[ix,ox]=ax(nx),cx=t=>{const{__scopePopper:r,children:n}=t,[s,i]=a.useState(null);return e.jsx(ix,{scope:r,anchor:s,onAnchorChange:i,children:n})};cx.displayName=nx;var lx="PopperAnchor",ux=a.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:s,...i}=t,o=ox(lx,n),c=a.useRef(null),l=gs(r,c),u=a.useRef(null);return a.useEffect(()=>{const e=u.current;u.current=s?.current||c.current,e!==u.current&&o.onAnchorChange(u.current)}),s?null:e.jsx(Ws.div,{...i,ref:l})});ux.displayName=lx;var dx="PopperContent",[px,mx]=ax(dx),hx=a.forwardRef((t,r)=>{const{__scopePopper:n,side:i="bottom",sideOffset:o=0,align:c="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=ox(dx,n),[x,w]=a.useState(null),S=gs(r,e=>w(e)),[k,E]=a.useState(null),C=il(k),N=C?.width??0,A=C?.height??0,j=i+("center"!==c?"-"+c:""),P="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},T=Array.isArray(p)?p:[p],_=T.length>0,R={padding:P,boundary:T.filter(vx),altBoundary:_},{refs:D,floatingStyles:I,placement:U,isPositioned:M,middlewareData:L}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:c}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[p,m]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=a.useState(n);Vy(h,n)||f(n);const[g,b]=a.useState(null),[v,y]=a.useState(null),x=a.useCallback(e=>{e!==E.current&&(E.current=e,b(e))},[]),w=a.useCallback(e=>{e!==C.current&&(C.current=e,y(e))},[]),S=o||g,k=c||v,E=a.useRef(null),C=a.useRef(null),N=a.useRef(p),A=null!=u,j=$y(u),P=$y(i),T=$y(d),_=a.useCallback(()=>{if(!E.current||!C.current)return;const e={placement:t,strategy:r,middleware:h};P.current&&(e.platform=P.current),By(E.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==T.current};R.current&&!Vy(N.current,t)&&(N.current=t,s.flushSync(()=>{m(t)}))})},[h,t,r,P,T]);Wy(()=>{!1===d&&N.current.isPositioned&&(N.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[d]);const R=a.useRef(!1);Wy(()=>(R.current=!0,()=>{R.current=!1}),[]),Wy(()=>{if(S&&(E.current=S),k&&(C.current=k),S&&k){if(j.current)return j.current(S,k,_);_()}},[S,k,_,j,A]);const D=a.useMemo(()=>({reference:E,floating:C,setReference:x,setFloating:w}),[x,w]),I=a.useMemo(()=>({reference:S,floating:k}),[S,k]),U=a.useMemo(()=>{const e={position:r,left:0,top:0};if(!I.floating)return e;const t=Gy(I.floating,p.x),n=Gy(I.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...Hy(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,I.floating,p.x,p.y]);return a.useMemo(()=>({...p,update:_,refs:D,elements:I,floatingStyles:U}),[p,_,D,I,U])}({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>Dy(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[qy({mainAxis:o+A,alignmentAxis:l}),d&&Zy({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?Jy():void 0,...R}),d&&Yy({...R}),Xy({...R,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:a,height:s}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${a}px`),i.setProperty("--radix-popper-anchor-height",`${s}px`)}}),k&&ex({element:k,padding:u}),yx({arrowWidth:N,arrowHeight:A}),f&&Qy({strategy:"referenceHidden",...R})]}),[O,z]=xx(U),F=Vs(b);Ds(()=>{M&&F?.()},[M,F]);const B=L.arrow?.x,W=L.arrow?.y,V=0!==L.arrow?.centerOffset,[H,G]=a.useState();return Ds(()=>{x&&G(window.getComputedStyle(x).zIndex)},[x]),e.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:M?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:H,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(px,{scope:n,placedSide:O,onArrowChange:E,arrowX:B,arrowY:W,shouldHideArrow:V,children:e.jsx(Ws.div,{"data-side":O,"data-align":z,...v,ref:S,style:{...v.style,animation:M?void 0:"none"}})})})});hx.displayName=dx;var fx="PopperArrow",gx={top:"bottom",right:"left",bottom:"top",left:"right"},bx=a.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=mx(fx,n),i=gx[s.placedSide];return e.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:e.jsx(rx,{...a,ref:r,style:{...a.style,display:"block"}})})});function vx(e){return null!==e}bx.displayName=fx;var yx=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:a}=t,s=0!==a.arrow?.centerOffset,i=s?0:e.arrowWidth,o=s?0:e.arrowHeight,[c,l]=xx(r),u={start:"0%",center:"50%",end:"100%"}[l],d=(a.arrow?.x??0)+i/2,p=(a.arrow?.y??0)+o/2;let m="",h="";return"bottom"===c?(m=s?u:`${d}px`,h=-o+"px"):"top"===c?(m=s?u:`${d}px`,h=`${n.floating.height+o}px`):"right"===c?(m=-o+"px",h=s?u:`${p}px`):"left"===c&&(m=`${n.floating.width+o}px`,h=s?u:`${p}px`),{data:{x:m,y:h}}}});function xx(e){const[t,r="center"]=e.split("-");return[t,r]}var wx=cx,Sx=ux,kx=hx,Ex=bx;function Cx(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?fs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Nx=Symbol("radix.slottable");function Ax(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Nx}var jx="Popover",[Px]=_s(jx,[sx]),Tx=sx(),[_x,Rx]=Px(jx),Dx=t=>{const{__scopePopover:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!1}=t,l=Tx(r),u=a.useRef(null),[d,p]=a.useState(!1),[m,h]=Os({prop:s,defaultProp:i??!1,onChange:o,caller:jx});return e.jsx(wx,{...l,children:e.jsx(_x,{scope:r,contentId:Ms(),triggerRef:u,open:m,onOpenChange:h,onOpenToggle:a.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:d,onCustomAnchorAdd:a.useCallback(()=>p(!0),[]),onCustomAnchorRemove:a.useCallback(()=>p(!1),[]),modal:c,children:n})})};Dx.displayName=jx;var Ix="PopoverAnchor";a.forwardRef((t,r)=>{const{__scopePopover:n,...s}=t,i=Rx(Ix,n),o=Tx(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=i;return a.useEffect(()=>(c(),()=>l()),[c,l]),e.jsx(Sx,{...o,...s,ref:r})}).displayName=Ix;var Ux="PopoverTrigger",Mx=a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Rx(Ux,n),i=Tx(n),o=gs(r,s.triggerRef),c=e.jsx(Ws.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":qx(s.open),...a,ref:o,onClick:Ts(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:e.jsx(Sx,{asChild:!0,...i,children:c})});Mx.displayName=Ux;var Lx="PopoverPortal",[Ox,zx]=Px(Lx,{forceMount:void 0}),Fx=t=>{const{__scopePopover:r,forceMount:n,children:a,container:s}=t,i=Rx(Lx,r);return e.jsx(Ox,{scope:r,forceMount:n,children:e.jsx(li,{present:n||i.open,children:e.jsx(ci,{asChild:!0,container:s,children:a})})})};Fx.displayName=Lx;var Bx="PopoverContent",Wx=a.forwardRef((t,r)=>{const n=zx(Bx,t.__scopePopover),{forceMount:a=n.forceMount,...s}=t,i=Rx(Bx,t.__scopePopover);return e.jsx(li,{present:a||i.open,children:i.modal?e.jsx(Hx,{...s,ref:r}):e.jsx(Gx,{...s,ref:r})})});Wx.displayName=Bx;var Vx=function(t){const r=Cx(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Ax);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("PopoverContent.RemoveScroll"),Hx=a.forwardRef((t,r)=>{const n=Rx(Bx,t.__scopePopover),s=a.useRef(null),i=gs(r,s),o=a.useRef(!1);return a.useEffect(()=>{const e=s.current;if(e)return oo(e)},[]),e.jsx(eo,{as:Vx,allowPinchZoom:!0,children:e.jsx($x,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ts(t.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ts(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;o.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:Ts(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),Gx=a.forwardRef((t,r)=>{const n=Rx(Bx,t.__scopePopover),s=a.useRef(!1),i=a.useRef(!1);return e.jsx($x,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(s.current||n.triggerRef.current?.focus(),e.preventDefault()),s.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(s.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const r=e.target,a=n.triggerRef.current?.contains(r);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),$x=a.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onInteractOutside:d,...p}=t,m=Rx(Bx,n),h=Tx(n);return pi(),e.jsx(ti,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:e.jsx(Zs,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:u,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(kx,{"data-state":qx(m.open),role:"dialog",id:m.contentId,...h,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Kx="PopoverClose";a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Rx(Kx,n);return e.jsx(Ws.button,{type:"button",...a,ref:r,onClick:Ts(t.onClick,()=>s.onOpenChange(!1))})}).displayName=Kx;function qx(e){return e?"open":"closed"}a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Tx(n);return e.jsx(Ex,{...s,...a,ref:r})}).displayName="PopoverArrow";var Zx=Fx,Jx=Wx;const Yx=Dx,Xx=Mx,Qx=a.forwardRef(({className:t,align:r="center",sideOffset:n=4,...s},i)=>{const{container:o}=a.useContext(cc);return e.jsx(Zx,{container:o,children:e.jsx(Jx,{ref:i,align:r,sideOffset:n,className:Se("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...s})})});function ew({options:r,value:n,onChange:a,placeholder:s="Search...",emptyLabel:i="Choose option"}){const[o,c]=t.useState(n??""),[l,u]=t.useState(!1);t.useEffect(()=>{void 0!==n&&c(n)},[n]);const d=r.find(e=>e.value===o);return e.jsxs(Yx,{open:l,onOpenChange:u,children:[e.jsx(Xx,{asChild:!0,children:e.jsxs(Ps,{variant:"outline",role:"combobox","aria-expanded":l,className:"justify-between overflow-hidden text-ellipsis",children:[d?e.jsxs("div",{children:[String(d.label).trim(),d.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:d.icon})]}):e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx(qa,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Qx,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(ov,{children:[e.jsx(cv,{placeholder:s}),e.jsx(lv,{children:e.jsx(uv,{children:r.map(t=>e.jsxs(dv,{className:Se("whitespace-nowrap text-start",{"text-green-500":o===t.value}),value:t.value,defaultValue:t.value,onSelect:()=>{return e=t.value,c(e),a?.(e),void u(!1);var e},children:[o===t.value&&e.jsx(Ka,{className:Se("me-2 h-4 w-4 text-green-400",o===t.value?"opacity-100":"opacity-0")}),String(t.label).trim(),t.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:t.icon})]},t.value))})})]})})]})}Qx.displayName=Jx.displayName;const tw={USD:"$",EUR:"€",JPY:"¥",GBP:"£",AUD:"A$",CAD:"C$",CHF:"CHF",CNY:"¥",SEK:"kr",NZD:"NZ$",INR:"₹",RUB:"₽",KRW:"₩",BRL:"R$",ZAR:"R",HKD:"HK$",SGD:"S$",MXN:"Mex$",NOK:"kr",TRY:"₺",IDR:"Rp",PLN:"zł",THB:"฿",ILS:"₪",PHP:"₱",MYR:"RM",CZK:"Kč",HUF:"Ft",DKK:"kr",PKR:"₨",EGP:"£",NGN:"₦",BDT:"৳",UAH:"₴",KZT:"₸",VND:"₫",ARS:"$",BGN:"лв",COP:"COL$",HRK:"kn",ISK:"kr",KES:"KSh",LKR:"Rs",MAD:"د.م.",MNT:"₮",NPR:"रू",RSD:"дин.",SAR:"ر.س",TWD:"NT$",UYU:"$U",YER:"﷼",FJD:"FJ$",JMD:"J$",HTG:"G",BHD:"ب.د",KWD:"د.ك",OMR:"ر.ع.",BND:"B$",KPW:"₩",GHS:"₵",SYP:"ل.س",SLL:"Le",SSP:"£",AFN:"؋",MGA:"Ar",MDL:"lei",FOK:"kr",GMD:"D",LTL:"Lt",LVL:"Ls",HNL:"L",GEL:"₾",BMD:"$",AWG:"Afl",BTN:"Nu",GTQ:"Q",TZS:"TSh",BBD:"Bds$",NAD:"N$",BZD:"$",JEP:"£",WST:"T",PGK:"K",KGS:"лв",AZN:"₼",QAR:"ر.ق",XOF:"CFA",XPF:"CFP"},rw={AF:"AFN",AX:"EUR",AL:"ALL",DZ:"DZD",AS:"USD",AD:"EUR",AO:"AOA",AI:"XCD",AQ:"USD",AG:"XCD",AR:"ARS",AM:"AMD",AW:"AWG",AU:"AUD",AT:"EUR",AZ:"AZN",BS:"BSD",BH:"BHD",BD:"BDT",BB:"BBD",BY:"BYN",BE:"EUR",BZ:"BZD",BJ:"XOF",BM:"BMD",BT:"BTN",BO:"BOB",BA:"BAM",BW:"BWP",BV:"NOK",BR:"BRL",IO:"USD",BN:"BND",BG:"BGN",BF:"XOF",BI:"BIF",KH:"KHR",CM:"XAF",CA:"CAD",CV:"CVE",KY:"KYD",CF:"XAF",TD:"XAF",CL:"CLP",CN:"CNY",CX:"AUD",CC:"AUD",CO:"COP",KM:"KMF",CG:"XAF",CD:"CDF",CK:"NZD",CR:"CRC",CI:"XOF",HR:"HRK",CU:"CUP",CY:"EUR",CZ:"CZK",DK:"DKK",DJ:"DJF",DM:"XCD",DO:"DOP",EC:"USD",EG:"EGP",SV:"USD",GQ:"XAF",ER:"ERN",EE:"EUR",ET:"ETB",FK:"FKP",FO:"DKK",FJ:"FJD",FI:"EUR",FR:"EUR",GF:"EUR",PF:"XPF",TF:"EUR",GA:"XAF",GM:"GMD",GE:"GEL",DE:"EUR",GH:"GHS",GI:"GIP",GR:"EUR",GL:"DKK",GD:"XCD",GP:"EUR",GU:"USD",GT:"GTQ",GG:"GBP",GN:"GNF",GW:"XOF",GY:"GYD",HT:"HTG",HM:"AUD",VA:"EUR",HN:"HNL",HK:"HKD",HU:"HUF",IS:"ISK",IN:"INR",ID:"IDR",IR:"IRR",IQ:"IQD",IE:"EUR",IM:"GBP",IL:"ILS",IT:"EUR",JM:"JMD",JP:"JPY",JE:"GBP",JO:"JOD",KZ:"KZT",KE:"KES",KI:"AUD",KP:"KPW",KR:"KRW",KW:"KWD",KG:"KGS",LA:"LAK",LV:"EUR",LB:"LBP",LS:"LSL",LR:"LRD",LY:"LYD",LI:"CHF",LT:"EUR",LU:"EUR",MO:"MOP",MK:"MKD",MG:"MGA",MW:"MWK",MY:"MYR",MV:"MVR",ML:"XOF",MT:"EUR",MH:"USD",MQ:"EUR",MR:"MRU",MU:"MUR",YT:"EUR",MX:"MXN",FM:"USD",MD:"MDL",MC:"EUR",MN:"MNT",ME:"EUR",MS:"XCD",MA:"MAD",MZ:"MZN",MM:"MMK",NA:"NAD",NR:"AUD",NP:"NPR",NL:"EUR",AN:"ANG",NC:"XPF",NZ:"NZD",NI:"NIO",NE:"XOF",NG:"NGN",NU:"NZD",NF:"AUD",MP:"USD",NO:"NOK",OM:"OMR",PK:"PKR",PW:"USD",PS:"ILS",PA:"PAB",PG:"PGK",PY:"PYG",PE:"PEN",PH:"PHP",PN:"NZD",PL:"PLN",PT:"EUR",PR:"USD",QA:"QAR",RE:"EUR",RO:"RON",RU:"RUB",RW:"RWF",SH:"SHP",KN:"XCD",LC:"XCD",PM:"EUR",VC:"XCD",WS:"WST",SM:"EUR",ST:"STN",SA:"SAR",SN:"XOF",RS:"RSD",SC:"SCR",SL:"SLL",SG:"SGD",SK:"EUR",SI:"EUR",SB:"SBD",SO:"SOS",ZA:"ZAR",GS:"GBP",ES:"EUR",LK:"LKR",SD:"SDG",SR:"SRD",SJ:"NOK",SZ:"SZL",SE:"SEK",CH:"CHF",SY:"SYP",TW:"TWD",TJ:"TJS",TZ:"TZS",TH:"THB"},nw=[{name:"Afghanistan",code:"AF"},{name:"land Islands",code:"AX"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"AndorrA",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua and Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia and Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"Brunei Darussalam",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Cape Verde",code:"CV"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo",code:"CG"},{name:"Congo, The Democratic Republic of the",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Cote D Ivoire",code:"CI"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands (Malvinas)",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island and Mcdonald Islands",code:"HM"},{name:"Holy See (Vatican City State)",code:"VA"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran, Islamic Republic Of",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:'Korea, Democratic People"S Republic of',code:"KP"},{name:"Korea, Republic of",code:"KR"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:'Lao People"S Democratic Republic',code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libyan Arab Jamahiriya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Macedonia, The Former Yugoslav Republic of",code:"MK"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia, Federated States of",code:"FM"},{name:"Moldova, Republic of",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"Netherlands Antilles",code:"AN"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territory, Occupied",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Reunion",code:"RE"},{name:"Romania",code:"RO"},{name:"Russian Federation",code:"RU"},{name:"RWANDA",code:"RW"},{name:"Saint Helena",code:"SH"},{name:"Saint Kitts and Nevis",code:"KN"},{name:"Saint Lucia",code:"LC"},{name:"Saint Pierre and Miquelon",code:"PM"},{name:"Saint Vincent and the Grenadines",code:"VC"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Sao Tome and Principe",code:"ST"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia and the South Sandwich Islands",code:"GS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard and Jan Mayen",code:"SJ"},{name:"Swaziland",code:"SZ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syrian Arab Republic",code:"SY"},{name:"Taiwan, Province of China",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania, United Republic of",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad and Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks and Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"United States Minor Outlying Islands",code:"UM"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Venezuela",code:"VE"},{name:"Viet Nam",code:"VN"},{name:"Virgin Islands, British",code:"VG"},{name:"Virgin Islands, U.S.",code:"VI"},{name:"Wallis and Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"}].map(e=>{const t=rw[e.code]||"USD",r=tw[t]||"";return{value:e.code,flag:(n=e.code,n.toUpperCase().replace(/./g,e=>String.fromCodePoint(127397+e.charCodeAt(0)))),text:e.name,currencyCode:t,currencyIcon:r};var n});function aw({value:t,onChange:r}){const{t:n}=an(),a=nw.map(e=>({value:e.value,label:e.text,icon:e.flag}));return e.jsx(ew,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCountry"),emptyLabel:n("dropdowns.chooseCountry")})}const sw=nw.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),iw=Array.from(new Set(sw.map(e=>e.value))).map(e=>sw.find(t=>t.value===e)).filter(e=>void 0!==e);function ow({value:t,onChange:r}){const{t:n}=an(),a=iw.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return e.jsx(ew,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCurrency"),emptyLabel:n("dropdowns.chooseCurrency")})}let cw=[{code:"en",label:"English",flag:"🇬🇧"},{code:"en-GB",label:"English (United Kingdom)",flag:"🇬🇧"},{code:"en-US",label:"English (United States)",flag:"🇺🇸"},{code:"en-AU",label:"English (Australia)",flag:"🇦🇺"},{code:"en-CA",label:"English (Canada)",flag:"🇨🇦"},{code:"en-NZ",label:"English (New Zealand)",flag:"🇳🇿"},{code:"es",label:"Spanish",flag:"🇪🇸"},{code:"es-ES",label:"Spanish (Spain)",flag:"🇪🇸"},{code:"es-MX",label:"Spanish (Mexico)",flag:"🇲🇽"},{code:"fr",label:"French",flag:"🇫🇷"},{code:"fr-FR",label:"French (France)",flag:"🇫🇷"},{code:"de",label:"German",flag:"🇩🇪"},{code:"de-DE",label:"German (Germany)",flag:"🇩🇪"},{code:"it",label:"Italian",flag:"🇮🇹"},{code:"it-IT",label:"Italian (Italy)",flag:"🇮🇹"},{code:"pt",label:"Portuguese",flag:"🇵🇹"},{code:"pt-PT",label:"Portuguese (Portugal)",flag:"🇵🇹"},{code:"pt-BR",label:"Portuguese (Brazil)",flag:"🇧🇷"},{code:"ru",label:"Russian",flag:"🇷🇺"},{code:"ru-RU",label:"Russian (Russia)",flag:"🇷🇺"},{code:"zh",label:"Chinese",flag:"🇨🇳"},{code:"zh-CN",label:"Chinese (Simplified)",flag:"🇨🇳"},{code:"zh-TW",label:"Chinese (Traditional)",flag:"🇹🇼"},{code:"ja",label:"Japanese",flag:"🇯🇵"},{code:"ja-JP",label:"Japanese (Japan)",flag:"🇯🇵"},{code:"ko",label:"Korean",flag:"🇰🇷"},{code:"ko-KR",label:"Korean (South Korea)",flag:"🇰🇷"},{code:"ar",label:"Arabic",flag:"🇸🇦"},{code:"ar-SA",label:"Arabic (Saudi Arabia)",flag:"🇸🇦"},{code:"hi",label:"Hindi",flag:"🇮🇳"},{code:"hi-IN",label:"Hindi (India)",flag:"🇮🇳"},{code:"bn",label:"Bengali",flag:"🇮🇳"},{code:"bn-IN",label:"Bengali (India)",flag:"🇮🇳"},{code:"gu",label:"Gujarati",flag:"🇮🇳"},{code:"gu-IN",label:"Gujarati (India)",flag:"🇮🇳"},{code:"ta",label:"Tamil",flag:"🇮🇳"},{code:"ta-IN",label:"Tamil (India)",flag:"🇮🇳"},{code:"te",label:"Telugu",flag:"🇮🇳"},{code:"te-IN",label:"Telugu (India)",flag:"🇮🇳"},{code:"ml",label:"Malayalam",flag:"🇮🇳"},{code:"ml-IN",label:"Malayalam (India)",flag:"🇮🇳"},{code:"kn",label:"Kannada",flag:"🇮🇳"},{code:"kn-IN",label:"Kannada (India)",flag:"🇮🇳"},{code:"mr",label:"Marathi",flag:"🇮🇳"},{code:"mr-IN",label:"Marathi (India)",flag:"🇮🇳"},{code:"pa",label:"Punjabi",flag:"🇮🇳"},{code:"pa-IN",label:"Punjabi (India)",flag:"🇮🇳"},{code:"ur",label:"Urdu",flag:"🇮🇳"},{code:"ur-IN",label:"Urdu (India)",flag:"🇮🇳"},{code:"or",label:"Odia",flag:"🇮🇳"},{code:"or-IN",label:"Odia (India)",flag:"🇮🇳"},{code:"as",label:"Assamese",flag:"🇮🇳"},{code:"as-IN",label:"Assamese (India)",flag:"🇮🇳"},{code:"zh-HK",label:"Chinese (Hong Kong)",flag:"🇭🇰"},{code:"nl",label:"Dutch",flag:"🇳🇱"},{code:"nl-NL",label:"Dutch (Netherlands)",flag:"🇳🇱"},{code:"pl",label:"Polish",flag:"🇵🇱"},{code:"pl-PL",label:"Polish (Poland)",flag:"🇵🇱"},{code:"sv",label:"Swedish",flag:"🇸🇪"},{code:"sv-SE",label:"Swedish (Sweden)",flag:"🇸🇪"},{code:"da",label:"Danish",flag:"🇩🇰"},{code:"da-DK",label:"Danish (Denmark)",flag:"🇩🇰"},{code:"no",label:"Norwegian",flag:"🇳🇴"},{code:"no-NO",label:"Norwegian (Norway)",flag:"🇳🇴"},{code:"fi",label:"Finnish",flag:"🇫🇮"},{code:"fi-FI",label:"Finnish (Finland)",flag:"🇫🇮"},{code:"tr",label:"Turkish",flag:"🇹🇷"},{code:"tr-TR",label:"Turkish (Turkey)",flag:"🇹🇷"},{code:"cs",label:"Czech",flag:"🇨🇿"},{code:"cs-CZ",label:"Czech (Czech Republic)",flag:"🇨🇿"},{code:"sk",label:"Slovak",flag:"🇸🇰"},{code:"sk-SK",label:"Slovak (Slovakia)",flag:"🇸🇰"},{code:"hu",label:"Hungarian",flag:"🇭🇺"},{code:"hu-HU",label:"Hungarian (Hungary)",flag:"🇭🇺"},{code:"ro",label:"Romanian",flag:"🇷🇴"},{code:"ro-RO",label:"Romanian (Romania)",flag:"🇷🇴"},{code:"el",label:"Greek",flag:"🇬🇷"},{code:"el-GR",label:"Greek (Greece)",flag:"🇬🇷"},{code:"th",label:"Thai",flag:"🇹🇭"},{code:"th-TH",label:"Thai (Thailand)",flag:"🇹🇭"},{code:"id",label:"Indonesian",flag:"🇮🇩"},{code:"id-ID",label:"Indonesian (Indonesia)",flag:"🇮🇩"},{code:"ms",label:"Malay",flag:"🇲🇾"},{code:"ms-MY",label:"Malay (Malaysia)",flag:"🇲🇾"},{code:"vi",label:"Vietnamese",flag:"🇻🇳"},{code:"vi-VN",label:"Vietnamese (Vietnam)",flag:"🇻🇳"},{code:"he",label:"Hebrew",flag:"🇮🇱"},{code:"he-IL",label:"Hebrew (Israel)",flag:"🇮🇱"}];cw=cw.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),cw.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const lw=cw.filter(e=>function(e){try{const t=new Intl.DateTimeFormat(e);return t.resolvedOptions().locale===e||t.resolvedOptions().locale.startsWith(e)}catch{return!1}}(e.code)).filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)).map(e=>({value:e.code,label:e.label,flag:e.flag}));function uw({value:t,onChange:r}){const{t:n}=an(),a=lw.map(e=>({value:e.value,label:e.label,icon:e.flag}));return e.jsx(ew,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchLanguage"),emptyLabel:n("dropdowns.chooseLanguage")})}const dw=[{value:"Dateline Standard Time",abbr:"DST",offset:-12,isdst:!1,text:"(UTC-12:00) International Date Line West",utc:["Etc/GMT+12"]},{value:"UTC-11",abbr:"U",offset:-11,isdst:!1,text:"(UTC-11:00) Coordinated Universal Time-11",utc:["Etc/GMT+11","Pacific/Midway","Pacific/Niue","Pacific/Pago_Pago"]},{value:"Hawaiian Standard Time",abbr:"HST",offset:-10,isdst:!1,text:"(UTC-10:00) Hawaii",utc:["Etc/GMT+10","Pacific/Honolulu","Pacific/Johnston","Pacific/Rarotonga","Pacific/Tahiti"]},{value:"Alaskan Standard Time",abbr:"AKDT",offset:-8,isdst:!0,text:"(UTC-09:00) Alaska",utc:["America/Anchorage","America/Juneau","America/Nome","America/Sitka","America/Yakutat"]},{value:"Pacific Standard Time (Mexico)",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-08:00) Baja California",utc:["America/Santa_Isabel"]},{value:"Pacific Daylight Time",abbr:"PDT",offset:-7,isdst:!0,text:"(UTC-07:00) Pacific Daylight Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver"]},{value:"Pacific Standard Time",abbr:"PST",offset:-8,isdst:!1,text:"(UTC-08:00) Pacific Standard Time (US & Canada)",utc:["America/Los_Angeles","America/Tijuana","America/Vancouver","PST8PDT"]},{value:"US Mountain Standard Time",abbr:"UMST",offset:-7,isdst:!1,text:"(UTC-07:00) Arizona",utc:["America/Creston","America/Dawson","America/Dawson_Creek","America/Hermosillo","America/Phoenix","America/Whitehorse","Etc/GMT+7"]},{value:"Mountain Standard Time (Mexico)",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",utc:["America/Chihuahua","America/Mazatlan"]},{value:"Mountain Standard Time",abbr:"MDT",offset:-6,isdst:!0,text:"(UTC-07:00) Mountain Time (US & Canada)",utc:["America/Boise","America/Cambridge_Bay","America/Denver","America/Edmonton","America/Inuvik","America/Ojinaga","America/Yellowknife","MST7MDT"]},{value:"Central America Standard Time",abbr:"CAST",offset:-6,isdst:!1,text:"(UTC-06:00) Central America",utc:["America/Belize","America/Costa_Rica","America/El_Salvador","America/Guatemala","America/Managua","America/Tegucigalpa","Etc/GMT+6","Pacific/Galapagos"]},{value:"Central Standard Time",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Central Time (US & Canada)",utc:["America/Chicago","America/Indiana/Knox","America/Indiana/Tell_City","America/Matamoros","America/Menominee","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Rainy_River","America/Rankin_Inlet","America/Resolute","America/Winnipeg","CST6CDT"]},{value:"Central Standard Time (Mexico)",abbr:"CDT",offset:-5,isdst:!0,text:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",utc:["America/Bahia_Banderas","America/Cancun","America/Merida","America/Mexico_City","America/Monterrey"]},{value:"Canada Central Standard Time",abbr:"CCST",offset:-6,isdst:!1,text:"(UTC-06:00) Saskatchewan",utc:["America/Regina","America/Swift_Current"]},{value:"SA Pacific Standard Time",abbr:"SPST",offset:-5,isdst:!1,text:"(UTC-05:00) Bogota, Lima, Quito",utc:["America/Bogota","America/Cayman","America/Coral_Harbour","America/Eirunepe","America/Guayaquil","America/Jamaica","America/Lima","America/Panama","America/Rio_Branco","Etc/GMT+5"]},{value:"Eastern Standard Time",abbr:"EST",offset:-5,isdst:!1,text:"(UTC-05:00) Eastern Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"Eastern Daylight Time",abbr:"EDT",offset:-4,isdst:!0,text:"(UTC-04:00) Eastern Daylight Time (US & Canada)",utc:["America/Detroit","America/Havana","America/Indiana/Petersburg","America/Indiana/Vincennes","America/Indiana/Winamac","America/Iqaluit","America/Kentucky/Monticello","America/Louisville","America/Montreal","America/Nassau","America/New_York","America/Nipigon","America/Pangnirtung","America/Port-au-Prince","America/Thunder_Bay","America/Toronto"]},{value:"US Eastern Standard Time",abbr:"UEDT",offset:-5,isdst:!1,text:"(UTC-05:00) Indiana (East)",utc:["America/Indiana/Marengo","America/Indiana/Vevay","America/Indianapolis"]},{value:"Venezuela Standard Time",abbr:"VST",offset:-4.5,isdst:!1,text:"(UTC-04:30) Caracas",utc:["America/Caracas"]},{value:"Paraguay Standard Time",abbr:"PYT",offset:-4,isdst:!1,text:"(UTC-04:00) Asuncion",utc:["America/Asuncion"]},{value:"Atlantic Standard Time",abbr:"ADT",offset:-3,isdst:!0,text:"(UTC-04:00) Atlantic Time (Canada)",utc:["America/Glace_Bay","America/Goose_Bay","America/Halifax","America/Moncton","America/Thule","Atlantic/Bermuda"]},{value:"Central Brazilian Standard Time",abbr:"CBST",offset:-4,isdst:!1,text:"(UTC-04:00) Cuiaba",utc:["America/Campo_Grande","America/Cuiaba"]},{value:"SA Western Standard Time",abbr:"SWST",offset:-4,isdst:!1,text:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",utc:["America/Anguilla","America/Antigua","America/Aruba","America/Barbados","America/Blanc-Sablon","America/Boa_Vista","America/Curacao","America/Dominica","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guyana","America/Kralendijk","America/La_Paz","America/Lower_Princes","America/Manaus","America/Marigot","America/Martinique","America/Montserrat","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Santo_Domingo","America/St_Barthelemy","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Tortola","Etc/GMT+4"]},{value:"Pacific SA Standard Time",abbr:"PSST",offset:-4,isdst:!1,text:"(UTC-04:00) Santiago",utc:["America/Santiago","Antarctica/Palmer"]},{value:"Newfoundland Standard Time",abbr:"NDT",offset:-2.5,isdst:!0,text:"(UTC-03:30) Newfoundland",utc:["America/St_Johns"]},{value:"E. South America Standard Time",abbr:"ESAST",offset:-3,isdst:!1,text:"(UTC-03:00) Brasilia",utc:["America/Sao_Paulo"]},{value:"Argentina Standard Time",abbr:"AST",offset:-3,isdst:!1,text:"(UTC-03:00) Buenos Aires",utc:["America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Buenos_Aires","America/Catamarca","America/Cordoba","America/Jujuy","America/Mendoza"]},{value:"SA Eastern Standard Time",abbr:"SEST",offset:-3,isdst:!1,text:"(UTC-03:00) Cayenne, Fortaleza",utc:["America/Araguaina","America/Belem","America/Cayenne","America/Fortaleza","America/Maceio","America/Paramaribo","America/Recife","America/Santarem","Antarctica/Rothera","Atlantic/Stanley","Etc/GMT+3"]},{value:"Greenland Standard Time",abbr:"GDT",offset:-3,isdst:!0,text:"(UTC-03:00) Greenland",utc:["America/Godthab"]},{value:"Montevideo Standard Time",abbr:"MST",offset:-3,isdst:!1,text:"(UTC-03:00) Montevideo",utc:["America/Montevideo"]},{value:"Bahia Standard Time",abbr:"BST",offset:-3,isdst:!1,text:"(UTC-03:00) Salvador",utc:["America/Bahia"]},{value:"UTC-02",abbr:"U",offset:-2,isdst:!1,text:"(UTC-02:00) Coordinated Universal Time-02",utc:["America/Noronha","Atlantic/South_Georgia","Etc/GMT+2"]},{value:"Mid-Atlantic Standard Time",abbr:"MDT",offset:-1,isdst:!0,text:"(UTC-02:00) Mid-Atlantic - Old",utc:[]},{value:"Azores Standard Time",abbr:"ADT",offset:0,isdst:!0,text:"(UTC-01:00) Azores",utc:["America/Scoresbysund","Atlantic/Azores"]},{value:"Cape Verde Standard Time",abbr:"CVST",offset:-1,isdst:!1,text:"(UTC-01:00) Cape Verde Is.",utc:["Atlantic/Cape_Verde","Etc/GMT+1"]},{value:"Morocco Standard Time",abbr:"MDT",offset:1,isdst:!0,text:"(UTC) Casablanca",utc:["Africa/Casablanca","Africa/El_Aaiun"]},{value:"UTC",abbr:"UTC",offset:0,isdst:!1,text:"(UTC) Coordinated Universal Time",utc:["America/Danmarkshavn","Etc/GMT"]},{value:"GMT Standard Time",abbr:"GMT",offset:0,isdst:!1,text:"(UTC) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"British Summer Time",abbr:"BST",offset:1,isdst:!0,text:"(UTC+01:00) Edinburgh, London",utc:["Europe/Isle_of_Man","Europe/Guernsey","Europe/Jersey","Europe/London"]},{value:"GMT Standard Time",abbr:"GDT",offset:1,isdst:!0,text:"(UTC) Dublin, Lisbon",utc:["Atlantic/Canary","Atlantic/Faeroe","Atlantic/Madeira","Europe/Dublin","Europe/Lisbon"]},{value:"Greenwich Standard Time",abbr:"GST",offset:0,isdst:!1,text:"(UTC) Monrovia, Reykjavik",utc:["Africa/Abidjan","Africa/Accra","Africa/Bamako","Africa/Banjul","Africa/Bissau","Africa/Conakry","Africa/Dakar","Africa/Freetown","Africa/Lome","Africa/Monrovia","Africa/Nouakchott","Africa/Ouagadougou","Africa/Sao_Tome","Atlantic/Reykjavik","Atlantic/St_Helena"]},{value:"W. Europe Standard Time",abbr:"WEDT",offset:2,isdst:!0,text:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",utc:["Arctic/Longyearbyen","Europe/Amsterdam","Europe/Andorra","Europe/Berlin","Europe/Busingen","Europe/Gibraltar","Europe/Luxembourg","Europe/Malta","Europe/Monaco","Europe/Oslo","Europe/Rome","Europe/San_Marino","Europe/Stockholm","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Zurich"]},{value:"Central Europe Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",utc:["Europe/Belgrade","Europe/Bratislava","Europe/Budapest","Europe/Ljubljana","Europe/Podgorica","Europe/Prague","Europe/Tirane"]},{value:"Romance Standard Time",abbr:"RDT",offset:2,isdst:!0,text:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",utc:["Africa/Ceuta","Europe/Brussels","Europe/Copenhagen","Europe/Madrid","Europe/Paris"]},{value:"Central European Standard Time",abbr:"CEDT",offset:2,isdst:!0,text:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",utc:["Europe/Sarajevo","Europe/Skopje","Europe/Warsaw","Europe/Zagreb"]},{value:"W. Central Africa Standard Time",abbr:"WCAST",offset:1,isdst:!1,text:"(UTC+01:00) West Central Africa",utc:["Africa/Algiers","Africa/Bangui","Africa/Brazzaville","Africa/Douala","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Luanda","Africa/Malabo","Africa/Ndjamena","Africa/Niamey","Africa/Porto-Novo","Africa/Tunis","Etc/GMT-1"]},{value:"Namibia Standard Time",abbr:"NST",offset:1,isdst:!1,text:"(UTC+01:00) Windhoek",utc:["Africa/Windhoek"]},{value:"GTB Standard Time",abbr:"GDT",offset:3,isdst:!0,text:"(UTC+02:00) Athens, Bucharest",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau"]},{value:"Middle East Standard Time",abbr:"MEDT",offset:3,isdst:!0,text:"(UTC+02:00) Beirut",utc:["Asia/Beirut"]},{value:"Egypt Standard Time",abbr:"EST",offset:2,isdst:!1,text:"(UTC+02:00) Cairo",utc:["Africa/Cairo"]},{value:"Syria Standard Time",abbr:"SDT",offset:3,isdst:!0,text:"(UTC+02:00) Damascus",utc:["Asia/Damascus"]},{value:"E. Europe Standard Time",abbr:"EEDT",offset:3,isdst:!0,text:"(UTC+02:00) E. Europe",utc:["Asia/Nicosia","Europe/Athens","Europe/Bucharest","Europe/Chisinau","Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Nicosia","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"South Africa Standard Time",abbr:"SAST",offset:2,isdst:!1,text:"(UTC+02:00) Harare, Pretoria",utc:["Africa/Blantyre","Africa/Bujumbura","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Kigali","Africa/Lubumbashi","Africa/Lusaka","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Etc/GMT-2"]},{value:"FLE Standard Time",abbr:"FDT",offset:3,isdst:!0,text:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",utc:["Europe/Helsinki","Europe/Kyiv","Europe/Mariehamn","Europe/Riga","Europe/Sofia","Europe/Tallinn","Europe/Uzhhorod","Europe/Vilnius","Europe/Zaporizhzhia"]},{value:"Turkey Standard Time",abbr:"TDT",offset:3,isdst:!1,text:"(UTC+03:00) Istanbul",utc:["Europe/Istanbul"]},{value:"Israel Standard Time",abbr:"JDT",offset:3,isdst:!0,text:"(UTC+02:00) Jerusalem",utc:["Asia/Jerusalem"]},{value:"Libya Standard Time",abbr:"LST",offset:2,isdst:!1,text:"(UTC+02:00) Tripoli",utc:["Africa/Tripoli"]},{value:"Jordan Standard Time",abbr:"JST",offset:3,isdst:!1,text:"(UTC+03:00) Amman",utc:["Asia/Amman"]},{value:"Arabic Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Baghdad",utc:["Asia/Baghdad"]},{value:"Kaliningrad Standard Time",abbr:"KST",offset:3,isdst:!1,text:"(UTC+02:00) Kaliningrad",utc:["Europe/Kaliningrad"]},{value:"Arab Standard Time",abbr:"AST",offset:3,isdst:!1,text:"(UTC+03:00) Kuwait, Riyadh",utc:["Asia/Aden","Asia/Bahrain","Asia/Kuwait","Asia/Qatar","Asia/Riyadh"]},{value:"E. Africa Standard Time",abbr:"EAST",offset:3,isdst:!1,text:"(UTC+03:00) Nairobi",utc:["Africa/Addis_Ababa","Africa/Asmera","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Mogadishu","Africa/Nairobi","Antarctica/Syowa","Etc/GMT-3","Indian/Antananarivo","Indian/Comoro","Indian/Mayotte"]},{value:"Moscow Standard Time",abbr:"MSK",offset:3,isdst:!1,text:"(UTC+03:00) Moscow, St. Petersburg, Volgograd, Minsk",utc:["Europe/Kirov","Europe/Moscow","Europe/Simferopol","Europe/Volgograd","Europe/Minsk"]},{value:"Samara Time",abbr:"SAMT",offset:4,isdst:!1,text:"(UTC+04:00) Samara, Ulyanovsk, Saratov",utc:["Europe/Astrakhan","Europe/Samara","Europe/Ulyanovsk"]},{value:"Iran Standard Time",abbr:"IDT",offset:4.5,isdst:!0,text:"(UTC+03:30) Tehran",utc:["Asia/Tehran"]},{value:"Arabian Standard Time",abbr:"AST",offset:4,isdst:!1,text:"(UTC+04:00) Abu Dhabi, Muscat",utc:["Asia/Dubai","Asia/Muscat","Etc/GMT-4"]},{value:"Azerbaijan Standard Time",abbr:"ADT",offset:5,isdst:!0,text:"(UTC+04:00) Baku",utc:["Asia/Baku"]},{value:"Mauritius Standard Time",abbr:"MST",offset:4,isdst:!1,text:"(UTC+04:00) Port Louis",utc:["Indian/Mahe","Indian/Mauritius","Indian/Reunion"]},{value:"Georgian Standard Time",abbr:"GET",offset:4,isdst:!1,text:"(UTC+04:00) Tbilisi",utc:["Asia/Tbilisi"]},{value:"Caucasus Standard Time",abbr:"CST",offset:4,isdst:!1,text:"(UTC+04:00) Yerevan",utc:["Asia/Yerevan"]},{value:"Afghanistan Standard Time",abbr:"AST",offset:4.5,isdst:!1,text:"(UTC+04:30) Kabul",utc:["Asia/Kabul"]},{value:"West Asia Standard Time",abbr:"WAST",offset:5,isdst:!1,text:"(UTC+05:00) Ashgabat, Tashkent",utc:["Antarctica/Mawson","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Dushanbe","Asia/Oral","Asia/Samarkand","Asia/Tashkent","Etc/GMT-5","Indian/Kerguelen","Indian/Maldives"]},{value:"Yekaterinburg Time",abbr:"YEKT",offset:5,isdst:!1,text:"(UTC+05:00) Yekaterinburg",utc:["Asia/Yekaterinburg"]},{value:"Pakistan Standard Time",abbr:"PKT",offset:5,isdst:!1,text:"(UTC+05:00) Islamabad, Karachi",utc:["Asia/Karachi"]},{value:"India Standard Time",abbr:"IST",offset:5.5,isdst:!1,text:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",utc:["Asia/Kolkata","Asia/Calcutta"]},{value:"Sri Lanka Standard Time",abbr:"SLST",offset:5.5,isdst:!1,text:"(UTC+05:30) Sri Jayawardenepura",utc:["Asia/Colombo"]},{value:"Nepal Standard Time",abbr:"NST",offset:5.75,isdst:!1,text:"(UTC+05:45) Kathmandu",utc:["Asia/Kathmandu"]},{value:"Central Asia Standard Time",abbr:"CAST",offset:6,isdst:!1,text:"(UTC+06:00) Nur-Sultan (Astana)",utc:["Antarctica/Vostok","Asia/Almaty","Asia/Bishkek","Asia/Qyzylorda","Asia/Urumqi","Etc/GMT-6","Indian/Chagos"]},{value:"Bangladesh Standard Time",abbr:"BST",offset:6,isdst:!1,text:"(UTC+06:00) Dhaka",utc:["Asia/Dhaka","Asia/Thimphu"]},{value:"Myanmar Standard Time",abbr:"MST",offset:6.5,isdst:!1,text:"(UTC+06:30) Yangon (Rangoon)",utc:["Asia/Rangoon","Indian/Cocos"]},{value:"SE Asia Standard Time",abbr:"SAST",offset:7,isdst:!1,text:"(UTC+07:00) Bangkok, Hanoi, Jakarta",utc:["Antarctica/Davis","Asia/Bangkok","Asia/Hovd","Asia/Jakarta","Asia/Phnom_Penh","Asia/Pontianak","Asia/Saigon","Asia/Vientiane","Etc/GMT-7","Indian/Christmas"]},{value:"N. Central Asia Standard Time",abbr:"NCAST",offset:7,isdst:!1,text:"(UTC+07:00) Novosibirsk",utc:["Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk"]},{value:"China Standard Time",abbr:"CST",offset:8,isdst:!1,text:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",utc:["Asia/Hong_Kong","Asia/Macau","Asia/Shanghai"]},{value:"North Asia Standard Time",abbr:"NAST",offset:8,isdst:!1,text:"(UTC+08:00) Krasnoyarsk",utc:["Asia/Krasnoyarsk"]},{value:"Singapore Standard Time",abbr:"MPST",offset:8,isdst:!1,text:"(UTC+08:00) Kuala Lumpur, Singapore",utc:["Asia/Brunei","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Makassar","Asia/Manila","Asia/Singapore","Etc/GMT-8"]},{value:"W. Australia Standard Time",abbr:"WAST",offset:8,isdst:!1,text:"(UTC+08:00) Perth",utc:["Antarctica/Casey","Australia/Perth"]},{value:"Taipei Standard Time",abbr:"TST",offset:8,isdst:!1,text:"(UTC+08:00) Taipei",utc:["Asia/Taipei"]},{value:"Ulaanbaatar Standard Time",abbr:"UST",offset:8,isdst:!1,text:"(UTC+08:00) Ulaanbaatar",utc:["Asia/Choibalsan","Asia/Ulaanbaatar"]},{value:"North Asia East Standard Time",abbr:"NAEST",offset:8,isdst:!1,text:"(UTC+08:00) Irkutsk",utc:["Asia/Irkutsk"]},{value:"Japan Standard Time",abbr:"JST",offset:9,isdst:!1,text:"(UTC+09:00) Osaka, Sapporo, Tokyo",utc:["Asia/Dili","Asia/Jayapura","Asia/Tokyo","Etc/GMT-9","Pacific/Palau"]},{value:"Korea Standard Time",abbr:"KST",offset:9,isdst:!1,text:"(UTC+09:00) Seoul",utc:["Asia/Pyongyang","Asia/Seoul"]},{value:"Cen. Australia Standard Time",abbr:"CAST",offset:9.5,isdst:!1,text:"(UTC+09:30) Adelaide",utc:["Australia/Adelaide","Australia/Broken_Hill"]},{value:"AUS Central Standard Time",abbr:"ACST",offset:9.5,isdst:!1,text:"(UTC+09:30) Darwin",utc:["Australia/Darwin"]},{value:"E. Australia Standard Time",abbr:"EAST",offset:10,isdst:!1,text:"(UTC+10:00) Brisbane",utc:["Australia/Brisbane","Australia/Lindeman"]},{value:"AUS Eastern Standard Time",abbr:"AEST",offset:10,isdst:!1,text:"(UTC+10:00) Canberra, Melbourne, Sydney",utc:["Australia/Melbourne","Australia/Sydney"]},{value:"West Pacific Standard Time",abbr:"WPST",offset:10,isdst:!1,text:"(UTC+10:00) Guam, Port Moresby",utc:["Antarctica/DumontDUrville","Etc/GMT-10","Pacific/Guam","Pacific/Port_Moresby","Pacific/Saipan","Pacific/Truk"]},{value:"Tasmania Standard Time",abbr:"TST",offset:10,isdst:!1,text:"(UTC+10:00) Hobart",utc:["Australia/Currie","Australia/Hobart"]},{value:"Yakutsk Standard Time",abbr:"YST",offset:9,isdst:!1,text:"(UTC+09:00) Yakutsk",utc:["Asia/Chita","Asia/Khandyga","Asia/Yakutsk"]},{value:"Central Pacific Standard Time",abbr:"CPST",offset:11,isdst:!1,text:"(UTC+11:00) Solomon Is., New Caledonia",utc:["Antarctica/Macquarie","Etc/GMT-11","Pacific/Efate","Pacific/Guadalcanal","Pacific/Kosrae","Pacific/Noumea","Pacific/Ponape"]},{value:"Vladivostok Standard Time",abbr:"VST",offset:11,isdst:!1,text:"(UTC+11:00) Vladivostok",utc:["Asia/Sakhalin","Asia/Ust-Nera","Asia/Vladivostok"]},{value:"New Zealand Standard Time",abbr:"NZST",offset:12,isdst:!1,text:"(UTC+12:00) Auckland, Wellington",utc:["Antarctica/McMurdo","Pacific/Auckland"]},{value:"UTC+12",abbr:"U",offset:12,isdst:!1,text:"(UTC+12:00) Coordinated Universal Time+12",utc:["Etc/GMT-12","Pacific/Funafuti","Pacific/Kwajalein","Pacific/Majuro","Pacific/Nauru","Pacific/Tarawa","Pacific/Wake","Pacific/Wallis"]},{value:"Fiji Standard Time",abbr:"FST",offset:12,isdst:!1,text:"(UTC+12:00) Fiji",utc:["Pacific/Fiji"]},{value:"Magadan Standard Time",abbr:"MST",offset:12,isdst:!1,text:"(UTC+12:00) Magadan",utc:["Asia/Anadyr","Asia/Kamchatka","Asia/Magadan","Asia/Srednekolymsk"]},{value:"Kamchatka Standard Time",abbr:"KDT",offset:13,isdst:!0,text:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",utc:["Asia/Kamchatka"]},{value:"Tonga Standard Time",abbr:"TST",offset:13,isdst:!1,text:"(UTC+13:00) Nuku'alofa",utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]},{value:"Samoa Standard Time",abbr:"SST",offset:13,isdst:!1,text:"(UTC+13:00) Samoa",utc:["Pacific/Apia"]}].filter(e=>e.utc.length).reduce((e,t)=>{let r=t.utc;for(let n=0;n<r.length;n++){const a=r[n],s=t.text;let i=s.substring(s.indexOf("(")+1,s.indexOf(")"));-1!==i.indexOf("UTC")&&e.push({value:a,abbr:t.abbr,offset:t.offset,isdst:t.isdst,text:`(${i}) ${a}`,utc:["Etc/GMT-13","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Tongatapu"]})}return e},[]).filter((e,t,r)=>t===r.findIndex(t=>t.value===e.value));function pw({value:t,onChange:r}){const{t:n}=an(),a=dw.map(e=>({value:e.value,label:e.text}));return e.jsx(ew,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchTimezone"),emptyLabel:n("dropdowns.chooseTimezone")})}const mw=({workspace:r})=>{const{t:n}=an(),{updateUserProfile:a,getProfile:s}=Pa(),[i,o]=t.useState(!1),[c,l]=t.useState(),[u,d]=t.useState(0),[p,m]=t.useState(null),h=t.useRef(null);t.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);const f=Gu({resolver:Qm(Yh({name:Eh().min(2,{message:n("profile.nameMinLength")}),country:Eh().optional(),timezone:Eh().optional(),language:Eh().optional(),currency:Eh().optional()})),defaultValues:{name:c?.name||"",country:c?.country||"",timezone:c?.timezone||"",language:c?.language||"",currency:c?.currency||""}});return t.useEffect(()=>{s().then(e=>{l(e),f.setValue("name",e.name),f.setValue("country",e.country),f.setValue("timezone",e.timezone),f.setValue("language",e.language),f.setValue("currency",e.currency)})},[u]),c?e.jsxs("div",{children:[p&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded mb-4",children:[e.jsx("p",{className:"font-medium",children:n("settings.common.success")}),e.jsx("p",{className:"text-sm",children:p})]}),e.jsx("div",{className:"space-y-4",children:e.jsx(Cf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){o(!0),m(null);try{await a({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),m(n("profile.success")),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{m(null)},5e3)}catch(e){Re(e,{component:"WorkspaceSettingsProfile",action:"updateUserProfile",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:n("profile.email")}),e.jsx(Uf,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:c?.email})]}),e.jsx(Af,{disabled:i,control:f.control,name:"name",render:({field:t})=>e.jsxs(Tf,{children:[e.jsx(_f,{children:n("profile.name")}),e.jsx(Rf,{children:e.jsx(Uf,{...t})}),e.jsx(If,{})]})}),e.jsxs("div",{className:"flex gap-y-2 my-4 flex-col",children:[e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.language")}),e.jsx(uw,{value:f.watch("language"),onChange:e=>{f.setValue("language",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.country")}),e.jsx(aw,{value:f.watch("country"),onChange:e=>{f.setValue("country",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.currency")}),e.jsx(ow,{value:f.watch("currency"),onChange:e=>{f.setValue("currency",e)}})]}),e.jsxs("div",{className:"flex flex-col gap-0.5",children:[e.jsx("div",{className:"text-sm font-medium",children:n("profile.timezone")}),e.jsx(pw,{value:f.watch("timezone"),onChange:e=>{f.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(Ps,{type:"submit",progress:i,disabled:i,children:n("profile.save")}),e.jsx(Ps,{type:"button",variant:"outline",onClick:()=>{d(e=>e+1)},disabled:i,children:n("profile.reset")})]})]})})}),c?.image&&e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:n("profile.profileImage")}),e.jsx("div",{className:"w-16 h-16 rounded-full overflow-hidden",children:e.jsx("img",{src:c.image,alt:c.name,className:"w-full h-full object-cover"})})]})]}):e.jsx(nl,{})},hw="bb";function fw(e,t){let r;try{const e=t||("undefined"!=typeof window?window.location.href:"https://localhost");r=new URL(e),r.search=""}catch{r=new URL("https://localhost")}return r.searchParams.set(hw,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),r.toString()}function gw(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(hw);if(!e)return null;const t=function(e){const t={};if(!e)return t;const r=e.split(",");for(const e of r){const r=e.indexOf(":");if(-1===r)continue;const n=decodeURIComponent(e.slice(0,r)),a=decodeURIComponent(e.slice(r+1));n&&(t[n]=a)}return t}(e);return Object.keys(t).length>0?t:null}catch{return null}}function bw(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(hw)&&(e.searchParams.delete(hw),window.history.replaceState({},"",e.toString()))}catch{}}function vw(e,t){if(null==e)return null;const r=e[t??"monthly"];return r?{included:r.included,...void 0!==r.overage&&{overage:r.overage},...void 0!==r.unitSize&&{unitSize:r.unitSize}}:null}function yw(e,t,r={}){if(null==e)return null;const{overageInCents:n=!0,currency:a,locale:s="en"}=r,{included:i,overage:o}=e;if(null==o)return{included:i,hasOverage:!1,price:"",unit:""};const c=n?o/100:o,l=(a??"").trim().toUpperCase();let u;if(l&&"number"==typeof c&&Number.isFinite(c))try{u=new Intl.NumberFormat(s,{style:"currency",currency:l,minimumFractionDigits:2}).format(c)}catch{u=`${r.currencySymbol??yf(a??"")}${c.toFixed(2)}`}else{u=`${r.currencySymbol??yf(a??"")}${"number"==typeof c?c.toFixed(2):String(o)}`}return{included:i,hasOverage:!0,price:u,unit:t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?`${e.unitSize.toLocaleString(s)} ${t}`:t||""}}const xw="personal",ww=(e,t,r="en-US")=>{const n=(t??"").trim();return n?new Intl.NumberFormat(r,{style:"currency",currency:n.toUpperCase(),minimumFractionDigits:2}).format(e/100):(e/100).toFixed(2)},Sw=(e,t="en-US")=>e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):"",kw=e=>{switch(e){case qn:return"bg-green-100 text-green-800";case Kn:return"bg-yellow-100 text-yellow-800";case $n:return"bg-gray-100 text-gray-800";case Zn:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},Ew=({workspaceId:t,hasActiveSubscription:r=!1,onViewPricingPlans:n,limit:a=20})=>{const{t:s,formattingLocale:i}=an(),{invoices:o,loading:c,error:l,refetch:u}=Rn(t,a),d=o.length>0;return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold",children:s("invoices.title")}),e.jsx("p",{className:"text-sm text-gray-600",children:s("invoices.description")})]}),e.jsx(Ps,{variant:"ghost",size:"sm",progress:c,onClick:u,disabled:c,children:s("settings.common.refreshAction",{loading:String(c)})})]}),l&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s("invoices.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:l})]}),e.jsx(Ps,{variant:"outline",size:"sm",onClick:u,disabled:c,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.retryAction",{loading:String(c)})})]}),c&&!d?e.jsx("div",{className:"border rounded-lg p-6",children:e.jsx(nl,{})}):d?e.jsx("div",{className:"space-y-2",children:o.map(t=>{const r=(e=>{switch(e.status){case $n:case Kn:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case qn:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case Zn:case Jn:return{textKey:"invoices.viewDetails",color:"bg-gray-600 hover:bg-gray-700"};default:return{textKey:"invoices.view",color:"bg-gray-600 hover:bg-gray-700"}}})(t);return e.jsxs("div",{className:"border rounded-lg bg-white hover:shadow-sm transition-shadow p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-gray-900 truncate min-w-0",children:t.description||t.number||t.id.slice(-8)}),e.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0 ${kw(t.status)}`,children:s(`invoices.status.${t.status}`)})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-0.5 text-sm text-gray-600 mb-2.5",children:[e.jsx("span",{className:"font-medium text-gray-900",children:ww(t.amount_due,t.currency,i)}),t.created&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-300 hidden sm:inline",children:"·"}),e.jsx("span",{children:Sw(t.created,i)})]}),t.amount_paid>0&&t.amount_due>0&&e.jsx("span",{className:"text-xs text-gray-500",children:s("invoices.paidAmount",{amount:ww(t.amount_paid,t.currency,i)})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Ps,{size:"sm",disabled:!t.hosted_invoice_url,onClick:()=>t.hosted_invoice_url&&window.open(t.hosted_invoice_url,"_blank","noopener,noreferrer"),className:r.color,children:[s(r.textKey),e.jsx(Ya,{className:"h-3 w-3 ms-1.5"})]}),t.invoice_pdf&&e.jsxs(Ps,{size:"sm",variant:"outline",onClick:()=>window.open(t.invoice_pdf,"_blank","noopener,noreferrer"),children:[e.jsx(Ja,{className:"h-3 w-3 me-1.5"}),s("invoices.download")]})]})]},t.id)})}):e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsx(Xa,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-sm text-gray-500",children:s(r?"invoices.noInvoicesWithSub":"invoices.noInvoices")}),!r&&n&&e.jsx(Ps,{size:"sm",className:"mt-4",onClick:n,children:s("subscription.viewPricingPlans")})]})]})},Cw=t.lazy(()=>Promise.resolve().then(function(){return ZE}).then(e=>({default:e.default}))),Nw=(e,t)=>{if(!t)return"";try{const r=new Date(t);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(e,{month:"long",day:"numeric",year:"numeric"}).format(r)}catch{return""}},Aw=({workspace:r})=>{const n=r._id?.toString(),{t:a,formattingLocale:s,fmtNum:i,fmtCents:o}=an(),{settings:c}=Sn(),l=c?.workspace?.mode===xw,{subscription:u,loading:d,error:p,updateSubscription:m,refetch:h}=_n(n),{createCheckoutSession:f}=Pn(n),{cancelSubscription:g,loading:b}=In(n),{resumeSubscription:v,loading:y}=Un(n),{openBillingPortal:x,loading:w}=Dn(n),{versions:S,loading:k,error:E,refetch:C}=jn(n),N=d||k,A=p||E,{currentVersion:j,latestVersion:P,isDeprecated:T,plansToShow:_}=t.useMemo(()=>{const e=S?.currentVersion,t=S?.availableVersions||[],r=null!=u?.subscription;let n=null;t.length>0?n=t.reduce((e,t)=>t.version>e.version?t:e):e&&(n=e);const a=!!(r&&n&&e)&&n.version>e.version;return{currentVersion:e,latestVersion:n,hasNewerVersion:a,isDeprecated:a&&r,plansToShow:n?.plans&&n.plans.length>0?n.plans:[]}},[S,u?.subscription]),[R,D]=t.useState(!1),[I,U]=t.useState(null),[M,L]=t.useState(null),O=t.useRef(null),[z,F]=t.useState(!1),[B,W]=t.useState(!1);t.useEffect(()=>()=>{O.current&&clearTimeout(O.current)},[]);const[V,H]=t.useState(!1),[G,$]=t.useState("subscription"),K=async()=>{await Promise.all([h(),C()])},q=t.useMemo(()=>oa(u?.subscription?.stripePriceId,_??[]),[u?.subscription?.stripePriceId,_]);if(N&&!u&&!S)return e.jsx(nl,{});const Z=u?.planVersion?._id||null;return n?e.jsxs("div",{className:"space-y-6",children:[A&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("subscription.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:A}),e.jsx("p",{className:"text-xs mt-2 text-red-600",children:a("subscription.errorLoadingDescription")})]}),e.jsx(Ps,{variant:"outline",size:"sm",onClick:K,disabled:N,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.retryAction",{loading:String(N)})})]}),I&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("subscription.updateFailed")}),e.jsx("p",{className:"text-sm mt-1",children:I})]}),e.jsx(Ps,{variant:"outline",size:"sm",onClick:()=>U(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.dismiss")})]}),M&&e.jsxs("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:a("settings.common.success")}),e.jsx("p",{className:"text-sm mt-1",children:M})]}),e.jsx(Ps,{variant:"outline",size:"sm",onClick:()=>L(null),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:a("settings.common.dismiss")})]}),e.jsx("div",{className:"border-b border-gray-200",children:e.jsxs("nav",{className:"-mb-px flex gap-6","aria-label":"Subscription tabs",children:[e.jsx("button",{type:"button",onClick:()=>$("subscription"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("subscription"===G?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:a("subscription.plan")}),e.jsx("button",{type:"button",onClick:()=>$("invoices"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("invoices"===G?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:a("subscription.invoicesTab")})]})}),"subscription"===G&&e.jsxs(e.Fragment,{children:[N&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(es,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),T&&u?.subscription&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg px-4 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ds,{className:"h-4 w-4 text-amber-600 shrink-0"}),e.jsxs("span",{className:"text-sm text-amber-800",children:[e.jsx("span",{className:"font-medium",children:a("subscription.planUpdateAvailable")}),e.jsxs("span",{className:"text-amber-600",children:[" ","— v",j?.version||"?"," → v",P?.version||"?"]})]})]}),e.jsx(Ps,{size:"sm",variant:"outline",className:"shrink-0 border-amber-300 text-amber-700 hover:bg-amber-100",onClick:()=>F(!0),children:a("subscription.viewPlans")})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("p",{className:"text-sm text-gray-600",children:a("subscription.managePlan")})}),e.jsxs("div",{className:"flex items-center gap-2",children:[(()=>{const t=u?.subscription?.subscriptionStatus===Vn,r=u?.subscription?.cancelAtPeriodEnd;return r||b?null:t&&_&&_.length>0?e.jsx(Ps,{size:"sm",onClick:()=>F(!0),children:a("subscription.viewPricingPlans")}):u?.subscription&&!t?e.jsx(Ps,{variant:"outline",size:"sm",onClick:()=>F(!0),children:a("subscription.changePlanButton")}):!u?.subscription&&_&&_.length>0?e.jsx(Ps,{size:"sm",onClick:()=>F(!0),children:a("subscription.viewPricingPlans")}):null})(),e.jsx(Ps,{variant:"ghost",size:"sm",progress:N,onClick:K,disabled:N||R,children:a("settings.common.refreshAction",{loading:String(N)})})]})]}),u?.subscription?(()=>{const t=oa(u.subscription.stripePriceId,_??[]),n=t?.interval??null,c=t?.currency??u.plan?.currency??r?.billingCurrency??"",d=n&&u.planVersion?aa(u.planVersion,c,n):null,p=c,m=u.planVersion?ca(u.planVersion,c):null,h=m&&n?la(u.planVersion,c,n):null,f=Array.isArray(r?.users)?r.users.length:1,g=m?.includedSeats??0,v=Math.max(0,f-g),S=null!=d?0===d?a("subscription.free"):o(d,p):null,k=n===Fn.Monthly?a("subscription.billingInterval.perMonth"):n===Fn.Quarterly?a("subscription.billingInterval.perQuarter"):n===Fn.Yearly?a("subscription.billingInterval.perYear"):"";return e.jsxs("div",{className:"border rounded-lg overflow-hidden "+(T?"border-amber-300":"border-gray-200"),children:[u.subscription.subscriptionStatus===Wn&&(()=>{const t=u.subscription.trialEnd||u.subscription.stripeCurrentPeriodEnd,r=t?new Date(t):null,n=r&&!isNaN(r.getTime())?r:null,s=n?Math.max(0,Math.ceil((n.getTime()-Date.now())/864e5)):null,i=null!==s&&s<=3;return e.jsxs("div",{className:"px-4 py-3 sm:px-5 text-sm flex flex-col sm:flex-row sm:items-center justify-between gap-2 "+(i?"bg-amber-50 text-amber-800 border-b border-amber-200":"bg-blue-50 text-blue-800 border-b border-blue-200"),children:[e.jsxs("span",{children:[null!==s&&s<=0?a("subscription.trialEnded"):null!==s?a("subscription.trialEndsIn",{days:s}):a("subscription.onTrial")," ",a("subscription.upgradeToKeepAccess")]}),e.jsx(Ps,{size:"sm",variant:i?"default":"outline",className:"shrink-0 "+(i?"":"border-blue-300 text-blue-700 hover:bg-blue-100"),onClick:()=>F(!0),children:a("subscription.upgradePlan")})]})})(),e.jsxs("div",{className:"p-4 sm:p-5 "+(T?"bg-amber-50/50":"bg-gray-50/50"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:u.plan?.name||a("subscription.noPlanAssigned")}),e.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium "+(u.subscription.subscriptionStatus===Bn?u.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":u.subscription.subscriptionStatus===Wn?"bg-blue-100 text-blue-800":u.subscription.subscriptionStatus===Vn?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[u.subscription.subscriptionStatus===Bn&&(u.subscription.cancelAtPeriodEnd?a("subscription.status.canceling"):a("subscription.status.active")),u.subscription.subscriptionStatus===Wn&&a("subscription.status.trial"),u.subscription.subscriptionStatus===Vn&&a("subscription.status.canceled"),u.subscription.subscriptionStatus===Hn&&a("subscription.status.pastDue")]}),u.subscription.subscriptionStatus===Wn&&Nw(s,u.subscription.trialEnd||u.subscription.stripeCurrentPeriodEnd)&&e.jsxs("span",{className:"text-xs text-gray-500",children:["(ends"," ",Nw(s,u.subscription.trialEnd||u.subscription.stripeCurrentPeriodEnd),")"]}),T&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-100 text-amber-800",children:[e.jsx(ds,{className:"h-3 w-3"}),a("subscription.status.deprecated")]})]}),u.plan?.description&&e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:u.plan.description}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-gray-900",children:S||a("invoices.na")}),S&&S!==a("subscription.free")&&k&&e.jsx("span",{className:"text-sm text-gray-500",children:k})]}),m&&h&&h>0&&!l&&e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:a("subscription.perSeatDisplay",{price:o(h,p),interval:k})}),!l&&m&&h&&h>0&&v>0&&S&&S!==a("subscription.free")&&null!=d&&e.jsx("div",{className:"text-xs text-gray-500 mt-1 pt-1 border-t border-gray-200",children:a("subscription.estTotalDisplay",{total:o(d+h*v,p),interval:k,count:v})})]}),(u.subscription.subscriptionStatus===Bn||u.subscription.subscriptionStatus===Wn)&&!u.subscription.cancelAtPeriodEnd&&Nw(s,u.subscription.stripeCurrentPeriodEnd)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(Ga,{className:"h-3.5 w-3.5 flex-shrink-0"}),e.jsx("span",{children:a("subscription.nextBillingDisplay",{date:Nw(s,u.subscription.stripeCurrentPeriodEnd)??""})})]})]}),T&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["Version ",j?.version||a("invoices.na")]}),(u.subscription.subscriptionStatus===Bn||u.subscription.subscriptionStatus===Wn||u.subscription.subscriptionStatus===Hn)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-4 pt-4 border-t border-gray-200",children:[u.subscription&&e.jsx(Ps,{variant:"outline",size:"sm",onClick:()=>x(),disabled:w,progress:w,children:a(w?"subscription.openingPortal":"subscription.managePayment")}),(u.subscription.subscriptionStatus===Bn||u.subscription.subscriptionStatus===Wn)&&e.jsx(e.Fragment,{children:u.subscription.subscriptionStatus===Bn&&u.subscription.cancelAtPeriodEnd?e.jsx(Ps,{variant:"outline",size:"sm",onClick:()=>H(!0),disabled:R||b||y,progress:y,children:a("subscription.resumeTitle")}):e.jsx(Ps,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",onClick:()=>W(!0),disabled:R||b||y,progress:b||R,children:b||R?a("subscription.canceling"):u.subscription.subscriptionStatus===Wn?a("subscription.cancelTrial"):a("subscription.cancelTitle")})})]})]}),u.subscription.subscriptionStatus===Hn&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ds,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:a("subscription.paymentPastDue")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:a("subscription.paymentPastDueDescription")}),e.jsx(Ps,{variant:"outline",size:"sm",className:"mt-2 border-red-200 text-red-700 hover:bg-red-100",onClick:()=>$("invoices"),children:a("subscription.viewInvoices")})]})]})}),u.subscription.subscriptionStatus===Hn&&u.subscription.dunningState&&u.subscription.dunningState!==ea&&e.jsx("div",{className:"px-5 py-3 bg-red-50 border-t border-red-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ds,{className:"h-5 w-5 text-red-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-800",children:u.subscription.dunningState===ta?a("subscription.dunningFinal"):u.subscription.dunningState===ra?a("subscription.dunningSuspended"):a("subscription.dunningRecovery")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:u.subscription.dunningState===ra?a("subscription.dunningSuspendedDescription"):a("subscription.dunningRecoveryDescription")})]})]})}),u.subscription.subscriptionStatus===Gn&&e.jsx("div",{className:"px-5 py-3 bg-blue-50 border-t border-blue-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ga,{className:"h-5 w-5 text-blue-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-blue-800",children:a("subscription.subscriptionPaused")}),e.jsx("p",{className:"text-sm text-blue-700 mt-0.5",children:a("subscription.subscriptionPausedDescription")})]})]})}),u.subscription.cancelAtPeriodEnd&&e.jsx("div",{className:"px-5 py-3 bg-amber-50 border-t border-amber-200",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(Ga,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-amber-800",children:a("subscription.scheduledCancellation")}),e.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:Nw(s,u.subscription.stripeCurrentPeriodEnd)?e.jsxs(e.Fragment,{children:[a("subscription.cancelEndDescription")," ",e.jsx("span",{className:"font-medium",children:Nw(s,u.subscription.stripeCurrentPeriodEnd)}),"."]}):a("subscription.cancelEndFallback")})]})]})}),u.planVersion&&(()=>{const t=((e,t,r=Fn.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],a=[],s=[];return e.subscriptionItems.forEach(i=>{const o=i.slug;if(i.type===Yn){const t=e.features?.[o]??!1;n.push({item:i,enabled:t})}else if(i.type===Xn){const t=e.limits?.[o]??0;a.push({item:i,value:t})}else if(i.type===Qn){const n=t&&e.pricingVariants?.length?ia(e,t,o,r):vw(e.quotas?.[o],r);null!=n&&s.push({item:i,value:n})}}),{features:n,limits:a,quotas:s}})(u.planVersion,c,n??"monthly");return t.features.length>0||t.limits.length>0||t.quotas.length>0?e.jsx("div",{className:"px-4 py-4 sm:px-5 sm:py-5 border-t border-gray-100",children:e.jsxs("div",{className:"space-y-5",children:[t.features.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.features")}),e.jsx("ul",{className:"space-y-1.5",children:t.features.sort(e=>e.enabled?-1:1).map(({item:t,enabled:r})=>e.jsxs("li",{className:"flex items-center gap-2 text-sm",children:[e.jsx("span",{className:"w-4 text-center shrink-0 "+(r?"text-green-500":"text-gray-300"),children:r?"✓":"✕"}),e.jsx("span",{className:r?"text-gray-700":"text-gray-400",children:t.name})]},t._id))})]}),t.limits.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.limits")}),e.jsx("ul",{className:"space-y-1.5",children:t.limits.map(({item:t,value:r})=>e.jsxs("li",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900",children:r})]},t._id))})]}),t.quotas.length>0&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.quotas")}),e.jsx("ul",{className:"space-y-1.5",children:t.quotas.map(({item:t,value:r})=>{const n=yw(r,t.name.toLowerCase(),{currency:c,locale:s}),i=n?n.hasOverage?a("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):a("quota.includedOnly",{count:n.included}):"—";return e.jsx("li",{className:"text-sm",children:e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-0.5",children:[e.jsx("span",{className:"text-gray-600",children:t.name}),e.jsx("span",{className:"font-medium text-gray-900 text-xs sm:text-sm",children:i})]})},t._id)})})]}),m&&!l&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.seats.title")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.members")}),e.jsx("span",{className:"font-semibold text-gray-900",children:i(f)})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.included")}),e.jsx("span",{className:"text-gray-900",children:i(g)})]}),v>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.billable")}),e.jsxs("span",{className:"font-medium text-amber-600",children:[i(v)," ",a("subscription.seats.extra")]})]}),h&&h>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.perExtraSeat")}),e.jsxs("span",{className:"text-gray-900",children:[o(h,c),k]})]}),m.maxSeats>0&&e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.seats.limit")}),e.jsx("span",{className:"text-gray-900",children:i(m.maxSeats)})]})]})]})]})}):null})()]})})():r.pendingOnboarding?e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(Za,{className:"h-12 w-12 mx-auto mb-3 text-blue-400"}),e.jsx("p",{className:"text-lg font-medium text-gray-700",children:a("subscription.startFreeTrial")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:a("subscription.startTrialDescription")})]}),e.jsx(Ps,{size:"sm",progress:R,onClick:async()=>{try{D(!0);const e=await f({planVersionId:r.pendingOnboarding?.planVersionId??""});e&&"checkoutUrl"in e&&e.checkoutUrl&&Ia(e.checkoutUrl)}catch(e){}finally{D(!1)}},children:a("subscription.startFreeTrial")}),_&&_.length>0&&e.jsx(Ps,{variant:"ghost",size:"sm",className:"ms-2",onClick:()=>F(!0),children:a("subscription.viewAllPlans")})]}):e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(Za,{className:"h-12 w-12 mx-auto text-gray-400 mb-3"}),e.jsx("p",{className:"text-lg font-medium text-gray-700",children:a("subscription.noSubscription")}),e.jsx("p",{className:"text-sm text-gray-500 mt-1",children:a("subscription.noSubscriptionDescription")})]}),_&&_.length>0&&e.jsx(Ps,{size:"sm",onClick:()=>F(!0),children:a("subscription.viewPricingPlans")})]})]}),!S&&!N&&e.jsxs("div",{className:"border rounded-lg p-4 text-center",children:[e.jsxs("div",{className:"text-gray-500 mb-2",children:[e.jsx("p",{className:"font-medium",children:a("subscription.errorLoading")}),A&&e.jsxs("p",{className:"text-sm mt-2 text-red-600",children:["Error: ",A]}),!A&&e.jsx("p",{className:"text-sm mt-2",children:a("subscription.noPlansAvailable")})]}),e.jsx(Ps,{variant:"outline",size:"sm",progress:N,onClick:K,disabled:N,className:"mt-4",children:a("settings.common.refreshAction",{loading:String(N)})})]})]}),"invoices"===G&&e.jsxs(e.Fragment,{children:[N&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(es,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),e.jsx(Ew,{workspaceId:n,hasActiveSubscription:null!==u?.subscription,onViewPricingPlans:()=>$("subscription"),limit:20})]}),_&&_.length>0&&e.jsx(t.Suspense,{fallback:z?e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx(es,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:a("settings.common.loading")})]})}):null,children:e.jsx(Cw,{open:z,onOpenChange:F,planVersions:_,currentPlanVersionId:Z||null,currentStripePriceId:u?.subscription?.stripePriceId,billingCurrency:r.billingCurrency,currentMemberCount:Array.isArray(r?.users)?r.users.length:void 0,onSelectPlan:async(e,t=Fn.Monthly,s)=>{if(!n)return;const i=_?.find(t=>t._id===e),o=s??q?.currency??u?.plan?.currency??r?.billingCurrency??"",c=i?function(e,t,r){const n=na(e,t);if(!n?.stripePrices)return null;const a=r===Fn.Monthly?"monthlyPriceId":r===Fn.Yearly?"yearlyPriceId":"quarterlyPriceId",s=r===Fn.Monthly?"monthly":r===Fn.Yearly?"yearly":void 0;return n.stripePrices[a]??(s?n.stripePrices[s]:void 0)??null}(i,o,t):null,l=u?.subscription?.stripePriceId;if(!c||!l||c!==l){D(!0),U(null),L(null);try{const{successUrl:r,cancelUrl:s}=function(e){const t="undefined"!=typeof window?window.location.href:void 0;return{successUrl:fw({action:"checkout",status:"success",ws:e,screen:"subscription"},t),cancelUrl:fw({action:"checkout",status:"cancel",ws:e,screen:"subscription"},t)}}(n);let i;const c=u?.subscription?.subscriptionStatus===Vn;if(i=u?.subscription&&!c?await m(e,{billingInterval:t,successUrl:r,cancelUrl:s}):await f({planVersionId:e,billingInterval:t,currency:o||void 0,successUrl:r,cancelUrl:s}),i&&"checkoutUrl"in i&&i.checkoutUrl)return void Ia(i.checkoutUrl);L(a("subscription.updateSuccess")),await K()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorProcessing");U(t)}finally{D(!1),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{U(null),L(null)},5e3)}}},loading:R||N})}),e.jsx(Gc,{open:V,onOpenChange:H,children:e.jsxs(Zc,{children:[e.jsxs(Jc,{children:[e.jsx(Xc,{children:a("subscription.resumeTitle")}),e.jsx(Qc,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:a("subscription.resumeConfirm")}),e.jsxs("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ds,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[a("subscription.resumeChargeDate")," ",u?.subscription?.stripeCurrentPeriodEnd&&Nw(s,u.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:Nw(s,u.subscription.stripeCurrentPeriodEnd)}):a("subscription.resumeChargeFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-amber-600 mt-0.5",children:"•"}),e.jsx("span",{children:a("subscription.resumeContinue")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:a("subscription.resumeCancelAnytime")})]})]})]})})]}),e.jsxs(Yc,{children:[e.jsx(tl,{disabled:y,children:a("subscription.resumeKeep")}),e.jsx(el,{onClick:async()=>{if(n){H(!1),D(!0),U(null),L(null);try{await v(),L(a("subscription.resumeSuccess")),await K()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorResuming");U(t)}finally{D(!1),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{U(null),L(null)},5e3)}}},disabled:y,children:a(y?"subscription.resuming":"subscription.resumeButton")})]})]})}),e.jsx(Gc,{open:B,onOpenChange:W,children:e.jsxs(Zc,{children:[e.jsxs(Jc,{children:[e.jsx(Xc,{children:a("subscription.cancelTitle")}),e.jsx(Qc,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:a("subscription.cancelConfirm")}),e.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 space-y-2 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsxs("span",{children:[a("subscription.retainAccess")," ",u?.subscription?.stripeCurrentPeriodEnd&&Nw(s,u.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:Nw(s,u.subscription.stripeCurrentPeriodEnd)}):a("subscription.retainAccessFallback")]})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-green-600 mt-0.5",children:"✓"}),e.jsx("span",{children:a("subscription.cancelNotCharged")})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx("span",{className:"text-blue-600 mt-0.5",children:"ℹ"}),e.jsx("span",{children:a("subscription.cancelResumeAnytime")})]})]})]})})]}),e.jsxs(Yc,{children:[e.jsx(tl,{disabled:b,children:a("subscription.cancelKeep")}),e.jsx(el,{onClick:async()=>{if(n){W(!1),D(!0),U(null),L(null);try{await g(),L(a("subscription.cancelSuccess")),await K()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorCanceling");U(t)}finally{D(!1),O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{U(null),L(null)},5e3)}}},disabled:b,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:a(b?"subscription.canceling":"subscription.cancelButton")})]})]})})]}):e.jsx("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:e.jsx("p",{children:a("subscription.invalidWorkspace")})})};function jw(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function Pw(e,t,r){return t+e.toLocaleString(r,{minimumFractionDigits:2,maximumFractionDigits:2})}function Tw(e){try{const t=new Date(e);if(isNaN(t.getTime()))return null;const r=new Date;return Math.ceil((t.getTime()-r.getTime())/864e5)}catch{return null}}const _w=()=>{const{quotas:r,loading:n,error:a,refetch:s}=Ra(),{t:i,formattingLocale:o,fmtNum:c}=an(),l=(e,t)=>Pw(e,t,o),{response:u}=zn(),[d,p]=t.useState(!1),m=t.useMemo(()=>{const e={};if(!u?.planVersion||!u?.subscription)return e;const t=u.planVersion,n=u.subscription,a=n.billingInterval??"monthly",s=n.plan?.currency??"usd",i=yf(s);if(!r)return e;for(const n of Object.keys(r)){const o=sa(t,s,n,a);if(null==o||o<=0)continue;const c=t.quotas?.[n],l=c?.[a],u=l?.unitSize??1,d=r[n].overage,p=(u>1?Math.ceil(d/u):d)*o/100;e[n]={overageCents:o,unitSize:u,currency:s,currencySymbol:i,estimatedCost:p}}return e},[u,r]),h=t.useMemo(()=>{const e=u?.subscription?.stripeCurrentPeriodEnd;if(!e)return null;const t=function(e,t="en-US"){try{const r=new Date(e);return isNaN(r.getTime())?"":new Intl.DateTimeFormat(t,{month:"short",day:"numeric",year:"numeric"}).format(r)}catch{return""}}(e,o);return t?{endDate:t,daysRemaining:Tw(e)}:null},[u,o]),f=async()=>{p(!0);try{await s()}finally{p(!1)}};if(n&&!r)return e.jsx(nl,{});if(a)return e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:i("usage.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:a})]}),e.jsx(Ps,{variant:"outline",size:"sm",onClick:f,disabled:d,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.retryAction",{loading:String(d)})})]});const g=function(e){return[...e].sort(([,e],[,t])=>{if(e.hasOverage&&!t.hasOverage)return-1;if(!e.hasOverage&&t.hasOverage)return 1;const r=e.included>0?e.consumed/e.included:e.consumed>0?1:0;return(t.included>0?t.consumed/t.included:t.consumed>0?1:0)-r})}(r?Object.entries(r):[]);if(0===g.length)return e.jsxs("div",{className:"border rounded-lg p-8 text-center",children:[e.jsx($a,{className:"h-10 w-10 text-gray-300 mx-auto mb-3"}),e.jsx("p",{className:"text-sm text-gray-600",children:i("usage.noData")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:i("usage.noDataHint")})]});const b=g.filter(([,e])=>e.hasOverage).length,v=g.length>0?Math.round(g.reduce((e,[,t])=>e+(t.included>0?t.consumed/t.included*100:0),0)/g.length):0,y=Object.values(m).reduce((e,t)=>e+t.estimatedCost,0),x=Object.values(m)[0]?.currencySymbol??"$";return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-sm text-gray-600",children:i("usage.description")}),e.jsxs(Ps,{variant:"ghost",size:"sm",onClick:f,disabled:d,children:[e.jsx(ns,{className:Se("h-3.5 w-3.5 me-1.5",d&&"animate-spin")}),i("settings.common.refreshAction",{loading:String(d)})]})]}),h&&e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-gray-200 bg-gray-50/50 px-4 py-3 text-sm text-gray-600",children:[e.jsx(Ga,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e.jsxs("span",{children:[i("usage.resetDateDisplay",{date:h.endDate}),null!==h.daysRemaining&&h.daysRemaining>0&&e.jsxs("span",{className:"text-gray-500",children:[" (",i("usage.daysRemainingDisplay",{count:h.daysRemaining}),")"]}),null!==h.daysRemaining&&h.daysRemaining<=0&&e.jsxs("span",{className:"text-amber-600 font-medium",children:[" (",i("usage.renewingSoon"),")"]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 sm:gap-3",children:[e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.totalResources")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(g.length)})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.overallUsage")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(v)+"%"})]}),e.jsxs("div",{className:Se("border rounded-lg p-3 sm:p-4",b>0?"border-red-200 bg-red-50":"border-gray-200"),children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.inOverage")}),e.jsx("p",{className:Se("text-lg sm:text-xl font-semibold mt-1",b>0?"text-red-600":"text-gray-900"),children:c(b)})]}),b>0&&y>0&&e.jsxs("div",{className:"border border-red-200 bg-red-50 rounded-lg p-3 sm:p-4",children:[e.jsx("p",{className:"text-xs text-gray-500 font-medium",children:i("usage.estOverageCost")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold mt-1 text-red-600",children:l(y,x)})]})]}),b>0&&e.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ds,{className:"h-5 w-5 text-amber-600 flex-shrink-0 mt-0.5 hidden sm:block"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-sm font-semibold text-amber-800 mb-1",children:i("usage.overageDetected")}),e.jsx("p",{className:"text-sm text-amber-700",children:i("usage.overageWarning",{count:b})}),y>0&&e.jsx("p",{className:"text-sm text-amber-700 font-medium mt-1",children:i("usage.estOverageCharges",{amount:l(y,x)})})]})]})}),e.jsx("div",{className:"space-y-3",children:g.map(([t,r])=>{const n=(a=r.consumed,(s=r.included)<=0?a>0?100:0:Math.min(a/s*100,100));var a,s;const i=function(e,t){return t?{bar:"bg-red-500",bg:"bg-red-100",badge:"bg-red-100",badgeText:"text-red-800"}:e>=90?{bar:"bg-amber-500",bg:"bg-amber-100",badge:"bg-amber-100",badgeText:"text-amber-800"}:e>=75?{bar:"bg-yellow-500",bg:"bg-yellow-100",badge:"bg-yellow-100",badgeText:"text-yellow-800"}:{bar:"bg-blue-500",bg:"bg-blue-100",badge:"bg-blue-100",badgeText:"text-blue-800"}}(n,r.hasOverage),o=m[t];return e.jsx(Rw,{slug:t,quota:r,percent:n,colors:i,pricing:o},t)})})]})};function Rw({slug:t,quota:r,percent:n,colors:a,pricing:s}){const{t:i,formattingLocale:o}=an(),c=e=>function(e,t){return e>=1e6?(e/1e6).toLocaleString(t,{maximumFractionDigits:1})+"M":e>=1e3?(e/1e3).toLocaleString(t,{maximumFractionDigits:1})+"K":e.toLocaleString(t)}(e,o),l=(e,t)=>Pw(e,t,o);return e.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 sm:p-5",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-y-1 mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 truncate",children:jw(t)}),r.hasOverage&&e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",a.badge,a.badgeText),children:i("usage.overage")}),!r.hasOverage&&n>=90&&e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",a.badge,a.badgeText),children:i("usage.almostFull")})]}),e.jsxs("span",{className:"text-sm text-gray-500 whitespace-nowrap",children:[c(r.consumed)," / ",c(r.included)]})]}),e.jsx("div",{className:Se("h-2 rounded-full w-full",a.bg),children:e.jsx("div",{className:Se("h-2 rounded-full transition-all duration-500",a.bar),style:{width:`${n}%`}})}),e.jsxs("div",{className:"flex items-center justify-between mt-2 text-xs text-gray-500",children:[e.jsx("span",{children:i("usage.percentUsed",{percent:Math.round(n)})}),e.jsx("span",{children:r.available>0?i("usage.availableRemaining",{count:c(r.available)}):r.hasOverage?i("usage.overLimitCount",{count:c(r.overage)}):i("usage.fullyUsed")})]}),r.hasOverage&&s&&e.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.overageUnits")}),e.jsx("span",{className:"font-medium text-gray-900",children:c(r.overage)})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.rate")}),e.jsx("span",{className:"font-medium text-gray-900",children:i("usage.rateDisplay",{rate:l(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})]}),s.unitSize>1&&e.jsxs("div",{className:"flex items-center justify-between text-xs",children:[e.jsx("span",{className:"text-gray-500",children:i("usage.billableBlocks")}),e.jsx("span",{className:"font-medium text-gray-900",children:Math.ceil(r.overage/s.unitSize).toLocaleString(o)})]}),e.jsxs("div",{className:"flex items-center justify-between text-xs pt-2 border-t border-gray-200",children:[e.jsx("span",{className:"font-medium text-red-600",children:i("usage.estimatedCharge")}),e.jsx("span",{className:"font-semibold text-red-600",children:l(s.estimatedCost,s.currencySymbol)})]})]}),!r.hasOverage&&s&&e.jsx("div",{className:"mt-2 text-xs text-gray-500",children:i("usage.overageRateDisplay",{rate:i("usage.rateDisplay",{rate:l(s.overageCents/100,s.currencySymbol),unitSize:s.unitSize})})})]})}function Dw(e){const t=a.forwardRef((e,t)=>{const{children:r,...n}=e;if(a.isValidElement(r)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;if(r)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r)return e.props.ref;return e.props.ref||e.ref}(r),s=function(e,t){const r={...t};for(const n in t){const a=e[n],s=t[n];/^on[A-Z]/.test(n)?a&&s?r[n]=(...e)=>{const t=s(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...s}:"className"===n&&(r[n]=[a,s].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?fs(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Iw=Symbol("radix.slottable");function Uw(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Iw}var Mw=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});a.forwardRef((t,r)=>e.jsx(Ws.span,{...t,ref:r,style:{...Mw,...t.style}})).displayName="VisuallyHidden";var Lw=[" ","Enter","ArrowUp","ArrowDown"],Ow=[" ","Enter"],zw="Select",[Fw,Bw,Ww]=Ff(zw),[Vw]=_s(zw,[Ww,sx]),Hw=sx(),[Gw,$w]=Vw(zw),[Kw,qw]=Vw(zw),Zw=t=>{const{__scopeSelect:r,children:n,open:s,defaultOpen:i,onOpenChange:o,value:c,defaultValue:l,onValueChange:u,dir:d,name:p,autoComplete:m,disabled:h,required:f,form:g}=t,b=Hw(r),[v,y]=a.useState(null),[x,w]=a.useState(null),[S,k]=a.useState(!1),E=Wf(d),[C,N]=Os({prop:s,defaultProp:i??!1,onChange:o,caller:zw}),[A,j]=Os({prop:c,defaultProp:l,onChange:u,caller:zw}),P=a.useRef(null),T=!v||(g||!!v.closest("form")),[_,R]=a.useState(new Set),D=Array.from(_).map(e=>e.props.value).join(";");return e.jsx(wx,{...b,children:e.jsxs(Gw,{required:f,scope:r,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:Ms(),value:A,onValueChange:j,open:C,onOpenChange:N,dir:E,triggerPointerDownPosRef:P,disabled:h,children:[e.jsx(Fw.Provider,{scope:r,children:e.jsx(Kw,{scope:t.__scopeSelect,onNativeOptionAdd:a.useCallback(e=>{R(t=>new Set(t).add(e))},[]),onNativeOptionRemove:a.useCallback(e=>{R(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),T?e.jsxs(DS,{"aria-hidden":!0,required:f,tabIndex:-1,name:p,autoComplete:m,value:A,onChange:e=>j(e.target.value),disabled:h,form:g,children:[void 0===A?e.jsx("option",{value:""}):null,Array.from(_)]},D):null]})})};Zw.displayName=zw;var Jw="SelectTrigger",Yw=a.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:s=!1,...i}=t,o=Hw(n),c=$w(Jw,n),l=c.disabled||s,u=gs(r,c.onTriggerChange),d=Bw(n),p=a.useRef("touch"),[m,h,f]=US(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),n=MS(t,e,r);void 0!==n&&c.onValueChange(n.value)}),g=e=>{l||(c.onOpenChange(!0),f()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return e.jsx(Sx,{asChild:!0,...o,children:e.jsx(Ws.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":IS(c.value)?"":void 0,...i,ref:u,onClick:Ts(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:Ts(i.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:Ts(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||Lw.includes(e.key)&&(g(),e.preventDefault())})})})});Yw.displayName=Jw;var Xw="SelectValue",Qw=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:s,children:i,placeholder:o="",...c}=t,l=$w(Xw,n),{onValueNodeHasChildrenChange:u}=l,d=void 0!==i,p=gs(r,l.onValueNodeChange);return Ds(()=>{u(d)},[u,d]),e.jsx(Ws.span,{...c,ref:p,style:{pointerEvents:"none"},children:IS(l.value)?e.jsx(e.Fragment,{children:o}):i})});Qw.displayName=Xw;var eS=a.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...s}=t;return e.jsx(Ws.span,{"aria-hidden":!0,...s,ref:r,children:a||"▼"})});eS.displayName="SelectIcon";var tS=t=>e.jsx(ci,{asChild:!0,...t});tS.displayName="SelectPortal";var rS="SelectContent",nS=a.forwardRef((t,r)=>{const n=$w(rS,t.__scopeSelect),[i,o]=a.useState();if(Ds(()=>{o(new DocumentFragment)},[]),!n.open){const r=i;return r?s.createPortal(e.jsx(sS,{scope:t.__scopeSelect,children:e.jsx(Fw.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(cS,{...t,ref:r})});nS.displayName=rS;var aS=10,[sS,iS]=Vw(rS),oS=function(t){const r=Dw(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Uw);if(c){const t=c.props.children,s=o.map(e=>e===c?a.Children.count(t)>1?a.Children.only(null):a.isValidElement(t)?t.props.children:null:e);return e.jsx(r,{...i,ref:n,children:a.isValidElement(t)?a.cloneElement(t,void 0,s):null})}return e.jsx(r,{...i,ref:n,children:s})});return n.displayName=`${t}.Slot`,n}("SelectContent.RemoveScroll"),cS=a.forwardRef((t,r)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:c,side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v,...y}=t,x=$w(rS,n),[w,S]=a.useState(null),[k,E]=a.useState(null),C=gs(r,e=>S(e)),[N,A]=a.useState(null),[j,P]=a.useState(null),T=Bw(n),[_,R]=a.useState(!1),D=a.useRef(!1);a.useEffect(()=>{if(w)return oo(w)},[w]),pi();const I=a.useCallback(e=>{const[t,...r]=T().map(e=>e.ref.current),[n]=r.slice(-1),a=document.activeElement;for(const r of e){if(r===a)return;if(r?.scrollIntoView({block:"nearest"}),r===t&&k&&(k.scrollTop=0),r===n&&k&&(k.scrollTop=k.scrollHeight),r?.focus(),document.activeElement!==a)return}},[T,k]),U=a.useCallback(()=>I([N,w]),[I,N,w]);a.useEffect(()=>{_&&U()},[_,U]);const{onOpenChange:M,triggerPointerDownPosRef:L}=x;a.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():w.contains(r.target)||M(!1),document.removeEventListener("pointermove",t),L.current=null};return null!==L.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[w,M,L]),a.useEffect(()=>{const e=()=>M(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[M]);const[O,z]=US(e=>{const t=T().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=MS(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),F=a.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==x.value&&x.value===t||n)&&(A(e),n&&(D.current=!0))},[x.value]),B=a.useCallback(()=>w?.focus(),[w]),W=a.useCallback((e,t,r)=>{const n=!D.current&&!r;(void 0!==x.value&&x.value===t||n)&&P(e)},[x.value]),V="popper"===s?uS:lS,H=V===uS?{side:l,sideOffset:u,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return e.jsx(sS,{scope:n,content:w,viewport:k,onViewportChange:E,itemRefCallback:F,selectedItem:N,onItemLeave:B,itemTextRefCallback:W,focusSelectedItem:U,selectedItemText:j,position:s,isPositioned:_,searchRef:O,children:e.jsx(eo,{as:oS,allowPinchZoom:!0,children:e.jsx(ti,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Ts(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(Zs,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:e.jsx(V,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...y,...H,onPlaced:()=>R(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Ts(y.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=T().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>I(t)),e.preventDefault()}})})})})})})});cS.displayName="SelectContentImpl";var lS=a.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:s,...i}=t,o=$w(rS,n),c=iS(rS,n),[l,u]=a.useState(null),[d,p]=a.useState(null),m=gs(r,e=>p(e)),h=Bw(n),f=a.useRef(!1),g=a.useRef(!0),{viewport:b,selectedItem:v,selectedItemText:y,focusSelectedItem:x}=c,w=a.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&d&&b&&v&&y){const e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=o.valueNode.getBoundingClientRect(),n=y.getBoundingClientRect();if("rtl"!==o.dir){const a=n.left-t.left,s=r.left-a,i=e.left-s,o=e.width+i,c=Math.max(o,t.width),u=window.innerWidth-aS,d=Dg(s,[aS,Math.max(aS,u-c)]);l.style.minWidth=o+"px",l.style.left=d+"px"}else{const a=t.right-n.right,s=window.innerWidth-r.right-a,i=window.innerWidth-e.right-s,o=e.width+i,c=Math.max(o,t.width),u=window.innerWidth-aS,d=Dg(s,[aS,Math.max(aS,u-c)]);l.style.minWidth=o+"px",l.style.right=d+"px"}const a=h(),i=window.innerHeight-2*aS,c=b.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),m=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=p+m+c+parseInt(u.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,x),S=window.getComputedStyle(b),k=parseInt(S.paddingTop,10),E=parseInt(S.paddingBottom,10),C=e.top+e.height/2-aS,N=i-C,A=v.offsetHeight/2,j=p+m+(v.offsetTop+A),P=x-j;if(j<=C){const e=a.length>0&&v===a[a.length-1].ref.current;l.style.bottom="0px";const t=d.clientHeight-b.offsetTop-b.offsetHeight,r=j+Math.max(N,A+(e?E:0)+t+g);l.style.height=r+"px"}else{const e=a.length>0&&v===a[0].ref.current;l.style.top="0px";const t=Math.max(C,p+b.offsetTop+(e?k:0)+A)+P;l.style.height=t+"px",b.scrollTop=j-C+b.offsetTop}l.style.margin=`${aS}px 0`,l.style.minHeight=w+"px",l.style.maxHeight=i+"px",s?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,l,d,b,v,y,o.dir,s]);Ds(()=>w(),[w]);const[S,k]=a.useState();Ds(()=>{d&&k(window.getComputedStyle(d).zIndex)},[d]);const E=a.useCallback(e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)},[w,x]);return e.jsx(dS,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:f,onScrollButtonChange:E,children:e.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:e.jsx(Ws.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});lS.displayName="SelectItemAlignedPosition";var uS=a.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:s=aS,...i}=t,o=Hw(n);return e.jsx(kx,{...o,...i,ref:r,align:a,collisionPadding:s,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});uS.displayName="SelectPopperPosition";var[dS,pS]=Vw(rS,{}),mS="SelectViewport",hS=a.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:s,...i}=t,o=iS(mS,n),c=pS(mS,n),l=gs(r,o.onViewportChange),u=a.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),e.jsx(Fw.Slot,{scope:n,children:e.jsx(Ws.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ts(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=c;if(n?.current&&r){const e=Math.abs(u.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*aS,a=parseFloat(r.style.minHeight),s=parseFloat(r.style.height),i=Math.max(a,s);if(i<n){const a=i+e,s=Math.min(n,a),o=a-s;r.style.height=s+"px","0px"===r.style.bottom&&(t.scrollTop=o>0?o:0,r.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});hS.displayName=mS;var fS="SelectGroup",[gS,bS]=Vw(fS);a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=Ms();return e.jsx(gS,{scope:n,id:s,children:e.jsx(Ws.div,{role:"group","aria-labelledby":s,...a,ref:r})})}).displayName=fS;var vS="SelectLabel",yS=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=bS(vS,n);return e.jsx(Ws.div,{id:s.id,...a,ref:r})});yS.displayName=vS;var xS="SelectItem",[wS,SS]=Vw(xS),kS=a.forwardRef((t,r)=>{const{__scopeSelect:n,value:s,disabled:i=!1,textValue:o,...c}=t,l=$w(xS,n),u=iS(xS,n),d=l.value===s,[p,m]=a.useState(o??""),[h,f]=a.useState(!1),g=gs(r,e=>u.itemRefCallback?.(e,s,i)),b=Ms(),v=a.useRef("touch"),y=()=>{i||(l.onValueChange(s),l.onOpenChange(!1))};if(""===s)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(wS,{scope:n,value:s,disabled:i,textId:b,isSelected:d,onItemTextChange:a.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(Fw.ItemSlot,{scope:n,value:s,disabled:i,textValue:p,children:e.jsx(Ws.div,{role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:g,onFocus:Ts(c.onFocus,()=>f(!0)),onBlur:Ts(c.onBlur,()=>f(!1)),onClick:Ts(c.onClick,()=>{"mouse"!==v.current&&y()}),onPointerUp:Ts(c.onPointerUp,()=>{"mouse"===v.current&&y()}),onPointerDown:Ts(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Ts(c.onPointerMove,e=>{v.current=e.pointerType,i?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ts(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Ts(c.onKeyDown,e=>{""!==u.searchRef?.current&&" "===e.key||(Ow.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});kS.displayName=xS;var ES="SelectItemText",CS=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:i,style:o,...c}=t,l=$w(ES,n),u=iS(ES,n),d=SS(ES,n),p=qw(ES,n),[m,h]=a.useState(null),f=gs(r,e=>h(e),d.onItemTextChange,e=>u.itemTextRefCallback?.(e,d.value,d.disabled)),g=m?.textContent,b=a.useMemo(()=>e.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=p;return Ds(()=>(v(b),()=>y(b)),[v,y,b]),e.jsxs(e.Fragment,{children:[e.jsx(Ws.span,{id:d.textId,...c,ref:f}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?s.createPortal(c.children,l.valueNode):null]})});CS.displayName=ES;var NS="SelectItemIndicator",AS=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return SS(NS,n).isSelected?e.jsx(Ws.span,{"aria-hidden":!0,...a,ref:r}):null});AS.displayName=NS;var jS="SelectScrollUpButton";a.forwardRef((t,r)=>{const n=iS(jS,t.__scopeSelect),s=pS(jS,t.__scopeSelect),[i,o]=a.useState(!1),c=gs(r,s.onScrollButtonChange);return Ds(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;o(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?e.jsx(TS,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=jS;var PS="SelectScrollDownButton";a.forwardRef((t,r)=>{const n=iS(PS,t.__scopeSelect),s=pS(PS,t.__scopeSelect),[i,o]=a.useState(!1),c=gs(r,s.onScrollButtonChange);return Ds(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;o(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),i?e.jsx(TS,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=PS;var TS=a.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:s,...i}=t,o=iS("SelectScrollButton",n),c=a.useRef(null),l=Bw(n),u=a.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return a.useEffect(()=>()=>u(),[u]),Ds(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),e.jsx(Ws.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:Ts(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(s,50))}),onPointerMove:Ts(i.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(s,50))}),onPointerLeave:Ts(i.onPointerLeave,()=>{u()})})}),_S=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e.jsx(Ws.div,{"aria-hidden":!0,...a,ref:r})});_S.displayName="SelectSeparator";var RS="SelectArrow";a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=Hw(n),i=$w(RS,n),o=iS(RS,n);return i.open&&"popper"===o.position?e.jsx(Ex,{...s,...a,ref:r}):null}).displayName=RS;var DS=a.forwardRef(({__scopeSelect:t,value:r,...n},s)=>{const i=a.useRef(null),o=gs(s,i),c=sl(r);return a.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(c!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[c,r]),e.jsx(Ws.select,{...n,style:{...Mw,...n.style},ref:o,defaultValue:r})});function IS(e){return""===e||void 0===e}function US(e){const t=Vs(e),r=a.useRef(""),n=a.useRef(0),s=a.useCallback(e=>{const a=r.current+e;t(a),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(a)},[t]),i=a.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return a.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,i]}function MS(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=r?e.indexOf(r):-1;let s=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(a,0));1===n.length&&(s=s.filter(e=>e!==r));const i=s.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}DS.displayName="SelectBubbleInput";var LS=Yw,OS=eS,zS=tS,FS=nS,BS=hS,WS=yS,VS=kS,HS=CS,GS=AS,$S=_S;const KS=Zw,qS=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(LS,{ref:a,className:Se("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t),...n,children:[r,e.jsx(OS,{asChild:!0,children:e.jsx(tc,{className:"h-4 w-4 opacity-50"})})]}));qS.displayName=LS.displayName;const ZS=a.forwardRef(({className:t,children:r,position:n="popper",...s},i)=>{const{container:o}=a.useContext(cc);return e.jsx(zS,{container:o,children:e.jsx(FS,{ref:i,className:Se("relative z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...s,children:e.jsx(BS,{className:Se("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});ZS.displayName=FS.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(WS,{ref:n,className:Se("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=WS.displayName;const JS=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(VS,{ref:a,className:Se("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 ps-2 pe-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[e.jsx("span",{className:"absolute end-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(GS,{children:e.jsx(nc,{className:"h-4 w-4"})})}),e.jsx(HS,{children:r})]}));JS.displayName=VS.displayName;function YS(e,r){const{response:n}=zn();return t.useMemo(()=>{if(!e)return{hasSeatPricing:!1,memberCount:0,includedSeats:0,maxUsers:0,maxSeats:0,limitSource:"none",billableSeats:0,availableSeats:1/0,isAtMax:!1,isNearMax:!1,perSeatPriceCents:null,currency:"",canInvite:!0,inviteBlockReason:null,inviteBlockMessageKey:null,inviteBlockMessageValues:null};const t=e.users?.length??0,a=n?.planVersion,s=n?.subscription,i=e.billingCurrency||"usd",o=ua({planVersion:a,currency:i,settingsMaxUsers:r?.settingsMaxUsers}),{maxUsers:c,hasSeatPricing:l,includedSeats:u}=o,d=l?Math.max(0,t-u):0,p=c>0?Math.max(0,c-t):1/0,m=c>0&&t>=c,h=c>0&&t>=.8*c&&!m,f=l&&a?la(a,i,s?.billingInterval??"monthly"):null,g=da({memberCount:t,maxUsersConfig:o});return{hasSeatPricing:l,memberCount:t,includedSeats:u,maxUsers:c,maxSeats:c,limitSource:o.source,billableSeats:d,availableSeats:p,isAtMax:m,isNearMax:h,perSeatPriceCents:f,currency:i,canInvite:g.canInvite,inviteBlockReason:g.blockReason,inviteBlockMessageKey:g.blockMessageKey,inviteBlockMessageValues:g.blockMessageValues}},[n,e,r?.settingsMaxUsers])}a.forwardRef(({className:t,...r},n)=>e.jsx($S,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=$S.displayName;const XS=({workspace:r})=>{const{user:n}=hk(),{t:a,fmtNum:s,fmtCents:i}=an(),[o,c]=t.useState(0),[l,u]=t.useState(!1),[d,p]=t.useState([]),[m,h]=t.useState(null),{getUsers:f,removeUser:g,updateUser:b}=Pa(),{settings:v}=Sn(),{response:y}=zn(),x=YS(r,{settingsMaxUsers:v?.workspace?.maxWorkspaceUsers});t.useEffect(()=>{r&&(u(!0),f(r._id).then(e=>{p(e)}).catch(e=>{Re(e,{component:"WorkspaceSettingsUsers",action:"getUsers",metadata:{workspaceId:r._id}})}).finally(()=>{u(!1)}))},[r,o]);const w=()=>{c(e=>e+1)};if(l||!r)return e.jsx(nl,{});const S=e=>"string"==typeof e?{name:a("users.unknownUser"),email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},k=d.map(e=>({...e,...S(e.user)})),E=d.find(e=>("string"==typeof e.user?e.user:e.user._id)===n?.id)?.role,C="admin"===E,{hasSeatPricing:N,includedSeats:A,maxUsers:j,canInvite:P,inviteBlockReason:T,inviteBlockMessageKey:_,inviteBlockMessageValues:R,perSeatPriceCents:D,currency:I}=x,U=d.length,M=y?.subscription?.billingInterval??"monthly",L=N&&U>=A;return e.jsxs("div",{children:[!C&&e.jsx("div",{className:"text-red-500",children:a("users.adminOnly")}),C&&!1!==v?.workspace?.canInviteMembers&&e.jsx("div",{className:"mb-4",children:P?e.jsxs("div",{children:[e.jsx(QS,{onInvite:w,workspaceId:r._id}),L&&D&&D>0&&e.jsx("div",{className:"flex items-center gap-1.5 mt-2 text-xs text-amber-600 bg-amber-50 px-3 py-1.5 rounded-md",children:e.jsx("span",{children:a("users.extraSeatCost",{price:i(D,I),interval:M})})})]}):e.jsx("div",{className:"flex items-center justify-between p-3 bg-red-50 border border-red-100 rounded-md",children:e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-red-700",children:a("users.limitReached",{reason:T??"member_limit_reached"})}),e.jsx("p",{className:"text-xs text-red-600 mt-0.5",children:_?a(_,R??void 0):""})]})})}),(N||j>0)&&e.jsxs("div",{className:"mb-4 rounded-lg border bg-gray-50 p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("h4",{className:"text-sm font-semibold text-gray-900",children:a("users.seatHeading",{hasSeatPricing:String(N)})}),j>0&&e.jsxs("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full "+(U>=j?"bg-red-100 text-red-700":U>=.8*j?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),children:[s(U)," / ",s(j)]})]}),j>0&&e.jsx("div",{className:"w-full h-1.5 bg-gray-200 rounded-full mb-3",children:e.jsx("div",{className:"h-1.5 rounded-full transition-all "+(U>=j?"bg-red-500":U>=.8*j?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,U/j*100)}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[e.jsx("div",{children:N?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(A)})," ",a("users.included"),D&&D>0&&e.jsxs("span",{className:"text-gray-400",children:[" · ",i(D,I),a("users.perExtraSeat")]})]}):e.jsxs("span",{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(j)})," ",a("users.maxMembers")]})}),j>0?e.jsxs("span",{children:[s(Math.max(0,j-U))," ",a("users.available")]}):e.jsx("span",{className:"text-gray-400",children:a("users.noMemberLimit")})]})]}),e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("div",{children:e.jsx("div",{className:"text-sm text-gray-600",children:a("users.memberCount",{count:U})})}),e.jsx("div",{children:e.jsx(Ps,{variant:"ghost",size:"sm",onClick:w,progress:l,children:a("settings.common.refreshAction",{loading:String(l)})})})]}),e.jsx("ul",{className:"space-y-2",children:k.map((t,s)=>{const i=t.id===n?.id,o=("object"==typeof r.createdBy&&null!==r.createdBy?r.createdBy._id:r.createdBy)===t.id;return e.jsxs("li",{className:"border rounded p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 sm:gap-3 min-w-0",children:[e.jsx("div",{className:"w-8 h-8 bg-gray-200 rounded-full flex items-center justify-center text-sm font-medium shrink-0",children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500 truncate",children:t.email})]})]}),e.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[i&&e.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-0.5 rounded",children:a("users.you")}),o&&e.jsx("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-0.5 rounded",children:a("users.owner")})]})]}),C&&e.jsxs("div",{className:"flex items-center gap-2 mt-2 pt-2 border-t border-gray-100 sm:mt-0 sm:pt-0 sm:border-0",children:[e.jsxs("div",{className:"relative flex-1 sm:flex-initial",children:[e.jsxs(KS,{disabled:i||!C||o||m===t.id,value:t.role,onValueChange:e=>{return n=r._id,a=t.id,s=e,void(Aa(r,a)?Re(new Error("Cannot change the role of the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:a,role:s}}):(h(a),b(n,a,{role:s}).then(()=>{w()}).catch(e=>{Re(e,{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:a,role:s}})}).finally(()=>{h(null)})));var n,a,s},children:[e.jsx(qS,{children:e.jsx(Qw,{placeholder:a("users.selectRole")})}),e.jsx(ZS,{children:r?.roles.map(t=>e.jsx(JS,{value:t,children:t},t))})]}),m===t.id&&e.jsx("div",{className:"absolute end-8 top-1/2 -translate-y-1/2 pointer-events-none",children:e.jsx(es,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!i&&!o&&e.jsx(Ps,{variant:"destructive",size:"sm",startIcon:e.jsx(us,{}),onClick:()=>{return e=t.id,void(Aa(r,e)?Re(new Error("Cannot remove the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}}):g(r._id,e).then(()=>{w()}).catch(t=>{Re(t,{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}})}));var e}})]})]},s)})}),0===d.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:a("users.noMembers")})]})};function QS({onInvite:r,workspaceId:n}){const{t:a}=an(),{addUser:s,getWorkspace:i}=Pa(),{settings:o}=Sn(),[c,l]=t.useState(""),[u,d]=t.useState("admin"),[p,m]=t.useState(!1),[h,f]=t.useState(null),[g,b]=t.useState(null),[v,y]=t.useState(null),x=t.useRef(null),w=o?.workspace.roles??v?.roles??[];t.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]),t.useEffect(()=>{n&&i(n).then(y)},[n]);const S=()=>{f(null),b(null),l(""),d("admin")};return e.jsxs("div",{className:"flex gap-2 flex-col gap-y-2",children:[h&&e.jsx("div",{className:"text-red-500",children:h}),g&&e.jsx("div",{className:"text-green-500",children:g}),e.jsxs("div",{children:[e.jsx(Ef,{children:a("users.inviteByEmail")}),e.jsx(Uf,{type:"email",value:c,onChange:e=>l(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(Ef,{children:a("users.role")}),e.jsxs(KS,{value:u,onValueChange:d,children:[e.jsx(qS,{children:e.jsx(Qw,{placeholder:a("users.selectRole")})}),e.jsx(ZS,{children:w.map(t=>e.jsx(JS,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(Ps,{progress:p,onClick:async()=>{const e=c.trim();if(!e)return void f(a("users.emailRequired"));/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?(m(!0),await s(n,e,u).then(()=>{b(a("users.inviteSuccess")),r?.()}).catch(t=>{Re(t,{component:"InviteMember",action:"addUser",metadata:{workspaceId:n,email:e,role:u}}),f(t instanceof Error?t.message:a("users.inviteFailed"))}).finally(()=>{m(!1),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{S()},6e3)})):f(a("users.invalidEmail"))},disabled:p||!c||!u,children:p?a("users.inviting"):a("users.inviteAs",{role:u})})})]})}const ek={firefox:4,safari:4,edge:4,chrome:4},tk=()=>{const{isSupported:r,permission:n,isSubscribed:a,loading:s,error:i,subscribe:o,unsubscribe:c}=yk(),{t:l}=an(),u=t.useMemo(()=>function(){const e="undefined"!=typeof navigator?navigator.userAgent:"";return e.includes("Firefox")?"firefox":e.includes("Safari")&&!e.includes("Chrome")?"safari":e.includes("Edg")?"edge":"chrome"}(),[]),d=ek[u];return r?e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-sm text-gray-600",children:l("notifications.manageDescription")}),i&&"denied"!==n&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:i}),"denied"===n&&e.jsx("div",{className:"border border-amber-200 bg-amber-50 rounded-lg p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(is,{className:"h-5 w-5 text-amber-600 shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-amber-800",children:l("notifications.blocked")}),e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:l("notifications.blockedDescription")}),e.jsx("ol",{className:"text-xs text-amber-700 mt-2 space-y-1 list-decimal list-inside",children:Array.from({length:d},(t,r)=>e.jsx("li",{children:l(`notifications.unblock.${u}.step${r+1}`)},r))})]})]})}),"denied"!==n&&e.jsxs("div",{className:"border rounded-lg p-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"mt-0.5 p-2 rounded-lg "+(a?"bg-green-100":"bg-gray-100"),children:a?e.jsx(Va,{className:"h-4 w-4 text-green-600"}):e.jsx(Wa,{className:"h-4 w-4 text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900",children:l("notifications.pushTitle")}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:l("notifications.pushDescription",{subscribed:String(a)})})]})]}),e.jsx(Ps,{variant:a?"outline":"default",size:"sm",className:"shrink-0",onClick:a?c:o,disabled:s,progress:s,children:l("notifications.toggleAction",{loading:String(s),subscribed:String(a)})})]}),a&&e.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100 text-xs text-gray-500",children:l("notifications.deviceNote")})]})]}):e.jsx("div",{className:"text-sm text-gray-500",children:l("notifications.notSupported")})},rk=({workspace:t,section:r,setSection:n})=>{const{t:a}=an(),{user:s}=hk(),{settings:i}=Sn(),o=i?.workspace?.mode===xw,c=("object"==typeof t.createdBy&&null!==t.createdBy?t.createdBy._id:t.createdBy)===s?.id,l=ja(t,s?.id??null),u=c||"admin"===l?.toLowerCase();return e.jsxs("div",{className:"w-44 sm:w-56 h-full flex flex-col space-y-4 sm:space-y-6 shrink-0",children:[t&&e.jsx("div",{className:"border-b p-2 py-4",children:e.jsxs("div",{className:"flex items-center gap-x-2",children:[t.image&&t.image.trim()&&e.jsx("div",{className:"bg-blue-100 rounded flex items-center justify-center text-blue-600 font-medium px-0.5 py-0.5",style:{width:"40px",height:"40px",minWidth:"40px",minHeight:"40px"},children:e.jsx("img",{src:t.image,className:"w-full h-full object-contain",style:{width:"36px",height:"36px",maxWidth:"36px",maxHeight:"36px",objectFit:"contain"},alt:t.name})}),e.jsxs("div",{className:Se("flex-1 min-w-0",t.image?"":"ps-2"),children:[e.jsx("div",{className:"font-medium text-sm line-clamp-1 text-ellipsis overflow-hidden",children:t.name}),e.jsx("div",{className:"text-xs text-gray-500",children:t.workspaceId})]})]})}),e.jsx(nk,{title:a("settings.sidebar.account"),children:e.jsx(ak,{activeSection:r,icon:e.jsx(ps,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.profile"),section:sk.Profile,onClick:()=>n(sk.Profile)})}),e.jsxs(nk,{title:a("settings.sidebar.workspace"),children:[e.jsx(ak,{activeSection:r,icon:e.jsx(ss,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.general"),section:sk.General,onClick:()=>n(sk.General)}),!o&&e.jsx(ak,{activeSection:r,icon:e.jsx(ms,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.users"),section:sk.Users,onClick:()=>n(sk.Users)}),e.jsx(ak,{activeSection:r,icon:e.jsx(Za,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.subscription"),section:sk.Subscription,onClick:()=>n(sk.Subscription)}),e.jsx(ak,{activeSection:r,icon:e.jsx($a,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.usage"),section:sk.Usage,onClick:()=>n(sk.Usage)}),e.jsx(ak,{activeSection:r,icon:e.jsx(cs,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.features"),section:sk.Features,onClick:()=>n(sk.Features)}),e.jsx(ak,{activeSection:r,icon:e.jsx(Va,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.notifications"),section:sk.Notifications,onClick:()=>n(sk.Notifications)}),u&&!o&&e.jsx(ak,{activeSection:r,icon:e.jsx(ds,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.danger"),section:sk.Danger,onClick:()=>n(sk.Danger)})]})]})};function nk({title:t,children:r}){return e.jsxs("div",{className:"px-2 flex flex-col space-y-1",children:[e.jsx("div",{className:"text-xs font-bold mb-2 text-gray-500 uppercase tracking-wide px-2",children:t}),r]})}function ak({icon:t,label:r,section:n,onClick:a,activeSection:s}){return e.jsxs("button",{className:Se("flex w-full text-start px-2 py-1 rounded text-sm items-center gap-x-1",n===s?"bg-blue-100 text-blue-700 font-medium":"hover:bg-gray-200 hover:text-gray-700"),onClick:()=>a(n),children:[t,r]})}const sk={Profile:"profile",General:"general",Users:"users",Subscription:"subscription",Usage:"usage",Features:"features",Notifications:"notifications",Danger:"danger"},ik=new Set(Object.values(sk)),ok={[sk.Profile]:"settings.titles.profile",[sk.General]:"settings.titles.general",[sk.Users]:"settings.titles.users",[sk.Subscription]:"settings.titles.subscription",[sk.Usage]:"settings.titles.usage",[sk.Features]:"settings.titles.features",[sk.Notifications]:"settings.titles.notifications",[sk.Danger]:"settings.titles.danger"},ck=({workspace:r,onClose:n,open:a,onOpenChange:s,defaultSection:i=sk.Profile,section:o,onSectionChange:c,showTrigger:l=!0,trigger:u})=>{const{t:d,dir:p}=an(),[m,h]=t.useState(!1),[f,g]=t.useState(i),b=void 0!==a?a:m,v=s||h,y=void 0!==o?o:f,x=c||g;if(!r)return null;const w=e.jsx(Ps,{variant:"outline",size:"icon",children:e.jsx(ss,{className:"h-4 w-4"})});return e.jsxs(uc,{open:b,onOpenChange:e=>{v(e),!e&&n&&n()},children:[l&&e.jsx(dc,{asChild:!0,children:u||w}),e.jsxs(hc,{dir:p,className:"flex max-w-2xl min-w-full sm:min-w-[800px] p-0 m-0 bg-muted sm:min-h-[600px] min-h-full gap-x-0 space-x-0",children:[e.jsx(bc,{className:"sr-only",children:d(ok[y])}),e.jsx(rk,{workspace:r,section:y,setSection:x}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsx(gc,{className:"text-xl font-bold mb-4",children:d(ok[y])}),e.jsxs("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[y===sk.Profile&&e.jsx(mw,{workspace:r}),y===sk.General&&e.jsx(xb,{workspace:r}),y===sk.Users&&e.jsx(XS,{workspace:r}),y===sk.Subscription&&e.jsx(Aw,{workspace:r}),y===sk.Usage&&e.jsx(_w,{}),y===sk.Features&&e.jsx(yl,{workspaceId:r._id?.toString()}),y===sk.Notifications&&e.jsx(tk,{}),y===sk.Danger&&e.jsx(al,{workspace:r})]})]})]})]})};var lk=Object.freeze({__proto__:null,SETTINGS_SCREENS:ik,SettingsScreen:sk,WorkspaceSettingsDialog:ck,default:ck});const uk=new class{constructor(){this.listeners=new Set,this.currentState={open:!1,section:sk.Profile}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getState(){return{...this.currentState}}openWorkspaceSettings(e){this.currentState={open:!0,section:e||sk.Profile},this.notifyListeners()}closeSettings(){this.currentState={...this.currentState,open:!1},this.notifyListeners()}setSection(e){this.currentState={...this.currentState,section:e},this.notifyListeners()}notifyListeners(){this.listeners.forEach(e=>{e(this.currentState.open,this.currentState.section)})}};function dk(e,t,r){const n=e._id||e.id;if(!n||"string"!=typeof n)throw new Error("User data missing required ID field");if(!e.email||"string"!=typeof e.email)throw new Error("User data missing required email field");return{id:n,name:e.name||"",org:t,email:e.email,emailVerified:!0,clientId:r,role:e.role||"",image:e.image}}function pk(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function mk(){return Pt(e=>e.auth)}function hk(){const{t:e}=an(),r=bn(),n=mk(),a=xn(),{serverUrl:s,orgId:i,auth:o}=a,{resetCurrentWorkspace:c,currentWorkspace:l}=Pa(),u=t.useMemo(()=>new Da({serverUrl:s,version:a.version}),[s,a.version]),d=t.useCallback(async()=>{r.auth(Ue());try{const t=await u.requestAuth({orgId:i,clientId:o?.clientId??"",redirect:{success:o?.redirectUrl||window.location.href,error:o?.redirectUrl||window.location.href}});if(!t.success)throw r.auth(Le()),new Error(t.message||e("errors.generic"));Ia(t.data.redirectUrl)}catch(e){throw r.auth(Le()),Re(e,{component:"useSaaSAuth",action:"signIn"}),e}},[u,i,o,r]),p=t.useCallback(async()=>{try{o?.callbacks?.onSignOut&&"function"==typeof o.callbacks.onSignOut&&await o.callbacks.onSignOut()}catch(e){Re(e,{component:"useSaaSAuth",action:"signOut"})}finally{cn(ln),r.auth(ze()),c()}},[r,c,o?.callbacks?.onSignOut]),m=t.useCallback(e=>{l?uk.openWorkspaceSettings(e):Re(new Error("Cannot open settings: No current workspace"),{component:"useSaaSAuth",action:"openWorkspaceSettings"})},[l]),h=t.useMemo(()=>Ve(n.status),[n.status]);return t.useMemo(()=>({user:n.session?.user,session:n.session,status:n.status,...h,signIn:d,signOut:p,openWorkspaceSettings:m}),[n.session,n.status,h,d,p,m])}class fk extends fn{constructor(e){super({...e,requireOrgId:!0})}async getVapidPublicKey(){return this.fetchJson("push/vapid-public-key")}async subscribe(e,t){await this.fetchJson("push/subscribe",{method:"POST",body:JSON.stringify({endpoint:e.endpoint,keys:e.keys,userAgent:t})})}async unsubscribe(e){await this.fetchJson("push/unsubscribe",{method:"DELETE",body:JSON.stringify({endpoint:e})})}}const gk=t.createContext(null);function bk(e){const t=(e+"=".repeat((4-e.length%4)%4)).replace(/-/g,"+").replace(/_/g,"/"),r=atob(t),n=new Uint8Array(r.length);for(let e=0;e<r.length;e++)n[e]=r.charCodeAt(e);return n}const vk=t.memo(function({children:r,serviceWorkerPath:n="/push-sw.js",autoSubscribe:a=!1}){const{t:s}=an(),i=xn(),{isAuthenticated:o}=hk(),c=t.useMemo(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=t.useMemo(()=>new fk({serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}),[i.serverUrl,i.version,i.orgId]),[u,d]=t.useState({permission:c?Notification.permission:"default",isSubscribed:!1,isSupported:c,loading:!1,error:null});t.useEffect(()=>{if(!o||!c)return;let e=!1;return(async()=>{try{const t=await navigator.serviceWorker.getRegistration(n);if(e)return;if(!t)return void d(e=>({...e,isSubscribed:!1}));const r=await t.pushManager.getSubscription();if(e)return;d(e=>({...e,isSubscribed:!!r,permission:Notification.permission}))}catch{e||d(e=>({...e,isSubscribed:!1}))}})(),()=>{e=!0}},[o,c,n]);const p=t.useCallback(async()=>{if(!c)return!1;const e=await Notification.requestPermission();return d(t=>({...t,permission:e})),"granted"===e},[c]),m=t.useCallback(async()=>{if(c&&o){d(e=>({...e,loading:!0,error:null}));try{if(!await p())return void d(e=>({...e,loading:!1,error:s("notifications.permissionDenied")}));const{publicKey:e}=await l.getVapidPublicKey(),t=await navigator.serviceWorker.register(n);await navigator.serviceWorker.ready;const r=(await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:bk(e)})).toJSON();await l.subscribe({endpoint:r.endpoint,keys:{p256dh:r.keys.p256dh,auth:r.keys.auth}},navigator.userAgent),d(e=>({...e,isSubscribed:!0,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToSubscribe");d(e=>({...e,loading:!1,error:t})),Re(e,{component:"PushNotificationProvider",action:"subscribe"})}}},[c,o,l,n,p]),h=t.useCallback(async()=>{if(c){d(e=>({...e,loading:!0,error:null}));try{const e=await navigator.serviceWorker.getRegistration(n);if(e){const t=await e.pushManager.getSubscription();if(t){const e=t.endpoint;await t.unsubscribe(),await l.unsubscribe(e)}}d(e=>({...e,isSubscribed:!1,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToUnsubscribe");d(e=>({...e,loading:!1,error:t})),Re(e,{component:"PushNotificationProvider",action:"unsubscribe"})}}},[c,l,n]),f=t.useMemo(()=>({...u,requestPermission:p,subscribe:m,unsubscribe:h}),[u,p,m,h]);return e.jsx(gk.Provider,{value:f,children:r})});function yk(){const e=t.useContext(gk);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}let xk=!1,wk=null;const Sk=t.memo(({children:r,callbacks:n})=>{const a=bn(),s=mk(),i=xn(),o=Ve(s.status).isAuthenticated,c=t.useRef(!1),l=t.useRef(null);t.useEffect(()=>{o||(xk=!1,wk=null)},[]);const u=t.useCallback(async e=>{try{if(n?.handleAuthentication){const{sessionId:t}=await n.handleAuthentication(e);if(!t||"string"!=typeof t||""===t.trim())throw new Error("Invalid sessionId received from authentication callback");const r=i;if(!rt(r))throw new Error("OS configuration is not available");const{serverUrl:s,version:o,orgId:c}=r,l=new Da({serverUrl:s,version:o}),u=await l.getProfile(t),d=pk(dk(u,c,r.auth?.clientId||""),t);dn(d.sessionId),a.auth(Oe(d)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(un),window.history.replaceState({},"",e.toString())}catch(e){Re(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:un}})}}()}}catch(t){throw Re(t,{component:"AuthProviderWrapper",action:"handleAuthRedirect",metadata:{hasCode:!!e}}),a.auth(Le()),t}},[a,n,i]);return t.useEffect(()=>{if("undefined"==typeof window)return;if(o)return;if(xk)return;if(wk)return;if(!rt(i))return;if(mn())return;if(!n?.getSession)return xk=!0,void a.auth(Le());const e=n.getSession,{serverUrl:t,version:r,orgId:s}=i,c=i.auth?.clientId||"";wk=(async()=>{let i=null;try{i=await e()}catch(e){Re(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!i)return xk=!0,a.auth(Le()),void n?.onSessionExpired?.("missing");try{const e=new Da({serverUrl:t,version:r}),n=await e.getProfile(i),o=pk(dk(n,s,c),i);dn(o.sessionId),xk=!0,a.auth(Oe(o))}catch(e){Re(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),xk=!0,a.auth(Le()),n?.onSessionExpired?.("expired")}finally{wk=null}})()},[o,a,i,n]),t.useEffect(()=>{const e=mn();if(!e)return;if(c.current||l.current===e)return;if(!rt(i))return;c.current=!0,l.current=e;let t=!1;return a.auth(Me()),u(e).then(()=>{t||(l.current=null)}).catch(e=>{t||(Re(e,{component:"AuthProviderWrapper",action:"handleAuthRedirectEffect",metadata:{hasCode:!0}}),l.current=null)}).finally(()=>{c.current=!1}),()=>{t=!0}},[u,i.serverUrl,i.version,i.orgId]),e.jsx(e.Fragment,{children:r})});Sk.displayName="AuthProviderWrapper";const kk=t.memo(({config:r,auth:n,children:a})=>{const s=bn(),i=xn(),o=t.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||"",callbacks:n?.callbacks}),[n?.clientId,n?.redirectUrl,n?.callbacks]);t.useEffect(()=>{s.os(Qe({...r,auth:o}))},[r,o,s]);const c=t.useMemo(()=>rt(i)?new yn(i):null,[i.serverUrl,i.version,i.orgId]);return vn(async e=>{if(!c||i.settings)return;const t=await c.getSettings(e);s.os(et(t))},[c,i.settings,s],{onError:e=>Re(e,{component:"ContextConfigProvider",action:"fetchSettings",metadata:{serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}})}),e.jsx(e.Fragment,{children:a})});kk.displayName="ContextConfigProvider";class Ek extends fn{constructor(e){super(e)}async getAttributes(e){const t=await this.fetchResponse("users/attributes",{signal:e});if(!t.ok)throw new Error(await Ae(t,"Failed to fetch user attributes"));const r=await t.json();return r&&"object"==typeof r&&!Array.isArray(r)?r:{}}async updateAttributes(e){return this.fetchJson("users/attributes",{method:"PATCH",body:JSON.stringify({attributes:e})},"Failed to update user attributes")}async updateAttribute(e,t){return this.fetchJson(`users/attributes/${e}`,{method:"PATCH",body:JSON.stringify({value:t})},"Failed to update user attribute")}async getFeatures(e){const t=await this.fetchResponse("users/features",{signal:e});if(!t.ok)throw new Error(await Ae(t,"Failed to fetch user features"));const r=await t.json();return"object"==typeof r&&null!==r?r:{}}}const Ck=t.createContext(void 0),Nk=t.memo(({children:r})=>{const{t:n}=an(),a=xn(),s=function(){const e=xn();return t.useMemo(()=>new Ek(e),[e.serverUrl,e.version])}(),{isAuthenticated:i}=hk(),{serverUrl:o,version:c}=a,[l,u]=t.useState({}),[d,p]=t.useState({}),[m,h]=t.useState(!1),[f,g]=t.useState(null),b=t.useCallback(async e=>{if(o&&c&&i)try{const t=await s.getAttributes(e);u(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Re(e,{component:"UserProvider",action:"fetchAttributes"})}else u({})},[s,o,c,i]),v=t.useCallback(async()=>{if(o&&c&&i){h(!0),g(null);try{await b()}finally{h(!1)}}},[o,c,i,b]),y=t.useCallback(async e=>{h(!0),g(null);try{const t=await s.updateAttributes(e);return await b(),t}catch(t){const r=t instanceof Error?t:new Error(n("errors.generic"));throw g(r),Re(t,{component:"UserProvider",action:"updateAttributes",metadata:{updates:e}}),t}finally{h(!1)}},[s,b]),x=t.useCallback(async(e,t)=>{h(!0),g(null);try{const r=await s.updateAttribute(e,t);return await b(),r}catch(r){const a=r instanceof Error?r:new Error(n("errors.generic"));throw g(a),Re(r,{component:"UserProvider",action:"updateAttribute",metadata:{attributeKey:e,value:t}}),r}finally{h(!1)}},[s,b]),w=t.useCallback(async e=>{if(o&&c&&i)try{const t=await s.getFeatures(e);p(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Re(e,{component:"UserProvider",action:"fetchFeatures"})}else p({})},[s,o,c,i]),S=t.useCallback(async()=>{if(o&&c&&i){h(!0),g(null);try{await w()}finally{h(!1)}}},[o,c,i,w]);vn(async e=>{if(!i||!o||!c)return u({}),void p({});h(!0),g(null);try{await Promise.all([b(e),w(e)])}finally{h(!1)}},[i,o,c,b,w],{onError:e=>Re(e,{component:"UserProvider",action:"initialFetch",metadata:{step:"fetchAttributesAndFeatures"}})});const k=t.useMemo(()=>({attributes:l,features:d,isLoading:m,error:f,updateAttributes:y,updateAttribute:x,refreshAttributes:v,refreshFeatures:S}),[l,d,m,f,y,x,v,S]);return e.jsx(Ck.Provider,{value:k,children:r})});Nk.displayName="UserProvider";const Ak=t.lazy(()=>Promise.resolve().then(function(){return lk}).then(e=>({default:e.default})));const jk=({children:r})=>{const{currentWorkspace:n,switchToWorkspace:a,workspaces:s}=Pa(),[i,o]=t.useState(!1),[c,l]=t.useState(sk.Profile),u=t.useRef(!1);return t.useEffect(()=>{const e=uk.getState();o(e.open),l(e.section);return uk.subscribe((e,t)=>{o(e),l(t)})},[]),t.useEffect(()=>{if(u.current)return;if(!n)return;const e=gw();if(!e)return;const t=function(e){if(e.screen&&ik.has(e.screen))return e.screen;switch(e.action){case"checkout":case"billing":return sk.Subscription;default:return null}}(e);if(!t)return u.current=!0,void bw();const r=e.ws;if(r&&r!==n._id){const e=s.find(e=>e._id===r);return e?void a(e).catch(()=>{u.current=!0,bw()}):(u.current=!0,void bw())}u.current=!0,uk.openWorkspaceSettings(t),bw()},[n,s,a]),e.jsxs(e.Fragment,{children:[r,n&&i&&e.jsx(t.Suspense,{fallback:null,children:e.jsx(Ak,{workspace:n,open:i,onOpenChange:e=>{e||uk.closeSettings()},section:c,onSectionChange:e=>{uk.setSection(e)},showTrigger:!1})})]})},Pk=(e,t,r)=>{if(t!==tt.V1)throw new Error(`Invalid version: "${t}". Only "${tt.V1}" is currently supported.`);if(!e||"string"!=typeof e)throw new Error("serverUrl is required and must be a string");if(!(e=>{try{return new URL(e),!0}catch{return!1}})(e))throw new Error(`Invalid serverUrl: "${e}". Must be a valid URL.`);if(!r||"string"!=typeof r)throw new Error("orgId is required and must be a string");if(!/^[0-9a-fA-F]{24}$/.test(r))throw new Error(`Invalid orgId: "${r}". Must be a valid MongoDB ObjectId (24 hexadecimal characters).`)},Tk=t.memo(({serverUrl:r,version:n,orgId:a,auth:s,locale:i,children:o})=>{Pk(r,n,a);const c=t.useMemo(()=>({serverUrl:r,version:n,orgId:a}),[r,n,a]),l=t.useMemo(()=>s?.callbacks,[s?.callbacks?.handleAuthentication,s?.callbacks?.onSignOut,s?.callbacks?.handleEvent,s?.callbacks?.onWorkspaceChange]),u=s?.callbacks?.handleEvent;return t.useEffect(()=>(wa.setCallbacks(u?{handleEvent:u}:null),()=>{wa.setCallbacks(null)}),[u]),e.jsx(Yr,{locale:i,children:e.jsx(jt,{children:e.jsx(Sk,{callbacks:l,children:e.jsx(lc,{children:e.jsx(kk,{config:c,auth:s,children:e.jsx(Nk,{children:e.jsx(On,{children:e.jsx(_a,{children:e.jsx(vk,{children:e.jsx(jk,{children:o})})})})})})})})})})});Tk.displayName="SaaSOSProviderInner";const _k=({children:t,...r})=>e.jsx(Ie,{children:e.jsx(Tk,{...r,children:t})});_k.displayName="SaaSOSProvider";const Rk=e=>{const{children:t}=e,{status:r}=hk();return r!==We.authenticated?null:t},Dk=e=>{const{children:t}=e,{status:r}=hk();return r!==We.unauthenticated?null:t};Rk.displayName="WhenAuthenticated",Dk.displayName="WhenUnauthenticated";const Ik=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=hk();return n.includes(a?.role??"")?t:r||null},Uk=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=hk(),{currentWorkspace:s}=Pa(),i=s?.users.find(e=>e._id===a?.id);return i&&n.includes(i?.role??"")?t:r||null};function Mk(){const e=t.useContext(Ck);if(void 0===e)throw new Error("useUserFeatures must be used within a UserProvider");return{features:e.features,isLoading:e.isLoading,error:e.error,refreshFeatures:e.refreshFeatures,isFeatureEnabled:t=>Boolean(e.features[t])}}Ik.displayName="WhenRoles",Uk.displayName="WhenWorkspaceRoles";const Lk=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=Pa(),a=n?.features?.[r];return a?t:null},Ok=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=Pa(),a=n?.features?.[r];return a?null:t},zk=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=Mk();return n(r)?t:null},Fk=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=Mk();return n(r)?null:t};Lk.displayName="WhenWorkspaceFeatureEnabled",Ok.displayName="WhenWorkspaceFeatureDisabled",zk.displayName="WhenUserFeatureEnabled",Fk.displayName="WhenUserFeatureDisabled";const Bk=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?t:n??null},Wk=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?n??null:t},Vk=e=>{const{children:t,plans:r,loadingComponent:n,fallbackComponent:a}=e,{response:s,loading:i}=zn();if(i)return n??null;if(!s?.subscription)return a??null;const o=s.plan??s.subscription?.plan;if(!o)return a??null;const c=r.map(e=>e.trim().toLowerCase()),l=(o.slug??"").toLowerCase();return c.includes(l)?t:a??null},Hk=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:"trialing"!==a?.subscription?.subscriptionStatus?n??null:t},Gk=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=zn();return s?r??null:a?.subscription?.subscriptionStatus===Wn?n??null:t},$k=e=>{const{children:t,loadingComponent:r,fallbackComponent:n,daysThreshold:a=3}=e,{response:s,loading:i}=zn();if(i)return r??null;const o=s?.subscription;if(!o||"trialing"!==o.subscriptionStatus)return n??null;const c=o.trialEnd||o.stripeCurrentPeriodEnd;if(!c)return n??null;const l=new Date(c);if(isNaN(l.getTime()))return n??null;return Math.max(0,Math.ceil((l.getTime()-Date.now())/864e5))>a?n??null:t};Bk.displayName="WhenSubscription",Wk.displayName="WhenNoSubscription",Vk.displayName="WhenSubscriptionToPlans",Hk.displayName="WhenTrialing",Gk.displayName="WhenNotTrialing",$k.displayName="WhenTrialEnding";const Kk=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ra();if(i)return n??null;const o=s?.[t];return o?o.available<=0?a??null:r:a??null},qk=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ra();if(i)return n??null;const o=s?.[t];return o?o.available>0?a??null:r:a??null},Zk=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=Ra();if(i)return n??null;const o=s?.[t];return o&&o.hasOverage?r:a??null},Jk=e=>{const{slug:t,threshold:r,children:n,loadingComponent:a,fallbackComponent:s}=e,{quotas:i,loading:o}=Ra();if(o)return a??null;const c=i?.[t];if(!c)return s??null;return(c.included>0?c.consumed/c.included*100:c.consumed>0?100:0)<r?s??null:n};function Yk(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}function Xk(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}Kk.displayName="WhenQuotaAvailable",qk.displayName="WhenQuotaExhausted",Zk.displayName="WhenQuotaOverage",Jk.displayName="WhenQuotaThreshold";var Qk,eE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=xs(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),tE={exports:{}},rE={};function nE(){if(Qk)return rE;Qk=1;var e=t;var r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,a=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function o(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var r=t(),c=n({inst:{value:r,getSnapshot:t}}),l=c[0].inst,u=c[1];return s(function(){l.value=r,l.getSnapshot=t,o(l)&&u({inst:l})},[e,r,t]),a(function(){return o(l)&&u({inst:l}),e(function(){o(l)&&u({inst:l})})},[e]),i(r),r};return rE.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,rE}var aE,sE,iE={};
28
+ /**
29
+ * @license React
30
+ * use-sync-external-store-shim.development.js
31
+ *
32
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
33
+ *
34
+ * This source code is licensed under the MIT license found in the
35
+ * LICENSE file in the root directory of this source tree.
36
+ */function oE(){return aE||(aE=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,s=r.useEffect,i=r.useLayoutEffect,o=r.useDebugValue,c=!1,l=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){c||void 0===r.startTransition||(c=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var d=u();if(!l){var p=u();n(d,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var m=(p=a({inst:{value:d,getSnapshot:u}}))[0].inst,h=p[1];return i(function(){m.value=d,m.getSnapshot=u,e(m)&&h({inst:m})},[t,d,u]),s(function(){return e(m)&&h({inst:m}),t(function(){e(m)&&h({inst:m})})},[t]),o(d),d};iE.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),iE}function cE(){return sE||(sE=1,"production"===process.env.NODE_ENV?tE.exports=nE():tE.exports=oE()),tE.exports}var lE=cE();function uE(){return()=>{}}var dE="Avatar",[pE]=function(t,r=[]){let n=[];const s=()=>{const e=n.map(e=>a.createContext(e));return function(r){const n=r?.[t]||e;return a.useMemo(()=>({[`__scope${t}`]:{...r,[t]:n}}),[r,n])}};return s.scopeName=t,[function(r,s){const i=a.createContext(s);i.displayName=r+"Context";const o=n.length;n=[...n,s];const c=r=>{const{scope:n,children:s,...c}=r,l=n?.[t]?.[o]||i,u=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:u,children:s})};return c.displayName=r+"Provider",[c,function(e,n){const c=n?.[t]?.[o]||i,l=a.useContext(c);if(l)return l;if(void 0!==s)return s;throw new Error(`\`${e}\` must be used within \`${r}\``)}]},Xk(s,...r)]}(dE),[mE,hE]=pE(dE),fE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,...s}=t,[i,o]=a.useState("idle");return e.jsx(mE,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:e.jsx(eE.span,{...s,ref:r})})});fE.displayName=dE;var gE="AvatarImage",bE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:i=()=>{},...o}=t,c=hE(gE,n),l=function(e,{referrerPolicy:t,crossOrigin:r}){const n=lE.useSyncExternalStore(uE,()=>!0,()=>!1),s=a.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,c]=a.useState(()=>xE(i,e));return Ds(()=>{c(xE(i,e))},[i,e]),Ds(()=>{const e=e=>()=>{c(e)};if(!i)return;const n=e("loaded"),a=e("error");return i.addEventListener("load",n),i.addEventListener("error",a),t&&(i.referrerPolicy=t),"string"==typeof r&&(i.crossOrigin=r),()=>{i.removeEventListener("load",n),i.removeEventListener("error",a)}},[i,r,t]),o}(s,o),u=Vs(e=>{i(e),c.onImageLoadingStatusChange(e)});return Ds(()=>{"idle"!==l&&u(l)},[l,u]),"loaded"===l?e.jsx(eE.img,{...o,ref:r,src:s}):null});bE.displayName=gE;var vE="AvatarFallback",yE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:s,...i}=t,o=hE(vE,n),[c,l]=a.useState(void 0===s);return a.useEffect(()=>{if(void 0!==s){const e=window.setTimeout(()=>l(!0),s);return()=>window.clearTimeout(e)}},[s]),c&&"loaded"!==o.imageLoadingStatus?e.jsx(eE.span,{...i,ref:r}):null});function xE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}yE.displayName=vE;var wE=fE,SE=bE,kE=yE;const EE=a.forwardRef(({className:t,...r},n)=>e.jsx(wE,{ref:n,className:Se("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));EE.displayName=wE.displayName;const CE=a.forwardRef(({className:t,...r},n)=>e.jsx(SE,{ref:n,className:Se("aspect-square h-full w-full",t),...r}));CE.displayName=SE.displayName;const NE=a.forwardRef(({className:t,...r},n)=>e.jsx(kE,{ref:n,className:Se("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));NE.displayName=kE.displayName;var AE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=xs(`Primitive.${r}`),s=a.forwardRef((t,a)=>{const{asChild:s,...i}=t,o=s?n:r;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),e.jsx(o,{...i,ref:a})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{}),jE="horizontal",PE=["horizontal","vertical"],TE=a.forwardRef((t,r)=>{const{decorative:n,orientation:a=jE,...s}=t,i=function(e){return PE.includes(e)}(a)?a:jE,o=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e.jsx(AE.div,{"data-orientation":i,...o,...s,ref:r})});TE.displayName="Separator";var _E=TE;const RE=a.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},s)=>e.jsx(_E,{ref:s,decorative:n,orientation:r,className:Se("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",t),...a}));function DE(t){const{t:r}=an(),{workspace:n,setCurrentWorkspace:a,setOpen:s,workspacesToUse:i,switchingToId:o}=t,c=t.isCurrentWorkspace??!1,l=o===n._id,u=n.subscription??null,d=null!=u&&"object"==typeof u?u.plan??null:null,p=d?.name??"";return e.jsxs("div",{className:Se("flex items-center gap-3 rounded-lg border-2 p-3 border-border",{"bg-muted text-muted-foreground":c}),children:[e.jsxs(EE,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(CE,{src:n.image&&n.image.trim()?n.image:void 0})}),e.jsx(NE,{children:(m=n.name,m.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2))})]}),e.jsxs("div",{className:"flex-1 min-w-0 max-w-full",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx("span",{className:"font-medium line-clamp-1 text-ellipsis overflow-hidden max-w-full",children:n.name})}),e.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[e.jsx(ms,{className:"h-3 w-3"}),e.jsx("span",{children:r("workspace.membersCount",{count:n.users?.length||0})})]}),p&&e.jsx("div",{className:"max-w-fit",children:e.jsx("div",{className:"flex items-center gap-1 text-sm text-muted-foreground bg-green-500 text-white rounded-full px-2 py-0.5",children:e.jsx("span",{className:"text-xs",children:p})})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c?null:e.jsx(Ps,{size:"sm",disabled:null!==o||l,progress:l,onClick:()=>{t.switchToWorkspace(n).then(()=>s(!1)).catch(e=>{Re(e,{component:"WorkspaceItem",action:"switchToWorkspace",metadata:{workspaceId:n._id}})})},children:r("workspace.switchTo")}),e.jsx(ck,{workspace:n,onClose:()=>{if(c){const e=i.findIndex(e=>e._id?.toString()===n._id?.toString());-1!==e&&a(i[e])}}})]})]});var m}function IE(r){const{t:n,dir:a}=an(),{switching:s}=Pa(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[u,d]=t.useState("🏢"),[p,m]=t.useState(!1),{createWorkspace:h}=Pa(),f=Gu({resolver:Qm(Yh({name:Eh().min(2,{message:n("workspace.workspaceNameMinLength")}),image:Eh().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(uc,{open:i,onOpenChange:o,children:[e.jsx(dc,{asChild:!0,children:e.jsxs(Ps,{className:"w-full rounded-none",disabled:s,children:[e.jsx(ts,{className:"h-4 w-4 me-2"}),n("workspace.createNew")]})}),e.jsxs(hc,{dir:a,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(fc,{children:[e.jsx(gc,{children:n("workspace.createTitle")}),e.jsx(bc,{children:n("workspace.createDescription")})]}),e.jsx(Cf,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===c)t=vb(u);else if("url"===c&&e.image)try{new URL(e.image),t=e.image}catch{return void f.setError("image",{message:n("workspace.invalidUrl")})}m(!0);try{await h(e.name,t),o(!1),f.reset(),d("🏢"),l("emoji"),r?.onCreated?.()}catch(t){Re(t,{component:"WorkspaceProvider",action:"createWorkspace",metadata:{name:e.name}})}finally{m(!1)}}),children:[e.jsx(Af,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Tf,{children:[e.jsx(_f,{children:n("workspace.workspaceName")}),e.jsx(Rf,{children:e.jsx(Uf,{placeholder:n("workspace.workspaceNamePlaceholder"),...t})}),e.jsx(If,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(Ef,{className:"text-sm font-medium",children:n("workspace.workspaceIcon")}),e.jsx(Df,{children:n("workspace.iconDescription")})]}),e.jsxs(_g,{value:c,onValueChange:e=>l(e),className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Rg,{value:"emoji",id:"emoji"}),e.jsxs(Ef,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(os,{className:"h-4 w-4"}),n("workspace.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Rg,{value:"url",id:"url"}),e.jsxs(Ef,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Qa,{className:"h-4 w-4"}),n("workspace.customImageUrl")]})]})]}),"emoji"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border flex items-center justify-center text-2xl bg-muted",children:u})]}),e.jsx(gb,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:yb.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{d(e),f.setValue("image",vb(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(u===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(Af,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Tf,{children:[e.jsx(_f,{children:n("workspace.imageUrl")}),e.jsx(Rf,{children:e.jsx(Uf,{placeholder:n("workspace.imageUrlPlaceholder"),...t})}),e.jsx(Df,{children:n("workspace.imageUrlDescription")}),e.jsx(If,{})]})}),f.watch("image")&&f.watch("image")?.trim()&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm font-medium",children:n("general.previewLabel")}),e.jsx("div",{className:"w-12 h-12 rounded-lg border-2 border-border overflow-hidden bg-muted",children:e.jsx("img",{src:f.watch("image")||void 0,alt:"Workspace preview",className:"w-full h-full object-cover",onError:e=>{e.currentTarget.style.display="none"}})})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3 pt-4",children:[e.jsx(Ps,{type:"button",variant:"outline",onClick:()=>{o(!1),f.reset(),d("🏢"),l("emoji")},disabled:p,children:n("settings.common.cancel")}),e.jsx(Ps,{type:"submit",disabled:p,children:p?e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"me-2 h-4 w-4 animate-spin"}),n("workspace.creating")]}):n("workspace.createWorkspace")})]})]})})]})]})}RE.displayName=_E.displayName;class UE extends fn{constructor(e){super({...e,basePath:"beta",requireOrgId:!0})}getAuthHeaders(){return{}}async fetchConfig(){return this.fetchJson(`config?orgId=${encodeURIComponent(this.orgId)}`,{},"Failed to fetch beta form configuration")}async submitBetaUser(e){return this.fetchJson("submit",{method:"POST",body:JSON.stringify(e)},"Failed to submit beta user request")}}let ME=class{constructor(e){this.api=new UE(e),this.orgId=e.orgId}async fetchConfig(){return this.api.fetchConfig()}async submitBetaUser(e){const t=e?.context??{},r=t?.country??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[1]:void 0),n=t?.language??("undefined"!=typeof navigator&&navigator.language?navigator.language.split("-")[0]:void 0),a=t?.timezone??("undefined"!=typeof Intl&&Intl.DateTimeFormat?Intl.DateTimeFormat().resolvedOptions().timeZone:void 0),s=t?.currency??("undefined"!=typeof Intl&&Intl.NumberFormat&&Intl.NumberFormat().resolvedOptions().currency?Intl.NumberFormat().resolvedOptions().currency:void 0);return this.api.submitBetaUser({orgId:this.orgId,formData:{...e,country:r,language:n,timezone:a,currency:s}})}};const LE=Yh({name:Eh().min(1,"Please enter your name").max(50,"Name must be less than 50 characters").regex(/^[\p{L}\p{M}\s'-]*$/u,"Name can only contain letters and spaces"),email:Eh().min(1,"Please enter your email address").email("Please enter a valid email address").max(100,"Email must be less than 100 characters").regex(/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/,"Please enter a valid email format (e.g., name@domain.com)")});function OE({screen:t}){return e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsx("p",{className:"text-2xl font-bold",children:t?.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t?.description})]})}function zE({logo:t}){return"string"==typeof t?e.jsx("img",{src:t,alt:"Logo",className:"max-h-24"}):e.jsx("img",{src:t.bucket?.url,alt:"Logo",className:"max-h-24"})}var FE=Object.freeze({__proto__:null,es:{settings:{titles:{profile:"Cuenta",general:"Configuración del espacio de trabajo",users:"Miembros del espacio de trabajo",subscription:"Plan y facturación",usage:"Uso",features:"Funciones del espacio de trabajo",notifications:"Notificaciones",danger:"Zona de peligro"},sidebar:{account:"Cuenta",workspace:"Espacio de trabajo",profile:"Cuenta",general:"Configuración",users:"Miembros",subscription:"Plan y facturación",usage:"Uso",features:"Funciones",notifications:"Notificaciones",danger:"Zona de peligro"},common:{refresh:"Actualizar",refreshing:"Actualizando...",retry:"Reintentar",retrying:"Reintentando...",save:"Guardar",saving:"Guardando...",cancel:"Cancelar",delete:"Eliminar",dismiss:"Descartar",loading:"Cargando...",success:"¡Éxito!",error:"Error",refreshAction:"{loading, select, true {Actualizando...} other {Actualizar}}",retryAction:"{loading, select, true {Reintentando...} other {Reintentar}}"}},subscription:{managePlan:"Administra tu plan y facturación",changePlan:"Cambiar plan",viewPricingPlans:"Ver planes de precios",viewPlans:"Ver planes",upgradePlan:"Mejorar ahora",subscribe:"Suscribirse",currentPlan:"Plan actual",noSubscription:"No tienes una suscripción activa",choosePlan:"Elige tu plan",choosePlanDescription:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",planUpdateAvailable:"Actualización de plan disponible",updateSuccess:"¡Suscripción actualizada correctamente!",updateFailed:"Error en la actualización",cancelTitle:"Cancelar suscripción",cancelConfirm:"¿Estás seguro de que deseas cancelar tu suscripción?",cancelKeep:"Mantener suscripción",cancelButton:"Sí, cancelar suscripción",canceling:"Cancelando...",cancelSuccess:"La suscripción se cancelará al final del período de facturación.",cancelNotCharged:"No se te cobrará de nuevo después de la cancelación",cancelResumeAnytime:"Puedes reanudar tu suscripción en cualquier momento antes de que termine",resumeTitle:"Reanudar suscripción",resumeConfirm:"¿Estás seguro de que deseas reanudar tu suscripción?",resumeKeep:"Mantener cancelada",resumeButton:"Sí, reanudar suscripción",resuming:"Reanudando...",resumeSuccess:"La suscripción ha sido reanudada.",managePayment:"Administrar pago",openingPortal:"Abriendo...",viewAllPlans:"Ver todos los planes",scheduledCancellation:"Cancelación de suscripción programada",paymentPastDue:"Pago vencido",paymentPastDueDescription:"Por favor, actualiza tu método de pago para evitar la interrupción del servicio.",subscriptionPaused:"Suscripción pausada",subscriptionPausedDescription:"Tu suscripción está actualmente pausada. Reanúdala para restaurar el acceso completo.",errorLoading:"Error al cargar los datos de la suscripción",errorLoadingDescription:"Por favor, verifica tu conexión e inténtalo de nuevo.",errorProcessing:"Error al procesar la suscripción",errorCanceling:"Error al cancelar la suscripción",errorResuming:"Error al reanudar la suscripción",invalidWorkspace:"ID de espacio de trabajo no válido",billingInterval:{monthly:"Mensual",quarterly:"Trimestral",yearly:"Anual",perMonth:"/mes",perQuarter:"/trimestre",perYear:"/año"},seats:{title:"Puestos",members:"Miembros",included:"Incluidos",billable:"Facturables",perExtraSeat:"Por puesto adicional",limit:"Límite",includedSeats:"Puestos incluidos",maxSeats:"Máx. puestos",freeWithBase:"Gratis con el precio base",allIncluded:"Todos incluidos",extra:"adicional",unlimited:"Ilimitado"},items:{features:"Funciones",limits:"Límites",quotas:"Cuotas de uso"},checkout:{upgrade:"Mejorar",downgrade:"Reducir",switchTo:"Cambiar a",select:"Seleccionar"},status:{active:"Activa",canceling:"Cancelando",trial:"Prueba",canceled:"Cancelada",pastDue:"Vencida",paused:"Pausada",deprecated:"Obsoleta",unknown:"Desconocida"},plan:"Plan",invoicesTab:"Facturas",changePlanButton:"Cambiar plan",noPlanAssigned:"Sin plan asignado",free:"Gratis",perSeatDisplay:"+ {price}/puesto{interval}",estTotalDisplay:"Total est.: {total}{interval} ({count, plural, one {# puesto adicional} other {# puestos adicionales}})",nextBillingDisplay:"Próxima facturación: {date}",membersInWorkspace:"{count, plural, one {# miembro} other {# miembros}} en el espacio de trabajo",billingInCurrency:"Facturación en {currency}",savingsPercent:"Ahorra {percent, number}%",switchToInterval:"Cambiar a {interval}",seatPriceDisplay:"+ {price}/puesto{interval} ({included} {includedLabel})",trialEnded:"Tu período de prueba ha terminado.",trialEndsIn:"Tu período de prueba termina en {days, plural, one {# día} other {# días}}.",onTrial:"Estás en un período de prueba.",upgradeToKeepAccess:"Mejora tu plan para mantener el acceso.",viewInvoices:"Ver facturas",cancelTrial:"Cancelar prueba",dunningFinal:"Última advertencia: La suscripción será suspendida",dunningSuspended:"Suscripción suspendida",dunningRecovery:"Recuperación de pago en curso",dunningSuspendedDescription:"Tu suscripción ha sido suspendida debido a fallos de pago repetidos. Actualiza tu método de pago para restaurar el acceso.",dunningRecoveryDescription:"No pudimos procesar tu pago. Por favor, actualiza tu método de pago para no perder el acceso.",cancelEndDescription:"Tu suscripción terminará el",cancelEndFallback:"Tu suscripción se cancelará al final del período de facturación actual. No se te cobrará de nuevo.",resumeChargeDate:"Se te cobrará de nuevo el",resumeChargeFallback:"la próxima fecha de facturación",resumeContinue:"Tu suscripción continuará automáticamente y se te facturará según tu plan",resumeCancelAnytime:"Puedes cancelar en cualquier momento antes de la próxima fecha de facturación si cambias de opinión",retainAccess:"Mantendrás acceso completo a este plan hasta",retainAccessFallback:"el final de tu período de facturación actual",noPlansAvailable:"No hay grupos de planes disponibles para este espacio de trabajo. Por favor, contacta a soporte si crees que esto es un error.",noPlansAvailableHint:"No hay grupos de planes disponibles para este espacio de trabajo.",startTrialDescription:"Prueba el plan completo sin compromiso. Puedes mejorar o cancelar en cualquier momento.",noSubscriptionDescription:"Elige un plan para comenzar con tu espacio de trabajo",startFreeTrial:"Comenzar prueba gratuita"},users:{title:"Miembros del espacio de trabajo",adminOnly:"Solo el administrador del espacio de trabajo puede gestionar usuarios y roles.",inviteByEmail:"Invitar miembro por correo electrónico",inviteButton:"Invitar",inviting:"Invitando...",inviteSuccess:"Usuario invitado correctamente",emailRequired:"El correo electrónico es obligatorio",invalidEmail:"Formato de dirección de correo electrónico no válido",inviteFailed:"Error al invitar al miembro",seatLimitReached:"Límite de puestos alcanzado",memberLimitReached:"Límite de miembros alcanzado",role:"Rol",you:"Tú",owner:"Propietario",noMembers:"No se encontraron miembros en este espacio de trabajo.",extraSeatCost:"Cada miembro adicional añade {price}/{interval, select, yearly {año} quarterly {trim.} other {mes}} a tu suscripción",unknownUser:"Usuario desconocido",seats:"Puestos",members:"Miembros",included:"incluidos",perExtraSeat:"/puesto adicional",maxMembers:"máx. miembros",available:"disponibles",noMemberLimit:"Sin límite de miembros",seatHeading:"{hasSeatPricing, select, true {Puestos} other {Miembros}}",limitReached:"{reason, select, seat_limit_reached {Límite de puestos alcanzado} other {Límite de miembros alcanzado}}",memberCount:"{count, plural, one {# miembro} other {# miembros}}",subscriptionRequired:"Se requiere una suscripción para invitar miembros.",seatLimitMessage:"Tu plan permite hasta {maxUsers, number} miembros. Mejora tu plan para más puestos.",settingsLimitMessage:"Este espacio de trabajo permite hasta {maxUsers, number} miembros.",memberLimitMessage:"Límite de miembros de {maxUsers, number} alcanzado.",selectRole:"Seleccionar un rol",inviteAs:"Invitar como {role}"},invoices:{title:"Historial de facturación",description:"Ver y descargar tus facturas",pay:"Pagar",view:"Ver",viewDetails:"Ver detalles",download:"PDF",errorLoading:"Error al cargar las facturas",noInvoices:"Aún no hay facturas. Suscríbete a un plan para recibir facturas.",noInvoicesWithSub:"No se encontraron facturas con opción de descarga",paidAmount:"Pagado: {amount}",na:"N/D",status:{draft:"Borrador",open:"Abierta",paid:"Pagada",uncollectible:"Incobrable",void:"Anulada"}},usage:{title:"Uso",description:"Monitorea tu consumo de recursos y cuotas",totalResources:"Total de recursos",overallUsage:"Uso general",inOverage:"En exceso",estOverageCost:"Costo est. por exceso",overageDetected:"Exceso detectado",overageDescription:"El uso adicional se facturará como exceso en tu próxima factura.",overageUnits:"Unidades en exceso",rate:"Tarifa",billableBlocks:"Bloques facturables",estimatedCharge:"Cargo estimado",noData:"No hay datos de uso de cuotas disponibles para este espacio de trabajo.",noDataHint:"Las cuotas aparecerán aquí una vez que tu plan incluya recursos medidos.",used:"usado",remaining:"restante",overLimit:"sobre el límite",percentUsed:"{percent, number}% usado",availableRemaining:"{count} restantes",overLimitCount:"{count} sobre el límite",overageWarning:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}} El uso adicional se facturará como exceso en tu próxima factura.",fullyUsed:"Completamente usado",renewingSoon:"se renueva pronto",almostFull:"Casi lleno",overage:"Exceso",errorLoading:"Error al cargar los datos de uso",perUnit:"/ unidad",perUnits:"/ unidades",rateDisplay:"{rate} {unitSize, plural, =1 {/ unidad} other {/ {unitSize, number} unidades}}",resourcesExceeded:"{count, plural, one {# recurso ha excedido la cuota incluida.} other {# recursos han excedido la cuota incluida.}}",estOverageCharges:"Cargos estimados por exceso este período: {amount}",overageRateDisplay:"Tarifa de exceso: {rate}",resetDateDisplay:"El uso se restablece el {date}",daysRemainingDisplay:"{count, plural, one {# día restante} other {# días restantes}}"},profile:{email:"Correo electrónico",name:"Nombre",language:"Idioma",country:"País",currency:"Moneda",timezone:"Zona horaria",profileImage:"Imagen de perfil",success:"Perfil guardado correctamente",nameMinLength:"El nombre debe tener al menos 2 caracteres.",save:"Guardar",reset:"Restablecer"},general:{ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar la configuración.",name:"Nombre",namePlaceholder:"Mi espacio de trabajo",nameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",billingCurrency:"Moneda de facturación",icon:"Icono",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",previewLabel:"Vista previa:",success:"Configuración del espacio de trabajo guardada correctamente",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",updateWorkspace:"Actualizar espacio de trabajo"},features:{title:"Funciones del espacio de trabajo",ownerOnly:"Solo el propietario del espacio de trabajo puede cambiar las funciones.",noFeatures:"El espacio de trabajo no tiene funciones para gestionar.",enabled:"habilitada",disabled:"deshabilitada",enabling:"Habilitando",disabling:"Deshabilitando",featureSuccess:"correctamente",updateSuccess:"{feature} {enabled, select, true {habilitada} other {deshabilitada}} correctamente",actionStatus:"{action, select, enabling {Habilitando} disabling {Deshabilitando} other {}}"},danger:{title:"Eliminar espacio de trabajo",adminOnly:"Solo los administradores pueden eliminar espacios de trabajo.",deleteWorkspace:"Eliminar espacio de trabajo",deleteConfirm:"¿Estás completamente seguro?",deleteWarning:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos los datos asociados.",deleting:"Eliminando...",deleteDescription:"Una vez que elimines un espacio de trabajo, no hay vuelta atrás. Esto eliminará permanentemente el espacio de trabajo y todos sus datos, incluidos miembros, configuración y funciones.",deleteConfirmDescription:"Esta acción no se puede deshacer. Esto eliminará permanentemente el espacio de trabajo y todos sus datos.",failedToDelete:"Error al eliminar el espacio de trabajo"},notifications:{title:"Preferencias de notificaciones",permissionDenied:"Permiso de notificaciones denegado",notSupported:"Las notificaciones push no son compatibles con este navegador.",manageDescription:"Administra cómo recibes notificaciones de este espacio de trabajo.",blocked:"Notificaciones bloqueadas",blockedDescription:"Previamente bloqueaste las notificaciones para este sitio. Para habilitarlas, actualiza la configuración de tu navegador:",pushTitle:"Notificaciones push",pushEnabledDescription:"Recibirás notificaciones del navegador para actualizaciones importantes.",pushDisabledDescription:"Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.",enabling:"Habilitando...",disabling:"Deshabilitando...",enable:"Habilitar",disable:"Deshabilitar",toggleAction:"{loading, select, true {{subscribed, select, true {Deshabilitando...} other {Habilitando...}}} other {{subscribed, select, true {Deshabilitar} other {Habilitar}}}}",pushDescription:"{subscribed, select, true {Recibirás notificaciones del navegador para actualizaciones importantes.} other {Recibe notificaciones sobre problemas de pago, expiración de prueba y otras actualizaciones importantes.}}",deviceNote:"Las notificaciones se envían a este dispositivo. Habilítalas en otros dispositivos por separado.",unblock:{firefox:{step1:"Haz clic en el icono del candado (o del escudo) en la barra de direcciones",step2:'Busca "Notificaciones" en la lista de permisos',step3:'Cambia de "Bloqueado" a "Permitir"',step4:"Recarga esta página"},safari:{step1:"Abre Safari → Configuración → Sitios web → Notificaciones",step2:"Busca este sitio web en la lista",step3:'Cambia de "Denegar" a "Permitir"',step4:"Recarga esta página"},edge:{step1:"Haz clic en el icono del candado en la barra de direcciones",step2:'Haz clic en "Permisos para este sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"},chrome:{step1:"Haz clic en el icono del candado (o del ajuste) en la barra de direcciones",step2:'Haz clic en "Configuración del sitio"',step3:'Configura "Notificaciones" como "Permitir"',step4:"Recarga esta página"}}},quota:{includedOnly:"{count, number} incluidos",includedWithOverage:"{count, number} incluidos, luego {price} / {unit}",unitFallback:"unidad"},pricing:{title:"Elige tu plan",description:"Compara los planes y selecciona el que mejor se adapte a tus necesidades",currency:"Moneda",billingIn:"Facturación en",noPlansCurrency:"No hay planes disponibles para tu moneda de facturación.",noPlansCurrencyHint:"Algo salió mal. Por favor, contacta a soporte.",noPlans:"No hay planes disponibles",free:"Gratis",included:"incluido",save:"Ahorra",current:"Actual",processing:"Procesando...",unavailable:"No disponible",selectCurrency:"Seleccionar moneda de facturación",billingInterval:"Intervalo de facturación"},beta:{nameLabel:"Nombre",emailLabel:"Correo electrónico",submitText:"Enviar",submittingText:"Enviando...",errorMessage:"Ocurrió un error",tryAgain:"Intentar de nuevo",privacyConsent:"Al enviar este formulario, aceptas nuestra",privacyPolicy:"Política de privacidad",and:"y",termsOfService:"Términos de servicio"},workspace:{switchTitle:"Cambiar espacio de trabajo",switchDescription:"Selecciona un espacio de trabajo o crea uno nuevo.",notLoggedIn:"Parece que no has iniciado sesión. Por favor, inicia sesión para continuar.",availableWorkspaces:"Espacios de trabajo disponibles ({count, number})",loadingWorkspaces:"Cargando espacios de trabajo...",searchPlaceholder:"Buscar espacios de trabajo...",noWorkspacesFound:"No se encontraron espacios de trabajo",noWorkspacesAvailable:"No hay espacios de trabajo disponibles",switchTo:"Cambiar a",membersCount:"{count, plural, one {# miembro} other {# miembros}}",createNew:"Crear nuevo espacio de trabajo",createTitle:"Crear nuevo espacio de trabajo",createDescription:"Crea un nuevo espacio de trabajo para comenzar.",workspaceName:"Nombre del espacio de trabajo",workspaceNamePlaceholder:"Mi espacio de trabajo",workspaceNameMinLength:"El nombre del espacio de trabajo debe tener al menos 2 caracteres.",workspaceIcon:"Icono del espacio de trabajo",iconDescription:"Elige un emoji o sube una imagen personalizada para tu espacio de trabajo.",chooseEmoji:"Elegir emoji",customImageUrl:"URL de imagen personalizada",imageUrl:"URL de imagen",imageUrlPlaceholder:"https://ejemplo.com/imagen.png",imageUrlDescription:"Introduce una URL válida para la imagen de tu espacio de trabajo. Compatible con formatos PNG, JPG y SVG.",invalidUrl:"Por favor, introduce una URL válida",creating:"Creando...",createWorkspace:"Crear espacio de trabajo"},dropdowns:{search:"Buscar...",chooseOption:"Elegir opción",chooseCountry:"Elegir país",searchCountry:"Elegir país...",chooseLanguage:"Elegir idioma",searchLanguage:"Elegir idioma...",chooseCurrency:"Elegir moneda",searchCurrency:"Elegir moneda...",chooseTimezone:"Elegir zona horaria",searchTimezone:"Elegir zona horaria..."},push:{failedToSubscribe:"Error al suscribirse a las notificaciones push",failedToUnsubscribe:"Error al cancelar la suscripción a las notificaciones push"},errors:{networkError:"Error de red: Por favor, verifica tu conexión a internet",unauthorized:"No autorizado — Por favor, verifica tu sesión",notFound:"Recurso no encontrado",generic:"Ocurrió un error",fetchPlans:"Error al obtener los planes",fetchPlanGroup:"Error al obtener el grupo de planes",fetchPlanGroupVersion:"Error al obtener la versión del grupo de planes",fetchPlanGroupVersions:"Error al obtener las versiones del grupo de planes",fetchSubscription:"Error al obtener la suscripción",createCheckout:"Error al crear la sesión de pago",updateSubscription:"Error al actualizar la suscripción",fetchInvoices:"Error al obtener las facturas",fetchInvoice:"Error al obtener la factura",openBillingPortal:"Error al abrir el portal de facturación",cancelSubscription:"Error al cancelar la suscripción",resumeSubscription:"Error al reanudar la suscripción",recordUsage:"Error al registrar el uso",fetchQuotaUsage:"Error al obtener el estado de uso de cuotas",fetchAllQuotaUsage:"Error al obtener todo el uso de cuotas",fetchUsageLogs:"Error al obtener los registros de uso"}}});var BE=Object.freeze({__proto__:null,fr:{settings:{titles:{profile:"Compte",general:"Paramètres de l'espace de travail",users:"Membres de l'espace de travail",subscription:"Plan et facturation",usage:"Utilisation",features:"Fonctionnalités de l'espace de travail",notifications:"Notifications",danger:"Zone de danger"},sidebar:{account:"Compte",workspace:"Espace de travail",profile:"Compte",general:"Paramètres",users:"Membres",subscription:"Plan et facturation",usage:"Utilisation",features:"Fonctionnalités",notifications:"Notifications",danger:"Zone de danger"},common:{refresh:"Actualiser",refreshing:"Actualisation...",retry:"Réessayer",retrying:"Nouvelle tentative...",save:"Enregistrer",saving:"Enregistrement...",cancel:"Annuler",delete:"Supprimer",dismiss:"Ignorer",loading:"Chargement...",success:"Succès !",error:"Erreur",refreshAction:"{loading, select, true {Actualisation...} other {Actualiser}}",retryAction:"{loading, select, true {Nouvelle tentative...} other {Réessayer}}"}},subscription:{managePlan:"Gérez votre plan et votre facturation",changePlan:"Changer de plan",viewPricingPlans:"Voir les plans tarifaires",viewPlans:"Voir les plans",upgradePlan:"Mettre à niveau",subscribe:"S'abonner",currentPlan:"Plan actuel",noSubscription:"Vous n'avez pas d'abonnement actif",choosePlan:"Choisissez votre plan",choosePlanDescription:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",planUpdateAvailable:"Mise à jour du plan disponible",updateSuccess:"Abonnement mis à jour avec succès !",updateFailed:"Échec de la mise à jour",cancelTitle:"Annuler l'abonnement",cancelConfirm:"Êtes-vous sûr de vouloir annuler votre abonnement ?",cancelKeep:"Conserver l'abonnement",cancelButton:"Oui, annuler l'abonnement",canceling:"Annulation...",cancelSuccess:"L'abonnement sera annulé à la fin de la période de facturation.",cancelNotCharged:"Vous ne serez plus facturé après l'annulation",cancelResumeAnytime:"Vous pouvez reprendre votre abonnement à tout moment avant qu'il ne se termine",resumeTitle:"Reprendre l'abonnement",resumeConfirm:"Êtes-vous sûr de vouloir reprendre votre abonnement ?",resumeKeep:"Maintenir annulé",resumeButton:"Oui, reprendre l'abonnement",resuming:"Reprise...",resumeSuccess:"L'abonnement a été repris.",managePayment:"Gérer le paiement",openingPortal:"Ouverture...",viewAllPlans:"Voir tous les plans",scheduledCancellation:"Annulation de l'abonnement programmée",paymentPastDue:"Paiement en retard",paymentPastDueDescription:"Veuillez mettre à jour votre moyen de paiement pour éviter une interruption de service.",subscriptionPaused:"Abonnement suspendu",subscriptionPausedDescription:"Votre abonnement est actuellement suspendu. Reprenez-le pour restaurer l'accès complet.",errorLoading:"Erreur lors du chargement des données d'abonnement",errorLoadingDescription:"Veuillez vérifier votre connexion et réessayer.",errorProcessing:"Échec du traitement de l'abonnement",errorCanceling:"Échec de l'annulation de l'abonnement",errorResuming:"Échec de la reprise de l'abonnement",invalidWorkspace:"ID d'espace de travail invalide",billingInterval:{monthly:"Mensuel",quarterly:"Trimestriel",yearly:"Annuel",perMonth:"/mois",perQuarter:"/trimestre",perYear:"/an"},seats:{title:"Sièges",members:"Membres",included:"Inclus",billable:"Facturables",perExtraSeat:"Par siège supplémentaire",limit:"Limite",includedSeats:"Sièges inclus",maxSeats:"Sièges max.",freeWithBase:"Gratuit avec le prix de base",allIncluded:"Tous inclus",extra:"supplémentaire",unlimited:"Illimité"},items:{features:"Fonctionnalités",limits:"Limites",quotas:"Quotas d'utilisation"},checkout:{upgrade:"Mettre à niveau",downgrade:"Rétrograder",switchTo:"Passer à",select:"Sélectionner"},status:{active:"Actif",canceling:"En annulation",trial:"Essai",canceled:"Annulé",pastDue:"En retard",paused:"Suspendu",deprecated:"Obsolète",unknown:"Inconnu"},plan:"Plan",invoicesTab:"Factures",changePlanButton:"Changer de plan",noPlanAssigned:"Aucun plan attribué",free:"Gratuit",perSeatDisplay:"+ {price}/siège{interval}",estTotalDisplay:"Total est. : {total}{interval} ({count, plural, one {# siège supplémentaire} other {# sièges supplémentaires}})",nextBillingDisplay:"Prochaine facturation : {date}",membersInWorkspace:"{count, plural, one {# membre} other {# membres}} dans l'espace de travail",billingInCurrency:"Facturation en {currency}",savingsPercent:"Économisez {percent, number}%",switchToInterval:"Passer à {interval}",seatPriceDisplay:"+ {price}/siège{interval} ({included} {includedLabel})",trialEnded:"Votre période d'essai est terminée.",trialEndsIn:"Votre période d'essai se termine dans {days, plural, one {# jour} other {# jours}}.",onTrial:"Vous êtes en période d'essai.",upgradeToKeepAccess:"Mettez à niveau pour conserver l'accès.",viewInvoices:"Voir les factures",cancelTrial:"Annuler l'essai",dunningFinal:"Dernier avertissement : l'abonnement sera suspendu",dunningSuspended:"Abonnement suspendu",dunningRecovery:"Récupération de paiement en cours",dunningSuspendedDescription:"Votre abonnement a été suspendu en raison d'échecs de paiement répétés. Mettez à jour votre moyen de paiement pour restaurer l'accès.",dunningRecoveryDescription:"Nous n'avons pas pu traiter votre paiement. Veuillez mettre à jour votre moyen de paiement pour ne pas perdre l'accès.",cancelEndDescription:"Votre abonnement prendra fin le",cancelEndFallback:"Votre abonnement sera annulé à la fin de la période de facturation en cours. Vous ne serez plus facturé.",resumeChargeDate:"Vous serez de nouveau facturé le",resumeChargeFallback:"la prochaine date de facturation",resumeContinue:"Votre abonnement continuera automatiquement et vous serez facturé selon votre plan",resumeCancelAnytime:"Vous pouvez annuler à tout moment avant la prochaine date de facturation si vous changez d'avis",retainAccess:"Vous conserverez l'accès complet à ce plan jusqu'au",retainAccessFallback:"la fin de votre période de facturation actuelle",noPlansAvailable:"Aucun groupe de plans n'est disponible pour cet espace de travail. Veuillez contacter le support si vous pensez qu'il s'agit d'une erreur.",noPlansAvailableHint:"Aucun groupe de plans n'est disponible pour cet espace de travail.",startTrialDescription:"Essayez le plan complet sans engagement. Vous pouvez mettre à niveau ou annuler à tout moment.",noSubscriptionDescription:"Choisissez un plan pour commencer avec votre espace de travail",startFreeTrial:"Commencer l'essai gratuit"},users:{title:"Membres de l'espace de travail",adminOnly:"Seul l'administrateur de l'espace de travail peut gérer les utilisateurs et les rôles.",inviteByEmail:"Inviter un membre par e-mail",inviteButton:"Inviter",inviting:"Invitation...",inviteSuccess:"Utilisateur invité avec succès",emailRequired:"L'adresse e-mail est obligatoire",invalidEmail:"Format d'adresse e-mail invalide",inviteFailed:"Échec de l'invitation du membre",seatLimitReached:"Limite de sièges atteinte",memberLimitReached:"Limite de membres atteinte",role:"Rôle",you:"Vous",owner:"Propriétaire",noMembers:"Aucun membre trouvé dans cet espace de travail.",extraSeatCost:"Chaque membre supplémentaire ajoute {price}/{interval, select, yearly {an} quarterly {trim.} other {mois}} à votre abonnement",unknownUser:"Utilisateur inconnu",seats:"Sièges",members:"Membres",included:"inclus",perExtraSeat:"/siège supplémentaire",maxMembers:"membres max.",available:"disponibles",noMemberLimit:"Pas de limite de membres",seatHeading:"{hasSeatPricing, select, true {Sièges} other {Membres}}",limitReached:"{reason, select, seat_limit_reached {Limite de sièges atteinte} other {Limite de membres atteinte}}",memberCount:"{count, plural, one {# membre} other {# membres}}",subscriptionRequired:"Un abonnement est requis pour inviter des membres.",seatLimitMessage:"Votre plan autorise jusqu'à {maxUsers, number} membres. Mettez à niveau pour plus de sièges.",settingsLimitMessage:"Cet espace de travail autorise jusqu'à {maxUsers, number} membres.",memberLimitMessage:"Limite de membres de {maxUsers, number} atteinte.",selectRole:"Sélectionner un rôle",inviteAs:"Inviter en tant que {role}"},invoices:{title:"Historique de facturation",description:"Consultez et téléchargez vos factures",pay:"Payer",view:"Voir",viewDetails:"Voir les détails",download:"PDF",errorLoading:"Erreur lors du chargement des factures",noInvoices:"Pas encore de factures. Abonnez-vous à un plan pour recevoir des factures.",noInvoicesWithSub:"Aucune facture avec option de téléchargement trouvée",paidAmount:"Payé : {amount}",na:"N/D",status:{draft:"Brouillon",open:"Ouverte",paid:"Payée",uncollectible:"Irrécouvrable",void:"Annulée"}},usage:{title:"Utilisation",description:"Surveillez votre consommation de ressources et vos quotas",totalResources:"Total des ressources",overallUsage:"Utilisation globale",inOverage:"En dépassement",estOverageCost:"Coût est. de dépassement",overageDetected:"Dépassement détecté",overageDescription:"L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",overageUnits:"Unités en dépassement",rate:"Tarif",billableBlocks:"Blocs facturables",estimatedCharge:"Charge estimée",noData:"Aucune donnée d'utilisation de quotas disponible pour cet espace de travail.",noDataHint:"Les quotas apparaîtront ici une fois que votre plan inclura des ressources mesurées.",used:"utilisé",remaining:"restant",overLimit:"au-dessus de la limite",percentUsed:"{percent, number}% utilisé",availableRemaining:"{count} restants",overLimitCount:"{count} au-dessus de la limite",overageWarning:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}} L'utilisation supplémentaire sera facturée en dépassement sur votre prochaine facture.",fullyUsed:"Entièrement utilisé",renewingSoon:"renouvellement imminent",almostFull:"Presque plein",overage:"Dépassement",errorLoading:"Échec du chargement des données d'utilisation",perUnit:"/ unité",perUnits:"/ unités",rateDisplay:"{rate} {unitSize, plural, =1 {/ unité} other {/ {unitSize, number} unités}}",resourcesExceeded:"{count, plural, one {# ressource a dépassé le quota inclus.} other {# ressources ont dépassé le quota inclus.}}",estOverageCharges:"Charges de dépassement estimées pour cette période : {amount}",overageRateDisplay:"Tarif de dépassement : {rate}",resetDateDisplay:"L'utilisation se réinitialise le {date}",daysRemainingDisplay:"{count, plural, one {# jour restant} other {# jours restants}}"},profile:{email:"E-mail",name:"Nom",language:"Langue",country:"Pays",currency:"Devise",timezone:"Fuseau horaire",profileImage:"Image de profil",success:"Profil enregistré avec succès",nameMinLength:"Le nom doit comporter au moins 2 caractères.",save:"Enregistrer",reset:"Réinitialiser"},general:{ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les paramètres.",name:"Nom",namePlaceholder:"Mon espace de travail",nameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",billingCurrency:"Devise de facturation",icon:"Icône",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",previewLabel:"Aperçu :",success:"Paramètres de l'espace de travail enregistrés avec succès",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",updateWorkspace:"Mettre à jour l'espace de travail"},features:{title:"Fonctionnalités de l'espace de travail",ownerOnly:"Seul le propriétaire de l'espace de travail peut modifier les fonctionnalités.",noFeatures:"L'espace de travail n'a pas de fonctionnalités à gérer.",enabled:"activée",disabled:"désactivée",enabling:"Activation",disabling:"Désactivation",featureSuccess:"avec succès",updateSuccess:"{feature} {enabled, select, true {activée} other {désactivée}} avec succès",actionStatus:"{action, select, enabling {Activation} disabling {Désactivation} other {}}"},danger:{title:"Supprimer l'espace de travail",adminOnly:"Seuls les administrateurs peuvent supprimer les espaces de travail.",deleteWorkspace:"Supprimer l'espace de travail",deleteConfirm:"Êtes-vous absolument sûr ?",deleteWarning:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes les données associées.",deleting:"Suppression...",deleteDescription:"Une fois l'espace de travail supprimé, il n'y a pas de retour en arrière. Cela supprimera définitivement l'espace de travail et toutes ses données, y compris les membres, les paramètres et les fonctionnalités.",deleteConfirmDescription:"Cette action est irréversible. Cela supprimera définitivement l'espace de travail et toutes ses données.",failedToDelete:"Échec de la suppression de l'espace de travail"},notifications:{title:"Préférences de notifications",permissionDenied:"Autorisation de notifications refusée",notSupported:"Les notifications push ne sont pas prises en charge par ce navigateur.",manageDescription:"Gérez la façon dont vous recevez les notifications de cet espace de travail.",blocked:"Notifications bloquées",blockedDescription:"Vous avez précédemment bloqué les notifications pour ce site. Pour les activer, mettez à jour les paramètres de votre navigateur :",pushTitle:"Notifications push",pushEnabledDescription:"Vous recevrez des notifications du navigateur pour les mises à jour importantes.",pushDisabledDescription:"Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.",enabling:"Activation...",disabling:"Désactivation...",enable:"Activer",disable:"Désactiver",toggleAction:"{loading, select, true {{subscribed, select, true {Désactivation...} other {Activation...}}} other {{subscribed, select, true {Désactiver} other {Activer}}}}",pushDescription:"{subscribed, select, true {Vous recevrez des notifications du navigateur pour les mises à jour importantes.} other {Recevez des notifications concernant les problèmes de paiement, l'expiration de l'essai et d'autres mises à jour importantes.}}",deviceNote:"Les notifications sont envoyées à cet appareil. Activez-les sur vos autres appareils séparément.",unblock:{firefox:{step1:"Cliquez sur l'icône du cadenas (ou du bouclier) dans la barre d'adresse",step2:'Trouvez "Notifications" dans la liste des autorisations',step3:'Changez de "Bloqué" à "Autoriser"',step4:"Rechargez cette page"},safari:{step1:"Ouvrez Safari → Réglages → Sites web → Notifications",step2:"Trouvez ce site web dans la liste",step3:'Changez de "Refuser" à "Autoriser"',step4:"Rechargez cette page"},edge:{step1:"Cliquez sur l'icône du cadenas dans la barre d'adresse",step2:'Cliquez sur "Autorisations pour ce site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"},chrome:{step1:"Cliquez sur l'icône du cadenas (ou de réglage) dans la barre d'adresse",step2:'Cliquez sur "Paramètres du site"',step3:'Réglez "Notifications" sur "Autoriser"',step4:"Rechargez cette page"}}},quota:{includedOnly:"{count, number} inclus",includedWithOverage:"{count, number} inclus, puis {price} / {unit}",unitFallback:"unité"},pricing:{title:"Choisissez votre plan",description:"Comparez les plans et sélectionnez celui qui correspond à vos besoins",currency:"Devise",billingIn:"Facturation en",noPlansCurrency:"Aucun plan disponible pour votre devise de facturation.",noPlansCurrencyHint:"Une erreur s'est produite. Veuillez contacter le support.",noPlans:"Aucun plan disponible",free:"Gratuit",included:"inclus",save:"Économisez",current:"Actuel",processing:"Traitement...",unavailable:"Indisponible",selectCurrency:"Sélectionner la devise de facturation",billingInterval:"Intervalle de facturation"},beta:{nameLabel:"Nom",emailLabel:"E-mail",submitText:"Envoyer",submittingText:"Envoi...",errorMessage:"Une erreur s'est produite",tryAgain:"Réessayer",privacyConsent:"En soumettant ce formulaire, vous acceptez notre",privacyPolicy:"Politique de confidentialité",and:"et",termsOfService:"Conditions d'utilisation"},workspace:{switchTitle:"Changer d'espace de travail",switchDescription:"Sélectionnez un espace de travail ou créez-en un nouveau.",notLoggedIn:"Il semble que vous n'êtes pas connecté. Veuillez vous connecter pour continuer.",availableWorkspaces:"Espaces de travail disponibles ({count, number})",loadingWorkspaces:"Chargement des espaces de travail...",searchPlaceholder:"Rechercher des espaces de travail...",noWorkspacesFound:"Aucun espace de travail trouvé",noWorkspacesAvailable:"Aucun espace de travail disponible",switchTo:"Passer à",membersCount:"{count, plural, one {# membre} other {# membres}}",createNew:"Créer un nouvel espace de travail",createTitle:"Créer un nouvel espace de travail",createDescription:"Créez un nouvel espace de travail pour commencer.",workspaceName:"Nom de l'espace de travail",workspaceNamePlaceholder:"Mon espace de travail",workspaceNameMinLength:"Le nom de l'espace de travail doit comporter au moins 2 caractères.",workspaceIcon:"Icône de l'espace de travail",iconDescription:"Choisissez un emoji ou téléchargez une image personnalisée pour votre espace de travail.",chooseEmoji:"Choisir un emoji",customImageUrl:"URL d'image personnalisée",imageUrl:"URL de l'image",imageUrlPlaceholder:"https://exemple.com/image.png",imageUrlDescription:"Entrez une URL valide pour l'image de votre espace de travail. Formats pris en charge : PNG, JPG et SVG.",invalidUrl:"Veuillez entrer une URL valide",creating:"Création...",createWorkspace:"Créer l'espace de travail"},dropdowns:{search:"Rechercher...",chooseOption:"Choisir une option",chooseCountry:"Choisir un pays",searchCountry:"Choisir un pays...",chooseLanguage:"Choisir une langue",searchLanguage:"Choisir une langue...",chooseCurrency:"Choisir une devise",searchCurrency:"Choisir une devise...",chooseTimezone:"Choisir un fuseau horaire",searchTimezone:"Choisir un fuseau horaire..."},push:{failedToSubscribe:"Échec de l'abonnement aux notifications push",failedToUnsubscribe:"Échec de la désinscription des notifications push"},errors:{networkError:"Erreur réseau : Veuillez vérifier votre connexion Internet",unauthorized:"Non autorisé — Veuillez vérifier votre session",notFound:"Ressource introuvable",generic:"Une erreur s'est produite",fetchPlans:"Échec de la récupération des plans",fetchPlanGroup:"Échec de la récupération du groupe de plans",fetchPlanGroupVersion:"Échec de la récupération de la version du groupe de plans",fetchPlanGroupVersions:"Échec de la récupération des versions du groupe de plans",fetchSubscription:"Échec de la récupération de l'abonnement",createCheckout:"Échec de la création de la session de paiement",updateSubscription:"Échec de la mise à jour de l'abonnement",fetchInvoices:"Échec de la récupération des factures",fetchInvoice:"Échec de la récupération de la facture",openBillingPortal:"Échec de l'ouverture du portail de facturation",cancelSubscription:"Échec de l'annulation de l'abonnement",resumeSubscription:"Échec de la reprise de l'abonnement",recordUsage:"Échec de l'enregistrement de l'utilisation",fetchQuotaUsage:"Échec de la récupération du statut d'utilisation des quotas",fetchAllQuotaUsage:"Échec de la récupération de toute l'utilisation des quotas",fetchUsageLogs:"Échec de la récupération des journaux d'utilisation"}}});var WE=Object.freeze({__proto__:null,de:{settings:{titles:{profile:"Konto",general:"Arbeitsbereich-Einstellungen",users:"Arbeitsbereich-Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",features:"Arbeitsbereich-Funktionen",notifications:"Benachrichtigungen",danger:"Gefahrenzone"},sidebar:{account:"Konto",workspace:"Arbeitsbereich",profile:"Konto",general:"Einstellungen",users:"Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",features:"Funktionen",notifications:"Benachrichtigungen",danger:"Gefahrenzone"},common:{refresh:"Aktualisieren",refreshing:"Wird aktualisiert...",retry:"Erneut versuchen",retrying:"Wird erneut versucht...",save:"Speichern",saving:"Wird gespeichert...",cancel:"Abbrechen",delete:"Löschen",dismiss:"Verwerfen",loading:"Wird geladen...",success:"Erfolg!",error:"Fehler",refreshAction:"{loading, select, true {Wird aktualisiert...} other {Aktualisieren}}",retryAction:"{loading, select, true {Wird erneut versucht...} other {Erneut versuchen}}"}},subscription:{managePlan:"Verwalte deinen Plan und deine Abrechnung",changePlan:"Plan ändern",viewPricingPlans:"Preispläne ansehen",viewPlans:"Pläne ansehen",upgradePlan:"Jetzt upgraden",subscribe:"Abonnieren",currentPlan:"Aktueller Plan",noSubscription:"Du hast kein aktives Abonnement",choosePlan:"Wähle deinen Plan",choosePlanDescription:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",planUpdateAvailable:"Plan-Update verfügbar",updateSuccess:"Abonnement erfolgreich aktualisiert!",updateFailed:"Aktualisierung fehlgeschlagen",cancelTitle:"Abonnement kündigen",cancelConfirm:"Bist du sicher, dass du dein Abonnement kündigen möchtest?",cancelKeep:"Abonnement behalten",cancelButton:"Ja, Abonnement kündigen",canceling:"Wird gekündigt...",cancelSuccess:"Das Abonnement wird zum Ende des Abrechnungszeitraums gekündigt.",cancelNotCharged:"Nach der Kündigung wird dir nichts mehr berechnet",cancelResumeAnytime:"Du kannst dein Abonnement jederzeit vor Ablauf wieder aufnehmen",resumeTitle:"Abonnement fortsetzen",resumeConfirm:"Bist du sicher, dass du dein Abonnement fortsetzen möchtest?",resumeKeep:"Gekündigt lassen",resumeButton:"Ja, Abonnement fortsetzen",resuming:"Wird fortgesetzt...",resumeSuccess:"Das Abonnement wurde fortgesetzt.",managePayment:"Zahlung verwalten",openingPortal:"Wird geöffnet...",viewAllPlans:"Alle Pläne ansehen",scheduledCancellation:"Kündigung des Abonnements geplant",paymentPastDue:"Zahlung überfällig",paymentPastDueDescription:"Bitte aktualisiere deine Zahlungsmethode, um eine Dienstunterbrechung zu vermeiden.",subscriptionPaused:"Abonnement pausiert",subscriptionPausedDescription:"Dein Abonnement ist derzeit pausiert. Setze es fort, um den vollen Zugang wiederherzustellen.",errorLoading:"Fehler beim Laden der Abonnementdaten",errorLoadingDescription:"Bitte überprüfe deine Verbindung und versuche es erneut.",errorProcessing:"Abonnement konnte nicht verarbeitet werden",errorCanceling:"Abonnement konnte nicht gekündigt werden",errorResuming:"Abonnement konnte nicht fortgesetzt werden",invalidWorkspace:"Ungültige Arbeitsbereich-ID",billingInterval:{monthly:"Monatlich",quarterly:"Vierteljährlich",yearly:"Jährlich",perMonth:"/Monat",perQuarter:"/Quartal",perYear:"/Jahr"},seats:{title:"Plätze",members:"Mitglieder",included:"Enthalten",billable:"Abrechenbar",perExtraSeat:"Pro zusätzlichem Platz",limit:"Limit",includedSeats:"Enthaltene Plätze",maxSeats:"Max. Plätze",freeWithBase:"Im Grundpreis enthalten",allIncluded:"Alle enthalten",extra:"zusätzlich",unlimited:"Unbegrenzt"},items:{features:"Funktionen",limits:"Limits",quotas:"Nutzungskontingente"},checkout:{upgrade:"Upgraden",downgrade:"Downgraden",switchTo:"Wechseln zu",select:"Auswählen"},status:{active:"Aktiv",canceling:"Wird gekündigt",trial:"Testversion",canceled:"Gekündigt",pastDue:"Überfällig",paused:"Pausiert",deprecated:"Veraltet",unknown:"Unbekannt"},plan:"Plan",invoicesTab:"Rechnungen",changePlanButton:"Plan ändern",noPlanAssigned:"Kein Plan zugewiesen",free:"Kostenlos",perSeatDisplay:"+ {price}/Platz{interval}",estTotalDisplay:"Geschätztes Gesamt: {total}{interval} ({count, plural, one {# zusätzlicher Platz} other {# zusätzliche Plätze}})",nextBillingDisplay:"Nächste Abrechnung: {date}",membersInWorkspace:"{count, plural, one {# Mitglied} other {# Mitglieder}} im Arbeitsbereich",billingInCurrency:"Abrechnung in {currency}",savingsPercent:"{percent, number}% sparen",switchToInterval:"Zu {interval} wechseln",seatPriceDisplay:"+ {price}/Platz{interval} ({included} {includedLabel})",trialEnded:"Deine Testversion ist abgelaufen.",trialEndsIn:"Deine Testversion endet in {days, plural, one {# Tag} other {# Tagen}}.",onTrial:"Du befindest dich in der Testversion.",upgradeToKeepAccess:"Upgrade, um den Zugang zu behalten.",viewInvoices:"Rechnungen ansehen",cancelTrial:"Testversion abbrechen",dunningFinal:"Letzte Warnung: Abonnement wird ausgesetzt",dunningSuspended:"Abonnement ausgesetzt",dunningRecovery:"Zahlungswiederherstellung läuft",dunningSuspendedDescription:"Dein Abonnement wurde aufgrund wiederholter Zahlungsfehler ausgesetzt. Aktualisiere deine Zahlungsmethode, um den Zugang wiederherzustellen.",dunningRecoveryDescription:"Wir konnten deine Zahlung nicht verarbeiten. Bitte aktualisiere deine Zahlungsmethode, um den Zugang nicht zu verlieren.",cancelEndDescription:"Dein Abonnement endet am",cancelEndFallback:"Dein Abonnement wird zum Ende des aktuellen Abrechnungszeitraums gekündigt. Dir wird nichts mehr berechnet.",resumeChargeDate:"Dir wird erneut berechnet am",resumeChargeFallback:"dem nächsten Abrechnungsdatum",resumeContinue:"Dein Abonnement wird automatisch fortgesetzt und gemäß deinem Plan abgerechnet",resumeCancelAnytime:"Du kannst jederzeit vor dem nächsten Abrechnungsdatum kündigen, wenn du es dir anders überlegst",retainAccess:"Du behältst den vollen Zugang zu diesem Plan bis",retainAccessFallback:"zum Ende deines aktuellen Abrechnungszeitraums",noPlansAvailable:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar. Bitte kontaktiere den Support, wenn du glaubst, dass dies ein Fehler ist.",noPlansAvailableHint:"Für diesen Arbeitsbereich sind keine Plangruppen verfügbar.",startTrialDescription:"Teste den vollständigen Plan ohne Verpflichtung. Du kannst jederzeit upgraden oder kündigen.",noSubscriptionDescription:"Wähle einen Plan, um mit deinem Arbeitsbereich loszulegen",startFreeTrial:"Kostenlose Testversion starten"},users:{title:"Arbeitsbereich-Mitglieder",adminOnly:"Nur der Arbeitsbereich-Administrator kann Benutzer und Rollen verwalten.",inviteByEmail:"Mitglied per E-Mail einladen",inviteButton:"Einladen",inviting:"Wird eingeladen...",inviteSuccess:"Benutzer erfolgreich eingeladen",emailRequired:"E-Mail-Adresse ist erforderlich",invalidEmail:"Ungültiges E-Mail-Adressformat",inviteFailed:"Einladung des Mitglieds fehlgeschlagen",seatLimitReached:"Platzlimit erreicht",memberLimitReached:"Mitgliederlimit erreicht",role:"Rolle",you:"Du",owner:"Eigentümer",noMembers:"Keine Mitglieder in diesem Arbeitsbereich gefunden.",extraSeatCost:"Jedes zusätzliche Mitglied fügt {price}/{interval, select, yearly {Jahr} quarterly {Quartal} other {Monat}} zu deinem Abonnement hinzu",unknownUser:"Unbekannter Benutzer",seats:"Plätze",members:"Mitglieder",included:"enthalten",perExtraSeat:"/zusätzlicher Platz",maxMembers:"max. Mitglieder",available:"verfügbar",noMemberLimit:"Kein Mitgliederlimit",seatHeading:"{hasSeatPricing, select, true {Plätze} other {Mitglieder}}",limitReached:"{reason, select, seat_limit_reached {Platzlimit erreicht} other {Mitgliederlimit erreicht}}",memberCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",subscriptionRequired:"Ein Abonnement ist erforderlich, um Mitglieder einzuladen.",seatLimitMessage:"Dein Plan erlaubt bis zu {maxUsers, number} Mitglieder. Upgrade für mehr Plätze.",settingsLimitMessage:"Dieser Arbeitsbereich erlaubt bis zu {maxUsers, number} Mitglieder.",memberLimitMessage:"Mitgliederlimit von {maxUsers, number} erreicht.",selectRole:"Rolle auswählen",inviteAs:"Einladen als {role}"},invoices:{title:"Abrechnungsverlauf",description:"Rechnungen ansehen und herunterladen",pay:"Bezahlen",view:"Ansehen",viewDetails:"Details ansehen",download:"PDF",errorLoading:"Fehler beim Laden der Rechnungen",noInvoices:"Noch keine Rechnungen. Abonniere einen Plan, um Rechnungen zu erhalten.",noInvoicesWithSub:"Keine Rechnungen mit Download-Option gefunden",paidAmount:"Bezahlt: {amount}",na:"k. A.",status:{draft:"Entwurf",open:"Offen",paid:"Bezahlt",uncollectible:"Uneinbringlich",void:"Storniert"}},usage:{title:"Nutzung",description:"Überwache deinen Ressourcenverbrauch und deine Kontingente",totalResources:"Ressourcen gesamt",overallUsage:"Gesamtnutzung",inOverage:"Im Überschuss",estOverageCost:"Geschätzte Überschusskosten",overageDetected:"Überschuss erkannt",overageDescription:"Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",overageUnits:"Überschusseinheiten",rate:"Tarif",billableBlocks:"Abrechenbare Blöcke",estimatedCharge:"Geschätzte Kosten",noData:"Keine Kontingentnutzungsdaten für diesen Arbeitsbereich verfügbar.",noDataHint:"Kontingente erscheinen hier, sobald dein Plan gemessene Ressourcen enthält.",used:"genutzt",remaining:"verbleibend",overLimit:"über dem Limit",percentUsed:"{percent, number}% genutzt",availableRemaining:"{count} verbleibend",overLimitCount:"{count} über dem Limit",overageWarning:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}} Zusätzliche Nutzung wird als Überschuss auf deiner nächsten Rechnung berechnet.",fullyUsed:"Vollständig genutzt",renewingSoon:"wird bald erneuert",almostFull:"Fast voll",overage:"Überschuss",errorLoading:"Nutzungsdaten konnten nicht geladen werden",perUnit:"/ Einheit",perUnits:"/ Einheiten",rateDisplay:"{rate} {unitSize, plural, =1 {/ Einheit} other {/ {unitSize, number} Einheiten}}",resourcesExceeded:"{count, plural, one {# Ressource hat das enthaltene Kontingent überschritten.} other {# Ressourcen haben das enthaltene Kontingent überschritten.}}",estOverageCharges:"Geschätzte Überschusskosten in diesem Zeitraum: {amount}",overageRateDisplay:"Überschusstarif: {rate}",resetDateDisplay:"Nutzung wird zurückgesetzt am {date}",daysRemainingDisplay:"{count, plural, one {# Tag verbleibend} other {# Tage verbleibend}}"},profile:{email:"E-Mail",name:"Name",language:"Sprache",country:"Land",currency:"Währung",timezone:"Zeitzone",profileImage:"Profilbild",success:"Profil erfolgreich gespeichert",nameMinLength:"Der Name muss mindestens 2 Zeichen lang sein.",save:"Speichern",reset:"Zurücksetzen"},general:{ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Einstellungen ändern.",name:"Name",namePlaceholder:"Mein Arbeitsbereich",nameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",billingCurrency:"Abrechnungswährung",icon:"Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",previewLabel:"Vorschau:",success:"Arbeitsbereich-Einstellungen erfolgreich gespeichert",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",updateWorkspace:"Arbeitsbereich aktualisieren"},features:{title:"Arbeitsbereich-Funktionen",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann die Funktionen ändern.",noFeatures:"Der Arbeitsbereich hat keine zu verwaltenden Funktionen.",enabled:"aktiviert",disabled:"deaktiviert",enabling:"Wird aktiviert",disabling:"Wird deaktiviert",featureSuccess:"erfolgreich",updateSuccess:"{feature} erfolgreich {enabled, select, true {aktiviert} other {deaktiviert}}",actionStatus:"{action, select, enabling {Wird aktiviert} disabling {Wird deaktiviert} other {}}"},danger:{title:"Arbeitsbereich löschen",adminOnly:"Nur Administratoren können Arbeitsbereiche löschen.",deleteWorkspace:"Arbeitsbereich löschen",deleteConfirm:"Bist du dir absolut sicher?",deleteWarning:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle zugehörigen Daten werden dauerhaft gelöscht.",deleting:"Wird gelöscht...",deleteDescription:"Sobald du einen Arbeitsbereich löschst, gibt es kein Zurück. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht, einschließlich Mitglieder, Einstellungen und Funktionen.",deleteConfirmDescription:"Diese Aktion kann nicht rückgängig gemacht werden. Der Arbeitsbereich und alle seine Daten werden dauerhaft gelöscht.",failedToDelete:"Arbeitsbereich konnte nicht gelöscht werden"},notifications:{title:"Benachrichtigungseinstellungen",permissionDenied:"Benachrichtigungsberechtigung verweigert",notSupported:"Push-Benachrichtigungen werden in diesem Browser nicht unterstützt.",manageDescription:"Verwalte, wie du Benachrichtigungen von diesem Arbeitsbereich erhältst.",blocked:"Benachrichtigungen blockiert",blockedDescription:"Du hast Benachrichtigungen für diese Seite zuvor blockiert. Um sie zu aktivieren, aktualisiere deine Browsereinstellungen:",pushTitle:"Push-Benachrichtigungen",pushEnabledDescription:"Du erhältst Browser-Benachrichtigungen für wichtige Updates.",pushDisabledDescription:"Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.",enabling:"Wird aktiviert...",disabling:"Wird deaktiviert...",enable:"Aktivieren",disable:"Deaktivieren",toggleAction:"{loading, select, true {{subscribed, select, true {Wird deaktiviert...} other {Wird aktiviert...}}} other {{subscribed, select, true {Deaktivieren} other {Aktivieren}}}}",pushDescription:"{subscribed, select, true {Du erhältst Browser-Benachrichtigungen für wichtige Updates.} other {Erhalte Benachrichtigungen über Zahlungsprobleme, Ablauf der Testversion und andere wichtige Updates.}}",deviceNote:"Benachrichtigungen werden an dieses Gerät gesendet. Aktiviere sie auf anderen Geräten separat.",unblock:{firefox:{step1:"Klicke auf das Schloss-Symbol (oder Schild-Symbol) in der Adressleiste",step2:'Finde "Benachrichtigungen" in der Berechtigungsliste',step3:'Ändere von "Blockiert" zu "Erlauben"',step4:"Lade diese Seite neu"},safari:{step1:"Öffne Safari → Einstellungen → Websites → Benachrichtigungen",step2:"Finde diese Website in der Liste",step3:'Ändere von "Ablehnen" zu "Erlauben"',step4:"Lade diese Seite neu"},edge:{step1:"Klicke auf das Schloss-Symbol in der Adressleiste",step2:'Klicke auf "Berechtigungen für diese Website"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"},chrome:{step1:"Klicke auf das Schloss-Symbol (oder Einstellungssymbol) in der Adressleiste",step2:'Klicke auf "Website-Einstellungen"',step3:'Setze "Benachrichtigungen" auf "Erlauben"',step4:"Lade diese Seite neu"}}},quota:{includedOnly:"{count, number} enthalten",includedWithOverage:"{count, number} enthalten, dann {price} / {unit}",unitFallback:"Einheit"},pricing:{title:"Wähle deinen Plan",description:"Vergleiche Pläne und wähle den, der zu deinen Anforderungen passt",currency:"Währung",billingIn:"Abrechnung in",noPlansCurrency:"Keine Pläne für deine Abrechnungswährung verfügbar.",noPlansCurrencyHint:"Etwas ist schiefgelaufen. Bitte kontaktiere den Support.",noPlans:"Keine Pläne verfügbar",free:"Kostenlos",included:"enthalten",save:"Sparen",current:"Aktuell",processing:"Wird verarbeitet...",unavailable:"Nicht verfügbar",selectCurrency:"Abrechnungswährung auswählen",billingInterval:"Abrechnungsintervall"},beta:{nameLabel:"Name",emailLabel:"E-Mail",submitText:"Absenden",submittingText:"Wird gesendet...",errorMessage:"Ein Fehler ist aufgetreten",tryAgain:"Erneut versuchen",privacyConsent:"Mit dem Absenden dieses Formulars stimmst du unserer",privacyPolicy:"Datenschutzrichtlinie",and:"und",termsOfService:"Nutzungsbedingungen"},workspace:{switchTitle:"Arbeitsbereich wechseln",switchDescription:"Wähle einen Arbeitsbereich aus oder erstelle einen neuen.",notLoggedIn:"Es sieht so aus, als wärst du nicht eingeloggt. Bitte melde dich an, um fortzufahren.",availableWorkspaces:"Verfügbare Arbeitsbereiche ({count, number})",loadingWorkspaces:"Arbeitsbereiche werden geladen...",searchPlaceholder:"Arbeitsbereiche suchen...",noWorkspacesFound:"Keine Arbeitsbereiche gefunden",noWorkspacesAvailable:"Keine Arbeitsbereiche verfügbar",switchTo:"Wechseln zu",membersCount:"{count, plural, one {# Mitglied} other {# Mitglieder}}",createNew:"Neuen Arbeitsbereich erstellen",createTitle:"Neuen Arbeitsbereich erstellen",createDescription:"Erstelle einen neuen Arbeitsbereich, um loszulegen.",workspaceName:"Name des Arbeitsbereichs",workspaceNamePlaceholder:"Mein Arbeitsbereich",workspaceNameMinLength:"Der Arbeitsbereichname muss mindestens 2 Zeichen lang sein.",workspaceIcon:"Arbeitsbereich-Symbol",iconDescription:"Wähle ein Emoji oder lade ein benutzerdefiniertes Bild für deinen Arbeitsbereich hoch.",chooseEmoji:"Emoji wählen",customImageUrl:"Benutzerdefinierte Bild-URL",imageUrl:"Bild-URL",imageUrlPlaceholder:"https://beispiel.de/bild.png",imageUrlDescription:"Gib eine gültige URL für dein Arbeitsbereich-Bild ein. Unterstützt PNG-, JPG- und SVG-Formate.",invalidUrl:"Bitte gib eine gültige URL ein",creating:"Wird erstellt...",createWorkspace:"Arbeitsbereich erstellen"},dropdowns:{search:"Suchen...",chooseOption:"Option wählen",chooseCountry:"Land wählen",searchCountry:"Land wählen...",chooseLanguage:"Sprache wählen",searchLanguage:"Sprache wählen...",chooseCurrency:"Währung wählen",searchCurrency:"Währung wählen...",chooseTimezone:"Zeitzone wählen",searchTimezone:"Zeitzone wählen..."},push:{failedToSubscribe:"Push-Benachrichtigungen konnten nicht abonniert werden",failedToUnsubscribe:"Push-Benachrichtigungen konnten nicht abbestellt werden"},errors:{networkError:"Netzwerkfehler: Bitte überprüfe deine Internetverbindung",unauthorized:"Nicht autorisiert — Bitte überprüfe deine Sitzung",notFound:"Ressource nicht gefunden",generic:"Ein Fehler ist aufgetreten",fetchPlans:"Pläne konnten nicht abgerufen werden",fetchPlanGroup:"Plangruppe konnte nicht abgerufen werden",fetchPlanGroupVersion:"Plangruppenversion konnte nicht abgerufen werden",fetchPlanGroupVersions:"Plangruppenversionen konnten nicht abgerufen werden",fetchSubscription:"Abonnement konnte nicht abgerufen werden",createCheckout:"Checkout-Sitzung konnte nicht erstellt werden",updateSubscription:"Abonnement konnte nicht aktualisiert werden",fetchInvoices:"Rechnungen konnten nicht abgerufen werden",fetchInvoice:"Rechnung konnte nicht abgerufen werden",openBillingPortal:"Abrechnungsportal konnte nicht geöffnet werden",cancelSubscription:"Abonnement konnte nicht gekündigt werden",resumeSubscription:"Abonnement konnte nicht fortgesetzt werden",recordUsage:"Nutzung konnte nicht erfasst werden",fetchQuotaUsage:"Kontingentnutzungsstatus konnte nicht abgerufen werden",fetchAllQuotaUsage:"Gesamte Kontingentnutzung konnte nicht abgerufen werden",fetchUsageLogs:"Nutzungsprotokolle konnten nicht abgerufen werden"}}});var VE=Object.freeze({__proto__:null,ja:{settings:{titles:{profile:"アカウント",general:"ワークスペース設定",users:"ワークスペースメンバー",subscription:"プランと請求",usage:"使用状況",features:"ワークスペース機能",notifications:"通知",danger:"危険ゾーン"},sidebar:{account:"アカウント",workspace:"ワークスペース",profile:"アカウント",general:"設定",users:"メンバー",subscription:"プランと請求",usage:"使用状況",features:"機能",notifications:"通知",danger:"危険ゾーン"},common:{refresh:"更新",refreshing:"更新中...",retry:"再試行",retrying:"再試行中...",save:"保存",saving:"保存中...",cancel:"キャンセル",delete:"削除",dismiss:"閉じる",loading:"読み込み中...",success:"成功しました!",error:"エラー",refreshAction:"{loading, select, true {更新中...} other {更新}}",retryAction:"{loading, select, true {再試行中...} other {再試行}}"}},subscription:{managePlan:"プランと請求を管理",changePlan:"プランを変更",viewPricingPlans:"料金プランを見る",viewPlans:"プランを見る",upgradePlan:"今すぐアップグレード",subscribe:"登録する",currentPlan:"現在のプラン",noSubscription:"有効なサブスクリプションがありません",choosePlan:"プランを選択",choosePlanDescription:"プランを比較して、ニーズに合ったものを選択してください",planUpdateAvailable:"プランの更新が利用可能です",updateSuccess:"サブスクリプションが正常に更新されました!",updateFailed:"更新に失敗しました",cancelTitle:"サブスクリプションをキャンセル",cancelConfirm:"サブスクリプションをキャンセルしてもよろしいですか?",cancelKeep:"サブスクリプションを維持",cancelButton:"はい、キャンセルします",canceling:"キャンセル中...",cancelSuccess:"サブスクリプションは請求期間の終了時にキャンセルされます。",cancelNotCharged:"キャンセル後は課金されません",cancelResumeAnytime:"終了前であればいつでもサブスクリプションを再開できます",resumeTitle:"サブスクリプションを再開",resumeConfirm:"サブスクリプションを再開してもよろしいですか?",resumeKeep:"キャンセルのまま維持",resumeButton:"はい、再開します",resuming:"再開中...",resumeSuccess:"サブスクリプションが再開されました。",managePayment:"支払いを管理",openingPortal:"開いています...",viewAllPlans:"すべてのプランを見る",scheduledCancellation:"サブスクリプションのキャンセルが予定されています",paymentPastDue:"支払い期限超過",paymentPastDueDescription:"サービスの中断を避けるため、お支払い方法を更新してください。",subscriptionPaused:"サブスクリプション一時停止中",subscriptionPausedDescription:"サブスクリプションは現在一時停止中です。再開してフルアクセスを復元してください。",errorLoading:"サブスクリプションデータの読み込みエラー",errorLoadingDescription:"接続を確認して、もう一度お試しください。",errorProcessing:"サブスクリプションの処理に失敗しました",errorCanceling:"サブスクリプションのキャンセルに失敗しました",errorResuming:"サブスクリプションの再開に失敗しました",invalidWorkspace:"無効なワークスペースID",billingInterval:{monthly:"月額",quarterly:"四半期",yearly:"年額",perMonth:"/月",perQuarter:"/四半期",perYear:"/年"},seats:{title:"シート",members:"メンバー",included:"含まれる",billable:"課金対象",perExtraSeat:"追加シートあたり",limit:"上限",includedSeats:"含まれるシート数",maxSeats:"最大シート数",freeWithBase:"基本料金に含まれる",allIncluded:"すべて含まれる",extra:"追加",unlimited:"無制限"},items:{features:"機能",limits:"制限",quotas:"使用量クォータ"},checkout:{upgrade:"アップグレード",downgrade:"ダウングレード",switchTo:"切り替え",select:"選択"},status:{active:"有効",canceling:"キャンセル中",trial:"トライアル",canceled:"キャンセル済み",pastDue:"期限超過",paused:"一時停止中",deprecated:"非推奨",unknown:"不明"},plan:"プラン",invoicesTab:"請求書",changePlanButton:"プランを変更",noPlanAssigned:"プランが割り当てられていません",free:"無料",perSeatDisplay:"+ {price}/シート{interval}",estTotalDisplay:"推定合計: {total}{interval} ({count, plural, one {追加シート #} other {追加シート #}})",nextBillingDisplay:"次回請求日: {date}",membersInWorkspace:"ワークスペースに{count, plural, one {# メンバー} other {# メンバー}}",billingInCurrency:"{currency}で請求",savingsPercent:"{percent, number}%お得",switchToInterval:"{interval}に切り替え",seatPriceDisplay:"+ {price}/シート{interval} ({included} {includedLabel})",trialEnded:"トライアル期間が終了しました。",trialEndsIn:"トライアル期間は{days, plural, one {# 日} other {# 日}}で終了します。",onTrial:"トライアル期間中です。",upgradeToKeepAccess:"アクセスを維持するにはアップグレードしてください。",viewInvoices:"請求書を見る",cancelTrial:"トライアルをキャンセル",dunningFinal:"最終警告:サブスクリプションが停止されます",dunningSuspended:"サブスクリプションが停止されました",dunningRecovery:"支払い回収中",dunningSuspendedDescription:"支払いの失敗が繰り返されたため、サブスクリプションが停止されました。アクセスを復元するには、お支払い方法を更新してください。",dunningRecoveryDescription:"お支払いを処理できませんでした。アクセスを失わないよう、お支払い方法を更新してください。",cancelEndDescription:"サブスクリプションの終了日:",cancelEndFallback:"サブスクリプションは現在の請求期間の終了時にキャンセルされます。以降の課金はありません。",resumeChargeDate:"次回の課金日:",resumeChargeFallback:"次回の請求日",resumeContinue:"サブスクリプションは自動的に継続され、プランに基づいて請求されます",resumeCancelAnytime:"次回の請求日前であれば、いつでもキャンセルできます",retainAccess:"このプランへのフルアクセスは次の日まで維持されます:",retainAccessFallback:"現在の請求期間の終了まで",noPlansAvailable:"このワークスペースで利用可能なプラングループがありません。エラーだと思われる場合は、サポートにお問い合わせください。",noPlansAvailableHint:"このワークスペースで利用可能なプラングループがありません。",startTrialDescription:"コミットなしでフルプランをお試しください。いつでもアップグレードまたはキャンセルできます。",noSubscriptionDescription:"ワークスペースを始めるにはプランを選択してください",startFreeTrial:"無料トライアルを開始"},users:{title:"ワークスペースメンバー",adminOnly:"ワークスペース管理者のみがユーザーとロールを管理できます。",inviteByEmail:"メールでメンバーを招待",inviteButton:"招待",inviting:"招待中...",inviteSuccess:"ユーザーが正常に招待されました",emailRequired:"メールアドレスは必須です",invalidEmail:"メールアドレスの形式が無効です",inviteFailed:"メンバーの招待に失敗しました",seatLimitReached:"シート上限に達しました",memberLimitReached:"メンバー上限に達しました",role:"ロール",you:"あなた",owner:"オーナー",noMembers:"このワークスペースにメンバーが見つかりません。",extraSeatCost:"追加メンバーごとにサブスクリプションに{price}/{interval, select, yearly {年} quarterly {四半期} other {月}}が追加されます",unknownUser:"不明なユーザー",seats:"シート",members:"メンバー",included:"含まれる",perExtraSeat:"/追加シート",maxMembers:"最大メンバー数",available:"利用可能",noMemberLimit:"メンバー制限なし",seatHeading:"{hasSeatPricing, select, true {シート} other {メンバー}}",limitReached:"{reason, select, seat_limit_reached {シート上限に達しました} other {メンバー上限に達しました}}",memberCount:"{count, plural, one {# メンバー} other {# メンバー}}",subscriptionRequired:"メンバーを招待するにはサブスクリプションが必要です。",seatLimitMessage:"プランでは最大{maxUsers, number}メンバーまで許可されています。シートを増やすにはアップグレードしてください。",settingsLimitMessage:"このワークスペースでは最大{maxUsers, number}メンバーまで許可されています。",memberLimitMessage:"メンバー上限の{maxUsers, number}に達しました。",selectRole:"ロールを選択",inviteAs:"{role}として招待"},invoices:{title:"請求履歴",description:"請求書の確認とダウンロード",pay:"支払う",view:"表示",viewDetails:"詳細を表示",download:"PDF",errorLoading:"請求書の読み込みエラー",noInvoices:"請求書はまだありません。プランに登録すると請求書が発行されます。",noInvoicesWithSub:"ダウンロード可能な請求書が見つかりません",paidAmount:"支払済: {amount}",na:"該当なし",status:{draft:"下書き",open:"未払い",paid:"支払済",uncollectible:"回収不能",void:"無効"}},usage:{title:"使用状況",description:"リソース消費量とクォータを監視",totalResources:"合計リソース",overallUsage:"全体の使用状況",inOverage:"超過中",estOverageCost:"推定超過コスト",overageDetected:"超過を検出",overageDescription:"追加使用分は次回の請求書で超過分として課金されます。",overageUnits:"超過ユニット",rate:"料金",billableBlocks:"課金対象ブロック",estimatedCharge:"推定料金",noData:"このワークスペースのクォータ使用データがありません。",noDataHint:"プランに従量制リソースが含まれると、ここにクォータが表示されます。",used:"使用済み",remaining:"残り",overLimit:"上限超過",percentUsed:"{percent, number}%使用済み",availableRemaining:"残り{count}",overLimitCount:"{count}が上限超過",overageWarning:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}追加使用分は次回の請求書で超過分として課金されます。",fullyUsed:"全量使用済み",renewingSoon:"まもなく更新",almostFull:"ほぼ上限",overage:"超過",errorLoading:"使用状況データの読み込みに失敗しました",perUnit:"/ ユニット",perUnits:"/ ユニット",rateDisplay:"{rate} {unitSize, plural, =1 {/ ユニット} other {/ {unitSize, number} ユニット}}",resourcesExceeded:"{count, plural, one {# リソースが含まれるクォータを超過しました。} other {# リソースが含まれるクォータを超過しました。}}",estOverageCharges:"この期間の推定超過料金: {amount}",overageRateDisplay:"超過料金: {rate}",resetDateDisplay:"使用量は{date}にリセットされます",daysRemainingDisplay:"{count, plural, one {残り # 日} other {残り # 日}}"},profile:{email:"メールアドレス",name:"名前",language:"言語",country:"国",currency:"通貨",timezone:"タイムゾーン",profileImage:"プロフィール画像",success:"プロフィールが正常に保存されました",nameMinLength:"名前は2文字以上で入力してください。",save:"保存",reset:"リセット"},general:{ownerOnly:"ワークスペースのオーナーのみが設定を変更できます。",name:"名前",namePlaceholder:"マイワークスペース",nameMinLength:"ワークスペース名は2文字以上で入力してください。",billingCurrency:"請求通貨",icon:"アイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",previewLabel:"プレビュー:",success:"ワークスペース設定が正常に保存されました",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",updateWorkspace:"ワークスペースを更新"},features:{title:"ワークスペース機能",ownerOnly:"ワークスペースのオーナーのみが機能を変更できます。",noFeatures:"ワークスペースに管理可能な機能がありません。",enabled:"有効",disabled:"無効",enabling:"有効化中",disabling:"無効化中",featureSuccess:"成功",updateSuccess:"{feature}が正常に{enabled, select, true {有効化} other {無効化}}されました",actionStatus:"{action, select, enabling {有効化中} disabling {無効化中} other {}}"},danger:{title:"ワークスペースを削除",adminOnly:"管理者のみがワークスペースを削除できます。",deleteWorkspace:"ワークスペースを削除",deleteConfirm:"本当によろしいですか?",deleteWarning:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",deleting:"削除中...",deleteDescription:"ワークスペースを削除すると元に戻すことはできません。ワークスペースとメンバー、設定、機能を含むすべてのデータが完全に削除されます。",deleteConfirmDescription:"この操作は取り消せません。ワークスペースと関連するすべてのデータが完全に削除されます。",failedToDelete:"ワークスペースの削除に失敗しました"},notifications:{title:"通知設定",permissionDenied:"通知の権限が拒否されました",notSupported:"このブラウザではプッシュ通知はサポートされていません。",manageDescription:"このワークスペースからの通知の受信方法を管理します。",blocked:"通知がブロックされています",blockedDescription:"このサイトの通知を以前ブロックしました。有効にするには、ブラウザの設定を更新してください:",pushTitle:"プッシュ通知",pushEnabledDescription:"重要な更新についてブラウザ通知を受信します。",pushDisabledDescription:"支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。",enabling:"有効化中...",disabling:"無効化中...",enable:"有効にする",disable:"無効にする",toggleAction:"{loading, select, true {{subscribed, select, true {無効化中...} other {有効化中...}}} other {{subscribed, select, true {無効にする} other {有効にする}}}}",pushDescription:"{subscribed, select, true {重要な更新についてブラウザ通知を受信します。} other {支払い問題、トライアル期限、その他の重要な更新についての通知を受け取ります。}}",deviceNote:"通知はこのデバイスに送信されます。他のデバイスでは個別に有効にしてください。",unblock:{firefox:{step1:"アドレスバーの鍵アイコン(またはシールドアイコン)をクリック",step2:"権限リストで「通知」を見つける",step3:"「ブロック」から「許可」に変更",step4:"このページを再読み込み"},safari:{step1:"Safari → 設定 → Webサイト → 通知 を開く",step2:"リストからこのWebサイトを見つける",step3:"「拒否」から「許可」に変更",step4:"このページを再読み込み"},edge:{step1:"アドレスバーの鍵アイコンをクリック",step2:"「このサイトの権限」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"},chrome:{step1:"アドレスバーの鍵アイコン(またはチューンアイコン)をクリック",step2:"「サイトの設定」をクリック",step3:"「通知」を「許可」に設定",step4:"このページを再読み込み"}}},quota:{includedOnly:"{count, number}件含まれる",includedWithOverage:"{count, number}件含まれる、以降{price} / {unit}",unitFallback:"ユニット"},pricing:{title:"プランを選択",description:"プランを比較して、ニーズに合ったものを選択してください",currency:"通貨",billingIn:"請求通貨",noPlansCurrency:"お使いの請求通貨で利用可能なプランがありません。",noPlansCurrencyHint:"エラーが発生しました。サポートにお問い合わせください。",noPlans:"利用可能なプランがありません",free:"無料",included:"含まれる",save:"お得",current:"現在",processing:"処理中...",unavailable:"利用不可",selectCurrency:"請求通貨を選択",billingInterval:"請求間隔"},beta:{nameLabel:"名前",emailLabel:"メールアドレス",submitText:"送信",submittingText:"送信中...",errorMessage:"エラーが発生しました",tryAgain:"再試行",privacyConsent:"このフォームを送信することで、以下に同意したことになります:",privacyPolicy:"プライバシーポリシー",and:"および",termsOfService:"利用規約"},workspace:{switchTitle:"ワークスペースを切り替え",switchDescription:"ワークスペースを選択するか、新しく作成してください。",notLoggedIn:"ログインしていないようです。続行するにはログインしてください。",availableWorkspaces:"利用可能なワークスペース ({count, number})",loadingWorkspaces:"ワークスペースを読み込み中...",searchPlaceholder:"ワークスペースを検索...",noWorkspacesFound:"ワークスペースが見つかりません",noWorkspacesAvailable:"利用可能なワークスペースがありません",switchTo:"切り替え",membersCount:"{count, plural, one {# メンバー} other {# メンバー}}",createNew:"新しいワークスペースを作成",createTitle:"新しいワークスペースを作成",createDescription:"新しいワークスペースを作成して始めましょう。",workspaceName:"ワークスペース名",workspaceNamePlaceholder:"マイワークスペース",workspaceNameMinLength:"ワークスペース名は2文字以上で入力してください。",workspaceIcon:"ワークスペースアイコン",iconDescription:"絵文字を選択するか、ワークスペース用のカスタム画像をアップロードしてください。",chooseEmoji:"絵文字を選択",customImageUrl:"カスタム画像URL",imageUrl:"画像URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"ワークスペース画像の有効なURLを入力してください。PNG、JPG、SVG形式に対応しています。",invalidUrl:"有効なURLを入力してください",creating:"作成中...",createWorkspace:"ワークスペースを作成"},dropdowns:{search:"検索...",chooseOption:"オプションを選択",chooseCountry:"国を選択",searchCountry:"国を選択...",chooseLanguage:"言語を選択",searchLanguage:"言語を選択...",chooseCurrency:"通貨を選択",searchCurrency:"通貨を選択...",chooseTimezone:"タイムゾーンを選択",searchTimezone:"タイムゾーンを選択..."},push:{failedToSubscribe:"プッシュ通知の登録に失敗しました",failedToUnsubscribe:"プッシュ通知の解除に失敗しました"},errors:{networkError:"ネットワークエラー:インターネット接続を確認してください",unauthorized:"認証エラー — セッションを確認してください",notFound:"リソースが見つかりません",generic:"エラーが発生しました",fetchPlans:"プランの取得に失敗しました",fetchPlanGroup:"プラングループの取得に失敗しました",fetchPlanGroupVersion:"プラングループバージョンの取得に失敗しました",fetchPlanGroupVersions:"プラングループバージョン一覧の取得に失敗しました",fetchSubscription:"サブスクリプションの取得に失敗しました",createCheckout:"チェックアウトセッションの作成に失敗しました",updateSubscription:"サブスクリプションの更新に失敗しました",fetchInvoices:"請求書の取得に失敗しました",fetchInvoice:"請求書の取得に失敗しました",openBillingPortal:"請求ポータルを開けませんでした",cancelSubscription:"サブスクリプションのキャンセルに失敗しました",resumeSubscription:"サブスクリプションの再開に失敗しました",recordUsage:"使用量の記録に失敗しました",fetchQuotaUsage:"クォータ使用状況の取得に失敗しました",fetchAllQuotaUsage:"全クォータ使用状況の取得に失敗しました",fetchUsageLogs:"使用ログの取得に失敗しました"}}});var HE=Object.freeze({__proto__:null,zh:{settings:{titles:{profile:"账户",general:"工作区设置",users:"工作区成员",subscription:"套餐与账单",usage:"用量",features:"工作区功能",notifications:"通知",danger:"危险区域"},sidebar:{account:"账户",workspace:"工作区",profile:"账户",general:"设置",users:"成员",subscription:"套餐与账单",usage:"用量",features:"功能",notifications:"通知",danger:"危险区域"},common:{refresh:"刷新",refreshing:"正在刷新...",retry:"重试",retrying:"正在重试...",save:"保存",saving:"正在保存...",cancel:"取消",delete:"删除",dismiss:"关闭",loading:"正在加载...",success:"操作成功!",error:"错误",refreshAction:"{loading, select, true {正在刷新...} other {刷新}}",retryAction:"{loading, select, true {正在重试...} other {重试}}"}},subscription:{managePlan:"管理您的套餐和账单",changePlan:"更改套餐",viewPricingPlans:"查看价格方案",viewPlans:"查看套餐",upgradePlan:"立即升级",subscribe:"订阅",currentPlan:"当前套餐",noSubscription:"您没有有效的订阅",choosePlan:"选择您的套餐",choosePlanDescription:"比较各套餐,选择最适合您需求的方案",planUpdateAvailable:"套餐更新可用",updateSuccess:"订阅已成功更新!",updateFailed:"更新失败",cancelTitle:"取消订阅",cancelConfirm:"您确定要取消订阅吗?",cancelKeep:"保留订阅",cancelButton:"是的,取消订阅",canceling:"正在取消...",cancelSuccess:"订阅将在当前计费周期结束时取消。",cancelNotCharged:"取消后将不再收费",cancelResumeAnytime:"您可以在订阅结束前随时恢复",resumeTitle:"恢复订阅",resumeConfirm:"您确定要恢复订阅吗?",resumeKeep:"保持取消状态",resumeButton:"是的,恢复订阅",resuming:"正在恢复...",resumeSuccess:"订阅已恢复。",managePayment:"管理支付方式",openingPortal:"正在打开...",viewAllPlans:"查看所有套餐",scheduledCancellation:"订阅已安排取消",paymentPastDue:"付款逾期",paymentPastDueDescription:"请更新您的支付方式以避免服务中断。",subscriptionPaused:"订阅已暂停",subscriptionPausedDescription:"您的订阅当前已暂停。恢复订阅以获得完整访问权限。",errorLoading:"加载订阅数据时出错",errorLoadingDescription:"请检查您的网络连接并重试。",errorProcessing:"订阅处理失败",errorCanceling:"取消订阅失败",errorResuming:"恢复订阅失败",invalidWorkspace:"无效的工作区 ID",billingInterval:{monthly:"月付",quarterly:"季付",yearly:"年付",perMonth:"/月",perQuarter:"/季",perYear:"/年"},seats:{title:"席位",members:"成员",included:"包含",billable:"计费",perExtraSeat:"每增加一个席位",limit:"上限",includedSeats:"包含席位数",maxSeats:"最大席位数",freeWithBase:"包含在基础价格中",allIncluded:"全部包含",extra:"额外",unlimited:"不限"},items:{features:"功能",limits:"限制",quotas:"用量配额"},checkout:{upgrade:"升级",downgrade:"降级",switchTo:"切换至",select:"选择"},status:{active:"有效",canceling:"取消中",trial:"试用",canceled:"已取消",pastDue:"逾期",paused:"已暂停",deprecated:"已弃用",unknown:"未知"},plan:"套餐",invoicesTab:"账单",changePlanButton:"更改套餐",noPlanAssigned:"未分配套餐",free:"免费",perSeatDisplay:"+ {price}/席位{interval}",estTotalDisplay:"预估总计:{total}{interval}({count, plural, one {# 个额外席位} other {# 个额外席位}})",nextBillingDisplay:"下次计费日:{date}",membersInWorkspace:"工作区有 {count, plural, one {# 名成员} other {# 名成员}}",billingInCurrency:"以{currency}计费",savingsPercent:"节省 {percent, number}%",switchToInterval:"切换至{interval}",seatPriceDisplay:"+ {price}/席位{interval}({included} {includedLabel})",trialEnded:"您的试用期已结束。",trialEndsIn:"您的试用期将在 {days, plural, one {# 天} other {# 天}}后结束。",onTrial:"您正在试用中。",upgradeToKeepAccess:"升级以保留访问权限。",viewInvoices:"查看账单",cancelTrial:"取消试用",dunningFinal:"最终警告:订阅将被暂停",dunningSuspended:"订阅已暂停",dunningRecovery:"付款恢复中",dunningSuspendedDescription:"由于多次付款失败,您的订阅已被暂停。请更新支付方式以恢复访问权限。",dunningRecoveryDescription:"我们无法处理您的付款。请更新您的支付方式以避免失去访问权限。",cancelEndDescription:"您的订阅将于以下日期结束:",cancelEndFallback:"您的订阅将在当前计费周期结束时取消,之后将不再收费。",resumeChargeDate:"将于以下日期再次收费:",resumeChargeFallback:"下一个计费日",resumeContinue:"您的订阅将自动继续,并按照套餐计费",resumeCancelAnytime:"如果您改变主意,可以在下一个计费日之前随时取消",retainAccess:"您将保留此套餐的完整访问权限直到",retainAccessFallback:"当前计费周期结束",noPlansAvailable:"此工作区没有可用的套餐组。如果您认为这是一个错误,请联系客服。",noPlansAvailableHint:"此工作区没有可用的套餐组。",startTrialDescription:"免费试用完整套餐,无需承诺。您可以随时升级或取消。",noSubscriptionDescription:"选择一个套餐来开始使用您的工作区",startFreeTrial:"开始免费试用"},users:{title:"工作区成员",adminOnly:"只有工作区管理员才能管理用户和角色。",inviteByEmail:"通过电子邮件邀请成员",inviteButton:"邀请",inviting:"正在邀请...",inviteSuccess:"用户邀请成功",emailRequired:"电子邮件为必填项",invalidEmail:"电子邮件地址格式无效",inviteFailed:"邀请成员失败",seatLimitReached:"已达到席位上限",memberLimitReached:"已达到成员上限",role:"角色",you:"您",owner:"拥有者",noMembers:"此工作区未找到成员。",extraSeatCost:"每增加一名成员将增加{price}/{interval, select, yearly {年} quarterly {季} other {月}}的订阅费用",unknownUser:"未知用户",seats:"席位",members:"成员",included:"包含",perExtraSeat:"/额外席位",maxMembers:"最大成员数",available:"可用",noMemberLimit:"无成员限制",seatHeading:"{hasSeatPricing, select, true {席位} other {成员}}",limitReached:"{reason, select, seat_limit_reached {已达到席位上限} other {已达到成员上限}}",memberCount:"{count, plural, one {# 名成员} other {# 名成员}}",subscriptionRequired:"邀请成员需要有效订阅。",seatLimitMessage:"您的套餐最多允许 {maxUsers, number} 名成员。升级以获得更多席位。",settingsLimitMessage:"此工作区最多允许 {maxUsers, number} 名成员。",memberLimitMessage:"已达到成员上限 {maxUsers, number}。",selectRole:"选择角色",inviteAs:"以{role}身份邀请"},invoices:{title:"账单历史",description:"查看和下载您的账单",pay:"支付",view:"查看",viewDetails:"查看详情",download:"PDF",errorLoading:"加载账单时出错",noInvoices:"暂无账单。订阅套餐后将生成账单。",noInvoicesWithSub:"未找到可下载的账单",paidAmount:"已支付:{amount}",na:"不适用",status:{draft:"草稿",open:"待支付",paid:"已支付",uncollectible:"无法收回",void:"已作废"}},usage:{title:"用量",description:"监控您的资源消耗和配额",totalResources:"总资源",overallUsage:"总体用量",inOverage:"超额中",estOverageCost:"预估超额费用",overageDetected:"检测到超额",overageDescription:"额外用量将作为超额部分在下次账单中收取。",overageUnits:"超额单位",rate:"费率",billableBlocks:"计费块",estimatedCharge:"预估费用",noData:"此工作区没有可用的配额使用数据。",noDataHint:"当您的套餐包含计量资源时,配额将在此处显示。",used:"已使用",remaining:"剩余",overLimit:"超出上限",percentUsed:"已使用 {percent, number}%",availableRemaining:"剩余 {count}",overLimitCount:"{count} 超出上限",overageWarning:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}额外用量将作为超额部分在下次账单中收取。",fullyUsed:"已全部使用",renewingSoon:"即将续期",almostFull:"即将用完",overage:"超额",errorLoading:"加载用量数据失败",perUnit:"/ 单位",perUnits:"/ 单位",rateDisplay:"{rate} {unitSize, plural, =1 {/ 单位} other {/ {unitSize, number} 单位}}",resourcesExceeded:"{count, plural, one {# 项资源已超出包含的配额。} other {# 项资源已超出包含的配额。}}",estOverageCharges:"本期预估超额费用:{amount}",overageRateDisplay:"超额费率:{rate}",resetDateDisplay:"用量将于 {date} 重置",daysRemainingDisplay:"{count, plural, one {剩余 # 天} other {剩余 # 天}}"},profile:{email:"电子邮件",name:"姓名",language:"语言",country:"国家/地区",currency:"货币",timezone:"时区",profileImage:"头像",success:"个人资料保存成功",nameMinLength:"姓名至少需要2个字符。",save:"保存",reset:"重置"},general:{ownerOnly:"只有工作区拥有者才能更改设置。",name:"名称",namePlaceholder:"我的工作区",nameMinLength:"工作区名称至少需要2个字符。",billingCurrency:"计费货币",icon:"图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",previewLabel:"预览:",success:"工作区设置保存成功",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",updateWorkspace:"更新工作区"},features:{title:"工作区功能",ownerOnly:"只有工作区拥有者才能更改功能。",noFeatures:"工作区没有可管理的功能。",enabled:"已启用",disabled:"已禁用",enabling:"正在启用",disabling:"正在禁用",featureSuccess:"成功",updateSuccess:"{feature}已成功{enabled, select, true {启用} other {禁用}}",actionStatus:"{action, select, enabling {正在启用} disabling {正在禁用} other {}}"},danger:{title:"删除工作区",adminOnly:"只有管理员才能删除工作区。",deleteWorkspace:"删除工作区",deleteConfirm:"您确定吗?",deleteWarning:"此操作不可撤销。这将永久删除工作区及所有相关数据。",deleting:"正在删除...",deleteDescription:"一旦删除工作区,将无法恢复。这将永久删除工作区及其所有数据,包括成员、设置和功能。",deleteConfirmDescription:"此操作不可撤销。这将永久删除工作区及所有相关数据。",failedToDelete:"删除工作区失败"},notifications:{title:"通知偏好设置",permissionDenied:"通知权限被拒绝",notSupported:"此浏览器不支持推送通知。",manageDescription:"管理您从此工作区接收通知的方式。",blocked:"通知已被阻止",blockedDescription:"您之前阻止了此网站的通知。要启用通知,请更新浏览器设置:",pushTitle:"推送通知",pushEnabledDescription:"您将收到重要更新的浏览器通知。",pushDisabledDescription:"接收有关付款问题、试用到期和其他重要更新的通知。",enabling:"正在启用...",disabling:"正在禁用...",enable:"启用",disable:"禁用",toggleAction:"{loading, select, true {{subscribed, select, true {正在禁用...} other {正在启用...}}} other {{subscribed, select, true {禁用} other {启用}}}}",pushDescription:"{subscribed, select, true {您将收到重要更新的浏览器通知。} other {接收有关付款问题、试用到期和其他重要更新的通知。}}",deviceNote:"通知将发送到此设备。请在其他设备上单独启用。",unblock:{firefox:{step1:"点击地址栏中的锁形图标(或盾形图标)",step2:'在权限列表中找到"通知"',step3:'将"阻止"更改为"允许"',step4:"重新加载此页面"},safari:{step1:"打开 Safari → 设置 → 网站 → 通知",step2:"在列表中找到此网站",step3:'将"拒绝"更改为"允许"',step4:"重新加载此页面"},edge:{step1:"点击地址栏中的锁形图标",step2:'点击"此站点的权限"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"},chrome:{step1:"点击地址栏中的锁形图标(或调节图标)",step2:'点击"网站设置"',step3:'将"通知"设置为"允许"',step4:"重新加载此页面"}}},quota:{includedOnly:"包含 {count, number} 个",includedWithOverage:"包含 {count, number} 个,之后 {price} / {unit}",unitFallback:"单位"},pricing:{title:"选择您的套餐",description:"比较各套餐,选择最适合您需求的方案",currency:"货币",billingIn:"计费货币",noPlansCurrency:"没有适用于您的计费货币的套餐。",noPlansCurrencyHint:"出现错误,请联系客服。",noPlans:"没有可用的套餐",free:"免费",included:"包含",save:"节省",current:"当前",processing:"正在处理...",unavailable:"不可用",selectCurrency:"选择计费货币",billingInterval:"计费周期"},beta:{nameLabel:"姓名",emailLabel:"电子邮件",submitText:"提交",submittingText:"正在提交...",errorMessage:"发生错误",tryAgain:"重试",privacyConsent:"提交此表单即表示您同意我们的",privacyPolicy:"隐私政策",and:"和",termsOfService:"服务条款"},workspace:{switchTitle:"切换工作区",switchDescription:"选择一个工作区或创建新的工作区。",notLoggedIn:"您似乎尚未登录。请登录后继续。",availableWorkspaces:"可用工作区 ({count, number})",loadingWorkspaces:"正在加载工作区...",searchPlaceholder:"搜索工作区...",noWorkspacesFound:"未找到工作区",noWorkspacesAvailable:"没有可用的工作区",switchTo:"切换至",membersCount:"{count, plural, one {# 名成员} other {# 名成员}}",createNew:"创建新工作区",createTitle:"创建新工作区",createDescription:"创建一个新的工作区来开始使用。",workspaceName:"工作区名称",workspaceNamePlaceholder:"我的工作区",workspaceNameMinLength:"工作区名称至少需要2个字符。",workspaceIcon:"工作区图标",iconDescription:"选择一个表情符号或为您的工作区上传自定义图片。",chooseEmoji:"选择表情",customImageUrl:"自定义图片 URL",imageUrl:"图片 URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"输入工作区图片的有效 URL。支持 PNG、JPG 和 SVG 格式。",invalidUrl:"请输入有效的 URL",creating:"正在创建...",createWorkspace:"创建工作区"},dropdowns:{search:"搜索...",chooseOption:"选择选项",chooseCountry:"选择国家/地区",searchCountry:"选择国家/地区...",chooseLanguage:"选择语言",searchLanguage:"选择语言...",chooseCurrency:"选择货币",searchCurrency:"选择货币...",chooseTimezone:"选择时区",searchTimezone:"选择时区..."},push:{failedToSubscribe:"订阅推送通知失败",failedToUnsubscribe:"取消订阅推送通知失败"},errors:{networkError:"网络错误:请检查您的网络连接",unauthorized:"未授权 — 请检查您的会话",notFound:"资源未找到",generic:"发生错误",fetchPlans:"获取套餐失败",fetchPlanGroup:"获取套餐组失败",fetchPlanGroupVersion:"获取套餐组版本失败",fetchPlanGroupVersions:"获取套餐组版本列表失败",fetchSubscription:"获取订阅信息失败",createCheckout:"创建结账会话失败",updateSubscription:"更新订阅失败",fetchInvoices:"获取账单失败",fetchInvoice:"获取账单失败",openBillingPortal:"打开账单门户失败",cancelSubscription:"取消订阅失败",resumeSubscription:"恢复订阅失败",recordUsage:"记录用量失败",fetchQuotaUsage:"获取配额使用状态失败",fetchAllQuotaUsage:"获取所有配额使用情况失败",fetchUsageLogs:"获取使用日志失败"}}});var GE=Object.freeze({__proto__:null,hi:{settings:{titles:{profile:"खाता",general:"वर्कस्पेस सेटिंग्स",users:"वर्कस्पेस सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",features:"वर्कस्पेस फ़ीचर्स",notifications:"सूचनाएँ",danger:"खतरनाक ज़ोन"},sidebar:{account:"खाता",workspace:"वर्कस्पेस",profile:"खाता",general:"सेटिंग्स",users:"सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",features:"फ़ीचर्स",notifications:"सूचनाएँ",danger:"खतरनाक ज़ोन"},common:{refresh:"रीफ़्रेश",refreshing:"रीफ़्रेश हो रहा है...",retry:"पुनः प्रयास",retrying:"पुनः प्रयास हो रहा है...",save:"सहेजें",saving:"सहेजा जा रहा है...",cancel:"रद्द करें",delete:"हटाएँ",dismiss:"खारिज करें",loading:"लोड हो रहा है...",success:"सफल!",error:"त्रुटि",refreshAction:"{loading, select, true {रीफ़्रेश हो रहा है...} other {रीफ़्रेश}}",retryAction:"{loading, select, true {पुनः प्रयास हो रहा है...} other {पुनः प्रयास}}"}},subscription:{managePlan:"अपना प्लान और बिलिंग प्रबंधित करें",changePlan:"प्लान बदलें",viewPricingPlans:"मूल्य निर्धारण प्लान देखें",viewPlans:"प्लान देखें",upgradePlan:"अभी अपग्रेड करें",subscribe:"सदस्यता लें",currentPlan:"वर्तमान प्लान",noSubscription:"आपके पास कोई सक्रिय सदस्यता नहीं है",choosePlan:"अपना प्लान चुनें",choosePlanDescription:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",planUpdateAvailable:"प्लान अपडेट उपलब्ध है",updateSuccess:"सदस्यता सफलतापूर्वक अपडेट हो गई!",updateFailed:"अपडेट विफल",cancelTitle:"सदस्यता रद्द करें",cancelConfirm:"क्या आप वाकई अपनी सदस्यता रद्द करना चाहते हैं?",cancelKeep:"सदस्यता बनाए रखें",cancelButton:"हाँ, सदस्यता रद्द करें",canceling:"रद्द किया जा रहा है...",cancelSuccess:"बिलिंग अवधि के अंत में सदस्यता रद्द कर दी जाएगी।",cancelNotCharged:"रद्द करने के बाद आपसे दोबारा शुल्क नहीं लिया जाएगा",cancelResumeAnytime:"आप सदस्यता समाप्त होने से पहले कभी भी इसे फिर से शुरू कर सकते हैं",resumeTitle:"सदस्यता फिर से शुरू करें",resumeConfirm:"क्या आप वाकई अपनी सदस्यता फिर से शुरू करना चाहते हैं?",resumeKeep:"रद्द रखें",resumeButton:"हाँ, सदस्यता फिर से शुरू करें",resuming:"फिर से शुरू हो रहा है...",resumeSuccess:"सदस्यता फिर से शुरू हो गई है।",managePayment:"भुगतान प्रबंधित करें",openingPortal:"खोला जा रहा है...",viewAllPlans:"सभी प्लान देखें",scheduledCancellation:"सदस्यता रद्द करने के लिए निर्धारित",paymentPastDue:"भुगतान अतिदेय",paymentPastDueDescription:"सेवा में रुकावट से बचने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",subscriptionPaused:"सदस्यता रुकी हुई है",subscriptionPausedDescription:"आपकी सदस्यता वर्तमान में रुकी हुई है। पूर्ण पहुँच बहाल करने के लिए फिर से शुरू करें।",errorLoading:"सदस्यता डेटा लोड करने में त्रुटि",errorLoadingDescription:"कृपया अपना कनेक्शन जाँचें और पुनः प्रयास करें।",errorProcessing:"सदस्यता प्रोसेस करने में विफल",errorCanceling:"सदस्यता रद्द करने में विफल",errorResuming:"सदस्यता फिर से शुरू करने में विफल",invalidWorkspace:"अमान्य वर्कस्पेस ID",billingInterval:{monthly:"मासिक",quarterly:"तिमाही",yearly:"वार्षिक",perMonth:"/माह",perQuarter:"/तिमाही",perYear:"/वर्ष"},seats:{title:"सीटें",members:"सदस्य",included:"शामिल",billable:"बिल योग्य",perExtraSeat:"प्रति अतिरिक्त सीट",limit:"सीमा",includedSeats:"शामिल सीटें",maxSeats:"अधिकतम सीटें",freeWithBase:"मूल कीमत में मुफ़्त",allIncluded:"सभी शामिल",extra:"अतिरिक्त",unlimited:"असीमित"},items:{features:"फ़ीचर्स",limits:"सीमाएँ",quotas:"उपयोग कोटा"},checkout:{upgrade:"अपग्रेड",downgrade:"डाउनग्रेड",switchTo:"बदलें",select:"चुनें"},status:{active:"सक्रिय",canceling:"रद्द हो रहा है",trial:"ट्रायल",canceled:"रद्द",pastDue:"अतिदेय",paused:"रुका हुआ",deprecated:"पुराना",unknown:"अज्ञात"},plan:"प्लान",invoicesTab:"चालान",changePlanButton:"प्लान बदलें",noPlanAssigned:"कोई प्लान नहीं",free:"मुफ़्त",perSeatDisplay:"+ {price}/सीट{interval}",estTotalDisplay:"अनुमानित कुल: {total}{interval} ({count, plural, one {# अतिरिक्त सीट} other {# अतिरिक्त सीटें}})",nextBillingDisplay:"अगली बिलिंग: {date}",membersInWorkspace:"वर्कस्पेस में {count, plural, one {# सदस्य} other {# सदस्य}}",billingInCurrency:"{currency} में बिलिंग",savingsPercent:"{percent, number}% बचाएँ",switchToInterval:"{interval} पर बदलें",seatPriceDisplay:"+ {price}/सीट{interval} ({included} {includedLabel})",trialEnded:"आपका ट्रायल समाप्त हो गया है।",trialEndsIn:"आपका ट्रायल {days, plural, one {# दिन} other {# दिनों}} में समाप्त होगा।",onTrial:"आप ट्रायल पर हैं।",upgradeToKeepAccess:"पहुँच बनाए रखने के लिए अपग्रेड करें।",viewInvoices:"चालान देखें",cancelTrial:"ट्रायल रद्द करें",dunningFinal:"अंतिम चेतावनी: सदस्यता निलंबित की जाएगी",dunningSuspended:"सदस्यता निलंबित",dunningRecovery:"भुगतान वसूली प्रक्रिया चल रही है",dunningSuspendedDescription:"बार-बार भुगतान विफल होने के कारण आपकी सदस्यता निलंबित कर दी गई है। पहुँच बहाल करने के लिए अपना भुगतान तरीका अपडेट करें।",dunningRecoveryDescription:"हम आपका भुगतान प्रोसेस करने में असमर्थ रहे। पहुँच न खोने के लिए कृपया अपना भुगतान तरीका अपडेट करें।",cancelEndDescription:"आपकी सदस्यता इस तारीख को समाप्त होगी",cancelEndFallback:"वर्तमान बिलिंग अवधि के अंत में आपकी सदस्यता रद्द कर दी जाएगी। आपसे दोबारा शुल्क नहीं लिया जाएगा।",resumeChargeDate:"आपसे फिर से शुल्क लिया जाएगा",resumeChargeFallback:"अगली बिलिंग तिथि",resumeContinue:"आपकी सदस्यता स्वचालित रूप से जारी रहेगी और आपसे आपके प्लान के अनुसार बिल लिया जाएगा",resumeCancelAnytime:"अगर आप अपना मन बदलते हैं तो अगली बिलिंग तिथि से पहले कभी भी रद्द कर सकते हैं",retainAccess:"आपके पास इस प्लान की पूर्ण पहुँच बनी रहेगी",retainAccessFallback:"आपकी वर्तमान बिलिंग अवधि के अंत तक",noPlansAvailable:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है। अगर आपको लगता है कि यह त्रुटि है तो कृपया सहायता से संपर्क करें।",noPlansAvailableHint:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है।",startTrialDescription:"बिना किसी प्रतिबद्धता के पूरा प्लान आज़माएँ। आप कभी भी अपग्रेड या रद्द कर सकते हैं।",noSubscriptionDescription:"अपने वर्कस्पेस के लिए एक प्लान चुनें",startFreeTrial:"मुफ़्त ट्रायल शुरू करें"},users:{title:"वर्कस्पेस सदस्य",adminOnly:"केवल वर्कस्पेस एडमिन ही उपयोगकर्ताओं और भूमिकाओं को प्रबंधित कर सकते हैं।",inviteByEmail:"ईमेल से सदस्य आमंत्रित करें",inviteButton:"आमंत्रित करें",inviting:"आमंत्रित किया जा रहा है...",inviteSuccess:"उपयोगकर्ता सफलतापूर्वक आमंत्रित किया गया",emailRequired:"ईमेल आवश्यक है",invalidEmail:"अमान्य ईमेल पता प्रारूप",inviteFailed:"सदस्य को आमंत्रित करने में विफल",seatLimitReached:"सीट सीमा पूरी हो गई",memberLimitReached:"सदस्य सीमा पूरी हो गई",role:"भूमिका",you:"आप",owner:"मालिक",noMembers:"इस वर्कस्पेस में कोई सदस्य नहीं मिला।",extraSeatCost:"प्रत्येक अतिरिक्त सदस्य आपकी सदस्यता में {price}/{interval, select, yearly {वर्ष} quarterly {तिमाही} other {माह}} जोड़ता है",unknownUser:"अज्ञात उपयोगकर्ता",seats:"सीटें",members:"सदस्य",included:"शामिल",perExtraSeat:"/अतिरिक्त सीट",maxMembers:"अधिकतम सदस्य",available:"उपलब्ध",noMemberLimit:"कोई सदस्य सीमा नहीं",seatHeading:"{hasSeatPricing, select, true {सीटें} other {सदस्य}}",limitReached:"{reason, select, seat_limit_reached {सीट सीमा पूरी हो गई} other {सदस्य सीमा पूरी हो गई}}",memberCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",subscriptionRequired:"सदस्यों को आमंत्रित करने के लिए सदस्यता आवश्यक है।",seatLimitMessage:"आपका प्लान अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है। अधिक सीटों के लिए अपग्रेड करें।",settingsLimitMessage:"यह वर्कस्पेस अधिकतम {maxUsers, number} सदस्यों की अनुमति देता है।",memberLimitMessage:"{maxUsers, number} सदस्यों की सीमा पूरी हो गई है।",selectRole:"भूमिका चुनें",inviteAs:"{role} के रूप में आमंत्रित करें"},invoices:{title:"बिलिंग इतिहास",description:"अपने चालान देखें और डाउनलोड करें",pay:"भुगतान करें",view:"देखें",viewDetails:"विवरण देखें",download:"PDF",errorLoading:"चालान लोड करने में त्रुटि",noInvoices:"अभी कोई चालान नहीं। चालान प्राप्त करने के लिए एक प्लान की सदस्यता लें।",noInvoicesWithSub:"डाउनलोड विकल्प वाला कोई चालान नहीं मिला",paidAmount:"भुगतान किया: {amount}",na:"लागू नहीं",status:{draft:"ड्राफ़्ट",open:"खुला",paid:"भुगतान हो गया",uncollectible:"अप्राप्य",void:"शून्य"}},usage:{title:"उपयोग",description:"अपने संसाधन उपभोग और कोटा की निगरानी करें",totalResources:"कुल संसाधन",overallUsage:"समग्र उपयोग",inOverage:"अतिरिक्त उपयोग में",estOverageCost:"अनुमानित अतिरिक्त लागत",overageDetected:"अतिरिक्त उपयोग पाया गया",overageDescription:"अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",overageUnits:"अतिरिक्त इकाइयाँ",rate:"दर",billableBlocks:"बिल योग्य ब्लॉक",estimatedCharge:"अनुमानित शुल्क",noData:"इस वर्कस्पेस के लिए कोई कोटा उपयोग डेटा उपलब्ध नहीं है।",noDataHint:"जब आपके प्लान में मीटर्ड संसाधन शामिल होंगे तो कोटा यहाँ दिखाई देंगे।",used:"उपयोग किया",remaining:"शेष",overLimit:"सीमा से अधिक",percentUsed:"{percent, number}% उपयोग किया",availableRemaining:"{count} शेष",overLimitCount:"{count} सीमा से अधिक",overageWarning:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}} अतिरिक्त उपयोग आपके अगले चालान में अतिरिक्त शुल्क के रूप में बिल किया जाएगा।",fullyUsed:"पूरी तरह उपयोग किया",renewingSoon:"जल्द नवीनीकरण",almostFull:"लगभग भरा",overage:"अतिरिक्त",errorLoading:"उपयोग डेटा लोड करने में विफल",perUnit:"/ इकाई",perUnits:"/ इकाइयाँ",rateDisplay:"{rate} {unitSize, plural, =1 {/ इकाई} other {/ {unitSize, number} इकाइयाँ}}",resourcesExceeded:"{count, plural, one {# संसाधन ने शामिल कोटा पार कर लिया है।} other {# संसाधनों ने शामिल कोटा पार कर लिया है।}}",estOverageCharges:"इस अवधि का अनुमानित अतिरिक्त शुल्क: {amount}",overageRateDisplay:"अतिरिक्त दर: {rate}",resetDateDisplay:"उपयोग {date} को रीसेट होगा",daysRemainingDisplay:"{count, plural, one {# दिन शेष} other {# दिन शेष}}"},profile:{email:"ईमेल",name:"नाम",language:"भाषा",country:"देश",currency:"मुद्रा",timezone:"समय क्षेत्र",profileImage:"प्रोफ़ाइल छवि",success:"प्रोफ़ाइल सफलतापूर्वक सहेजी गई",nameMinLength:"नाम कम से कम 2 अक्षरों का होना चाहिए।",save:"सहेजें",reset:"रीसेट"},general:{ownerOnly:"केवल वर्कस्पेस का मालिक ही वर्कस्पेस सेटिंग्स बदल सकता है।",name:"नाम",namePlaceholder:"मेरा शानदार वर्कस्पेस",nameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",billingCurrency:"बिलिंग मुद्रा",icon:"आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",previewLabel:"पूर्वावलोकन:",success:"वर्कस्पेस सेटिंग्स सफलतापूर्वक सहेजी गईं",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",updateWorkspace:"वर्कस्पेस अपडेट करें"},features:{title:"वर्कस्पेस फ़ीचर्स",ownerOnly:"केवल वर्कस्पेस का मालिक ही फ़ीचर्स बदल सकता है।",noFeatures:"प्रबंधित करने के लिए कोई फ़ीचर नहीं है।",enabled:"सक्रिय",disabled:"निष्क्रिय",enabling:"सक्रिय किया जा रहा है",disabling:"निष्क्रिय किया जा रहा है",featureSuccess:"सफलतापूर्वक",updateSuccess:"{feature} सफलतापूर्वक {enabled, select, true {सक्रिय} other {निष्क्रिय}} किया गया",actionStatus:"{action, select, enabling {सक्रिय किया जा रहा है} disabling {निष्क्रिय किया जा रहा है} other {}}"},danger:{title:"वर्कस्पेस हटाएँ",adminOnly:"केवल वर्कस्पेस एडमिन ही वर्कस्पेस हटा सकते हैं।",deleteWorkspace:"वर्कस्पेस हटाएँ",deleteConfirm:"क्या आप बिल्कुल सुनिश्चित हैं?",deleteWarning:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और सभी संबंधित डेटा को स्थायी रूप से हटा देगी।",deleting:"हटाया जा रहा है...",deleteDescription:"एक बार वर्कस्पेस हटाने के बाद वापस नहीं जा सकते। यह वर्कस्पेस और उसका सभी डेटा स्थायी रूप से हटा देगा, जिसमें सदस्य, सेटिंग्स और फ़ीचर्स शामिल हैं।",deleteConfirmDescription:"यह क्रिया पूर्ववत नहीं की जा सकती। यह वर्कस्पेस और उसके सभी डेटा को स्थायी रूप से हटा देगी।",failedToDelete:"वर्कस्पेस हटाने में विफल"},notifications:{title:"सूचना प्राथमिकताएँ",permissionDenied:"सूचना अनुमति अस्वीकृत",notSupported:"इस ब्राउज़र में पुश सूचनाएँ समर्थित नहीं हैं।",manageDescription:"प्रबंधित करें कि आप इस वर्कस्पेस से कैसे सूचनाएँ प्राप्त करते हैं।",blocked:"सूचनाएँ अवरुद्ध हैं",blockedDescription:"आपने पहले इस साइट के लिए सूचनाएँ अवरुद्ध की थीं। उन्हें सक्रिय करने के लिए अपनी ब्राउज़र सेटिंग्स अपडेट करें:",pushTitle:"पुश सूचनाएँ",pushEnabledDescription:"आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।",pushDisabledDescription:"भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।",enabling:"सक्रिय किया जा रहा है...",disabling:"निष्क्रिय किया जा रहा है...",enable:"सक्रिय करें",disable:"निष्क्रिय करें",toggleAction:"{loading, select, true {{subscribed, select, true {निष्क्रिय किया जा रहा है...} other {सक्रिय किया जा रहा है...}}} other {{subscribed, select, true {निष्क्रिय करें} other {सक्रिय करें}}}}",pushDescription:"{subscribed, select, true {आपको महत्वपूर्ण अपडेट के लिए ब्राउज़र सूचनाएँ प्राप्त होंगी।} other {भुगतान समस्याओं, ट्रायल समाप्ति और अन्य महत्वपूर्ण अपडेट के बारे में सूचित रहें।}}",deviceNote:"सूचनाएँ इस डिवाइस पर भेजी जाती हैं। अन्य डिवाइसों पर अलग से सक्रिय करें।",unblock:{firefox:{step1:"एड्रेस बार में लॉक आइकन (या शील्ड आइकन) पर क्लिक करें",step2:'अनुमतियों की सूची में "Notifications" खोजें',step3:'"Blocked" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},safari:{step1:"Safari → Settings → Websites → Notifications खोलें",step2:"सूची में यह वेबसाइट खोजें",step3:'"Deny" से "Allow" में बदलें',step4:"इस पेज को रीलोड करें"},edge:{step1:"एड्रेस बार में लॉक आइकन पर क्लिक करें",step2:'"Permissions for this site" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"},chrome:{step1:"एड्रेस बार में लॉक आइकन (या ट्यून आइकन) पर क्लिक करें",step2:'"Site settings" पर क्लिक करें',step3:'"Notifications" को "Allow" पर सेट करें',step4:"इस पेज को रीलोड करें"}}},quota:{includedOnly:"{count, number} शामिल",includedWithOverage:"{count, number} शामिल, फिर {price} / {unit}",unitFallback:"इकाई"},pricing:{title:"अपना प्लान चुनें",description:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",currency:"मुद्रा",billingIn:"बिलिंग",noPlansCurrency:"आपकी बिलिंग मुद्रा के लिए कोई प्लान उपलब्ध नहीं है।",noPlansCurrencyHint:"कुछ गलत हो गया। कृपया सहायता से संपर्क करें।",noPlans:"कोई प्लान उपलब्ध नहीं",free:"मुफ़्त",included:"शामिल",save:"बचाएँ",current:"वर्तमान",processing:"प्रोसेस हो रहा है...",unavailable:"अनुपलब्ध",selectCurrency:"बिलिंग मुद्रा चुनें",billingInterval:"बिलिंग अवधि"},beta:{nameLabel:"नाम",emailLabel:"ईमेल",submitText:"जमा करें",submittingText:"जमा किया जा रहा है...",errorMessage:"एक त्रुटि हुई",tryAgain:"पुनः प्रयास करें",privacyConsent:"यह फ़ॉर्म जमा करके, आप हमारी",privacyPolicy:"गोपनीयता नीति",and:"और",termsOfService:"सेवा की शर्तों"},workspace:{switchTitle:"वर्कस्पेस बदलें",switchDescription:"एक वर्कस्पेस चुनें या नया बनाएँ।",notLoggedIn:"ऐसा लगता है कि आपने लॉगिन नहीं किया है। जारी रखने के लिए कृपया लॉगिन करें।",availableWorkspaces:"उपलब्ध वर्कस्पेस ({count, number})",loadingWorkspaces:"वर्कस्पेस लोड हो रहे हैं...",searchPlaceholder:"वर्कस्पेस खोजें...",noWorkspacesFound:"कोई वर्कस्पेस नहीं मिला",noWorkspacesAvailable:"कोई वर्कस्पेस उपलब्ध नहीं",switchTo:"बदलें",membersCount:"{count, plural, one {# सदस्य} other {# सदस्य}}",createNew:"नया वर्कस्पेस बनाएँ",createTitle:"नया वर्कस्पेस बनाएँ",createDescription:"शुरू करने के लिए एक नया वर्कस्पेस बनाएँ।",workspaceName:"वर्कस्पेस का नाम",workspaceNamePlaceholder:"मेरा शानदार वर्कस्पेस",workspaceNameMinLength:"वर्कस्पेस का नाम कम से कम 2 अक्षरों का होना चाहिए।",workspaceIcon:"वर्कस्पेस आइकन",iconDescription:"अपने वर्कस्पेस के लिए एक इमोजी चुनें या कस्टम छवि अपलोड करें।",chooseEmoji:"इमोजी चुनें",customImageUrl:"कस्टम छवि URL",imageUrl:"छवि URL",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"अपने वर्कस्पेस की छवि के लिए एक मान्य URL दर्ज करें। PNG, JPG और SVG प्रारूप समर्थित हैं।",invalidUrl:"कृपया एक मान्य URL दर्ज करें",creating:"बनाया जा रहा है...",createWorkspace:"वर्कस्पेस बनाएँ"},dropdowns:{search:"खोजें...",chooseOption:"विकल्प चुनें",chooseCountry:"देश चुनें",searchCountry:"देश चुनें...",chooseLanguage:"भाषा चुनें",searchLanguage:"भाषा चुनें...",chooseCurrency:"मुद्रा चुनें",searchCurrency:"मुद्रा चुनें...",chooseTimezone:"समय क्षेत्र चुनें",searchTimezone:"समय क्षेत्र चुनें..."},push:{failedToSubscribe:"पुश सूचनाओं की सदस्यता लेने में विफल",failedToUnsubscribe:"पुश सूचनाओं की सदस्यता रद्द करने में विफल"},errors:{networkError:"नेटवर्क त्रुटि: कृपया अपना इंटरनेट कनेक्शन जाँचें",unauthorized:"अनधिकृत - कृपया अपना सत्र जाँचें",notFound:"संसाधन नहीं मिला",generic:"एक त्रुटि हुई",fetchPlans:"प्लान लाने में विफल",fetchPlanGroup:"प्लान ग्रुप लाने में विफल",fetchPlanGroupVersion:"प्लान ग्रुप वर्शन लाने में विफल",fetchPlanGroupVersions:"प्लान ग्रुप वर्शन लाने में विफल",fetchSubscription:"सदस्यता लाने में विफल",createCheckout:"चेकआउट सत्र बनाने में विफल",updateSubscription:"सदस्यता अपडेट करने में विफल",fetchInvoices:"चालान लाने में विफल",fetchInvoice:"चालान लाने में विफल",openBillingPortal:"बिलिंग पोर्टल खोलने में विफल",cancelSubscription:"सदस्यता रद्द करने में विफल",resumeSubscription:"सदस्यता फिर से शुरू करने में विफल",recordUsage:"उपयोग दर्ज करने में विफल",fetchQuotaUsage:"कोटा उपयोग स्थिति लाने में विफल",fetchAllQuotaUsage:"सभी कोटा उपयोग लाने में विफल",fetchUsageLogs:"उपयोग लॉग लाने में विफल"}}});var $E=Object.freeze({__proto__:null,ar:{settings:{titles:{profile:"الحساب",general:"إعدادات مساحة العمل",users:"أعضاء مساحة العمل",subscription:"الخطة والفوترة",usage:"الاستخدام",features:"ميزات مساحة العمل",notifications:"الإشعارات",danger:"منطقة الخطر"},sidebar:{account:"الحساب",workspace:"مساحة العمل",profile:"الحساب",general:"الإعدادات",users:"الأعضاء",subscription:"الخطة والفوترة",usage:"الاستخدام",features:"الميزات",notifications:"الإشعارات",danger:"منطقة الخطر"},common:{refresh:"تحديث",refreshing:"جارٍ التحديث...",retry:"إعادة المحاولة",retrying:"جارٍ إعادة المحاولة...",save:"حفظ",saving:"جارٍ الحفظ...",cancel:"إلغاء",delete:"حذف",dismiss:"تجاهل",loading:"جارٍ التحميل...",success:"تم بنجاح!",error:"خطأ",refreshAction:"{loading, select, true {جارٍ التحديث...} other {تحديث}}",retryAction:"{loading, select, true {جارٍ إعادة المحاولة...} other {إعادة المحاولة}}"}},subscription:{managePlan:"إدارة خطتك وفوترتك",changePlan:"تغيير الخطة",viewPricingPlans:"عرض خطط الأسعار",viewPlans:"عرض الخطط",upgradePlan:"ترقية الآن",subscribe:"اشتراك",currentPlan:"الخطة الحالية",noSubscription:"ليس لديك اشتراك نشط",choosePlan:"اختر خطتك",choosePlanDescription:"قارن بين الخطط واختر ما يناسب احتياجاتك",planUpdateAvailable:"تحديث الخطة متوفر",updateSuccess:"تم تحديث الاشتراك بنجاح!",updateFailed:"فشل التحديث",cancelTitle:"إلغاء الاشتراك",cancelConfirm:"هل أنت متأكد من رغبتك في إلغاء اشتراكك؟",cancelKeep:"الاحتفاظ بالاشتراك",cancelButton:"نعم، إلغاء الاشتراك",canceling:"جارٍ الإلغاء...",cancelSuccess:"سيتم إلغاء الاشتراك في نهاية فترة الفوترة.",cancelNotCharged:"لن يتم تحصيل رسوم منك مرة أخرى بعد الإلغاء",cancelResumeAnytime:"يمكنك استئناف اشتراكك في أي وقت قبل انتهائه",resumeTitle:"استئناف الاشتراك",resumeConfirm:"هل أنت متأكد من رغبتك في استئناف اشتراكك؟",resumeKeep:"إبقاء الإلغاء",resumeButton:"نعم، استئناف الاشتراك",resuming:"جارٍ الاستئناف...",resumeSuccess:"تم استئناف الاشتراك.",managePayment:"إدارة الدفع",openingPortal:"جارٍ الفتح...",viewAllPlans:"عرض جميع الخطط",scheduledCancellation:"تم جدولة إلغاء الاشتراك",paymentPastDue:"الدفع متأخر",paymentPastDueDescription:"يرجى تحديث طريقة الدفع لتجنب انقطاع الخدمة.",subscriptionPaused:"الاشتراك موقوف",subscriptionPausedDescription:"اشتراكك موقوف حالياً. استأنف لاستعادة الوصول الكامل.",errorLoading:"خطأ في تحميل بيانات الاشتراك",errorLoadingDescription:"يرجى التحقق من اتصالك والمحاولة مرة أخرى.",errorProcessing:"فشل في معالجة الاشتراك",errorCanceling:"فشل في إلغاء الاشتراك",errorResuming:"فشل في استئناف الاشتراك",invalidWorkspace:"معرّف مساحة العمل غير صالح",billingInterval:{monthly:"شهري",quarterly:"ربع سنوي",yearly:"سنوي",perMonth:"/شهر",perQuarter:"/ربع سنة",perYear:"/سنة"},seats:{title:"المقاعد",members:"الأعضاء",included:"مشمول",billable:"قابل للفوترة",perExtraSeat:"لكل مقعد إضافي",limit:"الحد",includedSeats:"المقاعد المشمولة",maxSeats:"الحد الأقصى للمقاعد",freeWithBase:"مجاني مع السعر الأساسي",allIncluded:"الكل مشمول",extra:"إضافي",unlimited:"غير محدود"},items:{features:"الميزات",limits:"الحدود",quotas:"حصص الاستخدام"},checkout:{upgrade:"ترقية",downgrade:"تخفيض",switchTo:"التبديل إلى",select:"اختيار"},status:{active:"نشط",canceling:"جارٍ الإلغاء",trial:"تجريبي",canceled:"ملغى",pastDue:"متأخر",paused:"موقوف",deprecated:"قديم",unknown:"غير معروف"},plan:"الخطة",invoicesTab:"الفواتير",changePlanButton:"تغيير الخطة",noPlanAssigned:"لم يتم تعيين خطة",free:"مجاني",perSeatDisplay:"+ {price}/مقعد{interval}",estTotalDisplay:"الإجمالي التقديري: {total}{interval} ({count, plural, zero {بدون مقاعد إضافية} one {مقعد إضافي واحد} two {مقعدان إضافيان} few {# مقاعد إضافية} many {# مقعداً إضافياً} other {# مقعد إضافي}})",nextBillingDisplay:"الفوترة التالية: {date}",membersInWorkspace:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}} في مساحة العمل",billingInCurrency:"الفوترة بـ {currency}",savingsPercent:"وفّر {percent, number}%",switchToInterval:"التبديل إلى {interval}",seatPriceDisplay:"+ {price}/مقعد{interval} ({included} {includedLabel})",trialEnded:"انتهت فترتك التجريبية.",trialEndsIn:"تنتهي فترتك التجريبية خلال {days, plural, zero {اليوم} one {يوم واحد} two {يومين} few {# أيام} many {# يوماً} other {# يوم}}.",onTrial:"أنت في فترة تجريبية.",upgradeToKeepAccess:"قم بالترقية للحفاظ على الوصول.",viewInvoices:"عرض الفواتير",cancelTrial:"إلغاء التجربة",dunningFinal:"تحذير أخير: سيتم تعليق الاشتراك",dunningSuspended:"الاشتراك معلق",dunningRecovery:"جارٍ استرداد الدفع",dunningSuspendedDescription:"تم تعليق اشتراكك بسبب فشل الدفع المتكرر. حدّث طريقة الدفع لاستعادة الوصول.",dunningRecoveryDescription:"لم نتمكن من معالجة دفعتك. يرجى تحديث طريقة الدفع لتجنب فقدان الوصول.",cancelEndDescription:"سينتهي اشتراكك في",cancelEndFallback:"سيتم إلغاء اشتراكك في نهاية فترة الفوترة الحالية. لن يتم تحصيل رسوم منك مرة أخرى.",resumeChargeDate:"سيتم تحصيل الرسوم منك مرة أخرى في",resumeChargeFallback:"تاريخ الفوترة التالي",resumeContinue:"سيستمر اشتراكك تلقائياً وسيتم فوترتك وفقاً لخطتك",resumeCancelAnytime:"يمكنك الإلغاء في أي وقت قبل تاريخ الفوترة التالي إذا غيرت رأيك",retainAccess:"ستحتفظ بالوصول الكامل إلى هذه الخطة حتى",retainAccessFallback:"نهاية فترة الفوترة الحالية",noPlansAvailable:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه. يرجى الاتصال بالدعم إذا كنت تعتقد أن هذا خطأ.",noPlansAvailableHint:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه.",startTrialDescription:"جرب الخطة الكاملة بدون التزام. يمكنك الترقية أو الإلغاء في أي وقت.",noSubscriptionDescription:"اختر خطة للبدء مع مساحة العمل الخاصة بك",startFreeTrial:"ابدأ التجربة المجانية"},users:{title:"أعضاء مساحة العمل",adminOnly:"فقط مدير مساحة العمل يمكنه إدارة المستخدمين والأدوار.",inviteByEmail:"دعوة عضو عبر البريد الإلكتروني",inviteButton:"دعوة",inviting:"جارٍ الدعوة...",inviteSuccess:"تمت دعوة المستخدم بنجاح",emailRequired:"البريد الإلكتروني مطلوب",invalidEmail:"صيغة البريد الإلكتروني غير صالحة",inviteFailed:"فشل في دعوة العضو",seatLimitReached:"تم الوصول لحد المقاعد",memberLimitReached:"تم الوصول لحد الأعضاء",role:"الدور",you:"أنت",owner:"المالك",noMembers:"لم يتم العثور على أعضاء في مساحة العمل هذه.",extraSeatCost:"كل عضو إضافي يضيف {price}/{interval, select, yearly {سنة} quarterly {ربع سنة} other {شهر}} لاشتراكك",unknownUser:"مستخدم غير معروف",seats:"المقاعد",members:"الأعضاء",included:"مشمول",perExtraSeat:"/مقعد إضافي",maxMembers:"الحد الأقصى للأعضاء",available:"متاح",noMemberLimit:"لا حد للأعضاء",seatHeading:"{hasSeatPricing, select, true {المقاعد} other {الأعضاء}}",limitReached:"{reason, select, seat_limit_reached {تم الوصول لحد المقاعد} other {تم الوصول لحد الأعضاء}}",memberCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",subscriptionRequired:"الاشتراك مطلوب لدعوة الأعضاء.",seatLimitMessage:"خطتك تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}. قم بالترقية للحصول على مقاعد إضافية.",settingsLimitMessage:"مساحة العمل هذه تسمح بحد أقصى {maxUsers, number} {maxUsers, plural, zero {أعضاء} one {عضو} two {عضوين} few {أعضاء} many {عضواً} other {عضو}}.",memberLimitMessage:"تم الوصول لحد الأعضاء: {maxUsers, number}.",selectRole:"اختر دوراً",inviteAs:"دعوة كـ {role}"},invoices:{title:"سجل الفوترة",description:"عرض وتحميل فواتيرك",pay:"دفع",view:"عرض",viewDetails:"عرض التفاصيل",download:"PDF",errorLoading:"خطأ في تحميل الفواتير",noInvoices:"لا توجد فواتير بعد. اشترك في خطة لاستلام الفواتير.",noInvoicesWithSub:"لم يتم العثور على فواتير مع خيار التحميل",paidAmount:"المدفوع: {amount}",na:"غ/م",status:{draft:"مسودة",open:"مفتوح",paid:"مدفوع",uncollectible:"غير قابل للتحصيل",void:"ملغى"}},usage:{title:"الاستخدام",description:"راقب استهلاك مواردك وحصصك",totalResources:"إجمالي الموارد",overallUsage:"الاستخدام الإجمالي",inOverage:"تجاوز الحد",estOverageCost:"التكلفة التقديرية للتجاوز",overageDetected:"تم اكتشاف تجاوز",overageDescription:"سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",overageUnits:"وحدات التجاوز",rate:"المعدل",billableBlocks:"الكتل القابلة للفوترة",estimatedCharge:"الرسوم التقديرية",noData:"لا تتوفر بيانات استخدام الحصص لمساحة العمل هذه.",noDataHint:"ستظهر الحصص هنا عندما تتضمن خطتك موارد مقاسة.",used:"مستخدم",remaining:"متبقٍ",overLimit:"فوق الحد",percentUsed:"{percent, number}% مستخدم",availableRemaining:"{count} متبقٍ",overLimitCount:"{count} فوق الحد",overageWarning:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}} سيتم فوترة الاستخدام الإضافي كتجاوز في فاتورتك التالية.",fullyUsed:"مستخدم بالكامل",renewingSoon:"يتجدد قريباً",almostFull:"ممتلئ تقريباً",overage:"تجاوز",errorLoading:"فشل في تحميل بيانات الاستخدام",perUnit:"/ وحدة",perUnits:"/ وحدات",rateDisplay:"{rate} {unitSize, plural, =1 {/ وحدة} other {/ {unitSize, number} وحدة}}",resourcesExceeded:"{count, plural, zero {لم تتجاوز أي موارد الحصة المشمولة.} one {مورد واحد تجاوز الحصة المشمولة.} two {مورداً تجاوزا الحصة المشمولة.} few {# موارد تجاوزت الحصة المشمولة.} many {# مورداً تجاوز الحصة المشمولة.} other {# مورد تجاوز الحصة المشمولة.}}",estOverageCharges:"الرسوم التقديرية للتجاوز في هذه الفترة: {amount}",overageRateDisplay:"معدل التجاوز: {rate}",resetDateDisplay:"يتم إعادة تعيين الاستخدام في {date}",daysRemainingDisplay:"{count, plural, zero {اليوم} one {يوم واحد متبقٍ} two {يومان متبقيان} few {# أيام متبقية} many {# يوماً متبقياً} other {# يوم متبقٍ}}"},profile:{email:"البريد الإلكتروني",name:"الاسم",language:"اللغة",country:"البلد",currency:"العملة",timezone:"المنطقة الزمنية",profileImage:"صورة الملف الشخصي",success:"تم حفظ الملف الشخصي بنجاح",nameMinLength:"يجب أن يتكون الاسم من حرفين على الأقل.",save:"حفظ",reset:"إعادة تعيين"},general:{ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير إعدادات مساحة العمل.",name:"الاسم",namePlaceholder:"مساحة العمل الرائعة",nameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",billingCurrency:"عملة الفوترة",icon:"الأيقونة",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",previewLabel:"معاينة:",success:"تم حفظ إعدادات مساحة العمل بنجاح",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",updateWorkspace:"تحديث مساحة العمل"},features:{title:"ميزات مساحة العمل",ownerOnly:"فقط مالك مساحة العمل يمكنه تغيير الميزات.",noFeatures:"لا توجد ميزات لإدارتها.",enabled:"مفعّل",disabled:"معطّل",enabling:"جارٍ التفعيل",disabling:"جارٍ التعطيل",featureSuccess:"بنجاح",updateSuccess:"تم {enabled, select, true {تفعيل} other {تعطيل}} {feature} بنجاح",actionStatus:"{action, select, enabling {جارٍ التفعيل} disabling {جارٍ التعطيل} other {}}"},danger:{title:"حذف مساحة العمل",adminOnly:"فقط مديرو مساحة العمل يمكنهم حذف مساحات العمل.",deleteWorkspace:"حذف مساحة العمل",deleteConfirm:"هل أنت متأكد تماماً؟",deleteWarning:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع البيانات المرتبطة نهائياً.",deleting:"جارٍ الحذف...",deleteDescription:"بمجرد حذف مساحة العمل لا يمكن العودة. سيتم حذف مساحة العمل وجميع بياناتها نهائياً، بما في ذلك الأعضاء والإعدادات والميزات.",deleteConfirmDescription:"لا يمكن التراجع عن هذا الإجراء. سيتم حذف مساحة العمل وجميع بياناتها نهائياً.",failedToDelete:"فشل في حذف مساحة العمل"},notifications:{title:"تفضيلات الإشعارات",permissionDenied:"تم رفض إذن الإشعارات",notSupported:"الإشعارات الفورية غير مدعومة في هذا المتصفح.",manageDescription:"أدِر كيفية تلقي الإشعارات من مساحة العمل هذه.",blocked:"الإشعارات محظورة",blockedDescription:"لقد حظرت الإشعارات لهذا الموقع سابقاً. لتفعيلها، حدّث إعدادات متصفحك:",pushTitle:"الإشعارات الفورية",pushEnabledDescription:"ستتلقى إشعارات المتصفح للتحديثات المهمة.",pushDisabledDescription:"احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.",enabling:"جارٍ التفعيل...",disabling:"جارٍ التعطيل...",enable:"تفعيل",disable:"تعطيل",toggleAction:"{loading, select, true {{subscribed, select, true {جارٍ التعطيل...} other {جارٍ التفعيل...}}} other {{subscribed, select, true {تعطيل} other {تفعيل}}}}",pushDescription:"{subscribed, select, true {ستتلقى إشعارات المتصفح للتحديثات المهمة.} other {احصل على إشعارات حول مشاكل الدفع وانتهاء التجربة والتحديثات المهمة الأخرى.}}",deviceNote:"يتم إرسال الإشعارات إلى هذا الجهاز. فعّلها على الأجهزة الأخرى بشكل منفصل.",unblock:{firefox:{step1:"انقر على أيقونة القفل (أو الدرع) في شريط العنوان",step2:'ابحث عن "Notifications" في قائمة الأذونات',step3:'غيّر من "Blocked" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},safari:{step1:"افتح Safari ← الإعدادات ← مواقع الويب ← الإشعارات",step2:"ابحث عن هذا الموقع في القائمة",step3:'غيّر من "Deny" إلى "Allow"',step4:"أعد تحميل هذه الصفحة"},edge:{step1:"انقر على أيقونة القفل في شريط العنوان",step2:'انقر على "Permissions for this site"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"},chrome:{step1:"انقر على أيقونة القفل (أو الضبط) في شريط العنوان",step2:'انقر على "Site settings"',step3:'اضبط "Notifications" على "Allow"',step4:"أعد تحميل هذه الصفحة"}}},quota:{includedOnly:"{count, number} مشمول",includedWithOverage:"{count, number} مشمول، ثم {price} / {unit}",unitFallback:"وحدة"},pricing:{title:"اختر خطتك",description:"قارن بين الخطط واختر ما يناسب احتياجاتك",currency:"العملة",billingIn:"الفوترة بـ",noPlansCurrency:"لا توجد خطط متاحة لعملة الفوترة الخاصة بك.",noPlansCurrencyHint:"حدث خطأ ما. يرجى الاتصال بالدعم.",noPlans:"لا توجد خطط متاحة",free:"مجاني",included:"مشمول",save:"وفّر",current:"الحالي",processing:"جارٍ المعالجة...",unavailable:"غير متاح",selectCurrency:"اختر عملة الفوترة",billingInterval:"فترة الفوترة"},beta:{nameLabel:"الاسم",emailLabel:"البريد الإلكتروني",submitText:"إرسال",submittingText:"جارٍ الإرسال...",errorMessage:"حدث خطأ",tryAgain:"حاول مرة أخرى",privacyConsent:"بإرسال هذا النموذج، فإنك توافق على",privacyPolicy:"سياسة الخصوصية",and:"و",termsOfService:"شروط الخدمة"},workspace:{switchTitle:"تبديل مساحة العمل",switchDescription:"اختر مساحة عمل للتبديل إليها أو أنشئ واحدة جديدة.",notLoggedIn:"يبدو أنك لم تسجل الدخول. يرجى تسجيل الدخول للمتابعة.",availableWorkspaces:"مساحات العمل المتاحة ({count, number})",loadingWorkspaces:"جارٍ تحميل مساحات العمل...",searchPlaceholder:"بحث في مساحات العمل...",noWorkspacesFound:"لم يتم العثور على مساحات عمل",noWorkspacesAvailable:"لا تتوفر مساحات عمل",switchTo:"التبديل إلى",membersCount:"{count, plural, zero {لا أعضاء} one {عضو واحد} two {عضوان} few {# أعضاء} many {# عضواً} other {# عضو}}",createNew:"إنشاء مساحة عمل جديدة",createTitle:"إنشاء مساحة عمل جديدة",createDescription:"أنشئ مساحة عمل جديدة للبدء.",workspaceName:"اسم مساحة العمل",workspaceNamePlaceholder:"مساحة العمل الرائعة",workspaceNameMinLength:"يجب أن يتكون اسم مساحة العمل من حرفين على الأقل.",workspaceIcon:"أيقونة مساحة العمل",iconDescription:"اختر رمزاً تعبيرياً أو حمّل صورة مخصصة لمساحة العمل.",chooseEmoji:"اختر رمزاً تعبيرياً",customImageUrl:"رابط صورة مخصص",imageUrl:"رابط الصورة",imageUrlPlaceholder:"https://example.com/image.png",imageUrlDescription:"أدخل رابطاً صالحاً لصورة مساحة العمل. الصيغ المدعومة: PNG و JPG و SVG.",invalidUrl:"يرجى إدخال رابط صالح",creating:"جارٍ الإنشاء...",createWorkspace:"إنشاء مساحة العمل"},dropdowns:{search:"بحث...",chooseOption:"اختر خياراً",chooseCountry:"اختر البلد",searchCountry:"اختر البلد...",chooseLanguage:"اختر اللغة",searchLanguage:"اختر اللغة...",chooseCurrency:"اختر العملة",searchCurrency:"اختر العملة...",chooseTimezone:"اختر المنطقة الزمنية",searchTimezone:"اختر المنطقة الزمنية..."},push:{failedToSubscribe:"فشل في الاشتراك في الإشعارات الفورية",failedToUnsubscribe:"فشل في إلغاء الاشتراك من الإشعارات الفورية"},errors:{networkError:"خطأ في الشبكة: يرجى التحقق من اتصالك بالإنترنت",unauthorized:"غير مصرح - يرجى التحقق من جلستك",notFound:"المورد غير موجود",generic:"حدث خطأ",fetchPlans:"فشل في جلب الخطط",fetchPlanGroup:"فشل في جلب مجموعة الخطط",fetchPlanGroupVersion:"فشل في جلب إصدار مجموعة الخطط",fetchPlanGroupVersions:"فشل في جلب إصدارات مجموعة الخطط",fetchSubscription:"فشل في جلب الاشتراك",createCheckout:"فشل في إنشاء جلسة الدفع",updateSubscription:"فشل في تحديث الاشتراك",fetchInvoices:"فشل في جلب الفواتير",fetchInvoice:"فشل في جلب الفاتورة",openBillingPortal:"فشل في فتح بوابة الفوترة",cancelSubscription:"فشل في إلغاء الاشتراك",resumeSubscription:"فشل في استئناف الاشتراك",recordUsage:"فشل في تسجيل الاستخدام",fetchQuotaUsage:"فشل في جلب حالة استخدام الحصص",fetchAllQuotaUsage:"فشل في جلب جميع استخدامات الحصص",fetchUsageLogs:"فشل في جلب سجلات الاستخدام"}}});const KE={[Fn.Monthly]:"subscription.billingInterval.perMonth",[Fn.Quarterly]:"subscription.billingInterval.perQuarter",[Fn.Yearly]:"subscription.billingInterval.perYear"},qE=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case Fn.Yearly:n=t/12;break;case Fn.Quarterly:n=t/3;break;default:return null}const a=(e-n)/e*100;return a>0?Math.round(a):null};var ZE=Object.freeze({__proto__:null,default:({open:r,onOpenChange:n,planVersions:a,currentPlanVersionId:s,currentStripePriceId:i,billingCurrency:o,currentMemberCount:c,onSelectPlan:l,loading:u=!1})=>{const[d,p]=t.useState(!1),{t:m,formattingLocale:h,dir:f,fmtNum:g,fmtCents:b}=an(),{settings:v}=Sn(),y=v?.workspace?.mode===xw,x=(e,t)=>null==e||0===e?"":b(e,t),w=e=>m(KE[e]??KE[Fn.Monthly]),[S,k]=t.useState(null),E=t.useRef(!1),C=t.useMemo(()=>oa(i,a),[i,a]),N=C?.interval??null,A=C?.currency??null,j=t.useMemo(()=>function(e){const t=new Set;for(const r of e)r.pricingVariants?.forEach(e=>{e.currency&&t.add(e.currency.toLowerCase())});return Array.from(t).sort()}(a),[a]),P=t.useMemo(()=>{const e=o?.trim().toLowerCase();return e?j.includes(e)?[e]:[]:j},[o,j]),[T,_]=t.useState(N||Fn.Monthly),[R,D]=t.useState(()=>A&&P.includes(A)?A:P.length>0?P[0]:""),I=o?.trim()||R;t.useEffect(()=>{r&&(_(N||Fn.Monthly),A&&P.includes(A)?D(A):P.length>0&&!P.includes(R)&&D(P[0]))},[r,N,A,P]);const U=t.useMemo(()=>[...a].sort((e,t)=>e.version-t.version),[a]),M=(e=>{const t=new Map;return e.forEach(e=>{e.subscriptionItems?.forEach(e=>{t.has(e._id)||t.set(e._id,e)})}),Array.from(t.values())})(U),L=M.filter(e=>e.type===Yn),O=M.filter(e=>e.type===Xn),z=M.filter(e=>e.type===Qn),F=async e=>{if(!(e===s&&N===T||u||d||E.current)){E.current=!0,p(!0),k(e);try{await l(e,T,I),n(!1)}catch(e){}finally{E.current=!1,p(!1),k(null)}}},B=e=>aa(e,I,T),W=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===I.toLowerCase()),V=u||d,H=e=>{switch(e){case Fn.Monthly:return m("subscription.billingInterval.monthly");case Fn.Quarterly:return m("subscription.billingInterval.quarterly");case Fn.Yearly:return m("subscription.billingInterval.yearly");default:return m("subscription.billingInterval.monthly")}},G=e=>{const t=e._id===s,r=N===T;if(t&&r)return{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0};if(t&&!r)return{labelKey:"_dynamic",dynamicLabel:m("subscription.switchToInterval",{interval:H(T)}),variant:"default",disabled:!1};if(!s)return{labelKey:"subscription.subscribe",variant:"default",disabled:!1};const n=U.findIndex(e=>e._id===s),a=U.findIndex(t=>t._id===e._id);return-1===n||-1===a?{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}:a<n?{labelKey:"subscription.checkout.downgrade",variant:"outline",disabled:!1}:a>n?{labelKey:"subscription.checkout.upgrade",variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}},$=(e,t,r=Fn.Monthly)=>{if(t.type===Yn)return e.features?.[t.slug]??!1;if(t.type===Xn)return e.limits?.[t.slug]??null;if(t.type===Qn){const n=ia(e,I,t.slug,r);return n||vw(e.quotas?.[t.slug],r)}return null},K=(e,t,r)=>{if(t.type===Yn)return!0===e?"✓":"—";if(t.type===Xn)return null!=e?String(e):"—";if(t.type===Qn){const n=yw("object"==typeof e&&null!==e&&"included"in e?e:null,t.name.toLowerCase(),{currency:r,locale:h});return n?n.hasOverage?m("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):m("quota.includedOnly",{count:n.included}):"—"}return"—"};return e.jsx(uc,{open:r,onOpenChange:n,children:e.jsxs(hc,{dir:f,className:"inset-0 w-screen h-screen max-w-none rounded-none translate-x-0 translate-y-0 p-0 flex flex-col",children:[e.jsxs("div",{className:"flex-shrink-0 px-4 py-4 sm:px-6 sm:py-6 border-b space-y-3 sm:space-y-4",children:[e.jsxs("div",{children:[e.jsx(gc,{className:"text-xl sm:text-2xl font-bold",children:m("pricing.title")}),e.jsx(bc,{className:"mt-1 text-sm",children:m("subscription.choosePlanDescription")})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[!o?.trim()&&P.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-slate-600",children:m("pricing.currency")}),e.jsx("select",{"aria-label":m("pricing.selectCurrency"),value:R,onChange:e=>D(e.target.value),className:"rounded-md border border-slate-200 bg-white px-3 py-2 text-sm font-medium text-slate-900 shadow-sm focus:outline-none focus:ring-2 focus:ring-primary",children:P.map(t=>{const r=vf(t);return e.jsx("option",{value:t,children:r?`${r} ${t.toUpperCase()}`:t.toUpperCase()},t)})})]}),o?.trim()&&e.jsx("span",{className:"text-xs text-slate-500",children:m("subscription.billingInCurrency",{currency:o.toUpperCase()})})]}),e.jsx("div",{className:"flex items-center gap-0.5 sm:gap-1 p-1 bg-slate-100 rounded-lg w-full sm:w-auto",role:"group","aria-label":m("pricing.billingInterval"),children:[Fn.Monthly,Fn.Quarterly,Fn.Yearly].map(t=>{const r=N===t;return e.jsx("button",{onClick:()=>_(t),"aria-pressed":T===t,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(T===t?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:text-slate-900"),children:e.jsxs("span",{className:"flex items-center justify-center gap-1 sm:gap-1.5",children:[t===Fn.Monthly&&m("subscription.billingInterval.monthly"),t===Fn.Quarterly&&m("subscription.billingInterval.quarterly"),t===Fn.Yearly&&m("subscription.billingInterval.yearly"),t===Fn.Yearly&&e.jsx("span",{className:"text-[10px] sm:text-xs px-1 sm:px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold",children:m("pricing.save")}),r&&s&&e.jsx("span",{className:"hidden sm:inline text-xs px-1.5 py-0.5 bg-blue-100 text-blue-700 rounded-full font-semibold",children:m("pricing.current")})]})},t)})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:o?.trim()&&0===P.length?e.jsxs("div",{className:"text-center py-12 px-4",children:[e.jsx("p",{className:"text-slate-600 font-medium",children:m("pricing.noPlansCurrency")}),e.jsx("p",{className:"text-slate-500 text-sm mt-2",children:m("pricing.noPlansCurrencyHint")})]}):0===U.length?e.jsx("div",{className:"text-center py-12 text-gray-500",children:e.jsx("p",{children:m("pricing.noPlans")})}):e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden bg-white",children:[e.jsx("div",{className:"md:hidden overflow-auto h-full",style:{maxHeight:"calc(100vh - 13rem)"},children:e.jsx("div",{className:"p-4 space-y-4",children:U.map(t=>{const r=t._id===s,n=G(t),a=V&&t._id===S,i=B(t),o=W(t),l=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===I.toLowerCase())?I:t.plan?.currency??I??"",u=aa(t,I,Fn.Monthly)??0,d=T!==Fn.Monthly&&null!==i?qE(u,i,T):null,p=ca(t,I),h=p?la(t,I,T):null;return e.jsxs("div",{className:"rounded-xl border-2 p-4 "+(r?"border-blue-500 bg-blue-50/30":"border-slate-200 bg-white"),children:[e.jsxs("div",{className:"flex items-start justify-between mb-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900",children:t.plan.name}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 mt-0.5 line-clamp-2",children:t.plan.description})]}),r&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:m("pricing.current")})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:o&&null!==i||o?x(i,l)||m("pricing.free"):"—"}),null!==i&&i>0&&o&&e.jsx("span",{className:"text-sm text-slate-500",children:w(T)})]}),null!==d&&d>0&&o&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium",children:m("subscription.savingsPercent",{percent:d})}),p?.enabled&&h&&h>0&&!y&&e.jsx("div",{className:"text-xs text-slate-500 mt-1",children:m("subscription.seatPriceDisplay",{price:b(h,l),interval:w(T),included:g(p.includedSeats),includedLabel:m("pricing.included")})})]}),L.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:m("subscription.items.features")}),e.jsx("div",{className:"space-y-1",children:L.map(r=>{const n=$(t,r,T),a=r.type===Yn&&!0===n;return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.type===Yn?a?e.jsx("span",{className:"text-emerald-500 text-xs",children:"✓"}):e.jsx("span",{className:"text-slate-300 text-xs",children:"✕"}):null,e.jsx("span",{className:a?"text-slate-700":"text-slate-400",children:r.name})]},r._id)})})]}),O.length>0&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-1.5",children:m("subscription.items.limits")}),e.jsx("div",{className:"space-y-1",children:O.map(r=>{const n=$(t,r,T);return e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-slate-600",children:r.name}),e.jsx("span",{className:"font-medium text-slate-700",children:"number"==typeof n?g(n):"—"})]},r._id)})})]}),p?.enabled&&!y&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-emerald-600 uppercase tracking-wider mb-1.5",children:m("subscription.seats.title")}),e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:m("subscription.seats.included")}),e.jsx("span",{className:"font-medium",children:g(p.includedSeats||0)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:m("subscription.seats.maxSeats")}),e.jsx("span",{className:"font-medium",children:p.maxSeats>0?g(p.maxSeats):m("subscription.seats.unlimited")})]}),null!=c&&c>0&&(()=>{const t=Math.max(0,c-(p.includedSeats||0));return e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:m("subscription.seats.billable")}),e.jsx("span",{className:"font-medium "+(0===t?"text-emerald-600":"text-amber-600"),children:0===t?m("subscription.seats.allIncluded"):`${g(t)} ${m("subscription.seats.extra")}`})]})})()]})]}),e.jsx(Ps,{className:"w-full mt-2",variant:n.variant,disabled:n.disabled||V||!o,progress:a,onClick:()=>F(t._id),children:a?m("pricing.processing"):o?n.dynamicLabel??m(n.labelKey):m("pricing.unavailable")})]},t._id)})})}),e.jsx("div",{className:"hidden md:block overflow-auto h-full",style:{maxHeight:"calc(100vh - 12rem)"},children:e.jsxs("table",{className:"w-full border-separate border-spacing-0",style:{minWidth:280+200*U.length+"px",borderCollapse:"separate"},children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:280,minWidth:280}}),U.map(t=>e.jsx("col",{style:{width:200,minWidth:200}},t._id))]}),e.jsx("thead",{children:e.jsxs("tr",{className:"align-top",children:[e.jsx("th",{className:"sticky top-0 start-0 z-30 p-0 bg-white text-start"}),U.map(t=>{const r=t._id===s,n=G(t),a=V&&t._id===S,i=B(t),o=aa(t,I,Fn.Monthly)??0,c=T!==Fn.Monthly&&null!==i?qE(o,i,T):null,l=W(t),u=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===I.toLowerCase())?I:t.plan?.currency??I??"";return e.jsx("th",{className:"sticky top-0 z-20 border-b border-slate-200 p-3 shadow-[0_2px_4px_-2px_rgba(0,0,0,0.06)] "+(t._id===s?"bg-blue-50/80":"bg-white"),children:e.jsxs("div",{className:"flex h-full flex-col gap-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900 truncate",children:t.plan.name}),r&&e.jsx("span",{className:"shrink-0 rounded-md bg-blue-600 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-white",children:m("pricing.current")})]}),e.jsxs("div",{className:"flex flex-col items-start",children:[e.jsxs("div",{className:"flex items-baseline gap-1 whitespace-nowrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:l&&null!==i||l?x(i,u)||m("pricing.free"):"—"}),null!==i&&i>0&&l&&e.jsx("span",{className:"text-sm text-slate-500",children:w(T)})]}),null!==c&&c>0&&l&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium mt-0.5",children:m("subscription.savingsPercent",{percent:c})}),(()=>{if(y)return null;const r=ca(t,I);if(!r)return null;const n=la(t,I,T);return!n||n<=0?null:e.jsx("div",{className:"text-xs text-slate-500 mt-1 border-t border-slate-100 pt-1",children:e.jsx("span",{children:m("subscription.seatPriceDisplay",{price:b(n,u),interval:w(T),included:g(r.includedSeats),includedLabel:m("pricing.included")})})})})()]}),t.plan.description&&e.jsx("p",{className:"text-xs text-slate-500 line-clamp-2 leading-relaxed text-start",children:t.plan.description}),e.jsx(Ps,{className:"mt-auto w-full",variant:n.variant,disabled:n.disabled||V||!l,progress:a,onClick:()=>F(t._id),children:a?m("pricing.processing"):l?n.dynamicLabel??m(n.labelKey):m("pricing.unavailable")})]})},t._id)})]})}),e.jsxs("tbody",{children:[L.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.items.features")}),e.jsx("td",{colSpan:U.length,className:"border-t border-slate-200 bg-slate-100"})]}),L.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),U.map(r=>{const n=$(r,t,T),a=r.pricingVariants?.length?I:r.plan?.currency??I??"",i=K(n,t,a),o=t.type===Yn&&!0===n;return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+(o?"text-emerald-600":"—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),O.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.items.limits")}),e.jsx("td",{colSpan:U.length,className:"border-t border-slate-200 bg-slate-100"})]}),O.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),U.map(r=>{const n=$(r,t,T),a=r.pricingVariants?.length?I:r.plan?.currency??I??"",i=K(n,t,a);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),z.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-200 bg-slate-100 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-slate-600 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.items.quotas")}),e.jsx("td",{colSpan:U.length,className:"border-t border-slate-200 bg-slate-100"})]}),z.map(t=>e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:t.description})]}),U.map(r=>{const n=$(r,t,T),a=r.pricingVariants?.length?I:r.plan?.currency??I??"",i=K(n,t,a);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(r._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium "+("—"===i?"text-slate-400":"text-slate-700"),children:i})},r._id)})]},t._id))]}),!y&&U.some(e=>{const t=ca(e,I);return t?.enabled})&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-emerald-200 bg-emerald-50 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-emerald-700 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:m("subscription.seats.title")}),e.jsx("td",{colSpan:U.length,className:"border-t border-emerald-200 bg-emerald-50"})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.includedSeats")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:m("subscription.seats.freeWithBase")})]}),U.map(t=>{const r=ca(t,I);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?g(r.includedSeats||0):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.maxSeats")})}),U.map(t=>{const r=ca(t,I);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r?.enabled?r.maxSeats>0?g(r.maxSeats):m("subscription.seats.unlimited"):"—"})},t._id)})]}),e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.perExtraSeat")})}),U.map(t=>{const r=la(t,I,T),n=t.pricingVariants?.length?I:t.plan?.currency??I??"";return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r&&r>0?`${b(r,n)}${w(T)}`:"—"})},t._id)})]}),null!=c&&c>0&&e.jsxs("tr",{className:"group hover:bg-slate-50/50",children:[e.jsxs("td",{className:"sticky start-0 z-10 border-t border-slate-100 bg-white p-4 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)] group-hover:bg-slate-50/80",children:[e.jsx("div",{className:"font-medium text-sm text-slate-900",children:m("subscription.seats.billable")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:m("subscription.membersInWorkspace",{count:c})})]}),U.map(t=>{const r=ca(t,I);if(!r?.enabled)return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},t._id);const n=r.includedSeats||0,a=Math.max(0,c-n);return e.jsx("td",{className:"border-t border-slate-100 p-4 text-center align-middle "+(t._id===s?"bg-blue-50/50":"bg-white"),children:0===a?e.jsx("span",{className:"text-sm font-medium text-emerald-600",children:m("subscription.seats.allIncluded")}):e.jsxs("span",{className:"text-sm font-medium text-amber-600",children:[g(a)," ",m("subscription.seats.extra")]})},t._id)})]})]})]})]})})]})})]})})}});exports.BetaForm=({onSuccess:r,onError:n,className:a="w-full",fieldClassName:s="flex flex-col gap-1.5 w-full",autoFocus:i=!0,showSuccessMessage:o=!0,hideLogo:c=!1,hideTitles:l=!1})=>{const{t:u}=an(),[d,p]=t.useState(!1),[m,h]=t.useState(!1),{submitBetaForm:f,isLoading:g,isSubmitting:b,error:v,config:y,success:x,message:w}=(()=>{const{t:e}=an(),r=xn(),[n,a]=t.useState(null),[s,i]=t.useState(!0),[o,c]=t.useState(!1),[l,u]=t.useState(null),[d,p]=t.useState(!1),[m,h]=t.useState(null);return t.useEffect(()=>{let t=!1;return(async()=>{i(!0),u(null);try{const e=new ME(r),n=await e.fetchConfig();t||a(n)}catch(r){t||u(r instanceof Error?r.message:e("beta.errorMessage"))}finally{t||i(!1)}})(),()=>{t=!0}},[r]),{isLoading:s,isSubmitting:o,config:n,error:l,success:d,message:m,submitBetaForm:t.useCallback(async t=>{if(!r){const t=e("errors.generic");return u(t),{success:!1,message:t}}try{c(!0),u(null),p(!1),h(null);const e=new ME(r),n=await e.submitBetaUser({name:t.name||"",email:t.email}),a="success"===n.status;return p(a),h(n.message),{success:a,message:n.message}}catch(t){const r=t instanceof Error?t.message:e("beta.errorMessage");return u(r),p(!1),h(r),{success:!1,message:r}}finally{c(!1)}},[r])}})();t.useEffect(()=>{x&&o&&(p(!0),h(!0)),v&&h(!0)},[x,o,v]);const S=Gu({resolver:Qm(LE),defaultValues:{email:"",name:""},mode:"onChange",reValidateMode:"onChange"});t.useEffect(()=>{i&&S.setFocus("name")},[i,S]);const k=S.formState.isValid&&!b;return e.jsx("div",{className:"saas-os-ui",style:{width:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:g?e.jsxs("div",{className:Se("flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",a),children:[e.jsx(rl,{className:"h-24 w-24 rounded-lg"}),e.jsx(rl,{className:"h-6 w-32"}),e.jsxs("div",{className:"w-full space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(rl,{className:"h-4 w-16"}),e.jsx(rl,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(rl,{className:"h-4 w-16"}),e.jsx(rl,{className:"h-10 w-full"})]}),e.jsx(rl,{className:"h-10 w-full"})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center w-full px-2.5 sm:px-6 py-2.5 sm:py-6 gap-y-2.5 sm:gap-y-4",children:[!c&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[y?.logo&&e.jsx(zE,{logo:y?.logo}),y?.name&&e.jsx("div",{children:y?.name})]}),e.jsx(lu,{...S,children:e.jsxs("form",{onSubmit:S.handleSubmit(async e=>{try{const t=await f(e);t.success?(r?.(),S.reset(),o&&p(!0),h(!0)):(n?.(t.message),h(!0))}catch(e){n?.(e instanceof Error?e.message:u("beta.errorMessage")),h(!0)}}),className:a,noValidate:!0,"aria-busy":b,children:[!m&&e.jsxs(e.Fragment,{children:[!l&&y?.screen?.register&&e.jsx(OE,{screen:y?.screen?.register}),e.jsx(Af,{control:S.control,name:"name",render:({field:t})=>e.jsxs(Tf,{className:s,children:[e.jsx(_f,{children:u("beta.nameLabel")}),e.jsx(Rf,{children:e.jsx(Uf,{...t})}),e.jsx(Df,{}),e.jsx(If,{})]})}),e.jsx(Af,{control:S.control,name:"email",render:({field:t})=>e.jsxs(Tf,{className:s,children:[e.jsx(_f,{children:u("beta.emailLabel")}),e.jsx(Rf,{children:e.jsx(Uf,{...t})}),e.jsx(Df,{}),e.jsx(If,{})]})}),e.jsx(Ps,{type:"submit",disabled:!k,className:s,children:u(b?"beta.submittingText":"beta.submitText")})]}),m&&v&&e.jsxs("div",{className:"flex flex-col items-center justify-center w-full",children:[e.jsxs("div",{className:"border-red-300 text-red-700",role:"alert","aria-live":"assertive","aria-atomic":!0,children:[e.jsx("span",{className:"text-4xl mb-2",role:"img","aria-label":u("settings.common.error"),children:"❗"}),v]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(Ps,{type:"button",onClick:()=>{h(!1),S.reset()},className:s,children:u("beta.tryAgain")})})]}),m&&d&&w&&e.jsx("div",{className:"flex flex-col items-center justify-center w-full text-green-700 border-green-300 text-center",children:y?.screen?.thankYou&&e.jsx(OE,{screen:y?.screen?.thankYou})})]})}),!m&&e.jsx("div",{children:e.jsxs("div",{children:[u("beta.privacyConsent")," ",e.jsx("a",{href:y?.privacyPolicy,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:u("beta.privacyPolicy")})," ",u("beta.and")," ",e.jsx("a",{href:y?.termsOfService,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:text-blue-700",children:u("beta.termsOfService")}),"."]})})]})})},exports.PricingPage=function({slug:t,children:r,loadingFallback:n,errorFallback:a}){const{items:s,plans:i,notes:o,loading:c,error:l,refetch:u}=Cn(t);return c?void 0!==n?e.jsx(e.Fragment,{children:n}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(rl,{className:"h-8 w-48"}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(t=>e.jsx(rl,{className:"h-64 rounded-lg"},t))})]}):l?a?e.jsx(e.Fragment,{children:a(l)}):e.jsx("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:l}):e.jsx(e.Fragment,{children:r({loading:c,error:l,items:s,plans:i,notes:o,refetch:u})})},exports.PushNotificationProvider=vk,exports.QuotaUsageContextProvider=_a,exports.SETTINGS_SCREENS=ik,exports.SUPPORTED_LOCALES=qr,exports.SaaSOSProvider=_k,exports.SettingsScreen=sk,exports.SubscriptionContextProvider=On,exports.WhenAuthenticated=Rk,exports.WhenNoSubscription=Wk,exports.WhenNotTrialing=Gk,exports.WhenQuotaAvailable=Kk,exports.WhenQuotaExhausted=qk,exports.WhenQuotaOverage=Zk,exports.WhenQuotaThreshold=Jk,exports.WhenRoles=Ik,exports.WhenSubscription=Bk,exports.WhenSubscriptionToPlans=Vk,exports.WhenTrialEnding=$k,exports.WhenTrialing=Hk,exports.WhenUnauthenticated=Dk,exports.WhenUserFeatureDisabled=Fk,exports.WhenUserFeatureEnabled=zk,exports.WhenWorkspaceFeatureDisabled=Ok,exports.WhenWorkspaceFeatureEnabled=Lk,exports.WhenWorkspaceRoles=Uk,exports.WorkspaceSwitcher=function(r){const{t:n,dir:a}=an(),{isAuthenticated:s,user:i}=hk(),o=rt(xn()),{workspaces:c,currentWorkspace:l,loading:u,refreshing:d,switchingToId:p,fetchWorkspaces:m,getFeatures:h,refreshWorkspaces:f,setCurrentWorkspace:g,switchToWorkspace:b}=Pa(),{settings:v}=Sn(),[y,x]=t.useState(!1),[w,S]=t.useState(0),[k,E]=t.useState(""),C=u||d;t.useEffect(()=>{s&&o&&(0===c.length?(m(),h()):h())},[s,o]),t.useEffect(()=>{s&&o&&w>0&&f()},[w,s,o]);const N=c,A=N.filter(e=>e._id!==l?._id).filter(e=>e.name.toLowerCase().includes(k.toLowerCase())),j=v?.workspace?.canCreateWorkspace??!0,P=v?.workspace?.showSwitcher??!0,T=v?.workspace?.maxWorkspacesPerUser??0,_=N?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===i?.id?.toString()).length??0,R=!1!==j&&(0===T||_<T);return t.useEffect(()=>{!P&&c.length>0&&!l&&b(c[0]).catch(()=>{})},[P,c,l]),!P&&l?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>x(!0),children:r.trigger?.(C,l)}),e.jsx(ck,{workspace:l,open:y,onOpenChange:x,showTrigger:!1})]}):e.jsxs(uc,{open:y,onOpenChange:x,children:[e.jsx(dc,{children:r.trigger?.(C,l)}),e.jsxs(hc,{dir:a,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(fc,{dir:a,children:[e.jsxs(gc,{className:"flex items-center gap-2",children:[e.jsx(Ha,{className:"h-5 w-5"}),n("workspace.switchTitle")]}),e.jsx(bc,{children:n("workspace.switchDescription")})]}),!i&&e.jsx("div",{className:"flex flex-col items-center justify-center h-full py-4 sm:py-8",children:e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:n("workspace.notLoggedIn")})}),i&&e.jsxs("div",{dir:a,className:"flex flex-col gap-4",children:[l&&e.jsx(DE,{workspace:l,isCurrentWorkspace:!0,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N}),e.jsx(RE,{}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("div",{className:"text-sm font-medium text-muted-foreground",children:n("workspace.availableWorkspaces",{count:A.length})}),e.jsx("div",{children:e.jsx(Ps,{progress:d,disabled:d,variant:"ghost",onClick:function(){s&&o&&S(e=>e+1)},startIcon:e.jsx(rs,{}),children:n("settings.common.refreshAction",{loading:String(d)})})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(as,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(Uf,{placeholder:n("workspace.searchPlaceholder"),value:k,onChange:e=>E(e.target.value),className:"ps-10"})]}),u?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(es,{className:"h-6 w-6 animate-spin text-muted-foreground"}),e.jsx("span",{className:"ms-2 text-sm text-muted-foreground",children:n("workspace.loadingWorkspaces")})]}):0===A.length?e.jsxs("div",{className:"text-center py-8",children:[e.jsx(Ha,{className:"mx-auto h-12 w-12 text-muted-foreground"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:n(k?"workspace.noWorkspacesFound":"workspace.noWorkspacesAvailable")})]}):e.jsx(gb,{className:"h-64",dir:a,children:e.jsx("div",{dir:a,className:"flex flex-col gap-2 my-2.5",children:A.map(t=>{const r=t._id===l?._id;return e.jsx(DE,{workspace:t,isCurrentWorkspace:r,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N},t._id)})})})]}),R&&e.jsxs(e.Fragment,{children:[e.jsx(RE,{}),e.jsx(IE,{onCreated:()=>{m()}})]})]})]})]})},exports.useAllQuotaUsage=Mn,exports.useBillingPortal=Dn,exports.useCancelSubscription=In,exports.useCreateCheckoutSession=Pn,exports.useInvoice=(e,r)=>{const{t:n}=an(),{api:a}=kn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e&&r){c(!0),u(null);try{const t=await a.getInvoice(e,r);i(t.invoice)}catch(t){const a=En(t,"errors.fetchInvoice",n);u(a),Re(t,{component:"useInvoice",action:"fetchInvoice",metadata:{workspaceId:e,invoiceId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{d()},[d]),{invoice:s,loading:o,error:l,refetch:d}},exports.useInvoices=Rn,exports.usePlanGroup=An,exports.usePlanGroupVersions=jn,exports.usePublicPlanGroupVersion=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),u=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersion(e);s(t)}catch(t){const n=En(t,"errors.fetchPlanGroupVersion",r);l(n),Re(t,{component:"usePublicPlanGroupVersion",action:"fetchVersion",metadata:{groupVersionId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{u()},[u]),{planGroupVersion:a,loading:i,error:c,refetch:u}},exports.usePublicPlans=Cn,exports.usePushNotifications=yk,exports.useQuotaUsageContext=Ra,exports.useQuotaUsageStatus=(e,r)=>{const{t:n}=an(),{api:a}=kn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,u]=t.useState(null),d=t.useCallback(async()=>{if(e&&r){c(!0),u(null);try{const t=await a.getQuotaUsageStatus(e,r);i(t)}catch(t){const a=En(t,"errors.fetchQuotaUsage",n);u(a),Re(t,{component:"useQuotaUsageStatus",action:"fetchStatus",metadata:{workspaceId:e,quotaSlug:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{d()},[d]),{status:s,loading:o,error:l,refetch:d}},exports.useRecordUsage=e=>{const{t:r}=an(),{api:n}=kn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{recordUsage:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=await n.recordUsage(e,t);return _t(),r}catch(n){const a=En(n,"errors.recordUsage",r);throw o(a),Re(n,{component:"useRecordUsage",action:"recordUsage",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},exports.useResumeSubscription=Un,exports.useSaaSAuth=hk,exports.useSaaSOs=xn,exports.useSaaSSettings=Sn,exports.useSaaSWorkspaces=Pa,exports.useSeatStatus=YS,exports.useSubscription=Nn,exports.useSubscriptionContext=zn,exports.useSubscriptionManagement=_n,exports.useTranslation=an,exports.useTrialStatus=function(){const{response:e}=zn();return t.useMemo(()=>{const t=e?.subscription;if(!t||"trialing"!==t.subscriptionStatus)return{isTrialing:!1,daysRemaining:0,trialEndsAt:null,trialStartedAt:null,isTrialEnding:!1};const r=Yk(t.trialEnd)??Yk(t.stripeCurrentPeriodEnd),n=Yk(t.trialStart),a=r?Math.max(0,Math.ceil((r.getTime()-Date.now())/864e5)):0;return{isTrialing:!0,daysRemaining:a,trialEndsAt:r,trialStartedAt:n,isTrialEnding:a<=3}},[e])},exports.useUpdateSubscription=Tn,exports.useUsageLogs=(e,r,n)=>{const{t:a}=an(),{api:s}=kn(),[i,o]=t.useState([]),[c,l]=t.useState(0),[u,d]=t.useState(0),[p,m]=t.useState(1),[h,f]=t.useState(!1),[g,b]=t.useState(!1),[v,y]=t.useState(!1),[x,w]=t.useState(null),S=n?.from,k=n?.to,E=n?.source,C=n?.page,N=n?.limit,A=t.useCallback(async()=>{if(!e)return o([]),l(0),d(0),m(1),f(!1),void b(!1);y(!0),w(null);try{const t={...r&&{quotaSlug:r},...S&&{from:S},...k&&{to:k},...E&&{source:E},...C&&{page:C},...N&&{limit:N}},n=await s.getUsageLogs(e,t);o(n.docs||[]),l(n.totalDocs||0),d(n.totalPages||0),m(n.page||1),f(n.hasNextPage||!1),b(n.hasPrevPage||!1)}catch(t){const n=En(t,"errors.fetchUsageLogs",a);w(n),Re(t,{component:"useUsageLogs",action:"fetchLogs",metadata:{workspaceId:e,quotaSlug:r}})}finally{y(!1)}},[s,e,r,S,k,E,C,N]);return t.useEffect(()=>{A()},[A]),{logs:i,totalDocs:c,totalPages:u,page:p,hasNextPage:h,hasPrevPage:g,loading:v,error:x,refetch:A}},exports.useUserAttributes=function(){const e=t.useContext(Ck);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e},exports.useUserFeatures=Mk;