@buildbase/sdk 0.0.46 → 0.0.47

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,5 +1,5 @@
1
1
  "use client";
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="-",d=[],u=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||d}return r[e]||d}}},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)}}},C=[],E=(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 E(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)):E(C,!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+/,_=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=_(e[n]))&&(r&&(r+=" "),r+=t);return r},P=(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:d,hasImportantModifier:u,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===d.length?"":1===d.length?d[0]:s(d).join(":"),b=u?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),...u(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=_(t))&&(a&&(a+=" "),a+=r);return a})(...e))},T=[],R=e=>{const t=t=>t[e]||T;return t.isThemeGetter=!0,t},D=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,M=/^\d+\/\d+$/,U=/^(\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=>M.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),V=e=>!!e&&Number.isInteger(Number(e)),G=e=>e.endsWith("%")&&W(e.slice(0,-1)),H=e=>U.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),de=e=>me(e,fe),ue=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=P(()=>{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"),d=R("shadow"),u=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],C=()=>[V,"auto",se,Q],E=()=>["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],_=()=>["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]}],P=()=>["auto","cover","contain",le,X,{size:[se,Q]}],T=()=>[G,ie,ee],D=()=>["","none","full",l,se,Q],I=()=>["",W,ie,ee],M=()=>[W,G,ce,re],U=()=>["","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:[H],breakpoint:[H],color:[$],container:[H],"drop-shadow":[H],ease:["in","out","in-out"],font:[Y],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[H],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[H],shadow:[H],spacing:["px",W],text:[H],"text-shadow":[H],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":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],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",G,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:_()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},V,se,Q],radial:["",se,Q],conic:[V,se,Q]},de,ne]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:T()}],"gradient-via-pos":[{via:T()}],"gradient-to-pos":[{to:T()}],"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",d,ue,ae]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",u,ue,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,ue,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":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"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":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"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":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"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":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"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":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"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":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"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":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"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":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"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":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"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:_()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,Q]}],filter:[{filter:["","none",se,Q]}],blur:[{blur:U()}],brightness:[{brightness:[W,se,Q]}],contrast:[{contrast:[W,se,Q]}],"drop-shadow":[{"drop-shadow":["","none",m,ue,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":U()}],"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 Ce(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 Ee(e,...t){console.error(e,...t)}function Ne(e){return e instanceof Error&&("AbortError"===e.name||"ERR_CANCELED"===e.code)}async function Ae(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 je(e,t="Request failed"){if(!e.ok){let r=t;try{const t=await Ae(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 Ae(e)}catch(e){if(e instanceof Error&&e.message.includes("Invalid JSON"))throw e;throw new Error("Failed to parse response as JSON")}}class _e 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,_e)}}const Pe=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 _e("string"==typeof e?e:"An unknown error occurred","UNKNOWN_ERROR",t),n=r instanceof _e?r:new _e(r.message,"SDK_ERROR",t,r);if(this.config.enableConsoleLogging&&Ce(`[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){Ee("[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 Te(e,t={}){Pe.handleError(e,t)}function Re(e,t={}){return!Ne(e)&&(Pe.handleError(e,t),!0)}function De(e,t,r){return e instanceof Error?e.message:r(t)}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(Te(e,{component:"ErrorBoundary",action:"componentDidCatch",metadata:{componentStack:t.componentStack,errorBoundary:this.constructor.name}}),this.props.onError)try{this.props.onError(e,t)}catch(e){Ee("[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 Me=()=>({type:"AUTHENTICATION_STARTED"}),Ue=()=>({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),c=a.current!==r,l=s.current!==n,d=c||l;a.current=r,s.current=n;const u=t.useRef(0);d&&(u.current+=1);const p=u.current;return t.useMemo(()=>{const t=r(e);if(o.current){if(n?n(i.current,t):Object.is(i.current,t))return i.current}return i.current=t,o.current=!0,t},[e,p])}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,d]=t.useReducer(a,n,s||(e=>e)),u=t.useMemo(()=>({state:l,dispatch:d}),[l,d]);return e.jsx(c.Provider,{value:u,children:e.jsx(i.Provider,{value:l,children:e.jsx(o.Provider,{value:d,children:r})})})});l.displayName=`${r}Provider`;const d=e=>new Error(`use${r}${e} must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`),u=()=>{const e=t.useContext(i);if(null===e)throw d("State");return e};return{Provider:l,useContext:()=>{const e=t.useContext(c);if(!e)throw d("Context");return e},useState:u,useDispatch:()=>{const e=t.useContext(o);if(null===e)throw d("Dispatch");return e},useSelector:(e,t)=>{const r=e||(e=>e);return Fe(u(),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 Ge(e,t,r){return{...e,[t]:r}}function He(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 Ge(e,"status",We.redirecting);case"AUTHENTICATION_PROCESSING":return Ge(e,"status",We.authenticating);case"AUTHENTICATION_FAILED":case"REMOVE_SESSION":return He(e,{session:null,status:We.unauthenticated});case"SET_SESSION":return He(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 He(e,t.payload);case"REMOVE_SAAS_OS_CONFIG":return nt();case"SET_SETTINGS":return Ge(e,"settings",t.payload);default:return e}}}),ot=at,ct=st,lt=it,dt=e=>({type:"SET_WORKSPACES",payload:e}),ut=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:Ct}=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 Ge(e,"workspaces",t.payload);case"ADD_WORKSPACE":return Ge(e,"workspaces",[...e.workspaces,t.payload]);case"UPDATE_WORKSPACE":return Ge(e,"workspaces",e.workspaces.map(e=>e._id===t.payload._id?t.payload:e));case"REMOVE_WORKSPACE":return Ge(e,"workspaces",e.workspaces.filter(e=>e._id!==t.payload));case"SET_ALL_FEATURES":return Ge(e,"allFeatures",t.payload);case"SET_CURRENT_WORKSPACE":return Ge(e,"currentWorkspace",t.payload);case"RESET_CURRENT_WORKSPACE":return Ge(e,"currentWorkspace",null);case"SET_IS_INITIALIZED":return Ge(e,"isInitialized",t.payload);case"SET_LOADING":return Ge(e,"loading",t.payload);case"SET_ERROR":return Ge(e,"error",t.payload);case"SET_REFRESHING":return Ge(e,"refreshing",t.payload);case"SET_SWITCHING_TO_ID":return Ge(e,"switchingToId",t.payload);default:return e}}}),Et=St,Nt=kt,At=Ct,jt=t.memo(({children:t})=>e.jsx(ot,{children:e.jsx(Je,{children:e.jsx(Et,{children:t})})}));jt.displayName="SDKContextProvider";const _t=t.createContext({});_t.displayName="CheckoutConfigContext";const Pt=t.memo(({getCheckoutStripeParams:r,children:n})=>{const a=t.useMemo(()=>({getCheckoutStripeParams:r}),[r]);return e.jsx(_t.Provider,{value:a,children:n})});function Tt(){const e=new Set;return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),invalidate(){e.forEach(e=>e())},reset(){e.clear()}}}Pt.displayName="CheckoutConfigProvider";const Rt=Tt(),Dt=Rt.subscribe,It=Rt.invalidate,Mt=Tt(),Ut=Mt.subscribe,Lt=Mt.invalidate;function Ot(e,t){const r=t&&t.cache?t.cache:Ht,n=t&&t.serializer?t.serializer:Vt;return(t&&t.strategy?t.strategy:Wt)(e,{cache:r,serializer:n})}function zt(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 Ft(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 Bt(e,t,r,n,a){return r.bind(t,e,n,a)}function Wt(e,t){return Bt(e,this,1===e.length?zt:Ft,t.cache.create(),t.serializer)}const Vt=function(){return JSON.stringify(arguments)};class Gt{cache;constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const Ht={create:function(){return new Gt}},$t={variadic:function(e,t){return Bt(e,this,Ft,t.cache.create(),t.serializer)}},Kt=/(?:[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 qt(e){const t={};return e.replace(Kt,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 Zt=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Jt(e){return e.replace(/^(.*?)-/,"")}const Yt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Xt=/^(@+)?(\+|#+)?[rs]?$/g,Qt=/(\*)(0+)|(#+)(0+)|(0+)/g,er=/^(0+)$/;function tr(e){const t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(Xt,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 rr(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 nr(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)),!er.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function ar(e){const t=rr(e);return t||{}}function sr(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=Jt(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,...ar(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...r.options.reduce((e,t)=>({...e,...ar(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(Qt,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(er.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(Yt.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Yt,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,...tr(e)});continue}if(Xt.test(r.stem)){t={...t,...tr(r.stem)};continue}const e=rr(r.stem);e&&(t={...t,...e});const n=nr(r.stem);n&&(t={...t,...n})}return t}let ir=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}({}),or=function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e}({});function cr(e){return e.type===ir.literal}function lr(e){return e.type===ir.argument}function dr(e){return e.type===ir.number}function ur(e){return e.type===ir.date}function pr(e){return e.type===ir.time}function mr(e){return e.type===ir.select}function hr(e){return e.type===ir.plural}function fr(e){return e.type===ir.pound}function gr(e){return e.type===ir.tag}function br(e){return!(!e||"object"!=typeof e||e.type!==or.number)}function vr(e){return!(!e||"object"!=typeof e||e.type!==or.dateTime)}let yr=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 xr=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,wr={"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 Sr(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(wr[n||""]||wr[r||""]||wr[`${r}-001`]||wr["001"])[0]}const kr=new RegExp(`^${xr.source}*`),Cr=new RegExp(`${xr.source}*$`);function Er(e,t){return{start:e,end:t}}const Nr=!!Object.fromEntries,Ar=!!String.prototype.trimStart,jr=!!String.prototype.trimEnd,_r=Nr?Object.fromEntries:function(e){const t={};for(const[r,n]of e)t[r]=n;return t},Pr=Ar?function(e){return e.trimStart()}:function(e){return e.replace(kr,"")},Tr=jr?function(e){return e.trimEnd()}:function(e){return e.replace(Cr,"")},Rr=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class Dr{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(yr.UNMATCHED_CLOSING_TAG,Er(this.clonePosition(),this.clonePosition()))}if(60===a&&!this.ignoreTag&&Ir(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:ir.pound,location:Er(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:ir.literal,value:`<${n}/>`,location:Er(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()||!Ir(this.char()))return this.error(yr.INVALID_TAG,Er(i,this.clonePosition()));const e=this.clonePosition();return n!==this.parseTagName()?this.error(yr.UNMATCHED_CLOSING_TAG,Er(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:ir.tag,value:n,children:s,location:Er(r,this.clonePosition())},err:null}:this.error(yr.INVALID_TAG,Er(i,this.clonePosition())))}return this.error(yr.UNCLOSED_TAG,Er(r,this.clonePosition()))}return this.error(yr.INVALID_TAG,Er(r,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&Mr(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=Er(r,this.clonePosition());return{val:{type:ir.literal,value:n,location:a},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Ir(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(yr.EXPECT_ARGUMENT_CLOSING_BRACE,Er(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(yr.EMPTY_ARGUMENT,Er(r,this.clonePosition()));let n=this.parseIdentifierIfPossible().value;if(!n)return this.error(yr.MALFORMED_ARGUMENT,Er(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(yr.EXPECT_ARGUMENT_CLOSING_BRACE,Er(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:ir.argument,value:n,location:Er(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(yr.EXPECT_ARGUMENT_CLOSING_BRACE,Er(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(yr.MALFORMED_ARGUMENT,Er(r,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),r=function(e,t){return Rr.lastIndex=t,Rr.exec(e)[1]??""}(this.message,t),n=t+r.length;this.bumpTo(n);return{value:r,location:Er(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(yr.EXPECT_ARGUMENT_TYPE,Er(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=Tr(r.val);if(0===n.length)return this.error(yr.EXPECT_ARGUMENT_STYLE,Er(this.clonePosition(),this.clonePosition()));e={style:n,styleLocation:Er(t,this.clonePosition())}}const t=this.tryParseArgumentClose(n);if(t.err)return t;const a=Er(n,this.clonePosition());if(e&&e.style.startsWith("::")){let t=Pr(e.style.slice(2));if("number"===s){const n=this.parseNumberSkeletonFromString(t,e.styleLocation);return n.err?n:{val:{type:ir.number,value:r,location:a,style:n.val},err:null}}{if(0===t.length)return this.error(yr.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=Sr(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:or.dateTime,pattern:n,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?qt(n):{}};return{val:{type:"date"===s?ir.date:ir.time,value:r,location:a,style:i},err:null}}}return{val:{type:"number"===s?ir.number:"date"===s?ir.date:ir.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(yr.EXPECT_SELECT_ARGUMENT_OPTIONS,Er(a,{...a}));this.bumpSpace();let i=this.parseIdentifierIfPossible(),o=0;if("select"!==s&&"offset"===i.value){if(!this.bumpIf(":"))return this.error(yr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Er(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(yr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,yr.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 d=Er(n,this.clonePosition());return"select"===s?{val:{type:ir.select,value:r,options:_r(c.val),location:d},err:null}:{val:{type:ir.plural,value:r,options:_r(c.val),offset:o,pluralType:"plural"===s?"cardinal":"ordinal",location:d},err:null}}default:return this.error(yr.INVALID_ARGUMENT_TYPE,Er(a,i))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(yr.EXPECT_ARGUMENT_CLOSING_BRACE,Er(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(yr.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Er(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(Zt).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(yr.INVALID_NUMBER_SKELETON,t)}return{val:{type:or.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?sr(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(yr.EXPECT_PLURAL_ARGUMENT_SELECTOR,yr.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;c=Er(e,this.clonePosition()),o=this.message.slice(e.offset,this.offset())}}if(i.has(o))return this.error("select"===t?yr.DUPLICATE_SELECT_ARGUMENT_SELECTOR:yr.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===o&&(a=!0),this.bumpSpace();const n=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?yr.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:yr.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Er(this.clonePosition(),this.clonePosition()));const l=this.parseMessage(e+1,t,r);if(l.err)return l;const d=this.tryParseArgumentClose(n);if(d.err)return d;s.push([o,{value:l.val,location:Er(n,this.clonePosition())}]),i.add(o),this.bumpSpace(),({value:o,location:c}=this.parseIdentifierIfPossible())}return 0===s.length?this.error("select"===t?yr.EXPECT_SELECT_ARGUMENT_SELECTOR:yr.EXPECT_PLURAL_ARGUMENT_SELECTOR,Er(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(yr.MISSING_OTHER_CLAUSE,Er(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=Er(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()&&Ur(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 Ir(e){return e>=97&&e<=122||e>=65&&e<=90}function Mr(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 Ur(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Lr(e){e.forEach(e=>{if(delete e.location,mr(e)||hr(e))for(const t in e.options)delete e.options[t].location,Lr(e.options[t].value);else dr(e)&&br(e.style)||(ur(e)||pr(e))&&vr(e.style)?delete e.style.location:gr(e)&&Lr(e.children)})}function Or(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const r=new Dr(e,t).parse();if(r.err){const e=SyntaxError(yr[r.err.kind]);throw e.location=r.err.location,e.originalMessage=r.err.message,e}return t?.captureLocation||Lr(r.val),r.val}let zr=function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e}({});class Fr 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 Br extends Fr{constructor(e,t,r,n){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(r).join('", "')}"`,zr.INVALID_VALUE,n)}}class Wr extends Fr{constructor(e,t,r){super(`Value for "${e}" must be of type ${t}`,zr.INVALID_VALUE,r)}}class Vr extends Fr{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,zr.MISSING_VALUE,t)}}let Gr=function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e}({});function Hr(e){return"function"==typeof e}function $r(e,t,r,n,a,s,i){if(1===e.length&&cr(e[0]))return[{type:Gr.literal,value:e[0].value}];const o=[];for(const c of e){if(cr(c)){o.push({type:Gr.literal,value:c.value});continue}if(fr(c)){"number"==typeof s&&o.push({type:Gr.literal,value:r.getNumberFormat(t).format(s)});continue}const{value:e}=c;if(!a||!(e in a))throw new Vr(e,i);let l=a[e];if(lr(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?Gr.literal:Gr.object,value:l});else{if(ur(c)){const e="string"==typeof c.style?n.date[c.style]:vr(c.style)?c.style.parsedOptions:void 0;o.push({type:Gr.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(pr(c)){const e="string"==typeof c.style?n.time[c.style]:vr(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:Gr.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(dr(c)){const e="string"==typeof c.style?n.number[c.style]:br(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:Gr.literal,value:r.getNumberFormat(t,e).format(l)});continue}if(gr(c)){const{children:e,value:l}=c,d=a[l];if(!Hr(d))throw new Wr(l,"function",i);let u=d($r(e,t,r,n,a,s).map(e=>e.value));Array.isArray(u)||(u=[u]),o.push(...u.map(e=>({type:"string"==typeof e?Gr.literal:Gr.object,value:e})))}if(mr(c)){const e=l,s=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!s)throw new Br(c.value,l,Object.keys(c.options),i);o.push(...$r(s.value,t,r,n,a));continue}if(hr(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 Fr('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',zr.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 Br(c.value,l,Object.keys(c.options),i);const d="bigint"==typeof l?Number(l):l;o.push(...$r(s.value,t,r,n,a,d-(c.offset||0)));continue}}}return(c=o).length<2?c:c.reduce((e,t)=>{const r=e[e.length-1];return r&&r.type===Gr.literal&&t.type===Gr.literal?r.value+=t.value:e.push(t),e},[]);var c}function Kr(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 qr(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}class Zr{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(e,t=Zr.defaultLocale,r,n){if(this.locales=t,this.resolvedLocale=Zr.resolveLocale(t),"string"==typeof e){if(this.message=e,!Zr.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...t}=n||{};this.ast=Zr.__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=Kr(Zr.formats,r),this.formatters=n&&n.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:Ot((...e)=>new Intl.NumberFormat(...e),{cache:qr(e.number),strategy:$t.variadic}),getDateTimeFormat:Ot((...e)=>new Intl.DateTimeFormat(...e),{cache:qr(e.dateTime),strategy:$t.variadic}),getPluralRules:Ot((...e)=>new Intl.PluralRules(...e),{cache:qr(e.pluralRules),strategy:$t.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===Gr.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=>$r(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 Zr.memoizedDefaultLocale||(Zr.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),Zr.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=Or;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 Jr={settings:{titles:{profile:"Account",general:"Workspace Settings",users:"Workspace Members",subscription:"Plan & Billing",usage:"Usage",credits:"Credits",features:"Workspace Features",notifications:"Notifications",permissions:"Permissions",danger:"Danger Zone"},sidebar:{account:"Account",workspace:"Workspace",profile:"Account",general:"Settings",users:"Members",subscription:"Plan & Billing",usage:"Usage",credits:"Credits",features:"Features",notifications:"Notifications",permissions:"Permissions",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}}",noPermissionTitle:"Access Restricted",noPermissionDescription:"You don't have permission to access this section. Contact a workspace admin if you need access.",billingManageOnly:"Only users with billing management permissions can perform this action."}},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",forWorkspace:"for {name}",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",cancelTrialTitle:"Cancel Trial",cancelTrialConfirm:"Are you sure you want to cancel your trial?",cancelTrialAccess:"Your trial will continue until",cancelTrialNoCharge:"You won't be charged — your trial will simply expire",cancelTrialResume:"You can resume your trial anytime before it ends",cancelTrialKeep:"Keep Trial",cancelTrialButton:"Yes, Cancel Trial",resumeTitle:"Resume Subscription",resumeTrial:"Resume Trial",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",scheduledTrialCancellation:"Trial 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",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal"},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",trialEndDescription:"Your trial 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",startTrialDays:"Start {days}-day Free Trial",trialBadge:"{days}-day 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.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}/mo",includedWithOverage:"{count, number}/mo, then {price} / {unit}",includedHardLimit:"{count, number}/mo (hard limit)",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"},permissions:{title:"Permissions",description:"Permissions assigned to each role in this workspace.",ownerOnly:"Only the workspace owner can manage permissions.",save:"Save Permissions",saving:"Saving...",saveSuccess:"Permissions saved successfully"},credits:{title:"Credits",description:"Credits can be used for premium actions like AI generation.",balance:"Credit Balance",available:"Available",totalGranted:"Total Granted",totalConsumed:"Total Consumed",totalExpired:"Total Expired",noCredits:"No credits yet",noCreditsHint:"Credits will appear here when granted by your plan or purchased.",buyCredits:"Buy Credits",buyAmount:"Buy {count} Credits",purchasing:"Redirecting...",packages:"Credit Packages",noPackages:"No credit packages available.",creditsAmount:"{count} credits",validityDays:"Valid for {count} days",validityUnlimited:"No expiry",transactions:"Recent Transactions",noTransactions:"No transactions yet.",loadMore:"Load More",viewAll:"View All",expiringSoon:"Expiring Soon",expiringInDays:"{count} credits expiring within {days} days",noExpiring:"No credits expiring soon.",type:{plan_grant:"Plan Grant",pack_purchased:"Purchased",consumed:"Consumed",expired:"Expired",admin_grant:"Granted",admin_revoke:"Revoked",refund:"Refund"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"Credits purchased successfully! Your balance has been updated.",purchaseCanceled:"Credit purchase was canceled. No charges were made.",purchaseFailed:"Credit purchase failed. Please try again or contact support.",errorLoading:"Failed to load credit data",insufficientCredits:"Not enough credits"},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",fetchCreditBalance:"Failed to fetch credit balance",consumeCredits:"Failed to consume credits",purchaseCredits:"Failed to purchase credits",fetchCreditPackages:"Failed to fetch credit packages",fetchCreditTransactions:"Failed to fetch credit transactions",fetchExpiringCredits:"Failed to fetch expiring credits"}},Yr={en:async()=>Jr,es:async()=>(await Promise.resolve().then(function(){return eN})).es,fr:async()=>(await Promise.resolve().then(function(){return tN})).fr,de:async()=>(await Promise.resolve().then(function(){return rN})).de,ja:async()=>(await Promise.resolve().then(function(){return nN})).ja,zh:async()=>(await Promise.resolve().then(function(){return aN})).zh,hi:async()=>(await Promise.resolve().then(function(){return sN})).hi,ar:async()=>(await Promise.resolve().then(function(){return iN})).ar},Xr=["en","es","fr","de","ja","zh","hi","ar"];const Qr={hi:"hi-u-nu-deva",ar:"ar-u-nu-arab"};const en=t.createContext({messages:Jr,locale:"en",formattingLocale:"en"});function tn({locale:e="en",children:r}){const n=function(e){const t=e.toLowerCase().replace("_","-");if(Xr.includes(t))return t;const r=t.split("-")[0];return Xr.includes(r)?r:"en"}(e),[a,s]=t.useState(Jr);t.useEffect(()=>{if("en"===n)return void s(Jr);let e=!1;const t=Yr[n];return t&&t().then(t=>{e||s(t)}),()=>{e=!0}},[n]);const i=function(e){return Qr[e]??e}(n),o=t.useMemo(()=>({messages:a,locale:n,formattingLocale:i}),[a,n,i]);return t.createElement(en.Provider,{value:o},r)}const rn=new Map,nn=new Map,an=new Map;function sn(e,t){return t?`${e}:${JSON.stringify(t)}`:e}const on={getNumberFormat(e,t){const r=sn(e,t);let n=rn.get(r);return n||(n=new Intl.NumberFormat(e,t),rn.set(r,n)),n},getDateTimeFormat(e,t){const r=sn(e,t);let n=nn.get(r);return n||(n=new Intl.DateTimeFormat(e,t),nn.set(r,n)),n},getPluralRules(e,t){const r=sn(e,t);let n=an.get(r);return n||(n=new Intl.PluralRules(e,t),an.set(r,n)),n}},cn=new Map;function ln(){const{messages:e,locale:r,formattingLocale:n}=t.useContext(en),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=cn.get(r);return n||(n=new Zr(e,t,void 0,{formatters:on}),cn.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 dn(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return Te(t,{component:"storage",action:"getStorageItem",metadata:{key:e}}),null}}function un(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){Te(t,{component:"storage",action:"setStorageItem",metadata:{key:e}})}}function pn(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){Te(t,{component:"storage",action:"removeStorageItem",metadata:{key:e}})}}const mn="saas-session-id",hn="code";function fn(e){un(mn,e)}function gn(){return function(){if("undefined"==typeof window)return null;try{return dn(mn)}catch(e){return Te(e,{component:"auth-utils",action:"getSessionId",metadata:{key:mn}}),null}}()}function bn(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(hn)}catch(e){return Te(e,{component:"auth-utils",action:"getTokenFromUrl",metadata:{param:hn}}),null}}const vn="SDK is not ready (missing serverUrl, version, or orgId)";class yn{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._onUnauthorized=e.onUnauthorized,this._fetch=e.fetch??globalThis.fetch}ensureReady(){if(!this.serverUrl?.trim()||!this.version)throw new Error(vn);if(this.requireOrgId&&!this.orgId?.trim())throw new Error(vn)}get baseUrl(){return this.ensureReady(),`${this.serverUrl}/api/${this.version}/${this.basePath}`}getAuthHeaders(){return this._sessionId?{"x-session-id":this._sessionId}:function(){const e=gn(),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}`),401===a.status&&this._onUnauthorized&&this._onUnauthorized(),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 je(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)}async throwResponseError(e,t){let r=t;try{r=(await e.json()).message||r}catch{r=`${t} (${e.status}: ${e.statusText})`}throw new Error(r)}async unwrapResponse(e,t){const r=await e.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||t);return r.data||r}return r}}class xn extends yn{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 updateSettings(e){return this.fetchJson("workspaces/settings",{method:"PATCH",body:JSON.stringify(e)},"Failed to update workspace settings")}async updateWorkspacePermissions(e,t){return this.fetchJson(`workspaces/${e}/permissions`,{method:"PATCH",body:JSON.stringify({permissions:t})},"Failed to update workspace permissions")}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`);return t.ok||await this.throwResponseError(t,"Failed to fetch subscription"),this.unwrapResponse(t,"Failed to fetch subscription")}async getPlanGroup(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group`);return t.ok||await this.throwResponseError(t,"Failed to fetch plan group"),this.unwrapResponse(t,"Failed to fetch plan group")}async getPlanGroupByVersion(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/plan-group?groupVersionId=${encodeURIComponent(t)}`);return r.ok||await this.throwResponseError(r,"Failed to fetch plan group version"),this.unwrapResponse(r,"Failed to fetch plan group version")}async getPlanGroupVersions(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group/versions`);return t.ok||await this.throwResponseError(t,"Failed to fetch plan group versions"),this.unwrapResponse(t,"Failed to fetch plan group versions")}async getPublicPlans(e){if(!this.orgId)throw new Error("orgId is required for getPublicPlans");const t=await this.fetchResponse(`${this.orgId}/plans/${encodeURIComponent(e)}`);return t.ok||await this.throwResponseError(t,"Failed to fetch plans"),this.unwrapResponse(t,"Failed to fetch plans")}async getPublicCreditPackages(){if(!this.orgId)throw new Error("orgId is required for getPublicCreditPackages");const e=await this.fetchResponse(`${this.orgId}/credit-packages`);return e.ok||await this.throwResponseError(e,"Failed to fetch credit packages"),this.unwrapResponse(e,"Failed to fetch credit packages")}async getPlanGroupVersion(e){const t=await this.fetchResponse(`plan-group-versions/${e}`);return t.ok||await this.throwResponseError(t,"Failed to fetch plan group version"),this.unwrapResponse(t,"Failed to fetch plan group version")}async createCheckoutSession(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/checkout`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to create checkout session"),this.unwrapResponse(r,"Failed to create checkout session")}async selectFreePlan(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/select-free-plan`,{method:"POST",body:JSON.stringify({planVersionId:t})});return r.ok||await this.throwResponseError(r,"Failed to select free plan"),r.json()}async updateSubscription(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription`,{method:"PATCH",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to update subscription"),this.unwrapResponse(r,"Failed to update subscription")}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()}`);return a.ok||await this.throwResponseError(a,"Failed to fetch invoices"),this.unwrapResponse(a,"Failed to fetch invoices")}async getInvoice(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/invoices/${t}`);return r.ok||await this.throwResponseError(r,"Failed to fetch invoice"),this.unwrapResponse(r,"Failed to fetch invoice")}async cancelSubscriptionAtPeriodEnd(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/cancel-at-period-end`,{method:"POST"});return t.ok||await this.throwResponseError(t,"Failed to cancel subscription"),this.unwrapResponse(t,"Failed to cancel subscription")}async resumeSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/resume`,{method:"POST"});return t.ok||await this.throwResponseError(t,"Failed to resume subscription"),this.unwrapResponse(t,"Failed to resume subscription")}async recordUsage(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to record usage"),this.unwrapResponse(r,"Failed to record usage")}async recordUsageBatch(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/batch`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to record batch usage"),this.unwrapResponse(r,"Failed to record batch usage")}async getQuotaUsageStatus(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/status?quotaSlug=${encodeURIComponent(t)}`);return r.ok||await this.throwResponseError(r,"Failed to fetch quota usage status"),this.unwrapResponse(r,"Failed to fetch quota usage status")}async getAllQuotaUsage(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/usage/all`);return t.ok||await this.throwResponseError(t,"Failed to fetch all quota usage"),this.unwrapResponse(t,"Failed to fetch all quota usage")}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);return s.ok||await this.throwResponseError(s,"Failed to fetch usage logs"),this.unwrapResponse(s,"Failed to fetch usage logs")}async sendNotification(e,t,r,n){const a={event:t};return r&&(a.userId=r),n&&(a.data=n),this.fetchJson(`workspaces/${e}/notifications/send`,{method:"POST",body:JSON.stringify(a)},"Failed to send notification")}async getNotificationEvents(e){return this.fetchJson(`workspaces/${e}/notification-events`,{},"Failed to fetch notification events")}async getNotificationPreferences(e){return(await this.fetchJson(`workspaces/${e}/notification-preferences`,{},"Failed to fetch notification preferences")).notificationPreferences??{}}async updateNotificationPreferences(e,t){return(await this.fetchJson(`workspaces/${e}/notification-preferences`,{method:"PATCH",body:JSON.stringify({notificationPreferences:t})},"Failed to update notification preferences")).notificationPreferences??{}}async getCreditBalance(e){const t=await this.fetchResponse(`workspaces/${e}/credits`);return t.ok||await this.throwResponseError(t,"Failed to fetch credit balance"),this.unwrapResponse(t,"Failed to fetch credit balance")}async consumeCredits(e,t){const r=await this.fetchResponse(`workspaces/${e}/credits/consume`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){if(402===r.status){const e=await r.json().catch(()=>({})),t=new Error(e.message||"Insufficient credits");throw t.available=e.available,t.requested=e.requested,t.code="INSUFFICIENT_CREDITS",t}await this.throwResponseError(r,"Failed to consume credits")}return this.unwrapResponse(r,"Failed to consume credits")}async purchaseCredits(e,t){const r=await this.fetchResponse(`workspaces/${e}/credits/purchase`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to create credit purchase checkout"),this.unwrapResponse(r,"Failed to create credit purchase checkout")}async getCreditPackages(e){const t=await this.fetchResponse(`workspaces/${e}/credits/packages`);t.ok||await this.throwResponseError(t,"Failed to fetch credit packages");const r=await this.unwrapResponse(t,"Failed to fetch credit packages");return r.docs??r}async getCreditTransactions(e,t){const r=new URLSearchParams;t?.type&&r.append("type",t.type),t?.page&&r.append("page",t.page.toString()),t?.limit&&r.append("limit",t.limit.toString());const n=r.toString(),a=`workspaces/${e}/credits/transactions${n?`?${n}`:""}`,s=await this.fetchResponse(a);return s.ok||await this.throwResponseError(s,"Failed to fetch credit transactions"),this.unwrapResponse(s,"Failed to fetch credit transactions")}async getCreditBuckets(e,t){const r=new URLSearchParams;t?.status&&r.append("status",t.status),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}/credits/buckets${n?`?${n}`:""}`,s=await this.fetchResponse(a);return s.ok||await this.throwResponseError(s,"Failed to fetch credit buckets"),this.unwrapResponse(s,"Failed to fetch credit buckets")}async getExpiringCredits(e,t){const r=t?`?days=${t}`:"",n=await this.fetchResponse(`workspaces/${e}/credits/expiring${r}`);return n.ok||await this.throwResponseError(n,"Failed to fetch expiring credits"),this.unwrapResponse(n,"Failed to fetch expiring credits")}}function wn(){const e=Xe(),r=lt(),n=At();return t.useMemo(()=>({auth:e,os:r,workspaces:n}),[e,r,n])}function Sn(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)}function kn(e,r,n){t.useEffect(()=>{const t=new AbortController;return e(t.signal).catch(e=>{Ne(e)||(n?.onError?n.onError(e):Te(e,{component:"useAsyncEffect",action:"effect",metadata:{note:"Unhandled rejection - consider passing onError"}}))}),()=>t.abort()},r)}class Cn extends yn{constructor(e){super({...e,requireOrgId:!0})}async getSettings(e){return this.fetchJson(`${this.orgId}/settings`,{signal:e},"Failed to fetch settings")}}function En(){return Sn(e=>e.os)}let Nn=null;function An(){const e=wn(),r=En(),{serverUrl:n,version:a,orgId:s,settings:i}=r,o=t.useMemo(()=>rt(r)?new Cn({serverUrl:n,version:a,orgId:s}):null,[n,a,s]),c=t.useCallback(async t=>o?Nn||(Nn=(async()=>{try{const r=await o.getSettings(t);return e.os(et(r)),r}catch(e){return Re(e,{component:"useSaaSSettings",action:"getSettings",metadata:{serverUrl:n,version:a,orgId:s}}),null}finally{Nn=null}})(),Nn):null,[o,e,n,a,s]);return kn(async e=>{i||rt(r)&&await c(e)},[n,a,s],{onError:e=>Re(e,{component:"useSaaSSettings",action:"fetchSettings",metadata:{serverUrl:n,version:a,orgId:s}})}),t.useMemo(()=>({settings:i,getSettings:c}),[i,c])}function jn(){const e=En(),r=t.useCallback(()=>{e.auth?.callbacks?.onSessionExpired?.("expired")},[e.auth?.callbacks?.onSessionExpired]),n=function(e,r){return t.useMemo(()=>new xn({...e,onUnauthorized:r}),[e.serverUrl,e.version,e.orgId,r])}(e,r);return t.useMemo(()=>({os:e,api:n}),[e,n])}const _n=e=>{const{t:r}=ln(),{os:n,api:a}=jn(),s=rt(n),[i,o]=t.useState(null),[c,l]=t.useState(!1),[d,u]=t.useState(null),p=t.useCallback(async()=>{if(e&&s){l(!0),u(null);try{const t=await a.getPublicPlans(e);o(t)}catch(t){const n=De(t,"errors.fetchPlans",r);u(n),Te(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:d,refetch:p}},Pn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCurrentSubscription(e);s(t)}catch(t){const n=De(t,"errors.fetchSubscription",r);l(n),Te(t,{component:"useSubscription",action:"fetchSubscription",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{subscription:a,loading:i,error:c,refetch:d}},Tn=(e,r)=>{const{t:n}=ln(),{api:a}=jn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e){c(!0),d(null);try{const t=r?await a.getPlanGroupByVersion(e,r):await a.getPlanGroup(e);i(t)}catch(t){const a=De(t,"errors.fetchPlanGroup",n);d(a),Te(t,{component:"usePlanGroup",action:"fetchPlanGroup",metadata:{workspaceId:e,groupVersionId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{planGroup:s,loading:o,error:l,refetch:u}},Rn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersions(e);s(t)}catch(t){const n=De(t,"errors.fetchPlanGroupVersions",r);l(n),Te(t,{component:"usePlanGroupVersions",action:"fetchVersions",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{versions:a,loading:i,error:c,refetch:d}},Dn=e=>{const{t:r}=ln(),{api:n}=jn(),{getCheckoutStripeParams:a}=t.useContext(_t),[s,i]=t.useState(!1),[o,c]=t.useState(null);return{createCheckoutSession:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");i(!0),c(null);try{let r=t;if(a){const e=await a(t);e&&(r={...t,stripeOptions:{...t.stripeOptions,...e,metadata:{...t.stripeOptions?.metadata,...e.metadata},subscriptionMetadata:{...t.stripeOptions?.subscriptionMetadata,...e.subscriptionMetadata}}})}const s=await n.createCheckoutSession(e,r);return"trial_started"===s.type&&(Lt(),It()),s}catch(n){const a=De(n,"errors.createCheckout",r);throw c(a),Te(n,{component:"useCreateCheckoutSession",action:"createCheckoutSession",metadata:{workspaceId:e,request:t}}),n}finally{i(!1)}},[n,e,a]),loading:s,error:o}},In=e=>{const{t:r}=ln(),{api:n}=jn(),[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 Lt(),s}catch(n){const s=De(n,"errors.updateSubscription",r);throw o(s),Te(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}},Mn=(e,r)=>{const n=Pn(e),a=Tn(e,r),s=In(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}},Un=(e,r=10,n)=>{const{t:a}=ln(),{api:s}=jn(),[i,o]=t.useState([]),[c,l]=t.useState(!1),[d,u]=t.useState(!1),[p,m]=t.useState(null),h=t.useCallback(async()=>{if(!e)return o([]),void l(!1);u(!0),m(null);try{const t=await s.listInvoices(e,r,n);o(t.invoices||[]),l(t.has_more||!1)}catch(t){const s=De(t,"errors.fetchInvoices",a);m(s),Te(t,{component:"useInvoices",action:"fetchInvoices",metadata:{workspaceId:e,limit:r,startingAfter:n}})}finally{u(!1)}},[s,e,r,n]);return t.useEffect(()=>{h()},[h]),{invoices:i,hasMore:c,loading:d,error:p,refetch:h}},Ln=e=>{const{t:r}=ln(),{api:n}=jn(),[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=De(t,"errors.openBillingPortal",r);throw o(n),Te(t,{component:"useBillingPortal",action:"openBillingPortal",metadata:{workspaceId:e}}),t}finally{s(!1)}},[e,n]),loading:a,error:i}},On=e=>{const{t:r}=ln(),{api:n}=jn(),[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 Lt(),t}catch(t){const n=De(t,"errors.cancelSubscription",r);throw o(n),Te(t,{component:"useCancelSubscription",action:"cancelSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},zn=e=>{const{t:r}=ln(),{api:n}=jn(),[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 Lt(),t}catch(t){const n=De(t,"errors.resumeSubscription",r);throw o(n),Te(t,{component:"useResumeSubscription",action:"resumeSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},Fn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getAllQuotaUsage(e);s(t.quotas)}catch(t){const n=De(t,"errors.fetchAllQuotaUsage",r);l(n),Te(t,{component:"useAllQuotaUsage",action:"fetchAllUsage",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{quotas:a,loading:i,error:c,refetch:d}},Bn=t.createContext(null);Bn.displayName="SubscriptionContext";const Wn=t.memo(function({children:r}){const n=Sn(e=>e.workspaces.currentWorkspace),{subscription:a,loading:s,error:i,refetch:o}=Pn(n?._id);t.useEffect(()=>Ut(o),[o]);const c=t.useMemo(()=>({response:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(Bn.Provider,{value:c,children:r})});function Vn(){const e=t.useContext(Bn);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}Wn.displayName="SubscriptionContextProvider";const Gn=Tt(),Hn=Gn.subscribe,$n=Gn.invalidate,Kn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCreditBalance(e);s(t)}catch(t){const n=De(t,"errors.fetchCreditBalance",r);l(n),Te(t,{component:"useCreditBalance",action:"fetchBalance",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{balance:a,loading:i,error:c,refetch:d}},qn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{consumeCredits:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=await n.consumeCredits(e,t);return $n(),r}catch(n){const a="INSUFFICIENT_CREDITS"===n.code?`Insufficient credits. Available: ${n.available}, requested: ${n.requested}`:De(n,"errors.consumeCredits",r);throw o(a),Te(n,{component:"useConsumeCredits",action:"consumeCredits",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},Zn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{purchaseCredits:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{return await n.purchaseCredits(e,t)}catch(n){const a=De(n,"errors.purchaseCredits",r);throw o(a),Te(n,{component:"usePurchaseCredits",action:"purchaseCredits",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},Jn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState([]),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCreditPackages(e);s(t)}catch(t){const n=De(t,"errors.fetchCreditPackages",r);l(n),Te(t,{component:"useCreditPackages",action:"fetchPackages",metadata:{workspaceId:e}})}finally{o(!1)}}else s([])},[n,e]);return t.useEffect(()=>{d()},[d]),{packages:a,loading:i,error:c,refetch:d}},Yn=(e,r)=>{const{t:n}=ln(),{api:a}=jn(),[s,i]=t.useState([]),[o,c]=t.useState(0),[l,d]=t.useState(0),[u,p]=t.useState(1),[m,h]=t.useState(!1),[f,g]=t.useState(!1),[b,v]=t.useState(!1),[y,x]=t.useState(null),w=r?.type,S=r?.page,k=r?.limit,C=t.useCallback(async()=>{if(!e)return i([]),c(0),d(0),p(1),h(!1),void g(!1);v(!0),x(null);try{const t=await a.getCreditTransactions(e,{type:w,page:S,limit:k});i(t.docs||[]),c(t.totalDocs||0),d(t.totalPages||0),p(t.page||1),h(t.hasNextPage||!1),g(t.hasPrevPage||!1)}catch(t){const r=De(t,"errors.fetchCreditTransactions",n);x(r),Te(t,{component:"useCreditTransactions",action:"fetchTransactions",metadata:{workspaceId:e}})}finally{v(!1)}},[a,e,w,S,k]);return t.useEffect(()=>{C()},[C]),{transactions:s,totalDocs:o,totalPages:l,page:u,hasNextPage:m,hasPrevPage:f,loading:b,error:y,refetch:C}},Xn=(e,r)=>{const{t:n}=ln(),{api:a}=jn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e){c(!0),d(null);try{const t=await a.getExpiringCredits(e,r);i(t)}catch(t){const a=De(t,"errors.fetchExpiringCredits",n);d(a),Te(t,{component:"useExpiringCredits",action:"fetchExpiring",metadata:{workspaceId:e,days:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{expiringCredits:s?.expiringCredits??0,buckets:s?.buckets??[],days:s?.days??r??7,loading:o,error:l,refetch:u}},Qn=()=>{const{t:e}=ln(),{os:r,api:n}=jn(),a=rt(r),[s,i]=t.useState([]),[o,c]=t.useState(),[l,d]=t.useState(!1),[u,p]=t.useState(null),m=t.useCallback(async()=>{if(a){d(!0),p(null);try{const e=await n.getPublicCreditPackages();i(e.packages||[]),c(e.notes)}catch(t){const r=De(t,"errors.fetchCreditPackages",e);p(r),Te(t,{component:"usePublicCreditPackages",action:"fetchPackages"})}finally{d(!1)}}else i([])},[n,a]);t.useEffect(()=>{m()},[m]);return{packages:s,notes:o,loading:!a||l,error:u,refetch:m}},ea=t.createContext(null);ea.displayName="CreditBalanceContext";const ta=t.memo(function({children:r}){const n=Sn(e=>e.workspaces.currentWorkspace),{balance:a,loading:s,error:i,refetch:o}=Kn(n?._id);t.useEffect(()=>Hn(o),[o]);const c=t.useMemo(()=>({balance:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(ea.Provider,{value:c,children:r})});function ra(){const e=t.useContext(ea);if(null===e)throw new Error("useCreditBalanceContext must be used within CreditBalanceContextProvider. Make sure CreditBalanceContextProvider is wrapping your application (included in SaaSOSProvider by default).");return e}ta.displayName="CreditBalanceContextProvider";const na=t.createContext({appPermissions:void 0});function aa({appPermissions:r,children:n}){const a=t.useMemo(()=>({appPermissions:r}),[r]);return e.jsx(na.Provider,{value:a,children:n})}function sa(){return t.useContext(na)}const ia=t.createContext(null);ia.displayName="QuotaUsageContext";const oa=t.memo(function({children:r}){const n=Sn(e=>e.workspaces.currentWorkspace),{quotas:a,loading:s,error:i,refetch:o}=Fn(n?._id);t.useEffect(()=>Dt(o),[o]);const c=t.useMemo(()=>({quotas:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(ia.Provider,{value:c,children:r})});function ca(){const e=t.useContext(ia);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}function la(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}}function da(e,t="/"){const r=la(e);window.location.href=r||t}oa.displayName="QuotaUsageContextProvider";const ua="saas-auth-intent";function pa(e){return"object"==typeof e&&null!==e&&"string"==typeof e.returnUrl&&"number"==typeof e.createdAt}function ma(e){la(e)&&function(e,t){try{un(e,JSON.stringify(t))}catch(t){Te(t,{component:"storage",action:"setStorageJSON",metadata:{key:e}})}}(ua,{returnUrl:e,createdAt:Date.now()})}function ha(){const e=function(e,t){const r=dn(e);if(!r)return null;try{const n=JSON.parse(r);return t&&!t(n)?(Te(new Error("Storage data failed validation"),{component:"storage",action:"getStorageJSON",metadata:{key:e}}),pn(e),null):n}catch(t){return Te(t,{component:"storage",action:"getStorageJSON",metadata:{key:e}}),pn(e),null}}(ua,pa);return pn(ua),e?Date.now()-e.createdAt>6e5?null:la(e.returnUrl):null}class fa extends yn{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)});return r.ok||await this.throwResponseError(r,"Failed to initiate authentication"),r.json()}async getProfile(e,t){return this.fetchJson("profile",{headers:{"x-session-id":e},signal:t},"Failed to fetch user profile")}}const ga="bb",ba="checkout",va="billing",ya="selectPlan",xa="creditPurchase",wa="openCreditStore",Sa="success",ka="cancel",Ca="error",Ea="subscription",Na="credits";function Aa(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(ga,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),r.toString()}function ja(e,t){const r="undefined"!=typeof window?window.location.href:void 0;return{successUrl:Aa({action:xa,status:Sa,ws:e,screen:Na},r),cancelUrl:Aa({action:xa,status:ka,ws:e,screen:Na},r)}}function _a(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(ga);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 Pa(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(ga)&&(e.searchParams.delete(ga),window.history.replaceState({},"",e.toString()))}catch{}}const Ta={Monthly:"monthly",Yearly:"yearly",Quarterly:"quarterly"},Ra="active",Da="trialing",Ia="canceled",Ma="past_due",Ua="paused",La="draft",Oa="open",za="paid",Fa="uncollectible",Ba="void",Wa="feature",Va="limit",Ga="quota",Ha="none",$a="final",Ka="suspended",qa="plan_grant",Za="pack_purchased",Ja="consumed",Ya="expired",Xa="admin_grant",Qa="admin_revoke",es="refund";function ts(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 rs(e,t,r){const n=ts(e,t);if(!n?.basePricing)return null;const a=n.basePricing[r];return null!=a?a:null}function ns(e,t,r,n){const a=ts(e,t),s=a?.quotaOverages?.[r];if(s)return s[n]}function as(e,t,r,n){const a=e.quotas?.[r];if(null==a)return null;const s=a[n];if(!s)return null;const i=ns(e,t,r,n);return{included:s.included,...void 0!==s.unitSize&&{unitSize:s.unitSize},...void 0!==i&&{overage:i},allowOverage:!1!==a.allowOverage}}function ss(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 is(e,t){const r=ts(e,t);return r?.seatPricing?.enabled?r.seatPricing:null}function os(e,t,r){const n=is(e,t);return n?.perSeat?n.perSeat[r]??null:null}function cs(e){const{planVersion:t,currency:r="usd",settingsMaxUsers:n}=e;if(t){const e=is(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 ls(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 ds="user:created",us="user:updated",ps="workspace:changed",ms="workspace:updated",hs="workspace:user-added",fs="workspace:user-removed",gs="workspace:user-role-changed",bs="workspace:created",vs="workspace:deleted";const ys=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){Te(t,{component:"EventEmitter",action:"emit",metadata:{eventType:e}})}}async emitUserCreated(e){await this.emit(ds,{user:e})}async emitUserUpdated(e,t){await this.emit(us,{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit(ps,{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit(ms,{workspace:e})}async emitWorkspaceUserAdded(e,t,r){await this.emit(hs,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRemoved(e,t,r){await this.emit(fs,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRoleChanged(e,t,r,n){await this.emit(gs,{userId:e,workspace:t,previousRole:r,newRole:n})}async emitWorkspaceCreated(e){await this.emit(bs,{workspace:e})}async emitWorkspaceDeleted(e){await this.emit(vs,{workspace:e})}},xs=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ws=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)},Ss=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),ks=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
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="-",d=[],u=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||d}return r[e]||d}}},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)}}},C=[],E=(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 E(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)):E(C,!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+/,_=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=_(e[n]))&&(r&&(r+=" "),r+=t);return r},P=(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:d,hasImportantModifier:u,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===d.length?"":1===d.length?d[0]:s(d).join(":"),b=u?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),...u(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=_(t))&&(a&&(a+=" "),a+=r);return a})(...e))},T=[],R=e=>{const t=t=>t[e]||T;return t.isThemeGetter=!0,t},D=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I=/^\((?:(\w[\w-]*):)?(.+)\)$/i,M=/^\d+\/\d+$/,U=/^(\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=>M.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),V=e=>!!e&&Number.isInteger(Number(e)),G=e=>e.endsWith("%")&&W(e.slice(0,-1)),H=e=>U.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),de=e=>me(e,fe),ue=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=P(()=>{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"),d=R("shadow"),u=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],C=()=>[V,"auto",se,Q],E=()=>["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],_=()=>["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]}],P=()=>["auto","cover","contain",le,X,{size:[se,Q]}],T=()=>[G,ie,ee],D=()=>["","none","full",l,se,Q],I=()=>["",W,ie,ee],M=()=>[W,G,ce,re],U=()=>["","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:[H],breakpoint:[H],color:[$],container:[H],"drop-shadow":[H],ease:["in","out","in-out"],font:[Y],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[H],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[H],shadow:[H],spacing:["px",W],text:[H],"text-shadow":[H],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":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":S()}],"row-start-end":[{row:k()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":E()}],"auto-rows":[{"auto-rows":E()}],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",G,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:_()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:P()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},V,se,Q],radial:["",se,Q],conic:[V,se,Q]},de,ne]}],"bg-color":[{bg:j()}],"gradient-from-pos":[{from:T()}],"gradient-via-pos":[{via:T()}],"gradient-to-pos":[{to:T()}],"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",d,ue,ae]}],"shadow-color":[{shadow:j()}],"inset-shadow":[{"inset-shadow":["none",u,ue,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,ue,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":M()}],"mask-image-linear-to-pos":[{"mask-linear-to":M()}],"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":M()}],"mask-image-t-to-pos":[{"mask-t-to":M()}],"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":M()}],"mask-image-r-to-pos":[{"mask-r-to":M()}],"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":M()}],"mask-image-b-to-pos":[{"mask-b-to":M()}],"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":M()}],"mask-image-l-to-pos":[{"mask-l-to":M()}],"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":M()}],"mask-image-x-to-pos":[{"mask-x-to":M()}],"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":M()}],"mask-image-y-to-pos":[{"mask-y-to":M()}],"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":M()}],"mask-image-radial-to-pos":[{"mask-radial-to":M()}],"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":M()}],"mask-image-conic-to-pos":[{"mask-conic-to":M()}],"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:_()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:P()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,Q]}],filter:[{filter:["","none",se,Q]}],blur:[{blur:U()}],brightness:[{brightness:[W,se,Q]}],contrast:[{contrast:[W,se,Q]}],"drop-shadow":[{"drop-shadow":["","none",m,ue,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":U()}],"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 Ce(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 Ee(e,...t){console.error(e,...t)}function Ne(e){return e instanceof Error&&("AbortError"===e.name||"ERR_CANCELED"===e.code)}async function Ae(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 je(e,t="Request failed"){if(!e.ok){let r=t;try{const t=await Ae(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 Ae(e)}catch(e){if(e instanceof Error&&e.message.includes("Invalid JSON"))throw e;throw new Error("Failed to parse response as JSON")}}class _e 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,_e)}}const Pe=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 _e("string"==typeof e?e:"An unknown error occurred","UNKNOWN_ERROR",t),n=r instanceof _e?r:new _e(r.message,"SDK_ERROR",t,r);if(this.config.enableConsoleLogging&&Ce(`[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){Ee("[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 Te(e,t={}){Pe.handleError(e,t)}function Re(e,t={}){return!Ne(e)&&(Pe.handleError(e,t),!0)}function De(e,t,r){return e instanceof Error?e.message:r(t)}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(Te(e,{component:"ErrorBoundary",action:"componentDidCatch",metadata:{componentStack:t.componentStack,errorBoundary:this.constructor.name}}),this.props.onError)try{this.props.onError(e,t)}catch(e){Ee("[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 Me=()=>({type:"AUTHENTICATION_STARTED"}),Ue=()=>({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),c=a.current!==r,l=s.current!==n,d=c||l;a.current=r,s.current=n;const u=t.useRef(0);d&&(u.current+=1);const p=u.current;return t.useMemo(()=>{const t=r(e);if(o.current){if(n?n(i.current,t):Object.is(i.current,t))return i.current}return i.current=t,o.current=!0,t},[e,p])}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,d]=t.useReducer(a,n,s||(e=>e)),u=t.useMemo(()=>({state:l,dispatch:d}),[l,d]);return e.jsx(c.Provider,{value:u,children:e.jsx(i.Provider,{value:l,children:e.jsx(o.Provider,{value:d,children:r})})})});l.displayName=`${r}Provider`;const d=e=>new Error(`use${r}${e} must be used within a ${r}Provider. Make sure SaaSOSProvider is wrapping your application.`),u=()=>{const e=t.useContext(i);if(null===e)throw d("State");return e};return{Provider:l,useContext:()=>{const e=t.useContext(c);if(!e)throw d("Context");return e},useState:u,useDispatch:()=>{const e=t.useContext(o);if(null===e)throw d("Dispatch");return e},useSelector:(e,t)=>{const r=e||(e=>e);return Fe(u(),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 Ge(e,t,r){return{...e,[t]:r}}function He(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 Ge(e,"status",We.redirecting);case"AUTHENTICATION_PROCESSING":return Ge(e,"status",We.authenticating);case"AUTHENTICATION_FAILED":case"REMOVE_SESSION":return He(e,{session:null,status:We.unauthenticated});case"SET_SESSION":return He(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 He(e,t.payload);case"REMOVE_SAAS_OS_CONFIG":return nt();case"SET_SETTINGS":return Ge(e,"settings",t.payload);default:return e}}}),ot=at,ct=st,lt=it,dt=e=>({type:"SET_WORKSPACES",payload:e}),ut=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:Ct}=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 Ge(e,"workspaces",t.payload);case"ADD_WORKSPACE":return Ge(e,"workspaces",[...e.workspaces,t.payload]);case"UPDATE_WORKSPACE":return Ge(e,"workspaces",e.workspaces.map(e=>e._id===t.payload._id?t.payload:e));case"REMOVE_WORKSPACE":return Ge(e,"workspaces",e.workspaces.filter(e=>e._id!==t.payload));case"SET_ALL_FEATURES":return Ge(e,"allFeatures",t.payload);case"SET_CURRENT_WORKSPACE":return Ge(e,"currentWorkspace",t.payload);case"RESET_CURRENT_WORKSPACE":return Ge(e,"currentWorkspace",null);case"SET_IS_INITIALIZED":return Ge(e,"isInitialized",t.payload);case"SET_LOADING":return Ge(e,"loading",t.payload);case"SET_ERROR":return Ge(e,"error",t.payload);case"SET_REFRESHING":return Ge(e,"refreshing",t.payload);case"SET_SWITCHING_TO_ID":return Ge(e,"switchingToId",t.payload);default:return e}}}),Et=St,Nt=kt,At=Ct,jt=t.memo(({children:t})=>e.jsx(ot,{children:e.jsx(Je,{children:e.jsx(Et,{children:t})})}));jt.displayName="SDKContextProvider";const _t=t.createContext({});_t.displayName="CheckoutConfigContext";const Pt=t.memo(({getCheckoutStripeParams:r,children:n})=>{const a=t.useMemo(()=>({getCheckoutStripeParams:r}),[r]);return e.jsx(_t.Provider,{value:a,children:n})});function Tt(){const e=new Set;return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),invalidate(){e.forEach(e=>e())},reset(){e.clear()}}}Pt.displayName="CheckoutConfigProvider";const Rt=Tt(),Dt=Rt.subscribe,It=Rt.invalidate,Mt=Tt(),Ut=Mt.subscribe,Lt=Mt.invalidate;function Ot(e,t){const r=t&&t.cache?t.cache:Ht,n=t&&t.serializer?t.serializer:Vt;return(t&&t.strategy?t.strategy:Wt)(e,{cache:r,serializer:n})}function zt(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 Ft(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 Bt(e,t,r,n,a){return r.bind(t,e,n,a)}function Wt(e,t){return Bt(e,this,1===e.length?zt:Ft,t.cache.create(),t.serializer)}const Vt=function(){return JSON.stringify(arguments)};class Gt{cache;constructor(){this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const Ht={create:function(){return new Gt}},$t={variadic:function(e,t){return Bt(e,this,Ft,t.cache.create(),t.serializer)}},Kt=/(?:[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 qt(e){const t={};return e.replace(Kt,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 Zt=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function Jt(e){return e.replace(/^(.*?)-/,"")}const Yt=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,Xt=/^(@+)?(\+|#+)?[rs]?$/g,Qt=/(\*)(0+)|(#+)(0+)|(0+)/g,er=/^(0+)$/;function tr(e){const t={};return"r"===e[e.length-1]?t.roundingPriority="morePrecision":"s"===e[e.length-1]&&(t.roundingPriority="lessPrecision"),e.replace(Xt,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 rr(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 nr(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)),!er.test(e))throw new Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}function ar(e){const t=rr(e);return t||{}}function sr(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=Jt(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,...ar(t)}),{})};continue;case"engineering":t={...t,notation:"engineering",...r.options.reduce((e,t)=>({...e,...ar(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(Qt,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(er.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(Yt.test(r.stem)){if(r.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");r.stem.replace(Yt,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,...tr(e)});continue}if(Xt.test(r.stem)){t={...t,...tr(r.stem)};continue}const e=rr(r.stem);e&&(t={...t,...e});const n=nr(r.stem);n&&(t={...t,...n})}return t}let ir=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}({}),or=function(e){return e[e.number=0]="number",e[e.dateTime=1]="dateTime",e}({});function cr(e){return e.type===ir.literal}function lr(e){return e.type===ir.argument}function dr(e){return e.type===ir.number}function ur(e){return e.type===ir.date}function pr(e){return e.type===ir.time}function mr(e){return e.type===ir.select}function hr(e){return e.type===ir.plural}function fr(e){return e.type===ir.pound}function gr(e){return e.type===ir.tag}function br(e){return!(!e||"object"!=typeof e||e.type!==or.number)}function vr(e){return!(!e||"object"!=typeof e||e.type!==or.dateTime)}let yr=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 xr=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,wr={"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 Sr(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(wr[n||""]||wr[r||""]||wr[`${r}-001`]||wr["001"])[0]}const kr=new RegExp(`^${xr.source}*`),Cr=new RegExp(`${xr.source}*$`);function Er(e,t){return{start:e,end:t}}const Nr=!!Object.fromEntries,Ar=!!String.prototype.trimStart,jr=!!String.prototype.trimEnd,_r=Nr?Object.fromEntries:function(e){const t={};for(const[r,n]of e)t[r]=n;return t},Pr=Ar?function(e){return e.trimStart()}:function(e){return e.replace(kr,"")},Tr=jr?function(e){return e.trimEnd()}:function(e){return e.replace(Cr,"")},Rr=new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");class Dr{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(yr.UNMATCHED_CLOSING_TAG,Er(this.clonePosition(),this.clonePosition()))}if(60===a&&!this.ignoreTag&&Ir(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:ir.pound,location:Er(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:ir.literal,value:`<${n}/>`,location:Er(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()||!Ir(this.char()))return this.error(yr.INVALID_TAG,Er(i,this.clonePosition()));const e=this.clonePosition();return n!==this.parseTagName()?this.error(yr.UNMATCHED_CLOSING_TAG,Er(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf(">")?{val:{type:ir.tag,value:n,children:s,location:Er(r,this.clonePosition())},err:null}:this.error(yr.INVALID_TAG,Er(i,this.clonePosition())))}return this.error(yr.UNCLOSED_TAG,Er(r,this.clonePosition()))}return this.error(yr.INVALID_TAG,Er(r,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&Mr(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=Er(r,this.clonePosition());return{val:{type:ir.literal,value:n,location:a},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Ir(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(yr.EXPECT_ARGUMENT_CLOSING_BRACE,Er(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(yr.EMPTY_ARGUMENT,Er(r,this.clonePosition()));let n=this.parseIdentifierIfPossible().value;if(!n)return this.error(yr.MALFORMED_ARGUMENT,Er(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(yr.EXPECT_ARGUMENT_CLOSING_BRACE,Er(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:ir.argument,value:n,location:Er(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(yr.EXPECT_ARGUMENT_CLOSING_BRACE,Er(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(yr.MALFORMED_ARGUMENT,Er(r,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),r=function(e,t){return Rr.lastIndex=t,Rr.exec(e)[1]??""}(this.message,t),n=t+r.length;this.bumpTo(n);return{value:r,location:Er(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(yr.EXPECT_ARGUMENT_TYPE,Er(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=Tr(r.val);if(0===n.length)return this.error(yr.EXPECT_ARGUMENT_STYLE,Er(this.clonePosition(),this.clonePosition()));e={style:n,styleLocation:Er(t,this.clonePosition())}}const t=this.tryParseArgumentClose(n);if(t.err)return t;const a=Er(n,this.clonePosition());if(e&&e.style.startsWith("::")){let t=Pr(e.style.slice(2));if("number"===s){const n=this.parseNumberSkeletonFromString(t,e.styleLocation);return n.err?n:{val:{type:ir.number,value:r,location:a,style:n.val},err:null}}{if(0===t.length)return this.error(yr.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=Sr(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:or.dateTime,pattern:n,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?qt(n):{}};return{val:{type:"date"===s?ir.date:ir.time,value:r,location:a,style:i},err:null}}}return{val:{type:"number"===s?ir.number:"date"===s?ir.date:ir.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(yr.EXPECT_SELECT_ARGUMENT_OPTIONS,Er(a,{...a}));this.bumpSpace();let i=this.parseIdentifierIfPossible(),o=0;if("select"!==s&&"offset"===i.value){if(!this.bumpIf(":"))return this.error(yr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Er(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(yr.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,yr.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 d=Er(n,this.clonePosition());return"select"===s?{val:{type:ir.select,value:r,options:_r(c.val),location:d},err:null}:{val:{type:ir.plural,value:r,options:_r(c.val),offset:o,pluralType:"plural"===s?"cardinal":"ordinal",location:d},err:null}}default:return this.error(yr.INVALID_ARGUMENT_TYPE,Er(a,i))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(yr.EXPECT_ARGUMENT_CLOSING_BRACE,Er(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(yr.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Er(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(Zt).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(yr.INVALID_NUMBER_SKELETON,t)}return{val:{type:or.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?sr(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(yr.EXPECT_PLURAL_ARGUMENT_SELECTOR,yr.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;c=Er(e,this.clonePosition()),o=this.message.slice(e.offset,this.offset())}}if(i.has(o))return this.error("select"===t?yr.DUPLICATE_SELECT_ARGUMENT_SELECTOR:yr.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,c);"other"===o&&(a=!0),this.bumpSpace();const n=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?yr.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:yr.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Er(this.clonePosition(),this.clonePosition()));const l=this.parseMessage(e+1,t,r);if(l.err)return l;const d=this.tryParseArgumentClose(n);if(d.err)return d;s.push([o,{value:l.val,location:Er(n,this.clonePosition())}]),i.add(o),this.bumpSpace(),({value:o,location:c}=this.parseIdentifierIfPossible())}return 0===s.length?this.error("select"===t?yr.EXPECT_SELECT_ARGUMENT_SELECTOR:yr.EXPECT_PLURAL_ARGUMENT_SELECTOR,Er(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!a?this.error(yr.MISSING_OTHER_CLAUSE,Er(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=Er(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()&&Ur(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 Ir(e){return e>=97&&e<=122||e>=65&&e<=90}function Mr(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 Ur(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Lr(e){e.forEach(e=>{if(delete e.location,mr(e)||hr(e))for(const t in e.options)delete e.options[t].location,Lr(e.options[t].value);else dr(e)&&br(e.style)||(ur(e)||pr(e))&&vr(e.style)?delete e.style.location:gr(e)&&Lr(e.children)})}function Or(e,t={}){t={shouldParseSkeletons:!0,requiresOtherClause:!0,...t};const r=new Dr(e,t).parse();if(r.err){const e=SyntaxError(yr[r.err.kind]);throw e.location=r.err.location,e.originalMessage=r.err.message,e}return t?.captureLocation||Lr(r.val),r.val}let zr=function(e){return e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API",e}({});class Fr 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 Br extends Fr{constructor(e,t,r,n){super(`Invalid values for "${e}": "${t}". Options are "${Object.keys(r).join('", "')}"`,zr.INVALID_VALUE,n)}}class Wr extends Fr{constructor(e,t,r){super(`Value for "${e}" must be of type ${t}`,zr.INVALID_VALUE,r)}}class Vr extends Fr{constructor(e,t){super(`The intl string context variable "${e}" was not provided to the string "${t}"`,zr.MISSING_VALUE,t)}}let Gr=function(e){return e[e.literal=0]="literal",e[e.object=1]="object",e}({});function Hr(e){return"function"==typeof e}function $r(e,t,r,n,a,s,i){if(1===e.length&&cr(e[0]))return[{type:Gr.literal,value:e[0].value}];const o=[];for(const c of e){if(cr(c)){o.push({type:Gr.literal,value:c.value});continue}if(fr(c)){"number"==typeof s&&o.push({type:Gr.literal,value:r.getNumberFormat(t).format(s)});continue}const{value:e}=c;if(!a||!(e in a))throw new Vr(e,i);let l=a[e];if(lr(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?Gr.literal:Gr.object,value:l});else{if(ur(c)){const e="string"==typeof c.style?n.date[c.style]:vr(c.style)?c.style.parsedOptions:void 0;o.push({type:Gr.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(pr(c)){const e="string"==typeof c.style?n.time[c.style]:vr(c.style)?c.style.parsedOptions:n.time.medium;o.push({type:Gr.literal,value:r.getDateTimeFormat(t,e).format(l)});continue}if(dr(c)){const e="string"==typeof c.style?n.number[c.style]:br(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:Gr.literal,value:r.getNumberFormat(t,e).format(l)});continue}if(gr(c)){const{children:e,value:l}=c,d=a[l];if(!Hr(d))throw new Wr(l,"function",i);let u=d($r(e,t,r,n,a,s).map(e=>e.value));Array.isArray(u)||(u=[u]),o.push(...u.map(e=>({type:"string"==typeof e?Gr.literal:Gr.object,value:e})))}if(mr(c)){const e=l,s=(Object.prototype.hasOwnProperty.call(c.options,e)?c.options[e]:void 0)||c.options.other;if(!s)throw new Br(c.value,l,Object.keys(c.options),i);o.push(...$r(s.value,t,r,n,a));continue}if(hr(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 Fr('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',zr.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 Br(c.value,l,Object.keys(c.options),i);const d="bigint"==typeof l?Number(l):l;o.push(...$r(s.value,t,r,n,a,d-(c.offset||0)));continue}}}return(c=o).length<2?c:c.reduce((e,t)=>{const r=e[e.length-1];return r&&r.type===Gr.literal&&t.type===Gr.literal?r.value+=t.value:e.push(t),e},[]);var c}function Kr(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 qr(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}class Zr{ast;locales;resolvedLocale;formatters;formats;message;formatterCache={number:{},dateTime:{},pluralRules:{}};constructor(e,t=Zr.defaultLocale,r,n){if(this.locales=t,this.resolvedLocale=Zr.resolveLocale(t),"string"==typeof e){if(this.message=e,!Zr.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");const{...t}=n||{};this.ast=Zr.__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=Kr(Zr.formats,r),this.formatters=n&&n.formatters||function(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:Ot((...e)=>new Intl.NumberFormat(...e),{cache:qr(e.number),strategy:$t.variadic}),getDateTimeFormat:Ot((...e)=>new Intl.DateTimeFormat(...e),{cache:qr(e.dateTime),strategy:$t.variadic}),getPluralRules:Ot((...e)=>new Intl.PluralRules(...e),{cache:qr(e.pluralRules),strategy:$t.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===Gr.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=>$r(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 Zr.memoizedDefaultLocale||(Zr.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),Zr.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=Or;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 Jr={settings:{titles:{profile:"Account",general:"Workspace Settings",users:"Workspace Members",subscription:"Plan & Billing",usage:"Usage",credits:"Credits",features:"Workspace Features",notifications:"Notifications",permissions:"Permissions",danger:"Danger Zone"},sidebar:{account:"Account",workspace:"Workspace",profile:"Account",general:"Settings",users:"Members",subscription:"Plan & Billing",usage:"Usage",credits:"Credits",features:"Features",notifications:"Notifications",permissions:"Permissions",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}}",noPermissionTitle:"Access Restricted",noPermissionDescription:"You don't have permission to access this section. Contact a workspace admin if you need access.",billingManageOnly:"Only users with billing management permissions can perform this action."}},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",forWorkspace:"for {name}",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",cancelTrialTitle:"Cancel Trial",cancelTrialConfirm:"Are you sure you want to cancel your trial?",cancelTrialAccess:"Your trial will continue until",cancelTrialNoCharge:"You won't be charged — your trial will simply expire",cancelTrialResume:"You can resume your trial anytime before it ends",cancelTrialKeep:"Keep Trial",cancelTrialButton:"Yes, Cancel Trial",resumeTitle:"Resume Subscription",resumeTrial:"Resume Trial",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",scheduledTrialCancellation:"Trial 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",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal"},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",trialEndDescription:"Your trial 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",startTrialDays:"Start {days}-day Free Trial",trialBadge:"{days}-day 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.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}/mo",includedWithOverage:"{count, number}/mo, then {price} / {unit}",includedHardLimit:"{count, number}/mo (hard limit)",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"},permissions:{title:"Permissions",description:"Permissions assigned to each role in this workspace.",ownerOnly:"Only the workspace owner can manage permissions.",save:"Save Permissions",saving:"Saving...",saveSuccess:"Permissions saved successfully"},credits:{title:"Credits",description:"Credits can be used for premium actions like AI generation.",balance:"Credit Balance",available:"Available",totalGranted:"Total Granted",totalConsumed:"Total Consumed",totalExpired:"Total Expired",noCredits:"No credits yet",noCreditsHint:"Credits will appear here when granted by your plan or purchased.",buyCredits:"Buy Credits",buyAmount:"Buy {count} Credits",purchasing:"Redirecting...",packages:"Credit Packages",noPackages:"No credit packages available.",creditsAmount:"{count} credits",validityDays:"Valid for {count} days",validityUnlimited:"No expiry",transactions:"Recent Transactions",noTransactions:"No transactions yet.",loadMore:"Load More",viewAll:"View All",expiringSoon:"Expiring Soon",expiringInDays:"{count} credits expiring within {days} days",noExpiring:"No credits expiring soon.",type:{plan_grant:"Plan Grant",pack_purchased:"Purchased",consumed:"Consumed",expired:"Expired",admin_grant:"Granted",admin_revoke:"Revoked",refund:"Refund"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"Credits purchased successfully! Your balance has been updated.",purchaseCanceled:"Credit purchase was canceled. No charges were made.",purchaseFailed:"Credit purchase failed. Please try again or contact support.",errorLoading:"Failed to load credit data",insufficientCredits:"Not enough credits"},loading:{restoringSession:"Restoring your session...",redirecting:"Redirecting...",signingIn:"Signing you in...",verifyingAccount:"Verifying your account...",almostThere:"Almost there..."},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",fetchCreditBalance:"Failed to fetch credit balance",consumeCredits:"Failed to consume credits",purchaseCredits:"Failed to purchase credits",fetchCreditPackages:"Failed to fetch credit packages",fetchCreditTransactions:"Failed to fetch credit transactions",fetchExpiringCredits:"Failed to fetch expiring credits"}},Yr={en:async()=>Jr,es:async()=>(await Promise.resolve().then(function(){return sN})).es,fr:async()=>(await Promise.resolve().then(function(){return iN})).fr,de:async()=>(await Promise.resolve().then(function(){return oN})).de,ja:async()=>(await Promise.resolve().then(function(){return cN})).ja,zh:async()=>(await Promise.resolve().then(function(){return lN})).zh,hi:async()=>(await Promise.resolve().then(function(){return dN})).hi,ar:async()=>(await Promise.resolve().then(function(){return uN})).ar},Xr=["en","es","fr","de","ja","zh","hi","ar"];const Qr={hi:"hi-u-nu-deva",ar:"ar-u-nu-arab"};const en=t.createContext({messages:Jr,locale:"en",formattingLocale:"en"});function tn({locale:e="en",children:r}){const n=function(e){const t=e.toLowerCase().replace("_","-");if(Xr.includes(t))return t;const r=t.split("-")[0];return Xr.includes(r)?r:"en"}(e),[a,s]=t.useState(Jr);t.useEffect(()=>{if("en"===n)return void s(Jr);let e=!1;const t=Yr[n];return t&&t().then(t=>{e||s(t)}),()=>{e=!0}},[n]);const i=function(e){return Qr[e]??e}(n),o=t.useMemo(()=>({messages:a,locale:n,formattingLocale:i}),[a,n,i]);return t.createElement(en.Provider,{value:o},r)}const rn=new Map,nn=new Map,an=new Map;function sn(e,t){return t?`${e}:${JSON.stringify(t)}`:e}const on={getNumberFormat(e,t){const r=sn(e,t);let n=rn.get(r);return n||(n=new Intl.NumberFormat(e,t),rn.set(r,n)),n},getDateTimeFormat(e,t){const r=sn(e,t);let n=nn.get(r);return n||(n=new Intl.DateTimeFormat(e,t),nn.set(r,n)),n},getPluralRules(e,t){const r=sn(e,t);let n=an.get(r);return n||(n=new Intl.PluralRules(e,t),an.set(r,n)),n}},cn=new Map;function ln(){const{messages:e,locale:r,formattingLocale:n}=t.useContext(en),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=cn.get(r);return n||(n=new Zr(e,t,void 0,{formatters:on}),cn.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 dn(e){if("undefined"==typeof window)return null;try{return localStorage.getItem(e)}catch(t){return Te(t,{component:"storage",action:"getStorageItem",metadata:{key:e}}),null}}function un(e,t){if("undefined"!=typeof window)try{localStorage.setItem(e,t)}catch(t){Te(t,{component:"storage",action:"setStorageItem",metadata:{key:e}})}}function pn(e){if("undefined"!=typeof window)try{localStorage.removeItem(e)}catch(t){Te(t,{component:"storage",action:"removeStorageItem",metadata:{key:e}})}}const mn="saas-session-id",hn="code";function fn(e){un(mn,e)}function gn(){return function(){if("undefined"==typeof window)return null;try{return dn(mn)}catch(e){return Te(e,{component:"auth-utils",action:"getSessionId",metadata:{key:mn}}),null}}()}function bn(){if("undefined"==typeof window)return null;try{return new URLSearchParams(window.location.search).get(hn)}catch(e){return Te(e,{component:"auth-utils",action:"getTokenFromUrl",metadata:{param:hn}}),null}}const vn="SDK is not ready (missing serverUrl, version, or orgId)";class yn{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._onUnauthorized=e.onUnauthorized,this._fetch=e.fetch??globalThis.fetch}ensureReady(){if(!this.serverUrl?.trim()||!this.version)throw new Error(vn);if(this.requireOrgId&&!this.orgId?.trim())throw new Error(vn)}get baseUrl(){return this.ensureReady(),`${this.serverUrl}/api/${this.version}/${this.basePath}`}getAuthHeaders(){return this._sessionId?{"x-session-id":this._sessionId}:function(){const e=gn(),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}`),401===a.status&&this._onUnauthorized&&this._onUnauthorized(),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 je(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)}async throwResponseError(e,t){let r=t;try{r=(await e.json()).message||r}catch{r=`${t} (${e.status}: ${e.statusText})`}throw new Error(r)}async unwrapResponse(e,t){const r=await e.json();if(void 0!==r.success){if(!r.success)throw new Error(r.message||t);return r.data||r}return r}}class xn extends yn{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 updateSettings(e){return this.fetchJson("workspaces/settings",{method:"PATCH",body:JSON.stringify(e)},"Failed to update workspace settings")}async updateWorkspacePermissions(e,t){return this.fetchJson(`workspaces/${e}/permissions`,{method:"PATCH",body:JSON.stringify({permissions:t})},"Failed to update workspace permissions")}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`);return t.ok||await this.throwResponseError(t,"Failed to fetch subscription"),this.unwrapResponse(t,"Failed to fetch subscription")}async getPlanGroup(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group`);return t.ok||await this.throwResponseError(t,"Failed to fetch plan group"),this.unwrapResponse(t,"Failed to fetch plan group")}async getPlanGroupByVersion(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/plan-group?groupVersionId=${encodeURIComponent(t)}`);return r.ok||await this.throwResponseError(r,"Failed to fetch plan group version"),this.unwrapResponse(r,"Failed to fetch plan group version")}async getPlanGroupVersions(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/plan-group/versions`);return t.ok||await this.throwResponseError(t,"Failed to fetch plan group versions"),this.unwrapResponse(t,"Failed to fetch plan group versions")}async getPublicPlans(e){if(!this.orgId)throw new Error("orgId is required for getPublicPlans");const t=await this.fetchResponse(`${this.orgId}/plans/${encodeURIComponent(e)}`);return t.ok||await this.throwResponseError(t,"Failed to fetch plans"),this.unwrapResponse(t,"Failed to fetch plans")}async getPublicCreditPackages(){if(!this.orgId)throw new Error("orgId is required for getPublicCreditPackages");const e=await this.fetchResponse(`${this.orgId}/credit-packages`);return e.ok||await this.throwResponseError(e,"Failed to fetch credit packages"),this.unwrapResponse(e,"Failed to fetch credit packages")}async getPlanGroupVersion(e){const t=await this.fetchResponse(`plan-group-versions/${e}`);return t.ok||await this.throwResponseError(t,"Failed to fetch plan group version"),this.unwrapResponse(t,"Failed to fetch plan group version")}async createCheckoutSession(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/checkout`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to create checkout session"),this.unwrapResponse(r,"Failed to create checkout session")}async selectFreePlan(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/select-free-plan`,{method:"POST",body:JSON.stringify({planVersionId:t})});return r.ok||await this.throwResponseError(r,"Failed to select free plan"),r.json()}async updateSubscription(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription`,{method:"PATCH",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to update subscription"),this.unwrapResponse(r,"Failed to update subscription")}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()}`);return a.ok||await this.throwResponseError(a,"Failed to fetch invoices"),this.unwrapResponse(a,"Failed to fetch invoices")}async getInvoice(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/invoices/${t}`);return r.ok||await this.throwResponseError(r,"Failed to fetch invoice"),this.unwrapResponse(r,"Failed to fetch invoice")}async cancelSubscriptionAtPeriodEnd(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/cancel-at-period-end`,{method:"POST"});return t.ok||await this.throwResponseError(t,"Failed to cancel subscription"),this.unwrapResponse(t,"Failed to cancel subscription")}async resumeSubscription(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/resume`,{method:"POST"});return t.ok||await this.throwResponseError(t,"Failed to resume subscription"),this.unwrapResponse(t,"Failed to resume subscription")}async recordUsage(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to record usage"),this.unwrapResponse(r,"Failed to record usage")}async recordUsageBatch(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/batch`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to record batch usage"),this.unwrapResponse(r,"Failed to record batch usage")}async getQuotaUsageStatus(e,t){const r=await this.fetchResponse(`workspaces/${e}/subscription/usage/status?quotaSlug=${encodeURIComponent(t)}`);return r.ok||await this.throwResponseError(r,"Failed to fetch quota usage status"),this.unwrapResponse(r,"Failed to fetch quota usage status")}async getAllQuotaUsage(e){const t=await this.fetchResponse(`workspaces/${e}/subscription/usage/all`);return t.ok||await this.throwResponseError(t,"Failed to fetch all quota usage"),this.unwrapResponse(t,"Failed to fetch all quota usage")}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);return s.ok||await this.throwResponseError(s,"Failed to fetch usage logs"),this.unwrapResponse(s,"Failed to fetch usage logs")}async sendNotification(e,t,r,n){const a={event:t};return r&&(a.userId=r),n&&(a.data=n),this.fetchJson(`workspaces/${e}/notifications/send`,{method:"POST",body:JSON.stringify(a)},"Failed to send notification")}async getNotificationEvents(e){return this.fetchJson(`workspaces/${e}/notification-events`,{},"Failed to fetch notification events")}async getNotificationPreferences(e){return(await this.fetchJson(`workspaces/${e}/notification-preferences`,{},"Failed to fetch notification preferences")).notificationPreferences??{}}async updateNotificationPreferences(e,t){return(await this.fetchJson(`workspaces/${e}/notification-preferences`,{method:"PATCH",body:JSON.stringify({notificationPreferences:t})},"Failed to update notification preferences")).notificationPreferences??{}}async getCreditBalance(e){const t=await this.fetchResponse(`workspaces/${e}/credits`);return t.ok||await this.throwResponseError(t,"Failed to fetch credit balance"),this.unwrapResponse(t,"Failed to fetch credit balance")}async consumeCredits(e,t){const r=await this.fetchResponse(`workspaces/${e}/credits/consume`,{method:"POST",body:JSON.stringify(t)});if(!r.ok){if(402===r.status){const e=await r.json().catch(()=>({})),t=new Error(e.message||"Insufficient credits");throw t.available=e.available,t.requested=e.requested,t.code="INSUFFICIENT_CREDITS",t}await this.throwResponseError(r,"Failed to consume credits")}return this.unwrapResponse(r,"Failed to consume credits")}async purchaseCredits(e,t){const r=await this.fetchResponse(`workspaces/${e}/credits/purchase`,{method:"POST",body:JSON.stringify(t)});return r.ok||await this.throwResponseError(r,"Failed to create credit purchase checkout"),this.unwrapResponse(r,"Failed to create credit purchase checkout")}async getCreditPackages(e){const t=await this.fetchResponse(`workspaces/${e}/credits/packages`);t.ok||await this.throwResponseError(t,"Failed to fetch credit packages");const r=await this.unwrapResponse(t,"Failed to fetch credit packages");return r.docs??r}async getCreditTransactions(e,t){const r=new URLSearchParams;t?.type&&r.append("type",t.type),t?.page&&r.append("page",t.page.toString()),t?.limit&&r.append("limit",t.limit.toString());const n=r.toString(),a=`workspaces/${e}/credits/transactions${n?`?${n}`:""}`,s=await this.fetchResponse(a);return s.ok||await this.throwResponseError(s,"Failed to fetch credit transactions"),this.unwrapResponse(s,"Failed to fetch credit transactions")}async getCreditBuckets(e,t){const r=new URLSearchParams;t?.status&&r.append("status",t.status),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}/credits/buckets${n?`?${n}`:""}`,s=await this.fetchResponse(a);return s.ok||await this.throwResponseError(s,"Failed to fetch credit buckets"),this.unwrapResponse(s,"Failed to fetch credit buckets")}async getExpiringCredits(e,t){const r=t?`?days=${t}`:"",n=await this.fetchResponse(`workspaces/${e}/credits/expiring${r}`);return n.ok||await this.throwResponseError(n,"Failed to fetch expiring credits"),this.unwrapResponse(n,"Failed to fetch expiring credits")}}function wn(){const e=Xe(),r=lt(),n=At();return t.useMemo(()=>({auth:e,os:r,workspaces:n}),[e,r,n])}function Sn(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)}function kn(e,r,n){t.useEffect(()=>{const t=new AbortController;return e(t.signal).catch(e=>{Ne(e)||(n?.onError?n.onError(e):Te(e,{component:"useAsyncEffect",action:"effect",metadata:{note:"Unhandled rejection - consider passing onError"}}))}),()=>t.abort()},r)}class Cn extends yn{constructor(e){super({...e,requireOrgId:!0})}async getSettings(e){return this.fetchJson(`${this.orgId}/settings`,{signal:e},"Failed to fetch settings")}}function En(){return Sn(e=>e.os)}let Nn=null;function An(){const e=wn(),r=En(),{serverUrl:n,version:a,orgId:s,settings:i}=r,o=t.useMemo(()=>rt(r)?new Cn({serverUrl:n,version:a,orgId:s}):null,[n,a,s]),c=t.useCallback(async t=>o?Nn||(Nn=(async()=>{try{const r=await o.getSettings(t);return e.os(et(r)),r}catch(e){return Re(e,{component:"useSaaSSettings",action:"getSettings",metadata:{serverUrl:n,version:a,orgId:s}}),null}finally{Nn=null}})(),Nn):null,[o,e,n,a,s]);return kn(async e=>{i||rt(r)&&await c(e)},[n,a,s],{onError:e=>Re(e,{component:"useSaaSSettings",action:"fetchSettings",metadata:{serverUrl:n,version:a,orgId:s}})}),t.useMemo(()=>({settings:i,getSettings:c}),[i,c])}function jn(){const e=En(),r=t.useCallback(()=>{e.auth?.callbacks?.onSessionExpired?.("expired")},[e.auth?.callbacks?.onSessionExpired]),n=function(e,r){return t.useMemo(()=>new xn({...e,onUnauthorized:r}),[e.serverUrl,e.version,e.orgId,r])}(e,r);return t.useMemo(()=>({os:e,api:n}),[e,n])}const _n=e=>{const{t:r}=ln(),{os:n,api:a}=jn(),s=rt(n),[i,o]=t.useState(null),[c,l]=t.useState(!1),[d,u]=t.useState(null),p=t.useCallback(async()=>{if(e&&s){l(!0),u(null);try{const t=await a.getPublicPlans(e);o(t)}catch(t){const n=De(t,"errors.fetchPlans",r);u(n),Te(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:d,refetch:p}},Pn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCurrentSubscription(e);s(t)}catch(t){const n=De(t,"errors.fetchSubscription",r);l(n),Te(t,{component:"useSubscription",action:"fetchSubscription",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{subscription:a,loading:i,error:c,refetch:d}},Tn=(e,r)=>{const{t:n}=ln(),{api:a}=jn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e){c(!0),d(null);try{const t=r?await a.getPlanGroupByVersion(e,r):await a.getPlanGroup(e);i(t)}catch(t){const a=De(t,"errors.fetchPlanGroup",n);d(a),Te(t,{component:"usePlanGroup",action:"fetchPlanGroup",metadata:{workspaceId:e,groupVersionId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{planGroup:s,loading:o,error:l,refetch:u}},Rn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersions(e);s(t)}catch(t){const n=De(t,"errors.fetchPlanGroupVersions",r);l(n),Te(t,{component:"usePlanGroupVersions",action:"fetchVersions",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{versions:a,loading:i,error:c,refetch:d}},Dn=e=>{const{t:r}=ln(),{api:n}=jn(),{getCheckoutStripeParams:a}=t.useContext(_t),[s,i]=t.useState(!1),[o,c]=t.useState(null);return{createCheckoutSession:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");i(!0),c(null);try{let r=t;if(a){const e=await a(t);e&&(r={...t,stripeOptions:{...t.stripeOptions,...e,metadata:{...t.stripeOptions?.metadata,...e.metadata},subscriptionMetadata:{...t.stripeOptions?.subscriptionMetadata,...e.subscriptionMetadata}}})}const s=await n.createCheckoutSession(e,r);return"trial_started"===s.type&&(Lt(),It()),s}catch(n){const a=De(n,"errors.createCheckout",r);throw c(a),Te(n,{component:"useCreateCheckoutSession",action:"createCheckoutSession",metadata:{workspaceId:e,request:t}}),n}finally{i(!1)}},[n,e,a]),loading:s,error:o}},In=e=>{const{t:r}=ln(),{api:n}=jn(),[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 Lt(),s}catch(n){const s=De(n,"errors.updateSubscription",r);throw o(s),Te(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}},Mn=(e,r)=>{const n=Pn(e),a=Tn(e,r),s=In(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}},Un=(e,r=10,n)=>{const{t:a}=ln(),{api:s}=jn(),[i,o]=t.useState([]),[c,l]=t.useState(!1),[d,u]=t.useState(!1),[p,m]=t.useState(null),h=t.useCallback(async()=>{if(!e)return o([]),void l(!1);u(!0),m(null);try{const t=await s.listInvoices(e,r,n);o(t.invoices||[]),l(t.has_more||!1)}catch(t){const s=De(t,"errors.fetchInvoices",a);m(s),Te(t,{component:"useInvoices",action:"fetchInvoices",metadata:{workspaceId:e,limit:r,startingAfter:n}})}finally{u(!1)}},[s,e,r,n]);return t.useEffect(()=>{h()},[h]),{invoices:i,hasMore:c,loading:d,error:p,refetch:h}},Ln=e=>{const{t:r}=ln(),{api:n}=jn(),[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=De(t,"errors.openBillingPortal",r);throw o(n),Te(t,{component:"useBillingPortal",action:"openBillingPortal",metadata:{workspaceId:e}}),t}finally{s(!1)}},[e,n]),loading:a,error:i}},On=e=>{const{t:r}=ln(),{api:n}=jn(),[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 Lt(),t}catch(t){const n=De(t,"errors.cancelSubscription",r);throw o(n),Te(t,{component:"useCancelSubscription",action:"cancelSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},zn=e=>{const{t:r}=ln(),{api:n}=jn(),[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 Lt(),t}catch(t){const n=De(t,"errors.resumeSubscription",r);throw o(n),Te(t,{component:"useResumeSubscription",action:"resumeSubscription",metadata:{workspaceId:e}}),t}finally{s(!1)}},[n,e]),loading:a,error:i}},Fn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getAllQuotaUsage(e);s(t.quotas)}catch(t){const n=De(t,"errors.fetchAllQuotaUsage",r);l(n),Te(t,{component:"useAllQuotaUsage",action:"fetchAllUsage",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{quotas:a,loading:i,error:c,refetch:d}},Bn=t.createContext(null);Bn.displayName="SubscriptionContext";const Wn=t.memo(function({children:r}){const n=Sn(e=>e.workspaces.currentWorkspace),{subscription:a,loading:s,error:i,refetch:o}=Pn(n?._id);t.useEffect(()=>Ut(o),[o]);const c=t.useMemo(()=>({response:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(Bn.Provider,{value:c,children:r})});function Vn(){const e=t.useContext(Bn);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}Wn.displayName="SubscriptionContextProvider";const Gn=Tt(),Hn=Gn.subscribe,$n=Gn.invalidate,Kn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCreditBalance(e);s(t)}catch(t){const n=De(t,"errors.fetchCreditBalance",r);l(n),Te(t,{component:"useCreditBalance",action:"fetchBalance",metadata:{workspaceId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{balance:a,loading:i,error:c,refetch:d}},qn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{consumeCredits:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{const r=await n.consumeCredits(e,t);return $n(),r}catch(n){const a="INSUFFICIENT_CREDITS"===n.code?`Insufficient credits. Available: ${n.available}, requested: ${n.requested}`:De(n,"errors.consumeCredits",r);throw o(a),Te(n,{component:"useConsumeCredits",action:"consumeCredits",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},Zn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(!1),[i,o]=t.useState(null);return{purchaseCredits:t.useCallback(async t=>{if(!e)throw new Error("Workspace ID is required");s(!0),o(null);try{return await n.purchaseCredits(e,t)}catch(n){const a=De(n,"errors.purchaseCredits",r);throw o(a),Te(n,{component:"usePurchaseCredits",action:"purchaseCredits",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},Jn=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState([]),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getCreditPackages(e);s(t)}catch(t){const n=De(t,"errors.fetchCreditPackages",r);l(n),Te(t,{component:"useCreditPackages",action:"fetchPackages",metadata:{workspaceId:e}})}finally{o(!1)}}else s([])},[n,e]);return t.useEffect(()=>{d()},[d]),{packages:a,loading:i,error:c,refetch:d}},Yn=(e,r)=>{const{t:n}=ln(),{api:a}=jn(),[s,i]=t.useState([]),[o,c]=t.useState(0),[l,d]=t.useState(0),[u,p]=t.useState(1),[m,h]=t.useState(!1),[f,g]=t.useState(!1),[b,v]=t.useState(!1),[y,x]=t.useState(null),w=r?.type,S=r?.page,k=r?.limit,C=t.useCallback(async()=>{if(!e)return i([]),c(0),d(0),p(1),h(!1),void g(!1);v(!0),x(null);try{const t=await a.getCreditTransactions(e,{type:w,page:S,limit:k});i(t.docs||[]),c(t.totalDocs||0),d(t.totalPages||0),p(t.page||1),h(t.hasNextPage||!1),g(t.hasPrevPage||!1)}catch(t){const r=De(t,"errors.fetchCreditTransactions",n);x(r),Te(t,{component:"useCreditTransactions",action:"fetchTransactions",metadata:{workspaceId:e}})}finally{v(!1)}},[a,e,w,S,k]);return t.useEffect(()=>{C()},[C]),{transactions:s,totalDocs:o,totalPages:l,page:u,hasNextPage:m,hasPrevPage:f,loading:b,error:y,refetch:C}},Xn=(e,r)=>{const{t:n}=ln(),{api:a}=jn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e){c(!0),d(null);try{const t=await a.getExpiringCredits(e,r);i(t)}catch(t){const a=De(t,"errors.fetchExpiringCredits",n);d(a),Te(t,{component:"useExpiringCredits",action:"fetchExpiring",metadata:{workspaceId:e,days:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{expiringCredits:s?.expiringCredits??0,buckets:s?.buckets??[],days:s?.days??r??7,loading:o,error:l,refetch:u}},Qn=()=>{const{t:e}=ln(),{os:r,api:n}=jn(),a=rt(r),[s,i]=t.useState([]),[o,c]=t.useState(),[l,d]=t.useState(!1),[u,p]=t.useState(null),m=t.useCallback(async()=>{if(a){d(!0),p(null);try{const e=await n.getPublicCreditPackages();i(e.packages||[]),c(e.notes)}catch(t){const r=De(t,"errors.fetchCreditPackages",e);p(r),Te(t,{component:"usePublicCreditPackages",action:"fetchPackages"})}finally{d(!1)}}else i([])},[n,a]);t.useEffect(()=>{m()},[m]);return{packages:s,notes:o,loading:!a||l,error:u,refetch:m}},ea=t.createContext(null);ea.displayName="CreditBalanceContext";const ta=t.memo(function({children:r}){const n=Sn(e=>e.workspaces.currentWorkspace),{balance:a,loading:s,error:i,refetch:o}=Kn(n?._id);t.useEffect(()=>Hn(o),[o]);const c=t.useMemo(()=>({balance:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(ea.Provider,{value:c,children:r})});function ra(){const e=t.useContext(ea);if(null===e)throw new Error("useCreditBalanceContext must be used within CreditBalanceContextProvider. Make sure CreditBalanceContextProvider is wrapping your application (included in SaaSOSProvider by default).");return e}ta.displayName="CreditBalanceContextProvider";const na=t.createContext({appPermissions:void 0});function aa({appPermissions:r,children:n}){const a=t.useMemo(()=>({appPermissions:r}),[r]);return e.jsx(na.Provider,{value:a,children:n})}function sa(){return t.useContext(na)}const ia=t.createContext(null);ia.displayName="QuotaUsageContext";const oa=t.memo(function({children:r}){const n=Sn(e=>e.workspaces.currentWorkspace),{quotas:a,loading:s,error:i,refetch:o}=Fn(n?._id);t.useEffect(()=>Dt(o),[o]);const c=t.useMemo(()=>({quotas:a,loading:s,error:i,refetch:o}),[a,s,i,o]);return e.jsx(ia.Provider,{value:c,children:r})});function ca(){const e=t.useContext(ia);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}oa.displayName="QuotaUsageContextProvider";const la=({message:t})=>e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"bb-fs-loader-spinner",style:{width:40,height:40,border:"3px solid #e5e7eb",borderTopColor:"#6b7280",borderRadius:"50%",animation:"bb-fs-loader-spin 0.6s linear infinite"}}),e.jsx("p",{"aria-hidden":"true",style:{marginTop:16,color:"#6b7280",fontSize:14},children:t}),e.jsx("style",{children:"\n @keyframes bb-fs-loader-spin { to { transform: rotate(360deg) } }\n @media (prefers-reduced-motion: reduce) {\n .bb-fs-loader-spinner { animation: none !important; }\n }\n @media (prefers-color-scheme: dark) {\n .bb-fs-loader-spinner {\n border-color: #374151 !important;\n border-top-color: #9ca3af !important;\n }\n }\n "})]}),da=({children:t,message:r="Loading...",backgroundColor:n})=>e.jsxs("div",{role:"status","aria-live":"polite","aria-busy":"true",className:"bb-fs-loader",style:{position:"fixed",inset:0,zIndex:2147483647,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",backgroundColor:n??void 0},children:[e.jsx("span",{style:{position:"absolute",width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0,0,0,0)",whiteSpace:"nowrap",border:0},children:r}),t??e.jsx(la,{message:r}),e.jsx("style",{children:"\n .bb-fs-loader {\n background-color: #fff;\n }\n @media (prefers-color-scheme: dark) {\n .bb-fs-loader {\n background-color: #0a0a0a;\n }\n .bb-fs-loader p {\n color: #9ca3af !important;\n }\n }\n "})]});da.displayName="FullScreenLoader";const ua=t.createContext(null),pa=({children:r,loadingComponent:n})=>{const[a,s]=t.useState({visible:!1,message:""}),i=t.useRef(null),o=t.useCallback(()=>{i.current&&(clearTimeout(i.current),i.current=null)},[]),c=t.useCallback(()=>{o(),s({visible:!1,message:""})},[o]),l=t.useCallback(e=>{o(),s({visible:!0,message:e}),i.current=setTimeout(()=>{Te(new Error("FullScreenLoader timed out — auto-hiding after 60s"),{component:"FullScreenLoaderProvider",action:"timeout"}),s({visible:!1,message:""})},6e4)},[o]);t.useEffect(()=>()=>o(),[o]);const d=t.useMemo(()=>({show:l,hide:c,visible:a.visible,message:a.message}),[l,c,a.visible,a.message]),u="function"==typeof n?n({message:a.message}):n;return e.jsxs(ua.Provider,{value:d,children:[r,a.visible&&e.jsx(da,{message:a.message,children:u})]})};function ma(){const e=t.useContext(ua);if(!e)throw new Error("useFullScreenLoader must be used within FullScreenLoaderProvider");return e}function ha(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}}function fa(e,t="/"){const r=ha(e);window.location.href=r||t}pa.displayName="FullScreenLoaderProvider";const ga="saas-auth-intent";function ba(e){return"object"==typeof e&&null!==e&&"string"==typeof e.returnUrl&&"number"==typeof e.createdAt}function va(e){ha(e)&&function(e,t){try{un(e,JSON.stringify(t))}catch(t){Te(t,{component:"storage",action:"setStorageJSON",metadata:{key:e}})}}(ga,{returnUrl:e,createdAt:Date.now()})}function ya(){const e=function(e,t){const r=dn(e);if(!r)return null;try{const n=JSON.parse(r);return t&&!t(n)?(Te(new Error("Storage data failed validation"),{component:"storage",action:"getStorageJSON",metadata:{key:e}}),pn(e),null):n}catch(t){return Te(t,{component:"storage",action:"getStorageJSON",metadata:{key:e}}),pn(e),null}}(ga,ba);return pn(ga),e?Date.now()-e.createdAt>6e5?null:ha(e.returnUrl):null}class xa extends yn{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)});return r.ok||await this.throwResponseError(r,"Failed to initiate authentication"),r.json()}async getProfile(e,t){return this.fetchJson("profile",{headers:{"x-session-id":e},signal:t},"Failed to fetch user profile")}}const wa="bb",Sa="checkout",ka="billing",Ca="selectPlan",Ea="creditPurchase",Na="openCreditStore",Aa="success",ja="cancel",_a="error",Pa="subscription",Ta="credits";function Ra(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(wa,function(e){return Object.entries(e).filter(([,e])=>null!=e&&""!==e).map(([e,t])=>`${encodeURIComponent(e)}:${encodeURIComponent(t)}`).join(",")}(e)),r.toString()}function Da(e,t){const r="undefined"!=typeof window?window.location.href:void 0;return{successUrl:Ra({action:Ea,status:Aa,ws:e,screen:Ta},r),cancelUrl:Ra({action:Ea,status:ja,ws:e,screen:Ta},r)}}function Ia(){if("undefined"==typeof window)return null;try{const e=new URLSearchParams(window.location.search).get(wa);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 Ma(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.has(wa)&&(e.searchParams.delete(wa),window.history.replaceState({},"",e.toString()))}catch{}}const Ua={Monthly:"monthly",Yearly:"yearly",Quarterly:"quarterly"},La="active",Oa="trialing",za="canceled",Fa="past_due",Ba="paused",Wa="draft",Va="open",Ga="paid",Ha="uncollectible",$a="void",Ka="feature",qa="limit",Za="quota",Ja="none",Ya="final",Xa="suspended",Qa="plan_grant",es="pack_purchased",ts="consumed",rs="expired",ns="admin_grant",as="admin_revoke",ss="refund";function is(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 os(e,t,r){const n=is(e,t);if(!n?.basePricing)return null;const a=n.basePricing[r];return null!=a?a:null}function cs(e,t,r,n){const a=is(e,t),s=a?.quotaOverages?.[r];if(s)return s[n]}function ls(e,t,r,n){const a=e.quotas?.[r];if(null==a)return null;const s=a[n];if(!s)return null;const i=cs(e,t,r,n);return{included:s.included,...void 0!==s.unitSize&&{unitSize:s.unitSize},...void 0!==i&&{overage:i},allowOverage:!1!==a.allowOverage}}function ds(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 us(e,t){const r=is(e,t);return r?.seatPricing?.enabled?r.seatPricing:null}function ps(e,t,r){const n=us(e,t);return n?.perSeat?n.perSeat[r]??null:null}function ms(e){const{planVersion:t,currency:r="usd",settingsMaxUsers:n}=e;if(t){const e=us(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 hs(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 fs="user:created",gs="user:updated",bs="workspace:changed",vs="workspace:updated",ys="workspace:user-added",xs="workspace:user-removed",ws="workspace:user-role-changed",Ss="workspace:created",ks="workspace:deleted";const Cs=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){Te(t,{component:"EventEmitter",action:"emit",metadata:{eventType:e}})}}async emitUserCreated(e){await this.emit(fs,{user:e})}async emitUserUpdated(e,t){await this.emit(gs,{user:e,previousUser:t})}async emitWorkspaceChanged(e,t){await this.emit(bs,{workspace:e,previousWorkspace:t})}async emitWorkspaceUpdated(e){await this.emit(vs,{workspace:e})}async emitWorkspaceUserAdded(e,t,r){await this.emit(ys,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRemoved(e,t,r){await this.emit(xs,{userId:e,workspace:t,role:r})}async emitWorkspaceUserRoleChanged(e,t,r,n){await this.emit(ws,{userId:e,workspace:t,previousRole:r,newRole:n})}async emitWorkspaceCreated(e){await this.emit(Ss,{workspace:e})}async emitWorkspaceDeleted(e){await this.emit(ks,{workspace:e})}},Es=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ns=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)},As=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),js=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
3
3
  /**
4
4
  * @license lucide-react v0.544.0 - ISC
5
5
  *
@@ -12,19 +12,19 @@
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
14
  */
15
- var Cs={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"};
15
+ var _s={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
16
  /**
17
17
  * @license lucide-react v0.544.0 - ISC
18
18
  *
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
- */const Es=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,...Cs,width:r,height:r,stroke:e,strokeWidth:a?24*Number(n)/Number(r):n,className:Ss("lucide",s),...!i&&!ks(c)&&{"aria-hidden":"true"},...c},[...o.map(([e,r])=>t.createElement(e,r)),...Array.isArray(i)?i:[i]])),Ns=(e,r)=>{const n=t.forwardRef(({className:n,...a},s)=>t.createElement(Es,{ref:s,iconNode:r,className:Ss(`lucide-${xs(ws(e))}`,`lucide-${e}`,n),...a}));return n.displayName=ws(e),n},As=Ns("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"}]]),js=Ns("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"}]]),_s=Ns("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"}]]),Ps=Ns("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"}]]),Ts=Ns("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"}]]),Rs=Ns("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),Ds=Ns("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),Is=Ns("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),Ms=Ns("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]),Us=Ns("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"}]]),Ls=Ns("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"}]]),Os=Ns("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"}]]),zs=Ns("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"}]]),Fs=Ns("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"}]]),Bs=Ns("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Ws=Ns("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),Vs=Ns("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Gs=Ns("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"}]]),Hs=Ns("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"}]]),$s=Ns("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Ks=Ns("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"}]]),qs=Ns("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"}]]),Zs=Ns("shield",[["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"}]]),Js=Ns("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),Ys=Ns("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),Xs=Ns("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"}]]),Qs=Ns("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),ei=Ns("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"}]]),ti=Ns("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"}]]),ri=Ns("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"}]]),ni=Ns("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"}]]),ai=Ns("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"}]]);
21
+ */const Ps=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,..._s,width:r,height:r,stroke:e,strokeWidth:a?24*Number(n)/Number(r):n,className:As("lucide",s),...!i&&!js(c)&&{"aria-hidden":"true"},...c},[...o.map(([e,r])=>t.createElement(e,r)),...Array.isArray(i)?i:[i]])),Ts=(e,r)=>{const n=t.forwardRef(({className:n,...a},s)=>t.createElement(Ps,{ref:s,iconNode:r,className:As(`lucide-${Es(Ns(e))}`,`lucide-${e}`,n),...a}));return n.displayName=Ns(e),n},Rs=Ts("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"}]]),Ds=Ts("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"}]]),Is=Ts("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"}]]),Ms=Ts("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"}]]),Us=Ts("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"}]]),Ls=Ts("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),Os=Ts("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),zs=Ts("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),Fs=Ts("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]),Bs=Ts("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"}]]),Ws=Ts("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"}]]),Vs=Ts("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"}]]),Gs=Ts("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"}]]),Hs=Ts("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"}]]),$s=Ts("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Ks=Ts("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]),qs=Ts("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Zs=Ts("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"}]]),Js=Ts("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"}]]),Ys=Ts("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Xs=Ts("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"}]]),Qs=Ts("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"}]]),ei=Ts("shield",[["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"}]]),ti=Ts("shopping-cart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),ri=Ts("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]),ni=Ts("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"}]]),ai=Ts("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),si=Ts("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"}]]),ii=Ts("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"}]]),oi=Ts("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"}]]),ci=Ts("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"}]]),li=Ts("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
22
  /**
23
23
  * @license lucide-react v0.544.0 - ISC
24
24
  *
25
25
  * This source code is licensed under the ISC license.
26
26
  * See the LICENSE file in the root directory of this source tree.
27
- */function si(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function ii(...e){return t=>{let r=!1;const n=e.map(e=>{const n=si(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():si(e[t],null)}}}}function oi(...e){return a.useCallback(ii(...e),e)}var ci=Symbol.for("react.lazy"),li=a[" use ".trim().toString()];function di(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===ci&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function ui(t){const r=mi(t),n=a.forwardRef((t,n)=>{let{children:s,...i}=t;di(s)&&"function"==typeof li&&(s=li(s._payload));const o=a.Children.toArray(s),c=o.find(fi);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 pi=ui("Slot");function mi(e){const t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(di(r)&&"function"==typeof li&&(r=li(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?ii(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 hi=Symbol("radix.slottable");function fi(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===hi}const gi=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,bi=o,vi=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return bi(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=gi(t)||gi(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 bi(e,i,c,null==r?void 0:r.class,null==r?void 0:r.className)},yi=vi("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"}}),xi=a.forwardRef(({className:t,variant:r,progress:n,size:s,startIcon:i,endIcon:o,asChild:c=!1,...l},d)=>{const u=c?pi:"button",p=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(s);return e.jsxs(u,{disabled:n||l.disabled,className:Se(yi({variant:r,size:s,withIcon:null!=n||null!=i||null!=o,className:t})),ref:d,...l,children:[n&&e.jsx(Bs,{size:p,className:"animate-spin"}),i&&a.cloneElement(i,{size:p}),l.children,o&&a.cloneElement(o,{size:p})]})});function wi(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function Si(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,d=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:d,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}\``)}]},ki(s,...r)]}function ki(...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}xi.displayName="Button";var Ci=globalThis?.document?a.useLayoutEffect:()=>{},Ei=a[" useId ".trim().toString()]||(()=>{}),Ni=0;function Ai(e){const[t,r]=a.useState(Ei());return Ci(()=>{r(e=>e??String(Ni++))},[e]),e||(t?`radix-${t}`:"")}var ji=a[" useInsertionEffect ".trim().toString()]||Ci;function _i({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 ji(()=>{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 d=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,d]}function Pi(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?ii(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 Ti=Symbol("radix.slottable");function Ri(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ti}var Di=["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=Pi(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Ri);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 Ii(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}var Mi,Ui="dismissableLayer.update",Li="dismissableLayer.pointerDownOutside",Oi="dismissableLayer.focusOutside",zi=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Fi=a.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...d}=t,u=a.useContext(zi),[p,m]=a.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=a.useState({}),g=oi(r,e=>m(e)),b=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(v),x=p?b.indexOf(p):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=x>=y,k=function(e,t=globalThis?.document){const r=Ii(e),n=a.useRef(!1),s=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Wi(Li,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=[...u.branches].some(e=>e.contains(t));S&&!r&&(i?.(e),c?.(e),e.defaultPrevented||l?.())},h),C=function(e,t=globalThis?.document){const r=Ii(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){Wi(Oi,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;[...u.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const r=Ii(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===u.layers.size-1&&(s?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),a.useEffect(()=>{if(p)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Mi=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),Bi(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Mi)}},[p,h,n,u]),a.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),Bi())},[p,u]),a.useEffect(()=>{const e=()=>f({});return document.addEventListener(Ui,e),()=>document.removeEventListener(Ui,e)},[]),e.jsx(Di.div,{...d,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:wi(t.onFocusCapture,C.onFocusCapture),onBlurCapture:wi(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:wi(t.onPointerDownCapture,k.onPointerDownCapture)})});Fi.displayName="DismissableLayer";function Bi(){const e=new CustomEvent(Ui);document.dispatchEvent(e)}function Wi(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(zi),s=a.useRef(null),i=oi(r,s);return a.useEffect(()=>{const e=s.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(Di.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var Vi="focusScope.autoFocusOnMount",Gi="focusScope.autoFocusOnUnmount",Hi={bubbles:!1,cancelable:!0},$i=a.forwardRef((t,r)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=t,[l,d]=a.useState(null),u=Ii(i),p=Ii(o),m=a.useRef(null),h=oi(r,e=>d(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:Ji(m.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Ji(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Ji(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){Yi.add(f);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(Vi,Hi);l.addEventListener(Vi,u),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ji(n,{select:t}),document.activeElement!==r)return}((e=Ki(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Ji(l))}return()=>{l.removeEventListener(Vi,u),setTimeout(()=>{const e=new CustomEvent(Gi,Hi);l.addEventListener(Gi,p),l.dispatchEvent(e),e.defaultPrevented||Ji(t??document.body,{select:!0}),l.removeEventListener(Gi,p),Yi.remove(f)},0)}}var e},[l,u,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=Ki(e),r=qi(t,e),n=qi(t.reverse(),e);return[r,n]}(t);a&&s?e.shiftKey||r!==s?e.shiftKey&&r===a&&(e.preventDefault(),n&&Ji(s,{select:!0})):(e.preventDefault(),n&&Ji(a,{select:!0})):r===t&&e.preventDefault()}},[n,s,f.paused]);return e.jsx(Di.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});function Ki(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 qi(e,t){for(const r of e)if(!Zi(r,{upTo:t}))return r}function Zi(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 Ji(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()}}$i.displayName="FocusScope";var Yi=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Xi(e,t),e.unshift(t)},remove(t){e=Xi(e,t),e[0]?.resume()}}}();function Xi(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Qi=a.forwardRef((t,n)=>{const{container:s,...i}=t,[o,c]=a.useState(!1);Ci(()=>c(!0),[]);const l=s||o&&globalThis?.document?.body;return l?r.createPortal(e.jsx(Di.div,{...i,ref:n}),l):null});Qi.displayName="Portal";var eo=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=to(n.current);i.current="mounted"===c?e:"none"},[c]),Ci(()=>{const t=n.current,r=s.current;if(r!==e){const n=i.current,a=to(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]),Ci(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const i=to(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=to(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=oi(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 to(e){return e?.animationName||"none"}eo.displayName="Presence";var ro=0;function no(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ao()),document.body.insertAdjacentElement("beforeend",e[1]??ao()),ro++,()=>{1===ro&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ro--}},[])}function ao(){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 so=function(){return so=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},so.apply(this,arguments)};function io(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 oo="right-scroll-bar-position",co="width-before-scroll-bar";function lo(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var uo="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,po=new WeakMap;function mo(e,r){var n,a,s,i=(n=null,a=function(t){return e.forEach(function(e){return lo(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 uo(function(){var t=po.get(i);if(t){var r=new Set(t),n=new Set(e),a=i.current;r.forEach(function(e){n.has(e)||lo(e,null)}),n.forEach(function(e){r.has(e)||lo(e,a)})}po.set(i,e)},[e]),i}function ho(e){return e}var fo=function(e){var t=e.sideCar,r=io(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,so({},r))};fo.isSideCarExport=!0;var go=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=ho);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=so({async:!0,ssr:!1},e),t}(),bo=function(){},vo=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:bo,onWheelCapture:bo,onTouchMoveCapture:bo}),s=n[0],i=n[1],o=e.forwardProps,c=e.children,l=e.className,d=e.removeScrollBar,u=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=io(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=mo([r,t]),C=so(so({},w),s);return a.createElement(a.Fragment,null,u&&a.createElement(S,{sideCar:go,removeScrollBar:d,shards:p,noRelative:h,noIsolation:f,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:x}),o?a.cloneElement(a.Children.only(c),so(so({},C),{ref:k})):a.createElement(y,so({},C,{className:l,ref:k}),c))});vo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},vo.classNames={fullWidth:co,zeroRight:oo};function yo(){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 xo=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=yo())&&(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)}}},wo=function(){var e,t=(e=xo(),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}},So={left:0,top:0,right:0,gap:0},ko=function(e){return parseInt(e||"",10)||0},Co=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return So;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[ko(r),ko(n),ko(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])}},Eo=wo(),No="data-scroll-locked",Ao=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(No,"] {\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(oo," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(co," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(oo," .").concat(oo," {\n right: 0 ").concat(n,";\n }\n \n .").concat(co," .").concat(co," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(No,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},jo=function(){var e=parseInt(document.body.getAttribute(No)||"0",10);return isFinite(e)?e:0},_o=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(No,(jo()+1).toString()),function(){var e=jo()-1;e<=0?document.body.removeAttribute(No):document.body.setAttribute(No,e.toString())}},[]);var i=a.useMemo(function(){return Co(s)},[s]);return a.createElement(Eo,{styles:Ao(i,!t,s,r?"":"!important")})},Po=!1;if("undefined"!=typeof window)try{var To=Object.defineProperty({},"passive",{get:function(){return Po=!0,!0}});window.addEventListener("test",To,To),window.removeEventListener("test",To,To)}catch(e){Po=!1}var Ro=!!Po&&{passive:!1},Do=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])},Io=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Mo(e,n)){var a=Uo(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Mo=function(e,t){return"v"===e?function(e){return Do(e,"overflowY")}(t):function(e){return Do(e,"overflowX")}(t)},Uo=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)},Lo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Oo=function(e){return[e.deltaX,e.deltaY]},zo=function(e){return e&&"current"in e?e.current:e},Fo=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Bo=0,Wo=[];function Vo(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Go,Ho=(Go=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),s=a.useState(Bo++)[0],i=a.useState(wo)[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(zo),!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=Lo(e),i=r.current,c="deltaX"in e?e.deltaX:i[0]-s[0],l="deltaY"in e?e.deltaY:i[1]-s[1],d=e.target,u=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var p=window.getSelection(),m=p&&p.anchorNode;if(m&&(m===d||m.contains(d)))return!1;var h=Io(u,d);if(!h)return!0;if(h?a=u:(a="v"===u?"h":"v",h=Io(u,d)),!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,d=0,u=0;do{if(!i)break;var p=Uo(e,i),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Mo(e,i)&&(d+=h,u+=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(d)<1||!l&&Math.abs(u)<1)&&(c=!0),c}(f,t,e,"h"===f?c:l)},[]),l=a.useCallback(function(e){var r=e;if(Wo.length&&Wo[Wo.length-1]===i){var n="deltaY"in r?Oo(r):Lo(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(zo).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?c(r,s[0]):!o.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),d=a.useCallback(function(e,r,n,a){var s={name:e,delta:r,target:n,should:a,shadowParent:Vo(n)};t.current.push(s),setTimeout(function(){t.current=t.current.filter(function(e){return e!==s})},1)},[]),u=a.useCallback(function(e){r.current=Lo(e),n.current=void 0},[]),p=a.useCallback(function(t){d(t.type,Oo(t),t.target,c(t,e.lockRef.current))},[]),m=a.useCallback(function(t){d(t.type,Lo(t),t.target,c(t,e.lockRef.current))},[]);a.useEffect(function(){return Wo.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Ro),document.addEventListener("touchmove",l,Ro),document.addEventListener("touchstart",u,Ro),function(){Wo=Wo.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Ro),document.removeEventListener("touchmove",l,Ro),document.removeEventListener("touchstart",u,Ro)}},[]);var h=e.removeScrollBar,f=e.inert;return a.createElement(a.Fragment,null,f?a.createElement(i,{styles:Fo(s)}):null,h?a.createElement(_o,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},go.useMedium(Go),fo),$o=a.forwardRef(function(e,t){return a.createElement(vo,so({},e,{ref:t,sideCar:Ho}))});$o.classNames=vo.classNames;var Ko=new WeakMap,qo=new WeakMap,Zo={},Jo=0,Yo=function(e){return e&&(e.host||Yo(e.parentNode))},Xo=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Yo(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]);Zo[r]||(Zo[r]=new WeakMap);var s=Zo[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 d=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(o.has(e))d(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,c=(Ko.get(e)||0)+1,l=(s.get(e)||0)+1;Ko.set(e,c),s.set(e,l),i.push(e),1===c&&a&&qo.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 d(t),o.clear(),Jo++,function(){i.forEach(function(e){var t=Ko.get(e)-1,a=s.get(e)-1;Ko.set(e,t),s.set(e,a),t||(qo.has(e)||e.removeAttribute(n),qo.delete(e)),a||e.removeAttribute(r)}),--Jo||(Ko=new WeakMap,Ko=new WeakMap,qo=new WeakMap,Zo={})}},Qo=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"))),Xo(n,a,r,"aria-hidden")):function(){return null}};function ec(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?ii(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 tc=Symbol("radix.slottable");function rc(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tc}var nc="Dialog",[ac,sc]=Si(nc),[ic,oc]=ac(nc),cc=t=>{const{__scopeDialog:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!0}=t,l=a.useRef(null),d=a.useRef(null),[u,p]=_i({prop:s,defaultProp:i??!1,onChange:o,caller:nc});return e.jsx(ic,{scope:r,triggerRef:l,contentRef:d,contentId:Ai(),titleId:Ai(),descriptionId:Ai(),open:u,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:c,children:n})};cc.displayName=nc;var lc="DialogTrigger",dc=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=oc(lc,n),i=oi(r,s.triggerRef);return e.jsx(Di.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Pc(s.open),...a,ref:i,onClick:wi(t.onClick,s.onOpenToggle)})});dc.displayName=lc;var uc="DialogPortal",[pc,mc]=ac(uc,{forceMount:void 0}),hc=t=>{const{__scopeDialog:r,forceMount:n,children:s,container:i}=t,o=oc(uc,r);return e.jsx(pc,{scope:r,forceMount:n,children:a.Children.map(s,t=>e.jsx(eo,{present:n||o.open,children:e.jsx(Qi,{asChild:!0,container:i,children:t})}))})};hc.displayName=uc;var fc="DialogOverlay",gc=a.forwardRef((t,r)=>{const n=mc(fc,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=oc(fc,t.__scopeDialog);return i.modal?e.jsx(eo,{present:a||i.open,children:e.jsx(vc,{...s,ref:r})}):null});gc.displayName=fc;var bc=function(t){const r=ec(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(rc);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"),vc=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=oc(fc,n);return e.jsx($o,{as:bc,allowPinchZoom:!0,shards:[s.contentRef],children:e.jsx(Di.div,{"data-state":Pc(s.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),yc="DialogContent",xc=a.forwardRef((t,r)=>{const n=mc(yc,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=oc(yc,t.__scopeDialog);return e.jsx(eo,{present:a||i.open,children:i.modal?e.jsx(wc,{...s,ref:r}):e.jsx(Sc,{...s,ref:r})})});xc.displayName=yc;var wc=a.forwardRef((t,r)=>{const n=oc(yc,t.__scopeDialog),s=a.useRef(null),i=oi(r,n.contentRef,s);return a.useEffect(()=>{const e=s.current;if(e)return Qo(e)},[]),e.jsx(kc,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:wi(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:wi(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:wi(t.onFocusOutside,e=>e.preventDefault())})}),Sc=a.forwardRef((t,r)=>{const n=oc(yc,t.__scopeDialog),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(kc,{...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()}})}),kc=a.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=t,l=oc(yc,n),d=a.useRef(null),u=oi(r,d);return no(),e.jsxs(e.Fragment,{children:[e.jsx($i,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:e.jsx(Fi,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Pc(l.open),...c,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(Ic,{titleId:l.titleId}),e.jsx(Mc,{contentRef:d,descriptionId:l.descriptionId})]})]})}),Cc="DialogTitle",Ec=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=oc(Cc,n);return e.jsx(Di.h2,{id:s.titleId,...a,ref:r})});Ec.displayName=Cc;var Nc="DialogDescription",Ac=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=oc(Nc,n);return e.jsx(Di.p,{id:s.descriptionId,...a,ref:r})});Ac.displayName=Nc;var jc="DialogClose",_c=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=oc(jc,n);return e.jsx(Di.button,{type:"button",...a,ref:r,onClick:wi(t.onClick,()=>s.onOpenChange(!1))})});function Pc(e){return e?"open":"closed"}_c.displayName=jc;var Tc="DialogTitleWarning",[Rc,Dc]=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}\``)}]}(Tc,{contentName:yc,titleName:Cc,docsSlug:"dialog"}),Ic=({titleId:e})=>{const t=Dc(Tc),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},Mc=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Dc("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},Uc=cc,Lc=dc,Oc=hc,zc=gc,Fc=xc,Bc=Ec,Wc=Ac,Vc=_c;function Gc(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 Hc=["color"],$c=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Gc(e,Hc);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"}))}),Kc=["color"],qc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Gc(e,Kc);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"}))}),Zc=["color"],Jc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Gc(e,Zc);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"}))}),Yc=["color"],Xc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Gc(e,Yc);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 Qc=t.createContext({container:null,setContainer:()=>{}}),el=t.memo(({children:r})=>{const[n,a]=t.useState(null),s=t.useMemo(()=>({container:n,setContainer:a}),[n]);return e.jsxs(Qc.Provider,{value:s,children:[r,e.jsx("div",{ref:a,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});el.displayName="PortalProvider";const tl=Uc,rl=Lc,nl=Oc,al=a.forwardRef(({className:t,...r},n)=>e.jsx(zc,{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}));al.displayName=zc.displayName;const sl=a.forwardRef(({className:t,children:r,...n},s)=>{const{container:i}=a.useContext(Qc);return e.jsxs(nl,{container:i,children:[e.jsx(al,{}),e.jsxs(Fc,{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(Vc,{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(Jc,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});sl.displayName=Fc.displayName;const il=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-start",t),...r});il.displayName="DialogHeader";const ol=a.forwardRef(({className:t,...r},n)=>e.jsx(Bc,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",t),...r}));ol.displayName=Bc.displayName;const cl=a.forwardRef(({className:t,...r},n)=>e.jsx(Wc,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));cl.displayName=Wc.displayName;const ll="saas-workspace-current",dl=e=>{e?un(ll,e._id):pn(ll)},ul=()=>dn(ll),pl=()=>{pn(ll)},ml=(e,t)=>!!e&&t.some(t=>t._id===e);function hl(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 fl(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 gl={WORKSPACE_SETTINGS_VIEW:"workspace:settings:view",WORKSPACE_SETTINGS_EDIT:"workspace:settings:edit",WORKSPACE_DELETE:"workspace:delete",WORKSPACE_MEMBERS_VIEW:"workspace:members:view",WORKSPACE_MEMBERS_INVITE:"workspace:members:invite",WORKSPACE_MEMBERS_REMOVE:"workspace:members:remove",WORKSPACE_MEMBERS_ROLE_CHANGE:"workspace:members:role-change",WORKSPACE_FEATURES_VIEW:"workspace:features:view",WORKSPACE_FEATURES_EDIT:"workspace:features:edit",WORKSPACE_BILLING_VIEW:"workspace:billing:view",WORKSPACE_BILLING_MANAGE:"workspace:billing:manage",WORKSPACE_USAGE_VIEW:"workspace:usage:view"},bl=Object.values(gl),vl={admin:bl.filter(e=>e!==gl.WORKSPACE_DELETE),member:[gl.WORKSPACE_SETTINGS_VIEW,gl.WORKSPACE_MEMBERS_VIEW,gl.WORKSPACE_FEATURES_VIEW,gl.WORKSPACE_BILLING_VIEW,gl.WORKSPACE_USAGE_VIEW],viewer:[gl.WORKSPACE_SETTINGS_VIEW,gl.WORKSPACE_MEMBERS_VIEW]};function yl(e){const t=new Set;for(const r of Object.values(e))for(const e of r)t.add(e);return Array.from(t)}function xl(e){const{userId:t,workspace:r,settings:n,appPermissions:a}=e;if(!r||!t)return new Set;if(hl(r,t)){const e=new Set(bl);if(a)for(const t of yl(a))e.add(t);if(r.permissions)for(const t of yl(r.permissions))e.add(t);if(n?.workspace?.permissions)for(const t of yl(n.workspace.permissions))e.add(t);return e}const s=e.workspaceRole??fl(r,t);if(!s)return new Set;const i=r.permissions,o=n?.workspace?.permissions,c=e=>e.filter(e=>e.startsWith("workspace:")),l=e=>e.filter(e=>!e.startsWith("workspace:")),d=i?.[s]?c(i[s]):[],u=o?.[s]?c(o[s]):[],p=vl[s]??[];let m;if(d.length>0)m=d;else if(u.length>0)m=u;else if(p.length>0)m=p;else{m=vl[n?.workspace?.defaultRole??"member"]??vl.member??[]}const h=new Set(m),f=i?.[s]?l(i[s]):[],g=a?.[s]?l(a[s]):[],b=f.length>0?f:g;for(const e of b)h.add(e);return function(e,t,r){if(!r?.workspace)return;const{canInviteMembers:n}=r.workspace;(!1===n||"admin-only"===n&&"admin"!==t)&&e.delete(gl.WORKSPACE_MEMBERS_INVITE)}(h,s,n),h}function wl(e){const{user:r}=_C(),{currentWorkspace:n}=EC(),{settings:a}=An(),{appPermissions:s}=sa(),i=e??n??null,o=r?.id??null,c=t.useMemo(()=>i?fl(i,o):null,[i,o]),l=t.useMemo(()=>!!i&&hl(i,o),[i,o]),d=t.useMemo(()=>xl({userId:o,workspaceRole:c,workspace:i,settings:a,appPermissions:s}),[o,c,i,a,s]),u=t.useCallback(e=>Array.isArray(e)?e.every(e=>d.has(e)):d.has(e),[d]);return{can:u,permissions:d,isOwner:l,role:c}}const Sl={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:"฿"},kl={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function Cl(e){return e&&e.trim()?kl[e.trim().toLowerCase()]??"":""}function El(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return Sl[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()} (${El(e)})`}));const Nl=({open:r,onOpenChange:n,packages:a,billingCurrency:s,workspaceName:i,onSelectPackage:o,purchasingPackageId:c,loading:l=!1})=>{const{t:d,dir:u,fmtNum:p,fmtCents:m}=ln(),h=t.useMemo(()=>{const e=new Set;return a.forEach(t=>{t.pricingVariants?.forEach(t=>{t.currency&&e.add(t.currency.toLowerCase())})}),Array.from(e)},[a]),f=t.useMemo(()=>{const e=s?.trim().toLowerCase();return e?h.includes(e)?[e]:[]:h},[s,h]),[g,b]=t.useState(()=>f.length>0?f[0]:""),v=s?.trim().toLowerCase()||g,y=l||!!c;return e.jsx(tl,{open:r,onOpenChange:n,children:e.jsxs(sl,{dir:u,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(ol,{className:"text-xl sm:text-2xl font-bold",children:d("credits.dialogTitle")}),e.jsxs(cl,{className:"mt-1 text-sm",children:[d("credits.dialogDescription"),i&&e.jsx("span",{className:"ms-1 font-medium text-foreground",children:d("credits.dialogDescriptionWorkspace",{workspace:i})})]})]}),!s?.trim()&&f.length>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-slate-600",children:d("pricing.currency")}),e.jsx("div",{className:"flex gap-1 rounded-lg border border-gray-200 bg-gray-50/50 p-1",children:f.map(t=>e.jsxs("button",{type:"button",onClick:()=>b(t),className:Se("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",v===t?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:[El(t)," ",t.toUpperCase()]},t))})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:0===a.length?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-gray-400",children:[e.jsx(Ms,{className:"h-12 w-12 mb-3"}),e.jsx("p",{className:"text-sm",children:d("credits.noPackages")})]}):e.jsx("div",{className:"max-w-2xl mx-auto px-4 py-6 sm:px-6 space-y-4",children:a.map(t=>{const r=t.pricingVariants?.find(e=>e.currency?.toLowerCase()===v)??t.pricingVariants?.[0],n=r?.amount,a=r?.currency??v,s=c===t._id,i=null!=n&&n>0&&t.creditAmount>0?Math.round(n/t.creditAmount):null;return e.jsxs("div",{className:Se("rounded-xl border p-5 sm:p-6 flex flex-col sm:flex-row sm:items-center gap-4 transition-all",s?"border-primary bg-primary/5 shadow-md":"border-gray-200 hover:border-gray-300 hover:shadow-sm"),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t.name}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-blue-50 px-2.5 py-0.5 text-xs font-medium text-blue-700",children:[e.jsx(Ms,{className:"h-3 w-3"}),d("credits.creditsAmount",{count:p(t.creditAmount)})]})]}),t.description&&e.jsx("p",{className:"text-sm text-gray-500 mb-2",children:t.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-gray-400",children:[e.jsx("span",{children:t.validityDays?d("credits.validityDays",{count:t.validityDays}):d("credits.validityUnlimited")}),null!=i&&e.jsx("span",{children:d("credits.perCredit",{price:m(i,a)})})]})]}),e.jsxs("div",{className:"flex items-center gap-4 sm:flex-col sm:items-end sm:gap-2 shrink-0",children:[null!=n&&e.jsx("span",{className:"text-2xl sm:text-3xl font-bold text-gray-900 whitespace-nowrap",children:m(n,a)}),e.jsx(xi,{size:"sm",onClick:()=>o(t),disabled:y,progress:s,className:"whitespace-nowrap",children:s?d("credits.purchasing"):d("credits.buyAmount",{count:p(t.creditAmount)})})]})]},t._id)})})})]})})},Al=({titleKey:t,descriptionKey:r})=>{const{t:n}=ln();return 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(qs,{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:n(t??"settings.common.noPermissionTitle")}),e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:n(r??"settings.common.noPermissionDescription")})]})]})})};function jl({className:t,...r}){return e.jsx("div",{className:Se("animate-pulse rounded-md bg-primary/10",t),...r})}function _l(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(jl,{className:"h-10 w-full"}),e.jsx(jl,{className:"h-10 w-full"}),e.jsx(jl,{className:"h-10 w-full"})]})}function Pl(e,t="en-US",r){try{const n=new Date(e);return isNaN(n.getTime())?"":new Intl.DateTimeFormat(t,r??{month:"short",day:"numeric",year:"numeric"}).format(n)}catch{return""}}function Tl(e,t="en-US"){return Pl(e,t,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Rl(e,t="en-US"){return e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):""}const Dl={[qa]:"credits.type.plan_grant",[Za]:"credits.type.pack_purchased",[Ja]:"credits.type.consumed",[Ya]:"credits.type.expired",[Xa]:"credits.type.admin_grant",[Qa]:"credits.type.admin_revoke",[es]:"credits.type.refund"};const Il=({workspace:r})=>{const n=r._id?.toString(),{t:a,fmtNum:s}=ln(),{can:i}=wl(),o=i(gl.WORKSPACE_BILLING_VIEW),c=i(gl.WORKSPACE_BILLING_MANAGE),{balance:l,loading:d,error:u,refetch:p}=ra(),{packages:m,loading:h}=Jn(n),{expiringCredits:f,loading:g}=Xn(n,7),[b,v]=t.useState(1),{transactions:y,hasNextPage:x,loading:w}=Yn(n,{limit:10,page:b}),[S,k]=t.useState([]);t.useEffect(()=>{w||0===y.length||k(1===b?y:e=>{const t=new Set(e.map(e=>e._id)),r=y.filter(e=>!t.has(e._id));return r.length>0?[...e,...r]:e})},[y,b,w]);const C=t.useCallback(()=>{x&&!w&&v(e=>e+1)},[x,w]),E=S,{purchaseCredits:N,loading:A}=Zn(n),[j,_]=t.useState(!1),[P,T]=t.useState(null),[R,D]=t.useState(!1),[I,M]=t.useState(!1),[U,L]=t.useState(null),[O,z]=t.useState(!1),F=t.useRef(!1),B=d&&!l;t.useEffect(()=>{if(F.current)return;const e=CC.getState();if(!e.params?.action)return;if(e.params.action===wa)return F.current=!0,CC.clearParams(),void z(!0);if(e.params.action!==xa)return;F.current=!0;const t=e.params.status;if(CC.clearParams(),t===Sa){D(!0),$n();const e=setTimeout(()=>D(!1),8e3);return()=>clearTimeout(e)}if(t===ka){M(!0);const e=setTimeout(()=>M(!1),5e3);return()=>clearTimeout(e)}t===Ca&&T(a("credits.purchaseFailed"))},[]);if(B)return e.jsx(_l,{});if(!o)return e.jsx(Al,{});if(!n)return e.jsx("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:e.jsx("p",{children:a("subscription.invalidWorkspace")})});const W=!h&&m.length>0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-600",children:a("credits.description")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[W&&c&&e.jsxs(xi,{size:"sm",onClick:()=>z(!0),children:[e.jsx(Js,{className:"h-3.5 w-3.5 me-1.5"}),a("credits.buyCredits")]}),e.jsxs(xi,{variant:"ghost",size:"sm",onClick:async()=>{_(!0);try{await p()}finally{_(!1)}},disabled:j,children:[e.jsx(Hs,{className:Se("h-3.5 w-3.5 me-1.5",j&&"animate-spin")}),a("settings.common.refreshAction",{loading:String(j)})]})]})]}),u&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg",children:[e.jsx("p",{className:"font-medium",children:a("credits.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:u})]}),R&&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",{className:"flex items-center gap-2",children:[e.jsx(Is,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("p",{className:"text-sm font-medium",children:a("credits.purchaseSuccess")})]}),e.jsx(xi,{variant:"outline",size:"sm",onClick:()=>D(!1),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:a("settings.common.dismiss")})]}),I&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 text-amber-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsx("p",{className:"text-sm font-medium",children:a("credits.purchaseCanceled")}),e.jsx(xi,{variant:"outline",size:"sm",onClick:()=>M(!1),className:"flex-shrink-0 border-amber-200 text-amber-700 hover:bg-amber-100",children:a("settings.common.dismiss")})]}),P&&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.jsx("p",{className:"text-sm",children:P}),e.jsx(xi,{variant:"outline",size:"sm",onClick:()=>T(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.dismiss")})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[e.jsxs("div",{className:"bg-gray-50/50 p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wider",children:a("credits.balance")}),e.jsx(Ms,{className:"h-5 w-5 text-gray-400"})]}),l?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-3xl font-bold text-gray-900 mb-4",children:s(l.available)}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.totalGranted")}),e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s(l.totalGranted)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.totalConsumed")}),e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s(l.totalConsumed)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.totalExpired")}),e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s(l.totalExpired)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.available")}),e.jsx("p",{className:"text-sm font-semibold text-green-600",children:s(l.available)})]})]})]}):e.jsxs("div",{className:"text-center py-4",children:[e.jsx(Ms,{className:"h-10 w-10 text-gray-300 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:a("credits.noCredits")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:a("credits.noCreditsHint")}),W&&c&&e.jsxs(xi,{size:"sm",className:"mt-3",onClick:()=>z(!0),children:[e.jsx(Js,{className:"h-3.5 w-3.5 me-1.5"}),a("credits.buyCredits")]})]})]}),!g&&f>0&&e.jsx("div",{className:"px-4 py-3 bg-amber-50 border-t border-amber-200 text-sm text-amber-800",children:a("credits.expiringInDays",{count:f,days:7})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:a("credits.transactions")}),w&&0===E.length?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(Bs,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}):0===E.length?e.jsx("div",{className:"border rounded-lg p-6 text-center",children:e.jsx("p",{className:"text-sm text-gray-500",children:a("credits.noTransactions")})}):e.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[e.jsx("div",{className:"divide-y divide-gray-100",children:E.map(t=>e.jsx(Ml,{tx:t},t._id))}),x&&e.jsx("div",{className:"border-t border-gray-200 px-4 py-3 text-center",children:e.jsx(xi,{variant:"ghost",size:"sm",onClick:C,disabled:w,progress:w&&b>1,children:a("credits.loadMore")})})]})]}),W&&c&&e.jsx(Nl,{open:O,onOpenChange:z,packages:m,billingCurrency:r.billingCurrency,workspaceName:r.name,onSelectPackage:async e=>{if(n){T(null),L(e._id);try{const{successUrl:t,cancelUrl:r}=ja(n),a=await N({creditPackageId:e._id,successUrl:t,cancelUrl:r});a.url&&da(a.url)}catch(e){T(e instanceof Error?e.message:a("errors.purchaseCredits")),L(null)}}},purchasingPackageId:U,loading:A})]})};function Ml({tx:t}){const{t:r,formattingLocale:n,fmtNum:a}=ln(),s=Dl[t.type]??"credits.type.consumed",i=function(e){switch(e){case"plan_grant":case"admin_grant":case"refund":return"bg-green-100 text-green-800";case"pack_purchased":return"bg-blue-100 text-blue-800";case"consumed":default:return"bg-gray-100 text-gray-800";case"expired":case"admin_revoke":return"bg-red-100 text-red-800"}}(t.type),o=t.amount>0;return e.jsx("div",{className:"px-3 py-3 sm:px-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-0.5",children:[e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0",i),children:r(s)}),t.description&&e.jsx("p",{className:"text-sm text-gray-700 truncate",children:t.description})]}),e.jsx("p",{className:"text-xs text-gray-400",children:Tl(t.createdAt,n)})]}),e.jsxs("div",{className:"text-end shrink-0",children:[e.jsxs("span",{className:Se("text-sm font-semibold",o?"text-green-600":"text-gray-900"),children:[o?"+":"",a(t.amount)]}),e.jsx("p",{className:"text-xs text-gray-400",children:a(t.balanceAfter)})]})]})})}var Ul=Symbol("radix.slottable");var Ll="AlertDialog",[Ol]=Si(Ll,[sc]),zl=sc(),Fl=t=>{const{__scopeAlertDialog:r,...n}=t,a=zl(r);return e.jsx(Uc,{...a,...n,modal:!0})};Fl.displayName=Ll;var Bl=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=zl(n);return e.jsx(Lc,{...s,...a,ref:r})});Bl.displayName="AlertDialogTrigger";var Wl=t=>{const{__scopeAlertDialog:r,...n}=t,a=zl(r);return e.jsx(Oc,{...a,...n})};Wl.displayName="AlertDialogPortal";var Vl=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=zl(n);return e.jsx(zc,{...s,...a,ref:r})});Vl.displayName="AlertDialogOverlay";var Gl="AlertDialogContent",[Hl,$l]=Ol(Gl),Kl=function(t){const r=({children:t})=>e.jsx(e.Fragment,{children:t});return r.displayName=`${t}.Slottable`,r.__radixId=Ul,r}("AlertDialogContent"),ql=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,children:s,...i}=t,o=zl(n),c=a.useRef(null),l=oi(r,c),d=a.useRef(null);return e.jsx(Rc,{contentName:Gl,titleName:Zl,docsSlug:"alert-dialog",children:e.jsx(Hl,{scope:n,cancelRef:d,children:e.jsxs(Fc,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:wi(i.onOpenAutoFocus,e=>{e.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Kl,{children:s}),e.jsx(rd,{contentRef:c})]})})})});ql.displayName=Gl;var Zl="AlertDialogTitle",Jl=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=zl(n);return e.jsx(Bc,{...s,...a,ref:r})});Jl.displayName=Zl;var Yl="AlertDialogDescription",Xl=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=zl(n);return e.jsx(Wc,{...s,...a,ref:r})});Xl.displayName=Yl;var Ql=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=zl(n);return e.jsx(Vc,{...s,...a,ref:r})});Ql.displayName="AlertDialogAction";var ed="AlertDialogCancel",td=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,{cancelRef:s}=$l(ed,n),i=zl(n),o=oi(r,s);return e.jsx(Vc,{...i,...a,ref:o})});td.displayName=ed;var rd=({contentRef:e})=>{const t=`\`${Gl}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Gl}\` by passing a \`${Yl}\` 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 \`${Gl}\`. 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},nd=Vl,ad=ql,sd=Ql,id=td,od=Jl,cd=Xl;const ld=Fl,dd=Bl,ud=Wl,pd=a.forwardRef(({className:t,...r},n)=>e.jsx(nd,{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}));pd.displayName=nd.displayName;const md=a.forwardRef(({className:t,...r},n)=>{const{container:s}=a.useContext(Qc);return e.jsxs(ud,{container:s,children:[e.jsx(pd,{}),e.jsx(ad,{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})]})});md.displayName=ad.displayName;const hd=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-start",t),...r});hd.displayName="AlertDialogHeader";const fd=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});fd.displayName="AlertDialogFooter";const gd=a.forwardRef(({className:t,...r},n)=>e.jsx(od,{ref:n,className:Se("text-lg font-semibold",t),...r}));gd.displayName=od.displayName;const bd=a.forwardRef(({className:t,...r},n)=>e.jsx(cd,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));bd.displayName=cd.displayName;const vd=a.forwardRef(({className:t,...r},n)=>e.jsx(sd,{ref:n,className:Se(yi(),t),...r}));vd.displayName=sd.displayName;const yd=a.forwardRef(({className:t,...r},n)=>e.jsx(id,{ref:n,className:Se(yi({variant:"outline"}),"mt-2 sm:mt-0",t),...r}));yd.displayName=id.displayName;const xd=({workspace:r})=>{const[n,a]=t.useState(!1),{deleteWorkspace:s}=EC(),{can:i}=wl(),{settings:o}=An(),{t:c}=ln();if(1===(o?.workspace?.maxWorkspacesPerUser??0))return null;if(!r)return e.jsx(_l,{});return i(gl.WORKSPACE_DELETE)?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(ld,{children:[e.jsx(dd,{asChild:!0,children:e.jsxs(xi,{variant:"destructive",disabled:n,progress:n,children:[e.jsx(ei,{className:"h-4 w-4 me-2"}),c("danger.deleteWorkspace")]})}),e.jsxs(md,{children:[e.jsxs(hd,{children:[e.jsx(gd,{children:c("danger.deleteConfirm")}),e.jsx(bd,{children:c("danger.deleteConfirmDescription")})]}),e.jsxs(fd,{children:[e.jsx(yd,{disabled:n,children:c("settings.common.cancel")}),e.jsx(vd,{onClick:async()=>{a(!0);try{await s(r._id)}catch(e){Te(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(Bs,{className:"me-2 h-4 w-4 animate-spin"}),c("danger.deleting")]}):c("danger.deleteWorkspace")})]})]})]})]}):e.jsx(Al,{descriptionKey:"danger.adminOnly"})};function wd(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 Sd(e){const[t,r]=a.useState(void 0);return Ci(()=>{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 kd="Switch",[Cd]=Si(kd),[Ed,Nd]=Cd(kd),Ad=a.forwardRef((t,r)=>{const{__scopeSwitch:n,name:s,checked:i,defaultChecked:o,required:c,disabled:l,value:d="on",onCheckedChange:u,form:p,...m}=t,[h,f]=a.useState(null),g=oi(r,e=>f(e)),b=a.useRef(!1),v=!h||(p||!!h.closest("form")),[y,x]=_i({prop:i,defaultProp:o??!1,onChange:u,caller:kd});return e.jsxs(Ed,{scope:n,checked:y,disabled:l,children:[e.jsx(Di.button,{type:"button",role:"switch","aria-checked":y,"aria-required":c,"data-state":Td(y),"data-disabled":l?"":void 0,disabled:l,value:d,...m,ref:g,onClick:wi(t.onClick,e=>{x(e=>!e),v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),v&&e.jsx(Pd,{control:h,bubbles:!b.current,name:s,value:d,checked:y,required:c,disabled:l,form:p,style:{transform:"translateX(-100%)"}})]})});Ad.displayName=kd;var jd="SwitchThumb",_d=a.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,s=Nd(jd,n);return e.jsx(Di.span,{"data-state":Td(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:r})});_d.displayName=jd;var Pd=a.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=oi(c,o),d=wd(n),u=Sd(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[d,n,s]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Td(e){return e?"checked":"unchecked"}Pd.displayName="SwitchBubbleInput";var Rd=Ad,Dd=_d;const Id=a.forwardRef(({className:t,...r},n)=>e.jsx(Rd,{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(Dd,{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")})}));function Md(e=5e3){const[r,n]=t.useState(null),a=t.useRef(null);t.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);return{message:r,show:t.useCallback(t=>{n(t),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{n(null)},e)},[e]),clear:t.useCallback(()=>{n(null),a.current&&clearTimeout(a.current)},[])}}Id.displayName=Rd.displayName;const Ud=({workspaceId:r})=>{const{t:n}=ln(),{allFeatures:a,updateFeature:s,getWorkspace:i}=EC(),{can:o}=wl(),[c,l]=t.useState({}),d=Md(),[u,p]=t.useState(null);if(t.useEffect(()=>{i(r).then(p)},[r]),!u)return e.jsx(_l,{});const m=o(gl.WORKSPACE_FEATURES_EDIT);return e.jsxs("div",{children:[d.message&&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:d.message})]}),e.jsxs("div",{className:"flex flex-col gap-y-3.5 pe-4",children:[!m&&e.jsx(Al,{descriptionKey:"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=u?.features?.[t.slug],i=null!==c[t.slug]&&void 0!==c[t.slug],o=c[t.slug],h=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(Bs,{className:"h-4 w-4 animate-spin text-gray-500"}),e.jsxs("span",{className:"text-sm text-gray-600",children:[h,"..."]})]}):e.jsx(Id,{disabled:!m,checked:r??t.defaultValue,onCheckedChange:e=>async function(e,t){if(u){l(r=>({...r,[e]:t})),d.clear();try{const r=await s(u._id,e,t);p(r);const i=a.find(t=>t.slug===e),o=i?.name||"Feature";d.show(n("features.updateSuccess",{feature:o,enabled:String(t)}))}catch(t){Te(t,{component:"WorkspaceSettingsFeatures",action:"updateFeature",metadata:{workspaceId:u._id,featureKey:e}})}finally{l(t=>({...t,[e]:null}))}}}(t.slug,e)})]},t._id)})})]})]})};var Ld=e=>"checkbox"===e.type,Od=e=>e instanceof Date,zd=e=>null==e;const Fd=e=>"object"==typeof e;var Bd=e=>!zd(e)&&!Array.isArray(e)&&Fd(e)&&!Od(e),Wd=e=>Bd(e)&&e.target?Ld(e.target)?e.target.checked:e.target.value:e,Vd=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Gd="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Hd(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(Gd&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||Bd(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return Bd(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]=Hd(e[t]));return n}var $d=e=>/^\w*$/.test(e),Kd=e=>void 0===e,qd=e=>Array.isArray(e)?e.filter(Boolean):[],Zd=e=>qd(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Jd=(e,t,r)=>{if(!t||!Bd(e))return r;const n=($d(t)?[t]:Zd(t)).reduce((e,t)=>zd(e)?e:e[t],e);return Kd(n)||n===e?Kd(e[t])?r:e[t]:n},Yd=e=>"boolean"==typeof e,Xd=e=>"function"==typeof e,Qd=(e,t,r)=>{let n=-1;const a=$d(t)?[t]:Zd(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=Bd(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=s,e=e[t]}};const eu="blur",tu="focusout",ru="change",nu="onBlur",au="onChange",su="onSubmit",iu="onTouched",ou="all",cu="max",lu="min",du="maxLength",uu="minLength",pu="pattern",mu="required",hu="validate",fu=t.createContext(null);fu.displayName="HookFormControlContext";const gu=()=>t.useContext(fu);var bu=(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]!==ou&&(t._proxyFormState[a]=!n||ou),r&&(r[a]=!0),e[a]}});return a};const vu="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var yu=e=>"string"==typeof e,xu=(e,t,r,n,a)=>yu(e)?(n&&t.watch.add(e),Jd(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),Jd(r,e))):(n&&(t.watchAll=!0),r),wu=e=>zd(e)||!Fd(e);function Su(e,t,r=new WeakSet){if(wu(e)||wu(t))return Object.is(e,t);if(Od(e)&&Od(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(Od(n)&&Od(e)||Bd(n)&&Bd(e)||Array.isArray(n)&&Array.isArray(e)?!Su(n,e,r):!Object.is(n,e))return!1}}return!0}function ku(e){const r=gu(),{name:n,disabled:a,control:s=r,shouldUnregister:i,defaultValue:o,exact:c=!0}=e,l=Vd(s._names.array,n),d=t.useMemo(()=>Jd(s._formValues,n,Jd(s._defaultValues,n,o)),[s,n,o]),u=function(e){const r=gu(),{control:n=r,name:a,defaultValue:s,disabled:i,exact:o,compute:c}=e||{},l=t.useRef(s),d=t.useRef(c),u=t.useRef(void 0),p=t.useRef(n),m=t.useRef(a);d.current=c;const[h,f]=t.useState(()=>{const e=n._getWatch(a,l.current);return d.current?d.current(e):e}),g=t.useCallback(e=>{const t=xu(a,n._names,e||n._formValues,!1,l.current);return d.current?d.current(t):t},[n._formValues,n._names,a]),b=t.useCallback(e=>{if(!i){const t=xu(a,n._names,e||n._formValues,!1,l.current);if(d.current){const e=d.current(t);Su(e,u.current)||(f(e),u.current=e)}else f(t)}},[n._formValues,n._names,i,a]);vu(()=>(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:d,exact:c}),p=function(e){const r=gu(),{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 vu(()=>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(()=>bu(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:u,...Yd(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Jd(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Jd(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Jd(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Jd(p.validatingFields,n)},error:{enumerable:!0,get:()=>Jd(p.errors,n)}}),[p,n]),b=t.useCallback(e=>f.current.onChange({target:{value:Wd(e),name:n},type:ru}),[n]),v=t.useCallback(()=>f.current.onBlur({target:{value:Jd(s._formValues,n),name:n},type:eu}),[n,s._formValues]),y=t.useCallback(e=>{const t=Jd(s._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>Xd(e.focus)&&e.focus(),select:()=>Xd(e.select)&&e.select(),setCustomValidity:t=>Xd(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>Xd(e.reportValidity)&&e.reportValidity()})},[s._fields,n]),x=t.useMemo(()=>({name:n,value:u,...Yd(a)||p.disabled?{disabled:p.disabled||a}:{},onChange:b,onBlur:v,ref:y}),[n,a,p.disabled,b,v,y,u]);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,...Yd(m.current.disabled)?{disabled:m.current.disabled}:{}});const r=(e,t)=>{const r=Jd(s._fields,e);r&&r._f&&(r._f.mount=t)};if(r(n,!0),e){const e=Hd(Jd(s._options.defaultValues,n,m.current.defaultValue));Qd(s._defaultValues,n,e),Kd(Jd(s._formValues,n))&&Qd(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 Cu=e=>e.render(ku(e)),Eu=t.createContext(null);Eu.displayName="HookFormContext";const Nu=e=>{const{children:r,watch:n,getValues:a,getFieldState:s,setError:i,clearErrors:o,setValue:c,trigger:l,formState:d,resetField:u,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}=e;return t.createElement(Eu.Provider,{value:t.useMemo(()=>({watch:n,getValues:a,getFieldState:s,setError:i,clearErrors:o,setValue:c,trigger:l,formState:d,resetField:u,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}),[o,f,d,s,a,m,g,p,u,i,b,c,v,l,h,n])},t.createElement(fu.Provider,{value:f},r))};var Au=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},ju=e=>Array.isArray(e)?e:[e],_u=()=>{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 Pu(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],s=t[n];if(a&&Bd(a)&&s){const e=Pu(a,s);Bd(e)&&(r[n]=e)}else e[n]&&(r[n]=s)}return r}var Tu=e=>Bd(e)&&!Object.keys(e).length,Ru=e=>"file"===e.type,Du=e=>{if(!Gd)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Iu=e=>"select-multiple"===e.type,Mu=e=>"radio"===e.type,Uu=e=>Du(e)&&e.isConnected;function Lu(e,t){const r=Array.isArray(t)?t:$d(t)?[t]:Zd(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Kd(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,s=r[a];return n&&delete n[s],0!==a&&(Bd(n)&&Tu(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Kd(e[t]))return!1;return!0}(n))&&Lu(e,r.slice(0,-1)),e}function Ou(e){return Array.isArray(e)||Bd(e)&&!(e=>{for(const t in e)if(Xd(e[t]))return!0;return!1})(e)}function zu(e,t={}){for(const r in e){const n=e[r];Ou(n)?(t[r]=Array.isArray(n)?[]:{},zu(n,t[r])):Kd(n)||(t[r]=!0)}return t}function Fu(e,t,r){r||(r=zu(t));for(const n in e){const a=e[n];if(Ou(a))Kd(t)||wu(r[n])?r[n]=zu(a,Array.isArray(a)?[]:{}):Fu(a,zd(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!Su(a,e)}}return r}const Bu={value:!1,isValid:!1},Wu={value:!0,isValid:!0};var Vu=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&&!Kd(e[0].attributes.value)?Kd(e[0].value)||""===e[0].value?Wu:{value:e[0].value,isValid:!0}:Wu:Bu}return Bu},Gu=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Kd(e)?e:t?""===e?NaN:e?+e:e:r&&yu(e)?new Date(e):n?n(e):e;const Hu={isValid:!1,value:null};var $u=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Hu):Hu;function Ku(e){const t=e.ref;return Ru(t)?t.files:Mu(t)?$u(e.refs).value:Iu(t)?[...t.selectedOptions].map(({value:e})=>e):Ld(t)?Vu(e.refs).value:Gu(Kd(t.value)?e.ref.value:t.value,e)}var qu=e=>e instanceof RegExp,Zu=e=>Kd(e)?e:qu(e)?e.source:Bd(e)?qu(e.value)?e.value.source:e.value:e,Ju=e=>({isOnSubmit:!e||e===su,isOnBlur:e===nu,isOnChange:e===au,isOnAll:e===ou,isOnTouch:e===iu});const Yu="AsyncFunction";var Xu=e=>!!e&&!!e.validate&&!!(Xd(e.validate)&&e.validate.constructor.name===Yu||Bd(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===Yu)),Qu=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const ep=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=Jd(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(ep(s,t))break}else if(Bd(s)&&ep(s,t))break}}};function tp(e,t,r){const n=Jd(e,r);if(n||$d(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),s=Jd(t,n),i=Jd(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 rp=(e,t,r)=>{const n=ju(Jd(e,r));return Qd(n,"root",t[r]),Qd(e,r,n),e};function np(e,t,r="validate"){if(yu(e)||Array.isArray(e)&&e.every(yu)||Yd(e)&&!e)return{type:r,message:yu(e)?e:"",ref:t}}var ap=e=>Bd(e)&&!qu(e)?e:{value:e,message:""},sp=async(e,t,r,n,a,s)=>{const{ref:i,refs:o,required:c,maxLength:l,minLength:d,min:u,max:p,pattern:m,validate:h,name:f,valueAsNumber:g,mount:b}=e._f,v=Jd(r,f);if(!b||t.has(f))return{};const y=o?o[0]:i,x=e=>{a&&y.reportValidity&&(y.setCustomValidity(Yd(e)?"":e||""),y.reportValidity())},w={},S=Mu(i),k=Ld(i),C=S||k,E=(g||Ru(i))&&Kd(i.value)&&Kd(v)||Du(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,N=Au.bind(null,f,n,w),A=(e,t,r,n=du,a=uu)=>{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&&(!C&&(E||zd(v))||Yd(v)&&!v||k&&!Vu(o).isValid||S&&!$u(o).isValid)){const{value:e,message:t}=yu(c)?{value:!!c,message:c}:ap(c);if(e&&(w[f]={type:mu,message:t,ref:y,...N(mu,t)},!n))return x(t),w}if(!(E||zd(u)&&zd(p))){let e,t;const r=ap(p),a=ap(u);if(zd(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;yu(r.value)&&v&&(e=o?s(v)>s(r.value):c?v>r.value:n>new Date(r.value)),yu(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);zd(r.value)||(e=n>r.value),zd(a.value)||(t=n<a.value)}if((e||t)&&(A(!!e,r.message,a.message,cu,lu),!n))return x(w[f].message),w}if((l||d)&&!E&&(yu(v)||s&&Array.isArray(v))){const e=ap(l),t=ap(d),r=!zd(e.value)&&v.length>+e.value,a=!zd(t.value)&&v.length<+t.value;if((r||a)&&(A(r,e.message,t.message),!n))return x(w[f].message),w}if(m&&!E&&yu(v)){const{value:e,message:t}=ap(m);if(qu(e)&&!v.match(e)&&(w[f]={type:pu,message:t,ref:i,...N(pu,t)},!n))return x(t),w}if(h)if(Xd(h)){const e=np(await h(v,r),y);if(e&&(w[f]={...e,...N(hu,e.message)},!n))return x(e.message),w}else if(Bd(h)){let e={};for(const t in h){if(!Tu(e)&&!n)break;const a=np(await h[t](v,r),y,t);a&&(e={...a,...N(t,a.message)},x(a.message),n&&(w[f]=e))}if(!Tu(e)&&(w[f]={ref:y,...e},!n))return w}return x(!0),w};const ip={mode:su,reValidateMode:au,shouldFocusError:!0};function op(e={}){let t,r={...ip,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Xd(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},s=(Bd(r.defaultValues)||Bd(r.values))&&Hd(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Hd(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 d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={...d};let p={...u};const m={array:_u(),state:_u()},h=r.criteriaMode===ou,f=async e=>{if(!o.keepIsValid&&!r.disabled&&(u.isValid||p.isValid||e)){let e;r.resolver?(e=Tu((await x()).errors),g()):e=await w(a,!0),e!==n.isValid&&m.state.next({isValid:e})}},g=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||p.isValidating||p.validatingFields)&&((e||Array.from(c.mount)).forEach(e=>{e&&(t?Qd(n.validatingFields,e,t):Lu(n.validatingFields,e))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Tu(n.validatingFields)}))},b=(e,t,r,n)=>{const c=Jd(a,e);if(c){const a=Jd(i,e,Kd(r)?Jd(s,e):r);Kd(a)||n&&n.defaultChecked||t?Qd(i,e,t?a:Ku(c._f)):C(e,a),o.mount&&!o.action&&f()}},v=(e,t,a,i,o)=>{let c=!1,l=!1;const d={name:e};if(!r.disabled){if(!a||i){(u.isDirty||p.isDirty)&&(l=n.isDirty,n.isDirty=d.isDirty=S(),c=l!==d.isDirty);const r=Su(Jd(s,e),t);l=!!Jd(n.dirtyFields,e),r?Lu(n.dirtyFields,e):Qd(n.dirtyFields,e,!0),d.dirtyFields=n.dirtyFields,c=c||(u.dirtyFields||p.dirtyFields)&&l!==!r}if(a){const t=Jd(n.touchedFields,e);t||(Qd(n.touchedFields,e,a),d.touchedFields=n.touchedFields,c=c||(u.touchedFields||p.touchedFields)&&t!==a)}c&&o&&m.state.next(d)}return c?d:{}},y=(e,a,s,i)=>{const o=Jd(n.errors,e),c=(u.isValid||p.isValid)&&Yd(a)&&n.isValid!==a;var d;if(r.delayError&&s?(d=()=>((e,t)=>{Qd(n.errors,e,t),m.state.next({errors:n.errors})})(e,s),t=e=>{clearTimeout(l),l=setTimeout(d,e)},t(r.delayError)):(clearTimeout(l),t=null,s?Qd(n.errors,e,s):Lu(n.errors,e)),(s?!Su(o,s):o)||!Tu(i)||c){const t={...i,...c&&Yd(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=Jd(t,r);e&&Qd(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),d=l._f&&Xu(l._f);d&&u.validatingFields&&g([t.name],!0);const p=await sp(l,c.disabled,i,h,r.shouldUseNativeValidation&&!a,o);if(d&&u.validatingFields&&g([t.name]),p[t.name]&&(s.valid=!1,a||e.shouldUseNativeValidation))break;!a&&(Jd(p,t.name)?o?rp(n.errors,p,t.name):Qd(n.errors,t.name,p[t.name]):Lu(n.errors,t.name))}!Tu(o)&&await w(o,a,s)}}return s.valid},S=(e,t)=>!r.disabled&&(e&&t&&Qd(i,e,t),!Su(P(),s)),k=(e,t,r)=>xu(e,c,{...o.mount?i:Kd(t)?s:yu(e)?{[e]:t}:t},r,t),C=(e,t,r={})=>{const n=Jd(a,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&Qd(i,e,Gu(t,r)),s=Du(r.ref)&&zd(t)?"":t,Iu(r.ref)?[...r.ref.options].forEach(e=>e.selected=s.includes(e.value)):r.refs?Ld(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):Ru(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||m.state.next({name:e,values:Hd(i)})))}(r.shouldDirty||r.shouldTouch)&&v(e,s,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&_(e)},E=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const s=t[n],i=e+"."+n,o=Jd(a,i);(c.array.has(e)||Bd(s)||o&&!o._f)&&!Od(s)?E(i,s,r):C(i,s,r)}},N=(e,t,r={})=>{const l=Jd(a,e),d=c.array.has(e),h=Hd(t);Qd(i,e,h),d?(m.array.next({name:e,values:Hd(i)}),(u.isDirty||u.dirtyFields||p.isDirty||p.dirtyFields)&&r.shouldDirty&&m.state.next({name:e,dirtyFields:Fu(s,i),isDirty:S(e,h)})):!l||l._f||zd(h)?C(e,h,r):E(e,h,r),Qu(e,c)?m.state.next({...n,name:e,values:Hd(i)}):m.state.next({name:o.mount?e:void 0,values:Hd(i)})},A=async e=>{o.mount=!0;const s=e.target;let l=s.name,d=!0;const b=Jd(a,l),S=e=>{d=Number.isNaN(e)||Od(e)&&isNaN(e.getTime())||Su(e,Jd(i,l,e))},k=Ju(r.mode),C=Ju(r.reValidateMode);if(b){let o,E;const N=s.type?Ku(b._f):Wd(e),A=e.type===eu||e.type===tu,j=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(b._f)&&!r.resolver&&!Jd(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,Jd(n.touchedFields,l),n.isSubmitted,C,k),P=Qu(l,c,A);Qd(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 T=v(l,N,A),R=!Tu(T)||P;if(!A&&m.state.next({name:l,type:e.type,values:Hd(i)}),j)return(u.isValid||p.isValid)&&("onBlur"===r.mode?A&&f():A||f()),R&&m.state.next({name:l,...P?{}:T});if(!A&&P&&m.state.next({...n}),r.resolver){const{errors:e}=await x([l]);if(g([l]),S(N),d){const t=tp(n.errors,a,l),r=tp(e,a,t.name||l);o=r.error,l=r.name,E=Tu(e)}}else g([l],!0),o=(await sp(b,c.disabled,i,h,r.shouldUseNativeValidation))[l],g([l]),S(N),d&&(o?E=!1:(u.isValid||p.isValid)&&(E=await w(a,!0)));d&&(b._f.deps&&(!Array.isArray(b._f.deps)||b._f.deps.length>0)&&_(b._f.deps),y(l,E,o,T))}},j=(e,t)=>{if(Jd(n.errors,t)&&e.focus)return e.focus(),1},_=async(e,t={})=>{let s,i;const o=ju(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=Jd(t,r);e?Qd(n.errors,r,e):Lu(n.errors,r)}else n.errors=t;return t})(Kd(e)?e:o);s=Tu(t),i=e?!o.some(e=>Jd(t,e)):s}else e?(i=(await Promise.all(o.map(async e=>{const t=Jd(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({...!yu(e)||(u.isValid||p.isValid)&&s!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:s}:{},errors:n.errors}),t.shouldFocus&&!i&&ep(a,j,e?o:c.mount),i},P=(e,t)=>{let r={...o.mount?i:s};return t&&(r=Pu(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),Kd(e)?r:yu(e)?Jd(r,e):e.map(e=>Jd(r,e))},T=(e,t)=>({invalid:!!Jd((t||n).errors,e),isDirty:!!Jd((t||n).dirtyFields,e),error:Jd((t||n).errors,e),isValidating:!!Jd(n.validatingFields,e),isTouched:!!Jd((t||n).touchedFields,e)}),R=(e,t,r)=>{const s=(Jd(a,e,{_f:{}})._f||{}).ref,i=Jd(n.errors,e)||{},{ref:o,message:c,type:l,...d}=i;Qd(n.errors,e,{...d,...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&&!ju(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 Tu(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(e=>t[e]===(!n||ou))})(t,e.formState||u,B,e.reRenderRoot)||e.callback({values:{...i},...n,...t,defaultValues:s})}}).unsubscribe,I=(e,t={})=>{for(const o of e?ju(e):c.mount)c.mount.delete(o),c.array.delete(o),t.keepValue||(Lu(a,o),Lu(i,o)),!t.keepError&&Lu(n.errors,o),!t.keepDirty&&Lu(n.dirtyFields,o),!t.keepTouched&&Lu(n.touchedFields,o),!t.keepIsValidating&&Lu(n.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&Lu(s,o);m.state.next({values:Hd(i)}),m.state.next({...n,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&f()},M=({disabled:e,name:t})=>{if(Yd(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()}},U=(e,t={})=>{let n=Jd(a,e);const i=Yd(t.disabled)||Yd(r.disabled);return Qd(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),n?M({disabled:Yd(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:Zu(t.min),max:Zu(t.max),minLength:Zu(t.minLength),maxLength:Zu(t.maxLength),pattern:Zu(t.pattern)}:{},name:e,onChange:A,onBlur:A,ref:i=>{if(i){U(e,t),n=Jd(a,e);const r=Kd(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,o=(e=>Mu(e)||Ld(e))(r),c=n._f.refs||[];if(o?c.find(e=>e===r):r===n._f.ref)return;Qd(a,e,{_f:{...n._f,...o?{refs:[...c.filter(Uu),r,...Array.isArray(Jd(s,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),b(e,!1,void 0,r)}else n=Jd(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!Vd(c.array,e)||!o.action)&&c.unMount.add(e)}}},L=()=>r.shouldFocusError&&ep(a,j,c.mount),O=(e,t)=>async s=>{let o;s&&(s.preventDefault&&s.preventDefault(),s.persist&&s.persist());let l=Hd(i);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();g(),n.errors=e,l=Hd(t)}else await w(a);if(c.disabled.size)for(const e of c.disabled)Lu(l,e);if(Lu(n.errors,"root"),Tu(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:Tu(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},z=(e,t={})=>{const l=e?Hd(e):s,d=Hd(l),p=Tu(e),h=p?s:d;if(t.keepDefaultValues||(s=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(Fu(s,i))]);for(const t of Array.from(e)){const e=Jd(n.dirtyFields,t),r=Jd(i,t),a=Jd(h,t);e&&!Kd(r)?Qd(h,t,r):e||Kd(a)||N(t,a)}}else{if(Gd&&Kd(e))for(const e of c.mount){const t=Jd(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Du(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)N(e,Jd(h,e));else a={}}i=r.shouldUnregister?t.keepDefaultValues?Hd(s):{}:Hd(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=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!r.shouldUnregister&&!Tu(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?Fu(s,i):n.dirtyFields:t.keepDefaultValues&&e?Fu(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(Xd(e)?e(i):e,{...r.resetOptions,...t}),B=e=>{n={...n,...e}},W={control:{register:U,unregister:I,getFieldState:T,handleSubmit:O,setError:R,_subscribe:D,_runSchema:x,_updateIsValidating:g,_focusError:L,_getWatch:k,_getDirty:S,_setValid:f,_setFieldArray:(e,t=[],c,l,d=!0,h=!0)=>{if(l&&c&&!r.disabled){if(o.action=!0,h&&Array.isArray(Jd(a,e))){const t=c(Jd(a,e),l.argA,l.argB);d&&Qd(a,e,t)}if(h&&Array.isArray(Jd(n.errors,e))){const t=c(Jd(n.errors,e),l.argA,l.argB);d&&Qd(n.errors,e,t),((e,t)=>{!qd(Jd(e,t)).length&&Lu(e,t)})(n.errors,e)}if((u.touchedFields||p.touchedFields)&&h&&Array.isArray(Jd(n.touchedFields,e))){const t=c(Jd(n.touchedFields,e),l.argA,l.argB);d&&Qd(n.touchedFields,e,t)}(u.dirtyFields||p.dirtyFields)&&(n.dirtyFields=Fu(s,i)),m.state.next({name:e,isDirty:S(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Qd(i,e,t)},_setDisabledField:M,_setErrors:e=>{n.errors=e,m.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>qd(Jd(o.mount?i:s,e,r.shouldUnregister?Jd(s,e,[]):[])),_reset:z,_resetDefaultValues:()=>Xd(r.defaultValues)&&r.defaultValues().then(e=>{F(e,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of c.unMount){const t=Jd(a,e);t&&(t._f.refs?t._f.refs.every(e=>!Uu(e)):!Uu(t._f.ref))&&I(e)}c.unMount=new Set},_disableForm:e=>{Yd(e)&&(m.state.next({disabled:e}),ep(a,(t,r)=>{const n=Jd(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:u,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:{...d,...e.formState}})),trigger:_,register:U,handleSubmit:O,watch:(e,t)=>Xd(e)?m.state.subscribe({next:r=>"values"in r&&e(k(void 0,t),r)}):k(e,t,!0),setValue:N,getValues:P,reset:F,resetField:(e,t={})=>{Jd(a,e)&&(Kd(t.defaultValue)?N(e,Hd(Jd(s,e))):(N(e,t.defaultValue),Qd(s,e,Hd(t.defaultValue))),t.keepTouched||Lu(n.touchedFields,e),t.keepDirty||(Lu(n.dirtyFields,e),n.isDirty=t.defaultValue?S(e,Hd(Jd(s,e))):S()),t.keepError||(Lu(n.errors,e),u.isValid&&f()),m.state.next({...n}))},clearErrors:e=>{e&&ju(e).forEach(e=>Lu(n.errors,e)),m.state.next({errors:e?n.errors:{}})},unregister:I,setError:R,setFocus:(e,t={})=>{const r=Jd(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&Xd(e.select)&&e.select()})}},getFieldState:T};return{...W,formControl:W}}function cp(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,s]=t.useState({isDirty:!1,isValidating:!1,isLoading:Xd(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:Xd(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!Xd(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=op(e);r.current={...n,formState:a}}const i=r.current.control;return i._options=e,vu(()=>{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(()=>bu(a,i),[i,a]),r.current}const lp=(e,t,r)=>{if(e&&"reportValidity"in e){const n=Jd(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},dp=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?lp(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>lp(t,r,e))}},up=(e,t)=>{t.shouldUseNativeValidation&&dp(e,t);const r={};for(const n in e){const a=Jd(t.fields,n),s=Object.assign(e[n]||{},{ref:a&&a.ref});if(pp(t.names||Object.keys(e),n)){const e=Object.assign({},Jd(r,n));Qd(e,"root",s),Qd(r,n,e)}else Qd(r,n,s)}return r},pp=(e,t)=>{const r=mp(t);return e.some(e=>mp(e).match(`^${r}\\.\\d+`))};function mp(e){return e.replace(/\]|\[/g,"")}function hp(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 fp extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class gp extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const bp={};function vp(e){return bp}function yp(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 xp(e,t){return"bigint"==typeof t?t.toString():t}function wp(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Sp(e){return null==e}function kp(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const Cp=Symbol("evaluating");function Ep(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Cp)return void 0===n&&(n=Cp,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Np(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Ap(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function jp(e){return JSON.stringify(e)}const _p="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Pp(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Tp=wp(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Rp(e){if(!1===Pp(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!==Pp(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Dp(e){return Rp(e)?{...e}:Array.isArray(e)?[...e]:e}const Ip=new Set(["string","number","symbol"]);function Mp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Up(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function Lp(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 Op(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 zp(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function Fp(e){return"string"==typeof e?e:e?.message}function Bp(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=Fp(e.inst?._zod.def?.error?.(e))??Fp(t?.error?.(e))??Fp(r.customError?.(e))??Fp(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Wp(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function Vp(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const Gp=(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,xp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Hp=hp("$ZodError",Gp),$p=hp("$ZodError",Gp,{Parent:Error});const Kp=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 fp;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>Bp(e,s,vp())));throw _p(t,a?.callee),t}return i.value},qp=Kp($p),Zp=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=>Bp(e,s,vp())));throw _p(t,a?.callee),t}return i.value},Jp=Zp($p),Yp=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 fp;return s.issues.length?{success:!1,error:new(e??Hp)(s.issues.map(e=>Bp(e,a,vp())))}:{success:!0,data:s.value}},Xp=Yp($p),Qp=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=>Bp(e,a,vp())))}:{success:!0,data:s.value}},em=Qp($p),tm=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Kp(e)(t,r,a)},rm=e=>(t,r,n)=>Kp(e)(t,r,n),nm=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Zp(e)(t,r,a)},am=e=>async(t,r,n)=>Zp(e)(t,r,n),sm=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Yp(e)(t,r,a)},im=e=>(t,r,n)=>Yp(e)(t,r,n),om=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Qp(e)(t,r,a)},cm=e=>async(t,r,n)=>Qp(e)(t,r,n),lm=/^[cC][^\s-]{8,}$/,dm=/^[0-9a-z]+$/,um=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pm=/^[0-9a-vA-V]{20}$/,mm=/^[A-Za-z0-9]{27}$/,hm=/^[a-zA-Z0-9_-]{21}$/,fm=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gm=/^([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})$/,bm=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)$/,vm=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const ym=/^(?:(?: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])$/,xm=/^(([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}|:))$/,wm=/^((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])$/,Sm=/^(([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])$/,km=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Cm=/^[A-Za-z0-9_-]*$/,Em=/^\+[1-9]\d{6,14}$/,Nm="(?:(?:\\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])))",Am=new RegExp(`^${Nm}$`);function jm(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 _m=/^[^A-Z]*$/,Pm=/^[^a-z]*$/,Tm=hp("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Rm=hp("$ZodCheckMaxLength",(e,t)=>{var r;Tm.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Sp(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=Wp(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Dm=hp("$ZodCheckMinLength",(e,t)=>{var r;Tm.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Sp(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=Wp(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Im=hp("$ZodCheckLengthEquals",(e,t)=>{var r;Tm.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Sp(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=Wp(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})}}),Mm=hp("$ZodCheckStringFormat",(e,t)=>{var r,n;Tm.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=()=>{})}),Um=hp("$ZodCheckRegex",(e,t)=>{Mm.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})}}),Lm=hp("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=_m),Mm.init(e,t)}),Om=hp("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Pm),Mm.init(e,t)}),zm=hp("$ZodCheckIncludes",(e,t)=>{Tm.init(e,t);const r=Mp(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})}}),Fm=hp("$ZodCheckStartsWith",(e,t)=>{Tm.init(e,t);const r=new RegExp(`^${Mp(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})}}),Bm=hp("$ZodCheckEndsWith",(e,t)=>{Tm.init(e,t);const r=new RegExp(`.*${Mp(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})}}),Wm=hp("$ZodCheckOverwrite",(e,t)=>{Tm.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Vm{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 Gm={major:4,minor:3,patch:6},Hm=hp("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Gm;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=Op(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 fp;if(n||i instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(a||(a=Op(e,t)))});else{if(e.issues.length===t)continue;a||(a=Op(e,t))}}return n?n.then(()=>e):e},r=(r,a,s)=>{if(Op(r))return r.aborted=!0,r;const i=t(a,n,s);if(i instanceof Promise){if(!1===s.async)throw new fp;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 fp;return i.then(e=>t(e,n,s))}return t(i,n,s)}}Ep(e,"~standard",()=>({validate:t=>{try{const r=Xp(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return em(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),$m=hp("$ZodString",(e,t)=>{var r;Hm.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}}),Km=hp("$ZodStringFormat",(e,t)=>{Mm.init(e,t),$m.init(e,t)}),qm=hp("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=gm),Km.init(e,t)}),Zm=hp("$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=bm(e))}else t.pattern??(t.pattern=bm());Km.init(e,t)}),Jm=hp("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=vm),Km.init(e,t)}),Ym=hp("$ZodURL",(e,t)=>{Km.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})}}}),Xm=hp("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Km.init(e,t)}),Qm=hp("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hm),Km.init(e,t)}),eh=hp("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=lm),Km.init(e,t)}),th=hp("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=dm),Km.init(e,t)}),rh=hp("$ZodULID",(e,t)=>{t.pattern??(t.pattern=um),Km.init(e,t)}),nh=hp("$ZodXID",(e,t)=>{t.pattern??(t.pattern=pm),Km.init(e,t)}),ah=hp("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=mm),Km.init(e,t)}),sh=hp("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=jm({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(`^${Nm}T(?:${n})$`)}(t)),Km.init(e,t)}),ih=hp("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Am),Km.init(e,t)}),oh=hp("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${jm(t)}$`)),Km.init(e,t)}),ch=hp("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=fm),Km.init(e,t)}),lh=hp("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ym),Km.init(e,t),e._zod.bag.format="ipv4"}),dh=hp("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xm),Km.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})}}}),uh=hp("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=wm),Km.init(e,t)}),ph=hp("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Sm),Km.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 mh(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const hh=hp("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=km),Km.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{mh(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const fh=hp("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Cm),Km.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{(function(e){if(!Cm.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return mh(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})}}),gh=hp("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Em),Km.init(e,t)});const bh=hp("$ZodJWT",(e,t)=>{Km.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})}}),vh=hp("$ZodUnknown",(e,t)=>{Hm.init(e,t),e._zod.parse=e=>e}),yh=hp("$ZodNever",(e,t)=>{Hm.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function xh(e,t,r){e.issues.length&&t.issues.push(...zp(r,e.issues)),t.value[r]=e.value}const wh=hp("$ZodArray",(e,t)=>{Hm.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=>xh(t,r,e))):xh(o,r,e)}return s.length?Promise.all(s).then(()=>r):r}});function Sh(e,t,r,n,a){if(e.issues.length){if(a&&!(r in n))return;t.issues.push(...zp(r,e.issues))}void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function kh(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 Ch(e,t,r,n,a,s){const i=[],o=a.keySet,c=a.catchall._zod,l=c.def.type,d="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=>Sh(e,r,a,t,d))):Sh(s,r,a,t,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const Eh=hp("$ZodObject",(e,t)=>{Hm.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=wp(()=>kh(t));Ep(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=Pp,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=>Sh(r,t,e,o,a))):Sh(s,t,e,o,a)}return s?Ch(c,o,t,r,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Nh=hp("$ZodObjectJIT",(e,t)=>{Eh.init(e,t);const r=e._zod.parse,n=wp(()=>kh(t));let a;const s=Pp,i=!bp.jitless,o=i&&Tp.value,c=t.catchall;let l;e._zod.parse=(d,u)=>{l??(l=n.value);const p=d.value;return s(p)?i&&o&&!1===u?.async&&!0!==u.jitless?(a||(a=(e=>{const t=new Vm(["shape","payload","ctx"]),r=n.value,a=e=>{const t=jp(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=jp(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)),d=a(d,u),c?Ch([],p,d,u,l,e):d):r(d,u):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function Ah(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=>!Op(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=>Bp(e,n,vp())))}),t)}const jh=hp("$ZodUnion",(e,t)=>{Hm.init(e,t),Ep(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Ep(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Ep(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ep(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=>kp(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=>Ah(t,a,e,s)):Ah(o,a,e,s)}}),_h=hp("$ZodIntersection",(e,t)=>{Hm.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])=>Th(e,t,r)):Th(e,a,s)}});function Ph(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(Rp(e)&&Rp(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=Ph(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=Ph(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 Th(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}),Op(e))return e;const i=Ph(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 Rh=hp("$ZodEnum",(e,t)=>{Hm.init(e,t);const r=yp(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>Ip.has(typeof e)).map(e=>"string"==typeof e?Mp(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}}),Dh=hp("$ZodTransform",(e,t)=>{Hm.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new gp(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 fp;return r.value=a,r}});function Ih(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Mh=hp("$ZodOptional",(e,t)=>{Hm.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ep(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ep(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${kp(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=>Ih(t,e.value)):Ih(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),Uh=hp("$ZodExactOptional",(e,t)=>{Mh.init(e,t),Ep(e._zod,"values",()=>t.innerType._zod.values),Ep(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),Lh=hp("$ZodNullable",(e,t)=>{Hm.init(e,t),Ep(e._zod,"optin",()=>t.innerType._zod.optin),Ep(e._zod,"optout",()=>t.innerType._zod.optout),Ep(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${kp(e.source)}|null)$`):void 0}),Ep(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)}),Oh=hp("$ZodDefault",(e,t)=>{Hm.init(e,t),e._zod.optin="optional",Ep(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=>zh(e,t)):zh(n,t)}});function zh(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Fh=hp("$ZodPrefault",(e,t)=>{Hm.init(e,t),e._zod.optin="optional",Ep(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))}),Bh=hp("$ZodNonOptional",(e,t)=>{Hm.init(e,t),Ep(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=>Wh(t,e)):Wh(a,e)}});function Wh(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 Vh=hp("$ZodCatch",(e,t)=>{Hm.init(e,t),Ep(e._zod,"optin",()=>t.innerType._zod.optin),Ep(e._zod,"optout",()=>t.innerType._zod.optout),Ep(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=>Bp(e,r,vp()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>Bp(e,r,vp()))},input:e.value}),e.issues=[]),e)}}),Gh=hp("$ZodPipe",(e,t)=>{Hm.init(e,t),Ep(e._zod,"values",()=>t.in._zod.values),Ep(e._zod,"optin",()=>t.in._zod.optin),Ep(e._zod,"optout",()=>t.out._zod.optout),Ep(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=>Hh(e,t.in,r)):Hh(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>Hh(e,t.out,r)):Hh(n,t.out,r)}});function Hh(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const $h=hp("$ZodReadonly",(e,t)=>{Hm.init(e,t),Ep(e._zod,"propValues",()=>t.innerType._zod.propValues),Ep(e._zod,"values",()=>t.innerType._zod.values),Ep(e._zod,"optin",()=>t.innerType?._zod?.optin),Ep(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(Kh):Kh(n)}});function Kh(e){return e.value=Object.freeze(e.value),e}const qh=hp("$ZodCustom",(e,t)=>{Tm.init(e,t),Hm.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=>Zh(t,r,n,e));Zh(a,r,n,e)}});function Zh(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(Vp(e))}}var Jh;class Yh{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)}}(Jh=globalThis).__zod_globalRegistry??(Jh.__zod_globalRegistry=new Yh);const Xh=globalThis.__zod_globalRegistry;function Qh(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Lp(t)})}function ef(e,t){return new Rm({check:"max_length",...Lp(t),maximum:e})}function tf(e,t){return new Dm({check:"min_length",...Lp(t),minimum:e})}function rf(e,t){return new Im({check:"length_equals",...Lp(t),length:e})}function nf(e){return new Wm({check:"overwrite",tx:e})}function af(e){const t=function(e,t){const r=new Tm({check:"custom",...Lp(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(Vp(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(Vp(n))}},e(r.value,r)));return t}function sf(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??Xh,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 of(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),of(s,t,n),t.seen.get(s).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(i.schema,c),"input"===t.io&&df(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 cf(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 lf(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:uf(t,"input",e.processors),output:uf(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw new Error("Error converting schema to JSON.")}}function df(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 df(n.element,r);if("set"===n.type)return df(n.valueType,r);if("lazy"===n.type)return df(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 df(n.innerType,r);if("intersection"===n.type)return df(n.left,r)||df(n.right,r);if("record"===n.type||"map"===n.type)return df(n.keyType,r)||df(n.valueType,r);if("pipe"===n.type)return df(n.in,r)||df(n.out,r);if("object"===n.type){for(const e in n.shape)if(df(n.shape[e],r))return!0;return!1}if("union"===n.type){for(const e of n.options)if(df(e,r))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if(df(e,r))return!0;return!(!n.rest||!df(n.rest,r))}return!1}const uf=(e,t,r={})=>n=>{const{libraryOptions:a,target:s}=n??{},i=sf({...a??{},target:s,io:t,processors:r});return of(e,i),cf(i,e),lf(i,e)},pf={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},mf=(e,t,r,n)=>{const a=e._zod.def;of(a.innerType,t,n);t.seen.get(e).ref=a.innerType};function hf(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function ff(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]=Au(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function gf(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]=Au(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function bf(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(hf(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return s.shouldUseNativeValidation&&dp({},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:up(ff(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(hf(function(){return Promise.resolve(("sync"===r.mode?qp:Jp)(e,n,t)).then(function(e){return s.shouldUseNativeValidation&&dp({},s),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof Hp}(e))return{values:{},errors:up(gf(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 vf=hp("ZodISODateTime",(e,t)=>{sh.init(e,t),Vf.init(e,t)});function yf(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Lp(t)})}(vf,e)}const xf=hp("ZodISODate",(e,t)=>{ih.init(e,t),Vf.init(e,t)});function wf(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Lp(t)})}(xf,e)}const Sf=hp("ZodISOTime",(e,t)=>{oh.init(e,t),Vf.init(e,t)});function kf(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Lp(t)})}(Sf,e)}const Cf=hp("ZodISODuration",(e,t)=>{ch.init(e,t),Vf.init(e,t)});function Ef(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Lp(t)})}(Cf,e)}const Nf=hp("ZodError",(e,t)=>{Hp.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,xp,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,xp,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Af=Kp(Nf),jf=Zp(Nf),_f=Yp(Nf),Pf=Qp(Nf),Tf=tm(Nf),Rf=rm(Nf),Df=nm(Nf),If=am(Nf),Mf=sm(Nf),Uf=im(Nf),Lf=om(Nf),Of=cm(Nf),zf=hp("ZodType",(e,t)=>(Hm.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:uf(e,"input"),output:uf(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{const n=sf({...r,processors:t});return of(e,n),cf(n,e),lf(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Ap(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)=>Up(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>Af(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>_f(e,t,r),e.parseAsync=async(t,r)=>jf(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>Pf(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Tf(e,t,r),e.decode=(t,r)=>Rf(e,t,r),e.encodeAsync=async(t,r)=>Df(e,t,r),e.decodeAsync=async(t,r)=>If(e,t,r),e.safeEncode=(t,r)=>Mf(e,t,r),e.safeDecode=(t,r)=>Uf(e,t,r),e.safeEncodeAsync=async(t,r)=>Lf(e,t,r),e.safeDecodeAsync=async(t,r)=>Of(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,...Lp(r)})}(Rg,e,t)}(t,r)),e.superRefine=t=>e.check(af(t)),e.overwrite=t=>e.check(nf(t)),e.optional=()=>wg(e),e.exactOptional=()=>new Sg({type:"optional",innerType:e}),e.nullable=()=>Cg(e),e.nullish=()=>wg(Cg(e)),e.nonoptional=t=>function(e,t){return new Ag({type:"nonoptional",innerType:e,...Lp(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...Lp(r)})}(mg,e,t);var t},e.or=t=>function(e,t){return new gg({type:"union",options:e,...Lp(t)})}([e,t]),e.and=t=>new bg({type:"intersection",left:e,right:t}),e.transform=t=>Pg(e,new yg({type:"transform",transform:t})),e.default=t=>{return r=t,new Eg({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():Dp(r)}});var r},e.prefault=t=>{return r=t,new Ng({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():Dp(r)}});var r},e.catch=t=>{return new jg({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>Pg(e,t),e.readonly=()=>new Tg({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return Xh.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>Xh.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return Xh.get(e);const r=e.clone();return Xh.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Ff=hp("_ZodString",(e,t)=>{$m.init(e,t),zf.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=pf[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 Um({check:"string_format",format:"regex",...Lp(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new zm({check:"string_format",format:"includes",...Lp(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Fm({check:"string_format",format:"starts_with",...Lp(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Bm({check:"string_format",format:"ends_with",...Lp(t),suffix:e})}(...t)),e.min=(...t)=>e.check(tf(...t)),e.max=(...t)=>e.check(ef(...t)),e.length=(...t)=>e.check(rf(...t)),e.nonempty=(...t)=>e.check(tf(1,...t)),e.lowercase=t=>e.check(function(e){return new Lm({check:"string_format",format:"lowercase",...Lp(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Om({check:"string_format",format:"uppercase",...Lp(e)})}(t)),e.trim=()=>e.check(nf(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return nf(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(nf(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(nf(e=>e.toUpperCase())),e.slugify=()=>e.check(nf(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),Bf=hp("ZodString",(e,t)=>{$m.init(e,t),Ff.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Lp(t)})}(Gf,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Lp(t)})}(Kf,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Lp(t)})}(cg,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Lp(t)})}(qf,t)),e.guid=t=>e.check(Qh(Hf,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Lp(t)})}($f,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Lp(t)})}($f,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Lp(t)})}($f,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Lp(t)})}($f,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Lp(t)})}(Zf,t)),e.guid=t=>e.check(Qh(Hf,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Lp(t)})}(Jf,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Lp(t)})}(Yf,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Lp(t)})}(Xf,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Lp(t)})}(sg,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Lp(t)})}(ig,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Lp(t)})}(Qf,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Lp(t)})}(eg,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Lp(t)})}(tg,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Lp(t)})}(rg,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Lp(t)})}(ng,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Lp(t)})}(ag,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Lp(t)})}(og,t)),e.datetime=t=>e.check(yf(t)),e.date=t=>e.check(wf(t)),e.time=t=>e.check(kf(t)),e.duration=t=>e.check(Ef(t))});function Wf(e){return function(e,t){return new e({type:"string",...Lp(t)})}(Bf,e)}const Vf=hp("ZodStringFormat",(e,t)=>{Km.init(e,t),Ff.init(e,t)}),Gf=hp("ZodEmail",(e,t)=>{Jm.init(e,t),Vf.init(e,t)}),Hf=hp("ZodGUID",(e,t)=>{qm.init(e,t),Vf.init(e,t)}),$f=hp("ZodUUID",(e,t)=>{Zm.init(e,t),Vf.init(e,t)}),Kf=hp("ZodURL",(e,t)=>{Ym.init(e,t),Vf.init(e,t)}),qf=hp("ZodEmoji",(e,t)=>{Xm.init(e,t),Vf.init(e,t)}),Zf=hp("ZodNanoID",(e,t)=>{Qm.init(e,t),Vf.init(e,t)}),Jf=hp("ZodCUID",(e,t)=>{eh.init(e,t),Vf.init(e,t)}),Yf=hp("ZodCUID2",(e,t)=>{th.init(e,t),Vf.init(e,t)}),Xf=hp("ZodULID",(e,t)=>{rh.init(e,t),Vf.init(e,t)}),Qf=hp("ZodXID",(e,t)=>{nh.init(e,t),Vf.init(e,t)}),eg=hp("ZodKSUID",(e,t)=>{ah.init(e,t),Vf.init(e,t)}),tg=hp("ZodIPv4",(e,t)=>{lh.init(e,t),Vf.init(e,t)}),rg=hp("ZodIPv6",(e,t)=>{dh.init(e,t),Vf.init(e,t)}),ng=hp("ZodCIDRv4",(e,t)=>{uh.init(e,t),Vf.init(e,t)}),ag=hp("ZodCIDRv6",(e,t)=>{ph.init(e,t),Vf.init(e,t)}),sg=hp("ZodBase64",(e,t)=>{hh.init(e,t),Vf.init(e,t)}),ig=hp("ZodBase64URL",(e,t)=>{fh.init(e,t),Vf.init(e,t)}),og=hp("ZodE164",(e,t)=>{gh.init(e,t),Vf.init(e,t)}),cg=hp("ZodJWT",(e,t)=>{bh.init(e,t),Vf.init(e,t)}),lg=hp("ZodUnknown",(e,t)=>{vh.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function dg(){return new lg({type:"unknown"})}const ug=hp("ZodNever",(e,t)=>{yh.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r)=>{r.not={}})(0,0,t)});function pg(e){return function(e,t){return new e({type:"never",...Lp(t)})}(ug,e)}const mg=hp("ZodArray",(e,t)=>{wh.init(e,t),zf.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=of(s.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(tf(t,r)),e.nonempty=t=>e.check(tf(1,t)),e.max=(t,r)=>e.check(ef(t,r)),e.length=(t,r)=>e.check(rf(t,r)),e.unwrap=()=>e.element});const hg=hp("ZodObject",(e,t)=>{Nh.init(e,t),zf.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]=of(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=of(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(a.additionalProperties=!1)})(e,t,r,n),Ep(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new vg({type:"enum",entries:r,...Lp(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:dg()}),e.loose=()=>e.clone({...e._zod.def,catchall:dg()}),e.strict=()=>e.clone({...e._zod.def,catchall:pg()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Rp(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=Ap(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Np(this,"shape",r),r}});return Up(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!Rp(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Ap(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Np(this,"shape",r),r}});return Up(e,r)}(e,t),e.merge=t=>function(e,t){const r=Ap(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Np(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Up(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 Up(e,Ap(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 Np(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=Ap(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 Np(this,"shape",n),n},checks:[]});return Up(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=Ap(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 Np(this,"shape",a),a},checks:[]});return Up(t,a)}(xg,e,t[0]),e.required=(...t)=>function(e,t,r){const n=Ap(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 Np(this,"shape",a),a}});return Up(t,n)}(Ag,e,t[0])});function fg(e,t){const r={type:"object",shape:e??{},...Lp(t)};return new hg(r)}const gg=hp("ZodUnion",(e,t)=>{jh.init(e,t),zf.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)=>of(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 bg=hp("ZodIntersection",(e,t)=>{_h.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=of(a.left,t,{...n,path:[...n.path,"allOf",0]}),i=of(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 vg=hp("ZodEnum",(e,t)=>{Rh.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=yp(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 vg({...t,checks:[],...Lp(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 vg({...t,checks:[],...Lp(n),entries:a})}});const yg=hp("ZodTransform",(e,t)=>{Dh.init(e,t),zf.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 gp(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(Vp(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(Vp(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const xg=hp("ZodOptional",(e,t)=>{Mh.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>mf(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function wg(e){return new xg({type:"optional",innerType:e})}const Sg=hp("ZodExactOptional",(e,t)=>{Uh.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>mf(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const kg=hp("ZodNullable",(e,t)=>{Lh.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=of(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 Cg(e){return new kg({type:"nullable",innerType:e})}const Eg=hp("ZodDefault",(e,t)=>{Oh.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;of(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 Ng=hp("ZodPrefault",(e,t)=>{Fh.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;of(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 Ag=hp("ZodNonOptional",(e,t)=>{Bh.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;of(a.innerType,t,n),t.seen.get(e).ref=a.innerType})(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const jg=hp("ZodCatch",(e,t)=>{Vh.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;let s;of(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 _g=hp("ZodPipe",(e,t)=>{Gh.init(e,t),zf.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;of(s,t,n),t.seen.get(e).ref=s})(e,t,0,n),e.in=t.in,e.out=t.out});function Pg(e,t){return new _g({type:"pipe",in:e,out:t})}const Tg=hp("ZodReadonly",(e,t)=>{$h.init(e,t),zf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;of(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 Rg=hp("ZodCustom",(e,t)=>{qh.init(e,t),zf.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)});var Dg=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ui(`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}},{}),Ig=a.forwardRef((t,r)=>e.jsx(Dg.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));Ig.displayName="Label";var Mg=Ig;const Ug=vi("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Lg=a.forwardRef(({className:t,...r},n)=>e.jsx(Mg,{ref:n,className:Se(Ug(),t),...r}));Lg.displayName=Mg.displayName;const Og=Nu,zg=a.createContext({}),Fg=({...t})=>e.jsx(zg.Provider,{value:{name:t.name},children:e.jsx(Cu,{...t})}),Bg=()=>{const e=a.useContext(zg),r=a.useContext(Wg),{getFieldState:n,formState:s}=t.useContext(Eu),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}},Wg=a.createContext({}),Vg=a.forwardRef(({className:t,...r},n)=>{const s=a.useId();return e.jsx(Wg.Provider,{value:{id:s},children:e.jsx("div",{ref:n,className:Se("space-y-2",t),...r})})});Vg.displayName="FormItem";const Gg=a.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:s}=Bg();return e.jsx(Lg,{ref:n,className:Se(a&&"text-destructive",t),htmlFor:s,...r})});Gg.displayName="FormLabel";const Hg=a.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:s,formMessageId:i}=Bg();return e.jsx(pi,{ref:r,id:a,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});Hg.displayName="FormControl";const $g=a.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=Bg();return e.jsx("p",{ref:n,id:a,className:Se("text-sm text-muted-foreground",t),...r})});$g.displayName="FormDescription";const Kg=a.forwardRef(({className:t,children:r,...n},a)=>{const{error:s,formMessageId:i}=Bg(),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});Kg.displayName="FormMessage";const qg=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 Zg(t){const r=Jg(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Xg);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 Jg(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?ii(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}qg.displayName="Input";var Yg=Symbol("radix.slottable");function Xg(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Yg}function Qg(r){const n=r+"CollectionProvider",[a,s]=Si(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",d=Zg(l),u=t.forwardRef((t,r)=>{const{scope:n,children:a}=t,s=oi(r,o(l,n).collectionRef);return e.jsx(d,{ref:s,children:a})});u.displayName=l;const p=r+"CollectionItemSlot",m="data-radix-collection-item",h=Zg(p),f=t.forwardRef((r,n)=>{const{scope:a,children:s,...i}=r,c=t.useRef(null),l=oi(n,c),d=o(p,a);return t.useEffect(()=>(d.itemMap.set(c,{ref:c,...i}),()=>{d.itemMap.delete(c)})),e.jsx(h,{[m]:"",ref:l,children:s})});return f.displayName=p,[{Provider:c,Slot:u,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 eb=a.createContext(void 0);function tb(e){const t=a.useContext(eb);return e||t||"ltr"}var rb="rovingFocusGroup.onEntryFocus",nb={bubbles:!1,cancelable:!0},ab="RovingFocusGroup",[sb,ib,ob]=Qg(ab),[cb,lb]=Si(ab,[ob]),[db,ub]=cb(ab),pb=a.forwardRef((t,r)=>e.jsx(sb.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(sb.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(mb,{...t,ref:r})})}));pb.displayName=ab;var mb=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...m}=t,h=a.useRef(null),f=oi(r,h),g=tb(o),[b,v]=_i({prop:c,defaultProp:l??null,onChange:d,caller:ab}),[y,x]=a.useState(!1),w=Ii(u),S=ib(n),k=a.useRef(!1),[C,E]=a.useState(0);return a.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(rb,w),()=>e.removeEventListener(rb,w)},[w]),e.jsx(db,{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(()=>E(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>E(e=>e-1),[]),children:e.jsx(Di.div,{tabIndex:y||0===C?-1:0,"data-orientation":s,...m,ref:f,style:{outline:"none",...t.style},onMouseDown:wi(t.onMouseDown,()=>{k.current=!0}),onFocus:wi(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(rb,nb);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);bb([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}k.current=!1}),onBlur:wi(t.onBlur,()=>x(!1))})})}),hb="RovingFocusGroupItem",fb=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:o,children:c,...l}=t,d=Ai(),u=o||d,p=ub(hb,n),m=p.currentTabStopId===u,h=ib(n),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:b}=p;return a.useEffect(()=>{if(s)return f(),()=>g()},[s,f,g]),e.jsx(sb.ItemSlot,{scope:n,id:u,focusable:s,active:i,children:e.jsx(Di.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:r,onMouseDown:wi(t.onMouseDown,e=>{s?p.onItemFocus(u):e.preventDefault()}),onFocus:wi(t.onFocus,()=>p.onItemFocus(u)),onKeyDown:wi(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:gb[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(()=>bb(r))}}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=b}):c})})});fb.displayName=hb;var gb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function bb(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 vb=pb,yb=fb,xb="Radio",[wb,Sb]=Si(xb),[kb,Cb]=wb(xb),Eb=a.forwardRef((t,r)=>{const{__scopeRadio:n,name:s,checked:i=!1,required:o,disabled:c,value:l="on",onCheck:d,form:u,...p}=t,[m,h]=a.useState(null),f=oi(r,e=>h(e)),g=a.useRef(!1),b=!m||(u||!!m.closest("form"));return e.jsxs(kb,{scope:n,checked:i,disabled:c,children:[e.jsx(Di.button,{type:"button",role:"radio","aria-checked":i,"data-state":_b(i),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:f,onClick:wi(t.onClick,e=>{i||d?.(),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&e.jsx(jb,{control:m,bubbles:!g.current,name:s,value:l,checked:i,required:o,disabled:c,form:u,style:{transform:"translateX(-100%)"}})]})});Eb.displayName=xb;var Nb="RadioIndicator",Ab=a.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...s}=t,i=Cb(Nb,n);return e.jsx(eo,{present:a||i.checked,children:e.jsx(Di.span,{"data-state":_b(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:r})})});Ab.displayName=Nb;var jb=a.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=oi(c,o),d=wd(n),u=Sd(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[d,n,s]),e.jsx(Di.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function _b(e){return e?"checked":"unchecked"}jb.displayName="RadioBubbleInput";var Pb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Tb="RadioGroup",[Rb]=Si(Tb,[lb,Sb]),Db=lb(),Ib=Sb(),[Mb,Ub]=Rb(Tb),Lb=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:s,value:i,required:o=!1,disabled:c=!1,orientation:l,dir:d,loop:u=!0,onValueChange:p,...m}=t,h=Db(n),f=tb(d),[g,b]=_i({prop:i,defaultProp:s??null,onChange:p,caller:Tb});return e.jsx(Mb,{scope:n,name:a,required:o,disabled:c,value:g,onValueChange:b,children:e.jsx(vb,{asChild:!0,...h,orientation:l,dir:f,loop:u,children:e.jsx(Di.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:f,...m,ref:r})})})});Lb.displayName=Tb;var Ob="RadioGroupItem",zb=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:s,...i}=t,o=Ub(Ob,n),c=o.disabled||s,l=Db(n),d=Ib(n),u=a.useRef(null),p=oi(r,u),m=o.value===i.value,h=a.useRef(!1);return a.useEffect(()=>{const e=e=>{Pb.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(yb,{asChild:!0,...l,focusable:!c,active:m,children:e.jsx(Eb,{disabled:c,required:o.required,checked:m,...d,...i,name:o.name,ref:p,onCheck:()=>o.onValueChange(i.value),onKeyDown:wi(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:wi(i.onFocus,()=>{h.current&&u.current?.click()})})})});zb.displayName=Ob;var Fb=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,s=Ib(n);return e.jsx(Ab,{...s,...a,ref:r})});Fb.displayName="RadioGroupIndicator";var Bb=Lb,Wb=zb,Vb=Fb;const Gb=a.forwardRef(({className:t,...r},n)=>e.jsx(Bb,{className:Se("grid gap-2",t),...r,ref:n}));Gb.displayName=Bb.displayName;const Hb=a.forwardRef(({className:t,...r},n)=>e.jsx(Wb,{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(Vb,{className:"flex items-center justify-center",children:e.jsx(qc,{className:"h-3.5 w-3.5 fill-primary"})})}));function $b(e,[t,r]){return Math.min(r,Math.max(t,e))}Hb.displayName=Wb.displayName;var Kb="ScrollArea",[qb]=Si(Kb),[Zb,Jb]=qb(Kb),Yb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,type:s="hover",dir:i,scrollHideDelay:o=600,...c}=t,[l,d]=a.useState(null),[u,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,C]=a.useState(!1),[E,N]=a.useState(!1),A=oi(r,e=>d(e)),j=tb(i);return e.jsx(Zb,{scope:n,type:s,dir:j,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:p,content:m,onContentChange:h,scrollbarX:f,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:C,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:E,onScrollbarYEnabledChange:N,onCornerWidthChange:x,onCornerHeightChange:S,children:e.jsx(Di.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}})})});Yb.displayName=Kb;var Xb="ScrollAreaViewport",Qb=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:s,nonce:i,...o}=t,c=Jb(Xb,n),l=oi(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(Di.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})})]})});Qb.displayName=Xb;var ev="ScrollAreaScrollbar",tv=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Jb(ev,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(rv,{...s,ref:r,forceMount:n}):"scroll"===i.type?e.jsx(nv,{...s,ref:r,forceMount:n}):"auto"===i.type?e.jsx(av,{...s,ref:r,forceMount:n}):"always"===i.type?e.jsx(sv,{...s,ref:r}):null});tv.displayName=ev;var rv=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Jb(ev,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(eo,{present:n||o,children:e.jsx(av,{"data-state":o?"visible":"hidden",...s,ref:r})})}),nv=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=Jb(ev,t.__scopeScrollArea),o="horizontal"===t.orientation,c=Cv(()=>d("SCROLL_END"),100),[l,d]=(u="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,u));var u,p;return a.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,i.scrollHideDelay,d]),a.useEffect(()=>{const e=i.viewport,t=o?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(d("SCROLL"),c()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[i.viewport,o,d,c]),e.jsx(eo,{present:n||"hidden"!==l,children:e.jsx(sv,{"data-state":"hidden"===l?"hidden":"visible",...s,ref:r,onPointerEnter:wi(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:wi(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),av=a.forwardRef((t,r)=>{const n=Jb(ev,t.__scopeScrollArea),{forceMount:s,...i}=t,[o,c]=a.useState(!1),l="horizontal"===t.orientation,d=Cv(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;c(l?e:t)}},10);return Ev(n.viewport,d),Ev(n.content,d),e.jsx(eo,{present:s||o,children:e.jsx(sv,{"data-state":o?"visible":"hidden",...i,ref:r})})}),sv=a.forwardRef((t,r)=>{const{orientation:n="vertical",...s}=t,i=Jb(ev,t.__scopeScrollArea),o=a.useRef(null),c=a.useRef(0),[l,d]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=vv(l.viewport,l.content),p={...s,sizes:l,onSizesChange:d,hasThumb:Boolean(u>0&&u<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=yv(r),s=a/2,i=t||s,o=a-i,c=r.scrollbar.paddingStart+i,l=r.scrollbar.size-r.scrollbar.paddingEnd-o,d=r.content-r.viewport,u="ltr"===n?[0,d]:[-1*d,0];return wv([c,l],u)(e)}(e,c.current,l,t)}return"horizontal"===n?e.jsx(iv,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=xv(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(ov,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=xv(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}),iv=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=Jb(ev,t.__scopeScrollArea),[c,l]=a.useState(),d=a.useRef(null),u=oi(r,d,o.onScrollbarXChange);return a.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),e.jsx(dv,{"data-orientation":"horizontal",...i,ref:u,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":yv(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),Sv(n,r)&&e.preventDefault()}},onResize:()=>{d.current&&o.viewport&&c&&s({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:bv(c.paddingLeft),paddingEnd:bv(c.paddingRight)}})}})}),ov=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=Jb(ev,t.__scopeScrollArea),[c,l]=a.useState(),d=a.useRef(null),u=oi(r,d,o.onScrollbarYChange);return a.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),e.jsx(dv,{"data-orientation":"vertical",...i,ref:u,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":yv(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),Sv(n,r)&&e.preventDefault()}},onResize:()=>{d.current&&o.viewport&&c&&s({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:bv(c.paddingTop),paddingEnd:bv(c.paddingBottom)}})}})}),[cv,lv]=qb(ev),dv=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,sizes:s,hasThumb:i,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:p,onResize:m,...h}=t,f=Jb(ev,n),[g,b]=a.useState(null),v=oi(r,e=>b(e)),y=a.useRef(null),x=a.useRef(""),w=f.viewport,S=s.content-s.viewport,k=Ii(p),C=Ii(d),E=Cv(m,10);function N(e){if(y.current){const t=e.clientX-y.current.left,r=e.clientY-y.current.top;u({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(C,[s,C]),Ev(g,E),Ev(f.content,E),e.jsx(cv,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:Ii(o),onThumbPointerUp:Ii(c),onThumbPositionChange:C,onThumbPointerDown:Ii(l),children:e.jsx(Di.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:wi(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:wi(t.onPointerMove,N),onPointerUp:wi(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})})})}),uv="ScrollAreaThumb",pv=a.forwardRef((t,r)=>{const{forceMount:n,...a}=t,s=lv(uv,t.__scopeScrollArea);return e.jsx(eo,{present:n||s.hasThumb,children:e.jsx(mv,{ref:r,...a})})}),mv=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:s,...i}=t,o=Jb(uv,n),c=lv(uv,n),{onThumbPositionChange:l}=c,d=oi(r,e=>c.onThumbChange(e)),u=a.useRef(void 0),p=Cv(()=>{u.current&&(u.current(),u.current=void 0)},100);return a.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(p(),!u.current){const t=kv(e,l);u.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),e.jsx(Di.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:wi(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:wi(t.onPointerUp,c.onThumbPointerUp)})});pv.displayName=uv;var hv="ScrollAreaCorner",fv=a.forwardRef((t,r)=>{const n=Jb(hv,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e.jsx(gv,{...t,ref:r}):null});fv.displayName=hv;var gv=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,...s}=t,i=Jb(hv,n),[o,c]=a.useState(0),[l,d]=a.useState(0),u=Boolean(o&&l);return Ev(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),d(e)}),Ev(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),u?e.jsx(Di.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 bv(e){return e?parseInt(e,10):0}function vv(e,t){const r=e/t;return isNaN(r)?0:r}function yv(e){const t=vv(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function xv(e,t,r="ltr"){const n=yv(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-a,i=t.content-t.viewport,o=s-n,c=$b(e,"ltr"===r?[0,i]:[-1*i,0]);return wv([0,i],[0,o])(c)}function wv(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 Sv(e,t){return e>0&&e<t}var kv=(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 Cv(e,t){const r=Ii(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 Ev(e,t){const r=Ii(t);Ci(()=>{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 Nv=Yb,Av=Qb,jv=fv;const _v=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(Nv,{ref:a,className:Se("relative overflow-hidden",t),...n,children:[e.jsx(Av,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(Pv,{}),e.jsx(jv,{})]}));_v.displayName=Nv.displayName;const Pv=a.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e.jsx(tv,{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(pv,{className:Se("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));function Tv(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>`}Pv.displayName=tv.displayName;const Rv=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑‍💻","👨‍💻","👩‍💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨‍💼","👩‍💼","👨‍🏫","👩‍🏫","👨‍🔬","👩‍🔬","👨‍🎨","👩‍🎨","👨‍🔧","👩‍🔧","👨‍🚀","👩‍🚀","👨‍⚖️","👩‍⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️‍🌈","🎟️","🎫"],Dv=({workspace:r})=>{const{t:n}=ln(),{updateWorkspace:a}=EC(),{can:s}=wl(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[d,u]=t.useState(),p=Md(),m=cp({resolver:bf(fg({name:Wf().min(2,{message:n("general.nameMinLength")}),image:Wf().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx(_l,{});const h=s(gl.WORKSPACE_SETTINGS_EDIT);return e.jsxs("div",{children:[p.message&&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.message})]}),!h&&e.jsx(Al,{descriptionKey:"general.ownerOnly"}),e.jsx(Og,{...m,children:e.jsxs("form",{onSubmit:m.handleSubmit(async function(e){o(!0),p.clear();try{await a(r,e),p.show(n("general.success"))}catch(e){Te(e,{component:"WorkspaceSettingsGeneral",action:"updateWorkspace",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-6",children:[e.jsx(Fg,{control:m.control,name:"name",render:({field:t})=>e.jsxs(Vg,{children:[e.jsx(Gg,{children:n("general.name")}),e.jsx(Hg,{children:e.jsx(qg,{placeholder:n("general.namePlaceholder"),...t,disabled:!h})}),e.jsx(Kg,{})]})}),r.billingCurrency?.trim()&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Lg,{className:"text-sm font-medium text-muted-foreground",children:n("general.billingCurrency")}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[Cl(r.billingCurrency)&&e.jsx("span",{className:"text-base",children:Cl(r.billingCurrency)}),e.jsx("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Lg,{className:"text-sm font-medium",children:n("general.icon")}),e.jsx($g,{children:n("general.iconDescription")})]}),e.jsxs(Gb,{value:c,disabled:!h,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(Hb,{value:"emoji",id:"emoji"}),e.jsxs(Lg,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(Xs,{className:"h-4 w-4"}),n("general.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Hb,{value:"url",id:"url"}),e.jsxs(Lg,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Fs,{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:[d&&e.jsx("span",{className:"text-2xl",children:d}),!d&&m.watch("image")?.trim()&&e.jsx("img",{src:m.watch("image")||void 0,alt:"Workspace preview"})]})]}),h&&e.jsx(_v,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Rv.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{u(e),m.setValue("image",Tv(e))})(t),disabled:!h,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(d===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(Fg,{control:m.control,name:"image",render:({field:t})=>e.jsxs(Vg,{children:[e.jsx(Gg,{children:n("general.imageUrl")}),e.jsx(Hg,{children:e.jsx(qg,{placeholder:n("general.imageUrlPlaceholder"),...t,disabled:!h})}),e.jsx($g,{children:n("general.imageUrlDescription")}),e.jsx(Kg,{})]})}),m.watch("image")&&m.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:m.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:h&&e.jsx(xi,{type:"submit",disabled:i,progress:i,children:n("general.updateWorkspace")})})]})})]})};class Iv extends yn{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 Mv=t.createContext(null);function Uv(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 Lv=t.memo(function({children:r,serviceWorkerPath:n="/push-sw.js",autoSubscribe:a=!1}){const{t:s}=ln(),i=En(),{isAuthenticated:o}=_C(),c=t.useMemo(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=t.useMemo(()=>new Iv({serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}),[i.serverUrl,i.version,i.orgId]),[d,u]=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 u(e=>({...e,isSubscribed:!1}));const r=await t.pushManager.getSubscription();if(e)return;u(e=>({...e,isSubscribed:!!r,permission:Notification.permission}))}catch{e||u(e=>({...e,isSubscribed:!1}))}})(),()=>{e=!0}},[o,c,n]);const p=t.useCallback(async()=>{if(!c)return!1;const e=await Notification.requestPermission();return u(t=>({...t,permission:e})),"granted"===e},[c]),m=t.useCallback(async()=>{if(c&&o){u(e=>({...e,loading:!0,error:null}));try{if(!await p())return void u(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:Uv(e)})).toJSON();await l.subscribe({endpoint:r.endpoint,keys:{p256dh:r.keys.p256dh,auth:r.keys.auth}},navigator.userAgent),u(e=>({...e,isSubscribed:!0,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToSubscribe");u(e=>({...e,loading:!1,error:t})),Te(e,{component:"PushNotificationProvider",action:"subscribe"})}}},[c,o,l,n,p]),h=t.useCallback(async()=>{if(c){u(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)}}u(e=>({...e,isSubscribed:!1,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToUnsubscribe");u(e=>({...e,loading:!1,error:t})),Te(e,{component:"PushNotificationProvider",action:"unsubscribe"})}}},[c,l,n]),f=t.useMemo(()=>({...d,requestPermission:p,subscribe:m,unsubscribe:h}),[d,p,m,h]);return e.jsx(Mv.Provider,{value:f,children:r})});function Ov(){const e=t.useContext(Mv);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}const zv={firefox:4,safari:4,edge:4,chrome:4},Fv=({workspace:r})=>{const{isSupported:n,permission:a,isSubscribed:s,loading:i,error:o,subscribe:c,unsubscribe:l}=Ov(),{t:d}=ln(),{api:u}=jn(),{can:p}=wl(),m=p(gl.WORKSPACE_SETTINGS_EDIT),h=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"}(),[]),f=zv[h],[g,b]=t.useState([]),[v,y]=t.useState(!0),[x,w]=t.useState({}),[S,k]=t.useState(!0),[C,E]=t.useState(null),[N,A]=t.useState(null),j=t.useRef(null);t.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]),t.useEffect(()=>{if(!r?._id)return;const e=r._id.toString();y(!0),k(!0),Promise.all([u.getNotificationEvents(e).catch(()=>[]),u.getNotificationPreferences(e).catch(()=>({}))]).then(([e,t])=>{b(e),w(t)}).finally(()=>{y(!1),k(!1)})},[r?._id]);const _=t.useCallback(async(e,t,n)=>{if(!r?._id||!m)return;const a=!n;E(`${e}.${t}`),A(null),w(r=>({...r,[e]:{...r[e],[t]:a}}));try{const n=await u.updateNotificationPreferences(r._id.toString(),{[e]:{[t]:a}});w(n),A(d("notifications.prefsSaved")),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>A(null),3e3)}catch(r){w(r=>({...r,[e]:{...r[e],[t]:n}})),Te(r,{component:"SettingsNotifications",action:"toggleChannel"})}finally{E(null)}},[r?._id,m,u,d]),P=(e,t)=>!1!==x[e]?.[t],T=t.useMemo(()=>{const e=new Map;for(const t of g){const r=t.category||"general";e.has(r)||e.set(r,[]),e.get(r).push(t)}return Array.from(e.entries())},[g]),R=v||S,D=g.length>0;return e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-sm text-gray-600",children:d("notifications.manageDescription")}),n&&e.jsxs(e.Fragment,{children:[o&&"denied"!==a&&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"===a&&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(qs,{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:d("notifications.blocked")}),e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:d("notifications.blockedDescription")}),e.jsx("ol",{className:"text-xs text-amber-700 mt-2 space-y-1 list-decimal list-inside",children:Array.from({length:f},(t,r)=>e.jsx("li",{children:d(`notifications.unblock.${h}.step${r+1}`)},r))})]})]})}),"denied"!==a&&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(js,{className:"h-4 w-4 text-green-600"}):e.jsx(As,{className:"h-4 w-4 text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900",children:d("notifications.pushTitle")}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:d("notifications.pushDescription",{subscribed:String(s)})})]})]}),e.jsx(xi,{variant:s?"outline":"default",size:"sm",className:"shrink-0",onClick:s?l:c,disabled:i,progress:i,children:d("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:d("notifications.deviceNote")})]})]}),R&&e.jsx("div",{className:"text-center text-sm text-gray-400 py-4",children:d("notifications.loadingPrefs")}),!R&&D&&m&&e.jsxs(e.Fragment,{children:[N&&e.jsx("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg text-sm",children:N}),T.map(([t,r])=>e.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[e.jsx("div",{className:"bg-gray-50 px-4 py-2.5 border-b",children:e.jsx("h4",{className:"text-sm font-medium text-gray-700 capitalize",children:t})}),e.jsxs("div",{className:"divide-y",children:[e.jsxs("div",{className:"flex items-center px-4 py-2 bg-gray-50/50",children:[e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(Ws,{className:"h-3.5 w-3.5 text-gray-400"})}),e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(Ys,{className:"h-3.5 w-3.5 text-gray-400"})})]})]}),r.map(t=>{const r=P(t.slug,"email"),n=P(t.slug,"push"),a=C===`${t.slug}.email`,s=C===`${t.slug}.push`;return e.jsxs("div",{className:"flex items-center px-4 py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:t.description})]}),e.jsxs("div",{className:"flex items-center gap-6 shrink-0",children:[e.jsx("div",{className:"w-12 flex justify-center",children:t.channels.email?e.jsx(Id,{checked:r,onCheckedChange:()=>_(t.slug,"email",r),disabled:a}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})}),e.jsx("div",{className:"w-12 flex justify-center",children:t.channels.push?e.jsx(Id,{checked:n,onCheckedChange:()=>_(t.slug,"push",n),disabled:s}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})})]})]},t.slug)})]})]},t))]})]})},Bv=({workspace:r})=>{const{t:n}=ln(),{isOwner:a}=wl(),{settings:s}=An(),{appPermissions:i}=sa(),{updateWorkspacePermissions:o}=EC(),[c,l]=t.useState(!1),d=Md(),u=t.useMemo(()=>s?.workspace?.roles??r.roles??[],[s?.workspace?.roles,r.roles]),p=t.useMemo(()=>{if(!i)return[];const e=new Set;for(const t of Object.values(i))for(const r of t)r.startsWith("workspace:")||e.add(r);return Array.from(e).sort()},[i]),[m,h]=t.useState({});if(t.useEffect(()=>{if(!i)return;const e=r.permissions,t={};for(const r of u)t[r]=e&&r in e?e[r].filter(e=>!e.startsWith("workspace:")):r in i?i[r].filter(e=>!e.startsWith("workspace:")):[];h(t)},[r.permissions,i,u]),!r)return e.jsx(_l,{});if(!i||0===p.length)return null;return e.jsxs("div",{children:[d.message&&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:d.message})]}),!a&&e.jsx(Al,{descriptionKey:"permissions.ownerOnly"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:n("permissions.description")}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"text-start py-2 pe-4 font-medium text-gray-500 min-w-[160px]"}),u.map(t=>e.jsx("th",{className:"text-center py-2 px-3 font-medium text-gray-700 capitalize min-w-[80px]",children:t},t))]})}),e.jsx("tbody",{children:p.map(t=>e.jsxs("tr",{className:"border-b border-gray-50 hover:bg-gray-50/50",children:[e.jsx("td",{className:"py-2 pe-4 text-gray-700 font-mono text-xs",children:t}),u.map(r=>{const n="admin"===r,s=n||(m[r]??[]).includes(t);return e.jsx("td",{className:"text-center py-2 px-3",children:e.jsx(Id,{checked:s,disabled:!a||n,onCheckedChange:()=>((e,t)=>{h(r=>{const n=r[e]??[],a=n.includes(t);return{...r,[e]:a?n.filter(e=>e!==t):[...n,t]}})})(r,t),className:"mx-auto"})},r)})]},t))})]})}),a&&e.jsx("div",{className:"mt-6",children:e.jsx(xi,{onClick:async()=>{l(!0),d.clear();try{const e=r.permissions??{},t={},a=new Set([...Object.keys(e),...Object.keys(m)]);for(const r of a){const n=(e[r]??[]).filter(e=>e.startsWith("workspace:")),a=m[r]??[];t[r]=[...n,...a]}await o(r._id,t),d.show(n("permissions.saveSuccess"))}catch(e){Te(e,{component:"WorkspaceSettingsPermissions",action:"savePermissions",metadata:{workspaceId:r._id}})}finally{l(!1)}},disabled:c,progress:c,children:n(c?"permissions.saving":"permissions.save")})})]})};var Wv=.999,Vv=/[\\\/_+.#"@\[\(\{&]/,Gv=/[\\\/_+.#"@\[\(\{&]/g,Hv=/[\s-]/,$v=/[\s-]/g;function Kv(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,d,u,p=n.charAt(s),m=r.indexOf(p,a),h=0;m>=0;)(c=Kv(e,t,r,n,m+1,s+1,i))>h&&(m===a?c*=1:Vv.test(e.charAt(m-1))?(c*=.8,(d=e.slice(a,m-1).match(Gv))&&a>0&&(c*=Math.pow(Wv,d.length))):Hv.test(e.charAt(m-1))?(c*=.9,(u=e.slice(a,m-1).match($v))&&a>0&&(c*=Math.pow(Wv,u.length))):(c*=.17,a>0&&(c*=Math.pow(Wv,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=Kv(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 qv(e){return e.toLowerCase().replace($v," ")}function Zv(e,t,r){return Kv(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,qv(e),qv(t),0,0,{})}var Jv='[cmdk-group=""]',Yv='[cmdk-group-items=""]',Xv='[cmdk-item=""]',Qv=`${Xv}:not([aria-disabled="true"])`,ey="cmdk-item-select",ty="data-value",ry=(e,t,r)=>Zv(e,t,r),ny=a.createContext(void 0),ay=()=>a.useContext(ny),sy=a.createContext(void 0),iy=()=>a.useContext(sy),oy=a.createContext(void 0),cy=a.forwardRef((e,t)=>{let r=Sy(()=>{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=Sy(()=>new Set),s=Sy(()=>new Map),i=Sy(()=>new Map),o=Sy(()=>new Set),c=xy(e),{label:l,children:d,value:u,onValueChange:p,filter:m,shouldFilter:h,loop:f,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,y=Ai(),x=Ai(),w=Ai(),S=a.useRef(null),k=Ey();wy(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,C.emit()}},[u]),wy(()=>{k(6,P)},[]);let C=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)_(),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=T())?void 0:e.id,C.emit()}),n||k(5,P),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))}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=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(),C.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,()=>{_(),A(),r.current.value||j(),C.emit()}),()=>{i.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=T();k(4,()=>{_(),(null==t?void 0:t.getAttribute("id"))===e&&j(),C.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:ry;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(Yv);t?t.appendChild(e.parentElement===t?e:e.closest(`${Yv} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${Yv} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${Jv}[${ty}="${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(ty);C.setState("value",t||void 0)}function _(){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 P(){var e,t,r;let n=T();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(Jv))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=S.current)?void 0:e.querySelector(`${Xv}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(Qv))||[])}function D(e){let t=R()[e];t&&C.setState("value",t.getAttribute(ty))}function I(e){var t;let r=T(),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&&C.setState("value",s.getAttribute(ty))}function M(e){let t,r=T(),n=null==r?void 0:r.closest(Jv);for(;n&&!t;)n=e>0?vy(n,Jv):yy(n,Jv),t=null==n?void 0:n.querySelector(Qv);t?C.setState("value",t.getAttribute(ty)):I(e)}let U=()=>D(R().length-1),L=e=>{e.preventDefault(),e.metaKey?U():e.altKey?M(1):I(1)},O=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?M(-1):I(-1)};return a.createElement(Di.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(),U();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event(ey);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:Ay},l),Ny(e,e=>a.createElement(sy.Provider,{value:C},a.createElement(ny.Provider,{value:E},e))))}),ly=a.forwardRef((e,t)=>{var r,n;let s=Ai(),i=a.useRef(null),o=a.useContext(oy),c=ay(),l=xy(e),d=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==o?void 0:o.forceMount;wy(()=>{if(!d)return c.item(s,null==o?void 0:o.id)},[d]);let u=Cy(s,i,[e.value,e.children,i],e.keywords),p=iy(),m=ky(e=>e.value&&e.value===u.current),h=ky(e=>!(!d&&!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,u.current)}function g(){p.setState("value",u.current,!0)}if(a.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(ey,f),()=>t.removeEventListener(ey,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(Di.div,{ref:ii(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)}),dy=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=Ai(),c=a.useRef(null),l=a.useRef(null),d=Ai(),u=ay(),p=ky(e=>!(!s&&!1!==u.filter())||(!e.search||e.filtered.groups.has(o)));wy(()=>u.group(o),[]),Cy(o,c,[e.value,e.heading,l]);let m=a.useMemo(()=>({id:o,forceMount:s}),[s]);return a.createElement(Di.div,{ref:ii(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&a.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),Ny(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},a.createElement(oy.Provider,{value:m},e))))}),uy=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=a.useRef(null),i=ky(e=>!e.search);return r||i?a.createElement(Di.div,{ref:ii(s,t),...n,"cmdk-separator":"",role:"separator"}):null}),py=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=null!=e.value,i=iy(),o=ky(e=>e.search),c=ky(e=>e.selectedItemId),l=ay();return a.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),a.createElement(Di.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)}})}),my=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=a.useRef(null),o=a.useRef(null),c=ky(e=>e.selectedItemId),l=ay();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(Di.div,{ref:ii(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":n,id:l.listId},Ny(e,e=>a.createElement("div",{ref:ii(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),hy=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...c}=e;return a.createElement(Uc,{open:r,onOpenChange:n},a.createElement(Oc,{container:o},a.createElement(zc,{"cmdk-overlay":"",className:s}),a.createElement(Fc,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(cy,{ref:t,...c}))))}),fy=a.forwardRef((e,t)=>ky(e=>0===e.filtered.count)?a.createElement(Di.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),gy=a.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return a.createElement(Di.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Ny(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),by=Object.assign(cy,{List:my,Item:ly,Input:py,Group:dy,Separator:uy,Dialog:hy,Empty:fy,Loading:gy});function vy(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function yy(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function xy(e){let t=a.useRef(e);return wy(()=>{t.current=e}),t}var wy="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function Sy(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function ky(e){let t=iy(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function Cy(e,t,r,n=[]){let s=a.useRef(),i=ay();return wy(()=>{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(ty,o),s.current=o}),s}var Ey=()=>{let[e,t]=a.useState(),r=Sy(()=>new Map);return wy(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function Ny({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 Ay={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const jy=a.forwardRef(({className:t,...r},n)=>e.jsx(by,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));jy.displayName=by.displayName;const _y=a.forwardRef(({className:t,...r},n)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(Xc,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(by.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})]}));_y.displayName=by.Input.displayName;const Py=a.forwardRef(({className:t,...r},n)=>e.jsx(by.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));Py.displayName=by.List.displayName;a.forwardRef((t,r)=>e.jsx(by.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=by.Empty.displayName;const Ty=a.forwardRef(({className:t,...r},n)=>e.jsx(by.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}));Ty.displayName=by.Group.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(by.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",t),...r})).displayName=by.Separator.displayName;const Ry=a.forwardRef(({className:t,...r},n)=>e.jsx(by.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}));Ry.displayName=by.Item.displayName;const Dy=["top","right","bottom","left"],Iy=Math.min,My=Math.max,Uy=Math.round,Ly=Math.floor,Oy=e=>({x:e,y:e}),zy={left:"right",right:"left",bottom:"top",top:"bottom"},Fy={start:"end",end:"start"};function By(e,t,r){return My(e,Iy(t,r))}function Wy(e,t){return"function"==typeof e?e(t):e}function Vy(e){return e.split("-")[0]}function Gy(e){return e.split("-")[1]}function Hy(e){return"x"===e?"y":"x"}function $y(e){return"y"===e?"height":"width"}const Ky=new Set(["top","bottom"]);function qy(e){return Ky.has(Vy(e))?"y":"x"}function Zy(e){return Hy(qy(e))}function Jy(e){return e.replace(/start|end/g,e=>Fy[e])}const Yy=["left","right"],Xy=["right","left"],Qy=["top","bottom"],ex=["bottom","top"];function tx(e,t,r,n){const a=Gy(e);let s=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Xy:Yy:t?Yy:Xy;case"left":case"right":return t?Qy:ex;default:return[]}}(Vy(e),"start"===r,n);return a&&(s=s.map(e=>e+"-"+a),t&&(s=s.concat(s.map(Jy)))),s}function rx(e){return e.replace(/left|right|bottom|top/g,e=>zy[e])}function nx(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 ax(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 sx(e,t,r){let{reference:n,floating:a}=e;const s=qy(t),i=Zy(t),o=$y(i),c=Vy(t),l="y"===s,d=n.x+n.width/2-a.width/2,u=n.y+n.height/2-a.height/2,p=n[o]/2-a[o]/2;let m;switch(c){case"top":m={x:d,y:n.y-a.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-a.width,y:u};break;default:m={x:n.x,y:n.y}}switch(Gy(t)){case"start":m[i]-=p*(r&&l?-1:1);break;case"end":m[i]+=p*(r&&l?-1:1)}return m}async function ix(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:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=Wy(t,e),h=nx(m),f=o[p?"floating"===u?"reference":"floating":u],g=ax(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:d,strategy:c})),b="floating"===u?{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=ax(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 ox(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cx(e){return Dy.some(t=>e[t]>=0)}const lx=new Set(["left","top"]);function dx(){return"undefined"!=typeof window}function ux(e){return hx(e)?(e.nodeName||"").toLowerCase():"#document"}function px(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function mx(e){var t;return null==(t=(hx(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function hx(e){return!!dx()&&(e instanceof Node||e instanceof px(e).Node)}function fx(e){return!!dx()&&(e instanceof Element||e instanceof px(e).Element)}function gx(e){return!!dx()&&(e instanceof HTMLElement||e instanceof px(e).HTMLElement)}function bx(e){return!(!dx()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof px(e).ShadowRoot)}const vx=new Set(["inline","contents"]);function yx(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Tx(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!vx.has(a)}const xx=new Set(["table","td","th"]);function wx(e){return xx.has(ux(e))}const Sx=[":popover-open",":modal"];function kx(e){return Sx.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Cx=["transform","translate","scale","rotate","perspective"],Ex=["transform","translate","scale","rotate","perspective","filter"],Nx=["paint","layout","strict","content"];function Ax(e){const t=jx(),r=fx(e)?Tx(e):e;return Cx.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||Ex.some(e=>(r.willChange||"").includes(e))||Nx.some(e=>(r.contain||"").includes(e))}function jx(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const _x=new Set(["html","body","#document"]);function Px(e){return _x.has(ux(e))}function Tx(e){return px(e).getComputedStyle(e)}function Rx(e){return fx(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Dx(e){if("html"===ux(e))return e;const t=e.assignedSlot||e.parentNode||bx(e)&&e.host||mx(e);return bx(t)?t.host:t}function Ix(e){const t=Dx(e);return Px(t)?e.ownerDocument?e.ownerDocument.body:e.body:gx(t)&&yx(t)?t:Ix(t)}function Mx(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=Ix(e),s=a===(null==(n=e.ownerDocument)?void 0:n.body),i=px(a);if(s){const e=Ux(i);return t.concat(i,i.visualViewport||[],yx(a)?a:[],e&&r?Mx(e):[])}return t.concat(a,Mx(a,[],r))}function Ux(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Lx(e){const t=Tx(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=gx(e),s=a?e.offsetWidth:r,i=a?e.offsetHeight:n,o=Uy(r)!==s||Uy(n)!==i;return o&&(r=s,n=i),{width:r,height:n,$:o}}function Ox(e){return fx(e)?e:e.contextElement}function zx(e){const t=Ox(e);if(!gx(t))return Oy(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=Lx(t);let i=(s?Uy(r.width):r.width)/n,o=(s?Uy(r.height):r.height)/a;return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}const Fx=Oy(0);function Bx(e){const t=px(e);return jx()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Fx}function Wx(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),s=Ox(e);let i=Oy(1);t&&(n?fx(n)&&(i=zx(n)):i=zx(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==px(e))&&t}(s,r,n)?Bx(s):Oy(0);let c=(a.left+o.x)/i.x,l=(a.top+o.y)/i.y,d=a.width/i.x,u=a.height/i.y;if(s){const e=px(s),t=n&&fx(n)?px(n):n;let r=e,a=Ux(r);for(;a&&n&&t!==r;){const e=zx(a),t=a.getBoundingClientRect(),n=Tx(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,d*=e.x,u*=e.y,c+=s,l+=i,r=px(a),a=Ux(r)}}return ax({width:d,height:u,x:c,y:l})}function Vx(e,t){const r=Rx(e).scrollLeft;return t?t.left+r:Wx(mx(e)).left+r}function Gx(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Vx(e,r),y:r.top+t.scrollTop}}const Hx=new Set(["absolute","fixed"]);function $x(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=px(e),n=mx(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=jx();(!e||e&&"fixed"===t)&&(o=a.offsetLeft,c=a.offsetTop)}const l=Vx(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=mx(e),r=Rx(e),n=e.ownerDocument.body,a=My(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=My(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Vx(e);const o=-r.scrollTop;return"rtl"===Tx(n).direction&&(i+=My(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:i,y:o}}(mx(e));else if(fx(t))n=function(e,t){const r=Wx(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=gx(e)?zx(e):Oy(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=Bx(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ax(n)}function Kx(e,t){const r=Dx(e);return!(r===t||!fx(r)||Px(r))&&("fixed"===Tx(r).position||Kx(r,t))}function qx(e,t,r){const n=gx(t),a=mx(t),s="fixed"===r,i=Wx(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const c=Oy(0);function l(){c.x=Vx(a)}if(n||!n&&!s)if(("body"!==ux(t)||yx(a))&&(o=Rx(t)),n){const e=Wx(t,!0,s,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&l();s&&!n&&a&&l();const d=!a||n||s?Oy(0):Gx(a,o);return{x:i.left+o.scrollLeft-c.x-d.x,y:i.top+o.scrollTop-c.y-d.y,width:i.width,height:i.height}}function Zx(e){return"static"===Tx(e).position}function Jx(e,t){if(!gx(e)||"fixed"===Tx(e).position)return null;if(t)return t(e);let r=e.offsetParent;return mx(e)===r&&(r=r.ownerDocument.body),r}function Yx(e,t){const r=px(e);if(kx(e))return r;if(!gx(e)){let t=Dx(e);for(;t&&!Px(t);){if(fx(t)&&!Zx(t))return t;t=Dx(t)}return r}let n=Jx(e,t);for(;n&&wx(n)&&Zx(n);)n=Jx(n,t);return n&&Px(n)&&Zx(n)&&!Ax(n)?r:n||function(e){let t=Dx(e);for(;gx(t)&&!Px(t);){if(Ax(t))return t;if(kx(t))return null;t=Dx(t)}return null}(e)||r}const Xx={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s="fixed"===a,i=mx(n),o=!!t&&kx(t.floating);if(n===i||o&&s)return r;let c={scrollLeft:0,scrollTop:0},l=Oy(1);const d=Oy(0),u=gx(n);if((u||!u&&!s)&&(("body"!==ux(n)||yx(i))&&(c=Rx(n)),gx(n))){const e=Wx(n);l=zx(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}const p=!i||u||s?Oy(0):Gx(i,c);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+d.x+p.x,y:r.y*l.y-c.scrollTop*l.y+d.y+p.y}},getDocumentElement:mx,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const s=[..."clippingAncestors"===r?kx(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Mx(e,[],!1).filter(e=>fx(e)&&"body"!==ux(e)),a=null;const s="fixed"===Tx(e).position;let i=s?Dx(e):e;for(;fx(i)&&!Px(i);){const t=Tx(i),r=Ax(i);r||"fixed"!==t.position||(a=null),(s?!r&&!a:!r&&"static"===t.position&&a&&Hx.has(a.position)||yx(i)&&!r&&Kx(e,i))?n=n.filter(e=>e!==i):a=t,i=Dx(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=s[0],o=s.reduce((e,r)=>{const n=$x(t,r,a);return e.top=My(n.top,e.top),e.right=Iy(n.right,e.right),e.bottom=Iy(n.bottom,e.bottom),e.left=My(n.left,e.left),e},$x(t,i,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:Yx,getElementRects:async function(e){const t=this.getOffsetParent||Yx,r=this.getDimensions,n=await r(e.floating);return{reference:qx(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}=Lx(e);return{width:t,height:r}},getScale:zx,isElement:fx,isRTL:function(e){return"rtl"===Tx(e).direction}};function Qx(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ew(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=Ox(e),d=a||s?[...l?Mx(l):[],...Mx(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),s&&e.addEventListener("resize",r)});const u=l&&o?function(e,t){let r,n=null;const a=mx(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:d,top:u,width:p,height:m}=l;if(o||t(),!p||!m)return;const h={rootMargin:-Ly(u)+"px "+-Ly(a.clientWidth-(d+p))+"px "+-Ly(a.clientHeight-(u+m))+"px "+-Ly(d)+"px",threshold:My(0,Iy(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||Qx(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?Wx(e):null;return c&&function t(){const n=Wx(e);f&&!Qx(f,n)&&r();f=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",r),s&&e.removeEventListener("resize",r)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const tw=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=Vy(r),o=Gy(r),c="y"===qy(r),l=lx.has(i)?-1:1,d=s&&c?-1:1,u=Wy(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return o&&"number"==typeof h&&(m="end"===o?-1*h:h),c?{x:m*d,y:p*l}:{x:p*l,y:m*d}}(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}}}}},rw=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}=Wy(e,t),d={x:r,y:n},u=await s.detectOverflow(t,l),p=qy(Vy(a)),m=Hy(p);let h=d[m],f=d[p];if(i){const e="y"===m?"bottom":"right";h=By(h+u["y"===m?"top":"left"],h,h-u[e])}if(o){const e="y"===p?"bottom":"right";f=By(f+u["y"===p?"top":"left"],f,f-u[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}}}}}},nw=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:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=!0,...g}=Wy(e,t);if(null!=(r=s.arrow)&&r.alignmentOffset)return{};const b=Vy(a),v=qy(o),y=Vy(o)===o,x=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=p||(y||!f?[rx(o)]:function(e){const t=rx(e);return[Jy(e),t,Jy(t)]}(o)),S="none"!==h;!p&&S&&w.push(...tx(o,f,h,x));const k=[o,...w],C=await c.detectOverflow(t,g),E=[];let N=(null==(n=s.flip)?void 0:n.overflows)||[];if(d&&E.push(C[b]),u){const e=function(e,t,r){void 0===r&&(r=!1);const n=Gy(e),a=Zy(e),s=$y(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=rx(i)),[i,rx(i)]}(a,i,x);E.push(C[e[0]],C[e[1]])}if(N=[...N,{placement:a,overflows:E}],!E.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"===u&&v!==qy(t))||N.every(e=>qy(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 _;const e=null==(_=N.filter(e=>{if(S){const t=qy(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:_[0];e&&(r=e);break}case"initialPlacement":r=o}if(a!==r)return{reset:{placement:r}}}return{}}}},aw=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}=Wy(e,t),d=await i.detectOverflow(t,l),u=Vy(a),p=Gy(a),m="y"===qy(a),{width:h,height:f}=s.floating;let g,b;"top"===u||"bottom"===u?(g=u,b=p===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(b=u,g="end"===p?"top":"bottom");const v=f-d.top-d.bottom,y=h-d.left-d.right,x=Iy(f-d[g],v),w=Iy(h-d[b],y),S=!t.middlewareData.shift;let k=x,C=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(C=y),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=v),S&&!p){const e=My(d.left,0),t=My(d.right,0),r=My(d.top,0),n=My(d.bottom,0);m?C=h-2*(0!==e||0!==t?e+t:My(d.left,d.right)):k=f-2*(0!==r||0!==n?r+n:My(d.top,d.bottom))}await c({...t,availableWidth:C,availableHeight:k});const E=await i.getDimensions(o.floating);return h!==E.width||f!==E.height?{reset:{rects:!0}}:{}}}},sw=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...s}=Wy(e,t);switch(a){case"referenceHidden":{const e=ox(await n.detectOverflow(t,{...s,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cx(e)}}}case"escaped":{const e=ox(await n.detectOverflow(t,{...s,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:cx(e)}}}default:return{}}}}},iw=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:d=0}=Wy(e,t)||{};if(null==l)return{};const u=nx(d),p={x:r,y:n},m=Zy(a),h=$y(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 C=x/2-w/2,E=k/2-f[h]/2-1,N=Iy(u[b],E),A=Iy(u[v],E),j=N,_=k-f[h]-A,P=k/2-f[h]/2+C,T=By(j,P,_),R=!c.arrow&&null!=Gy(a)&&P!==T&&s.reference[h]/2-(P<j?N:A)-f[h]/2<0,D=R?P<j?P-j:P-_:0;return{[m]:p[m]+D,data:{[m]:T,centerOffset:P-T-D,...R&&{alignmentOffset:D}},reset:R}}}),ow=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}=Wy(e,t),d={x:r,y:n},u=qy(a),p=Hy(u);let m=d[p],h=d[u];const f=Wy(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=lx.has(Vy(a)),r=s.reference[u]-s.floating[e]+(t&&(null==(b=i.offset)?void 0:b[u])||0)+(t?0:g.crossAxis),n=s.reference[u]+s.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[u])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[p]:m,[u]:h}}}},cw=(e,t,r)=>{const n=new Map,a={platform:Xx,...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:d,y:u}=sx(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:d,y:u,initialPlacement:n,placement:p,strategy:a,middlewareData:m,rects:l,platform:{...i,detectOverflow:null!=(f=i.detectOverflow)?f:ix},elements:{reference:e,floating:t}});d=null!=b?b:d,u=null!=v?v:u,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:d,y:u}=sx(l,p,c))),r=-1)}return{x:d,y:u,placement:p,strategy:a,middlewareData:m}})(e,t,{...a,platform:s})};var lw="undefined"!=typeof document?t.useLayoutEffect:function(){};function dw(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(!dw(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)&&!dw(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function uw(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pw(e,t){const r=uw(e);return Math.round(t*r)/r}function mw(e){const t=a.useRef(e);return lw(()=>{t.current=e}),t}const hw=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?iw({element:r.current,padding:n}).fn(t):{}:r?iw({element:r,padding:n}).fn(t):{};var a}}),fw=(e,t)=>({...tw(e),options:[e,t]}),gw=(e,t)=>({...rw(e),options:[e,t]}),bw=(e,t)=>({...ow(e),options:[e,t]}),vw=(e,t)=>({...nw(e),options:[e,t]}),yw=(e,t)=>({...aw(e),options:[e,t]}),xw=(e,t)=>({...sw(e),options:[e,t]}),ww=(e,t)=>({...hw(e),options:[e,t]});var Sw=a.forwardRef((t,r)=>{const{children:n,width:a=10,height:s=5,...i}=t;return e.jsx(Di.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"})})});Sw.displayName="Arrow";var kw=Sw,Cw="Popper",[Ew,Nw]=Si(Cw),[Aw,jw]=Ew(Cw),_w=t=>{const{__scopePopper:r,children:n}=t,[s,i]=a.useState(null);return e.jsx(Aw,{scope:r,anchor:s,onAnchorChange:i,children:n})};_w.displayName=Cw;var Pw="PopperAnchor",Tw=a.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:s,...i}=t,o=jw(Pw,n),c=a.useRef(null),l=oi(r,c),d=a.useRef(null);return a.useEffect(()=>{const e=d.current;d.current=s?.current||c.current,e!==d.current&&o.onAnchorChange(d.current)}),s?null:e.jsx(Di.div,{...i,ref:l})});Tw.displayName=Pw;var Rw="PopperContent",[Dw,Iw]=Ew(Rw),Mw=a.forwardRef((t,r)=>{const{__scopePopper:n,side:i="bottom",sideOffset:o=0,align:c="center",alignOffset:l=0,arrowPadding:d=0,avoidCollisions:u=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=jw(Rw,n),[x,w]=a.useState(null),S=oi(r,e=>w(e)),[k,C]=a.useState(null),E=Sd(k),N=E?.width??0,A=E?.height??0,j=i+("center"!==c?"-"+c:""),_="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},P=Array.isArray(p)?p:[p],T=P.length>0,R={padding:_,boundary:P.filter(zw),altBoundary:T},{refs:D,floatingStyles:I,placement:M,isPositioned:U,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:d,open:u}=e,[p,m]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=a.useState(n);dw(h,n)||f(n);const[g,b]=a.useState(null),[v,y]=a.useState(null),x=a.useCallback(e=>{e!==C.current&&(C.current=e,b(e))},[]),w=a.useCallback(e=>{e!==E.current&&(E.current=e,y(e))},[]),S=o||g,k=c||v,C=a.useRef(null),E=a.useRef(null),N=a.useRef(p),A=null!=d,j=mw(d),_=mw(i),P=mw(u),T=a.useCallback(()=>{if(!C.current||!E.current)return;const e={placement:t,strategy:r,middleware:h};_.current&&(e.platform=_.current),cw(C.current,E.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};R.current&&!dw(N.current,t)&&(N.current=t,s.flushSync(()=>{m(t)}))})},[h,t,r,_,P]);lw(()=>{!1===u&&N.current.isPositioned&&(N.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[u]);const R=a.useRef(!1);lw(()=>(R.current=!0,()=>{R.current=!1}),[]),lw(()=>{if(S&&(C.current=S),k&&(E.current=k),S&&k){if(j.current)return j.current(S,k,T);T()}},[S,k,T,j,A]);const D=a.useMemo(()=>({reference:C,floating:E,setReference:x,setFloating:w}),[x,w]),I=a.useMemo(()=>({reference:S,floating:k}),[S,k]),M=a.useMemo(()=>{const e={position:r,left:0,top:0};if(!I.floating)return e;const t=pw(I.floating,p.x),n=pw(I.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...uw(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:T,refs:D,elements:I,floatingStyles:M}),[p,T,D,I,M])}({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>ew(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[fw({mainAxis:o+A,alignmentAxis:l}),u&&gw({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?bw():void 0,...R}),u&&vw({...R}),yw({...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&&ww({element:k,padding:d}),Fw({arrowWidth:N,arrowHeight:A}),f&&xw({strategy:"referenceHidden",...R})]}),[O,z]=Bw(M),F=Ii(b);Ci(()=>{U&&F?.()},[U,F]);const B=L.arrow?.x,W=L.arrow?.y,V=0!==L.arrow?.centerOffset,[G,H]=a.useState();return Ci(()=>{x&&H(window.getComputedStyle(x).zIndex)},[x]),e.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:U?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Dw,{scope:n,placedSide:O,onArrowChange:C,arrowX:B,arrowY:W,shouldHideArrow:V,children:e.jsx(Di.div,{"data-side":O,"data-align":z,...v,ref:S,style:{...v.style,animation:U?void 0:"none"}})})})});Mw.displayName=Rw;var Uw="PopperArrow",Lw={top:"bottom",right:"left",bottom:"top",left:"right"},Ow=a.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=Iw(Uw,n),i=Lw[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(kw,{...a,ref:r,style:{...a.style,display:"block"}})})});function zw(e){return null!==e}Ow.displayName=Uw;var Fw=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]=Bw(r),d={start:"0%",center:"50%",end:"100%"}[l],u=(a.arrow?.x??0)+i/2,p=(a.arrow?.y??0)+o/2;let m="",h="";return"bottom"===c?(m=s?d:`${u}px`,h=-o+"px"):"top"===c?(m=s?d:`${u}px`,h=`${n.floating.height+o}px`):"right"===c?(m=-o+"px",h=s?d:`${p}px`):"left"===c&&(m=`${n.floating.width+o}px`,h=s?d:`${p}px`),{data:{x:m,y:h}}}});function Bw(e){const[t,r="center"]=e.split("-");return[t,r]}var Ww=_w,Vw=Tw,Gw=Mw,Hw=Ow;function $w(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?ii(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 Kw=Symbol("radix.slottable");function qw(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Kw}var Zw="Popover",[Jw]=Si(Zw,[Nw]),Yw=Nw(),[Xw,Qw]=Jw(Zw),eS=t=>{const{__scopePopover:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!1}=t,l=Yw(r),d=a.useRef(null),[u,p]=a.useState(!1),[m,h]=_i({prop:s,defaultProp:i??!1,onChange:o,caller:Zw});return e.jsx(Ww,{...l,children:e.jsx(Xw,{scope:r,contentId:Ai(),triggerRef:d,open:m,onOpenChange:h,onOpenToggle:a.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:u,onCustomAnchorAdd:a.useCallback(()=>p(!0),[]),onCustomAnchorRemove:a.useCallback(()=>p(!1),[]),modal:c,children:n})})};eS.displayName=Zw;var tS="PopoverAnchor";a.forwardRef((t,r)=>{const{__scopePopover:n,...s}=t,i=Qw(tS,n),o=Yw(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=i;return a.useEffect(()=>(c(),()=>l()),[c,l]),e.jsx(Vw,{...o,...s,ref:r})}).displayName=tS;var rS="PopoverTrigger",nS=a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Qw(rS,n),i=Yw(n),o=oi(r,s.triggerRef),c=e.jsx(Di.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":fS(s.open),...a,ref:o,onClick:wi(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:e.jsx(Vw,{asChild:!0,...i,children:c})});nS.displayName=rS;var aS="PopoverPortal",[sS,iS]=Jw(aS,{forceMount:void 0}),oS=t=>{const{__scopePopover:r,forceMount:n,children:a,container:s}=t,i=Qw(aS,r);return e.jsx(sS,{scope:r,forceMount:n,children:e.jsx(eo,{present:n||i.open,children:e.jsx(Qi,{asChild:!0,container:s,children:a})})})};oS.displayName=aS;var cS="PopoverContent",lS=a.forwardRef((t,r)=>{const n=iS(cS,t.__scopePopover),{forceMount:a=n.forceMount,...s}=t,i=Qw(cS,t.__scopePopover);return e.jsx(eo,{present:a||i.open,children:i.modal?e.jsx(uS,{...s,ref:r}):e.jsx(pS,{...s,ref:r})})});lS.displayName=cS;var dS=function(t){const r=$w(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(qw);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"),uS=a.forwardRef((t,r)=>{const n=Qw(cS,t.__scopePopover),s=a.useRef(null),i=oi(r,s),o=a.useRef(!1);return a.useEffect(()=>{const e=s.current;if(e)return Qo(e)},[]),e.jsx($o,{as:dS,allowPinchZoom:!0,children:e.jsx(mS,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:wi(t.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:wi(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:wi(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),pS=a.forwardRef((t,r)=>{const n=Qw(cS,t.__scopePopover),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(mS,{...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()}})}),mS=a.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...p}=t,m=Qw(cS,n),h=Yw(n);return no(),e.jsx($i,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:e.jsx(Fi,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(Gw,{"data-state":fS(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)"}})})})}),hS="PopoverClose";a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Qw(hS,n);return e.jsx(Di.button,{type:"button",...a,ref:r,onClick:wi(t.onClick,()=>s.onOpenChange(!1))})}).displayName=hS;function fS(e){return e?"open":"closed"}a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=Yw(n);return e.jsx(Hw,{...s,...a,ref:r})}).displayName="PopoverArrow";var gS=oS,bS=lS;const vS=eS,yS=nS,xS=a.forwardRef(({className:t,align:r="center",sideOffset:n=4,...s},i)=>{const{container:o}=a.useContext(Qc);return e.jsx(gS,{container:o,children:e.jsx(bS,{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 wS({options:r,value:n,onChange:a,placeholder:s="Search...",emptyLabel:i="Choose option"}){const[o,c]=t.useState(n??""),[l,d]=t.useState(!1);t.useEffect(()=>{void 0!==n&&c(n)},[n]);const u=r.find(e=>e.value===o);return e.jsxs(vS,{open:l,onOpenChange:d,children:[e.jsx(yS,{asChild:!0,children:e.jsxs(xi,{variant:"outline",role:"combobox","aria-expanded":l,className:"justify-between overflow-hidden text-ellipsis",children:[u?e.jsxs("div",{children:[String(u.label).trim(),u.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:u.icon})]}):e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx(Ds,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(xS,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(jy,{children:[e.jsx(_y,{placeholder:s}),e.jsx(Py,{children:e.jsx(Ty,{children:r.map(t=>e.jsxs(Ry,{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 d(!1);var e},children:[o===t.value&&e.jsx(Rs,{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))})})]})})]})}xS.displayName=bS.displayName;const SS={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"},kS={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"},CS=[{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=kS[e.code]||"USD",r=SS[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 ES({value:t,onChange:r}){const{t:n}=ln(),a=CS.map(e=>({value:e.value,label:e.text,icon:e.flag}));return e.jsx(wS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCountry"),emptyLabel:n("dropdowns.chooseCountry")})}const NS=CS.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),AS=Array.from(new Set(NS.map(e=>e.value))).map(e=>NS.find(t=>t.value===e)).filter(e=>void 0!==e);function jS({value:t,onChange:r}){const{t:n}=ln(),a=AS.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return e.jsx(wS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCurrency"),emptyLabel:n("dropdowns.chooseCurrency")})}let _S=[{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:"🇮🇱"}];_S=_S.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),_S.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const PS=_S.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 TS({value:t,onChange:r}){const{t:n}=ln(),a=PS.map(e=>({value:e.value,label:e.label,icon:e.flag}));return e.jsx(wS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchLanguage"),emptyLabel:n("dropdowns.chooseLanguage")})}const RS=[{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 DS({value:t,onChange:r}){const{t:n}=ln(),a=RS.map(e=>({value:e.value,label:e.text}));return e.jsx(wS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchTimezone"),emptyLabel:n("dropdowns.chooseTimezone")})}const IS=({workspace:r})=>{const{t:n}=ln(),{updateUserProfile:a,getProfile:s}=EC(),[i,o]=t.useState(!1),[c,l]=t.useState(),[d,u]=t.useState(0),p=Md(),m=cp({resolver:bf(fg({name:Wf().min(2,{message:n("profile.nameMinLength")}),country:Wf().optional(),timezone:Wf().optional(),language:Wf().optional(),currency:Wf().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),m.setValue("name",e.name),m.setValue("country",e.country),m.setValue("timezone",e.timezone),m.setValue("language",e.language),m.setValue("currency",e.currency)})},[d]),c?e.jsxs("div",{children:[p.message&&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.message})]}),e.jsx("div",{className:"space-y-4",children:e.jsx(Og,{...m,children:e.jsxs("form",{onSubmit:m.handleSubmit(async function(e){o(!0),p.clear();try{await a({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),p.show(n("profile.success"))}catch(e){Te(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(qg,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:c?.email})]}),e.jsx(Fg,{disabled:i,control:m.control,name:"name",render:({field:t})=>e.jsxs(Vg,{children:[e.jsx(Gg,{children:n("profile.name")}),e.jsx(Hg,{children:e.jsx(qg,{...t})}),e.jsx(Kg,{})]})}),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(TS,{value:m.watch("language"),onChange:e=>{m.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(ES,{value:m.watch("country"),onChange:e=>{m.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(jS,{value:m.watch("currency"),onChange:e=>{m.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(DS,{value:m.watch("timezone"),onChange:e=>{m.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(xi,{type:"submit",progress:i,disabled:i,children:n("profile.save")}),e.jsx(xi,{type:"button",variant:"outline",onClick:()=>{u(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(_l,{})};function MS(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},allowOverage:!1!==e.allowOverage}:null}function US(e,t,r={}){if(null==e)return null;const{overageInCents:n=!0,currency:a,locale:s="en"}=r,{included:i,overage:o}=e;if(!(!1!==e.allowOverage))return{included:i,hasOverage:!1,allowOverage:!1,price:"",unit:""};if(null==o)return{included:i,hasOverage:!1,allowOverage:!0,price:"",unit:""};const c=n?o/100:o,l=(a??"").trim().toUpperCase();let d;if(l&&"number"==typeof c&&Number.isFinite(c))try{d=new Intl.NumberFormat(s,{style:"currency",currency:l,minimumFractionDigits:2}).format(c)}catch{d=`${r.currencySymbol??El(a??"")}${c.toFixed(2)}`}else{d=`${r.currencySymbol??El(a??"")}${"number"==typeof c?c.toFixed(2):String(o)}`}return{included:i,hasOverage:!0,allowOverage:!0,price:d,unit:t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?`${e.unitSize.toLocaleString(s)} ${t}`:t||""}}const LS="personal",OS=(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)},zS=e=>{switch(e){case za:return"bg-green-100 text-green-800";case Oa:return"bg-yellow-100 text-yellow-800";case La:return"bg-gray-100 text-gray-800";case Fa:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},FS=({workspaceId:t,hasActiveSubscription:r=!1,onViewPricingPlans:n,limit:a=20})=>{const{t:s,formattingLocale:i}=ln(),{can:o}=wl(),c=o(gl.WORKSPACE_BILLING_VIEW),{invoices:l,loading:d,error:u,refetch:p}=Un(t,a);if(!c)return e.jsx(Al,{});const m=l.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(xi,{variant:"ghost",size:"sm",progress:d,onClick:p,disabled:d,children:s("settings.common.refreshAction",{loading:String(d)})})]}),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:s("invoices.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:u})]}),e.jsx(xi,{variant:"outline",size:"sm",onClick:p,disabled:d,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.retryAction",{loading:String(d)})})]}),d&&!m?e.jsx("div",{className:"border rounded-lg p-6",children:e.jsx(_l,{})}):m?e.jsx("div",{className:"space-y-2",children:l.map(t=>{const r=(e=>{switch(e.status){case La:case Oa:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case za:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case Fa:case Ba: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 ${zS(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:OS(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:Rl(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:OS(t.amount_paid,t.currency,i)})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(xi,{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(Os,{className:"h-3 w-3 ms-1.5"})]}),t.invoice_pdf&&e.jsxs(xi,{size:"sm",variant:"outline",onClick:()=>window.open(t.invoice_pdf,"_blank","noopener,noreferrer"),children:[e.jsx(Ls,{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(zs,{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(xi,{size:"sm",className:"mt-4",onClick:n,children:s("subscription.viewPricingPlans")})]})]})},BS=t.lazy(()=>Promise.resolve().then(function(){return lN}).then(e=>({default:e.default}))),WS=(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""}},VS=({workspace:r})=>{const n=r._id?.toString(),{t:a,formattingLocale:s,fmtNum:i,fmtCents:o}=ln(),{api:c}=jn(),{can:l}=wl(),{settings:d}=An(),u=l(gl.WORKSPACE_BILLING_VIEW),p=l(gl.WORKSPACE_BILLING_MANAGE),m=d?.workspace?.mode===LS,{subscription:h,loading:f,error:g,updateSubscription:b,refetch:v}=Mn(n),{createCheckoutSession:y}=Dn(n),{cancelSubscription:x,loading:w}=On(n),{resumeSubscription:S,loading:k}=zn(n),{openBillingPortal:C,loading:E}=Ln(n),{versions:N,loading:A,error:j,refetch:_}=Rn(n),P=f||A,T=g||j,{currentVersion:R,latestVersion:D,isDeprecated:I,plansToShow:M}=t.useMemo(()=>{const e=N?.currentVersion,t=N?.availableVersions||[],r=null!=h?.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:[]}},[N,h?.subscription]),[U,L]=t.useState(!1),[O,z]=t.useState(null),[F,B]=t.useState(null),W=t.useRef(null),[V,G]=t.useState(!1),[H,$]=t.useState(!1),K=t.useRef(void 0),q=t.useRef(!1);t.useEffect(()=>{if(q.current)return;if(f||!M||0===M.length)return;const e=CC.getState(),t=e.params?.action===ya;h?.subscription&&!t||(q.current=!0,t&&(K.current=e.params,CC.clearParams()),G(!0))},[f,h?.subscription,M]),t.useEffect(()=>()=>{W.current&&clearTimeout(W.current)},[]);const[Z,J]=t.useState(!1),[Y,X]=t.useState("subscription"),Q=async()=>{await Promise.all([v(),_()])},ee=t.useMemo(()=>ss(h?.subscription?.stripePriceId,M??[]),[h?.subscription?.stripePriceId,M]),te=async()=>{if(n){$(!1),L(!0),z(null),B(null);try{await x(),B(a("subscription.cancelSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorCanceling");z(t)}finally{L(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}};if(P&&!h&&!N)return e.jsx(_l,{});if(!u)return null;const re=h?.planVersion?._id||null;return n?e.jsxs("div",{className:"space-y-6",children:[T&&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:T}),e.jsx("p",{className:"text-xs mt-2 text-red-600",children:a("subscription.errorLoadingDescription")})]}),e.jsx(xi,{variant:"outline",size:"sm",onClick:Q,disabled:P,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.retryAction",{loading:String(P)})})]}),O&&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:O})]}),e.jsx(xi,{variant:"outline",size:"sm",onClick:()=>z(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.dismiss")})]}),F&&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:F})]}),e.jsx(xi,{variant:"outline",size:"sm",onClick:()=>B(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:()=>X("subscription"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("subscription"===Y?"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:()=>X("invoices"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("invoices"===Y?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:a("subscription.invoicesTab")})]})}),"subscription"===Y&&e.jsxs(e.Fragment,{children:[P&&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(Bs,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),I&&h?.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(ri,{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",R?.version||"?"," → v",D?.version||"?"]})]})]}),e.jsx(xi,{size:"sm",variant:"outline",className:"shrink-0 border-amber-300 text-amber-700 hover:bg-amber-100",onClick:()=>G(!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=h?.subscription?.subscriptionStatus===Ia,r=h?.subscription?.cancelAtPeriodEnd;return r||w?null:t&&M&&M.length>0?e.jsx(xi,{size:"sm",onClick:()=>G(!0),children:a("subscription.viewPricingPlans")}):h?.subscription&&!t&&p?e.jsx(xi,{variant:"outline",size:"sm",onClick:()=>G(!0),children:a("subscription.changePlanButton")}):!h?.subscription&&M&&M.length>0?e.jsx(xi,{size:"sm",onClick:()=>G(!0),children:a("subscription.viewPricingPlans")}):null})(),e.jsx(xi,{variant:"ghost",size:"sm",progress:P,onClick:Q,disabled:P||U,children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),h?.subscription?(()=>{const t=ss(h.subscription.stripePriceId,M??[]),n=t?.interval??null,c=t?.currency??h.plan?.currency??r?.billingCurrency??"",l=n&&h.planVersion?rs(h.planVersion,c,n):null,d=c,u=h.planVersion?is(h.planVersion,c):null,f=u&&n?os(h.planVersion,c,n):null,g=Array.isArray(r?.users)?r.users.length:1,b=u?.includedSeats??0,v=Math.max(0,g-b),y=!!h.plan?.isFreemium,x=null!=l?0===l?a("subscription.free"):o(l,d):y?a("subscription.free"):null,S=n===Ta.Monthly?a("subscription.billingInterval.perMonth"):n===Ta.Quarterly?a("subscription.billingInterval.perQuarter"):n===Ta.Yearly?a("subscription.billingInterval.perYear"):"";return e.jsxs("div",{className:"border rounded-lg overflow-hidden "+(I?"border-amber-300":"border-gray-200"),children:[h.subscription.subscriptionStatus===Da&&!h.subscription.cancelAtPeriodEnd&&(()=>{const t=h.subscription.trialEnd||h.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(xi,{size:"sm",variant:i?"default":"outline",className:"shrink-0 "+(i?"":"border-blue-300 text-blue-700 hover:bg-blue-100"),onClick:()=>G(!0),children:a("subscription.upgradePlan")})]})})(),e.jsxs("div",{className:"p-4 sm:p-5 "+(I?"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:h.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 "+(h.subscription.subscriptionStatus===Ra?h.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":h.subscription.subscriptionStatus===Da?"bg-blue-100 text-blue-800":h.subscription.subscriptionStatus===Ia?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[h.subscription.subscriptionStatus===Ra&&(h.subscription.cancelAtPeriodEnd?a("subscription.status.canceling"):a("subscription.status.active")),h.subscription.subscriptionStatus===Da&&a("subscription.status.trial"),h.subscription.subscriptionStatus===Ia&&a("subscription.status.canceled"),h.subscription.subscriptionStatus===Ma&&a("subscription.status.pastDue")]}),h.subscription.subscriptionStatus===Da&&WS(s,h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("span",{className:"text-xs text-gray-500",children:["(ends"," ",WS(s,h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd),")"]}),I&&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(ri,{className:"h-3 w-3"}),a("subscription.status.deprecated")]})]}),h.plan?.description&&e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:h.plan.description}),!y&&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:x||a("invoices.na")}),x&&x!==a("subscription.free")&&S&&e.jsx("span",{className:"text-sm text-gray-500",children:S})]}),u&&f&&f>0&&!m&&e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:a("subscription.perSeatDisplay",{price:o(f,d),interval:S})}),!m&&u&&f&&f>0&&v>0&&x&&x!==a("subscription.free")&&null!=l&&e.jsx("div",{className:"text-xs text-gray-500 mt-1 pt-1 border-t border-gray-200",children:a("subscription.estTotalDisplay",{total:o(l+f*v,d),interval:S,count:v})})]}),(h.subscription.subscriptionStatus===Ra||h.subscription.subscriptionStatus===Da)&&!h.subscription.cancelAtPeriodEnd&&WS(s,h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(Ps,{className:"h-3.5 w-3.5 flex-shrink-0"}),e.jsx("span",{children:a("subscription.nextBillingDisplay",{date:WS(s,h.subscription.stripeCurrentPeriodEnd)??""})})]})]}),I&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["Version ",R?.version||a("invoices.na")]}),!y&&(h.subscription.subscriptionStatus===Ra||h.subscription.subscriptionStatus===Da||h.subscription.subscriptionStatus===Ma)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-4 pt-4 border-t border-gray-200",children:[h.subscription&&p&&h.subscription?.subscriptionId&&e.jsx(xi,{variant:"outline",size:"sm",onClick:()=>C(),disabled:E,progress:E,children:a(E?"subscription.openingPortal":"subscription.managePayment")}),p&&h.subscription?.subscriptionId&&(h.subscription.subscriptionStatus===Ra||h.subscription.subscriptionStatus===Da)&&e.jsx(e.Fragment,{children:h.subscription.cancelAtPeriodEnd?e.jsx(xi,{variant:"outline",size:"sm",onClick:()=>J(!0),disabled:U||w||k,progress:k,children:h.subscription.subscriptionStatus===Da?a("subscription.resumeTrial"):a("subscription.resumeTitle")}):e.jsx(xi,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",onClick:()=>$(!0),disabled:U||w||k,progress:w||U,children:w||U?a("subscription.canceling"):h.subscription.subscriptionStatus===Da?a("subscription.cancelTrial"):a("subscription.cancelTitle")})})]})]}),h.subscription.subscriptionStatus===Ma&&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(ri,{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(xi,{variant:"outline",size:"sm",className:"mt-2 border-red-200 text-red-700 hover:bg-red-100",onClick:()=>X("invoices"),children:a("subscription.viewInvoices")})]})]})}),h.subscription.subscriptionStatus===Ma&&h.subscription.dunningState&&h.subscription.dunningState!==Ha&&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(ri,{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:h.subscription.dunningState===$a?a("subscription.dunningFinal"):h.subscription.dunningState===Ka?a("subscription.dunningSuspended"):a("subscription.dunningRecovery")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:h.subscription.dunningState===Ka?a("subscription.dunningSuspendedDescription"):a("subscription.dunningRecoveryDescription")})]})]})}),h.subscription.subscriptionStatus===Ua&&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(Ps,{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")})]})]})}),h.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(Ps,{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:h.subscription.subscriptionStatus===Da?a("subscription.scheduledTrialCancellation"):a("subscription.scheduledCancellation")}),e.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:WS(s,h.subscription.subscriptionStatus===Da&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)?e.jsxs(e.Fragment,{children:[h.subscription.subscriptionStatus===Da?a("subscription.trialEndDescription"):a("subscription.cancelEndDescription")," ",e.jsx("span",{className:"font-medium",children:WS(s,h.subscription.subscriptionStatus===Da&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)}),"."]}):a("subscription.cancelEndFallback")})]})]})}),h.planVersion&&(()=>{const t=((e,t,r=Ta.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],a=[],s=[];return e.subscriptionItems.forEach(i=>{const o=i.slug;if(i.type===Wa){const t=e.features?.[o]??!1;n.push({item:i,enabled:t})}else if(i.type===Va){const t=e.limits?.[o]??0;a.push({item:i,value:t})}else if(i.type===Ga){const n=t&&e.pricingVariants?.length?as(e,t,o,r):MS(e.quotas?.[o],r);null!=n&&s.push({item:i,value:n})}}),{features:n,limits:a,quotas:s}})(h.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:i(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=US(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)})})]}),u&&!m&&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(g)})]}),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(b)})]}),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")]})]}),f&&f>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(f,c),S]})]}),(u?.maxSeats??0)>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(u.maxSeats)})]})]})]}),h.planVersion?.creditGrant?.enabled&&"object"==typeof h.planVersion.creditGrant.creditPackage&&null!==h.planVersion.creditGrant.creditPackage&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.credits")}),e.jsxs("div",{className:"bg-purple-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:h.planVersion.creditGrant.renewOnPeriod?a("subscription.items.creditsPerMonth"):a("subscription.items.creditsOneTime")}),e.jsx("span",{className:"font-semibold text-purple-700",children:i("object"==typeof h.planVersion.creditGrant.creditPackage?h.planVersion.creditGrant.creditPackage.creditAmount:0)})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.items.creditRenewal")}),e.jsx("span",{className:"font-medium text-gray-900",children:h.planVersion.creditGrant.renewOnPeriod?"reset"===h.planVersion.creditGrant.mode?a("subscription.items.creditModeReset"):a("subscription.items.creditModeTopup"):a("subscription.items.creditModeLifetime")})]})]})]})]})}):null})()]})})():e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(Us,{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")})]}),M&&M.length>0&&e.jsx(xi,{size:"sm",onClick:()=>G(!0),children:a("subscription.viewPricingPlans")})]})]}),!N&&!P&&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")}),T&&e.jsxs("p",{className:"text-sm mt-2 text-red-600",children:["Error: ",T]}),!T&&e.jsx("p",{className:"text-sm mt-2",children:a("subscription.noPlansAvailable")})]}),e.jsx(xi,{variant:"outline",size:"sm",progress:P,onClick:Q,disabled:P,className:"mt-4",children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),"invoices"===Y&&e.jsxs(e.Fragment,{children:[P&&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(Bs,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),e.jsx(FS,{workspaceId:n,hasActiveSubscription:null!==h?.subscription,onViewPricingPlans:()=>X("subscription"),limit:20})]}),M&&M.length>0&&e.jsx(t.Suspense,{fallback:V?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(Bs,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:a("settings.common.loading")})]})}):null,children:e.jsx(BS,{open:V,onOpenChange:G,planVersions:M,currentPlanVersionId:re||null,currentStripePriceId:h?.subscription?.stripePriceId,billingCurrency:r.billingCurrency,trialUsedAt:r.trialUsedAt,workspaceName:r.name,initialInterval:K.current?.interval,initialCurrency:K.current?.currency,currentMemberCount:Array.isArray(r?.users)?r.users.length:void 0,onSelectPlan:async(e,t=Ta.Monthly,s)=>{if(!n)return;const i=M?.find(t=>t._id===e),o=s??ee?.currency??h?.plan?.currency??r?.billingCurrency??"",l=i?function(e,t,r){const n=ts(e,t);if(!n?.stripePrices)return null;const a=r===Ta.Monthly?"monthlyPriceId":r===Ta.Yearly?"yearlyPriceId":"quarterlyPriceId",s=r===Ta.Monthly?"monthly":r===Ta.Yearly?"yearly":void 0;return n.stripePrices[a]??(s?n.stripePrices[s]:void 0)??null}(i,o,t):null,d=h?.subscription?.stripePriceId;if(!l||!d||l!==d){L(!0),z(null),B(null);try{const{successUrl:r,cancelUrl:s}=function(e){const t="undefined"!=typeof window?window.location.href:void 0;return{successUrl:Aa({action:ba,status:Sa,ws:e,screen:Ea},t),cancelUrl:Aa({action:ba,status:ka,ws:e,screen:Ea},t)}}(n);let l;if(i?.plan?.isFreemium){return h?.subscription?.subscriptionId?(G(!1),void $(!0)):(await c.selectFreePlan(n,e),G(!1),Lt(),await Q(),void B(a("subscription.updateSuccess")))}const d=h?.subscription?.subscriptionStatus===Ia;if(l=h?.subscription&&!d?await b(e,{billingInterval:t,successUrl:r,cancelUrl:s}):await y({planVersionId:e,billingInterval:t,currency:o||void 0,successUrl:r,cancelUrl:s}),l&&"checkoutUrl"in l&&l.checkoutUrl)return void da(l.checkoutUrl);B(a("subscription.updateSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorProcessing");z(t)}finally{L(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}},loading:U||P})}),e.jsx(ld,{open:Z,onOpenChange:J,children:e.jsxs(md,{children:[e.jsxs(hd,{children:[e.jsx(gd,{children:a("subscription.resumeTitle")}),e.jsx(bd,{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(ri,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[a("subscription.resumeChargeDate")," ",h?.subscription?.stripeCurrentPeriodEnd&&WS(s,h.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:WS(s,h.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(fd,{children:[e.jsx(yd,{disabled:k,children:a("subscription.resumeKeep")}),e.jsx(vd,{onClick:async()=>{if(n){J(!1),L(!0),z(null),B(null);try{await S(),B(a("subscription.resumeSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorResuming");z(t)}finally{L(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}},disabled:k,children:a(k?"subscription.resuming":"subscription.resumeButton")})]})]})}),(()=>{const t=h?.subscription?.subscriptionStatus===Da,r=t&&h?.subscription?.trialEnd||h?.subscription?.stripeCurrentPeriodEnd;return e.jsx(ld,{open:H,onOpenChange:$,children:e.jsxs(md,{children:[e.jsxs(hd,{children:[e.jsx(gd,{children:a(t?"subscription.cancelTrialTitle":"subscription.cancelTitle")}),e.jsx(bd,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:a(t?"subscription.cancelTrialConfirm":"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(t?"subscription.cancelTrialAccess":"subscription.retainAccess")," ",r&&WS(s,r)?e.jsx("span",{className:"font-medium",children:WS(s,r)}):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(t?"subscription.cancelTrialNoCharge":"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(t?"subscription.cancelTrialResume":"subscription.cancelResumeAnytime")})]})]})]})})]}),e.jsxs(fd,{children:[e.jsx(yd,{disabled:w,children:a(t?"subscription.cancelTrialKeep":"subscription.cancelKeep")}),e.jsx(vd,{onClick:te,disabled:w,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:a(w?"subscription.canceling":t?"subscription.cancelTrialButton":"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 GS(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function HS(e,t,r){return t+e.toLocaleString(r,{minimumFractionDigits:2,maximumFractionDigits:2})}function $S(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 KS=()=>{const{quotas:r,loading:n,error:a,refetch:s}=ca(),{t:i,formattingLocale:o,fmtNum:c}=ln(),{can:l}=wl(),d=(e,t)=>HS(e,t,o),{response:u}=Vn(),[p,m]=t.useState(!1),h=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=El(s);if(!r)return e;for(const n of Object.keys(r)){const o=ns(t,s,n,a);if(null==o||o<=0)continue;const c=t.quotas?.[n],l=c?.[a],d=l?.unitSize??1,u=r[n].overage,p=(d>1?Math.ceil(u/d):u)*o/100;e[n]={overageCents:o,unitSize:d,currency:s,currencySymbol:i,estimatedCost:p}}return e},[u,r]),f=t.useMemo(()=>{const e=u?.subscription?.usageCurrentPeriodEnd||u?.subscription?.stripeCurrentPeriodEnd;if(!e)return null;const t=Pl(e,o);return t?{endDate:t,daysRemaining:$S(e)}:null},[u,o]),g=async()=>{m(!0);try{await s()}finally{m(!1)}};if(n&&!r)return e.jsx(_l,{});if(!l(gl.WORKSPACE_USAGE_VIEW))return null;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(xi,{variant:"outline",size:"sm",onClick:g,disabled:p,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.retryAction",{loading:String(p)})})]});const b=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===b.length)return e.jsxs("div",{className:"border rounded-lg p-8 text-center",children:[e.jsx(Ts,{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 v=b.filter(([,e])=>e.hasOverage).length,y=b.length>0?Math.round(b.reduce((e,[,t])=>e+(t.included>0?t.consumed/t.included*100:0),0)/b.length):0,x=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:i("usage.description")}),e.jsxs(xi,{variant:"ghost",size:"sm",onClick:g,disabled:p,children:[e.jsx(Hs,{className:Se("h-3.5 w-3.5 me-1.5",p&&"animate-spin")}),i("settings.common.refreshAction",{loading:String(p)})]})]}),f&&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(Ps,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e.jsxs("span",{children:[i("usage.resetDateDisplay",{date:f.endDate}),null!==f.daysRemaining&&f.daysRemaining>0&&e.jsxs("span",{className:"text-gray-500",children:[" ","(",i("usage.daysRemainingDisplay",{count:f.daysRemaining}),")"]}),null!==f.daysRemaining&&f.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(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:i("usage.overallUsage")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(y)+"%"})]}),e.jsxs("div",{className:Se("border rounded-lg p-3 sm:p-4",v>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",v>0?"text-red-600":"text-gray-900"),children:c(v)})]}),v>0&&x>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:d(x,w)})]})]}),v>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(ri,{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:v})}),x>0&&e.jsx("p",{className:"text-sm text-amber-700 font-medium mt-1",children:i("usage.estOverageCharges",{amount:d(x,w)})})]})]})}),e.jsx("div",{className:"space-y-3",children:b.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=h[t];return e.jsx(qS,{slug:t,quota:r,percent:n,colors:i,pricing:o},t)})})]})};function qS({slug:t,quota:r,percent:n,colors:a,pricing:s}){const{t:i,formattingLocale:o}=ln(),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)=>HS(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:GS(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:c(Math.ceil(r.overage/s.unitSize))})]}),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 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?ii(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 JS=Symbol("radix.slottable");function YS(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===JS}var XS=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(Di.span,{...t,ref:r,style:{...XS,...t.style}})).displayName="VisuallyHidden";var QS=[" ","Enter","ArrowUp","ArrowDown"],ek=[" ","Enter"],tk="Select",[rk,nk,ak]=Qg(tk),[sk]=Si(tk,[ak,Nw]),ik=Nw(),[ok,ck]=sk(tk),[lk,dk]=sk(tk),uk=t=>{const{__scopeSelect:r,children:n,open:s,defaultOpen:i,onOpenChange:o,value:c,defaultValue:l,onValueChange:d,dir:u,name:p,autoComplete:m,disabled:h,required:f,form:g}=t,b=ik(r),[v,y]=a.useState(null),[x,w]=a.useState(null),[S,k]=a.useState(!1),C=tb(u),[E,N]=_i({prop:s,defaultProp:i??!1,onChange:o,caller:tk}),[A,j]=_i({prop:c,defaultProp:l,onChange:d,caller:tk}),_=a.useRef(null),P=!v||(g||!!v.closest("form")),[T,R]=a.useState(new Set),D=Array.from(T).map(e=>e.props.value).join(";");return e.jsx(Ww,{...b,children:e.jsxs(ok,{required:f,scope:r,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:Ai(),value:A,onValueChange:j,open:E,onOpenChange:N,dir:C,triggerPointerDownPosRef:_,disabled:h,children:[e.jsx(rk.Provider,{scope:r,children:e.jsx(lk,{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})}),P?e.jsxs(Zk,{"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(T)]},D):null]})})};uk.displayName=tk;var pk="SelectTrigger",mk=a.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:s=!1,...i}=t,o=ik(n),c=ck(pk,n),l=c.disabled||s,d=oi(r,c.onTriggerChange),u=nk(n),p=a.useRef("touch"),[m,h,f]=Yk(e=>{const t=u().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),n=Xk(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(Vw,{asChild:!0,...o,children:e.jsx(Di.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":Jk(c.value)?"":void 0,...i,ref:d,onClick:wi(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:wi(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:wi(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||QS.includes(e.key)&&(g(),e.preventDefault())})})})});mk.displayName=pk;var hk="SelectValue",fk=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:s,children:i,placeholder:o="",...c}=t,l=ck(hk,n),{onValueNodeHasChildrenChange:d}=l,u=void 0!==i,p=oi(r,l.onValueNodeChange);return Ci(()=>{d(u)},[d,u]),e.jsx(Di.span,{...c,ref:p,style:{pointerEvents:"none"},children:Jk(l.value)?e.jsx(e.Fragment,{children:o}):i})});fk.displayName=hk;var gk=a.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...s}=t;return e.jsx(Di.span,{"aria-hidden":!0,...s,ref:r,children:a||"▼"})});gk.displayName="SelectIcon";var bk=t=>e.jsx(Qi,{asChild:!0,...t});bk.displayName="SelectPortal";var vk="SelectContent",yk=a.forwardRef((t,r)=>{const n=ck(vk,t.__scopeSelect),[i,o]=a.useState();if(Ci(()=>{o(new DocumentFragment)},[]),!n.open){const r=i;return r?s.createPortal(e.jsx(wk,{scope:t.__scopeSelect,children:e.jsx(rk.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(Ck,{...t,ref:r})});yk.displayName=vk;var xk=10,[wk,Sk]=sk(vk),kk=function(t){const r=ZS(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(YS);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"),Ck=a.forwardRef((t,r)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:c,side:l,sideOffset:d,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v,...y}=t,x=ck(vk,n),[w,S]=a.useState(null),[k,C]=a.useState(null),E=oi(r,e=>S(e)),[N,A]=a.useState(null),[j,_]=a.useState(null),P=nk(n),[T,R]=a.useState(!1),D=a.useRef(!1);a.useEffect(()=>{if(w)return Qo(w)},[w]),no();const I=a.useCallback(e=>{const[t,...r]=P().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}},[P,k]),M=a.useCallback(()=>I([N,w]),[I,N,w]);a.useEffect(()=>{T&&M()},[T,M]);const{onOpenChange:U,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)||U(!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,U,L]),a.useEffect(()=>{const e=()=>U(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[U]);const[O,z]=Yk(e=>{const t=P().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=Xk(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)&&_(e)},[x.value]),V="popper"===s?Nk:Ek,G=V===Nk?{side:l,sideOffset:d,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return e.jsx(wk,{scope:n,content:w,viewport:k,onViewportChange:C,itemRefCallback:F,selectedItem:N,onItemLeave:B,itemTextRefCallback:W,focusSelectedItem:M,selectedItemText:j,position:s,isPositioned:T,searchRef:O,children:e.jsx($o,{as:kk,allowPinchZoom:!0,children:e.jsx($i,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:wi(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(Fi,{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,...G,onPlaced:()=>R(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:wi(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=P().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()}})})})})})})});Ck.displayName="SelectContentImpl";var Ek=a.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:s,...i}=t,o=ck(vk,n),c=Sk(vk,n),[l,d]=a.useState(null),[u,p]=a.useState(null),m=oi(r,e=>p(e)),h=nk(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&&u&&b&&v&&y){const e=o.trigger.getBoundingClientRect(),t=u.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),d=window.innerWidth-xk,u=$b(s,[xk,Math.max(xk,d-c)]);l.style.minWidth=o+"px",l.style.left=u+"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),d=window.innerWidth-xk,u=$b(s,[xk,Math.max(xk,d-c)]);l.style.minWidth=o+"px",l.style.right=u+"px"}const a=h(),i=window.innerHeight-2*xk,c=b.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),x=p+m+c+parseInt(d.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,x),S=window.getComputedStyle(b),k=parseInt(S.paddingTop,10),C=parseInt(S.paddingBottom,10),E=e.top+e.height/2-xk,N=i-E,A=v.offsetHeight/2,j=p+m+(v.offsetTop+A),_=x-j;if(j<=E){const e=a.length>0&&v===a[a.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-b.offsetTop-b.offsetHeight,r=j+Math.max(N,A+(e?C: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(E,p+b.offsetTop+(e?k:0)+A)+_;l.style.height=t+"px",b.scrollTop=j-E+b.offsetTop}l.style.margin=`${xk}px 0`,l.style.minHeight=w+"px",l.style.maxHeight=i+"px",s?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,l,u,b,v,y,o.dir,s]);Ci(()=>w(),[w]);const[S,k]=a.useState();Ci(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const C=a.useCallback(e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)},[w,x]);return e.jsx(Ak,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:e.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:e.jsx(Di.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Ek.displayName="SelectItemAlignedPosition";var Nk=a.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:s=xk,...i}=t,o=ik(n);return e.jsx(Gw,{...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)"}})});Nk.displayName="SelectPopperPosition";var[Ak,jk]=sk(vk,{}),_k="SelectViewport",Pk=a.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:s,...i}=t,o=Sk(_k,n),c=jk(_k,n),l=oi(r,o.onViewportChange),d=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(rk.Slot,{scope:n,children:e.jsx(Di.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:wi(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=c;if(n?.current&&r){const e=Math.abs(d.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*xk,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")}}}d.current=t.scrollTop})})})]})});Pk.displayName=_k;var Tk="SelectGroup",[Rk,Dk]=sk(Tk);a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=Ai();return e.jsx(Rk,{scope:n,id:s,children:e.jsx(Di.div,{role:"group","aria-labelledby":s,...a,ref:r})})}).displayName=Tk;var Ik="SelectLabel",Mk=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=Dk(Ik,n);return e.jsx(Di.div,{id:s.id,...a,ref:r})});Mk.displayName=Ik;var Uk="SelectItem",[Lk,Ok]=sk(Uk),zk=a.forwardRef((t,r)=>{const{__scopeSelect:n,value:s,disabled:i=!1,textValue:o,...c}=t,l=ck(Uk,n),d=Sk(Uk,n),u=l.value===s,[p,m]=a.useState(o??""),[h,f]=a.useState(!1),g=oi(r,e=>d.itemRefCallback?.(e,s,i)),b=Ai(),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(Lk,{scope:n,value:s,disabled:i,textId:b,isSelected:u,onItemTextChange:a.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(rk.ItemSlot,{scope:n,value:s,disabled:i,textValue:p,children:e.jsx(Di.div,{role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:g,onFocus:wi(c.onFocus,()=>f(!0)),onBlur:wi(c.onBlur,()=>f(!1)),onClick:wi(c.onClick,()=>{"mouse"!==v.current&&y()}),onPointerUp:wi(c.onPointerUp,()=>{"mouse"===v.current&&y()}),onPointerDown:wi(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:wi(c.onPointerMove,e=>{v.current=e.pointerType,i?d.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:wi(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:wi(c.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(ek.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});zk.displayName=Uk;var Fk="SelectItemText",Bk=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:i,style:o,...c}=t,l=ck(Fk,n),d=Sk(Fk,n),u=Ok(Fk,n),p=dk(Fk,n),[m,h]=a.useState(null),f=oi(r,e=>h(e),u.onItemTextChange,e=>d.itemTextRefCallback?.(e,u.value,u.disabled)),g=m?.textContent,b=a.useMemo(()=>e.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=p;return Ci(()=>(v(b),()=>y(b)),[v,y,b]),e.jsxs(e.Fragment,{children:[e.jsx(Di.span,{id:u.textId,...c,ref:f}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?s.createPortal(c.children,l.valueNode):null]})});Bk.displayName=Fk;var Wk="SelectItemIndicator",Vk=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return Ok(Wk,n).isSelected?e.jsx(Di.span,{"aria-hidden":!0,...a,ref:r}):null});Vk.displayName=Wk;var Gk="SelectScrollUpButton";a.forwardRef((t,r)=>{const n=Sk(Gk,t.__scopeSelect),s=jk(Gk,t.__scopeSelect),[i,o]=a.useState(!1),c=oi(r,s.onScrollButtonChange);return Ci(()=>{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($k,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=Gk;var Hk="SelectScrollDownButton";a.forwardRef((t,r)=>{const n=Sk(Hk,t.__scopeSelect),s=jk(Hk,t.__scopeSelect),[i,o]=a.useState(!1),c=oi(r,s.onScrollButtonChange);return Ci(()=>{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($k,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=Hk;var $k=a.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:s,...i}=t,o=Sk("SelectScrollButton",n),c=a.useRef(null),l=nk(n),d=a.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return a.useEffect(()=>()=>d(),[d]),Ci(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),e.jsx(Di.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:wi(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(s,50))}),onPointerMove:wi(i.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(s,50))}),onPointerLeave:wi(i.onPointerLeave,()=>{d()})})}),Kk=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e.jsx(Di.div,{"aria-hidden":!0,...a,ref:r})});Kk.displayName="SelectSeparator";var qk="SelectArrow";a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=ik(n),i=ck(qk,n),o=Sk(qk,n);return i.open&&"popper"===o.position?e.jsx(Hw,{...s,...a,ref:r}):null}).displayName=qk;var Zk=a.forwardRef(({__scopeSelect:t,value:r,...n},s)=>{const i=a.useRef(null),o=oi(s,i),c=wd(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(Di.select,{...n,style:{...XS,...n.style},ref:o,defaultValue:r})});function Jk(e){return""===e||void 0===e}function Yk(e){const t=Ii(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 Xk(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}Zk.displayName="SelectBubbleInput";var Qk=mk,eC=gk,tC=bk,rC=yk,nC=Pk,aC=Mk,sC=zk,iC=Bk,oC=Vk,cC=Kk;const lC=uk,dC=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(Qk,{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(eC,{asChild:!0,children:e.jsx($c,{className:"h-4 w-4 opacity-50"})})]}));dC.displayName=Qk.displayName;const uC=a.forwardRef(({className:t,children:r,position:n="popper",...s},i)=>{const{container:o}=a.useContext(Qc);return e.jsx(tC,{container:o,children:e.jsx(rC,{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(nC,{className:Se("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});uC.displayName=rC.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(aC,{ref:n,className:Se("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=aC.displayName;const pC=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(sC,{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(oC,{children:e.jsx(qc,{className:"h-4 w-4"})})}),e.jsx(iC,{children:r})]}));pC.displayName=sC.displayName;function mC(e,r){const{response:n}=Vn();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=cs({planVersion:a,currency:i,settingsMaxUsers:r?.settingsMaxUsers}),{maxUsers:c,hasSeatPricing:l,includedSeats:d}=o,u=l?Math.max(0,t-d):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?os(a,i,s?.billingInterval??"monthly"):null,g=ls({memberCount:t,maxUsersConfig:o});return{hasSeatPricing:l,memberCount:t,includedSeats:d,maxUsers:c,maxSeats:c,limitSource:o.source,billableSeats:u,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(cC,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=cC.displayName;const hC=({workspace:r})=>{const{user:n}=_C(),{t:a,fmtNum:s,fmtCents:i}=ln(),[o,c]=t.useState(0),[l,d]=t.useState(!1),[u,p]=t.useState([]),[m,h]=t.useState(null),{getUsers:f,removeUser:g,updateUser:b}=EC(),{settings:v}=An(),{can:y}=wl(),{response:x}=Vn(),w=mC(r,{settingsMaxUsers:v?.workspace?.maxWorkspaceUsers});t.useEffect(()=>{r&&(d(!0),f(r._id).then(e=>{p(e)}).catch(e=>{Te(e,{component:"WorkspaceSettingsUsers",action:"getUsers",metadata:{workspaceId:r._id}})}).finally(()=>{d(!1)}))},[r,o,f]);const S=()=>{c(e=>e+1)},k=v?.workspace?.mode===LS;if(l||!r)return e.jsx(_l,{});if(k)return null;const C=e=>"string"==typeof e?{name:a("users.unknownUser"),email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},E=u.map(e=>({...e,...C(e.user)})),N=y(gl.WORKSPACE_MEMBERS_INVITE),A=y(gl.WORKSPACE_MEMBERS_REMOVE),j=y(gl.WORKSPACE_MEMBERS_ROLE_CHANGE),{hasSeatPricing:_,includedSeats:P,maxUsers:T,canInvite:R,inviteBlockReason:D,inviteBlockMessageKey:I,inviteBlockMessageValues:M,perSeatPriceCents:U,currency:L}=w,O=u.length,z=x?.subscription?.billingInterval??"monthly",F=_&&O>=P;return e.jsxs("div",{children:[!N&&!A&&!j&&e.jsx(Al,{descriptionKey:"users.adminOnly"}),N&&e.jsx("div",{className:"mb-4",children:R?e.jsxs("div",{children:[e.jsx(fC,{onInvite:S,workspaceId:r._id}),F&&U&&U>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(U,L),interval:z})})})]}):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:D??"member_limit_reached"})}),e.jsx("p",{className:"text-xs text-red-600 mt-0.5",children:I?a(I,M??void 0):""})]})})}),(_||T>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(_)})}),T>0&&e.jsxs("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full "+(O>=T?"bg-red-100 text-red-700":O>=.8*T?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),children:[s(O)," / ",s(T)]})]}),T>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 "+(O>=T?"bg-red-500":O>=.8*T?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,O/T*100)}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[e.jsx("div",{children:_?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(P)})," ",a("users.included"),U&&U>0&&e.jsxs("span",{className:"text-gray-400",children:[" ","· ",i(U,L),a("users.perExtraSeat")]})]}):e.jsxs("span",{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(T)})," ",a("users.maxMembers")]})}),T>0?e.jsxs("span",{children:[s(Math.max(0,T-O))," ",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:O})})}),e.jsx("div",{children:e.jsx(xi,{variant:"ghost",size:"sm",onClick:S,progress:l,children:a("settings.common.refreshAction",{loading:String(l)})})})]}),e.jsx("ul",{className:"space-y-2",children:E.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")})]})]}),j&&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(lC,{disabled:i||!j||o||m===t.id,value:t.role,onValueChange:e=>{return n=r._id,a=t.id,s=e,void(hl(r,a)?Te(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(()=>{S()}).catch(e=>{Te(e,{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:a,role:s}})}).finally(()=>{h(null)})));var n,a,s},children:[e.jsx(dC,{children:e.jsx(fk,{placeholder:a("users.selectRole")})}),e.jsx(uC,{children:r?.roles.map(t=>e.jsx(pC,{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(Bs,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!i&&!o&&A&&e.jsx(xi,{variant:"destructive",size:"sm",startIcon:e.jsx(ti,{}),onClick:()=>{return e=t.id,void(hl(r,e)?Te(new Error("Cannot remove the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}}):g(r._id,e).then(()=>{S()}).catch(t=>{Te(t,{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}})}));var e}})]})]},s)})}),0===u.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:a("users.noMembers")})]})};function fC({onInvite:r,workspaceId:n}){const{t:a}=ln(),{addUser:s,getWorkspace:i}=EC(),{settings:o}=An(),[c,l]=t.useState(""),[d,u]=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(""),u("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(Lg,{children:a("users.inviteByEmail")}),e.jsx(qg,{type:"email",value:c,onChange:e=>l(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(Lg,{children:a("users.role")}),e.jsxs(lC,{value:d,onValueChange:u,children:[e.jsx(dC,{children:e.jsx(fk,{placeholder:a("users.selectRole")})}),e.jsx(uC,{children:w.map(t=>e.jsx(pC,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(xi,{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,d).then(()=>{b(a("users.inviteSuccess")),r?.()}).catch(t=>{Te(t,{component:"InviteMember",action:"addUser",metadata:{workspaceId:n,email:e,role:d}}),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||!d,children:p?a("users.inviting"):a("users.inviteAs",{role:d})})})]})}const gC=({workspace:t,section:r,setSection:n})=>{const{t:a}=ln(),{settings:s}=An(),{can:i}=wl(),{appPermissions:o}=sa(),c=s?.workspace?.mode===LS,l=i(gl.WORKSPACE_DELETE),d=o&&Object.keys(o).length>0;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(bC,{title:a("settings.sidebar.account"),children:e.jsx(vC,{activeSection:r,icon:e.jsx(ni,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.profile"),section:yC.Profile,onClick:()=>n(yC.Profile)})}),e.jsxs(bC,{title:a("settings.sidebar.workspace"),children:[i(gl.WORKSPACE_SETTINGS_VIEW)&&e.jsx(vC,{activeSection:r,icon:e.jsx(Ks,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.general"),section:yC.General,onClick:()=>n(yC.General)}),!c&&i(gl.WORKSPACE_MEMBERS_VIEW)&&e.jsx(vC,{activeSection:r,icon:e.jsx(ai,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.users"),section:yC.Users,onClick:()=>n(yC.Users)}),i(gl.WORKSPACE_BILLING_VIEW)&&e.jsx(vC,{activeSection:r,icon:e.jsx(Us,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.subscription"),section:yC.Subscription,onClick:()=>n(yC.Subscription)}),i(gl.WORKSPACE_USAGE_VIEW)&&e.jsx(vC,{activeSection:r,icon:e.jsx(Ts,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.usage"),section:yC.Usage,onClick:()=>n(yC.Usage)}),i(gl.WORKSPACE_BILLING_VIEW)&&e.jsx(vC,{activeSection:r,icon:e.jsx(Ms,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.credits"),section:yC.Credits,onClick:()=>n(yC.Credits)}),i(gl.WORKSPACE_FEATURES_VIEW)&&e.jsx(vC,{activeSection:r,icon:e.jsx(Qs,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.features"),section:yC.Features,onClick:()=>n(yC.Features)}),e.jsx(vC,{activeSection:r,icon:e.jsx(js,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.notifications"),section:yC.Notifications,onClick:()=>n(yC.Notifications)}),d&&!c&&e.jsx(vC,{activeSection:r,icon:e.jsx(Zs,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.permissions"),section:yC.Permissions,onClick:()=>n(yC.Permissions)}),l&&!c&&e.jsx(vC,{activeSection:r,icon:e.jsx(ri,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.danger"),section:yC.Danger,onClick:()=>n(yC.Danger)})]})]})};function bC({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 vC({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 yC={Profile:"profile",General:"general",Users:"users",Subscription:"subscription",Usage:"usage",Credits:"credits",Features:"features",Notifications:"notifications",Permissions:"permissions",Danger:"danger"},xC=new Set(Object.values(yC)),wC={[yC.Profile]:"settings.titles.profile",[yC.General]:"settings.titles.general",[yC.Users]:"settings.titles.users",[yC.Subscription]:"settings.titles.subscription",[yC.Usage]:"settings.titles.usage",[yC.Credits]:"settings.titles.credits",[yC.Features]:"settings.titles.features",[yC.Notifications]:"settings.titles.notifications",[yC.Permissions]:"settings.titles.permissions",[yC.Danger]:"settings.titles.danger"},SC=({workspace:r,onClose:n,open:a,onOpenChange:s,defaultSection:i=yC.Profile,section:o,onSectionChange:c,showTrigger:l=!0,trigger:d})=>{const{t:u,dir:p}=ln(),[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(xi,{variant:"outline",size:"icon",children:e.jsx(Ks,{className:"h-4 w-4"})});return e.jsxs(tl,{open:b,onOpenChange:e=>{v(e),!e&&n&&n()},children:[l&&e.jsx(rl,{asChild:!0,children:d||w}),e.jsxs(sl,{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(cl,{className:"sr-only",children:u(wC[y])}),e.jsx(gC,{workspace:r,section:y,setSection:x}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsx(ol,{className:"text-xl font-bold mb-4",children:u(wC[y])}),e.jsxs("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[y===yC.Profile&&e.jsx(IS,{workspace:r}),y===yC.General&&e.jsx(Dv,{workspace:r}),y===yC.Users&&e.jsx(hC,{workspace:r}),y===yC.Subscription&&e.jsx(VS,{workspace:r}),y===yC.Usage&&e.jsx(KS,{}),y===yC.Credits&&e.jsx(Il,{workspace:r}),y===yC.Features&&e.jsx(Ud,{workspaceId:r._id?.toString()}),y===yC.Notifications&&e.jsx(Fv,{workspace:r}),y===yC.Permissions&&e.jsx(Bv,{workspace:r}),y===yC.Danger&&e.jsx(xd,{workspace:r})]})]})]})]})};var kC=Object.freeze({__proto__:null,SETTINGS_SCREENS:xC,SettingsScreen:yC,WorkspaceSettingsDialog:SC,default:SC});const CC=new class{constructor(){this.listeners=new Set,this.currentState={open:!1,section:yC.Profile}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getState(){return{...this.currentState}}openWorkspaceSettings(e,t){this.currentState={open:!0,section:e||yC.Profile,params:t},this.notifyListeners()}closeSettings(){this.currentState={...this.currentState,open:!1,params:void 0},this.notifyListeners()}setSection(e){this.currentState={...this.currentState,section:e},this.notifyListeners()}clearParams(){this.currentState={...this.currentState,params:void 0}}notifyListeners(){this.listeners.forEach(e=>{e(this.currentState)})}},EC=()=>{const e=wn(),{os:r,api:n}=jn(),{settings:a}=An(),s=Sn(e=>e.workspaces),i=Sn(e=>e.auth.session?.user),o=t.useCallback((t,r)=>{if((!(t._id===s.currentWorkspace?._id)||r?.forceEmit)&&t){const r=s.currentWorkspace;dl(t),e.workspaces(ft(t)),ys.emitWorkspaceChanged(t,r).catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceChanged",metadata:{workspaceId:t._id}})})}},[s.currentWorkspace,e]),c=t.useCallback(async(t,n)=>{const a=++m.current;e.workspaces(wt(t._id));try{const e=r.auth?.callbacks?.onWorkspaceChange;if(e){const r=fl(t,i?.id);try{await e({workspace:t,user:i??null,role:r})}catch(e){throw Te(e,{component:"useSaaSWorkspaces",action:"onWorkspaceChange",metadata:{workspaceId:t._id}}),e}if(a!==m.current)return}o(t,n)}finally{a===m.current&&e.workspaces(wt(null))}},[e,r.auth?.callbacks?.onWorkspaceChange,o,i]),l=t.useRef(c);l.current=c,t.useEffect(()=>{if(!s.isInitialized){const t=ul();if(e.workspaces(bt(!0)),t){const e=s.workspaces.find(e=>e._id===t);e&&l.current(e,{forceEmit:!0}).catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"initWorkspaceSwitch",metadata:{savedWorkspaceId:t}})})}}},[s.isInitialized,s.workspaces,e]);const d=t.useCallback(()=>{pl(),e.workspaces(gt())},[e]),u=t.useRef(!1),p=t.useRef(!1),m=t.useRef(0),h=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(dt(t)),t.length>0){const e=ul();if(e&&ml(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]),f=t.useCallback(async()=>{if(!s.refreshing&&!u.current){u.current=!0,e.workspaces(xt(!0));try{const t=await n.getWorkspaces();e.workspaces(dt(t))}catch(e){}finally{e.workspaces(xt(!1)),u.current=!1}}},[n,s.refreshing,e]),g=t.useCallback(async(t,r)=>{const a=await n.createWorkspace({name:t,image:r});e.workspaces(ut(a)),await c(a),ys.emitWorkspaceCreated(a).catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:a._id}})}),setTimeout(()=>{CC.openWorkspaceSettings(yC.Subscription)},300)},[n,e,c]),b=t.useCallback(async(t,r)=>{const a=await n.updateWorkspace(t._id,r);e.workspaces(pt(a)),ys.emitWorkspaceUpdated(a).catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceUpdated",metadata:{workspaceId:a._id}})})},[n,e]),v=t.useCallback(async()=>{if(p.current)return s.allFeatures.length>0?s.allFeatures:null;if(s.allFeatures.length>0)return s.allFeatures;p.current=!0;try{const t=await n.getFeatures();return e.workspaces(ht(t)),t}catch(e){return Te(e,{component:"useSaaSWorkspaces",action:"getFeatures"}),null}finally{p.current=!1}},[n,e,s.allFeatures]),y=t.useCallback(async(e,t,r)=>await n.updateFeature(e,t,r),[n]),x=t.useCallback(async e=>n.updateSettings(e),[n]),w=t.useCallback(async(e,t)=>{const r=await n.updateWorkspacePermissions(e,t);return await f(),r},[n,f]);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&&(dl(r),e.workspaces(ft(r)));else if(s.workspaces.length>0){const e=s.workspaces[0];e._id!==t&&c(e).catch(t=>{Te(t,{component:"useSaaSWorkspaces",action:"fallbackWorkspaceSwitch",metadata:{workspaceId:e._id}})})}},[s.workspaces,s.currentWorkspace,e,c]);const S=t.useCallback(async e=>await n.getWorkspaceUsers(e),[n]),k=t.useCallback(async(e,t,r)=>{const i=s.workspaces.find(t=>t._id===e);if(i){const e=cs({settingsMaxUsers:a?.workspace?.maxWorkspaceUsers}),t=ls({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&&ys.emitWorkspaceUserAdded(o.userId,i,r).catch(t=>{Te(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:r}})}),f().catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"refreshAfterAddUser"})}),Lt(),o},[n,s.workspaces,f,a]),C=t.useCallback(async(e,t)=>{const r=s.workspaces.find(t=>t._id===e);if(r&&hl(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;ys.emitWorkspaceUserRemoved(i.userId,r,t).catch(r=>{Te(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:i.userId,role:t}})})}return f().catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"refreshAfterRemoveUser"})}),Lt(),i},[n,s.workspaces,f]),E=t.useCallback(async(e,t,r)=>{if(r.role){const r=s.workspaces.find(t=>t._id===e);if(r&&hl(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&&ys.emitWorkspaceUserRoleChanged(i.userId,i.workspace,a,r.role).catch(n=>{Te(n,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRoleChanged",metadata:{workspaceId:e,userId:t,previousRole:a,newRole:r.role}})}),i},[n,s.workspaces]),N=t.useCallback(async e=>{const t=await n.getProfile().catch(()=>null),r=await n.updateUserProfile(e);return ys.emitUserUpdated(r,t||void 0).catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"emitUserUpdated",metadata:{userId:r._id}})}),r},[n]),A=t.useCallback(async()=>await n.getProfile(),[n]),j=t.useCallback(async e=>await n.getWorkspace(e),[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(!hl(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&&(pl(),e.workspaces(gt())),r&&ys.emitWorkspaceDeleted(r).catch(e=>{Te(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:h,refreshWorkspaces:f,refreshing:s.refreshing,currentWorkspace:s.currentWorkspace,setCurrentWorkspace:o,switchToWorkspace:c,resetCurrentWorkspace:d,createWorkspace:g,allFeatures:s.allFeatures,getFeatures:v,updateFeature:y,updateWorkspaceSettings:x,updateWorkspacePermissions:w,getWorkspace:j,updateWorkspace:b,getUsers:S,addUser:k,removeUser:C,updateUser:E,getProfile:A,updateUserProfile:N,deleteWorkspace:_,switching:null!==s.switchingToId,switchingToId:s.switchingToId}};function NC(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:!1!==e.emailVerified,clientId:r,role:e.role||"",image:e.image}}function AC(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function jC(){return Sn(e=>e.auth)}function _C(){const{t:e}=ln(),r=wn(),n=jC(),a=En(),{serverUrl:s,orgId:i,auth:o}=a,{resetCurrentWorkspace:c,currentWorkspace:l}=EC(),d=t.useMemo(()=>new fa({serverUrl:s,version:a.version}),[s,a.version]),u=t.useCallback(async t=>{ma(t||window.location.href),r.auth(Me());try{const t=await d.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"));da(t.data.redirectUrl)}catch(e){throw r.auth(Le()),Te(e,{component:"useSaaSAuth",action:"signIn"}),e}},[d,i,o,r]),p=t.useCallback(async()=>{try{o?.callbacks?.onSignOut&&"function"==typeof o.callbacks.onSignOut&&await o.callbacks.onSignOut()}catch(e){Te(e,{component:"useSaaSAuth",action:"signOut"})}finally{pn(mn),r.auth(ze()),c()}},[r,c,o?.callbacks?.onSignOut]),m=t.useCallback(e=>{l?CC.openWorkspaceSettings(e):Te(new Error("Cannot open settings: No current workspace"),{component:"useSaaSAuth",action:"openWorkspaceSettings"})},[l]),h=t.useCallback(()=>{l?CC.openWorkspaceSettings(yC.Credits,{action:wa}):Te(new Error("Cannot open credit store: No current workspace"),{component:"useSaaSAuth",action:"openCreditStore"})},[l]),f=t.useCallback(()=>{l?CC.openWorkspaceSettings(yC.Subscription,{action:ya}):Te(new Error("Cannot open plan picker: No current workspace"),{component:"useSaaSAuth",action:"openPlanPicker"})},[l]),g=t.useMemo(()=>Ve(n.status),[n.status]);return t.useMemo(()=>({user:n.session?.user,session:n.session,status:n.status,...g,signIn:u,signOut:p,openWorkspaceSettings:m,openCreditStore:h,openPlanPicker:f}),[n.session,n.status,g,u,p,m,h,f])}const PC=t.memo(({children:r,callbacks:n})=>{const a=wn(),s=jC(),i=En(),o=Ve(s.status).isAuthenticated,c=t.useRef(!1),l=t.useRef(null),d=t.useRef(!1),u=t.useRef(null),p=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 fa({serverUrl:s,version:o}),d=await l.getProfile(t),u=AC(NC(d,c,r.auth?.clientId||""),t);fn(u.sessionId),a.auth(Oe(u)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(hn),window.history.replaceState({},"",e.toString())}catch(e){Te(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:hn}})}}();const p=ha();p&&p!==window.location.href&&da(p)}}catch(t){throw ha(),Te(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(d.current)return;if(u.current)return;if(!rt(i))return;if(bn())return;if(!n?.getSession)return d.current=!0,void a.auth(Le());const e=n.getSession,{serverUrl:t,version:r,orgId:s}=i,c=i.auth?.clientId||"";u.current=(async()=>{let i=null;try{i=await e()}catch(e){Te(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!i)return d.current=!0,a.auth(Le()),"undefined"!=typeof window&&ma(window.location.href),void n?.onSessionExpired?.("missing");try{const e=new fa({serverUrl:t,version:r}),n=await e.getProfile(i),o=AC(NC(n,s,c),i);fn(o.sessionId),d.current=!0,a.auth(Oe(o));const l=ha();l&&l!==window.location.href&&da(l)}catch(e){Te(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),d.current=!0,a.auth(Le()),"undefined"!=typeof window&&ma(window.location.href),n?.onSessionExpired?.("expired")}finally{u.current=null}})()},[o,a,i,n]),t.useEffect(()=>{const e=bn();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(Ue()),p(e).then(()=>{t||(l.current=null)}).catch(e=>{t||(Te(e,{component:"AuthProviderWrapper",action:"handleAuthRedirectEffect",metadata:{hasCode:!0}}),l.current=null)}).finally(()=>{c.current=!1}),()=>{t=!0}},[p,i.serverUrl,i.version,i.orgId]),e.jsx(e.Fragment,{children:r})});PC.displayName="AuthProviderWrapper";const TC=t.memo(({config:r,auth:n,children:a})=>{const s=wn();En();const i=t.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||"",callbacks:n?.callbacks}),[n?.clientId,n?.redirectUrl,n?.callbacks]);return t.useEffect(()=>{s.os(Qe({...r,auth:i}))},[r,i,s]),e.jsx(e.Fragment,{children:a})});TC.displayName="ContextConfigProvider";class RC extends yn{constructor(e){super(e)}async getAttributes(e){const t=await this.fetchResponse("users/attributes",{signal:e});t.ok||await this.throwResponseError(t,"Failed to fetch user attributes");const r=await this.unwrapResponse(t,"Failed to fetch user attributes");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});t.ok||await this.throwResponseError(t,"Failed to fetch user features");const r=await this.unwrapResponse(t,"Failed to fetch user features");return"object"==typeof r&&null!==r?r:{}}}const DC=t.createContext(void 0),IC=t.memo(({children:r})=>{const{t:n}=ln(),a=En(),s=function(){const e=En();return t.useMemo(()=>new RC(e),[e.serverUrl,e.version])}(),{isAuthenticated:i}=_C(),{serverUrl:o,version:c}=a,[l,d]=t.useState({}),[u,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);d(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Te(e,{component:"UserProvider",action:"fetchAttributes"})}else d({})},[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),Te(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),Te(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),Te(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]);kn(async e=>{if(!i||!o||!c)return d({}),void p({});h(!0),g(null);try{await Promise.all([b(e),w(e)])}finally{h(!1)}},[i,o,c,b,w],{onError:e=>Te(e,{component:"UserProvider",action:"initialFetch",metadata:{step:"fetchAttributesAndFeatures"}})});const k=t.useMemo(()=>({attributes:l,features:u,isLoading:m,error:f,updateAttributes:y,updateAttribute:x,refreshAttributes:v,refreshFeatures:S}),[l,u,m,f,y,x,v,S]);return e.jsx(DC.Provider,{value:k,children:r})});IC.displayName="UserProvider";const MC=t.lazy(()=>Promise.resolve().then(function(){return kC}).then(e=>({default:e.default})));const UC=({children:r})=>{const{currentWorkspace:n,switchToWorkspace:a,workspaces:s}=EC(),[i,o]=t.useState(!1),[c,l]=t.useState(yC.Profile),d=t.useRef(!1);return t.useEffect(()=>{const e=CC.getState();o(e.open),l(e.section);return CC.subscribe(e=>{o(e.open),l(e.section)})},[]),t.useEffect(()=>{if(d.current)return;if(!n)return;const e=_a();if(!e)return;const t=function(e){if(e.screen&&xC.has(e.screen))return e.screen;switch(e.action){case ba:case va:case ya:return yC.Subscription;case xa:return yC.Credits;default:return null}}(e);if(!t)return d.current=!0,void Pa();const r=e.ws;if(r&&r!==n._id){const e=s.find(e=>e._id===r);return e?void a(e).catch(e=>{Te(e,{component:"WorkspaceSettingsProvider",action:"switchWorkspaceFromUrl",metadata:{targetWs:r}}),d.current=!0,Pa()}):(d.current=!0,void Pa())}d.current=!0,CC.openWorkspaceSettings(t,e),Pa()},[n,s,a]),e.jsxs(e.Fragment,{children:[r,n&&i&&e.jsx(Ie,{fallback:null,children:e.jsx(t.Suspense,{fallback:null,children:e.jsx(MC,{workspace:n,open:i,onOpenChange:e=>{e||CC.closeSettings()},section:c,onSectionChange:e=>{CC.setSection(e)},showTrigger:!1})})})]})},LC=(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).`)},OC=t.memo(({serverUrl:r,version:n,orgId:a,auth:s,locale:i,defaultPermissions:o,getCheckoutStripeParams:c,children:l})=>{LC(r,n,a);const d=t.useMemo(()=>({serverUrl:r,version:n,orgId:a}),[r,n,a]),u=t.useMemo(()=>s?.callbacks,[s?.callbacks?.handleAuthentication,s?.callbacks?.onSignOut,s?.callbacks?.getSession,s?.callbacks?.onSessionExpired,s?.callbacks?.handleEvent,s?.callbacks?.onWorkspaceChange]),p=s?.callbacks?.handleEvent;return t.useEffect(()=>(ys.setCallbacks(p?{handleEvent:p}:null),()=>{ys.setCallbacks(null)}),[p]),e.jsx(tn,{locale:i,children:e.jsx(jt,{children:e.jsx(PC,{callbacks:u,children:e.jsx(el,{children:e.jsx(TC,{config:d,auth:s,children:e.jsx(Pt,{getCheckoutStripeParams:c,children:e.jsx(aa,{appPermissions:o,children:e.jsx(IC,{children:e.jsx(Wn,{children:e.jsx(oa,{children:e.jsx(ta,{children:e.jsx(Lv,{children:e.jsx(UC,{children:l})})})})})})})})})})})})})});OC.displayName="SaaSOSProviderInner";const zC=({children:t,...r})=>e.jsx(Ie,{children:e.jsx(OC,{...r,children:t})});zC.displayName="SaaSOSProvider";const FC=e=>{const{children:t}=e,{status:r}=_C();return r!==We.authenticated?null:t},BC=e=>{const{children:t}=e,{status:r}=_C();return r!==We.unauthenticated?null:t};FC.displayName="WhenAuthenticated",BC.displayName="WhenUnauthenticated";const WC=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=_C();return n.includes(a?.role??"")?t:r||null},VC=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=_C(),{currentWorkspace:s}=EC(),i=s?.users.find(e=>e._id===a?.id);return i&&n.includes(i?.role??"")?t:r||null};WC.displayName="WhenRoles",VC.displayName="WhenWorkspaceRoles";const GC=e=>{const{children:t,fallback:r,permission:n}=e,{can:a}=wl();return a(n)?t:r??null};function HC(){const e=t.useContext(DC);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])}}GC.displayName="WhenPermission";const $C=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=EC(),a=n?.features?.[r];return a?t:null},KC=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=EC(),a=n?.features?.[r];return a?null:t},qC=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=HC();return n(r)?t:null},ZC=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=HC();return n(r)?null:t};$C.displayName="WhenWorkspaceFeatureEnabled",KC.displayName="WhenWorkspaceFeatureDisabled",qC.displayName="WhenUserFeatureEnabled",ZC.displayName="WhenUserFeatureDisabled";const JC=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Vn();return s?r??null:a?.subscription?t:n??null},YC=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Vn();return s?r??null:a?.subscription?n??null:t},XC=e=>{const{children:t,plans:r,loadingComponent:n,fallbackComponent:a}=e,{response:s,loading:i}=Vn();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},QC=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Vn();return s?r??null:"trialing"!==a?.subscription?.subscriptionStatus?n??null:t},eE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Vn();return s?r??null:a?.subscription?.subscriptionStatus===Da?n??null:t},tE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n,daysThreshold:a=3}=e,{response:s,loading:i}=Vn();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};JC.displayName="WhenSubscription",YC.displayName="WhenNoSubscription",XC.displayName="WhenSubscriptionToPlans",QC.displayName="WhenTrialing",eE.displayName="WhenNotTrialing",tE.displayName="WhenTrialEnding";const rE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=ca();if(i)return n??null;const o=s?.[t];return o?o.available<=0?a??null:r:a??null},nE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=ca();if(i)return n??null;const o=s?.[t];return o?o.available>0?a??null:r:a??null},aE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=ca();if(i)return n??null;const o=s?.[t];return o&&o.hasOverage&&!1!==o.allowOverage?r:a??null},sE=e=>{const{slug:t,threshold:r,children:n,loadingComponent:a,fallbackComponent:s}=e,{quotas:i,loading:o}=ca();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};rE.displayName="WhenQuotaAvailable",nE.displayName="WhenQuotaExhausted",aE.displayName="WhenQuotaOverage",sE.displayName="WhenQuotaThreshold";const iE=({children:e})=>{const{currentWorkspace:t}=EC(),r=t?._id,{balance:n,loading:a,error:s,refetch:i}=ra(),{packages:o,loading:c}=Jn(r),{consumeCredits:l,loading:d,error:u}=qn(r),{purchaseCredits:p,loading:m,error:h}=Zn(r);return e({balance:n,loading:a,packages:o,packagesLoading:c,consume:l,consuming:d,purchase:async e=>{if(!r)throw new Error("No workspace selected");const{successUrl:t,cancelUrl:n}=ja(r),a=await p({creditPackageId:e._id,successUrl:t,cancelUrl:n});a.url&&da(a.url)},purchasing:m,refetch:i,error:u||h||s})};iE.displayName="CreditActionsProvider";const oE=({children:e})=>{const{balance:t,loading:r,error:n,refetch:a}=ra();return e({balance:t,loading:r,error:n,refetch:a})};oE.displayName="CreditBalance";const cE=e=>{const{min:t=1,children:r,loadingComponent:n,fallbackComponent:a}=e,{balance:s,loading:i}=ra();return i?n??null:s?s.available<t?a??null:r:a??null},lE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{balance:a,loading:s}=ra();return s?r??null:a?a.available>0?n??null:t:n??null},dE=e=>{const{threshold:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{balance:s,loading:i}=ra();return i?n??null:s?s.available>t?a??null:r:a??null};function uE(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}cE.displayName="WhenCreditsAvailable",lE.displayName="WhenCreditsExhausted",dE.displayName="WhenCreditsLow";class pE extends yn{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 pE(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 hE=fg({name:Wf().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:Wf().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 fE({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 gE({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"})}function bE(...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}var vE,yE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ui(`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}},{}),xE={exports:{}},wE={};function SE(){if(vE)return wE;vE=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,d=c[1];return s(function(){l.value=r,l.getSnapshot=t,o(l)&&d({inst:l})},[e,r,t]),a(function(){return o(l)&&d({inst:l}),e(function(){o(l)&&d({inst:l})})},[e]),i(r),r};return wE.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,wE}var kE,CE,EE={};
27
+ */function di(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function ui(...e){return t=>{let r=!1;const n=e.map(e=>{const n=di(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():di(e[t],null)}}}}function pi(...e){return a.useCallback(ui(...e),e)}var mi=Symbol.for("react.lazy"),hi=a[" use ".trim().toString()];function fi(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===mi&&"_payload"in e&&("object"==typeof(t=e._payload)&&null!==t&&"then"in t);var t}function gi(t){const r=vi(t),n=a.forwardRef((t,n)=>{let{children:s,...i}=t;fi(s)&&"function"==typeof hi&&(s=hi(s._payload));const o=a.Children.toArray(s),c=o.find(xi);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 bi=gi("Slot");function vi(e){const t=a.forwardRef((e,t)=>{let{children:r,...n}=e;if(fi(r)&&"function"==typeof hi&&(r=hi(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?ui(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 yi=Symbol("radix.slottable");function xi(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===yi}const wi=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Si=o,ki=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Si(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=wi(t)||wi(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 Si(e,i,c,null==r?void 0:r.class,null==r?void 0:r.className)},Ci=ki("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"}}),Ei=a.forwardRef(({className:t,variant:r,progress:n,size:s,startIcon:i,endIcon:o,asChild:c=!1,...l},d)=>{const u=c?bi:"button",p=function(e){switch(e){case"lg":return 20;case"sm":return 14;default:return 16}}(s);return e.jsxs(u,{disabled:n||l.disabled,className:Se(Ci({variant:r,size:s,withIcon:null!=n||null!=i||null!=o,className:t})),ref:d,...l,children:[n&&e.jsx($s,{size:p,className:"animate-spin"}),i&&a.cloneElement(i,{size:p}),l.children,o&&a.cloneElement(o,{size:p})]})});function Ni(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}function Ai(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,d=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:d,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}\``)}]},ji(s,...r)]}function ji(...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}Ei.displayName="Button";var _i=globalThis?.document?a.useLayoutEffect:()=>{},Pi=a[" useId ".trim().toString()]||(()=>{}),Ti=0;function Ri(e){const[t,r]=a.useState(Pi());return _i(()=>{r(e=>e??String(Ti++))},[e]),e||(t?`radix-${t}`:"")}var Di=a[" useInsertionEffect ".trim().toString()]||_i;function Ii({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 Di(()=>{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 d=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,d]}function Mi(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?ui(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 Ui=Symbol("radix.slottable");function Li(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Ui}var Oi=["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=Mi(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Li);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 zi(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...e)=>t.current?.(...e),[])}var Fi,Bi="dismissableLayer.update",Wi="dismissableLayer.pointerDownOutside",Vi="dismissableLayer.focusOutside",Gi=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Hi=a.forwardRef((t,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:c,onDismiss:l,...d}=t,u=a.useContext(Gi),[p,m]=a.useState(null),h=p?.ownerDocument??globalThis?.document,[,f]=a.useState({}),g=pi(r,e=>m(e)),b=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=b.indexOf(v),x=p?b.indexOf(p):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,S=x>=y,k=function(e,t=globalThis?.document){const r=zi(e),n=a.useRef(!1),s=a.useRef(()=>{});return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Ki(Wi,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=[...u.branches].some(e=>e.contains(t));S&&!r&&(i?.(e),c?.(e),e.defaultPrevented||l?.())},h),C=function(e,t=globalThis?.document){const r=zi(e),n=a.useRef(!1);return a.useEffect(()=>{const e=e=>{if(e.target&&!n.current){Ki(Vi,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;[...u.branches].some(e=>e.contains(t))||(o?.(e),c?.(e),e.defaultPrevented||l?.())},h);return function(e,t=globalThis?.document){const r=zi(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===u.layers.size-1&&(s?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),a.useEffect(()=>{if(p)return n&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Fi=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),$i(),()=>{n&&1===u.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=Fi)}},[p,h,n,u]),a.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),$i())},[p,u]),a.useEffect(()=>{const e=()=>f({});return document.addEventListener(Bi,e),()=>document.removeEventListener(Bi,e)},[]),e.jsx(Oi.div,{...d,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...t.style},onFocusCapture:Ni(t.onFocusCapture,C.onFocusCapture),onBlurCapture:Ni(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ni(t.onPointerDownCapture,k.onPointerDownCapture)})});Hi.displayName="DismissableLayer";function $i(){const e=new CustomEvent(Bi);document.dispatchEvent(e)}function Ki(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(Gi),s=a.useRef(null),i=pi(r,s);return a.useEffect(()=>{const e=s.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),e.jsx(Oi.div,{...t,ref:i})}).displayName="DismissableLayerBranch";var qi="focusScope.autoFocusOnMount",Zi="focusScope.autoFocusOnUnmount",Ji={bubbles:!1,cancelable:!0},Yi=a.forwardRef((t,r)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=t,[l,d]=a.useState(null),u=zi(i),p=zi(o),m=a.useRef(null),h=pi(r,e=>d(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:to(m.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||to(m.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&to(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){ro.add(f);const t=document.activeElement;if(!l.contains(t)){const r=new CustomEvent(qi,Ji);l.addEventListener(qi,u),l.dispatchEvent(r),r.defaultPrevented||(!function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(to(n,{select:t}),document.activeElement!==r)return}((e=Xi(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&to(l))}return()=>{l.removeEventListener(qi,u),setTimeout(()=>{const e=new CustomEvent(Zi,Ji);l.addEventListener(Zi,p),l.dispatchEvent(e),e.defaultPrevented||to(t??document.body,{select:!0}),l.removeEventListener(Zi,p),ro.remove(f)},0)}}var e},[l,u,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=Xi(e),r=Qi(t,e),n=Qi(t.reverse(),e);return[r,n]}(t);a&&s?e.shiftKey||r!==s?e.shiftKey&&r===a&&(e.preventDefault(),n&&to(s,{select:!0})):(e.preventDefault(),n&&to(a,{select:!0})):r===t&&e.preventDefault()}},[n,s,f.paused]);return e.jsx(Oi.div,{tabIndex:-1,...c,ref:h,onKeyDown:g})});function Xi(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 Qi(e,t){for(const r of e)if(!eo(r,{upTo:t}))return r}function eo(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 to(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()}}Yi.displayName="FocusScope";var ro=function(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=no(e,t),e.unshift(t)},remove(t){e=no(e,t),e[0]?.resume()}}}();function no(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var ao=a.forwardRef((t,n)=>{const{container:s,...i}=t,[o,c]=a.useState(!1);_i(()=>c(!0),[]);const l=s||o&&globalThis?.document?.body;return l?r.createPortal(e.jsx(Oi.div,{...i,ref:n}),l):null});ao.displayName="Portal";var so=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=io(n.current);i.current="mounted"===c?e:"none"},[c]),_i(()=>{const t=n.current,r=s.current;if(r!==e){const n=i.current,a=io(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]),_i(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,a=a=>{const i=io(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=io(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=pi(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 io(e){return e?.animationName||"none"}so.displayName="Presence";var oo=0;function co(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lo()),document.body.insertAdjacentElement("beforeend",e[1]??lo()),oo++,()=>{1===oo&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),oo--}},[])}function lo(){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 uo=function(){return uo=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},uo.apply(this,arguments)};function po(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 mo="right-scroll-bar-position",ho="width-before-scroll-bar";function fo(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var go="undefined"!=typeof window?a.useLayoutEffect:a.useEffect,bo=new WeakMap;function vo(e,r){var n,a,s,i=(n=null,a=function(t){return e.forEach(function(e){return fo(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 go(function(){var t=bo.get(i);if(t){var r=new Set(t),n=new Set(e),a=i.current;r.forEach(function(e){n.has(e)||fo(e,null)}),n.forEach(function(e){r.has(e)||fo(e,a)})}bo.set(i,e)},[e]),i}function yo(e){return e}var xo=function(e){var t=e.sideCar,r=po(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,uo({},r))};xo.isSideCarExport=!0;var wo=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=yo);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=uo({async:!0,ssr:!1},e),t}(),So=function(){},ko=a.forwardRef(function(e,t){var r=a.useRef(null),n=a.useState({onScrollCapture:So,onWheelCapture:So,onTouchMoveCapture:So}),s=n[0],i=n[1],o=e.forwardProps,c=e.children,l=e.className,d=e.removeScrollBar,u=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=po(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=m,k=vo([r,t]),C=uo(uo({},w),s);return a.createElement(a.Fragment,null,u&&a.createElement(S,{sideCar:wo,removeScrollBar:d,shards:p,noRelative:h,noIsolation:f,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:x}),o?a.cloneElement(a.Children.only(c),uo(uo({},C),{ref:k})):a.createElement(y,uo({},C,{className:l,ref:k}),c))});ko.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},ko.classNames={fullWidth:ho,zeroRight:mo};function Co(){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 Eo=function(){var e=0,t=null;return{add:function(r){var n,a;0==e&&(t=Co())&&(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)}}},No=function(){var e,t=(e=Eo(),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}},Ao={left:0,top:0,right:0,gap:0},jo=function(e){return parseInt(e||"",10)||0},_o=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Ao;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[jo(r),jo(n),jo(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])}},Po=No(),To="data-scroll-locked",Ro=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(To,"] {\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(mo," {\n right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(ho," {\n margin-right: ").concat(o,"px ").concat(n,";\n }\n \n .").concat(mo," .").concat(mo," {\n right: 0 ").concat(n,";\n }\n \n .").concat(ho," .").concat(ho," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(To,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(o,"px;\n }\n")},Do=function(){var e=parseInt(document.body.getAttribute(To)||"0",10);return isFinite(e)?e:0},Io=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(To,(Do()+1).toString()),function(){var e=Do()-1;e<=0?document.body.removeAttribute(To):document.body.setAttribute(To,e.toString())}},[]);var i=a.useMemo(function(){return _o(s)},[s]);return a.createElement(Po,{styles:Ro(i,!t,s,r?"":"!important")})},Mo=!1;if("undefined"!=typeof window)try{var Uo=Object.defineProperty({},"passive",{get:function(){return Mo=!0,!0}});window.addEventListener("test",Uo,Uo),window.removeEventListener("test",Uo,Uo)}catch(e){Mo=!1}var Lo=!!Mo&&{passive:!1},Oo=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])},zo=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),Fo(e,n)){var a=Bo(e,n);if(a[1]>a[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Fo=function(e,t){return"v"===e?function(e){return Oo(e,"overflowY")}(t):function(e){return Oo(e,"overflowX")}(t)},Bo=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)},Wo=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Vo=function(e){return[e.deltaX,e.deltaY]},Go=function(e){return e&&"current"in e?e.current:e},Ho=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},$o=0,Ko=[];function qo(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Zo,Jo=(Zo=function(e){var t=a.useRef([]),r=a.useRef([0,0]),n=a.useRef(),s=a.useState($o++)[0],i=a.useState(No)[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(Go),!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=Wo(e),i=r.current,c="deltaX"in e?e.deltaX:i[0]-s[0],l="deltaY"in e?e.deltaY:i[1]-s[1],d=e.target,u=Math.abs(c)>Math.abs(l)?"h":"v";if("touches"in e&&"h"===u&&"range"===d.type)return!1;var p=window.getSelection(),m=p&&p.anchorNode;if(m&&(m===d||m.contains(d)))return!1;var h=zo(u,d);if(!h)return!0;if(h?a=u:(a="v"===u?"h":"v",h=zo(u,d)),!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,d=0,u=0;do{if(!i)break;var p=Bo(e,i),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Fo(e,i)&&(d+=h,u+=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(d)<1||!l&&Math.abs(u)<1)&&(c=!0),c}(f,t,e,"h"===f?c:l)},[]),l=a.useCallback(function(e){var r=e;if(Ko.length&&Ko[Ko.length-1]===i){var n="deltaY"in r?Vo(r):Wo(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(Go).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?c(r,s[0]):!o.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),d=a.useCallback(function(e,r,n,a){var s={name:e,delta:r,target:n,should:a,shadowParent:qo(n)};t.current.push(s),setTimeout(function(){t.current=t.current.filter(function(e){return e!==s})},1)},[]),u=a.useCallback(function(e){r.current=Wo(e),n.current=void 0},[]),p=a.useCallback(function(t){d(t.type,Vo(t),t.target,c(t,e.lockRef.current))},[]),m=a.useCallback(function(t){d(t.type,Wo(t),t.target,c(t,e.lockRef.current))},[]);a.useEffect(function(){return Ko.push(i),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",l,Lo),document.addEventListener("touchmove",l,Lo),document.addEventListener("touchstart",u,Lo),function(){Ko=Ko.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,Lo),document.removeEventListener("touchmove",l,Lo),document.removeEventListener("touchstart",u,Lo)}},[]);var h=e.removeScrollBar,f=e.inert;return a.createElement(a.Fragment,null,f?a.createElement(i,{styles:Ho(s)}):null,h?a.createElement(Io,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},wo.useMedium(Zo),xo),Yo=a.forwardRef(function(e,t){return a.createElement(ko,uo({},e,{ref:t,sideCar:Jo}))});Yo.classNames=ko.classNames;var Xo=new WeakMap,Qo=new WeakMap,ec={},tc=0,rc=function(e){return e&&(e.host||rc(e.parentNode))},nc=function(e,t,r,n){var a=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=rc(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]);ec[r]||(ec[r]=new WeakMap);var s=ec[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 d=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(o.has(e))d(e);else try{var t=e.getAttribute(n),a=null!==t&&"false"!==t,c=(Xo.get(e)||0)+1,l=(s.get(e)||0)+1;Xo.set(e,c),s.set(e,l),i.push(e),1===c&&a&&Qo.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 d(t),o.clear(),tc++,function(){i.forEach(function(e){var t=Xo.get(e)-1,a=s.get(e)-1;Xo.set(e,t),s.set(e,a),t||(Qo.has(e)||e.removeAttribute(n),Qo.delete(e)),a||e.removeAttribute(r)}),--tc||(Xo=new WeakMap,Xo=new WeakMap,Qo=new WeakMap,ec={})}},ac=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"))),nc(n,a,r,"aria-hidden")):function(){return null}};function sc(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?ui(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 ic=Symbol("radix.slottable");function oc(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===ic}var cc="Dialog",[lc,dc]=Ai(cc),[uc,pc]=lc(cc),mc=t=>{const{__scopeDialog:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!0}=t,l=a.useRef(null),d=a.useRef(null),[u,p]=Ii({prop:s,defaultProp:i??!1,onChange:o,caller:cc});return e.jsx(uc,{scope:r,triggerRef:l,contentRef:d,contentId:Ri(),titleId:Ri(),descriptionId:Ri(),open:u,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(e=>!e),[p]),modal:c,children:n})};mc.displayName=cc;var hc="DialogTrigger",fc=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=pc(hc,n),i=pi(r,s.triggerRef);return e.jsx(Oi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Mc(s.open),...a,ref:i,onClick:Ni(t.onClick,s.onOpenToggle)})});fc.displayName=hc;var gc="DialogPortal",[bc,vc]=lc(gc,{forceMount:void 0}),yc=t=>{const{__scopeDialog:r,forceMount:n,children:s,container:i}=t,o=pc(gc,r);return e.jsx(bc,{scope:r,forceMount:n,children:a.Children.map(s,t=>e.jsx(so,{present:n||o.open,children:e.jsx(ao,{asChild:!0,container:i,children:t})}))})};yc.displayName=gc;var xc="DialogOverlay",wc=a.forwardRef((t,r)=>{const n=vc(xc,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=pc(xc,t.__scopeDialog);return i.modal?e.jsx(so,{present:a||i.open,children:e.jsx(kc,{...s,ref:r})}):null});wc.displayName=xc;var Sc=function(t){const r=sc(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(oc);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"),kc=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=pc(xc,n);return e.jsx(Yo,{as:Sc,allowPinchZoom:!0,shards:[s.contentRef],children:e.jsx(Oi.div,{"data-state":Mc(s.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),Cc="DialogContent",Ec=a.forwardRef((t,r)=>{const n=vc(Cc,t.__scopeDialog),{forceMount:a=n.forceMount,...s}=t,i=pc(Cc,t.__scopeDialog);return e.jsx(so,{present:a||i.open,children:i.modal?e.jsx(Nc,{...s,ref:r}):e.jsx(Ac,{...s,ref:r})})});Ec.displayName=Cc;var Nc=a.forwardRef((t,r)=>{const n=pc(Cc,t.__scopeDialog),s=a.useRef(null),i=pi(r,n.contentRef,s);return a.useEffect(()=>{const e=s.current;if(e)return ac(e)},[]),e.jsx(jc,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ni(t.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Ni(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:Ni(t.onFocusOutside,e=>e.preventDefault())})}),Ac=a.forwardRef((t,r)=>{const n=pc(Cc,t.__scopeDialog),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(jc,{...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()}})}),jc=a.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=t,l=pc(Cc,n),d=a.useRef(null),u=pi(r,d);return co(),e.jsxs(e.Fragment,{children:[e.jsx(Yi,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:i,onUnmountAutoFocus:o,children:e.jsx(Hi,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Mc(l.open),...c,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),e.jsxs(e.Fragment,{children:[e.jsx(zc,{titleId:l.titleId}),e.jsx(Fc,{contentRef:d,descriptionId:l.descriptionId})]})]})}),_c="DialogTitle",Pc=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=pc(_c,n);return e.jsx(Oi.h2,{id:s.titleId,...a,ref:r})});Pc.displayName=_c;var Tc="DialogDescription",Rc=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=pc(Tc,n);return e.jsx(Oi.p,{id:s.descriptionId,...a,ref:r})});Rc.displayName=Tc;var Dc="DialogClose",Ic=a.forwardRef((t,r)=>{const{__scopeDialog:n,...a}=t,s=pc(Dc,n);return e.jsx(Oi.button,{type:"button",...a,ref:r,onClick:Ni(t.onClick,()=>s.onOpenChange(!1))})});function Mc(e){return e?"open":"closed"}Ic.displayName=Dc;var Uc="DialogTitleWarning",[Lc,Oc]=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}\``)}]}(Uc,{contentName:Cc,titleName:_c,docsSlug:"dialog"}),zc=({titleId:e})=>{const t=Oc(Uc),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},Fc=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Oc("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},Bc=mc,Wc=fc,Vc=yc,Gc=wc,Hc=Ec,$c=Pc,Kc=Rc,qc=Ic;function Zc(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 Jc=["color"],Yc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Zc(e,Jc);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"}))}),Xc=["color"],Qc=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Zc(e,Xc);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"}))}),el=["color"],tl=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Zc(e,el);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"}))}),rl=["color"],nl=t.forwardRef(function(e,r){var n=e.color,a=void 0===n?"currentColor":n,s=Zc(e,rl);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 al=t.createContext({container:null,setContainer:()=>{}}),sl=t.memo(({children:r})=>{const[n,a]=t.useState(null),s=t.useMemo(()=>({container:n,setContainer:a}),[n]);return e.jsxs(al.Provider,{value:s,children:[r,e.jsx("div",{ref:a,id:"saas-os-portal",className:"saas-os-ui",style:{width:"100%",height:"100%"}})]})});sl.displayName="PortalProvider";const il=Bc,ol=Wc,cl=Vc,ll=a.forwardRef(({className:t,...r},n)=>e.jsx(Gc,{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}));ll.displayName=Gc.displayName;const dl=a.forwardRef(({className:t,children:r,...n},s)=>{const{container:i}=a.useContext(al);return e.jsxs(cl,{container:i,children:[e.jsx(ll,{}),e.jsxs(Hc,{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(qc,{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(tl,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})});dl.displayName=Hc.displayName;const ul=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-1.5 text-center sm:text-start",t),...r});ul.displayName="DialogHeader";const pl=a.forwardRef(({className:t,...r},n)=>e.jsx($c,{ref:n,className:Se("text-lg font-semibold leading-none tracking-tight",t),...r}));pl.displayName=$c.displayName;const ml=a.forwardRef(({className:t,...r},n)=>e.jsx(Kc,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));ml.displayName=Kc.displayName;const hl="saas-workspace-current",fl=e=>{e?un(hl,e._id):pn(hl)},gl=()=>dn(hl),bl=()=>{pn(hl)},vl=(e,t)=>!!e&&t.some(t=>t._id===e);function yl(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 xl(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 wl={WORKSPACE_SETTINGS_VIEW:"workspace:settings:view",WORKSPACE_SETTINGS_EDIT:"workspace:settings:edit",WORKSPACE_DELETE:"workspace:delete",WORKSPACE_MEMBERS_VIEW:"workspace:members:view",WORKSPACE_MEMBERS_INVITE:"workspace:members:invite",WORKSPACE_MEMBERS_REMOVE:"workspace:members:remove",WORKSPACE_MEMBERS_ROLE_CHANGE:"workspace:members:role-change",WORKSPACE_FEATURES_VIEW:"workspace:features:view",WORKSPACE_FEATURES_EDIT:"workspace:features:edit",WORKSPACE_BILLING_VIEW:"workspace:billing:view",WORKSPACE_BILLING_MANAGE:"workspace:billing:manage",WORKSPACE_USAGE_VIEW:"workspace:usage:view"},Sl=Object.values(wl),kl={admin:Sl.filter(e=>e!==wl.WORKSPACE_DELETE),member:[wl.WORKSPACE_SETTINGS_VIEW,wl.WORKSPACE_MEMBERS_VIEW,wl.WORKSPACE_FEATURES_VIEW,wl.WORKSPACE_BILLING_VIEW,wl.WORKSPACE_USAGE_VIEW],viewer:[wl.WORKSPACE_SETTINGS_VIEW,wl.WORKSPACE_MEMBERS_VIEW]};function Cl(e){const t=new Set;for(const r of Object.values(e))for(const e of r)t.add(e);return Array.from(t)}function El(e){const{userId:t,workspace:r,settings:n,appPermissions:a}=e;if(!r||!t)return new Set;if(yl(r,t)){const e=new Set(Sl);if(a)for(const t of Cl(a))e.add(t);if(r.permissions)for(const t of Cl(r.permissions))e.add(t);if(n?.workspace?.permissions)for(const t of Cl(n.workspace.permissions))e.add(t);return e}const s=e.workspaceRole??xl(r,t);if(!s)return new Set;const i=r.permissions,o=n?.workspace?.permissions,c=e=>e.filter(e=>e.startsWith("workspace:")),l=e=>e.filter(e=>!e.startsWith("workspace:")),d=i?.[s]?c(i[s]):[],u=o?.[s]?c(o[s]):[],p=kl[s]??[];let m;if(d.length>0)m=d;else if(u.length>0)m=u;else if(p.length>0)m=p;else{m=kl[n?.workspace?.defaultRole??"member"]??kl.member??[]}const h=new Set(m),f=i?.[s]?l(i[s]):[],g=a?.[s]?l(a[s]):[],b=f.length>0?f:g;for(const e of b)h.add(e);return function(e,t,r){if(!r?.workspace)return;const{canInviteMembers:n}=r.workspace;(!1===n||"admin-only"===n&&"admin"!==t)&&e.delete(wl.WORKSPACE_MEMBERS_INVITE)}(h,s,n),h}function Nl(e){const{user:r}=IC(),{currentWorkspace:n}=PC(),{settings:a}=An(),{appPermissions:s}=sa(),i=e??n??null,o=r?.id??null,c=t.useMemo(()=>i?xl(i,o):null,[i,o]),l=t.useMemo(()=>!!i&&yl(i,o),[i,o]),d=t.useMemo(()=>El({userId:o,workspaceRole:c,workspace:i,settings:a,appPermissions:s}),[o,c,i,a,s]),u=t.useCallback(e=>Array.isArray(e)?e.every(e=>d.has(e)):d.has(e),[d]);return{can:u,permissions:d,isOwner:l,role:c}}const Al={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:"฿"},jl={usd:"🇺🇸",eur:"🇪🇺",gbp:"🇬🇧",jpy:"🇯🇵",cad:"🇨🇦",aud:"🇦🇺",chf:"🇨🇭",cny:"🇨🇳",hkd:"🇭🇰",sgd:"🇸🇬",inr:"🇮🇳",mxn:"🇲🇽",brl:"🇧🇷",nzd:"🇳🇿",sek:"🇸🇪",nok:"🇳🇴",dkk:"🇩🇰",pln:"🇵🇱",thb:"🇹🇭"};function _l(e){return e&&e.trim()?jl[e.trim().toLowerCase()]??"":""}function Pl(e){if(!e||!e.trim())return"";const t=e.trim().toLowerCase();return Al[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()} (${Pl(e)})`}));const Tl=({open:r,onOpenChange:n,packages:a,billingCurrency:s,workspaceName:i,onSelectPackage:o,purchasingPackageId:c,loading:l=!1})=>{const{t:d,dir:u,fmtNum:p,fmtCents:m}=ln(),h=t.useMemo(()=>{const e=new Set;return a.forEach(t=>{t.pricingVariants?.forEach(t=>{t.currency&&e.add(t.currency.toLowerCase())})}),Array.from(e)},[a]),f=t.useMemo(()=>{const e=s?.trim().toLowerCase();return e?h.includes(e)?[e]:[]:h},[s,h]),[g,b]=t.useState(()=>f.length>0?f[0]:""),v=s?.trim().toLowerCase()||g,y=l||!!c;return e.jsx(il,{open:r,onOpenChange:n,children:e.jsxs(dl,{dir:u,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(pl,{className:"text-xl sm:text-2xl font-bold",children:d("credits.dialogTitle")}),e.jsxs(ml,{className:"mt-1 text-sm",children:[d("credits.dialogDescription"),i&&e.jsx("span",{className:"ms-1 font-medium text-foreground",children:d("credits.dialogDescriptionWorkspace",{workspace:i})})]})]}),!s?.trim()&&f.length>1&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-slate-600",children:d("pricing.currency")}),e.jsx("div",{className:"flex gap-1 rounded-lg border border-gray-200 bg-gray-50/50 p-1",children:f.map(t=>e.jsxs("button",{type:"button",onClick:()=>b(t),className:Se("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",v===t?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:[Pl(t)," ",t.toUpperCase()]},t))})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:0===a.length?e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-gray-400",children:[e.jsx(Fs,{className:"h-12 w-12 mb-3"}),e.jsx("p",{className:"text-sm",children:d("credits.noPackages")})]}):e.jsx("div",{className:"max-w-2xl mx-auto px-4 py-6 sm:px-6 space-y-4",children:a.map(t=>{const r=t.pricingVariants?.find(e=>e.currency?.toLowerCase()===v)??t.pricingVariants?.[0],n=r?.amount,a=r?.currency??v,s=c===t._id,i=null!=n&&n>0&&t.creditAmount>0?Math.round(n/t.creditAmount):null;return e.jsxs("div",{className:Se("rounded-xl border p-5 sm:p-6 flex flex-col sm:flex-row sm:items-center gap-4 transition-all",s?"border-primary bg-primary/5 shadow-md":"border-gray-200 hover:border-gray-300 hover:shadow-sm"),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:t.name}),e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-blue-50 px-2.5 py-0.5 text-xs font-medium text-blue-700",children:[e.jsx(Fs,{className:"h-3 w-3"}),d("credits.creditsAmount",{count:p(t.creditAmount)})]})]}),t.description&&e.jsx("p",{className:"text-sm text-gray-500 mb-2",children:t.description}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-gray-400",children:[e.jsx("span",{children:t.validityDays?d("credits.validityDays",{count:t.validityDays}):d("credits.validityUnlimited")}),null!=i&&e.jsx("span",{children:d("credits.perCredit",{price:m(i,a)})})]})]}),e.jsxs("div",{className:"flex items-center gap-4 sm:flex-col sm:items-end sm:gap-2 shrink-0",children:[null!=n&&e.jsx("span",{className:"text-2xl sm:text-3xl font-bold text-gray-900 whitespace-nowrap",children:m(n,a)}),e.jsx(Ei,{size:"sm",onClick:()=>o(t),disabled:y,progress:s,className:"whitespace-nowrap",children:s?d("credits.purchasing"):d("credits.buyAmount",{count:p(t.creditAmount)})})]})]},t._id)})})})]})})},Rl=({titleKey:t,descriptionKey:r})=>{const{t:n}=ln();return 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(Qs,{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:n(t??"settings.common.noPermissionTitle")}),e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:n(r??"settings.common.noPermissionDescription")})]})]})})};function Dl({className:t,...r}){return e.jsx("div",{className:Se("animate-pulse rounded-md bg-primary/10",t),...r})}function Il(){return e.jsxs("div",{className:"space-y-3.5",children:[e.jsx(Dl,{className:"h-10 w-full"}),e.jsx(Dl,{className:"h-10 w-full"}),e.jsx(Dl,{className:"h-10 w-full"})]})}function Ml(e,t="en-US",r){try{const n=new Date(e);return isNaN(n.getTime())?"":new Intl.DateTimeFormat(t,r??{month:"short",day:"numeric",year:"numeric"}).format(n)}catch{return""}}function Ul(e,t="en-US"){return Ml(e,t,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"})}function Ll(e,t="en-US"){return e?new Date(1e3*e).toLocaleDateString(t,{year:"numeric",month:"short",day:"numeric"}):""}const Ol={[Qa]:"credits.type.plan_grant",[es]:"credits.type.pack_purchased",[ts]:"credits.type.consumed",[rs]:"credits.type.expired",[ns]:"credits.type.admin_grant",[as]:"credits.type.admin_revoke",[ss]:"credits.type.refund"};const zl=({workspace:r})=>{const n=r._id?.toString(),{t:a,fmtNum:s}=ln(),{can:i}=Nl(),o=i(wl.WORKSPACE_BILLING_VIEW),c=i(wl.WORKSPACE_BILLING_MANAGE),{balance:l,loading:d,error:u,refetch:p}=ra(),{packages:m,loading:h}=Jn(n),{expiringCredits:f,loading:g}=Xn(n,7),[b,v]=t.useState(1),{transactions:y,hasNextPage:x,loading:w}=Yn(n,{limit:10,page:b}),[S,k]=t.useState([]);t.useEffect(()=>{w||0===y.length||k(1===b?y:e=>{const t=new Set(e.map(e=>e._id)),r=y.filter(e=>!t.has(e._id));return r.length>0?[...e,...r]:e})},[y,b,w]);const C=t.useCallback(()=>{x&&!w&&v(e=>e+1)},[x,w]),E=S,{purchaseCredits:N,loading:A}=Zn(n),[j,_]=t.useState(!1),[P,T]=t.useState(null),[R,D]=t.useState(!1),[I,M]=t.useState(!1),[U,L]=t.useState(null),[O,z]=t.useState(!1),F=t.useRef(!1),B=d&&!l;t.useEffect(()=>{if(F.current)return;const e=_C.getState();if(!e.params?.action)return;if(e.params.action===Na)return F.current=!0,_C.clearParams(),void z(!0);if(e.params.action!==Ea)return;F.current=!0;const t=e.params.status;if(_C.clearParams(),t===Aa){D(!0),$n();const e=setTimeout(()=>D(!1),8e3);return()=>clearTimeout(e)}if(t===ja){M(!0);const e=setTimeout(()=>M(!1),5e3);return()=>clearTimeout(e)}t===_a&&T(a("credits.purchaseFailed"))},[]);if(B)return e.jsx(Il,{});if(!o)return e.jsx(Rl,{});if(!n)return e.jsx("div",{className:"border rounded-lg p-4 text-center text-gray-500",children:e.jsx("p",{children:a("subscription.invalidWorkspace")})});const W=!h&&m.length>0;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-gray-600",children:a("credits.description")}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[W&&c&&e.jsxs(Ei,{size:"sm",onClick:()=>z(!0),children:[e.jsx(ti,{className:"h-3.5 w-3.5 me-1.5"}),a("credits.buyCredits")]}),e.jsxs(Ei,{variant:"ghost",size:"sm",onClick:async()=>{_(!0);try{await p()}finally{_(!1)}},disabled:j,children:[e.jsx(Js,{className:Se("h-3.5 w-3.5 me-1.5",j&&"animate-spin")}),a("settings.common.refreshAction",{loading:String(j)})]})]})]}),u&&e.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg",children:[e.jsx("p",{className:"font-medium",children:a("credits.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:u})]}),R&&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",{className:"flex items-center gap-2",children:[e.jsx(zs,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("p",{className:"text-sm font-medium",children:a("credits.purchaseSuccess")})]}),e.jsx(Ei,{variant:"outline",size:"sm",onClick:()=>D(!1),className:"flex-shrink-0 border-green-200 text-green-700 hover:bg-green-100",children:a("settings.common.dismiss")})]}),I&&e.jsxs("div",{className:"bg-amber-50 border border-amber-200 text-amber-700 px-4 py-3 rounded-lg flex items-start justify-between gap-4",children:[e.jsx("p",{className:"text-sm font-medium",children:a("credits.purchaseCanceled")}),e.jsx(Ei,{variant:"outline",size:"sm",onClick:()=>M(!1),className:"flex-shrink-0 border-amber-200 text-amber-700 hover:bg-amber-100",children:a("settings.common.dismiss")})]}),P&&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.jsx("p",{className:"text-sm",children:P}),e.jsx(Ei,{variant:"outline",size:"sm",onClick:()=>T(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.dismiss")})]}),e.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[e.jsxs("div",{className:"bg-gray-50/50 p-4 sm:p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-500 uppercase tracking-wider",children:a("credits.balance")}),e.jsx(Fs,{className:"h-5 w-5 text-gray-400"})]}),l?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"text-3xl font-bold text-gray-900 mb-4",children:s(l.available)}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.totalGranted")}),e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s(l.totalGranted)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.totalConsumed")}),e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s(l.totalConsumed)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.totalExpired")}),e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s(l.totalExpired)})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-gray-500",children:a("credits.available")}),e.jsx("p",{className:"text-sm font-semibold text-green-600",children:s(l.available)})]})]})]}):e.jsxs("div",{className:"text-center py-4",children:[e.jsx(Fs,{className:"h-10 w-10 text-gray-300 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-gray-600",children:a("credits.noCredits")}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:a("credits.noCreditsHint")}),W&&c&&e.jsxs(Ei,{size:"sm",className:"mt-3",onClick:()=>z(!0),children:[e.jsx(ti,{className:"h-3.5 w-3.5 me-1.5"}),a("credits.buyCredits")]})]})]}),!g&&f>0&&e.jsx("div",{className:"px-4 py-3 bg-amber-50 border-t border-amber-200 text-sm text-amber-800",children:a("credits.expiringInDays",{count:f,days:7})})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-semibold text-gray-900 mb-3",children:a("credits.transactions")}),w&&0===E.length?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($s,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}):0===E.length?e.jsx("div",{className:"border rounded-lg p-6 text-center",children:e.jsx("p",{className:"text-sm text-gray-500",children:a("credits.noTransactions")})}):e.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[e.jsx("div",{className:"divide-y divide-gray-100",children:E.map(t=>e.jsx(Fl,{tx:t},t._id))}),x&&e.jsx("div",{className:"border-t border-gray-200 px-4 py-3 text-center",children:e.jsx(Ei,{variant:"ghost",size:"sm",onClick:C,disabled:w,progress:w&&b>1,children:a("credits.loadMore")})})]})]}),W&&c&&e.jsx(Tl,{open:O,onOpenChange:z,packages:m,billingCurrency:r.billingCurrency,workspaceName:r.name,onSelectPackage:async e=>{if(n){T(null),L(e._id);try{const{successUrl:t,cancelUrl:r}=Da(n),a=await N({creditPackageId:e._id,successUrl:t,cancelUrl:r});a.url&&fa(a.url)}catch(e){T(e instanceof Error?e.message:a("errors.purchaseCredits")),L(null)}}},purchasingPackageId:U,loading:A})]})};function Fl({tx:t}){const{t:r,formattingLocale:n,fmtNum:a}=ln(),s=Ol[t.type]??"credits.type.consumed",i=function(e){switch(e){case"plan_grant":case"admin_grant":case"refund":return"bg-green-100 text-green-800";case"pack_purchased":return"bg-blue-100 text-blue-800";case"consumed":default:return"bg-gray-100 text-gray-800";case"expired":case"admin_revoke":return"bg-red-100 text-red-800"}}(t.type),o=t.amount>0;return e.jsx("div",{className:"px-3 py-3 sm:px-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 mb-0.5",children:[e.jsx("span",{className:Se("inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium shrink-0",i),children:r(s)}),t.description&&e.jsx("p",{className:"text-sm text-gray-700 truncate",children:t.description})]}),e.jsx("p",{className:"text-xs text-gray-400",children:Ul(t.createdAt,n)})]}),e.jsxs("div",{className:"text-end shrink-0",children:[e.jsxs("span",{className:Se("text-sm font-semibold",o?"text-green-600":"text-gray-900"),children:[o?"+":"",a(t.amount)]}),e.jsx("p",{className:"text-xs text-gray-400",children:a(t.balanceAfter)})]})]})})}var Bl=Symbol("radix.slottable");var Wl="AlertDialog",[Vl]=Ai(Wl,[dc]),Gl=dc(),Hl=t=>{const{__scopeAlertDialog:r,...n}=t,a=Gl(r);return e.jsx(Bc,{...a,...n,modal:!0})};Hl.displayName=Wl;var $l=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=Gl(n);return e.jsx(Wc,{...s,...a,ref:r})});$l.displayName="AlertDialogTrigger";var Kl=t=>{const{__scopeAlertDialog:r,...n}=t,a=Gl(r);return e.jsx(Vc,{...a,...n})};Kl.displayName="AlertDialogPortal";var ql=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=Gl(n);return e.jsx(Gc,{...s,...a,ref:r})});ql.displayName="AlertDialogOverlay";var Zl="AlertDialogContent",[Jl,Yl]=Vl(Zl),Xl=function(t){const r=({children:t})=>e.jsx(e.Fragment,{children:t});return r.displayName=`${t}.Slottable`,r.__radixId=Bl,r}("AlertDialogContent"),Ql=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,children:s,...i}=t,o=Gl(n),c=a.useRef(null),l=pi(r,c),d=a.useRef(null);return e.jsx(Lc,{contentName:Zl,titleName:ed,docsSlug:"alert-dialog",children:e.jsx(Jl,{scope:n,cancelRef:d,children:e.jsxs(Hc,{role:"alertdialog",...o,...i,ref:l,onOpenAutoFocus:Ni(i.onOpenAutoFocus,e=>{e.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[e.jsx(Xl,{children:s}),e.jsx(od,{contentRef:c})]})})})});Ql.displayName=Zl;var ed="AlertDialogTitle",td=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=Gl(n);return e.jsx($c,{...s,...a,ref:r})});td.displayName=ed;var rd="AlertDialogDescription",nd=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=Gl(n);return e.jsx(Kc,{...s,...a,ref:r})});nd.displayName=rd;var ad=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,s=Gl(n);return e.jsx(qc,{...s,...a,ref:r})});ad.displayName="AlertDialogAction";var sd="AlertDialogCancel",id=a.forwardRef((t,r)=>{const{__scopeAlertDialog:n,...a}=t,{cancelRef:s}=Yl(sd,n),i=Gl(n),o=pi(r,s);return e.jsx(qc,{...i,...a,ref:o})});id.displayName=sd;var od=({contentRef:e})=>{const t=`\`${Zl}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${Zl}\` by passing a \`${rd}\` 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 \`${Zl}\`. 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},cd=ql,ld=Ql,dd=ad,ud=id,pd=td,md=nd;const hd=Hl,fd=$l,gd=Kl,bd=a.forwardRef(({className:t,...r},n)=>e.jsx(cd,{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}));bd.displayName=cd.displayName;const vd=a.forwardRef(({className:t,...r},n)=>{const{container:s}=a.useContext(al);return e.jsxs(gd,{container:s,children:[e.jsx(bd,{}),e.jsx(ld,{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})]})});vd.displayName=ld.displayName;const yd=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col space-y-2 text-center sm:text-start",t),...r});yd.displayName="AlertDialogHeader";const xd=({className:t,...r})=>e.jsx("div",{className:Se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r});xd.displayName="AlertDialogFooter";const wd=a.forwardRef(({className:t,...r},n)=>e.jsx(pd,{ref:n,className:Se("text-lg font-semibold",t),...r}));wd.displayName=pd.displayName;const Sd=a.forwardRef(({className:t,...r},n)=>e.jsx(md,{ref:n,className:Se("text-sm text-muted-foreground",t),...r}));Sd.displayName=md.displayName;const kd=a.forwardRef(({className:t,...r},n)=>e.jsx(dd,{ref:n,className:Se(Ci(),t),...r}));kd.displayName=dd.displayName;const Cd=a.forwardRef(({className:t,...r},n)=>e.jsx(ud,{ref:n,className:Se(Ci({variant:"outline"}),"mt-2 sm:mt-0",t),...r}));Cd.displayName=ud.displayName;const Ed=({workspace:r})=>{const[n,a]=t.useState(!1),{deleteWorkspace:s}=PC(),{can:i}=Nl(),{settings:o}=An(),{t:c}=ln();if(1===(o?.workspace?.maxWorkspacesPerUser??0))return null;if(!r)return e.jsx(Il,{});return i(wl.WORKSPACE_DELETE)?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(hd,{children:[e.jsx(fd,{asChild:!0,children:e.jsxs(Ei,{variant:"destructive",disabled:n,progress:n,children:[e.jsx(si,{className:"h-4 w-4 me-2"}),c("danger.deleteWorkspace")]})}),e.jsxs(vd,{children:[e.jsxs(yd,{children:[e.jsx(wd,{children:c("danger.deleteConfirm")}),e.jsx(Sd,{children:c("danger.deleteConfirmDescription")})]}),e.jsxs(xd,{children:[e.jsx(Cd,{disabled:n,children:c("settings.common.cancel")}),e.jsx(kd,{onClick:async()=>{a(!0);try{await s(r._id)}catch(e){Te(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($s,{className:"me-2 h-4 w-4 animate-spin"}),c("danger.deleting")]}):c("danger.deleteWorkspace")})]})]})]})]}):e.jsx(Rl,{descriptionKey:"danger.adminOnly"})};function Nd(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 Ad(e){const[t,r]=a.useState(void 0);return _i(()=>{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 jd="Switch",[_d]=Ai(jd),[Pd,Td]=_d(jd),Rd=a.forwardRef((t,r)=>{const{__scopeSwitch:n,name:s,checked:i,defaultChecked:o,required:c,disabled:l,value:d="on",onCheckedChange:u,form:p,...m}=t,[h,f]=a.useState(null),g=pi(r,e=>f(e)),b=a.useRef(!1),v=!h||(p||!!h.closest("form")),[y,x]=Ii({prop:i,defaultProp:o??!1,onChange:u,caller:jd});return e.jsxs(Pd,{scope:n,checked:y,disabled:l,children:[e.jsx(Oi.button,{type:"button",role:"switch","aria-checked":y,"aria-required":c,"data-state":Ud(y),"data-disabled":l?"":void 0,disabled:l,value:d,...m,ref:g,onClick:Ni(t.onClick,e=>{x(e=>!e),v&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})}),v&&e.jsx(Md,{control:h,bubbles:!b.current,name:s,value:d,checked:y,required:c,disabled:l,form:p,style:{transform:"translateX(-100%)"}})]})});Rd.displayName=jd;var Dd="SwitchThumb",Id=a.forwardRef((t,r)=>{const{__scopeSwitch:n,...a}=t,s=Td(Dd,n);return e.jsx(Oi.span,{"data-state":Ud(s.checked),"data-disabled":s.disabled?"":void 0,...a,ref:r})});Id.displayName=Dd;var Md=a.forwardRef(({__scopeSwitch:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=pi(c,o),d=Nd(n),u=Ad(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[d,n,s]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Ud(e){return e?"checked":"unchecked"}Md.displayName="SwitchBubbleInput";var Ld=Rd,Od=Id;const zd=a.forwardRef(({className:t,...r},n)=>e.jsx(Ld,{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(Od,{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")})}));function Fd(e=5e3){const[r,n]=t.useState(null),a=t.useRef(null);t.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]);return{message:r,show:t.useCallback(t=>{n(t),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{n(null)},e)},[e]),clear:t.useCallback(()=>{n(null),a.current&&clearTimeout(a.current)},[])}}zd.displayName=Ld.displayName;const Bd=({workspaceId:r})=>{const{t:n}=ln(),{allFeatures:a,updateFeature:s,getWorkspace:i}=PC(),{can:o}=Nl(),[c,l]=t.useState({}),d=Fd(),[u,p]=t.useState(null);if(t.useEffect(()=>{i(r).then(p)},[r]),!u)return e.jsx(Il,{});const m=o(wl.WORKSPACE_FEATURES_EDIT);return e.jsxs("div",{children:[d.message&&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:d.message})]}),e.jsxs("div",{className:"flex flex-col gap-y-3.5 pe-4",children:[!m&&e.jsx(Rl,{descriptionKey:"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=u?.features?.[t.slug],i=null!==c[t.slug]&&void 0!==c[t.slug],o=c[t.slug],h=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($s,{className:"h-4 w-4 animate-spin text-gray-500"}),e.jsxs("span",{className:"text-sm text-gray-600",children:[h,"..."]})]}):e.jsx(zd,{disabled:!m,checked:r??t.defaultValue,onCheckedChange:e=>async function(e,t){if(u){l(r=>({...r,[e]:t})),d.clear();try{const r=await s(u._id,e,t);p(r);const i=a.find(t=>t.slug===e),o=i?.name||"Feature";d.show(n("features.updateSuccess",{feature:o,enabled:String(t)}))}catch(t){Te(t,{component:"WorkspaceSettingsFeatures",action:"updateFeature",metadata:{workspaceId:u._id,featureKey:e}})}finally{l(t=>({...t,[e]:null}))}}}(t.slug,e)})]},t._id)})})]})]})};var Wd=e=>"checkbox"===e.type,Vd=e=>e instanceof Date,Gd=e=>null==e;const Hd=e=>"object"==typeof e;var $d=e=>!Gd(e)&&!Array.isArray(e)&&Hd(e)&&!Vd(e),Kd=e=>$d(e)&&e.target?Wd(e.target)?e.target.checked:e.target.value:e,qd=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),Zd="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Jd(e){if(e instanceof Date)return new Date(e);const t="undefined"!=typeof FileList&&e instanceof FileList;if(Zd&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!(r||$d(e)&&(e=>{const t=e.constructor&&e.constructor.prototype;return $d(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]=Jd(e[t]));return n}var Yd=e=>/^\w*$/.test(e),Xd=e=>void 0===e,Qd=e=>Array.isArray(e)?e.filter(Boolean):[],eu=e=>Qd(e.replace(/["|']|\]/g,"").split(/\.|\[/)),tu=(e,t,r)=>{if(!t||!$d(e))return r;const n=(Yd(t)?[t]:eu(t)).reduce((e,t)=>Gd(e)?e:e[t],e);return Xd(n)||n===e?Xd(e[t])?r:e[t]:n},ru=e=>"boolean"==typeof e,nu=e=>"function"==typeof e,au=(e,t,r)=>{let n=-1;const a=Yd(t)?[t]:eu(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=$d(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=s,e=e[t]}};const su="blur",iu="focusout",ou="change",cu="onBlur",lu="onChange",du="onSubmit",uu="onTouched",pu="all",mu="max",hu="min",fu="maxLength",gu="minLength",bu="pattern",vu="required",yu="validate",xu=t.createContext(null);xu.displayName="HookFormControlContext";const wu=()=>t.useContext(xu);var Su=(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]!==pu&&(t._proxyFormState[a]=!n||pu),r&&(r[a]=!0),e[a]}});return a};const ku="undefined"!=typeof window?t.useLayoutEffect:t.useEffect;var Cu=e=>"string"==typeof e,Eu=(e,t,r,n,a)=>Cu(e)?(n&&t.watch.add(e),tu(r,e,a)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),tu(r,e))):(n&&(t.watchAll=!0),r),Nu=e=>Gd(e)||!Hd(e);function Au(e,t,r=new WeakSet){if(Nu(e)||Nu(t))return Object.is(e,t);if(Vd(e)&&Vd(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(Vd(n)&&Vd(e)||$d(n)&&$d(e)||Array.isArray(n)&&Array.isArray(e)?!Au(n,e,r):!Object.is(n,e))return!1}}return!0}function ju(e){const r=wu(),{name:n,disabled:a,control:s=r,shouldUnregister:i,defaultValue:o,exact:c=!0}=e,l=qd(s._names.array,n),d=t.useMemo(()=>tu(s._formValues,n,tu(s._defaultValues,n,o)),[s,n,o]),u=function(e){const r=wu(),{control:n=r,name:a,defaultValue:s,disabled:i,exact:o,compute:c}=e||{},l=t.useRef(s),d=t.useRef(c),u=t.useRef(void 0),p=t.useRef(n),m=t.useRef(a);d.current=c;const[h,f]=t.useState(()=>{const e=n._getWatch(a,l.current);return d.current?d.current(e):e}),g=t.useCallback(e=>{const t=Eu(a,n._names,e||n._formValues,!1,l.current);return d.current?d.current(t):t},[n._formValues,n._names,a]),b=t.useCallback(e=>{if(!i){const t=Eu(a,n._names,e||n._formValues,!1,l.current);if(d.current){const e=d.current(t);Au(e,u.current)||(f(e),u.current=e)}else f(t)}},[n._formValues,n._names,i,a]);ku(()=>(p.current===n&&Au(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&&!Au(y,a);return v||e?g():null},[i,v,a,y,g]);return null!==x?x:h}({control:s,name:n,defaultValue:d,exact:c}),p=function(e){const r=wu(),{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 ku(()=>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(()=>Su(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:u,...ru(e.disabled)?{disabled:e.disabled}:{}}));m.current=e;const g=t.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!tu(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!tu(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!tu(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!tu(p.validatingFields,n)},error:{enumerable:!0,get:()=>tu(p.errors,n)}}),[p,n]),b=t.useCallback(e=>f.current.onChange({target:{value:Kd(e),name:n},type:ou}),[n]),v=t.useCallback(()=>f.current.onBlur({target:{value:tu(s._formValues,n),name:n},type:su}),[n,s._formValues]),y=t.useCallback(e=>{const t=tu(s._fields,n);t&&t._f&&e&&(t._f.ref={focus:()=>nu(e.focus)&&e.focus(),select:()=>nu(e.select)&&e.select(),setCustomValidity:t=>nu(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>nu(e.reportValidity)&&e.reportValidity()})},[s._fields,n]),x=t.useMemo(()=>({name:n,value:u,...ru(a)||p.disabled?{disabled:p.disabled||a}:{},onChange:b,onBlur:v,ref:y}),[n,a,p.disabled,b,v,y,u]);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,...ru(m.current.disabled)?{disabled:m.current.disabled}:{}});const r=(e,t)=>{const r=tu(s._fields,e);r&&r._f&&(r._f.mount=t)};if(r(n,!0),e){const e=Jd(tu(s._options.defaultValues,n,m.current.defaultValue));au(s._defaultValues,n,e),Xd(tu(s._formValues,n))&&au(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 _u=e=>e.render(ju(e)),Pu=t.createContext(null);Pu.displayName="HookFormContext";const Tu=e=>{const{children:r,watch:n,getValues:a,getFieldState:s,setError:i,clearErrors:o,setValue:c,trigger:l,formState:d,resetField:u,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}=e;return t.createElement(Pu.Provider,{value:t.useMemo(()=>({watch:n,getValues:a,getFieldState:s,setError:i,clearErrors:o,setValue:c,trigger:l,formState:d,resetField:u,reset:p,handleSubmit:m,unregister:h,control:f,register:g,setFocus:b,subscribe:v}),[o,f,d,s,a,m,g,p,u,i,b,c,v,l,h,n])},t.createElement(xu.Provider,{value:f},r))};var Ru=(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],Iu=()=>{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&&$d(a)&&s){const e=Mu(a,s);$d(e)&&(r[n]=e)}else e[n]&&(r[n]=s)}return r}var Uu=e=>$d(e)&&!Object.keys(e).length,Lu=e=>"file"===e.type,Ou=e=>{if(!Zd)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},zu=e=>"select-multiple"===e.type,Fu=e=>"radio"===e.type,Bu=e=>Ou(e)&&e.isConnected;function Wu(e,t){const r=Array.isArray(t)?t:Yd(t)?[t]:eu(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Xd(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,s=r[a];return n&&delete n[s],0!==a&&($d(n)&&Uu(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Xd(e[t]))return!1;return!0}(n))&&Wu(e,r.slice(0,-1)),e}function Vu(e){return Array.isArray(e)||$d(e)&&!(e=>{for(const t in e)if(nu(e[t]))return!0;return!1})(e)}function Gu(e,t={}){for(const r in e){const n=e[r];Vu(n)?(t[r]=Array.isArray(n)?[]:{},Gu(n,t[r])):Xd(n)||(t[r]=!0)}return t}function Hu(e,t,r){r||(r=Gu(t));for(const n in e){const a=e[n];if(Vu(a))Xd(t)||Nu(r[n])?r[n]=Gu(a,Array.isArray(a)?[]:{}):Hu(a,Gd(t)?{}:t[n],r[n]);else{const e=t[n];r[n]=!Au(a,e)}}return r}const $u={value:!1,isValid:!1},Ku={value:!0,isValid:!0};var qu=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&&!Xd(e[0].attributes.value)?Xd(e[0].value)||""===e[0].value?Ku:{value:e[0].value,isValid:!0}:Ku:$u}return $u},Zu=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Xd(e)?e:t?""===e?NaN:e?+e:e:r&&Cu(e)?new Date(e):n?n(e):e;const Ju={isValid:!1,value:null};var Yu=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,Ju):Ju;function Xu(e){const t=e.ref;return Lu(t)?t.files:Fu(t)?Yu(e.refs).value:zu(t)?[...t.selectedOptions].map(({value:e})=>e):Wd(t)?qu(e.refs).value:Zu(Xd(t.value)?e.ref.value:t.value,e)}var Qu=e=>e instanceof RegExp,ep=e=>Xd(e)?e:Qu(e)?e.source:$d(e)?Qu(e.value)?e.value.source:e.value:e,tp=e=>({isOnSubmit:!e||e===du,isOnBlur:e===cu,isOnChange:e===lu,isOnAll:e===pu,isOnTouch:e===uu});const rp="AsyncFunction";var np=e=>!!e&&!!e.validate&&!!(nu(e.validate)&&e.validate.constructor.name===rp||$d(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===rp)),ap=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const sp=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=tu(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(sp(s,t))break}else if($d(s)&&sp(s,t))break}}};function ip(e,t,r){const n=tu(e,r);if(n||Yd(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),s=tu(t,n),i=tu(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 op=(e,t,r)=>{const n=Du(tu(e,r));return au(n,"root",t[r]),au(e,r,n),e};function cp(e,t,r="validate"){if(Cu(e)||Array.isArray(e)&&e.every(Cu)||ru(e)&&!e)return{type:r,message:Cu(e)?e:"",ref:t}}var lp=e=>$d(e)&&!Qu(e)?e:{value:e,message:""},dp=async(e,t,r,n,a,s)=>{const{ref:i,refs:o,required:c,maxLength:l,minLength:d,min:u,max:p,pattern:m,validate:h,name:f,valueAsNumber:g,mount:b}=e._f,v=tu(r,f);if(!b||t.has(f))return{};const y=o?o[0]:i,x=e=>{a&&y.reportValidity&&(y.setCustomValidity(ru(e)?"":e||""),y.reportValidity())},w={},S=Fu(i),k=Wd(i),C=S||k,E=(g||Lu(i))&&Xd(i.value)&&Xd(v)||Ou(i)&&""===i.value||""===v||Array.isArray(v)&&!v.length,N=Ru.bind(null,f,n,w),A=(e,t,r,n=fu,a=gu)=>{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&&(!C&&(E||Gd(v))||ru(v)&&!v||k&&!qu(o).isValid||S&&!Yu(o).isValid)){const{value:e,message:t}=Cu(c)?{value:!!c,message:c}:lp(c);if(e&&(w[f]={type:vu,message:t,ref:y,...N(vu,t)},!n))return x(t),w}if(!(E||Gd(u)&&Gd(p))){let e,t;const r=lp(p),a=lp(u);if(Gd(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;Cu(r.value)&&v&&(e=o?s(v)>s(r.value):c?v>r.value:n>new Date(r.value)),Cu(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);Gd(r.value)||(e=n>r.value),Gd(a.value)||(t=n<a.value)}if((e||t)&&(A(!!e,r.message,a.message,mu,hu),!n))return x(w[f].message),w}if((l||d)&&!E&&(Cu(v)||s&&Array.isArray(v))){const e=lp(l),t=lp(d),r=!Gd(e.value)&&v.length>+e.value,a=!Gd(t.value)&&v.length<+t.value;if((r||a)&&(A(r,e.message,t.message),!n))return x(w[f].message),w}if(m&&!E&&Cu(v)){const{value:e,message:t}=lp(m);if(Qu(e)&&!v.match(e)&&(w[f]={type:bu,message:t,ref:i,...N(bu,t)},!n))return x(t),w}if(h)if(nu(h)){const e=cp(await h(v,r),y);if(e&&(w[f]={...e,...N(yu,e.message)},!n))return x(e.message),w}else if($d(h)){let e={};for(const t in h){if(!Uu(e)&&!n)break;const a=cp(await h[t](v,r),y,t);a&&(e={...a,...N(t,a.message)},x(a.message),n&&(w[f]=e))}if(!Uu(e)&&(w[f]={ref:y,...e},!n))return w}return x(!0),w};const up={mode:du,reValidateMode:lu,shouldFocusError:!0};function pp(e={}){let t,r={...up,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:nu(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},s=($d(r.defaultValues)||$d(r.values))&&Jd(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:Jd(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 d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},u={...d};let p={...u};const m={array:Iu(),state:Iu()},h=r.criteriaMode===pu,f=async e=>{if(!o.keepIsValid&&!r.disabled&&(u.isValid||p.isValid||e)){let e;r.resolver?(e=Uu((await x()).errors),g()):e=await w(a,!0),e!==n.isValid&&m.state.next({isValid:e})}},g=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||p.isValidating||p.validatingFields)&&((e||Array.from(c.mount)).forEach(e=>{e&&(t?au(n.validatingFields,e,t):Wu(n.validatingFields,e))}),m.state.next({validatingFields:n.validatingFields,isValidating:!Uu(n.validatingFields)}))},b=(e,t,r,n)=>{const c=tu(a,e);if(c){const a=tu(i,e,Xd(r)?tu(s,e):r);Xd(a)||n&&n.defaultChecked||t?au(i,e,t?a:Xu(c._f)):C(e,a),o.mount&&!o.action&&f()}},v=(e,t,a,i,o)=>{let c=!1,l=!1;const d={name:e};if(!r.disabled){if(!a||i){(u.isDirty||p.isDirty)&&(l=n.isDirty,n.isDirty=d.isDirty=S(),c=l!==d.isDirty);const r=Au(tu(s,e),t);l=!!tu(n.dirtyFields,e),r?Wu(n.dirtyFields,e):au(n.dirtyFields,e,!0),d.dirtyFields=n.dirtyFields,c=c||(u.dirtyFields||p.dirtyFields)&&l!==!r}if(a){const t=tu(n.touchedFields,e);t||(au(n.touchedFields,e,a),d.touchedFields=n.touchedFields,c=c||(u.touchedFields||p.touchedFields)&&t!==a)}c&&o&&m.state.next(d)}return c?d:{}},y=(e,a,s,i)=>{const o=tu(n.errors,e),c=(u.isValid||p.isValid)&&ru(a)&&n.isValid!==a;var d;if(r.delayError&&s?(d=()=>((e,t)=>{au(n.errors,e,t),m.state.next({errors:n.errors})})(e,s),t=e=>{clearTimeout(l),l=setTimeout(d,e)},t(r.delayError)):(clearTimeout(l),t=null,s?au(n.errors,e,s):Wu(n.errors,e)),(s?!Au(o,s):o)||!Uu(i)||c){const t={...i,...c&&ru(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=tu(t,r);e&&au(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),d=l._f&&np(l._f);d&&u.validatingFields&&g([t.name],!0);const p=await dp(l,c.disabled,i,h,r.shouldUseNativeValidation&&!a,o);if(d&&u.validatingFields&&g([t.name]),p[t.name]&&(s.valid=!1,a||e.shouldUseNativeValidation))break;!a&&(tu(p,t.name)?o?op(n.errors,p,t.name):au(n.errors,t.name,p[t.name]):Wu(n.errors,t.name))}!Uu(o)&&await w(o,a,s)}}return s.valid},S=(e,t)=>!r.disabled&&(e&&t&&au(i,e,t),!Au(P(),s)),k=(e,t,r)=>Eu(e,c,{...o.mount?i:Xd(t)?s:Cu(e)?{[e]:t}:t},r,t),C=(e,t,r={})=>{const n=tu(a,e);let s=t;if(n){const r=n._f;r&&(!r.disabled&&au(i,e,Zu(t,r)),s=Ou(r.ref)&&Gd(t)?"":t,zu(r.ref)?[...r.ref.options].forEach(e=>e.selected=s.includes(e.value)):r.refs?Wd(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):Lu(r.ref)?r.ref.value="":(r.ref.value=s,r.ref.type||m.state.next({name:e,values:Jd(i)})))}(r.shouldDirty||r.shouldTouch)&&v(e,s,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&_(e)},E=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const s=t[n],i=e+"."+n,o=tu(a,i);(c.array.has(e)||$d(s)||o&&!o._f)&&!Vd(s)?E(i,s,r):C(i,s,r)}},N=(e,t,r={})=>{const l=tu(a,e),d=c.array.has(e),h=Jd(t);au(i,e,h),d?(m.array.next({name:e,values:Jd(i)}),(u.isDirty||u.dirtyFields||p.isDirty||p.dirtyFields)&&r.shouldDirty&&m.state.next({name:e,dirtyFields:Hu(s,i),isDirty:S(e,h)})):!l||l._f||Gd(h)?C(e,h,r):E(e,h,r),ap(e,c)?m.state.next({...n,name:e,values:Jd(i)}):m.state.next({name:o.mount?e:void 0,values:Jd(i)})},A=async e=>{o.mount=!0;const s=e.target;let l=s.name,d=!0;const b=tu(a,l),S=e=>{d=Number.isNaN(e)||Vd(e)&&isNaN(e.getTime())||Au(e,tu(i,l,e))},k=tp(r.mode),C=tp(r.reValidateMode);if(b){let o,E;const N=s.type?Xu(b._f):Kd(e),A=e.type===su||e.type===iu,j=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(b._f)&&!r.resolver&&!tu(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,tu(n.touchedFields,l),n.isSubmitted,C,k),P=ap(l,c,A);au(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 T=v(l,N,A),R=!Uu(T)||P;if(!A&&m.state.next({name:l,type:e.type,values:Jd(i)}),j)return(u.isValid||p.isValid)&&("onBlur"===r.mode?A&&f():A||f()),R&&m.state.next({name:l,...P?{}:T});if(!A&&P&&m.state.next({...n}),r.resolver){const{errors:e}=await x([l]);if(g([l]),S(N),d){const t=ip(n.errors,a,l),r=ip(e,a,t.name||l);o=r.error,l=r.name,E=Uu(e)}}else g([l],!0),o=(await dp(b,c.disabled,i,h,r.shouldUseNativeValidation))[l],g([l]),S(N),d&&(o?E=!1:(u.isValid||p.isValid)&&(E=await w(a,!0)));d&&(b._f.deps&&(!Array.isArray(b._f.deps)||b._f.deps.length>0)&&_(b._f.deps),y(l,E,o,T))}},j=(e,t)=>{if(tu(n.errors,t)&&e.focus)return e.focus(),1},_=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=tu(t,r);e?au(n.errors,r,e):Wu(n.errors,r)}else n.errors=t;return t})(Xd(e)?e:o);s=Uu(t),i=e?!o.some(e=>tu(t,e)):s}else e?(i=(await Promise.all(o.map(async e=>{const t=tu(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({...!Cu(e)||(u.isValid||p.isValid)&&s!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:s}:{},errors:n.errors}),t.shouldFocus&&!i&&sp(a,j,e?o:c.mount),i},P=(e,t)=>{let r={...o.mount?i:s};return t&&(r=Mu(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),Xd(e)?r:Cu(e)?tu(r,e):e.map(e=>tu(r,e))},T=(e,t)=>({invalid:!!tu((t||n).errors,e),isDirty:!!tu((t||n).dirtyFields,e),error:tu((t||n).errors,e),isValidating:!!tu(n.validatingFields,e),isTouched:!!tu((t||n).touchedFields,e)}),R=(e,t,r)=>{const s=(tu(a,e,{_f:{}})._f||{}).ref,i=tu(n.errors,e)||{},{ref:o,message:c,type:l,...d}=i;au(n.errors,e,{...d,...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 Uu(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(e=>t[e]===(!n||pu))})(t,e.formState||u,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||(Wu(a,o),Wu(i,o)),!t.keepError&&Wu(n.errors,o),!t.keepDirty&&Wu(n.dirtyFields,o),!t.keepTouched&&Wu(n.touchedFields,o),!t.keepIsValidating&&Wu(n.validatingFields,o),!r.shouldUnregister&&!t.keepDefaultValue&&Wu(s,o);m.state.next({values:Jd(i)}),m.state.next({...n,...t.keepDirty?{isDirty:S()}:{}}),!t.keepIsValid&&f()},M=({disabled:e,name:t})=>{if(ru(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()}},U=(e,t={})=>{let n=tu(a,e);const i=ru(t.disabled)||ru(r.disabled);return au(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),c.mount.add(e),n?M({disabled:ru(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:ep(t.min),max:ep(t.max),minLength:ep(t.minLength),maxLength:ep(t.maxLength),pattern:ep(t.pattern)}:{},name:e,onChange:A,onBlur:A,ref:i=>{if(i){U(e,t),n=tu(a,e);const r=Xd(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,o=(e=>Fu(e)||Wd(e))(r),c=n._f.refs||[];if(o?c.find(e=>e===r):r===n._f.ref)return;au(a,e,{_f:{...n._f,...o?{refs:[...c.filter(Bu),r,...Array.isArray(tu(s,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),b(e,!1,void 0,r)}else n=tu(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!qd(c.array,e)||!o.action)&&c.unMount.add(e)}}},L=()=>r.shouldFocusError&&sp(a,j,c.mount),O=(e,t)=>async s=>{let o;s&&(s.preventDefault&&s.preventDefault(),s.persist&&s.persist());let l=Jd(i);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();g(),n.errors=e,l=Jd(t)}else await w(a);if(c.disabled.size)for(const e of c.disabled)Wu(l,e);if(Wu(n.errors,"root"),Uu(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:Uu(n.errors)&&!o,submitCount:n.submitCount+1,errors:n.errors}),o)throw o},z=(e,t={})=>{const l=e?Jd(e):s,d=Jd(l),p=Uu(e),h=p?s:d;if(t.keepDefaultValues||(s=l),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...c.mount,...Object.keys(Hu(s,i))]);for(const t of Array.from(e)){const e=tu(n.dirtyFields,t),r=tu(i,t),a=tu(h,t);e&&!Xd(r)?au(h,t,r):e||Xd(a)||N(t,a)}}else{if(Zd&&Xd(e))for(const e of c.mount){const t=tu(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Ou(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of c.mount)N(e,tu(h,e));else a={}}i=r.shouldUnregister?t.keepDefaultValues?Jd(s):{}:Jd(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=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues||!r.shouldUnregister&&!Uu(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||Au(e,s))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:p?{}:t.keepDirtyValues?t.keepDefaultValues&&i?Hu(s,i):n.dirtyFields:t.keepDefaultValues&&e?Hu(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(nu(e)?e(i):e,{...r.resetOptions,...t}),B=e=>{n={...n,...e}},W={control:{register:U,unregister:I,getFieldState:T,handleSubmit:O,setError:R,_subscribe:D,_runSchema:x,_updateIsValidating:g,_focusError:L,_getWatch:k,_getDirty:S,_setValid:f,_setFieldArray:(e,t=[],c,l,d=!0,h=!0)=>{if(l&&c&&!r.disabled){if(o.action=!0,h&&Array.isArray(tu(a,e))){const t=c(tu(a,e),l.argA,l.argB);d&&au(a,e,t)}if(h&&Array.isArray(tu(n.errors,e))){const t=c(tu(n.errors,e),l.argA,l.argB);d&&au(n.errors,e,t),((e,t)=>{!Qd(tu(e,t)).length&&Wu(e,t)})(n.errors,e)}if((u.touchedFields||p.touchedFields)&&h&&Array.isArray(tu(n.touchedFields,e))){const t=c(tu(n.touchedFields,e),l.argA,l.argB);d&&au(n.touchedFields,e,t)}(u.dirtyFields||p.dirtyFields)&&(n.dirtyFields=Hu(s,i)),m.state.next({name:e,isDirty:S(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else au(i,e,t)},_setDisabledField:M,_setErrors:e=>{n.errors=e,m.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>Qd(tu(o.mount?i:s,e,r.shouldUnregister?tu(s,e,[]):[])),_reset:z,_resetDefaultValues:()=>nu(r.defaultValues)&&r.defaultValues().then(e=>{F(e,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of c.unMount){const t=tu(a,e);t&&(t._f.refs?t._f.refs.every(e=>!Bu(e)):!Bu(t._f.ref))&&I(e)}c.unMount=new Set},_disableForm:e=>{ru(e)&&(m.state.next({disabled:e}),sp(a,(t,r)=>{const n=tu(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:u,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:{...d,...e.formState}})),trigger:_,register:U,handleSubmit:O,watch:(e,t)=>nu(e)?m.state.subscribe({next:r=>"values"in r&&e(k(void 0,t),r)}):k(e,t,!0),setValue:N,getValues:P,reset:F,resetField:(e,t={})=>{tu(a,e)&&(Xd(t.defaultValue)?N(e,Jd(tu(s,e))):(N(e,t.defaultValue),au(s,e,Jd(t.defaultValue))),t.keepTouched||Wu(n.touchedFields,e),t.keepDirty||(Wu(n.dirtyFields,e),n.isDirty=t.defaultValue?S(e,Jd(tu(s,e))):S()),t.keepError||(Wu(n.errors,e),u.isValid&&f()),m.state.next({...n}))},clearErrors:e=>{e&&Du(e).forEach(e=>Wu(n.errors,e)),m.state.next({errors:e?n.errors:{}})},unregister:I,setError:R,setFocus:(e,t={})=>{const r=tu(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&nu(e.select)&&e.select()})}},getFieldState:T};return{...W,formControl:W}}function mp(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,s]=t.useState({isDirty:!1,isValidating:!1,isLoading:nu(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:nu(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!nu(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:t,...n}=pp(e);r.current={...n,formState:a}}const i=r.current.control;return i._options=e,ku(()=>{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&&!Au(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(()=>Su(a,i),[i,a]),r.current}const hp=(e,t,r)=>{if(e&&"reportValidity"in e){const n=tu(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},fp=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?hp(n.ref,r,e):n&&n.refs&&n.refs.forEach(t=>hp(t,r,e))}},gp=(e,t)=>{t.shouldUseNativeValidation&&fp(e,t);const r={};for(const n in e){const a=tu(t.fields,n),s=Object.assign(e[n]||{},{ref:a&&a.ref});if(bp(t.names||Object.keys(e),n)){const e=Object.assign({},tu(r,n));au(e,"root",s),au(r,n,e)}else au(r,n,s)}return r},bp=(e,t)=>{const r=vp(t);return e.some(e=>vp(e).match(`^${r}\\.\\d+`))};function vp(e){return e.replace(/\]|\[/g,"")}function yp(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 xp extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class wp extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Sp={};function kp(e){return Sp}function Cp(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 Ep(e,t){return"bigint"==typeof t?t.toString():t}function Np(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ap(e){return null==e}function jp(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const _p=Symbol("evaluating");function Pp(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==_p)return void 0===n&&(n=_p,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function Tp(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Rp(...e){const t={};for(const r of e){const e=Object.getOwnPropertyDescriptors(r);Object.assign(t,e)}return Object.defineProperties({},t)}function Dp(e){return JSON.stringify(e)}const Ip="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Mp(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Up=Np(()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Lp(e){if(!1===Mp(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!==Mp(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function Op(e){return Lp(e)?{...e}:Array.isArray(e)?[...e]:e}const zp=new Set(["string","number","symbol"]);function Fp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Bp(e,t,r){const n=new e._zod.constr(t??e._zod.def);return t&&!r?.parent||(n._zod.parent=e),n}function Wp(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 Vp(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 Gp(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function Hp(e){return"string"==typeof e?e:e?.message}function $p(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const a=Hp(e.inst?._zod.def?.error?.(e))??Hp(t?.error?.(e))??Hp(r.customError?.(e))??Hp(r.localeError?.(e))??"Invalid input";n.message=a}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function Kp(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function qp(...e){const[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}const Zp=(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,Ep,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Jp=yp("$ZodError",Zp),Yp=yp("$ZodError",Zp,{Parent:Error});const Xp=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 xp;if(i.issues.length){const t=new(a?.Err??e)(i.issues.map(e=>$p(e,s,kp())));throw Ip(t,a?.callee),t}return i.value},Qp=Xp(Yp),em=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=>$p(e,s,kp())));throw Ip(t,a?.callee),t}return i.value},tm=em(Yp),rm=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 xp;return s.issues.length?{success:!1,error:new(e??Jp)(s.issues.map(e=>$p(e,a,kp())))}:{success:!0,data:s.value}},nm=rm(Yp),am=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=>$p(e,a,kp())))}:{success:!0,data:s.value}},sm=am(Yp),im=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Xp(e)(t,r,a)},om=e=>(t,r,n)=>Xp(e)(t,r,n),cm=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return em(e)(t,r,a)},lm=e=>async(t,r,n)=>em(e)(t,r,n),dm=e=>(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return rm(e)(t,r,a)},um=e=>(t,r,n)=>rm(e)(t,r,n),pm=e=>async(t,r,n)=>{const a=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return am(e)(t,r,a)},mm=e=>async(t,r,n)=>am(e)(t,r,n),hm=/^[cC][^\s-]{8,}$/,fm=/^[0-9a-z]+$/,gm=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,bm=/^[0-9a-vA-V]{20}$/,vm=/^[A-Za-z0-9]{27}$/,ym=/^[a-zA-Z0-9_-]{21}$/,xm=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,wm=/^([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})$/,Sm=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)$/,km=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const Cm=/^(?:(?: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])$/,Em=/^(([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}|:))$/,Nm=/^((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])$/,Am=/^(([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])$/,jm=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,_m=/^[A-Za-z0-9_-]*$/,Pm=/^\+[1-9]\d{6,14}$/,Tm="(?:(?:\\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])))",Rm=new RegExp(`^${Tm}$`);function Dm(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 Im=/^[^A-Z]*$/,Mm=/^[^a-z]*$/,Um=yp("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Lm=yp("$ZodCheckMaxLength",(e,t)=>{var r;Um.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Ap(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=Kp(n);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Om=yp("$ZodCheckMinLength",(e,t)=>{var r;Um.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Ap(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=Kp(n);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),zm=yp("$ZodCheckLengthEquals",(e,t)=>{var r;Um.init(e,t),(r=e._zod.def).when??(r.when=e=>{const t=e.value;return!Ap(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=Kp(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})}}),Fm=yp("$ZodCheckStringFormat",(e,t)=>{var r,n;Um.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=()=>{})}),Bm=yp("$ZodCheckRegex",(e,t)=>{Fm.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})}}),Wm=yp("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Im),Fm.init(e,t)}),Vm=yp("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mm),Fm.init(e,t)}),Gm=yp("$ZodCheckIncludes",(e,t)=>{Um.init(e,t);const r=Fp(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})}}),Hm=yp("$ZodCheckStartsWith",(e,t)=>{Um.init(e,t);const r=new RegExp(`^${Fp(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})}}),$m=yp("$ZodCheckEndsWith",(e,t)=>{Um.init(e,t);const r=new RegExp(`.*${Fp(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})}}),Km=yp("$ZodCheckOverwrite",(e,t)=>{Um.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class qm{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 Zm={major:4,minor:3,patch:6},Jm=yp("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Zm;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=Vp(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 xp;if(n||i instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await i;e.issues.length!==t&&(a||(a=Vp(e,t)))});else{if(e.issues.length===t)continue;a||(a=Vp(e,t))}}return n?n.then(()=>e):e},r=(r,a,s)=>{if(Vp(r))return r.aborted=!0,r;const i=t(a,n,s);if(i instanceof Promise){if(!1===s.async)throw new xp;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 xp;return i.then(e=>t(e,n,s))}return t(i,n,s)}}Pp(e,"~standard",()=>({validate:t=>{try{const r=nm(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return sm(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Ym=yp("$ZodString",(e,t)=>{var r;Jm.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}}),Xm=yp("$ZodStringFormat",(e,t)=>{Fm.init(e,t),Ym.init(e,t)}),Qm=yp("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=wm),Xm.init(e,t)}),eh=yp("$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=Sm(e))}else t.pattern??(t.pattern=Sm());Xm.init(e,t)}),th=yp("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=km),Xm.init(e,t)}),rh=yp("$ZodURL",(e,t)=>{Xm.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})}}}),nh=yp("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Xm.init(e,t)}),ah=yp("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ym),Xm.init(e,t)}),sh=yp("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=hm),Xm.init(e,t)}),ih=yp("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=fm),Xm.init(e,t)}),oh=yp("$ZodULID",(e,t)=>{t.pattern??(t.pattern=gm),Xm.init(e,t)}),ch=yp("$ZodXID",(e,t)=>{t.pattern??(t.pattern=bm),Xm.init(e,t)}),lh=yp("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vm),Xm.init(e,t)}),dh=yp("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Dm({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(`^${Tm}T(?:${n})$`)}(t)),Xm.init(e,t)}),uh=yp("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Rm),Xm.init(e,t)}),ph=yp("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Dm(t)}$`)),Xm.init(e,t)}),mh=yp("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=xm),Xm.init(e,t)}),hh=yp("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Cm),Xm.init(e,t),e._zod.bag.format="ipv4"}),fh=yp("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Em),Xm.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})}}}),gh=yp("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Nm),Xm.init(e,t)}),bh=yp("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Am),Xm.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 vh(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const yh=yp("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=jm),Xm.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{vh(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});const xh=yp("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=_m),Xm.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{(function(e){if(!_m.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return vh(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})}}),wh=yp("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Pm),Xm.init(e,t)});const Sh=yp("$ZodJWT",(e,t)=>{Xm.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})}}),kh=yp("$ZodUnknown",(e,t)=>{Jm.init(e,t),e._zod.parse=e=>e}),Ch=yp("$ZodNever",(e,t)=>{Jm.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Eh(e,t,r){e.issues.length&&t.issues.push(...Gp(r,e.issues)),t.value[r]=e.value}const Nh=yp("$ZodArray",(e,t)=>{Jm.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=>Eh(t,r,e))):Eh(o,r,e)}return s.length?Promise.all(s).then(()=>r):r}});function Ah(e,t,r,n,a){if(e.issues.length){if(a&&!(r in n))return;t.issues.push(...Gp(r,e.issues))}void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function jh(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 _h(e,t,r,n,a,s){const i=[],o=a.keySet,c=a.catchall._zod,l=c.def.type,d="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=>Ah(e,r,a,t,d))):Ah(s,r,a,t,d)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const Ph=yp("$ZodObject",(e,t)=>{Jm.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=Np(()=>jh(t));Pp(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=Mp,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=>Ah(r,t,e,o,a))):Ah(s,t,e,o,a)}return s?_h(c,o,t,r,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Th=yp("$ZodObjectJIT",(e,t)=>{Ph.init(e,t);const r=e._zod.parse,n=Np(()=>jh(t));let a;const s=Mp,i=!Sp.jitless,o=i&&Up.value,c=t.catchall;let l;e._zod.parse=(d,u)=>{l??(l=n.value);const p=d.value;return s(p)?i&&o&&!1===u?.async&&!0!==u.jitless?(a||(a=(e=>{const t=new qm(["shape","payload","ctx"]),r=n.value,a=e=>{const t=Dp(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=Dp(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)),d=a(d,u),c?_h([],p,d,u,l,e):d):r(d,u):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function Rh(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=>!Vp(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=>$p(e,n,kp())))}),t)}const Dh=yp("$ZodUnion",(e,t)=>{Jm.init(e,t),Pp(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),Pp(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),Pp(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Pp(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=>jp(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=>Rh(t,a,e,s)):Rh(o,a,e,s)}}),Ih=yp("$ZodIntersection",(e,t)=>{Jm.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])=>Uh(e,t,r)):Uh(e,a,s)}});function Mh(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(Lp(e)&&Lp(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=Mh(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=Mh(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 Uh(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}),Vp(e))return e;const i=Mh(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 Lh=yp("$ZodEnum",(e,t)=>{Jm.init(e,t);const r=Cp(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(e=>zp.has(typeof e)).map(e=>"string"==typeof e?Fp(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}}),Oh=yp("$ZodTransform",(e,t)=>{Jm.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new wp(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 xp;return r.value=a,r}});function zh(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Fh=yp("$ZodOptional",(e,t)=>{Jm.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Pp(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Pp(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${jp(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=>zh(t,e.value)):zh(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),Bh=yp("$ZodExactOptional",(e,t)=>{Fh.init(e,t),Pp(e._zod,"values",()=>t.innerType._zod.values),Pp(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),Wh=yp("$ZodNullable",(e,t)=>{Jm.init(e,t),Pp(e._zod,"optin",()=>t.innerType._zod.optin),Pp(e._zod,"optout",()=>t.innerType._zod.optout),Pp(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${jp(e.source)}|null)$`):void 0}),Pp(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)}),Vh=yp("$ZodDefault",(e,t)=>{Jm.init(e,t),e._zod.optin="optional",Pp(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=>Gh(e,t)):Gh(n,t)}});function Gh(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Hh=yp("$ZodPrefault",(e,t)=>{Jm.init(e,t),e._zod.optin="optional",Pp(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))}),$h=yp("$ZodNonOptional",(e,t)=>{Jm.init(e,t),Pp(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=>Kh(t,e)):Kh(a,e)}});function Kh(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 qh=yp("$ZodCatch",(e,t)=>{Jm.init(e,t),Pp(e._zod,"optin",()=>t.innerType._zod.optin),Pp(e._zod,"optout",()=>t.innerType._zod.optout),Pp(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=>$p(e,r,kp()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>$p(e,r,kp()))},input:e.value}),e.issues=[]),e)}}),Zh=yp("$ZodPipe",(e,t)=>{Jm.init(e,t),Pp(e._zod,"values",()=>t.in._zod.values),Pp(e._zod,"optin",()=>t.in._zod.optin),Pp(e._zod,"optout",()=>t.out._zod.optout),Pp(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=>Jh(e,t.in,r)):Jh(n,t.in,r)}const n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>Jh(e,t.out,r)):Jh(n,t.out,r)}});function Jh(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Yh=yp("$ZodReadonly",(e,t)=>{Jm.init(e,t),Pp(e._zod,"propValues",()=>t.innerType._zod.propValues),Pp(e._zod,"values",()=>t.innerType._zod.values),Pp(e._zod,"optin",()=>t.innerType?._zod?.optin),Pp(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(Xh):Xh(n)}});function Xh(e){return e.value=Object.freeze(e.value),e}const Qh=yp("$ZodCustom",(e,t)=>{Um.init(e,t),Jm.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=>ef(t,r,n,e));ef(a,r,n,e)}});function ef(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(qp(e))}}var tf;class rf{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)}}(tf=globalThis).__zod_globalRegistry??(tf.__zod_globalRegistry=new rf);const nf=globalThis.__zod_globalRegistry;function af(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Wp(t)})}function sf(e,t){return new Lm({check:"max_length",...Wp(t),maximum:e})}function of(e,t){return new Om({check:"min_length",...Wp(t),minimum:e})}function cf(e,t){return new zm({check:"length_equals",...Wp(t),length:e})}function lf(e){return new Km({check:"overwrite",tx:e})}function df(e){const t=function(e,t){const r=new Um({check:"custom",...Wp(t)});return r._zod.check=e,r}(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(qp(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(qp(n))}},e(r.value,r)));return t}function uf(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??nf,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 pf(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),pf(s,t,n),t.seen.get(s).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(i.schema,c),"input"===t.io&&ff(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 mf(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 hf(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:gf(t,"input",e.processors),output:gf(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw new Error("Error converting schema to JSON.")}}function ff(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 ff(n.element,r);if("set"===n.type)return ff(n.valueType,r);if("lazy"===n.type)return ff(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 ff(n.innerType,r);if("intersection"===n.type)return ff(n.left,r)||ff(n.right,r);if("record"===n.type||"map"===n.type)return ff(n.keyType,r)||ff(n.valueType,r);if("pipe"===n.type)return ff(n.in,r)||ff(n.out,r);if("object"===n.type){for(const e in n.shape)if(ff(n.shape[e],r))return!0;return!1}if("union"===n.type){for(const e of n.options)if(ff(e,r))return!0;return!1}if("tuple"===n.type){for(const e of n.items)if(ff(e,r))return!0;return!(!n.rest||!ff(n.rest,r))}return!1}const gf=(e,t,r={})=>n=>{const{libraryOptions:a,target:s}=n??{},i=uf({...a??{},target:s,io:t,processors:r});return pf(e,i),mf(i,e),hf(i,e)},bf={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},vf=(e,t,r,n)=>{const a=e._zod.def;pf(a.innerType,t,n);t.seen.get(e).ref=a.innerType};function yf(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function xf(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]=Ru(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function wf(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]=Ru(i,t,r,a,l?[].concat(l,n.message):n.message)}e.shift()}return r}function Sf(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(yf(function(){return Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return s.shouldUseNativeValidation&&fp({},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:gp(xf(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(yf(function(){return Promise.resolve(("sync"===r.mode?Qp:tm)(e,n,t)).then(function(e){return s.shouldUseNativeValidation&&fp({},s),{errors:{},values:r.raw?Object.assign({},n):e}})},function(e){if(function(e){return e instanceof Jp}(e))return{values:{},errors:gp(wf(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 kf=yp("ZodISODateTime",(e,t)=>{dh.init(e,t),qf.init(e,t)});function Cf(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Wp(t)})}(kf,e)}const Ef=yp("ZodISODate",(e,t)=>{uh.init(e,t),qf.init(e,t)});function Nf(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...Wp(t)})}(Ef,e)}const Af=yp("ZodISOTime",(e,t)=>{ph.init(e,t),qf.init(e,t)});function jf(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Wp(t)})}(Af,e)}const _f=yp("ZodISODuration",(e,t)=>{mh.init(e,t),qf.init(e,t)});function Pf(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...Wp(t)})}(_f,e)}const Tf=yp("ZodError",(e,t)=>{Jp.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,Ep,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Ep,2)}},isEmpty:{get:()=>0===e.issues.length}})},{Parent:Error}),Rf=Xp(Tf),Df=em(Tf),If=rm(Tf),Mf=am(Tf),Uf=im(Tf),Lf=om(Tf),Of=cm(Tf),zf=lm(Tf),Ff=dm(Tf),Bf=um(Tf),Wf=pm(Tf),Vf=mm(Tf),Gf=yp("ZodType",(e,t)=>(Jm.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:gf(e,"input"),output:gf(e,"output")}}),e.toJSONSchema=((e,t={})=>r=>{const n=uf({...r,processors:t});return pf(e,n),mf(n,e),hf(n,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Rp(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)=>Bp(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>Rf(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>If(e,t,r),e.parseAsync=async(t,r)=>Df(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>Mf(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>Uf(e,t,r),e.decode=(t,r)=>Lf(e,t,r),e.encodeAsync=async(t,r)=>Of(e,t,r),e.decodeAsync=async(t,r)=>zf(e,t,r),e.safeEncode=(t,r)=>Ff(e,t,r),e.safeDecode=(t,r)=>Bf(e,t,r),e.safeEncodeAsync=async(t,r)=>Wf(e,t,r),e.safeDecodeAsync=async(t,r)=>Vf(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,...Wp(r)})}(Lg,e,t)}(t,r)),e.superRefine=t=>e.check(df(t)),e.overwrite=t=>e.check(lf(t)),e.optional=()=>Ng(e),e.exactOptional=()=>new Ag({type:"optional",innerType:e}),e.nullable=()=>_g(e),e.nullish=()=>Ng(_g(e)),e.nonoptional=t=>function(e,t){return new Rg({type:"nonoptional",innerType:e,...Wp(t)})}(e,t),e.array=()=>{return function(e,t,r){return new e({type:"array",element:t,...Wp(r)})}(vg,e,t);var t},e.or=t=>function(e,t){return new wg({type:"union",options:e,...Wp(t)})}([e,t]),e.and=t=>new Sg({type:"intersection",left:e,right:t}),e.transform=t=>Mg(e,new Cg({type:"transform",transform:t})),e.default=t=>{return r=t,new Pg({type:"default",innerType:e,get defaultValue(){return"function"==typeof r?r():Op(r)}});var r},e.prefault=t=>{return r=t,new Tg({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof r?r():Op(r)}});var r},e.catch=t=>{return new Dg({type:"catch",innerType:e,catchValue:"function"==typeof(r=t)?r:()=>r});var r},e.pipe=t=>Mg(e,t),e.readonly=()=>new Ug({type:"readonly",innerType:e}),e.describe=t=>{const r=e.clone();return nf.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>nf.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return nf.get(e);const r=e.clone();return nf.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),Hf=yp("_ZodString",(e,t)=>{Ym.init(e,t),Gf.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=bf[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 Bm({check:"string_format",format:"regex",...Wp(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Gm({check:"string_format",format:"includes",...Wp(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Hm({check:"string_format",format:"starts_with",...Wp(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new $m({check:"string_format",format:"ends_with",...Wp(t),suffix:e})}(...t)),e.min=(...t)=>e.check(of(...t)),e.max=(...t)=>e.check(sf(...t)),e.length=(...t)=>e.check(cf(...t)),e.nonempty=(...t)=>e.check(of(1,...t)),e.lowercase=t=>e.check(function(e){return new Wm({check:"string_format",format:"lowercase",...Wp(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Vm({check:"string_format",format:"uppercase",...Wp(e)})}(t)),e.trim=()=>e.check(lf(e=>e.trim())),e.normalize=(...t)=>e.check(function(e){return lf(t=>t.normalize(e))}(...t)),e.toLowerCase=()=>e.check(lf(e=>e.toLowerCase())),e.toUpperCase=()=>e.check(lf(e=>e.toUpperCase())),e.slugify=()=>e.check(lf(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}),$f=yp("ZodString",(e,t)=>{Ym.init(e,t),Hf.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Wp(t)})}(Zf,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Wp(t)})}(Xf,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Wp(t)})}(mg,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Wp(t)})}(Qf,t)),e.guid=t=>e.check(af(Jf,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Wp(t)})}(Yf,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Wp(t)})}(Yf,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Wp(t)})}(Yf,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Wp(t)})}(Yf,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Wp(t)})}(eg,t)),e.guid=t=>e.check(af(Jf,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Wp(t)})}(tg,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Wp(t)})}(rg,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Wp(t)})}(ng,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Wp(t)})}(dg,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Wp(t)})}(ug,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Wp(t)})}(ag,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Wp(t)})}(sg,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Wp(t)})}(ig,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Wp(t)})}(og,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Wp(t)})}(cg,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Wp(t)})}(lg,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Wp(t)})}(pg,t)),e.datetime=t=>e.check(Cf(t)),e.date=t=>e.check(Nf(t)),e.time=t=>e.check(jf(t)),e.duration=t=>e.check(Pf(t))});function Kf(e){return function(e,t){return new e({type:"string",...Wp(t)})}($f,e)}const qf=yp("ZodStringFormat",(e,t)=>{Xm.init(e,t),Hf.init(e,t)}),Zf=yp("ZodEmail",(e,t)=>{th.init(e,t),qf.init(e,t)}),Jf=yp("ZodGUID",(e,t)=>{Qm.init(e,t),qf.init(e,t)}),Yf=yp("ZodUUID",(e,t)=>{eh.init(e,t),qf.init(e,t)}),Xf=yp("ZodURL",(e,t)=>{rh.init(e,t),qf.init(e,t)}),Qf=yp("ZodEmoji",(e,t)=>{nh.init(e,t),qf.init(e,t)}),eg=yp("ZodNanoID",(e,t)=>{ah.init(e,t),qf.init(e,t)}),tg=yp("ZodCUID",(e,t)=>{sh.init(e,t),qf.init(e,t)}),rg=yp("ZodCUID2",(e,t)=>{ih.init(e,t),qf.init(e,t)}),ng=yp("ZodULID",(e,t)=>{oh.init(e,t),qf.init(e,t)}),ag=yp("ZodXID",(e,t)=>{ch.init(e,t),qf.init(e,t)}),sg=yp("ZodKSUID",(e,t)=>{lh.init(e,t),qf.init(e,t)}),ig=yp("ZodIPv4",(e,t)=>{hh.init(e,t),qf.init(e,t)}),og=yp("ZodIPv6",(e,t)=>{fh.init(e,t),qf.init(e,t)}),cg=yp("ZodCIDRv4",(e,t)=>{gh.init(e,t),qf.init(e,t)}),lg=yp("ZodCIDRv6",(e,t)=>{bh.init(e,t),qf.init(e,t)}),dg=yp("ZodBase64",(e,t)=>{yh.init(e,t),qf.init(e,t)}),ug=yp("ZodBase64URL",(e,t)=>{xh.init(e,t),qf.init(e,t)}),pg=yp("ZodE164",(e,t)=>{wh.init(e,t),qf.init(e,t)}),mg=yp("ZodJWT",(e,t)=>{Sh.init(e,t),qf.init(e,t)}),hg=yp("ZodUnknown",(e,t)=>{kh.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(e,t,r)=>{}});function fg(){return new hg({type:"unknown"})}const gg=yp("ZodNever",(e,t)=>{Ch.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(e,t,r)=>((e,t,r)=>{r.not={}})(0,0,t)});function bg(e){return function(e,t){return new e({type:"never",...Wp(t)})}(gg,e)}const vg=yp("ZodArray",(e,t)=>{Nh.init(e,t),Gf.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=pf(s.element,t,{...n,path:[...n.path,"items"]})})(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(of(t,r)),e.nonempty=t=>e.check(of(1,t)),e.max=(t,r)=>e.check(sf(t,r)),e.length=(t,r)=>e.check(cf(t,r)),e.unwrap=()=>e.element});const yg=yp("ZodObject",(e,t)=>{Th.init(e,t),Gf.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]=pf(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=pf(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(a.additionalProperties=!1)})(e,t,r,n),Pp(e,"shape",()=>t.shape),e.keyof=()=>function(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new kg({type:"enum",entries:r,...Wp(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:fg()}),e.loose=()=>e.clone({...e._zod.def,catchall:fg()}),e.strict=()=>e.clone({...e._zod.def,catchall:bg()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!Lp(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=Rp(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Tp(this,"shape",r),r}});return Bp(e,n)}(e,t),e.safeExtend=t=>function(e,t){if(!Lp(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=Rp(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Tp(this,"shape",r),r}});return Bp(e,r)}(e,t),e.merge=t=>function(e,t){const r=Rp(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Tp(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Bp(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 Bp(e,Rp(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 Tp(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=Rp(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 Tp(this,"shape",n),n},checks:[]});return Bp(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=Rp(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 Tp(this,"shape",a),a},checks:[]});return Bp(t,a)}(Eg,e,t[0]),e.required=(...t)=>function(e,t,r){const n=Rp(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 Tp(this,"shape",a),a}});return Bp(t,n)}(Rg,e,t[0])});function xg(e,t){const r={type:"object",shape:e??{},...Wp(t)};return new yg(r)}const wg=yp("ZodUnion",(e,t)=>{Dh.init(e,t),Gf.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)=>pf(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 Sg=yp("ZodIntersection",(e,t)=>{Ih.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=pf(a.left,t,{...n,path:[...n.path,"allOf",0]}),i=pf(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 kg=yp("ZodEnum",(e,t)=>{Lh.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r)=>{const n=Cp(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 kg({...t,checks:[],...Wp(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 kg({...t,checks:[],...Wp(n),entries:a})}});const Cg=yp("ZodTransform",(e,t)=>{Oh.init(e,t),Gf.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 wp(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(qp(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(qp(t))}};const a=t.transform(r.value,r);return a instanceof Promise?a.then(e=>(r.value=e,r)):(r.value=a,r)}});const Eg=yp("ZodOptional",(e,t)=>{Fh.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>vf(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});function Ng(e){return new Eg({type:"optional",innerType:e})}const Ag=yp("ZodExactOptional",(e,t)=>{Bh.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>vf(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const jg=yp("ZodNullable",(e,t)=>{Wh.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def,s=pf(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 _g(e){return new jg({type:"nullable",innerType:e})}const Pg=yp("ZodDefault",(e,t)=>{Vh.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;pf(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 Tg=yp("ZodPrefault",(e,t)=>{Hh.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;pf(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 Rg=yp("ZodNonOptional",(e,t)=>{$h.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;pf(a.innerType,t,n),t.seen.get(e).ref=a.innerType})(e,t,0,n),e.unwrap=()=>e._zod.def.innerType});const Dg=yp("ZodCatch",(e,t)=>{qh.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;let s;pf(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 Ig=yp("ZodPipe",(e,t)=>{Zh.init(e,t),Gf.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;pf(s,t,n),t.seen.get(e).ref=s})(e,t,0,n),e.in=t.in,e.out=t.out});function Mg(e,t){return new Ig({type:"pipe",in:e,out:t})}const Ug=yp("ZodReadonly",(e,t)=>{Yh.init(e,t),Gf.init(e,t),e._zod.processJSONSchema=(t,r,n)=>((e,t,r,n)=>{const a=e._zod.def;pf(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 Lg=yp("ZodCustom",(e,t)=>{Qh.init(e,t),Gf.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)});var Og=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=gi(`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}},{}),zg=a.forwardRef((t,r)=>e.jsx(Og.label,{...t,ref:r,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(t.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));zg.displayName="Label";var Fg=zg;const Bg=ki("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Wg=a.forwardRef(({className:t,...r},n)=>e.jsx(Fg,{ref:n,className:Se(Bg(),t),...r}));Wg.displayName=Fg.displayName;const Vg=Tu,Gg=a.createContext({}),Hg=({...t})=>e.jsx(Gg.Provider,{value:{name:t.name},children:e.jsx(_u,{...t})}),$g=()=>{const e=a.useContext(Gg),r=a.useContext(Kg),{getFieldState:n,formState:s}=t.useContext(Pu),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}},Kg=a.createContext({}),qg=a.forwardRef(({className:t,...r},n)=>{const s=a.useId();return e.jsx(Kg.Provider,{value:{id:s},children:e.jsx("div",{ref:n,className:Se("space-y-2",t),...r})})});qg.displayName="FormItem";const Zg=a.forwardRef(({className:t,...r},n)=>{const{error:a,formItemId:s}=$g();return e.jsx(Wg,{ref:n,className:Se(a&&"text-destructive",t),htmlFor:s,...r})});Zg.displayName="FormLabel";const Jg=a.forwardRef(({...t},r)=>{const{error:n,formItemId:a,formDescriptionId:s,formMessageId:i}=$g();return e.jsx(bi,{ref:r,id:a,"aria-describedby":n?`${s} ${i}`:`${s}`,"aria-invalid":!!n,...t})});Jg.displayName="FormControl";const Yg=a.forwardRef(({className:t,...r},n)=>{const{formDescriptionId:a}=$g();return e.jsx("p",{ref:n,id:a,className:Se("text-sm text-muted-foreground",t),...r})});Yg.displayName="FormDescription";const Xg=a.forwardRef(({className:t,children:r,...n},a)=>{const{error:s,formMessageId:i}=$g(),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});Xg.displayName="FormMessage";const Qg=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 eb(t){const r=tb(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(nb);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 tb(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?ui(t,e):e),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}Qg.displayName="Input";var rb=Symbol("radix.slottable");function nb(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===rb}function ab(r){const n=r+"CollectionProvider",[a,s]=Ai(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",d=eb(l),u=t.forwardRef((t,r)=>{const{scope:n,children:a}=t,s=pi(r,o(l,n).collectionRef);return e.jsx(d,{ref:s,children:a})});u.displayName=l;const p=r+"CollectionItemSlot",m="data-radix-collection-item",h=eb(p),f=t.forwardRef((r,n)=>{const{scope:a,children:s,...i}=r,c=t.useRef(null),l=pi(n,c),d=o(p,a);return t.useEffect(()=>(d.itemMap.set(c,{ref:c,...i}),()=>{d.itemMap.delete(c)})),e.jsx(h,{[m]:"",ref:l,children:s})});return f.displayName=p,[{Provider:c,Slot:u,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 sb=a.createContext(void 0);function ib(e){const t=a.useContext(sb);return e||t||"ltr"}var ob="rovingFocusGroup.onEntryFocus",cb={bubbles:!1,cancelable:!0},lb="RovingFocusGroup",[db,ub,pb]=ab(lb),[mb,hb]=Ai(lb,[pb]),[fb,gb]=mb(lb),bb=a.forwardRef((t,r)=>e.jsx(db.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(db.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(vb,{...t,ref:r})})}));bb.displayName=lb;var vb=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:i=!1,dir:o,currentTabStopId:c,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:d,onEntryFocus:u,preventScrollOnEntryFocus:p=!1,...m}=t,h=a.useRef(null),f=pi(r,h),g=ib(o),[b,v]=Ii({prop:c,defaultProp:l??null,onChange:d,caller:lb}),[y,x]=a.useState(!1),w=zi(u),S=ub(n),k=a.useRef(!1),[C,E]=a.useState(0);return a.useEffect(()=>{const e=h.current;if(e)return e.addEventListener(ob,w),()=>e.removeEventListener(ob,w)},[w]),e.jsx(fb,{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(()=>E(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>E(e=>e-1),[]),children:e.jsx(Oi.div,{tabIndex:y||0===C?-1:0,"data-orientation":s,...m,ref:f,style:{outline:"none",...t.style},onMouseDown:Ni(t.onMouseDown,()=>{k.current=!0}),onFocus:Ni(t.onFocus,e=>{const t=!k.current;if(e.target===e.currentTarget&&t&&!y){const t=new CustomEvent(ob,cb);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter(e=>e.focusable);Sb([e.find(e=>e.active),e.find(e=>e.id===b),...e].filter(Boolean).map(e=>e.ref.current),p)}}k.current=!1}),onBlur:Ni(t.onBlur,()=>x(!1))})})}),yb="RovingFocusGroupItem",xb=a.forwardRef((t,r)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:i=!1,tabStopId:o,children:c,...l}=t,d=Ri(),u=o||d,p=gb(yb,n),m=p.currentTabStopId===u,h=ub(n),{onFocusableItemAdd:f,onFocusableItemRemove:g,currentTabStopId:b}=p;return a.useEffect(()=>{if(s)return f(),()=>g()},[s,f,g]),e.jsx(db.ItemSlot,{scope:n,id:u,focusable:s,active:i,children:e.jsx(Oi.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:r,onMouseDown:Ni(t.onMouseDown,e=>{s?p.onItemFocus(u):e.preventDefault()}),onFocus:Ni(t.onFocus,()=>p.onItemFocus(u)),onKeyDown:Ni(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:wb[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(()=>Sb(r))}}),children:"function"==typeof c?c({isCurrentTabStop:m,hasTabStop:null!=b}):c})})});xb.displayName=yb;var wb={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Sb(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 kb=bb,Cb=xb,Eb="Radio",[Nb,Ab]=Ai(Eb),[jb,_b]=Nb(Eb),Pb=a.forwardRef((t,r)=>{const{__scopeRadio:n,name:s,checked:i=!1,required:o,disabled:c,value:l="on",onCheck:d,form:u,...p}=t,[m,h]=a.useState(null),f=pi(r,e=>h(e)),g=a.useRef(!1),b=!m||(u||!!m.closest("form"));return e.jsxs(jb,{scope:n,checked:i,disabled:c,children:[e.jsx(Oi.button,{type:"button",role:"radio","aria-checked":i,"data-state":Ib(i),"data-disabled":c?"":void 0,disabled:c,value:l,...p,ref:f,onClick:Ni(t.onClick,e=>{i||d?.(),b&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),b&&e.jsx(Db,{control:m,bubbles:!g.current,name:s,value:l,checked:i,required:o,disabled:c,form:u,style:{transform:"translateX(-100%)"}})]})});Pb.displayName=Eb;var Tb="RadioIndicator",Rb=a.forwardRef((t,r)=>{const{__scopeRadio:n,forceMount:a,...s}=t,i=_b(Tb,n);return e.jsx(so,{present:a||i.checked,children:e.jsx(Oi.span,{"data-state":Ib(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:r})})});Rb.displayName=Tb;var Db=a.forwardRef(({__scopeRadio:t,control:r,checked:n,bubbles:s=!0,...i},o)=>{const c=a.useRef(null),l=pi(c,o),d=Nd(n),u=Ad(r);return a.useEffect(()=>{const e=c.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(d!==n&&r){const t=new Event("click",{bubbles:s});r.call(e,n),e.dispatchEvent(t)}},[d,n,s]),e.jsx(Oi.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Ib(e){return e?"checked":"unchecked"}Db.displayName="RadioBubbleInput";var Mb=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Ub="RadioGroup",[Lb]=Ai(Ub,[hb,Ab]),Ob=hb(),zb=Ab(),[Fb,Bb]=Lb(Ub),Wb=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,name:a,defaultValue:s,value:i,required:o=!1,disabled:c=!1,orientation:l,dir:d,loop:u=!0,onValueChange:p,...m}=t,h=Ob(n),f=ib(d),[g,b]=Ii({prop:i,defaultProp:s??null,onChange:p,caller:Ub});return e.jsx(Fb,{scope:n,name:a,required:o,disabled:c,value:g,onValueChange:b,children:e.jsx(kb,{asChild:!0,...h,orientation:l,dir:f,loop:u,children:e.jsx(Oi.div,{role:"radiogroup","aria-required":o,"aria-orientation":l,"data-disabled":c?"":void 0,dir:f,...m,ref:r})})})});Wb.displayName=Ub;var Vb="RadioGroupItem",Gb=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,disabled:s,...i}=t,o=Bb(Vb,n),c=o.disabled||s,l=Ob(n),d=zb(n),u=a.useRef(null),p=pi(r,u),m=o.value===i.value,h=a.useRef(!1);return a.useEffect(()=>{const e=e=>{Mb.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(Cb,{asChild:!0,...l,focusable:!c,active:m,children:e.jsx(Pb,{disabled:c,required:o.required,checked:m,...d,...i,name:o.name,ref:p,onCheck:()=>o.onValueChange(i.value),onKeyDown:Ni(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:Ni(i.onFocus,()=>{h.current&&u.current?.click()})})})});Gb.displayName=Vb;var Hb=a.forwardRef((t,r)=>{const{__scopeRadioGroup:n,...a}=t,s=zb(n);return e.jsx(Rb,{...s,...a,ref:r})});Hb.displayName="RadioGroupIndicator";var $b=Wb,Kb=Gb,qb=Hb;const Zb=a.forwardRef(({className:t,...r},n)=>e.jsx($b,{className:Se("grid gap-2",t),...r,ref:n}));Zb.displayName=$b.displayName;const Jb=a.forwardRef(({className:t,...r},n)=>e.jsx(Kb,{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(qb,{className:"flex items-center justify-center",children:e.jsx(Qc,{className:"h-3.5 w-3.5 fill-primary"})})}));function Yb(e,[t,r]){return Math.min(r,Math.max(t,e))}Jb.displayName=Kb.displayName;var Xb="ScrollArea",[Qb]=Ai(Xb),[ev,tv]=Qb(Xb),rv=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,type:s="hover",dir:i,scrollHideDelay:o=600,...c}=t,[l,d]=a.useState(null),[u,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,C]=a.useState(!1),[E,N]=a.useState(!1),A=pi(r,e=>d(e)),j=ib(i);return e.jsx(ev,{scope:n,type:s,dir:j,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:p,content:m,onContentChange:h,scrollbarX:f,onScrollbarXChange:g,scrollbarXEnabled:k,onScrollbarXEnabledChange:C,scrollbarY:b,onScrollbarYChange:v,scrollbarYEnabled:E,onScrollbarYEnabledChange:N,onCornerWidthChange:x,onCornerHeightChange:S,children:e.jsx(Oi.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}})})});rv.displayName=Xb;var nv="ScrollAreaViewport",av=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,children:s,nonce:i,...o}=t,c=tv(nv,n),l=pi(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(Oi.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})})]})});av.displayName=nv;var sv="ScrollAreaScrollbar",iv=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=tv(sv,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(ov,{...s,ref:r,forceMount:n}):"scroll"===i.type?e.jsx(cv,{...s,ref:r,forceMount:n}):"auto"===i.type?e.jsx(lv,{...s,ref:r,forceMount:n}):"always"===i.type?e.jsx(dv,{...s,ref:r}):null});iv.displayName=sv;var ov=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=tv(sv,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(so,{present:n||o,children:e.jsx(lv,{"data-state":o?"visible":"hidden",...s,ref:r})})}),cv=a.forwardRef((t,r)=>{const{forceMount:n,...s}=t,i=tv(sv,t.__scopeScrollArea),o="horizontal"===t.orientation,c=_v(()=>d("SCROLL_END"),100),[l,d]=(u="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,u));var u,p;return a.useEffect(()=>{if("idle"===l){const e=window.setTimeout(()=>d("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[l,i.scrollHideDelay,d]),a.useEffect(()=>{const e=i.viewport,t=o?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(d("SCROLL"),c()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[i.viewport,o,d,c]),e.jsx(so,{present:n||"hidden"!==l,children:e.jsx(dv,{"data-state":"hidden"===l?"hidden":"visible",...s,ref:r,onPointerEnter:Ni(t.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Ni(t.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),lv=a.forwardRef((t,r)=>{const n=tv(sv,t.__scopeScrollArea),{forceMount:s,...i}=t,[o,c]=a.useState(!1),l="horizontal"===t.orientation,d=_v(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;c(l?e:t)}},10);return Pv(n.viewport,d),Pv(n.content,d),e.jsx(so,{present:s||o,children:e.jsx(dv,{"data-state":o?"visible":"hidden",...i,ref:r})})}),dv=a.forwardRef((t,r)=>{const{orientation:n="vertical",...s}=t,i=tv(sv,t.__scopeScrollArea),o=a.useRef(null),c=a.useRef(0),[l,d]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=kv(l.viewport,l.content),p={...s,sizes:l,onSizesChange:d,hasThumb:Boolean(u>0&&u<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=Cv(r),s=a/2,i=t||s,o=a-i,c=r.scrollbar.paddingStart+i,l=r.scrollbar.size-r.scrollbar.paddingEnd-o,d=r.content-r.viewport,u="ltr"===n?[0,d]:[-1*d,0];return Nv([c,l],u)(e)}(e,c.current,l,t)}return"horizontal"===n?e.jsx(uv,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=Ev(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(pv,{...p,ref:r,onThumbPositionChange:()=>{if(i.viewport&&o.current){const e=Ev(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}),uv=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=tv(sv,t.__scopeScrollArea),[c,l]=a.useState(),d=a.useRef(null),u=pi(r,d,o.onScrollbarXChange);return a.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),e.jsx(fv,{"data-orientation":"horizontal",...i,ref:u,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":Cv(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),Av(n,r)&&e.preventDefault()}},onResize:()=>{d.current&&o.viewport&&c&&s({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Sv(c.paddingLeft),paddingEnd:Sv(c.paddingRight)}})}})}),pv=a.forwardRef((t,r)=>{const{sizes:n,onSizesChange:s,...i}=t,o=tv(sv,t.__scopeScrollArea),[c,l]=a.useState(),d=a.useRef(null),u=pi(r,d,o.onScrollbarYChange);return a.useEffect(()=>{d.current&&l(getComputedStyle(d.current))},[d]),e.jsx(fv,{"data-orientation":"vertical",...i,ref:u,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":Cv(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),Av(n,r)&&e.preventDefault()}},onResize:()=>{d.current&&o.viewport&&c&&s({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Sv(c.paddingTop),paddingEnd:Sv(c.paddingBottom)}})}})}),[mv,hv]=Qb(sv),fv=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,sizes:s,hasThumb:i,onThumbChange:o,onThumbPointerUp:c,onThumbPointerDown:l,onThumbPositionChange:d,onDragScroll:u,onWheelScroll:p,onResize:m,...h}=t,f=tv(sv,n),[g,b]=a.useState(null),v=pi(r,e=>b(e)),y=a.useRef(null),x=a.useRef(""),w=f.viewport,S=s.content-s.viewport,k=zi(p),C=zi(d),E=_v(m,10);function N(e){if(y.current){const t=e.clientX-y.current.left,r=e.clientY-y.current.top;u({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(C,[s,C]),Pv(g,E),Pv(f.content,E),e.jsx(mv,{scope:n,scrollbar:g,hasThumb:i,onThumbChange:zi(o),onThumbPointerUp:zi(c),onThumbPositionChange:C,onThumbPointerDown:zi(l),children:e.jsx(Oi.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:Ni(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:Ni(t.onPointerMove,N),onPointerUp:Ni(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})})})}),gv="ScrollAreaThumb",bv=a.forwardRef((t,r)=>{const{forceMount:n,...a}=t,s=hv(gv,t.__scopeScrollArea);return e.jsx(so,{present:n||s.hasThumb,children:e.jsx(vv,{ref:r,...a})})}),vv=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,style:s,...i}=t,o=tv(gv,n),c=hv(gv,n),{onThumbPositionChange:l}=c,d=pi(r,e=>c.onThumbChange(e)),u=a.useRef(void 0),p=_v(()=>{u.current&&(u.current(),u.current=void 0)},100);return a.useEffect(()=>{const e=o.viewport;if(e){const t=()=>{if(p(),!u.current){const t=jv(e,l);u.current=t,l()}};return l(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[o.viewport,p,l]),e.jsx(Oi.div,{"data-state":c.hasThumb?"visible":"hidden",...i,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:Ni(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:Ni(t.onPointerUp,c.onThumbPointerUp)})});bv.displayName=gv;var yv="ScrollAreaCorner",xv=a.forwardRef((t,r)=>{const n=tv(yv,t.__scopeScrollArea),a=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&a?e.jsx(wv,{...t,ref:r}):null});xv.displayName=yv;var wv=a.forwardRef((t,r)=>{const{__scopeScrollArea:n,...s}=t,i=tv(yv,n),[o,c]=a.useState(0),[l,d]=a.useState(0),u=Boolean(o&&l);return Pv(i.scrollbarX,()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),d(e)}),Pv(i.scrollbarY,()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),c(e)}),u?e.jsx(Oi.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 Sv(e){return e?parseInt(e,10):0}function kv(e,t){const r=e/t;return isNaN(r)?0:r}function Cv(e){const t=kv(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function Ev(e,t,r="ltr"){const n=Cv(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-a,i=t.content-t.viewport,o=s-n,c=Yb(e,"ltr"===r?[0,i]:[-1*i,0]);return Nv([0,i],[0,o])(c)}function Nv(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 Av(e,t){return e>0&&e<t}var jv=(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 _v(e,t){const r=zi(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 Pv(e,t){const r=zi(t);_i(()=>{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 Tv=rv,Rv=av,Dv=xv;const Iv=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(Tv,{ref:a,className:Se("relative overflow-hidden",t),...n,children:[e.jsx(Rv,{className:"h-full w-full rounded-[inherit]",children:r}),e.jsx(Mv,{}),e.jsx(Dv,{})]}));Iv.displayName=Tv.displayName;const Mv=a.forwardRef(({className:t,orientation:r="vertical",...n},a)=>e.jsx(iv,{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(bv,{className:Se("relative rounded-full bg-border","vertical"===r&&"flex-1")})}));function Uv(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>`}Mv.displayName=iv.displayName;const Lv=["🏢","🏬","🏣","🏤","🏦","🏛️","🏠","🏡","🏭","🏗️","🏪","🏨","🏫","🏥","💼","📊","📈","📉","📋","📁","📂","🗂️","🗃️","🗄️","📅","🗓️","📝","🖋️","✏️","🖊️","🖌️","🖍️","📇","📌","📍","📎","🖇️","💻","🖥️","🖨️","🖱️","⌨️","📱","📲","📡","🌐","🔗","🔒","🔓","⚙️","🔧","🛠️","🧑‍💻","👨‍💻","👩‍💻","🕹️","💾","📟","🖥️","🖲️","🚀","💡","🎨","🖼️","🧪","🔬","🧬","🎯","⚡","🎲","🎮","🧩","📷","🎥","✉️","📨","📩","📧","📞","☎️","📠","🗣️","💬","🗨️","📢","📣","🔔","🛎️","💰","💸","💳","🏦","📈","📉","⚖️","🧾","🪙","🏛️","⚗️","🧪","🔭","🔬","🩺","🧬","🩻","🏥","🌱","🌍","🌏","🌎","🌡️","👨‍💼","👩‍💼","👨‍🏫","👩‍🏫","👨‍🔬","👩‍🔬","👨‍🎨","👩‍🎨","👨‍🔧","👩‍🔧","👨‍🚀","👩‍🚀","👨‍⚖️","👩‍⚖️","🏅","🎖️","🥇","🥈","🥉","🏆","🎗️","🔑","🗝️","🧭","🛡️","🚩","🏳️‍🌈","🎟️","🎫"],Ov=({workspace:r})=>{const{t:n}=ln(),{updateWorkspace:a}=PC(),{can:s}=Nl(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[d,u]=t.useState(),p=Fd(),m=mp({resolver:Sf(xg({name:Kf().min(2,{message:n("general.nameMinLength")}),image:Kf().optional()})),defaultValues:{name:r.name||"",image:r.image||""}});if(!r)return e.jsx(Il,{});const h=s(wl.WORKSPACE_SETTINGS_EDIT);return e.jsxs("div",{children:[p.message&&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.message})]}),!h&&e.jsx(Rl,{descriptionKey:"general.ownerOnly"}),e.jsx(Vg,{...m,children:e.jsxs("form",{onSubmit:m.handleSubmit(async function(e){o(!0),p.clear();try{await a(r,e),p.show(n("general.success"))}catch(e){Te(e,{component:"WorkspaceSettingsGeneral",action:"updateWorkspace",metadata:{workspaceId:r._id}})}finally{o(!1)}}),className:"space-y-6",children:[e.jsx(Hg,{control:m.control,name:"name",render:({field:t})=>e.jsxs(qg,{children:[e.jsx(Zg,{children:n("general.name")}),e.jsx(Jg,{children:e.jsx(Qg,{placeholder:n("general.namePlaceholder"),...t,disabled:!h})}),e.jsx(Xg,{})]})}),r.billingCurrency?.trim()&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(Wg,{className:"text-sm font-medium text-muted-foreground",children:n("general.billingCurrency")}),e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[_l(r.billingCurrency)&&e.jsx("span",{className:"text-base",children:_l(r.billingCurrency)}),e.jsx("span",{children:r.billingCurrency.trim().toUpperCase()})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(Wg,{className:"text-sm font-medium",children:n("general.icon")}),e.jsx(Yg,{children:n("general.iconDescription")})]}),e.jsxs(Zb,{value:c,disabled:!h,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(Jb,{value:"emoji",id:"emoji"}),e.jsxs(Wg,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(ni,{className:"h-4 w-4"}),n("general.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Jb,{value:"url",id:"url"}),e.jsxs(Wg,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Hs,{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:[d&&e.jsx("span",{className:"text-2xl",children:d}),!d&&m.watch("image")?.trim()&&e.jsx("img",{src:m.watch("image")||void 0,alt:"Workspace preview"})]})]}),h&&e.jsx(Iv,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Lv.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{u(e),m.setValue("image",Uv(e))})(t),disabled:!h,className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(d===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(Hg,{control:m.control,name:"image",render:({field:t})=>e.jsxs(qg,{children:[e.jsx(Zg,{children:n("general.imageUrl")}),e.jsx(Jg,{children:e.jsx(Qg,{placeholder:n("general.imageUrlPlaceholder"),...t,disabled:!h})}),e.jsx(Yg,{children:n("general.imageUrlDescription")}),e.jsx(Xg,{})]})}),m.watch("image")&&m.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:m.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:h&&e.jsx(Ei,{type:"submit",disabled:i,progress:i,children:n("general.updateWorkspace")})})]})})]})};class zv extends yn{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 Fv=t.createContext(null);function Bv(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 Wv=t.memo(function({children:r,serviceWorkerPath:n="/push-sw.js",autoSubscribe:a=!1}){const{t:s}=ln(),i=En(),{isAuthenticated:o}=IC(),c=t.useMemo(()=>"undefined"!=typeof window&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window,[]),l=t.useMemo(()=>new zv({serverUrl:i.serverUrl,version:i.version,orgId:i.orgId}),[i.serverUrl,i.version,i.orgId]),[d,u]=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 u(e=>({...e,isSubscribed:!1}));const r=await t.pushManager.getSubscription();if(e)return;u(e=>({...e,isSubscribed:!!r,permission:Notification.permission}))}catch{e||u(e=>({...e,isSubscribed:!1}))}})(),()=>{e=!0}},[o,c,n]);const p=t.useCallback(async()=>{if(!c)return!1;const e=await Notification.requestPermission();return u(t=>({...t,permission:e})),"granted"===e},[c]),m=t.useCallback(async()=>{if(c&&o){u(e=>({...e,loading:!0,error:null}));try{if(!await p())return void u(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:Bv(e)})).toJSON();await l.subscribe({endpoint:r.endpoint,keys:{p256dh:r.keys.p256dh,auth:r.keys.auth}},navigator.userAgent),u(e=>({...e,isSubscribed:!0,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToSubscribe");u(e=>({...e,loading:!1,error:t})),Te(e,{component:"PushNotificationProvider",action:"subscribe"})}}},[c,o,l,n,p]),h=t.useCallback(async()=>{if(c){u(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)}}u(e=>({...e,isSubscribed:!1,loading:!1}))}catch(e){const t=e instanceof Error?e.message:s("push.failedToUnsubscribe");u(e=>({...e,loading:!1,error:t})),Te(e,{component:"PushNotificationProvider",action:"unsubscribe"})}}},[c,l,n]),f=t.useMemo(()=>({...d,requestPermission:p,subscribe:m,unsubscribe:h}),[d,p,m,h]);return e.jsx(Fv.Provider,{value:f,children:r})});function Vv(){const e=t.useContext(Fv);if(!e)throw new Error("usePushNotifications must be used within PushNotificationProvider");return e}const Gv={firefox:4,safari:4,edge:4,chrome:4},Hv=({workspace:r})=>{const{isSupported:n,permission:a,isSubscribed:s,loading:i,error:o,subscribe:c,unsubscribe:l}=Vv(),{t:d}=ln(),{api:u}=jn(),{can:p}=Nl(),m=p(wl.WORKSPACE_SETTINGS_EDIT),h=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"}(),[]),f=Gv[h],[g,b]=t.useState([]),[v,y]=t.useState(!0),[x,w]=t.useState({}),[S,k]=t.useState(!0),[C,E]=t.useState(null),[N,A]=t.useState(null),j=t.useRef(null);t.useEffect(()=>()=>{j.current&&clearTimeout(j.current)},[]),t.useEffect(()=>{if(!r?._id)return;const e=r._id.toString();y(!0),k(!0),Promise.all([u.getNotificationEvents(e).catch(()=>[]),u.getNotificationPreferences(e).catch(()=>({}))]).then(([e,t])=>{b(e),w(t)}).finally(()=>{y(!1),k(!1)})},[r?._id]);const _=t.useCallback(async(e,t,n)=>{if(!r?._id||!m)return;const a=!n;E(`${e}.${t}`),A(null),w(r=>({...r,[e]:{...r[e],[t]:a}}));try{const n=await u.updateNotificationPreferences(r._id.toString(),{[e]:{[t]:a}});w(n),A(d("notifications.prefsSaved")),j.current&&clearTimeout(j.current),j.current=setTimeout(()=>A(null),3e3)}catch(r){w(r=>({...r,[e]:{...r[e],[t]:n}})),Te(r,{component:"SettingsNotifications",action:"toggleChannel"})}finally{E(null)}},[r?._id,m,u,d]),P=(e,t)=>!1!==x[e]?.[t],T=t.useMemo(()=>{const e=new Map;for(const t of g){const r=t.category||"general";e.has(r)||e.set(r,[]),e.get(r).push(t)}return Array.from(e.entries())},[g]),R=v||S,D=g.length>0;return e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-sm text-gray-600",children:d("notifications.manageDescription")}),n&&e.jsxs(e.Fragment,{children:[o&&"denied"!==a&&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"===a&&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(Qs,{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:d("notifications.blocked")}),e.jsx("p",{className:"text-xs text-amber-700 mt-1",children:d("notifications.blockedDescription")}),e.jsx("ol",{className:"text-xs text-amber-700 mt-2 space-y-1 list-decimal list-inside",children:Array.from({length:f},(t,r)=>e.jsx("li",{children:d(`notifications.unblock.${h}.step${r+1}`)},r))})]})]})}),"denied"!==a&&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(Ds,{className:"h-4 w-4 text-green-600"}):e.jsx(Rs,{className:"h-4 w-4 text-gray-400"})}),e.jsxs("div",{children:[e.jsx("h4",{className:"text-sm font-medium text-gray-900",children:d("notifications.pushTitle")}),e.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:d("notifications.pushDescription",{subscribed:String(s)})})]})]}),e.jsx(Ei,{variant:s?"outline":"default",size:"sm",className:"shrink-0",onClick:s?l:c,disabled:i,progress:i,children:d("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:d("notifications.deviceNote")})]})]}),R&&e.jsx("div",{className:"text-center text-sm text-gray-400 py-4",children:d("notifications.loadingPrefs")}),!R&&D&&m&&e.jsxs(e.Fragment,{children:[N&&e.jsx("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg text-sm",children:N}),T.map(([t,r])=>e.jsxs("div",{className:"border rounded-lg overflow-hidden",children:[e.jsx("div",{className:"bg-gray-50 px-4 py-2.5 border-b",children:e.jsx("h4",{className:"text-sm font-medium text-gray-700 capitalize",children:t})}),e.jsxs("div",{className:"divide-y",children:[e.jsxs("div",{className:"flex items-center px-4 py-2 bg-gray-50/50",children:[e.jsx("div",{className:"flex-1"}),e.jsxs("div",{className:"flex items-center gap-6",children:[e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(Ks,{className:"h-3.5 w-3.5 text-gray-400"})}),e.jsx("div",{className:"w-12 flex justify-center",children:e.jsx(ri,{className:"h-3.5 w-3.5 text-gray-400"})})]})]}),r.map(t=>{const r=P(t.slug,"email"),n=P(t.slug,"push"),a=C===`${t.slug}.email`,s=C===`${t.slug}.push`;return e.jsxs("div",{className:"flex items-center px-4 py-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900",children:t.name}),t.description&&e.jsx("div",{className:"text-xs text-gray-500 mt-0.5",children:t.description})]}),e.jsxs("div",{className:"flex items-center gap-6 shrink-0",children:[e.jsx("div",{className:"w-12 flex justify-center",children:t.channels.email?e.jsx(zd,{checked:r,onCheckedChange:()=>_(t.slug,"email",r),disabled:a}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})}),e.jsx("div",{className:"w-12 flex justify-center",children:t.channels.push?e.jsx(zd,{checked:n,onCheckedChange:()=>_(t.slug,"push",n),disabled:s}):e.jsx("span",{className:"text-xs text-gray-300",children:"—"})})]})]},t.slug)})]})]},t))]})]})},$v=({workspace:r})=>{const{t:n}=ln(),{isOwner:a}=Nl(),{settings:s}=An(),{appPermissions:i}=sa(),{updateWorkspacePermissions:o}=PC(),[c,l]=t.useState(!1),d=Fd(),u=t.useMemo(()=>s?.workspace?.roles??r.roles??[],[s?.workspace?.roles,r.roles]),p=t.useMemo(()=>{if(!i)return[];const e=new Set;for(const t of Object.values(i))for(const r of t)r.startsWith("workspace:")||e.add(r);return Array.from(e).sort()},[i]),[m,h]=t.useState({});if(t.useEffect(()=>{if(!i)return;const e=r.permissions,t={};for(const r of u)t[r]=e&&r in e?e[r].filter(e=>!e.startsWith("workspace:")):r in i?i[r].filter(e=>!e.startsWith("workspace:")):[];h(t)},[r.permissions,i,u]),!r)return e.jsx(Il,{});if(!i||0===p.length)return null;return e.jsxs("div",{children:[d.message&&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:d.message})]}),!a&&e.jsx(Rl,{descriptionKey:"permissions.ownerOnly"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:n("permissions.description")}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b",children:[e.jsx("th",{className:"text-start py-2 pe-4 font-medium text-gray-500 min-w-[160px]"}),u.map(t=>e.jsx("th",{className:"text-center py-2 px-3 font-medium text-gray-700 capitalize min-w-[80px]",children:t},t))]})}),e.jsx("tbody",{children:p.map(t=>e.jsxs("tr",{className:"border-b border-gray-50 hover:bg-gray-50/50",children:[e.jsx("td",{className:"py-2 pe-4 text-gray-700 font-mono text-xs",children:t}),u.map(r=>{const n="admin"===r,s=n||(m[r]??[]).includes(t);return e.jsx("td",{className:"text-center py-2 px-3",children:e.jsx(zd,{checked:s,disabled:!a||n,onCheckedChange:()=>((e,t)=>{h(r=>{const n=r[e]??[],a=n.includes(t);return{...r,[e]:a?n.filter(e=>e!==t):[...n,t]}})})(r,t),className:"mx-auto"})},r)})]},t))})]})}),a&&e.jsx("div",{className:"mt-6",children:e.jsx(Ei,{onClick:async()=>{l(!0),d.clear();try{const e=r.permissions??{},t={},a=new Set([...Object.keys(e),...Object.keys(m)]);for(const r of a){const n=(e[r]??[]).filter(e=>e.startsWith("workspace:")),a=m[r]??[];t[r]=[...n,...a]}await o(r._id,t),d.show(n("permissions.saveSuccess"))}catch(e){Te(e,{component:"WorkspaceSettingsPermissions",action:"savePermissions",metadata:{workspaceId:r._id}})}finally{l(!1)}},disabled:c,progress:c,children:n(c?"permissions.saving":"permissions.save")})})]})};var Kv=.999,qv=/[\\\/_+.#"@\[\(\{&]/,Zv=/[\\\/_+.#"@\[\(\{&]/g,Jv=/[\s-]/,Yv=/[\s-]/g;function Xv(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,d,u,p=n.charAt(s),m=r.indexOf(p,a),h=0;m>=0;)(c=Xv(e,t,r,n,m+1,s+1,i))>h&&(m===a?c*=1:qv.test(e.charAt(m-1))?(c*=.8,(d=e.slice(a,m-1).match(Zv))&&a>0&&(c*=Math.pow(Kv,d.length))):Jv.test(e.charAt(m-1))?(c*=.9,(u=e.slice(a,m-1).match(Yv))&&a>0&&(c*=Math.pow(Kv,u.length))):(c*=.17,a>0&&(c*=Math.pow(Kv,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=Xv(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 Qv(e){return e.toLowerCase().replace(Yv," ")}function ey(e,t,r){return Xv(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,Qv(e),Qv(t),0,0,{})}var ty='[cmdk-group=""]',ry='[cmdk-group-items=""]',ny='[cmdk-item=""]',ay=`${ny}:not([aria-disabled="true"])`,sy="cmdk-item-select",iy="data-value",oy=(e,t,r)=>ey(e,t,r),cy=a.createContext(void 0),ly=()=>a.useContext(cy),dy=a.createContext(void 0),uy=()=>a.useContext(dy),py=a.createContext(void 0),my=a.forwardRef((e,t)=>{let r=Ay(()=>{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=Ay(()=>new Set),s=Ay(()=>new Map),i=Ay(()=>new Map),o=Ay(()=>new Set),c=Ey(e),{label:l,children:d,value:u,onValueChange:p,filter:m,shouldFilter:h,loop:f,disablePointerSelection:g=!1,vimBindings:b=!0,...v}=e,y=Ri(),x=Ri(),w=Ri(),S=a.useRef(null),k=Py();Ny(()=>{if(void 0!==u){let e=u.trim();r.current.value=e,C.emit()}},[u]),Ny(()=>{k(6,P)},[]);let C=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)_(),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=T())?void 0:e.id,C.emit()}),n||k(5,P),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))}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),E=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(),C.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,()=>{_(),A(),r.current.value||j(),C.emit()}),()=>{i.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=T();k(4,()=>{_(),(null==t?void 0:t.getAttribute("id"))===e&&j(),C.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:oy;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(ry);t?t.appendChild(e.parentElement===t?e:e.closest(`${ry} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${ry} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{var t;let r=null==(t=S.current)?void 0:t.querySelector(`${ty}[${iy}="${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(iy);C.setState("value",t||void 0)}function _(){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 P(){var e,t,r;let n=T();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(ty))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=S.current)?void 0:e.querySelector(`${ny}[aria-selected="true"]`)}function R(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(ay))||[])}function D(e){let t=R()[e];t&&C.setState("value",t.getAttribute(iy))}function I(e){var t;let r=T(),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&&C.setState("value",s.getAttribute(iy))}function M(e){let t,r=T(),n=null==r?void 0:r.closest(ty);for(;n&&!t;)n=e>0?ky(n,ty):Cy(n,ty),t=null==n?void 0:n.querySelector(ay);t?C.setState("value",t.getAttribute(iy)):I(e)}let U=()=>D(R().length-1),L=e=>{e.preventDefault(),e.metaKey?U():e.altKey?M(1):I(1)},O=e=>{e.preventDefault(),e.metaKey?D(0):e.altKey?M(-1):I(-1)};return a.createElement(Oi.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(),U();break;case"Enter":{e.preventDefault();let t=T();if(t){let e=new Event(sy);t.dispatchEvent(e)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:Ry},l),Ty(e,e=>a.createElement(dy.Provider,{value:C},a.createElement(cy.Provider,{value:E},e))))}),hy=a.forwardRef((e,t)=>{var r,n;let s=Ri(),i=a.useRef(null),o=a.useContext(py),c=ly(),l=Ey(e),d=null!=(n=null==(r=l.current)?void 0:r.forceMount)?n:null==o?void 0:o.forceMount;Ny(()=>{if(!d)return c.item(s,null==o?void 0:o.id)},[d]);let u=_y(s,i,[e.value,e.children,i],e.keywords),p=uy(),m=jy(e=>e.value&&e.value===u.current),h=jy(e=>!(!d&&!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,u.current)}function g(){p.setState("value",u.current,!0)}if(a.useEffect(()=>{let t=i.current;if(t&&!e.disabled)return t.addEventListener(sy,f),()=>t.removeEventListener(sy,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(Oi.div,{ref:ui(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)}),fy=a.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:s,...i}=e,o=Ri(),c=a.useRef(null),l=a.useRef(null),d=Ri(),u=ly(),p=jy(e=>!(!s&&!1!==u.filter())||(!e.search||e.filtered.groups.has(o)));Ny(()=>u.group(o),[]),_y(o,c,[e.value,e.heading,l]);let m=a.useMemo(()=>({id:o,forceMount:s}),[s]);return a.createElement(Oi.div,{ref:ui(c,t),...i,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&a.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:d},r),Ty(e,e=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?d:void 0},a.createElement(py.Provider,{value:m},e))))}),gy=a.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,s=a.useRef(null),i=jy(e=>!e.search);return r||i?a.createElement(Oi.div,{ref:ui(s,t),...n,"cmdk-separator":"",role:"separator"}):null}),by=a.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,s=null!=e.value,i=uy(),o=jy(e=>e.search),c=jy(e=>e.selectedItemId),l=ly();return a.useEffect(()=>{null!=e.value&&i.setState("search",e.value)},[e.value]),a.createElement(Oi.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)}})}),vy=a.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...s}=e,i=a.useRef(null),o=a.useRef(null),c=jy(e=>e.selectedItemId),l=ly();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(Oi.div,{ref:ui(i,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":n,id:l.listId},Ty(e,e=>a.createElement("div",{ref:ui(o,l.listInnerRef),"cmdk-list-sizer":""},e)))}),yy=a.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:s,contentClassName:i,container:o,...c}=e;return a.createElement(Bc,{open:r,onOpenChange:n},a.createElement(Vc,{container:o},a.createElement(Gc,{"cmdk-overlay":"",className:s}),a.createElement(Hc,{"aria-label":e.label,"cmdk-dialog":"",className:i},a.createElement(my,{ref:t,...c}))))}),xy=a.forwardRef((e,t)=>jy(e=>0===e.filtered.count)?a.createElement(Oi.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),wy=a.forwardRef((e,t)=>{let{progress:r,children:n,label:s="Loading...",...i}=e;return a.createElement(Oi.div,{ref:t,...i,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Ty(e,e=>a.createElement("div",{"aria-hidden":!0},e)))}),Sy=Object.assign(my,{List:vy,Item:hy,Input:by,Group:fy,Separator:gy,Dialog:yy,Empty:xy,Loading:wy});function ky(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function Cy(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function Ey(e){let t=a.useRef(e);return Ny(()=>{t.current=e}),t}var Ny="undefined"==typeof window?a.useEffect:a.useLayoutEffect;function Ay(e){let t=a.useRef();return void 0===t.current&&(t.current=e()),t}function jy(e){let t=uy(),r=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,r,r)}function _y(e,t,r,n=[]){let s=a.useRef(),i=ly();return Ny(()=>{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(iy,o),s.current=o}),s}var Py=()=>{let[e,t]=a.useState(),r=Ay(()=>new Map);return Ny(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function Ty({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 Ry={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Dy=a.forwardRef(({className:t,...r},n)=>e.jsx(Sy,{ref:n,className:Se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",t),...r}));Dy.displayName=Sy.displayName;const Iy=a.forwardRef(({className:t,...r},n)=>e.jsxs("div",{className:"flex items-center border-b px-3","data-cmdk-input-wrapper":"",children:[e.jsx(nl,{className:"me-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(Sy.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})]}));Iy.displayName=Sy.Input.displayName;const My=a.forwardRef(({className:t,...r},n)=>e.jsx(Sy.List,{ref:n,className:Se("max-h-[300px] overflow-y-auto overflow-x-hidden",t),...r}));My.displayName=Sy.List.displayName;a.forwardRef((t,r)=>e.jsx(Sy.Empty,{ref:r,className:"py-6 text-center text-sm",...t})).displayName=Sy.Empty.displayName;const Uy=a.forwardRef(({className:t,...r},n)=>e.jsx(Sy.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}));Uy.displayName=Sy.Group.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(Sy.Separator,{ref:n,className:Se("-mx-1 h-px bg-border",t),...r})).displayName=Sy.Separator.displayName;const Ly=a.forwardRef(({className:t,...r},n)=>e.jsx(Sy.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}));Ly.displayName=Sy.Item.displayName;const Oy=["top","right","bottom","left"],zy=Math.min,Fy=Math.max,By=Math.round,Wy=Math.floor,Vy=e=>({x:e,y:e}),Gy={left:"right",right:"left",bottom:"top",top:"bottom"},Hy={start:"end",end:"start"};function $y(e,t,r){return Fy(e,zy(t,r))}function Ky(e,t){return"function"==typeof e?e(t):e}function qy(e){return e.split("-")[0]}function Zy(e){return e.split("-")[1]}function Jy(e){return"x"===e?"y":"x"}function Yy(e){return"y"===e?"height":"width"}const Xy=new Set(["top","bottom"]);function Qy(e){return Xy.has(qy(e))?"y":"x"}function ex(e){return Jy(Qy(e))}function tx(e){return e.replace(/start|end/g,e=>Hy[e])}const rx=["left","right"],nx=["right","left"],ax=["top","bottom"],sx=["bottom","top"];function ix(e,t,r,n){const a=Zy(e);let s=function(e,t,r){switch(e){case"top":case"bottom":return r?t?nx:rx:t?rx:nx;case"left":case"right":return t?ax:sx;default:return[]}}(qy(e),"start"===r,n);return a&&(s=s.map(e=>e+"-"+a),t&&(s=s.concat(s.map(tx)))),s}function ox(e){return e.replace(/left|right|bottom|top/g,e=>Gy[e])}function cx(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 lx(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 dx(e,t,r){let{reference:n,floating:a}=e;const s=Qy(t),i=ex(t),o=Yy(i),c=qy(t),l="y"===s,d=n.x+n.width/2-a.width/2,u=n.y+n.height/2-a.height/2,p=n[o]/2-a[o]/2;let m;switch(c){case"top":m={x:d,y:n.y-a.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:u};break;case"left":m={x:n.x-a.width,y:u};break;default:m={x:n.x,y:n.y}}switch(Zy(t)){case"start":m[i]-=p*(r&&l?-1:1);break;case"end":m[i]+=p*(r&&l?-1:1)}return m}async function ux(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:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:m=0}=Ky(t,e),h=cx(m),f=o[p?"floating"===u?"reference":"floating":u],g=lx(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:d,strategy:c})),b="floating"===u?{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=lx(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 px(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function mx(e){return Oy.some(t=>e[t]>=0)}const hx=new Set(["left","top"]);function fx(){return"undefined"!=typeof window}function gx(e){return yx(e)?(e.nodeName||"").toLowerCase():"#document"}function bx(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function vx(e){var t;return null==(t=(yx(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function yx(e){return!!fx()&&(e instanceof Node||e instanceof bx(e).Node)}function xx(e){return!!fx()&&(e instanceof Element||e instanceof bx(e).Element)}function wx(e){return!!fx()&&(e instanceof HTMLElement||e instanceof bx(e).HTMLElement)}function Sx(e){return!(!fx()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof bx(e).ShadowRoot)}const kx=new Set(["inline","contents"]);function Cx(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=Ux(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!kx.has(a)}const Ex=new Set(["table","td","th"]);function Nx(e){return Ex.has(gx(e))}const Ax=[":popover-open",":modal"];function jx(e){return Ax.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const _x=["transform","translate","scale","rotate","perspective"],Px=["transform","translate","scale","rotate","perspective","filter"],Tx=["paint","layout","strict","content"];function Rx(e){const t=Dx(),r=xx(e)?Ux(e):e;return _x.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||Px.some(e=>(r.willChange||"").includes(e))||Tx.some(e=>(r.contain||"").includes(e))}function Dx(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Ix=new Set(["html","body","#document"]);function Mx(e){return Ix.has(gx(e))}function Ux(e){return bx(e).getComputedStyle(e)}function Lx(e){return xx(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ox(e){if("html"===gx(e))return e;const t=e.assignedSlot||e.parentNode||Sx(e)&&e.host||vx(e);return Sx(t)?t.host:t}function zx(e){const t=Ox(e);return Mx(t)?e.ownerDocument?e.ownerDocument.body:e.body:wx(t)&&Cx(t)?t:zx(t)}function Fx(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const a=zx(e),s=a===(null==(n=e.ownerDocument)?void 0:n.body),i=bx(a);if(s){const e=Bx(i);return t.concat(i,i.visualViewport||[],Cx(a)?a:[],e&&r?Fx(e):[])}return t.concat(a,Fx(a,[],r))}function Bx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Wx(e){const t=Ux(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=wx(e),s=a?e.offsetWidth:r,i=a?e.offsetHeight:n,o=By(r)!==s||By(n)!==i;return o&&(r=s,n=i),{width:r,height:n,$:o}}function Vx(e){return xx(e)?e:e.contextElement}function Gx(e){const t=Vx(e);if(!wx(t))return Vy(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:s}=Wx(t);let i=(s?By(r.width):r.width)/n,o=(s?By(r.height):r.height)/a;return i&&Number.isFinite(i)||(i=1),o&&Number.isFinite(o)||(o=1),{x:i,y:o}}const Hx=Vy(0);function $x(e){const t=bx(e);return Dx()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Hx}function Kx(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const a=e.getBoundingClientRect(),s=Vx(e);let i=Vy(1);t&&(n?xx(n)&&(i=Gx(n)):i=Gx(e));const o=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==bx(e))&&t}(s,r,n)?$x(s):Vy(0);let c=(a.left+o.x)/i.x,l=(a.top+o.y)/i.y,d=a.width/i.x,u=a.height/i.y;if(s){const e=bx(s),t=n&&xx(n)?bx(n):n;let r=e,a=Bx(r);for(;a&&n&&t!==r;){const e=Gx(a),t=a.getBoundingClientRect(),n=Ux(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,d*=e.x,u*=e.y,c+=s,l+=i,r=bx(a),a=Bx(r)}}return lx({width:d,height:u,x:c,y:l})}function qx(e,t){const r=Lx(e).scrollLeft;return t?t.left+r:Kx(vx(e)).left+r}function Zx(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-qx(e,r),y:r.top+t.scrollTop}}const Jx=new Set(["absolute","fixed"]);function Yx(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=bx(e),n=vx(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=Dx();(!e||e&&"fixed"===t)&&(o=a.offsetLeft,c=a.offsetTop)}const l=qx(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=vx(e),r=Lx(e),n=e.ownerDocument.body,a=Fy(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=Fy(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+qx(e);const o=-r.scrollTop;return"rtl"===Ux(n).direction&&(i+=Fy(t.clientWidth,n.clientWidth)-a),{width:a,height:s,x:i,y:o}}(vx(e));else if(xx(t))n=function(e,t){const r=Kx(e,!0,"fixed"===t),n=r.top+e.clientTop,a=r.left+e.clientLeft,s=wx(e)?Gx(e):Vy(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=$x(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return lx(n)}function Xx(e,t){const r=Ox(e);return!(r===t||!xx(r)||Mx(r))&&("fixed"===Ux(r).position||Xx(r,t))}function Qx(e,t,r){const n=wx(t),a=vx(t),s="fixed"===r,i=Kx(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const c=Vy(0);function l(){c.x=qx(a)}if(n||!n&&!s)if(("body"!==gx(t)||Cx(a))&&(o=Lx(t)),n){const e=Kx(t,!0,s,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&l();s&&!n&&a&&l();const d=!a||n||s?Vy(0):Zx(a,o);return{x:i.left+o.scrollLeft-c.x-d.x,y:i.top+o.scrollTop-c.y-d.y,width:i.width,height:i.height}}function ew(e){return"static"===Ux(e).position}function tw(e,t){if(!wx(e)||"fixed"===Ux(e).position)return null;if(t)return t(e);let r=e.offsetParent;return vx(e)===r&&(r=r.ownerDocument.body),r}function rw(e,t){const r=bx(e);if(jx(e))return r;if(!wx(e)){let t=Ox(e);for(;t&&!Mx(t);){if(xx(t)&&!ew(t))return t;t=Ox(t)}return r}let n=tw(e,t);for(;n&&Nx(n)&&ew(n);)n=tw(n,t);return n&&Mx(n)&&ew(n)&&!Rx(n)?r:n||function(e){let t=Ox(e);for(;wx(t)&&!Mx(t);){if(Rx(t))return t;if(jx(t))return null;t=Ox(t)}return null}(e)||r}const nw={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const s="fixed"===a,i=vx(n),o=!!t&&jx(t.floating);if(n===i||o&&s)return r;let c={scrollLeft:0,scrollTop:0},l=Vy(1);const d=Vy(0),u=wx(n);if((u||!u&&!s)&&(("body"!==gx(n)||Cx(i))&&(c=Lx(n)),wx(n))){const e=Kx(n);l=Gx(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}const p=!i||u||s?Vy(0):Zx(i,c);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-c.scrollLeft*l.x+d.x+p.x,y:r.y*l.y-c.scrollTop*l.y+d.y+p.y}},getDocumentElement:vx,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const s=[..."clippingAncestors"===r?jx(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=Fx(e,[],!1).filter(e=>xx(e)&&"body"!==gx(e)),a=null;const s="fixed"===Ux(e).position;let i=s?Ox(e):e;for(;xx(i)&&!Mx(i);){const t=Ux(i),r=Rx(i);r||"fixed"!==t.position||(a=null),(s?!r&&!a:!r&&"static"===t.position&&a&&Jx.has(a.position)||Cx(i)&&!r&&Xx(e,i))?n=n.filter(e=>e!==i):a=t,i=Ox(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=s[0],o=s.reduce((e,r)=>{const n=Yx(t,r,a);return e.top=Fy(n.top,e.top),e.right=zy(n.right,e.right),e.bottom=zy(n.bottom,e.bottom),e.left=Fy(n.left,e.left),e},Yx(t,i,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:rw,getElementRects:async function(e){const t=this.getOffsetParent||rw,r=this.getDimensions,n=await r(e.floating);return{reference:Qx(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}=Wx(e);return{width:t,height:r}},getScale:Gx,isElement:xx,isRTL:function(e){return"rtl"===Ux(e).direction}};function aw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sw(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=Vx(e),d=a||s?[...l?Fx(l):[],...Fx(t)]:[];d.forEach(e=>{a&&e.addEventListener("scroll",r,{passive:!0}),s&&e.addEventListener("resize",r)});const u=l&&o?function(e,t){let r,n=null;const a=vx(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:d,top:u,width:p,height:m}=l;if(o||t(),!p||!m)return;const h={rootMargin:-Wy(u)+"px "+-Wy(a.clientWidth-(d+p))+"px "+-Wy(a.clientHeight-(u+m))+"px "+-Wy(d)+"px",threshold:Fy(0,zy(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||aw(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?Kx(e):null;return c&&function t(){const n=Kx(e);f&&!aw(f,n)&&r();f=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{a&&e.removeEventListener("scroll",r),s&&e.removeEventListener("resize",r)}),null==u||u(),null==(e=h)||e.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const iw=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=qy(r),o=Zy(r),c="y"===Qy(r),l=hx.has(i)?-1:1,d=s&&c?-1:1,u=Ky(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return o&&"number"==typeof h&&(m="end"===o?-1*h:h),c?{x:m*d,y:p*l}:{x:p*l,y:m*d}}(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}}}}},ow=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}=Ky(e,t),d={x:r,y:n},u=await s.detectOverflow(t,l),p=Qy(qy(a)),m=Jy(p);let h=d[m],f=d[p];if(i){const e="y"===m?"bottom":"right";h=$y(h+u["y"===m?"top":"left"],h,h-u[e])}if(o){const e="y"===p?"bottom":"right";f=$y(f+u["y"===p?"top":"left"],f,f-u[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}}}}}},cw=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:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:f=!0,...g}=Ky(e,t);if(null!=(r=s.arrow)&&r.alignmentOffset)return{};const b=qy(a),v=Qy(o),y=qy(o)===o,x=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=p||(y||!f?[ox(o)]:function(e){const t=ox(e);return[tx(e),t,tx(t)]}(o)),S="none"!==h;!p&&S&&w.push(...ix(o,f,h,x));const k=[o,...w],C=await c.detectOverflow(t,g),E=[];let N=(null==(n=s.flip)?void 0:n.overflows)||[];if(d&&E.push(C[b]),u){const e=function(e,t,r){void 0===r&&(r=!1);const n=Zy(e),a=ex(e),s=Yy(a);let i="x"===a?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=ox(i)),[i,ox(i)]}(a,i,x);E.push(C[e[0]],C[e[1]])}if(N=[...N,{placement:a,overflows:E}],!E.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"===u&&v!==Qy(t))||N.every(e=>Qy(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 _;const e=null==(_=N.filter(e=>{if(S){const t=Qy(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:_[0];e&&(r=e);break}case"initialPlacement":r=o}if(a!==r)return{reset:{placement:r}}}return{}}}},lw=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}=Ky(e,t),d=await i.detectOverflow(t,l),u=qy(a),p=Zy(a),m="y"===Qy(a),{width:h,height:f}=s.floating;let g,b;"top"===u||"bottom"===u?(g=u,b=p===(await(null==i.isRTL?void 0:i.isRTL(o.floating))?"start":"end")?"left":"right"):(b=u,g="end"===p?"top":"bottom");const v=f-d.top-d.bottom,y=h-d.left-d.right,x=zy(f-d[g],v),w=zy(h-d[b],y),S=!t.middlewareData.shift;let k=x,C=w;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(C=y),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(k=v),S&&!p){const e=Fy(d.left,0),t=Fy(d.right,0),r=Fy(d.top,0),n=Fy(d.bottom,0);m?C=h-2*(0!==e||0!==t?e+t:Fy(d.left,d.right)):k=f-2*(0!==r||0!==n?r+n:Fy(d.top,d.bottom))}await c({...t,availableWidth:C,availableHeight:k});const E=await i.getDimensions(o.floating);return h!==E.width||f!==E.height?{reset:{rects:!0}}:{}}}},dw=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:a="referenceHidden",...s}=Ky(e,t);switch(a){case"referenceHidden":{const e=px(await n.detectOverflow(t,{...s,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:mx(e)}}}case"escaped":{const e=px(await n.detectOverflow(t,{...s,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:mx(e)}}}default:return{}}}}},uw=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:d=0}=Ky(e,t)||{};if(null==l)return{};const u=cx(d),p={x:r,y:n},m=ex(a),h=Yy(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 C=x/2-w/2,E=k/2-f[h]/2-1,N=zy(u[b],E),A=zy(u[v],E),j=N,_=k-f[h]-A,P=k/2-f[h]/2+C,T=$y(j,P,_),R=!c.arrow&&null!=Zy(a)&&P!==T&&s.reference[h]/2-(P<j?N:A)-f[h]/2<0,D=R?P<j?P-j:P-_:0;return{[m]:p[m]+D,data:{[m]:T,centerOffset:P-T-D,...R&&{alignmentOffset:D}},reset:R}}}),pw=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}=Ky(e,t),d={x:r,y:n},u=Qy(a),p=Jy(u);let m=d[p],h=d[u];const f=Ky(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=hx.has(qy(a)),r=s.reference[u]-s.floating[e]+(t&&(null==(b=i.offset)?void 0:b[u])||0)+(t?0:g.crossAxis),n=s.reference[u]+s.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[u])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[p]:m,[u]:h}}}},mw=(e,t,r)=>{const n=new Map,a={platform:nw,...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:d,y:u}=dx(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:d,y:u,initialPlacement:n,placement:p,strategy:a,middlewareData:m,rects:l,platform:{...i,detectOverflow:null!=(f=i.detectOverflow)?f:ux},elements:{reference:e,floating:t}});d=null!=b?b:d,u=null!=v?v:u,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:d,y:u}=dx(l,p,c))),r=-1)}return{x:d,y:u,placement:p,strategy:a,middlewareData:m}})(e,t,{...a,platform:s})};var hw="undefined"!=typeof document?t.useLayoutEffect:function(){};function fw(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(!fw(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)&&!fw(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function gw(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bw(e,t){const r=gw(e);return Math.round(t*r)/r}function vw(e){const t=a.useRef(e);return hw(()=>{t.current=e}),t}const yw=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?uw({element:r.current,padding:n}).fn(t):{}:r?uw({element:r,padding:n}).fn(t):{};var a}}),xw=(e,t)=>({...iw(e),options:[e,t]}),ww=(e,t)=>({...ow(e),options:[e,t]}),Sw=(e,t)=>({...pw(e),options:[e,t]}),kw=(e,t)=>({...cw(e),options:[e,t]}),Cw=(e,t)=>({...lw(e),options:[e,t]}),Ew=(e,t)=>({...dw(e),options:[e,t]}),Nw=(e,t)=>({...yw(e),options:[e,t]});var Aw=a.forwardRef((t,r)=>{const{children:n,width:a=10,height:s=5,...i}=t;return e.jsx(Oi.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"})})});Aw.displayName="Arrow";var jw=Aw,_w="Popper",[Pw,Tw]=Ai(_w),[Rw,Dw]=Pw(_w),Iw=t=>{const{__scopePopper:r,children:n}=t,[s,i]=a.useState(null);return e.jsx(Rw,{scope:r,anchor:s,onAnchorChange:i,children:n})};Iw.displayName=_w;var Mw="PopperAnchor",Uw=a.forwardRef((t,r)=>{const{__scopePopper:n,virtualRef:s,...i}=t,o=Dw(Mw,n),c=a.useRef(null),l=pi(r,c),d=a.useRef(null);return a.useEffect(()=>{const e=d.current;d.current=s?.current||c.current,e!==d.current&&o.onAnchorChange(d.current)}),s?null:e.jsx(Oi.div,{...i,ref:l})});Uw.displayName=Mw;var Lw="PopperContent",[Ow,zw]=Pw(Lw),Fw=a.forwardRef((t,r)=>{const{__scopePopper:n,side:i="bottom",sideOffset:o=0,align:c="center",alignOffset:l=0,arrowPadding:d=0,avoidCollisions:u=!0,collisionBoundary:p=[],collisionPadding:m=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:g="optimized",onPlaced:b,...v}=t,y=Dw(Lw,n),[x,w]=a.useState(null),S=pi(r,e=>w(e)),[k,C]=a.useState(null),E=Ad(k),N=E?.width??0,A=E?.height??0,j=i+("center"!==c?"-"+c:""),_="number"==typeof m?m:{top:0,right:0,bottom:0,left:0,...m},P=Array.isArray(p)?p:[p],T=P.length>0,R={padding:_,boundary:P.filter(Gw),altBoundary:T},{refs:D,floatingStyles:I,placement:M,isPositioned:U,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:d,open:u}=e,[p,m]=a.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=a.useState(n);fw(h,n)||f(n);const[g,b]=a.useState(null),[v,y]=a.useState(null),x=a.useCallback(e=>{e!==C.current&&(C.current=e,b(e))},[]),w=a.useCallback(e=>{e!==E.current&&(E.current=e,y(e))},[]),S=o||g,k=c||v,C=a.useRef(null),E=a.useRef(null),N=a.useRef(p),A=null!=d,j=vw(d),_=vw(i),P=vw(u),T=a.useCallback(()=>{if(!C.current||!E.current)return;const e={placement:t,strategy:r,middleware:h};_.current&&(e.platform=_.current),mw(C.current,E.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};R.current&&!fw(N.current,t)&&(N.current=t,s.flushSync(()=>{m(t)}))})},[h,t,r,_,P]);hw(()=>{!1===u&&N.current.isPositioned&&(N.current.isPositioned=!1,m(e=>({...e,isPositioned:!1})))},[u]);const R=a.useRef(!1);hw(()=>(R.current=!0,()=>{R.current=!1}),[]),hw(()=>{if(S&&(C.current=S),k&&(E.current=k),S&&k){if(j.current)return j.current(S,k,T);T()}},[S,k,T,j,A]);const D=a.useMemo(()=>({reference:C,floating:E,setReference:x,setFloating:w}),[x,w]),I=a.useMemo(()=>({reference:S,floating:k}),[S,k]),M=a.useMemo(()=>{const e={position:r,left:0,top:0};if(!I.floating)return e;const t=bw(I.floating,p.x),n=bw(I.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...gw(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:T,refs:D,elements:I,floatingStyles:M}),[p,T,D,I,M])}({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>sw(...e,{animationFrame:"always"===g}),elements:{reference:y.anchor},middleware:[xw({mainAxis:o+A,alignmentAxis:l}),u&&ww({mainAxis:!0,crossAxis:!1,limiter:"partial"===h?Sw():void 0,...R}),u&&kw({...R}),Cw({...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&&Nw({element:k,padding:d}),Hw({arrowWidth:N,arrowHeight:A}),f&&Ew({strategy:"referenceHidden",...R})]}),[O,z]=$w(M),F=zi(b);_i(()=>{U&&F?.()},[U,F]);const B=L.arrow?.x,W=L.arrow?.y,V=0!==L.arrow?.centerOffset,[G,H]=a.useState();return _i(()=>{x&&H(window.getComputedStyle(x).zIndex)},[x]),e.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:U?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:e.jsx(Ow,{scope:n,placedSide:O,onArrowChange:C,arrowX:B,arrowY:W,shouldHideArrow:V,children:e.jsx(Oi.div,{"data-side":O,"data-align":z,...v,ref:S,style:{...v.style,animation:U?void 0:"none"}})})})});Fw.displayName=Lw;var Bw="PopperArrow",Ww={top:"bottom",right:"left",bottom:"top",left:"right"},Vw=a.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,s=zw(Bw,n),i=Ww[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(jw,{...a,ref:r,style:{...a.style,display:"block"}})})});function Gw(e){return null!==e}Vw.displayName=Bw;var Hw=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]=$w(r),d={start:"0%",center:"50%",end:"100%"}[l],u=(a.arrow?.x??0)+i/2,p=(a.arrow?.y??0)+o/2;let m="",h="";return"bottom"===c?(m=s?d:`${u}px`,h=-o+"px"):"top"===c?(m=s?d:`${u}px`,h=`${n.floating.height+o}px`):"right"===c?(m=-o+"px",h=s?d:`${p}px`):"left"===c&&(m=`${n.floating.width+o}px`,h=s?d:`${p}px`),{data:{x:m,y:h}}}});function $w(e){const[t,r="center"]=e.split("-");return[t,r]}var Kw=Iw,qw=Uw,Zw=Fw,Jw=Vw;function Yw(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?ui(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 Xw=Symbol("radix.slottable");function Qw(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Xw}var eS="Popover",[tS]=Ai(eS,[Tw]),rS=Tw(),[nS,aS]=tS(eS),sS=t=>{const{__scopePopover:r,children:n,open:s,defaultOpen:i,onOpenChange:o,modal:c=!1}=t,l=rS(r),d=a.useRef(null),[u,p]=a.useState(!1),[m,h]=Ii({prop:s,defaultProp:i??!1,onChange:o,caller:eS});return e.jsx(Kw,{...l,children:e.jsx(nS,{scope:r,contentId:Ri(),triggerRef:d,open:m,onOpenChange:h,onOpenToggle:a.useCallback(()=>h(e=>!e),[h]),hasCustomAnchor:u,onCustomAnchorAdd:a.useCallback(()=>p(!0),[]),onCustomAnchorRemove:a.useCallback(()=>p(!1),[]),modal:c,children:n})})};sS.displayName=eS;var iS="PopoverAnchor";a.forwardRef((t,r)=>{const{__scopePopover:n,...s}=t,i=aS(iS,n),o=rS(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:l}=i;return a.useEffect(()=>(c(),()=>l()),[c,l]),e.jsx(qw,{...o,...s,ref:r})}).displayName=iS;var oS="PopoverTrigger",cS=a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=aS(oS,n),i=rS(n),o=pi(r,s.triggerRef),c=e.jsx(Oi.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":xS(s.open),...a,ref:o,onClick:Ni(t.onClick,s.onOpenToggle)});return s.hasCustomAnchor?c:e.jsx(qw,{asChild:!0,...i,children:c})});cS.displayName=oS;var lS="PopoverPortal",[dS,uS]=tS(lS,{forceMount:void 0}),pS=t=>{const{__scopePopover:r,forceMount:n,children:a,container:s}=t,i=aS(lS,r);return e.jsx(dS,{scope:r,forceMount:n,children:e.jsx(so,{present:n||i.open,children:e.jsx(ao,{asChild:!0,container:s,children:a})})})};pS.displayName=lS;var mS="PopoverContent",hS=a.forwardRef((t,r)=>{const n=uS(mS,t.__scopePopover),{forceMount:a=n.forceMount,...s}=t,i=aS(mS,t.__scopePopover);return e.jsx(so,{present:a||i.open,children:i.modal?e.jsx(gS,{...s,ref:r}):e.jsx(bS,{...s,ref:r})})});hS.displayName=mS;var fS=function(t){const r=Yw(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(Qw);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"),gS=a.forwardRef((t,r)=>{const n=aS(mS,t.__scopePopover),s=a.useRef(null),i=pi(r,s),o=a.useRef(!1);return a.useEffect(()=>{const e=s.current;if(e)return ac(e)},[]),e.jsx(Yo,{as:fS,allowPinchZoom:!0,children:e.jsx(vS,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ni(t.onCloseAutoFocus,e=>{e.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Ni(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:Ni(t.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),bS=a.forwardRef((t,r)=>{const n=aS(mS,t.__scopePopover),s=a.useRef(!1),i=a.useRef(!1);return e.jsx(vS,{...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()}})}),vS=a.forwardRef((t,r)=>{const{__scopePopover:n,trapFocus:a,onOpenAutoFocus:s,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onInteractOutside:u,...p}=t,m=aS(mS,n),h=rS(n);return co(),e.jsx(Yi,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:s,onUnmountAutoFocus:i,children:e.jsx(Hi,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:c,onPointerDownOutside:l,onFocusOutside:d,onDismiss:()=>m.onOpenChange(!1),children:e.jsx(Zw,{"data-state":xS(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)"}})})})}),yS="PopoverClose";a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=aS(yS,n);return e.jsx(Oi.button,{type:"button",...a,ref:r,onClick:Ni(t.onClick,()=>s.onOpenChange(!1))})}).displayName=yS;function xS(e){return e?"open":"closed"}a.forwardRef((t,r)=>{const{__scopePopover:n,...a}=t,s=rS(n);return e.jsx(Jw,{...s,...a,ref:r})}).displayName="PopoverArrow";var wS=pS,SS=hS;const kS=sS,CS=cS,ES=a.forwardRef(({className:t,align:r="center",sideOffset:n=4,...s},i)=>{const{container:o}=a.useContext(al);return e.jsx(wS,{container:o,children:e.jsx(SS,{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 NS({options:r,value:n,onChange:a,placeholder:s="Search...",emptyLabel:i="Choose option"}){const[o,c]=t.useState(n??""),[l,d]=t.useState(!1);t.useEffect(()=>{void 0!==n&&c(n)},[n]);const u=r.find(e=>e.value===o);return e.jsxs(kS,{open:l,onOpenChange:d,children:[e.jsx(CS,{asChild:!0,children:e.jsxs(Ei,{variant:"outline",role:"combobox","aria-expanded":l,className:"justify-between overflow-hidden text-ellipsis",children:[u?e.jsxs("div",{children:[String(u.label).trim(),u.icon&&e.jsx("span",{className:"ms-2 text-xs text-muted-foreground",children:u.icon})]}):e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx(Os,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(ES,{className:"p-0 overflow-hidden text-ellipsis",children:e.jsxs(Dy,{children:[e.jsx(Iy,{placeholder:s}),e.jsx(My,{children:e.jsx(Uy,{children:r.map(t=>e.jsxs(Ly,{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 d(!1);var e},children:[o===t.value&&e.jsx(Ls,{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))})})]})})]})}ES.displayName=SS.displayName;const AS={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"},jS={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"},_S=[{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=jS[e.code]||"USD",r=AS[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 PS({value:t,onChange:r}){const{t:n}=ln(),a=_S.map(e=>({value:e.value,label:e.text,icon:e.flag}));return e.jsx(NS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCountry"),emptyLabel:n("dropdowns.chooseCountry")})}const TS=_S.map(e=>({value:e.currencyCode,text:e.currencyCode,icon:e.currencyIcon??null})),RS=Array.from(new Set(TS.map(e=>e.value))).map(e=>TS.find(t=>t.value===e)).filter(e=>void 0!==e);function DS({value:t,onChange:r}){const{t:n}=ln(),a=RS.map(e=>({value:e.value,label:e.text,icon:e.icon??void 0}));return e.jsx(NS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchCurrency"),emptyLabel:n("dropdowns.chooseCurrency")})}let IS=[{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:"🇮🇱"}];IS=IS.filter((e,t,r)=>t===r.findIndex(t=>t.code===e.code&&t.label===e.label)),IS.sort((e,t)=>e.label<t.label?-1:e.label>t.label?1:0);const MS=IS.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 US({value:t,onChange:r}){const{t:n}=ln(),a=MS.map(e=>({value:e.value,label:e.label,icon:e.flag}));return e.jsx(NS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchLanguage"),emptyLabel:n("dropdowns.chooseLanguage")})}const LS=[{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 OS({value:t,onChange:r}){const{t:n}=ln(),a=LS.map(e=>({value:e.value,label:e.text}));return e.jsx(NS,{options:a,value:t,onChange:r,placeholder:n("dropdowns.searchTimezone"),emptyLabel:n("dropdowns.chooseTimezone")})}const zS=({workspace:r})=>{const{t:n}=ln(),{updateUserProfile:a,getProfile:s}=PC(),[i,o]=t.useState(!1),[c,l]=t.useState(),[d,u]=t.useState(0),p=Fd(),m=mp({resolver:Sf(xg({name:Kf().min(2,{message:n("profile.nameMinLength")}),country:Kf().optional(),timezone:Kf().optional(),language:Kf().optional(),currency:Kf().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),m.setValue("name",e.name),m.setValue("country",e.country),m.setValue("timezone",e.timezone),m.setValue("language",e.language),m.setValue("currency",e.currency)})},[d]),c?e.jsxs("div",{children:[p.message&&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.message})]}),e.jsx("div",{className:"space-y-4",children:e.jsx(Vg,{...m,children:e.jsxs("form",{onSubmit:m.handleSubmit(async function(e){o(!0),p.clear();try{await a({name:e.name,country:e.country,timezone:e.timezone,language:e.language,currency:e.currency}),p.show(n("profile.success"))}catch(e){Te(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(Qg,{disabled:!0,className:"w-full border rounded px-3 py-2 bg-gray-100",value:c?.email})]}),e.jsx(Hg,{disabled:i,control:m.control,name:"name",render:({field:t})=>e.jsxs(qg,{children:[e.jsx(Zg,{children:n("profile.name")}),e.jsx(Jg,{children:e.jsx(Qg,{...t})}),e.jsx(Xg,{})]})}),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(US,{value:m.watch("language"),onChange:e=>{m.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(PS,{value:m.watch("country"),onChange:e=>{m.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(DS,{value:m.watch("currency"),onChange:e=>{m.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(OS,{value:m.watch("timezone"),onChange:e=>{m.setValue("timezone",e)}})]})]}),e.jsxs("div",{className:"flex justify-end gap-x-2",children:[e.jsx(Ei,{type:"submit",progress:i,disabled:i,children:n("profile.save")}),e.jsx(Ei,{type:"button",variant:"outline",onClick:()=>{u(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(Il,{})};function FS(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},allowOverage:!1!==e.allowOverage}:null}function BS(e,t,r={}){if(null==e)return null;const{overageInCents:n=!0,currency:a,locale:s="en"}=r,{included:i,overage:o}=e;if(!(!1!==e.allowOverage))return{included:i,hasOverage:!1,allowOverage:!1,price:"",unit:""};if(null==o)return{included:i,hasOverage:!1,allowOverage:!0,price:"",unit:""};const c=n?o/100:o,l=(a??"").trim().toUpperCase();let d;if(l&&"number"==typeof c&&Number.isFinite(c))try{d=new Intl.NumberFormat(s,{style:"currency",currency:l,minimumFractionDigits:2}).format(c)}catch{d=`${r.currencySymbol??Pl(a??"")}${c.toFixed(2)}`}else{d=`${r.currencySymbol??Pl(a??"")}${"number"==typeof c?c.toFixed(2):String(o)}`}return{included:i,hasOverage:!0,allowOverage:!0,price:d,unit:t&&"unitSize"in e&&null!=e.unitSize&&e.unitSize>0?`${e.unitSize.toLocaleString(s)} ${t}`:t||""}}const WS="personal",VS=(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)},GS=e=>{switch(e){case Ga:return"bg-green-100 text-green-800";case Va:return"bg-yellow-100 text-yellow-800";case Wa:return"bg-gray-100 text-gray-800";case Ha:return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}},HS=({workspaceId:t,hasActiveSubscription:r=!1,onViewPricingPlans:n,limit:a=20})=>{const{t:s,formattingLocale:i}=ln(),{can:o}=Nl(),c=o(wl.WORKSPACE_BILLING_VIEW),{invoices:l,loading:d,error:u,refetch:p}=Un(t,a);if(!c)return e.jsx(Rl,{});const m=l.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(Ei,{variant:"ghost",size:"sm",progress:d,onClick:p,disabled:d,children:s("settings.common.refreshAction",{loading:String(d)})})]}),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:s("invoices.errorLoading")}),e.jsx("p",{className:"text-sm mt-1",children:u})]}),e.jsx(Ei,{variant:"outline",size:"sm",onClick:p,disabled:d,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:s("settings.common.retryAction",{loading:String(d)})})]}),d&&!m?e.jsx("div",{className:"border rounded-lg p-6",children:e.jsx(Il,{})}):m?e.jsx("div",{className:"space-y-2",children:l.map(t=>{const r=(e=>{switch(e.status){case Wa:case Va:return{textKey:"invoices.pay",color:"bg-blue-600 hover:bg-blue-700"};case Ga:return{textKey:"invoices.view",color:"bg-green-600 hover:bg-green-700"};case Ha:case $a: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 ${GS(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:VS(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:Ll(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:VS(t.amount_paid,t.currency,i)})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(Ei,{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(Vs,{className:"h-3 w-3 ms-1.5"})]}),t.invoice_pdf&&e.jsxs(Ei,{size:"sm",variant:"outline",onClick:()=>window.open(t.invoice_pdf,"_blank","noopener,noreferrer"),children:[e.jsx(Ws,{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(Gs,{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(Ei,{size:"sm",className:"mt-4",onClick:n,children:s("subscription.viewPricingPlans")})]})]})},$S=t.lazy(()=>Promise.resolve().then(function(){return hN}).then(e=>({default:e.default}))),KS=(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""}},qS=({workspace:r})=>{const n=r._id?.toString(),{t:a,formattingLocale:s,fmtNum:i,fmtCents:o}=ln(),{api:c}=jn(),{can:l}=Nl(),{settings:d}=An(),u=l(wl.WORKSPACE_BILLING_VIEW),p=l(wl.WORKSPACE_BILLING_MANAGE),m=d?.workspace?.mode===WS,{subscription:h,loading:f,error:g,updateSubscription:b,refetch:v}=Mn(n),{createCheckoutSession:y}=Dn(n),{cancelSubscription:x,loading:w}=On(n),{resumeSubscription:S,loading:k}=zn(n),{openBillingPortal:C,loading:E}=Ln(n),{versions:N,loading:A,error:j,refetch:_}=Rn(n),P=f||A,T=g||j,{currentVersion:R,latestVersion:D,isDeprecated:I,plansToShow:M}=t.useMemo(()=>{const e=N?.currentVersion,t=N?.availableVersions||[],r=null!=h?.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:[]}},[N,h?.subscription]),[U,L]=t.useState(!1),[O,z]=t.useState(null),[F,B]=t.useState(null),W=t.useRef(null),[V,G]=t.useState(!1),[H,$]=t.useState(!1),K=t.useRef(void 0),q=t.useRef(!1);t.useEffect(()=>{if(q.current)return;if(f||!M||0===M.length)return;const e=_C.getState(),t=e.params?.action===Ca;h?.subscription&&!t||(q.current=!0,t&&(K.current=e.params,_C.clearParams()),G(!0))},[f,h?.subscription,M]),t.useEffect(()=>()=>{W.current&&clearTimeout(W.current)},[]);const[Z,J]=t.useState(!1),[Y,X]=t.useState("subscription"),Q=async()=>{await Promise.all([v(),_()])},ee=t.useMemo(()=>ds(h?.subscription?.stripePriceId,M??[]),[h?.subscription?.stripePriceId,M]),te=async()=>{if(n){$(!1),L(!0),z(null),B(null);try{await x(),B(a("subscription.cancelSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorCanceling");z(t)}finally{L(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}};if(P&&!h&&!N)return e.jsx(Il,{});if(!u)return null;const re=h?.planVersion?._id||null;return n?e.jsxs("div",{className:"space-y-6",children:[T&&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:T}),e.jsx("p",{className:"text-xs mt-2 text-red-600",children:a("subscription.errorLoadingDescription")})]}),e.jsx(Ei,{variant:"outline",size:"sm",onClick:Q,disabled:P,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.retryAction",{loading:String(P)})})]}),O&&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:O})]}),e.jsx(Ei,{variant:"outline",size:"sm",onClick:()=>z(null),className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:a("settings.common.dismiss")})]}),F&&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:F})]}),e.jsx(Ei,{variant:"outline",size:"sm",onClick:()=>B(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:()=>X("subscription"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("subscription"===Y?"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:()=>X("invoices"),className:"border-b-2 py-3 text-sm font-medium transition-colors "+("invoices"===Y?"border-primary text-primary":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),children:a("subscription.invoicesTab")})]})}),"subscription"===Y&&e.jsxs(e.Fragment,{children:[P&&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($s,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),I&&h?.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(oi,{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",R?.version||"?"," → v",D?.version||"?"]})]})]}),e.jsx(Ei,{size:"sm",variant:"outline",className:"shrink-0 border-amber-300 text-amber-700 hover:bg-amber-100",onClick:()=>G(!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=h?.subscription?.subscriptionStatus===za,r=h?.subscription?.cancelAtPeriodEnd;return r||w?null:t&&M&&M.length>0?e.jsx(Ei,{size:"sm",onClick:()=>G(!0),children:a("subscription.viewPricingPlans")}):h?.subscription&&!t&&p?e.jsx(Ei,{variant:"outline",size:"sm",onClick:()=>G(!0),children:a("subscription.changePlanButton")}):!h?.subscription&&M&&M.length>0?e.jsx(Ei,{size:"sm",onClick:()=>G(!0),children:a("subscription.viewPricingPlans")}):null})(),e.jsx(Ei,{variant:"ghost",size:"sm",progress:P,onClick:Q,disabled:P||U,children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),h?.subscription?(()=>{const t=ds(h.subscription.stripePriceId,M??[]),n=t?.interval??null,c=t?.currency??h.plan?.currency??r?.billingCurrency??"",l=n&&h.planVersion?os(h.planVersion,c,n):null,d=c,u=h.planVersion?us(h.planVersion,c):null,f=u&&n?ps(h.planVersion,c,n):null,g=Array.isArray(r?.users)?r.users.length:1,b=u?.includedSeats??0,v=Math.max(0,g-b),y=!!h.plan?.isFreemium,x=null!=l?0===l?a("subscription.free"):o(l,d):y?a("subscription.free"):null,S=n===Ua.Monthly?a("subscription.billingInterval.perMonth"):n===Ua.Quarterly?a("subscription.billingInterval.perQuarter"):n===Ua.Yearly?a("subscription.billingInterval.perYear"):"";return e.jsxs("div",{className:"border rounded-lg overflow-hidden "+(I?"border-amber-300":"border-gray-200"),children:[h.subscription.subscriptionStatus===Oa&&!h.subscription.cancelAtPeriodEnd&&(()=>{const t=h.subscription.trialEnd||h.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(Ei,{size:"sm",variant:i?"default":"outline",className:"shrink-0 "+(i?"":"border-blue-300 text-blue-700 hover:bg-blue-100"),onClick:()=>G(!0),children:a("subscription.upgradePlan")})]})})(),e.jsxs("div",{className:"p-4 sm:p-5 "+(I?"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:h.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 "+(h.subscription.subscriptionStatus===La?h.subscription.cancelAtPeriodEnd?"bg-amber-100 text-amber-800":"bg-green-100 text-green-800":h.subscription.subscriptionStatus===Oa?"bg-blue-100 text-blue-800":h.subscription.subscriptionStatus===za?"bg-gray-100 text-gray-800":"bg-red-100 text-red-800"),children:[h.subscription.subscriptionStatus===La&&(h.subscription.cancelAtPeriodEnd?a("subscription.status.canceling"):a("subscription.status.active")),h.subscription.subscriptionStatus===Oa&&a("subscription.status.trial"),h.subscription.subscriptionStatus===za&&a("subscription.status.canceled"),h.subscription.subscriptionStatus===Fa&&a("subscription.status.pastDue")]}),h.subscription.subscriptionStatus===Oa&&KS(s,h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("span",{className:"text-xs text-gray-500",children:["(ends"," ",KS(s,h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd),")"]}),I&&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(oi,{className:"h-3 w-3"}),a("subscription.status.deprecated")]})]}),h.plan?.description&&e.jsx("p",{className:"text-sm text-gray-600 mb-3",children:h.plan.description}),!y&&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:x||a("invoices.na")}),x&&x!==a("subscription.free")&&S&&e.jsx("span",{className:"text-sm text-gray-500",children:S})]}),u&&f&&f>0&&!m&&e.jsx("div",{className:"text-xs text-gray-500 mt-1",children:a("subscription.perSeatDisplay",{price:o(f,d),interval:S})}),!m&&u&&f&&f>0&&v>0&&x&&x!==a("subscription.free")&&null!=l&&e.jsx("div",{className:"text-xs text-gray-500 mt-1 pt-1 border-t border-gray-200",children:a("subscription.estTotalDisplay",{total:o(l+f*v,d),interval:S,count:v})})]}),(h.subscription.subscriptionStatus===La||h.subscription.subscriptionStatus===Oa)&&!h.subscription.cancelAtPeriodEnd&&KS(s,h.subscription.stripeCurrentPeriodEnd)&&e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[e.jsx(Ms,{className:"h-3.5 w-3.5 flex-shrink-0"}),e.jsx("span",{children:a("subscription.nextBillingDisplay",{date:KS(s,h.subscription.stripeCurrentPeriodEnd)??""})})]})]}),I&&e.jsxs("p",{className:"text-xs text-amber-600 mt-2",children:["Version ",R?.version||a("invoices.na")]}),!y&&(h.subscription.subscriptionStatus===La||h.subscription.subscriptionStatus===Oa||h.subscription.subscriptionStatus===Fa)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mt-4 pt-4 border-t border-gray-200",children:[h.subscription&&p&&h.subscription?.subscriptionId&&e.jsx(Ei,{variant:"outline",size:"sm",onClick:()=>C(),disabled:E,progress:E,children:a(E?"subscription.openingPortal":"subscription.managePayment")}),p&&h.subscription?.subscriptionId&&(h.subscription.subscriptionStatus===La||h.subscription.subscriptionStatus===Oa)&&e.jsx(e.Fragment,{children:h.subscription.cancelAtPeriodEnd?e.jsx(Ei,{variant:"outline",size:"sm",onClick:()=>J(!0),disabled:U||w||k,progress:k,children:h.subscription.subscriptionStatus===Oa?a("subscription.resumeTrial"):a("subscription.resumeTitle")}):e.jsx(Ei,{variant:"outline",size:"sm",className:"text-red-600 hover:text-red-700 hover:bg-red-50 border-red-200",onClick:()=>$(!0),disabled:U||w||k,progress:w||U,children:w||U?a("subscription.canceling"):h.subscription.subscriptionStatus===Oa?a("subscription.cancelTrial"):a("subscription.cancelTitle")})})]})]}),h.subscription.subscriptionStatus===Fa&&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(oi,{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(Ei,{variant:"outline",size:"sm",className:"mt-2 border-red-200 text-red-700 hover:bg-red-100",onClick:()=>X("invoices"),children:a("subscription.viewInvoices")})]})]})}),h.subscription.subscriptionStatus===Fa&&h.subscription.dunningState&&h.subscription.dunningState!==Ja&&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(oi,{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:h.subscription.dunningState===Ya?a("subscription.dunningFinal"):h.subscription.dunningState===Xa?a("subscription.dunningSuspended"):a("subscription.dunningRecovery")}),e.jsx("p",{className:"text-sm text-red-700 mt-0.5",children:h.subscription.dunningState===Xa?a("subscription.dunningSuspendedDescription"):a("subscription.dunningRecoveryDescription")})]})]})}),h.subscription.subscriptionStatus===Ba&&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(Ms,{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")})]})]})}),h.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(Ms,{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:h.subscription.subscriptionStatus===Oa?a("subscription.scheduledTrialCancellation"):a("subscription.scheduledCancellation")}),e.jsx("p",{className:"text-sm text-amber-700 mt-0.5",children:KS(s,h.subscription.subscriptionStatus===Oa&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)?e.jsxs(e.Fragment,{children:[h.subscription.subscriptionStatus===Oa?a("subscription.trialEndDescription"):a("subscription.cancelEndDescription")," ",e.jsx("span",{className:"font-medium",children:KS(s,h.subscription.subscriptionStatus===Oa&&h.subscription.trialEnd||h.subscription.stripeCurrentPeriodEnd)}),"."]}):a("subscription.cancelEndFallback")})]})]})}),h.planVersion&&(()=>{const t=((e,t,r=Ua.Monthly)=>{if(!e?.subscriptionItems)return{features:[],limits:[],quotas:[]};const n=[],a=[],s=[];return e.subscriptionItems.forEach(i=>{const o=i.slug;if(i.type===Ka){const t=e.features?.[o]??!1;n.push({item:i,enabled:t})}else if(i.type===qa){const t=e.limits?.[o]??0;a.push({item:i,value:t})}else if(i.type===Za){const n=t&&e.pricingVariants?.length?ls(e,t,o,r):FS(e.quotas?.[o],r);null!=n&&s.push({item:i,value:n})}}),{features:n,limits:a,quotas:s}})(h.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:i(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=BS(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)})})]}),u&&!m&&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(g)})]}),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(b)})]}),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")]})]}),f&&f>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(f,c),S]})]}),(u?.maxSeats??0)>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(u.maxSeats)})]})]})]}),h.planVersion?.creditGrant?.enabled&&"object"==typeof h.planVersion.creditGrant.creditPackage&&null!==h.planVersion.creditGrant.creditPackage&&e.jsxs("div",{children:[e.jsx("h4",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider mb-2",children:a("subscription.items.credits")}),e.jsxs("div",{className:"bg-purple-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:h.planVersion.creditGrant.renewOnPeriod?a("subscription.items.creditsPerMonth"):a("subscription.items.creditsOneTime")}),e.jsx("span",{className:"font-semibold text-purple-700",children:i("object"==typeof h.planVersion.creditGrant.creditPackage?h.planVersion.creditGrant.creditPackage.creditAmount:0)})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-gray-600",children:a("subscription.items.creditRenewal")}),e.jsx("span",{className:"font-medium text-gray-900",children:h.planVersion.creditGrant.renewOnPeriod?"reset"===h.planVersion.creditGrant.mode?a("subscription.items.creditModeReset"):a("subscription.items.creditModeTopup"):a("subscription.items.creditModeLifetime")})]})]})]})]})}):null})()]})})():e.jsxs("div",{className:"border rounded-lg p-6 text-center",children:[e.jsxs("div",{className:"mb-4",children:[e.jsx(Bs,{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")})]}),M&&M.length>0&&e.jsx(Ei,{size:"sm",onClick:()=>G(!0),children:a("subscription.viewPricingPlans")})]})]}),!N&&!P&&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")}),T&&e.jsxs("p",{className:"text-sm mt-2 text-red-600",children:["Error: ",T]}),!T&&e.jsx("p",{className:"text-sm mt-2",children:a("subscription.noPlansAvailable")})]}),e.jsx(Ei,{variant:"outline",size:"sm",progress:P,onClick:Q,disabled:P,className:"mt-4",children:a("settings.common.refreshAction",{loading:String(P)})})]})]}),"invoices"===Y&&e.jsxs(e.Fragment,{children:[P&&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($s,{className:"h-4 w-4 animate-spin flex-shrink-0"}),e.jsx("span",{children:a("settings.common.loading")})]}),e.jsx(HS,{workspaceId:n,hasActiveSubscription:null!==h?.subscription,onViewPricingPlans:()=>X("subscription"),limit:20})]}),M&&M.length>0&&e.jsx(t.Suspense,{fallback:V?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($s,{className:"h-5 w-5 animate-spin"}),e.jsx("span",{children:a("settings.common.loading")})]})}):null,children:e.jsx($S,{open:V,onOpenChange:G,planVersions:M,currentPlanVersionId:re||null,currentStripePriceId:h?.subscription?.stripePriceId,billingCurrency:r.billingCurrency,trialUsedAt:r.trialUsedAt,workspaceName:r.name,initialInterval:K.current?.interval,initialCurrency:K.current?.currency,currentMemberCount:Array.isArray(r?.users)?r.users.length:void 0,onSelectPlan:async(e,t=Ua.Monthly,s)=>{if(!n)return;const i=M?.find(t=>t._id===e),o=s??ee?.currency??h?.plan?.currency??r?.billingCurrency??"",l=i?function(e,t,r){const n=is(e,t);if(!n?.stripePrices)return null;const a=r===Ua.Monthly?"monthlyPriceId":r===Ua.Yearly?"yearlyPriceId":"quarterlyPriceId",s=r===Ua.Monthly?"monthly":r===Ua.Yearly?"yearly":void 0;return n.stripePrices[a]??(s?n.stripePrices[s]:void 0)??null}(i,o,t):null,d=h?.subscription?.stripePriceId;if(!l||!d||l!==d){L(!0),z(null),B(null);try{const{successUrl:r,cancelUrl:s}=function(e){const t="undefined"!=typeof window?window.location.href:void 0;return{successUrl:Ra({action:Sa,status:Aa,ws:e,screen:Pa},t),cancelUrl:Ra({action:Sa,status:ja,ws:e,screen:Pa},t)}}(n);let l;if(i?.plan?.isFreemium){return h?.subscription?.subscriptionId?(G(!1),void $(!0)):(await c.selectFreePlan(n,e),G(!1),Lt(),await Q(),void B(a("subscription.updateSuccess")))}const d=h?.subscription?.subscriptionStatus===za;if(l=h?.subscription&&!d?await b(e,{billingInterval:t,successUrl:r,cancelUrl:s}):await y({planVersionId:e,billingInterval:t,currency:o||void 0,successUrl:r,cancelUrl:s}),l&&"checkoutUrl"in l&&l.checkoutUrl)return void fa(l.checkoutUrl);B(a("subscription.updateSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorProcessing");z(t)}finally{L(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}},loading:U||P})}),e.jsx(hd,{open:Z,onOpenChange:J,children:e.jsxs(vd,{children:[e.jsxs(yd,{children:[e.jsx(wd,{children:a("subscription.resumeTitle")}),e.jsx(Sd,{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(oi,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[a("subscription.resumeChargeDate")," ",h?.subscription?.stripeCurrentPeriodEnd&&KS(s,h.subscription.stripeCurrentPeriodEnd)?e.jsx("span",{className:"font-medium",children:KS(s,h.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(xd,{children:[e.jsx(Cd,{disabled:k,children:a("subscription.resumeKeep")}),e.jsx(kd,{onClick:async()=>{if(n){J(!1),L(!0),z(null),B(null);try{await S(),B(a("subscription.resumeSuccess")),await Q()}catch(e){const t=e instanceof Error?e.message:a("subscription.errorResuming");z(t)}finally{L(!1),W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{z(null),B(null)},5e3)}}},disabled:k,children:a(k?"subscription.resuming":"subscription.resumeButton")})]})]})}),(()=>{const t=h?.subscription?.subscriptionStatus===Oa,r=t&&h?.subscription?.trialEnd||h?.subscription?.stripeCurrentPeriodEnd;return e.jsx(hd,{open:H,onOpenChange:$,children:e.jsxs(vd,{children:[e.jsxs(yd,{children:[e.jsx(wd,{children:a(t?"subscription.cancelTrialTitle":"subscription.cancelTitle")}),e.jsx(Sd,{asChild:!0,children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{children:a(t?"subscription.cancelTrialConfirm":"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(t?"subscription.cancelTrialAccess":"subscription.retainAccess")," ",r&&KS(s,r)?e.jsx("span",{className:"font-medium",children:KS(s,r)}):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(t?"subscription.cancelTrialNoCharge":"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(t?"subscription.cancelTrialResume":"subscription.cancelResumeAnytime")})]})]})]})})]}),e.jsxs(xd,{children:[e.jsx(Cd,{disabled:w,children:a(t?"subscription.cancelTrialKeep":"subscription.cancelKeep")}),e.jsx(kd,{onClick:te,disabled:w,className:"bg-red-600 hover:bg-red-700 focus:ring-red-600",children:a(w?"subscription.canceling":t?"subscription.cancelTrialButton":"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 ZS(e){return e.replace(/[_-]/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function JS(e,t,r){return t+e.toLocaleString(r,{minimumFractionDigits:2,maximumFractionDigits:2})}function YS(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 XS=()=>{const{quotas:r,loading:n,error:a,refetch:s}=ca(),{t:i,formattingLocale:o,fmtNum:c}=ln(),{can:l}=Nl(),d=(e,t)=>JS(e,t,o),{response:u}=Vn(),[p,m]=t.useState(!1),h=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=Pl(s);if(!r)return e;for(const n of Object.keys(r)){const o=cs(t,s,n,a);if(null==o||o<=0)continue;const c=t.quotas?.[n],l=c?.[a],d=l?.unitSize??1,u=r[n].overage,p=(d>1?Math.ceil(u/d):u)*o/100;e[n]={overageCents:o,unitSize:d,currency:s,currencySymbol:i,estimatedCost:p}}return e},[u,r]),f=t.useMemo(()=>{const e=u?.subscription?.usageCurrentPeriodEnd||u?.subscription?.stripeCurrentPeriodEnd;if(!e)return null;const t=Ml(e,o);return t?{endDate:t,daysRemaining:YS(e)}:null},[u,o]),g=async()=>{m(!0);try{await s()}finally{m(!1)}};if(n&&!r)return e.jsx(Il,{});if(!l(wl.WORKSPACE_USAGE_VIEW))return null;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(Ei,{variant:"outline",size:"sm",onClick:g,disabled:p,className:"flex-shrink-0 border-red-200 text-red-700 hover:bg-red-100",children:i("settings.common.retryAction",{loading:String(p)})})]});const b=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===b.length)return e.jsxs("div",{className:"border rounded-lg p-8 text-center",children:[e.jsx(Us,{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 v=b.filter(([,e])=>e.hasOverage).length,y=b.length>0?Math.round(b.reduce((e,[,t])=>e+(t.included>0?t.consumed/t.included*100:0),0)/b.length):0,x=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:i("usage.description")}),e.jsxs(Ei,{variant:"ghost",size:"sm",onClick:g,disabled:p,children:[e.jsx(Js,{className:Se("h-3.5 w-3.5 me-1.5",p&&"animate-spin")}),i("settings.common.refreshAction",{loading:String(p)})]})]}),f&&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(Ms,{className:"h-4 w-4 text-gray-400 flex-shrink-0"}),e.jsxs("span",{children:[i("usage.resetDateDisplay",{date:f.endDate}),null!==f.daysRemaining&&f.daysRemaining>0&&e.jsxs("span",{className:"text-gray-500",children:[" ","(",i("usage.daysRemainingDisplay",{count:f.daysRemaining}),")"]}),null!==f.daysRemaining&&f.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(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:i("usage.overallUsage")}),e.jsx("p",{className:"text-lg sm:text-xl font-semibold text-gray-900 mt-1",children:c(y)+"%"})]}),e.jsxs("div",{className:Se("border rounded-lg p-3 sm:p-4",v>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",v>0?"text-red-600":"text-gray-900"),children:c(v)})]}),v>0&&x>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:d(x,w)})]})]}),v>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(oi,{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:v})}),x>0&&e.jsx("p",{className:"text-sm text-amber-700 font-medium mt-1",children:i("usage.estOverageCharges",{amount:d(x,w)})})]})]})}),e.jsx("div",{className:"space-y-3",children:b.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=h[t];return e.jsx(QS,{slug:t,quota:r,percent:n,colors:i,pricing:o},t)})})]})};function QS({slug:t,quota:r,percent:n,colors:a,pricing:s}){const{t:i,formattingLocale:o}=ln(),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)=>JS(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:ZS(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:c(Math.ceil(r.overage/s.unitSize))})]}),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 ek(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?ui(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 tk=Symbol("radix.slottable");function rk(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===tk}var nk=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(Oi.span,{...t,ref:r,style:{...nk,...t.style}})).displayName="VisuallyHidden";var ak=[" ","Enter","ArrowUp","ArrowDown"],sk=[" ","Enter"],ik="Select",[ok,ck,lk]=ab(ik),[dk]=Ai(ik,[lk,Tw]),uk=Tw(),[pk,mk]=dk(ik),[hk,fk]=dk(ik),gk=t=>{const{__scopeSelect:r,children:n,open:s,defaultOpen:i,onOpenChange:o,value:c,defaultValue:l,onValueChange:d,dir:u,name:p,autoComplete:m,disabled:h,required:f,form:g}=t,b=uk(r),[v,y]=a.useState(null),[x,w]=a.useState(null),[S,k]=a.useState(!1),C=ib(u),[E,N]=Ii({prop:s,defaultProp:i??!1,onChange:o,caller:ik}),[A,j]=Ii({prop:c,defaultProp:l,onChange:d,caller:ik}),_=a.useRef(null),P=!v||(g||!!v.closest("form")),[T,R]=a.useState(new Set),D=Array.from(T).map(e=>e.props.value).join(";");return e.jsx(Kw,{...b,children:e.jsxs(pk,{required:f,scope:r,trigger:v,onTriggerChange:y,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:k,contentId:Ri(),value:A,onValueChange:j,open:E,onOpenChange:N,dir:C,triggerPointerDownPosRef:_,disabled:h,children:[e.jsx(ok.Provider,{scope:r,children:e.jsx(hk,{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})}),P?e.jsxs(eC,{"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(T)]},D):null]})})};gk.displayName=ik;var bk="SelectTrigger",vk=a.forwardRef((t,r)=>{const{__scopeSelect:n,disabled:s=!1,...i}=t,o=uk(n),c=mk(bk,n),l=c.disabled||s,d=pi(r,c.onTriggerChange),u=ck(n),p=a.useRef("touch"),[m,h,f]=rC(e=>{const t=u().filter(e=>!e.disabled),r=t.find(e=>e.value===c.value),n=nC(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(qw,{asChild:!0,...o,children:e.jsx(Oi.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":tC(c.value)?"":void 0,...i,ref:d,onClick:Ni(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)}),onPointerDown:Ni(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:Ni(i.onKeyDown,e=>{const t=""!==m.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||ak.includes(e.key)&&(g(),e.preventDefault())})})})});vk.displayName=bk;var yk="SelectValue",xk=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:a,style:s,children:i,placeholder:o="",...c}=t,l=mk(yk,n),{onValueNodeHasChildrenChange:d}=l,u=void 0!==i,p=pi(r,l.onValueNodeChange);return _i(()=>{d(u)},[d,u]),e.jsx(Oi.span,{...c,ref:p,style:{pointerEvents:"none"},children:tC(l.value)?e.jsx(e.Fragment,{children:o}):i})});xk.displayName=yk;var wk=a.forwardRef((t,r)=>{const{__scopeSelect:n,children:a,...s}=t;return e.jsx(Oi.span,{"aria-hidden":!0,...s,ref:r,children:a||"▼"})});wk.displayName="SelectIcon";var Sk=t=>e.jsx(ao,{asChild:!0,...t});Sk.displayName="SelectPortal";var kk="SelectContent",Ck=a.forwardRef((t,r)=>{const n=mk(kk,t.__scopeSelect),[i,o]=a.useState();if(_i(()=>{o(new DocumentFragment)},[]),!n.open){const r=i;return r?s.createPortal(e.jsx(Nk,{scope:t.__scopeSelect,children:e.jsx(ok.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),r):null}return e.jsx(_k,{...t,ref:r})});Ck.displayName=kk;var Ek=10,[Nk,Ak]=dk(kk),jk=function(t){const r=ek(t),n=a.forwardRef((t,n)=>{const{children:s,...i}=t,o=a.Children.toArray(s),c=o.find(rk);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"),_k=a.forwardRef((t,r)=>{const{__scopeSelect:n,position:s="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:c,side:l,sideOffset:d,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v,...y}=t,x=mk(kk,n),[w,S]=a.useState(null),[k,C]=a.useState(null),E=pi(r,e=>S(e)),[N,A]=a.useState(null),[j,_]=a.useState(null),P=ck(n),[T,R]=a.useState(!1),D=a.useRef(!1);a.useEffect(()=>{if(w)return ac(w)},[w]),co();const I=a.useCallback(e=>{const[t,...r]=P().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}},[P,k]),M=a.useCallback(()=>I([N,w]),[I,N,w]);a.useEffect(()=>{T&&M()},[T,M]);const{onOpenChange:U,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)||U(!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,U,L]),a.useEffect(()=>{const e=()=>U(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[U]);const[O,z]=rC(e=>{const t=P().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=nC(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)&&_(e)},[x.value]),V="popper"===s?Tk:Pk,G=V===Tk?{side:l,sideOffset:d,align:u,alignOffset:p,arrowPadding:m,collisionBoundary:h,collisionPadding:f,sticky:g,hideWhenDetached:b,avoidCollisions:v}:{};return e.jsx(Nk,{scope:n,content:w,viewport:k,onViewportChange:C,itemRefCallback:F,selectedItem:N,onItemLeave:B,itemTextRefCallback:W,focusSelectedItem:M,selectedItemText:j,position:s,isPositioned:T,searchRef:O,children:e.jsx(Yo,{as:jk,allowPinchZoom:!0,children:e.jsx(Yi,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Ni(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:e.jsx(Hi,{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,...G,onPlaced:()=>R(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:Ni(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=P().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()}})})})})})})});_k.displayName="SelectContentImpl";var Pk=a.forwardRef((t,r)=>{const{__scopeSelect:n,onPlaced:s,...i}=t,o=mk(kk,n),c=Ak(kk,n),[l,d]=a.useState(null),[u,p]=a.useState(null),m=pi(r,e=>p(e)),h=ck(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&&u&&b&&v&&y){const e=o.trigger.getBoundingClientRect(),t=u.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),d=window.innerWidth-Ek,u=Yb(s,[Ek,Math.max(Ek,d-c)]);l.style.minWidth=o+"px",l.style.left=u+"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),d=window.innerWidth-Ek,u=Yb(s,[Ek,Math.max(Ek,d-c)]);l.style.minWidth=o+"px",l.style.right=u+"px"}const a=h(),i=window.innerHeight-2*Ek,c=b.scrollHeight,d=window.getComputedStyle(u),p=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),x=p+m+c+parseInt(d.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,x),S=window.getComputedStyle(b),k=parseInt(S.paddingTop,10),C=parseInt(S.paddingBottom,10),E=e.top+e.height/2-Ek,N=i-E,A=v.offsetHeight/2,j=p+m+(v.offsetTop+A),_=x-j;if(j<=E){const e=a.length>0&&v===a[a.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-b.offsetTop-b.offsetHeight,r=j+Math.max(N,A+(e?C: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(E,p+b.offsetTop+(e?k:0)+A)+_;l.style.height=t+"px",b.scrollTop=j-E+b.offsetTop}l.style.margin=`${Ek}px 0`,l.style.minHeight=w+"px",l.style.maxHeight=i+"px",s?.(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,l,u,b,v,y,o.dir,s]);_i(()=>w(),[w]);const[S,k]=a.useState();_i(()=>{u&&k(window.getComputedStyle(u).zIndex)},[u]);const C=a.useCallback(e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)},[w,x]);return e.jsx(Rk,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:f,onScrollButtonChange:C,children:e.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:e.jsx(Oi.div,{...i,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Pk.displayName="SelectItemAlignedPosition";var Tk=a.forwardRef((t,r)=>{const{__scopeSelect:n,align:a="start",collisionPadding:s=Ek,...i}=t,o=uk(n);return e.jsx(Zw,{...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)"}})});Tk.displayName="SelectPopperPosition";var[Rk,Dk]=dk(kk,{}),Ik="SelectViewport",Mk=a.forwardRef((t,r)=>{const{__scopeSelect:n,nonce:s,...i}=t,o=Ak(Ik,n),c=Dk(Ik,n),l=pi(r,o.onViewportChange),d=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(ok.Slot,{scope:n,children:e.jsx(Oi.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ni(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=c;if(n?.current&&r){const e=Math.abs(d.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*Ek,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")}}}d.current=t.scrollTop})})})]})});Mk.displayName=Ik;var Uk="SelectGroup",[Lk,Ok]=dk(Uk);a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=Ri();return e.jsx(Lk,{scope:n,id:s,children:e.jsx(Oi.div,{role:"group","aria-labelledby":s,...a,ref:r})})}).displayName=Uk;var zk="SelectLabel",Fk=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=Ok(zk,n);return e.jsx(Oi.div,{id:s.id,...a,ref:r})});Fk.displayName=zk;var Bk="SelectItem",[Wk,Vk]=dk(Bk),Gk=a.forwardRef((t,r)=>{const{__scopeSelect:n,value:s,disabled:i=!1,textValue:o,...c}=t,l=mk(Bk,n),d=Ak(Bk,n),u=l.value===s,[p,m]=a.useState(o??""),[h,f]=a.useState(!1),g=pi(r,e=>d.itemRefCallback?.(e,s,i)),b=Ri(),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(Wk,{scope:n,value:s,disabled:i,textId:b,isSelected:u,onItemTextChange:a.useCallback(e=>{m(t=>t||(e?.textContent??"").trim())},[]),children:e.jsx(ok.ItemSlot,{scope:n,value:s,disabled:i,textValue:p,children:e.jsx(Oi.div,{role:"option","aria-labelledby":b,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...c,ref:g,onFocus:Ni(c.onFocus,()=>f(!0)),onBlur:Ni(c.onBlur,()=>f(!1)),onClick:Ni(c.onClick,()=>{"mouse"!==v.current&&y()}),onPointerUp:Ni(c.onPointerUp,()=>{"mouse"===v.current&&y()}),onPointerDown:Ni(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Ni(c.onPointerMove,e=>{v.current=e.pointerType,i?d.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ni(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Ni(c.onKeyDown,e=>{""!==d.searchRef?.current&&" "===e.key||(sk.includes(e.key)&&y()," "===e.key&&e.preventDefault())})})})})});Gk.displayName=Bk;var Hk="SelectItemText",$k=a.forwardRef((t,r)=>{const{__scopeSelect:n,className:i,style:o,...c}=t,l=mk(Hk,n),d=Ak(Hk,n),u=Vk(Hk,n),p=fk(Hk,n),[m,h]=a.useState(null),f=pi(r,e=>h(e),u.onItemTextChange,e=>d.itemTextRefCallback?.(e,u.value,u.disabled)),g=m?.textContent,b=a.useMemo(()=>e.jsx("option",{value:u.value,disabled:u.disabled,children:g},u.value),[u.disabled,u.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=p;return _i(()=>(v(b),()=>y(b)),[v,y,b]),e.jsxs(e.Fragment,{children:[e.jsx(Oi.span,{id:u.textId,...c,ref:f}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?s.createPortal(c.children,l.valueNode):null]})});$k.displayName=Hk;var Kk="SelectItemIndicator",qk=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return Vk(Kk,n).isSelected?e.jsx(Oi.span,{"aria-hidden":!0,...a,ref:r}):null});qk.displayName=Kk;var Zk="SelectScrollUpButton";a.forwardRef((t,r)=>{const n=Ak(Zk,t.__scopeSelect),s=Dk(Zk,t.__scopeSelect),[i,o]=a.useState(!1),c=pi(r,s.onScrollButtonChange);return _i(()=>{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(Yk,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}).displayName=Zk;var Jk="SelectScrollDownButton";a.forwardRef((t,r)=>{const n=Ak(Jk,t.__scopeSelect),s=Dk(Jk,t.__scopeSelect),[i,o]=a.useState(!1),c=pi(r,s.onScrollButtonChange);return _i(()=>{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(Yk,{...t,ref:c,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}).displayName=Jk;var Yk=a.forwardRef((t,r)=>{const{__scopeSelect:n,onAutoScroll:s,...i}=t,o=Ak("SelectScrollButton",n),c=a.useRef(null),l=ck(n),d=a.useCallback(()=>{null!==c.current&&(window.clearInterval(c.current),c.current=null)},[]);return a.useEffect(()=>()=>d(),[d]),_i(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),e.jsx(Oi.div,{"aria-hidden":!0,...i,ref:r,style:{flexShrink:0,...i.style},onPointerDown:Ni(i.onPointerDown,()=>{null===c.current&&(c.current=window.setInterval(s,50))}),onPointerMove:Ni(i.onPointerMove,()=>{o.onItemLeave?.(),null===c.current&&(c.current=window.setInterval(s,50))}),onPointerLeave:Ni(i.onPointerLeave,()=>{d()})})}),Xk=a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t;return e.jsx(Oi.div,{"aria-hidden":!0,...a,ref:r})});Xk.displayName="SelectSeparator";var Qk="SelectArrow";a.forwardRef((t,r)=>{const{__scopeSelect:n,...a}=t,s=uk(n),i=mk(Qk,n),o=Ak(Qk,n);return i.open&&"popper"===o.position?e.jsx(Jw,{...s,...a,ref:r}):null}).displayName=Qk;var eC=a.forwardRef(({__scopeSelect:t,value:r,...n},s)=>{const i=a.useRef(null),o=pi(s,i),c=Nd(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(Oi.select,{...n,style:{...nk,...n.style},ref:o,defaultValue:r})});function tC(e){return""===e||void 0===e}function rC(e){const t=zi(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 nC(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}eC.displayName="SelectBubbleInput";var aC=vk,sC=wk,iC=Sk,oC=Ck,cC=Mk,lC=Fk,dC=Gk,uC=$k,pC=qk,mC=Xk;const hC=gk,fC=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(aC,{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(sC,{asChild:!0,children:e.jsx(Yc,{className:"h-4 w-4 opacity-50"})})]}));fC.displayName=aC.displayName;const gC=a.forwardRef(({className:t,children:r,position:n="popper",...s},i)=>{const{container:o}=a.useContext(al);return e.jsx(iC,{container:o,children:e.jsx(oC,{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(cC,{className:Se("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r})})})});gC.displayName=oC.displayName;a.forwardRef(({className:t,...r},n)=>e.jsx(lC,{ref:n,className:Se("px-2 py-1.5 text-sm font-semibold",t),...r})).displayName=lC.displayName;const bC=a.forwardRef(({className:t,children:r,...n},a)=>e.jsxs(dC,{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(pC,{children:e.jsx(Qc,{className:"h-4 w-4"})})}),e.jsx(uC,{children:r})]}));bC.displayName=dC.displayName;function vC(e,r){const{response:n}=Vn();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=ms({planVersion:a,currency:i,settingsMaxUsers:r?.settingsMaxUsers}),{maxUsers:c,hasSeatPricing:l,includedSeats:d}=o,u=l?Math.max(0,t-d):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?ps(a,i,s?.billingInterval??"monthly"):null,g=hs({memberCount:t,maxUsersConfig:o});return{hasSeatPricing:l,memberCount:t,includedSeats:d,maxUsers:c,maxSeats:c,limitSource:o.source,billableSeats:u,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(mC,{ref:n,className:Se("-mx-1 my-1 h-px bg-muted",t),...r})).displayName=mC.displayName;const yC=({workspace:r})=>{const{user:n}=IC(),{t:a,fmtNum:s,fmtCents:i}=ln(),[o,c]=t.useState(0),[l,d]=t.useState(!1),[u,p]=t.useState([]),[m,h]=t.useState(null),{getUsers:f,removeUser:g,updateUser:b}=PC(),{settings:v}=An(),{can:y}=Nl(),{response:x}=Vn(),w=vC(r,{settingsMaxUsers:v?.workspace?.maxWorkspaceUsers});t.useEffect(()=>{r&&(d(!0),f(r._id).then(e=>{p(e)}).catch(e=>{Te(e,{component:"WorkspaceSettingsUsers",action:"getUsers",metadata:{workspaceId:r._id}})}).finally(()=>{d(!1)}))},[r,o,f]);const S=()=>{c(e=>e+1)},k=v?.workspace?.mode===WS;if(l||!r)return e.jsx(Il,{});if(k)return null;const C=e=>"string"==typeof e?{name:a("users.unknownUser"),email:e,id:e,role:"-"}:{name:e.name,email:e.email,id:e._id},E=u.map(e=>({...e,...C(e.user)})),N=y(wl.WORKSPACE_MEMBERS_INVITE),A=y(wl.WORKSPACE_MEMBERS_REMOVE),j=y(wl.WORKSPACE_MEMBERS_ROLE_CHANGE),{hasSeatPricing:_,includedSeats:P,maxUsers:T,canInvite:R,inviteBlockReason:D,inviteBlockMessageKey:I,inviteBlockMessageValues:M,perSeatPriceCents:U,currency:L}=w,O=u.length,z=x?.subscription?.billingInterval??"monthly",F=_&&O>=P;return e.jsxs("div",{children:[!N&&!A&&!j&&e.jsx(Rl,{descriptionKey:"users.adminOnly"}),N&&e.jsx("div",{className:"mb-4",children:R?e.jsxs("div",{children:[e.jsx(xC,{onInvite:S,workspaceId:r._id}),F&&U&&U>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(U,L),interval:z})})})]}):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:D??"member_limit_reached"})}),e.jsx("p",{className:"text-xs text-red-600 mt-0.5",children:I?a(I,M??void 0):""})]})})}),(_||T>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(_)})}),T>0&&e.jsxs("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full "+(O>=T?"bg-red-100 text-red-700":O>=.8*T?"bg-amber-100 text-amber-700":"bg-emerald-100 text-emerald-700"),children:[s(O)," / ",s(T)]})]}),T>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 "+(O>=T?"bg-red-500":O>=.8*T?"bg-amber-500":"bg-emerald-500"),style:{width:`${Math.min(100,O/T*100)}%`}})}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[e.jsx("div",{children:_?e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(P)})," ",a("users.included"),U&&U>0&&e.jsxs("span",{className:"text-gray-400",children:[" ","· ",i(U,L),a("users.perExtraSeat")]})]}):e.jsxs("span",{children:[e.jsx("span",{className:"text-gray-900 font-medium",children:s(T)})," ",a("users.maxMembers")]})}),T>0?e.jsxs("span",{children:[s(Math.max(0,T-O))," ",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:O})})}),e.jsx("div",{children:e.jsx(Ei,{variant:"ghost",size:"sm",onClick:S,progress:l,children:a("settings.common.refreshAction",{loading:String(l)})})})]}),e.jsx("ul",{className:"space-y-2",children:E.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")})]})]}),j&&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(hC,{disabled:i||!j||o||m===t.id,value:t.role,onValueChange:e=>{return n=r._id,a=t.id,s=e,void(yl(r,a)?Te(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(()=>{S()}).catch(e=>{Te(e,{component:"WorkspaceSettingsUsers",action:"handleUpdateRole",metadata:{workspaceId:n,userId:a,role:s}})}).finally(()=>{h(null)})));var n,a,s},children:[e.jsx(fC,{children:e.jsx(xk,{placeholder:a("users.selectRole")})}),e.jsx(gC,{children:r?.roles.map(t=>e.jsx(bC,{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($s,{className:"h-4 w-4 animate-spin text-gray-500"})})]}),!i&&!o&&A&&e.jsx(Ei,{variant:"destructive",size:"sm",startIcon:e.jsx(ii,{}),onClick:()=>{return e=t.id,void(yl(r,e)?Te(new Error("Cannot remove the workspace owner"),{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}}):g(r._id,e).then(()=>{S()}).catch(t=>{Te(t,{component:"WorkspaceSettingsUsers",action:"handleRemoveUser",metadata:{workspaceId:r._id,userId:e}})}));var e}})]})]},s)})}),0===u.length&&e.jsx("div",{className:"text-center py-8 text-gray-500",children:a("users.noMembers")})]})};function xC({onInvite:r,workspaceId:n}){const{t:a}=ln(),{addUser:s,getWorkspace:i}=PC(),{settings:o}=An(),[c,l]=t.useState(""),[d,u]=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(""),u("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(Wg,{children:a("users.inviteByEmail")}),e.jsx(Qg,{type:"email",value:c,onChange:e=>l(e.target.value),placeholder:"example@example.com"})]}),e.jsxs("div",{children:[e.jsx(Wg,{children:a("users.role")}),e.jsxs(hC,{value:d,onValueChange:u,children:[e.jsx(fC,{children:e.jsx(xk,{placeholder:a("users.selectRole")})}),e.jsx(gC,{children:w.map(t=>e.jsx(bC,{value:t,children:t},t))})]})]}),e.jsx("div",{children:e.jsx(Ei,{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,d).then(()=>{b(a("users.inviteSuccess")),r?.()}).catch(t=>{Te(t,{component:"InviteMember",action:"addUser",metadata:{workspaceId:n,email:e,role:d}}),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||!d,children:p?a("users.inviting"):a("users.inviteAs",{role:d})})})]})}const wC=({workspace:t,section:r,setSection:n})=>{const{t:a}=ln(),{settings:s}=An(),{can:i}=Nl(),{appPermissions:o}=sa(),c=s?.workspace?.mode===WS,l=i(wl.WORKSPACE_DELETE),d=o&&Object.keys(o).length>0;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(SC,{title:a("settings.sidebar.account"),children:e.jsx(kC,{activeSection:r,icon:e.jsx(ci,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.profile"),section:CC.Profile,onClick:()=>n(CC.Profile)})}),e.jsxs(SC,{title:a("settings.sidebar.workspace"),children:[i(wl.WORKSPACE_SETTINGS_VIEW)&&e.jsx(kC,{activeSection:r,icon:e.jsx(Xs,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.general"),section:CC.General,onClick:()=>n(CC.General)}),!c&&i(wl.WORKSPACE_MEMBERS_VIEW)&&e.jsx(kC,{activeSection:r,icon:e.jsx(li,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.users"),section:CC.Users,onClick:()=>n(CC.Users)}),i(wl.WORKSPACE_BILLING_VIEW)&&e.jsx(kC,{activeSection:r,icon:e.jsx(Bs,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.subscription"),section:CC.Subscription,onClick:()=>n(CC.Subscription)}),i(wl.WORKSPACE_USAGE_VIEW)&&e.jsx(kC,{activeSection:r,icon:e.jsx(Us,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.usage"),section:CC.Usage,onClick:()=>n(CC.Usage)}),i(wl.WORKSPACE_BILLING_VIEW)&&e.jsx(kC,{activeSection:r,icon:e.jsx(Fs,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.credits"),section:CC.Credits,onClick:()=>n(CC.Credits)}),i(wl.WORKSPACE_FEATURES_VIEW)&&e.jsx(kC,{activeSection:r,icon:e.jsx(ai,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.features"),section:CC.Features,onClick:()=>n(CC.Features)}),e.jsx(kC,{activeSection:r,icon:e.jsx(Ds,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.notifications"),section:CC.Notifications,onClick:()=>n(CC.Notifications)}),d&&!c&&e.jsx(kC,{activeSection:r,icon:e.jsx(ei,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.permissions"),section:CC.Permissions,onClick:()=>n(CC.Permissions)}),l&&!c&&e.jsx(kC,{activeSection:r,icon:e.jsx(oi,{className:"h-3.5 w-3.5"}),label:a("settings.sidebar.danger"),section:CC.Danger,onClick:()=>n(CC.Danger)})]})]})};function SC({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 kC({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 CC={Profile:"profile",General:"general",Users:"users",Subscription:"subscription",Usage:"usage",Credits:"credits",Features:"features",Notifications:"notifications",Permissions:"permissions",Danger:"danger"},EC=new Set(Object.values(CC)),NC={[CC.Profile]:"settings.titles.profile",[CC.General]:"settings.titles.general",[CC.Users]:"settings.titles.users",[CC.Subscription]:"settings.titles.subscription",[CC.Usage]:"settings.titles.usage",[CC.Credits]:"settings.titles.credits",[CC.Features]:"settings.titles.features",[CC.Notifications]:"settings.titles.notifications",[CC.Permissions]:"settings.titles.permissions",[CC.Danger]:"settings.titles.danger"},AC=({workspace:r,onClose:n,open:a,onOpenChange:s,defaultSection:i=CC.Profile,section:o,onSectionChange:c,showTrigger:l=!0,trigger:d})=>{const{t:u,dir:p}=ln(),[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(Ei,{variant:"outline",size:"icon",children:e.jsx(Xs,{className:"h-4 w-4"})});return e.jsxs(il,{open:b,onOpenChange:e=>{v(e),!e&&n&&n()},children:[l&&e.jsx(ol,{asChild:!0,children:d||w}),e.jsxs(dl,{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(ml,{className:"sr-only",children:u(NC[y])}),e.jsx(wC,{workspace:r,section:y,setSection:x}),e.jsxs("div",{className:"flex-1 p-6 overflow-auto flex flex-col bg-background",children:[e.jsx(pl,{className:"text-xl font-bold mb-4",children:u(NC[y])}),e.jsxs("div",{className:"sm:max-h-[500px] overflow-y-auto",children:[y===CC.Profile&&e.jsx(zS,{workspace:r}),y===CC.General&&e.jsx(Ov,{workspace:r}),y===CC.Users&&e.jsx(yC,{workspace:r}),y===CC.Subscription&&e.jsx(qS,{workspace:r}),y===CC.Usage&&e.jsx(XS,{}),y===CC.Credits&&e.jsx(zl,{workspace:r}),y===CC.Features&&e.jsx(Bd,{workspaceId:r._id?.toString()}),y===CC.Notifications&&e.jsx(Hv,{workspace:r}),y===CC.Permissions&&e.jsx($v,{workspace:r}),y===CC.Danger&&e.jsx(Ed,{workspace:r})]})]})]})]})};var jC=Object.freeze({__proto__:null,SETTINGS_SCREENS:EC,SettingsScreen:CC,WorkspaceSettingsDialog:AC,default:AC});const _C=new class{constructor(){this.listeners=new Set,this.currentState={open:!1,section:CC.Profile}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getState(){return{...this.currentState}}openWorkspaceSettings(e,t){this.currentState={open:!0,section:e||CC.Profile,params:t},this.notifyListeners()}closeSettings(){this.currentState={...this.currentState,open:!1,params:void 0},this.notifyListeners()}setSection(e){this.currentState={...this.currentState,section:e},this.notifyListeners()}clearParams(){this.currentState={...this.currentState,params:void 0}}notifyListeners(){this.listeners.forEach(e=>{e(this.currentState)})}},PC=()=>{const e=wn(),{os:r,api:n}=jn(),{settings:a}=An(),s=Sn(e=>e.workspaces),i=Sn(e=>e.auth.session?.user),o=t.useCallback((t,r)=>{if((!(t._id===s.currentWorkspace?._id)||r?.forceEmit)&&t){const r=s.currentWorkspace;fl(t),e.workspaces(ft(t)),Cs.emitWorkspaceChanged(t,r).catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceChanged",metadata:{workspaceId:t._id}})})}},[s.currentWorkspace,e]),c=t.useCallback(async(t,n)=>{const a=++m.current;e.workspaces(wt(t._id));try{const e=r.auth?.callbacks?.onWorkspaceChange;if(e){const r=xl(t,i?.id);try{await e({workspace:t,user:i??null,role:r})}catch(e){throw Te(e,{component:"useSaaSWorkspaces",action:"onWorkspaceChange",metadata:{workspaceId:t._id}}),e}if(a!==m.current)return}o(t,n)}finally{a===m.current&&e.workspaces(wt(null))}},[e,r.auth?.callbacks?.onWorkspaceChange,o,i]),l=t.useRef(c);l.current=c,t.useEffect(()=>{if(!s.isInitialized){const t=gl();if(e.workspaces(bt(!0)),t){const e=s.workspaces.find(e=>e._id===t);e&&l.current(e,{forceEmit:!0}).catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"initWorkspaceSwitch",metadata:{savedWorkspaceId:t}})})}}},[s.isInitialized,s.workspaces,e]);const d=t.useCallback(()=>{bl(),e.workspaces(gt())},[e]),u=t.useRef(!1),p=t.useRef(!1),m=t.useRef(0),h=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(dt(t)),t.length>0){const e=gl();if(e&&vl(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]),f=t.useCallback(async()=>{if(!s.refreshing&&!u.current){u.current=!0,e.workspaces(xt(!0));try{const t=await n.getWorkspaces();e.workspaces(dt(t))}catch(e){}finally{e.workspaces(xt(!1)),u.current=!1}}},[n,s.refreshing,e]),g=t.useCallback(async(t,r)=>{const a=await n.createWorkspace({name:t,image:r});e.workspaces(ut(a)),await c(a),Cs.emitWorkspaceCreated(a).catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceCreated",metadata:{workspaceId:a._id}})}),setTimeout(()=>{_C.openWorkspaceSettings(CC.Subscription)},300)},[n,e,c]),b=t.useCallback(async(t,r)=>{const a=await n.updateWorkspace(t._id,r);e.workspaces(pt(a)),Cs.emitWorkspaceUpdated(a).catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"emitWorkspaceUpdated",metadata:{workspaceId:a._id}})})},[n,e]),v=t.useCallback(async()=>{if(p.current)return s.allFeatures.length>0?s.allFeatures:null;if(s.allFeatures.length>0)return s.allFeatures;p.current=!0;try{const t=await n.getFeatures();return e.workspaces(ht(t)),t}catch(e){return Te(e,{component:"useSaaSWorkspaces",action:"getFeatures"}),null}finally{p.current=!1}},[n,e,s.allFeatures]),y=t.useCallback(async(e,t,r)=>await n.updateFeature(e,t,r),[n]),x=t.useCallback(async e=>n.updateSettings(e),[n]),w=t.useCallback(async(e,t)=>{const r=await n.updateWorkspacePermissions(e,t);return await f(),r},[n,f]);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&&(fl(r),e.workspaces(ft(r)));else if(s.workspaces.length>0){const e=s.workspaces[0];e._id!==t&&c(e).catch(t=>{Te(t,{component:"useSaaSWorkspaces",action:"fallbackWorkspaceSwitch",metadata:{workspaceId:e._id}})})}},[s.workspaces,s.currentWorkspace,e,c]);const S=t.useCallback(async e=>await n.getWorkspaceUsers(e),[n]),k=t.useCallback(async(e,t,r)=>{const i=s.workspaces.find(t=>t._id===e);if(i){const e=ms({settingsMaxUsers:a?.workspace?.maxWorkspaceUsers}),t=hs({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&&Cs.emitWorkspaceUserAdded(o.userId,i,r).catch(t=>{Te(t,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserAdded",metadata:{workspaceId:e,userId:o.userId,role:r}})}),f().catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"refreshAfterAddUser"})}),Lt(),o},[n,s.workspaces,f,a]),C=t.useCallback(async(e,t)=>{const r=s.workspaces.find(t=>t._id===e);if(r&&yl(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;Cs.emitWorkspaceUserRemoved(i.userId,r,t).catch(r=>{Te(r,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRemoved",metadata:{workspaceId:e,userId:i.userId,role:t}})})}return f().catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"refreshAfterRemoveUser"})}),Lt(),i},[n,s.workspaces,f]),E=t.useCallback(async(e,t,r)=>{if(r.role){const r=s.workspaces.find(t=>t._id===e);if(r&&yl(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&&Cs.emitWorkspaceUserRoleChanged(i.userId,i.workspace,a,r.role).catch(n=>{Te(n,{component:"useSaaSWorkspaces",action:"emitWorkspaceUserRoleChanged",metadata:{workspaceId:e,userId:t,previousRole:a,newRole:r.role}})}),i},[n,s.workspaces]),N=t.useCallback(async e=>{const t=await n.getProfile().catch(()=>null),r=await n.updateUserProfile(e);return Cs.emitUserUpdated(r,t||void 0).catch(e=>{Te(e,{component:"useSaaSWorkspaces",action:"emitUserUpdated",metadata:{userId:r._id}})}),r},[n]),A=t.useCallback(async()=>await n.getProfile(),[n]),j=t.useCallback(async e=>await n.getWorkspace(e),[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(!yl(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&&(bl(),e.workspaces(gt())),r&&Cs.emitWorkspaceDeleted(r).catch(e=>{Te(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:h,refreshWorkspaces:f,refreshing:s.refreshing,currentWorkspace:s.currentWorkspace,setCurrentWorkspace:o,switchToWorkspace:c,resetCurrentWorkspace:d,createWorkspace:g,allFeatures:s.allFeatures,getFeatures:v,updateFeature:y,updateWorkspaceSettings:x,updateWorkspacePermissions:w,getWorkspace:j,updateWorkspace:b,getUsers:S,addUser:k,removeUser:C,updateUser:E,getProfile:A,updateUserProfile:N,deleteWorkspace:_,switching:null!==s.switchingToId,switchingToId:s.switchingToId}};function TC(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:!1!==e.emailVerified,clientId:r,role:e.role||"",image:e.image}}function RC(e,t){return{user:e,sessionId:t,expires:new Date(Date.now()+864e5).toISOString()}}function DC(){return Sn(e=>e.auth)}function IC(){const{t:e}=ln(),r=wn(),n=DC(),a=En(),{serverUrl:s,orgId:i,auth:o}=a,{resetCurrentWorkspace:c,currentWorkspace:l}=PC(),d=ma(),u=t.useMemo(()=>new xa({serverUrl:s,version:a.version}),[s,a.version]),p=t.useCallback(async t=>{va(t||window.location.href),r.auth(Me()),d.show(e("loading.redirecting"));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 d.hide(),r.auth(Le()),new Error(t.message||e("errors.generic"));fa(t.data.redirectUrl)}catch(e){throw d.hide(),r.auth(Le()),Te(e,{component:"useSaaSAuth",action:"signIn"}),e}},[u,i,o,r,d,e]),m=t.useCallback(async()=>{try{o?.callbacks?.onSignOut&&"function"==typeof o.callbacks.onSignOut&&await o.callbacks.onSignOut()}catch(e){Te(e,{component:"useSaaSAuth",action:"signOut"})}finally{pn(mn),r.auth(ze()),c()}},[r,c,o?.callbacks?.onSignOut]),h=t.useCallback(e=>{l?_C.openWorkspaceSettings(e):Te(new Error("Cannot open settings: No current workspace"),{component:"useSaaSAuth",action:"openWorkspaceSettings"})},[l]),f=t.useCallback(()=>{l?_C.openWorkspaceSettings(CC.Credits,{action:Na}):Te(new Error("Cannot open credit store: No current workspace"),{component:"useSaaSAuth",action:"openCreditStore"})},[l]),g=t.useCallback(()=>{l?_C.openWorkspaceSettings(CC.Subscription,{action:Ca}):Te(new Error("Cannot open plan picker: No current workspace"),{component:"useSaaSAuth",action:"openPlanPicker"})},[l]),b=t.useMemo(()=>Ve(n.status),[n.status]);return t.useMemo(()=>({user:n.session?.user,session:n.session,status:n.status,...b,signIn:p,signOut:m,openWorkspaceSettings:h,openCreditStore:f,openPlanPicker:g}),[n.session,n.status,b,p,m,h,f,g])}const MC=t.memo(({children:r,callbacks:n})=>{const{t:a}=ln(),s=wn(),i=DC(),o=En(),c=Ve(i.status).isAuthenticated,l=ma(),d=t.useRef(!1),u=t.useRef(null),p=t.useRef(!1),m=t.useRef(null),h=t.useCallback(async e=>{try{if(n?.handleAuthentication){l.show(a("loading.signingIn"));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=o;if(!rt(r))throw new Error("OS configuration is not available");const{serverUrl:i,version:c,orgId:d}=r;l.show(a("loading.verifyingAccount"));const u=new xa({serverUrl:i,version:c}),p=await u.getProfile(t),m=RC(TC(p,d,r.auth?.clientId||""),t);l.show(a("loading.almostThere")),fn(m.sessionId),s.auth(Oe(m)),function(){if("undefined"!=typeof window)try{const e=new URL(window.location.href);e.searchParams.delete(hn),window.history.replaceState({},"",e.toString())}catch(e){Te(e,{component:"auth-utils",action:"removeTokenFromUrl",metadata:{param:hn}})}}();const h=ya();h&&h!==window.location.href&&fa(h),l.hide()}}catch(t){throw l.hide(),ya(),Te(t,{component:"AuthProviderWrapper",action:"handleAuthRedirect",metadata:{hasCode:!!e}}),s.auth(Le()),t}},[s,n,o,l,a]);return t.useEffect(()=>{if("undefined"==typeof window)return;if(c)return;if(p.current)return;if(m.current)return;if(!rt(o))return;if(bn())return;if(!n?.getSession)return p.current=!0,void s.auth(Le());const e=n.getSession,{serverUrl:t,version:r,orgId:i}=o,d=o.auth?.clientId||"";m.current=(async()=>{l.show(a("loading.restoringSession"));let o=null;try{o=await e()}catch(e){Te(e,{component:"AuthProviderWrapper",action:"getSession"})}if(!o)return p.current=!0,s.auth(Le()),l.hide(),"undefined"!=typeof window&&va(window.location.href),void n?.onSessionExpired?.("missing");try{l.show(a("loading.verifyingAccount"));const e=new xa({serverUrl:t,version:r}),n=await e.getProfile(o),c=RC(TC(n,i,d),o);fn(c.sessionId),p.current=!0,s.auth(Oe(c)),l.hide();const u=ya();u&&u!==window.location.href&&fa(u)}catch(e){Te(e,{component:"AuthProviderWrapper",action:"fetchUserProfile"}),p.current=!0,s.auth(Le()),l.hide(),"undefined"!=typeof window&&va(window.location.href),n?.onSessionExpired?.("expired")}finally{m.current=null}})()},[c,s,o,n]),t.useEffect(()=>{const e=bn();if(!e)return;if(d.current||u.current===e)return;if(!rt(o))return;d.current=!0,u.current=e;let t=!1;return s.auth(Ue()),h(e).then(()=>{t||(u.current=null)}).catch(e=>{t||(Te(e,{component:"AuthProviderWrapper",action:"handleAuthRedirectEffect",metadata:{hasCode:!0}}),u.current=null)}).finally(()=>{d.current=!1}),()=>{t=!0}},[h,o.serverUrl,o.version,o.orgId]),e.jsx(e.Fragment,{children:r})});MC.displayName="AuthProviderWrapper";const UC=t.memo(({config:r,auth:n,children:a})=>{const s=wn();En();const i=t.useMemo(()=>({clientId:n?.clientId||"",redirectUrl:n?.redirectUrl||"",callbacks:n?.callbacks}),[n?.clientId,n?.redirectUrl,n?.callbacks]);return t.useEffect(()=>{s.os(Qe({...r,auth:i}))},[r,i,s]),e.jsx(e.Fragment,{children:a})});UC.displayName="ContextConfigProvider";class LC extends yn{constructor(e){super(e)}async getAttributes(e){const t=await this.fetchResponse("users/attributes",{signal:e});t.ok||await this.throwResponseError(t,"Failed to fetch user attributes");const r=await this.unwrapResponse(t,"Failed to fetch user attributes");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});t.ok||await this.throwResponseError(t,"Failed to fetch user features");const r=await this.unwrapResponse(t,"Failed to fetch user features");return"object"==typeof r&&null!==r?r:{}}}const OC=t.createContext(void 0),zC=t.memo(({children:r})=>{const{t:n}=ln(),a=En(),s=function(){const e=En();return t.useMemo(()=>new LC(e),[e.serverUrl,e.version])}(),{isAuthenticated:i}=IC(),{serverUrl:o,version:c}=a,[l,d]=t.useState({}),[u,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);d(t)}catch(e){if(Ne(e))return;const t=e instanceof Error?e:new Error(n("errors.generic"));g(t),Te(e,{component:"UserProvider",action:"fetchAttributes"})}else d({})},[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),Te(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),Te(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),Te(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]);kn(async e=>{if(!i||!o||!c)return d({}),void p({});h(!0),g(null);try{await Promise.all([b(e),w(e)])}finally{h(!1)}},[i,o,c,b,w],{onError:e=>Te(e,{component:"UserProvider",action:"initialFetch",metadata:{step:"fetchAttributesAndFeatures"}})});const k=t.useMemo(()=>({attributes:l,features:u,isLoading:m,error:f,updateAttributes:y,updateAttribute:x,refreshAttributes:v,refreshFeatures:S}),[l,u,m,f,y,x,v,S]);return e.jsx(OC.Provider,{value:k,children:r})});zC.displayName="UserProvider";const FC=t.lazy(()=>Promise.resolve().then(function(){return jC}).then(e=>({default:e.default})));const BC=({children:r})=>{const{currentWorkspace:n,switchToWorkspace:a,workspaces:s}=PC(),[i,o]=t.useState(!1),[c,l]=t.useState(CC.Profile),d=t.useRef(!1);return t.useEffect(()=>{const e=_C.getState();o(e.open),l(e.section);return _C.subscribe(e=>{o(e.open),l(e.section)})},[]),t.useEffect(()=>{if(d.current)return;if(!n)return;const e=Ia();if(!e)return;const t=function(e){if(e.screen&&EC.has(e.screen))return e.screen;switch(e.action){case Sa:case ka:case Ca:return CC.Subscription;case Ea:return CC.Credits;default:return null}}(e);if(!t)return d.current=!0,void Ma();const r=e.ws;if(r&&r!==n._id){const e=s.find(e=>e._id===r);return e?void a(e).catch(e=>{Te(e,{component:"WorkspaceSettingsProvider",action:"switchWorkspaceFromUrl",metadata:{targetWs:r}}),d.current=!0,Ma()}):(d.current=!0,void Ma())}d.current=!0,_C.openWorkspaceSettings(t,e),Ma()},[n,s,a]),e.jsxs(e.Fragment,{children:[r,n&&i&&e.jsx(Ie,{fallback:null,children:e.jsx(t.Suspense,{fallback:null,children:e.jsx(FC,{workspace:n,open:i,onOpenChange:e=>{e||_C.closeSettings()},section:c,onSectionChange:e=>{_C.setSection(e)},showTrigger:!1})})})]})},WC=(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).`)},VC=t.memo(({serverUrl:r,version:n,orgId:a,auth:s,locale:i,defaultPermissions:o,getCheckoutStripeParams:c,loadingComponent:l,children:d})=>{WC(r,n,a);const u=t.useMemo(()=>({serverUrl:r,version:n,orgId:a}),[r,n,a]),p=t.useMemo(()=>s?.callbacks,[s?.callbacks?.handleAuthentication,s?.callbacks?.onSignOut,s?.callbacks?.getSession,s?.callbacks?.onSessionExpired,s?.callbacks?.handleEvent,s?.callbacks?.onWorkspaceChange]),m=s?.callbacks?.handleEvent;return t.useEffect(()=>(Cs.setCallbacks(m?{handleEvent:m}:null),()=>{Cs.setCallbacks(null)}),[m]),e.jsx(tn,{locale:i,children:e.jsx(jt,{children:e.jsx(pa,{loadingComponent:l,children:e.jsx(MC,{callbacks:p,children:e.jsx(sl,{children:e.jsx(UC,{config:u,auth:s,children:e.jsx(Pt,{getCheckoutStripeParams:c,children:e.jsx(aa,{appPermissions:o,children:e.jsx(zC,{children:e.jsx(Wn,{children:e.jsx(oa,{children:e.jsx(ta,{children:e.jsx(Wv,{children:e.jsx(BC,{children:d})})})})})})})})})})})})})})});VC.displayName="SaaSOSProviderInner";const GC=({children:t,...r})=>e.jsx(Ie,{children:e.jsx(VC,{...r,children:t})});GC.displayName="SaaSOSProvider";const HC=e=>{const{children:t}=e,{status:r}=IC();return r!==We.authenticated?null:t},$C=e=>{const{children:t}=e,{status:r}=IC();return r!==We.unauthenticated?null:t};HC.displayName="WhenAuthenticated",$C.displayName="WhenUnauthenticated";const KC=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=IC();return n.includes(a?.role??"")?t:r||null},qC=e=>{const{children:t,fallback:r,roles:n}=e,{user:a}=IC(),{currentWorkspace:s}=PC(),i=s?.users.find(e=>e._id===a?.id);return i&&n.includes(i?.role??"")?t:r||null};KC.displayName="WhenRoles",qC.displayName="WhenWorkspaceRoles";const ZC=e=>{const{children:t,fallback:r,permission:n}=e,{can:a}=Nl();return a(n)?t:r??null};function JC(){const e=t.useContext(OC);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])}}ZC.displayName="WhenPermission";const YC=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=PC(),a=n?.features?.[r];return a?t:null},XC=e=>{const{children:t,slug:r}=e,{currentWorkspace:n}=PC(),a=n?.features?.[r];return a?null:t},QC=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=JC();return n(r)?t:null},eE=e=>{const{children:t,slug:r}=e,{isFeatureEnabled:n}=JC();return n(r)?null:t};YC.displayName="WhenWorkspaceFeatureEnabled",XC.displayName="WhenWorkspaceFeatureDisabled",QC.displayName="WhenUserFeatureEnabled",eE.displayName="WhenUserFeatureDisabled";const tE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Vn();return s?r??null:a?.subscription?t:n??null},rE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Vn();return s?r??null:a?.subscription?n??null:t},nE=e=>{const{children:t,plans:r,loadingComponent:n,fallbackComponent:a}=e,{response:s,loading:i}=Vn();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},aE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Vn();return s?r??null:"trialing"!==a?.subscription?.subscriptionStatus?n??null:t},sE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{response:a,loading:s}=Vn();return s?r??null:a?.subscription?.subscriptionStatus===Oa?n??null:t},iE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n,daysThreshold:a=3}=e,{response:s,loading:i}=Vn();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};tE.displayName="WhenSubscription",rE.displayName="WhenNoSubscription",nE.displayName="WhenSubscriptionToPlans",aE.displayName="WhenTrialing",sE.displayName="WhenNotTrialing",iE.displayName="WhenTrialEnding";const oE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=ca();if(i)return n??null;const o=s?.[t];return o?o.available<=0?a??null:r:a??null},cE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=ca();if(i)return n??null;const o=s?.[t];return o?o.available>0?a??null:r:a??null},lE=e=>{const{slug:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{quotas:s,loading:i}=ca();if(i)return n??null;const o=s?.[t];return o&&o.hasOverage&&!1!==o.allowOverage?r:a??null},dE=e=>{const{slug:t,threshold:r,children:n,loadingComponent:a,fallbackComponent:s}=e,{quotas:i,loading:o}=ca();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};oE.displayName="WhenQuotaAvailable",cE.displayName="WhenQuotaExhausted",lE.displayName="WhenQuotaOverage",dE.displayName="WhenQuotaThreshold";const uE=({children:e})=>{const{currentWorkspace:t}=PC(),r=t?._id,{balance:n,loading:a,error:s,refetch:i}=ra(),{packages:o,loading:c}=Jn(r),{consumeCredits:l,loading:d,error:u}=qn(r),{purchaseCredits:p,loading:m,error:h}=Zn(r);return e({balance:n,loading:a,packages:o,packagesLoading:c,consume:l,consuming:d,purchase:async e=>{if(!r)throw new Error("No workspace selected");const{successUrl:t,cancelUrl:n}=Da(r),a=await p({creditPackageId:e._id,successUrl:t,cancelUrl:n});a.url&&fa(a.url)},purchasing:m,refetch:i,error:u||h||s})};uE.displayName="CreditActionsProvider";const pE=({children:e})=>{const{balance:t,loading:r,error:n,refetch:a}=ra();return e({balance:t,loading:r,error:n,refetch:a})};pE.displayName="CreditBalance";const mE=e=>{const{min:t=1,children:r,loadingComponent:n,fallbackComponent:a}=e,{balance:s,loading:i}=ra();return i?n??null:s?s.available<t?a??null:r:a??null},hE=e=>{const{children:t,loadingComponent:r,fallbackComponent:n}=e,{balance:a,loading:s}=ra();return s?r??null:a?a.available>0?n??null:t:n??null},fE=e=>{const{threshold:t,children:r,loadingComponent:n,fallbackComponent:a}=e,{balance:s,loading:i}=ra();return i?n??null:s?s.available>t?a??null:r:a??null};function gE(e){if(!e)return null;const t=new Date(e);return isNaN(t.getTime())?null:t}mE.displayName="WhenCreditsAvailable",hE.displayName="WhenCreditsExhausted",fE.displayName="WhenCreditsLow";class bE extends yn{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 vE=class{constructor(e){this.api=new bE(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 yE=xg({name:Kf().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:Kf().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 xE({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 wE({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"})}function SE(...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}var kE,CE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=gi(`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}},{}),EE={exports:{}},NE={};function AE(){if(kE)return NE;kE=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,d=c[1];return s(function(){l.value=r,l.getSnapshot=t,o(l)&&d({inst:l})},[e,r,t]),a(function(){return o(l)&&d({inst:l}),e(function(){o(l)&&d({inst:l})})},[e]),i(r),r};return NE.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:c,NE}var jE,_E,PE={};
28
28
  /**
29
29
  * @license React
30
30
  * use-sync-external-store-shim.development.js
@@ -33,4 +33,4 @@ var Cs={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
33
33
  *
34
34
  * This source code is licensed under the MIT license found in the
35
35
  * LICENSE file in the root directory of this source tree.
36
- */function NE(){return kE||(kE=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,d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,d){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 u=d();if(!l){var p=d();n(u,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var m=(p=a({inst:{value:u,getSnapshot:d}}))[0].inst,h=p[1];return i(function(){m.value=u,m.getSnapshot=d,e(m)&&h({inst:m})},[t,u,d]),s(function(){return e(m)&&h({inst:m}),t(function(){e(m)&&h({inst:m})})},[t]),o(u),u};EE.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:d,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),EE}function AE(){return CE||(CE=1,"production"===process.env.NODE_ENV?xE.exports=SE():xE.exports=NE()),xE.exports}var jE=AE();function _E(){return()=>{}}var PE="Avatar",[TE]=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,d=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:d,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}\``)}]},bE(s,...r)]}(PE),[RE,DE]=TE(PE),IE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,...s}=t,[i,o]=a.useState("idle");return e.jsx(RE,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:e.jsx(yE.span,{...s,ref:r})})});IE.displayName=PE;var ME="AvatarImage",UE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:i=()=>{},...o}=t,c=DE(ME,n),l=function(e,{referrerPolicy:t,crossOrigin:r}){const n=jE.useSyncExternalStore(_E,()=>!0,()=>!1),s=a.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,c]=a.useState(()=>zE(i,e));return Ci(()=>{c(zE(i,e))},[i,e]),Ci(()=>{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),d=Ii(e=>{i(e),c.onImageLoadingStatusChange(e)});return Ci(()=>{"idle"!==l&&d(l)},[l,d]),"loaded"===l?e.jsx(yE.img,{...o,ref:r,src:s}):null});UE.displayName=ME;var LE="AvatarFallback",OE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:s,...i}=t,o=DE(LE,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(yE.span,{...i,ref:r}):null});function zE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}OE.displayName=LE;var FE=IE,BE=UE,WE=OE;const VE=a.forwardRef(({className:t,...r},n)=>e.jsx(FE,{ref:n,className:Se("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));VE.displayName=FE.displayName;const GE=a.forwardRef(({className:t,...r},n)=>e.jsx(BE,{ref:n,className:Se("aspect-square h-full w-full",t),...r}));GE.displayName=BE.displayName;const HE=a.forwardRef(({className:t,...r},n)=>e.jsx(WE,{ref:n,className:Se("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...r}));HE.displayName=WE.displayName;var $E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=ui(`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}},{}),KE="horizontal",qE=["horizontal","vertical"],ZE=a.forwardRef((t,r)=>{const{decorative:n,orientation:a=KE,...s}=t,i=function(e){return qE.includes(e)}(a)?a:KE,o=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e.jsx($E.div,{"data-orientation":i,...o,...s,ref:r})});ZE.displayName="Separator";var JE=ZE;const YE=a.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},s)=>e.jsx(JE,{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 XE(t){const{t:r}=ln(),{workspace:n,setCurrentWorkspace:a,setOpen:s,workspacesToUse:i,switchingToId:o}=t,c=t.isCurrentWorkspace??!1,l=o===n._id,d=n.subscription??null,u=null!=d&&"object"==typeof d?d.plan??null:null,p=u?.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(VE,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(GE,{src:n.image&&n.image.trim()?n.image:void 0})}),e.jsx(HE,{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(ai,{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(xi,{size:"sm",disabled:null!==o||l,progress:l,onClick:()=>{t.switchToWorkspace(n).then(()=>s(!1)).catch(e=>{Te(e,{component:"WorkspaceItem",action:"switchToWorkspace",metadata:{workspaceId:n._id}})})},children:r("workspace.switchTo")}),e.jsx(SC,{workspace:n,onClose:()=>{if(c){const e=i.findIndex(e=>e._id?.toString()===n._id?.toString());-1!==e&&a(i[e])}}})]})]});var m}function QE(r){const{t:n,dir:a}=ln(),{switching:s}=EC(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[d,u]=t.useState("🏢"),[p,m]=t.useState(!1),{createWorkspace:h}=EC(),f=cp({resolver:bf(fg({name:Wf().min(2,{message:n("workspace.workspaceNameMinLength")}),image:Wf().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(tl,{open:i,onOpenChange:o,children:[e.jsx(rl,{asChild:!0,children:e.jsxs(xi,{className:"w-full rounded-none",disabled:s,children:[e.jsx(Vs,{className:"h-4 w-4 me-2"}),n("workspace.createNew")]})}),e.jsxs(sl,{dir:a,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(il,{children:[e.jsx(ol,{children:n("workspace.createTitle")}),e.jsx(cl,{children:n("workspace.createDescription")})]}),e.jsx(Og,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===c)t=Tv(d);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(),u("🏢"),l("emoji"),r?.onCreated?.()}catch(t){Te(t,{component:"WorkspaceProvider",action:"createWorkspace",metadata:{name:e.name}})}finally{m(!1)}}),children:[e.jsx(Fg,{control:f.control,name:"name",render:({field:t})=>e.jsxs(Vg,{children:[e.jsx(Gg,{children:n("workspace.workspaceName")}),e.jsx(Hg,{children:e.jsx(qg,{placeholder:n("workspace.workspaceNamePlaceholder"),...t})}),e.jsx(Kg,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(Lg,{className:"text-sm font-medium",children:n("workspace.workspaceIcon")}),e.jsx($g,{children:n("workspace.iconDescription")})]}),e.jsxs(Gb,{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(Hb,{value:"emoji",id:"emoji"}),e.jsxs(Lg,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(Xs,{className:"h-4 w-4"}),n("workspace.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Hb,{value:"url",id:"url"}),e.jsxs(Lg,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Fs,{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:d})]}),e.jsx(_v,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Rv.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{u(e),f.setValue("image",Tv(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(d===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(Fg,{control:f.control,name:"image",render:({field:t})=>e.jsxs(Vg,{children:[e.jsx(Gg,{children:n("workspace.imageUrl")}),e.jsx(Hg,{children:e.jsx(qg,{placeholder:n("workspace.imageUrlPlaceholder"),...t})}),e.jsx($g,{children:n("workspace.imageUrlDescription")}),e.jsx(Kg,{})]})}),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(xi,{type:"button",variant:"outline",onClick:()=>{o(!1),f.reset(),u("🏢"),l("emoji")},disabled:p,children:n("settings.common.cancel")}),e.jsx(xi,{type:"submit",disabled:p,children:p?e.jsxs(e.Fragment,{children:[e.jsx(Bs,{className:"me-2 h-4 w-4 animate-spin"}),n("workspace.creating")]}):n("workspace.createWorkspace")})]})]})})]})]})}YE.displayName=JE.displayName;var eN=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",credits:"Créditos",features:"Funciones del espacio de trabajo",notifications:"Notificaciones",permissions:"Permisos",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",credits:"Créditos",features:"Funciones",notifications:"Notificaciones",permissions:"Permisos",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}}",noPermissionTitle:"Acceso restringido",noPermissionDescription:"No tienes permiso para acceder a esta sección. Contacta a un administrador del espacio de trabajo si necesitas acceso.",billingManageOnly:"Solo los usuarios con permisos de gestión de facturación pueden realizar esta acción."}},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",forWorkspace:"para {name}",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",cancelTrialTitle:"Cancelar prueba",cancelTrialConfirm:"¿Estás seguro de que deseas cancelar tu período de prueba?",cancelTrialAccess:"Tu período de prueba continuará hasta",cancelTrialNoCharge:"No se te cobrará — tu período de prueba simplemente expirará",cancelTrialResume:"Puedes reanudar tu prueba en cualquier momento antes de que termine",cancelTrialKeep:"Mantener prueba",cancelTrialButton:"Sí, cancelar prueba",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",resumeTrial:"Reanudar prueba",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",scheduledTrialCancellation:"Cancelación de prueba 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",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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",trialEndDescription:"Tu período de prueba 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",startTrialDays:"Comenzar prueba gratuita de {days} días",trialBadge:"Prueba de {days} días"},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.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number} incluidos (límite estricto)",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"},permissions:{title:"Permisos",description:"Configura lo que cada rol puede hacer en este espacio de trabajo.",ownerOnly:"Solo el propietario del espacio de trabajo puede gestionar los permisos.",save:"Guardar permisos",saving:"Guardando...",saveSuccess:"Permisos guardados correctamente"},credits:{title:"Créditos",description:"Los créditos se pueden usar para acciones premium como la generación con IA.",balance:"Saldo de créditos",available:"Disponible",totalGranted:"Total otorgado",totalConsumed:"Total consumido",totalExpired:"Total expirado",noCredits:"Aún no hay créditos",noCreditsHint:"Los créditos aparecerán aquí cuando sean otorgados por tu plan o comprados.",buyCredits:"Comprar créditos",buyAmount:"Buy {count} Credits",purchasing:"Redirigiendo...",packages:"Paquetes de créditos",noPackages:"No hay paquetes de créditos disponibles.",creditsAmount:"{count} créditos",validityDays:"Válido por {count} días",validityUnlimited:"Sin expiración",transactions:"Transacciones recientes",noTransactions:"Aún no hay transacciones.",loadMore:"Load More",viewAll:"Ver todo",expiringSoon:"Próximos a expirar",expiringInDays:"{count} créditos expiran dentro de {days} días",noExpiring:"No hay créditos próximos a expirar.",type:{plan_grant:"Otorgado por el plan",pack_purchased:"Comprado",consumed:"Consumido",expired:"Expirado",admin_grant:"Otorgado",admin_revoke:"Revocado",refund:"Reembolso"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"¡Créditos comprados correctamente! Tu saldo ha sido actualizado.",purchaseCanceled:"La compra de créditos fue cancelada. No se realizaron cargos.",purchaseFailed:"La compra de créditos falló. Por favor, inténtalo de nuevo o contacta a soporte.",errorLoading:"Error al cargar los datos de créditos",insufficientCredits:"Créditos insuficientes"},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",fetchCreditBalance:"Error al obtener el saldo de créditos",consumeCredits:"Error al consumir créditos",purchaseCredits:"Error al comprar créditos",fetchCreditPackages:"Error al obtener los paquetes de créditos",fetchCreditTransactions:"Error al obtener las transacciones de créditos",fetchExpiringCredits:"Error al obtener los créditos próximos a expirar"}}});var tN=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",credits:"Crédits",features:"Fonctionnalités de l'espace de travail",notifications:"Notifications",permissions:"Permissions",danger:"Zone de danger"},sidebar:{account:"Compte",workspace:"Espace de travail",profile:"Compte",general:"Paramètres",users:"Membres",subscription:"Plan et facturation",usage:"Utilisation",credits:"Crédits",features:"Fonctionnalités",notifications:"Notifications",permissions:"Permissions",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}}",noPermissionTitle:"Accès restreint",noPermissionDescription:"Vous n'avez pas la permission d'accéder à cette section. Contactez un administrateur de l'espace de travail si vous avez besoin d'un accès.",billingManageOnly:"Seuls les utilisateurs disposant des autorisations de gestion de la facturation peuvent effectuer cette action."}},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",forWorkspace:"pour {name}",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",cancelTrialTitle:"Annuler l'essai",cancelTrialConfirm:"Êtes-vous sûr de vouloir annuler votre période d'essai ?",cancelTrialAccess:"Votre période d'essai continuera jusqu'au",cancelTrialNoCharge:"Vous ne serez pas facturé — votre période d'essai expirera simplement",cancelTrialResume:"Vous pouvez reprendre votre essai à tout moment avant qu'il ne se termine",cancelTrialKeep:"Conserver l'essai",cancelTrialButton:"Oui, annuler l'essai",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",resumeTrial:"Reprendre l'essai",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",scheduledTrialCancellation:"Annulation de l'essai 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",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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",trialEndDescription:"Votre période d'essai 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",startTrialDays:"Commencer l'essai gratuit de {days} jours",trialBadge:"Essai de {days} jours"},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.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number} inclus (limite stricte)",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"},permissions:{title:"Permissions",description:"Configurez ce que chaque rôle peut faire dans cet espace de travail.",ownerOnly:"Seul le propriétaire de l'espace de travail peut gérer les permissions.",save:"Enregistrer les permissions",saving:"Enregistrement...",saveSuccess:"Permissions enregistrées avec succès"},credits:{title:"Crédits",description:"Les crédits peuvent être utilisés pour des actions premium comme la génération par IA.",balance:"Solde de crédits",available:"Disponible",totalGranted:"Total accordé",totalConsumed:"Total consommé",totalExpired:"Total expiré",noCredits:"Pas encore de crédits",noCreditsHint:"Les crédits apparaîtront ici lorsqu'ils seront accordés par votre plan ou achetés.",buyCredits:"Acheter des crédits",buyAmount:"Buy {count} Credits",purchasing:"Redirection...",packages:"Packs de crédits",noPackages:"Aucun pack de crédits disponible.",creditsAmount:"{count} crédits",validityDays:"Valable {count} jours",validityUnlimited:"Sans expiration",transactions:"Transactions récentes",noTransactions:"Pas encore de transactions.",loadMore:"Load More",viewAll:"Tout voir",expiringSoon:"Expiration imminente",expiringInDays:"{count} crédits expirent dans {days} jours",noExpiring:"Aucun crédit n'expire prochainement.",type:{plan_grant:"Octroi du plan",pack_purchased:"Acheté",consumed:"Consommé",expired:"Expiré",admin_grant:"Accordé",admin_revoke:"Révoqué",refund:"Remboursement"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"Crédits achetés avec succès ! Votre solde a été mis à jour.",purchaseCanceled:"L'achat de crédits a été annulé. Aucun frais n'a été facturé.",purchaseFailed:"L'achat de crédits a échoué. Veuillez réessayer ou contacter le support.",errorLoading:"Échec du chargement des données de crédits",insufficientCredits:"Crédits insuffisants"},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",fetchCreditBalance:"Échec de la récupération du solde de crédits",consumeCredits:"Échec de la consommation des crédits",purchaseCredits:"Échec de l'achat de crédits",fetchCreditPackages:"Échec de la récupération des packs de crédits",fetchCreditTransactions:"Échec de la récupération des transactions de crédits",fetchExpiringCredits:"Échec de la récupération des crédits expirant bientôt"}}});var rN=Object.freeze({__proto__:null,de:{settings:{titles:{profile:"Konto",general:"Arbeitsbereich-Einstellungen",users:"Arbeitsbereich-Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",credits:"Guthaben",features:"Arbeitsbereich-Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",danger:"Gefahrenzone"},sidebar:{account:"Konto",workspace:"Arbeitsbereich",profile:"Konto",general:"Einstellungen",users:"Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",credits:"Guthaben",features:"Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",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}}",noPermissionTitle:"Zugriff eingeschränkt",noPermissionDescription:"Sie haben keine Berechtigung, auf diesen Bereich zuzugreifen. Kontaktieren Sie einen Workspace-Administrator, wenn Sie Zugriff benötigen.",billingManageOnly:"Nur Benutzer mit Abrechnungsverwaltungsberechtigungen können diese Aktion durchführen."}},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",forWorkspace:"für {name}",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",cancelTrialTitle:"Testversion abbrechen",cancelTrialConfirm:"Bist du sicher, dass du deine Testversion abbrechen möchtest?",cancelTrialAccess:"Deine Testversion läuft weiter bis",cancelTrialNoCharge:"Dir wird nichts berechnet — deine Testversion läuft einfach ab",cancelTrialResume:"Du kannst deine Testversion jederzeit vor Ablauf wieder aufnehmen",cancelTrialKeep:"Testversion behalten",cancelTrialButton:"Ja, Testversion abbrechen",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",resumeTrial:"Testversion 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",scheduledTrialCancellation:"Kündigung der Testversion 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",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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",trialEndDescription:"Deine Testversion 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",startTrialDays:"{days}-tägige kostenlose Testversion starten",trialBadge:"{days}-Tage-Testversion"},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.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number} enthalten (festes Limit)",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"},permissions:{title:"Berechtigungen",description:"Konfiguriere, was jede Rolle in diesem Arbeitsbereich tun kann.",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann Berechtigungen verwalten.",save:"Berechtigungen speichern",saving:"Wird gespeichert...",saveSuccess:"Berechtigungen erfolgreich gespeichert"},credits:{title:"Guthaben",description:"Guthaben kann für Premium-Aktionen wie KI-Generierung verwendet werden.",balance:"Guthabenstand",available:"Verfügbar",totalGranted:"Gesamt gewährt",totalConsumed:"Gesamt verbraucht",totalExpired:"Gesamt abgelaufen",noCredits:"Noch kein Guthaben",noCreditsHint:"Guthaben wird hier angezeigt, wenn es durch deinen Plan gewährt oder gekauft wurde.",buyCredits:"Guthaben kaufen",buyAmount:"Buy {count} Credits",purchasing:"Weiterleitung...",packages:"Guthabenpakete",noPackages:"Keine Guthabenpakete verfügbar.",creditsAmount:"{count} Guthaben",validityDays:"Gültig für {count} Tage",validityUnlimited:"Kein Ablaufdatum",transactions:"Letzte Transaktionen",noTransactions:"Noch keine Transaktionen.",loadMore:"Load More",viewAll:"Alle anzeigen",expiringSoon:"Läuft bald ab",expiringInDays:"{count} Guthaben läuft innerhalb von {days} Tagen ab",noExpiring:"Kein Guthaben läuft bald ab.",type:{plan_grant:"Plan-Gewährung",pack_purchased:"Gekauft",consumed:"Verbraucht",expired:"Abgelaufen",admin_grant:"Gewährt",admin_revoke:"Widerrufen",refund:"Erstattung"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"Guthaben erfolgreich gekauft! Dein Kontostand wurde aktualisiert.",purchaseCanceled:"Guthabenkauf wurde abgebrochen. Es wurden keine Gebühren erhoben.",purchaseFailed:"Guthabenkauf fehlgeschlagen. Bitte versuche es erneut oder kontaktiere den Support.",errorLoading:"Guthabendaten konnten nicht geladen werden",insufficientCredits:"Nicht genügend Guthaben"},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",fetchCreditBalance:"Guthabenstand konnte nicht abgerufen werden",consumeCredits:"Guthaben konnte nicht verbraucht werden",purchaseCredits:"Guthaben konnte nicht gekauft werden",fetchCreditPackages:"Guthabenpakete konnten nicht abgerufen werden",fetchCreditTransactions:"Guthabentransaktionen konnten nicht abgerufen werden",fetchExpiringCredits:"Ablaufendes Guthaben konnte nicht abgerufen werden"}}});var nN=Object.freeze({__proto__:null,ja:{settings:{titles:{profile:"アカウント",general:"ワークスペース設定",users:"ワークスペースメンバー",subscription:"プランと請求",usage:"使用状況",credits:"クレジット",features:"ワークスペース機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},sidebar:{account:"アカウント",workspace:"ワークスペース",profile:"アカウント",general:"設定",users:"メンバー",subscription:"プランと請求",usage:"使用状況",credits:"クレジット",features:"機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},common:{refresh:"更新",refreshing:"更新中...",retry:"再試行",retrying:"再試行中...",save:"保存",saving:"保存中...",cancel:"キャンセル",delete:"削除",dismiss:"閉じる",loading:"読み込み中...",success:"成功しました!",error:"エラー",refreshAction:"{loading, select, true {更新中...} other {更新}}",retryAction:"{loading, select, true {再試行中...} other {再試行}}",noPermissionTitle:"アクセス制限",noPermissionDescription:"このセクションにアクセスする権限がありません。アクセスが必要な場合は、ワークスペース管理者にお問い合わせください。",billingManageOnly:"請求管理権限を持つユーザーのみがこの操作を実行できます。"}},subscription:{managePlan:"プランと請求を管理",changePlan:"プランを変更",viewPricingPlans:"料金プランを見る",viewPlans:"プランを見る",upgradePlan:"今すぐアップグレード",subscribe:"登録する",currentPlan:"現在のプラン",noSubscription:"有効なサブスクリプションがありません",choosePlan:"プランを選択",choosePlanDescription:"プランを比較して、ニーズに合ったものを選択してください",forWorkspace:"{name} 向け",planUpdateAvailable:"プランの更新が利用可能です",updateSuccess:"サブスクリプションが正常に更新されました!",updateFailed:"更新に失敗しました",cancelTitle:"サブスクリプションをキャンセル",cancelConfirm:"サブスクリプションをキャンセルしてもよろしいですか?",cancelKeep:"サブスクリプションを維持",cancelButton:"はい、キャンセルします",cancelTrialTitle:"トライアルをキャンセル",cancelTrialConfirm:"トライアルをキャンセルしてもよろしいですか?",cancelTrialAccess:"トライアルは次の日まで継続されます",cancelTrialNoCharge:"課金されることはありません — トライアルはそのまま終了します",cancelTrialResume:"終了前であればいつでもトライアルを再開できます",cancelTrialKeep:"トライアルを維持",cancelTrialButton:"はい、トライアルをキャンセル",canceling:"キャンセル中...",cancelSuccess:"サブスクリプションは請求期間の終了時にキャンセルされます。",cancelNotCharged:"キャンセル後は課金されません",cancelResumeAnytime:"終了前であればいつでもサブスクリプションを再開できます",resumeTitle:"サブスクリプションを再開",resumeTrial:"トライアルを再開",resumeConfirm:"サブスクリプションを再開してもよろしいですか?",resumeKeep:"キャンセルのまま維持",resumeButton:"はい、再開します",resuming:"再開中...",resumeSuccess:"サブスクリプションが再開されました。",managePayment:"支払いを管理",openingPortal:"開いています...",viewAllPlans:"すべてのプランを見る",scheduledCancellation:"サブスクリプションのキャンセルが予定されています",scheduledTrialCancellation:"トライアルのキャンセルが予定されています",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:"使用量クォータ",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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:"サブスクリプションの終了日:",trialEndDescription:"トライアルの終了日:",cancelEndFallback:"サブスクリプションは現在の請求期間の終了時にキャンセルされます。以降の課金はありません。",resumeChargeDate:"次回の課金日:",resumeChargeFallback:"次回の請求日",resumeContinue:"サブスクリプションは自動的に継続され、プランに基づいて請求されます",resumeCancelAnytime:"次回の請求日前であれば、いつでもキャンセルできます",retainAccess:"このプランへのフルアクセスは次の日まで維持されます:",retainAccessFallback:"現在の請求期間の終了まで",noPlansAvailable:"このワークスペースで利用可能なプラングループがありません。エラーだと思われる場合は、サポートにお問い合わせください。",noPlansAvailableHint:"このワークスペースで利用可能なプラングループがありません。",startTrialDescription:"コミットなしでフルプランをお試しください。いつでもアップグレードまたはキャンセルできます。",noSubscriptionDescription:"ワークスペースを始めるにはプランを選択してください",startFreeTrial:"無料トライアルを開始",startTrialDays:"{days}日間の無料トライアルを開始",trialBadge:"{days}日間トライアル"},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:"通知はこのデバイスに送信されます。他のデバイスでは個別に有効にしてください。",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number}件含まれる(上限)",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:"プッシュ通知の解除に失敗しました"},permissions:{title:"権限",description:"このワークスペースで各ロールができることを設定します。",ownerOnly:"ワークスペースのオーナーのみが権限を管理できます。",save:"権限を保存",saving:"保存中...",saveSuccess:"権限が正常に保存されました"},credits:{title:"クレジット",description:"クレジットはAI生成などのプレミアムアクションに使用できます。",balance:"クレジット残高",available:"利用可能",totalGranted:"付与合計",totalConsumed:"消費合計",totalExpired:"期限切れ合計",noCredits:"クレジットがありません",noCreditsHint:"プランによる付与または購入時にクレジットがここに表示されます。",buyCredits:"クレジットを購入",buyAmount:"Buy {count} Credits",purchasing:"リダイレクト中...",packages:"クレジットパッケージ",noPackages:"利用可能なクレジットパッケージがありません。",creditsAmount:"{count} クレジット",validityDays:"{count} 日間有効",validityUnlimited:"有効期限なし",transactions:"最近の取引",noTransactions:"取引はまだありません。",loadMore:"Load More",viewAll:"すべて表示",expiringSoon:"まもなく期限切れ",expiringInDays:"{count} クレジットが {days} 日以内に期限切れ",noExpiring:"まもなく期限切れになるクレジットはありません。",type:{plan_grant:"プラン付与",pack_purchased:"購入済み",consumed:"消費済み",expired:"期限切れ",admin_grant:"付与",admin_revoke:"取消",refund:"返金"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"クレジットの購入が完了しました!残高が更新されました。",purchaseCanceled:"クレジットの購入がキャンセルされました。課金は発生していません。",purchaseFailed:"クレジットの購入に失敗しました。再度お試しいただくか、サポートにお問い合わせください。",errorLoading:"クレジットデータの読み込みに失敗しました",insufficientCredits:"クレジットが不足しています"},errors:{networkError:"ネットワークエラー:インターネット接続を確認してください",unauthorized:"認証エラー — セッションを確認してください",notFound:"リソースが見つかりません",generic:"エラーが発生しました",fetchPlans:"プランの取得に失敗しました",fetchPlanGroup:"プラングループの取得に失敗しました",fetchPlanGroupVersion:"プラングループバージョンの取得に失敗しました",fetchPlanGroupVersions:"プラングループバージョン一覧の取得に失敗しました",fetchSubscription:"サブスクリプションの取得に失敗しました",createCheckout:"チェックアウトセッションの作成に失敗しました",updateSubscription:"サブスクリプションの更新に失敗しました",fetchInvoices:"請求書の取得に失敗しました",fetchInvoice:"請求書の取得に失敗しました",openBillingPortal:"請求ポータルを開けませんでした",cancelSubscription:"サブスクリプションのキャンセルに失敗しました",resumeSubscription:"サブスクリプションの再開に失敗しました",recordUsage:"使用量の記録に失敗しました",fetchQuotaUsage:"クォータ使用状況の取得に失敗しました",fetchAllQuotaUsage:"全クォータ使用状況の取得に失敗しました",fetchUsageLogs:"使用ログの取得に失敗しました",fetchCreditBalance:"クレジット残高の取得に失敗しました",consumeCredits:"クレジットの消費に失敗しました",purchaseCredits:"クレジットの購入に失敗しました",fetchCreditPackages:"クレジットパッケージの取得に失敗しました",fetchCreditTransactions:"クレジット取引履歴の取得に失敗しました",fetchExpiringCredits:"期限切れ間近のクレジットの取得に失敗しました"}}});var aN=Object.freeze({__proto__:null,zh:{settings:{titles:{profile:"账户",general:"工作区设置",users:"工作区成员",subscription:"套餐与账单",usage:"用量",credits:"积分",features:"工作区功能",notifications:"通知",permissions:"权限",danger:"危险区域"},sidebar:{account:"账户",workspace:"工作区",profile:"账户",general:"设置",users:"成员",subscription:"套餐与账单",usage:"用量",credits:"积分",features:"功能",notifications:"通知",permissions:"权限",danger:"危险区域"},common:{refresh:"刷新",refreshing:"正在刷新...",retry:"重试",retrying:"正在重试...",save:"保存",saving:"正在保存...",cancel:"取消",delete:"删除",dismiss:"关闭",loading:"正在加载...",success:"操作成功!",error:"错误",refreshAction:"{loading, select, true {正在刷新...} other {刷新}}",retryAction:"{loading, select, true {正在重试...} other {重试}}",noPermissionTitle:"访问受限",noPermissionDescription:"您没有权限访问此部分。如需访问权限,请联系工作区管理员。",billingManageOnly:"只有具有账单管理权限的用户才能执行此操作。"}},subscription:{managePlan:"管理您的套餐和账单",changePlan:"更改套餐",viewPricingPlans:"查看价格方案",viewPlans:"查看套餐",upgradePlan:"立即升级",subscribe:"订阅",currentPlan:"当前套餐",noSubscription:"您没有有效的订阅",choosePlan:"选择您的套餐",choosePlanDescription:"比较各套餐,选择最适合您需求的方案",forWorkspace:"适用于 {name}",planUpdateAvailable:"套餐更新可用",updateSuccess:"订阅已成功更新!",updateFailed:"更新失败",cancelTitle:"取消订阅",cancelConfirm:"您确定要取消订阅吗?",cancelKeep:"保留订阅",cancelButton:"是的,取消订阅",cancelTrialTitle:"取消试用",cancelTrialConfirm:"您确定要取消试用吗?",cancelTrialAccess:"您的试用将持续到",cancelTrialNoCharge:"不会向您收费 — 试用期将自动到期",cancelTrialResume:"您可以在试用结束前随时恢复试用",cancelTrialKeep:"保留试用",cancelTrialButton:"是的,取消试用",canceling:"正在取消...",cancelSuccess:"订阅将在当前计费周期结束时取消。",cancelNotCharged:"取消后将不再收费",cancelResumeAnytime:"您可以在订阅结束前随时恢复",resumeTitle:"恢复订阅",resumeTrial:"恢复试用",resumeConfirm:"您确定要恢复订阅吗?",resumeKeep:"保持取消状态",resumeButton:"是的,恢复订阅",resuming:"正在恢复...",resumeSuccess:"订阅已恢复。",managePayment:"管理支付方式",openingPortal:"正在打开...",viewAllPlans:"查看所有套餐",scheduledCancellation:"订阅已安排取消",scheduledTrialCancellation:"试用已安排取消",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:"用量配额",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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:"您的订阅将于以下日期结束:",trialEndDescription:"您的试用将于以下日期结束:",cancelEndFallback:"您的订阅将在当前计费周期结束时取消,之后将不再收费。",resumeChargeDate:"将于以下日期再次收费:",resumeChargeFallback:"下一个计费日",resumeContinue:"您的订阅将自动继续,并按照套餐计费",resumeCancelAnytime:"如果您改变主意,可以在下一个计费日之前随时取消",retainAccess:"您将保留此套餐的完整访问权限直到",retainAccessFallback:"当前计费周期结束",noPlansAvailable:"此工作区没有可用的套餐组。如果您认为这是一个错误,请联系客服。",noPlansAvailableHint:"此工作区没有可用的套餐组。",startTrialDescription:"免费试用完整套餐,无需承诺。您可以随时升级或取消。",noSubscriptionDescription:"选择一个套餐来开始使用您的工作区",startFreeTrial:"开始免费试用",startTrialDays:"开始 {days} 天免费试用",trialBadge:"{days} 天试用"},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:"通知将发送到此设备。请在其他设备上单独启用。",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"包含 {count, number} 个(硬性限制)",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:"取消订阅推送通知失败"},permissions:{title:"权限",description:"配置每个角色在此工作区中的操作权限。",ownerOnly:"只有工作区拥有者才能管理权限。",save:"保存权限",saving:"正在保存...",saveSuccess:"权限保存成功"},credits:{title:"积分",description:"积分可用于 AI 生成等高级操作。",balance:"积分余额",available:"可用",totalGranted:"总授予",totalConsumed:"总消耗",totalExpired:"总过期",noCredits:"暂无积分",noCreditsHint:"当您的套餐授予或购买积分时,积分将显示在此处。",buyCredits:"购买积分",buyAmount:"Buy {count} Credits",purchasing:"正在跳转...",packages:"积分套餐包",noPackages:"没有可用的积分套餐包。",creditsAmount:"{count} 积分",validityDays:"有效期 {count} 天",validityUnlimited:"永不过期",transactions:"最近交易",noTransactions:"暂无交易记录。",loadMore:"Load More",viewAll:"查看全部",expiringSoon:"即将过期",expiringInDays:"{count} 积分将在 {days} 天内过期",noExpiring:"没有即将过期的积分。",type:{plan_grant:"套餐授予",pack_purchased:"已购买",consumed:"已消耗",expired:"已过期",admin_grant:"已授予",admin_revoke:"已撤销",refund:"退款"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"积分购买成功!您的余额已更新。",purchaseCanceled:"积分购买已取消,未产生任何费用。",purchaseFailed:"积分购买失败。请重试或联系客服。",errorLoading:"加载积分数据失败",insufficientCredits:"积分不足"},errors:{networkError:"网络错误:请检查您的网络连接",unauthorized:"未授权 — 请检查您的会话",notFound:"资源未找到",generic:"发生错误",fetchPlans:"获取套餐失败",fetchPlanGroup:"获取套餐组失败",fetchPlanGroupVersion:"获取套餐组版本失败",fetchPlanGroupVersions:"获取套餐组版本列表失败",fetchSubscription:"获取订阅信息失败",createCheckout:"创建结账会话失败",updateSubscription:"更新订阅失败",fetchInvoices:"获取账单失败",fetchInvoice:"获取账单失败",openBillingPortal:"打开账单门户失败",cancelSubscription:"取消订阅失败",resumeSubscription:"恢复订阅失败",recordUsage:"记录用量失败",fetchQuotaUsage:"获取配额使用状态失败",fetchAllQuotaUsage:"获取所有配额使用情况失败",fetchUsageLogs:"获取使用日志失败",fetchCreditBalance:"获取积分余额失败",consumeCredits:"消耗积分失败",purchaseCredits:"购买积分失败",fetchCreditPackages:"获取积分套餐包失败",fetchCreditTransactions:"获取积分交易记录失败",fetchExpiringCredits:"获取即将过期的积分失败"}}});var sN=Object.freeze({__proto__:null,hi:{settings:{titles:{profile:"खाता",general:"वर्कस्पेस सेटिंग्स",users:"वर्कस्पेस सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",credits:"क्रेडिट",features:"वर्कस्पेस फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},sidebar:{account:"खाता",workspace:"वर्कस्पेस",profile:"खाता",general:"सेटिंग्स",users:"सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",credits:"क्रेडिट",features:"फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},common:{refresh:"रीफ़्रेश",refreshing:"रीफ़्रेश हो रहा है...",retry:"पुनः प्रयास",retrying:"पुनः प्रयास हो रहा है...",save:"सहेजें",saving:"सहेजा जा रहा है...",cancel:"रद्द करें",delete:"हटाएँ",dismiss:"खारिज करें",loading:"लोड हो रहा है...",success:"सफल!",error:"त्रुटि",refreshAction:"{loading, select, true {रीफ़्रेश हो रहा है...} other {रीफ़्रेश}}",retryAction:"{loading, select, true {पुनः प्रयास हो रहा है...} other {पुनः प्रयास}}",noPermissionTitle:"पहुँच प्रतिबंधित",noPermissionDescription:"आपके पास इस अनुभाग तक पहुँचने की अनुमति नहीं है। यदि आपको पहुँच की आवश्यकता है तो कार्यक्षेत्र व्यवस्थापक से संपर्क करें।",billingManageOnly:"केवल बिलिंग प्रबंधन अनुमतियों वाले उपयोगकर्ता ही यह कार्य कर सकते हैं।"}},subscription:{managePlan:"अपना प्लान और बिलिंग प्रबंधित करें",changePlan:"प्लान बदलें",viewPricingPlans:"मूल्य निर्धारण प्लान देखें",viewPlans:"प्लान देखें",upgradePlan:"अभी अपग्रेड करें",subscribe:"सदस्यता लें",currentPlan:"वर्तमान प्लान",noSubscription:"आपके पास कोई सक्रिय सदस्यता नहीं है",choosePlan:"अपना प्लान चुनें",choosePlanDescription:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",forWorkspace:"{name} के लिए",planUpdateAvailable:"प्लान अपडेट उपलब्ध है",updateSuccess:"सदस्यता सफलतापूर्वक अपडेट हो गई!",updateFailed:"अपडेट विफल",cancelTitle:"सदस्यता रद्द करें",cancelConfirm:"क्या आप वाकई अपनी सदस्यता रद्द करना चाहते हैं?",cancelKeep:"सदस्यता बनाए रखें",cancelButton:"हाँ, सदस्यता रद्द करें",cancelTrialTitle:"ट्रायल रद्द करें",cancelTrialConfirm:"क्या आप वाकई अपना ट्रायल रद्द करना चाहते हैं?",cancelTrialAccess:"आपका ट्रायल इस तारीख तक जारी रहेगा",cancelTrialNoCharge:"आपसे कोई शुल्क नहीं लिया जाएगा — आपका ट्रायल बस समाप्त हो जाएगा",cancelTrialResume:"आप समाप्त होने से पहले कभी भी अपना ट्रायल फिर से शुरू कर सकते हैं",cancelTrialKeep:"ट्रायल बनाए रखें",cancelTrialButton:"हाँ, ट्रायल रद्द करें",canceling:"रद्द किया जा रहा है...",cancelSuccess:"बिलिंग अवधि के अंत में सदस्यता रद्द कर दी जाएगी।",cancelNotCharged:"रद्द करने के बाद आपसे दोबारा शुल्क नहीं लिया जाएगा",cancelResumeAnytime:"आप सदस्यता समाप्त होने से पहले कभी भी इसे फिर से शुरू कर सकते हैं",resumeTitle:"सदस्यता फिर से शुरू करें",resumeTrial:"ट्रायल फिर से शुरू करें",resumeConfirm:"क्या आप वाकई अपनी सदस्यता फिर से शुरू करना चाहते हैं?",resumeKeep:"रद्द रखें",resumeButton:"हाँ, सदस्यता फिर से शुरू करें",resuming:"फिर से शुरू हो रहा है...",resumeSuccess:"सदस्यता फिर से शुरू हो गई है।",managePayment:"भुगतान प्रबंधित करें",openingPortal:"खोला जा रहा है...",viewAllPlans:"सभी प्लान देखें",scheduledCancellation:"सदस्यता रद्द करने के लिए निर्धारित",scheduledTrialCancellation:"ट्रायल रद्द करने के लिए निर्धारित",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:"उपयोग कोटा",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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:"आपकी सदस्यता इस तारीख को समाप्त होगी",trialEndDescription:"आपका ट्रायल इस तारीख को समाप्त होगा",cancelEndFallback:"वर्तमान बिलिंग अवधि के अंत में आपकी सदस्यता रद्द कर दी जाएगी। आपसे दोबारा शुल्क नहीं लिया जाएगा।",resumeChargeDate:"आपसे फिर से शुल्क लिया जाएगा",resumeChargeFallback:"अगली बिलिंग तिथि",resumeContinue:"आपकी सदस्यता स्वचालित रूप से जारी रहेगी और आपसे आपके प्लान के अनुसार बिल लिया जाएगा",resumeCancelAnytime:"अगर आप अपना मन बदलते हैं तो अगली बिलिंग तिथि से पहले कभी भी रद्द कर सकते हैं",retainAccess:"आपके पास इस प्लान की पूर्ण पहुँच बनी रहेगी",retainAccessFallback:"आपकी वर्तमान बिलिंग अवधि के अंत तक",noPlansAvailable:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है। अगर आपको लगता है कि यह त्रुटि है तो कृपया सहायता से संपर्क करें।",noPlansAvailableHint:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है।",startTrialDescription:"बिना किसी प्रतिबद्धता के पूरा प्लान आज़माएँ। आप कभी भी अपग्रेड या रद्द कर सकते हैं।",noSubscriptionDescription:"अपने वर्कस्पेस के लिए एक प्लान चुनें",startFreeTrial:"मुफ़्त ट्रायल शुरू करें",startTrialDays:"{days} दिन का मुफ़्त ट्रायल शुरू करें",trialBadge:"{days} दिन का ट्रायल"},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:"सूचनाएँ इस डिवाइस पर भेजी जाती हैं। अन्य डिवाइसों पर अलग से सक्रिय करें।",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number} शामिल (सख्त सीमा)",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:"पुश सूचनाओं की सदस्यता रद्द करने में विफल"},permissions:{title:"अनुमतियाँ",description:"इस कार्यक्षेत्र में प्रत्येक भूमिका क्या कर सकती है, यह कॉन्फ़िगर करें।",ownerOnly:"केवल कार्यक्षेत्र का स्वामी ही अनुमतियाँ प्रबंधित कर सकता है।",save:"अनुमतियाँ सहेजें",saving:"सहेजा जा रहा है...",saveSuccess:"अनुमतियाँ सफलतापूर्वक सहेजी गईं"},credits:{title:"क्रेडिट",description:"क्रेडिट का उपयोग AI जनरेशन जैसी प्रीमियम कार्रवाइयों के लिए किया जा सकता है।",balance:"क्रेडिट शेष",available:"उपलब्ध",totalGranted:"कुल प्रदान किया गया",totalConsumed:"कुल उपभोग किया गया",totalExpired:"कुल समाप्त हुआ",noCredits:"अभी कोई क्रेडिट नहीं",noCreditsHint:"जब आपके प्लान द्वारा प्रदान किया जाएगा या खरीदा जाएगा तो क्रेडिट यहाँ दिखाई देंगे।",buyCredits:"क्रेडिट खरीदें",buyAmount:"Buy {count} Credits",purchasing:"रीडायरेक्ट हो रहा है...",packages:"क्रेडिट पैकेज",noPackages:"कोई क्रेडिट पैकेज उपलब्ध नहीं।",creditsAmount:"{count} क्रेडिट",validityDays:"{count} दिनों के लिए मान्य",validityUnlimited:"कोई समाप्ति नहीं",transactions:"हाल की लेनदेन",noTransactions:"अभी कोई लेनदेन नहीं।",loadMore:"Load More",viewAll:"सभी देखें",expiringSoon:"जल्द समाप्त हो रहे हैं",expiringInDays:"{count} क्रेडिट {days} दिनों में समाप्त हो रहे हैं",noExpiring:"कोई क्रेडिट जल्द समाप्त नहीं हो रहे।",type:{plan_grant:"प्लान अनुदान",pack_purchased:"खरीदा गया",consumed:"उपभोग किया गया",expired:"समाप्त",admin_grant:"प्रदान किया गया",admin_revoke:"वापस लिया गया",refund:"वापसी"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"क्रेडिट सफलतापूर्वक खरीदे गए! आपका शेष अपडेट कर दिया गया है।",purchaseCanceled:"क्रेडिट खरीदारी रद्द कर दी गई। कोई शुल्क नहीं लिया गया।",purchaseFailed:"क्रेडिट खरीदारी विफल रही। कृपया पुनः प्रयास करें या सहायता से संपर्क करें।",errorLoading:"क्रेडिट डेटा लोड करने में विफल",insufficientCredits:"पर्याप्त क्रेडिट नहीं"},errors:{networkError:"नेटवर्क त्रुटि: कृपया अपना इंटरनेट कनेक्शन जाँचें",unauthorized:"अनधिकृत - कृपया अपना सत्र जाँचें",notFound:"संसाधन नहीं मिला",generic:"एक त्रुटि हुई",fetchPlans:"प्लान लाने में विफल",fetchPlanGroup:"प्लान ग्रुप लाने में विफल",fetchPlanGroupVersion:"प्लान ग्रुप वर्शन लाने में विफल",fetchPlanGroupVersions:"प्लान ग्रुप वर्शन लाने में विफल",fetchSubscription:"सदस्यता लाने में विफल",createCheckout:"चेकआउट सत्र बनाने में विफल",updateSubscription:"सदस्यता अपडेट करने में विफल",fetchInvoices:"चालान लाने में विफल",fetchInvoice:"चालान लाने में विफल",openBillingPortal:"बिलिंग पोर्टल खोलने में विफल",cancelSubscription:"सदस्यता रद्द करने में विफल",resumeSubscription:"सदस्यता फिर से शुरू करने में विफल",recordUsage:"उपयोग दर्ज करने में विफल",fetchQuotaUsage:"कोटा उपयोग स्थिति लाने में विफल",fetchAllQuotaUsage:"सभी कोटा उपयोग लाने में विफल",fetchUsageLogs:"उपयोग लॉग लाने में विफल",fetchCreditBalance:"क्रेडिट शेष लाने में विफल",consumeCredits:"क्रेडिट उपभोग करने में विफल",purchaseCredits:"क्रेडिट खरीदने में विफल",fetchCreditPackages:"क्रेडिट पैकेज लाने में विफल",fetchCreditTransactions:"क्रेडिट लेनदेन लाने में विफल",fetchExpiringCredits:"समाप्त होने वाले क्रेडिट लाने में विफल"}}});var iN=Object.freeze({__proto__:null,ar:{settings:{titles:{profile:"الحساب",general:"إعدادات مساحة العمل",users:"أعضاء مساحة العمل",subscription:"الخطة والفوترة",usage:"الاستخدام",credits:"الرصيد",features:"ميزات مساحة العمل",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},sidebar:{account:"الحساب",workspace:"مساحة العمل",profile:"الحساب",general:"الإعدادات",users:"الأعضاء",subscription:"الخطة والفوترة",usage:"الاستخدام",credits:"الرصيد",features:"الميزات",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},common:{refresh:"تحديث",refreshing:"جارٍ التحديث...",retry:"إعادة المحاولة",retrying:"جارٍ إعادة المحاولة...",save:"حفظ",saving:"جارٍ الحفظ...",cancel:"إلغاء",delete:"حذف",dismiss:"تجاهل",loading:"جارٍ التحميل...",success:"تم بنجاح!",error:"خطأ",refreshAction:"{loading, select, true {جارٍ التحديث...} other {تحديث}}",retryAction:"{loading, select, true {جارٍ إعادة المحاولة...} other {إعادة المحاولة}}",noPermissionTitle:"الوصول مقيد",noPermissionDescription:"ليس لديك إذن للوصول إلى هذا القسم. تواصل مع مسؤول مساحة العمل إذا كنت بحاجة إلى الوصول.",billingManageOnly:"فقط المستخدمون الذين لديهم أذونات إدارة الفواتير يمكنهم تنفيذ هذا الإجراء."}},subscription:{managePlan:"إدارة خطتك وفوترتك",changePlan:"تغيير الخطة",viewPricingPlans:"عرض خطط الأسعار",viewPlans:"عرض الخطط",upgradePlan:"ترقية الآن",subscribe:"اشتراك",currentPlan:"الخطة الحالية",noSubscription:"ليس لديك اشتراك نشط",choosePlan:"اختر خطتك",choosePlanDescription:"قارن بين الخطط واختر ما يناسب احتياجاتك",forWorkspace:"لـ {name}",planUpdateAvailable:"تحديث الخطة متوفر",updateSuccess:"تم تحديث الاشتراك بنجاح!",updateFailed:"فشل التحديث",cancelTitle:"إلغاء الاشتراك",cancelConfirm:"هل أنت متأكد من رغبتك في إلغاء اشتراكك؟",cancelKeep:"الاحتفاظ بالاشتراك",cancelButton:"نعم، إلغاء الاشتراك",cancelTrialTitle:"إلغاء التجربة",cancelTrialConfirm:"هل أنت متأكد من رغبتك في إلغاء فترتك التجريبية؟",cancelTrialAccess:"ستستمر فترتك التجريبية حتى",cancelTrialNoCharge:"لن يتم تحصيل أي رسوم منك — ستنتهي فترتك التجريبية ببساطة",cancelTrialResume:"يمكنك استئناف فترتك التجريبية في أي وقت قبل انتهائها",cancelTrialKeep:"الاحتفاظ بالتجربة",cancelTrialButton:"نعم، إلغاء التجربة",canceling:"جارٍ الإلغاء...",cancelSuccess:"سيتم إلغاء الاشتراك في نهاية فترة الفوترة.",cancelNotCharged:"لن يتم تحصيل رسوم منك مرة أخرى بعد الإلغاء",cancelResumeAnytime:"يمكنك استئناف اشتراكك في أي وقت قبل انتهائه",resumeTitle:"استئناف الاشتراك",resumeTrial:"استئناف التجربة",resumeConfirm:"هل أنت متأكد من رغبتك في استئناف اشتراكك؟",resumeKeep:"إبقاء الإلغاء",resumeButton:"نعم، استئناف الاشتراك",resuming:"جارٍ الاستئناف...",resumeSuccess:"تم استئناف الاشتراك.",managePayment:"إدارة الدفع",openingPortal:"جارٍ الفتح...",viewAllPlans:"عرض جميع الخطط",scheduledCancellation:"تم جدولة إلغاء الاشتراك",scheduledTrialCancellation:"تم جدولة إلغاء التجربة",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:"حصص الاستخدام",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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:"سينتهي اشتراكك في",trialEndDescription:"ستنتهي فترتك التجريبية في",cancelEndFallback:"سيتم إلغاء اشتراكك في نهاية فترة الفوترة الحالية. لن يتم تحصيل رسوم منك مرة أخرى.",resumeChargeDate:"سيتم تحصيل الرسوم منك مرة أخرى في",resumeChargeFallback:"تاريخ الفوترة التالي",resumeContinue:"سيستمر اشتراكك تلقائياً وسيتم فوترتك وفقاً لخطتك",resumeCancelAnytime:"يمكنك الإلغاء في أي وقت قبل تاريخ الفوترة التالي إذا غيرت رأيك",retainAccess:"ستحتفظ بالوصول الكامل إلى هذه الخطة حتى",retainAccessFallback:"نهاية فترة الفوترة الحالية",noPlansAvailable:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه. يرجى الاتصال بالدعم إذا كنت تعتقد أن هذا خطأ.",noPlansAvailableHint:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه.",startTrialDescription:"جرب الخطة الكاملة بدون التزام. يمكنك الترقية أو الإلغاء في أي وقت.",noSubscriptionDescription:"اختر خطة للبدء مع مساحة العمل الخاصة بك",startFreeTrial:"ابدأ التجربة المجانية",startTrialDays:"ابدأ تجربة مجانية لمدة {days} يوم",trialBadge:"تجربة {days} يوم"},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:"يتم إرسال الإشعارات إلى هذا الجهاز. فعّلها على الأجهزة الأخرى بشكل منفصل.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number} مشمول (حد أقصى)",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:"فشل في إلغاء الاشتراك من الإشعارات الفورية"},permissions:{title:"الصلاحيات",description:"قم بتكوين ما يمكن لكل دور القيام به في مساحة العمل هذه.",ownerOnly:"يمكن لمالك مساحة العمل فقط إدارة الصلاحيات.",save:"حفظ الصلاحيات",saving:"جارٍ الحفظ...",saveSuccess:"تم حفظ الصلاحيات بنجاح"},credits:{title:"الرصيد",description:"يمكن استخدام الرصيد للإجراءات المميزة مثل التوليد بالذكاء الاصطناعي.",balance:"رصيد الائتمان",available:"متاح",totalGranted:"إجمالي الممنوح",totalConsumed:"إجمالي المستهلك",totalExpired:"إجمالي المنتهي",noCredits:"لا يوجد رصيد بعد",noCreditsHint:"سيظهر الرصيد هنا عند منحه من خطتك أو شرائه.",buyCredits:"شراء رصيد",buyAmount:"Buy {count} Credits",purchasing:"جارٍ إعادة التوجيه...",packages:"حزم الرصيد",noPackages:"لا تتوفر حزم رصيد.",creditsAmount:"{count} رصيد",validityDays:"صالح لمدة {count} يوم",validityUnlimited:"بدون انتهاء صلاحية",transactions:"المعاملات الأخيرة",noTransactions:"لا توجد معاملات بعد.",loadMore:"Load More",viewAll:"عرض الكل",expiringSoon:"ينتهي قريباً",expiringInDays:"{count} رصيد ينتهي خلال {days} يوم",noExpiring:"لا يوجد رصيد ينتهي قريباً.",type:{plan_grant:"منحة الخطة",pack_purchased:"تم الشراء",consumed:"مستهلك",expired:"منتهي",admin_grant:"ممنوح",admin_revoke:"مسحوب",refund:"استرداد"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"تم شراء الرصيد بنجاح! تم تحديث رصيدك.",purchaseCanceled:"تم إلغاء شراء الرصيد. لم يتم تحصيل أي رسوم.",purchaseFailed:"فشل شراء الرصيد. يرجى المحاولة مرة أخرى أو التواصل مع الدعم.",errorLoading:"فشل في تحميل بيانات الرصيد",insufficientCredits:"رصيد غير كافٍ"},errors:{networkError:"خطأ في الشبكة: يرجى التحقق من اتصالك بالإنترنت",unauthorized:"غير مصرح - يرجى التحقق من جلستك",notFound:"المورد غير موجود",generic:"حدث خطأ",fetchPlans:"فشل في جلب الخطط",fetchPlanGroup:"فشل في جلب مجموعة الخطط",fetchPlanGroupVersion:"فشل في جلب إصدار مجموعة الخطط",fetchPlanGroupVersions:"فشل في جلب إصدارات مجموعة الخطط",fetchSubscription:"فشل في جلب الاشتراك",createCheckout:"فشل في إنشاء جلسة الدفع",updateSubscription:"فشل في تحديث الاشتراك",fetchInvoices:"فشل في جلب الفواتير",fetchInvoice:"فشل في جلب الفاتورة",openBillingPortal:"فشل في فتح بوابة الفوترة",cancelSubscription:"فشل في إلغاء الاشتراك",resumeSubscription:"فشل في استئناف الاشتراك",recordUsage:"فشل في تسجيل الاستخدام",fetchQuotaUsage:"فشل في جلب حالة استخدام الحصص",fetchAllQuotaUsage:"فشل في جلب جميع استخدامات الحصص",fetchUsageLogs:"فشل في جلب سجلات الاستخدام",fetchCreditBalance:"فشل في جلب رصيد الائتمان",consumeCredits:"فشل في استهلاك الرصيد",purchaseCredits:"فشل في شراء الرصيد",fetchCreditPackages:"فشل في جلب حزم الرصيد",fetchCreditTransactions:"فشل في جلب معاملات الرصيد",fetchExpiringCredits:"فشل في جلب الرصيد المنتهي قريباً"}}});const oN={[Ta.Monthly]:"subscription.billingInterval.perMonth",[Ta.Quarterly]:"subscription.billingInterval.perQuarter",[Ta.Yearly]:"subscription.billingInterval.perYear"},cN=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case Ta.Yearly:n=t/12;break;case Ta.Quarterly:n=t/3;break;default:return null}const a=(e-n)/e*100;return a>0?Math.round(a):null};var lN=Object.freeze({__proto__:null,default:({open:r,onOpenChange:n,planVersions:a,currentPlanVersionId:s,currentStripePriceId:i,billingCurrency:o,currentMemberCount:c,trialUsedAt:l,workspaceName:d,initialInterval:u,initialCurrency:p,onSelectPlan:m,loading:h=!1})=>{const[f,g]=t.useState(!1),{t:b,formattingLocale:v,dir:y,fmtNum:x,fmtCents:w}=ln(),{settings:S}=An(),k=S?.workspace?.mode===LS,C=(e,t)=>null==e||0===e?"":w(e,t),E=e=>b(oN[e]??oN[Ta.Monthly]),[N,A]=t.useState(null),j=t.useRef(!1),_=t.useMemo(()=>ss(i,a),[i,a]),P=_?.interval??null,T=_?.currency??null,R=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]),D=t.useMemo(()=>{const e=o?.trim().toLowerCase();return e?R.includes(e)?[e]:[]:R},[o,R]),[I,M]=t.useState(u||P||Ta.Monthly),[U,L]=t.useState(()=>p&&D.includes(p)?p:T&&D.includes(T)?T:D.length>0?D[0]:""),O=o?.trim()||U;t.useEffect(()=>{if(r){M(u||P||Ta.Monthly);const e=p||T;e&&D.includes(e)?L(e):D.length>0&&!D.includes(U)&&L(D[0])}},[r,u,p,P,T,D]);const z=t.useMemo(()=>[...a],[a]),F=(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())})(z),B=F.filter(e=>e.type===Wa),W=F.filter(e=>e.type===Va),V=F.filter(e=>e.type===Ga),G=async e=>{if(!(e===s&&P===I||h||f||j.current)){j.current=!0,g(!0),A(e);try{await m(e,I,O),n(!1)}catch(e){}finally{j.current=!1,g(!1),A(null)}}},H=e=>rs(e,O,I),$=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===O.toLowerCase()),K=h||f,q=e=>{switch(e){case Ta.Monthly:return b("subscription.billingInterval.monthly");case Ta.Quarterly:return b("subscription.billingInterval.quarterly");case Ta.Yearly:return b("subscription.billingInterval.yearly");default:return b("subscription.billingInterval.monthly")}},Z=e=>{const t=e._id===s,r=P===I;if(t&&r)return{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0};if(t&&!r)return e.plan?.isFreemium?{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0}:{labelKey:"_dynamic",dynamicLabel:b("subscription.switchToInterval",{interval:q(I)}),variant:"default",disabled:!1};const n=e.trial?.enabled&&e.trial.durationDays>0&&!l&&!i;if(!s)return n?{labelKey:"_dynamic",dynamicLabel:b("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.subscribe",variant:"default",disabled:!1};const a=z.findIndex(e=>e._id===s),o=z.findIndex(t=>t._id===e._id);return-1===a||-1===o?n?{labelKey:"_dynamic",dynamicLabel:b("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}:o<a?{labelKey:"subscription.checkout.downgrade",variant:"outline",disabled:!1}:o>a?n?{labelKey:"_dynamic",dynamicLabel:b("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.upgrade",variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}},J=(e,t,r=Ta.Monthly)=>{if(t.type===Wa)return e.features?.[t.slug]??!1;if(t.type===Va)return e.limits?.[t.slug]??null;if(t.type===Ga){const n=as(e,O,t.slug,r);return n||MS(e.quotas?.[t.slug],r)}return null},Y=(e,t,r)=>{if(t.type===Wa)return!0===e?"✓":"—";if(t.type===Va)return null!=e&&"number"==typeof e?x(e):"—";if(t.type===Ga){const n=US("object"==typeof e&&null!==e&&"included"in e?e:null,t.name.toLowerCase(),{currency:r,locale:v});return n?n.allowOverage?n.hasOverage?b("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):b("quota.includedOnly",{count:n.included}):b("quota.includedHardLimit",{count:n.included}):"—"}return"—"};return e.jsx(tl,{open:r,onOpenChange:n,children:e.jsxs(sl,{dir:y,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(ol,{className:"text-xl sm:text-2xl font-bold",children:b("pricing.title")}),e.jsxs(cl,{className:"mt-1 text-sm",children:[b("subscription.choosePlanDescription"),d&&e.jsx("span",{className:"ml-1 font-medium text-foreground",children:b("subscription.forWorkspace",{name:d})})]})]}),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()&&D.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-slate-600",children:b("pricing.currency")}),e.jsx("select",{"aria-label":b("pricing.selectCurrency"),value:U,onChange:e=>L(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:D.map(t=>{const r=Cl(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:b("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":b("pricing.billingInterval"),children:[Ta.Monthly,Ta.Quarterly,Ta.Yearly].map(t=>{const r=P===t;return e.jsx("button",{onClick:()=>M(t),"aria-pressed":I===t,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(I===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===Ta.Monthly&&b("subscription.billingInterval.monthly"),t===Ta.Quarterly&&b("subscription.billingInterval.quarterly"),t===Ta.Yearly&&b("subscription.billingInterval.yearly"),t===Ta.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:b("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:b("pricing.current")})]})},t)})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:o?.trim()&&0===D.length?e.jsxs("div",{className:"text-center py-12 px-4",children:[e.jsx("p",{className:"text-slate-600 font-medium",children:b("pricing.noPlansCurrency")}),e.jsx("p",{className:"text-slate-500 text-sm mt-2",children:b("pricing.noPlansCurrencyHint")})]}):0===z.length?e.jsx("div",{className:"text-center py-12 text-gray-500",children:e.jsx("p",{children:b("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:z.map(t=>{const r=t._id===s,n=Z(t),a=K&&t._id===N,o=H(t),d=$(t),u=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===O.toLowerCase())?O:t.plan?.currency??O??"",p=rs(t,O,Ta.Monthly)??0,m=I!==Ta.Monthly&&null!==o?cN(p,o,I):null,h=is(t,O),f=h?os(t,O,I):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.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900",children:t.plan.name}),t.trial?.enabled&&t.trial.durationDays>0&&!r&&!l&&!i&&e.jsx("span",{className:"shrink-0 rounded-md bg-emerald-100 text-emerald-700 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider",children:b("subscription.trialBadge",{days:t.trial.durationDays})})]}),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:b("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:d&&null!==o||d?C(o,u)||b("pricing.free"):"—"}),null!==o&&o>0&&d&&e.jsx("span",{className:"text-sm text-slate-500",children:E(I)})]}),null!==m&&m>0&&d&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium",children:b("subscription.savingsPercent",{percent:m})}),h?.enabled&&f&&f>0&&!k&&e.jsx("div",{className:"text-xs text-slate-500 mt-1",children:b("subscription.seatPriceDisplay",{price:w(f,u),interval:E(I),included:x(h.includedSeats),includedLabel:b("pricing.included")})})]}),B.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:b("subscription.items.features")}),e.jsx("div",{className:"space-y-1",children:B.map(r=>{const n=J(t,r,I),a=r.type===Wa&&!0===n;return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.type===Wa?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)})})]}),W.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:b("subscription.items.limits")}),e.jsx("div",{className:"space-y-1",children:W.map(r=>{const n=J(t,r,I);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?x(n):"—"})]},r._id)})})]}),h?.enabled&&!k&&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:b("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:b("subscription.seats.included")}),e.jsx("span",{className:"font-medium",children:x(h.includedSeats||0)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.seats.maxSeats")}),e.jsx("span",{className:"font-medium",children:(h?.maxSeats??0)>0?x(h.maxSeats):b("subscription.seats.unlimited")})]}),null!=c&&c>0&&(()=>{const t=Math.max(0,c-(h.includedSeats||0));return e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.seats.billable")}),e.jsx("span",{className:"font-medium "+(0===t?"text-emerald-600":"text-amber-600"),children:0===t?b("subscription.seats.allIncluded"):`${x(t)} ${b("subscription.seats.extra")}`})]})})()]})]}),t.creditGrant?.enabled&&"object"==typeof t.creditGrant.creditPackage&&null!==t.creditGrant.creditPackage&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-purple-600 uppercase tracking-wider mb-1.5",children:b("subscription.items.credits")}),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:t.creditGrant.renewOnPeriod?b("subscription.items.creditsPerMonth"):b("subscription.items.creditsOneTime")}),e.jsx("span",{className:"font-semibold text-purple-700",children:x(t.creditGrant.creditPackage.creditAmount)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.items.creditRenewal")}),e.jsx("span",{className:"font-medium text-slate-700",children:t.creditGrant.renewOnPeriod?"reset"===t.creditGrant.mode?b("subscription.items.creditModeReset"):b("subscription.items.creditModeTopup"):b("subscription.items.creditModeLifetime")})]})]})]}),e.jsx(xi,{className:"w-full mt-2",variant:n.variant,disabled:n.disabled||K||!d,progress:a,onClick:()=>G(t._id),children:a?b("pricing.processing"):d?n.dynamicLabel??b(n.labelKey):b("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:260+220*z.length+"px",borderCollapse:"separate"},children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:260,minWidth:260}}),z.map(t=>e.jsx("col",{style:{width:220,minWidth:220}},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"}),z.map(t=>{const r=t._id===s,n=Z(t),a=K&&t._id===N,o=H(t),c=rs(t,O,Ta.Monthly)??0,d=I!==Ta.Monthly&&null!==o?cN(c,o,I):null,u=$(t),p=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===O.toLowerCase())?O:t.plan?.currency??O??"";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-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("h3",{className:"text-base font-bold text-slate-900 truncate",children:t.plan.name}),t.trial?.enabled&&t.trial.durationDays>0&&!r&&!l&&!i&&e.jsx("span",{className:"shrink-0 rounded-md bg-emerald-100 text-emerald-700 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider",children:b("subscription.trialBadge",{days:t.trial.durationDays})})]}),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:b("pricing.current")})]}),e.jsxs("div",{className:"flex flex-col items-start min-h-[3rem]",children:[e.jsxs("div",{className:"flex items-baseline gap-1 flex-wrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:u&&null!==o||u?C(o,p)||b("pricing.free"):"—"}),null!==o&&o>0&&u&&e.jsx("span",{className:"text-sm text-slate-500",children:E(I)}),null!==d&&d>0&&u&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold whitespace-nowrap",children:b("subscription.savingsPercent",{percent:d})})]}),(()=>{if(k)return null;const r=is(t,O);if(!r)return null;const n=os(t,O,I);return!n||n<=0?null:e.jsx("div",{className:"text-[11px] text-slate-500 mt-1.5 border-t border-slate-100 pt-1 leading-tight",children:e.jsx("div",{children:b("subscription.seatPriceDisplay",{price:w(n,p),interval:E(I),included:x(r.includedSeats),includedLabel:b("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(xi,{className:"mt-auto w-full",variant:n.variant,disabled:n.disabled||K||!u,progress:a,onClick:()=>G(t._id),children:a?b("pricing.processing"):u?n.dynamicLabel??b(n.labelKey):b("pricing.unavailable")})]})},t._id)})]})}),e.jsxs("tbody",{children:[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:b("subscription.items.features")}),e.jsx("td",{colSpan:z.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})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?O:r.plan?.currency??O??"",i=Y(n,t,a),o=t.type===Wa&&!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))]}),W.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:b("subscription.items.limits")}),e.jsx("td",{colSpan:z.length,className:"border-t border-slate-200 bg-slate-100"})]}),W.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})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?O:r.plan?.currency??O??"",i=Y(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))]}),V.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:b("subscription.items.quotas")}),e.jsx("td",{colSpan:z.length,className:"border-t border-slate-200 bg-slate-100"})]}),V.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})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?O:r.plan?.currency??O??"",i=Y(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))]}),!k&&z.some(e=>{const t=is(e,O);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:b("subscription.seats.title")}),e.jsx("td",{colSpan:z.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:b("subscription.seats.includedSeats")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:b("subscription.seats.freeWithBase")})]}),z.map(t=>{const r=is(t,O);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?x(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:b("subscription.seats.maxSeats")})}),z.map(t=>{const r=is(t,O);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)>0?x(r.maxSeats):b("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:b("subscription.seats.perExtraSeat")})}),z.map(t=>{const r=os(t,O,I),n=t.pricingVariants?.length?O:t.plan?.currency??O??"";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?`${w(r,n)}${E(I)}`:"—"})},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:b("subscription.seats.billable")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:b("subscription.membersInWorkspace",{count:c})})]}),z.map(t=>{const r=is(t,O);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:b("subscription.seats.allIncluded")}):e.jsxs("span",{className:"text-sm font-medium text-amber-600",children:[x(a)," ",b("subscription.seats.extra")]})},t._id)})]})]}),z.some(e=>e.creditGrant?.enabled&&"object"==typeof e.creditGrant.creditPackage&&null!==e.creditGrant.creditPackage)&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-purple-200 bg-purple-50 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-purple-700 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:b("subscription.items.credits")}),e.jsx("td",{colSpan:z.length,className:"border-t border-purple-200 bg-purple-50"})]}),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:z.every(e=>!e.creditGrant?.enabled||!e.creditGrant.renewOnPeriod)?b("subscription.items.creditsOneTime"):b("subscription.items.creditsPerMonth")})}),z.map(t=>{const r=t.creditGrant,n=r?.enabled&&"object"==typeof r.creditPackage&&null!==r.creditPackage?r.creditPackage:null;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:n?e.jsx("span",{className:"text-sm font-semibold text-purple-700",children:x(n.creditAmount)}):e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},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:b("subscription.items.creditRenewal")})}),z.map(t=>{const r=t.creditGrant;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:r?.enabled?e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r.renewOnPeriod?"reset"===r.mode?b("subscription.items.creditModeReset"):b("subscription.items.creditModeTopup"):b("subscription.items.creditModeLifetime")}):e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},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:d}=ln(),[u,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}=ln(),r=En(),[n,a]=t.useState(null),[s,i]=t.useState(!0),[o,c]=t.useState(!1),[l,d]=t.useState(null),[u,p]=t.useState(!1),[m,h]=t.useState(null);return t.useEffect(()=>{let t=!1;return(async()=>{i(!0),d(null);try{const e=new mE(r),n=await e.fetchConfig();t||a(n)}catch(r){t||d(r instanceof Error?r.message:e("beta.errorMessage"))}finally{t||i(!1)}})(),()=>{t=!0}},[r]),{isLoading:s,isSubmitting:o,config:n,error:l,success:u,message:m,submitBetaForm:t.useCallback(async t=>{if(!r){const t=e("errors.generic");return d(t),{success:!1,message:t}}try{c(!0),d(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 d(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=cp({resolver:bf(hE),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(jl,{className:"h-24 w-24 rounded-lg"}),e.jsx(jl,{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(jl,{className:"h-4 w-16"}),e.jsx(jl,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(jl,{className:"h-4 w-16"}),e.jsx(jl,{className:"h-10 w-full"})]}),e.jsx(jl,{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(gE,{logo:y?.logo}),y?.name&&e.jsx("div",{children:y?.name})]}),e.jsx(Nu,{...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:d("beta.errorMessage")),h(!0)}}),className:a,noValidate:!0,"aria-busy":b,children:[!m&&e.jsxs(e.Fragment,{children:[!l&&y?.screen?.register&&e.jsx(fE,{screen:y?.screen?.register}),e.jsx(Fg,{control:S.control,name:"name",render:({field:t})=>e.jsxs(Vg,{className:s,children:[e.jsx(Gg,{children:d("beta.nameLabel")}),e.jsx(Hg,{children:e.jsx(qg,{...t})}),e.jsx($g,{}),e.jsx(Kg,{})]})}),e.jsx(Fg,{control:S.control,name:"email",render:({field:t})=>e.jsxs(Vg,{className:s,children:[e.jsx(Gg,{children:d("beta.emailLabel")}),e.jsx(Hg,{children:e.jsx(qg,{...t})}),e.jsx($g,{}),e.jsx(Kg,{})]})}),e.jsx(xi,{type:"submit",disabled:!k,className:s,children:d(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":d("settings.common.error"),children:"❗"}),v]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(xi,{type:"button",onClick:()=>{h(!1),S.reset()},className:s,children:d("beta.tryAgain")})})]}),m&&u&&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(fE,{screen:y?.screen?.thankYou})})]})}),!m&&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.CreditActionsProvider=iE,exports.CreditBalance=oE,exports.CreditBalanceContextProvider=ta,exports.CreditStorePage=function({children:r,loadingFallback:n,errorFallback:a,redirectBaseUrl:s}){const{packages:i,notes:o,loading:c,error:l,refetch:d}=Qn(),{isAuthenticated:u,signIn:p}=_C(),m=t.useCallback(e=>{if(u)CC.openWorkspaceSettings(yC.Credits,{action:xa,packageId:e});else if(s){const t=Aa({action:xa,screen:"credits",packageId:e},s);p(t)}else p()},[u,p,s]);return c?void 0!==n?e.jsx(e.Fragment,{children:n}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(jl,{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(jl,{className:"h-48 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,packages:i,notes:o,refetch:d,selectPackage:m})})},exports.PricingPage=function({slug:r,children:n,loadingFallback:a,errorFallback:s,redirectBaseUrl:i}){const{items:o,plans:c,notes:l,loading:d,error:u,refetch:p}=_n(r),{isAuthenticated:m,signIn:h}=_C(),f=t.useCallback((e,t,r)=>i?Aa({action:"selectPlan",plan:e,interval:t,currency:r},i):null,[i]),g=t.useCallback((e,t,r)=>{if(m)return void CC.openWorkspaceSettings(yC.Subscription,{action:"selectPlan",plan:e,interval:t,currency:r});const n=f(e,t,r);h(n??void 0)},[m,h,f]);return d?void 0!==a?e.jsx(e.Fragment,{children:a}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(jl,{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(jl,{className:"h-64 rounded-lg"},t))})]}):u?s?e.jsx(e.Fragment,{children:s(u)}):e.jsx("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:u}):e.jsx(e.Fragment,{children:n({loading:d,error:u,items:o,plans:c,notes:l,refetch:p,selectPlan:g})})},exports.PushNotificationProvider=Lv,exports.QuotaUsageContextProvider=oa,exports.SETTINGS_SCREENS=xC,exports.SUPPORTED_LOCALES=Xr,exports.SaaSOSProvider=zC,exports.SettingsScreen=yC,exports.SubscriptionContextProvider=Wn,exports.WhenAuthenticated=FC,exports.WhenCreditsAvailable=cE,exports.WhenCreditsExhausted=lE,exports.WhenCreditsLow=dE,exports.WhenNoSubscription=YC,exports.WhenNotTrialing=eE,exports.WhenPermission=GC,exports.WhenQuotaAvailable=rE,exports.WhenQuotaExhausted=nE,exports.WhenQuotaOverage=aE,exports.WhenQuotaThreshold=sE,exports.WhenRoles=WC,exports.WhenSubscription=JC,exports.WhenSubscriptionToPlans=XC,exports.WhenTrialEnding=tE,exports.WhenTrialing=QC,exports.WhenUnauthenticated=BC,exports.WhenUserFeatureDisabled=ZC,exports.WhenUserFeatureEnabled=qC,exports.WhenWorkspaceFeatureDisabled=KC,exports.WhenWorkspaceFeatureEnabled=$C,exports.WhenWorkspaceRoles=VC,exports.WorkspaceSwitcher=function(r){const{t:n,dir:a}=ln(),{isAuthenticated:s,user:i}=_C(),o=rt(En()),{workspaces:c,currentWorkspace:l,loading:d,refreshing:u,switchingToId:p,fetchWorkspaces:m,getFeatures:h,refreshWorkspaces:f,setCurrentWorkspace:g,switchToWorkspace:b}=EC(),{settings:v}=An(),[y,x]=t.useState(!1),[w,S]=t.useState(0),[k,C]=t.useState(""),E=d||u;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,_=v?.workspace?.showSwitcher??!0,P=v?.workspace?.maxWorkspacesPerUser??0,T=N?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===i?.id?.toString()).length??0,R=!1!==j&&(0===P||T<P);return t.useEffect(()=>{!_&&c.length>0&&!l&&b(c[0]).catch(e=>{Te(e,{component:"WorkspaceProvider",action:"autoSelectWorkspace"})})},[_,c,l]),!_&&l?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>x(!0),children:r.trigger?.(E,l)}),e.jsx(SC,{workspace:l,open:y,onOpenChange:x,showTrigger:!1})]}):e.jsxs(tl,{open:y,onOpenChange:x,children:[e.jsx(rl,{children:r.trigger?.(E,l)}),e.jsxs(sl,{dir:a,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(il,{dir:a,children:[e.jsxs(ol,{className:"flex items-center gap-2",children:[e.jsx(_s,{className:"h-5 w-5"}),n("workspace.switchTitle")]}),e.jsx(cl,{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(XE,{workspace:l,isCurrentWorkspace:!0,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N}),e.jsx(YE,{}),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(xi,{progress:u,disabled:u,variant:"ghost",onClick:function(){s&&o&&S(e=>e+1)},startIcon:e.jsx(Gs,{}),children:n("settings.common.refreshAction",{loading:String(u)})})})]}),e.jsxs("div",{className:"relative",children:[e.jsx($s,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(qg,{placeholder:n("workspace.searchPlaceholder"),value:k,onChange:e=>C(e.target.value),className:"ps-10"})]}),d?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx(Bs,{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(_s,{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(_v,{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(XE,{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(YE,{}),e.jsx(QE,{onCreated:()=>{m()}})]})]})]})]})},exports.useAllQuotaUsage=Fn,exports.useBillingPortal=Ln,exports.useCancelSubscription=On,exports.useConsumeCredits=qn,exports.useCreateCheckoutSession=Dn,exports.useCreditBalance=Kn,exports.useCreditBalanceContext=ra,exports.useCreditPackages=Jn,exports.useCreditTransactions=Yn,exports.useExpiringCredits=Xn,exports.useInvoice=(e,r)=>{const{t:n}=ln(),{api:a}=jn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e&&r){c(!0),d(null);try{const t=await a.getInvoice(e,r);i(t.invoice)}catch(t){const a=De(t,"errors.fetchInvoice",n);d(a),Te(t,{component:"useInvoice",action:"fetchInvoice",metadata:{workspaceId:e,invoiceId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{invoice:s,loading:o,error:l,refetch:u}},exports.useInvoices=Un,exports.usePermissions=wl,exports.usePlanGroup=Tn,exports.usePlanGroupVersions=Rn,exports.usePublicCreditPackages=Qn,exports.usePublicPlanGroupVersion=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersion(e);s(t)}catch(t){const n=De(t,"errors.fetchPlanGroupVersion",r);l(n),Te(t,{component:"usePublicPlanGroupVersion",action:"fetchVersion",metadata:{groupVersionId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{planGroupVersion:a,loading:i,error:c,refetch:d}},exports.usePublicPlans=_n,exports.usePurchaseCredits=Zn,exports.usePushNotifications=Ov,exports.useQuotaUsageContext=ca,exports.useQuotaUsageStatus=(e,r)=>{const{t:n}=ln(),{api:a}=jn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e&&r){c(!0),d(null);try{const t=await a.getQuotaUsageStatus(e,r);i(t)}catch(t){const a=De(t,"errors.fetchQuotaUsage",n);d(a),Te(t,{component:"useQuotaUsageStatus",action:"fetchStatus",metadata:{workspaceId:e,quotaSlug:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{status:s,loading:o,error:l,refetch:u}},exports.useRecordUsage=e=>{const{t:r}=ln(),{api:n}=jn(),[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 It(),r}catch(n){const a=De(n,"errors.recordUsage",r);throw o(a),Te(n,{component:"useRecordUsage",action:"recordUsage",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},exports.useResumeSubscription=zn,exports.useSaaSAuth=_C,exports.useSaaSOs=En,exports.useSaaSSettings=An,exports.useSaaSWorkspaces=EC,exports.useSeatStatus=mC,exports.useSubscription=Pn,exports.useSubscriptionContext=Vn,exports.useSubscriptionManagement=Mn,exports.useTranslation=ln,exports.useTrialStatus=function(){const{response:e}=Vn();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=uE(t.trialEnd)??uE(t.stripeCurrentPeriodEnd),n=uE(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=In,exports.useUsageLogs=(e,r,n)=>{const{t:a}=ln(),{api:s}=jn(),[i,o]=t.useState([]),[c,l]=t.useState(0),[d,u]=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,C=n?.source,E=n?.page,N=n?.limit,A=t.useCallback(async()=>{if(!e)return o([]),l(0),u(0),m(1),f(!1),void b(!1);y(!0),w(null);try{const t={...r&&{quotaSlug:r},...S&&{from:S},...k&&{to:k},...C&&{source:C},...E&&{page:E},...N&&{limit:N}},n=await s.getUsageLogs(e,t);o(n.docs||[]),l(n.totalDocs||0),u(n.totalPages||0),m(n.page||1),f(n.hasNextPage||!1),b(n.hasPrevPage||!1)}catch(t){const n=De(t,"errors.fetchUsageLogs",a);w(n),Te(t,{component:"useUsageLogs",action:"fetchLogs",metadata:{workspaceId:e,quotaSlug:r}})}finally{y(!1)}},[s,e,r,S,k,C,E,N]);return t.useEffect(()=>{A()},[A]),{logs:i,totalDocs:c,totalPages:d,page:p,hasNextPage:h,hasPrevPage:g,loading:v,error:x,refetch:A}},exports.useUserAttributes=function(){const e=t.useContext(DC);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e},exports.useUserFeatures=HC;
36
+ */function TE(){return jE||(jE=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,d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,d){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 u=d();if(!l){var p=d();n(u,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}var m=(p=a({inst:{value:u,getSnapshot:d}}))[0].inst,h=p[1];return i(function(){m.value=u,m.getSnapshot=d,e(m)&&h({inst:m})},[t,u,d]),s(function(){return e(m)&&h({inst:m}),t(function(){e(m)&&h({inst:m})})},[t]),o(u),u};PE.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:d,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),PE}function RE(){return _E||(_E=1,"production"===process.env.NODE_ENV?EE.exports=AE():EE.exports=TE()),EE.exports}var DE=RE();function IE(){return()=>{}}var ME="Avatar",[UE]=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,d=a.useMemo(()=>c,Object.values(c));return e.jsx(l.Provider,{value:d,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}\``)}]},SE(s,...r)]}(ME),[LE,OE]=UE(ME),zE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,...s}=t,[i,o]=a.useState("idle");return e.jsx(LE,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:e.jsx(CE.span,{...s,ref:r})})});zE.displayName=ME;var FE="AvatarImage",BE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:i=()=>{},...o}=t,c=OE(FE,n),l=function(e,{referrerPolicy:t,crossOrigin:r}){const n=DE.useSyncExternalStore(IE,()=>!0,()=>!1),s=a.useRef(null),i=n?(s.current||(s.current=new window.Image),s.current):null,[o,c]=a.useState(()=>GE(i,e));return _i(()=>{c(GE(i,e))},[i,e]),_i(()=>{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),d=zi(e=>{i(e),c.onImageLoadingStatusChange(e)});return _i(()=>{"idle"!==l&&d(l)},[l,d]),"loaded"===l?e.jsx(CE.img,{...o,ref:r,src:s}):null});BE.displayName=FE;var WE="AvatarFallback",VE=a.forwardRef((t,r)=>{const{__scopeAvatar:n,delayMs:s,...i}=t,o=OE(WE,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(CE.span,{...i,ref:r}):null});function GE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}VE.displayName=WE;var HE=zE,$E=BE,KE=VE;const qE=a.forwardRef(({className:t,...r},n)=>e.jsx(HE,{ref:n,className:Se("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...r}));qE.displayName=HE.displayName;const ZE=a.forwardRef(({className:t,...r},n)=>e.jsx($E,{ref:n,className:Se("aspect-square h-full w-full",t),...r}));ZE.displayName=$E.displayName;const JE=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}));JE.displayName=KE.displayName;var YE=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,r)=>{const n=gi(`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}},{}),XE="horizontal",QE=["horizontal","vertical"],eN=a.forwardRef((t,r)=>{const{decorative:n,orientation:a=XE,...s}=t,i=function(e){return QE.includes(e)}(a)?a:XE,o=n?{role:"none"}:{"aria-orientation":"vertical"===i?i:void 0,role:"separator"};return e.jsx(YE.div,{"data-orientation":i,...o,...s,ref:r})});eN.displayName="Separator";var tN=eN;const rN=a.forwardRef(({className:t,orientation:r="horizontal",decorative:n=!0,...a},s)=>e.jsx(tN,{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 nN(t){const{t:r}=ln(),{workspace:n,setCurrentWorkspace:a,setOpen:s,workspacesToUse:i,switchingToId:o}=t,c=t.isCurrentWorkspace??!1,l=o===n._id,d=n.subscription??null,u=null!=d&&"object"==typeof d?d.plan??null:null,p=u?.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(qE,{className:"h-8 w-8 flex items-center justify-center",children:[e.jsx("div",{children:e.jsx(ZE,{src:n.image&&n.image.trim()?n.image:void 0})}),e.jsx(JE,{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(li,{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(Ei,{size:"sm",disabled:null!==o||l,progress:l,onClick:()=>{t.switchToWorkspace(n).then(()=>s(!1)).catch(e=>{Te(e,{component:"WorkspaceItem",action:"switchToWorkspace",metadata:{workspaceId:n._id}})})},children:r("workspace.switchTo")}),e.jsx(AC,{workspace:n,onClose:()=>{if(c){const e=i.findIndex(e=>e._id?.toString()===n._id?.toString());-1!==e&&a(i[e])}}})]})]});var m}function aN(r){const{t:n,dir:a}=ln(),{switching:s}=PC(),[i,o]=t.useState(!1),[c,l]=t.useState("emoji"),[d,u]=t.useState("🏢"),[p,m]=t.useState(!1),{createWorkspace:h}=PC(),f=mp({resolver:Sf(xg({name:Kf().min(2,{message:n("workspace.workspaceNameMinLength")}),image:Kf().optional()})),defaultValues:{name:"",image:""}});return e.jsxs(il,{open:i,onOpenChange:o,children:[e.jsx(ol,{asChild:!0,children:e.jsxs(Ei,{className:"w-full rounded-none",disabled:s,children:[e.jsx(qs,{className:"h-4 w-4 me-2"}),n("workspace.createNew")]})}),e.jsxs(dl,{dir:a,className:"max-w-xl min-w-full sm:min-w-[600px]",children:[e.jsxs(ul,{children:[e.jsx(pl,{children:n("workspace.createTitle")}),e.jsx(ml,{children:n("workspace.createDescription")})]}),e.jsx(Vg,{...f,children:e.jsxs("form",{onSubmit:f.handleSubmit(async function(e){let t="";if("emoji"===c)t=Uv(d);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(),u("🏢"),l("emoji"),r?.onCreated?.()}catch(t){Te(t,{component:"WorkspaceProvider",action:"createWorkspace",metadata:{name:e.name}})}finally{m(!1)}}),children:[e.jsx(Hg,{control:f.control,name:"name",render:({field:t})=>e.jsxs(qg,{children:[e.jsx(Zg,{children:n("workspace.workspaceName")}),e.jsx(Jg,{children:e.jsx(Qg,{placeholder:n("workspace.workspaceNamePlaceholder"),...t})}),e.jsx(Xg,{})]})}),e.jsxs("div",{className:"flex flex-col gap-y-2 my-2",children:[e.jsxs("div",{children:[e.jsx(Wg,{className:"text-sm font-medium",children:n("workspace.workspaceIcon")}),e.jsx(Yg,{children:n("workspace.iconDescription")})]}),e.jsxs(Zb,{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(Jb,{value:"emoji",id:"emoji"}),e.jsxs(Wg,{htmlFor:"emoji",className:"flex items-center gap-2",children:[e.jsx(ni,{className:"h-4 w-4"}),n("workspace.chooseEmoji")]})]}),e.jsxs("div",{className:"flex items-center gap-x-2 my-1",children:[e.jsx(Jb,{value:"url",id:"url"}),e.jsxs(Wg,{htmlFor:"url",className:"flex items-center gap-2",children:[e.jsx(Hs,{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:d})]}),e.jsx(Iv,{className:"h-32 w-full rounded-md border",children:e.jsx("div",{className:"p-4 grid grid-cols-8 gap-2",children:Lv.map((t,r)=>e.jsx("button",{type:"button",onClick:()=>(e=>{u(e),f.setValue("image",Uv(e))})(t),className:"w-8 h-8 rounded flex items-center justify-center text-lg hover:bg-muted transition-colors "+(d===t?"bg-primary text-primary-foreground":""),children:t},r))})})]}),"url"===c&&e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsx(Hg,{control:f.control,name:"image",render:({field:t})=>e.jsxs(qg,{children:[e.jsx(Zg,{children:n("workspace.imageUrl")}),e.jsx(Jg,{children:e.jsx(Qg,{placeholder:n("workspace.imageUrlPlaceholder"),...t})}),e.jsx(Yg,{children:n("workspace.imageUrlDescription")}),e.jsx(Xg,{})]})}),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(Ei,{type:"button",variant:"outline",onClick:()=>{o(!1),f.reset(),u("🏢"),l("emoji")},disabled:p,children:n("settings.common.cancel")}),e.jsx(Ei,{type:"submit",disabled:p,children:p?e.jsxs(e.Fragment,{children:[e.jsx($s,{className:"me-2 h-4 w-4 animate-spin"}),n("workspace.creating")]}):n("workspace.createWorkspace")})]})]})})]})]})}rN.displayName=tN.displayName;var sN=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",credits:"Créditos",features:"Funciones del espacio de trabajo",notifications:"Notificaciones",permissions:"Permisos",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",credits:"Créditos",features:"Funciones",notifications:"Notificaciones",permissions:"Permisos",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}}",noPermissionTitle:"Acceso restringido",noPermissionDescription:"No tienes permiso para acceder a esta sección. Contacta a un administrador del espacio de trabajo si necesitas acceso.",billingManageOnly:"Solo los usuarios con permisos de gestión de facturación pueden realizar esta acción."}},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",forWorkspace:"para {name}",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",cancelTrialTitle:"Cancelar prueba",cancelTrialConfirm:"¿Estás seguro de que deseas cancelar tu período de prueba?",cancelTrialAccess:"Tu período de prueba continuará hasta",cancelTrialNoCharge:"No se te cobrará — tu período de prueba simplemente expirará",cancelTrialResume:"Puedes reanudar tu prueba en cualquier momento antes de que termine",cancelTrialKeep:"Mantener prueba",cancelTrialButton:"Sí, cancelar prueba",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",resumeTrial:"Reanudar prueba",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",scheduledTrialCancellation:"Cancelación de prueba 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",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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",trialEndDescription:"Tu período de prueba 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",startTrialDays:"Comenzar prueba gratuita de {days} días",trialBadge:"Prueba de {days} días"},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.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number} incluidos (límite estricto)",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"},permissions:{title:"Permisos",description:"Configura lo que cada rol puede hacer en este espacio de trabajo.",ownerOnly:"Solo el propietario del espacio de trabajo puede gestionar los permisos.",save:"Guardar permisos",saving:"Guardando...",saveSuccess:"Permisos guardados correctamente"},credits:{title:"Créditos",description:"Los créditos se pueden usar para acciones premium como la generación con IA.",balance:"Saldo de créditos",available:"Disponible",totalGranted:"Total otorgado",totalConsumed:"Total consumido",totalExpired:"Total expirado",noCredits:"Aún no hay créditos",noCreditsHint:"Los créditos aparecerán aquí cuando sean otorgados por tu plan o comprados.",buyCredits:"Comprar créditos",buyAmount:"Buy {count} Credits",purchasing:"Redirigiendo...",packages:"Paquetes de créditos",noPackages:"No hay paquetes de créditos disponibles.",creditsAmount:"{count} créditos",validityDays:"Válido por {count} días",validityUnlimited:"Sin expiración",transactions:"Transacciones recientes",noTransactions:"Aún no hay transacciones.",loadMore:"Load More",viewAll:"Ver todo",expiringSoon:"Próximos a expirar",expiringInDays:"{count} créditos expiran dentro de {days} días",noExpiring:"No hay créditos próximos a expirar.",type:{plan_grant:"Otorgado por el plan",pack_purchased:"Comprado",consumed:"Consumido",expired:"Expirado",admin_grant:"Otorgado",admin_revoke:"Revocado",refund:"Reembolso"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"¡Créditos comprados correctamente! Tu saldo ha sido actualizado.",purchaseCanceled:"La compra de créditos fue cancelada. No se realizaron cargos.",purchaseFailed:"La compra de créditos falló. Por favor, inténtalo de nuevo o contacta a soporte.",errorLoading:"Error al cargar los datos de créditos",insufficientCredits:"Créditos insuficientes"},loading:{restoringSession:"Restaurando tu sesión...",redirecting:"Redirigiendo...",signingIn:"Iniciando sesión...",verifyingAccount:"Verificando tu cuenta...",almostThere:"Ya casi..."},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",fetchCreditBalance:"Error al obtener el saldo de créditos",consumeCredits:"Error al consumir créditos",purchaseCredits:"Error al comprar créditos",fetchCreditPackages:"Error al obtener los paquetes de créditos",fetchCreditTransactions:"Error al obtener las transacciones de créditos",fetchExpiringCredits:"Error al obtener los créditos próximos a expirar"}}});var iN=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",credits:"Crédits",features:"Fonctionnalités de l'espace de travail",notifications:"Notifications",permissions:"Permissions",danger:"Zone de danger"},sidebar:{account:"Compte",workspace:"Espace de travail",profile:"Compte",general:"Paramètres",users:"Membres",subscription:"Plan et facturation",usage:"Utilisation",credits:"Crédits",features:"Fonctionnalités",notifications:"Notifications",permissions:"Permissions",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}}",noPermissionTitle:"Accès restreint",noPermissionDescription:"Vous n'avez pas la permission d'accéder à cette section. Contactez un administrateur de l'espace de travail si vous avez besoin d'un accès.",billingManageOnly:"Seuls les utilisateurs disposant des autorisations de gestion de la facturation peuvent effectuer cette action."}},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",forWorkspace:"pour {name}",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",cancelTrialTitle:"Annuler l'essai",cancelTrialConfirm:"Êtes-vous sûr de vouloir annuler votre période d'essai ?",cancelTrialAccess:"Votre période d'essai continuera jusqu'au",cancelTrialNoCharge:"Vous ne serez pas facturé — votre période d'essai expirera simplement",cancelTrialResume:"Vous pouvez reprendre votre essai à tout moment avant qu'il ne se termine",cancelTrialKeep:"Conserver l'essai",cancelTrialButton:"Oui, annuler l'essai",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",resumeTrial:"Reprendre l'essai",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",scheduledTrialCancellation:"Annulation de l'essai 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",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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",trialEndDescription:"Votre période d'essai 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",startTrialDays:"Commencer l'essai gratuit de {days} jours",trialBadge:"Essai de {days} jours"},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.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number} inclus (limite stricte)",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"},permissions:{title:"Permissions",description:"Configurez ce que chaque rôle peut faire dans cet espace de travail.",ownerOnly:"Seul le propriétaire de l'espace de travail peut gérer les permissions.",save:"Enregistrer les permissions",saving:"Enregistrement...",saveSuccess:"Permissions enregistrées avec succès"},credits:{title:"Crédits",description:"Les crédits peuvent être utilisés pour des actions premium comme la génération par IA.",balance:"Solde de crédits",available:"Disponible",totalGranted:"Total accordé",totalConsumed:"Total consommé",totalExpired:"Total expiré",noCredits:"Pas encore de crédits",noCreditsHint:"Les crédits apparaîtront ici lorsqu'ils seront accordés par votre plan ou achetés.",buyCredits:"Acheter des crédits",buyAmount:"Buy {count} Credits",purchasing:"Redirection...",packages:"Packs de crédits",noPackages:"Aucun pack de crédits disponible.",creditsAmount:"{count} crédits",validityDays:"Valable {count} jours",validityUnlimited:"Sans expiration",transactions:"Transactions récentes",noTransactions:"Pas encore de transactions.",loadMore:"Load More",viewAll:"Tout voir",expiringSoon:"Expiration imminente",expiringInDays:"{count} crédits expirent dans {days} jours",noExpiring:"Aucun crédit n'expire prochainement.",type:{plan_grant:"Octroi du plan",pack_purchased:"Acheté",consumed:"Consommé",expired:"Expiré",admin_grant:"Accordé",admin_revoke:"Révoqué",refund:"Remboursement"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"Crédits achetés avec succès ! Votre solde a été mis à jour.",purchaseCanceled:"L'achat de crédits a été annulé. Aucun frais n'a été facturé.",purchaseFailed:"L'achat de crédits a échoué. Veuillez réessayer ou contacter le support.",errorLoading:"Échec du chargement des données de crédits",insufficientCredits:"Crédits insuffisants"},loading:{restoringSession:"Restauration de votre session...",redirecting:"Redirection...",signingIn:"Connexion en cours...",verifyingAccount:"Vérification de votre compte...",almostThere:"Presque terminé..."},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",fetchCreditBalance:"Échec de la récupération du solde de crédits",consumeCredits:"Échec de la consommation des crédits",purchaseCredits:"Échec de l'achat de crédits",fetchCreditPackages:"Échec de la récupération des packs de crédits",fetchCreditTransactions:"Échec de la récupération des transactions de crédits",fetchExpiringCredits:"Échec de la récupération des crédits expirant bientôt"}}});var oN=Object.freeze({__proto__:null,de:{settings:{titles:{profile:"Konto",general:"Arbeitsbereich-Einstellungen",users:"Arbeitsbereich-Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",credits:"Guthaben",features:"Arbeitsbereich-Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",danger:"Gefahrenzone"},sidebar:{account:"Konto",workspace:"Arbeitsbereich",profile:"Konto",general:"Einstellungen",users:"Mitglieder",subscription:"Plan & Abrechnung",usage:"Nutzung",credits:"Guthaben",features:"Funktionen",notifications:"Benachrichtigungen",permissions:"Berechtigungen",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}}",noPermissionTitle:"Zugriff eingeschränkt",noPermissionDescription:"Sie haben keine Berechtigung, auf diesen Bereich zuzugreifen. Kontaktieren Sie einen Workspace-Administrator, wenn Sie Zugriff benötigen.",billingManageOnly:"Nur Benutzer mit Abrechnungsverwaltungsberechtigungen können diese Aktion durchführen."}},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",forWorkspace:"für {name}",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",cancelTrialTitle:"Testversion abbrechen",cancelTrialConfirm:"Bist du sicher, dass du deine Testversion abbrechen möchtest?",cancelTrialAccess:"Deine Testversion läuft weiter bis",cancelTrialNoCharge:"Dir wird nichts berechnet — deine Testversion läuft einfach ab",cancelTrialResume:"Du kannst deine Testversion jederzeit vor Ablauf wieder aufnehmen",cancelTrialKeep:"Testversion behalten",cancelTrialButton:"Ja, Testversion abbrechen",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",resumeTrial:"Testversion 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",scheduledTrialCancellation:"Kündigung der Testversion 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",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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",trialEndDescription:"Deine Testversion 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",startTrialDays:"{days}-tägige kostenlose Testversion starten",trialBadge:"{days}-Tage-Testversion"},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.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number} enthalten (festes Limit)",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"},permissions:{title:"Berechtigungen",description:"Konfiguriere, was jede Rolle in diesem Arbeitsbereich tun kann.",ownerOnly:"Nur der Eigentümer des Arbeitsbereichs kann Berechtigungen verwalten.",save:"Berechtigungen speichern",saving:"Wird gespeichert...",saveSuccess:"Berechtigungen erfolgreich gespeichert"},credits:{title:"Guthaben",description:"Guthaben kann für Premium-Aktionen wie KI-Generierung verwendet werden.",balance:"Guthabenstand",available:"Verfügbar",totalGranted:"Gesamt gewährt",totalConsumed:"Gesamt verbraucht",totalExpired:"Gesamt abgelaufen",noCredits:"Noch kein Guthaben",noCreditsHint:"Guthaben wird hier angezeigt, wenn es durch deinen Plan gewährt oder gekauft wurde.",buyCredits:"Guthaben kaufen",buyAmount:"Buy {count} Credits",purchasing:"Weiterleitung...",packages:"Guthabenpakete",noPackages:"Keine Guthabenpakete verfügbar.",creditsAmount:"{count} Guthaben",validityDays:"Gültig für {count} Tage",validityUnlimited:"Kein Ablaufdatum",transactions:"Letzte Transaktionen",noTransactions:"Noch keine Transaktionen.",loadMore:"Load More",viewAll:"Alle anzeigen",expiringSoon:"Läuft bald ab",expiringInDays:"{count} Guthaben läuft innerhalb von {days} Tagen ab",noExpiring:"Kein Guthaben läuft bald ab.",type:{plan_grant:"Plan-Gewährung",pack_purchased:"Gekauft",consumed:"Verbraucht",expired:"Abgelaufen",admin_grant:"Gewährt",admin_revoke:"Widerrufen",refund:"Erstattung"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"Guthaben erfolgreich gekauft! Dein Kontostand wurde aktualisiert.",purchaseCanceled:"Guthabenkauf wurde abgebrochen. Es wurden keine Gebühren erhoben.",purchaseFailed:"Guthabenkauf fehlgeschlagen. Bitte versuche es erneut oder kontaktiere den Support.",errorLoading:"Guthabendaten konnten nicht geladen werden",insufficientCredits:"Nicht genügend Guthaben"},loading:{restoringSession:"Sitzung wird wiederhergestellt...",redirecting:"Weiterleitung...",signingIn:"Anmeldung läuft...",verifyingAccount:"Konto wird überprüft...",almostThere:"Fast geschafft..."},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",fetchCreditBalance:"Guthabenstand konnte nicht abgerufen werden",consumeCredits:"Guthaben konnte nicht verbraucht werden",purchaseCredits:"Guthaben konnte nicht gekauft werden",fetchCreditPackages:"Guthabenpakete konnten nicht abgerufen werden",fetchCreditTransactions:"Guthabentransaktionen konnten nicht abgerufen werden",fetchExpiringCredits:"Ablaufendes Guthaben konnte nicht abgerufen werden"}}});var cN=Object.freeze({__proto__:null,ja:{settings:{titles:{profile:"アカウント",general:"ワークスペース設定",users:"ワークスペースメンバー",subscription:"プランと請求",usage:"使用状況",credits:"クレジット",features:"ワークスペース機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},sidebar:{account:"アカウント",workspace:"ワークスペース",profile:"アカウント",general:"設定",users:"メンバー",subscription:"プランと請求",usage:"使用状況",credits:"クレジット",features:"機能",notifications:"通知",permissions:"権限",danger:"危険ゾーン"},common:{refresh:"更新",refreshing:"更新中...",retry:"再試行",retrying:"再試行中...",save:"保存",saving:"保存中...",cancel:"キャンセル",delete:"削除",dismiss:"閉じる",loading:"読み込み中...",success:"成功しました!",error:"エラー",refreshAction:"{loading, select, true {更新中...} other {更新}}",retryAction:"{loading, select, true {再試行中...} other {再試行}}",noPermissionTitle:"アクセス制限",noPermissionDescription:"このセクションにアクセスする権限がありません。アクセスが必要な場合は、ワークスペース管理者にお問い合わせください。",billingManageOnly:"請求管理権限を持つユーザーのみがこの操作を実行できます。"}},subscription:{managePlan:"プランと請求を管理",changePlan:"プランを変更",viewPricingPlans:"料金プランを見る",viewPlans:"プランを見る",upgradePlan:"今すぐアップグレード",subscribe:"登録する",currentPlan:"現在のプラン",noSubscription:"有効なサブスクリプションがありません",choosePlan:"プランを選択",choosePlanDescription:"プランを比較して、ニーズに合ったものを選択してください",forWorkspace:"{name} 向け",planUpdateAvailable:"プランの更新が利用可能です",updateSuccess:"サブスクリプションが正常に更新されました!",updateFailed:"更新に失敗しました",cancelTitle:"サブスクリプションをキャンセル",cancelConfirm:"サブスクリプションをキャンセルしてもよろしいですか?",cancelKeep:"サブスクリプションを維持",cancelButton:"はい、キャンセルします",cancelTrialTitle:"トライアルをキャンセル",cancelTrialConfirm:"トライアルをキャンセルしてもよろしいですか?",cancelTrialAccess:"トライアルは次の日まで継続されます",cancelTrialNoCharge:"課金されることはありません — トライアルはそのまま終了します",cancelTrialResume:"終了前であればいつでもトライアルを再開できます",cancelTrialKeep:"トライアルを維持",cancelTrialButton:"はい、トライアルをキャンセル",canceling:"キャンセル中...",cancelSuccess:"サブスクリプションは請求期間の終了時にキャンセルされます。",cancelNotCharged:"キャンセル後は課金されません",cancelResumeAnytime:"終了前であればいつでもサブスクリプションを再開できます",resumeTitle:"サブスクリプションを再開",resumeTrial:"トライアルを再開",resumeConfirm:"サブスクリプションを再開してもよろしいですか?",resumeKeep:"キャンセルのまま維持",resumeButton:"はい、再開します",resuming:"再開中...",resumeSuccess:"サブスクリプションが再開されました。",managePayment:"支払いを管理",openingPortal:"開いています...",viewAllPlans:"すべてのプランを見る",scheduledCancellation:"サブスクリプションのキャンセルが予定されています",scheduledTrialCancellation:"トライアルのキャンセルが予定されています",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:"使用量クォータ",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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:"サブスクリプションの終了日:",trialEndDescription:"トライアルの終了日:",cancelEndFallback:"サブスクリプションは現在の請求期間の終了時にキャンセルされます。以降の課金はありません。",resumeChargeDate:"次回の課金日:",resumeChargeFallback:"次回の請求日",resumeContinue:"サブスクリプションは自動的に継続され、プランに基づいて請求されます",resumeCancelAnytime:"次回の請求日前であれば、いつでもキャンセルできます",retainAccess:"このプランへのフルアクセスは次の日まで維持されます:",retainAccessFallback:"現在の請求期間の終了まで",noPlansAvailable:"このワークスペースで利用可能なプラングループがありません。エラーだと思われる場合は、サポートにお問い合わせください。",noPlansAvailableHint:"このワークスペースで利用可能なプラングループがありません。",startTrialDescription:"コミットなしでフルプランをお試しください。いつでもアップグレードまたはキャンセルできます。",noSubscriptionDescription:"ワークスペースを始めるにはプランを選択してください",startFreeTrial:"無料トライアルを開始",startTrialDays:"{days}日間の無料トライアルを開始",trialBadge:"{days}日間トライアル"},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:"通知はこのデバイスに送信されます。他のデバイスでは個別に有効にしてください。",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number}件含まれる(上限)",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:"プッシュ通知の解除に失敗しました"},permissions:{title:"権限",description:"このワークスペースで各ロールができることを設定します。",ownerOnly:"ワークスペースのオーナーのみが権限を管理できます。",save:"権限を保存",saving:"保存中...",saveSuccess:"権限が正常に保存されました"},credits:{title:"クレジット",description:"クレジットはAI生成などのプレミアムアクションに使用できます。",balance:"クレジット残高",available:"利用可能",totalGranted:"付与合計",totalConsumed:"消費合計",totalExpired:"期限切れ合計",noCredits:"クレジットがありません",noCreditsHint:"プランによる付与または購入時にクレジットがここに表示されます。",buyCredits:"クレジットを購入",buyAmount:"Buy {count} Credits",purchasing:"リダイレクト中...",packages:"クレジットパッケージ",noPackages:"利用可能なクレジットパッケージがありません。",creditsAmount:"{count} クレジット",validityDays:"{count} 日間有効",validityUnlimited:"有効期限なし",transactions:"最近の取引",noTransactions:"取引はまだありません。",loadMore:"Load More",viewAll:"すべて表示",expiringSoon:"まもなく期限切れ",expiringInDays:"{count} クレジットが {days} 日以内に期限切れ",noExpiring:"まもなく期限切れになるクレジットはありません。",type:{plan_grant:"プラン付与",pack_purchased:"購入済み",consumed:"消費済み",expired:"期限切れ",admin_grant:"付与",admin_revoke:"取消",refund:"返金"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"クレジットの購入が完了しました!残高が更新されました。",purchaseCanceled:"クレジットの購入がキャンセルされました。課金は発生していません。",purchaseFailed:"クレジットの購入に失敗しました。再度お試しいただくか、サポートにお問い合わせください。",errorLoading:"クレジットデータの読み込みに失敗しました",insufficientCredits:"クレジットが不足しています"},loading:{restoringSession:"セッションを復元中...",redirecting:"リダイレクト中...",signingIn:"サインイン中...",verifyingAccount:"アカウントを確認中...",almostThere:"もう少しです..."},errors:{networkError:"ネットワークエラー:インターネット接続を確認してください",unauthorized:"認証エラー — セッションを確認してください",notFound:"リソースが見つかりません",generic:"エラーが発生しました",fetchPlans:"プランの取得に失敗しました",fetchPlanGroup:"プラングループの取得に失敗しました",fetchPlanGroupVersion:"プラングループバージョンの取得に失敗しました",fetchPlanGroupVersions:"プラングループバージョン一覧の取得に失敗しました",fetchSubscription:"サブスクリプションの取得に失敗しました",createCheckout:"チェックアウトセッションの作成に失敗しました",updateSubscription:"サブスクリプションの更新に失敗しました",fetchInvoices:"請求書の取得に失敗しました",fetchInvoice:"請求書の取得に失敗しました",openBillingPortal:"請求ポータルを開けませんでした",cancelSubscription:"サブスクリプションのキャンセルに失敗しました",resumeSubscription:"サブスクリプションの再開に失敗しました",recordUsage:"使用量の記録に失敗しました",fetchQuotaUsage:"クォータ使用状況の取得に失敗しました",fetchAllQuotaUsage:"全クォータ使用状況の取得に失敗しました",fetchUsageLogs:"使用ログの取得に失敗しました",fetchCreditBalance:"クレジット残高の取得に失敗しました",consumeCredits:"クレジットの消費に失敗しました",purchaseCredits:"クレジットの購入に失敗しました",fetchCreditPackages:"クレジットパッケージの取得に失敗しました",fetchCreditTransactions:"クレジット取引履歴の取得に失敗しました",fetchExpiringCredits:"期限切れ間近のクレジットの取得に失敗しました"}}});var lN=Object.freeze({__proto__:null,zh:{settings:{titles:{profile:"账户",general:"工作区设置",users:"工作区成员",subscription:"套餐与账单",usage:"用量",credits:"积分",features:"工作区功能",notifications:"通知",permissions:"权限",danger:"危险区域"},sidebar:{account:"账户",workspace:"工作区",profile:"账户",general:"设置",users:"成员",subscription:"套餐与账单",usage:"用量",credits:"积分",features:"功能",notifications:"通知",permissions:"权限",danger:"危险区域"},common:{refresh:"刷新",refreshing:"正在刷新...",retry:"重试",retrying:"正在重试...",save:"保存",saving:"正在保存...",cancel:"取消",delete:"删除",dismiss:"关闭",loading:"正在加载...",success:"操作成功!",error:"错误",refreshAction:"{loading, select, true {正在刷新...} other {刷新}}",retryAction:"{loading, select, true {正在重试...} other {重试}}",noPermissionTitle:"访问受限",noPermissionDescription:"您没有权限访问此部分。如需访问权限,请联系工作区管理员。",billingManageOnly:"只有具有账单管理权限的用户才能执行此操作。"}},subscription:{managePlan:"管理您的套餐和账单",changePlan:"更改套餐",viewPricingPlans:"查看价格方案",viewPlans:"查看套餐",upgradePlan:"立即升级",subscribe:"订阅",currentPlan:"当前套餐",noSubscription:"您没有有效的订阅",choosePlan:"选择您的套餐",choosePlanDescription:"比较各套餐,选择最适合您需求的方案",forWorkspace:"适用于 {name}",planUpdateAvailable:"套餐更新可用",updateSuccess:"订阅已成功更新!",updateFailed:"更新失败",cancelTitle:"取消订阅",cancelConfirm:"您确定要取消订阅吗?",cancelKeep:"保留订阅",cancelButton:"是的,取消订阅",cancelTrialTitle:"取消试用",cancelTrialConfirm:"您确定要取消试用吗?",cancelTrialAccess:"您的试用将持续到",cancelTrialNoCharge:"不会向您收费 — 试用期将自动到期",cancelTrialResume:"您可以在试用结束前随时恢复试用",cancelTrialKeep:"保留试用",cancelTrialButton:"是的,取消试用",canceling:"正在取消...",cancelSuccess:"订阅将在当前计费周期结束时取消。",cancelNotCharged:"取消后将不再收费",cancelResumeAnytime:"您可以在订阅结束前随时恢复",resumeTitle:"恢复订阅",resumeTrial:"恢复试用",resumeConfirm:"您确定要恢复订阅吗?",resumeKeep:"保持取消状态",resumeButton:"是的,恢复订阅",resuming:"正在恢复...",resumeSuccess:"订阅已恢复。",managePayment:"管理支付方式",openingPortal:"正在打开...",viewAllPlans:"查看所有套餐",scheduledCancellation:"订阅已安排取消",scheduledTrialCancellation:"试用已安排取消",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:"用量配额",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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:"您的订阅将于以下日期结束:",trialEndDescription:"您的试用将于以下日期结束:",cancelEndFallback:"您的订阅将在当前计费周期结束时取消,之后将不再收费。",resumeChargeDate:"将于以下日期再次收费:",resumeChargeFallback:"下一个计费日",resumeContinue:"您的订阅将自动继续,并按照套餐计费",resumeCancelAnytime:"如果您改变主意,可以在下一个计费日之前随时取消",retainAccess:"您将保留此套餐的完整访问权限直到",retainAccessFallback:"当前计费周期结束",noPlansAvailable:"此工作区没有可用的套餐组。如果您认为这是一个错误,请联系客服。",noPlansAvailableHint:"此工作区没有可用的套餐组。",startTrialDescription:"免费试用完整套餐,无需承诺。您可以随时升级或取消。",noSubscriptionDescription:"选择一个套餐来开始使用您的工作区",startFreeTrial:"开始免费试用",startTrialDays:"开始 {days} 天免费试用",trialBadge:"{days} 天试用"},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:"通知将发送到此设备。请在其他设备上单独启用。",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"包含 {count, number} 个(硬性限制)",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:"取消订阅推送通知失败"},permissions:{title:"权限",description:"配置每个角色在此工作区中的操作权限。",ownerOnly:"只有工作区拥有者才能管理权限。",save:"保存权限",saving:"正在保存...",saveSuccess:"权限保存成功"},credits:{title:"积分",description:"积分可用于 AI 生成等高级操作。",balance:"积分余额",available:"可用",totalGranted:"总授予",totalConsumed:"总消耗",totalExpired:"总过期",noCredits:"暂无积分",noCreditsHint:"当您的套餐授予或购买积分时,积分将显示在此处。",buyCredits:"购买积分",buyAmount:"Buy {count} Credits",purchasing:"正在跳转...",packages:"积分套餐包",noPackages:"没有可用的积分套餐包。",creditsAmount:"{count} 积分",validityDays:"有效期 {count} 天",validityUnlimited:"永不过期",transactions:"最近交易",noTransactions:"暂无交易记录。",loadMore:"Load More",viewAll:"查看全部",expiringSoon:"即将过期",expiringInDays:"{count} 积分将在 {days} 天内过期",noExpiring:"没有即将过期的积分。",type:{plan_grant:"套餐授予",pack_purchased:"已购买",consumed:"已消耗",expired:"已过期",admin_grant:"已授予",admin_revoke:"已撤销",refund:"退款"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"积分购买成功!您的余额已更新。",purchaseCanceled:"积分购买已取消,未产生任何费用。",purchaseFailed:"积分购买失败。请重试或联系客服。",errorLoading:"加载积分数据失败",insufficientCredits:"积分不足"},loading:{restoringSession:"正在恢复会话...",redirecting:"正在跳转...",signingIn:"正在登录...",verifyingAccount:"正在验证您的账户...",almostThere:"即将完成..."},errors:{networkError:"网络错误:请检查您的网络连接",unauthorized:"未授权 — 请检查您的会话",notFound:"资源未找到",generic:"发生错误",fetchPlans:"获取套餐失败",fetchPlanGroup:"获取套餐组失败",fetchPlanGroupVersion:"获取套餐组版本失败",fetchPlanGroupVersions:"获取套餐组版本列表失败",fetchSubscription:"获取订阅信息失败",createCheckout:"创建结账会话失败",updateSubscription:"更新订阅失败",fetchInvoices:"获取账单失败",fetchInvoice:"获取账单失败",openBillingPortal:"打开账单门户失败",cancelSubscription:"取消订阅失败",resumeSubscription:"恢复订阅失败",recordUsage:"记录用量失败",fetchQuotaUsage:"获取配额使用状态失败",fetchAllQuotaUsage:"获取所有配额使用情况失败",fetchUsageLogs:"获取使用日志失败",fetchCreditBalance:"获取积分余额失败",consumeCredits:"消耗积分失败",purchaseCredits:"购买积分失败",fetchCreditPackages:"获取积分套餐包失败",fetchCreditTransactions:"获取积分交易记录失败",fetchExpiringCredits:"获取即将过期的积分失败"}}});var dN=Object.freeze({__proto__:null,hi:{settings:{titles:{profile:"खाता",general:"वर्कस्पेस सेटिंग्स",users:"वर्कस्पेस सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",credits:"क्रेडिट",features:"वर्कस्पेस फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},sidebar:{account:"खाता",workspace:"वर्कस्पेस",profile:"खाता",general:"सेटिंग्स",users:"सदस्य",subscription:"प्लान और बिलिंग",usage:"उपयोग",credits:"क्रेडिट",features:"फ़ीचर्स",notifications:"सूचनाएँ",permissions:"अनुमतियाँ",danger:"खतरनाक ज़ोन"},common:{refresh:"रीफ़्रेश",refreshing:"रीफ़्रेश हो रहा है...",retry:"पुनः प्रयास",retrying:"पुनः प्रयास हो रहा है...",save:"सहेजें",saving:"सहेजा जा रहा है...",cancel:"रद्द करें",delete:"हटाएँ",dismiss:"खारिज करें",loading:"लोड हो रहा है...",success:"सफल!",error:"त्रुटि",refreshAction:"{loading, select, true {रीफ़्रेश हो रहा है...} other {रीफ़्रेश}}",retryAction:"{loading, select, true {पुनः प्रयास हो रहा है...} other {पुनः प्रयास}}",noPermissionTitle:"पहुँच प्रतिबंधित",noPermissionDescription:"आपके पास इस अनुभाग तक पहुँचने की अनुमति नहीं है। यदि आपको पहुँच की आवश्यकता है तो कार्यक्षेत्र व्यवस्थापक से संपर्क करें।",billingManageOnly:"केवल बिलिंग प्रबंधन अनुमतियों वाले उपयोगकर्ता ही यह कार्य कर सकते हैं।"}},subscription:{managePlan:"अपना प्लान और बिलिंग प्रबंधित करें",changePlan:"प्लान बदलें",viewPricingPlans:"मूल्य निर्धारण प्लान देखें",viewPlans:"प्लान देखें",upgradePlan:"अभी अपग्रेड करें",subscribe:"सदस्यता लें",currentPlan:"वर्तमान प्लान",noSubscription:"आपके पास कोई सक्रिय सदस्यता नहीं है",choosePlan:"अपना प्लान चुनें",choosePlanDescription:"प्लान की तुलना करें और अपनी ज़रूरत के अनुसार चुनें",forWorkspace:"{name} के लिए",planUpdateAvailable:"प्लान अपडेट उपलब्ध है",updateSuccess:"सदस्यता सफलतापूर्वक अपडेट हो गई!",updateFailed:"अपडेट विफल",cancelTitle:"सदस्यता रद्द करें",cancelConfirm:"क्या आप वाकई अपनी सदस्यता रद्द करना चाहते हैं?",cancelKeep:"सदस्यता बनाए रखें",cancelButton:"हाँ, सदस्यता रद्द करें",cancelTrialTitle:"ट्रायल रद्द करें",cancelTrialConfirm:"क्या आप वाकई अपना ट्रायल रद्द करना चाहते हैं?",cancelTrialAccess:"आपका ट्रायल इस तारीख तक जारी रहेगा",cancelTrialNoCharge:"आपसे कोई शुल्क नहीं लिया जाएगा — आपका ट्रायल बस समाप्त हो जाएगा",cancelTrialResume:"आप समाप्त होने से पहले कभी भी अपना ट्रायल फिर से शुरू कर सकते हैं",cancelTrialKeep:"ट्रायल बनाए रखें",cancelTrialButton:"हाँ, ट्रायल रद्द करें",canceling:"रद्द किया जा रहा है...",cancelSuccess:"बिलिंग अवधि के अंत में सदस्यता रद्द कर दी जाएगी।",cancelNotCharged:"रद्द करने के बाद आपसे दोबारा शुल्क नहीं लिया जाएगा",cancelResumeAnytime:"आप सदस्यता समाप्त होने से पहले कभी भी इसे फिर से शुरू कर सकते हैं",resumeTitle:"सदस्यता फिर से शुरू करें",resumeTrial:"ट्रायल फिर से शुरू करें",resumeConfirm:"क्या आप वाकई अपनी सदस्यता फिर से शुरू करना चाहते हैं?",resumeKeep:"रद्द रखें",resumeButton:"हाँ, सदस्यता फिर से शुरू करें",resuming:"फिर से शुरू हो रहा है...",resumeSuccess:"सदस्यता फिर से शुरू हो गई है।",managePayment:"भुगतान प्रबंधित करें",openingPortal:"खोला जा रहा है...",viewAllPlans:"सभी प्लान देखें",scheduledCancellation:"सदस्यता रद्द करने के लिए निर्धारित",scheduledTrialCancellation:"ट्रायल रद्द करने के लिए निर्धारित",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:"उपयोग कोटा",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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:"आपकी सदस्यता इस तारीख को समाप्त होगी",trialEndDescription:"आपका ट्रायल इस तारीख को समाप्त होगा",cancelEndFallback:"वर्तमान बिलिंग अवधि के अंत में आपकी सदस्यता रद्द कर दी जाएगी। आपसे दोबारा शुल्क नहीं लिया जाएगा।",resumeChargeDate:"आपसे फिर से शुल्क लिया जाएगा",resumeChargeFallback:"अगली बिलिंग तिथि",resumeContinue:"आपकी सदस्यता स्वचालित रूप से जारी रहेगी और आपसे आपके प्लान के अनुसार बिल लिया जाएगा",resumeCancelAnytime:"अगर आप अपना मन बदलते हैं तो अगली बिलिंग तिथि से पहले कभी भी रद्द कर सकते हैं",retainAccess:"आपके पास इस प्लान की पूर्ण पहुँच बनी रहेगी",retainAccessFallback:"आपकी वर्तमान बिलिंग अवधि के अंत तक",noPlansAvailable:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है। अगर आपको लगता है कि यह त्रुटि है तो कृपया सहायता से संपर्क करें।",noPlansAvailableHint:"इस वर्कस्पेस के लिए कोई प्लान ग्रुप उपलब्ध नहीं है।",startTrialDescription:"बिना किसी प्रतिबद्धता के पूरा प्लान आज़माएँ। आप कभी भी अपग्रेड या रद्द कर सकते हैं।",noSubscriptionDescription:"अपने वर्कस्पेस के लिए एक प्लान चुनें",startFreeTrial:"मुफ़्त ट्रायल शुरू करें",startTrialDays:"{days} दिन का मुफ़्त ट्रायल शुरू करें",trialBadge:"{days} दिन का ट्रायल"},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:"सूचनाएँ इस डिवाइस पर भेजी जाती हैं। अन्य डिवाइसों पर अलग से सक्रिय करें।",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number} शामिल (सख्त सीमा)",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:"पुश सूचनाओं की सदस्यता रद्द करने में विफल"},permissions:{title:"अनुमतियाँ",description:"इस कार्यक्षेत्र में प्रत्येक भूमिका क्या कर सकती है, यह कॉन्फ़िगर करें।",ownerOnly:"केवल कार्यक्षेत्र का स्वामी ही अनुमतियाँ प्रबंधित कर सकता है।",save:"अनुमतियाँ सहेजें",saving:"सहेजा जा रहा है...",saveSuccess:"अनुमतियाँ सफलतापूर्वक सहेजी गईं"},credits:{title:"क्रेडिट",description:"क्रेडिट का उपयोग AI जनरेशन जैसी प्रीमियम कार्रवाइयों के लिए किया जा सकता है।",balance:"क्रेडिट शेष",available:"उपलब्ध",totalGranted:"कुल प्रदान किया गया",totalConsumed:"कुल उपभोग किया गया",totalExpired:"कुल समाप्त हुआ",noCredits:"अभी कोई क्रेडिट नहीं",noCreditsHint:"जब आपके प्लान द्वारा प्रदान किया जाएगा या खरीदा जाएगा तो क्रेडिट यहाँ दिखाई देंगे।",buyCredits:"क्रेडिट खरीदें",buyAmount:"Buy {count} Credits",purchasing:"रीडायरेक्ट हो रहा है...",packages:"क्रेडिट पैकेज",noPackages:"कोई क्रेडिट पैकेज उपलब्ध नहीं।",creditsAmount:"{count} क्रेडिट",validityDays:"{count} दिनों के लिए मान्य",validityUnlimited:"कोई समाप्ति नहीं",transactions:"हाल की लेनदेन",noTransactions:"अभी कोई लेनदेन नहीं।",loadMore:"Load More",viewAll:"सभी देखें",expiringSoon:"जल्द समाप्त हो रहे हैं",expiringInDays:"{count} क्रेडिट {days} दिनों में समाप्त हो रहे हैं",noExpiring:"कोई क्रेडिट जल्द समाप्त नहीं हो रहे।",type:{plan_grant:"प्लान अनुदान",pack_purchased:"खरीदा गया",consumed:"उपभोग किया गया",expired:"समाप्त",admin_grant:"प्रदान किया गया",admin_revoke:"वापस लिया गया",refund:"वापसी"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"क्रेडिट सफलतापूर्वक खरीदे गए! आपका शेष अपडेट कर दिया गया है।",purchaseCanceled:"क्रेडिट खरीदारी रद्द कर दी गई। कोई शुल्क नहीं लिया गया।",purchaseFailed:"क्रेडिट खरीदारी विफल रही। कृपया पुनः प्रयास करें या सहायता से संपर्क करें।",errorLoading:"क्रेडिट डेटा लोड करने में विफल",insufficientCredits:"पर्याप्त क्रेडिट नहीं"},loading:{restoringSession:"सत्र पुनर्स्थापित हो रहा है...",redirecting:"रीडायरेक्ट हो रहा है...",signingIn:"साइन इन हो रहा है...",verifyingAccount:"आपका खाता सत्यापित हो रहा है...",almostThere:"लगभग हो गया..."},errors:{networkError:"नेटवर्क त्रुटि: कृपया अपना इंटरनेट कनेक्शन जाँचें",unauthorized:"अनधिकृत - कृपया अपना सत्र जाँचें",notFound:"संसाधन नहीं मिला",generic:"एक त्रुटि हुई",fetchPlans:"प्लान लाने में विफल",fetchPlanGroup:"प्लान ग्रुप लाने में विफल",fetchPlanGroupVersion:"प्लान ग्रुप वर्शन लाने में विफल",fetchPlanGroupVersions:"प्लान ग्रुप वर्शन लाने में विफल",fetchSubscription:"सदस्यता लाने में विफल",createCheckout:"चेकआउट सत्र बनाने में विफल",updateSubscription:"सदस्यता अपडेट करने में विफल",fetchInvoices:"चालान लाने में विफल",fetchInvoice:"चालान लाने में विफल",openBillingPortal:"बिलिंग पोर्टल खोलने में विफल",cancelSubscription:"सदस्यता रद्द करने में विफल",resumeSubscription:"सदस्यता फिर से शुरू करने में विफल",recordUsage:"उपयोग दर्ज करने में विफल",fetchQuotaUsage:"कोटा उपयोग स्थिति लाने में विफल",fetchAllQuotaUsage:"सभी कोटा उपयोग लाने में विफल",fetchUsageLogs:"उपयोग लॉग लाने में विफल",fetchCreditBalance:"क्रेडिट शेष लाने में विफल",consumeCredits:"क्रेडिट उपभोग करने में विफल",purchaseCredits:"क्रेडिट खरीदने में विफल",fetchCreditPackages:"क्रेडिट पैकेज लाने में विफल",fetchCreditTransactions:"क्रेडिट लेनदेन लाने में विफल",fetchExpiringCredits:"समाप्त होने वाले क्रेडिट लाने में विफल"}}});var uN=Object.freeze({__proto__:null,ar:{settings:{titles:{profile:"الحساب",general:"إعدادات مساحة العمل",users:"أعضاء مساحة العمل",subscription:"الخطة والفوترة",usage:"الاستخدام",credits:"الرصيد",features:"ميزات مساحة العمل",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},sidebar:{account:"الحساب",workspace:"مساحة العمل",profile:"الحساب",general:"الإعدادات",users:"الأعضاء",subscription:"الخطة والفوترة",usage:"الاستخدام",credits:"الرصيد",features:"الميزات",notifications:"الإشعارات",permissions:"الصلاحيات",danger:"منطقة الخطر"},common:{refresh:"تحديث",refreshing:"جارٍ التحديث...",retry:"إعادة المحاولة",retrying:"جارٍ إعادة المحاولة...",save:"حفظ",saving:"جارٍ الحفظ...",cancel:"إلغاء",delete:"حذف",dismiss:"تجاهل",loading:"جارٍ التحميل...",success:"تم بنجاح!",error:"خطأ",refreshAction:"{loading, select, true {جارٍ التحديث...} other {تحديث}}",retryAction:"{loading, select, true {جارٍ إعادة المحاولة...} other {إعادة المحاولة}}",noPermissionTitle:"الوصول مقيد",noPermissionDescription:"ليس لديك إذن للوصول إلى هذا القسم. تواصل مع مسؤول مساحة العمل إذا كنت بحاجة إلى الوصول.",billingManageOnly:"فقط المستخدمون الذين لديهم أذونات إدارة الفواتير يمكنهم تنفيذ هذا الإجراء."}},subscription:{managePlan:"إدارة خطتك وفوترتك",changePlan:"تغيير الخطة",viewPricingPlans:"عرض خطط الأسعار",viewPlans:"عرض الخطط",upgradePlan:"ترقية الآن",subscribe:"اشتراك",currentPlan:"الخطة الحالية",noSubscription:"ليس لديك اشتراك نشط",choosePlan:"اختر خطتك",choosePlanDescription:"قارن بين الخطط واختر ما يناسب احتياجاتك",forWorkspace:"لـ {name}",planUpdateAvailable:"تحديث الخطة متوفر",updateSuccess:"تم تحديث الاشتراك بنجاح!",updateFailed:"فشل التحديث",cancelTitle:"إلغاء الاشتراك",cancelConfirm:"هل أنت متأكد من رغبتك في إلغاء اشتراكك؟",cancelKeep:"الاحتفاظ بالاشتراك",cancelButton:"نعم، إلغاء الاشتراك",cancelTrialTitle:"إلغاء التجربة",cancelTrialConfirm:"هل أنت متأكد من رغبتك في إلغاء فترتك التجريبية؟",cancelTrialAccess:"ستستمر فترتك التجريبية حتى",cancelTrialNoCharge:"لن يتم تحصيل أي رسوم منك — ستنتهي فترتك التجريبية ببساطة",cancelTrialResume:"يمكنك استئناف فترتك التجريبية في أي وقت قبل انتهائها",cancelTrialKeep:"الاحتفاظ بالتجربة",cancelTrialButton:"نعم، إلغاء التجربة",canceling:"جارٍ الإلغاء...",cancelSuccess:"سيتم إلغاء الاشتراك في نهاية فترة الفوترة.",cancelNotCharged:"لن يتم تحصيل رسوم منك مرة أخرى بعد الإلغاء",cancelResumeAnytime:"يمكنك استئناف اشتراكك في أي وقت قبل انتهائه",resumeTitle:"استئناف الاشتراك",resumeTrial:"استئناف التجربة",resumeConfirm:"هل أنت متأكد من رغبتك في استئناف اشتراكك؟",resumeKeep:"إبقاء الإلغاء",resumeButton:"نعم، استئناف الاشتراك",resuming:"جارٍ الاستئناف...",resumeSuccess:"تم استئناف الاشتراك.",managePayment:"إدارة الدفع",openingPortal:"جارٍ الفتح...",viewAllPlans:"عرض جميع الخطط",scheduledCancellation:"تم جدولة إلغاء الاشتراك",scheduledTrialCancellation:"تم جدولة إلغاء التجربة",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:"حصص الاستخدام",credits:"AI Credits",creditsPerMonth:"Credits per month",creditsOneTime:"Credits (given once)",creditRenewal:"Credit renewal",creditModeLifetime:"Given once",creditsPerPeriod:"Credits per month",creditRollover:"Credit renewal",creditModeReset:"Fresh every month",creditModeTopup:"Adds up every month"},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:"سينتهي اشتراكك في",trialEndDescription:"ستنتهي فترتك التجريبية في",cancelEndFallback:"سيتم إلغاء اشتراكك في نهاية فترة الفوترة الحالية. لن يتم تحصيل رسوم منك مرة أخرى.",resumeChargeDate:"سيتم تحصيل الرسوم منك مرة أخرى في",resumeChargeFallback:"تاريخ الفوترة التالي",resumeContinue:"سيستمر اشتراكك تلقائياً وسيتم فوترتك وفقاً لخطتك",resumeCancelAnytime:"يمكنك الإلغاء في أي وقت قبل تاريخ الفوترة التالي إذا غيرت رأيك",retainAccess:"ستحتفظ بالوصول الكامل إلى هذه الخطة حتى",retainAccessFallback:"نهاية فترة الفوترة الحالية",noPlansAvailable:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه. يرجى الاتصال بالدعم إذا كنت تعتقد أن هذا خطأ.",noPlansAvailableHint:"لا توجد مجموعات خطط متاحة لمساحة العمل هذه.",startTrialDescription:"جرب الخطة الكاملة بدون التزام. يمكنك الترقية أو الإلغاء في أي وقت.",noSubscriptionDescription:"اختر خطة للبدء مع مساحة العمل الخاصة بك",startFreeTrial:"ابدأ التجربة المجانية",startTrialDays:"ابدأ تجربة مجانية لمدة {days} يوم",trialBadge:"تجربة {days} يوم"},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:"يتم إرسال الإشعارات إلى هذا الجهاز. فعّلها على الأجهزة الأخرى بشكل منفصل.",prefsSaved:"Notification preferences saved.",loadingPrefs:"Loading preferences...",categories:{workspace:"Workspace",billing:"Billing & Payments"},events:{workspace_invite:"Member Invited",workspace_invite_desc:"When a new member is added to the workspace",workspace_removed:"Member Removed",workspace_removed_desc:"When a member is removed from the workspace",workspace_role_changed:"Role Changed",workspace_role_changed_desc:"When a member's role is updated",subscription_created:"Subscription Created",subscription_created_desc:"When a new subscription is activated",subscription_upgraded:"Plan Upgraded",subscription_upgraded_desc:"When the subscription plan is upgraded",subscription_canceled:"Subscription Canceled",subscription_canceled_desc:"When the subscription is canceled",subscription_suspended:"Access Suspended",subscription_suspended_desc:"When access is suspended due to payment failures",trial_ending:"Trial Ending",trial_ending_desc:"A few days before the trial expires",trial_expired:"Trial Expired",trial_expired_desc:"When the trial period has ended",payment_failed:"Payment Failed",payment_failed_desc:"When a payment could not be processed",payment_action_required:"Payment Action Required",payment_action_required_desc:"When a payment requires additional verification",payment_succeeded:"Payment Received",payment_succeeded_desc:"When a payment is successfully processed"},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}",includedHardLimit:"{count, number} مشمول (حد أقصى)",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:"فشل في إلغاء الاشتراك من الإشعارات الفورية"},permissions:{title:"الصلاحيات",description:"قم بتكوين ما يمكن لكل دور القيام به في مساحة العمل هذه.",ownerOnly:"يمكن لمالك مساحة العمل فقط إدارة الصلاحيات.",save:"حفظ الصلاحيات",saving:"جارٍ الحفظ...",saveSuccess:"تم حفظ الصلاحيات بنجاح"},credits:{title:"الرصيد",description:"يمكن استخدام الرصيد للإجراءات المميزة مثل التوليد بالذكاء الاصطناعي.",balance:"رصيد الائتمان",available:"متاح",totalGranted:"إجمالي الممنوح",totalConsumed:"إجمالي المستهلك",totalExpired:"إجمالي المنتهي",noCredits:"لا يوجد رصيد بعد",noCreditsHint:"سيظهر الرصيد هنا عند منحه من خطتك أو شرائه.",buyCredits:"شراء رصيد",buyAmount:"Buy {count} Credits",purchasing:"جارٍ إعادة التوجيه...",packages:"حزم الرصيد",noPackages:"لا تتوفر حزم رصيد.",creditsAmount:"{count} رصيد",validityDays:"صالح لمدة {count} يوم",validityUnlimited:"بدون انتهاء صلاحية",transactions:"المعاملات الأخيرة",noTransactions:"لا توجد معاملات بعد.",loadMore:"Load More",viewAll:"عرض الكل",expiringSoon:"ينتهي قريباً",expiringInDays:"{count} رصيد ينتهي خلال {days} يوم",noExpiring:"لا يوجد رصيد ينتهي قريباً.",type:{plan_grant:"منحة الخطة",pack_purchased:"تم الشراء",consumed:"مستهلك",expired:"منتهي",admin_grant:"ممنوح",admin_revoke:"مسحوب",refund:"استرداد"},dialogTitle:"Buy Credit Packages",dialogDescription:"Choose a credit package to purchase.",dialogDescriptionWorkspace:"Purchase credits for {workspace}.",perCredit:"{price} per credit",purchaseSuccess:"تم شراء الرصيد بنجاح! تم تحديث رصيدك.",purchaseCanceled:"تم إلغاء شراء الرصيد. لم يتم تحصيل أي رسوم.",purchaseFailed:"فشل شراء الرصيد. يرجى المحاولة مرة أخرى أو التواصل مع الدعم.",errorLoading:"فشل في تحميل بيانات الرصيد",insufficientCredits:"رصيد غير كافٍ"},loading:{restoringSession:"جارٍ استعادة الجلسة...",redirecting:"جارٍ إعادة التوجيه...",signingIn:"جارٍ تسجيل الدخول...",verifyingAccount:"جارٍ التحقق من حسابك...",almostThere:"أوشكنا على الانتهاء..."},errors:{networkError:"خطأ في الشبكة: يرجى التحقق من اتصالك بالإنترنت",unauthorized:"غير مصرح - يرجى التحقق من جلستك",notFound:"المورد غير موجود",generic:"حدث خطأ",fetchPlans:"فشل في جلب الخطط",fetchPlanGroup:"فشل في جلب مجموعة الخطط",fetchPlanGroupVersion:"فشل في جلب إصدار مجموعة الخطط",fetchPlanGroupVersions:"فشل في جلب إصدارات مجموعة الخطط",fetchSubscription:"فشل في جلب الاشتراك",createCheckout:"فشل في إنشاء جلسة الدفع",updateSubscription:"فشل في تحديث الاشتراك",fetchInvoices:"فشل في جلب الفواتير",fetchInvoice:"فشل في جلب الفاتورة",openBillingPortal:"فشل في فتح بوابة الفوترة",cancelSubscription:"فشل في إلغاء الاشتراك",resumeSubscription:"فشل في استئناف الاشتراك",recordUsage:"فشل في تسجيل الاستخدام",fetchQuotaUsage:"فشل في جلب حالة استخدام الحصص",fetchAllQuotaUsage:"فشل في جلب جميع استخدامات الحصص",fetchUsageLogs:"فشل في جلب سجلات الاستخدام",fetchCreditBalance:"فشل في جلب رصيد الائتمان",consumeCredits:"فشل في استهلاك الرصيد",purchaseCredits:"فشل في شراء الرصيد",fetchCreditPackages:"فشل في جلب حزم الرصيد",fetchCreditTransactions:"فشل في جلب معاملات الرصيد",fetchExpiringCredits:"فشل في جلب الرصيد المنتهي قريباً"}}});const pN={[Ua.Monthly]:"subscription.billingInterval.perMonth",[Ua.Quarterly]:"subscription.billingInterval.perQuarter",[Ua.Yearly]:"subscription.billingInterval.perYear"},mN=(e,t,r)=>{if(!e||0===e)return null;let n;switch(r){case Ua.Yearly:n=t/12;break;case Ua.Quarterly:n=t/3;break;default:return null}const a=(e-n)/e*100;return a>0?Math.round(a):null};var hN=Object.freeze({__proto__:null,default:({open:r,onOpenChange:n,planVersions:a,currentPlanVersionId:s,currentStripePriceId:i,billingCurrency:o,currentMemberCount:c,trialUsedAt:l,workspaceName:d,initialInterval:u,initialCurrency:p,onSelectPlan:m,loading:h=!1})=>{const[f,g]=t.useState(!1),{t:b,formattingLocale:v,dir:y,fmtNum:x,fmtCents:w}=ln(),{settings:S}=An(),k=S?.workspace?.mode===WS,C=(e,t)=>null==e||0===e?"":w(e,t),E=e=>b(pN[e]??pN[Ua.Monthly]),[N,A]=t.useState(null),j=t.useRef(!1),_=t.useMemo(()=>ds(i,a),[i,a]),P=_?.interval??null,T=_?.currency??null,R=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]),D=t.useMemo(()=>{const e=o?.trim().toLowerCase();return e?R.includes(e)?[e]:[]:R},[o,R]),[I,M]=t.useState(u||P||Ua.Monthly),[U,L]=t.useState(()=>p&&D.includes(p)?p:T&&D.includes(T)?T:D.length>0?D[0]:""),O=o?.trim()||U;t.useEffect(()=>{if(r){M(u||P||Ua.Monthly);const e=p||T;e&&D.includes(e)?L(e):D.length>0&&!D.includes(U)&&L(D[0])}},[r,u,p,P,T,D]);const z=t.useMemo(()=>[...a],[a]),F=(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())})(z),B=F.filter(e=>e.type===Ka),W=F.filter(e=>e.type===qa),V=F.filter(e=>e.type===Za),G=async e=>{if(!(e===s&&P===I||h||f||j.current)){j.current=!0,g(!0),A(e);try{await m(e,I,O),n(!1)}catch(e){}finally{j.current=!1,g(!1),A(null)}}},H=e=>os(e,O,I),$=e=>!!e.pricingVariants?.some(e=>e.currency?.toLowerCase()===O.toLowerCase()),K=h||f,q=e=>{switch(e){case Ua.Monthly:return b("subscription.billingInterval.monthly");case Ua.Quarterly:return b("subscription.billingInterval.quarterly");case Ua.Yearly:return b("subscription.billingInterval.yearly");default:return b("subscription.billingInterval.monthly")}},Z=e=>{const t=e._id===s,r=P===I;if(t&&r)return{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0};if(t&&!r)return e.plan?.isFreemium?{labelKey:"subscription.currentPlan",variant:"outline",disabled:!0}:{labelKey:"_dynamic",dynamicLabel:b("subscription.switchToInterval",{interval:q(I)}),variant:"default",disabled:!1};const n=e.trial?.enabled&&e.trial.durationDays>0&&!l&&!i;if(!s)return n?{labelKey:"_dynamic",dynamicLabel:b("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.subscribe",variant:"default",disabled:!1};const a=z.findIndex(e=>e._id===s),o=z.findIndex(t=>t._id===e._id);return-1===a||-1===o?n?{labelKey:"_dynamic",dynamicLabel:b("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}:o<a?{labelKey:"subscription.checkout.downgrade",variant:"outline",disabled:!1}:o>a?n?{labelKey:"_dynamic",dynamicLabel:b("subscription.startTrialDays",{days:e.trial.durationDays}),variant:"default",disabled:!1}:{labelKey:"subscription.checkout.upgrade",variant:"default",disabled:!1}:{labelKey:"subscription.checkout.select",variant:"default",disabled:!1}},J=(e,t,r=Ua.Monthly)=>{if(t.type===Ka)return e.features?.[t.slug]??!1;if(t.type===qa)return e.limits?.[t.slug]??null;if(t.type===Za){const n=ls(e,O,t.slug,r);return n||FS(e.quotas?.[t.slug],r)}return null},Y=(e,t,r)=>{if(t.type===Ka)return!0===e?"✓":"—";if(t.type===qa)return null!=e&&"number"==typeof e?x(e):"—";if(t.type===Za){const n=BS("object"==typeof e&&null!==e&&"included"in e?e:null,t.name.toLowerCase(),{currency:r,locale:v});return n?n.allowOverage?n.hasOverage?b("quota.includedWithOverage",{count:n.included,price:n.price,unit:n.unit}):b("quota.includedOnly",{count:n.included}):b("quota.includedHardLimit",{count:n.included}):"—"}return"—"};return e.jsx(il,{open:r,onOpenChange:n,children:e.jsxs(dl,{dir:y,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(pl,{className:"text-xl sm:text-2xl font-bold",children:b("pricing.title")}),e.jsxs(ml,{className:"mt-1 text-sm",children:[b("subscription.choosePlanDescription"),d&&e.jsx("span",{className:"ml-1 font-medium text-foreground",children:b("subscription.forWorkspace",{name:d})})]})]}),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()&&D.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-sm text-slate-600",children:b("pricing.currency")}),e.jsx("select",{"aria-label":b("pricing.selectCurrency"),value:U,onChange:e=>L(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:D.map(t=>{const r=_l(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:b("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":b("pricing.billingInterval"),children:[Ua.Monthly,Ua.Quarterly,Ua.Yearly].map(t=>{const r=P===t;return e.jsx("button",{onClick:()=>M(t),"aria-pressed":I===t,className:"flex-1 sm:flex-initial px-3 sm:px-4 py-2 text-sm font-medium rounded-md transition-all relative "+(I===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===Ua.Monthly&&b("subscription.billingInterval.monthly"),t===Ua.Quarterly&&b("subscription.billingInterval.quarterly"),t===Ua.Yearly&&b("subscription.billingInterval.yearly"),t===Ua.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:b("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:b("pricing.current")})]})},t)})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 flex flex-col",children:o?.trim()&&0===D.length?e.jsxs("div",{className:"text-center py-12 px-4",children:[e.jsx("p",{className:"text-slate-600 font-medium",children:b("pricing.noPlansCurrency")}),e.jsx("p",{className:"text-slate-500 text-sm mt-2",children:b("pricing.noPlansCurrencyHint")})]}):0===z.length?e.jsx("div",{className:"text-center py-12 text-gray-500",children:e.jsx("p",{children:b("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:z.map(t=>{const r=t._id===s,n=Z(t),a=K&&t._id===N,o=H(t),d=$(t),u=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===O.toLowerCase())?O:t.plan?.currency??O??"",p=os(t,O,Ua.Monthly)??0,m=I!==Ua.Monthly&&null!==o?mN(p,o,I):null,h=us(t,O),f=h?ps(t,O,I):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.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"text-lg font-bold text-slate-900",children:t.plan.name}),t.trial?.enabled&&t.trial.durationDays>0&&!r&&!l&&!i&&e.jsx("span",{className:"shrink-0 rounded-md bg-emerald-100 text-emerald-700 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider",children:b("subscription.trialBadge",{days:t.trial.durationDays})})]}),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:b("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:d&&null!==o||d?C(o,u)||b("pricing.free"):"—"}),null!==o&&o>0&&d&&e.jsx("span",{className:"text-sm text-slate-500",children:E(I)})]}),null!==m&&m>0&&d&&e.jsx("span",{className:"text-xs text-emerald-600 font-medium",children:b("subscription.savingsPercent",{percent:m})}),h?.enabled&&f&&f>0&&!k&&e.jsx("div",{className:"text-xs text-slate-500 mt-1",children:b("subscription.seatPriceDisplay",{price:w(f,u),interval:E(I),included:x(h.includedSeats),includedLabel:b("pricing.included")})})]}),B.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:b("subscription.items.features")}),e.jsx("div",{className:"space-y-1",children:B.map(r=>{const n=J(t,r,I),a=r.type===Ka&&!0===n;return e.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[r.type===Ka?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)})})]}),W.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:b("subscription.items.limits")}),e.jsx("div",{className:"space-y-1",children:W.map(r=>{const n=J(t,r,I);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?x(n):"—"})]},r._id)})})]}),h?.enabled&&!k&&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:b("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:b("subscription.seats.included")}),e.jsx("span",{className:"font-medium",children:x(h.includedSeats||0)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.seats.maxSeats")}),e.jsx("span",{className:"font-medium",children:(h?.maxSeats??0)>0?x(h.maxSeats):b("subscription.seats.unlimited")})]}),null!=c&&c>0&&(()=>{const t=Math.max(0,c-(h.includedSeats||0));return e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.seats.billable")}),e.jsx("span",{className:"font-medium "+(0===t?"text-emerald-600":"text-amber-600"),children:0===t?b("subscription.seats.allIncluded"):`${x(t)} ${b("subscription.seats.extra")}`})]})})()]})]}),t.creditGrant?.enabled&&"object"==typeof t.creditGrant.creditPackage&&null!==t.creditGrant.creditPackage&&e.jsxs("div",{className:"mb-3",children:[e.jsx("div",{className:"text-xs font-semibold text-purple-600 uppercase tracking-wider mb-1.5",children:b("subscription.items.credits")}),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:t.creditGrant.renewOnPeriod?b("subscription.items.creditsPerMonth"):b("subscription.items.creditsOneTime")}),e.jsx("span",{className:"font-semibold text-purple-700",children:x(t.creditGrant.creditPackage.creditAmount)})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-slate-600",children:b("subscription.items.creditRenewal")}),e.jsx("span",{className:"font-medium text-slate-700",children:t.creditGrant.renewOnPeriod?"reset"===t.creditGrant.mode?b("subscription.items.creditModeReset"):b("subscription.items.creditModeTopup"):b("subscription.items.creditModeLifetime")})]})]})]}),e.jsx(Ei,{className:"w-full mt-2",variant:n.variant,disabled:n.disabled||K||!d,progress:a,onClick:()=>G(t._id),children:a?b("pricing.processing"):d?n.dynamicLabel??b(n.labelKey):b("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:260+220*z.length+"px",borderCollapse:"separate"},children:[e.jsxs("colgroup",{children:[e.jsx("col",{style:{width:260,minWidth:260}}),z.map(t=>e.jsx("col",{style:{width:220,minWidth:220}},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"}),z.map(t=>{const r=t._id===s,n=Z(t),a=K&&t._id===N,o=H(t),c=os(t,O,Ua.Monthly)??0,d=I!==Ua.Monthly&&null!==o?mN(c,o,I):null,u=$(t),p=t.pricingVariants?.length&&t.pricingVariants.some(e=>e.currency?.toLowerCase()===O.toLowerCase())?O:t.plan?.currency??O??"";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-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("h3",{className:"text-base font-bold text-slate-900 truncate",children:t.plan.name}),t.trial?.enabled&&t.trial.durationDays>0&&!r&&!l&&!i&&e.jsx("span",{className:"shrink-0 rounded-md bg-emerald-100 text-emerald-700 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider",children:b("subscription.trialBadge",{days:t.trial.durationDays})})]}),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:b("pricing.current")})]}),e.jsxs("div",{className:"flex flex-col items-start min-h-[3rem]",children:[e.jsxs("div",{className:"flex items-baseline gap-1 flex-wrap",children:[e.jsx("span",{className:"text-2xl font-bold text-slate-900",children:u&&null!==o||u?C(o,p)||b("pricing.free"):"—"}),null!==o&&o>0&&u&&e.jsx("span",{className:"text-sm text-slate-500",children:E(I)}),null!==d&&d>0&&u&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-emerald-100 text-emerald-700 rounded-full font-semibold whitespace-nowrap",children:b("subscription.savingsPercent",{percent:d})})]}),(()=>{if(k)return null;const r=us(t,O);if(!r)return null;const n=ps(t,O,I);return!n||n<=0?null:e.jsx("div",{className:"text-[11px] text-slate-500 mt-1.5 border-t border-slate-100 pt-1 leading-tight",children:e.jsx("div",{children:b("subscription.seatPriceDisplay",{price:w(n,p),interval:E(I),included:x(r.includedSeats),includedLabel:b("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(Ei,{className:"mt-auto w-full",variant:n.variant,disabled:n.disabled||K||!u,progress:a,onClick:()=>G(t._id),children:a?b("pricing.processing"):u?n.dynamicLabel??b(n.labelKey):b("pricing.unavailable")})]})},t._id)})]})}),e.jsxs("tbody",{children:[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:b("subscription.items.features")}),e.jsx("td",{colSpan:z.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})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?O:r.plan?.currency??O??"",i=Y(n,t,a),o=t.type===Ka&&!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))]}),W.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:b("subscription.items.limits")}),e.jsx("td",{colSpan:z.length,className:"border-t border-slate-200 bg-slate-100"})]}),W.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})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?O:r.plan?.currency??O??"",i=Y(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))]}),V.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:b("subscription.items.quotas")}),e.jsx("td",{colSpan:z.length,className:"border-t border-slate-200 bg-slate-100"})]}),V.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})]}),z.map(r=>{const n=J(r,t,I),a=r.pricingVariants?.length?O:r.plan?.currency??O??"",i=Y(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))]}),!k&&z.some(e=>{const t=us(e,O);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:b("subscription.seats.title")}),e.jsx("td",{colSpan:z.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:b("subscription.seats.includedSeats")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:b("subscription.seats.freeWithBase")})]}),z.map(t=>{const r=us(t,O);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?x(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:b("subscription.seats.maxSeats")})}),z.map(t=>{const r=us(t,O);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)>0?x(r.maxSeats):b("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:b("subscription.seats.perExtraSeat")})}),z.map(t=>{const r=ps(t,O,I),n=t.pricingVariants?.length?O:t.plan?.currency??O??"";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?`${w(r,n)}${E(I)}`:"—"})},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:b("subscription.seats.billable")}),e.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:b("subscription.membersInWorkspace",{count:c})})]}),z.map(t=>{const r=us(t,O);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:b("subscription.seats.allIncluded")}):e.jsxs("span",{className:"text-sm font-medium text-amber-600",children:[x(a)," ",b("subscription.seats.extra")]})},t._id)})]})]}),z.some(e=>e.creditGrant?.enabled&&"object"==typeof e.creditGrant.creditPackage&&null!==e.creditGrant.creditPackage)&&e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{className:"sticky start-0 z-10 border-t border-purple-200 bg-purple-50 px-4 py-2.5 font-semibold text-xs uppercase tracking-wider text-purple-700 shadow-[2px_0_4px_-2px_rgba(0,0,0,0.06)]",children:b("subscription.items.credits")}),e.jsx("td",{colSpan:z.length,className:"border-t border-purple-200 bg-purple-50"})]}),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:z.every(e=>!e.creditGrant?.enabled||!e.creditGrant.renewOnPeriod)?b("subscription.items.creditsOneTime"):b("subscription.items.creditsPerMonth")})}),z.map(t=>{const r=t.creditGrant,n=r?.enabled&&"object"==typeof r.creditPackage&&null!==r.creditPackage?r.creditPackage:null;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:n?e.jsx("span",{className:"text-sm font-semibold text-purple-700",children:x(n.creditAmount)}):e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},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:b("subscription.items.creditRenewal")})}),z.map(t=>{const r=t.creditGrant;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:r?.enabled?e.jsx("span",{className:"text-sm font-medium text-slate-700",children:r.renewOnPeriod?"reset"===r.mode?b("subscription.items.creditModeReset"):b("subscription.items.creditModeTopup"):b("subscription.items.creditModeLifetime")}):e.jsx("span",{className:"text-sm text-slate-400",children:"—"})},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:d}=ln(),[u,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}=ln(),r=En(),[n,a]=t.useState(null),[s,i]=t.useState(!0),[o,c]=t.useState(!1),[l,d]=t.useState(null),[u,p]=t.useState(!1),[m,h]=t.useState(null);return t.useEffect(()=>{let t=!1;return(async()=>{i(!0),d(null);try{const e=new vE(r),n=await e.fetchConfig();t||a(n)}catch(r){t||d(r instanceof Error?r.message:e("beta.errorMessage"))}finally{t||i(!1)}})(),()=>{t=!0}},[r]),{isLoading:s,isSubmitting:o,config:n,error:l,success:u,message:m,submitBetaForm:t.useCallback(async t=>{if(!r){const t=e("errors.generic");return d(t),{success:!1,message:t}}try{c(!0),d(null),p(!1),h(null);const e=new vE(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 d(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=mp({resolver:Sf(yE),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(Dl,{className:"h-24 w-24 rounded-lg"}),e.jsx(Dl,{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(Dl,{className:"h-4 w-16"}),e.jsx(Dl,{className:"h-10 w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Dl,{className:"h-4 w-16"}),e.jsx(Dl,{className:"h-10 w-full"})]}),e.jsx(Dl,{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(wE,{logo:y?.logo}),y?.name&&e.jsx("div",{children:y?.name})]}),e.jsx(Tu,{...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:d("beta.errorMessage")),h(!0)}}),className:a,noValidate:!0,"aria-busy":b,children:[!m&&e.jsxs(e.Fragment,{children:[!l&&y?.screen?.register&&e.jsx(xE,{screen:y?.screen?.register}),e.jsx(Hg,{control:S.control,name:"name",render:({field:t})=>e.jsxs(qg,{className:s,children:[e.jsx(Zg,{children:d("beta.nameLabel")}),e.jsx(Jg,{children:e.jsx(Qg,{...t})}),e.jsx(Yg,{}),e.jsx(Xg,{})]})}),e.jsx(Hg,{control:S.control,name:"email",render:({field:t})=>e.jsxs(qg,{className:s,children:[e.jsx(Zg,{children:d("beta.emailLabel")}),e.jsx(Jg,{children:e.jsx(Qg,{...t})}),e.jsx(Yg,{}),e.jsx(Xg,{})]})}),e.jsx(Ei,{type:"submit",disabled:!k,className:s,children:d(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":d("settings.common.error"),children:"❗"}),v]}),e.jsx("div",{className:"mt-4 flex justify-center",children:e.jsx(Ei,{type:"button",onClick:()=>{h(!1),S.reset()},className:s,children:d("beta.tryAgain")})})]}),m&&u&&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(xE,{screen:y?.screen?.thankYou})})]})}),!m&&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.CreditActionsProvider=uE,exports.CreditBalance=pE,exports.CreditBalanceContextProvider=ta,exports.CreditStorePage=function({children:r,loadingFallback:n,errorFallback:a,redirectBaseUrl:s}){const{packages:i,notes:o,loading:c,error:l,refetch:d}=Qn(),{isAuthenticated:u,signIn:p}=IC(),m=t.useCallback(e=>{if(u)_C.openWorkspaceSettings(CC.Credits,{action:Ea,packageId:e});else if(s){const t=Ra({action:Ea,screen:"credits",packageId:e},s);p(t)}else p()},[u,p,s]);return c?void 0!==n?e.jsx(e.Fragment,{children:n}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(Dl,{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(Dl,{className:"h-48 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,packages:i,notes:o,refetch:d,selectPackage:m})})},exports.FullScreenLoader=da,exports.PricingPage=function({slug:r,children:n,loadingFallback:a,errorFallback:s,redirectBaseUrl:i}){const{items:o,plans:c,notes:l,loading:d,error:u,refetch:p}=_n(r),{isAuthenticated:m,signIn:h}=IC(),f=t.useCallback((e,t,r)=>i?Ra({action:"selectPlan",plan:e,interval:t,currency:r},i):null,[i]),g=t.useCallback((e,t,r)=>{if(m)return void _C.openWorkspaceSettings(CC.Subscription,{action:"selectPlan",plan:e,interval:t,currency:r});const n=f(e,t,r);h(n??void 0)},[m,h,f]);return d?void 0!==a?e.jsx(e.Fragment,{children:a}):e.jsxs("div",{className:"space-y-4",children:[e.jsx(Dl,{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(Dl,{className:"h-64 rounded-lg"},t))})]}):u?s?e.jsx(e.Fragment,{children:s(u)}):e.jsx("div",{className:"rounded-lg border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:u}):e.jsx(e.Fragment,{children:n({loading:d,error:u,items:o,plans:c,notes:l,refetch:p,selectPlan:g})})},exports.PushNotificationProvider=Wv,exports.QuotaUsageContextProvider=oa,exports.SETTINGS_SCREENS=EC,exports.SUPPORTED_LOCALES=Xr,exports.SaaSOSProvider=GC,exports.SettingsScreen=CC,exports.SubscriptionContextProvider=Wn,exports.WhenAuthenticated=HC,exports.WhenCreditsAvailable=mE,exports.WhenCreditsExhausted=hE,exports.WhenCreditsLow=fE,exports.WhenNoSubscription=rE,exports.WhenNotTrialing=sE,exports.WhenPermission=ZC,exports.WhenQuotaAvailable=oE,exports.WhenQuotaExhausted=cE,exports.WhenQuotaOverage=lE,exports.WhenQuotaThreshold=dE,exports.WhenRoles=KC,exports.WhenSubscription=tE,exports.WhenSubscriptionToPlans=nE,exports.WhenTrialEnding=iE,exports.WhenTrialing=aE,exports.WhenUnauthenticated=$C,exports.WhenUserFeatureDisabled=eE,exports.WhenUserFeatureEnabled=QC,exports.WhenWorkspaceFeatureDisabled=XC,exports.WhenWorkspaceFeatureEnabled=YC,exports.WhenWorkspaceRoles=qC,exports.WorkspaceSwitcher=function(r){const{t:n,dir:a}=ln(),{isAuthenticated:s,user:i}=IC(),o=rt(En()),{workspaces:c,currentWorkspace:l,loading:d,refreshing:u,switchingToId:p,fetchWorkspaces:m,getFeatures:h,refreshWorkspaces:f,setCurrentWorkspace:g,switchToWorkspace:b}=PC(),{settings:v}=An(),[y,x]=t.useState(!1),[w,S]=t.useState(0),[k,C]=t.useState(""),E=d||u;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,_=v?.workspace?.showSwitcher??!0,P=v?.workspace?.maxWorkspacesPerUser??0,T=N?.filter(e=>("object"==typeof e.createdBy?e.createdBy._id?.toString():e.createdBy?.toString())===i?.id?.toString()).length??0,R=!1!==j&&(0===P||T<P);return t.useEffect(()=>{!_&&c.length>0&&!l&&b(c[0]).catch(e=>{Te(e,{component:"WorkspaceProvider",action:"autoSelectWorkspace"})})},[_,c,l]),!_&&l?e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>x(!0),children:r.trigger?.(E,l)}),e.jsx(AC,{workspace:l,open:y,onOpenChange:x,showTrigger:!1})]}):e.jsxs(il,{open:y,onOpenChange:x,children:[e.jsx(ol,{children:r.trigger?.(E,l)}),e.jsxs(dl,{dir:a,className:"max-w-2xl min-w-full sm:min-w-[800px]",children:[e.jsxs(ul,{dir:a,children:[e.jsxs(pl,{className:"flex items-center gap-2",children:[e.jsx(Is,{className:"h-5 w-5"}),n("workspace.switchTitle")]}),e.jsx(ml,{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(nN,{workspace:l,isCurrentWorkspace:!0,switchToWorkspace:b,switchingToId:p,onClose:()=>x(!1),setCurrentWorkspace:g,setOpen:x,workspacesToUse:N}),e.jsx(rN,{}),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(Ei,{progress:u,disabled:u,variant:"ghost",onClick:function(){s&&o&&S(e=>e+1)},startIcon:e.jsx(Zs,{}),children:n("settings.common.refreshAction",{loading:String(u)})})})]}),e.jsxs("div",{className:"relative",children:[e.jsx(Ys,{className:"absolute start-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(Qg,{placeholder:n("workspace.searchPlaceholder"),value:k,onChange:e=>C(e.target.value),className:"ps-10"})]}),d?e.jsxs("div",{className:"flex items-center justify-center py-8",children:[e.jsx($s,{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(Is,{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(Iv,{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(nN,{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(rN,{}),e.jsx(aN,{onCreated:()=>{m()}})]})]})]})]})},exports.useAllQuotaUsage=Fn,exports.useBillingPortal=Ln,exports.useCancelSubscription=On,exports.useConsumeCredits=qn,exports.useCreateCheckoutSession=Dn,exports.useCreditBalance=Kn,exports.useCreditBalanceContext=ra,exports.useCreditPackages=Jn,exports.useCreditTransactions=Yn,exports.useExpiringCredits=Xn,exports.useFullScreenLoader=ma,exports.useInvoice=(e,r)=>{const{t:n}=ln(),{api:a}=jn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e&&r){c(!0),d(null);try{const t=await a.getInvoice(e,r);i(t.invoice)}catch(t){const a=De(t,"errors.fetchInvoice",n);d(a),Te(t,{component:"useInvoice",action:"fetchInvoice",metadata:{workspaceId:e,invoiceId:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{invoice:s,loading:o,error:l,refetch:u}},exports.useInvoices=Un,exports.usePermissions=Nl,exports.usePlanGroup=Tn,exports.usePlanGroupVersions=Rn,exports.usePublicCreditPackages=Qn,exports.usePublicPlanGroupVersion=e=>{const{t:r}=ln(),{api:n}=jn(),[a,s]=t.useState(null),[i,o]=t.useState(!1),[c,l]=t.useState(null),d=t.useCallback(async()=>{if(e){o(!0),l(null);try{const t=await n.getPlanGroupVersion(e);s(t)}catch(t){const n=De(t,"errors.fetchPlanGroupVersion",r);l(n),Te(t,{component:"usePublicPlanGroupVersion",action:"fetchVersion",metadata:{groupVersionId:e}})}finally{o(!1)}}else s(null)},[n,e]);return t.useEffect(()=>{d()},[d]),{planGroupVersion:a,loading:i,error:c,refetch:d}},exports.usePublicPlans=_n,exports.usePurchaseCredits=Zn,exports.usePushNotifications=Vv,exports.useQuotaUsageContext=ca,exports.useQuotaUsageStatus=(e,r)=>{const{t:n}=ln(),{api:a}=jn(),[s,i]=t.useState(null),[o,c]=t.useState(!1),[l,d]=t.useState(null),u=t.useCallback(async()=>{if(e&&r){c(!0),d(null);try{const t=await a.getQuotaUsageStatus(e,r);i(t)}catch(t){const a=De(t,"errors.fetchQuotaUsage",n);d(a),Te(t,{component:"useQuotaUsageStatus",action:"fetchStatus",metadata:{workspaceId:e,quotaSlug:r}})}finally{c(!1)}}else i(null)},[a,e,r]);return t.useEffect(()=>{u()},[u]),{status:s,loading:o,error:l,refetch:u}},exports.useRecordUsage=e=>{const{t:r}=ln(),{api:n}=jn(),[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 It(),r}catch(n){const a=De(n,"errors.recordUsage",r);throw o(a),Te(n,{component:"useRecordUsage",action:"recordUsage",metadata:{workspaceId:e,request:t}}),n}finally{s(!1)}},[n,e]),loading:a,error:i}},exports.useResumeSubscription=zn,exports.useSaaSAuth=IC,exports.useSaaSOs=En,exports.useSaaSSettings=An,exports.useSaaSWorkspaces=PC,exports.useSeatStatus=vC,exports.useSubscription=Pn,exports.useSubscriptionContext=Vn,exports.useSubscriptionManagement=Mn,exports.useTranslation=ln,exports.useTrialStatus=function(){const{response:e}=Vn();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=gE(t.trialEnd)??gE(t.stripeCurrentPeriodEnd),n=gE(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=In,exports.useUsageLogs=(e,r,n)=>{const{t:a}=ln(),{api:s}=jn(),[i,o]=t.useState([]),[c,l]=t.useState(0),[d,u]=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,C=n?.source,E=n?.page,N=n?.limit,A=t.useCallback(async()=>{if(!e)return o([]),l(0),u(0),m(1),f(!1),void b(!1);y(!0),w(null);try{const t={...r&&{quotaSlug:r},...S&&{from:S},...k&&{to:k},...C&&{source:C},...E&&{page:E},...N&&{limit:N}},n=await s.getUsageLogs(e,t);o(n.docs||[]),l(n.totalDocs||0),u(n.totalPages||0),m(n.page||1),f(n.hasNextPage||!1),b(n.hasPrevPage||!1)}catch(t){const n=De(t,"errors.fetchUsageLogs",a);w(n),Te(t,{component:"useUsageLogs",action:"fetchLogs",metadata:{workspaceId:e,quotaSlug:r}})}finally{y(!1)}},[s,e,r,S,k,C,E,N]);return t.useEffect(()=>{A()},[A]),{logs:i,totalDocs:c,totalPages:d,page:p,hasNextPage:h,hasPrevPage:g,loading:v,error:x,refetch:A}},exports.useUserAttributes=function(){const e=t.useContext(OC);if(void 0===e)throw new Error("useUserAttributes must be used within a UserProvider");return e},exports.useUserFeatures=JC;