@zuplo/editor 1.0.18288435022-dev → 1.0.18294202458-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/local.html +1 -1
- package/dist/client/static/js/App-D5-r7r-7.js +457 -0
- package/dist/client/static/js/App-D5-r7r-7.js.map +1 -0
- package/dist/client/static/js/LocalEditorPage-CCG4v-Fn.js +1815 -0
- package/dist/client/static/js/LocalEditorPage-CCG4v-Fn.js.map +1 -0
- package/dist/client/static/js/LocalProjectPage-BBCigkiz.js +22 -0
- package/dist/client/static/js/LocalProjectPage-BBCigkiz.js.map +1 -0
- package/dist/client/static/js/Skeleton-BeJ51E3q.js +12 -0
- package/dist/client/static/js/Skeleton-BeJ51E3q.js.map +1 -0
- package/dist/client/static/js/local-worker-CmThaCEP.js +2 -0
- package/dist/client/static/js/local-worker-CmThaCEP.js.map +1 -0
- package/dist/client/static/js/{main-BKE_GwQc.js → main-unOFXwzS.js} +3 -4
- package/dist/client/static/js/main-unOFXwzS.js.map +1 -0
- package/dist/routes/api.d.ts.map +1 -1
- package/dist/routes/api.js +0 -5
- package/dist/routes/api.js.map +1 -1
- package/dist/routes/editor.d.ts.map +1 -1
- package/dist/routes/editor.js +19 -2
- package/dist/routes/editor.js.map +1 -1
- package/dist/routes/fs.d.ts.map +1 -1
- package/dist/routes/fs.js +51 -43
- package/dist/routes/fs.js.map +1 -1
- package/dist/routes/test.d.ts.map +1 -1
- package/dist/routes/test.js +13 -1
- package/dist/routes/test.js.map +1 -1
- package/dist/routes/types.d.ts.map +1 -1
- package/dist/routes/types.js +9 -1
- package/dist/routes/types.js.map +1 -1
- package/dist/server.d.ts +5 -2
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -11
- package/dist/server.js.map +1 -1
- package/package.json +6 -4
- package/dist/client/static/js/App-BfMl6jhU.js +0 -2162
- package/dist/client/static/js/App-BfMl6jhU.js.map +0 -1
- package/dist/client/static/js/local-worker-CT-ae3Yc.js +0 -2
- package/dist/client/static/js/local-worker-CT-ae3Yc.js.map +0 -1
- package/dist/client/static/js/main-BKE_GwQc.js.map +0 -1
- /package/dist/client/static/css/{App-DH9HRCOf.css → LocalEditorPage-DH9HRCOf.css} +0 -0
@@ -0,0 +1,457 @@
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/static/js/local-worker-CmThaCEP.js","/static/js/main-unOFXwzS.js","/static/css/main-DB0Klj1W.css","/static/js/LocalProjectPage-BBCigkiz.js","/static/js/Skeleton-BeJ51E3q.js","/static/js/LocalEditorPage-CCG4v-Fn.js","/static/css/LocalEditorPage-DH9HRCOf.css"])))=>i.map(i=>d[i]);
|
2
|
+
var bM=Object.defineProperty;var nw=e=>{throw TypeError(e)};var xM=(e,t,n)=>t in e?bM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var rt=(e,t,n)=>xM(e,typeof t!="symbol"?t+"":t,n),fm=(e,t,n)=>t.has(e)||nw("Cannot "+n);var T=(e,t,n)=>(fm(e,t,"read from private field"),n?n.call(e):t.get(e)),we=(e,t,n)=>t.has(e)?nw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ie=(e,t,n,r)=>(fm(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),We=(e,t,n)=>(fm(e,t,"access private method"),n);var Od=(e,t,n,r)=>({set _(s){ie(e,t,s,n)},get _(){return T(e,t,r)}});import{r as h,j as d,a as wM,g as Bl,R as qs,b as ce,l as Et,c as _M,L as ba,w as EM,_ as qg}from"./main-unOFXwzS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fa43665c-6653-45c3-a7db-d8f8d8c50617",e._sentryDebugIdIdentifier="sentry-dbid-fa43665c-6653-45c3-a7db-d8f8d8c50617")}catch{}})();function PC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=PC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function jC(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=PC(e))&&(r&&(r+=" "),r+=t);return r}const rb="-",SM=e=>{const t=TM(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(rb);return a[0]===""&&a.length!==1&&a.shift(),AC(a,t)||CM(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},AC=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?AC(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(rb);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId},rw=/^\[(.+)\]$/,CM=e=>{if(rw.test(e)){const t=rw.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},TM=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return NM(Object.entries(e.classGroups),n).forEach(([o,i])=>{Hg(i,r,o,t)}),r},Hg=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:sw(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(RM(s)){Hg(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{Hg(i,sw(t,o),n,r)})})},sw=(e,t)=>{let n=e;return t.split(rb).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},RM=e=>e.isThemeGetter,NM=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,a])=>[t+i,a])):o);return[n,s]}):e,PM=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}},$C="!",jM=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,i=a=>{const l=[];let c=0,u=0,f;for(let v=0;v<a.length;v++){let b=a[v];if(c===0){if(b===s&&(r||a.slice(v,v+o)===t)){l.push(a.slice(u,v)),u=v+o;continue}if(b==="/"){f=v;continue}}b==="["?c++:b==="]"&&c--}const p=l.length===0?a:a.substring(u),g=p.startsWith($C),y=g?p.substring(1):p,m=f&&f>u?f-u:void 0;return{modifiers:l,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:m}};return n?a=>n({className:a,parseClassName:i}):i},AM=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},$M=e=>({cache:PM(e.cacheSize),parseClassName:jM(e),...SM(e)}),DM=/\s+/,kM=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],i=e.trim().split(DM);let a="";for(let l=i.length-1;l>=0;l-=1){const c=i[l],{modifiers:u,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:g}=n(c);let y=!!g,m=r(y?p.substring(0,g):p);if(!m){if(!y){a=c+(a.length>0?" "+a:a);continue}if(m=r(p),!m){a=c+(a.length>0?" "+a:a);continue}y=!1}const v=AM(u).join(":"),b=f?v+$C:v,x=b+m;if(o.includes(x))continue;o.push(x);const w=s(m,y);for(let _=0;_<w.length;++_){const E=w[_];o.push(b+E)}a=c+(a.length>0?" "+a:a)}return a};function OM(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=DC(t))&&(r&&(r+=" "),r+=n);return r}const DC=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=DC(e[r]))&&(n&&(n+=" "),n+=t);return n};function MM(e,...t){let n,r,s,o=i;function i(l){const c=t.reduce((u,f)=>f(u),e());return n=$M(c),r=n.cache.get,s=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const u=kM(l,n);return s(l,u),u}return function(){return o(OM.apply(null,arguments))}}const mt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},kC=/^\[(?:([a-z-]+):)?(.+)\]$/i,IM=/^\d+\/\d+$/,FM=new Set(["px","full","screen"]),LM=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,UM=/\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$/,BM=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,VM=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,zM=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Es=e=>Ja(e)||FM.has(e)||IM.test(e),oo=e=>Vl(e,"length",QM),Ja=e=>!!e&&!Number.isNaN(Number(e)),hm=e=>Vl(e,"number",Ja),pc=e=>!!e&&Number.isInteger(Number(e)),WM=e=>e.endsWith("%")&&Ja(e.slice(0,-1)),Ke=e=>kC.test(e),io=e=>LM.test(e),qM=new Set(["length","size","percentage"]),HM=e=>Vl(e,qM,OC),GM=e=>Vl(e,"position",OC),KM=new Set(["image","url"]),YM=e=>Vl(e,KM,JM),ZM=e=>Vl(e,"",XM),mc=()=>!0,Vl=(e,t,n)=>{const r=kC.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},QM=e=>UM.test(e)&&!BM.test(e),OC=()=>!1,XM=e=>VM.test(e),JM=e=>zM.test(e),eI=()=>{const e=mt("colors"),t=mt("spacing"),n=mt("blur"),r=mt("brightness"),s=mt("borderColor"),o=mt("borderRadius"),i=mt("borderSpacing"),a=mt("borderWidth"),l=mt("contrast"),c=mt("grayscale"),u=mt("hueRotate"),f=mt("invert"),p=mt("gap"),g=mt("gradientColorStops"),y=mt("gradientColorStopPositions"),m=mt("inset"),v=mt("margin"),b=mt("opacity"),x=mt("padding"),w=mt("saturate"),_=mt("scale"),E=mt("sepia"),S=mt("skew"),R=mt("space"),C=mt("translate"),N=()=>["auto","contain","none"],k=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto",Ke,t],L=()=>[Ke,t],G=()=>["",Es,oo],$=()=>["auto",Ja,Ke],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",Ke],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ee=()=>[Ja,Ke];return{cacheSize:500,separator:":",theme:{colors:[mc],spacing:[Es,oo],blur:["none","",io,Ke],brightness:ee(),borderColor:[e],borderRadius:["none","","full",io,Ke],borderSpacing:L(),borderWidth:G(),contrast:ee(),grayscale:U(),hueRotate:ee(),invert:U(),gap:L(),gradientColorStops:[e],gradientColorStopPositions:[WM,oo],inset:V(),margin:V(),opacity:ee(),padding:L(),saturate:ee(),scale:ee(),sepia:U(),skew:ee(),space:L(),translate:L()},classGroups:{aspect:[{aspect:["auto","square","video",Ke]}],container:["container"],columns:[{columns:[io]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"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"],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:[...I(),Ke]}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",pc,Ke]}],basis:[{basis:V()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ke]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",pc,Ke]}],"grid-cols":[{"grid-cols":[mc]}],"col-start-end":[{col:["auto",{span:["full",pc,Ke]},Ke]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[mc]}],"row-start-end":[{row:["auto",{span:[pc,Ke]},Ke]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ke]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ke]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],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:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[R]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[R]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ke,t]}],"min-w":[{"min-w":[Ke,t,"min","max","fit"]}],"max-w":[{"max-w":[Ke,t,"none","full","min","max","fit","prose",{screen:[io]},io]}],h:[{h:[Ke,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ke,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ke,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ke,t,"auto","min","max","fit"]}],"font-size":[{text:["base",io,oo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",hm]}],"font-family":[{font:[mc]}],"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:["tighter","tight","normal","wide","wider","widest",Ke]}],"line-clamp":[{"line-clamp":["none",Ja,hm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Es,Ke]}],"list-image":[{"list-image":["none",Ke]}],"list-style-type":[{list:["none","disc","decimal",Ke]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Es,oo]}],"underline-offset":[{"underline-offset":["auto",Es,Ke]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),GM]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",HM]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},YM]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:j()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[Es,Ke]}],"outline-w":[{outline:[Es,oo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Es,oo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",io,ZM]}],"shadow-color":[{shadow:[mc]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",io,Ke]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[f]}],saturate:[{saturate:[w]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[w]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ke]}],duration:[{duration:ee()}],ease:[{ease:["linear","in","out","in-out",Ke]}],delay:[{delay:ee()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ke]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[pc,Ke]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ke]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",Ke]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",Ke]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Es,oo,hm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},tI=MM(eI);function se(...e){return tI(jC(e))}const nI="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAYAAAA8AXHiAAAACXBIWXMAAAAAAAAAAQCEeRdzAAAGWElEQVR4nO2dy4oeVRSFo4gXUBEnJqMEzESciIPMvIGCQxUzc6JkojhylKFvEB/Dl7CjCQYj0Yhi1BBFHPkGDiu9/C1S/nTnr+o+q9beZ68PNjR0d11OfVVn17nVicEYAifUB2D6xGIZChbLULBYhoLFMhQslqFgsQwFi2UoWCxDwWIZChbLULBYhoLFMhQslqFgsQwFi2UoWCxDwWIZChbLULBYhoLFMhQslqFgsQwFi2UoWCxDwWIZChbLULBYhoLF2uazv4bhwi/D8Op39+LU1WF46qtN4Ofp7/C3+B/zP2qL9fnfw/D2jxtZHvhivzSOGdgGtoVtYtuFqScWnjCtRJorGvZZjBpiXdqvqs5eW0em+0mGYyjyJOtbrIu/b/IilUyHBY7pUt95WZ9ioep5aE8v0K7AMXZaTfYlFqqZiE+oOU+wzqrIPsT6859hePFbvSDHDZwDzqUD8ouFOz1DtTc3cC4dPL1yi4UGSrUIrEBbWGJyioXqImMutTTQBpa0aswnFgr6scv6i75W4FwTypVLLOQeykZOVSTMu/KIVVWqMXDuieTKIVZ1qRLKFV8s5BeW6l6gWkyQc8UWq1qiPjcSJPSxxarQpHDUQFNEYOKK9UrHjZ+t4q24jagxxUKCqr5oWSJoMh9PLOQOPfX9sSNoMh9PrBeu6y9WtkCZBSOWWK4Cjx7BqsRYYvkt8OiBsgtEHLE+uKW/ONkDZRiEOGIpEvYH9+PRy+vEGueDMgxCDLEwm0Zxh5/5ehg+/WO9uHhnM/yYKVqQ2T8xxFLlVmuLNY3Xvuf0gQbJtfRi4Q5TSKUWC/H+rU113Pq8Arwh6sV69lpdsRDv/tT+yYUyFaMXSzkkJoJYiLONby6UqRitWOomhihiIalvfYPhhUiIVqyTVy3WGKcal8VJ7bAarVjqkaGRxHqp8TAhcXWoEytCv2AksZDEtz4/4duhTiwMUlOLhYZKyMWKN39YJlfr8xMOBNSJVaHD+fEv50vFuNGEjaU6sdQXfY14/eZ8sZ7/pv3+hXmWxYogFYLVf6i6vJK9fvyb/sJHkuqj27xjQVkL0Ij18g39xUc8d30Yzt1YFs9caSsVArkY6xzf0STwGrFOC/sHjyPAGzfbb/Mc+SY7rek3rClWFKl2bdNiLUQpViWpyomlmjdYTSrEI3uSS1xHrIpSIUTj4GuIVVUqi2WpaFGqKlwrea8uFaJU8r6GWJbKYjUPNDpGkOq9n7VSlROL2aWDoSKtpXr6yvKunyjf9inVpcPshP7w11xVFTtKdUL/u2dCIT65YGAdAiM81ReeHarLK9szYyIFJiTMleo8YaJotBAuEqITizH1CxMS5or1BHGoSpQQTgHrazLFkmoQEjInUqy1dNH9ouRkCsb0r/MLnljsgFxqsUpO/wKtc5yl0616FqvshFXQOs/CNHW1UFHEKj3FvvWiIFhrSi1UFLFKLwoCWleHUabNK8Uqv4wRaL3wGgo1QhKvFMsLrw2ct8MIcinF8lKR/8FYxwFyoSO4mlhe3HYCczluNFRCsE9u1xDLy3FvscZw5Yf31vtgAGM15F2BL68GIY5Y6vVIewh/8uQQKqyZxYogudVILLEiLB+ZNQK8CU6JJRbwhzCXB76fHYx4YvnTvcvCn+5dgKvE+RGsChyJKRaIsKpy9BAO5NtFXLGA+ssVkUM8LGYXscVC7oBGP/VFjBYok4B51ZTYYgEUYO+zaZZE0GR9m/hiASSolmtTBkGT9W1yiAWqy5VIKpBHLFBVLlR/iaQCucQC1RL6BIn6QeQTC6CgKzRF4BwTSgVyijXScyNq4MbPOeQWCyD36KlvMWE+dRD5xQKoLnoYFYFRCkmrvm36EGsEd3rGwYI45g6eUlP6EmsEQ3QzVI944ws0nLglfYo1ghkrEZ9gOKYgs2lY9C3WCKoZzA5WNq5i3ziGzqq8w6gh1hTMYUT70BqSYR/Yl3iBDgX1xJqCpwfai1qJhrwO28I2izyZDqO2WAeB3AdPGLz6jwFZkBch8PP0d/jbzvOlo2CxDAWLZShYLEPBYhkKFstQsFiGgsUyFCyWoWCxDAWLZShYLEPBYhkKFstQsFiGgsUyFCyWoWCxDAWLZShYLEPBYhkKFstQsFiGgsUyFCyWoWCxDAWLZShYLEPBYhkKFstQuAuHQWblXH1mCgAAAABJRU5ErkJggg==";function rI(){const[e,t]=h.useState(!1);return h.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow="initial"}),[]),d.jsxs("div",{className:"flex flex-row justify-center h-full w-full relative items-center",children:[d.jsx("img",{src:nI,className:se("size-20",e&&"hidden")}),d.jsx("img",{src:"/zuplo.apng",className:se("h-20 w-20",!e&&"hidden"),onLoad:()=>t(!0)})]})}const sI=h.createContext(null);function oI(e,t){const n=new Set(e.requirements),r={...e.timestamps};switch(t.type){case"add":return n.add(t.id),r[t.id]=Date.now(),{requirements:[...n],timestamps:r};case"remove":return n.delete(t.id),delete r[t.id],{requirements:[...n],timestamps:r};default:throw new Error}}const iI=({children:e})=>{const[t,n]=h.useReducer(oI,{requirements:[],timestamps:{}}),r=h.useRef(null),s=h.useRef(new Set),o=h.useCallback(a=>n({type:"add",id:a}),[]),i=h.useCallback(a=>n({type:"remove",id:a}),[]);return h.useEffect(()=>(t.requirements.length>0?r.current=setInterval(()=>{const a=Date.now(),l=2e3;t.requirements.forEach(c=>{const u=t.timestamps[c];u&&a-u>l&&(s.current.has(c)||(console.warn(`🐌 Slow loading detected: "${c}" has been loading for ${Math.round((a-u)/1e3)} seconds`),s.current.add(c)))})},2e3):(r.current&&(clearInterval(r.current),r.current=null),s.current.clear()),()=>{r.current&&clearInterval(r.current)}),[t.requirements,t.timestamps]),d.jsxs(sI.Provider,{value:{add:o,remove:i},children:[t.requirements.length>0&&d.jsx(rI,{}),e]})};var zl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},aI={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},_o,nb,yC,lI=(yC=class{constructor(){we(this,_o,aI);we(this,nb,!1)}setTimeoutProvider(e){ie(this,_o,e)}setTimeout(e,t){return T(this,_o).setTimeout(e,t)}clearTimeout(e){T(this,_o).clearTimeout(e)}setInterval(e,t){return T(this,_o).setInterval(e,t)}clearInterval(e){T(this,_o).clearInterval(e)}},_o=new WeakMap,nb=new WeakMap,yC),Ai=new lI;function cI(e){setTimeout(e,0)}var Xi=typeof window>"u"||"Deno"in globalThis;function $n(){}function uI(e,t){return typeof e=="function"?e(t):e}function Gg(e){return typeof e=="number"&&e>=0&&e!==1/0}function MC(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Io(e,t){return typeof e=="function"?e(t):e}function vr(e,t){return typeof e=="function"?e(t):e}function ow(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==sb(i,t.options))return!1}else if(!pu(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function iw(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Ji(t.options.mutationKey)!==Ji(o))return!1}else if(!pu(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function sb(e,t){return((t==null?void 0:t.queryKeyHashFn)||Ji)(e)}function Ji(e){return JSON.stringify(e,(t,n)=>Kg(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function pu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>pu(e[n],t[n])):!1}var dI=Object.prototype.hasOwnProperty;function IC(e,t){if(e===t)return e;const n=aw(e)&&aw(t);if(!n&&!(Kg(e)&&Kg(t)))return t;const s=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),i=o.length,a=n?new Array(i):{};let l=0;for(let c=0;c<i;c++){const u=n?c:o[c],f=e[u],p=t[u];if(f===p){a[u]=f,(n?c<s:dI.call(e,u))&&l++;continue}if(f===null||p===null||typeof f!="object"||typeof p!="object"){a[u]=p;continue}const g=IC(f,p);a[u]=g,g===f&&l++}return s===i&&l===s?e:a}function Uf(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function aw(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Kg(e){if(!lw(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!lw(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function lw(e){return Object.prototype.toString.call(e)==="[object Object]"}function fI(e){return new Promise(t=>{Ai.setTimeout(t,e)})}function Yg(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?IC(e,t):t}function hI(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function pI(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var ob=Symbol();function FC(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===ob?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function LC(e,t){return typeof e=="function"?e(...t):!!e}var Ii,Eo,ul,bC,mI=(bC=class extends zl{constructor(){super();we(this,Ii);we(this,Eo);we(this,ul);ie(this,ul,t=>{if(!Xi&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,Eo)||this.setEventListener(T(this,ul))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,Eo))==null||t.call(this),ie(this,Eo,void 0))}setEventListener(t){var n;ie(this,ul,t),(n=T(this,Eo))==null||n.call(this),ie(this,Eo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){T(this,Ii)!==t&&(ie(this,Ii,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof T(this,Ii)=="boolean"?T(this,Ii):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ii=new WeakMap,Eo=new WeakMap,ul=new WeakMap,bC),ib=new mI;function Zg(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var gI=cI;function vI(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=gI;const o=a=>{t?e.push(a):s(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Yt=vI(),dl,So,fl,xC,yI=(xC=class extends zl{constructor(){super();we(this,dl,!0);we(this,So);we(this,fl);ie(this,fl,t=>{if(!Xi&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){T(this,So)||this.setEventListener(T(this,fl))}onUnsubscribe(){var t;this.hasListeners()||((t=T(this,So))==null||t.call(this),ie(this,So,void 0))}setEventListener(t){var n;ie(this,fl,t),(n=T(this,So))==null||n.call(this),ie(this,So,t(this.setOnline.bind(this)))}setOnline(t){T(this,dl)!==t&&(ie(this,dl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return T(this,dl)}},dl=new WeakMap,So=new WeakMap,fl=new WeakMap,xC),Bf=new yI;function bI(e){return Math.min(1e3*2**e,3e4)}function UC(e){return(e??"online")==="online"?Bf.isOnline():!0}var Qg=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function BC(e){let t=!1,n=0,r;const s=Zg(),o=()=>s.status!=="pending",i=m=>{var v;if(!o()){const b=new Qg(m);p(b),(v=e.onCancel)==null||v.call(e,b)}},a=()=>{t=!0},l=()=>{t=!1},c=()=>ib.isFocused()&&(e.networkMode==="always"||Bf.isOnline())&&e.canRun(),u=()=>UC(e.networkMode)&&e.canRun(),f=m=>{o()||(r==null||r(),s.resolve(m))},p=m=>{o()||(r==null||r(),s.reject(m))},g=()=>new Promise(m=>{var v;r=b=>{(o()||c())&&m(b)},(v=e.onPause)==null||v.call(e)}).then(()=>{var m;r=void 0,o()||(m=e.onContinue)==null||m.call(e)}),y=()=>{if(o())return;let m;const v=n===0?e.initialPromise:void 0;try{m=v??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(f).catch(b=>{var S;if(o())return;const x=e.retry??(Xi?0:3),w=e.retryDelay??bI,_=typeof w=="function"?w(n,b):w,E=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!E){p(b);return}n++,(S=e.onFail)==null||S.call(e,n,b),fI(_).then(()=>c()?void 0:g()).then(()=>{t?p(b):y()})})};return{promise:s,status:()=>s.status,cancel:i,continue:()=>(r==null||r(),s),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?y():g().then(y),s)}}var Fi,wC,VC=(wC=class{constructor(){we(this,Fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Gg(this.gcTime)&&ie(this,Fi,Ai.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xi?1/0:5*60*1e3))}clearGcTimeout(){T(this,Fi)&&(Ai.clearTimeout(T(this,Fi)),ie(this,Fi,void 0))}},Fi=new WeakMap,wC),Li,hl,pr,Ui,en,Yu,Bi,jr,Rs,_C,xI=(_C=class extends VC{constructor(t){super();we(this,jr);we(this,Li);we(this,hl);we(this,pr);we(this,Ui);we(this,en);we(this,Yu);we(this,Bi);ie(this,Bi,!1),ie(this,Yu,t.defaultOptions),this.setOptions(t.options),this.observers=[],ie(this,Ui,t.client),ie(this,pr,T(this,Ui).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ie(this,Li,cw(this.options)),this.state=t.state??T(this,Li),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=T(this,en))==null?void 0:t.promise}setOptions(t){if(this.options={...T(this,Yu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=cw(this.options);n.data!==void 0&&(this.setData(n.data,{updatedAt:n.dataUpdatedAt,manual:!0}),ie(this,Li,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,pr).remove(this)}setData(t,n){const r=Yg(this.state.data,t,this.options);return We(this,jr,Rs).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){We(this,jr,Rs).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=T(this,en))==null?void 0:r.promise;return(s=T(this,en))==null||s.cancel(t),n?n.then($n).catch($n):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,Li))}isActive(){return this.observers.some(t=>vr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ob||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Io(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!MC(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,en))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=T(this,en))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),T(this,pr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(T(this,en)&&(T(this,Bi)?T(this,en).cancel({revert:!0}):T(this,en).cancelRetry()),this.scheduleGc()),T(this,pr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||We(this,jr,Rs).call(this,{type:"invalidate"})}async fetch(t,n){var l,c,u,f,p,g,y,m,v,b,x,w;if(this.state.fetchStatus!=="idle"&&((l=T(this,en))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,en))return T(this,en).continueRetry(),T(this,en).promise}if(t&&this.setOptions(t),!this.options.queryFn){const _=this.observers.find(E=>E.options.queryFn);_&&this.setOptions(_.options)}const r=new AbortController,s=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(ie(this,Bi,!0),r.signal)})},o=()=>{const _=FC(this.options,n),S=(()=>{const R={client:T(this,Ui),queryKey:this.queryKey,meta:this.meta};return s(R),R})();return ie(this,Bi,!1),this.options.persister?this.options.persister(_,S,this):_(S)},a=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:T(this,Ui),state:this.state,fetchFn:o};return s(_),_})();(c=this.options.behavior)==null||c.onFetch(a,this),ie(this,hl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&We(this,jr,Rs).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta}),ie(this,en,BC({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:_=>{_ instanceof Qg&&_.revert&&this.setState({...T(this,hl),fetchStatus:"idle"}),r.abort()},onFail:(_,E)=>{We(this,jr,Rs).call(this,{type:"failed",failureCount:_,error:E})},onPause:()=>{We(this,jr,Rs).call(this,{type:"pause"})},onContinue:()=>{We(this,jr,Rs).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const _=await T(this,en).start();if(_===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(_),(g=(p=T(this,pr).config).onSuccess)==null||g.call(p,_,this),(m=(y=T(this,pr).config).onSettled)==null||m.call(y,_,this.state.error,this),_}catch(_){if(_ instanceof Qg){if(_.silent)return T(this,en).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw We(this,jr,Rs).call(this,{type:"error",error:_}),(b=(v=T(this,pr).config).onError)==null||b.call(v,_,this),(w=(x=T(this,pr).config).onSettled)==null||w.call(x,this.state.data,_,this),_}finally{this.scheduleGc()}}},Li=new WeakMap,hl=new WeakMap,pr=new WeakMap,Ui=new WeakMap,en=new WeakMap,Yu=new WeakMap,Bi=new WeakMap,jr=new WeakSet,Rs=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...zC(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ie(this,hl,t.manual?s:void 0),s;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Yt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,pr).notify({query:this,type:"updated",action:t})})},_C);function zC(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:UC(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function cw(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var In,Je,Zu,Pn,Vi,pl,Ds,Co,Qu,ml,gl,zi,Wi,To,vl,at,Dc,Xg,Jg,ev,tv,nv,rv,sv,WC,EC,wI=(EC=class extends zl{constructor(t,n){super();we(this,at);we(this,In);we(this,Je);we(this,Zu);we(this,Pn);we(this,Vi);we(this,pl);we(this,Ds);we(this,Co);we(this,Qu);we(this,ml);we(this,gl);we(this,zi);we(this,Wi);we(this,To);we(this,vl,new Set);this.options=n,ie(this,In,t),ie(this,Co,null),ie(this,Ds,Zg()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,Je).addObserver(this),uw(T(this,Je),this.options)?We(this,at,Dc).call(this):this.updateResult(),We(this,at,tv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ov(T(this,Je),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ov(T(this,Je),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,We(this,at,nv).call(this),We(this,at,rv).call(this),T(this,Je).removeObserver(this)}setOptions(t){const n=this.options,r=T(this,Je);if(this.options=T(this,In).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vr(this.options.enabled,T(this,Je))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");We(this,at,sv).call(this),T(this,Je).setOptions(this.options),n._defaulted&&!Uf(this.options,n)&&T(this,In).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,Je),observer:this});const s=this.hasListeners();s&&dw(T(this,Je),r,this.options,n)&&We(this,at,Dc).call(this),this.updateResult(),s&&(T(this,Je)!==r||vr(this.options.enabled,T(this,Je))!==vr(n.enabled,T(this,Je))||Io(this.options.staleTime,T(this,Je))!==Io(n.staleTime,T(this,Je)))&&We(this,at,Xg).call(this);const o=We(this,at,Jg).call(this);s&&(T(this,Je)!==r||vr(this.options.enabled,T(this,Je))!==vr(n.enabled,T(this,Je))||o!==T(this,To))&&We(this,at,ev).call(this,o)}getOptimisticResult(t){const n=T(this,In).getQueryCache().build(T(this,In),t),r=this.createResult(n,t);return EI(this,r)&&(ie(this,Pn,r),ie(this,pl,this.options),ie(this,Vi,T(this,Je).state)),r}getCurrentResult(){return T(this,Pn)}trackResult(t,n){return new Proxy(t,{get:(r,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&!this.options.experimental_prefetchInRender&&T(this,Ds).status==="pending"&&T(this,Ds).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(r,s))})}trackProp(t){T(this,vl).add(t)}getCurrentQuery(){return T(this,Je)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=T(this,In).defaultQueryOptions(t),r=T(this,In).getQueryCache().build(T(this,In),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return We(this,at,Dc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,Pn)))}createResult(t,n){var N;const r=T(this,Je),s=this.options,o=T(this,Pn),i=T(this,Vi),a=T(this,pl),c=t!==r?t.state:T(this,Zu),{state:u}=t;let f={...u},p=!1,g;if(n._optimisticResults){const k=this.hasListeners(),V=!k&&uw(t,n),L=k&&dw(t,r,n,s);(V||L)&&(f={...f,...zC(u.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:m,status:v}=f;g=f.data;let b=!1;if(n.placeholderData!==void 0&&g===void 0&&v==="pending"){let k;o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData)?(k=o.data,b=!0):k=typeof n.placeholderData=="function"?n.placeholderData((N=T(this,gl))==null?void 0:N.state.data,T(this,gl)):n.placeholderData,k!==void 0&&(v="success",g=Yg(o==null?void 0:o.data,k,n),p=!0)}if(n.select&&g!==void 0&&!b)if(o&&g===(i==null?void 0:i.data)&&n.select===T(this,Qu))g=T(this,ml);else try{ie(this,Qu,n.select),g=n.select(g),g=Yg(o==null?void 0:o.data,g,n),ie(this,ml,g),ie(this,Co,null)}catch(k){ie(this,Co,k)}T(this,Co)&&(y=T(this,Co),g=T(this,ml),m=Date.now(),v="error");const x=f.fetchStatus==="fetching",w=v==="pending",_=v==="error",E=w&&x,S=g!==void 0,C={status:v,fetchStatus:f.fetchStatus,isPending:w,isSuccess:v==="success",isError:_,isInitialLoading:E,isLoading:E,data:g,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:m,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!w,isLoadingError:_&&!S,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:_&&S,isStale:ab(t,n),refetch:this.refetch,promise:T(this,Ds),isEnabled:vr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const k=G=>{C.status==="error"?G.reject(C.error):C.data!==void 0&&G.resolve(C.data)},V=()=>{const G=ie(this,Ds,C.promise=Zg());k(G)},L=T(this,Ds);switch(L.status){case"pending":t.queryHash===r.queryHash&&k(L);break;case"fulfilled":(C.status==="error"||C.data!==L.value)&&V();break;case"rejected":(C.status!=="error"||C.error!==L.reason)&&V();break}}return C}updateResult(){const t=T(this,Pn),n=this.createResult(T(this,Je),this.options);if(ie(this,Vi,T(this,Je).state),ie(this,pl,this.options),T(this,Vi).data!==void 0&&ie(this,gl,T(this,Je)),Uf(n,t))return;ie(this,Pn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!T(this,vl).size)return!0;const i=new Set(o??T(this,vl));return this.options.throwOnError&&i.add("error"),Object.keys(T(this,Pn)).some(a=>{const l=a;return T(this,Pn)[l]!==t[l]&&i.has(l)})};We(this,at,WC).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&We(this,at,tv).call(this)}},In=new WeakMap,Je=new WeakMap,Zu=new WeakMap,Pn=new WeakMap,Vi=new WeakMap,pl=new WeakMap,Ds=new WeakMap,Co=new WeakMap,Qu=new WeakMap,ml=new WeakMap,gl=new WeakMap,zi=new WeakMap,Wi=new WeakMap,To=new WeakMap,vl=new WeakMap,at=new WeakSet,Dc=function(t){We(this,at,sv).call(this);let n=T(this,Je).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch($n)),n},Xg=function(){We(this,at,nv).call(this);const t=Io(this.options.staleTime,T(this,Je));if(Xi||T(this,Pn).isStale||!Gg(t))return;const r=MC(T(this,Pn).dataUpdatedAt,t)+1;ie(this,zi,Ai.setTimeout(()=>{T(this,Pn).isStale||this.updateResult()},r))},Jg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,Je)):this.options.refetchInterval)??!1},ev=function(t){We(this,at,rv).call(this),ie(this,To,t),!(Xi||vr(this.options.enabled,T(this,Je))===!1||!Gg(T(this,To))||T(this,To)===0)&&ie(this,Wi,Ai.setInterval(()=>{(this.options.refetchIntervalInBackground||ib.isFocused())&&We(this,at,Dc).call(this)},T(this,To)))},tv=function(){We(this,at,Xg).call(this),We(this,at,ev).call(this,We(this,at,Jg).call(this))},nv=function(){T(this,zi)&&(Ai.clearTimeout(T(this,zi)),ie(this,zi,void 0))},rv=function(){T(this,Wi)&&(Ai.clearInterval(T(this,Wi)),ie(this,Wi,void 0))},sv=function(){const t=T(this,In).getQueryCache().build(T(this,In),this.options);if(t===T(this,Je))return;const n=T(this,Je);ie(this,Je,t),ie(this,Zu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},WC=function(t){Yt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(T(this,Pn))}),T(this,In).getQueryCache().notify({query:T(this,Je),type:"observerResultsUpdated"})})},EC);function _I(e,t){return vr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function uw(e,t){return _I(e,t)||e.state.data!==void 0&&ov(e,t,t.refetchOnMount)}function ov(e,t,n){if(vr(t.enabled,e)!==!1&&Io(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&ab(e,t)}return!1}function dw(e,t,n,r){return(e!==t||vr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&ab(e,n)}function ab(e,t){return vr(t.enabled,e)!==!1&&e.isStaleByTime(Io(t.staleTime,e))}function EI(e,t){return!Uf(e.getCurrentResult(),t)}function fw(e){return{onFetch:(t,n)=>{var u,f,p,g,y;const r=t.options,s=(p=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,o=((g=t.state.data)==null?void 0:g.pages)||[],i=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let m=!1;const v=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},b=FC(t.options,t.fetchOptions),x=async(w,_,E)=>{if(m)return Promise.reject();if(_==null&&w.pages.length)return Promise.resolve(w);const R=(()=>{const V={client:t.client,queryKey:t.queryKey,pageParam:_,direction:E?"backward":"forward",meta:t.options.meta};return v(V),V})(),C=await b(R),{maxPages:N}=t.options,k=E?pI:hI;return{pages:k(w.pages,C,N),pageParams:k(w.pageParams,_,N)}};if(s&&o.length){const w=s==="backward",_=w?SI:hw,E={pages:o,pageParams:i},S=_(r,E);a=await x(E,S,w)}else{const w=e??o.length;do{const _=l===0?i[0]??r.initialPageParam:hw(r,a);if(l>0&&_==null)break;a=await x(a,_),l++}while(l<w)}return a};t.options.persister?t.fetchFn=()=>{var m,v;return(v=(m=t.options).persister)==null?void 0:v.call(m,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function hw(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function SI(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Xr,jn,qi,Jr,fo,SC,CI=(SC=class extends VC{constructor(t){super();we(this,Jr);we(this,Xr);we(this,jn);we(this,qi);this.mutationId=t.mutationId,ie(this,jn,t.mutationCache),ie(this,Xr,[]),this.state=t.state||qC(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){T(this,Xr).includes(t)||(T(this,Xr).push(t),this.clearGcTimeout(),T(this,jn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ie(this,Xr,T(this,Xr).filter(n=>n!==t)),this.scheduleGc(),T(this,jn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){T(this,Xr).length||(this.state.status==="pending"?this.scheduleGc():T(this,jn).remove(this))}continue(){var t;return((t=T(this,qi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,a,l,c,u,f,p,g,y,m,v,b,x,w,_,E,S,R,C;const n=()=>{We(this,Jr,fo).call(this,{type:"continue"})};ie(this,qi,BC({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(N,k)=>{We(this,Jr,fo).call(this,{type:"failed",failureCount:N,error:k})},onPause:()=>{We(this,Jr,fo).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,jn).canRun(this)}));const r=this.state.status==="pending",s=!T(this,qi).canStart();try{if(r)n();else{We(this,Jr,fo).call(this,{type:"pending",variables:t,isPaused:s}),await((i=(o=T(this,jn).config).onMutate)==null?void 0:i.call(o,t,this));const k=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));k!==this.state.context&&We(this,Jr,fo).call(this,{type:"pending",context:k,variables:t,isPaused:s})}const N=await T(this,qi).start();return await((u=(c=T(this,jn).config).onSuccess)==null?void 0:u.call(c,N,t,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,N,t,this.state.context)),await((y=(g=T(this,jn).config).onSettled)==null?void 0:y.call(g,N,null,this.state.variables,this.state.context,this)),await((v=(m=this.options).onSettled)==null?void 0:v.call(m,N,null,t,this.state.context)),We(this,Jr,fo).call(this,{type:"success",data:N}),N}catch(N){try{throw await((x=(b=T(this,jn).config).onError)==null?void 0:x.call(b,N,t,this.state.context,this)),await((_=(w=this.options).onError)==null?void 0:_.call(w,N,t,this.state.context)),await((S=(E=T(this,jn).config).onSettled)==null?void 0:S.call(E,void 0,N,this.state.variables,this.state.context,this)),await((C=(R=this.options).onSettled)==null?void 0:C.call(R,void 0,N,t,this.state.context)),N}finally{We(this,Jr,fo).call(this,{type:"error",error:N})}}finally{T(this,jn).runNext(this)}}},Xr=new WeakMap,jn=new WeakMap,qi=new WeakMap,Jr=new WeakSet,fo=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Yt.batch(()=>{T(this,Xr).forEach(r=>{r.onMutationUpdate(t)}),T(this,jn).notify({mutation:this,type:"updated",action:t})})},SC);function qC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ks,Ar,Xu,CC,TI=(CC=class extends zl{constructor(t={}){super();we(this,ks);we(this,Ar);we(this,Xu);this.config=t,ie(this,ks,new Set),ie(this,Ar,new Map),ie(this,Xu,0)}build(t,n,r){const s=new CI({mutationCache:this,mutationId:++Od(this,Xu)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){T(this,ks).add(t);const n=Md(t);if(typeof n=="string"){const r=T(this,Ar).get(n);r?r.push(t):T(this,Ar).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(T(this,ks).delete(t)){const n=Md(t);if(typeof n=="string"){const r=T(this,Ar).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&T(this,Ar).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Md(t);if(typeof n=="string"){const r=T(this,Ar).get(n),s=r==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=Md(t);if(typeof n=="string"){const s=(r=T(this,Ar).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Yt.batch(()=>{T(this,ks).forEach(t=>{this.notify({type:"removed",mutation:t})}),T(this,ks).clear(),T(this,Ar).clear()})}getAll(){return Array.from(T(this,ks))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>iw(n,r))}findAll(t={}){return this.getAll().filter(n=>iw(t,n))}notify(t){Yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Yt.batch(()=>Promise.all(t.map(n=>n.continue().catch($n))))}},ks=new WeakMap,Ar=new WeakMap,Xu=new WeakMap,CC);function Md(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Ro,No,Fn,Os,Ws,_f,iv,TC,RI=(TC=class extends zl{constructor(n,r){super();we(this,Ws);we(this,Ro);we(this,No);we(this,Fn);we(this,Os);ie(this,Ro,n),this.setOptions(r),this.bindMethods(),We(this,Ws,_f).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const r=this.options;this.options=T(this,Ro).defaultMutationOptions(n),Uf(this.options,r)||T(this,Ro).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,Fn),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Ji(r.mutationKey)!==Ji(this.options.mutationKey)?this.reset():((s=T(this,Fn))==null?void 0:s.state.status)==="pending"&&T(this,Fn).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=T(this,Fn))==null||n.removeObserver(this)}onMutationUpdate(n){We(this,Ws,_f).call(this),We(this,Ws,iv).call(this,n)}getCurrentResult(){return T(this,No)}reset(){var n;(n=T(this,Fn))==null||n.removeObserver(this),ie(this,Fn,void 0),We(this,Ws,_f).call(this),We(this,Ws,iv).call(this)}mutate(n,r){var s;return ie(this,Os,r),(s=T(this,Fn))==null||s.removeObserver(this),ie(this,Fn,T(this,Ro).getMutationCache().build(T(this,Ro),this.options)),T(this,Fn).addObserver(this),T(this,Fn).execute(n)}},Ro=new WeakMap,No=new WeakMap,Fn=new WeakMap,Os=new WeakMap,Ws=new WeakSet,_f=function(){var r;const n=((r=T(this,Fn))==null?void 0:r.state)??qC();ie(this,No,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},iv=function(n){Yt.batch(()=>{var r,s,o,i,a,l,c,u;if(T(this,Os)&&this.hasListeners()){const f=T(this,No).variables,p=T(this,No).context;(n==null?void 0:n.type)==="success"?((s=(r=T(this,Os)).onSuccess)==null||s.call(r,n.data,f,p),(i=(o=T(this,Os)).onSettled)==null||i.call(o,n.data,null,f,p)):(n==null?void 0:n.type)==="error"&&((l=(a=T(this,Os)).onError)==null||l.call(a,n.error,f,p),(u=(c=T(this,Os)).onSettled)==null||u.call(c,void 0,n.error,f,p))}this.listeners.forEach(f=>{f(T(this,No))})})},TC),es,RC,NI=(RC=class extends zl{constructor(t={}){super();we(this,es);this.config=t,ie(this,es,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??sb(s,n);let i=this.get(o);return i||(i=new xI({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){T(this,es).has(t.queryHash)||(T(this,es).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=T(this,es).get(t.queryHash);n&&(t.destroy(),n===t&&T(this,es).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return T(this,es).get(t)}getAll(){return[...T(this,es).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ow(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>ow(t,r)):n}notify(t){Yt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},es=new WeakMap,RC),Pt,Po,jo,yl,bl,Ao,xl,wl,NC,PI=(NC=class{constructor(e={}){we(this,Pt);we(this,Po);we(this,jo);we(this,yl);we(this,bl);we(this,Ao);we(this,xl);we(this,wl);ie(this,Pt,e.queryCache||new NI),ie(this,Po,e.mutationCache||new TI),ie(this,jo,e.defaultOptions||{}),ie(this,yl,new Map),ie(this,bl,new Map),ie(this,Ao,0)}mount(){Od(this,Ao)._++,T(this,Ao)===1&&(ie(this,xl,ib.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Pt).onFocus())})),ie(this,wl,Bf.subscribe(async e=>{e&&(await this.resumePausedMutations(),T(this,Pt).onOnline())})))}unmount(){var e,t;Od(this,Ao)._--,T(this,Ao)===0&&((e=T(this,xl))==null||e.call(this),ie(this,xl,void 0),(t=T(this,wl))==null||t.call(this),ie(this,wl,void 0))}isFetching(e){return T(this,Pt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return T(this,Po).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,Pt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=T(this,Pt).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Io(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return T(this,Pt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=T(this,Pt).get(r.queryHash),o=s==null?void 0:s.state.data,i=uI(t,o);if(i!==void 0)return T(this,Pt).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Yt.batch(()=>T(this,Pt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=T(this,Pt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=T(this,Pt);Yt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=T(this,Pt);return Yt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Yt.batch(()=>T(this,Pt).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then($n).catch($n)}invalidateQueries(e,t={}){return Yt.batch(()=>(T(this,Pt).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Yt.batch(()=>T(this,Pt).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch($n)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then($n)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=T(this,Pt).build(this,t);return n.isStaleByTime(Io(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then($n).catch($n)}fetchInfiniteQuery(e){return e.behavior=fw(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then($n).catch($n)}ensureInfiniteQueryData(e){return e.behavior=fw(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Bf.isOnline()?T(this,Po).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,Pt)}getMutationCache(){return T(this,Po)}getDefaultOptions(){return T(this,jo)}setDefaultOptions(e){ie(this,jo,e)}setQueryDefaults(e,t){T(this,yl).set(Ji(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...T(this,yl).values()],n={};return t.forEach(r=>{pu(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){T(this,bl).set(Ji(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...T(this,bl).values()],n={};return t.forEach(r=>{pu(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...T(this,jo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=sb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===ob&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...T(this,jo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){T(this,Pt).clear(),T(this,Po).clear()}},Pt=new WeakMap,Po=new WeakMap,jo=new WeakMap,yl=new WeakMap,bl=new WeakMap,Ao=new WeakMap,xl=new WeakMap,wl=new WeakMap,NC),HC=h.createContext(void 0),lb=e=>{const t=h.useContext(HC);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},jI=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(HC.Provider,{value:e,children:t})),GC=h.createContext(!1),AI=()=>h.useContext(GC);GC.Provider;function $I(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var DI=h.createContext($I()),kI=()=>h.useContext(DI),OI=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},MI=e=>{h.useEffect(()=>{e.clearReset()},[e])},II=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(s&&e.data===void 0||LC(n,[e.error,r])),FI=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...s)=>n(r(...s)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},LI=(e,t)=>e.isLoading&&e.isFetching&&!t,UI=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,pw=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function BI(e,t,n){var f,p,g,y,m;const r=AI(),s=kI(),o=lb(),i=o.defaultQueryOptions(e);(p=(f=o.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,i),i._optimisticResults=r?"isRestoring":"optimistic",FI(i),OI(i,s),MI(s);const a=!o.getQueryCache().get(i.queryHash),[l]=h.useState(()=>new t(o,i)),c=l.getOptimisticResult(i),u=!r&&e.subscribed!==!1;if(h.useSyncExternalStore(h.useCallback(v=>{const b=u?l.subscribe(Yt.batchCalls(v)):$n;return l.updateResult(),b},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),h.useEffect(()=>{l.setOptions(i)},[i,l]),UI(i,c))throw pw(i,l,s);if(II({result:c,errorResetBoundary:s,throwOnError:i.throwOnError,query:o.getQueryCache().get(i.queryHash),suspense:i.suspense}))throw c.error;if((y=(g=o.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||y.call(g,i,c),i.experimental_prefetchInRender&&!Xi&&LI(c,r)){const v=a?pw(i,l,s):(m=o.getQueryCache().get(i.queryHash))==null?void 0:m.promise;v==null||v.catch($n).finally(()=>{l.updateResult()})}return i.notifyOnChangeProps?c:l.trackResult(c)}function zh(e,t){return BI(e,wI)}function Rt(e,t){const n=lb(),[r]=h.useState(()=>new RI(n,e));h.useEffect(()=>{r.setOptions(e)},[r,e]);const s=h.useSyncExternalStore(h.useCallback(i=>r.subscribe(Yt.batchCalls(i)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=h.useCallback((i,a)=>{r.mutate(i,a).catch($n)},[r]);if(s.error&&LC(r.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}function me(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function mw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Hs(...e){return t=>{let n=!1;const r=e.map(s=>{const o=mw(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s<r.length;s++){const o=r[s];typeof o=="function"?o():mw(e[s],null)}}}}function tt(...e){return h.useCallback(Hs(...e),e)}function VI(e,t){const n=h.createContext(t),r=o=>{const{children:i,...a}=o,l=h.useMemo(()=>a,Object.values(a));return d.jsx(n.Provider,{value:l,children:i})};r.displayName=e+"Provider";function s(o){const i=h.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function Vr(e,t=[]){let n=[];function r(o,i){const a=h.createContext(i),l=n.length;n=[...n,i];const c=f=>{var b;const{scope:p,children:g,...y}=f,m=((b=p==null?void 0:p[e])==null?void 0:b[l])||a,v=h.useMemo(()=>y,Object.values(y));return d.jsx(m.Provider,{value:v,children:g})};c.displayName=o+"Provider";function u(f,p){var m;const g=((m=p==null?void 0:p[e])==null?void 0:m[l])||a,y=h.useContext(g);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,u]}const s=()=>{const o=n.map(i=>h.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[r,zI(s,...t)]}function zI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}var Cr=wM();const cb=Bl(Cr);function ea(e){const t=WI(e),n=h.forwardRef((r,s)=>{const{children:o,...i}=r,a=h.Children.toArray(o),l=a.find(HI);if(l){const c=l.props.children,u=a.map(f=>f===l?h.Children.count(c)>1?h.Children.only(null):h.isValidElement(c)?c.props.children:null:f);return d.jsx(t,{...i,ref:s,children:h.isValidElement(c)?h.cloneElement(c,void 0,u):null})}return d.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var KC=ea("Slot");function WI(e){const t=h.forwardRef((n,r)=>{const{children:s,...o}=n;if(h.isValidElement(s)){const i=KI(s),a=GI(o,s.props);return s.type!==h.Fragment&&(a.ref=r?Hs(r,i):i),h.cloneElement(s,a)}return h.Children.count(s)>1?h.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var YC=Symbol("radix.slottable");function qI(e){const t=({children:n})=>d.jsx(d.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=YC,t}function HI(e){return h.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===YC}function GI(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{o(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function KI(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var YI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$e=YI.reduce((e,t)=>{const n=ea(`Primitive.${t}`),r=h.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ub(e,t){e&&Cr.flushSync(()=>e.dispatchEvent(t))}function qn(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ZI(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e);h.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var QI="DismissableLayer",av="dismissableLayer.update",XI="dismissableLayer.pointerDownOutside",JI="dismissableLayer.focusOutside",gw,ZC=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wl=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=h.useContext(ZC),[u,f]=h.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=h.useState({}),y=tt(t,R=>f(R)),m=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(v),x=u?m.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,_=x>=b,E=tF(R=>{const C=R.target,N=[...c.branches].some(k=>k.contains(C));!_||N||(s==null||s(R),i==null||i(R),R.defaultPrevented||a==null||a())},p),S=nF(R=>{const C=R.target;[...c.branches].some(k=>k.contains(C))||(o==null||o(R),i==null||i(R),R.defaultPrevented||a==null||a())},p);return ZI(R=>{x===c.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},p),h.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(gw=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),vw(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=gw)}},[u,p,n,c]),h.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),vw())},[u,c]),h.useEffect(()=>{const R=()=>g({});return document.addEventListener(av,R),()=>document.removeEventListener(av,R)},[]),d.jsx($e.div,{...l,ref:y,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:me(e.onFocusCapture,S.onFocusCapture),onBlurCapture:me(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:me(e.onPointerDownCapture,E.onPointerDownCapture)})});Wl.displayName=QI;var eF="DismissableLayerBranch",QC=h.forwardRef((e,t)=>{const n=h.useContext(ZC),r=h.useRef(null),s=tt(t,r);return h.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx($e.div,{...e,ref:s})});QC.displayName=eF;function tF(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e),r=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){XC(XI,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function nF(e,t=globalThis==null?void 0:globalThis.document){const n=qn(e),r=h.useRef(!1);return h.useEffect(()=>{const s=o=>{o.target&&!r.current&&XC(JI,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vw(){const e=new CustomEvent(av);document.dispatchEvent(e)}function XC(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ub(s,o):s.dispatchEvent(o)}var rF=Wl,sF=QC,nn=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},oF=qs[" useId ".trim().toString()]||(()=>{}),iF=0;function fn(e){const[t,n]=h.useState(oF());return nn(()=>{n(r=>r??String(iF++))},[e]),e||(t?`radix-${t}`:"")}const aF=["top","right","bottom","left"],zo=Math.min,Zn=Math.max,Vf=Math.round,Id=Math.floor,ss=e=>({x:e,y:e}),lF={left:"right",right:"left",bottom:"top",top:"bottom"},cF={start:"end",end:"start"};function lv(e,t,n){return Zn(e,zo(t,n))}function Gs(e,t){return typeof e=="function"?e(t):e}function Ks(e){return e.split("-")[0]}function ql(e){return e.split("-")[1]}function db(e){return e==="x"?"y":"x"}function fb(e){return e==="y"?"height":"width"}function Wo(e){return["top","bottom"].includes(Ks(e))?"y":"x"}function hb(e){return db(Wo(e))}function uF(e,t,n){n===void 0&&(n=!1);const r=ql(e),s=hb(e),o=fb(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=zf(i)),[i,zf(i)]}function dF(e){const t=zf(e);return[cv(e),t,cv(t)]}function cv(e){return e.replace(/start|end/g,t=>cF[t])}function fF(e,t,n){const r=["left","right"],s=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?o:i;default:return[]}}function hF(e,t,n,r){const s=ql(e);let o=fF(Ks(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(cv)))),o}function zf(e){return e.replace(/left|right|bottom|top/g,t=>lF[t])}function pF(e){return{top:0,right:0,bottom:0,left:0,...e}}function JC(e){return typeof e!="number"?pF(e):{top:e,right:e,bottom:e,left:e}}function Wf(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function yw(e,t,n){let{reference:r,floating:s}=e;const o=Wo(t),i=hb(t),a=fb(i),l=Ks(t),c=o==="y",u=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,p=r[a]/2-s[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-s.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:f};break;case"left":g={x:r.x-s.width,y:f};break;default:g={x:r.x,y:r.y}}switch(ql(t)){case"start":g[i]-=p*(n&&c?-1:1);break;case"end":g[i]+=p*(n&&c?-1:1);break}return g}const mF=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,a=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:u,y:f}=yw(c,r,l),p=r,g={},y=0;for(let m=0;m<a.length;m++){const{name:v,fn:b}=a[m],{x,y:w,data:_,reset:E}=await b({x:u,y:f,initialPlacement:r,placement:p,strategy:s,middlewareData:g,rects:c,platform:i,elements:{reference:e,floating:t}});u=x??u,f=w??f,g={...g,[v]:{...g[v],..._}},E&&y<=50&&(y++,typeof E=="object"&&(E.placement&&(p=E.placement),E.rects&&(c=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:u,y:f}=yw(c,p,l)),m=-1)}return{x:u,y:f,placement:p,strategy:s,middlewareData:g}};async function mu(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:g=0}=Gs(t,e),y=JC(g),v=a[p?f==="floating"?"reference":"floating":f],b=Wf(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(v)))==null||n?v:v.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),x=f==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),_=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},E=Wf(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:w,strategy:l}):x);return{top:(b.top-E.top+y.top)/_.y,bottom:(E.bottom-b.bottom+y.bottom)/_.y,left:(b.left-E.left+y.left)/_.x,right:(E.right-b.right+y.right)/_.x}}const gF=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Gs(e,t)||{};if(c==null)return{};const f=JC(u),p={x:n,y:r},g=hb(s),y=fb(g),m=await i.getDimensions(c),v=g==="y",b=v?"top":"left",x=v?"bottom":"right",w=v?"clientHeight":"clientWidth",_=o.reference[y]+o.reference[g]-p[g]-o.floating[y],E=p[g]-o.reference[g],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let R=S?S[w]:0;(!R||!await(i.isElement==null?void 0:i.isElement(S)))&&(R=a.floating[w]||o.floating[y]);const C=_/2-E/2,N=R/2-m[y]/2-1,k=zo(f[b],N),V=zo(f[x],N),L=k,G=R-m[y]-V,$=R/2-m[y]/2+C,I=lv(L,$,G),j=!l.arrow&&ql(s)!=null&&$!==I&&o.reference[y]/2-($<L?k:V)-m[y]/2<0,F=j?$<L?$-L:$-G:0;return{[g]:p[g]+F,data:{[g]:I,centerOffset:$-I-F,...j&&{alignmentOffset:F}},reset:j}}}),vF=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:m=!0,...v}=Gs(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const b=Ks(s),x=Wo(a),w=Ks(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=p||(w||!m?[zf(a)]:dF(a)),S=y!=="none";!p&&S&&E.push(...hF(a,m,y,_));const R=[a,...E],C=await mu(t,v),N=[];let k=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&N.push(C[b]),f){const $=uF(s,i,_);N.push(C[$[0]],C[$[1]])}if(k=[...k,{placement:s,overflows:N}],!N.every($=>$<=0)){var V,L;const $=(((V=o.flip)==null?void 0:V.index)||0)+1,I=R[$];if(I)return{data:{index:$,overflows:k},reset:{placement:I}};let j=(L=k.filter(F=>F.overflows[0]<=0).sort((F,O)=>F.overflows[1]-O.overflows[1])[0])==null?void 0:L.placement;if(!j)switch(g){case"bestFit":{var G;const F=(G=k.filter(O=>{if(S){const U=Wo(O.placement);return U===x||U==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(U=>U>0).reduce((U,Y)=>U+Y,0)]).sort((O,U)=>O[1]-U[1])[0])==null?void 0:G[0];F&&(j=F);break}case"initialPlacement":j=a;break}if(s!==j)return{reset:{placement:j}}}return{}}}};function bw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xw(e){return aF.some(t=>e[t]>=0)}const yF=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Gs(e,t);switch(r){case"referenceHidden":{const o=await mu(t,{...s,elementContext:"reference"}),i=bw(o,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:xw(i)}}}case"escaped":{const o=await mu(t,{...s,altBoundary:!0}),i=bw(o,n.floating);return{data:{escapedOffsets:i,escaped:xw(i)}}}default:return{}}}}};async function bF(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=Ks(n),a=ql(n),l=Wo(n)==="y",c=["left","top"].includes(i)?-1:1,u=o&&l?-1:1,f=Gs(t,e);let{mainAxis:p,crossAxis:g,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof y=="number"&&(g=a==="end"?y*-1:y),l?{x:g*u,y:p*c}:{x:p*c,y:g*u}}const xF=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:a}=t,l=await bF(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:i}}}}},wF=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:v=>{let{x:b,y:x}=v;return{x:b,y:x}}},...l}=Gs(e,t),c={x:n,y:r},u=await mu(t,l),f=Wo(Ks(s)),p=db(f);let g=c[p],y=c[f];if(o){const v=p==="y"?"top":"left",b=p==="y"?"bottom":"right",x=g+u[v],w=g-u[b];g=lv(x,g,w)}if(i){const v=f==="y"?"top":"left",b=f==="y"?"bottom":"right",x=y+u[v],w=y-u[b];y=lv(x,y,w)}const m=a.fn({...t,[p]:g,[f]:y});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[p]:o,[f]:i}}}}}},_F=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Gs(e,t),u={x:n,y:r},f=Wo(s),p=db(f);let g=u[p],y=u[f];const m=Gs(a,t),v=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const w=p==="y"?"height":"width",_=o.reference[p]-o.floating[w]+v.mainAxis,E=o.reference[p]+o.reference[w]-v.mainAxis;g<_?g=_:g>E&&(g=E)}if(c){var b,x;const w=p==="y"?"width":"height",_=["top","left"].includes(Ks(s)),E=o.reference[f]-o.floating[w]+(_&&((b=i.offset)==null?void 0:b[f])||0)+(_?0:v.crossAxis),S=o.reference[f]+o.reference[w]+(_?0:((x=i.offset)==null?void 0:x[f])||0)-(_?v.crossAxis:0);y<E?y=E:y>S&&(y=S)}return{[p]:g,[f]:y}}}},EF=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:i,elements:a}=t,{apply:l=()=>{},...c}=Gs(e,t),u=await mu(t,c),f=Ks(s),p=ql(s),g=Wo(s)==="y",{width:y,height:m}=o.floating;let v,b;f==="top"||f==="bottom"?(v=f,b=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=f,v=p==="end"?"top":"bottom");const x=m-u.top-u.bottom,w=y-u.left-u.right,_=zo(m-u[v],x),E=zo(y-u[b],w),S=!t.middlewareData.shift;let R=_,C=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(C=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=x),S&&!p){const k=Zn(u.left,0),V=Zn(u.right,0),L=Zn(u.top,0),G=Zn(u.bottom,0);g?C=y-2*(k!==0||V!==0?k+V:Zn(u.left,u.right)):R=m-2*(L!==0||G!==0?L+G:Zn(u.top,u.bottom))}await l({...t,availableWidth:C,availableHeight:R});const N=await i.getDimensions(a.floating);return y!==N.width||m!==N.height?{reset:{rects:!0}}:{}}}};function Wh(){return typeof window<"u"}function Hl(e){return eT(e)?(e.nodeName||"").toLowerCase():"#document"}function er(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bs(e){var t;return(t=(eT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function eT(e){return Wh()?e instanceof Node||e instanceof er(e).Node:!1}function Ir(e){return Wh()?e instanceof Element||e instanceof er(e).Element:!1}function hs(e){return Wh()?e instanceof HTMLElement||e instanceof er(e).HTMLElement:!1}function ww(e){return!Wh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof er(e).ShadowRoot}function ed(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Fr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function SF(e){return["table","td","th"].includes(Hl(e))}function qh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function pb(e){const t=mb(),n=Ir(e)?Fr(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function CF(e){let t=qo(e);for(;hs(t)&&!_l(t);){if(pb(t))return t;if(qh(t))return null;t=qo(t)}return null}function mb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function _l(e){return["html","body","#document"].includes(Hl(e))}function Fr(e){return er(e).getComputedStyle(e)}function Hh(e){return Ir(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qo(e){if(Hl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ww(e)&&e.host||bs(e);return ww(t)?t.host:t}function tT(e){const t=qo(e);return _l(t)?e.ownerDocument?e.ownerDocument.body:e.body:hs(t)&&ed(t)?t:tT(t)}function gu(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=tT(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=er(s);if(o){const a=uv(i);return t.concat(i,i.visualViewport||[],ed(s)?s:[],a&&n?gu(a):[])}return t.concat(s,gu(s,[],n))}function uv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nT(e){const t=Fr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=hs(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,a=Vf(n)!==o||Vf(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function gb(e){return Ir(e)?e:e.contextElement}function el(e){const t=gb(e);if(!hs(t))return ss(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=nT(t);let i=(o?Vf(n.width):n.width)/r,a=(o?Vf(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const TF=ss(0);function rT(e){const t=er(e);return!mb()||!t.visualViewport?TF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function RF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==er(e)?!1:t}function ta(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=gb(e);let i=ss(1);t&&(r?Ir(r)&&(i=el(r)):i=el(e));const a=RF(o,n,r)?rT(o):ss(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,u=s.width/i.x,f=s.height/i.y;if(o){const p=er(o),g=r&&Ir(r)?er(r):r;let y=p,m=uv(y);for(;m&&r&&g!==y;){const v=el(m),b=m.getBoundingClientRect(),x=Fr(m),w=b.left+(m.clientLeft+parseFloat(x.paddingLeft))*v.x,_=b.top+(m.clientTop+parseFloat(x.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,f*=v.y,l+=w,c+=_,y=er(m),m=uv(y)}}return Wf({width:u,height:f,x:l,y:c})}function vb(e,t){const n=Hh(e).scrollLeft;return t?t.left+n:ta(bs(e)).left+n}function sT(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:vb(e,r)),o=r.top+t.scrollTop;return{x:s,y:o}}function NF(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=bs(r),a=t?qh(t.floating):!1;if(r===i||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=ss(1);const u=ss(0),f=hs(r);if((f||!f&&!o)&&((Hl(r)!=="body"||ed(i))&&(l=Hh(r)),hs(r))){const g=ta(r);c=el(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const p=i&&!f&&!o?sT(i,l,!0):ss(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function PF(e){return Array.from(e.getClientRects())}function jF(e){const t=bs(e),n=Hh(e),r=e.ownerDocument.body,s=Zn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Zn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+vb(e);const a=-n.scrollTop;return Fr(r).direction==="rtl"&&(i+=Zn(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:a}}function AF(e,t){const n=er(e),r=bs(e),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const c=mb();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:i,x:a,y:l}}function $F(e,t){const n=ta(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=hs(e)?el(e):ss(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,c=r*o.y;return{width:i,height:a,x:l,y:c}}function _w(e,t,n){let r;if(t==="viewport")r=AF(e,n);else if(t==="document")r=jF(bs(e));else if(Ir(t))r=$F(t,n);else{const s=rT(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Wf(r)}function oT(e,t){const n=qo(e);return n===t||!Ir(n)||_l(n)?!1:Fr(n).position==="fixed"||oT(n,t)}function DF(e,t){const n=t.get(e);if(n)return n;let r=gu(e,[],!1).filter(a=>Ir(a)&&Hl(a)!=="body"),s=null;const o=Fr(e).position==="fixed";let i=o?qo(e):e;for(;Ir(i)&&!_l(i);){const a=Fr(i),l=pb(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||ed(i)&&!l&&oT(e,i))?r=r.filter(u=>u!==i):s=a,i=qo(i)}return t.set(e,r),r}function kF(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?qh(t)?[]:DF(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{const f=_w(t,u,s);return c.top=Zn(f.top,c.top),c.right=zo(f.right,c.right),c.bottom=zo(f.bottom,c.bottom),c.left=Zn(f.left,c.left),c},_w(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function OF(e){const{width:t,height:n}=nT(e);return{width:t,height:n}}function MF(e,t,n){const r=hs(t),s=bs(t),o=n==="fixed",i=ta(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=ss(0);if(r||!r&&!o)if((Hl(t)!=="body"||ed(s))&&(a=Hh(t)),r){const p=ta(t,!0,o,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else s&&(l.x=vb(s));const c=s&&!r&&!o?sT(s,a):ss(0),u=i.left+a.scrollLeft-l.x-c.x,f=i.top+a.scrollTop-l.y-c.y;return{x:u,y:f,width:i.width,height:i.height}}function pm(e){return Fr(e).position==="static"}function Ew(e,t){if(!hs(e)||Fr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bs(e)===n&&(n=n.ownerDocument.body),n}function iT(e,t){const n=er(e);if(qh(e))return n;if(!hs(e)){let s=qo(e);for(;s&&!_l(s);){if(Ir(s)&&!pm(s))return s;s=qo(s)}return n}let r=Ew(e,t);for(;r&&SF(r)&&pm(r);)r=Ew(r,t);return r&&_l(r)&&pm(r)&&!pb(r)?n:r||CF(e)||n}const IF=async function(e){const t=this.getOffsetParent||iT,n=this.getDimensions,r=await n(e.floating);return{reference:MF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function FF(e){return Fr(e).direction==="rtl"}const LF={convertOffsetParentRelativeRectToViewportRelativeRect:NF,getDocumentElement:bs,getClippingRect:kF,getOffsetParent:iT,getElementRects:IF,getClientRects:PF,getDimensions:OF,getScale:el,isElement:Ir,isRTL:FF};function aT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function UF(e,t){let n=null,r;const s=bs(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:f,width:p,height:g}=c;if(a||t(),!p||!g)return;const y=Id(f),m=Id(s.clientWidth-(u+p)),v=Id(s.clientHeight-(f+g)),b=Id(u),w={rootMargin:-y+"px "+-m+"px "+-v+"px "+-b+"px",threshold:Zn(0,zo(1,l))||1};let _=!0;function E(S){const R=S[0].intersectionRatio;if(R!==l){if(!_)return i();R?i(!1,R):r=setTimeout(()=>{i(!1,1e-7)},1e3)}R===1&&!aT(c,e.getBoundingClientRect())&&i(),_=!1}try{n=new IntersectionObserver(E,{...w,root:s.ownerDocument})}catch{n=new IntersectionObserver(E,w)}n.observe(e)}return i(!0),o}function BF(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=gb(e),u=s||o?[...c?gu(c):[],...gu(t)]:[];u.forEach(b=>{s&&b.addEventListener("scroll",n,{passive:!0}),o&&b.addEventListener("resize",n)});const f=c&&a?UF(c,n):null;let p=-1,g=null;i&&(g=new ResizeObserver(b=>{let[x]=b;x&&x.target===c&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),c&&!l&&g.observe(c),g.observe(t));let y,m=l?ta(e):null;l&&v();function v(){const b=ta(e);m&&!aT(m,b)&&n(),m=b,y=requestAnimationFrame(v)}return n(),()=>{var b;u.forEach(x=>{s&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),f==null||f(),(b=g)==null||b.disconnect(),g=null,l&&cancelAnimationFrame(y)}}const VF=xF,zF=wF,WF=vF,qF=EF,HF=yF,Sw=gF,GF=_F,KF=(e,t,n)=>{const r=new Map,s={platform:LF,...n},o={...s.platform,_c:r};return mF(e,t,{...s,platform:o})};var Ef=typeof document<"u"?h.useLayoutEffect:h.useEffect;function qf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!qf(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!qf(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function lT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cw(e,t){const n=lT(e);return Math.round(t*n)/n}function mm(e){const t=h.useRef(e);return Ef(()=>{t.current=e}),t}function YF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,g]=h.useState(r);qf(p,r)||g(r);const[y,m]=h.useState(null),[v,b]=h.useState(null),x=h.useCallback(O=>{O!==S.current&&(S.current=O,m(O))},[]),w=h.useCallback(O=>{O!==R.current&&(R.current=O,b(O))},[]),_=o||y,E=i||v,S=h.useRef(null),R=h.useRef(null),C=h.useRef(u),N=l!=null,k=mm(l),V=mm(s),L=mm(c),G=h.useCallback(()=>{if(!S.current||!R.current)return;const O={placement:t,strategy:n,middleware:p};V.current&&(O.platform=V.current),KF(S.current,R.current,O).then(U=>{const Y={...U,isPositioned:L.current!==!1};$.current&&!qf(C.current,Y)&&(C.current=Y,Cr.flushSync(()=>{f(Y)}))})},[p,t,n,V,L]);Ef(()=>{c===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,f(O=>({...O,isPositioned:!1})))},[c]);const $=h.useRef(!1);Ef(()=>($.current=!0,()=>{$.current=!1}),[]),Ef(()=>{if(_&&(S.current=_),E&&(R.current=E),_&&E){if(k.current)return k.current(_,E,G);G()}},[_,E,G,k,N]);const I=h.useMemo(()=>({reference:S,floating:R,setReference:x,setFloating:w}),[x,w]),j=h.useMemo(()=>({reference:_,floating:E}),[_,E]),F=h.useMemo(()=>{const O={position:n,left:0,top:0};if(!j.floating)return O;const U=Cw(j.floating,u.x),Y=Cw(j.floating,u.y);return a?{...O,transform:"translate("+U+"px, "+Y+"px)",...lT(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:Y}},[n,a,j.floating,u.x,u.y]);return h.useMemo(()=>({...u,update:G,refs:I,elements:j,floatingStyles:F}),[u,G,I,j,F])}const ZF=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Sw({element:r.current,padding:s}).fn(n):{}:r?Sw({element:r,padding:s}).fn(n):{}}}},QF=(e,t)=>({...VF(e),options:[e,t]}),XF=(e,t)=>({...zF(e),options:[e,t]}),JF=(e,t)=>({...GF(e),options:[e,t]}),e2=(e,t)=>({...WF(e),options:[e,t]}),t2=(e,t)=>({...qF(e),options:[e,t]}),n2=(e,t)=>({...HF(e),options:[e,t]}),r2=(e,t)=>({...ZF(e),options:[e,t]});var s2="Arrow",cT=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return d.jsx($e.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});cT.displayName=s2;var o2=cT;function uT(e){const[t,n]=h.useState(void 0);return nn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var yb="Popper",[dT,Gl]=Vr(yb),[i2,fT]=dT(yb),hT=e=>{const{__scopePopper:t,children:n}=e,[r,s]=h.useState(null);return d.jsx(i2,{scope:t,anchor:r,onAnchorChange:s,children:n})};hT.displayName=yb;var pT="PopperAnchor",mT=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=fT(pT,n),i=h.useRef(null),a=tt(t,i);return h.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:d.jsx($e.div,{...s,ref:a})});mT.displayName=pT;var bb="PopperContent",[a2,l2]=dT(bb),gT=h.forwardRef((e,t)=>{var te,Re,Ce,ue,ge,ke;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:g="optimized",onPlaced:y,...m}=e,v=fT(bb,n),[b,x]=h.useState(null),w=tt(t,Ze=>x(Ze)),[_,E]=h.useState(null),S=uT(_),R=(S==null?void 0:S.width)??0,C=(S==null?void 0:S.height)??0,N=r+(o!=="center"?"-"+o:""),k=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},V=Array.isArray(c)?c:[c],L=V.length>0,G={padding:k,boundary:V.filter(u2),altBoundary:L},{refs:$,floatingStyles:I,placement:j,isPositioned:F,middlewareData:O}=YF({strategy:"fixed",placement:N,whileElementsMounted:(...Ze)=>BF(...Ze,{animationFrame:g==="always"}),elements:{reference:v.anchor},middleware:[QF({mainAxis:s+C,alignmentAxis:i}),l&&XF({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?JF():void 0,...G}),l&&e2({...G}),t2({...G,apply:({elements:Ze,rects:lt,availableWidth:lr,availableHeight:Gn})=>{const{width:Cn,height:cc}=lt.reference,ro=Ze.floating.style;ro.setProperty("--radix-popper-available-width",`${lr}px`),ro.setProperty("--radix-popper-available-height",`${Gn}px`),ro.setProperty("--radix-popper-anchor-width",`${Cn}px`),ro.setProperty("--radix-popper-anchor-height",`${cc}px`)}}),_&&r2({element:_,padding:a}),d2({arrowWidth:R,arrowHeight:C}),p&&n2({strategy:"referenceHidden",...G})]}),[U,Y]=bT(j),ee=qn(y);nn(()=>{F&&(ee==null||ee())},[F,ee]);const M=(te=O.arrow)==null?void 0:te.x,Q=(Re=O.arrow)==null?void 0:Re.y,H=((Ce=O.arrow)==null?void 0:Ce.centerOffset)!==0,[K,ae]=h.useState();return nn(()=>{b&&ae(window.getComputedStyle(b).zIndex)},[b]),d.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:F?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:K,"--radix-popper-transform-origin":[(ue=O.transformOrigin)==null?void 0:ue.x,(ge=O.transformOrigin)==null?void 0:ge.y].join(" "),...((ke=O.hide)==null?void 0:ke.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(a2,{scope:n,placedSide:U,onArrowChange:E,arrowX:M,arrowY:Q,shouldHideArrow:H,children:d.jsx($e.div,{"data-side":U,"data-align":Y,...m,ref:w,style:{...m.style,animation:F?void 0:"none"}})})})});gT.displayName=bb;var vT="PopperArrow",c2={top:"bottom",right:"left",bottom:"top",left:"right"},yT=h.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=l2(vT,r),i=c2[o.placedSide];return d.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:d.jsx(o2,{...s,ref:n,style:{...s.style,display:"block"}})})});yT.displayName=vT;function u2(e){return e!==null}var d2=e=>({name:"transformOrigin",options:e,fn(t){var v,b,x;const{placement:n,rects:r,middlewareData:s}=t,i=((v=s.arrow)==null?void 0:v.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=bT(n),f={start:"0%",center:"50%",end:"100%"}[u],p=(((b=s.arrow)==null?void 0:b.x)??0)+a/2,g=(((x=s.arrow)==null?void 0:x.y)??0)+l/2;let y="",m="";return c==="bottom"?(y=i?f:`${p}px`,m=`${-l}px`):c==="top"?(y=i?f:`${p}px`,m=`${r.floating.height+l}px`):c==="right"?(y=`${-l}px`,m=i?f:`${g}px`):c==="left"&&(y=`${r.floating.width+l}px`,m=i?f:`${g}px`),{data:{x:y,y:m}}}});function bT(e){const[t,n="center"]=e.split("-");return[t,n]}var xb=hT,wb=mT,_b=gT,Eb=yT,f2="Portal",td=h.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,o]=h.useState(!1);nn(()=>o(!0),[]);const i=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?cb.createPortal(d.jsx($e.div,{...r,ref:t}),i):null});td.displayName=f2;function h2(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var zr=e=>{const{present:t,children:n}=e,r=p2(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),o=tt(r.ref,m2(s));return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:o}):null};zr.displayName="Presence";function p2(e){const[t,n]=h.useState(),r=h.useRef(null),s=h.useRef(e),o=h.useRef("none"),i=e?"mounted":"unmounted",[a,l]=h2(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const c=Fd(r.current);o.current=a==="mounted"?c:"none"},[a]),nn(()=>{const c=r.current,u=s.current;if(u!==e){const p=o.current,g=Fd(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),nn(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,f=g=>{const m=Fd(r.current).includes(g.animationName);if(g.target===t&&m&&(l("ANIMATION_END"),!s.current)){const v=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=v)})}},p=g=>{g.target===t&&(o.current=Fd(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Fd(e){return(e==null?void 0:e.animationName)||"none"}function m2(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var g2=qs[" useInsertionEffect ".trim().toString()]||nn;function Ys({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,i]=v2({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:s;{const u=h.useRef(e!==void 0);h.useEffect(()=>{const f=u.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. 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.`),u.current=a},[a,r])}const c=h.useCallback(u=>{var f;if(a){const p=y2(u)?u(e):u;p!==e&&((f=i.current)==null||f.call(i,p))}else o(u)},[a,e,o,i]);return[l,c]}function v2({defaultProp:e,onChange:t}){const[n,r]=h.useState(e),s=h.useRef(n),o=h.useRef(t);return g2(()=>{o.current=t},[t]),h.useEffect(()=>{var i;s.current!==n&&((i=o.current)==null||i.call(o,n),s.current=n)},[n,s]),[n,r,o]}function y2(e){return typeof e=="function"}var xT=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"}),b2="VisuallyHidden",Gh=h.forwardRef((e,t)=>d.jsx($e.span,{...e,ref:t,style:{...xT,...e.style}}));Gh.displayName=b2;var x2=Gh,[Kh,Foe]=Vr("Tooltip",[Gl]),Yh=Gl(),wT="TooltipProvider",w2=700,dv="tooltip.open",[_2,Sb]=Kh(wT),_T=e=>{const{__scopeTooltip:t,delayDuration:n=w2,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,i=h.useRef(!0),a=h.useRef(!1),l=h.useRef(0);return h.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),d.jsx(_2,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:h.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:h.useCallback(c=>{a.current=c},[]),disableHoverableContent:s,children:o})};_T.displayName=wT;var vu="Tooltip",[E2,Zh]=Kh(vu),ET=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:o,disableHoverableContent:i,delayDuration:a}=e,l=Sb(vu,e.__scopeTooltip),c=Yh(t),[u,f]=h.useState(null),p=fn(),g=h.useRef(0),y=i??l.disableHoverableContent,m=a??l.delayDuration,v=h.useRef(!1),[b,x]=Ys({prop:r,defaultProp:s??!1,onChange:R=>{R?(l.onOpen(),document.dispatchEvent(new CustomEvent(dv))):l.onClose(),o==null||o(R)},caller:vu}),w=h.useMemo(()=>b?v.current?"delayed-open":"instant-open":"closed",[b]),_=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,v.current=!1,x(!0)},[x]),E=h.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),S=h.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{v.current=!0,x(!0),g.current=0},m)},[m,x]);return h.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),d.jsx(xb,{...c,children:d.jsx(E2,{scope:t,contentId:p,open:b,stateAttribute:w,trigger:u,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{l.isOpenDelayedRef.current?S():_()},[l.isOpenDelayedRef,S,_]),onTriggerLeave:h.useCallback(()=>{y?E():(window.clearTimeout(g.current),g.current=0)},[E,y]),onOpen:_,onClose:E,disableHoverableContent:y,children:n})})};ET.displayName=vu;var fv="TooltipTrigger",ST=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Zh(fv,n),o=Sb(fv,n),i=Yh(n),a=h.useRef(null),l=tt(t,a,s.onTriggerChange),c=h.useRef(!1),u=h.useRef(!1),f=h.useCallback(()=>c.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),d.jsx(wb,{asChild:!0,...i,children:d.jsx($e.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:me(e.onPointerMove,p=>{p.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:me(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:me(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:me(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:me(e.onBlur,s.onClose),onClick:me(e.onClick,s.onClose)})})});ST.displayName=fv;var S2="TooltipPortal",[Loe,C2]=Kh(S2,{forceMount:void 0}),El="TooltipContent",CT=h.forwardRef((e,t)=>{const n=C2(El,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,i=Zh(El,e.__scopeTooltip);return d.jsx(zr,{present:r||i.open,children:i.disableHoverableContent?d.jsx(TT,{side:s,...o,ref:t}):d.jsx(T2,{side:s,...o,ref:t})})}),T2=h.forwardRef((e,t)=>{const n=Zh(El,e.__scopeTooltip),r=Sb(El,e.__scopeTooltip),s=h.useRef(null),o=tt(t,s),[i,a]=h.useState(null),{trigger:l,onClose:c}=n,u=s.current,{onPointerInTransitChange:f}=r,p=h.useCallback(()=>{a(null),f(!1)},[f]),g=h.useCallback((y,m)=>{const v=y.currentTarget,b={x:y.clientX,y:y.clientY},x=j2(b,v.getBoundingClientRect()),w=A2(b,x),_=$2(m.getBoundingClientRect()),E=k2([...w,..._]);a(E),f(!0)},[f]);return h.useEffect(()=>()=>p(),[p]),h.useEffect(()=>{if(l&&u){const y=v=>g(v,u),m=v=>g(v,l);return l.addEventListener("pointerleave",y),u.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",y),u.removeEventListener("pointerleave",m)}}},[l,u,g,p]),h.useEffect(()=>{if(i){const y=m=>{const v=m.target,b={x:m.clientX,y:m.clientY},x=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),w=!D2(b,i);x?p():w&&(p(),c())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,u,i,c,p]),d.jsx(TT,{...e,ref:o})}),[R2,N2]=Kh(vu,{isInside:!1}),P2=qI("TooltipContent"),TT=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,l=Zh(El,n),c=Yh(n),{onClose:u}=l;return h.useEffect(()=>(document.addEventListener(dv,u),()=>document.removeEventListener(dv,u)),[u]),h.useEffect(()=>{if(l.trigger){const f=p=>{const g=p.target;g!=null&&g.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),d.jsx(Wl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:u,children:d.jsxs(_b,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx(P2,{children:r}),d.jsx(R2,{scope:n,isInside:!0,children:d.jsx(x2,{id:l.contentId,role:"tooltip",children:s||r})})]})})});CT.displayName=El;var RT="TooltipArrow",NT=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Yh(n);return N2(RT,n).isInside?null:d.jsx(Eb,{...s,...r,ref:t})});NT.displayName=RT;function j2(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function A2(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function $2(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function D2(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const a=t[o],l=t[i],c=a.x,u=a.y,f=l.x,p=l.y;u>r!=p>r&&n<(f-c)*(r-u)/(p-u)+c&&(s=!s)}return s}function k2(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),O2(t)}function O2(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var M2=_T,PT=ET,jT=ST,AT=CT,I2=NT;const F2=M2,Ho=PT,Go=jT,Lr=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>d.jsx(AT,{ref:r,sideOffset:t,className:se("z-50 rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n}));Lr.displayName=AT.displayName;const hv=({className:e,...t})=>d.jsx(I2,{...t,className:se("fill-white -translate-y-px drop-shadow-md [clip-path:inset(0_-10px_-10px_-10px)]",e)}),Uoe=({children:e,content:t,open:n,defaultOpen:r,onOpenChange:s,side:o="top",align:i="center",className:a,asChild:l=!0,...c})=>t?d.jsxs(PT,{open:n,defaultOpen:r,onOpenChange:s,children:[d.jsx(jT,{asChild:l,children:e}),d.jsxs(Lr,{side:o,align:i,className:a,...c,children:[t,d.jsx(hv,{})]})]}):e,tu="8.55.0",ps=globalThis;function Cb(e,t,n){const r=n||ps,s=r.__SENTRY__=r.__SENTRY__||{},o=s[tu]=s[tu]||{};return o[e]||(o[e]=t())}const Tb=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,L2="Sentry Logger ",Tw=["debug","info","warn","error","log","assert","trace"],Rw={};function $T(e){if(!("console"in ps))return e();const t=ps.console,n={},r=Object.keys(Rw);r.forEach(s=>{const o=Rw[s];n[s]=t[s],t[s]=o});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function U2(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return Tb?Tw.forEach(n=>{t[n]=(...r)=>{e&&$T(()=>{ps.console[n](`${L2}[${n}]:`,...r)})}}):Tw.forEach(n=>{t[n]=()=>{}}),t}const Qn=Cb("logger",U2);function Qh(){return Rb(ps),ps}function Rb(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||tu,t[tu]=t[tu]||{}}const DT=Object.prototype.toString;function B2(e){switch(DT.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return q2(e,Error)}}function V2(e,t){return DT.call(e)===`[object ${t}]`}function z2(e){return V2(e,"Object")}function W2(e){return!!(e&&e.then&&typeof e.then=="function")}function q2(e,t){try{return e instanceof t}catch{return!1}}function H2(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Tb&&Qn.log(`Failed to add non-enumerable property "${t}" to object`,e)}}const kT=1e3;function OT(){return Date.now()/kT}function G2(){const{performance:e}=ps;if(!e||!e.now)return OT;const t=Date.now()-e.now(),n=e.timeOrigin==null?t:e.timeOrigin;return()=>(n+e.now())/kT}const K2=G2();(()=>{const{performance:e}=ps;if(!e||!e.now)return;const t=3600*1e3,n=e.now(),r=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=s<t,i=e.timing&&e.timing.navigationStart,l=typeof i=="number"?Math.abs(i+n-r):t,c=l<t;return o||c?s<=l?e.timeOrigin:i:r})();function tl(){const e=ps,t=e.crypto||e.msCrypto;let n=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return t.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function Y2(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||K2(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:tl()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Nw(){return tl()}function Pw(){return tl().substring(16)}function MT(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&t&&Object.keys(t).length===0)return e;const r={...e};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=MT(r[s],t[s],n-1));return r}const pv="_sentrySpan";function jw(e,t){t?H2(e,pv,t):delete e[pv]}function Aw(e){return e[pv]}const Z2=100;class Nb{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Nw(),spanId:Pw()}}clone(){const t=new Nb;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,jw(t,Aw(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Y2(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this._tags={...this._tags,[t]:n},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,[r,s]=n instanceof na?[n.getScopeData(),n.getRequestSession()]:z2(n)?[t,t.requestSession]:[],{tags:o,extra:i,user:a,contexts:l,level:c,fingerprint:u=[],propagationContext:f}=r||{};return this._tags={...this._tags,...o},this._extra={...this._extra,...i},this._contexts={...this._contexts,...l},a&&Object.keys(a).length&&(this._user=a),c&&(this._level=c),u.length&&(this._fingerprint=u),f&&(this._propagationContext=f),s&&(this._requestSession=s),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,jw(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Nw()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:Z2;if(r<=0)return this;const s={timestamp:OT(),...t};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client&&this._client.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Aw(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=MT(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext={spanId:Pw(),...t},this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n&&n.event_id?n.event_id:tl();if(!this._client)return Qn.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},this),r}captureMessage(t,n,r){const s=r&&r.event_id?r.event_id:tl();if(!this._client)return Qn.warn("No client configured on scope - will not capture message!"),s;const o=new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:o,...r,event_id:s},this),s}captureEvent(t,n){const r=n&&n.event_id?n.event_id:tl();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(Qn.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}const na=Nb;function Q2(){return Cb("defaultCurrentScope",()=>new na)}function X2(){return Cb("defaultIsolationScope",()=>new na)}class J2{constructor(t,n){let r;t?r=t:r=new na;let s;n?s=n:s=new na,this._stack=[{scope:r}],this._isolationScope=s}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(s){throw this._popScope(),s}return W2(r)?r.then(s=>(this._popScope(),s),s=>{throw this._popScope(),s}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Sl(){const e=Qh(),t=Rb(e);return t.stack=t.stack||new J2(Q2(),X2())}function eL(e){return Sl().withScope(e)}function tL(e,t){const n=Sl();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function $w(e){return Sl().withScope(()=>e(Sl().getIsolationScope()))}function nL(){return{withIsolationScope:$w,withScope:eL,withSetScope:tL,withSetIsolationScope:(e,t)=>$w(t),getCurrentScope:()=>Sl().getScope(),getIsolationScope:()=>Sl().getIsolationScope()}}function Pb(e){const t=Rb(e);return t.acs?t.acs:nL()}function Xh(){const e=Qh();return Pb(e).getCurrentScope()}function rL(){const e=Qh();return Pb(e).getIsolationScope()}function sL(...e){const t=Qh(),n=Pb(t);if(e.length===2){const[r,s]=e;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(e[0])}function oL(){return Xh().getClient()}const iL=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function aL(e){return e==="http"||e==="https"}function lL(e,t=!1){const{host:n,path:r,pass:s,port:o,projectId:i,protocol:a,publicKey:l}=e;return`${a}://${l}${t&&s?`:${s}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${i}`}function cL(e){const t=iL.exec(e);if(!t){$T(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,s="",o="",i="",a=""]=t.slice(1);let l="",c=a;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const f=c.match(/^\d+/);f&&(c=f[0])}return IT({host:o,pass:s,path:l,projectId:c,port:i,protocol:n,publicKey:r})}function IT(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function uL(e){if(!Tb)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(Qn.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?aL(r)?t&&isNaN(parseInt(t,10))?(Qn.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(Qn.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Qn.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function dL(e){const t=typeof e=="string"?cL(e):IT(e);if(!(!t||!uL(t)))return t}function fL(e){if(e)return hL(e)?{captureContext:e}:mL(e)?{captureContext:e}:e}function hL(e){return e instanceof na||typeof e=="function"}const pL=["user","level","extra","contexts","tags","fingerprint","requestSession","propagationContext"];function mL(e){return Object.keys(e).some(t=>pL.includes(t))}function On(e,t){return Xh().captureException(e,fL(t))}function FT(e,t){const n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return Xh().captureMessage(e,n,r)}function gL(){return rL().lastEventId()}function vL(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function yL(e,t){const n=dL(e);if(!n)return"";const r=`${vL(n)}embed/error-page/`;let s=`dsn=${lL(n)}`;for(const o in t)if(o!=="dsn"&&o!=="onClose")if(o==="user"){const i=t.user;if(!i)continue;i.name&&(s+=`&name=${encodeURIComponent(i.name)}`),i.email&&(s+=`&email=${encodeURIComponent(i.email)}`)}else s+=`&${encodeURIComponent(o)}=${encodeURIComponent(t[o])}`;return`${r}?${s}`}const Na=ps,gm=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Dw(e={}){if(!Na.document){gm&&Qn.error("Global document not defined in showReportDialog call");return}const t=Xh(),n=t.getClient(),r=n&&n.getDsn();if(!r){gm&&Qn.error("DSN not configured for showReportDialog call");return}if(t&&(e.user={...t.getUser(),...e.user}),!e.eventId){const a=gL();a&&(e.eventId=a)}const s=Na.document.createElement("script");s.async=!0,s.crossOrigin="anonymous",s.src=yL(r,e),e.onLoad&&(s.onload=e.onLoad);const{onClose:o}=e;if(o){const a=l=>{if(l.data==="__sentry_reportdialog_closed__")try{o()}finally{Na.removeEventListener("message",a)}};Na.addEventListener("message",a)}const i=Na.document.head||Na.document.body;i?i.appendChild(s):gm&&Qn.error("Not injecting report dialog. No injection point found in HTML")}function bL(e){const t=e.match(/^([^.]+)/);return t!==null&&parseInt(t[0])>=17}function xL(e,t){const n=new WeakSet;function r(s,o){if(!n.has(s)){if(s.cause)return n.add(s),r(s.cause,o);s.cause=o}}r(e,t)}function wL(e,{componentStack:t},n){if(bL(h.version)&&B2(e)&&t){const r=new Error(e.message);r.name=`React ErrorBoundary ${e.name}`,r.stack=t,xL(e,r)}return On(e,{...n,captureContext:{contexts:{react:{componentStack:t}}}})}var vm={exports:{}},ot={};/** @license React v16.13.1
|
3
|
+
* react-is.production.min.js
|
4
|
+
*
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
6
|
+
*
|
7
|
+
* This source code is licensed under the MIT license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/var kw;function _L(){if(kw)return ot;kw=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,s=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,p=e?Symbol.for("react.suspense_list"):60120,g=e?Symbol.for("react.memo"):60115,y=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,v=e?Symbol.for("react.fundamental"):60117,b=e?Symbol.for("react.responder"):60118,x=e?Symbol.for("react.scope"):60119;function w(E){if(typeof E=="object"&&E!==null){var S=E.$$typeof;switch(S){case t:switch(E=E.type,E){case l:case c:case r:case o:case s:case f:return E;default:switch(E=E&&E.$$typeof,E){case a:case u:case y:case g:case i:return E;default:return S}}case n:return S}}}function _(E){return w(E)===c}return ot.AsyncMode=l,ot.ConcurrentMode=c,ot.ContextConsumer=a,ot.ContextProvider=i,ot.Element=t,ot.ForwardRef=u,ot.Fragment=r,ot.Lazy=y,ot.Memo=g,ot.Portal=n,ot.Profiler=o,ot.StrictMode=s,ot.Suspense=f,ot.isAsyncMode=function(E){return _(E)||w(E)===l},ot.isConcurrentMode=_,ot.isContextConsumer=function(E){return w(E)===a},ot.isContextProvider=function(E){return w(E)===i},ot.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},ot.isForwardRef=function(E){return w(E)===u},ot.isFragment=function(E){return w(E)===r},ot.isLazy=function(E){return w(E)===y},ot.isMemo=function(E){return w(E)===g},ot.isPortal=function(E){return w(E)===n},ot.isProfiler=function(E){return w(E)===o},ot.isStrictMode=function(E){return w(E)===s},ot.isSuspense=function(E){return w(E)===f},ot.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===c||E===o||E===s||E===f||E===p||typeof E=="object"&&E!==null&&(E.$$typeof===y||E.$$typeof===g||E.$$typeof===i||E.$$typeof===a||E.$$typeof===u||E.$$typeof===v||E.$$typeof===b||E.$$typeof===x||E.$$typeof===m)},ot.typeOf=w,ot}var Ow;function EL(){return Ow||(Ow=1,vm.exports=_L()),vm.exports}var ym,Mw;function SL(){if(Mw)return ym;Mw=1;var e=EL(),t={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[e.ForwardRef]=r,o[e.Memo]=s;function i(y){return e.isMemo(y)?s:o[y.$$typeof]||t}var a=Object.defineProperty,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;function g(y,m,v){if(typeof m!="string"){if(p){var b=f(m);b&&b!==p&&g(y,b,v)}var x=l(m);c&&(x=x.concat(c(m)));for(var w=i(y),_=i(m),E=0;E<x.length;++E){var S=x[E];if(!n[S]&&!(v&&v[S])&&!(_&&_[S])&&!(w&&w[S])){var R=u(m,S);try{a(y,S,R)}catch{}}}}return y}return ym=g,ym}SL();const LT=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Iw={componentStack:null,error:null,eventId:null};class jb extends h.Component{constructor(t){super(t),jb.prototype.__init.call(this),this.state=Iw,this._openFallbackReportDialog=!0;const n=oL();n&&t.showDialog&&(this._openFallbackReportDialog=!1,this._cleanupHook=n.on("afterSendEvent",r=>{!r.type&&this._lastEventId&&r.event_id===this._lastEventId&&Dw({...t.dialogOptions,eventId:this._lastEventId})}))}componentDidCatch(t,n){const{componentStack:r}=n,s=r??void 0,{beforeCapture:o,onError:i,showDialog:a,dialogOptions:l}=this.props;sL(c=>{o&&o(c,t,s);const u=this.props.handled!=null?this.props.handled:!!this.props.fallback,f=wL(t,n,{mechanism:{handled:u}});i&&i(t,s,f),a&&(this._lastEventId=f,this._openFallbackReportDialog&&Dw({...l,eventId:f})),this.setState({error:t,componentStack:r,eventId:f})})}componentDidMount(){const{onMount:t}=this.props;t&&t()}componentWillUnmount(){const{error:t,componentStack:n,eventId:r}=this.state,{onUnmount:s}=this.props;s&&s(t,n,r),this._cleanupHook&&(this._cleanupHook(),this._cleanupHook=void 0)}__init(){this.resetErrorBoundary=()=>{const{onReset:t}=this.props,{error:n,componentStack:r,eventId:s}=this.state;t&&t(n,r,s),this.setState(Iw)}}render(){const{fallback:t,children:n}=this.props,r=this.state;if(r.error){let s;return typeof t=="function"?s=h.createElement(t,{error:r.error,componentStack:r.componentStack,resetError:this.resetErrorBoundary,eventId:r.eventId}):s=t,h.isValidElement(s)?s:(t&<&&Qn.warn("fallback did not produce a valid ReactElement"),null)}return typeof n=="function"?n():n}}function CL(e,t){return LT&&Qn.warn(`reactRouterV${t}Instrumentation was unable to wrap the \`createRouter\` function because of one or more missing parameters.`),e}function TL(e){return CL(e,"7")}const RL="acts_as";var mv=function(e,t){return mv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},mv(e,t)};function NL(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");mv(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Hf=function(){return Hf=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Hf.apply(this,arguments)};var Ni=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ab(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $b(e,t){return e(t={exports:{}},t.exports),t.exports}var Ei=$b(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function r(){var s=this;this.locked=new Map,this.addToLocked=function(o,i){var a=s.locked.get(o);a===void 0?i===void 0?s.locked.set(o,[]):s.locked.set(o,[i]):i!==void 0&&(a.unshift(i),s.locked.set(o,a))},this.isLocked=function(o){return s.locked.has(o)},this.lock=function(o){return new Promise(function(i,a){s.isLocked(o)?s.addToLocked(o,i):(s.addToLocked(o),i())})},this.unlock=function(o){var i=s.locked.get(o);if(i!==void 0&&i.length!==0){var a=i.pop();s.locked.set(o,i),a!==void 0&&setTimeout(a,0)}else s.locked.delete(o)}}return r.getInstance=function(){return r.instance===void 0&&(r.instance=new r),r.instance},r}();t.default=function(){return n.getInstance()}});Ab(Ei);var PL=Ab($b(function(e,t){var n=Ni&&Ni.__awaiter||function(u,f,p,g){return new(p||(p=Promise))(function(y,m){function v(w){try{x(g.next(w))}catch(_){m(_)}}function b(w){try{x(g.throw(w))}catch(_){m(_)}}function x(w){w.done?y(w.value):new p(function(_){_(w.value)}).then(v,b)}x((g=g.apply(u,f||[])).next())})},r=Ni&&Ni.__generator||function(u,f){var p,g,y,m,v={label:0,sent:function(){if(1&y[0])throw y[1];return y[1]},trys:[],ops:[]};return m={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function b(x){return function(w){return function(_){if(p)throw new TypeError("Generator is already executing.");for(;v;)try{if(p=1,g&&(y=2&_[0]?g.return:_[0]?g.throw||((y=g.return)&&y.call(g),0):g.next)&&!(y=y.call(g,_[1])).done)return y;switch(g=0,y&&(_=[2&_[0],y.value]),_[0]){case 0:case 1:y=_;break;case 4:return v.label++,{value:_[1],done:!1};case 5:v.label++,g=_[1],_=[0];continue;case 7:_=v.ops.pop(),v.trys.pop();continue;default:if(y=v.trys,!((y=y.length>0&&y[y.length-1])||_[0]!==6&&_[0]!==2)){v=0;continue}if(_[0]===3&&(!y||_[1]>y[0]&&_[1]<y[3])){v.label=_[1];break}if(_[0]===6&&v.label<y[1]){v.label=y[1],y=_;break}if(y&&v.label<y[2]){v.label=y[2],v.ops.push(_);break}y[2]&&v.ops.pop(),v.trys.pop();continue}_=f.call(u,v)}catch(E){_=[6,E],g=0}finally{p=y=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([x,w])}}},s=Ni;Object.defineProperty(t,"__esModule",{value:!0});var o="browser-tabs-lock-key",i={key:function(u){return n(s,void 0,void 0,function(){return r(this,function(f){throw new Error("Unsupported")})})},getItem:function(u){return n(s,void 0,void 0,function(){return r(this,function(f){throw new Error("Unsupported")})})},clear:function(){return n(s,void 0,void 0,function(){return r(this,function(u){return[2,window.localStorage.clear()]})})},removeItem:function(u){return n(s,void 0,void 0,function(){return r(this,function(f){throw new Error("Unsupported")})})},setItem:function(u,f){return n(s,void 0,void 0,function(){return r(this,function(p){throw new Error("Unsupported")})})},keySync:function(u){return window.localStorage.key(u)},getItemSync:function(u){return window.localStorage.getItem(u)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(u){return window.localStorage.removeItem(u)},setItemSync:function(u,f){return window.localStorage.setItem(u,f)}};function a(u){return new Promise(function(f){return setTimeout(f,u)})}function l(u){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",p="",g=0;g<u;g++)p+=f[Math.floor(Math.random()*f.length)];return p}var c=function(){function u(f){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=f,u.waiters===void 0&&(u.waiters=[])}return u.prototype.acquireLock=function(f,p){return p===void 0&&(p=5e3),n(this,void 0,void 0,function(){var g,y,m,v,b,x,w;return r(this,function(_){switch(_.label){case 0:g=Date.now()+l(4),y=Date.now()+p,m=o+"-"+f,v=this.storageHandler===void 0?i:this.storageHandler,_.label=1;case 1:return Date.now()<y?[4,a(30)]:[3,8];case 2:return _.sent(),v.getItemSync(m)!==null?[3,5]:(b=this.id+"-"+f+"-"+g,[4,a(Math.floor(25*Math.random()))]);case 3:return _.sent(),v.setItemSync(m,JSON.stringify({id:this.id,iat:g,timeoutKey:b,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,a(30)];case 4:return _.sent(),(x=v.getItemSync(m))!==null&&(w=JSON.parse(x)).id===this.id&&w.iat===g?(this.acquiredIatSet.add(g),this.refreshLockWhileAcquired(m,g),[2,!0]):[3,7];case 5:return u.lockCorrector(this.storageHandler===void 0?i:this.storageHandler),[4,this.waitForSomethingToChange(y)];case 6:_.sent(),_.label=7;case 7:return g=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},u.prototype.refreshLockWhileAcquired=function(f,p){return n(this,void 0,void 0,function(){var g=this;return r(this,function(y){return setTimeout(function(){return n(g,void 0,void 0,function(){var m,v,b;return r(this,function(x){switch(x.label){case 0:return[4,Ei.default().lock(p)];case 1:return x.sent(),this.acquiredIatSet.has(p)?(m=this.storageHandler===void 0?i:this.storageHandler,(v=m.getItemSync(f))===null?(Ei.default().unlock(p),[2]):((b=JSON.parse(v)).timeRefreshed=Date.now(),m.setItemSync(f,JSON.stringify(b)),Ei.default().unlock(p),this.refreshLockWhileAcquired(f,p),[2])):(Ei.default().unlock(p),[2])}})})},1e3),[2]})})},u.prototype.waitForSomethingToChange=function(f){return n(this,void 0,void 0,function(){return r(this,function(p){switch(p.label){case 0:return[4,new Promise(function(g){var y=!1,m=Date.now(),v=!1;function b(){if(v||(window.removeEventListener("storage",b),u.removeFromWaiting(b),clearTimeout(x),v=!0),!y){y=!0;var w=50-(Date.now()-m);w>0?setTimeout(g,w):g(null)}}window.addEventListener("storage",b),u.addToWaiting(b);var x=setTimeout(b,Math.max(0,f-Date.now()))})];case 1:return p.sent(),[2]}})})},u.addToWaiting=function(f){this.removeFromWaiting(f),u.waiters!==void 0&&u.waiters.push(f)},u.removeFromWaiting=function(f){u.waiters!==void 0&&(u.waiters=u.waiters.filter(function(p){return p!==f}))},u.notifyWaiters=function(){u.waiters!==void 0&&u.waiters.slice().forEach(function(f){return f()})},u.prototype.releaseLock=function(f){return n(this,void 0,void 0,function(){return r(this,function(p){switch(p.label){case 0:return[4,this.releaseLock__private__(f)];case 1:return[2,p.sent()]}})})},u.prototype.releaseLock__private__=function(f){return n(this,void 0,void 0,function(){var p,g,y,m;return r(this,function(v){switch(v.label){case 0:return p=this.storageHandler===void 0?i:this.storageHandler,g=o+"-"+f,(y=p.getItemSync(g))===null?[2]:(m=JSON.parse(y)).id!==this.id?[3,2]:[4,Ei.default().lock(m.iat)];case 1:v.sent(),this.acquiredIatSet.delete(m.iat),p.removeItemSync(g),Ei.default().unlock(m.iat),u.notifyWaiters(),v.label=2;case 2:return[2]}})})},u.lockCorrector=function(f){for(var p=Date.now()-5e3,g=f,y=[],m=0;;){var v=g.keySync(m);if(v===null)break;y.push(v),m++}for(var b=!1,x=0;x<y.length;x++){var w=y[x];if(w.includes(o)){var _=g.getItemSync(w);if(_!==null){var E=JSON.parse(_);(E.timeRefreshed===void 0&&E.timeAcquired<p||E.timeRefreshed!==void 0&&E.timeRefreshed<p)&&(g.removeItemSync(w),b=!0)}}}b&&u.notifyWaiters()},u.waiters=void 0,u}();t.default=c})),$i=$b(function(e,t){var n=Ni&&Ni.__assign||function(){return n=Object.assign||function(l){for(var c,u=1,f=arguments.length;u<f;u++)for(var p in c=arguments[u])Object.prototype.hasOwnProperty.call(c,p)&&(l[p]=c[p]);return l},n.apply(this,arguments)};function r(l,c){if(!c)return"";var u="; "+l;return c===!0?u:u+"="+c}function s(l,c,u){return encodeURIComponent(l).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(c).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(f){if(typeof f.expires=="number"){var p=new Date;p.setMilliseconds(p.getMilliseconds()+864e5*f.expires),f.expires=p}return r("Expires",f.expires?f.expires.toUTCString():"")+r("Domain",f.domain)+r("Path",f.path)+r("Secure",f.secure)+r("SameSite",f.sameSite)}(u)}function o(l){for(var c={},u=l?l.split("; "):[],f=/(%[\dA-F]{2})+/gi,p=0;p<u.length;p++){var g=u[p].split("="),y=g.slice(1).join("=");y.charAt(0)==='"'&&(y=y.slice(1,-1));try{c[g[0].replace(f,decodeURIComponent)]=y.replace(f,decodeURIComponent)}catch{}}return c}function i(){return o(document.cookie)}function a(l,c,u){document.cookie=s(l,c,n({path:"/"},u))}t.__esModule=!0,t.encode=s,t.parse=o,t.getAll=i,t.get=function(l){return i()[l]},t.set=a,t.remove=function(l,c){a(l,"",n(n({},c),{expires:-1}))}});Ab($i),$i.encode,$i.parse,$i.getAll;$i.get;$i.set;$i.remove;new PL;var jL={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},Ss=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},AL=Hf(Hf({},jL),{buildAuthorizeUrl:Ss,buildLogoutUrl:Ss,getAccessTokenSilently:Ss,getAccessTokenWithPopup:Ss,getIdTokenClaims:Ss,loginWithRedirect:Ss,loginWithPopup:Ss,logout:Ss,handleRedirectCallback:Ss}),$L=h.createContext(AL);(function(e){NL(t,e);function t(n,r){var s=e.call(this,r??n)||this;return s.error=n,s.error_description=r,Object.setPrototypeOf(s,t.prototype),s}return t})(Error);var si=function(e){return e===void 0&&(e=$L),h.useContext(e)};const bm="sourceControlConnect";var W=typeof window<"u"?window:void 0,Vn=typeof globalThis<"u"?globalThis:W,UT=Array.prototype,Fw=UT.forEach,Lw=UT.indexOf,Xn=Vn==null?void 0:Vn.navigator,_e=Vn==null?void 0:Vn.document,Bn=Vn==null?void 0:Vn.location,gv=Vn==null?void 0:Vn.fetch,vv=Vn!=null&&Vn.XMLHttpRequest&&"withCredentials"in new Vn.XMLHttpRequest?Vn.XMLHttpRequest:void 0,Uw=Vn==null?void 0:Vn.AbortController,Ln=Xn==null?void 0:Xn.userAgent,ze=W??{},As={DEBUG:!1,LIB_VERSION:"1.256.1"},xm="$copy_autocapture",DL=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],Is=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),kL=["fatal","error","warning","log","info","debug"];function Qe(e,t){return e.indexOf(t)!==-1}var Jh=function(e){return e.trim()},yv=function(e){return e.replace(/^\$/,"")},OL=Array.isArray,BT=Object.prototype,VT=BT.hasOwnProperty,ep=BT.toString,bt=OL||function(e){return ep.call(e)==="[object Array]"},br=e=>typeof e=="function",At=e=>e===Object(e)&&!bt(e),Wa=e=>{if(At(e)){for(var t in e)if(VT.call(e,t))return!1;return!0}return!1},he=e=>e===void 0,$t=e=>ep.call(e)=="[object String]",bv=e=>$t(e)&&e.trim().length===0,oi=e=>e===null,st=e=>he(e)||oi(e),xn=e=>ep.call(e)=="[object Number]",ts=e=>ep.call(e)==="[object Boolean]",ML=e=>e instanceof FormData,IL=e=>Qe(DL,e),zT=e=>{var t={t:function(n){if(W&&(As.DEBUG||ze.POSTHOG_DEBUG)&&!he(W.console)&&W.console){for(var r=("__rrweb_original__"in W.console[n])?W.console[n].__rrweb_original__:W.console[n],s=arguments.length,o=new Array(s>1?s-1:0),i=1;i<s;i++)o[i-1]=arguments[i];r(e,...o)}},info:function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];t.t("log",...r)},warn:function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];t.t("warn",...r)},error:function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];t.t("error",...r)},critical:function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];console.error(e,...r)},uninitializedWarning:n=>{t.error("You must initialize PostHog before calling "+n)},createLogger:n=>zT(e+" "+n)};return t},Ee=zT("[PostHog.js]"),sn=Ee.createLogger,FL=sn("[ExternalScriptsLoader]"),Bw=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return FL.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=_e==null?void 0:_e.querySelectorAll("script");if(r){for(var s=0;s<r.length;s++)if(r[s].src===t)return n()}var o=()=>{if(!_e)return n("document not found");var i=_e.createElement("script");if(i.type="text/javascript",i.crossOrigin="anonymous",i.src=t,i.onload=c=>n(void 0,c),i.onerror=c=>n(c),e.config.prepare_external_dependency_script&&(i=e.config.prepare_external_dependency_script(i)),!i)return n("prepare_external_dependency_script returned null");var a,l=_e.querySelectorAll("body > script");l.length>0?(a=l[0].parentNode)==null||a.insertBefore(i,l[0]):_e.body.appendChild(i)};_e!=null&&_e.body?o():_e==null||_e.addEventListener("DOMContentLoaded",o)};function be(){return be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},be.apply(null,arguments)}function WT(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}ze.__PosthogExtensions__=ze.__PosthogExtensions__||{},ze.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/"+t+".js?v="+e.version;if(t==="remote-config"&&(r="/array/"+e.config.token+"/config.js"),t==="toolbar"){var s=3e5;r=r+"&t="+Math.floor(Date.now()/s)*s}var o=e.requestRouter.endpointFor("assets",r);Bw(e,o,n)},ze.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);Bw(e,r,n)};var Gf={};function Fo(e,t,n){if(bt(e)){if(Fw&&e.forEach===Fw)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,s=e.length;r<s;r++)if(r in e&&t.call(n,e[r],r)===Gf)return}}}function ct(e,t,n){if(!st(e)){if(bt(e))return Fo(e,t,n);if(ML(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===Gf)return}else for(var s in e)if(VT.call(e,s)&&t.call(n,e[s],s)===Gf)return}}var Ut=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Fo(n,function(s){for(var o in s)s[o]!==void 0&&(e[o]=s[o])}),e},tp=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Fo(n,function(s){Fo(s,function(o){e.push(o)})}),e};function Sf(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var Vw=function(e){try{return e()}catch{return}},LL=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(s){Ee.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Ee.critical(s)}}},Db=function(e){var t={};return ct(e,function(n,r){($t(n)&&n.length>0||xn(n))&&(t[r]=n)}),t};function UL(e,t){return n=e,r=o=>$t(o)&&!oi(t)?o.slice(0,t):o,s=new Set,function o(i,a){return i!==Object(i)?r?r(i,a):i:s.has(i)?void 0:(s.add(i),bt(i)?(l=[],Fo(i,c=>{l.push(o(c))})):(l={},ct(i,(c,u)=>{s.has(c)||(l[u]=o(c,u))})),l);var l}(n);var n,r,s}var BL=["herokuapp.com","vercel.app","netlify.app"];function VL(e){var t=e==null?void 0:e.hostname;if(!$t(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of BL)if(n===r)return!1;return!0}function qT(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function St(e,t,n,r){var{capture:s=!1,passive:o=!0}=r??{};e==null||e.addEventListener(t,n,{capture:s,passive:o})}var HT="$people_distinct_id",kc="__alias",Oc="__timers",zw="$autocapture_disabled_server_side",xv="$heatmaps_enabled_server_side",Ww="$exception_capture_enabled_server_side",wv="$error_tracking_suppression_rules",qw="$web_vitals_enabled_server_side",GT="$dead_clicks_enabled_server_side",Hw="$web_vitals_allowed_metrics",_v="$session_recording_enabled_server_side",Gw="$console_log_recording_enabled_server_side",Kw="$session_recording_network_payload_capture",Yw="$session_recording_masking",Zw="$session_recording_canvas_recording",Qw="$replay_sample_rate",Xw="$replay_minimum_duration",Jw="$replay_script_config",Kf="$sesid",Mc="$session_is_sampled",Ev="$session_recording_url_trigger_activated_session",Sv="$session_recording_event_trigger_activated_session",qa="$enabled_feature_flags",Cf="$early_access_features",Cv="$feature_flag_details",Ic="$stored_person_properties",Si="$stored_group_properties",Tv="$surveys",Ld="$surveys_activated",Yf="$flag_call_reported",Ps="$user_state",Rv="$client_session_props",Nv="$capture_rate_limit",Pv="$initial_campaign_params",jv="$initial_referrer_info",Zf="$initial_person_info",Qf="$epp",KT="__POSTHOG_TOOLBAR__",Ud="$posthog_cookieless",zL=[HT,kc,"__cmpns",Oc,_v,xv,Kf,qa,wv,Ps,Cf,Cv,Si,Ic,Tv,Yf,Rv,Nv,Pv,jv,Qf,Zf];function e_(e){return e instanceof Element&&(e.id===KT||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function np(e){return!!e&&e.nodeType===1}function Lo(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function YT(e){return!!e&&e.nodeType===3}function ZT(e){return!!e&&e.nodeType===11}function kb(e){return e?Jh(e).split(/\s+/):[]}function t_(e){var t=W==null?void 0:W.location.href;return!!(t&&e&&e.some(n=>t.match(n)))}function Xf(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return kb(t)}function QT(e){return st(e)?null:Jh(e).split(/(\s+)/).filter(t=>Cl(t)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function rp(e){var t="";return $v(e)&&!eR(e)&&e.childNodes&&e.childNodes.length&&ct(e.childNodes,function(n){var r;YT(n)&&n.textContent&&(t+=(r=QT(n.textContent))!==null&&r!==void 0?r:"")}),Jh(t)}function XT(e){return he(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Av=["a","button","form","input","select","textarea","label"];function JT(e){var t=e.parentNode;return!(!t||!np(t))&&t}function WL(e,t,n,r,s){var o,i,a;if(n===void 0&&(n=void 0),!W||!e||Lo(e,"html")||!np(e)||(o=n)!=null&&o.url_allowlist&&!t_(n.url_allowlist)||(i=n)!=null&&i.url_ignorelist&&t_(n.url_ignorelist))return!1;if((a=n)!=null&&a.dom_event_allowlist){var l=n.dom_event_allowlist;if(l&&!l.some(v=>t.type===v))return!1}for(var c=!1,u=[e],f=!0,p=e;p.parentNode&&!Lo(p,"body");)if(ZT(p.parentNode))u.push(p.parentNode.host),p=p.parentNode.host;else{if(!(f=JT(p)))break;if(r||Av.indexOf(f.tagName.toLowerCase())>-1)c=!0;else{var g=W.getComputedStyle(f);g&&g.getPropertyValue("cursor")==="pointer"&&(c=!0)}u.push(f),p=f}if(!function(v,b){var x=b==null?void 0:b.element_allowlist;if(he(x))return!0;var w,_=function(S){if(x.some(R=>S.tagName.toLowerCase()===R))return{v:!0}};for(var E of v)if(w=_(E))return w.v;return!1}(u,n)||!function(v,b){var x=b==null?void 0:b.css_selector_allowlist;if(he(x))return!0;var w,_=function(S){if(x.some(R=>S.matches(R)))return{v:!0}};for(var E of v)if(w=_(E))return w.v;return!1}(u,n))return!1;var y=W.getComputedStyle(e);if(y&&y.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var m=e.tagName.toLowerCase();switch(m){case"html":return!1;case"form":return(s||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(t.type)>=0;default:return c?(s||["click"]).indexOf(t.type)>=0:(s||["click"]).indexOf(t.type)>=0&&(Av.indexOf(m)>-1||e.getAttribute("contenteditable")==="true")}}function $v(e){for(var t=e;t.parentNode&&!Lo(t,"body");t=t.parentNode){var n=Xf(t);if(Qe(n,"ph-sensitive")||Qe(n,"ph-no-capture"))return!1}if(Qe(Xf(e),"ph-include"))return!0;var r=e.type||"";if($t(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!($t(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function eR(e){return!!(Lo(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Lo(e,"select")||Lo(e,"textarea")||e.getAttribute("contenteditable")==="true")}var tR="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",qL=new RegExp("^(?:"+tR+")$"),HL=new RegExp(tR),nR="\\d{3}-?\\d{2}-?\\d{4}",GL=new RegExp("^("+nR+")$"),KL=new RegExp("("+nR+")");function Cl(e,t){return t===void 0&&(t=!0),!(st(e)||$t(e)&&(e=Jh(e),(t?qL:HL).test((e||"").replace(/[- ]/g,""))||(t?GL:KL).test(e)))}function rR(e){var t=rp(e);return Cl(t=(t+" "+sR(e)).trim())?t:""}function sR(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ct(e.childNodes,function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=rp(n);t=(t+" "+s).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+sR(n)).trim())}catch(o){Ee.error("[AutoCapture]",o)}}),t}function YL(e){return function(t){var n=t.map(r=>{var s,o,i="";if(r.tag_name&&(i+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))i+="."+a.replace(/"/g,"");var l=be({},r.text?{text:r.text}:{},{"nth-child":(s=r.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(o=r.nth_of_type)!==null&&o!==void 0?o:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),c={};return Sf(l).sort((u,f)=>{var[p]=u,[g]=f;return p.localeCompare(g)}).forEach(u=>{var[f,p]=u;return c[n_(f.toString())]=n_(p.toString())}),i+=":",i+=Sf(c).map(u=>{var[f,p]=u;return f+'="'+p+'"'}).join("")});return n.join(";")}(function(t){return t.map(n=>{var r,s,o={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(s=n.attr__href)==null?void 0:s.slice(0,2048),attr_class:ZL(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Sf(n).filter(i=>{var[a]=i;return a.indexOf("attr__")===0}).forEach(i=>{var[a,l]=i;return o.attributes[a]=l}),o})}(e))}function n_(e){return e.replace(/"|\\"/g,'\\"')}function ZL(e){var t=e.attr__class;return t?bt(t)?t:kb(t):void 0}class oR{constructor(){this.clicks=[]}isRageClick(t,n,r){var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(t-s.x)+Math.abs(n-s.y)<30&&r-s.timestamp<1e3){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var QL=["localhost","127.0.0.1"],Tl=e=>{var t=_e==null?void 0:_e.createElement("a");return he(t)?null:(t.href=e,t)},XL=function(e,t){var n,r;t===void 0&&(t="&");var s=[];return ct(e,function(o,i){he(o)||he(i)||i==="undefined"||(n=encodeURIComponent((a=>a instanceof File)(o)?o.name:o.toString()),r=encodeURIComponent(i),s[s.length]=r+"="+n)}),s.join(t)},Jf=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<r.length;s++){var o=r[s].split("=");if(o[0]===t){n=o;break}}if(!bt(n)||n.length<2)return"";var i=n[1];try{i=decodeURIComponent(i)}catch{Ee.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},Ob=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[0]||"",o=r[1],i=s.split("?"),a=i[1],l=i[0],c=(a||"").split("&"),u=[],f=0;f<c.length;f++){var p=c[f].split("=");bt(p)&&(t.includes(p[0])?u.push(p[0]+"="+n):u.push(c[f]))}var g=l;return a!=null&&(g+="?"+u.join("&")),o!=null&&(g+="#"+o),g},eh=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},r_=sn("[AutoCapture]");function wm(e,t){return t.length>e?t.slice(0,e)+"...":t}function JL(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!np(t));return t}function eU(e,t,n,r){var s=e.tagName.toLowerCase(),o={tag_name:s};Av.indexOf(s)>-1&&!n&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?o.$el_text=wm(1024,rR(e)):o.$el_text=wm(1024,rp(e)));var i=Xf(e);i.length>0&&(o.classes=i.filter(function(u){return u!==""})),ct(e.attributes,function(u){var f;if((!eR(e)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(r==null||!r.includes(u.name))&&!t&&Cl(u.value)&&(f=u.name,!$t(f)||f.substring(0,10)!=="_ngcontent"&&f.substring(0,7)!=="_nghost")){var p=u.value;u.name==="class"&&(p=kb(p).join(" ")),o["attr__"+u.name]=wm(1024,p)}});for(var a=1,l=1,c=e;c=JL(c);)a++,c.tagName===e.tagName&&l++;return o.nth_child=a,o.nth_of_type=l,o}function tU(e,t){for(var n,r,{e:s,maskAllElementAttributes:o,maskAllText:i,elementAttributeIgnoreList:a,elementsChainAsString:l}=t,c=[e],u=e;u.parentNode&&!Lo(u,"body");)ZT(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var f,p=[],g={},y=!1,m=!1;if(ct(c,_=>{var E=$v(_);_.tagName.toLowerCase()==="a"&&(y=_.getAttribute("href"),y=E&&y&&Cl(y)&&y),Qe(Xf(_),"ph-no-capture")&&(m=!0),p.push(eU(_,o,i,a));var S=function(R){if(!$v(R))return{};var C={};return ct(R.attributes,function(N){if(N.name&&N.name.indexOf("data-ph-capture-attribute")===0){var k=N.name.replace("data-ph-capture-attribute-",""),V=N.value;k&&V&&Cl(V)&&(C[k]=V)}}),C}(_);Ut(g,S)}),m)return{props:{},explicitNoCapture:m};if(i||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?p[0].$el_text=rR(e):p[0].$el_text=rp(e)),y){var v,b;p[0].attr__href=y;var x=(v=Tl(y))==null?void 0:v.host,w=W==null||(b=W.location)==null?void 0:b.host;x&&w&&x!==w&&(f=y)}return{props:Ut({$event_type:s.type,$ce_version:1},l?{}:{$elements:p},{$elements_chain:YL(p)},(n=p[0])!=null&&n.$el_text?{$el_text:(r=p[0])==null?void 0:r.$el_text}:{},f&&s.type==="click"?{$external_click_url:f}:{},g)}}class nU{constructor(t){this.i=!1,this.o=null,this.rageclicks=new oR,this.h=!1,this.instance=t,this.m=null}get S(){var t,n,r=At(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(t=r.url_allowlist)==null?void 0:t.map(s=>new RegExp(s)),r.url_ignorelist=(n=r.url_ignorelist)==null?void 0:n.map(s=>new RegExp(s)),r}$(){if(this.isBrowserSupported()){if(W&&_e){var t=r=>{r=r||(W==null?void 0:W.event);try{this.k(r)}catch(s){r_.error("Failed to capture event",s)}};if(St(_e,"submit",t,{capture:!0}),St(_e,"change",t,{capture:!0}),St(_e,"click",t,{capture:!0}),this.S.capture_copied_text){var n=r=>{r=r||(W==null?void 0:W.event),this.k(r,xm)};St(_e,"copy",n,{capture:!0}),St(_e,"cut",n,{capture:!0})}}}else r_.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.i&&(this.$(),this.i=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.h=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[zw]:!!t.autocapture_opt_out}),this.o=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.m=t}getElementSelectors(t){var n,r=[];return(n=this.m)==null||n.forEach(s=>{var o=_e==null?void 0:_e.querySelectorAll(s);o==null||o.forEach(i=>{t===i&&r.push(s)})}),r}get isEnabled(){var t,n,r=(t=this.instance.persistence)==null?void 0:t.props[zw],s=this.o;if(oi(s)&&!ts(r)&&!this.instance.I())return!1;var o=(n=this.o)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!o}k(t,n){if(n===void 0&&(n="$autocapture"),this.isEnabled){var r,s=XT(t);YT(s)&&(s=s.parentNode||null),n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this.k(t,"$rageclick");var o=n===xm;if(s&&WL(s,t,this.S,o,o?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:a}=tU(s,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.S.element_attribute_ignorelist,elementsChainAsString:this.h});if(a)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(i.$element_selectors=l),n===xm){var c,u=QT(W==null||(c=W.getSelection())==null?void 0:c.toString()),f=t.type||"clipboard";if(!u)return!1;i.$selected_content=u,i.$copy_type=f}return this.instance.capture(n,i),!0}}}isBrowserSupported(){return br(_e==null?void 0:_e.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return xn(e)&&isFinite(e)&&Math.floor(e)===e});var s_="0123456789abcdef";class th{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,s){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(s)||t<0||n<0||r<0||s<0||t>0xffffffffffff||n>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/Math.pow(2,40),o[1]=t/Math.pow(2,32),o[2]=t/Math.pow(2,24),o[3]=t/Math.pow(2,16),o[4]=t/Math.pow(2,8),o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=s>>>24,o[13]=s>>>16,o[14]=s>>>8,o[15]=s,new th(o)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+s_.charAt(this.bytes[n]>>>4)+s_.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new th(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class rU{constructor(){this.P=0,this.R=0,this.T=new sU}generate(){var t=this.generateOrAbort();if(he(t)){this.P=0;var n=this.generateOrAbort();if(he(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.P)this.P=t,this.M();else{if(!(t+1e4>this.P))return;this.R++,this.R>4398046511103&&(this.P++,this.M())}return th.fromFieldsV7(this.P,Math.trunc(this.R/Math.pow(2,30)),this.R&Math.pow(2,30)-1,this.T.nextUint32())}M(){this.R=1024*this.T.nextUint32()+(1023&this.T.nextUint32())}}var o_,iR=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};W&&!he(W.crypto)&&crypto.getRandomValues&&(iR=e=>crypto.getRandomValues(e));class sU{constructor(){this.C=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.C.length&&(iR(this.C),this.F=0),this.C[this.F++]}}var ko=()=>oU().toString(),oU=()=>(o_||(o_=new rU)).generate(),gc="",iU=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function aU(e,t){if(t){var n=function(s,o){if(o===void 0&&(o=_e),gc)return gc;if(!o||["localhost","127.0.0.1"].includes(s))return"";for(var i=s.split("."),a=Math.min(i.length,8),l="dmn_chk_"+ko();!gc&&a--;){var c=i.slice(a).join("."),u=l+"=1;domain=."+c+";path=/";o.cookie=u+";max-age=3",o.cookie.includes(l)&&(o.cookie=u+";max-age=0",gc=c)}return gc}(e);if(!n){var r=(s=>{var o=s.match(iU);return o?o[0]:""})(e);r!==n&&Ee.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var os={O:()=>!!_e,A:function(e){Ee.error("cookieStore error: "+e)},D:function(e){if(_e){try{for(var t=e+"=",n=_e.cookie.split(";").filter(o=>o.length),r=0;r<n.length;r++){for(var s=n[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return decodeURIComponent(s.substring(t.length,s.length))}}catch{}return null}},L:function(e){var t;try{t=JSON.parse(os.D(e))||{}}catch{}return t},j:function(e,t,n,r,s){if(_e)try{var o="",i="",a=aU(_e.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),o="; expires="+l.toUTCString()}s&&(i="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+i;return c.length>3686.4&&Ee.warn("cookieStore warning: large cookie, len="+c.length),_e.cookie=c,c}catch{return}},N:function(e,t){try{os.j(e,"",-1,t)}catch{return}}},_m=null,Kt={O:function(){if(!oi(_m))return _m;var e=!0;if(he(W))e=!1;else try{var t="__mplssupport__";Kt.j(t,"xyz"),Kt.D(t)!=='"xyz"'&&(e=!1),Kt.N(t)}catch{e=!1}return e||Ee.error("localStorage unsupported; falling back to cookie store"),_m=e,e},A:function(e){Ee.error("localStorage error: "+e)},D:function(e){try{return W==null?void 0:W.localStorage.getItem(e)}catch(t){Kt.A(t)}return null},L:function(e){try{return JSON.parse(Kt.D(e))||{}}catch{}return null},j:function(e,t){try{W==null||W.localStorage.setItem(e,JSON.stringify(t))}catch(n){Kt.A(n)}},N:function(e){try{W==null||W.localStorage.removeItem(e)}catch(t){Kt.A(t)}}},lU=["distinct_id",Kf,Mc,Qf,Zf],Bd=be({},Kt,{L:function(e){try{var t={};try{t=os.L(e)||{}}catch{}var n=Ut(t,JSON.parse(Kt.D(e)||"{}"));return Kt.j(e,n),n}catch{}return null},j:function(e,t,n,r,s,o){try{Kt.j(e,t,void 0,void 0,o);var i={};lU.forEach(a=>{t[a]&&(i[a]=t[a])}),Object.keys(i).length&&os.j(e,i,n,r,s,o)}catch(a){Kt.A(a)}},N:function(e,t){try{W==null||W.localStorage.removeItem(e),os.N(e,t)}catch(n){Kt.A(n)}}}),Vd={},cU={O:function(){return!0},A:function(e){Ee.error("memoryStorage error: "+e)},D:function(e){return Vd[e]||null},L:function(e){return Vd[e]||null},j:function(e,t){Vd[e]=t},N:function(e){delete Vd[e]}},vi=null,un={O:function(){if(!oi(vi))return vi;if(vi=!0,he(W))vi=!1;else try{var e="__support__";un.j(e,"xyz"),un.D(e)!=='"xyz"'&&(vi=!1),un.N(e)}catch{vi=!1}return vi},A:function(e){Ee.error("sessionStorage error: ",e)},D:function(e){try{return W==null?void 0:W.sessionStorage.getItem(e)}catch(t){un.A(t)}return null},L:function(e){try{return JSON.parse(un.D(e))||null}catch{}return null},j:function(e,t){try{W==null||W.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){un.A(n)}},N:function(e){try{W==null||W.sessionStorage.removeItem(e)}catch(t){un.A(t)}}},Pa=function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e}({});class uU{constructor(t){this._instance=t}get S(){return this._instance.config}get consent(){return this.U()?Pa.DENIED:this.q}isOptedOut(){return this.consent===Pa.DENIED||this.consent===Pa.PENDING&&this.S.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(t){this.B.j(this.H,t?1:0,this.S.cookie_expiration,this.S.cross_subdomain_cookie,this.S.secure_cookie)}reset(){this.B.N(this.H,this.S.cross_subdomain_cookie)}get H(){var{token:t,opt_out_capturing_cookie_prefix:n}=this._instance.config;return(n||"__ph_opt_in_out_")+t}get q(){var t=this.B.D(this.H);return t==="1"?Pa.GRANTED:t==="0"?Pa.DENIED:Pa.PENDING}get B(){if(!this.W){var t=this.S.opt_out_capturing_persistence_type;this.W=t==="localStorage"?Kt:os;var n=t==="localStorage"?os:Kt;n.D(this.H)&&(this.W.D(this.H)||this.optInOut(n.D(this.H)==="1"),n.N(this.H,this.S.cross_subdomain_cookie))}return this.W}U(){return!!this.S.respect_dnt&&!!qT([Xn==null?void 0:Xn.doNotTrack,Xn==null?void 0:Xn.msDoNotTrack,ze.doNotTrack],t=>Qe([!0,1,"1","yes"],t))}}var zd=sn("[Dead Clicks]"),dU=()=>!0,fU=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(GT)),r=e.instance.config.capture_dead_clicks;return ts(r)?r:n};class aR{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[GT]:t==null?void 0:t.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.J(()=>{this.V()})}J(t){var n,r;(n=ze.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",s=>{s?zd.error("failed to load script",s):t()})}V(){var t;if(_e){if(!this.G&&(t=ze.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=At(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.G=ze.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.G.start(_e),zd.info("starting...")}}else zd.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,zd.info("stopping..."))}}function Jn(e,t,n,r,s){return t>n&&(Ee.warn("min cannot be greater than max."),t=n),xn(e)?e>n?(r&&Ee.warn(r+" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r&&Ee.warn(r+" cannot be less than min: "+t+". Using min value instead."),t):e:(r&&Ee.warn(r+" must be a number. using max or fallback. max: "+n+", fallback: "+s),Jn(s||n,t,n,r))}class lR{constructor(t){this.K={},this.Y=()=>{Object.keys(this.K).forEach(n=>{var r=this.X(n)+this.Z;r>=this.tt?delete this.K[n]:this.it(n,r)})},this.X=n=>this.K[String(n)],this.it=(n,r)=>{this.K[String(n)]=r},this.consumeRateLimit=n=>{var r,s=(r=this.X(n))!==null&&r!==void 0?r:this.tt;if((s=Math.max(s-1,0))===0)return!0;this.it(n,s);var o,i=s===0;return i&&((o=this.et)==null||o.call(this,n)),i},this.rt=t,this.et=this.rt.et,this.tt=Jn(this.rt.bucketSize,0,100,"rate limiter bucket size"),this.Z=Jn(this.rt.refillRate,0,this.tt,"rate limiter refill rate"),this.st=Jn(this.rt.refillInterval,0,864e5,"rate limiter refill interval"),setInterval(()=>{this.Y()},this.st)}}var Wd=sn("[ExceptionAutocapture]");let hU=class{constructor(t){var n,r,s;this.nt=()=>{var o;if(W&&this.isEnabled&&(o=ze.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var i=ze.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=ze.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=ze.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ot&&this.S.capture_unhandled_errors&&(this.ot=i(this.captureException.bind(this))),!this.lt&&this.S.capture_unhandled_rejections&&(this.lt=a(this.captureException.bind(this))),!this.ut&&this.S.capture_console_errors&&(this.ut=l(this.captureException.bind(this)))}catch(c){Wd.error("failed to start",c),this.ht()}}},this._instance=t,this.dt=!((n=this._instance.persistence)==null||!n.props[Ww]),this.S=this.vt(),this.ct=new lR({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10,refillInterval:1e4}),this.startIfEnabled()}vt(){var t=this._instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return At(t)?n=be({},n,t):(he(t)?this.dt:t)&&(n=be({},n,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.S.capture_console_errors||this.S.capture_unhandled_errors||this.S.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Wd.info("enabled"),this.J(this.nt))}J(t){var n,r;(n=ze.__PosthogExtensions__)!=null&&n.errorWrappingFunctions&&t(),(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",s=>{if(s)return Wd.error("failed to load script",s);t()})}ht(){var t,n,r;(t=this.ot)==null||t.call(this),this.ot=void 0,(n=this.lt)==null||n.call(this),this.lt=void 0,(r=this.ut)==null||r.call(this),this.ut=void 0}onRemoteConfig(t){var n=t.autocaptureExceptions;this.dt=!!n||!1,this.S=this.vt(),this._instance.persistence&&this._instance.persistence.register({[Ww]:this.dt}),this.startIfEnabled()}captureException(t){var n,r=this._instance.requestRouter.endpointFor("ui");t.$exception_personURL=r+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id();var s=(n=t.$exception_list[0].type)!==null&&n!==void 0?n:"Exception";this.ct.consumeRateLimit(s)?Wd.info("Skipping exception capture because of client rate limiting.",{exception:t.$exception_list[0].type}):this._instance.exceptions.sendExceptionEvent(t)}};function cR(e){return!he(Event)&&uR(e,Event)}function uR(e,t){try{return e instanceof t}catch{return!1}}function dR(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return uR(e,Error)}}function Tf(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function Em(e){return Tf(e,"DOMError")}var i_=/\(error: (.*)\)/,a_=50,Ha="?";function Sm(e,t,n,r){var s={platform:"web:javascript",filename:e,function:t==="<anonymous>"?Ha:t,in_app:!0};return he(n)||(s.lineno=n),he(r)||(s.colno=r),s}var pU=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,mU=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,gU=/\((\S*)(?::(\d+))(?::(\d+))\)/,vU=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,yU=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,bU=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.sort((s,o)=>s[0]-o[0]).map(s=>s[1]);return function(s,o){o===void 0&&(o=0);for(var i=[],a=s.split(`
|
10
|
+
`),l=o;l<a.length;l++){var c=a[l];if(!(c.length>1024)){var u=i_.test(c)?c.replace(i_,"$1"):c;if(!u.match(/\S*Error: /)){for(var f of r){var p=f(u);if(p){i.push(p);break}}if(i.length>=a_)break}}}return function(g){if(!g.length)return[];var y=Array.from(g);return y.reverse(),y.slice(0,a_).map(m=>be({},m,{filename:m.filename||xU(y).filename,function:m.function||Ha}))}(i)}}([30,e=>{var t=pU.exec(e);if(t){var[,n,r,s]=t;return Sm(n,Ha,+r,+s)}var o=mU.exec(e);if(o){if(o[2]&&o[2].indexOf("eval")===0){var i=gU.exec(o[2]);i&&(o[2]=i[1],o[3]=i[2],o[4]=i[3])}var[a,l]=c_(o[1]||Ha,o[2]);return Sm(l,a,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}}],[50,e=>{var t=vU.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=yU.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],s=t[1]||Ha;return[s,r]=c_(s,r),Sm(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]);function xU(e){return e[e.length-1]||{}}var qd,l_,Cm,c_=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Ha,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},wU=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Mb(e,t){t===void 0&&(t=0);var n=e.stacktrace||e.stack||"",r=function(i){return i&&_U.test(i.message)?1:0}(e);try{var s=bU,o=function(i,a){var l=function(c){var u=globalThis._posthogChunkIds;if(!u)return{};var f=Object.keys(u);return Cm&&f.length===l_||(l_=f.length,Cm=f.reduce((p,g)=>{qd||(qd={});var y=qd[g];if(y)p[y[0]]=y[1];else for(var m=c(g),v=m.length-1;v>=0;v--){var b=m[v],x=b==null?void 0:b.filename,w=u[g];if(x&&w){p[x]=w,qd[g]=[x,w];break}}return p},{})),Cm}(a);return i.forEach(c=>{c.filename&&(c.chunk_id=l[c.filename])}),i}(s(n,r),s);return o.slice(0,o.length-t)}catch{}return[]}var _U=/Minified React error #\d+;/i;function EU(e,t){var n,r,s=Mb(e),o=(n=t==null?void 0:t.handled)===null||n===void 0||n,i=(r=t==null?void 0:t.synthetic)!==null&&r!==void 0&&r;return{type:t!=null&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:function(a){var l=a.message;return l.error&&typeof l.error.message=="string"?String(l.error.message):String(l)}(e),stacktrace:{frames:s,type:"raw"},mechanism:{handled:o,synthetic:i}}}function fR(e,t){var n=EU(e,t);return e.cause&&dR(e.cause)&&e.cause!==e?[n,...fR(e.cause,{handled:t==null?void 0:t.handled,synthetic:t==null?void 0:t.synthetic})]:[n]}function Tm(e,t){return{$exception_list:fR(e,t),$exception_level:"error"}}function Rm(e,t){var n,r,s,o=(n=t==null?void 0:t.handled)===null||n===void 0||n,i=(r=t==null?void 0:t.synthetic)===null||r===void 0||r,a={type:t!=null&&t.overrideExceptionType?t.overrideExceptionType:(s=t==null?void 0:t.defaultExceptionType)!==null&&s!==void 0?s:"Error",value:e||(t==null?void 0:t.defaultExceptionMessage),mechanism:{handled:o,synthetic:i}};if(t!=null&&t.syntheticException){var l=Mb(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function SU(e){return $t(e)&&!bv(e)&&kL.indexOf(e)>=0}function CU(e,t){var n,r,s=(n=t==null?void 0:t.handled)===null||n===void 0||n,o=(r=t==null?void 0:t.synthetic)===null||r===void 0||r,i=t!=null&&t.overrideExceptionType?t.overrideExceptionType:cR(e)?e.constructor.name:"Error",a="Non-Error 'exception' captured with keys: "+function(u,f){f===void 0&&(f=40);var p=Object.keys(u);if(p.sort(),!p.length)return"[object has no keys]";for(var g=p.length;g>0;g--){var y=p.slice(0,g).join(", ");if(!(y.length>f))return g===p.length||y.length<=f?y:y.slice(0,f)+"..."}return""}(e),l={type:i,value:a,mechanism:{handled:s,synthetic:o}};if(t!=null&&t.syntheticException){var c=Mb(t==null?void 0:t.syntheticException,1);c.length&&(l.stacktrace={frames:c,type:"raw"})}return{$exception_list:[l],$exception_level:SU(e.level)?e.level:"error"}}function TU(e,t){var{error:n,event:r}=e,s={$exception_list:[]},o=n||r;if(Em(o)||function(p){return Tf(p,"DOMException")}(o)){var i=o;if(function(p){return"stack"in p}(o))s=Tm(o,t);else{var a=i.name||(Em(i)?"DOMError":"DOMException"),l=i.message?a+": "+i.message:a;s=Rm(l,be({},t,{overrideExceptionType:Em(i)?"DOMError":"DOMException",defaultExceptionMessage:l}))}return"code"in i&&(s.$exception_DOMException_code=""+i.code),s}if(function(p){return Tf(p,"ErrorEvent")}(o)&&o.error)return Tm(o.error,t);if(dR(o))return Tm(o,t);if(function(p){return Tf(p,"Object")}(o)||cR(o))return CU(o,t);if(he(n)&&$t(r)){var c="Error",u=r,f=r.match(wU);return f&&(c=f[1],u=f[2]),Rm(u,be({},t,{overrideExceptionType:c,defaultExceptionMessage:u}))}return Rm(o,t)}function u_(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],s=n(r);return br(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}let RU=class{constructor(t){var n;this._instance=t,this.ft=(W==null||(n=W.location)==null?void 0:n.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(Ee.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.gt&&this.gt(),this.gt=void 0,Ee.info("History API monitoring stopped")}monitorHistoryChanges(){var t,n;if(W&&W.history){var r=this;(t=W.history.pushState)!=null&&t.__posthog_wrapped__||u_(W.history,"pushState",s=>function(o,i,a){s.call(this,o,i,a),r._t("pushState")}),(n=W.history.replaceState)!=null&&n.__posthog_wrapped__||u_(W.history,"replaceState",s=>function(o,i,a){s.call(this,o,i,a),r._t("replaceState")}),this.bt()}}_t(t){try{var n,r=W==null||(n=W.location)==null?void 0:n.pathname;if(!r)return;r!==this.ft&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.ft=r}catch(s){Ee.error("Error capturing "+t+" pageview",s)}}bt(){if(!this.gt){var t=()=>{this._t("popstate")};St(W,"popstate",t),this.gt=()=>{W&&W.removeEventListener("popstate",t)}}}};function nh(e){var t,n;return((t=JSON.stringify(e,(n=[],function(r,s){if(At(s)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(s)?"[Circular]":(n.push(s),s)}return s})))==null?void 0:t.length)||0}function Dv(e,t){if(t===void 0&&(t=66060288e-1),e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),s=e.data.slice(n);return[Dv({size:nh(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),Dv({size:nh(s),data:s,sessionId:e.sessionId,windowId:e.windowId})].flatMap(o=>o)}return[e]}var js=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(js||{}),Pr=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Pr||{}),kv="[SessionRecording]",Ov="redacted",Hd={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},NU=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],PU=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],jU=["/s/","/e/","/i/"];function d_(e,t,n,r){if(st(e))return e;var s=(t==null?void 0:t["content-length"])||function(o){return new Blob([o]).size}(e);return $t(s)&&(s=parseInt(s)),s>n?kv+" "+r+" body too large to record ("+s+" bytes)":e}function f_(e,t){if(st(e))return e;var n=e;return Cl(n,!1)||(n=kv+" "+t+" body "+Ov),ct(PU,r=>{var s,o;(s=n)!=null&&s.length&&((o=n)==null?void 0:o.indexOf(r))!==-1&&(n=kv+" "+t+" body "+Ov+" as might contain: "+r)}),n}var AU=(e,t)=>{var n,r,s,o={payloadSizeLimitBytes:Hd.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...Hd.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...Hd.payloadHostDenyList]},i=e.session_recording.recordHeaders!==!1&&t.recordHeaders,a=e.session_recording.recordBody!==!1&&t.recordBody,l=e.capture_performance!==!1&&t.recordPerformance,c=(n=o,s=Math.min(1e6,(r=n.payloadSizeLimitBytes)!==null&&r!==void 0?r:1e6),p=>(p!=null&&p.requestBody&&(p.requestBody=d_(p.requestBody,p.requestHeaders,s,"Request")),p!=null&&p.responseBody&&(p.responseBody=d_(p.responseBody,p.responseHeaders,s,"Response")),p)),u=p=>{return c(((m,v)=>{var b,x=Tl(m.name),w=v.indexOf("http")===0?(b=Tl(v))==null?void 0:b.pathname:v;w==="/"&&(w="");var _=x==null?void 0:x.pathname.replace(w||"","");if(!(x&&_&&jU.some(E=>_.indexOf(E)===0)))return m})((y=(g=p).requestHeaders,st(y)||ct(Object.keys(y??{}),m=>{NU.includes(m.toLowerCase())&&(y[m]=Ov)}),g),e.api_host));var g,y},f=br(e.session_recording.maskNetworkRequestFn);return f&&br(e.session_recording.maskCapturedNetworkRequestFn)&&Ee.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),f&&(e.session_recording.maskCapturedNetworkRequestFn=p=>{var g=e.session_recording.maskNetworkRequestFn({url:p.name});return be({},p,{name:g==null?void 0:g.url})}),o.maskRequestFn=br(e.session_recording.maskCapturedNetworkRequestFn)?p=>{var g,y=u(p);return y&&(g=e.session_recording.maskCapturedNetworkRequestFn==null?void 0:e.session_recording.maskCapturedNetworkRequestFn(y))!==null&&g!==void 0?g:void 0}:p=>function(g){if(!he(g))return g.requestBody=f_(g.requestBody,"Request"),g.responseBody=f_(g.responseBody,"Response"),g}(u(p)),be({},Hd,o,{recordHeaders:i,recordBody:a,recordPerformance:l,recordInitialRequests:l})};let $U=class{constructor(t,n){var r,s;n===void 0&&(n={}),this.yt={},this.wt=o=>{if(!this.yt[o]){var i,a;this.yt[o]=!0;var l=this.St(o);(i=(a=this.rt).onBlockedNode)==null||i.call(a,o,l)}},this.$t=o=>{var i=this.St(o);if((i==null?void 0:i.nodeName)!=="svg"&&i instanceof Element){var a=i.closest("svg");if(a)return[this._rrweb.mirror.getId(a),a]}return[o,i]},this.St=o=>this._rrweb.mirror.getNode(o),this.kt=o=>{var i,a,l,c,u,f,p,g;return((i=(a=o.removes)==null?void 0:a.length)!==null&&i!==void 0?i:0)+((l=(c=o.attributes)==null?void 0:c.length)!==null&&l!==void 0?l:0)+((u=(f=o.texts)==null?void 0:f.length)!==null&&u!==void 0?u:0)+((p=(g=o.adds)==null?void 0:g.length)!==null&&p!==void 0?p:0)},this.throttleMutations=o=>{if(o.type!==3||o.data.source!==0)return o;var i=o.data,a=this.kt(i);i.attributes&&(i.attributes=i.attributes.filter(c=>{var[u]=this.$t(c.id);return!this.ct.consumeRateLimit(u)&&c}));var l=this.kt(i);return l!==0||a===l?o:void 0},this._rrweb=t,this.rt=n,this.ct=new lR({bucketSize:(r=this.rt.bucketSize)!==null&&r!==void 0?r:100,refillRate:(s=this.rt.refillRate)!==null&&s!==void 0?s:10,refillInterval:1e3,et:this.wt})}};var xr=Uint8Array,zn=Uint16Array,Rl=Uint32Array,Ib=new xr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Fb=new xr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),h_=new xr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),hR=function(e,t){for(var n=new zn(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var s=new Rl(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)s[o]=o-n[r]<<5|r;return[n,s]},pR=hR(Ib,2),DU=pR[0],Mv=pR[1];DU[28]=258,Mv[258]=28;for(var p_=hR(Fb,0)[1],mR=new zn(32768),gt=0;gt<32768;++gt){var yi=(43690>)>>>1|(21845>)<<1;yi=(61680&(yi=(52428&yi)>>>2|(13107&yi)<<2))>>>4|(3855&yi)<<4,mR[gt]=((65280&yi)>>>8|(255&yi)<<8)>>>1}var nu=function(e,t,n){for(var r=e.length,s=0,o=new zn(t);s<r;++s)++o[e[s]-1];var i,a=new zn(t);for(s=0;s<t;++s)a[s]=a[s-1]+o[s-1]<<1;for(i=new zn(r),s=0;s<r;++s)i[s]=mR[a[e[s]-1]++]>>>15-e[s];return i},ra=new xr(288);for(gt=0;gt<144;++gt)ra[gt]=8;for(gt=144;gt<256;++gt)ra[gt]=9;for(gt=256;gt<280;++gt)ra[gt]=7;for(gt=280;gt<288;++gt)ra[gt]=8;var rh=new xr(32);for(gt=0;gt<32;++gt)rh[gt]=5;var kU=nu(ra,9),OU=nu(rh,5),gR=function(e){return(e/8>>0)+(7&e&&1)},vR=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof zn?zn:e instanceof Rl?Rl:xr)(n-t);return r.set(e.subarray(t,n)),r},Cs=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},vc=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},Nm=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var s=n.length,o=n.slice();if(!s)return[new xr(0),0];if(s==1){var i=new xr(n[0].s+1);return i[n[0].s]=1,[i,1]}n.sort(function(E,S){return E.f-S.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],c=0,u=1,f=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=s-1;)a=n[n[c].f<n[f].f?c++:f++],l=n[c!=u&&n[c].f<n[f].f?c++:f++],n[u++]={s:-1,f:a.f+l.f,l:a,r:l};var p=o[0].s;for(r=1;r<s;++r)o[r].s>p&&(p=o[r].s);var g=new zn(p+1),y=Iv(n[u-1],g,0);if(y>t){r=0;var m=0,v=y-t,b=1<<v;for(o.sort(function(E,S){return g[S.s]-g[E.s]||E.f-S.f});r<s;++r){var x=o[r].s;if(!(g[x]>t))break;m+=b-(1<<y-g[x]),g[x]=t}for(m>>>=v;m>0;){var w=o[r].s;g[w]<t?m-=1<<t-g[w]++-1:++r}for(;r>=0&&m;--r){var _=o[r].s;g[_]==t&&(--g[_],++m)}y=t}return[new xr(g),y]},Iv=function(e,t,n){return e.s==-1?Math.max(Iv(e.l,t,n+1),Iv(e.r,t,n+1)):t[e.s]=n},m_=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new zn(++t),r=0,s=e[0],o=1,i=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==s&&a!=t)++o;else{if(!s&&o>2){for(;o>138;o-=138)i(32754);o>2&&(i(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(i(s),--o;o>6;o-=6)i(8304);o>2&&(i(o-3<<5|8208),o=0)}for(;o--;)i(s);o=1,s=e[a]}return[n.subarray(0,r),t]},yc=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Fv=function(e,t,n){var r=n.length,s=gR(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var o=0;o<r;++o)e[s+o+4]=n[o];return 8*(s+4+r)},g_=function(e,t,n,r,s,o,i,a,l,c,u){Cs(t,u++,n),++s[256];for(var f=Nm(s,15),p=f[0],g=f[1],y=Nm(o,15),m=y[0],v=y[1],b=m_(p),x=b[0],w=b[1],_=m_(m),E=_[0],S=_[1],R=new zn(19),C=0;C<x.length;++C)R[31&x[C]]++;for(C=0;C<E.length;++C)R[31&E[C]]++;for(var N=Nm(R,7),k=N[0],V=N[1],L=19;L>4&&!k[h_[L-1]];--L);var G,$,I,j,F=c+5<<3,O=yc(s,ra)+yc(o,rh)+i,U=yc(s,p)+yc(o,m)+i+14+3*L+yc(R,k)+(2*R[16]+3*R[17]+7*R[18]);if(F<=O&&F<=U)return Fv(t,u,e.subarray(l,l+c));if(Cs(t,u,1+(U<O)),u+=2,U<O){G=nu(p,g),$=p,I=nu(m,v),j=m;var Y=nu(k,V);for(Cs(t,u,w-257),Cs(t,u+5,S-1),Cs(t,u+10,L-4),u+=14,C=0;C<L;++C)Cs(t,u+3*C,k[h_[C]]);u+=3*L;for(var ee=[x,E],M=0;M<2;++M){var Q=ee[M];for(C=0;C<Q.length;++C){var H=31&Q[C];Cs(t,u,Y[H]),u+=k[H],H>15&&(Cs(t,u,Q[C]>>>5&127),u+=Q[C]>>>12)}}}else G=kU,$=ra,I=OU,j=rh;for(C=0;C<a;++C)if(r[C]>255){H=r[C]>>>18&31,vc(t,u,G[H+257]),u+=$[H+257],H>7&&(Cs(t,u,r[C]>>>23&31),u+=Ib[H]);var K=31&r[C];vc(t,u,I[K]),u+=j[K],K>3&&(vc(t,u,r[C]>>>5&8191),u+=Fb[K])}else vc(t,u,G[r[C]]),u+=$[r[C]];return vc(t,u,G[256]),u+$[256]},MU=new Rl([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),IU=function(){for(var e=new Rl(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),FU=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=IU[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},LU=function(e,t,n,r,s){return function(o,i,a,l,c,u){var f=o.length,p=new xr(l+f+5*(1+Math.floor(f/7e3))+c),g=p.subarray(l,p.length-c),y=0;if(!i||f<8)for(var m=0;m<=f;m+=65535){var v=m+65535;v<f?y=Fv(g,y,o.subarray(m,v)):(g[m]=u,y=Fv(g,y,o.subarray(m,f)))}else{for(var b=MU[i-1],x=b>>>13,w=8191&b,_=(1<<a)-1,E=new zn(32768),S=new zn(_+1),R=Math.ceil(a/3),C=2*R,N=function(Cn){return(o[Cn]^o[Cn+1]<<R^o[Cn+2]<<C)&_},k=new Rl(25e3),V=new zn(288),L=new zn(32),G=0,$=0,I=(m=0,0),j=0,F=0;m<f;++m){var O=N(m),U=32767&m,Y=S[O];if(E[U]=Y,S[O]=U,j<=m){var ee=f-m;if((G>7e3||I>24576)&&ee>423){y=g_(o,g,0,k,V,L,$,I,F,m-F,y),I=G=$=0,F=m;for(var M=0;M<286;++M)V[M]=0;for(M=0;M<30;++M)L[M]=0}var Q=2,H=0,K=w,ae=U-Y&32767;if(ee>2&&O==N(m-ae))for(var te=Math.min(x,ee)-1,Re=Math.min(32767,m),Ce=Math.min(258,ee);ae<=Re&&--K&&U!=Y;){if(o[m+Q]==o[m+Q-ae]){for(var ue=0;ue<Ce&&o[m+ue]==o[m+ue-ae];++ue);if(ue>Q){if(Q=ue,H=ae,ue>te)break;var ge=Math.min(ae,ue-2),ke=0;for(M=0;M<ge;++M){var Ze=m-ae+M+32768&32767,lt=Ze-E[Ze]+32768&32767;lt>ke&&(ke=lt,Y=Ze)}}}ae+=(U=Y)-(Y=E[U])+32768&32767}if(H){k[I++]=268435456|Mv[Q]<<18|p_[H];var lr=31&Mv[Q],Gn=31&p_[H];$+=Ib[lr]+Fb[Gn],++V[257+lr],++L[Gn],j=m+Q,++G}else k[I++]=o[m],++V[o[m]]}}y=g_(o,g,u,k,V,L,$,I,F,m-F,y)}return vR(p,0,l+gR(y)+c)}(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)},Lv=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},UU=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&Lv(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},BU=function(e){return 10+(e.filename&&e.filename.length+1||0)};function yR(e,t){t===void 0&&(t={});var n=FU(),r=e.length;n.p(e);var s=LU(e,t,BU(t),8),o=s.length;return UU(s,t),Lv(s,o-8,n.d()),Lv(s,o-4,r),s}function bR(e,t){var n=e.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new xr(e.length+(e.length>>>1)),s=0,o=function(c){r[s++]=c},i=0;i<n;++i){if(s+5>r.length){var a=new xr(s+8+(n-i<<1));a.set(r),r=a}var l=e.charCodeAt(i);l<128||t?o(l):l<2048?(o(192|l>>>6),o(128|63&l)):l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++i))>>>18),o(128|l>>>12&63),o(128|l>>>6&63),o(128|63&l)):(o(224|l>>>12),o(128|l>>>6&63),o(128|63&l))}return vR(r,0,s)}function VU(e,t){return function(n){for(var r=0,s=0;s<n.length;s++)r=(r<<5)-r+n.charCodeAt(s),r|=0;return Math.abs(r)}(e)%100<Jn(100*t,0,100)}var Ko="disabled",Lb="sampled",sh="active",sa="buffering",Ub="paused",Bb="trigger",is=Bb+"_activated",_n=Bb+"_pending",ms=Bb+"_"+Ko;function v_(e,t){return t.some(n=>n.matching==="regex"&&new RegExp(n.url).test(e))}class xR{constructor(t){this.xt=t}triggerStatus(t){var n=this.xt.map(r=>r.triggerStatus(t));return n.includes(is)?is:n.includes(_n)?_n:ms}stop(){this.xt.forEach(t=>t.stop())}}class wR{constructor(t){this.xt=t}triggerStatus(t){var n=new Set;for(var r of this.xt)n.add(r.triggerStatus(t));switch(n.delete(ms),n.size){case 0:return ms;case 1:return Array.from(n)[0];default:return _n}}stop(){this.xt.forEach(t=>t.stop())}}class zU{triggerStatus(){return _n}stop(){}}class WU{constructor(t){this.Et=[],this.It=[],this.urlBlocked=!1,this._instance=t}onRemoteConfig(t){var n,r;this.Et=((n=t.sessionRecording)==null?void 0:n.urlTriggers)||[],this.It=((r=t.sessionRecording)==null?void 0:r.urlBlocklist)||[]}Pt(t){var n;return this.Et.length===0?ms:((n=this._instance)==null?void 0:n.get_property(Ev))===t?is:_n}triggerStatus(t){var n=this.Pt(t),r=n===is?is:n===_n?_n:ms;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:r}),r}checkUrlTriggerConditions(t,n,r){if(W!==void 0&&W.location.href){var s=W.location.href,o=this.urlBlocked,i=v_(s,this.It);o&&i||(i&&!o?t():!i&&o&&n(),v_(s,this.Et)&&r("url"))}}stop(){}}class qU{constructor(t){this.linkedFlag=null,this.linkedFlagSeen=!1,this.Rt=()=>{},this._instance=t}triggerStatus(){var t=_n;return st(this.linkedFlag)&&(t=ms),this.linkedFlagSeen&&(t=is),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:t}),t}onRemoteConfig(t,n){var r;if(this.linkedFlag=((r=t.sessionRecording)==null?void 0:r.linkedFlag)||null,!st(this.linkedFlag)&&!this.linkedFlagSeen){var s=$t(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,o=$t(this.linkedFlag)?null:this.linkedFlag.variant;this.Rt=this._instance.onFeatureFlags((i,a)=>{var l=!1;if(At(a)&&s in a){var c=a[s];l=ts(c)?c===!0:o?c===o:!!c}this.linkedFlagSeen=l,l&&n(s,o)})}}stop(){this.Rt()}}class HU{constructor(t){this.Tt=[],this._instance=t}onRemoteConfig(t){var n;this.Tt=((n=t.sessionRecording)==null?void 0:n.eventTriggers)||[]}Mt(t){var n;return this.Tt.length===0?ms:((n=this._instance)==null?void 0:n.get_property(Sv))===t?is:_n}triggerStatus(t){var n=this.Mt(t),r=n===is?is:n===_n?_n:ms;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:r}),r}stop(){}}function GU(e){return e.isRecordingEnabled?sa:Ko}function KU(e){if(!e.receivedFlags)return sa;if(!e.isRecordingEnabled)return Ko;if(e.urlTriggerMatching.urlBlocked)return Ub;var t=e.isSampled===!0,n=new xR([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId);return t?Lb:n===is?sh:n===_n?sa:e.isSampled===!1?Ko:sh}function YU(e){if(!e.receivedFlags)return sa;if(!e.isRecordingEnabled)return Ko;if(e.urlTriggerMatching.urlBlocked)return Ub;var t=new wR([e.eventTriggerMatching,e.urlTriggerMatching,e.linkedFlagMatching]).triggerStatus(e.sessionId),n=t!==ms,r=ts(e.isSampled);return n&&t===_n?sa:n&&t===ms||r&&!e.isSampled?Ko:e.isSampled===!0?Lb:sh}var Fc="[SessionRecording]",vn=sn(Fc);function Gd(){var e;return ze==null||(e=ze.__PosthogExtensions__)==null||(e=e.rrweb)==null?void 0:e.record}var ZU=3e5,QU=[Pr.MouseMove,Pr.MouseInteraction,Pr.Scroll,Pr.ViewportResize,Pr.Input,Pr.TouchMove,Pr.MediaInteraction,Pr.Drag],y_=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function bi(e){return function(t,n){for(var r="",s=0;s<t.length;){var o=t[s++];r+=String.fromCharCode(o)}return r}(yR(bR(JSON.stringify(e))))}function b_(e){return e.type===js.Custom&&e.data.tag==="sessionIdle"}class XU{get sessionId(){return this.Ct}get Ft(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Ot}get At(){if(!this._instance.sessionManager)throw new Error(Fc+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Dt(){var t,n;return this.Lt.triggerStatus(this.sessionId)===_n?6e4:(t=(n=this._instance.config.session_recording)==null?void 0:n.full_snapshot_interval_millis)!==null&&t!==void 0?t:ZU}get jt(){var t=this._instance.get_property(Mc);return ts(t)?t:null}get Nt(){var t,n,r=(t=this.C)==null?void 0:t.data[((n=this.C)==null?void 0:n.data.length)-1],{sessionStartTimestamp:s}=this.At.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-s:null}get zt(){var t=!!this._instance.get_property(_v),n=!this._instance.config.disable_session_recording;return W&&t&&n}get Ut(){var t=!!this._instance.get_property(Gw),n=this._instance.config.enable_recording_console_log;return n??t}get qt(){var t,n,r,s,o,i,a=this._instance.config.session_recording.captureCanvas,l=this._instance.get_property(Zw),c=(t=(n=a==null?void 0:a.recordCanvas)!==null&&n!==void 0?n:l==null?void 0:l.enabled)!==null&&t!==void 0&&t,u=(r=(s=a==null?void 0:a.canvasFps)!==null&&s!==void 0?s:l==null?void 0:l.fps)!==null&&r!==void 0?r:4,f=(o=(i=a==null?void 0:a.canvasQuality)!==null&&i!==void 0?i:l==null?void 0:l.quality)!==null&&o!==void 0?o:.4;if(typeof f=="string"){var p=parseFloat(f);f=isNaN(p)?.4:p}return{enabled:c,fps:Jn(u,0,12,"canvas recording fps",4),quality:Jn(f,0,1,"canvas recording quality",.4)}}get Bt(){var t,n,r=this._instance.get_property(Kw),s={recordHeaders:(t=this._instance.config.session_recording)==null?void 0:t.recordHeaders,recordBody:(n=this._instance.config.session_recording)==null?void 0:n.recordBody},o=(s==null?void 0:s.recordHeaders)||(r==null?void 0:r.recordHeaders),i=(s==null?void 0:s.recordBody)||(r==null?void 0:r.recordBody),a=At(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,l=!!(ts(a)?a:r!=null&&r.capturePerformance);return o||i||l?{recordHeaders:o,recordBody:i,recordPerformance:l}:void 0}get Ht(){var t,n,r,s,o,i,a=this._instance.get_property(Yw),l={maskAllInputs:(t=this._instance.config.session_recording)==null?void 0:t.maskAllInputs,maskTextSelector:(n=this._instance.config.session_recording)==null?void 0:n.maskTextSelector,blockSelector:(r=this._instance.config.session_recording)==null?void 0:r.blockSelector},c=(s=l==null?void 0:l.maskAllInputs)!==null&&s!==void 0?s:a==null?void 0:a.maskAllInputs,u=(o=l==null?void 0:l.maskTextSelector)!==null&&o!==void 0?o:a==null?void 0:a.maskTextSelector,f=(i=l==null?void 0:l.blockSelector)!==null&&i!==void 0?i:a==null?void 0:a.blockSelector;return he(c)&&he(u)&&he(f)?void 0:{maskAllInputs:c==null||c,maskTextSelector:u,blockSelector:f}}get Wt(){var t=this._instance.get_property(Qw);return xn(t)?t:null}get Gt(){var t=this._instance.get_property(Xw);return xn(t)?t:null}get status(){return this.Jt?this.Vt({receivedFlags:this.Jt,isRecordingEnabled:this.zt,isSampled:this.jt,urlTriggerMatching:this.Kt,eventTriggerMatching:this.Yt,linkedFlagMatching:this.Xt,sessionId:this.sessionId}):sa}constructor(t){if(this.Vt=GU,this.Jt=!1,this.Qt=[],this.Zt="unknown",this.ti=Date.now(),this.Lt=new zU,this.ii=void 0,this.ei=void 0,this.ri=void 0,this.si=void 0,this.ni=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.oi=()=>{this.ai()},this.li=()=>{this.ui("browser offline",{})},this.hi=()=>{this.ui("browser online",{})},this.di=()=>{if(_e!=null&&_e.visibilityState){var s="window "+_e.visibilityState;this.ui(s,{})}},this._instance=t,this.Ot=!1,this.vi="/s/",this.ci=void 0,this.Jt=!1,!this._instance.sessionManager)throw vn.error("started without valid sessionManager"),new Error(Fc+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw new Error(Fc+" cannot be used with __preview_experimental_cookieless_mode.");this.Xt=new qU(this._instance),this.Kt=new WU(this._instance),this.Yt=new HU(this._instance);var{sessionId:n,windowId:r}=this.At.checkAndGetSessionAndWindowId();this.Ct=n,this.fi=r,this.C=this.pi(),this.Ft>=this.At.sessionTimeoutMs&&vn.warn("session_idle_threshold_ms ("+this.Ft+") is greater than the session timeout ("+this.At.sessionTimeoutMs+"). Session will never be detected as idle")}startIfEnabledOrStop(t){this.zt?(this.gi(t),St(W,"beforeunload",this.oi),St(W,"offline",this.li),St(W,"online",this.hi),St(W,"visibilitychange",this.di),this.mi(),this.bi(),st(this.ii)&&(this.ii=this._instance.on("eventCaptured",n=>{try{if(n.event==="$pageview"){var r=n!=null&&n.properties.$current_url?this.yi(n==null?void 0:n.properties.$current_url):"";if(!r)return;this.ui("$pageview",{href:r})}}catch(s){vn.error("Could not add $pageview to rrweb session",s)}})),this.ei||(this.ei=this.At.onSessionId((n,r,s)=>{var o,i;s&&(this.ui("$session_id_change",{sessionId:n,windowId:r,changeReason:s}),(o=this._instance)==null||(o=o.persistence)==null||o.unregister(Sv),(i=this._instance)==null||(i=i.persistence)==null||i.unregister(Ev))}))):this.stopRecording()}stopRecording(){var t,n,r,s;this.Ot&&this.ci&&(this.ci(),this.ci=void 0,this.Ot=!1,W==null||W.removeEventListener("beforeunload",this.oi),W==null||W.removeEventListener("offline",this.li),W==null||W.removeEventListener("online",this.hi),W==null||W.removeEventListener("visibilitychange",this.di),this.pi(),clearInterval(this.wi),(t=this.ii)==null||t.call(this),this.ii=void 0,(n=this.ni)==null||n.call(this),this.ni=void 0,(r=this.ei)==null||r.call(this),this.ei=void 0,(s=this.si)==null||s.call(this),this.si=void 0,this.Yt.stop(),this.Kt.stop(),this.Xt.stop(),vn.info("stopped"))}Si(){var t;(t=this._instance.persistence)==null||t.unregister(Mc)}$i(t){var n,r=this.Ct!==t,s=this.Wt;if(xn(s)){var o=this.jt,i=r||!ts(o),a=i?VU(t,s):o;i&&(a?this.ki(Lb):vn.warn("Sample rate ("+s+") has determined that this sessionId ("+t+") will not be sent to the server."),this.ui("samplingDecisionMade",{sampleRate:s,isSampled:a})),(n=this._instance.persistence)==null||n.register({[Mc]:a})}else this.Si()}onRemoteConfig(t){var n,r,s,o;this.ui("$remote_config_received",t),this.xi(t),(n=t.sessionRecording)!=null&&n.endpoint&&(this.vi=(o=t.sessionRecording)==null?void 0:o.endpoint),this.mi(),((r=t.sessionRecording)==null?void 0:r.triggerMatchType)==="any"?(this.Vt=KU,this.Lt=new xR([this.Yt,this.Kt])):(this.Vt=YU,this.Lt=new wR([this.Yt,this.Kt])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:(s=t.sessionRecording)==null?void 0:s.triggerMatchType}),this.Kt.onRemoteConfig(t),this.Yt.onRemoteConfig(t),this.Xt.onRemoteConfig(t,(i,a)=>{this.ki("linked_flag_matched",{flag:i,variant:a})}),this.Jt=!0,this.startIfEnabledOrStop()}mi(){xn(this.Wt)&&st(this.si)&&(this.si=this.At.onSessionId(t=>{this.$i(t)}))}xi(t){if(this._instance.persistence){var n,r=this._instance.persistence,s=()=>{var o,i,a,l,c,u,f,p,g,y=(o=t.sessionRecording)==null?void 0:o.sampleRate,m=st(y)?null:parseFloat(y);st(m)&&this.Si();var v=(i=t.sessionRecording)==null?void 0:i.minimumDurationMilliseconds;r.register({[_v]:!!t.sessionRecording,[Gw]:(a=t.sessionRecording)==null?void 0:a.consoleLogRecordingEnabled,[Kw]:be({capturePerformance:t.capturePerformance},(l=t.sessionRecording)==null?void 0:l.networkPayloadCapture),[Yw]:(c=t.sessionRecording)==null?void 0:c.masking,[Zw]:{enabled:(u=t.sessionRecording)==null?void 0:u.recordCanvas,fps:(f=t.sessionRecording)==null?void 0:f.canvasFps,quality:(p=t.sessionRecording)==null?void 0:p.canvasQuality},[Qw]:m,[Xw]:he(v)?null:v,[Jw]:(g=t.sessionRecording)==null?void 0:g.scriptConfig})};s(),(n=this.ri)==null||n.call(this),this.ri=this.At.onSessionId(s)}}log(t,n){var r;n===void 0&&(n="log"),(r=this._instance.sessionRecording)==null||r.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}gi(t){if(!he(Object.assign)&&!he(Array.from)&&!(this.Ot||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var n;this.Ot=!0,this.At.checkAndGetSessionAndWindowId(),Gd()?this.Ei():(n=ze.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.Ii,r=>{if(r)return vn.error("could not load recorder",r);this.Ei()}),vn.info("starting"),this.status===sh&&this.ki(t||"recording_initialized")}}get Ii(){var t;return((t=this._instance)==null||(t=t.persistence)==null||(t=t.get_property(Jw))==null?void 0:t.script)||"recorder"}Pi(t){var n;return t.type===3&&QU.indexOf((n=t.data)==null?void 0:n.source)!==-1}Ri(t){var n=this.Pi(t);n||this.Zt||t.timestamp-this.ti>this.Ft&&(this.Zt=!0,clearInterval(this.wi),this.ui("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this.ti,threshold:this.Ft,bufferLength:this.C.data.length,bufferSize:this.C.size}),this.ai());var r=!1;if(n&&(this.ti=t.timestamp,this.Zt)){var s=this.Zt==="unknown";this.Zt=!1,s||(this.ui("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.Zt){var{windowId:o,sessionId:i}=this.At.checkAndGetSessionAndWindowId(!n,t.timestamp),a=this.Ct!==i,l=this.fi!==o;this.fi=o,this.Ct=i,a||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):r&&this.Ti()}}Mi(t){try{return t.rrwebMethod(),!0}catch(n){return this.Qt.length<10?this.Qt.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt++,rrwebMethod:t.rrwebMethod}):vn.warn("could not emit queued rrweb event.",n,t),!1}}ui(t,n){return this.Mi(y_(()=>Gd().addCustomEvent(t,n)))}Ci(){return this.Mi(y_(()=>Gd().takeFullSnapshot()))}Ei(){var t,n,r,s,o={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},i=this._instance.config.session_recording;for(var[a,l]of Object.entries(i||{}))a in o&&(a==="maskInputOptions"?o.maskInputOptions=be({password:!0},l):o[a]=l);this.qt&&this.qt.enabled&&(o.recordCanvas=!0,o.sampling={canvas:this.qt.fps},o.dataURLOptions={type:"image/webp",quality:this.qt.quality}),this.Ht&&(o.maskAllInputs=(n=this.Ht.maskAllInputs)===null||n===void 0||n,o.maskTextSelector=(r=this.Ht.maskTextSelector)!==null&&r!==void 0?r:void 0,o.blockSelector=(s=this.Ht.blockSelector)!==null&&s!==void 0?s:void 0);var c=Gd();if(c){this.Fi=(t=this.Fi)!==null&&t!==void 0?t:new $U(c,{refillRate:this._instance.config.session_recording.__mutationThrottlerRefillRate,bucketSize:this._instance.config.session_recording.__mutationThrottlerBucketSize,onBlockedNode:(f,p)=>{var g="Too many mutations on node '"+f+"'. Rate limiting. This could be due to SVG animations or something similar";vn.info(g,{node:p}),this.log(Fc+" "+g,"warn")}});var u=this.Oi();this.ci=c(be({emit:f=>{this.onRRwebEmit(f)},plugins:u},o)),this.ti=Date.now(),this.Zt=ts(this.Zt)?this.Zt:"unknown",this.ui("$session_options",{sessionRecordingOptions:o,activePlugins:u.map(f=>f==null?void 0:f.name)}),this.ui("$posthog_config",{config:this._instance.config})}else vn.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Ti(){if(this.wi&&clearInterval(this.wi),this.Zt!==!0){var t=this.Dt;t&&(this.wi=setInterval(()=>{this.Ci()},t))}}Oi(){var t,n,r=[],s=(t=ze.__PosthogExtensions__)==null||(t=t.rrwebPlugins)==null?void 0:t.getRecordConsolePlugin;s&&this.Ut&&r.push(s());var o=(n=ze.__PosthogExtensions__)==null||(n=n.rrwebPlugins)==null?void 0:n.getRecordNetworkPlugin;return this.Bt&&br(o)&&(!QL.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?r.push(o(AU(this._instance.config,this.Bt))):vn.info("NetworkCapture not started because we are on localhost.")),r}onRRwebEmit(t){var n;if(this.Ai(),t&&At(t)){if(t.type===js.Meta){var r=this.yi(t.data.href);if(this.Di=r,!r)return;t.data.href=r}else this.Li();if(this.Kt.checkUrlTriggerConditions(()=>this.ji(),()=>this.Ni(),p=>this.zi(p)),!this.Kt.urlBlocked||(s=t).type===js.Custom&&s.data.tag==="recording paused"){var s;t.type===js.FullSnapshot&&this.Ti(),t.type===js.FullSnapshot&&this.Jt&&this.Lt.triggerStatus(this.sessionId)===_n&&this.pi();var o=this.Fi?this.Fi.throttleMutations(t):t;if(o){var i=function(p){var g=p;if(g&&At(g)&&g.type===6&&At(g.data)&&g.data.plugin==="rrweb/console@1"){g.data.payload.payload.length>10&&(g.data.payload.payload=g.data.payload.payload.slice(0,10),g.data.payload.payload.push("...[truncated]"));for(var y=[],m=0;m<g.data.payload.payload.length;m++)g.data.payload.payload[m]&&g.data.payload.payload[m].length>2e3?y.push(g.data.payload.payload[m].slice(0,2e3)+"...[truncated]"):y.push(g.data.payload.payload[m]);return g.data.payload.payload=y,p}return p}(o);if(this.Ri(i),this.Zt!==!0||b_(i)){if(b_(i)){var a=i.data.payload;if(a){var l=a.lastActivityTimestamp,c=a.threshold;i.timestamp=l+c}}var u=(n=this._instance.config.session_recording.compress_events)===null||n===void 0||n?function(p){if(nh(p)<1024)return p;try{if(p.type===js.FullSnapshot)return be({},p,{data:bi(p.data),cv:"2024-10"});if(p.type===js.IncrementalSnapshot&&p.data.source===Pr.Mutation)return be({},p,{cv:"2024-10",data:be({},p.data,{texts:bi(p.data.texts),attributes:bi(p.data.attributes),removes:bi(p.data.removes),adds:bi(p.data.adds)})});if(p.type===js.IncrementalSnapshot&&p.data.source===Pr.StyleSheetRule)return be({},p,{cv:"2024-10",data:be({},p.data,{adds:p.data.adds?bi(p.data.adds):void 0,removes:p.data.removes?bi(p.data.removes):void 0})})}catch(g){vn.error("could not compress event - will use uncompressed event",g)}return p}(i):i,f={$snapshot_bytes:nh(u),$snapshot_data:u,$session_id:this.Ct,$window_id:this.fi};this.status!==Ko?this.Ui(f):this.pi()}}}}}Li(){if(!this._instance.config.capture_pageview&&W){var t=this.yi(W.location.href);this.Di!==t&&(this.ui("$url_changed",{href:t}),this.Di=t)}}Ai(){if(this.Qt.length){var t=[...this.Qt];this.Qt=[],t.forEach(n=>{Date.now()-n.enqueuedAt<=2e3&&this.Mi(n)})}}yi(t){var n=this._instance.config.session_recording;if(n.maskNetworkRequestFn){var r,s={url:t};return(r=s=n.maskNetworkRequestFn(s))==null?void 0:r.url}return t}pi(){return this.C={size:0,data:[],sessionId:this.Ct,windowId:this.fi},this.C}ai(){this.qi&&(clearTimeout(this.qi),this.qi=void 0);var t=this.Gt,n=this.Nt,r=xn(n)&&n>=0,s=xn(t)&&r&&n<t;return this.status===sa||this.status===Ub||this.status===Ko||s?(this.qi=setTimeout(()=>{this.ai()},2e3),this.C):(this.C.data.length>0&&Dv(this.C).forEach(o=>{this.Bi({$snapshot_bytes:o.size,$snapshot_data:o.data,$session_id:o.sessionId,$window_id:o.windowId,$lib:"web",$lib_version:As.LIB_VERSION})}),this.pi())}Ui(t){var n,r=2+(((n=this.C)==null?void 0:n.data.length)||0);!this.Zt&&(this.C.size+t.$snapshot_bytes+r>943718.4||this.C.sessionId!==this.Ct)&&(this.C=this.ai()),this.C.size+=t.$snapshot_bytes,this.C.data.push(t.$snapshot_data),this.qi||this.Zt||(this.qi=setTimeout(()=>{this.ai()},2e3))}Bi(t){this._instance.capture("$snapshot",t,{_url:this._instance.requestRouter.endpointFor("api",this.vi),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}zi(t){var n;this.Lt.triggerStatus(this.sessionId)===_n&&((n=this._instance)==null||(n=n.persistence)==null||n.register({[t==="url"?Ev:Sv]:this.Ct}),this.ai(),this.ki(t+"_trigger_matched"))}ji(){this.Kt.urlBlocked||(this.Kt.urlBlocked=!0,clearInterval(this.wi),vn.info("recording paused due to URL blocker"),this.ui("recording paused",{reason:"url blocker"}))}Ni(){this.Kt.urlBlocked&&(this.Kt.urlBlocked=!1,this.Ci(),this.Ti(),this.ui("recording resumed",{reason:"left blocked url"}),vn.info("recording resumed"))}bi(){this.Yt.Tt.length!==0&&st(this.ni)&&(this.ni=this._instance.on("eventCaptured",t=>{try{this.Yt.Tt.includes(t.event)&&this.zi("event")}catch(n){vn.error("Could not activate event trigger",n)}}))}overrideLinkedFlag(){this.Xt.linkedFlagSeen=!0,this.Ci(),this.ki("linked_flag_overridden")}overrideSampling(){var t;(t=this._instance.persistence)==null||t.register({[Mc]:!0}),this.Ci(),this.ki("sampling_overridden")}overrideTrigger(t){this.zi(t)}ki(t,n){this._instance.register_for_session({$session_recording_start_reason:t}),vn.info(t.replace("_"," "),n),Qe(["recording_initialized","session_id_changed"],t)||this.ui(t,n)}get sdkDebugProperties(){var{sessionStartTimestamp:t}=this.At.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.C.data.length,$sdk_debug_replay_internal_buffer_size:this.C.size,$sdk_debug_current_session_duration:this.Nt,$sdk_debug_session_start:t}}}var Pm=sn("[SegmentIntegration]");function JU(e,t){var n=e.config.segment;if(!n)return t();(function(r,s){var o=r.config.segment;if(!o)return s();var i=l=>{var c=()=>l.anonymousId()||ko();r.config.get_device_id=c,l.id()&&(r.register({distinct_id:l.id(),$device_id:c()}),r.persistence.set_property(Ps,"identified")),s()},a=o.user();"then"in a&&br(a.then)?a.then(l=>i(l)):i(a)})(e,()=>{n.register((r=>{Promise&&Promise.resolve||Pm.warn("This browser does not have Promise support, and can not use the segment integration");var s=(o,i)=>{if(!i)return o;o.event.userId||o.event.anonymousId===r.get_distinct_id()||(Pm.info("No userId set, resetting PostHog"),r.reset()),o.event.userId&&o.event.userId!==r.get_distinct_id()&&(Pm.info("UserId set, identifying with PostHog"),r.identify(o.event.userId));var a=r.calculateEventProperties(i,o.event.properties);return o.event.properties=Object.assign({},a,o.event.properties),o};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:o=>s(o,o.event.event),page:o=>s(o,"$pageview"),identify:o=>s(o,"$identify"),screen:o=>s(o,"$screen")}})(e)).then(()=>{t()})})}var _R="posthog-js";function ER(e,t){var{organization:n,projectId:r,prefix:s,severityAllowList:o=["error"]}=t===void 0?{}:t;return i=>{var a,l,c,u,f;if(!(o==="*"||o.includes(i.level))||!e.__loaded)return i;i.tags||(i.tags={});var p=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());i.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(i.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var g=((a=i.exception)==null?void 0:a.values)||[],y=g.map(v=>be({},v,{stacktrace:v.stacktrace?be({},v.stacktrace,{type:"raw",frames:(v.stacktrace.frames||[]).map(b=>be({},b,{platform:"web:javascript"}))}):void 0})),m={$exception_message:((l=g[0])==null?void 0:l.value)||i.message,$exception_type:(c=g[0])==null?void 0:c.type,$exception_personURL:p,$exception_level:i.level,$exception_list:y,$sentry_event_id:i.event_id,$sentry_exception:i.exception,$sentry_exception_message:((u=g[0])==null?void 0:u.value)||i.message,$sentry_exception_type:(f=g[0])==null?void 0:f.type,$sentry_tags:i.tags};return n&&r&&(m.$sentry_url=(s||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+i.event_id),e.exceptions.sendExceptionEvent(m),i}}class e4{constructor(t,n,r,s,o){this.name=_R,this.setupOnce=function(i){i(ER(t,{organization:n,projectId:r,prefix:s,severityAllowList:o}))}}}var t4=W!=null&&W.location?eh(W.location.hash,"__posthog")||eh(location.hash,"state"):null,x_="_postHogToolbarParams",w_=sn("[Toolbar]"),ho=function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e}(ho||{});class n4{constructor(t){this.instance=t}Hi(t){ze.ph_toolbar_state=t}Wi(){var t;return(t=ze.ph_toolbar_state)!==null&&t!==void 0?t:ho.UNINITIALIZED}maybeLoadToolbar(t,n,r){if(t===void 0&&(t=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),!W||!_e)return!1;t=t??W.location,r=r??W.history;try{if(!n){try{W.localStorage.setItem("test","test"),W.localStorage.removeItem("test")}catch{return!1}n=W==null?void 0:W.localStorage}var s,o=t4||eh(t.hash,"__posthog")||eh(t.hash,"state"),i=o?Vw(()=>JSON.parse(atob(decodeURIComponent(o))))||Vw(()=>JSON.parse(decodeURIComponent(o))):null;return i&&i.action==="ph_authorize"?((s=i).source="url",s&&Object.keys(s).length>0&&(i.desiredHash?t.hash=i.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((s=JSON.parse(n.getItem(x_)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}Gi(t){var n=ze.ph_load_toolbar||ze.ph_load_editor;!st(n)&&br(n)?n(t,this.instance):w_.warn("No toolbar load function found")}loadToolbar(t){var n=!(_e==null||!_e.getElementById(KT));if(!W||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=be({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(W.localStorage.setItem(x_,JSON.stringify(be({},s,{source:void 0}))),this.Wi()===ho.LOADED)this.Gi(s);else if(this.Wi()===ho.UNINITIALIZED){var o;this.Hi(ho.LOADING),(o=ze.__PosthogExtensions__)==null||o.loadExternalDependency==null||o.loadExternalDependency(this.instance,"toolbar",i=>{if(i)return w_.error("[Toolbar] Failed to load",i),void this.Hi(ho.UNINITIALIZED);this.Hi(ho.LOADED),this.Gi(s)}),St(W,"turbolinks:load",()=>{this.Hi(ho.UNINITIALIZED),this.loadToolbar(s)})}return!0}Ji(t){return this.loadToolbar(t)}maybeLoadEditor(t,n,r){return t===void 0&&(t=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(t,n,r)}}var r4=sn("[TracingHeaders]");class s4{constructor(t){this.Vi=void 0,this.Ki=void 0,this.nt=()=>{var n,r;he(this.Vi)&&((n=ze.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchXHR(this._instance.get_distinct_id(),this._instance.sessionManager)),he(this.Ki)&&((r=ze.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}J(t){var n,r;(n=ze.__PosthogExtensions__)!=null&&n.tracingHeadersPatchFns&&t(),(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",s=>{if(s)return r4.error("failed to load script",s);t()})}startIfEnabledOrStop(){var t,n;this._instance.config.__add_tracing_headers?this.J(this.nt):((t=this.Vi)==null||t.call(this),(n=this.Ki)==null||n.call(this),this.Vi=void 0,this.Ki=void 0)}}var ao=sn("[Web Vitals]"),__=9e5;class o4{constructor(t){var n;this.Yi=!1,this.i=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Xi=()=>{clearTimeout(this.Qi),this.C.metrics.length!==0&&(this._instance.capture("$web_vitals",this.C.metrics.reduce((r,s)=>be({},r,{["$web_vitals_"+s.name+"_event"]:be({},s),["$web_vitals_"+s.name+"_value"]:s.value}),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Zi=r=>{var s,o=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0);if(he(o))ao.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.te();he(i)||(st(r==null?void 0:r.name)||st(r==null?void 0:r.value)?ao.error("Invalid metric received",r):this.ie&&r.value>=this.ie?ao.error("Ignoring metric with value >= "+this.ie,r):(this.C.url!==i&&(this.Xi(),this.Qi=setTimeout(this.Xi,this.flushToCaptureTimeoutMs)),he(this.C.url)&&(this.C.url=i),this.C.firstMetricTimestamp=he(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.C.metrics.push(be({},r,{$current_url:i,$session_id:o.sessionId,$window_id:o.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Xi()))}},this.nt=()=>{var r,s,o,i,a=ze.__PosthogExtensions__;he(a)||he(a.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:s,onFCP:o,onINP:i}=a.postHogWebVitalsCallbacks),r&&s&&o&&i?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Zi.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.Zi.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&o(this.Zi.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.Zi.bind(this)),this.i=!0):ao.error("web vitals callbacks not loaded - not starting")},this._instance=t,this.Yi=!((n=this._instance.persistence)==null||!n.props[qw]),this.startIfEnabled()}get allowedMetrics(){var t,n,r=At(this._instance.config.capture_performance)?(t=this._instance.config.capture_performance)==null?void 0:t.web_vitals_allowed_metrics:void 0;return he(r)?((n=this._instance.persistence)==null?void 0:n.props[Hw])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(At(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get ie(){var t=At(this._instance.config.capture_performance)&&xn(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:__;return 0<t&&t<=6e4?__:t}get isEnabled(){var t=Bn==null?void 0:Bn.protocol;if(t!=="http:"&&t!=="https:")return ao.info("Web Vitals are disabled on non-http/https protocols"),!1;var n=At(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:ts(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return ts(n)?n:this.Yi}startIfEnabled(){this.isEnabled&&!this.i&&(ao.info("enabled, starting..."),this.J(this.nt))}onRemoteConfig(t){var n=At(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=At(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[qw]:n}),this._instance.persistence.register({[Hw]:r})),this.Yi=n,this.startIfEnabled()}J(t){var n,r;(n=ze.__PosthogExtensions__)!=null&&n.postHogWebVitalsCallbacks&&t(),(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"web-vitals",s=>{s?ao.error("failed to load script",s):t()})}te(){var t=W?W.location.href:void 0;return t||ao.error("Could not determine current URL"),t}}var i4=sn("[Heatmaps]");function E_(e){return At(e)&&"clientX"in e&&"clientY"in e&&xn(e.clientX)&&xn(e.clientY)}class a4{constructor(t){var n;this.rageclicks=new oR,this.Yi=!1,this.i=!1,this.ee=null,this.instance=t,this.Yi=!((n=this.instance.persistence)==null||!n.props[xv])}get flushIntervalMilliseconds(){var t=5e3;return At(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return he(this.instance.config.capture_heatmaps)?he(this.instance.config.enable_heatmaps)?this.Yi:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.i)return;i4.info("starting..."),this.re(),this.ee=setInterval(this.se.bind(this),this.flushIntervalMilliseconds)}else{var t,n;clearInterval((t=this.ee)!==null&&t!==void 0?t:void 0),(n=this.ne)==null||n.stop(),this.getAndClearBuffer()}}onRemoteConfig(t){var n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[xv]:n}),this.Yi=n,this.startIfEnabled()}getAndClearBuffer(){var t=this.C;return this.C=void 0,t}oe(t){this.ae(t.originalEvent,"deadclick")}re(){W&&_e&&(St(W,"beforeunload",this.se.bind(this)),St(_e,"click",t=>this.ae(t||(W==null?void 0:W.event)),{capture:!0}),St(_e,"mousemove",t=>this.le(t||(W==null?void 0:W.event)),{capture:!0}),this.ne=new aR(this.instance,dU,this.oe.bind(this)),this.ne.startIfEnabled(),this.i=!0)}ue(t,n){var r=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),o=this.instance.scrollManager.scrollElement(),i=function(a,l,c){for(var u=a;u&&np(u)&&!Lo(u,"body");){if(u===c)return!1;if(Qe(l,W==null?void 0:W.getComputedStyle(u).position))return!0;u=JT(u)}return!1}(XT(t),["fixed","sticky"],o);return{x:t.clientX+(i?0:s),y:t.clientY+(i?0:r),target_fixed:i,type:n}}ae(t,n){var r;if(n===void 0&&(n="click"),!e_(t.target)&&E_(t)){var s=this.ue(t,n);(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this.he(be({},s,{type:"rageclick"})),this.he(s)}}le(t){!e_(t.target)&&E_(t)&&(clearTimeout(this.de),this.de=setTimeout(()=>{this.he(this.ue(t,"mousemove"))},500))}he(t){if(W){var n=W.location.href;this.C=this.C||{},this.C[n]||(this.C[n]=[]),this.C[n].push(t)}}se(){this.C&&!Wa(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class l4{constructor(t){this._instance=t}doPageView(t,n){var r,s=this.ve(t,n);return this.ce={pathname:(r=W==null?void 0:W.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),s}doPageLeave(t){var n;return this.ve(t,(n=this.ce)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.ce)==null?void 0:t.pageViewId}}ve(t,n){var r=this.ce;if(!r)return{$pageview_id:n};var s={$pageview_id:n,$prev_pageview_id:r.pageViewId},o=this._instance.scrollManager.getContext();if(o&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:i,lastScrollY:a,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:f}=o;if(!(he(i)||he(a)||he(l)||he(c)||he(u)||he(f))){i=Math.ceil(i),a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),f=Math.ceil(f);var p=i<=1?1:Jn(a/i,0,1),g=i<=1?1:Jn(l/i,0,1),y=c<=1?1:Jn(u/c,0,1),m=c<=1?1:Jn(f/c,0,1);s=Ut(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:y,$prev_pageview_max_content:f,$prev_pageview_max_content_percentage:m})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),s}}var c4=function(e){var t,n,r,s,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,`
|
11
|
+
`).replace(/\r/g,`
|
12
|
+
`)).length,s=0;s<r;s++){var i=e.charCodeAt(s),a=null;i<128?n++:a=i>127&&i<2048?String.fromCharCode(i>>6|192,63&i|128):String.fromCharCode(i>>12|224,i>>6&63|128,63&i|128),oi(a)||(n>t&&(o+=e.substring(t,n)),o+=a,t=n=s+1)}return n>t&&(o+=e.substring(t,e.length)),o},u4=!!vv||!!gv,S_="text/plain",oh=(e,t)=>{var[n,r]=e.split("?"),s=be({},t);r==null||r.split("&").forEach(i=>{var[a]=i.split("=");delete s[a]});var o=XL(s);return n+"?"+(o=o?(r?r+"&":"")+o:r)},Lc=(e,t)=>JSON.stringify(e,(n,r)=>typeof r=="bigint"?r.toString():r,t),jm=e=>{var{data:t,compression:n}=e;if(t){if(n===Is.GZipJS){var r=yR(bR(Lc(t)),{mtime:0}),s=new Blob([r],{type:S_});return{contentType:S_,body:s,estimatedSize:s.size}}if(n===Is.Base64){var o=function(l){var c,u,f,p,g,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m=0,v=0,b="",x=[];if(!l)return l;l=c4(l);do c=(g=l.charCodeAt(m++)<<16|l.charCodeAt(m++)<<8|l.charCodeAt(m++))>>18&63,u=g>>12&63,f=g>>6&63,p=63&g,x[v++]=y.charAt(c)+y.charAt(u)+y.charAt(f)+y.charAt(p);while(m<l.length);switch(b=x.join(""),l.length%3){case 1:b=b.slice(0,-2)+"==";break;case 2:b=b.slice(0,-1)+"="}return b}(Lc(t)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Lc(l)))(o);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var a=Lc(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},ru=[];gv&&ru.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:s,estimatedSize:o}=(t=jm(e))!==null&&t!==void 0?t:{},i=new Headers;ct(e.headers,function(u,f){i.append(f,u)}),r&&i.append("Content-Type",r);var a=e.url,l=null;if(Uw){var c=new Uw;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}gv(a,be({method:(e==null?void 0:e.method)||"GET",headers:i,keepalive:e.method==="POST"&&(o||0)<52428.8,body:s,signal:(n=l)==null?void 0:n.signal},e.fetchOptions)).then(u=>u.text().then(f=>{var p={statusCode:u.status,text:f};if(u.status===200)try{p.json=JSON.parse(f)}catch(g){Ee.error(g)}e.callback==null||e.callback(p)})).catch(u=>{Ee.error(u),e.callback==null||e.callback({statusCode:0,text:u})}).finally(()=>l?clearTimeout(l.timeout):null)}}),vv&&ru.push({transport:"XHR",method:e=>{var t,n=new vv;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:s}=(t=jm(e))!==null&&t!==void 0?t:{};ct(e.headers,function(o,i){n.setRequestHeader(i,o)}),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(n.readyState===4){var o={statusCode:n.status,text:n.responseText};if(n.status===200)try{o.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(o)}},n.send(s)}}),Xn!=null&&Xn.sendBeacon&&ru.push({transport:"sendBeacon",method:e=>{var t=oh(e.url,{beacon:"1"});try{var n,{contentType:r,body:s}=(n=jm(e))!==null&&n!==void 0?n:{},o=typeof s=="string"?new Blob([s],{type:r}):s;Xn.sendBeacon(t,o)}catch{}}});var Nl=function(e,t){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function C_(e,t,n){return Lc({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var d4={exact:(e,t)=>t.some(n=>e.some(r=>n===r)),is_not:(e,t)=>t.every(n=>e.every(r=>n!==r)),regex:(e,t)=>t.some(n=>e.some(r=>Nl(n,r))),not_regex:(e,t)=>t.every(n=>e.every(r=>!Nl(n,r))),icontains:(e,t)=>t.map(Kd).some(n=>e.map(Kd).some(r=>n.includes(r))),not_icontains:(e,t)=>t.map(Kd).every(n=>e.map(Kd).every(r=>!n.includes(r)))},Kd=e=>e.toLowerCase(),f4=sn("[Error tracking]");class h4{constructor(t){var n,r;this.fe=[],this._instance=t,this.fe=(n=(r=this._instance.persistence)==null?void 0:r.get_property(wv))!==null&&n!==void 0?n:[]}onRemoteConfig(t){var n,r,s=(n=(r=t.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[];this.fe=s,this._instance.persistence&&this._instance.persistence.register({[wv]:this.fe})}sendExceptionEvent(t){this.pe(t)?f4.info("Skipping exception capture because a suppression rule matched"):this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}pe(t){var n=t.$exception_list;if(!n||!bt(n)||n.length===0)return!1;var r=n.reduce((s,o)=>{var{type:i,value:a}=o;return $t(i)&&i.length>0&&s.$exception_types.push(i),$t(a)&&a.length>0&&s.$exception_values.push(a),s},{$exception_types:[],$exception_values:[]});return this.fe.some(s=>{var o=s.values.map(i=>{var a,l=d4[i.operator],c=bt(i.value)?i.value:[i.value],u=(a=r[i.key])!==null&&a!==void 0?a:[];return c.length>0&&l(c,u)});return s.type==="OR"?o.some(Boolean):o.every(Boolean)})}}var wr="Mobile",ih="iOS",ns="Android",yu="Tablet",SR=ns+" "+yu,CR="iPad",TR="Apple",RR=TR+" Watch",bu="Safari",Pl="BlackBerry",NR="Samsung",PR=NR+"Browser",jR=NR+" Internet",oa="Chrome",p4=oa+" OS",AR=oa+" "+ih,Vb="Internet Explorer",$R=Vb+" "+wr,zb="Opera",m4=zb+" Mini",Wb="Edge",DR="Microsoft "+Wb,nl="Firefox",kR=nl+" "+ih,xu="Nintendo",wu="PlayStation",rl="Xbox",OR=ns+" "+wr,MR=wr+" "+bu,Uc="Windows",Uv=Uc+" Phone",T_="Nokia",Bv="Ouya",IR="Generic",g4=IR+" "+wr.toLowerCase(),FR=IR+" "+yu.toLowerCase(),Vv="Konqueror",Rn="(\\d+(\\.\\d+)?)",Am=new RegExp("Version/"+Rn),v4=new RegExp(rl,"i"),y4=new RegExp(wu+" \\w+","i"),b4=new RegExp(xu+" \\w+","i"),qb=new RegExp(Pl+"|PlayBook|BB10","i"),x4={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},w4=(e,t)=>t&&Qe(t,TR)||function(n){return Qe(n,bu)&&!Qe(n,oa)&&!Qe(n,ns)}(e),LR=function(e,t){return t=t||"",Qe(e," OPR/")&&Qe(e,"Mini")?m4:Qe(e," OPR/")?zb:qb.test(e)?Pl:Qe(e,"IE"+wr)||Qe(e,"WPDesktop")?$R:Qe(e,PR)?jR:Qe(e,Wb)||Qe(e,"Edg/")?DR:Qe(e,"FBIOS")?"Facebook "+wr:Qe(e,"UCWEB")||Qe(e,"UCBrowser")?"UC Browser":Qe(e,"CriOS")?AR:Qe(e,"CrMo")||Qe(e,oa)?oa:Qe(e,ns)&&Qe(e,bu)?OR:Qe(e,"FxiOS")?kR:Qe(e.toLowerCase(),Vv.toLowerCase())?Vv:w4(e,t)?Qe(e,wr)?MR:bu:Qe(e,nl)?nl:Qe(e,"MSIE")||Qe(e,"Trident/")?Vb:Qe(e,"Gecko")?nl:""},_4={[$R]:[new RegExp("rv:"+Rn)],[DR]:[new RegExp(Wb+"?\\/"+Rn)],[oa]:[new RegExp("("+oa+"|CrMo)\\/"+Rn)],[AR]:[new RegExp("CriOS\\/"+Rn)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Rn)],[bu]:[Am],[MR]:[Am],[zb]:[new RegExp("(Opera|OPR)\\/"+Rn)],[nl]:[new RegExp(nl+"\\/"+Rn)],[kR]:[new RegExp("FxiOS\\/"+Rn)],[Vv]:[new RegExp("Konqueror[:/]?"+Rn,"i")],[Pl]:[new RegExp(Pl+" "+Rn),Am],[OR]:[new RegExp("android\\s"+Rn,"i")],[jR]:[new RegExp(PR+"\\/"+Rn)],[Vb]:[new RegExp("(rv:|MSIE )"+Rn)],Mozilla:[new RegExp("rv:"+Rn)]},E4=function(e,t){var n=LR(e,t),r=_4[n];if(he(r))return null;for(var s=0;s<r.length;s++){var o=r[s],i=e.match(o);if(i)return parseFloat(i[i.length-2])}return null},R_=[[new RegExp(rl+"; "+rl+" (.*?)[);]","i"),e=>[rl,e&&e[1]||""]],[new RegExp(xu,"i"),[xu,""]],[new RegExp(wu,"i"),[wu,""]],[qb,[Pl,""]],[new RegExp(Uc,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Uv,""];if(new RegExp(wr).test(t)&&!/IEMobile\b/.test(t))return[Uc+" "+wr,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],s=x4[r]||"";return/arm/i.test(t)&&(s="RT"),[Uc,s]}return[Uc,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[ih,t.join(".")]}return[ih,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=he(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+ns+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ns+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[ns,t.join(".")]}return[ns,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[p4,""]],[/Linux|debian/i,["Linux",""]]],N_=function(e){return b4.test(e)?xu:y4.test(e)?wu:v4.test(e)?rl:new RegExp(Bv,"i").test(e)?Bv:new RegExp("("+Uv+"|WPDesktop)","i").test(e)?Uv:/iPad/.test(e)?CR:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?RR:qb.test(e)?Pl:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(T_,"i").test(e)?T_:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(wr).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ns:SR:ns:new RegExp("(pda|"+wr+")","i").test(e)?g4:new RegExp(yu,"i").test(e)&&!new RegExp(yu+" pc","i").test(e)?FR:""},Yd="https?://(.*)",sp=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],S4=tp(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],sp),Hb="<masked>",C4=["li_fat_id"];function UR(e,t,n){if(!_e)return{};var r,s=t?tp([],sp,n||[]):[],o=BR(Ob(_e.URL,s,Hb),e),i=(r={},ct(C4,function(a){var l=os.D(a);r[a]=l||null}),r);return Ut(i,o)}function BR(e,t){var n=S4.concat(t||[]),r={};return ct(n,function(s){var o=Jf(e,s);r[s]=o||null}),r}function VR(e){var t=function(o){return o?o.search(Yd+"google.([^/?]*)")===0?"google":o.search(Yd+"bing.com")===0?"bing":o.search(Yd+"yahoo.com")===0?"yahoo":o.search(Yd+"duckduckgo.com")===0?"duckduckgo":null:null}(e),n=t!="yahoo"?"q":"p",r={};if(!oi(t)){r.$search_engine=t;var s=_e?Jf(_e.referrer,n):"";s.length&&(r.ph_keyword=s)}return r}function P_(){return navigator.language||navigator.userLanguage}function zR(){return(_e==null?void 0:_e.referrer)||"$direct"}function WR(e,t){var n=e?tp([],sp,t||[]):[],r=Bn==null?void 0:Bn.href.substring(0,1e3);return{r:zR().substring(0,1e3),u:r?Ob(r,n,Hb):void 0}}function qR(e){var t,{r:n,u:r}=e,s={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=Tl(n))==null?void 0:t.host};if(r){s.$current_url=r;var o=Tl(r);s.$host=o==null?void 0:o.host,s.$pathname=o==null?void 0:o.pathname;var i=BR(r);Ut(s,i)}if(n){var a=VR(n);Ut(s,a)}return s}function HR(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function T4(){try{return new Date().getTimezoneOffset()}catch{return}}function R4(e,t){if(!Ln)return{};var n,r,s,o=e?tp([],sp,t||[]):[],[i,a]=function(l){for(var c=0;c<R_.length;c++){var[u,f]=R_[c],p=u.exec(l),g=p&&(br(f)?f(p,l):f);if(g)return g}return["",""]}(Ln);return Ut(Db({$os:i,$os_version:a,$browser:LR(Ln,navigator.vendor),$device:N_(Ln),$device_type:(r=Ln,s=N_(r),s===CR||s===SR||s==="Kobo"||s==="Kindle Fire"||s===FR?yu:s===xu||s===rl||s===wu||s===Bv?"Console":s===RR?"Wearable":s?wr:"Desktop"),$timezone:HR(),$timezone_offset:T4()}),{$current_url:Ob(Bn==null?void 0:Bn.href,o,Hb),$host:Bn==null?void 0:Bn.host,$pathname:Bn==null?void 0:Bn.pathname,$raw_user_agent:Ln.length>1e3?Ln.substring(0,997)+"...":Ln,$browser_version:E4(Ln,navigator.vendor),$browser_language:P_(),$browser_language_prefix:(n=P_(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:W==null?void 0:W.screen.height,$screen_width:W==null?void 0:W.screen.width,$viewport_height:W==null?void 0:W.innerHeight,$viewport_width:W==null?void 0:W.innerWidth,$lib:"web",$lib_version:As.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Qr=sn("[FeatureFlags]"),$m="$active_feature_flags",ja="$override_feature_flags",j_="$feature_flag_payloads",bc="$override_feature_flag_payloads",A_="$feature_flag_request_id",$_=e=>{var t={};for(var[n,r]of Sf(e||{}))r&&(t[n]=r);return t},N4=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(n=>t[n].enabled).filter(n=>{var r;return(r=t[n].metadata)==null?void 0:r.payload}).map(n=>{var r;return[n,(r=t[n].metadata)==null?void 0:r.payload]}))):Qr.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},P4=function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e}({}),D_=new Set(["7c6f7b45","66c1f69c","2727f65a","f3287528","8cc9a311","eb9f671b","c0e1c6f9","057989ec","723f4019","7b102104","563359d3","bad973ea","f6f2c4f4","59454a61","89ad1076","4edd0da1","26c52e72","a970bd2e","89cf4454","16e2b4e7","fba0e7b6","301c8488","bc65d69e","fe66a3c5","37926ca6","52a196df","d32a7577","42c4c9ef","6883bd5a","04809ff7","e59430a8","61be3dd8","7fa5500b","bf027177","8cfdba9b","96f6df5f","569798e9","0ebc61a5","1b5d7b92","17ebb0a4","f97ea965","85cc817b","3044dfc1","0c3fe5c3","b1f95fa3","8a6342e8","72365c68","12d34ad9","733853ec","3beeb69a","0645bb64","32de7f98","5dcbee21","3fe85053","ad960278","9466e5dd","7ca97b2d","2ee2a65c","28fde5f2","85c52f49","0ad823f4","f11b6cc9","aacf8af9","ab3e62b3","3a85ff15","8a67d3c4","f5e91ef1","4b873698","c5dae949","5b643d76","9599c892","34377448","2189e408","3be9ad53","1a14ce7c","2a164ded","8d53ea86","53bdb37d","bfc3f590","8df38ede","bdb81e49","38fde5c0","8d707e6d","73cbc496","f9d8a5ef","d3a9f8c4","a980d8cd","5bcfe086","e4818f68","4f11fb39","a13c6ae3","150c7fbb","98f3d658","f84f7377","1924dd9c","1f6b63b3","24748755","7c0f717c","8a87f11b","49f57f22","3c9e9234","3772f65b","dff631b6","cd609d40","f853c7f7","952db5ee","c5aa8a79","2d21b6fd","79b7164c","4110e26c","a7d3b43f","84e1b8f6","75cc0998","07f78e33","10ca9b1a","ce441b18","01eb8256","c0ac4b67","8e8e5216","db7943dd","fa133a95","498a4508","21bbda67","7dbfed69","be3ec24c","fc80b8e2"]);class j4{constructor(t){this.ge=!1,this._e=!1,this.me=!1,this.be=!1,this.ye=!1,this.we=!1,this.Se=!1,this._instance=t,this.featureFlagEventHandlers=[]}flags(){if(this._instance.config.__preview_remote_config)this.we=!0;else{var t=!this.$e&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.ke({disableFlags:t})}}get hasLoadedFlags(){return this._e}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(Cv),n=this._instance.get_property(ja),r=this._instance.get_property(bc);if(!r&&!n)return t||{};var s=Ut({},t||{}),o=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var i of o){var a,l,c=s[i],u=n==null?void 0:n[i],f=he(u)?(a=c==null?void 0:c.enabled)!==null&&a!==void 0&&a:!!u,p=he(u)?c.variant:typeof u=="string"?u:void 0,g=r==null?void 0:r[i],y=be({},c,{enabled:f,variant:f?p??(c==null?void 0:c.variant):void 0});f!==(c==null?void 0:c.enabled)&&(y.original_enabled=c==null?void 0:c.enabled),p!==(c==null?void 0:c.variant)&&(y.original_variant=c==null?void 0:c.variant),g&&(y.metadata=be({},c==null?void 0:c.metadata,{payload:g,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),s[i]=y}return this.ge||(Qr.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:s}),this.ge=!0),s}getFlagVariants(){var t=this._instance.get_property(qa),n=this._instance.get_property(ja);if(!n)return t||{};for(var r=Ut({},t),s=Object.keys(n),o=0;o<s.length;o++)r[s[o]]=n[s[o]];return this.ge||(Qr.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:n,finalFlags:r}),this.ge=!0),r}getFlagPayloads(){var t=this._instance.get_property(j_),n=this._instance.get_property(bc);if(!n)return t||{};for(var r=Ut({},t||{}),s=Object.keys(n),o=0;o<s.length;o++)r[s[o]]=n[s[o]];return this.ge||(Qr.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:n,finalPayloads:r}),this.ge=!0),r}reloadFeatureFlags(){this.be||this._instance.config.advanced_disable_feature_flags||this.$e||(this.$e=setTimeout(()=>{this.ke()},5))}xe(){clearTimeout(this.$e),this.$e=void 0}ensureFlagsLoaded(){this._e||this.me||this.$e||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.be=t}ke(t){var n;if(this.xe(),!this._instance.I())if(this.me)this.ye=!0;else{var r={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:be({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(Ic)||{}),group_properties:this._instance.get_property(Si)};(t!=null&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0);var s=this._instance.config.__preview_flags_v2&&this._instance.config.__preview_remote_config,o=function(l){var c=function(u){for(var f=2166136261,p=0;p<u.length;p++)f^=u.charCodeAt(p),f+=(f<<1)+(f<<4)+(f<<7)+(f<<8)+(f<<24);return("00000000"+(f>>>0).toString(16)).slice(-8)}(l);return D_==null?void 0:D_.has(c)}(this._instance.config.token)?"/decide?v=4":s?"/flags/?v=2":"/flags/?v=2&config=true",i=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("api",o+i);s&&(r.timezone=HR()),this.me=!0,this._instance.Ee({method:"POST",url:a,data:r,compression:this._instance.config.disable_compression?void 0:Is.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,f=!0;if(l.statusCode===200&&(this.ye||(this.$anon_distinct_id=void 0),f=!1),this.me=!1,this.we||(this.we=!0,this._instance.Ie((u=l.json)!==null&&u!==void 0?u:{})),!r.disable_flags||this.ye)if(this.Se=!f,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(P4.FeatureFlags))Qr.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var p;r.disable_flags||this.receivedFeatureFlags((p=l.json)!==null&&p!==void 0?p:{},f),this.ye&&(this.ye=!1,this.ke())}}})}}getFeatureFlag(t,n){if(n===void 0&&(n={}),this._e||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],s=""+r,o=this._instance.get_property(A_)||void 0,i=this._instance.get_property(Yf)||{};if((n.send_event||!("send_event"in n))&&(!(t in i)||!i[t].includes(s))){var a,l,c,u,f,p,g,y,m;bt(i[t])?i[t].push(s):i[t]=[s],(a=this._instance.persistence)==null||a.register({[Yf]:i});var v=this.getFeatureFlagDetails(t),b={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:o,$feature_flag_bootstrapped_response:((l=this._instance.config.bootstrap)==null||(l=l.featureFlags)==null?void 0:l[t])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[t])||null,$used_bootstrap_value:!this.Se};he(v==null||(u=v.metadata)==null?void 0:u.version)||(b.$feature_flag_version=v.metadata.version);var x,w=(f=v==null||(p=v.reason)==null?void 0:p.description)!==null&&f!==void 0?f:v==null||(g=v.reason)==null?void 0:g.code;w&&(b.$feature_flag_reason=w),v!=null&&(y=v.metadata)!=null&&y.id&&(b.$feature_flag_id=v.metadata.id),he(v==null?void 0:v.original_variant)&&he(v==null?void 0:v.original_enabled)||(b.$feature_flag_original_response=he(v.original_variant)?v.original_enabled:v.original_variant),v!=null&&(m=v.metadata)!=null&&m.original_payload&&(b.$feature_flag_original_payload=v==null||(x=v.metadata)==null?void 0:x.original_payload),this._instance.capture("$feature_flag_called",b)}return r}Qr.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,n){var r=this._instance.config.token;this._instance.Ee({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:{distinct_id:this._instance.get_distinct_id(),token:r},compression:this._instance.config.disable_compression?void 0:Is.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:s=>{var o,i=(o=s.json)==null?void 0:o.featureFlagPayloads;n((i==null?void 0:i[t])||void 0)}})}isFeatureEnabled(t,n){if(n===void 0&&(n={}),this._e||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(t,n);Qr.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(n=>n!==t)}receivedFeatureFlags(t,n){if(this._instance.persistence){this._e=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),o=this.getFlagsWithDetails();(function(i,a,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var f=N4(i),p=f.flags,g=f.featureFlags,y=f.featureFlagPayloads;if(g){var m=i.requestId;if(bt(g)){Qr.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(g)for(var b=0;b<g.length;b++)v[g[b]]=!0;a&&a.register({[$m]:g,[qa]:v})}else{var x=g,w=y,_=p;i.errorsWhileComputingFlags&&(x=be({},l,x),w=be({},c,w),_=be({},u,_)),a&&a.register(be({[$m]:Object.keys($_(x)),[qa]:x||{},[j_]:w||{},[Cv]:_||{}},m?{[A_]:m}:{}))}}})(t,this._instance.persistence,r,s,o),this.Pe(n)}}override(t,n){n===void 0&&(n=!1),Qr.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:n})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return Qr.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this._instance.persistence.unregister(ja),this._instance.persistence.unregister(bc),void this.Pe();if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this.ge=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(ja);else if(r.flags)if(bt(r.flags)){for(var s={},o=0;o<r.flags.length;o++)s[r.flags[o]]=!0;this._instance.persistence.register({[ja]:s})}else this._instance.persistence.register({[ja]:r.flags})}return"payloads"in r&&(r.payloads===!1?this._instance.persistence.unregister(bc):r.payloads&&this._instance.persistence.register({[bc]:r.payloads})),void this.Pe()}this.Pe()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this._e){var{flags:n,flagVariants:r}=this.Re();t(n,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,n){var r,s=(this._instance.get_property(Cf)||[]).find(l=>l.flagKey===t),o={["$feature_enrollment/"+t]:n},i={$feature_flag:t,$feature_enrollment:n,$set:o};s&&(i.$early_access_feature_name=s.name),this._instance.capture("$feature_enrollment_update",i),this.setPersonPropertiesForFlags(o,!1);var a=be({},this.getFlagVariants(),{[t]:n});(r=this._instance.persistence)==null||r.register({[$m]:Object.keys($_(a)),[qa]:a}),this.Pe()}getEarlyAccessFeatures(t,n,r){n===void 0&&(n=!1);var s=this._instance.get_property(Cf),o=r?"&"+r.map(i=>"stage="+i).join("&"):"";if(s&&!n)return t(s);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+o),method:"GET",callback:i=>{var a;if(i.json){var l=i.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.register({[Cf]:l}),t(l)}}})}Re(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter(r=>n[r]),flagVariants:Object.keys(n).filter(r=>n[r]).reduce((r,s)=>(r[s]=n[s],r),{})}}Pe(t){var{flags:n,flagVariants:r}=this.Re();this.featureFlagEventHandlers.forEach(s=>s(n,r,{errorsLoading:t}))}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(Ic)||{};this._instance.register({[Ic]:be({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ic)}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(Si)||{};Object.keys(r).length!==0&&Object.keys(r).forEach(s=>{r[s]=be({},r[s],t[s]),delete t[s]}),this._instance.register({[Si]:be({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var n=this._instance.get_property(Si)||{};this._instance.register({[Si]:be({},n,{[t]:{}})})}else this._instance.unregister(Si)}}var A4=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Dm{constructor(t){this.S=t,this.props={},this.Te=!1,this.Me=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(t),this.B=this.Ce(t),this.load(),t.debug&&Ee.info("Persistence loaded",t.persistence,be({},this.props)),this.update_config(t,t),this.save()}Ce(t){A4.indexOf(t.persistence.toLowerCase())===-1&&(Ee.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=t.persistence.toLowerCase();return n==="localstorage"&&Kt.O()?Kt:n==="localstorage+cookie"&&Bd.O()?Bd:n==="sessionstorage"&&un.O()?un:n==="memory"?cU:n==="cookie"?os:Bd.O()?Bd:os}properties(){var t={};return ct(this.props,function(n,r){if(r===qa&&At(n))for(var s=Object.keys(n),o=0;o<s.length;o++)t["$feature/"+s[o]]=n[s[o]];else a=r,l=!1,(oi(i=zL)?l:Lw&&i.indexOf===Lw?i.indexOf(a)!=-1:(ct(i,function(c){if(l||(l=c===a))return Gf}),l))||(t[r]=n);var i,a,l}),t}load(){if(!this.Fe){var t=this.B.L(this.Me);t&&(this.props=Ut({},t))}}save(){this.Fe||this.B.j(this.Me,this.props,this.Oe,this.Ae,this.De,this.S.debug)}remove(){this.B.N(this.Me,!1),this.B.N(this.Me,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(At(t)){he(n)&&(n="None"),this.Oe=he(r)?this.Le:r;var s=!1;if(ct(t,(o,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==n||(this.props[i]=o,s=!0)}),s)return this.save(),!0}return!1}register(t,n){if(At(t)){this.Oe=he(n)?this.Le:n;var r=!1;if(ct(t,(s,o)=>{t.hasOwnProperty(o)&&this.props[o]!==s&&(this.props[o]=s,r=!0)}),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.Te){var t=UR(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);Wa(Db(t))||this.register(t),this.Te=!0}}update_search_keyword(){var t;this.register((t=_e==null?void 0:_e.referrer)?VR(t):{})}update_referrer_info(){var t;this.register_once({$referrer:zR(),$referring_domain:_e!=null&&_e.referrer&&((t=Tl(_e.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Pv]||this.props[jv]||this.register_once({[Zf]:WR(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};ct([jv,Pv],i=>{var a=this.props[i];a&&ct(a,function(l,c){t["$initial_"+yv(c)]=l})});var n,r,s=this.props[Zf];if(s){var o=(n=qR(s),r={},ct(n,function(i,a){r["$initial_"+yv(a)]=i}),r);Ut(t,o)}return t}safe_merge(t){return ct(this.props,function(n,r){r in t||(t[r]=n)}),t}update_config(t,n){if(this.Le=this.Oe=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence){var r=this.Ce(t),s=this.props;this.clear(),this.B=r,this.props=s,this.save()}}set_disabled(t){this.Fe=t,this.Fe?this.remove():this.save()}set_cross_subdomain(t){t!==this.Ae&&(this.Ae=t,this.remove(),this.save())}set_secure(t){t!==this.De&&(this.De=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Oc]||{};r[t]=n,this.props[Oc]=r,this.save()}remove_event_timer(t){var n=(this.props[Oc]||{})[t];return he(n)||(delete this.props[Oc][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}class GR{constructor(){this.je={},this.je={}}on(t,n){return this.je[t]||(this.je[t]=[]),this.je[t].push(n),()=>{this.je[t]=this.je[t].filter(r=>r!==n)}}emit(t,n){for(var r of this.je[t]||[])r(n);for(var s of this.je["*"]||[])s(t,n)}}class Pi{constructor(t){this.Ne=new GR,this.ze=(n,r)=>this.Ue(n,r)&&this.qe(n,r)&&this.Be(n,r),this.Ue=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=t,this.He=new Set,this.We=new Set}init(){var t;if(!he((t=this._instance)==null?void 0:t.Ge)){var n;(n=this._instance)==null||n.Ge((r,s)=>{this.on(r,s)})}}register(t){var n,r;if(!he((n=this._instance)==null?void 0:n.Ge)&&(t.forEach(i=>{var a,l;(a=this.We)==null||a.add(i),(l=i.steps)==null||l.forEach(c=>{var u;(u=this.He)==null||u.add((c==null?void 0:c.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var s,o=new Set;t.forEach(i=>{var a;(a=i.steps)==null||a.forEach(l=>{l!=null&&l.selector&&o.add(l==null?void 0:l.selector)})}),(s=this._instance)==null||s.autocapture.setElementSelectors(o)}}on(t,n){var r;n!=null&&t.length!=0&&(this.He.has(t)||this.He.has(n==null?void 0:n.event))&&this.We&&((r=this.We)==null?void 0:r.size)>0&&this.We.forEach(s=>{this.Je(n,s)&&this.Ne.emit("actionCaptured",s.name)})}Ve(t){this.onAction("actionCaptured",n=>t(n))}Je(t,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.ze(t,r))return!0;return!1}onAction(t,n){return this.Ne.on(t,n)}qe(t,n){if(n!=null&&n.url){var r,s=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!Pi.Ke(s,n==null?void 0:n.url,(n==null?void 0:n.url_matching)||"contains"))return!1}return!0}static Ke(t,n,r){switch(r){case"regex":return!!W&&Nl(t,n);case"exact":return n===t;case"contains":var s=Pi.Ye(n).replace(/_/g,".").replace(/%/g,".*");return Nl(t,s);default:return!1}}static Ye(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Be(t,n){if((n!=null&&n.href||n!=null&&n.tag_name||n!=null&&n.text)&&!this.Xe(t).some(o=>!(n!=null&&n.href&&!Pi.Ke(o.href||"",n==null?void 0:n.href,(n==null?void 0:n.href_matching)||"exact"))&&(n==null||!n.tag_name||o.tag_name===(n==null?void 0:n.tag_name))&&!(n!=null&&n.text&&!Pi.Ke(o.text||"",n==null?void 0:n.text,(n==null?void 0:n.text_matching)||"exact")&&!Pi.Ke(o.$el_text||"",n==null?void 0:n.text,(n==null?void 0:n.text_matching)||"exact"))))return!1;if(n!=null&&n.selector){var r,s=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(!s||!s.includes(n==null?void 0:n.selector))return!1}return!0}Xe(t){return(t==null?void 0:t.properties.$elements)==null?[]:t==null?void 0:t.properties.$elements}}var Jt=sn("[Surveys]"),zv="seenSurvey_",$4=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n};class D4{constructor(t){this._instance=t,this.Qe=new Map,this.Ze=new Map}register(t){var n;he((n=this._instance)==null?void 0:n.Ge)||(this.tr(t),this.ir(t))}ir(t){var n=t.filter(r=>{var s,o;return((s=r.conditions)==null?void 0:s.actions)&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0});n.length!==0&&(this.er==null&&(this.er=new Pi(this._instance),this.er.init(),this.er.Ve(r=>{this.onAction(r)})),n.forEach(r=>{var s,o,i,a,l;r.conditions&&(s=r.conditions)!=null&&s.actions&&(o=r.conditions)!=null&&(o=o.actions)!=null&&o.values&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0&&((a=this.er)==null||a.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(c=>{if(c&&c.name){var u=this.Ze.get(c.name);u&&u.push(r.id),this.Ze.set(c.name,u||[r.id])}}))}))}tr(t){var n;t.filter(r=>{var s,o;return((s=r.conditions)==null?void 0:s.events)&&((o=r.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0}).length!==0&&((n=this._instance)==null||n.Ge((r,s)=>{this.onEvent(r,s)}),t.forEach(r=>{var s;(s=r.conditions)==null||(s=s.events)==null||(s=s.values)==null||s.forEach(o=>{if(o&&o.name){var i=this.Qe.get(o.name);i&&i.push(r.id),this.Qe.set(o.name,i||[r.id])}})}))}onEvent(t,n){var r,s=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[Ld])||[];if(t==="survey shown"&&n&&s.length>0){var o;Jt.info("survey event matched, removing survey from activated surveys",{event:t,eventPayload:n,existingActivatedSurveys:s});var i=n==null||(o=n.properties)==null?void 0:o.$survey_id;if(i){var a=s.indexOf(i);a>=0&&(s.splice(a,1),this.rr(s))}}else this.Qe.has(t)&&(Jt.info("survey event matched, updating activated surveys",{event:t,surveys:this.Qe.get(t)}),this.rr(s.concat(this.Qe.get(t)||[])))}onAction(t){var n,r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[Ld])||[];this.Ze.has(t)&&this.rr(r.concat(this.Ze.get(t)||[]))}rr(t){var n;(n=this._instance)==null||(n=n.persistence)==null||n.register({[Ld]:[...new Set(t)]})}getSurveys(){var t,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[Ld];return n||[]}getEventToSurveys(){return this.Qe}sr(){return this.er}}class k4{constructor(t){this.nr=void 0,this.ar=null,this.lr=!1,this.ur=!1,this.hr=[],this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){var n=t.surveys;if(st(n))return Jt.warn("Flags not loaded yet. Not loading surveys.");var r=bt(n);this.nr=r?n.length>0:n,Jt.info("flags response received, isSurveysEnabled: "+this.nr),this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(zv)||r!=null&&r.startsWith("inProgressSurvey_"))&&t.push(r)}t.forEach(s=>localStorage.removeItem(s))}loadIfEnabled(){if(!this.ar)if(this.ur)Jt.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Jt.info("Disabled. Not loading surveys.");else{var t=ze==null?void 0:ze.__PosthogExtensions__;if(t){var n=this.nr;if(!he(n)){this.ur=!0;try{var r=t.generateSurveys;if(r)return void this.dr(r,n);var s=t.loadExternalDependency;if(!s)return void this.vr("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",o=>{o||!t.generateSurveys?this.vr("Could not load surveys script",o):this.dr(t.generateSurveys,n)})}catch(o){throw this.vr("Error initializing surveys",o),o}finally{this.ur=!1}}}else Jt.error("PostHog Extensions not found.")}}dr(t,n){this.ar=t(this._instance,n),this._surveyEventReceiver=new D4(this._instance),Jt.info("Surveys loaded successfully"),this.cr({isLoaded:!0})}vr(t,n){Jt.error(t,n),this.cr({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.hr.push(t),this.ar&&this.cr({isLoaded:!0}),()=>{this.hr=this.hr.filter(n=>n!==t)}}getSurveys(t,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return Jt.info("Disabled. Not loading surveys."),t([]);var r=this._instance.get_property(Tv);if(r&&!n)return t(r,{isLoaded:!0});if(this.lr)return t([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.lr=!0,this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:s=>{var o;this.lr=!1;var i=s.statusCode;if(i!==200||!s.json){var a="Surveys API could not be loaded, status: "+i;return Jt.error(a),t([],{isLoaded:!1,error:a})}var l,c=s.json.surveys||[],u=c.filter(f=>function(p){return!(!p.start_date||p.end_date)}(f)&&(function(p){var g;return!((g=p.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)}(f)||function(p){var g;return!((g=p.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)}(f)));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(o=this._instance.persistence)==null||o.register({[Tv]:c}),t(c,{isLoaded:!0})}})}catch(s){throw this.lr=!1,s}}cr(t){for(var n of this.hr)try{t.isLoaded?this.getSurveys(n):n([],t)}catch(r){Jt.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,n){if(n===void 0&&(n=!1),!st(this.ar))return this.ar.getActiveMatchingSurveys(t,n);Jt.warn("init was not called")}pr(t){var n=null;return this.getSurveys(r=>{var s;n=(s=r.find(o=>o.id===t))!==null&&s!==void 0?s:null}),n}gr(t){if(st(this.ar))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof t=="string"?this.pr(t):t;return n?this.ar.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(st(this.ar))return Jt.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.gr(t);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(t,n){return st(this.ar)?(Jt.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(r=>{this.getSurveys(s=>{var o,i=(o=s.find(l=>l.id===t))!==null&&o!==void 0?o:null;if(i){var a=this.gr(i);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(t,n){if(st(this.ar))Jt.warn("init was not called");else{var r=this.pr(t),s=_e==null?void 0:_e.querySelector(n);r?s?this.ar.renderSurvey(r,s):Jt.warn("Survey element not found"):Jt.warn("Survey not found")}}}(function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e})({});(function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e})({});(function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e})({});(function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e})({});(function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e})({});(function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e})({});var km=function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e}({}),k_=function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e}({}),O_=sn("[RateLimiter]");class O4{constructor(t){var n,r;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=s=>{var o=s.text;if(o&&o.length)try{(JSON.parse(o).quota_limited||[]).forEach(i=>{O_.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4})}catch(i){return void O_.warn('could not rate limit - continuing. Error: "'+(i==null?void 0:i.message)+'"',{text:o})}},this.instance=t,this.captureEventsPerSecond=((n=t.config.rate_limiting)==null?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=t.config.rate_limiting)==null?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(t){var n,r,s;t===void 0&&(t=!1);var o=new Date().getTime(),i=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Nv))!==null&&n!==void 0?n:{tokens:this.captureEventsBurstLimit,last:o};i.tokens+=(o-i.last)/1e3*this.captureEventsPerSecond,i.last=o,i.tokens>this.captureEventsBurstLimit&&(i.tokens=this.captureEventsBurstLimit);var a=i.tokens<1;return a||t||(i.tokens=Math.max(0,i.tokens-1)),!a||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,(s=this.instance.persistence)==null||s.set_property(Nv,i),{isRateLimited:a,remainingTokens:i.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var xi=sn("[RemoteConfig]");class M4{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=ze._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}_r(t){var n,r;(n=ze.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):(xi.error("PostHog Extensions not found. Cannot load remote config."),t())}mr(t){this._instance.Ee({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return xi.info("Using preloaded remote config",this.remoteConfig),void this.Ie(this.remoteConfig);if(this._instance.I())return void xi.warn("Remote config is disabled. Falling back to local config.");this._r(t=>{if(!t)return xi.info("No config found after loading remote JS config. Falling back to JSON."),void this.mr(n=>{this.Ie(n)});this.Ie(t)})}catch(t){xi.error("Error loading remote config",t)}}Ie(t){t?this._instance.config.__preview_remote_config?(this._instance.Ie(t),t.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):xi.info("__preview_remote_config is disabled. Logging config instead",t):xi.error("Failed to fetch remote config from PostHog.")}}var Wv=3e3;class I4{constructor(t,n){this.br=!0,this.yr=[],this.wr=Jn((n==null?void 0:n.flush_interval_ms)||Wv,250,5e3,"flush interval",Wv),this.Sr=t}enqueue(t){this.yr.push(t),this.$r||this.kr()}unload(){this.Er();var t=this.yr.length>0?this.Ir():{},n=Object.values(t);[...n.filter(r=>r.url.indexOf("/e")===0),...n.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.Sr(be({},r,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.kr()}kr(){var t=this;this.br||(this.$r=setTimeout(()=>{if(this.Er(),this.yr.length>0){var n=this.Ir(),r=function(){var o=n[s],i=new Date().getTime();o.data&&bt(o.data)&&ct(o.data,a=>{a.offset=Math.abs(a.timestamp-i),delete a.timestamp}),t.Sr(o)};for(var s in n)r()}},this.wr))}Er(){clearTimeout(this.$r),this.$r=void 0}Ir(){var t={};return ct(this.yr,n=>{var r,s=n,o=(s?s.batchKey:null)||s.url;he(t[o])&&(t[o]=be({},s,{data:[]})),(r=t[o].data)==null||r.push(s.data)}),this.yr=[],t}}var F4=["retriesPerformedSoFar"];class L4{constructor(t){this.Pr=!1,this.Rr=3e3,this.yr=[],this._instance=t,this.yr=[],this.Tr=!0,!he(W)&&"onLine"in W.navigator&&(this.Tr=W.navigator.onLine,St(W,"online",()=>{this.Tr=!0,this.se()}),St(W,"offline",()=>{this.Tr=!1}))}get length(){return this.yr.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=WT(t,F4);xn(n)&&n>0&&(r.url=oh(r.url,{retry_count:n})),this._instance.Ee(be({},r,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(n??0)<10?this.Mr(be({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(s)}}))}Mr(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=function(i){var a=3e3*Math.pow(2,i),l=a/2,c=Math.min(18e5,a),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)}(n),s=Date.now()+r;this.yr.push({retryAt:s,requestOptions:t});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),Ee.warn(o),this.Pr||(this.Pr=!0,this.Cr())}Cr(){this.Fr&&clearTimeout(this.Fr),this.Fr=setTimeout(()=>{this.Tr&&this.yr.length>0&&this.se(),this.Cr()},this.Rr)}se(){var t=Date.now(),n=[],r=this.yr.filter(o=>o.retryAt<t||(n.push(o),!1));if(this.yr=n,r.length>0)for(var{requestOptions:s}of r)this.retriableRequest(s)}unload(){for(var{requestOptions:t}of(this.Fr&&(clearTimeout(this.Fr),this.Fr=void 0),this.yr))try{this._instance.Ee(be({},t,{transport:"sendBeacon"}))}catch(n){Ee.error(n)}this.yr=[]}}class U4{constructor(t){this.Or=()=>{var n,r,s,o;this.Ar||(this.Ar={});var i=this.scrollElement(),a=this.scrollY(),l=i?Math.max(0,i.scrollHeight-i.clientHeight):0,c=a+((i==null?void 0:i.clientHeight)||0),u=(i==null?void 0:i.scrollHeight)||0;this.Ar.lastScrollY=Math.ceil(a),this.Ar.maxScrollY=Math.max(a,(n=this.Ar.maxScrollY)!==null&&n!==void 0?n:0),this.Ar.maxScrollHeight=Math.max(l,(r=this.Ar.maxScrollHeight)!==null&&r!==void 0?r:0),this.Ar.lastContentY=c,this.Ar.maxContentY=Math.max(c,(s=this.Ar.maxContentY)!==null&&s!==void 0?s:0),this.Ar.maxContentHeight=Math.max(u,(o=this.Ar.maxContentHeight)!==null&&o!==void 0?o:0)},this._instance=t}getContext(){return this.Ar}resetContext(){var t=this.Ar;return setTimeout(this.Or,0),t}startMeasuringScrollPosition(){St(W,"scroll",this.Or,{capture:!0}),St(W,"scrollend",this.Or,{capture:!0}),St(W,"resize",this.Or)}scrollElement(){if(!this._instance.config.scroll_root_selector)return W==null?void 0:W.document.documentElement;var t=bt(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of t){var r=W==null?void 0:W.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return W&&(W.scrollY||W.pageYOffset||W.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return W&&(W.scrollX||W.pageXOffset||W.document.documentElement.scrollLeft)||0}}var B4=e=>WR(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties);class V4{constructor(t,n,r,s){this.Dr=o=>{var i=this.Lr();if(!i||i.sessionId!==o){var a={sessionId:o,props:this.jr(this._instance)};this.Nr.register({[Rv]:a})}},this._instance=t,this.zr=n,this.Nr=r,this.jr=s||B4,this.zr.onSessionId(this.Dr)}Lr(){return this.Nr.props[Rv]}getSetOnceProps(){var t,n=(t=this.Lr())==null?void 0:t.props;return n?"r"in n?qR(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return ct(Db(this.getSetOnceProps()),(n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+yv(r)]=n}),t}}var M_=sn("[SessionId]");class z4{constructor(t,n,r){var s;if(this.Ur=[],!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=t.config,this.Nr=t.persistence,this.fi=void 0,this.Ct=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.qr=n||ko,this.Br=r||ko;var o=this.S.persistence_name||this.S.token,i=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Jn(i,60,36e3,"session_idle_timeout_seconds",1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Hr(),this.Wr="ph_"+o+"_window_id",this.Gr="ph_"+o+"_primary_window_exists",this.Jr()){var a=un.L(this.Wr),l=un.L(this.Gr);a&&!l?this.fi=a:un.N(this.Wr),un.j(this.Gr,!0)}if((s=this.S.bootstrap)!=null&&s.sessionID)try{var c=(u=>{var f=u.replace(/-/g,"");if(f.length!==32)throw new Error("Not a valid UUID");if(f[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(f.substring(0,12),16)})(this.S.bootstrap.sessionID);this.Vr(this.S.bootstrap.sessionID,new Date().getTime(),c)}catch(u){M_.error("Invalid sessionID in bootstrap",u)}this.Kr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return he(this.Ur)&&(this.Ur=[]),this.Ur.push(t),this.Ct&&t(this.Ct,this.fi),()=>{this.Ur=this.Ur.filter(n=>n!==t)}}Jr(){return this.S.persistence!=="memory"&&!this.Nr.Fe&&un.O()}Yr(t){t!==this.fi&&(this.fi=t,this.Jr()&&un.j(this.Wr,t))}Xr(){return this.fi?this.fi:this.Jr()?un.L(this.Wr):null}Vr(t,n,r){t===this.Ct&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.Ct=t,this.Nr.register({[Kf]:[n,t,r]}))}Qr(){if(this.Ct&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Ct,this._sessionStartTimestamp];var t=this.Nr.props[Kf];return bt(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Vr(null,null,null)}Kr(){St(W,"beforeunload",()=>{this.Jr()&&un.N(this.Gr)},{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.S.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var r=n||new Date().getTime(),[s,o,i]=this.Qr(),a=this.Xr(),l=xn(i)&&i>0&&Math.abs(r-i)>864e5,c=!1,u=!o,f=!t&&Math.abs(r-s)>this.sessionTimeoutMs;u||f||l?(o=this.qr(),a=this.Br(),M_.info("new session ID generated",{sessionId:o,windowId:a,changeReason:{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}}),i=r,c=!0):a||(a=this.Br(),c=!0);var p=s===0||!t||l?r:s,g=i===0?new Date().getTime():i;return this.Yr(a),this.Vr(o,p,g),t||this.Hr(),c&&this.Ur.forEach(y=>y(o,a,c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0)),{sessionId:o,windowId:a,sessionStartTimestamp:g,changeReason:c?{noSessionId:u,activityTimeout:f,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}Hr(){clearTimeout(this.Zr),this.Zr=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var W4=["$set_once","$set"],lo=sn("[SiteApps]");class q4{constructor(t){this._instance=t,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(t,n){if(n){var r=this.globalsForEvent(n);this.ts.push(r),this.ts.length>1e3&&(this.ts=this.ts.slice(10))}}get siteAppLoaders(){var t;return(t=ze._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance.Ge(this.es.bind(this));this.rs=()=>{t(),this.ts=[],this.rs=void 0}}}globalsForEvent(t){var n,r,s,o,i,a,l;if(!t)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var[p,g]of Object.entries(f))c[p]={id:u[p],type:p,properties:g};var{$set_once:y,$set:m}=t;return{event:be({},WT(t,W4),{properties:be({},t.properties,m?{$set:be({},(n=(r=t.properties)==null?void 0:r.$set)!==null&&n!==void 0?n:{},m)}:{},y?{$set_once:be({},(s=(o=t.properties)==null?void 0:o.$set_once)!==null&&s!==void 0?s:{},y)}:{}),elements_chain:(i=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(t){var n=this.apps[t.id],r=()=>{var a;!n.errored&&this.ts.length&&(lo.info("Processing "+this.ts.length+" events for site app with id "+t.id),this.ts.forEach(l=>n.processEvent==null?void 0:n.processEvent(l)),n.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&((a=this.rs)==null||a.call(this))},s=!1,o=a=>{n.errored=!a,n.loaded=!0,lo.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),s&&r()};try{var{processEvent:i}=t.init({posthog:this._instance,callback:a=>{o(a)}});i&&(n.processEvent=i),s=!0}catch(a){lo.error("Error while initializing PostHog app with config id "+t.id,a),o(!1)}if(s&&n.loaded)try{r()}catch(a){lo.error("Error while processing buffered events PostHog app with config id "+t.id,a),n.errored=!0}}ss(){var t=this.siteAppLoaders||[];for(var n of t)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}ns(t){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(n)}catch(s){lo.error("Error while processing event "+t.event+" for site app "+r.id,s)}}}onRemoteConfig(t){var n,r,s,o=this;if((n=this.siteAppLoaders)!=null&&n.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",c=>this.ns(c))):void lo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.rs)==null||r.call(this),(s=t.siteApps)!=null&&s.length)if(this.isEnabled){var i=function(c){var u;ze["__$$ph_site_app_"+c]=o._instance,(u=ze.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(o._instance,l,f=>{if(f)return lo.error("Error while initializing PostHog app with config id "+c,f)})};for(var{id:a,url:l}of t.siteApps)i(a)}else lo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var H4=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],I_=function(e,t){if(!e)return!1;var n=e.toLowerCase();return H4.concat(t||[]).some(r=>{var s=r.toLowerCase();return n.indexOf(s)!==-1})},KR=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&I_(n,t))return!0;try{var r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>I_(s==null?void 0:s.brand,t)))return!0}catch{}return!!e.webdriver},Bc=function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e}({}),F_="i.posthog.com";class G4{constructor(t){this.os={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+F_,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.os[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=Bc.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.os[this.apiHost]=Bc.EU:this.os[this.apiHost]=Bc.CUSTOM),this.os[this.apiHost]}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(this.region===Bc.CUSTOM)return this.apiHost+n;var r=F_+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var K4={icontains:(e,t)=>!!W&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!W&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!W&&Nl(t.href,e),not_regex:(e,t)=>!!W&&!Nl(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class yn{constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments(s=>{yn.ls("retrieved web experiments from the server"),n.us=new Map,s.forEach(o=>{if(o.feature_flag_key){var i;n.us&&(yn.ls("setting flag key ",o.feature_flag_key," to web experiment ",o),(i=n.us)==null||i.set(o.feature_flag_key,o));var a=n._instance.getFeatureFlag(o.feature_flag_key);$t(a)&&o.variants[a]&&n.hs(o.name,a,o.variants[a].transforms)}else if(o.variants)for(var l in o.variants){var c=o.variants[l];yn.ds(c)&&n.hs(o.name,l,c.transforms)}})},r)},this._instance=t,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}onFeatureFlags(t){if(this._is_bot())yn.ls("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(st(this.us))return this.us=new Map,this.loadIfEnabled(),void this.previewWebExperiment();yn.ls("applying feature flags",t),t.forEach(n=>{var r;if(this.us&&(r=this.us)!=null&&r.has(n)){var s,o=this._instance.getFeatureFlag(n),i=(s=this.us)==null?void 0:s.get(n);o&&i!=null&&i.variants[o]&&this.hs(i.name,o,i.variants[o].transforms)}})}}previewWebExperiment(){var t=yn.getWindowLocation();if(t!=null&&t.search){var n=Jf(t==null?void 0:t.search,"__experiment_id"),r=Jf(t==null?void 0:t.search,"__experiment_variant");n&&r&&(yn.ls("previewing web experiments "+n+" && "+r),this.getWebExperiments(s=>{this.vs(parseInt(n),r,s)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var s=this._instance.get_property("$web_experiments");if(s&&!n)return t(s);this._instance.Ee({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:o=>{if(o.statusCode!==200||!o.json)return t([]);var i=o.json.experiments||[];return t(i)}})}vs(t,n,r){var s=r.filter(o=>o.id===t);s&&s.length>0&&(yn.ls("Previewing web experiment ["+s[0].name+"] with variant ["+n+"]"),this.hs(s[0].name,n,s[0].variants[n].transforms))}static ds(t){return!st(t.conditions)&&yn.cs(t)&&yn.fs(t)}static cs(t){var n;if(st(t.conditions)||st((n=t.conditions)==null?void 0:n.url))return!0;var r,s,o,i=yn.getWindowLocation();return!!i&&((r=t.conditions)==null||!r.url||K4[(s=(o=t.conditions)==null?void 0:o.urlMatchType)!==null&&s!==void 0?s:"icontains"](t.conditions.url,i))}static getWindowLocation(){return W==null?void 0:W.location}static fs(t){var n;if(st(t.conditions)||st((n=t.conditions)==null?void 0:n.utm))return!0;var r=UR();if(r.utm_source){var s,o,i,a,l,c,u,f,p=(s=t.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((o=t.conditions)==null||(o=o.utm)==null?void 0:o.utm_campaign)==r.utm_campaign,g=(i=t.conditions)==null||(i=i.utm)==null||!i.utm_source||((a=t.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==r.utm_source,y=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=t.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==r.utm_medium,m=(u=t.conditions)==null||(u=u.utm)==null||!u.utm_term||((f=t.conditions)==null||(f=f.utm)==null?void 0:f.utm_term)==r.utm_term;return p&&y&&m&&g}return!1}static ls(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];Ee.info("[WebExperiments] "+t,r)}hs(t,n,r){this._is_bot()?yn.ls("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach(s=>{if(s.selector){var o;yn.ls("applying transform of variant "+n+" for experiment "+t+" ",s);var i=(o=document)==null?void 0:o.querySelectorAll(s.selector);i==null||i.forEach(a=>{var l=a;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)})}}):yn.ls("Control variants leave the page unmodified.")}_is_bot(){return Xn&&this._instance?KR(Xn,this._instance.config.custom_blocked_useragents):void 0}}var Y4=sn("[PostHog ExternalIntegrations]"),Z4={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Q4{constructor(t){this._instance=t}J(t,n){var r;(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,s=>{if(s)return Y4.error("failed to load script",s);n()})}startIfEnabledOrStop(){var t=this,n=function(i){var a,l,c;!s||(a=ze.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[i]||t.J(Z4[i],()=>{var u;(u=ze.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[i])==null||u.start(t._instance)}),!s&&(l=ze.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[i]&&((c=ze.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[i])==null||c.stop())};for(var[r,s]of Object.entries((o=this._instance.config.integrations)!==null&&o!==void 0?o:{})){var o;n(r)}}}var su={},qv=()=>{},La="posthog",YR=!u4&&(Ln==null?void 0:Ln.indexOf("MSIE"))===-1&&(Ln==null?void 0:Ln.indexOf("Mozilla"))===-1,L_=e=>{var t;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:VL(_e==null?void 0:_e.location),persistence:"localStorage+cookie",persistence_name:"",loaded:qv,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:e!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:e??"unset",debug:Bn&&$t(Bn==null?void 0:Bn.search)&&Bn.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(W==null||(t=W.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;Ee.error(r)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Wv},error_tracking:{},_onCapture:qv}},U_=e=>{var t={};he(e.process_person)||(t.person_profiles=e.process_person),he(e.xhr_headers)||(t.request_headers=e.xhr_headers),he(e.cookie_name)||(t.persistence_name=e.cookie_name),he(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),he(e.store_google)||(t.save_campaign_params=e.store_google),he(e.verbose)||(t.debug=e.verbose);var n=Ut({},t,e);return bt(e.property_blacklist)&&(he(e.property_denylist)?n.property_denylist=e.property_blacklist:bt(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:Ee.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class X4{constructor(){this.__forceAllowLocalhost=!1}get ps(){return this.__forceAllowLocalhost}set ps(t){Ee.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class op{get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){this.webPerformance=new X4,this.gs=!1,this.version=As.LIB_VERSION,this._s=new GR,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=L_(),this.SentryIntegration=e4,this.sentryIntegration=t=>function(n,r){var s=ER(n,r);return{name:_R,processEvent:o=>s(o)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.bs=!1,this.ys=null,this.ws=null,this.Ss=null,this.featureFlags=new j4(this),this.toolbar=new n4(this),this.scrollManager=new U4(this),this.pageViewManager=new l4(this),this.surveys=new k4(this),this.experiments=new yn(this),this.exceptions=new h4(this),this.rateLimiter=new O4(this),this.requestRouter=new G4(this),this.consent=new uU(this),this.externalIntegrations=new Q4(this),this.people={set:(t,n,r)=>{var s=$t(t)?{[t]:n}:t;this.setPersonProperties(s),r==null||r({})},set_once:(t,n,r)=>{var s=$t(t)?{[t]:n}:t;this.setPersonProperties(void 0,s),r==null||r({})}},this.on("eventCaptured",t=>Ee.info('send "'+(t==null?void 0:t.event)+'"',t))}init(t,n,r){if(r&&r!==La){var s,o=(s=su[r])!==null&&s!==void 0?s:new op;return o._init(t,n,r),su[r]=o,su[La][r]=o,o}return this._init(t,n,r)}_init(t,n,r){var s,o;if(n===void 0&&(n={}),he(t)||bv(t))return Ee.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return Ee.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.$s=n,this.ks=[],n.person_profiles&&(this.ws=n.person_profiles),this.set_config(Ut({},L_(n.defaults),U_(n),{name:r,token:t})),this.config.on_xhr_error&&Ee.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Is.GZipJS,this.persistence=new Dm(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Dm(be({},this.config,{persistence:"sessionStorage"}));var i=be({},this.persistence.props),a=be({},this.sessionPersistence.props);if(this.register({$initialization_time:new Date().toISOString()}),this.xs=new I4(b=>this.Es(b),this.config.request_queue_config),this.Is=new L4(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new z4(this),this.sessionPropsManager=new V4(this,this.sessionManager,this.persistence)),new s4(this).startIfEnabledOrStop(),this.siteApps=new q4(this),(s=this.siteApps)==null||s.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new XU(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new nU(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new a4(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new o4(this),this.exceptionObserver=new hU(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new aR(this,fU),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new RU(this),this.historyAutocapture.startIfEnabled(),As.DEBUG=As.DEBUG||this.config.debug,As.DEBUG&&Ee.info("Starting in debug mode",{this:this,config:n,thisC:be({},this.config),p:i,s:a}),this.Ps(),((o=n.bootstrap)==null?void 0:o.distinctID)!==void 0){var l,c,u=this.config.get_device_id(ko()),f=(l=n.bootstrap)!=null&&l.isIdentifiedID?u:n.bootstrap.distinctID;this.persistence.set_property(Ps,(c=n.bootstrap)!=null&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:f})}if(this.Rs()){var p,g,y=Object.keys(((p=n.bootstrap)==null?void 0:p.featureFlags)||{}).filter(b=>{var x;return!((x=n.bootstrap)==null||(x=x.featureFlags)==null||!x[b])}).reduce((b,x)=>{var w;return b[x]=((w=n.bootstrap)==null||(w=w.featureFlags)==null?void 0:w[x])||!1,b},{}),m=Object.keys(((g=n.bootstrap)==null?void 0:g.featureFlagPayloads)||{}).filter(b=>y[b]).reduce((b,x)=>{var w,_;return(w=n.bootstrap)!=null&&(w=w.featureFlagPayloads)!=null&&w[x]&&(b[x]=(_=n.bootstrap)==null||(_=_.featureFlagPayloads)==null?void 0:_[x]),b},{});this.featureFlags.receivedFeatureFlags({featureFlags:y,featureFlagPayloads:m})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Ud,$device_id:null},"");else if(!this.get_distinct_id()){var v=this.config.get_device_id(ko());this.register_once({distinct_id:v,$device_id:v},""),this.persistence.set_property(Ps,"anonymous")}return St(W,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?JU(this,()=>this.Ts()):this.Ts(),br(this.config._onCapture)&&this.config._onCapture!==qv&&(Ee.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",b=>this.config._onCapture(b.event,b))),this.config.ip&&Ee.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Ie(t){var n,r,s,o,i,a,l,c;if(!_e||!_e.body)return Ee.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ie(t)},500);this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Qe(t.supportedCompression,Is.GZipJS)?Is.GZipJS:Qe(t.supportedCompression,Is.Base64)?Is.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.ws?this.ws:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(t),(s=this.sessionRecording)==null||s.onRemoteConfig(t),(o=this.autocapture)==null||o.onRemoteConfig(t),(i=this.heatmaps)==null||i.onRemoteConfig(t),this.surveys.onRemoteConfig(t),(a=this.webVitalsAutocapture)==null||a.onRemoteConfig(t),(l=this.exceptionObserver)==null||l.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(t)}Ts(){try{this.config.loaded(this)}catch(t){Ee.critical("`loaded` function failed",t)}this.Ms(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.Cs()},1),new M4(this).load(),this.featureFlags.flags()}Ms(){var t;this.has_opted_out_capturing()||this.config.request_batching&&((t=this.xs)==null||t.enable())}_dom_loaded(){this.has_opted_out_capturing()||Fo(this.__request_queue,t=>this.Es(t)),this.__request_queue=[],this.Ms()}_handle_unload(){var t,n;this.config.request_batching?(this.Fs()&&this.capture("$pageleave"),(t=this.xs)==null||t.unload(),(n=this.Is)==null||n.unload()):this.Fs()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}Ee(t){this.__loaded&&(YR?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=oh(t.url,{ip:this.config.ip?1:0}),t.headers=be({},this.config.request_headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,s,o,i=be({},n);i.timeout=i.timeout||6e4,i.url=oh(i.url,{_:new Date().getTime().toString(),ver:As.LIB_VERSION,compression:i.compression});var a=(r=i.transport)!==null&&r!==void 0?r:"fetch",l=(s=(o=qT(ru,c=>c.transport===a))==null?void 0:o.method)!==null&&s!==void 0?s:ru[0].method;if(!l)throw new Error("No available transport method");l(i)})(be({},t,{callback:n=>{var r,s;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(s=this.config).on_request_error)==null||r.call(s,n)),t.callback==null||t.callback(n)}}))))}Es(t){this.Is?this.Is.retriableRequest(t):this.Ee(t)}_execute_array(t){var n,r=[],s=[],o=[];Fo(t,a=>{a&&(n=a[0],bt(n)?o.push(a):br(a)?a.call(this):bt(a)&&n==="alias"?r.push(a):bt(a)&&n.indexOf("capture")!==-1&&br(this[n])?o.push(a):s.push(a))});var i=function(a,l){Fo(a,function(c){if(bt(c[0])){var u=l;ct(c,function(f){u=u[f[0]].apply(u,f.slice(1))})}else this[c[0]].apply(this,c.slice(1))},l)};i(r,this),i(s,this),i(o,this)}Rs(){var t,n;return((t=this.config.bootstrap)==null?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,n,r){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.xs){if(!this.consent.isOptedOut())if(!he(t)&&$t(t)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!$t(n==null?void 0:n.$current_url)&&(Ee.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var i=new Date,a=(r==null?void 0:r.timestamp)||i,l=ko(),c={uuid:l,event:t,properties:this.calculateEventProperties(t,n||{},a,l)};o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r!=null&&r.$set&&(c.$set=r==null?void 0:r.$set);var u,f,p=this.Os(r==null?void 0:r.$set_once);if(p&&(c.$set_once=p),(c=UL(c,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,he(r==null?void 0:r.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=i),t===km.DISMISSED||t===km.SENT){var g=n==null?void 0:n[k_.SURVEY_ID],y=n==null?void 0:n[k_.SURVEY_ITERATION];localStorage.setItem((f=""+zv+(u={id:g,current_iteration:y}).id,u.current_iteration&&u.current_iteration>0&&(f=""+zv+u.id+"_"+u.current_iteration),f),"true"),c.$set=be({},c.$set,{[$4({id:g,current_iteration:y},t===km.SENT?"responded":"dismissed")]:!0})}var m=be({},c.properties.$set,c.$set);if(Wa(m)||this.setPersonPropertiesForFlags(m),!st(this.config.before_send)){var v=this.As(c);if(!v)return;c=v}this._s.emit("eventCaptured",c);var b={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Es(b):this.xs.enqueue(b),c}Ee.critical("This capture call is ignored due to client rate limiting.")}}else Ee.error("No event name provided to posthog.capture")}else Ee.uninitializedWarning("posthog.capture")}Ge(t){return this.on("eventCaptured",n=>t(n.event,n))}calculateEventProperties(t,n,r,s,o){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var i=o?void 0:this.persistence.remove_event_timer(t),a=be({},n);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(a.$cookieless_mode=!0),t==="$snapshot"){var l=be({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=l.distinct_id,(!$t(a.distinct_id)&&!xn(a.distinct_id)||bv(a.distinct_id))&&Ee.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var c,u=R4(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:f,windowId:p}=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime());a.$session_id=f,a.$window_id=p}this.sessionPropsManager&&Ut(a,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Ut(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(g=this.Is)==null?void 0:g.length}catch(b){a.$sdk_debug_error_capturing_properties=String(b)}if(this.requestRouter.region===Bc.CUSTOM&&(a.$lib_custom_api_host=this.config.api_host),c=t!=="$pageview"||o?t!=="$pageleave"||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),a=Ut(a,c),t==="$pageview"&&_e&&(a.title=_e.title),!he(i)){var y=r.getTime()-i;a.$duration=parseFloat((y/1e3).toFixed(3))}Ln&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=Ut({},u,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),bt(this.config.property_denylist)?ct(this.config.property_denylist,function(b){delete a[b]}):Ee.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(Ee.error("sanitize_properties is deprecated. Use before_send instead"),a=m(a,t));var v=this.Ds();return a.$process_person_profile=v,v&&!o&&this.Ls("_calculate_event_properties"),a}Os(t){var n;if(!this.persistence||!this.Ds()||this.gs)return t;var r=this.persistence.get_initial_props(),s=(n=this.sessionPropsManager)==null?void 0:n.getSetOnceProps(),o=Ut({},r,s||{},t||{}),i=this.config.sanitize_properties;return i&&(Ee.error("sanitize_properties is deprecated. Use before_send instead"),o=i(o,"$set_once")),this.gs=!0,Wa(o)?void 0:o}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var s;(s=this.persistence)==null||s.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}js(t,n){this.register({[t]:n})}getFeatureFlag(t,n){return this.featureFlags.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(t,n){return this.featureFlags.isFeatureEnabled(t,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(t,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n)}getEarlyAccessFeatures(t,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(t,n,r)}on(t,n){return this._s.on(t,n)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys.getSurveys(t,n)}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(t,n)}renderSurvey(t,n){this.surveys.renderSurvey(t,n)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(t,n)}identify(t,n,r){if(!this.__loaded||!this.persistence)return Ee.uninitializedWarning("posthog.identify");if(xn(t)&&(t=t.toString(),Ee.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))Ee.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==Ud){if(this.Ls("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var o=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:o},"")}t!==s&&t!==this.get_property(kc)&&(this.unregister(kc),this.register({distinct_id:t}));var i=(this.persistence.get_property(Ps)||"anonymous")==="anonymous";t!==s&&i?(this.persistence.set_property(Ps,"identified"),this.setPersonPropertiesForFlags(be({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:s},{$set:n||{},$set_once:r||{}}),this.Ss=C_(t,n,r),this.featureFlags.setAnonymousDistinctId(s)):(n||r)&&this.setPersonProperties(n,r),t!==s&&(this.reloadFeatureFlags(),this.unregister(Yf))}}else Ee.critical('The string "'+Ud+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else Ee.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this.Ls("posthog.setPersonProperties")){var r=C_(this.get_distinct_id(),t,n);this.Ss!==r?(this.setPersonPropertiesForFlags(be({},n||{},t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Ss=r):Ee.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){if(this.Ls("posthog.group")){var s=this.getGroups();s[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:be({},s,{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),s[t]===n||r||this.reloadFeatureFlags()}}else Ee.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0),this.Ls("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,n)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var n,r,s,o;if(Ee.info("reset"),!this.__loaded)return Ee.uninitializedWarning("posthog.reset");var i=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),(s=this.persistence)==null||s.set_property(Ps,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Ss=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Ud,$device_id:null},"");else{var a=this.config.get_device_id(ko());this.register_once({distinct_id:a,$device_id:t?a:i},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var o,i=(o=t.timestampLookBack)!==null&&o!==void 0?o:10;if(!r)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-i,0)}return s}alias(t,n){return t===this.get_property(HT)?(Ee.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ls("posthog.alias")?(he(n)&&(n=this.get_distinct_id()),t!==n?(this.js(kc,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(Ee.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n,r,s,o,i,a=be({},this.config);At(t)&&(Ut(this.config,U_(t)),(n=this.persistence)==null||n.update_config(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Dm(be({},this.config,{persistence:"sessionStorage"})),Kt.O()&&Kt.D("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(As.DEBUG=!0,Ee.info("set_config",{config:t,oldConfig:a,newConfig:be({},this.config)})),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(o=this.heatmaps)==null||o.startIfEnabled(),this.surveys.loadIfEnabled(),this.Ps(),(i=this.externalIntegrations)==null||i.startIfEnabledOrStop())}startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var s,o,i,a,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),r.sampling&&((o=this.sessionRecording)==null||o.overrideSampling()),r.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){var r=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(be({},TU((s=>s instanceof Error)(t)?{error:t,event:t.message}:{event:t},{syntheticException:r}),n))}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:La;return n!==La&&(n=La+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(Ps))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Ps))==="identified"}Ds(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Wa(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[kc])&&((n=this.persistence)==null||(n=n.props)==null||!n[Qf]))}Fs(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Ds()||this.Ls("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ls(t){return this.config.person_profiles==="never"?(Ee.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.js(Qf,!0),!0)}Ps(){var t,n,r,s,o=this.consent.isOptedOut(),i=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||o&&!!i;((t=this.persistence)==null?void 0:t.Fe)!==a&&((r=this.persistence)==null||r.set_disabled(a)),((n=this.sessionPersistence)==null?void 0:n.Fe)!==a&&((s=this.sessionPersistence)==null||s.set_disabled(a))}opt_in_capturing(t){var n;this.consent.optInOut(!0),this.Ps(),(he(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((n=t==null?void 0:t.captureEventName)!==null&&n!==void 0?n:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Cs()}opt_out_capturing(){this.consent.optInOut(!1),this.Ps()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.Ps()}_is_bot(){return Xn?KR(Xn,this.config.custom_blocked_useragents):void 0}Cs(){_e&&(_e.visibilityState==="visible"?this.bs||(this.bs=!0,this.capture("$pageview",{title:_e.title},{send_instantly:!0}),this.ys&&(_e.removeEventListener("visibilitychange",this.ys),this.ys=null)):this.ys||(this.ys=this.Cs.bind(this),St(_e,"visibilitychange",this.ys)))}debug(t){t===!1?(W==null||W.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(W==null||W.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}I(){var t,n,r,s,o,i,a,l=this.$s||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(Ee.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",s=!1,o=Ee,i=(n="advanced_disable_flags")in(t=l)&&!he(t[n]),a=r in t&&!he(t[r]),i?t[n]:a?(o&&o.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]):s)}As(t){if(st(this.config.before_send))return t;var n=bt(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var s of n){if(r=s(r),st(r)){var o="Event '"+t.event+"' was rejected in beforeSend function";return IL(t.event)?Ee.warn(o+". This can cause unexpected behavior."):Ee.info(o),null}r.properties&&!Wa(r.properties)||Ee.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.ce)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}}(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=LL(e.prototype[t[n]])})(op,["identify"]);var B_,ZR=(B_=su[La]=new op,function(){function e(){e.done||(e.done=!0,YR=!1,ct(su,function(t){t._dom_loaded()}))}_e!=null&&_e.addEventListener?_e.readyState==="complete"?e():St(_e,"DOMContentLoaded",e,{capture:!1}):W&&Ee.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),B_),QR=h.createContext({client:ZR}),ip=function(){var e=h.useContext(QR).client;return e};function Woe(e){var t=ip(),n=h.useState(function(){return t.isFeatureEnabled(e)}),r=n[0],s=n[1];return h.useEffect(function(){return t.onFeatureFlags(function(){s(t.isFeatureEnabled(e))})},[t,e]),r}var Hv=function(e,t){return Hv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(n[s]=r[s])},Hv(e,t)};function J4(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Hv(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Om=function(e){return typeof e=="function"},eB={componentStack:null,error:null},tB={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(e){J4(t,e);function t(n){var r=e.call(this,n)||this;return r.state=eB,r}return t.prototype.componentDidCatch=function(n,r){var s=r.componentStack,o=this.props.additionalProperties;this.setState({error:n,componentStack:s});var i;Om(o)?i=o(n):typeof o=="object"&&(i=o);var a=this.context.client;a.captureException(n,i)},t.prototype.render=function(){var n=this.props,r=n.children,s=n.fallback,o=this.state;if(o.componentStack==null)return Om(r)?r():r;var i=Om(s)?ce.createElement(s,{error:o.error,componentStack:o.componentStack}):s;return ce.isValidElement(i)?i:(console.warn(tB.INVALID_FALLBACK),ce.createElement(ce.Fragment,null))},t.contextType=QR,t})(ce.Component);function ap(e,t){if(e===void 0)throw new Error(`Environment variable ${t} was undefined`);return e}ap(void 0,"VITE_AUTH0_DOMAIN");ap(void 0,"VITE_AUTH0_CLIENT_ID");ap(void 0,"VITE_GITHUB_CLIENT_ID");const nB="/api",XR="https://api.zuplo.com/",rB=void 0,X="/api",J="v1",sB=ap("https://cdn.zuplo.com","VITE_CDN_URL"),an=[];for(let e=0;e<256;++e)an.push((e+256).toString(16).slice(1));function oB(e,t=0){return(an[e[t+0]]+an[e[t+1]]+an[e[t+2]]+an[e[t+3]]+"-"+an[e[t+4]]+an[e[t+5]]+"-"+an[e[t+6]]+an[e[t+7]]+"-"+an[e[t+8]]+an[e[t+9]]+"-"+an[e[t+10]]+an[e[t+11]]+an[e[t+12]]+an[e[t+13]]+an[e[t+14]]+an[e[t+15]]).toLowerCase()}let Mm;const iB=new Uint8Array(16);function aB(){if(!Mm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Mm=crypto.getRandomValues.bind(crypto)}return Mm(iB)}const lB=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),V_={randomUUID:lB};function Gb(e,t,n){var s;if(V_.randomUUID&&!e)return V_.randomUUID();e=e||{};const r=e.random??((s=e.rng)==null?void 0:s.call(e))??aB();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,oB(r)}function cB(e){return e?e.email==="adrian+routesjson@zuplo.com"||e.email==="adrian+test@zuplo.com"||e.email==="dev-portal-bot-test@example.com":!1}const ft=()=>{const{user:e}=si();return{logEvent:h.useCallback((n,r)=>{cB(e)||ZR.capture(n,r)},[e])}};var P;(function(e){e[e.CONTINUE=100]="CONTINUE",e[e.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",e[e.PROCESSING=102]="PROCESSING",e[e.OK=200]="OK",e[e.CREATED=201]="CREATED",e[e.ACCEPTED=202]="ACCEPTED",e[e.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",e[e.NO_CONTENT=204]="NO_CONTENT",e[e.RESET_CONTENT=205]="RESET_CONTENT",e[e.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",e[e.MULTI_STATUS=207]="MULTI_STATUS",e[e.ALREADY_REPORTED=208]="ALREADY_REPORTED",e[e.IM_USED=226]="IM_USED",e[e.MULTIPLE_CHOICES=300]="MULTIPLE_CHOICES",e[e.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",e[e.FOUND=302]="FOUND",e[e.SEE_OTHER=303]="SEE_OTHER",e[e.NOT_MODIFIED=304]="NOT_MODIFIED",e[e.USE_PROXY=305]="USE_PROXY",e[e.SWITCH_PROXY=306]="SWITCH_PROXY",e[e.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",e[e.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",e[e.BAD_REQUEST=400]="BAD_REQUEST",e[e.UNAUTHORIZED=401]="UNAUTHORIZED",e[e.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",e[e.FORBIDDEN=403]="FORBIDDEN",e[e.NOT_FOUND=404]="NOT_FOUND",e[e.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",e[e.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",e[e.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",e[e.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",e[e.CONFLICT=409]="CONFLICT",e[e.GONE=410]="GONE",e[e.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",e[e.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",e[e.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",e[e.URI_TOO_LONG=414]="URI_TOO_LONG",e[e.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",e[e.RANGE_NOT_SATISFIABLE=416]="RANGE_NOT_SATISFIABLE",e[e.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",e[e.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",e[e.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",e[e.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",e[e.LOCKED=423]="LOCKED",e[e.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",e[e.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",e[e.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.REQUEST_HEADER_FIELDS_TOO_LARGE=431]="REQUEST_HEADER_FIELDS_TOO_LARGE",e[e.UNAVAILABLE_FOR_LEGAL_REASONS=451]="UNAVAILABLE_FOR_LEGAL_REASONS",e[e.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e[e.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",e[e.BAD_GATEWAY=502]="BAD_GATEWAY",e[e.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",e[e.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",e[e.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",e[e.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",e[e.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",e[e.LOOP_DETECTED=508]="LOOP_DETECTED",e[e.NOT_EXTENDED=510]="NOT_EXTENDED",e[e.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(P||(P={}));P.INTERNAL_SERVER_ERROR;P.BAD_REQUEST;P.CONFLICT;P.NOT_FOUND;P.METHOD_NOT_ALLOWED;P.UNAUTHORIZED;P.FORBIDDEN;P.NOT_FOUND;P.CONFLICT;P.NOT_FOUND;const uB={type:"https://zup.fail/user-has-no-access-to-account",status:P.FORBIDDEN};P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.BAD_REQUEST;P.BAD_REQUEST;P.NOT_FOUND;P.CONFLICT;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.NOT_FOUND;P.NOT_FOUND;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.NOT_FOUND;P.NOT_FOUND;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.FORBIDDEN;P.NOT_FOUND;P.NOT_FOUND;P.FORBIDDEN;P.BAD_REQUEST;P.NOT_FOUND;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.FORBIDDEN;P.NOT_FOUND;P.BAD_REQUEST;P.NOT_FOUND;P.BAD_REQUEST;P.NOT_FOUND;P.BAD_REQUEST;P.BAD_REQUEST;P.NOT_FOUND;P.NOT_FOUND;P.BAD_REQUEST;P.FORBIDDEN;P.NOT_FOUND;P.NOT_FOUND;P.NOT_FOUND;P.FORBIDDEN;P.NOT_FOUND;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.NOT_FOUND;P.NOT_FOUND;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.NOT_FOUND;P.BAD_REQUEST;P.NOT_FOUND;P.BAD_REQUEST;const dB={type:"https://zup.fail/user-has-no-access-to-project",status:P.FORBIDDEN};P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.FORBIDDEN;P.NOT_FOUND;P.FORBIDDEN;P.INTERNAL_SERVER_ERROR;P.BAD_REQUEST;P.BAD_REQUEST;const fB={type:"https://zup.fail/max-allowed-projects-limit-reached",status:P.BAD_REQUEST};P.INTERNAL_SERVER_ERROR;P.BAD_REQUEST;P.NOT_FOUND;P.BAD_REQUEST;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.NOT_FOUND;P.BAD_GATEWAY;P.BAD_GATEWAY;P.UNAUTHORIZED;P.FORBIDDEN;P.FORBIDDEN;P.INTERNAL_SERVER_ERROR;P.BAD_REQUEST;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.UNAUTHORIZED;P.FORBIDDEN;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.FORBIDDEN;P.INTERNAL_SERVER_ERROR;P.NOT_FOUND;P.NOT_FOUND;P.INTERNAL_SERVER_ERROR;P.FAILED_DEPENDENCY;P.FAILED_DEPENDENCY;P.FAILED_DEPENDENCY;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.NOT_FOUND;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.FORBIDDEN;P.NOT_FOUND;P.BAD_REQUEST;P.BAD_REQUEST;P.NOT_FOUND;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.CONFLICT;P.NOT_FOUND;P.INTERNAL_SERVER_ERROR;P.BAD_REQUEST;P.INTERNAL_SERVER_ERROR;P.FORBIDDEN;P.BAD_REQUEST;P.NOT_FOUND;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_GATEWAY;P.BAD_REQUEST;P.BAD_REQUEST;P.FORBIDDEN;P.FORBIDDEN;P.BAD_REQUEST;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.BAD_REQUEST;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.FORBIDDEN;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;P.BAD_REQUEST;const hB=[uB.type,dB.type,fB.type,"https://zup.fail/account-not-found","https://zup.fail/project-not-found","https://zup.fail/environment-not-found"];class gs extends Error{constructor({title:n,type:r,status:s,detail:o,instance:i,traceId:a},l){super(n,l);rt(this,"type");rt(this,"status");rt(this,"detail");rt(this,"instance");rt(this,"traceId");this.name="ZuploError",this.type=r,this.status=s,this.detail=o,this.instance=i,this.traceId=a}}class tr extends Error{constructor(n,r){super(n,r);rt(this,"code");rt(this,"type");rt(this,"status");rt(this,"detail");rt(this,"instance");rt(this,"traceId");rt(this,"title");rt(this,"body");this.traceId=r==null?void 0:r.traceId,this.name="ZuploApiError"}async tryReadResponse(n){try{this.status=n.status;const r=await n.clone().text();if(r){const s=JSON.parse(r);this.body=s,"code"in s&&typeof s.code=="number"?this.code=s.code:"code"in s&&typeof s.code=="string"&&(this.code=parseInt(s.code)),"type"in s&&typeof s.type=="string"&&(this.type=s.type),"detail"in s&&typeof s.detail=="string"&&(this.detail=s.detail),"instance"in s&&typeof s.instance=="string"&&(this.instance=s.instance),"title"in s&&typeof s.title=="string"&&(this.title=s.title),"title"in s&&typeof s.title=="string"?this.message=s.title:"message"in s&&typeof s.message=="string"&&(this.message=s.message)}}catch(r){Et.debug(r)}}setTraceId(n){this.traceId=n}}const pB=({children:e,fallback:t})=>{const{logEvent:n}=ft();return d.jsx(jb,{beforeCapture:(r,s)=>{n("error-boundary",{error:(s==null?void 0:s.message)??"not defined"}),(s instanceof gs||s instanceof tr)&&r.setTags({errorType:s.type,errorStatus:s.status,errorDetail:s.detail,errorInstance:s.instance,traceId:s.traceId})},fallback:t,showDialog:!1,children:e})},mB="https://discord.zuplo.com",Gv="support@zuplo.com",qoe="https://zuplo.com/meeting?utm_source=pzc",gB="sales@zuplo.com",z_=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,W_=jC,Wr=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return W_(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const u=n==null?void 0:n[c],f=o==null?void 0:o[c];if(u===null)return null;const p=z_(u)||z_(f);return s[c][p]}),a=n&&Object.entries(n).reduce((c,u)=>{let[f,p]=u;return p===void 0||(c[f]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:p,...g}=u;return Object.entries(g).every(y=>{let[m,v]=y;return Array.isArray(v)?v.includes({...o,...a}[m]):{...o,...a}[m]===v})?[...c,f,p]:c},[]);return W_(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)},Kb=Wr("inline-flex whitespace-nowrap items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 no-underline",{variants:{variant:{default:"bg-zuplo-600 shadow hover:bg-zuplo-pink-hover text-white disabled:bg-pink-300 disabled:cursor-not-allowed focus-visible:ring-zuplo-pink/60",secondary:"text-gray-800 bg-gray-100 hover:bg-gray-300",white:"bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:border-pink-300 hover:bg-accent focus-visible:ring-pink-300","white-warn":"bg-white border border-gray-300 rounded-md shadow-sm focus:outline-none focus:border-pink-300 hover:bg-accent text-red-500",ghost:"rounded-md text-gray-600 focus:outline-none focus:border-pink-300 hover:bg-neutral-100 hover:border-gray-600 hover:no-underline",warn:"bg-amber-100 hover:bg-amber-200 text-amber-800",outline:"rounded-md text-gray-600 focus:outline-none focus:border-pink-300 hover:border-neutral-200 border border-transparent hover:border-gray-600 hover:no-underline",discord:"bg-discord hover:bg-discord-hover text-white",danger:"bg-red-500 hover:bg-red-700 text-white","primary-next":"bg-[#20222E] hover:bg-[#20222E]/80 text-white",link:"p-0 text-zuplo-600 hover:text-gray-800 hover:no-underline","outline-primary":"rounded-md text-zuplo-600 border border-zuplo-600 hover:text-zuplo-700 hover:border-zuplo-700 hover:no-underline",fancy:"border-[#2564EB] bg-gradient-to-r from-[#2564EB] to-[#52E0FC] text-white font-semibold rounded py-[1px] shadow-sm hover:shadow-md transition-all duration-80 transform hover:translate-y-[-1px] !px-[1px]"},size:{default:"h-9 px-4 py-2",xs:"h-7 rounded-md px-2 text-xs",sm:"h-9 rounded-md px-3 text-sm",lg:"h-10 rounded-md px-8",inline:"",icon:"h-9 w-9","icon-lg":"h-10 w-10","icon-xs":"h-8 w-8","icon-xxs":"h-6 w-6"}},defaultVariants:{variant:"default",size:"default"}}),Fe=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const i=r?KC:"button";return d.jsx(i,{className:se(Kb({variant:t,size:n,className:e})),ref:o,...s})});Fe.displayName="Button";const Hoe=({children:e,className:t,...n})=>d.jsx("div",{className:se("flex w-full h-full transition-colors hover:bg-white/99 items-center px-2 bg-white text-[#2564EB] rounded",t),...n,children:e}),vB=e=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 127.14 96.36",...e,children:d.jsx("path",{d:"M107.7 8.07A105.15 105.15 0 0 0 81.47 0a72.06 72.06 0 0 0-3.36 6.83 97.68 97.68 0 0 0-29.11 0A72.37 72.37 0 0 0 45.64 0a105.89 105.89 0 0 0-26.25 8.09C2.79 32.65-1.71 56.6.54 80.21a105.73 105.73 0 0 0 32.17 16.15 77.7 77.7 0 0 0 6.89-11.11 68.42 68.42 0 0 1-10.85-5.18c.91-.66 1.8-1.34 2.66-2a75.57 75.57 0 0 0 64.32 0c.87.71 1.76 1.39 2.66 2a68.68 68.68 0 0 1-10.87 5.19 77 77 0 0 0 6.89 11.1 105.25 105.25 0 0 0 32.19-16.14c2.64-27.38-4.51-51.11-18.9-72.15ZM42.45 65.69C36.18 65.69 31 60 31 53s5-12.74 11.43-12.74S54 46 53.89 53s-5.05 12.69-11.44 12.69Zm42.24 0C78.41 65.69 73.25 60 73.25 53s5-12.74 11.44-12.74S96.23 46 96.12 53s-5.04 12.69-11.43 12.69Z",style:{fill:"#fff"}})}),JR=({text:e,onClick:t,className:n})=>d.jsx(Fe,{onClick:t,variant:"discord",className:n,asChild:!0,children:d.jsxs("a",{href:mB,target:"_blank",rel:"noreferrer",children:[d.jsx(vB,{className:"w-6 mr-2"}),e]})});/**
|
13
|
+
* @license lucide-react v0.483.0 - ISC
|
14
|
+
*
|
15
|
+
* This source code is licensed under the ISC license.
|
16
|
+
* See the LICENSE file in the root directory of this source tree.
|
17
|
+
*/const yB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),eN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
18
|
+
* @license lucide-react v0.483.0 - ISC
|
19
|
+
*
|
20
|
+
* This source code is licensed under the ISC license.
|
21
|
+
* See the LICENSE file in the root directory of this source tree.
|
22
|
+
*/var bB={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"};/**
|
23
|
+
* @license lucide-react v0.483.0 - ISC
|
24
|
+
*
|
25
|
+
* This source code is licensed under the ISC license.
|
26
|
+
* See the LICENSE file in the root directory of this source tree.
|
27
|
+
*/const xB=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},l)=>h.createElement("svg",{ref:l,...bB,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:eN("lucide",s),...a},[...i.map(([c,u])=>h.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
|
28
|
+
* @license lucide-react v0.483.0 - ISC
|
29
|
+
*
|
30
|
+
* This source code is licensed under the ISC license.
|
31
|
+
* See the LICENSE file in the root directory of this source tree.
|
32
|
+
*/const Be=(e,t)=>{const n=h.forwardRef(({className:r,...s},o)=>h.createElement(xB,{ref:o,iconNode:t,className:eN(`lucide-${yB(e)}`,r),...s}));return n.displayName=`${e}`,n};/**
|
33
|
+
* @license lucide-react v0.483.0 - ISC
|
34
|
+
*
|
35
|
+
* This source code is licensed under the ISC license.
|
36
|
+
* See the LICENSE file in the root directory of this source tree.
|
37
|
+
*/const wB=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],_B=Be("ArrowRight",wB);/**
|
38
|
+
* @license lucide-react v0.483.0 - ISC
|
39
|
+
*
|
40
|
+
* This source code is licensed under the ISC license.
|
41
|
+
* See the LICENSE file in the root directory of this source tree.
|
42
|
+
*/const EB=[["path",{d:"M7 17V7h10",key:"11bw93"}],["path",{d:"M17 17 7 7",key:"2786uv"}]],SB=Be("ArrowUpLeft",EB);/**
|
43
|
+
* @license lucide-react v0.483.0 - ISC
|
44
|
+
*
|
45
|
+
* This source code is licensed under the ISC license.
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
47
|
+
*/const CB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]],TB=Be("Ban",CB);/**
|
48
|
+
* @license lucide-react v0.483.0 - ISC
|
49
|
+
*
|
50
|
+
* This source code is licensed under the ISC license.
|
51
|
+
* See the LICENSE file in the root directory of this source tree.
|
52
|
+
*/const RB=[["path",{d:"m19 3 1 1",key:"ze14oc"}],["path",{d:"m20 2-4.5 4.5",key:"1sppr8"}],["path",{d:"M20 8v13a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"1ocbpn"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H14",key:"1gfsgw"}],["circle",{cx:"14",cy:"8",r:"2",key:"u49eql"}]],NB=Be("BookKey",RB);/**
|
53
|
+
* @license lucide-react v0.483.0 - ISC
|
54
|
+
*
|
55
|
+
* This source code is licensed under the ISC license.
|
56
|
+
* See the LICENSE file in the root directory of this source tree.
|
57
|
+
*/const PB=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],jB=Be("Box",PB);/**
|
58
|
+
* @license lucide-react v0.483.0 - ISC
|
59
|
+
*
|
60
|
+
* This source code is licensed under the ISC license.
|
61
|
+
* See the LICENSE file in the root directory of this source tree.
|
62
|
+
*/const AB=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]],$B=Be("Building",AB);/**
|
63
|
+
* @license lucide-react v0.483.0 - ISC
|
64
|
+
*
|
65
|
+
* This source code is licensed under the ISC license.
|
66
|
+
* See the LICENSE file in the root directory of this source tree.
|
67
|
+
*/const DB=[["path",{d:"m8.5 8.5-1 1a4.95 4.95 0 0 0 7 7l1-1",key:"1ff4ui"}],["path",{d:"M11.843 6.187A4.947 4.947 0 0 1 16.5 7.5a4.947 4.947 0 0 1 1.313 4.657",key:"1sbrv4"}],["path",{d:"M14 16.5V14",key:"1maf8j"}],["path",{d:"M14 6.5v1.843",key:"1a6u6t"}],["path",{d:"M10 10v7.5",key:"80pj65"}],["path",{d:"m16 7 1-5 1.367.683A3 3 0 0 0 19.708 3H21v1.292a3 3 0 0 0 .317 1.341L22 7l-5 1",key:"11a9mt"}],["path",{d:"m8 17-1 5-1.367-.683A3 3 0 0 0 4.292 21H3v-1.292a3 3 0 0 0-.317-1.341L2 17l5-1",key:"3mjmon"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]],kB=Be("CandyOff",DB);/**
|
68
|
+
* @license lucide-react v0.483.0 - ISC
|
69
|
+
*
|
70
|
+
* This source code is licensed under the ISC license.
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
72
|
+
*/const OB=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ia=Be("Check",OB);/**
|
73
|
+
* @license lucide-react v0.483.0 - ISC
|
74
|
+
*
|
75
|
+
* This source code is licensed under the ISC license.
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
77
|
+
*/const MB=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],lp=Be("ChevronDown",MB);/**
|
78
|
+
* @license lucide-react v0.483.0 - ISC
|
79
|
+
*
|
80
|
+
* This source code is licensed under the ISC license.
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
82
|
+
*/const IB=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],FB=Be("ChevronRight",IB);/**
|
83
|
+
* @license lucide-react v0.483.0 - ISC
|
84
|
+
*
|
85
|
+
* This source code is licensed under the ISC license.
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
87
|
+
*/const LB=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],UB=Be("ChevronUp",LB);/**
|
88
|
+
* @license lucide-react v0.483.0 - ISC
|
89
|
+
*
|
90
|
+
* This source code is licensed under the ISC license.
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
92
|
+
*/const BB=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],VB=Be("ChevronsUpDown",BB);/**
|
93
|
+
* @license lucide-react v0.483.0 - ISC
|
94
|
+
*
|
95
|
+
* This source code is licensed under the ISC license.
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
97
|
+
*/const zB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],cp=Be("CircleAlert",zB);/**
|
98
|
+
* @license lucide-react v0.483.0 - ISC
|
99
|
+
*
|
100
|
+
* This source code is licensed under the ISC license.
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
102
|
+
*/const WB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],Yb=Be("CircleArrowUp",WB);/**
|
103
|
+
* @license lucide-react v0.483.0 - ISC
|
104
|
+
*
|
105
|
+
* This source code is licensed under the ISC license.
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
107
|
+
*/const qB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}]],HB=Be("CircleMinus",qB);/**
|
108
|
+
* @license lucide-react v0.483.0 - ISC
|
109
|
+
*
|
110
|
+
* This source code is licensed under the ISC license.
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
112
|
+
*/const GB=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]],KB=Be("Clipboard",GB);/**
|
113
|
+
* @license lucide-react v0.483.0 - ISC
|
114
|
+
*
|
115
|
+
* This source code is licensed under the ISC license.
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
117
|
+
*/const YB=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],ZB=Be("Clock",YB);/**
|
118
|
+
* @license lucide-react v0.483.0 - ISC
|
119
|
+
*
|
120
|
+
* This source code is licensed under the ISC license.
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
122
|
+
*/const QB=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],Kv=Be("Code",QB);/**
|
123
|
+
* @license lucide-react v0.483.0 - ISC
|
124
|
+
*
|
125
|
+
* This source code is licensed under the ISC license.
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
127
|
+
*/const XB=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],tN=Be("Copy",XB);/**
|
128
|
+
* @license lucide-react v0.483.0 - ISC
|
129
|
+
*
|
130
|
+
* This source code is licensed under the ISC license.
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
132
|
+
*/const JB=[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]],eV=Be("Dot",JB);/**
|
133
|
+
* @license lucide-react v0.483.0 - ISC
|
134
|
+
*
|
135
|
+
* This source code is licensed under the ISC license.
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
137
|
+
*/const tV=[["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"}]],nN=Be("ExternalLink",tV);/**
|
138
|
+
* @license lucide-react v0.483.0 - ISC
|
139
|
+
*
|
140
|
+
* This source code is licensed under the ISC license.
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
142
|
+
*/const nV=[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]],rV=Be("FilePen",nV);/**
|
143
|
+
* @license lucide-react v0.483.0 - ISC
|
144
|
+
*
|
145
|
+
* This source code is licensed under the ISC license.
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
147
|
+
*/const sV=[["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"}]],oV=Be("File",sV);/**
|
148
|
+
* @license lucide-react v0.483.0 - ISC
|
149
|
+
*
|
150
|
+
* This source code is licensed under the ISC license.
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
152
|
+
*/const iV=[["path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4",key:"1nerag"}],["path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88",key:"o46ks0"}],["path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02",key:"ptglia"}],["path",{d:"M2 12a10 10 0 0 1 18-6",key:"ydlgp0"}],["path",{d:"M2 16h.01",key:"1gqxmh"}],["path",{d:"M21.8 16c.2-2 .131-5.354 0-6",key:"drycrb"}],["path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2",key:"1tidbn"}],["path",{d:"M8.65 22c.21-.66.45-1.32.57-2",key:"13wd9y"}],["path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2",key:"1fr1j5"}]],aV=Be("Fingerprint",iV);/**
|
153
|
+
* @license lucide-react v0.483.0 - ISC
|
154
|
+
*
|
155
|
+
* This source code is licensed under the ISC license.
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
157
|
+
*/const lV=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["line",{x1:"6",x2:"6",y1:"9",y2:"21",key:"rroup"}]],cV=Be("GitPullRequest",lV);/**
|
158
|
+
* @license lucide-react v0.483.0 - ISC
|
159
|
+
*
|
160
|
+
* This source code is licensed under the ISC license.
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
162
|
+
*/const uV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Zb=Be("Globe",uV);/**
|
163
|
+
* @license lucide-react v0.483.0 - ISC
|
164
|
+
*
|
165
|
+
* This source code is licensed under the ISC license.
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
167
|
+
*/const dV=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],rN=Be("House",dV);/**
|
168
|
+
* @license lucide-react v0.483.0 - ISC
|
169
|
+
*
|
170
|
+
* This source code is licensed under the ISC license.
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
172
|
+
*/const fV=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],hV=Be("Info",fV);/**
|
173
|
+
* @license lucide-react v0.483.0 - ISC
|
174
|
+
*
|
175
|
+
* This source code is licensed under the ISC license.
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
177
|
+
*/const pV=[["path",{d:"M20 10c0-4.4-3.6-8-8-8s-8 3.6-8 8 3.6 8 8 8h8",key:"4znkd0"}],["polyline",{points:"16 14 20 18 16 22",key:"11njsm"}]],mV=Be("IterationCcw",pV);/**
|
178
|
+
* @license lucide-react v0.483.0 - ISC
|
179
|
+
*
|
180
|
+
* This source code is licensed under the ISC license.
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
182
|
+
*/const gV=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],sN=Be("KeyRound",gV);/**
|
183
|
+
* @license lucide-react v0.483.0 - ISC
|
184
|
+
*
|
185
|
+
* This source code is licensed under the ISC license.
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
187
|
+
*/const vV=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],yV=Be("Link",vV);/**
|
188
|
+
* @license lucide-react v0.483.0 - ISC
|
189
|
+
*
|
190
|
+
* This source code is licensed under the ISC license.
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
192
|
+
*/const bV=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],up=Be("Lock",bV);/**
|
193
|
+
* @license lucide-react v0.483.0 - ISC
|
194
|
+
*
|
195
|
+
* This source code is licensed under the ISC license.
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
197
|
+
*/const xV=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],wV=Be("LogOut",xV);/**
|
198
|
+
* @license lucide-react v0.483.0 - ISC
|
199
|
+
*
|
200
|
+
* This source code is licensed under the ISC license.
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
202
|
+
*/const _V=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]],EV=Be("Mail",_V);/**
|
203
|
+
* @license lucide-react v0.483.0 - ISC
|
204
|
+
*
|
205
|
+
* This source code is licensed under the ISC license.
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
207
|
+
*/const SV=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],CV=Be("Package",SV);/**
|
208
|
+
* @license lucide-react v0.483.0 - ISC
|
209
|
+
*
|
210
|
+
* This source code is licensed under the ISC license.
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
212
|
+
*/const TV=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],RV=Be("Plus",TV);/**
|
213
|
+
* @license lucide-react v0.483.0 - ISC
|
214
|
+
*
|
215
|
+
* This source code is licensed under the ISC license.
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
217
|
+
*/const NV=[["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"}]],PV=Be("RefreshCw",NV);/**
|
218
|
+
* @license lucide-react v0.483.0 - ISC
|
219
|
+
*
|
220
|
+
* This source code is licensed under the ISC license.
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
222
|
+
*/const jV=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],AV=Be("Search",jV);/**
|
223
|
+
* @license lucide-react v0.483.0 - ISC
|
224
|
+
*
|
225
|
+
* This source code is licensed under the ISC license.
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
227
|
+
*/const $V=[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],DV=Be("Settings2",$V);/**
|
228
|
+
* @license lucide-react v0.483.0 - ISC
|
229
|
+
*
|
230
|
+
* This source code is licensed under the ISC license.
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
232
|
+
*/const kV=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],q_=Be("Settings",kV);/**
|
233
|
+
* @license lucide-react v0.483.0 - ISC
|
234
|
+
*
|
235
|
+
* This source code is licensed under the ISC license.
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
237
|
+
*/const OV=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 7v10",key:"d5nglc"}],["path",{d:"M11 7v10",key:"pptsnr"}],["path",{d:"m15 7 2 10",key:"1m7qm5"}]],MV=Be("SquareLibrary",OV);/**
|
238
|
+
* @license lucide-react v0.483.0 - ISC
|
239
|
+
*
|
240
|
+
* This source code is licensed under the ISC license.
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
242
|
+
*/const IV=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],FV=Be("SquareTerminal",IV);/**
|
243
|
+
* @license lucide-react v0.483.0 - ISC
|
244
|
+
*
|
245
|
+
* This source code is licensed under the ISC license.
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
247
|
+
*/const LV=[["path",{d:"M12 3c7.2 0 9 1.8 9 9s-1.8 9-9 9-9-1.8-9-9 1.8-9 9-9",key:"garfkc"}]],UV=Be("Squircle",LV);/**
|
248
|
+
* @license lucide-react v0.483.0 - ISC
|
249
|
+
*
|
250
|
+
* This source code is licensed under the ISC license.
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
252
|
+
*/const BV=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],VV=Be("ThumbsDown",BV);/**
|
253
|
+
* @license lucide-react v0.483.0 - ISC
|
254
|
+
*
|
255
|
+
* This source code is licensed under the ISC license.
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
257
|
+
*/const zV=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]],dp=Be("Trash",zV);/**
|
258
|
+
* @license lucide-react v0.483.0 - ISC
|
259
|
+
*
|
260
|
+
* This source code is licensed under the ISC license.
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
262
|
+
*/const WV=[["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"}]],qV=Be("User",WV);/**
|
263
|
+
* @license lucide-react v0.483.0 - ISC
|
264
|
+
*
|
265
|
+
* This source code is licensed under the ISC license.
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
267
|
+
*/const HV=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],GV=Be("UsersRound",HV);/**
|
268
|
+
* @license lucide-react v0.483.0 - ISC
|
269
|
+
*
|
270
|
+
* This source code is licensed under the ISC license.
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
272
|
+
*/const KV=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],aa=Be("X",KV);var fp="Collapsible",[YV,Goe]=Vr(fp),[ZV,Qb]=YV(fp),oN=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:o,onOpenChange:i,...a}=e,[l,c]=Ys({prop:r,defaultProp:s??!1,onChange:i,caller:fp});return d.jsx(ZV,{scope:n,disabled:o,contentId:fn(),open:l,onOpenToggle:h.useCallback(()=>c(u=>!u),[c]),children:d.jsx($e.div,{"data-state":Jb(l),"data-disabled":o?"":void 0,...a,ref:t})})});oN.displayName=fp;var iN="CollapsibleTrigger",aN=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=Qb(iN,n);return d.jsx($e.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Jb(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:me(e.onClick,s.onOpenToggle)})});aN.displayName=iN;var Xb="CollapsibleContent",lN=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=Qb(Xb,e.__scopeCollapsible);return d.jsx(zr,{present:n||s.open,children:({present:o})=>d.jsx(QV,{...r,ref:t,present:o})})});lN.displayName=Xb;var QV=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...o}=e,i=Qb(Xb,n),[a,l]=h.useState(r),c=h.useRef(null),u=tt(t,c),f=h.useRef(0),p=f.current,g=h.useRef(0),y=g.current,m=i.open||a,v=h.useRef(m),b=h.useRef(void 0);return h.useEffect(()=>{const x=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(x)},[]),nn(()=>{const x=c.current;if(x){b.current=b.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const w=x.getBoundingClientRect();f.current=w.height,g.current=w.width,v.current||(x.style.transitionDuration=b.current.transitionDuration,x.style.animationName=b.current.animationName),l(r)}},[i.open,r]),d.jsx($e.div,{"data-state":Jb(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!m,...o,ref:u,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:m&&s})});function Jb(e){return e?"open":"closed"}var XV=oN;const JV=XV,e5=aN,t5=lN,n5=Wr("",{variants:{variant:{default:"cursor-pointer text-indigo-600 hover:underline",neutral:"cursor-pointer hover:underline",ghost:"cursor-pointer hover:no-underline"},showIcon:{true:"inline-flex items-center gap-x-1"}},defaultVariants:{variant:"default"}}),xt=({className:e,variant:t,showIcon:n,children:r,...s})=>d.jsxs("a",{target:"_blank",rel:"noreferrer",className:se(n5({variant:t,showIcon:n,className:e})),...s,children:[r,n&&d.jsx(nN,{className:"size-[1em]"})]}),r5=({error:e,eventId:t})=>{var p;let n,r,s="N/A",o=e.message,i,a;(e instanceof gs||e instanceof tr)&&(n=e.type,r=e.message,s=e.status??s,o=e.detail,i=e.instance,a=e.traceId),r||(r="Oh zup! Something went wrong.");const l=void 0,c=n??`https://zuplo.com/docs/search?q=${r.replaceAll(" ","+")}`,u=n&&hB.includes(n);o||(s===403?o="It looks like you might not have permission to access this resources.":s===404?o="We can't find this. If you believe this is a mistake let us know.":o="An error has occurred. If the problem persists let us know.");const f=(p=e==null?void 0:e.stack)==null?void 0:p.split(`
|
273
|
+
`).splice(0,5).join(`
|
274
|
+
`);return d.jsxs("div",{className:"flex flex-col w-full mx-auto max-w-[800px] justify-center gap-4 items-center bg-white p-8",children:[d.jsxs("main",{className:"flex flex-col gap-10",children:[d.jsx(cp,{className:"self-center flex-shrink-0 w-14 h-14 text-pink-600"}),d.jsxs("div",{className:"text-center",children:[d.jsxs("p",{className:"text-base font-semibold text-pink-600",children:["Status: ",s]}),d.jsx("h1",{className:"mt-2 text-2xl font-medium text-pink-600",children:r}),d.jsx("p",{className:"mt-2 text-base",children:o}),d.jsxs("div",{className:"mt-6 flex items-center justify-center gap-x-2",children:[d.jsx(xt,{href:c,children:"Search docs for error"}),d.jsx("span",{"aria-hidden":"true",children:" ·"}),d.jsx(xt,{href:"https://status.zuplo.com/",children:"Check the status page"})]})]}),!u&&d.jsxs(JV,{className:"flex flex-col",children:[d.jsx(e5,{className:"mb-2",children:d.jsxs(Fe,{variant:"ghost",children:["Technical Details ",d.jsx(lp,{size:18})]})}),d.jsx(t5,{children:d.jsxs("div",{className:"border rounded border-solid grid grid-cols-[min-content_1fr] gap-x-3 gap-y-1.5 p-4 text-sm",children:[d.jsx("div",{children:"Timestamp:"}),d.jsx("div",{children:new Date().toISOString()}),l,a&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"Trace ID:"}),d.jsx("div",{children:a})]}),t&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"Event ID:"}),d.jsx("div",{children:t})]}),n&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"Type:"}),d.jsx("a",{className:"underline",href:n,target:"_blank",children:n})]}),i&&d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"Instance:"}),d.jsx("div",{children:i})]}),d.jsxs(d.Fragment,{children:[d.jsx("div",{children:"URL:"}),d.jsx("div",{className:"break-all",children:window.location.pathname+window.location.search})]}),d.jsx("div",{children:"Stacktrace:"}),d.jsx("pre",{className:"bg-gray-100 rounded overflow-scroll p-2",children:f})]})})]})]}),d.jsx("div",{className:"self-center",children:d.jsxs("div",{className:"flex justify-center space-x-4",children:[d.jsx(Fe,{asChild:!0,children:d.jsxs("a",{href:"/",children:[d.jsx(rN,{className:"w-4 h-4 mr-2 text-base"}),"Go Home"]})}),d.jsx(Fe,{className:"px-c4 py-2 text-base",variant:"white",asChild:!0,children:d.jsxs("a",{target:"_blank",href:`mailto:${Gv}`,rel:"noreferrer",children:[d.jsx(EV,{className:"w-4 h-4 mr-2"})," Email Support"]})}),d.jsx(JR,{text:"Chat on Discord"})]})})]})};/**
|
275
|
+
* react-router v7.9.1
|
276
|
+
*
|
277
|
+
* Copyright (c) Remix Software Inc.
|
278
|
+
*
|
279
|
+
* This source code is licensed under the MIT license found in the
|
280
|
+
* LICENSE.md file in the root directory of this source tree.
|
281
|
+
*
|
282
|
+
* @license MIT
|
283
|
+
*/var cN=e=>{throw TypeError(e)},s5=(e,t,n)=>t.has(e)||cN("Cannot "+n),Im=(e,t,n)=>(s5(e,t,"read from private field"),n?n.call(e):t.get(e)),o5=(e,t,n)=>t.has(e)?cN("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),H_="popstate";function i5(e={}){function t(r,s){let{pathname:o,search:i,hash:a}=r.location;return _u("",{pathname:o,search:i,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Yo(s)}return l5(t,n,null,e)}function He(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Tt(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function a5(){return Math.random().toString(36).substring(2,10)}function G_(e,t){return{usr:e.state,key:e.key,idx:t}}function _u(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ii(t):t,state:n,key:t&&t.key||r||a5()}}function Yo({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ii(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function l5(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,a="POP",l=null,c=u();c==null&&(c=0,i.replaceState({...i.state,idx:c},""));function u(){return(i.state||{idx:null}).idx}function f(){a="POP";let v=u(),b=v==null?null:v-c;c=v,l&&l({action:a,location:m.location,delta:b})}function p(v,b){a="PUSH";let x=_u(m.location,v,b);c=u()+1;let w=G_(x,c),_=m.createHref(x);try{i.pushState(w,"",_)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(_)}o&&l&&l({action:a,location:m.location,delta:1})}function g(v,b){a="REPLACE";let x=_u(m.location,v,b);c=u();let w=G_(x,c),_=m.createHref(x);i.replaceState(w,"",_),o&&l&&l({action:a,location:m.location,delta:0})}function y(v){return uN(v)}let m={get action(){return a},get location(){return e(s,i)},listen(v){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(H_,f),l=v,()=>{s.removeEventListener(H_,f),l=null}},createHref(v){return t(s,v)},createURL:y,encodeLocation(v){let b=y(v);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:p,replace:g,go(v){return i.go(v)}};return m}function uN(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),He(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Yo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Vc,K_=class{constructor(e){if(o5(this,Vc,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Im(this,Vc).has(e))return Im(this,Vc).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Im(this,Vc).set(e,t)}};Vc=new WeakMap;var c5=new Set(["lazy","caseSensitive","path","id","index","children"]);function u5(e){return c5.has(e)}var d5=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function f5(e){return d5.has(e)}function h5(e){return e.index===!0}function Eu(e,t,n=[],r={},s=!1){return e.map((o,i)=>{let a=[...n,String(i)],l=typeof o.id=="string"?o.id:a.join("-");if(He(o.index!==!0||!o.children,"Cannot specify children on an index route"),He(s||!r[l],`Found a route id collision on id "${l}". Route id's must be globally unique within Data Router usages`),h5(o)){let c={...o,...t(o),id:l};return r[l]=c,c}else{let c={...o,...t(o),id:l,children:void 0};return r[l]=c,o.children&&(c.children=Eu(o.children,t,a,r,s)),c}})}function bo(e,t,n="/"){return Rf(e,t,n,!1)}function Rf(e,t,n,r){let s=typeof t=="string"?ii(t):t,o=Er(s.pathname||"/",n);if(o==null)return null;let i=dN(e);m5(i);let a=null;for(let l=0;a==null&&l<i.length;++l){let c=T5(o);a=S5(i[l],c,r)}return a}function p5(e,t){let{route:n,pathname:r,params:s}=e;return{id:n.id,pathname:r,params:s,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function dN(e,t=[],n=[],r="",s=!1){let o=(i,a,l=s,c)=>{let u={relativePath:c===void 0?i.path||"":c,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(r)&&l)return;He(u.relativePath.startsWith(r),`Absolute route path "${u.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(r.length)}let f=as([r,u.relativePath]),p=n.concat(u);i.children&&i.children.length>0&&(He(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),dN(i.children,t,p,f,l)),!(i.path==null&&!i.index)&&t.push({path:f,score:_5(f,i.index),routesMeta:p})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let c of fN(i.path))o(i,a,!0,c)}),t}function fN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let i=fN(r.join("/")),a=[];return a.push(...i.map(l=>l===""?o:[o,l].join("/"))),s&&a.push(...i),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function m5(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:E5(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var g5=/^:[\w-]+$/,v5=3,y5=2,b5=1,x5=10,w5=-2,Y_=e=>e==="*";function _5(e,t){let n=e.split("/"),r=n.length;return n.some(Y_)&&(r+=w5),t&&(r+=y5),n.filter(s=>!Y_(s)).reduce((s,o)=>s+(g5.test(o)?v5:o===""?b5:x5),r)}function E5(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function S5(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",i=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",f=ah({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),p=l.route;if(!f&&c&&n&&!r[r.length-1].route.index&&(f=ah({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!f)return null;Object.assign(s,f.params),i.push({params:s,pathname:as([o,f.pathname]),pathnameBase:j5(as([o,f.pathnameBase])),route:p}),f.pathnameBase!=="/"&&(o=as([o,f.pathnameBase]))}return i}function Zs(e,t={}){let n=e;n.endsWith("*")&&n!=="*"&&!n.endsWith("/*")&&(Tt(!1,`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`),n=n.replace(/\*$/,"/*"));const r=n.startsWith("/")?"/":"",s=i=>i==null?"":typeof i=="string"?i:String(i),o=n.split(/\/+/).map((i,a,l)=>{if(a===l.length-1&&i==="*")return s(t["*"]);const u=i.match(/^:([\w-]+)(\??)$/);if(u){const[,f,p]=u;let g=t[f];return He(p==="?"||g!=null,`Missing ":${f}" param`),encodeURIComponent(s(g))}return i.replace(/\?$/g,"")}).filter(i=>!!i);return r+o.join("/")}function ah(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=C5(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((c,{paramName:u,isOptional:f},p)=>{if(u==="*"){let y=a[p]||"";i=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const g=a[p];return f&&!g?c[u]=void 0:c[u]=(g||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function C5(e,t=!1,n=!0){Tt(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function T5(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Tt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Er(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function R5({basename:e,pathname:t}){return t==="/"?e:as([e,t])}function N5(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?ii(e):e;return{pathname:n?n.startsWith("/")?n:P5(n,t):t,search:A5(r),hash:$5(s)}}function P5(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Fm(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function hN(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function hp(e){let t=hN(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function pp(e,t,n,r=!1){let s;typeof e=="string"?s=ii(e):(s={...e},He(!s.pathname||!s.pathname.includes("?"),Fm("?","pathname","search",s)),He(!s.pathname||!s.pathname.includes("#"),Fm("#","pathname","hash",s)),He(!s.search||!s.search.includes("#"),Fm("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),f-=1;s.pathname=p.join("/")}a=f>=0?t[f]:"/"}let l=N5(s,a),c=i&&i!=="/"&&i.endsWith("/"),u=(o||i===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var as=e=>e.join("/").replace(/\/\/+/g,"/"),j5=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),A5=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,$5=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,lh=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Su(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var pN=["POST","PUT","PATCH","DELETE"],D5=new Set(pN),k5=["GET",...pN],O5=new Set(k5),M5=new Set([301,302,303,307,308]),I5=new Set([307,308]),Lm={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},F5={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},xc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},L5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ex=e=>L5.test(e),U5=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),mN="remix-router-transitions",gN=Symbol("ResetLoaderData");function B5(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";He(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||U5,o={},i=Eu(e.routes,s,void 0,o),a,l=e.basename||"/";l.startsWith("/")||(l=`/${l}`);let c=e.dataStrategy||H5,u={...e.future},f=null,p=new Set,g=null,y=null,m=null,v=e.hydrationData!=null,b=bo(i,e.history.location,l),x=!1,w=null,_;if(b==null&&!e.patchRoutesOnNavigation){let D=gr(404,{pathname:e.history.location.pathname}),{matches:B,route:q}=Zd(i);_=!0,b=B,w={[q.id]:D}}else if(b&&!e.hydrationData&&jd(b,i,e.history.location.pathname).active&&(b=null),b)if(b.some(D=>D.route.lazy))_=!1;else if(!b.some(D=>D.route.loader))_=!0;else{let D=e.hydrationData?e.hydrationData.loaderData:null,B=e.hydrationData?e.hydrationData.errors:null;if(B){let q=b.findIndex(oe=>B[oe.route.id]!==void 0);_=b.slice(0,q+1).every(oe=>!Zv(oe.route,D,B))}else _=b.every(q=>!Zv(q.route,D,B))}else{_=!1,b=[];let D=jd(null,i,e.history.location.pathname);D.active&&D.matches&&(x=!0,b=D.matches)}let E,S={historyAction:e.history.action,location:e.history.location,matches:b,initialized:_,navigation:Lm,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||w,fetchers:new Map,blockers:new Map},R="POP",C=!1,N,k=!1,V=new Map,L=null,G=!1,$=!1,I=new Set,j=new Map,F=0,O=-1,U=new Map,Y=new Set,ee=new Map,M=new Map,Q=new Set,H=new Map,K,ae=null;function te(){if(f=e.history.listen(({action:D,location:B,delta:q})=>{if(K){K(),K=void 0;return}Tt(H.size===0||q!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let oe=dc({currentLocation:S.location,nextLocation:B,historyAction:D});if(oe&&q!=null){let de=new Promise(je=>{K=je});e.history.go(q*-1),Ta(oe,{state:"blocked",location:B,proceed(){Ta(oe,{state:"proceeding",proceed:void 0,reset:void 0,location:B}),de.then(()=>e.history.go(q))},reset(){let je=new Map(S.blockers);je.set(oe,xc),ue({blockers:je})}});return}return lt(D,B)}),n){a3(t,V);let D=()=>l3(t,V);t.addEventListener("pagehide",D),L=()=>t.removeEventListener("pagehide",D)}return S.initialized||lt("POP",S.location,{initialHydration:!0}),E}function Re(){f&&f(),L&&L(),p.clear(),N&&N.abort(),S.fetchers.forEach((D,B)=>Xe(B)),S.blockers.forEach((D,B)=>uc(B))}function Ce(D){return p.add(D),()=>p.delete(D)}function ue(D,B={}){D.matches&&(D.matches=D.matches.map(de=>{let je=o[de.route.id],Ae=de.route;return Ae.element!==je.element||Ae.errorElement!==je.errorElement||Ae.hydrateFallbackElement!==je.hydrateFallbackElement?{...de,route:je}:de})),S={...S,...D};let q=[],oe=[];S.fetchers.forEach((de,je)=>{de.state==="idle"&&(Q.has(je)?q.push(je):oe.push(je))}),Q.forEach(de=>{!S.fetchers.has(de)&&!j.has(de)&&q.push(de)}),[...p].forEach(de=>de(S,{deletedFetchers:q,viewTransitionOpts:B.viewTransitionOpts,flushSync:B.flushSync===!0})),q.forEach(de=>Xe(de)),oe.forEach(de=>S.fetchers.delete(de))}function ge(D,B,{flushSync:q}={}){var Me,Pe;let oe=S.actionData!=null&&S.navigation.formMethod!=null&&Un(S.navigation.formMethod)&&S.navigation.state==="loading"&&((Me=D.state)==null?void 0:Me._isRedirect)!==!0,de;B.actionData?Object.keys(B.actionData).length>0?de=B.actionData:de=null:oe?de=S.actionData:de=null;let je=B.loaderData?oE(S.loaderData,B.loaderData,B.matches||[],B.errors):S.loaderData,Ae=S.blockers;Ae.size>0&&(Ae=new Map(Ae),Ae.forEach((qe,dt)=>Ae.set(dt,xc)));let Ne=G?!1:ew(D,B.matches||S.matches),De=C===!0||S.navigation.formMethod!=null&&Un(S.navigation.formMethod)&&((Pe=D.state)==null?void 0:Pe._isRedirect)!==!0;a&&(i=a,a=void 0),G||R==="POP"||(R==="PUSH"?e.history.push(D,D.state):R==="REPLACE"&&e.history.replace(D,D.state));let Le;if(R==="POP"){let qe=V.get(S.location.pathname);qe&&qe.has(D.pathname)?Le={currentLocation:S.location,nextLocation:D}:V.has(D.pathname)&&(Le={currentLocation:D,nextLocation:S.location})}else if(k){let qe=V.get(S.location.pathname);qe?qe.add(D.pathname):(qe=new Set([D.pathname]),V.set(S.location.pathname,qe)),Le={currentLocation:S.location,nextLocation:D}}ue({...B,actionData:de,loaderData:je,historyAction:R,location:D,initialized:!0,navigation:Lm,revalidation:"idle",restoreScrollPosition:Ne,preventScrollReset:De,blockers:Ae},{viewTransitionOpts:Le,flushSync:q===!0}),R="POP",C=!1,k=!1,G=!1,$=!1,ae==null||ae.resolve(),ae=null}async function ke(D,B){if(typeof D=="number"){e.history.go(D);return}let q=Yv(S.location,S.matches,l,D,B==null?void 0:B.fromRouteId,B==null?void 0:B.relative),{path:oe,submission:de,error:je}=Z_(!1,q,B),Ae=S.location,Ne=_u(S.location,oe,B&&B.state);Ne={...Ne,...e.history.encodeLocation(Ne)};let De=B&&B.replace!=null?B.replace:void 0,Le="PUSH";De===!0?Le="REPLACE":De===!1||de!=null&&Un(de.formMethod)&&de.formAction===S.location.pathname+S.location.search&&(Le="REPLACE");let Me=B&&"preventScrollReset"in B?B.preventScrollReset===!0:void 0,Pe=(B&&B.flushSync)===!0,qe=dc({currentLocation:Ae,nextLocation:Ne,historyAction:Le});if(qe){Ta(qe,{state:"blocked",location:Ne,proceed(){Ta(qe,{state:"proceeding",proceed:void 0,reset:void 0,location:Ne}),ke(D,B)},reset(){let dt=new Map(S.blockers);dt.set(qe,xc),ue({blockers:dt})}});return}await lt(Le,Ne,{submission:de,pendingError:je,preventScrollReset:Me,replace:B&&B.replace,enableViewTransition:B&&B.viewTransition,flushSync:Pe})}function Ze(){ae||(ae=c3()),ve(),ue({revalidation:"loading"});let D=ae.promise;return S.navigation.state==="submitting"?D:S.navigation.state==="idle"?(lt(S.historyAction,S.location,{startUninterruptedRevalidation:!0}),D):(lt(R||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation,enableViewTransition:k===!0}),D)}async function lt(D,B,q){N&&N.abort(),N=null,R=D,G=(q&&q.startUninterruptedRevalidation)===!0,mM(S.location,S.matches),C=(q&&q.preventScrollReset)===!0,k=(q&&q.enableViewTransition)===!0;let oe=a||i,de=q&&q.overrideNavigation,je=q!=null&&q.initialHydration&&S.matches&&S.matches.length>0&&!x?S.matches:bo(oe,B,l),Ae=(q&&q.flushSync)===!0;if(je&&S.initialized&&!$&&e3(S.location,B)&&!(q&&q.submission&&Un(q.submission.formMethod))){ge(B,{matches:je},{flushSync:Ae});return}let Ne=jd(je,oe,B.pathname);if(Ne.active&&Ne.matches&&(je=Ne.matches),!je){let{error:Tn,notFoundMatches:wt,route:pt}=um(B.pathname);ge(B,{matches:wt,loaderData:{},errors:{[pt.id]:Tn}},{flushSync:Ae});return}N=new AbortController;let De=Ua(e.history,B,N.signal,q&&q.submission),Le=e.getContext?await e.getContext():new K_,Me;if(q&&q.pendingError)Me=[xo(je).route.id,{type:"error",error:q.pendingError}];else if(q&&q.submission&&Un(q.submission.formMethod)){let Tn=await lr(De,B,q.submission,je,Le,Ne.active,q&&q.initialHydration===!0,{replace:q.replace,flushSync:Ae});if(Tn.shortCircuited)return;if(Tn.pendingActionResult){let[wt,pt]=Tn.pendingActionResult;if(Kn(pt)&&Su(pt.error)&&pt.error.status===404){N=null,ge(B,{matches:Tn.matches,loaderData:{},errors:{[wt]:pt.error}});return}}je=Tn.matches||je,Me=Tn.pendingActionResult,de=Um(B,q.submission),Ae=!1,Ne.active=!1,De=Ua(e.history,De.url,De.signal)}let{shortCircuited:Pe,matches:qe,loaderData:dt,errors:Xt}=await Gn(De,B,je,Le,Ne.active,de,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,Ae,Me);Pe||(N=null,ge(B,{matches:qe||je,...iE(Me),loaderData:dt,errors:Xt}))}async function lr(D,B,q,oe,de,je,Ae,Ne={}){ve();let De=o3(B,q);if(ue({navigation:De},{flushSync:Ne.flushSync===!0}),je){let Pe=await Ad(oe,B.pathname,D.signal);if(Pe.type==="aborted")return{shortCircuited:!0};if(Pe.type==="error"){if(Pe.partialMatches.length===0){let{matches:dt,route:Xt}=Zd(i);return{matches:dt,pendingActionResult:[Xt.id,{type:"error",error:Pe.error}]}}let qe=xo(Pe.partialMatches).route.id;return{matches:Pe.partialMatches,pendingActionResult:[qe,{type:"error",error:Pe.error}]}}else if(Pe.matches)oe=Pe.matches;else{let{notFoundMatches:qe,error:dt,route:Xt}=um(B.pathname);return{matches:qe,pendingActionResult:[Xt.id,{type:"error",error:dt}]}}}let Le,Me=Nf(oe,B);if(!Me.route.action&&!Me.route.lazy)Le={type:"error",error:gr(405,{method:D.method,pathname:B.pathname,routeId:Me.route.id})};else{let Pe=sl(s,o,D,oe,Me,Ae?[]:r,de),qe=await z(D,Pe,de,null);if(Le=qe[Me.route.id],!Le){for(let dt of oe)if(qe[dt.route.id]){Le=qe[dt.route.id];break}}if(D.signal.aborted)return{shortCircuited:!0}}if(Di(Le)){let Pe;return Ne&&Ne.replace!=null?Pe=Ne.replace:Pe=nE(Le.response.headers.get("Location"),new URL(D.url),l)===S.location.pathname+S.location.search,await A(D,Le,!0,{submission:q,replace:Pe}),{shortCircuited:!0}}if(Kn(Le)){let Pe=xo(oe,Me.route.id);return(Ne&&Ne.replace)!==!0&&(R="PUSH"),{matches:oe,pendingActionResult:[Pe.route.id,Le,Me.route.id]}}return{matches:oe,pendingActionResult:[Me.route.id,Le]}}async function Gn(D,B,q,oe,de,je,Ae,Ne,De,Le,Me,Pe){let qe=je||Um(B,Ae),dt=Ae||Ne||lE(qe),Xt=!G&&!Le;if(de){if(Xt){let gn=Cn(Pe);ue({navigation:qe,...gn!==void 0?{actionData:gn}:{}},{flushSync:Me})}let nt=await Ad(q,B.pathname,D.signal);if(nt.type==="aborted")return{shortCircuited:!0};if(nt.type==="error"){if(nt.partialMatches.length===0){let{matches:Ra,route:gi}=Zd(i);return{matches:Ra,loaderData:{},errors:{[gi.id]:nt.error}}}let gn=xo(nt.partialMatches).route.id;return{matches:nt.partialMatches,loaderData:{},errors:{[gn]:nt.error}}}else if(nt.matches)q=nt.matches;else{let{error:gn,notFoundMatches:Ra,route:gi}=um(B.pathname);return{matches:Ra,loaderData:{},errors:{[gi.id]:gn}}}}let Tn=a||i,{dsMatches:wt,revalidatingFetchers:pt}=Q_(D,oe,s,o,e.history,S,q,dt,B,Le?[]:r,Le===!0,$,I,Q,ee,Y,Tn,l,e.patchRoutesOnNavigation!=null,Pe);if(O=++F,!e.dataStrategy&&!wt.some(nt=>nt.shouldLoad)&&!wt.some(nt=>nt.route.middleware)&&pt.length===0){let nt=Sa();return ge(B,{matches:q,loaderData:{},errors:Pe&&Kn(Pe[1])?{[Pe[0]]:Pe[1].error}:null,...iE(Pe),...nt?{fetchers:new Map(S.fetchers)}:{}},{flushSync:Me}),{shortCircuited:!0}}if(Xt){let nt={};if(!de){nt.navigation=qe;let gn=Cn(Pe);gn!==void 0&&(nt.actionData=gn)}pt.length>0&&(nt.fetchers=cc(pt)),ue(nt,{flushSync:Me})}pt.forEach(nt=>{ht(nt.key),nt.controller&&j.set(nt.key,nt.controller)});let pi=()=>pt.forEach(nt=>ht(nt.key));N&&N.signal.addEventListener("abort",pi);let{loaderResults:fc,fetcherResults:so}=await Z(wt,pt,D,oe);if(D.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",pi),pt.forEach(nt=>j.delete(nt.key));let Zr=Qd(fc);if(Zr)return await A(D,Zr.result,!0,{replace:De}),{shortCircuited:!0};if(Zr=Qd(so),Zr)return Y.add(Zr.key),await A(D,Zr.result,!0,{replace:De}),{shortCircuited:!0};let{loaderData:dm,errors:hc}=sE(S,q,fc,Pe,pt,so);Le&&S.errors&&(hc={...S.errors,...hc});let mi=Sa(),$d=Ca(O),Dd=mi||$d||pt.length>0;return{matches:q,loaderData:dm,errors:hc,...Dd?{fetchers:new Map(S.fetchers)}:{}}}function Cn(D){if(D&&!Kn(D[1]))return{[D[0]]:D[1].data};if(S.actionData)return Object.keys(S.actionData).length===0?null:S.actionData}function cc(D){return D.forEach(B=>{let q=S.fetchers.get(B.key),oe=wc(void 0,q?q.data:void 0);S.fetchers.set(B.key,oe)}),new Map(S.fetchers)}async function ro(D,B,q,oe){ht(D);let de=(oe&&oe.flushSync)===!0,je=a||i,Ae=Yv(S.location,S.matches,l,q,B,oe==null?void 0:oe.relative),Ne=bo(je,Ae,l),De=jd(Ne,je,Ae);if(De.active&&De.matches&&(Ne=De.matches),!Ne){ne(D,B,gr(404,{pathname:Ae}),{flushSync:de});return}let{path:Le,submission:Me,error:Pe}=Z_(!0,Ae,oe);if(Pe){ne(D,B,Pe,{flushSync:de});return}let qe=e.getContext?await e.getContext():new K_,dt=(oe&&oe.preventScrollReset)===!0;if(Me&&Un(Me.formMethod)){await X0(D,B,Le,Ne,qe,De.active,de,dt,Me);return}ee.set(D,{routeId:B,path:Le}),await Nd(D,B,Le,Ne,qe,De.active,de,dt,Me)}async function X0(D,B,q,oe,de,je,Ae,Ne,De){ve(),ee.delete(D);let Le=S.fetchers.get(D);le(D,i3(De,Le),{flushSync:Ae});let Me=new AbortController,Pe=Ua(e.history,q,Me.signal,De);if(je){let Wt=await Ad(oe,new URL(Pe.url).pathname,Pe.signal,D);if(Wt.type==="aborted")return;if(Wt.type==="error"){ne(D,B,Wt.error,{flushSync:Ae});return}else if(Wt.matches)oe=Wt.matches;else{ne(D,B,gr(404,{pathname:q}),{flushSync:Ae});return}}let qe=Nf(oe,q);if(!qe.route.action&&!qe.route.lazy){let Wt=gr(405,{method:De.formMethod,pathname:q,routeId:B});ne(D,B,Wt,{flushSync:Ae});return}j.set(D,Me);let dt=F,Xt=sl(s,o,Pe,oe,qe,r,de),wt=(await z(Pe,Xt,de,D))[qe.route.id];if(Pe.signal.aborted){j.get(D)===Me&&j.delete(D);return}if(Q.has(D)){if(Di(wt)||Kn(wt)){le(D,po(void 0));return}}else{if(Di(wt))if(j.delete(D),O>dt){le(D,po(void 0));return}else return Y.add(D),le(D,wc(De)),A(Pe,wt,!1,{fetcherSubmission:De,preventScrollReset:Ne});if(Kn(wt)){ne(D,B,wt.error);return}}let pt=S.navigation.location||S.location,pi=Ua(e.history,pt,Me.signal),fc=a||i,so=S.navigation.state!=="idle"?bo(fc,S.navigation.location,l):S.matches;He(so,"Didn't find any matches after fetcher action");let Zr=++F;U.set(D,Zr);let dm=wc(De,wt.data);S.fetchers.set(D,dm);let{dsMatches:hc,revalidatingFetchers:mi}=Q_(pi,de,s,o,e.history,S,so,De,pt,r,!1,$,I,Q,ee,Y,fc,l,e.patchRoutesOnNavigation!=null,[qe.route.id,wt]);mi.filter(Wt=>Wt.key!==D).forEach(Wt=>{let kd=Wt.key,tw=S.fetchers.get(kd),yM=wc(void 0,tw?tw.data:void 0);S.fetchers.set(kd,yM),ht(kd),Wt.controller&&j.set(kd,Wt.controller)}),ue({fetchers:new Map(S.fetchers)});let $d=()=>mi.forEach(Wt=>ht(Wt.key));Me.signal.addEventListener("abort",$d);let{loaderResults:Dd,fetcherResults:nt}=await Z(hc,mi,pi,de);if(Me.signal.aborted)return;if(Me.signal.removeEventListener("abort",$d),U.delete(D),j.delete(D),mi.forEach(Wt=>j.delete(Wt.key)),S.fetchers.has(D)){let Wt=po(wt.data);S.fetchers.set(D,Wt)}let gn=Qd(Dd);if(gn)return A(pi,gn.result,!1,{preventScrollReset:Ne});if(gn=Qd(nt),gn)return Y.add(gn.key),A(pi,gn.result,!1,{preventScrollReset:Ne});let{loaderData:Ra,errors:gi}=sE(S,so,Dd,void 0,mi,nt);Ca(Zr),S.navigation.state==="loading"&&Zr>O?(He(R,"Expected pending action"),N&&N.abort(),ge(S.navigation.location,{matches:so,loaderData:Ra,errors:gi,fetchers:new Map(S.fetchers)})):(ue({errors:gi,loaderData:oE(S.loaderData,Ra,so,gi),fetchers:new Map(S.fetchers)}),$=!1)}async function Nd(D,B,q,oe,de,je,Ae,Ne,De){let Le=S.fetchers.get(D);le(D,wc(De,Le?Le.data:void 0),{flushSync:Ae});let Me=new AbortController,Pe=Ua(e.history,q,Me.signal);if(je){let pt=await Ad(oe,new URL(Pe.url).pathname,Pe.signal,D);if(pt.type==="aborted")return;if(pt.type==="error"){ne(D,B,pt.error,{flushSync:Ae});return}else if(pt.matches)oe=pt.matches;else{ne(D,B,gr(404,{pathname:q}),{flushSync:Ae});return}}let qe=Nf(oe,q);j.set(D,Me);let dt=F,Xt=sl(s,o,Pe,oe,qe,r,de),wt=(await z(Pe,Xt,de,D))[qe.route.id];if(j.get(D)===Me&&j.delete(D),!Pe.signal.aborted){if(Q.has(D)){le(D,po(void 0));return}if(Di(wt))if(O>dt){le(D,po(void 0));return}else{Y.add(D),await A(Pe,wt,!1,{preventScrollReset:Ne});return}if(Kn(wt)){ne(D,B,wt.error);return}le(D,po(wt.data))}}async function A(D,B,q,{submission:oe,fetcherSubmission:de,preventScrollReset:je,replace:Ae}={}){B.response.headers.has("X-Remix-Revalidate")&&($=!0);let Ne=B.response.headers.get("Location");He(Ne,"Expected a Location header on the redirect Response"),Ne=nE(Ne,new URL(D.url),l);let De=_u(S.location,Ne,{_isRedirect:!0});if(n){let Xt=!1;if(B.response.headers.has("X-Remix-Reload-Document"))Xt=!0;else if(ex(Ne)){const Tn=uN(Ne,!0);Xt=Tn.origin!==t.location.origin||Er(Tn.pathname,l)==null}if(Xt){Ae?t.location.replace(Ne):t.location.assign(Ne);return}}N=null;let Le=Ae===!0||B.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Me,formAction:Pe,formEncType:qe}=S.navigation;!oe&&!de&&Me&&Pe&&qe&&(oe=lE(S.navigation));let dt=oe||de;if(I5.has(B.response.status)&&dt&&Un(dt.formMethod))await lt(Le,De,{submission:{...dt,formAction:Ne},preventScrollReset:je||C,enableViewTransition:q?k:void 0});else{let Xt=Um(De,oe);await lt(Le,De,{overrideNavigation:Xt,fetcherSubmission:de,preventScrollReset:je||C,enableViewTransition:q?k:void 0})}}async function z(D,B,q,oe){let de,je={};try{de=await K5(c,D,B,oe,q,!1)}catch(Ae){return B.filter(Ne=>Ne.shouldLoad).forEach(Ne=>{je[Ne.route.id]={type:"error",error:Ae}}),je}if(D.signal.aborted)return je;for(let[Ae,Ne]of Object.entries(de))if(r3(Ne)){let De=Ne.result;je[Ae]={type:"redirect",response:X5(De,D,Ae,B,l)}}else je[Ae]=await Q5(Ne);return je}async function Z(D,B,q,oe){let de=z(q,D,oe,null),je=Promise.all(B.map(async De=>{if(De.matches&&De.match&&De.request&&De.controller){let Me=(await z(De.request,De.matches,oe,De.key))[De.match.route.id];return{[De.key]:Me}}else return Promise.resolve({[De.key]:{type:"error",error:gr(404,{pathname:De.path})}})})),Ae=await de,Ne=(await je).reduce((De,Le)=>Object.assign(De,Le),{});return{loaderResults:Ae,fetcherResults:Ne}}function ve(){$=!0,ee.forEach((D,B)=>{j.has(B)&&I.add(B),ht(B)})}function le(D,B,q={}){S.fetchers.set(D,B),ue({fetchers:new Map(S.fetchers)},{flushSync:(q&&q.flushSync)===!0})}function ne(D,B,q,oe={}){let de=xo(S.matches,B);Xe(D),ue({errors:{[de.route.id]:q},fetchers:new Map(S.fetchers)},{flushSync:(oe&&oe.flushSync)===!0})}function Se(D){return M.set(D,(M.get(D)||0)+1),Q.has(D)&&Q.delete(D),S.fetchers.get(D)||F5}function Xe(D){let B=S.fetchers.get(D);j.has(D)&&!(B&&B.state==="loading"&&U.has(D))&&ht(D),ee.delete(D),U.delete(D),Y.delete(D),Q.delete(D),I.delete(D),S.fetchers.delete(D)}function Nt(D){let B=(M.get(D)||0)-1;B<=0?(M.delete(D),Q.add(D)):M.set(D,B),ue({fetchers:new Map(S.fetchers)})}function ht(D){let B=j.get(D);B&&(B.abort(),j.delete(D))}function Pd(D){for(let B of D){let q=Se(B),oe=po(q.data);S.fetchers.set(B,oe)}}function Sa(){let D=[],B=!1;for(let q of Y){let oe=S.fetchers.get(q);He(oe,`Expected fetcher: ${q}`),oe.state==="loading"&&(Y.delete(q),D.push(q),B=!0)}return Pd(D),B}function Ca(D){let B=[];for(let[q,oe]of U)if(oe<D){let de=S.fetchers.get(q);He(de,`Expected fetcher: ${q}`),de.state==="loading"&&(ht(q),U.delete(q),B.push(q))}return Pd(B),B.length>0}function cm(D,B){let q=S.blockers.get(D)||xc;return H.get(D)!==B&&H.set(D,B),q}function uc(D){S.blockers.delete(D),H.delete(D)}function Ta(D,B){let q=S.blockers.get(D)||xc;He(q.state==="unblocked"&&B.state==="blocked"||q.state==="blocked"&&B.state==="blocked"||q.state==="blocked"&&B.state==="proceeding"||q.state==="blocked"&&B.state==="unblocked"||q.state==="proceeding"&&B.state==="unblocked",`Invalid blocker state transition: ${q.state} -> ${B.state}`);let oe=new Map(S.blockers);oe.set(D,B),ue({blockers:oe})}function dc({currentLocation:D,nextLocation:B,historyAction:q}){if(H.size===0)return;H.size>1&&Tt(!1,"A router only supports one blocker at a time");let oe=Array.from(H.entries()),[de,je]=oe[oe.length-1],Ae=S.blockers.get(de);if(!(Ae&&Ae.state==="proceeding")&&je({currentLocation:D,nextLocation:B,historyAction:q}))return de}function um(D){let B=gr(404,{pathname:D}),q=a||i,{matches:oe,route:de}=Zd(q);return{notFoundMatches:oe,route:de,error:B}}function pM(D,B,q){if(g=D,m=B,y=q||null,!v&&S.navigation===Lm){v=!0;let oe=ew(S.location,S.matches);oe!=null&&ue({restoreScrollPosition:oe})}return()=>{g=null,m=null,y=null}}function J0(D,B){return y&&y(D,B.map(oe=>p5(oe,S.loaderData)))||D.key}function mM(D,B){if(g&&m){let q=J0(D,B);g[q]=m()}}function ew(D,B){if(g){let q=J0(D,B),oe=g[q];if(typeof oe=="number")return oe}return null}function jd(D,B,q){if(e.patchRoutesOnNavigation)if(D){if(Object.keys(D[0].params).length>0)return{active:!0,matches:Rf(B,q,l,!0)}}else return{active:!0,matches:Rf(B,q,l,!0)||[]};return{active:!1,matches:null}}async function Ad(D,B,q,oe){if(!e.patchRoutesOnNavigation)return{type:"success",matches:D};let de=D;for(;;){let je=a==null,Ae=a||i,Ne=o;try{await e.patchRoutesOnNavigation({signal:q,path:B,matches:de,fetcherKey:oe,patch:(Me,Pe)=>{q.aborted||X_(Me,Pe,Ae,Ne,s,!1)}})}catch(Me){return{type:"error",error:Me,partialMatches:de}}finally{je&&!q.aborted&&(i=[...i])}if(q.aborted)return{type:"aborted"};let De=bo(Ae,B,l);if(De)return{type:"success",matches:De};let Le=Rf(Ae,B,l,!0);if(!Le||de.length===Le.length&&de.every((Me,Pe)=>Me.route.id===Le[Pe].route.id))return{type:"success",matches:null};de=Le}}function gM(D){o={},a=Eu(D,s,void 0,o)}function vM(D,B,q=!1){let oe=a==null;X_(D,B,a||i,o,s,q),oe&&(i=[...i],ue({}))}return E={get basename(){return l},get future(){return u},get state(){return S},get routes(){return i},get window(){return t},initialize:te,subscribe:Ce,enableScrollRestoration:pM,navigate:ke,fetch:ro,revalidate:Ze,createHref:D=>e.history.createHref(D),encodeLocation:D=>e.history.encodeLocation(D),getFetcher:Se,deleteFetcher:Nt,dispose:Re,getBlocker:cm,deleteBlocker:uc,patchRoutes:vM,_internalFetchControllers:j,_internalSetRoutes:gM,_internalSetStateDoNotUseOrYouWillBreakYourApp(D){ue(D)}},E}function V5(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Yv(e,t,n,r,s,o){let i,a;if(s){i=[];for(let c of t)if(i.push(c),c.route.id===s){a=c;break}}else i=t,a=t[t.length-1];let l=pp(r||".",hp(i),Er(e.pathname,n)||e.pathname,o==="path");if(r==null&&(l.search=e.search,l.hash=e.hash),(r==null||r===""||r===".")&&a){let c=tx(l.search);if(a.route.index&&!c)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!a.route.index&&c){let u=new URLSearchParams(l.search),f=u.getAll("index");u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let p=u.toString();l.search=p?`?${p}`:""}}return n!=="/"&&(l.pathname=R5({basename:n,pathname:l.pathname})),Yo(l)}function Z_(e,t,n){if(!n||!V5(n))return{path:t};if(n.formMethod&&!s3(n.formMethod))return{path:t,error:gr(405,{method:n.formMethod})};let r=()=>({path:t,error:gr(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),i=_N(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Un(o))return r();let f=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((p,[g,y])=>`${p}${g}=${y}
|
284
|
+
`,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:i,formEncType:n.formEncType,formData:void 0,json:void 0,text:f}}}else if(n.formEncType==="application/json"){if(!Un(o))return r();try{let f=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:i,formEncType:n.formEncType,formData:void 0,json:f,text:void 0}}}catch{return r()}}}He(typeof FormData=="function","FormData is not available in this environment");let a,l;if(n.formData)a=Xv(n.formData),l=n.formData;else if(n.body instanceof FormData)a=Xv(n.body),l=n.body;else if(n.body instanceof URLSearchParams)a=n.body,l=rE(a);else if(n.body==null)a=new URLSearchParams,l=new FormData;else try{a=new URLSearchParams(n.body),l=rE(a)}catch{return r()}let c={formMethod:o,formAction:i,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(Un(c.formMethod))return{path:t,submission:c};let u=ii(t);return e&&u.search&&tx(u.search)&&a.append("index",""),u.search=`?${a}`,{path:Yo(u),submission:c}}function Q_(e,t,n,r,s,o,i,a,l,c,u,f,p,g,y,m,v,b,x,w){var G;let _=w?Kn(w[1])?w[1].error:w[1].data:void 0,E=s.createURL(o.location),S=s.createURL(l),R;if(u&&o.errors){let $=Object.keys(o.errors)[0];R=i.findIndex(I=>I.route.id===$)}else if(w&&Kn(w[1])){let $=w[0];R=i.findIndex(I=>I.route.id===$)-1}let C=w?w[1].statusCode:void 0,N=C&&C>=400,k={currentUrl:E,currentParams:((G=o.matches[0])==null?void 0:G.params)||{},nextUrl:S,nextParams:i[0].params,...a,actionResult:_,actionStatus:C},V=i.map(($,I)=>{let{route:j}=$,F=null;if(R!=null&&I>R?F=!1:j.lazy?F=!0:j.loader==null?F=!1:u?F=Zv(j,o.loaderData,o.errors):z5(o.loaderData,o.matches[I],$)&&(F=!0),F!==null)return Qv(n,r,e,$,c,t,F);let O=N?!1:f||E.pathname+E.search===S.pathname+S.search||E.search!==S.search||W5(o.matches[I],$),U={...k,defaultShouldRevalidate:O},Y=ch($,U);return Qv(n,r,e,$,c,t,Y,U)}),L=[];return y.forEach(($,I)=>{if(u||!i.some(Q=>Q.route.id===$.routeId)||g.has(I))return;let j=o.fetchers.get(I),F=j&&j.state!=="idle"&&j.data===void 0,O=bo(v,$.path,b);if(!O){if(x&&F)return;L.push({key:I,routeId:$.routeId,path:$.path,matches:null,match:null,request:null,controller:null});return}if(m.has(I))return;let U=Nf(O,$.path),Y=new AbortController,ee=Ua(s,$.path,Y.signal),M=null;if(p.has(I))p.delete(I),M=sl(n,r,ee,O,U,c,t);else if(F)f&&(M=sl(n,r,ee,O,U,c,t));else{let Q={...k,defaultShouldRevalidate:N?!1:f};ch(U,Q)&&(M=sl(n,r,ee,O,U,c,t,Q))}M&&L.push({key:I,routeId:$.routeId,path:$.path,matches:M,match:U,request:ee,controller:Y})}),{dsMatches:V,revalidatingFetchers:L}}function Zv(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&e.id in t,s=n!=null&&n[e.id]!==void 0;return!r&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!s}function z5(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function W5(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function ch(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function X_(e,t,n,r,s,o){let i;if(e){let c=r[e];He(c,`No route found to patch children into: routeId = ${e}`),c.children||(c.children=[]),i=c.children}else i=n;let a=[],l=[];if(t.forEach(c=>{let u=i.find(f=>vN(c,f));u?l.push({existingRoute:u,newRoute:c}):a.push(c)}),a.length>0){let c=Eu(a,s,[e||"_","patch",String((i==null?void 0:i.length)||"0")],r);i.push(...c)}if(o&&l.length>0)for(let c=0;c<l.length;c++){let{existingRoute:u,newRoute:f}=l[c],p=u,[g]=Eu([f],s,[],{},!0);Object.assign(p,{element:g.element?g.element:p.element,errorElement:g.errorElement?g.errorElement:p.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:p.hydrateFallbackElement})}}function vN(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var s;return(s=t.children)==null?void 0:s.some(o=>vN(n,o))}):!1}var J_=new WeakMap,yN=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(He(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let o=s.lazy[e];if(!o)return;let i=J_.get(s);i||(i={},J_.set(s,i));let a=i[e];if(a)return a;let l=(async()=>{let c=u5(e),f=s[e]!==void 0&&e!=="hasErrorBoundary";if(c)Tt(!c,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),i[e]=Promise.resolve();else if(f)Tt(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let p=await o();p!=null&&(Object.assign(s,{[e]:p}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(p=>p===void 0)&&(s.lazy=void 0))})();return i[e]=l,l},eE=new WeakMap;function q5(e,t,n,r,s){let o=n[e.id];if(He(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let u=eE.get(o);if(u)return{lazyRoutePromise:u,lazyHandlerPromise:u};let f=(async()=>{He(typeof e.lazy=="function","No lazy route function found");let p=await e.lazy(),g={};for(let y in p){let m=p[y];if(m===void 0)continue;let v=f5(y),x=o[y]!==void 0&&y!=="hasErrorBoundary";v?Tt(!v,"Route property "+y+" is not a supported property to be returned from a lazy route function. This property will be ignored."):x?Tt(!x,`Route "${o.id}" has a static property "${y}" defined but its lazy function is also returning a value for this property. The lazy route property "${y}" will be ignored.`):g[y]=m}Object.assign(o,g),Object.assign(o,{...r(o),lazy:void 0})})();return eE.set(o,f),f.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:f}}let i=Object.keys(e.lazy),a=[],l;for(let u of i){if(s&&s.includes(u))continue;let f=yN({key:u,route:e,manifest:n,mapRouteProperties:r});f&&(a.push(f),u===t&&(l=f))}let c=a.length>0?Promise.all(a).then(()=>{}):void 0;return c==null||c.catch(()=>{}),l==null||l.catch(()=>{}),{lazyRoutePromise:c,lazyHandlerPromise:l}}async function tE(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,o)=>{n[t[o].route.id]=s}),n}async function H5(e){return e.matches.some(t=>t.route.middleware)?bN(e,()=>tE(e)):tE(e)}function bN(e,t){return G5(e,t,r=>r,t3,n);function n(r,s,o){if(o)return Promise.resolve(Object.assign(o.value,{[s]:{type:"error",result:r}}));{let{matches:i}=e,a=Math.min(i.findIndex(c=>c.route.id===s)||0,i.findIndex(c=>c.unstable_shouldCallHandler())||0),l=xo(i,i[a].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:r}})}}}async function G5(e,t,n,r,s){let{matches:o,request:i,params:a,context:l}=e,c=o.flatMap(f=>f.route.middleware?f.route.middleware.map(p=>[f.route.id,p]):[]);return await xN({request:i,params:a,context:l},c,t,n,r,s)}async function xN(e,t,n,r,s,o,i=0){let{request:a}=e;if(a.signal.aborted)throw a.signal.reason??new Error(`Request aborted: ${a.method} ${a.url}`);let l=t[i];if(!l)return await n();let[c,u]=l,f,p=async()=>{if(f)throw new Error("You may only call `next()` once per middleware");try{return f={value:await xN(e,t,n,r,s,o,i+1)},f.value}catch(g){return f={value:await o(g,c,f)},f.value}};try{let g=await u(e,p),y=g!=null?r(g):void 0;return s(y)?y:f?y??f.value:(f={value:await p()},f.value)}catch(g){return await o(g,c,f)}}function wN(e,t,n,r,s){let o=yN({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),i=q5(r.route,Un(n.method)?"action":"loader",t,e,s);return{middleware:o,route:i.lazyRoutePromise,handler:i.lazyHandlerPromise}}function Qv(e,t,n,r,s,o,i,a=null){let l=!1,c=wN(e,t,n,r,s);return{...r,_lazyPromises:c,shouldLoad:i,unstable_shouldRevalidateArgs:a,unstable_shouldCallHandler(u){return l=!0,a?typeof u=="boolean"?ch(r,{...a,defaultShouldRevalidate:u}):ch(r,a):i},resolve(u){return l||i||u&&!Un(n.method)&&(r.route.lazy||r.route.loader)?Y5({request:n,match:r,lazyHandlerPromise:c==null?void 0:c.handler,lazyRoutePromise:c==null?void 0:c.route,handlerOverride:u,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function sl(e,t,n,r,s,o,i,a=null){return r.map(l=>l.route.id!==s.route.id?{...l,shouldLoad:!1,unstable_shouldRevalidateArgs:a,unstable_shouldCallHandler:()=>!1,_lazyPromises:wN(e,t,n,l,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Qv(e,t,n,l,o,i,!0,a))}async function K5(e,t,n,r,s,o){n.some(c=>{var u;return(u=c._lazyPromises)==null?void 0:u.middleware})&&await Promise.all(n.map(c=>{var u;return(u=c._lazyPromises)==null?void 0:u.middleware}));let i={request:t,params:n[0].params,context:s,matches:n},l=await e({...i,fetcherKey:r,runClientMiddleware:c=>{let u=i;return bN(u,()=>c({...u,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(c=>{var u,f;return[(u=c._lazyPromises)==null?void 0:u.handler,(f=c._lazyPromises)==null?void 0:f.route]}))}catch{}return l}async function Y5({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:s,scopedContext:o}){let i,a,l=Un(e.method),c=l?"action":"loader",u=f=>{let p,g=new Promise((v,b)=>p=b);a=()=>p(),e.signal.addEventListener("abort",a);let y=v=>typeof f!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${c}" [routeId: ${t.route.id}]`)):f({request:e,params:t.params,context:o},...v!==void 0?[v]:[]),m=(async()=>{try{return{type:"data",result:await(s?s(b=>y(b)):y())}}catch(v){return{type:"error",result:v}}})();return Promise.race([m,g])};try{let f=l?t.route.action:t.route.loader;if(n||r)if(f){let p,[g]=await Promise.all([u(f).catch(y=>{p=y}),n,r]);if(p!==void 0)throw p;i=g}else{await n;let p=l?t.route.action:t.route.loader;if(p)[i]=await Promise.all([u(p),r]);else if(c==="action"){let g=new URL(e.url),y=g.pathname+g.search;throw gr(405,{method:e.method,pathname:y,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(f)i=await u(f);else{let p=new URL(e.url),g=p.pathname+p.search;throw gr(404,{pathname:g})}}catch(f){return{type:"error",result:f}}finally{a&&e.signal.removeEventListener("abort",a)}return i}async function Z5(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Q5(e){var r,s,o,i,a,l;let{result:t,type:n}=e;if(EN(t)){let c;try{c=await Z5(t)}catch(u){return{type:"error",error:u}}return n==="error"?{type:"error",error:new lh(t.status,t.statusText,c),statusCode:t.status,headers:t.headers}:{type:"data",data:c,statusCode:t.status,headers:t.headers}}return n==="error"?aE(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new lh(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:Su(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Su(t)?t.status:void 0}:aE(t)?{type:"data",data:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function X5(e,t,n,r,s){let o=e.headers.get("Location");if(He(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!ex(o)){let i=r.slice(0,r.findIndex(a=>a.route.id===n)+1);o=Yv(new URL(t.url),i,s,o),e.headers.set("Location",o)}return e}function nE(e,t,n){if(ex(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=Er(s.pathname,n)!=null;if(s.origin===t.origin&&o)return s.pathname+s.search+s.hash}return e}function Ua(e,t,n,r){let s=e.createURL(_N(t)).toString(),o={signal:n};if(r&&Un(r.formMethod)){let{formMethod:i,formEncType:a}=r;o.method=i.toUpperCase(),a==="application/json"?(o.headers=new Headers({"Content-Type":a}),o.body=JSON.stringify(r.json)):a==="text/plain"?o.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?o.body=Xv(r.formData):o.body=r.formData}return new Request(s,o)}function Xv(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function rE(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function J5(e,t,n,r=!1,s=!1){let o={},i=null,a,l=!1,c={},u=n&&Kn(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let p=f.route.id,g=t[p];if(He(!Di(g),"Cannot handle redirect results in processLoaderData"),Kn(g)){let y=g.error;if(u!==void 0&&(y=u,u=void 0),i=i||{},s)i[p]=y;else{let m=xo(e,p);i[m.route.id]==null&&(i[m.route.id]=y)}r||(o[p]=gN),l||(l=!0,a=Su(g.error)?g.error.status:500),g.headers&&(c[p]=g.headers)}else o[p]=g.data,g.statusCode&&g.statusCode!==200&&!l&&(a=g.statusCode),g.headers&&(c[p]=g.headers)}),u!==void 0&&n&&(i={[n[0]]:u},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:i,statusCode:a||200,loaderHeaders:c}}function sE(e,t,n,r,s,o){let{loaderData:i,errors:a}=J5(t,n,r);return s.filter(l=>!l.matches||l.matches.some(c=>c.shouldLoad)).forEach(l=>{let{key:c,match:u,controller:f}=l;if(f&&f.signal.aborted)return;let p=o[c];if(He(p,"Did not find corresponding fetcher result"),Kn(p)){let g=xo(e.matches,u==null?void 0:u.route.id);a&&a[g.route.id]||(a={...a,[g.route.id]:p.error}),e.fetchers.delete(c)}else if(Di(p))He(!1,"Unhandled fetcher revalidation redirect");else{let g=po(p.data);e.fetchers.set(c,g)}}),{loaderData:i,errors:a}}function oE(e,t,n,r){let s=Object.entries(t).filter(([,o])=>o!==gN).reduce((o,[i,a])=>(o[i]=a,o),{});for(let o of n){let i=o.route.id;if(!t.hasOwnProperty(i)&&e.hasOwnProperty(i)&&o.route.loader&&(s[i]=e[i]),r&&r.hasOwnProperty(i))break}return s}function iE(e){return e?Kn(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function xo(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Zd(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function gr(e,{pathname:t,routeId:n,method:r,type:s,message:o}={}){let i="Unknown Server Error",a="Unknown @remix-run/router error";return e===400?(i="Bad Request",r&&t&&n?a=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:s==="invalid-body"&&(a="Unable to encode submission body")):e===403?(i="Forbidden",a=`Route "${n}" does not match URL "${t}"`):e===404?(i="Not Found",a=`No route matches URL "${t}"`):e===405&&(i="Method Not Allowed",r&&t&&n?a=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(a=`Invalid request method "${r.toUpperCase()}"`)),new lh(e||500,i,new Error(a),!0)}function Qd(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(Di(s))return{key:r,result:s}}}function _N(e){let t=typeof e=="string"?ii(e):e;return Yo({...t,hash:""})}function e3(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function t3(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&n3(n))}function n3(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function r3(e){return EN(e.result)&&M5.has(e.result.status)}function Kn(e){return e.type==="error"}function Di(e){return(e&&e.type)==="redirect"}function aE(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function EN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function s3(e){return O5.has(e.toUpperCase())}function Un(e){return D5.has(e.toUpperCase())}function tx(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Nf(e,t){let n=typeof t=="string"?ii(t).search:t.search;if(e[e.length-1].route.index&&tx(n||""))return e[e.length-1];let r=hN(e);return r[r.length-1]}function lE(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:o,json:i}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:i,text:void 0}}}function Um(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function o3(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function wc(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function i3(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function po(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function a3(e,t){try{let n=e.sessionStorage.getItem(mN);if(n){let r=JSON.parse(n);for(let[s,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(s,new Set(o||[]))}}catch{}}function l3(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(mN,JSON.stringify(n))}catch(r){Tt(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function c3(){let e,t,n=new Promise((r,s)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{s(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var xa=h.createContext(null);xa.displayName="DataRouter";var nd=h.createContext(null);nd.displayName="DataRouterState";h.createContext(!1);var nx=h.createContext({isTransitioning:!1});nx.displayName="ViewTransition";var SN=h.createContext(new Map);SN.displayName="Fetchers";var u3=h.createContext(null);u3.displayName="Await";var qr=h.createContext(null);qr.displayName="Navigation";var mp=h.createContext(null);mp.displayName="Location";var Tr=h.createContext({outlet:null,matches:[],isDataRoute:!1});Tr.displayName="Route";var rx=h.createContext(null);rx.displayName="RouteError";function d3(e,{relative:t}={}){He(Kl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=h.useContext(qr),{hash:s,pathname:o,search:i}=sd(e,{relative:t}),a=o;return n!=="/"&&(a=o==="/"?n:as([n,o])),r.createHref({pathname:a,search:i,hash:s})}function Kl(){return h.useContext(mp)!=null}function Hr(){return He(Kl(),"useLocation() may be used only in the context of a <Router> component."),h.useContext(mp).location}var CN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function TN(e){h.useContext(qr).static||h.useLayoutEffect(e)}function rd(){let{isDataRoute:e}=h.useContext(Tr);return e?C3():f3()}function f3(){He(Kl(),"useNavigate() may be used only in the context of a <Router> component.");let e=h.useContext(xa),{basename:t,navigator:n}=h.useContext(qr),{matches:r}=h.useContext(Tr),{pathname:s}=Hr(),o=JSON.stringify(hp(r)),i=h.useRef(!1);return TN(()=>{i.current=!0}),h.useCallback((l,c={})=>{if(Tt(i.current,CN),!i.current)return;if(typeof l=="number"){n.go(l);return}let u=pp(l,JSON.parse(o),s,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:as([t,u.pathname])),(c.replace?n.replace:n.push)(u,c.state,c)},[t,n,o,s,e])}var h3=h.createContext(null);function p3(e){let t=h.useContext(Tr).outlet;return t&&h.createElement(h3.Provider,{value:e},t)}function sx(){let{matches:e}=h.useContext(Tr),t=e[e.length-1];return t?t.params:{}}function sd(e,{relative:t}={}){let{matches:n}=h.useContext(Tr),{pathname:r}=Hr(),s=JSON.stringify(hp(n));return h.useMemo(()=>pp(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function m3(e,t,n,r,s){He(Kl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=h.useContext(qr),{matches:i}=h.useContext(Tr),a=i[i.length-1],l=a?a.params:{},c=a?a.pathname:"/",u=a?a.pathnameBase:"/",f=a&&a.route;{let x=f&&f.path||"";NN(c,!f||x.endsWith("*")||x.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${x}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
285
|
+
|
286
|
+
Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}/*`}">.`)}let p=Hr(),g;g=p;let y=g.pathname||"/",m=y;if(u!=="/"){let x=u.replace(/^\//,"").split("/");m="/"+y.replace(/^\//,"").split("/").slice(x.length).join("/")}let v=bo(e,{pathname:m});return Tt(f||v!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Tt(v==null||v[v.length-1].route.element!==void 0||v[v.length-1].route.Component!==void 0||v[v.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),x3(v&&v.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:as([u,o.encodeLocation?o.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?u:as([u,o.encodeLocation?o.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r,s)}function g3(){let e=RN(),t=Su(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},i=null;return console.error("Error handled by React Router default ErrorBoundary:",e),i=h.createElement(h.Fragment,null,h.createElement("p",null,"💿 Hey developer 👋"),h.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",h.createElement("code",{style:o},"ErrorBoundary")," or"," ",h.createElement("code",{style:o},"errorElement")," prop on your route.")),h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:s},n):null,i)}var v3=h.createElement(g3,null),y3=class extends h.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?h.createElement(Tr.Provider,{value:this.props.routeContext},h.createElement(rx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function b3({routeContext:e,match:t,children:n}){let r=h.useContext(xa);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),h.createElement(Tr.Provider,{value:e},n)}function x3(e,t=[],n=null,r=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,i=n==null?void 0:n.errors;if(i!=null){let c=o.findIndex(u=>u.route.id&&(i==null?void 0:i[u.route.id])!==void 0);He(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,c+1))}let a=!1,l=-1;if(n)for(let c=0;c<o.length;c++){let u=o[c];if((u.route.HydrateFallback||u.route.hydrateFallbackElement)&&(l=c),u.route.id){let{loaderData:f,errors:p}=n,g=u.route.loader&&!f.hasOwnProperty(u.route.id)&&(!p||p[u.route.id]===void 0);if(u.route.lazy||g){a=!0,l>=0?o=o.slice(0,l+1):o=[o[0]];break}}}return o.reduceRight((c,u,f)=>{let p,g=!1,y=null,m=null;n&&(p=i&&u.route.id?i[u.route.id]:void 0,y=u.route.errorElement||v3,a&&(l<0&&f===0?(NN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,m=null):l===f&&(g=!0,m=u.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,f+1)),b=()=>{let x;return p?x=y:g?x=m:u.route.Component?x=h.createElement(u.route.Component,null):u.route.element?x=u.route.element:x=c,h.createElement(b3,{match:u,routeContext:{outlet:c,matches:v,isDataRoute:n!=null},children:x})};return n&&(u.route.ErrorBoundary||u.route.errorElement||f===0)?h.createElement(y3,{location:n.location,revalidation:n.revalidation,component:y,error:p,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0},unstable_onError:r}):b()},null)}function ox(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function w3(e){let t=h.useContext(xa);return He(t,ox(e)),t}function _3(e){let t=h.useContext(nd);return He(t,ox(e)),t}function E3(e){let t=h.useContext(Tr);return He(t,ox(e)),t}function ix(e){let t=E3(e),n=t.matches[t.matches.length-1];return He(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function S3(){return ix("useRouteId")}function RN(){var r;let e=h.useContext(rx),t=_3("useRouteError"),n=ix("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function C3(){let{router:e}=w3("useNavigate"),t=ix("useNavigate"),n=h.useRef(!1);return TN(()=>{n.current=!0}),h.useCallback(async(s,o={})=>{Tt(n.current,CN),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var cE={};function NN(e,t,n){!t&&!cE[e]&&(cE[e]=!0,Tt(!1,n))}var uE={};function dE(e,t){!e&&!uE[t]&&(uE[t]=!0,console.warn(t))}function T3(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Tt(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:h.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Tt(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Tt(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var R3=["HydrateFallback","hydrateFallbackElement"],N3=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function P3({router:e,flushSync:t,unstable_onError:n}){let[r,s]=h.useState(e.state),[o,i]=h.useState(),[a,l]=h.useState({isTransitioning:!1}),[c,u]=h.useState(),[f,p]=h.useState(),[g,y]=h.useState(),m=h.useRef(new Map),v=h.useCallback(E=>{s(S=>(E.errors&&n&&Object.entries(E.errors).forEach(([R,C])=>{var N;((N=S.errors)==null?void 0:N[R])!==C&&n(C)}),E))},[n]),b=h.useCallback((E,{deletedFetchers:S,flushSync:R,viewTransitionOpts:C})=>{E.fetchers.forEach((k,V)=>{k.data!==void 0&&m.current.set(V,k.data)}),S.forEach(k=>m.current.delete(k)),dE(R===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let N=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(dE(C==null||N,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!C||!N){t&&R?t(()=>v(E)):h.startTransition(()=>v(E));return}if(t&&R){t(()=>{f&&(c&&c.resolve(),f.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:C.currentLocation,nextLocation:C.nextLocation})});let k=e.window.document.startViewTransition(()=>{t(()=>v(E))});k.finished.finally(()=>{t(()=>{u(void 0),p(void 0),i(void 0),l({isTransitioning:!1})})}),t(()=>p(k));return}f?(c&&c.resolve(),f.skipTransition(),y({state:E,currentLocation:C.currentLocation,nextLocation:C.nextLocation})):(i(E),l({isTransitioning:!0,flushSync:!1,currentLocation:C.currentLocation,nextLocation:C.nextLocation}))},[e.window,t,f,c,v]);h.useLayoutEffect(()=>e.subscribe(b),[e,b]),h.useEffect(()=>{a.isTransitioning&&!a.flushSync&&u(new N3)},[a]),h.useEffect(()=>{if(c&&o&&e.window){let E=o,S=c.promise,R=e.window.document.startViewTransition(async()=>{h.startTransition(()=>v(E)),await S});R.finished.finally(()=>{u(void 0),p(void 0),i(void 0),l({isTransitioning:!1})}),p(R)}},[o,c,e.window,v]),h.useEffect(()=>{c&&o&&r.location.key===o.location.key&&c.resolve()},[c,f,r.location,o]),h.useEffect(()=>{!a.isTransitioning&&g&&(i(g.state),l({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),y(void 0))},[a.isTransitioning,g]);let x=h.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:E=>e.navigate(E),push:(E,S,R)=>e.navigate(E,{state:S,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(E,S,R)=>e.navigate(E,{replace:!0,state:S,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[e]),w=e.basename||"/",_=h.useMemo(()=>({router:e,navigator:x,static:!1,basename:w,unstable_onError:n}),[e,x,w,n]);return h.createElement(h.Fragment,null,h.createElement(xa.Provider,{value:_},h.createElement(nd.Provider,{value:r},h.createElement(SN.Provider,{value:m.current},h.createElement(nx.Provider,{value:a},h.createElement($3,{basename:w,location:r.location,navigationType:r.historyAction,navigator:x},h.createElement(j3,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var j3=h.memo(A3);function A3({routes:e,future:t,state:n,unstable_onError:r}){return m3(e,void 0,n,r,t)}function PN({to:e,replace:t,state:n,relative:r}){He(Kl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=h.useContext(qr);Tt(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=h.useContext(Tr),{pathname:i}=Hr(),a=rd(),l=pp(e,hp(o),i,r==="path"),c=JSON.stringify(l);return h.useEffect(()=>{a(JSON.parse(c),{replace:t,state:n,relative:r})},[a,c,r,t,n]),null}function ax(e){return p3(e.context)}function Ci(e){He(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function $3({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1}){He(!Kl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let i=e.replace(/^\/*/,"/"),a=h.useMemo(()=>({basename:i,navigator:s,static:o,future:{}}),[i,s,o]);typeof n=="string"&&(n=ii(n));let{pathname:l="/",search:c="",hash:u="",state:f=null,key:p="default"}=n,g=h.useMemo(()=>{let y=Er(l,i);return y==null?null:{location:{pathname:y,search:c,hash:u,state:f,key:p},navigationType:r}},[i,l,c,u,f,p,r]);return Tt(g!=null,`<Router basename="${i}"> is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:h.createElement(qr.Provider,{value:a},h.createElement(mp.Provider,{children:t,value:g}))}function Jv(e,t=[]){let n=[];return h.Children.forEach(e,(r,s)=>{if(!h.isValidElement(r))return;let o=[...t,s];if(r.type===h.Fragment){n.push.apply(n,Jv(r.props.children,o));return}He(r.type===Ci,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),He(!r.props.index||!r.props.children,"An index route cannot have child routes.");let i={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(i.children=Jv(r.props.children,o)),n.push(i)}),n}var D3=Jv,Pf="get",jf="application/x-www-form-urlencoded";function gp(e){return e!=null&&typeof e.tagName=="string"}function k3(e){return gp(e)&&e.tagName.toLowerCase()==="button"}function O3(e){return gp(e)&&e.tagName.toLowerCase()==="form"}function M3(e){return gp(e)&&e.tagName.toLowerCase()==="input"}function I3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function F3(e,t){return e.button===0&&(!t||t==="_self")&&!I3(e)}function ey(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function L3(e,t){let n=ey(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}var Xd=null;function U3(){if(Xd===null)try{new FormData(document.createElement("form"),0),Xd=!1}catch{Xd=!0}return Xd}var B3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Bm(e){return e!=null&&!B3.has(e)?(Tt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${jf}"`),null):e}function V3(e,t){let n,r,s,o,i;if(O3(e)){let a=e.getAttribute("action");r=a?Er(a,t):null,n=e.getAttribute("method")||Pf,s=Bm(e.getAttribute("enctype"))||jf,o=new FormData(e)}else if(k3(e)||M3(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||a.getAttribute("action");if(r=l?Er(l,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Pf,s=Bm(e.getAttribute("formenctype"))||Bm(a.getAttribute("enctype"))||jf,o=new FormData(a,e),!U3()){let{name:c,type:u,value:f}=e;if(u==="image"){let p=c?`${c}.`:"";o.append(`${p}x`,"0"),o.append(`${p}y`,"0")}else c&&o.append(c,f)}}else{if(gp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Pf,r=null,s=jf,i=e}return o&&s==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lx(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function z3(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&Er(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function W3(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function q3(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function H3(e,t,n){let r=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let i=await W3(o,n);return i.links?i.links():[]}return[]}));return Z3(r.flat(1).filter(q3).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function fE(e,t,n,r,s,o){let i=(l,c)=>n[c]?l.route.id!==n[c].route.id:!0,a=(l,c)=>{var u;return n[c].pathname!==l.pathname||((u=n[c].route.path)==null?void 0:u.endsWith("*"))&&n[c].params["*"]!==l.params["*"]};return o==="assets"?t.filter((l,c)=>i(l,c)||a(l,c)):o==="data"?t.filter((l,c)=>{var f;let u=r.routes[l.route.id];if(!u||!u.hasLoader)return!1;if(i(l,c)||a(l,c))return!0;if(l.route.shouldRevalidate){let p=l.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((f=n[0])==null?void 0:f.params)||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function G3(e,t,{includeHydrateFallback:n}={}){return K3(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function K3(e){return[...new Set(e)]}function Y3(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Z3(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let o=JSON.stringify(Y3(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function jN(){let e=h.useContext(xa);return lx(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Q3(){let e=h.useContext(nd);return lx(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var cx=h.createContext(void 0);cx.displayName="FrameworkContext";function AN(){let e=h.useContext(cx);return lx(e,"You must render this element inside a <HydratedRouter> element"),e}function X3(e,t){let n=h.useContext(cx),[r,s]=h.useState(!1),[o,i]=h.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:c,onMouseLeave:u,onTouchStart:f}=t,p=h.useRef(null);h.useEffect(()=>{if(e==="render"&&i(!0),e==="viewport"){let m=b=>{b.forEach(x=>{i(x.isIntersecting)})},v=new IntersectionObserver(m,{threshold:.5});return p.current&&v.observe(p.current),()=>{v.disconnect()}}},[e]),h.useEffect(()=>{if(r){let m=setTimeout(()=>{i(!0)},100);return()=>{clearTimeout(m)}}},[r]);let g=()=>{s(!0)},y=()=>{s(!1),i(!1)};return n?e!=="intent"?[o,p,{}]:[o,p,{onFocus:_c(a,g),onBlur:_c(l,y),onMouseEnter:_c(c,g),onMouseLeave:_c(u,y),onTouchStart:_c(f,g)}]:[!1,p,{}]}function _c(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function J3({page:e,...t}){let{router:n}=jN(),r=h.useMemo(()=>bo(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?h.createElement(t6,{page:e,matches:r,...t}):null}function e6(e){let{manifest:t,routeModules:n}=AN(),[r,s]=h.useState([]);return h.useEffect(()=>{let o=!1;return H3(e,t,n).then(i=>{o||s(i)}),()=>{o=!0}},[e,t,n]),r}function t6({page:e,matches:t,...n}){let r=Hr(),{manifest:s,routeModules:o}=AN(),{basename:i}=jN(),{loaderData:a,matches:l}=Q3(),c=h.useMemo(()=>fE(e,t,l,s,r,"data"),[e,t,l,s,r]),u=h.useMemo(()=>fE(e,t,l,s,r,"assets"),[e,t,l,s,r]),f=h.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let y=new Set,m=!1;if(t.forEach(b=>{var w;let x=s.routes[b.route.id];!x||!x.hasLoader||(!c.some(_=>_.route.id===b.route.id)&&b.route.id in a&&((w=o[b.route.id])!=null&&w.shouldRevalidate)||x.hasClientLoader?m=!0:y.add(b.route.id))}),y.size===0)return[];let v=z3(e,i,"data");return m&&y.size>0&&v.searchParams.set("_routes",t.filter(b=>y.has(b.route.id)).map(b=>b.route.id).join(",")),[v.pathname+v.search]},[i,a,r,s,c,t,e,o]),p=h.useMemo(()=>G3(u,s),[u,s]),g=e6(u);return h.createElement(h.Fragment,null,f.map(y=>h.createElement("link",{key:y,rel:"prefetch",as:"fetch",href:y,...n})),p.map(y=>h.createElement("link",{key:y,rel:"modulepreload",href:y,...n})),g.map(({key:y,link:m})=>h.createElement("link",{key:y,nonce:n.nonce,...m})))}function n6(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var $N=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{$N&&(window.__reactRouterVersion="7.9.1")}catch{}function r6(e,t){return B5({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:i5({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||s6(),routes:e,mapRouteProperties:T3,hydrationRouteProperties:R3,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function s6(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:o6(e.errors)}),e}function o6(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,s]of t)if(s&&s.__type==="RouteErrorResponse")n[r]=new lh(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let o=window[s.__subType];if(typeof o=="function")try{let i=new o(s.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let o=new Error(s.message);o.stack="",n[r]=o}}else n[r]=s;return n}var DN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,od=h.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:i,state:a,target:l,to:c,preventScrollReset:u,viewTransition:f,...p},g){let{basename:y}=h.useContext(qr),m=typeof c=="string"&&DN.test(c),v,b=!1;if(typeof c=="string"&&m&&(v=c,$N))try{let N=new URL(window.location.href),k=c.startsWith("//")?new URL(N.protocol+c):new URL(c),V=Er(k.pathname,y);k.origin===N.origin&&V!=null?c=V+k.search+k.hash:b=!0}catch{Tt(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let x=d3(c,{relative:s}),[w,_,E]=X3(r,p),S=l6(c,{replace:i,state:a,target:l,preventScrollReset:u,relative:s,viewTransition:f});function R(N){t&&t(N),N.defaultPrevented||S(N)}let C=h.createElement("a",{...p,...E,href:v||x,onClick:b||o?t:R,ref:n6(g,_),target:l,"data-discover":!m&&n==="render"?"true":void 0});return w&&!m?h.createElement(h.Fragment,null,C,h.createElement(J3,{page:x})):C});od.displayName="Link";var kN=h.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:i,viewTransition:a,children:l,...c},u){let f=sd(i,{relative:c.relative}),p=Hr(),g=h.useContext(nd),{navigator:y,basename:m}=h.useContext(qr),v=g!=null&&h6(f)&&a===!0,b=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,x=p.pathname,w=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(x=x.toLowerCase(),w=w?w.toLowerCase():null,b=b.toLowerCase()),w&&m&&(w=Er(w,m)||w);const _=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let E=x===b||!s&&x.startsWith(b)&&x.charAt(_)==="/",S=w!=null&&(w===b||!s&&w.startsWith(b)&&w.charAt(b.length)==="/"),R={isActive:E,isPending:S,isTransitioning:v},C=E?t:void 0,N;typeof r=="function"?N=r(R):N=[r,E?"active":null,S?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let k=typeof o=="function"?o(R):o;return h.createElement(od,{...c,"aria-current":C,className:N,ref:u,style:k,to:i,viewTransition:a},typeof l=="function"?l(R):l)});kN.displayName="NavLink";var i6=h.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:i=Pf,action:a,onSubmit:l,relative:c,preventScrollReset:u,viewTransition:f,...p},g)=>{let y=d6(),m=f6(a,{relative:c}),v=i.toLowerCase()==="get"?"get":"post",b=typeof a=="string"&&DN.test(a),x=w=>{if(l&&l(w),w.defaultPrevented)return;w.preventDefault();let _=w.nativeEvent.submitter,E=(_==null?void 0:_.getAttribute("formmethod"))||i;y(_||w.currentTarget,{fetcherKey:t,method:E,navigate:n,replace:s,state:o,relative:c,preventScrollReset:u,viewTransition:f})};return h.createElement("form",{ref:g,method:v,action:m,onSubmit:r?l:x,...p,"data-discover":!b&&e==="render"?"true":void 0})});i6.displayName="Form";function a6(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ON(e){let t=h.useContext(xa);return He(t,a6(e)),t}function l6(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:o,viewTransition:i}={}){let a=rd(),l=Hr(),c=sd(e,{relative:o});return h.useCallback(u=>{if(F3(u,t)){u.preventDefault();let f=n!==void 0?n:Yo(l)===Yo(c);a(e,{replace:f,state:r,preventScrollReset:s,relative:o,viewTransition:i})}},[l,a,c,n,r,t,e,s,o,i])}function MN(e){Tt(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=h.useRef(ey(e)),n=h.useRef(!1),r=Hr(),s=h.useMemo(()=>L3(r.search,n.current?null:t.current),[r.search]),o=rd(),i=h.useCallback((a,l)=>{const c=ey(typeof a=="function"?a(new URLSearchParams(s)):a);n.current=!0,o("?"+c,l)},[o,s]);return[s,i]}var c6=0,u6=()=>`__${String(++c6)}__`;function d6(){let{router:e}=ON("useSubmit"),{basename:t}=h.useContext(qr),n=S3();return h.useCallback(async(r,s={})=>{let{action:o,method:i,encType:a,formData:l,body:c}=V3(r,t);if(s.navigate===!1){let u=s.fetcherKey||u6();await e.fetch(u,n,s.action||o,{preventScrollReset:s.preventScrollReset,formData:l,body:c,formMethod:s.method||i,formEncType:s.encType||a,flushSync:s.flushSync})}else await e.navigate(s.action||o,{preventScrollReset:s.preventScrollReset,formData:l,body:c,formMethod:s.method||i,formEncType:s.encType||a,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function f6(e,{relative:t}={}){let{basename:n}=h.useContext(qr),r=h.useContext(Tr);He(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...sd(e||".",{relative:t})},i=Hr();if(e==null){o.search=i.search;let a=new URLSearchParams(o.search),l=a.getAll("index");if(l.some(u=>u==="")){a.delete("index"),l.filter(f=>f).forEach(f=>a.append("index",f));let u=a.toString();o.search=u?`?${u}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:as([n,o.pathname])),Yo(o)}function h6(e,{relative:t}={}){let n=h.useContext(nx);He(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ON("useViewTransitionState"),s=sd(e,{relative:t});if(!n.isTransitioning)return!1;let o=Er(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Er(n.nextLocation.pathname,r)||n.nextLocation.pathname;return ah(s.pathname,i)!=null||ah(s.pathname,o)!=null}const hE=e=>{let t;const n=new Set,r=(c,u)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const p=t;t=u??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(g=>g(t,p))}},s=()=>t,a={setState:r,getState:s,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=t=e(r,s,a);return a},IN=e=>e?hE(e):hE,p6=e=>e;function m6(e,t=p6){const n=ce.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return ce.useDebugValue(n),n}const pE=e=>{const t=IN(e),n=r=>m6(t,r);return Object.assign(n,t),n},ux=e=>e?pE(e):pE,FN=({slots:e={}}={})=>{const t=new Map(Object.entries(e).map(([r,s])=>[r,[{id:r,content:s,type:"replace",sequence:0}]])),n=[];return IN()((r,s)=>({items:t,sequences:new Map,getItems:o=>s().items.get(o)??n,setSlot:(o,i,a,l)=>r(c=>{if(a==null)return c;const u=new Map(c.items),f=new Map(c.sequences),g=(u.get(i)??[]).filter(b=>b.id!==o),m=(f.get(i)??0)+1;f.set(i,m);const v={id:o,content:a,type:l,sequence:l==="prepend"?-m:m};if(l==="replace"){const b=g.filter(x=>x.type!=="replace");u.set(i,[...b,v])}else u.set(i,[...g,v]);return{items:u,sequences:f}}),clearSlot:(o,i)=>r(a=>{const l=new Map(a.items),c=new Map(a.sequences),f=(l.get(i)??[]).filter(p=>p.id!==o);return f.length===0?(l.delete(i),c.delete(i)):l.set(i,f),{items:l,sequences:c}})}))},g6=h.createContext(FN()),v6=({children:e,slots:t})=>{const n=h.useRef(FN({slots:t})).current;return d.jsx(g6.Provider,{value:n,children:e})},LN="API request failed",y6=2;function b6({router:e,queryClient:t,additionalProviders:n}){const r=t??new PI({defaultOptions:{queries:{retry:(o,i)=>i instanceof gs&&i.message===LN?o<=y6:!1}}});return()=>{var i;const o=d.jsx(h.StrictMode,{children:d.jsx(h.Suspense,{fallback:null,children:d.jsx(jI,{client:r,children:d.jsx(pB,{fallback:r5,children:d.jsx(iI,{children:d.jsx(F2,{children:d.jsx(v6,{children:d.jsx(P3,{router:e})})})})})})})});if(!n)return o;if(typeof n=="function"){if(((i=n.prototype)==null?void 0:i.isReactComponent)||/^[A-Z]/.test(n.name)){const l=n;return d.jsx(l,{children:o})}return n(o)}return o}}const UN=ce.createContext({account:void 0,project:void 0,environment:void 0});async function vp(e,t){const n=(t==null?void 0:t.method)??"GET",r=await x6(e,t);if(!r.ok){const s=await r.clone().text(),o=new tr(`${r.status}: ${r.statusText} making request '${n} ${e}': ${s}`);throw await o.tryReadResponse(r),o}return r}async function x6(e,t){const n=Gb(),r=await window.getAccessTokenSilently();if(!r)throw new Error("Error requesting access token. Could not authenticate user.");const s=`${X}/${J}${e}`,o=X!=null&&X.startsWith("http")?new URL(s):new URL(s,window.location.origin),i={...t},a={Authorization:`Bearer ${r}`,"zuplo-request-id":n};t!=null&&t.headers||(i.headers={}),Object.assign(i.headers??{},a);try{return await fetch(o.toString(),i)}catch(l){const c=new na;c.setTag("traceId",n),c.setTag("url",o.toString());const u=t!=null&&t.headers?JSON.stringify(t.headers):"{}",f=JSON.stringify(u);throw c.setTag("method",(t==null?void 0:t.method)??"GET"),c.setTag("initHeaders",f),l instanceof TypeError?new gs({type:"https://zup.fail/api-request-failed",title:"API request failed",status:500,instance:o.toString()}):l}}var mE=function(){throw new Error("Attempted to call useModal outside of modal context. Make sure your app is rendered inside ModalProvider.")},dx=h.createContext({showModal:mE,hideModal:mE});dx.displayName="ModalContext";var ou=function(){return ou=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ou.apply(this,arguments)};function w6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}var _6=h.memo(function(e){var t=e.component,n=w6(e,["component"]);return t(n)}),E6=h.memo(function(e){var t=e.modals,n=e.container,r=e.component,s=r===void 0?h.Fragment:r,o=h.useState(void 0),i=o[0],a=o[1];return h.useEffect(function(){return a(n||document.body)}),i?Cr.createPortal(h.createElement(s,null,Object.keys(t).map(function(l){return h.createElement(_6,{key:l,component:t[l]})})),i):null}),BN=function(e){var t=e.container,n=e.rootComponent,r=e.children;if(t&&!(t instanceof HTMLElement))throw new Error(`Container must specify DOM element to mount modal root into.
|
287
|
+
|
288
|
+
This behavior has changed in 3.0.0. Please use \`rootComponent\` prop instead.
|
289
|
+
See: https://github.com/mpontus/react-modal-hook/issues/18`);var s=h.useState({}),o=s[0],i=s[1],a=h.useCallback(function(u,f){return i(function(p){var g;return ou(ou({},p),(g={},g[u]=f,g))})},[]),l=h.useCallback(function(u){return i(function(f){if(!f[u])return f;var p=ou({},f);return delete p[u],p})},[]),c=h.useMemo(function(){return{showModal:a,hideModal:l}},[]);return h.createElement(dx.Provider,{value:c},h.createElement(h.Fragment,null,r,h.createElement(E6,{modals:o,component:n,container:t})))},S6=function(){var e=0;return function(){return"".concat(++e)}}(),C6=function(e){var t=e.prototype;return!t||!t.isReactComponent},ls=function(e,t){if(t===void 0&&(t=[]),!C6(e))throw new Error("Only stateless components can be used as an argument to useModal. You have probably passed a class component where a function was expected.");var n=h.useMemo(S6,[]),r=h.useMemo(function(){return e},t),s=h.useContext(dx),o=h.useState(!1),i=o[0],a=o[1],l=h.useCallback(function(){return a(!0)},[]),c=h.useCallback(function(){return a(!1)},[]);return h.useEffect(function(){return i?s.showModal(n,r):s.hideModal(n),function(){return s.hideModal(n)}},[r,i]),[l,c]};const fx=h.createContext(void 0),Koe=()=>{const e=h.useContext(fx),{user:t}=si();if(e)return e;if(!t)throw new Error("This hook should never be used outside of a protected route.");if(!t.sub)throw new Error("The user returned from Auth0 does not contain a 'sub'. Invalid state.");return{email:t.email??"unknown@example.com",name:t.name??"",userId:t.sub,asUser:t[RL]}},T6={email:"local@example.com",name:"Local Developer",userId:"local-user-id",asUser:void 0},R6=({children:e})=>d.jsx(fx.Provider,{value:T6,children:e});var nr=(e=>(e.PRODUCTION="PRODUCTION",e.PREVIEW="PREVIEW",e.WORKING_COPY="WORKING_COPY",e))(nr||{});function gE(e){return{account:{id:"local",name:"local",label:"Local Development",createdOn:new Date().toISOString(),isSharingEnabled:!1,isMfaEnforced:!1,isSsoAutoJoinEnabled:!1,requireSsoAuth:!1,plan:"FREE_V1",supportPin:void 0,logoUrl:null,entitlements:{customDomains:0,aliasDomains:!1,devPortalZuploBranding:!0,egressGbPerMonth:100,kvStoreEnabled:!0,numberOfApiKeys:100,numberOfProjects:10,numberOfUsers:5,requestsPerMonth:1e6,advancedAnalyticsEnabled:!1,premiumSupport:!1,emergencyPhoneSupport:!1,rbacEnabled:!1,mfaEnforcement:!1,enterpriseSingleSignOn:!1,auditLogsEnabled:!1},customDomainsInUse:0,tenantId:null},project:{sourceControlProvider:"GITHUB",accountName:"local",name:"local-project",productType:"standard",createdOn:new Date().toISOString(),sourceRepoUrl:null,defaultBranch:null,hasWorkingCopy:!0,hasCurrentUserWorkingCopy:!0,deployedEnvironmentCount:0,isProjectMember:!0,id:"local-project-id",type:"managed-edge"},environment:{name:"local",label:"local",urlParameter:"local",createdOn:Date.now(),accountName:"local",projectName:"local-project",state:"STARTED",message:null,branchName:null,environmentType:nr.WORKING_COPY,customDomain:void 0,updatedOn:Date.now(),deploymentVersion:e}}}const N6=Wr("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{outline:"",default:"bg-background text-foreground",info:"border-blue-100/50 [&>svg]:text-blue-400 bg-blue-50 border border-blue-200 text-blue-500",warning:"border-yellow-100/50 [&>svg]:text-yellow-400 bg-yellow-50 border border-yellow-200 text-yellow-900",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive bg-red-100 border-2 border-red-200 text-red-700"}},defaultVariants:{variant:"default"}}),Sr=h.forwardRef(({className:e,variant:t,...n},r)=>d.jsx("div",{ref:r,role:"alert",className:se(N6({variant:t}),e),...n}));Sr.displayName="Alert";const yp=h.forwardRef(({className:e,...t},n)=>d.jsx("h5",{ref:n,className:se("mb-1 font-medium leading-none tracking-tight",e),...t}));yp.displayName="AlertTitle";const ai=h.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:se("text-sm [&_p]:leading-relaxed",e),...t}));ai.displayName="AlertDescription";const P6=Wr("inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-zuplo-200 bg-zuplo-50 text-zuplo-700",invert:"border-transparent bg-pink-100 text-pink-500",secondary:"border-transparent bg-gray-200 text-secondary-foreground",info:"border-transparent bg-blue-200 text-blue-500",warn:"border-transparent bg-yellow-300 text-yellow-900",destructive:"border-transparent bg-destructive text-destructive-foreground",ghost:"border-transparent text-destructive-foreground",outline:"text-foreground"},button:{false:"",true:"cursor-pointer hover:bg-gray-200"},size:{default:"text-xs",lg:"text-sm py-1 px-3.5"}},compoundVariants:[{button:!0,variant:"default",className:"hover:bg-primary/80"},{button:!0,variant:"secondary",className:"bg-muted hover:bg-muted/80"},{button:!0,variant:"destructive",className:"hover:bg-destructive/80"}],defaultVariants:{variant:"default",button:!1}});function li({className:e,variant:t,button:n,size:r,...s}){return d.jsx("div",{className:se(P6({variant:t,button:n,size:r}),e),...s})}const VN=({goBack:e,hasGoHome:t})=>d.jsxs("div",{className:"flex gap-2 border-t pt-4 mt-2",children:[t&&d.jsx(Fe,{asChild:!0,children:d.jsxs("a",{href:"/",children:[d.jsx(rN,{className:"mr-2",size:22}),"Go Home"]})}),d.jsx(JR,{text:"Chat with us"}),e&&d.jsx(Fe,{onClick:()=>{e()},children:"Try again"})]}),j6=e=>e instanceof gs||e instanceof tr?{type:e.type,title:e.message,status:e.status,detail:e.detail,instance:e.instance,traceId:e.traceId}:{title:"Oh zup! Something went wrong.",detail:e instanceof Error?e.message:String(e)};function A6({id:e}){const t=RN(),n=j6(t),r=ft();return h.useEffect(()=>{t&&(On(t),r.logEvent("error-boundary",{id:e??"",title:n.title,detail:n.detail??""}))},[r,t,n.detail,n.title,e]),d.jsx("div",{className:"m-auto",children:d.jsxs("div",{className:"flex flex-col gap-2 my-5 max-w-screen-sm m-6",children:[d.jsx("div",{children:d.jsxs(li,{variant:"outline",children:[e," Error"]})}),d.jsx("span",{className:"text-2xl font-medium",children:n.title}),d.jsxs("span",{children:["Unfortunately, we encountered an error while trying to load this page. But there are good news: We informed the team and someone will go and fix it.",d.jsx("br",{})," In the meantime, try again or reach out and chat with us."]}),n.detail&&d.jsxs(Sr,{variant:"destructive",children:[n.type&&`${n.type}:`," ",n.detail]}),d.jsxs("span",{className:"font-mono text-sm",children:["Version ",rB," ",n.traceId&&`| Trace ID ${n.traceId}`]}),d.jsx(VN,{hasGoHome:!0})]})})}const zN=ux()(e=>({toasts:[],addToast:t=>{const n=Math.random().toString(36).substring(2);return e(r=>{const s=t.duration??Z6;return{toasts:[...r.toasts,{id:n,duration:s,showDismiss:!0,variant:"default",...t}]}}),n},dismissToast:t=>e(n=>({toasts:n.toasts.filter(r=>r.id!==t)}))})),ci=()=>{const{addToast:e,dismissToast:t}=zN();return{toast:(n,r)=>e({message:n,variant:"default",...r}),success:(n,r)=>e({message:n,variant:"default",...r}),error:(n,r)=>e({message:n,variant:"destructive",duration:7500,...r}),dismiss:n=>t(n)}};function bp(e){const t=e+"CollectionProvider",[n,r]=Vr(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=m=>{const{scope:v,children:b}=m,x=ce.useRef(null),w=ce.useRef(new Map).current;return d.jsx(s,{scope:v,itemMap:w,collectionRef:x,children:b})};i.displayName=t;const a=e+"CollectionSlot",l=ea(a),c=ce.forwardRef((m,v)=>{const{scope:b,children:x}=m,w=o(a,b),_=tt(v,w.collectionRef);return d.jsx(l,{ref:_,children:x})});c.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",p=ea(u),g=ce.forwardRef((m,v)=>{const{scope:b,children:x,...w}=m,_=ce.useRef(null),E=tt(v,_),S=o(u,b);return ce.useEffect(()=>(S.itemMap.set(_,{ref:_,...w}),()=>void S.itemMap.delete(_))),d.jsx(p,{[f]:"",ref:E,children:x})});g.displayName=u;function y(m){const v=o(e+"CollectionConsumer",m);return ce.useCallback(()=>{const x=v.collectionRef.current;if(!x)return[];const w=Array.from(x.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((S,R)=>w.indexOf(S.ref.current)-w.indexOf(R.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:i,Slot:c,ItemSlot:g},y,r]}var hx="ToastProvider",[px,$6,D6]=bp("Toast"),[WN,Yoe]=Vr("Toast",[D6]),[k6,xp]=WN(hx),qN=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i,onOpenChange:a}=e,[l,c]=h.useState(null),[u,f]=h.useState(0),p=h.useRef(!1),g=h.useRef(!1);return h.useEffect(()=>{a&&a(u)},[u]),n.trim()||console.error(`Invalid prop \`label\` supplied to \`${hx}\`. Expected non-empty \`string\`.`),d.jsx(px.Provider,{scope:t,children:d.jsx(k6,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:o,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:h.useCallback(()=>f(y=>y+1),[]),onToastRemove:h.useCallback(()=>f(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:p,isClosePausedRef:g,children:i})})};qN.displayName=hx;var HN="ToastViewport",O6=["F8"],ty="toast.viewportPause",ny="toast.viewportResume",GN=h.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=O6,label:s="Notifications ({hotkey})",...o}=e,i=xp(HN,n),a=$6(n),l=h.useRef(null),c=h.useRef(null),u=h.useRef(null),f=h.useRef(null),p=tt(t,f,i.onViewportChange),g=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=i.toastCount>0;h.useEffect(()=>{const v=b=>{var w;r.length!==0&&r.every(_=>b[_]||b.code===_)&&((w=f.current)==null||w.focus())};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[r]),h.useEffect(()=>{const v=l.current,b=f.current;if(y&&v&&b){const x=()=>{if(!i.isClosePausedRef.current){const S=new CustomEvent(ty);b.dispatchEvent(S),i.isClosePausedRef.current=!0}},w=()=>{if(i.isClosePausedRef.current){const S=new CustomEvent(ny);b.dispatchEvent(S),i.isClosePausedRef.current=!1}},_=S=>{!v.contains(S.relatedTarget)&&w()},E=()=>{v.contains(document.activeElement)||w()};return v.addEventListener("focusin",x),v.addEventListener("focusout",_),v.addEventListener("pointermove",x),v.addEventListener("pointerleave",E),window.addEventListener("blur",x),window.addEventListener("focus",w),()=>{v.removeEventListener("focusin",x),v.removeEventListener("focusout",_),v.removeEventListener("pointermove",x),v.removeEventListener("pointerleave",E),window.removeEventListener("blur",x),window.removeEventListener("focus",w)}}},[y,i.isClosePausedRef]);const m=h.useCallback(({tabbingDirection:v})=>{const x=a().map(w=>{const _=w.ref.current,E=[_,...K6(_)];return v==="forwards"?E:E.reverse()});return(v==="forwards"?x.reverse():x).flat()},[a]);return h.useEffect(()=>{const v=f.current;if(v){const b=x=>{var E,S,R;const w=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!w){const C=document.activeElement,N=x.shiftKey;if(x.target===v&&N){(E=c.current)==null||E.focus();return}const L=m({tabbingDirection:N?"backwards":"forwards"}),G=L.findIndex($=>$===C);Vm(L.slice(G+1))?x.preventDefault():N?(S=c.current)==null||S.focus():(R=u.current)==null||R.focus()}};return v.addEventListener("keydown",b),()=>v.removeEventListener("keydown",b)}},[a,m]),d.jsxs(sF,{ref:l,role:"region","aria-label":s.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&d.jsx(ry,{ref:c,onFocusFromOutsideViewport:()=>{const v=m({tabbingDirection:"forwards"});Vm(v)}}),d.jsx(px.Slot,{scope:n,children:d.jsx($e.ol,{tabIndex:-1,...o,ref:p})}),y&&d.jsx(ry,{ref:u,onFocusFromOutsideViewport:()=>{const v=m({tabbingDirection:"backwards"});Vm(v)}})]})});GN.displayName=HN;var KN="ToastFocusProxy",ry=h.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,o=xp(KN,n);return d.jsx(Gh,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=o.viewport)!=null&&c.contains(a))&&r()}})});ry.displayName=KN;var id="Toast",M6="toast.swipeStart",I6="toast.swipeMove",F6="toast.swipeCancel",L6="toast.swipeEnd",YN=h.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:o,...i}=e,[a,l]=Ys({prop:r,defaultProp:s??!0,onChange:o,caller:id});return d.jsx(zr,{present:n||a,children:d.jsx(V6,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:qn(e.onPause),onResume:qn(e.onResume),onSwipeStart:me(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:me(e.onSwipeMove,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:me(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:me(e.onSwipeEnd,c=>{const{x:u,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});YN.displayName=id;var[U6,B6]=WN(id,{onClose(){}}),V6=h.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:g,...y}=e,m=xp(id,n),[v,b]=h.useState(null),x=tt(t,$=>b($)),w=h.useRef(null),_=h.useRef(null),E=s||m.duration,S=h.useRef(0),R=h.useRef(E),C=h.useRef(0),{onToastAdd:N,onToastRemove:k}=m,V=qn(()=>{var I;(v==null?void 0:v.contains(document.activeElement))&&((I=m.viewport)==null||I.focus()),i()}),L=h.useCallback($=>{!$||$===1/0||(window.clearTimeout(C.current),S.current=new Date().getTime(),C.current=window.setTimeout(V,$))},[V]);h.useEffect(()=>{const $=m.viewport;if($){const I=()=>{L(R.current),c==null||c()},j=()=>{const F=new Date().getTime()-S.current;R.current=R.current-F,window.clearTimeout(C.current),l==null||l()};return $.addEventListener(ty,j),$.addEventListener(ny,I),()=>{$.removeEventListener(ty,j),$.removeEventListener(ny,I)}}},[m.viewport,E,l,c,L]),h.useEffect(()=>{o&&!m.isClosePausedRef.current&&L(E)},[o,E,m.isClosePausedRef,L]),h.useEffect(()=>(N(),()=>k()),[N,k]);const G=h.useMemo(()=>v?nP(v):null,[v]);return m.viewport?d.jsxs(d.Fragment,{children:[G&&d.jsx(z6,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:G}),d.jsx(U6,{scope:n,onClose:V,children:Cr.createPortal(d.jsx(px.ItemSlot,{scope:n,children:d.jsx(rF,{asChild:!0,onEscapeKeyDown:me(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||V(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:d.jsx($e.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":m.swipeDirection,...y,ref:x,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:me(e.onKeyDown,$=>{$.key==="Escape"&&(a==null||a($.nativeEvent),$.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,V()))}),onPointerDown:me(e.onPointerDown,$=>{$.button===0&&(w.current={x:$.clientX,y:$.clientY})}),onPointerMove:me(e.onPointerMove,$=>{if(!w.current)return;const I=$.clientX-w.current.x,j=$.clientY-w.current.y,F=!!_.current,O=["left","right"].includes(m.swipeDirection),U=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,Y=O?U(0,I):0,ee=O?0:U(0,j),M=$.pointerType==="touch"?10:2,Q={x:Y,y:ee},H={originalEvent:$,delta:Q};F?(_.current=Q,Jd(I6,f,H,{discrete:!1})):vE(Q,m.swipeDirection,M)?(_.current=Q,Jd(M6,u,H,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(I)>M||Math.abs(j)>M)&&(w.current=null)}),onPointerUp:me(e.onPointerUp,$=>{const I=_.current,j=$.target;if(j.hasPointerCapture($.pointerId)&&j.releasePointerCapture($.pointerId),_.current=null,w.current=null,I){const F=$.currentTarget,O={originalEvent:$,delta:I};vE(I,m.swipeDirection,m.swipeThreshold)?Jd(L6,g,O,{discrete:!0}):Jd(F6,p,O,{discrete:!0}),F.addEventListener("click",U=>U.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),z6=e=>{const{__scopeToast:t,children:n,...r}=e,s=xp(id,t),[o,i]=h.useState(!1),[a,l]=h.useState(!1);return H6(()=>i(!0)),h.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:d.jsx(td,{asChild:!0,children:d.jsx(Gh,{...r,children:o&&d.jsxs(d.Fragment,{children:[s.label," ",n]})})})},W6="ToastTitle",ZN=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return d.jsx($e.div,{...r,ref:t})});ZN.displayName=W6;var q6="ToastDescription",QN=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return d.jsx($e.div,{...r,ref:t})});QN.displayName=q6;var XN="ToastAction",JN=h.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?d.jsx(tP,{altText:n,asChild:!0,children:d.jsx(mx,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${XN}\`. Expected non-empty \`string\`.`),null)});JN.displayName=XN;var eP="ToastClose",mx=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=B6(eP,n);return d.jsx(tP,{asChild:!0,children:d.jsx($e.button,{type:"button",...r,ref:t,onClick:me(e.onClick,s.onClose)})})});mx.displayName=eP;var tP=h.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return d.jsx($e.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function nP(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),G6(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...nP(r))}}),t}function Jd(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ub(s,o):s.dispatchEvent(o)}var vE=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),o=r>s;return t==="left"||t==="right"?o&&r>n:!o&&s>n};function H6(e=()=>{}){const t=qn(e);nn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function G6(e){return e.nodeType===e.ELEMENT_NODE}function K6(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Vm(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var rP=qN,sP=GN,oP=YN,iP=ZN,aP=QN,lP=JN,cP=mx;const uP=h.forwardRef((e,t)=>d.jsx(rP,{...e}));uP.displayName=rP.displayName;const dP=h.forwardRef(({className:e,...t},n)=>d.jsx(sP,{ref:n,className:se("fixed gap-0.5 top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));dP.displayName=sP.displayName;const fP=h.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:se("flex flex-col gap-1",e),...t}));fP.displayName="ToastContent";const Y6=Wr("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-background text-destructive"}},defaultVariants:{variant:"default"}}),gx=h.forwardRef(({className:e,variant:t,...n},r)=>d.jsx(oP,{ref:r,className:se(Y6({variant:t}),e),...n}));gx.displayName=oP.displayName;const hP=h.forwardRef(({className:e,...t},n)=>d.jsx(lP,{ref:n,className:se("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));hP.displayName=lP.displayName;const vx=h.forwardRef(({className:e,...t},n)=>d.jsx(cP,{ref:n,className:se("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:d.jsx(aa,{className:"h-4 w-4"})}));vx.displayName=cP.displayName;const yx=h.forwardRef(({className:e,...t},n)=>d.jsx(iP,{ref:n,className:se("text-sm font-semibold [&+div]:text-xs",e),...t}));yx.displayName=iP.displayName;const bx=h.forwardRef(({className:e,...t},n)=>d.jsx(aP,{ref:n,className:se("text-sm opacity-90",e),...t}));bx.displayName=aP.displayName;const Z6=5e3;function Q6(){const{toasts:e,dismissToast:t}=zN();return d.jsx(d.Fragment,{children:e.map(({id:n,title:r,message:s,variant:o,showDismiss:i,duration:a,icon:l})=>d.jsx(gx,{variant:o??"default",duration:a,children:d.jsxs("div",{className:"flex gap-2 items-center",children:[l??d.jsx("div",{}),d.jsxs("div",{className:"w-full",children:[r&&d.jsx(yx,{children:r}),d.jsx(bx,{children:s})]}),i&&d.jsx(vx,{onClick:()=>t(n)})]})},n))})}const X6=()=>{const e=Hr(),{user:t}=si(),n=ip();h.useEffect(()=>{try{const r=window._hsq=window._hsq??[];r.push(["setPath",e.pathname]),r.push(["trackPageView"]),t&&r.push(["identify",{id:t.sub,email:t.email}])}catch(r){Et.debug(r)}try{const r=new URL(`${window.origin}${e.pathname}${e.search}`);n.capture("$pageview",{$current_url:r.toString()})}catch(r){Et.debug(r)}},[e.pathname])},yr={AccountProjects:"/accounts/:account/projects",SelectAccount:"/select-account",AccountSettings:"/accounts/:account/settings",AccountUsagePage:"/accounts/:account/usage",AccountServices:"/accounts/:account/services",ProjectServices:"/:account/:project/services",Analytics:"/:account/:project/analytics",Builds:"/:account/:project/environments/:environment/builds",Environments:"/:account/:project/environments",Overview:"/:account/:project",Code:"/:account/:project/:environment/edit",Health:"/health",Home:"/",Impersonate:"/impersonate",Login:"/login",Logout:"/logout",Logs:"/:account/:project/:environment/logs",NewProject:"/accounts/:account/new",SetupProject:"/accounts/:account/projects/:project/setup",Profile:"/user/profile",Settings:"/:account/:project/settings",SettingsSourceControl:"/:account/:project/settings/source-control-settings",EnvironmentVariables:"/:account/:project/settings/environment-variables",SignUp:"/signup",CreateAccount:"/new-account",Test:"/:account/:project/:environment/tests",SourceControlConnect:"/source-control-callback",Support:"/accounts/:account/settings/support"},Zoe="rewritePattern",Qoe="https://echo.zuplo.io/",Xoe="https://echo.zuplo.io";function J6(){const t=navigator.userAgent.toLowerCase();if(t.indexOf("win")!==-1)return"windows";if(t.indexOf("mac")!==-1)return"apple";if(t.indexOf("linux")!==-1)return"linux";if(t.indexOf("x11")!==-1)return"unix"}function e8(){return J6()==="apple"}const t8={other:{alt:"Alt",meta:"Ctrl",ctrl:"Ctrl",shift:"⇧",option:"Alt"},apple:{alt:"⌥",meta:"⌘",ctrl:"Ctrl",shift:"⇧",option:"⌥"}},n8=(e,t)=>{const n=e.toLowerCase().split("+"),r=n.includes("meta"),s=n.includes("shift"),o=n.includes("option")||n.includes("alt"),i=n.includes("ctrl"),a=e.split("+").pop(),l=h.useRef(t);return h.useEffect(()=>{l.current=t},[t]),h.useEffect(()=>{const c=u=>{(u.code===`Key${a==null?void 0:a.toUpperCase()}`||u.code.toLowerCase()===(a==null?void 0:a.toLowerCase()))&&u.metaKey===r&&u.shiftKey===s&&u.altKey===o&&u.ctrlKey===i&&(u.preventDefault(),l.current())};return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[a,r,s,o,i]),{trigger:()=>l.current(),label:n.map(c=>c==="meta"||c==="ctrl"||c==="alt"||c==="shift"||c==="option"?t8[e8()?"apple":"other"][c]:c.toUpperCase()).join(" ")}};var yE=1,r8=.9,s8=.8,o8=.17,zm=.1,Wm=.999,i8=.9999,a8=.99,l8=/[\\\/_+.#"@\[\(\{&]/,c8=/[\\\/_+.#"@\[\(\{&]/g,u8=/[\s-]/,pP=/[\s-]/g;function sy(e,t,n,r,s,o,i){if(o===t.length)return s===e.length?yE:a8;var a=`${s},${o}`;if(i[a]!==void 0)return i[a];for(var l=r.charAt(o),c=n.indexOf(l,s),u=0,f,p,g,y;c>=0;)f=sy(e,t,n,r,c+1,o+1,i),f>u&&(c===s?f*=yE:l8.test(e.charAt(c-1))?(f*=s8,g=e.slice(s,c-1).match(c8),g&&s>0&&(f*=Math.pow(Wm,g.length))):u8.test(e.charAt(c-1))?(f*=r8,y=e.slice(s,c-1).match(pP),y&&s>0&&(f*=Math.pow(Wm,y.length))):(f*=o8,s>0&&(f*=Math.pow(Wm,c-s))),e.charAt(c)!==t.charAt(o)&&(f*=i8)),(f<zm&&n.charAt(c-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(c-1)!==r.charAt(o))&&(p=sy(e,t,n,r,c+1,o+2,i),p*zm>f&&(f=p*zm)),f>u&&(u=f),c=n.indexOf(l,c+1);return i[a]=u,u}function bE(e){return e.toLowerCase().replace(pP," ")}function d8(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,sy(e,t,bE(e),bE(t),0,0,{})}var qm="focusScope.autoFocusOnMount",Hm="focusScope.autoFocusOnUnmount",xE={bubbles:!1,cancelable:!0},f8="FocusScope",wp=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,l]=h.useState(null),c=qn(s),u=qn(o),f=h.useRef(null),p=tt(t,m=>l(m)),g=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let m=function(w){if(g.paused||!a)return;const _=w.target;a.contains(_)?f.current=_:mo(f.current,{select:!0})},v=function(w){if(g.paused||!a)return;const _=w.relatedTarget;_!==null&&(a.contains(_)||mo(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&mo(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const x=new MutationObserver(b);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),x.disconnect()}}},[r,a,g.paused]),h.useEffect(()=>{if(a){_E.add(g);const m=document.activeElement;if(!a.contains(m)){const b=new CustomEvent(qm,xE);a.addEventListener(qm,c),a.dispatchEvent(b),b.defaultPrevented||(h8(y8(mP(a)),{select:!0}),document.activeElement===m&&mo(a))}return()=>{a.removeEventListener(qm,c),setTimeout(()=>{const b=new CustomEvent(Hm,xE);a.addEventListener(Hm,u),a.dispatchEvent(b),b.defaultPrevented||mo(m??document.body,{select:!0}),a.removeEventListener(Hm,u),_E.remove(g)},0)}}},[a,c,u,g]);const y=h.useCallback(m=>{if(!n&&!r||g.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(v&&b){const x=m.currentTarget,[w,_]=p8(x);w&&_?!m.shiftKey&&b===_?(m.preventDefault(),n&&mo(w,{select:!0})):m.shiftKey&&b===w&&(m.preventDefault(),n&&mo(_,{select:!0})):b===x&&m.preventDefault()}},[n,r,g.paused]);return d.jsx($e.div,{tabIndex:-1,...i,ref:p,onKeyDown:y})});wp.displayName=f8;function h8(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(mo(r,{select:t}),document.activeElement!==n)return}function p8(e){const t=mP(e),n=wE(t,e),r=wE(t.reverse(),e);return[n,r]}function mP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function wE(e,t){for(const n of e)if(!m8(n,{upTo:t}))return n}function m8(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function g8(e){return e instanceof HTMLInputElement&&"select"in e}function mo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&g8(e)&&t&&e.select()}}var _E=v8();function v8(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=EE(e,t),e.unshift(t)},remove(t){var n;e=EE(e,t),(n=e[0])==null||n.resume()}}}function EE(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function y8(e){return e.filter(t=>t.tagName!=="A")}var Gm=0;function xx(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??SE()),document.body.insertAdjacentElement("beforeend",e[1]??SE()),Gm++,()=>{Gm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Gm--}},[])}function SE(){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 Dt=function(){return Dt=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Dt.apply(this,arguments)};function _p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function wx(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,o;r<s;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var ol="right-scroll-bar-position",il="width-before-scroll-bar",b8="with-scroll-bars-hidden",x8="--removed-body-scroll-bar-size";function Km(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function w8(e,t){var n=h.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var _8=typeof window<"u"?h.useLayoutEffect:h.useEffect,CE=new WeakMap;function _x(e,t){var n=w8(null,function(r){return e.forEach(function(s){return Km(s,r)})});return _8(function(){var r=CE.get(n);if(r){var s=new Set(r),o=new Set(e),i=n.current;s.forEach(function(a){o.has(a)||Km(a,null)}),o.forEach(function(a){s.has(a)||Km(a,i)})}CE.set(n,e)},[e]),n}function E8(e){return e}function S8(e,t){t===void 0&&(t=E8);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(o){var i=t(o,r);return n.push(i),function(){n=n.filter(function(a){return a!==i})}},assignSyncMedium:function(o){for(r=!0;n.length;){var i=n;n=[],i.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var i=[];if(n.length){var a=n;n=[],a.forEach(o),i=n}var l=function(){var u=i;i=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),n}}}};return s}function Ex(e){e===void 0&&(e={});var t=S8(null);return t.options=Dt({async:!0,ssr:!1},e),t}var gP=function(e){var t=e.sideCar,n=_p(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return h.createElement(r,Dt({},n))};gP.isSideCarExport=!0;function Sx(e,t){return e.useMedium(t),gP}var vP=Ex(),Ym=function(){},Ep=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:Ym,onWheelCapture:Ym,onTouchMoveCapture:Ym}),s=r[0],o=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,g=e.noIsolation,y=e.inert,m=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,x=e.gapMode,w=_p(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=p,E=_x([n,t]),S=Dt(Dt({},w),s);return h.createElement(h.Fragment,null,u&&h.createElement(_,{sideCar:vP,removeScrollBar:c,shards:f,noIsolation:g,inert:y,setCallbacks:o,allowPinchZoom:!!m,lockRef:n,gapMode:x}),i?h.cloneElement(h.Children.only(a),Dt(Dt({},S),{ref:E})):h.createElement(b,Dt({},S,{className:l,ref:E}),a))});Ep.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ep.classNames={fullWidth:il,zeroRight:ol};var C8=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function T8(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=C8();return t&&e.setAttribute("nonce",t),e}function R8(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function N8(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var P8=function(){var e=0,t=null;return{add:function(n){e==0&&(t=T8())&&(R8(t,n),N8(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},j8=function(){var e=P8();return function(t,n){h.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Sp=function(){var e=j8(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},A8={left:0,top:0,right:0,gap:0},Zm=function(e){return parseInt(e||"",10)||0},$8=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Zm(n),Zm(r),Zm(s)]},D8=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return A8;var t=$8(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},k8=Sp(),al="data-scroll-locked",O8=function(e,t,n,r){var s=e.left,o=e.top,i=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
290
|
+
.`.concat(b8,` {
|
291
|
+
overflow: hidden `).concat(r,`;
|
292
|
+
padding-right: `).concat(a,"px ").concat(r,`;
|
293
|
+
}
|
294
|
+
body[`).concat(al,`] {
|
295
|
+
overflow: hidden `).concat(r,`;
|
296
|
+
overscroll-behavior: contain;
|
297
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
298
|
+
padding-left: `.concat(s,`px;
|
299
|
+
padding-top: `).concat(o,`px;
|
300
|
+
padding-right: `).concat(i,`px;
|
301
|
+
margin-left:0;
|
302
|
+
margin-top:0;
|
303
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
304
|
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
305
|
+
}
|
306
|
+
|
307
|
+
.`).concat(ol,` {
|
308
|
+
right: `).concat(a,"px ").concat(r,`;
|
309
|
+
}
|
310
|
+
|
311
|
+
.`).concat(il,` {
|
312
|
+
margin-right: `).concat(a,"px ").concat(r,`;
|
313
|
+
}
|
314
|
+
|
315
|
+
.`).concat(ol," .").concat(ol,` {
|
316
|
+
right: 0 `).concat(r,`;
|
317
|
+
}
|
318
|
+
|
319
|
+
.`).concat(il," .").concat(il,` {
|
320
|
+
margin-right: 0 `).concat(r,`;
|
321
|
+
}
|
322
|
+
|
323
|
+
body[`).concat(al,`] {
|
324
|
+
`).concat(x8,": ").concat(a,`px;
|
325
|
+
}
|
326
|
+
`)},TE=function(){var e=parseInt(document.body.getAttribute(al)||"0",10);return isFinite(e)?e:0},M8=function(){h.useEffect(function(){return document.body.setAttribute(al,(TE()+1).toString()),function(){var e=TE()-1;e<=0?document.body.removeAttribute(al):document.body.setAttribute(al,e.toString())}},[])},Cx=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;M8();var o=h.useMemo(function(){return D8(s)},[s]);return h.createElement(k8,{styles:O8(o,!t,s,n?"":"!important")})},oy=!1;if(typeof window<"u")try{var ef=Object.defineProperty({},"passive",{get:function(){return oy=!0,!0}});window.addEventListener("test",ef,ef),window.removeEventListener("test",ef,ef)}catch{oy=!1}var Aa=oy?{passive:!1}:!1,I8=function(e){return e.tagName==="TEXTAREA"},yP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!I8(e)&&n[t]==="visible")},F8=function(e){return yP(e,"overflowY")},L8=function(e){return yP(e,"overflowX")},RE=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=bP(e,r);if(s){var o=xP(e,r),i=o[1],a=o[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},U8=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},B8=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},bP=function(e,t){return e==="v"?F8(t):L8(t)},xP=function(e,t){return e==="v"?U8(t):B8(t)},V8=function(e,t){return e==="h"&&t==="rtl"?-1:1},z8=function(e,t,n,r,s){var o=V8(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,l=t.contains(a),c=!1,u=i>0,f=0,p=0;do{var g=xP(e,a),y=g[0],m=g[1],v=g[2],b=m-v-o*y;(y||b)&&bP(e,a)&&(f+=b,p+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(f)<1||!u&&Math.abs(p)<1)&&(c=!0),c},tf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},NE=function(e){return[e.deltaX,e.deltaY]},PE=function(e){return e&&"current"in e?e.current:e},W8=function(e,t){return e[0]===t[0]&&e[1]===t[1]},q8=function(e){return`
|
327
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
328
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
329
|
+
`)},H8=0,$a=[];function G8(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(H8++)[0],o=h.useState(Sp)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=wx([e.lockRef.current],(e.shards||[]).map(PE),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(m,v){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var b=tf(m),x=n.current,w="deltaX"in m?m.deltaX:x[0]-b[0],_="deltaY"in m?m.deltaY:x[1]-b[1],E,S=m.target,R=Math.abs(w)>Math.abs(_)?"h":"v";if("touches"in m&&R==="h"&&S.type==="range")return!1;var C=RE(R,S);if(!C)return!0;if(C?E=R:(E=R==="v"?"h":"v",C=RE(R,S)),!C)return!1;if(!r.current&&"changedTouches"in m&&(w||_)&&(r.current=E),!E)return!0;var N=r.current||E;return z8(N,v,m,N==="h"?w:_)},[]),l=h.useCallback(function(m){var v=m;if(!(!$a.length||$a[$a.length-1]!==o)){var b="deltaY"in v?NE(v):tf(v),x=t.current.filter(function(E){return E.name===v.type&&(E.target===v.target||v.target===E.shadowParent)&&W8(E.delta,b)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var w=(i.current.shards||[]).map(PE).filter(Boolean).filter(function(E){return E.contains(v.target)}),_=w.length>0?a(v,w[0]):!i.current.noIsolation;_&&v.cancelable&&v.preventDefault()}}},[]),c=h.useCallback(function(m,v,b,x){var w={name:m,delta:v,target:b,should:x,shadowParent:K8(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(_){return _!==w})},1)},[]),u=h.useCallback(function(m){n.current=tf(m),r.current=void 0},[]),f=h.useCallback(function(m){c(m.type,NE(m),m.target,a(m,e.lockRef.current))},[]),p=h.useCallback(function(m){c(m.type,tf(m),m.target,a(m,e.lockRef.current))},[]);h.useEffect(function(){return $a.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Aa),document.addEventListener("touchmove",l,Aa),document.addEventListener("touchstart",u,Aa),function(){$a=$a.filter(function(m){return m!==o}),document.removeEventListener("wheel",l,Aa),document.removeEventListener("touchmove",l,Aa),document.removeEventListener("touchstart",u,Aa)}},[]);var g=e.removeScrollBar,y=e.inert;return h.createElement(h.Fragment,null,y?h.createElement(o,{styles:q8(s)}):null,g?h.createElement(Cx,{gapMode:e.gapMode}):null)}function K8(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Y8=Sx(vP,G8);var Cp=h.forwardRef(function(e,t){return h.createElement(Ep,Dt({},e,{ref:t,sideCar:Y8}))});Cp.classNames=Ep.classNames;var Z8=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Da=new WeakMap,nf=new WeakMap,rf={},Qm=0,wP=function(e){return e&&(e.host||wP(e.parentNode))},Q8=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=wP(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},X8=function(e,t,n,r){var s=Q8(t,Array.isArray(e)?e:[e]);rf[n]||(rf[n]=new WeakMap);var o=rf[n],i=[],a=new Set,l=new Set(s),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};s.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(a.has(p))u(p);else try{var g=p.getAttribute(r),y=g!==null&&g!=="false",m=(Da.get(p)||0)+1,v=(o.get(p)||0)+1;Da.set(p,m),o.set(p,v),i.push(p),m===1&&y&&nf.set(p,!0),v===1&&p.setAttribute(n,"true"),y||p.setAttribute(r,"true")}catch(b){console.error("aria-hidden: cannot operate on ",p,b)}})};return u(t),a.clear(),Qm++,function(){i.forEach(function(f){var p=Da.get(f)-1,g=o.get(f)-1;Da.set(f,p),o.set(f,g),p||(nf.has(f)||f.removeAttribute(r),nf.delete(f)),g||f.removeAttribute(n)}),Qm--,Qm||(Da=new WeakMap,Da=new WeakMap,nf=new WeakMap,rf={})}},ad=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=Z8(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live]"))),X8(r,s,n,"aria-hidden")):function(){return null}},Tp="Dialog",[_P,Joe]=Vr(Tp),[J8,Gr]=_P(Tp),EP=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=h.useRef(null),l=h.useRef(null),[c,u]=Ys({prop:r,defaultProp:s??!1,onChange:o,caller:Tp});return d.jsx(J8,{scope:t,triggerRef:a,contentRef:l,contentId:fn(),titleId:fn(),descriptionId:fn(),open:c,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(f=>!f),[u]),modal:i,children:n})};EP.displayName=Tp;var SP="DialogTrigger",ez=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gr(SP,n),o=tt(t,s.triggerRef);return d.jsx($e.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Nx(s.open),...r,ref:o,onClick:me(e.onClick,s.onOpenToggle)})});ez.displayName=SP;var Tx="DialogPortal",[tz,CP]=_P(Tx,{forceMount:void 0}),TP=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Gr(Tx,t);return d.jsx(tz,{scope:t,forceMount:n,children:h.Children.map(r,i=>d.jsx(zr,{present:n||o.open,children:d.jsx(td,{asChild:!0,container:s,children:i})}))})};TP.displayName=Tx;var uh="DialogOverlay",RP=h.forwardRef((e,t)=>{const n=CP(uh,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Gr(uh,e.__scopeDialog);return o.modal?d.jsx(zr,{present:r||o.open,children:d.jsx(rz,{...s,ref:t})}):null});RP.displayName=uh;var nz=ea("DialogOverlay.RemoveScroll"),rz=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gr(uh,n);return d.jsx(Cp,{as:nz,allowPinchZoom:!0,shards:[s.contentRef],children:d.jsx($e.div,{"data-state":Nx(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),la="DialogContent",NP=h.forwardRef((e,t)=>{const n=CP(la,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Gr(la,e.__scopeDialog);return d.jsx(zr,{present:r||o.open,children:o.modal?d.jsx(sz,{...s,ref:t}):d.jsx(oz,{...s,ref:t})})});NP.displayName=la;var sz=h.forwardRef((e,t)=>{const n=Gr(la,e.__scopeDialog),r=h.useRef(null),s=tt(t,n.contentRef,r);return h.useEffect(()=>{const o=r.current;if(o)return ad(o)},[]),d.jsx(PP,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:me(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:me(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:me(e.onFocusOutside,o=>o.preventDefault())})}),oz=h.forwardRef((e,t)=>{const n=Gr(la,e.__scopeDialog),r=h.useRef(!1),s=h.useRef(!1);return d.jsx(PP,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),PP=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=Gr(la,n),l=h.useRef(null),c=tt(t,l);return xx(),d.jsxs(d.Fragment,{children:[d.jsx(wp,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:d.jsx(Wl,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Nx(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(cz,{titleId:a.titleId}),d.jsx(dz,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Rx="DialogTitle",iz=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gr(Rx,n);return d.jsx($e.h2,{id:s.titleId,...r,ref:t})});iz.displayName=Rx;var jP="DialogDescription",az=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gr(jP,n);return d.jsx($e.p,{id:s.descriptionId,...r,ref:t})});az.displayName=jP;var AP="DialogClose",lz=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Gr(AP,n);return d.jsx($e.button,{type:"button",...r,ref:t,onClick:me(e.onClick,()=>s.onOpenChange(!1))})});lz.displayName=AP;function Nx(e){return e?"open":"closed"}var $P="DialogTitleWarning",[eie,DP]=VI($P,{contentName:la,titleName:Rx,docsSlug:"dialog"}),cz=({titleId:e})=>{const t=DP($P),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
330
|
+
|
331
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
332
|
+
|
333
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},uz="DialogDescriptionWarning",dz=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${DP(uz).contentName}}.`;return h.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},fz=EP,hz=TP,pz=RP,mz=NP,Ec='[cmdk-group=""]',Xm='[cmdk-group-items=""]',gz='[cmdk-group-heading=""]',kP='[cmdk-item=""]',jE=`${kP}:not([aria-disabled="true"])`,iy="cmdk-item-select",Ba="data-value",vz=(e,t,n)=>d8(e,t,n),OP=h.createContext(void 0),ld=()=>h.useContext(OP),MP=h.createContext(void 0),Px=()=>h.useContext(MP),IP=h.createContext(void 0),FP=h.forwardRef((e,t)=>{let n=Va(()=>{var M,Q;return{search:"",value:(Q=(M=e.value)!=null?M:e.defaultValue)!=null?Q:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Va(()=>new Set),s=Va(()=>new Map),o=Va(()=>new Map),i=Va(()=>new Set),a=LP(e),{label:l,children:c,value:u,onValueChange:f,filter:p,shouldFilter:g,loop:y,disablePointerSelection:m=!1,vimBindings:v=!0,...b}=e,x=fn(),w=fn(),_=fn(),E=h.useRef(null),S=Nz();ca(()=>{if(u!==void 0){let M=u.trim();n.current.value=M,R.emit()}},[u]),ca(()=>{S(6,G)},[]);let R=h.useMemo(()=>({subscribe:M=>(i.current.add(M),()=>i.current.delete(M)),snapshot:()=>n.current,setState:(M,Q,H)=>{var K,ae,te,Re;if(!Object.is(n.current[M],Q)){if(n.current[M]=Q,M==="search")L(),k(),S(1,V);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let Ce=document.getElementById(_);Ce?Ce.focus():(K=document.getElementById(x))==null||K.focus()}if(S(7,()=>{var Ce;n.current.selectedItemId=(Ce=$())==null?void 0:Ce.id,R.emit()}),H||S(5,G),((ae=a.current)==null?void 0:ae.value)!==void 0){let Ce=Q??"";(Re=(te=a.current).onValueChange)==null||Re.call(te,Ce);return}}R.emit()}},emit:()=>{i.current.forEach(M=>M())}}),[]),C=h.useMemo(()=>({value:(M,Q,H)=>{var K;Q!==((K=o.current.get(M))==null?void 0:K.value)&&(o.current.set(M,{value:Q,keywords:H}),n.current.filtered.items.set(M,N(Q,H)),S(2,()=>{k(),R.emit()}))},item:(M,Q)=>(r.current.add(M),Q&&(s.current.has(Q)?s.current.get(Q).add(M):s.current.set(Q,new Set([M]))),S(3,()=>{L(),k(),n.current.value||V(),R.emit()}),()=>{o.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let H=$();S(4,()=>{L(),(H==null?void 0:H.getAttribute("id"))===M&&V(),R.emit()})}),group:M=>(s.current.has(M)||s.current.set(M,new Set),()=>{o.current.delete(M),s.current.delete(M)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:x,inputId:_,labelId:w,listInnerRef:E}),[]);function N(M,Q){var H,K;let ae=(K=(H=a.current)==null?void 0:H.filter)!=null?K:vz;return M?ae(M,n.current.search,Q):0}function k(){if(!n.current.search||a.current.shouldFilter===!1)return;let M=n.current.filtered.items,Q=[];n.current.filtered.groups.forEach(K=>{let ae=s.current.get(K),te=0;ae.forEach(Re=>{let Ce=M.get(Re);te=Math.max(Ce,te)}),Q.push([K,te])});let H=E.current;I().sort((K,ae)=>{var te,Re;let Ce=K.getAttribute("id"),ue=ae.getAttribute("id");return((te=M.get(ue))!=null?te:0)-((Re=M.get(Ce))!=null?Re:0)}).forEach(K=>{let ae=K.closest(Xm);ae?ae.appendChild(K.parentElement===ae?K:K.closest(`${Xm} > *`)):H.appendChild(K.parentElement===H?K:K.closest(`${Xm} > *`))}),Q.sort((K,ae)=>ae[1]-K[1]).forEach(K=>{var ae;let te=(ae=E.current)==null?void 0:ae.querySelector(`${Ec}[${Ba}="${encodeURIComponent(K[0])}"]`);te==null||te.parentElement.appendChild(te)})}function V(){let M=I().find(H=>H.getAttribute("aria-disabled")!=="true"),Q=M==null?void 0:M.getAttribute(Ba);R.setState("value",Q||void 0)}function L(){var M,Q,H,K;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ae=0;for(let te of r.current){let Re=(Q=(M=o.current.get(te))==null?void 0:M.value)!=null?Q:"",Ce=(K=(H=o.current.get(te))==null?void 0:H.keywords)!=null?K:[],ue=N(Re,Ce);n.current.filtered.items.set(te,ue),ue>0&&ae++}for(let[te,Re]of s.current)for(let Ce of Re)if(n.current.filtered.items.get(Ce)>0){n.current.filtered.groups.add(te);break}n.current.filtered.count=ae}function G(){var M,Q,H;let K=$();K&&(((M=K.parentElement)==null?void 0:M.firstChild)===K&&((H=(Q=K.closest(Ec))==null?void 0:Q.querySelector(gz))==null||H.scrollIntoView({block:"nearest"})),K.scrollIntoView({block:"nearest"}))}function $(){var M;return(M=E.current)==null?void 0:M.querySelector(`${kP}[aria-selected="true"]`)}function I(){var M;return Array.from(((M=E.current)==null?void 0:M.querySelectorAll(jE))||[])}function j(M){let Q=I()[M];Q&&R.setState("value",Q.getAttribute(Ba))}function F(M){var Q;let H=$(),K=I(),ae=K.findIndex(Re=>Re===H),te=K[ae+M];(Q=a.current)!=null&&Q.loop&&(te=ae+M<0?K[K.length-1]:ae+M===K.length?K[0]:K[ae+M]),te&&R.setState("value",te.getAttribute(Ba))}function O(M){let Q=$(),H=Q==null?void 0:Q.closest(Ec),K;for(;H&&!K;)H=M>0?Tz(H,Ec):Rz(H,Ec),K=H==null?void 0:H.querySelector(jE);K?R.setState("value",K.getAttribute(Ba)):F(M)}let U=()=>j(I().length-1),Y=M=>{M.preventDefault(),M.metaKey?U():M.altKey?O(1):F(1)},ee=M=>{M.preventDefault(),M.metaKey?j(0):M.altKey?O(-1):F(-1)};return h.createElement($e.div,{ref:t,tabIndex:-1,...b,"cmdk-root":"",onKeyDown:M=>{var Q;(Q=b.onKeyDown)==null||Q.call(b,M);let H=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||H))switch(M.key){case"n":case"j":{v&&M.ctrlKey&&Y(M);break}case"ArrowDown":{Y(M);break}case"p":case"k":{v&&M.ctrlKey&&ee(M);break}case"ArrowUp":{ee(M);break}case"Home":{M.preventDefault(),j(0);break}case"End":{M.preventDefault(),U();break}case"Enter":{M.preventDefault();let K=$();if(K){let ae=new Event(iy);K.dispatchEvent(ae)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:jz},l),Rp(e,M=>h.createElement(MP.Provider,{value:R},h.createElement(OP.Provider,{value:C},M))))}),yz=h.forwardRef((e,t)=>{var n,r;let s=fn(),o=h.useRef(null),i=h.useContext(IP),a=ld(),l=LP(e),c=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;ca(()=>{if(!c)return a.item(s,i==null?void 0:i.id)},[c]);let u=UP(s,o,[e.value,e.children,o],e.keywords),f=Px(),p=Zo(S=>S.value&&S.value===u.current),g=Zo(S=>c||a.filter()===!1?!0:S.search?S.filtered.items.get(s)>0:!0);h.useEffect(()=>{let S=o.current;if(!(!S||e.disabled))return S.addEventListener(iy,y),()=>S.removeEventListener(iy,y)},[g,e.onSelect,e.disabled]);function y(){var S,R;m(),(R=(S=l.current).onSelect)==null||R.call(S,u.current)}function m(){f.setState("value",u.current,!0)}if(!g)return null;let{disabled:v,value:b,onSelect:x,forceMount:w,keywords:_,...E}=e;return h.createElement($e.div,{ref:Hs(o,t),...E,id:s,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||a.getDisablePointerSelection()?void 0:m,onClick:v?void 0:y},e.children)}),bz=h.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...o}=e,i=fn(),a=h.useRef(null),l=h.useRef(null),c=fn(),u=ld(),f=Zo(g=>s||u.filter()===!1?!0:g.search?g.filtered.groups.has(i):!0);ca(()=>u.group(i),[]),UP(i,a,[e.value,e.heading,l]);let p=h.useMemo(()=>({id:i,forceMount:s}),[s]);return h.createElement($e.div,{ref:Hs(a,t),...o,"cmdk-group":"",role:"presentation",hidden:f?void 0:!0},n&&h.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:c},n),Rp(e,g=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?c:void 0},h.createElement(IP.Provider,{value:p},g))))}),xz=h.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=h.useRef(null),o=Zo(i=>!i.search);return!n&&!o?null:h.createElement($e.div,{ref:Hs(s,t),...r,"cmdk-separator":"",role:"separator"})}),wz=h.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,o=Px(),i=Zo(c=>c.search),a=Zo(c=>c.selectedItemId),l=ld();return h.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),h.createElement($e.input,{ref:t,...r,"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":a,id:l.inputId,type:"text",value:s?e.value:i,onChange:c=>{s||o.setState("search",c.target.value),n==null||n(c.target.value)}})}),_z=h.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,o=h.useRef(null),i=h.useRef(null),a=Zo(c=>c.selectedItemId),l=ld();return h.useEffect(()=>{if(i.current&&o.current){let c=i.current,u=o.current,f,p=new ResizeObserver(()=>{f=requestAnimationFrame(()=>{let g=c.offsetHeight;u.style.setProperty("--cmdk-list-height",g.toFixed(1)+"px")})});return p.observe(c),()=>{cancelAnimationFrame(f),p.unobserve(c)}}},[]),h.createElement($e.div,{ref:Hs(o,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:l.listId},Rp(e,c=>h.createElement("div",{ref:Hs(i,l.listInnerRef),"cmdk-list-sizer":""},c)))}),Ez=h.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:o,container:i,...a}=e;return h.createElement(fz,{open:n,onOpenChange:r},h.createElement(hz,{container:i},h.createElement(pz,{"cmdk-overlay":"",className:s}),h.createElement(mz,{"aria-label":e.label,"cmdk-dialog":"",className:o},h.createElement(FP,{ref:t,...a}))))}),Sz=h.forwardRef((e,t)=>Zo(n=>n.filtered.count===0)?h.createElement($e.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Cz=h.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...o}=e;return h.createElement($e.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Rp(e,i=>h.createElement("div",{"aria-hidden":!0},i)))}),Hn=Object.assign(FP,{List:_z,Item:yz,Input:wz,Group:bz,Separator:xz,Dialog:Ez,Empty:Sz,Loading:Cz});function Tz(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Rz(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function LP(e){let t=h.useRef(e);return ca(()=>{t.current=e}),t}var ca=typeof window>"u"?h.useEffect:h.useLayoutEffect;function Va(e){let t=h.useRef();return t.current===void 0&&(t.current=e()),t}function Zo(e){let t=Px(),n=()=>e(t.snapshot());return h.useSyncExternalStore(t.subscribe,n,n)}function UP(e,t,n,r=[]){let s=h.useRef(),o=ld();return ca(()=>{var i;let a=(()=>{var c;for(let u of n){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(c=u.current.textContent)==null?void 0:c.trim():s.current}})(),l=r.map(c=>c.trim());o.value(e,a,l),(i=t.current)==null||i.setAttribute(Ba,a),s.current=a}),s}var Nz=()=>{let[e,t]=h.useState(),n=Va(()=>new Map);return ca(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function Pz(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Rp({asChild:e,children:t},n){return e&&h.isValidElement(t)?h.cloneElement(Pz(t),{ref:t.ref},n(t.props.children)):n(t)}var jz={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Zt(){return Zt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zt.apply(null,arguments)}function Uo(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Az(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function BP(...e){return t=>e.forEach(n=>Az(n,t))}function Yl(...e){return h.useCallback(BP(...e),e)}function $z(e,t){const n=h.createContext(t);function r(o){const{children:i,...a}=o,l=h.useMemo(()=>a,Object.values(a));return h.createElement(n.Provider,{value:l},i)}function s(o){const i=h.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function Dz(e,t=[]){let n=[];function r(o,i){const a=h.createContext(i),l=n.length;n=[...n,i];function c(f){const{scope:p,children:g,...y}=f,m=(p==null?void 0:p[e][l])||a,v=h.useMemo(()=>y,Object.values(y));return h.createElement(m.Provider,{value:v},g)}function u(f,p){const g=(p==null?void 0:p[e][l])||a,y=h.useContext(g);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,u]}const s=()=>{const o=n.map(i=>h.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[r,kz(s,...t)]}function kz(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}const ay=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Oz=qs.useId||(()=>{});let Mz=0;function Jm(e){const[t,n]=h.useState(Oz());return ay(()=>{n(r=>r??String(Mz++))},[e]),e||(t?`radix-${t}`:"")}function ua(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Iz({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=Fz({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,a=ua(n),l=h.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else s(c)},[o,e,s,a]);return[i,l]}function Fz({defaultProp:e,onChange:t}){const n=h.useState(e),[r]=n,s=h.useRef(r),o=ua(t);return h.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}const jx=h.forwardRef((e,t)=>{const{children:n,...r}=e,s=h.Children.toArray(n),o=s.find(Uz);if(o){const i=o.props.children,a=s.map(l=>l===o?h.Children.count(i)>1?h.Children.only(null):h.isValidElement(i)?i.props.children:null:l);return h.createElement(ly,Zt({},r,{ref:t}),h.isValidElement(i)?h.cloneElement(i,void 0,a):null)}return h.createElement(ly,Zt({},r,{ref:t}),n)});jx.displayName="Slot";const ly=h.forwardRef((e,t)=>{const{children:n,...r}=e;return h.isValidElement(n)?h.cloneElement(n,{...Bz(r,n.props),ref:t?BP(t,n.ref):n.ref}):h.Children.count(n)>1?h.Children.only(null):null});ly.displayName="SlotClone";const Lz=({children:e})=>h.createElement(h.Fragment,null,e);function Uz(e){return h.isValidElement(e)&&e.type===Lz}function Bz(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{o(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}const Vz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],ui=Vz.reduce((e,t)=>{const n=h.forwardRef((r,s)=>{const{asChild:o,...i}=r,a=o?jx:t;return h.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),h.createElement(a,Zt({},i,{ref:s}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function zz(e,t){e&&Cr.flushSync(()=>e.dispatchEvent(t))}function Wz(e,t=globalThis==null?void 0:globalThis.document){const n=ua(e);h.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const cy="dismissableLayer.update",qz="dismissableLayer.pointerDownOutside",Hz="dismissableLayer.focusOutside";let AE;const Gz=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kz=h.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...c}=e,u=h.useContext(Gz),[f,p]=h.useState(null),g=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,y]=h.useState({}),m=Yl(t,C=>p(C)),v=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=v.indexOf(b),w=f?v.indexOf(f):-1,_=u.layersWithOutsidePointerEventsDisabled.size>0,E=w>=x,S=Yz(C=>{const N=C.target,k=[...u.branches].some(V=>V.contains(N));!E||k||(o==null||o(C),a==null||a(C),C.defaultPrevented||l==null||l())},g),R=Zz(C=>{const N=C.target;[...u.branches].some(V=>V.contains(N))||(i==null||i(C),a==null||a(C),C.defaultPrevented||l==null||l())},g);return Wz(C=>{w===u.layers.size-1&&(s==null||s(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},g),h.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(AE=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),$E(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=AE)}},[f,g,r,u]),h.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),$E())},[f,u]),h.useEffect(()=>{const C=()=>y({});return document.addEventListener(cy,C),()=>document.removeEventListener(cy,C)},[]),h.createElement(ui.div,Zt({},c,{ref:m,style:{pointerEvents:_?E?"auto":"none":void 0,...e.style},onFocusCapture:Uo(e.onFocusCapture,R.onFocusCapture),onBlurCapture:Uo(e.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Uo(e.onPointerDownCapture,S.onPointerDownCapture)}))});function Yz(e,t=globalThis==null?void 0:globalThis.document){const n=ua(e),r=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let c=function(){VP(qz,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=c,t.addEventListener("click",s.current,{once:!0})):c()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Zz(e,t=globalThis==null?void 0:globalThis.document){const n=ua(e),r=h.useRef(!1);return h.useEffect(()=>{const s=o=>{o.target&&!r.current&&VP(Hz,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function $E(){const e=new CustomEvent(cy);document.dispatchEvent(e)}function VP(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?zz(s,o):s.dispatchEvent(o)}const eg="focusScope.autoFocusOnMount",tg="focusScope.autoFocusOnUnmount",DE={bubbles:!1,cancelable:!0},Qz=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,l]=h.useState(null),c=ua(s),u=ua(o),f=h.useRef(null),p=Yl(t,m=>l(m)),g=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let m=function(w){if(g.paused||!a)return;const _=w.target;a.contains(_)?f.current=_:go(f.current,{select:!0})},v=function(w){if(g.paused||!a)return;const _=w.relatedTarget;_!==null&&(a.contains(_)||go(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&go(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const x=new MutationObserver(b);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),x.disconnect()}}},[r,a,g.paused]),h.useEffect(()=>{if(a){OE.add(g);const m=document.activeElement;if(!a.contains(m)){const b=new CustomEvent(eg,DE);a.addEventListener(eg,c),a.dispatchEvent(b),b.defaultPrevented||(Xz(rW(zP(a)),{select:!0}),document.activeElement===m&&go(a))}return()=>{a.removeEventListener(eg,c),setTimeout(()=>{const b=new CustomEvent(tg,DE);a.addEventListener(tg,u),a.dispatchEvent(b),b.defaultPrevented||go(m??document.body,{select:!0}),a.removeEventListener(tg,u),OE.remove(g)},0)}}},[a,c,u,g]);const y=h.useCallback(m=>{if(!n&&!r||g.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(v&&b){const x=m.currentTarget,[w,_]=Jz(x);w&&_?!m.shiftKey&&b===_?(m.preventDefault(),n&&go(w,{select:!0})):m.shiftKey&&b===w&&(m.preventDefault(),n&&go(_,{select:!0})):b===x&&m.preventDefault()}},[n,r,g.paused]);return h.createElement(ui.div,Zt({tabIndex:-1},i,{ref:p,onKeyDown:y}))});function Xz(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(go(r,{select:t}),document.activeElement!==n)return}function Jz(e){const t=zP(e),n=kE(t,e),r=kE(t.reverse(),e);return[n,r]}function zP(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function kE(e,t){for(const n of e)if(!eW(n,{upTo:t}))return n}function eW(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function tW(e){return e instanceof HTMLInputElement&&"select"in e}function go(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&tW(e)&&t&&e.select()}}const OE=nW();function nW(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=ME(e,t),e.unshift(t)},remove(t){var n;e=ME(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function ME(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function rW(e){return e.filter(t=>t.tagName!=="A")}const sW=h.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...s}=e;return r?cb.createPortal(h.createElement(ui.div,Zt({},s,{ref:t})),r):null});function oW(e,t){return h.useReducer((n,r)=>{const s=t[n][r];return s??n},e)}const Np=e=>{const{present:t,children:n}=e,r=iW(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),o=Yl(r.ref,s.ref);return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:o}):null};Np.displayName="Presence";function iW(e){const[t,n]=h.useState(),r=h.useRef({}),s=h.useRef(e),o=h.useRef("none"),i=e?"mounted":"unmounted",[a,l]=oW(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const c=sf(r.current);o.current=a==="mounted"?c:"none"},[a]),ay(()=>{const c=r.current,u=s.current;if(u!==e){const p=o.current,g=sf(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),ay(()=>{if(t){const c=f=>{const g=sf(r.current).includes(f.animationName);f.target===t&&g&&Cr.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(o.current=sf(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function sf(e){return(e==null?void 0:e.animationName)||"none"}let ng=0;function aW(){h.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:IE()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:IE()),ng++,()=>{ng===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),ng--}},[])}function IE(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var WP=Ex(),rg=function(){},Pp=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:rg,onWheelCapture:rg,onTouchMoveCapture:rg}),s=r[0],o=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,g=e.noIsolation,y=e.inert,m=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,x=_p(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),w=p,_=_x([n,t]),E=Dt(Dt({},x),s);return h.createElement(h.Fragment,null,u&&h.createElement(w,{sideCar:WP,removeScrollBar:c,shards:f,noIsolation:g,inert:y,setCallbacks:o,allowPinchZoom:!!m,lockRef:n}),i?h.cloneElement(h.Children.only(a),Dt(Dt({},E),{ref:_})):h.createElement(b,Dt({},E,{className:l,ref:_}),a))});Pp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Pp.classNames={fullWidth:il,zeroRight:ol};var uy=!1;if(typeof window<"u")try{var of=Object.defineProperty({},"passive",{get:function(){return uy=!0,!0}});window.addEventListener("test",of,of),window.removeEventListener("test",of,of)}catch{uy=!1}var ka=uy?{passive:!1}:!1,lW=function(e){return e.tagName==="TEXTAREA"},qP=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!lW(e)&&n[t]==="visible")},cW=function(e){return qP(e,"overflowY")},uW=function(e){return qP(e,"overflowX")},FE=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=HP(e,n);if(r){var s=GP(e,n),o=s[1],i=s[2];if(o>i)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},dW=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},fW=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},HP=function(e,t){return e==="v"?cW(t):uW(t)},GP=function(e,t){return e==="v"?dW(t):fW(t)},hW=function(e,t){return e==="h"&&t==="rtl"?-1:1},pW=function(e,t,n,r,s){var o=hW(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,l=t.contains(a),c=!1,u=i>0,f=0,p=0;do{var g=GP(e,a),y=g[0],m=g[1],v=g[2],b=m-v-o*y;(y||b)&&HP(e,a)&&(f+=b,p+=y),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&f===0||!u&&p===0)&&(c=!0),c},af=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},LE=function(e){return[e.deltaX,e.deltaY]},UE=function(e){return e&&"current"in e?e.current:e},mW=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gW=function(e){return`
|
334
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
335
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
336
|
+
`)},vW=0,Oa=[];function yW(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(vW++)[0],o=h.useState(function(){return Sp()})[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=wx([e.lockRef.current],(e.shards||[]).map(UE),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(m,v){if("touches"in m&&m.touches.length===2)return!i.current.allowPinchZoom;var b=af(m),x=n.current,w="deltaX"in m?m.deltaX:x[0]-b[0],_="deltaY"in m?m.deltaY:x[1]-b[1],E,S=m.target,R=Math.abs(w)>Math.abs(_)?"h":"v";if("touches"in m&&R==="h"&&S.type==="range")return!1;var C=FE(R,S);if(!C)return!0;if(C?E=R:(E=R==="v"?"h":"v",C=FE(R,S)),!C)return!1;if(!r.current&&"changedTouches"in m&&(w||_)&&(r.current=E),!E)return!0;var N=r.current||E;return pW(N,v,m,N==="h"?w:_)},[]),l=h.useCallback(function(m){var v=m;if(!(!Oa.length||Oa[Oa.length-1]!==o)){var b="deltaY"in v?LE(v):af(v),x=t.current.filter(function(E){return E.name===v.type&&E.target===v.target&&mW(E.delta,b)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var w=(i.current.shards||[]).map(UE).filter(Boolean).filter(function(E){return E.contains(v.target)}),_=w.length>0?a(v,w[0]):!i.current.noIsolation;_&&v.cancelable&&v.preventDefault()}}},[]),c=h.useCallback(function(m,v,b,x){var w={name:m,delta:v,target:b,should:x};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(_){return _!==w})},1)},[]),u=h.useCallback(function(m){n.current=af(m),r.current=void 0},[]),f=h.useCallback(function(m){c(m.type,LE(m),m.target,a(m,e.lockRef.current))},[]),p=h.useCallback(function(m){c(m.type,af(m),m.target,a(m,e.lockRef.current))},[]);h.useEffect(function(){return Oa.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,ka),document.addEventListener("touchmove",l,ka),document.addEventListener("touchstart",u,ka),function(){Oa=Oa.filter(function(m){return m!==o}),document.removeEventListener("wheel",l,ka),document.removeEventListener("touchmove",l,ka),document.removeEventListener("touchstart",u,ka)}},[]);var g=e.removeScrollBar,y=e.inert;return h.createElement(h.Fragment,null,y?h.createElement(o,{styles:gW(s)}):null,g?h.createElement(Cx,{gapMode:"margin"}):null)}const bW=Sx(WP,yW);var KP=h.forwardRef(function(e,t){return h.createElement(Pp,Dt({},e,{ref:t,sideCar:bW}))});KP.classNames=Pp.classNames;const YP="Dialog",[ZP,tie]=Dz(YP),[xW,Kr]=ZP(YP),wW=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=h.useRef(null),l=h.useRef(null),[c=!1,u]=Iz({prop:r,defaultProp:s,onChange:o});return h.createElement(xW,{scope:t,triggerRef:a,contentRef:l,contentId:Jm(),titleId:Jm(),descriptionId:Jm(),open:c,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(f=>!f),[u]),modal:i},n)},_W="DialogTrigger",EW=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Kr(_W,n),o=Yl(t,s.triggerRef);return h.createElement(ui.button,Zt({type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Ax(s.open)},r,{ref:o,onClick:Uo(e.onClick,s.onOpenToggle)}))}),QP="DialogPortal",[SW,XP]=ZP(QP,{forceMount:void 0}),CW=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Kr(QP,t);return h.createElement(SW,{scope:t,forceMount:n},h.Children.map(r,i=>h.createElement(Np,{present:n||o.open},h.createElement(sW,{asChild:!0,container:s},i))))},dy="DialogOverlay",TW=h.forwardRef((e,t)=>{const n=XP(dy,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Kr(dy,e.__scopeDialog);return o.modal?h.createElement(Np,{present:r||o.open},h.createElement(RW,Zt({},s,{ref:t}))):null}),RW=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Kr(dy,n);return h.createElement(KP,{as:jx,allowPinchZoom:!0,shards:[s.contentRef]},h.createElement(ui.div,Zt({"data-state":Ax(s.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),jl="DialogContent",NW=h.forwardRef((e,t)=>{const n=XP(jl,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Kr(jl,e.__scopeDialog);return h.createElement(Np,{present:r||o.open},o.modal?h.createElement(PW,Zt({},s,{ref:t})):h.createElement(jW,Zt({},s,{ref:t})))}),PW=h.forwardRef((e,t)=>{const n=Kr(jl,e.__scopeDialog),r=h.useRef(null),s=Yl(t,n.contentRef,r);return h.useEffect(()=>{const o=r.current;if(o)return ad(o)},[]),h.createElement(JP,Zt({},e,{ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Uo(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)===null||i===void 0||i.focus()}),onPointerDownOutside:Uo(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:Uo(e.onFocusOutside,o=>o.preventDefault())}))}),jW=h.forwardRef((e,t)=>{const n=Kr(jl,e.__scopeDialog),r=h.useRef(!1),s=h.useRef(!1);return h.createElement(JP,Zt({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,o),!o.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),o.preventDefault()}r.current=!1,s.current=!1},onInteractOutside:o=>{var i,a;(i=e.onInteractOutside)===null||i===void 0||i.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const l=o.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}}))}),JP=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=Kr(jl,n),l=h.useRef(null),c=Yl(t,l);return aW(),h.createElement(h.Fragment,null,h.createElement(Qz,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o},h.createElement(Kz,Zt({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Ax(a.open)},i,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),ej="DialogTitle",AW=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Kr(ej,n);return h.createElement(ui.h2,Zt({id:s.titleId},r,{ref:t}))}),$W="DialogDescription",DW=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Kr($W,n);return h.createElement(ui.p,Zt({id:s.descriptionId},r,{ref:t}))}),kW="DialogClose",OW=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Kr(kW,n);return h.createElement(ui.button,Zt({type:"button"},r,{ref:t,onClick:Uo(e.onClick,()=>s.onOpenChange(!1))}))});function Ax(e){return e?"open":"closed"}const MW="DialogTitleWarning";$z(MW,{contentName:jl,titleName:ej,docsSlug:"dialog"});const tj=wW,nj=EW,rj=CW,jp=TW,Ap=NW,$p=AW,Dp=DW,$x=OW,cd=tj,sj=nj,IW=rj,fy=$x,oj=h.forwardRef(({className:e,...t},n)=>d.jsx(jp,{ref:n,className:se("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));oj.displayName=jp.displayName;const Zl=h.forwardRef(({className:e,children:t,hideClose:n,...r},s)=>d.jsxs(IW,{children:[d.jsx(oj,{}),d.jsxs(Ap,{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",e),...r,children:[t,!n&&d.jsxs($x,{className:"absolute right-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:[d.jsx(aa,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Zl.displayName=Ap.displayName;const kp=({className:e,...t})=>d.jsx("div",{className:se("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});kp.displayName="DialogHeader";const Dx=({className:e,...t})=>d.jsx("div",{className:se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Dx.displayName="DialogFooter";const ud=h.forwardRef(({className:e,...t},n)=>d.jsx($p,{ref:n,className:se("text-2xl font-semibold leading-none text-center tracking-tight mb-5",e),...t}));ud.displayName=$p.displayName;const ij=h.forwardRef(({className:e,...t},n)=>d.jsx(Dp,{ref:n,className:se("text-sm text-center",e),...t}));ij.displayName=Dp.displayName;const aj=h.forwardRef(({className:e,...t},n)=>d.jsx(Hn,{ref:n,className:se("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));aj.displayName=Hn.displayName;const FW=({children:e,...t})=>d.jsx(cd,{...t,children:d.jsx(Zl,{className:"overflow-hidden p-0",children:d.jsx(aj,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),lj=h.forwardRef(({className:e,...t},n)=>d.jsx("div",{className:"flex items-center border-b px-1","cmdk-input-wrapper":"",children:d.jsx(Hn.Input,{ref:n,className:se("focus:ring-0 flex border-0 outline-none outline-0 h-10 w-full rounded-md bg-transparent py-3 text-sm placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 shadow-none",e),...t})}));lj.displayName=Hn.Input.displayName;const cj=h.forwardRef(({className:e,...t},n)=>d.jsx(Hn.List,{ref:n,className:se("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));cj.displayName=Hn.List.displayName;const uj=h.forwardRef((e,t)=>d.jsx(Hn.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));uj.displayName=Hn.Empty.displayName;const Ql=h.forwardRef(({className:e,...t},n)=>d.jsx(Hn.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",e),...t}));Ql.displayName=Hn.Group.displayName;const LW=h.forwardRef(({className:e,...t},n)=>d.jsx(Hn.Separator,{ref:n,className:se("-mx-1 h-px bg-border",e),...t}));LW.displayName=Hn.Separator.displayName;const Xl=h.forwardRef(({className:e,...t},n)=>d.jsx(Hn.Item,{ref:n,className:se("relative flex cursor-default select-none items-center rounded-md px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",e),...t}));Xl.displayName=Hn.Item.displayName;function nie(e,t){return[...e.slice(0,t),...e.slice(t+1)]}function rie(e){return`$import(${e})`}function sie(e){const t=e.split("/").pop();return t?t.replace(".ts",""):""}function oie(e,t){const r=/\$import\((.*?)\)/g.exec(e);if(!r||r.length!==2)return"INVALID IMPORT STATEMENT";const s=r[1];return t!==void 0&&s.indexOf(t)===0?s.substring(t.length):s}const Cu=e=>{let t="";switch(e){case"GITLAB":t="GitLab";break;case"GITHUB":t="GitHub";break;case"BITBUCKET":t="Bitbucket";break;default:t=e;break}return t},UW=(e,t)=>{const n=t.accounts.filter(s=>s.name===e);let r;if(n[0].sourceControlConfigurations&&n[0].sourceControlConfigurations.length>0)r=n[0].sourceControlConfigurations[0];else{const s=t.global.filter(o=>o.provider===n[0].sourceControlProvider);r=s.length>0?s[0]:null}return r};function hn(e){if(!e)return"";if(typeof e=="object"){if(e instanceof tr)return e.detail??e.title??e.message;if("message"in e)return e.message}return typeof e=="string"?e:""}const BW=async e=>{const t=await _M.init();return VW(e,t)},VW=(e,t)=>{const n=e.split(".").pop();if(n)return t.languages.getLanguages().find(r=>{var s;return(s=r.extensions)==null?void 0:s.includes(`.${n}`)})},cr=e=>{const t=Object.entries(e).flatMap(([n,r])=>r?[[n,r]]:[]);return new URLSearchParams(t).toString()},ye={authApiKey:e=>({url:`${X}/${J}/auth/api-keys/${e}`}),authAccountApiKeys:e=>({url:`${X}/${J}/auth/api-keys?accountName=${e}`}),authCurrentUserAccountRoles:e=>({url:`${X}/${J}/auth/users/me?accountName=${e}`}),authUserAccountRoles:(e,t)=>({url:`${X}/${J}/auth/users/${t}?accountName=${e}`}),authProjectUsersRoles:(e,t)=>({url:`${X}/${J}/auth/users?accountName=${e}&projectName=${t}`}),authAccountUsersRoles:e=>({url:`${X}/${J}/auth/users?accountName=${e}`}),mfaFactors:()=>({url:`${X}/${J}/mfa/factors`}),accountMemberInviteDetails:e=>({url:`${X}/${J}/account-member-invites/${e}`}),accountMemberInvites:e=>({url:`${X}/${J}/accounts/${e}/account-member-invites`}),accountMembers:e=>({url:`${X}/${J}/accounts/${e}/members`}),accountAuditLogs:(e,t)=>{const n=new URLSearchParams;t!=null&&t.limit&&n.append("limit",t.limit.toString()),t!=null&&t.offset&&n.append("offset",t.offset.toString()),t!=null&&t.action&&n.append("action",t.action),t!=null&&t.startDate&&n.append("startDate",t.startDate),t!=null&&t.endDate&&n.append("endDate",t.endDate),t!=null&&t.actor&&n.append("actor",t.actor),(t==null?void 0:t.success)!==void 0&&n.append("success",t.success.toString());const r=n.toString();return{url:`${X}/${J}/accounts/${e}/audit-logs${r?`?${r}`:""}`}},accounts:()=>({url:`${X}/${J}/accounts`}),accountSourceControlRepoList:e=>({url:`${X}/${J}/accounts/${e}/$repo-list`}),accountSourceControlNamespaces:e=>({url:`${X}/${J}/accounts/${e}/$namespaces`}),accountSourceControlRepos:(e,t,n)=>{const r=new URLSearchParams({namespace:t,query:n??""});return{url:`${X}/${J}/accounts/${e}/$repos?${r}`}},accountsSourceControlConfigurations:()=>({url:`${X}/${J}/user/me/source-control-configs`}),accountUsageAnalyticsByDate:(e,t,n)=>({url:`${X}/${J}/analytics/${e}/usage?from=${t}&to=${n}&version=2`}),billing:e=>({url:`${X}/${J}/accounts/${e}/billings`}),buildLogs:(e,t)=>({url:`${X}/${J}/deployments/${e}/build-logs/${t}`}),cdnContent:e=>({url:`${sB}${e}`}),chatIdentity:()=>({url:`${X}/${J}/chat-identity`}),knockIdentity:()=>({url:`${X}/${J}/knock-identity`}),bucketConfigurations:e=>({url:`${X}/${J}/buckets/${e}/configurations`}),bucketConfigurationTeams:e=>({url:`${X}/${J}/buckets/${e}/configurations/teams`}),bucketConfigurationApps:e=>({url:`${X}/${J}/buckets/${e}/configurations/apps`}),bucketConfiguration:(e,t)=>({url:`${X}/${J}/buckets/${e}/configurations/${t}`}),bucketConfigurationUsage:(e,t)=>({url:`${X}/${J}/buckets/${e}/configurations/${t}/usage`}),bucketConfigurationMembers:(e,t)=>({url:`${X}/${J}/buckets/${e}/configurations/${t}/members`}),bucketConfigurationMember:(e,t,n)=>({url:`${X}/${J}/buckets/${e}/configurations/${t}/members/${encodeURIComponent(n)}`}),supportedAiProviders:e=>({url:`${X}/${J}/buckets/${e}/providers`}),aiProviderAssignments:(e,t)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/ai-provider-assignments`}),hierarchicalQuota:e=>({url:`${X}/${J}/hierarchical-quota/${e}`}),bucketConfigurationRequestCount:(e,t,n,r,s)=>{const o=cr({startDate:n,endDate:r,granularity:s});return{url:`${X}/${J}/buckets/${e}/configurations/${t}/request-count?${o}`}},bucketConfigurationCostUsage:(e,t,n,r,s)=>{const o=cr({startDate:n,endDate:r,granularity:s});return{url:`${X}/${J}/buckets/${e}/configurations/${t}/cost-usage?${o}`}},bucketConfigurationTokenUsage:(e,t,n,r,s,o)=>{const i=cr({startDate:n,endDate:r,granularity:s,tokenType:o});return{url:`${X}/${J}/buckets/${e}/configurations/${t}/token-usage?${i}`}},bucketConfigurationTtfb:(e,t,n,r,s)=>{const o=cr({startDate:n,endDate:r,granularity:s});return{url:`${X}/${J}/buckets/${e}/configurations/${t}/ttfb?${o}`}},bucketConfigurationBlocksErrorsWarnings:(e,t,n,r,s)=>{const o=cr({startDate:n,endDate:r,granularity:s});return{url:`${X}/${J}/buckets/${e}/configurations/${t}/blocks-errors-warnings?${o}`}},consumer:(e,t)=>({url:`${X}/${J}/api-keys/${e}/consumers/${t}`}),consumersForBucket:e=>({url:`${X}/${J}/api-keys/${e}/consumers`}),customDomains:(e,t)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/custom-domains`}),deploymentVersions:(e,t,n)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/deployments/${n}/deployment-logs`}),environments:(e,t)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/deployments`}),environmentVariables:(e,t)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/environment-variables`}),file:(e,t)=>({url:`${X}/${J}/deployments/${e}/fs/file?path=${t}`}),gitBranches:(e,t)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/$branches`}),maxRpsAnalytics:(e,t,n)=>{const r=cr(n);return{url:`${X}/${J}/analytics/max-rps?deployment=${e}&filter=${t}&limit=10${r?`&${r}`:""}`}},meteringBucket:(e,t)=>({url:`${X}/${J}/metering/accounts/${e}/buckets/${t}/`}),meteringPlans:(e,t)=>({url:`${X}/${J}/metering/accounts/${e}/buckets/${t}/plans`}),meteringSubscriptions:(e,t)=>({url:`${X}/${J}/metering/accounts/${e}/buckets/${t}/subscriptions`}),meteringSubscriptionQuotas:(e,t,n)=>({url:`${X}/${J}/metering/accounts/${e}/buckets/${t}/subscriptions/${n}/quotas`}),primaryAnalytics:(e,t)=>({url:`${X}/${J}/metrics?deployment=${e}&filter=${t}`}),projectMembers:(e,t)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/members`}),project:(e,t)=>({url:`${X}/${J}/accounts/${e}/projects/${t}`}),projects:e=>({url:`${X}/${J}/accounts/${e}/projects`}),permissions:(e,t)=>({url:`${X}/${J}/permissions/${e}/${t}`}),permissionsProject:(e,t)=>({url:`${X}/${J}/permissions/project/${e}|${t}`}),permissionsAiTeam:e=>({url:`${X}/${J}/permissions/ai_team/${e}`}),runtimeLogs:e=>({url:`${X}/${J}/deployments/${e}/logs`}),topRpsAnalytics:(e,t,n,r)=>{const s=cr(r);return{url:`${X}/${J}/analytics/top-rps?deployment=${e}&filter=${t}${n?`&sortBy=${n}`:""}&limit=10${s?`&${s}`:""}`}},topRpsByIpAnalytics:(e,t,n,r)=>{const s=cr(r);return{url:`${X}/${J}/analytics/top-rps-by-ip?deployment=${e}&filter=${t}${n?`&sortBy=${n}`:""}&limit=10${s?`&${s}`:""}`}},topTenIpAddressesAnalytics:(e,t,n)=>{const r=cr(n);return{url:`${X}/${J}/analytics/top-ip-addresses?deployment=${e}&filter=${t}&limit=10${r?`&${r}`:""}`}},topTenLocationsAnalytics:(e,t,n)=>{const r=cr(n);return{url:`${X}/${J}/analytics/top-locations?deployment=${e}&filter=${t}&limit=10${r?`&${r}`:""}`}},topTenRoutesAnalytics:(e,t,n)=>{const r=cr(n);return{url:`${X}/${J}/analytics/top-routes?deployment=${e}&filter=${t}&limit=10${r?`&${r}`:""}`}},topTenSubsAnalytics:(e,t,n)=>{const r=cr(n);return{url:`${X}/${J}/analytics/top-subs?deployment=${e}&filter=${t}&limit=10${r?`&${r}`:""}`}},usersMe:()=>({url:`${X}/${J}/users/me`})},zW={createApiKey:e=>({url:`${X}/${J}/auth/api-keys`,method:"POST",json:!0,body:JSON.stringify(e),invalidateKeys:[ye.authAccountApiKeys(e.accountName)],acceptableStatuses:[200]}),deleteApiKey:(e,t)=>({url:`${X}/${J}/auth/api-keys/${e}`,method:"DELETE",invalidateKeys:[ye.authApiKey(e),ye.authAccountApiKeys(t)],acceptableStatuses:[204]}),updateUsersRole:({userId:e,accountName:t,projectName:n,role:r})=>({url:`${X}/${J}/auth/users/${e}`,method:"PATCH",json:!0,body:JSON.stringify({accountName:t,projectName:n,role:r}),parseResponse:!1,invalidateKeys:n?[ye.authProjectUsersRoles(t,n),ye.projectMembers(t,n),ye.authAccountUsersRoles(t)]:[ye.authAccountUsersRoles(t)],acceptableStatuses:[201,200]})},WW={createAccount:e=>({url:`${X}/${J}/accounts`,method:"POST",json:!0,body:JSON.stringify(e),invalidateKeys:[ye.accounts()],acceptableStatuses:[201]}),deleteAccount:e=>({url:`${X}/${J}/accounts/${e.name}`,method:"DELETE",invalidateKeys:[ye.accounts()],acceptableStatuses:[200]}),removeAccountMember:({accountName:e,memberUserSub:t})=>({url:`${X}/${J}/accounts/${e}/members?userSub=${t}`,method:"DELETE",invalidateKeys:[ye.projects(e),ye.accountMembers(e)],acceptableStatuses:[204]}),createCustomDomain:({accountName:e,projectName:t,isAlias:n,hostname:r,deploymentName:s,stage:o})=>({url:`${X}/${J}/accounts/${e}/custom-domains`,method:"POST",body:JSON.stringify({hostname:r,isAlias:n,deploymentName:s,stage:o}),invalidateKeys:[ye.accounts(),ye.projects(e),ye.environments(e,t),ye.customDomains(e,t)],acceptableStatuses:[200]}),deleteAccountMemberInvite:({accountName:e,inviteId:t})=>({url:`${X}/${J}/accounts/${e}/account-member-invites/${t}`,method:"DELETE",invalidateKeys:[ye.accountMemberInvites(e)],acceptableStatuses:[204]}),deleteCustomDomain:({accountName:e,projectName:t,hostname:n,deploymentName:r})=>({url:`${X}/${J}/accounts/${e}/custom-domains?hostname=${n}&deploymentName=${r}`,method:"DELETE",invalidateKeys:[ye.accounts(),ye.projects(e),ye.environments(e,t),ye.customDomains(e,t)],acceptableStatuses:[204]}),editCustomDomain:({accountName:e,projectName:t,hostname:n,deploymentName:r})=>({url:`${X}/${J}/accounts/${e}/custom-domains`,method:"PATCH",body:JSON.stringify({hostname:n,deploymentName:r}),invalidateKeys:[ye.accounts(),ye.projects(e),ye.environments(e,t),ye.customDomains(e,t)],acceptableStatuses:[200]}),resendAccountMemberInvite:({accountName:e,inviteId:t})=>({url:`${X}/${J}/accounts/${e}/account-member-invites/${t}/$resend`,method:"PATCH",body:JSON.stringify({}),invalidateKeys:[ye.accountMemberInvites(e)],acceptableStatuses:[201]}),billingUpgrade:(e,t,n,r)=>({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({successUrl:n,cancelUrl:r}),url:`${X}/${J}/accounts/${e}/upgrade/${t}`}),updateAccount:({accountName:e,...t})=>({url:`${X}/${J}/accounts/${e}`,method:"PATCH",body:JSON.stringify(t),json:!0,invalidateKeys:[ye.accounts()],acceptableStatuses:[200]})},qW={createProject:(e,t,{productType:n,...r}={})=>({url:`${X}/${J}/accounts/${e}/projects`,method:"POST",body:JSON.stringify({name:t,productType:n,options:r}),removeKeys:[ye.projects(e)],acceptableStatuses:[201]}),createProjectWithRepo:(e,t,n,r,s)=>({url:`${X}/${J}/accounts/${e}/projects/$create-with-repo`,method:"POST",body:JSON.stringify({projectName:t,orgName:n,repositoryName:r,defaultBranch:s}),removeKeys:[ye.projects(e)],acceptableStatuses:[201]}),createProjectFromRepo:(e,t,n,r)=>({url:`${X}/${J}/accounts/${e}/projects/$create-from-repo`,method:"POST",body:JSON.stringify({projectName:t,sourceRepoUrl:n,defaultBranch:r}),removeKeys:[ye.projects(e)],acceptableStatuses:[201]}),createRepoFromProject:(e,t,n,r,s)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/$create-repo`,method:"POST",body:JSON.stringify({orgName:n,repositoryName:r,defaultBranch:s}),invalidateKeys:[ye.projects(e),ye.environments(e,t)],acceptableStatuses:[201]}),connectProjectToRepo:(e,t,n,r,s,o)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/$connect`,method:"PATCH",body:JSON.stringify({orgName:n,repositoryURL:r,defaultBranch:s,forceConnect:o}),invalidateKeys:[ye.projects(e),ye.environments(e,t)],acceptableStatuses:[201]}),disconnectProjectFromRepo:(e,t)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/$disconnect`,method:"POST",body:JSON.stringify({}),invalidateKeys:[ye.projects(e)],acceptableStatuses:[201]}),initProject:(e,t)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/$init`,method:"POST",body:JSON.stringify({}),invalidateKeys:[ye.projects(e)],acceptableStatuses:[201]}),deleteProject:(e,t)=>({url:`${X}/${J}/accounts/${e}/projects/${t}`,method:"DELETE",invalidateKeys:[ye.projects(e)],removeKeys:[ye.environments(e,t)],acceptableStatuses:[204]}),shareProject:(e,t,n)=>({url:`${X}/${J}/accounts/${e}/projects/${t}/share`,method:"POST",body:JSON.stringify({userSub:n}),invalidateKeys:[ye.projectMembers(e,t)],acceptableStatuses:[201]}),removeMember:({accountName:e,projectName:t,memberId:n})=>({url:`${X}/${J}/accounts/${e}/projects/${t}/members/${n}`,method:"DELETE",invalidateKeys:[ye.projectMembers(e,t)],acceptableStatuses:[204]}),archiveProject:e=>({url:`${X}/${J}/deployments/${e}/archive`,method:"POST",body:JSON.stringify({}),acceptableStatuses:[200]}),updateDefaultBranch:({accountName:e,projectName:t,defaultBranch:n,sourceRepoUrl:r})=>({url:`${X}/${J}/accounts/${e}/projects/${t}/$update-default-branch`,method:"PATCH",body:JSON.stringify({defaultBranch:n,sourceRepoUrl:r}),headers:{"content-type":"application/json"},invalidateKeys:[ye.projects(e)],removeKeys:[ye.environments(e,t)],acceptableStatuses:[200]})},HW={updateEnvironmentVariable:e=>({url:`${X}/${J}/accounts/${e.accountName}/projects/${e.projectName}/environment-variables/${e.variableData.id}`,method:"PATCH",body:JSON.stringify(e.variableData),invalidateKeys:[ye.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[200]}),createEnvironmentVariable:e=>({url:`${X}/${J}/accounts/${e.accountName}/projects/${e.projectName}/environment-variables`,method:"POST",body:JSON.stringify(e.variableData),invalidateKeys:[ye.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[201]}),deleteEnvironmentVariable:e=>({url:`${X}/${J}/accounts/${e.accountName}/projects/${e.projectName}/environment-variables/${e.id}`,method:"DELETE",invalidateKeys:[ye.environmentVariables(e.accountName,e.projectName)],acceptableStatuses:[204]})},GW={makeTestRequest:({environmentName:e,testRequest:t,overrideUrl:n})=>{const r={body:t.body,deployment:e,headers:t.headers,method:t.method,overrideUrl:n,path:t.pathname};return{url:`${nB}/v1/test`,method:"POST",body:JSON.stringify(r),acceptableStatuses:[200],headers:{"content-type":"application/json"}}}},KW={requestFeature:({email:e,featureName:t,information:n})=>{const r={featureName:t,information:{email:e,...n}};return{url:`${X}/${J}/feature-access-request`,method:"POST",body:JSON.stringify(r),acceptableStatuses:[200],headers:{"content-type":"application/json"}}}},YW={saveFile:({environmentName:e,file:t,accountName:n,projectName:r})=>({url:`${X}/${J}/deployments/${e}/fs/file?path=${t.path}`,method:"POST",body:t.content,acceptableStatuses:[204,200],invalidateKeys:[ye.file(e,t.path),ye.deploymentVersions(n,r,e)]}),renameFile:({environmentName:e,path:t,newPath:n})=>({url:`${X}/${J}/deployments/${e}/fs/file?path=${t}`,method:"PATCH",body:JSON.stringify({newPath:n}),acceptableStatuses:[204,200],headers:{"content-type":"application/json"},invalidateKeys:[]}),saveMultipleFiles:async({environmentName:e,files:t,accountName:n,projectName:r})=>{var a;const s=new FormData,o={};for(const l of t)if(l.lastModified){const c=`x-if-unmodified-since-${encodeURIComponent(l.path)}`;o[c]=new Date(l.lastModified).toUTCString()}for(const{content:l,path:c}of t){const u=(a=await BW(c))==null?void 0:a.id;s.append("files[]",new File([l??""],c,{type:u==="text/typescript"?"text/javascript":u}),c)}const i=t.map(({path:l})=>ye.file(e,l));return{url:`${X}/${J}/deployments/${e}/fs/files`,method:"POST",body:s,headers:o,acceptableStatuses:[200,204],invalidateKeys:[...i,ye.deploymentVersions(n,r,e)]}},deleteFile:({environmentName:e,filePath:t})=>({url:`${X}/${J}/deployments/${e}/fs/delete?path=${t}`,method:"DELETE",acceptableStatuses:[204,200]})},ZW={createDirectory:({environmentName:e,path:t})=>({url:`${X}/${J}/deployments/${e}/fs/dir?path=${t}`,method:"POST",body:JSON.stringify({}),acceptableStatuses:[201]})},QW={acceptAccountInvite:e=>({url:`${X}/${J}/account-member-invites/${e}`,method:"POST",body:JSON.stringify({}),invalidateKeys:[ye.accounts()],acceptableStatuses:[201]}),createAccountInvite:(e,t)=>({url:`${X}/${J}/accounts/${e}/account-member-invites`,method:"POST",body:JSON.stringify({userEmail:t}),invalidateKeys:[ye.accountMembers(e),ye.accountMemberInvites(e)],acceptableStatuses:[201]})},XW={sourcemap:e=>({url:`${X}/${J}/logs/sourcemap`,method:"POST",json:!0,body:JSON.stringify(e),acceptableStatuses:[200]})},Mt={auth:zW,accounts:WW,projects:qW,environmentVariables:HW,testDesigner:GW,featureRequest:KW,fileTransactions:YW,directories:ZW,accountInvite:QW,logs:XW},JW=()=>{const e=h.useContext(fx),t=si();return h.useCallback(async()=>{if(e)return"local-access-token";try{return await t.getAccessTokenSilently({authorizationParams:{audience:XR,detailedResponse:!0}})}catch(n){On(n),Et.error(n);const r=new tr("Error retrieving access token",n instanceof Error?n:new Error(n));throw r.status=500,r}},[e,t])};function e7(){const{logout:e}=si(),t=ip(),{logEvent:n}=ft();return()=>{n("logout-clicked");try{t.reset()}catch(s){console.log(s)}e({logoutParams:{returnTo:window.location.origin}})}}const It=e=>{const t=lb(),n=JW(),r=e7();return{fetch:async o=>{var f,p;const i=await n(),a=Gb(),l=new Headers(o.headers);o.json&&o.method!=="DELETE"&&l.set("content-type","application/json"),l.set("authorization",`Bearer ${i}`),l.set("zuplo-request-id",a);let c;try{c=await fetch(o.url,{...e,method:o.method,headers:l,body:o.body})}catch(g){throw(g instanceof tr||g!=null&&typeof g=="object"&&"status"in g)&&g.status===P.UNAUTHORIZED&&r(),g instanceof tr&&g.setTraceId(a),g instanceof TypeError?new gs({type:"https://zup.fail/api-request-failed",title:"API request failed",status:500,instance:o.url,traceId:a}):g}if(!(o.acceptableStatuses??[200]).includes(c.status)){const g=new tr(`Unexpected response: ${c.status} calling ${o.method}: ${o.url}`,{traceId:a});throw await g.tryReadResponse(c),g}return(f=o.invalidateKeys)==null||f.forEach(g=>{t.invalidateQueries({queryKey:[g.url]})}),(p=o.removeKeys)==null||p.forEach(g=>{t.removeQueries({queryKey:[g.url]})}),o.parseResponse===!1?c:o.json?await c.json():c}}},t7=(e,...t)=>(...n)=>e(...t,...n);async function n7(e,t,n={}){const{text:r,extractData:s}=n;if(!e||typeof e!="string")throw new gs({type:"https://zup.fail/missing-url",title:"Missing URL"});const o=await t({authorizationParams:{audience:XR,detailedResponse:!0}}),i=new Request(e),a=Gb();i.headers.set("authorization",`Bearer ${o}`),i.headers.set("zuplo-request-id",a);let l;try{l=await fetch(i)}catch(c){throw c instanceof TypeError?new gs({type:"https://zup.fail/api-request-failed",title:LN,instance:e,traceId:a},{cause:c}):(c instanceof tr&&c.setTraceId(a),c)}if(!l.ok){const c=new tr("Error while making request. Please try again or contact support if the problem persists.",{traceId:a});throw await c.tryReadResponse(l),c}try{const c=r?await l.clone().text():await l.clone().json();return s?c.data:c}catch(c){const u=await l.clone().text();throw FT(`Failed to parse response of ${e} to JSON. Response: ${u}`,f=>f.setLevel("error").setTag("status",l.status).setTag("traceId",a).setTag("requestUrl",e)),c}}function ar(e,{enabled:t,text:n,extractData:r,...s}={}){const{getAccessTokenSilently:o}=si();return zh({enabled:t,queryKey:[e.url],queryFn:async({queryKey:i})=>{const[a]=i;return n7(a,o,{text:n,extractData:r})},...s})}const r7=t7(ar,ye.accounts()),s7=e=>ar(ye.accountMemberInvites(e),{extractData:!0}),o7=()=>{const e=It();return Rt({mutationFn:async t=>await e.fetch(Mt.accounts.deleteAccountMemberInvite(t))})},i7=()=>{const e=It();return Rt({mutationFn:async t=>await e.fetch(Mt.accounts.resendAccountMemberInvite(t))})},a7="~working-copy",iie="$import(@zuplo/runtime)",aie="KeyS",lie=2,dj=(e,t)=>ar(ye.projects(e),{...t,throwOnError:!0,extractData:!0}),l7=(e,t)=>{const n=It();return Rt({mutationFn:async()=>{await n.fetch(Mt.projects.deleteProject(e,t))}})},c7=()=>{const e=It(),t=ci();return Rt({mutationFn:async r=>{await e.fetch(Mt.projects.shareProject(r.accountName,r.projectName,r.userSub))},onError:r=>t.error(hn(r)),onSuccess:()=>t.success("User was added to project")})},u7=()=>{const e=It();return Rt({mutationFn:async n=>{await e.fetch(Mt.projects.removeMember(n))}})},d7=e=>{const t=It();return Rt({mutationFn:async r=>{await t.fetch(Mt.projects.createRepoFromProject(e,r.projectName,r.orgName,r.repositoryName,r.defaultBranch))}})},f7=(e,t)=>{const n=It();return Rt({mutationFn:async s=>await n.fetch(Mt.projects.connectProjectToRepo(e,t,s.orgName,s.repositoryURL,s.defaultBranch,s.forceConnect))})},h7=(e,t)=>{const n=It();return Rt({mutationFn:async()=>{await n.fetch(Mt.projects.disconnectProjectFromRepo(e,t))}})},p7=(e,t)=>{const n=It();return Rt({mutationFn:async s=>{await n.fetch(Mt.projects.updateDefaultBranch({accountName:e,projectName:t,defaultBranch:s.defaultBranch,sourceRepoUrl:s.sourceRepoUrl}))}})},m7=({account:e,navigateTo:t})=>{const{data:n}=dj(e),r=[...n??[]].sort((s,o)=>s.name.toLowerCase().localeCompare(o.name.toLowerCase()));return d.jsx(Ql,{heading:e,children:r.map(s=>d.jsxs(Xl,{onSelect:()=>t(Zs(yr.Code,{account:e,project:s.name,environment:a7})),children:[d.jsx(jB,{className:"mr-3 h-4 w-4 text-neutral-600"}),d.jsx("span",{children:s.name})]},s.id))})},g7=({navigateTo:e})=>{var n,r;const t=r7();return d.jsxs(d.Fragment,{children:[(n=t.data)==null?void 0:n.map(s=>d.jsx(m7,{navigateTo:e,account:s.name},`projects-${s.name}`)),d.jsx(Ql,{heading:"Accounts",children:(r=t.data)==null?void 0:r.map(s=>d.jsxs(Xl,{onSelect:()=>{e(Zs(yr.AccountProjects,{account:s.name})),close()},children:[d.jsx($B,{className:"mr-2 h-4 w-4"}),d.jsx("span",{children:s.name})]},s.name))})]})};var Qs=(e=>(e[e.Unknown=0]="Unknown",e[e.File=1]="File",e[e.Directory=2]="Directory",e[e.SymbolicLink=64]="SymbolicLink",e))(Qs||{}),ut=(e=>(e.modified="modified",e.new="new",e.saving="saving",e.unmodified="unmodified",e.removing="removing",e.error="error",e))(ut||{});const BE=e=>Symbol.iterator in e,VE=e=>"entries"in e,zE=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[s,o]of n)if(!Object.is(o,r.get(s)))return!1;return!0},v7=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let s=n.next(),o=r.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=n.next(),o=r.next()}return!!s.done&&!!o.done};function y7(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:!BE(e)||!BE(t)?zE({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)}):VE(e)&&VE(t)?zE(e,t):v7(e,t)}function fj(e){const t=ce.useRef(void 0);return n=>{const r=e(n);return y7(t.current,r)?t.current:t.current=r}}const Ot=ux(e=>({projectTreeNodes:[],filesByPath:{},testResponse:void 0,executionHistory:[],saveConflictPath:null,setProjectTreeNodes:t=>e({projectTreeNodes:t}),filterProjectTreeNodes:t=>e(n=>({projectTreeNodes:n.projectTreeNodes.filter(t)})),addFile:t=>e(n=>({filesByPath:{...n.filesByPath,[t.path]:t}})),removeFile:t=>e(n=>{const r={...n.filesByPath};return delete r[t],{filesByPath:r}}),updateFile:t=>e(n=>{const s=t.saveState===ut.new&&!n.projectTreeNodes.some(i=>i.path===t.path)?[...n.projectTreeNodes,t]:n.projectTreeNodes,o={...n.filesByPath,[t.path]:t};return{projectTreeNodes:s,filesByPath:o}}),resetStore:()=>e({projectTreeNodes:[],filesByPath:{}}),setTestResponse:t=>e({testResponse:t}),appendExecutionHistory:t=>e(n=>({executionHistory:[...n.executionHistory,t]})),showSaveConflict:t=>e({saveConflictPath:t}),clearSaveConflict:()=>e({saveConflictPath:null})}));function hj(){return Ot(fj(e=>{const t=[];for(const n of e.projectTreeNodes){const r=n.path?e.filesByPath[n.path]:void 0;r&&r.saveState===ut.modified&&t.push(r)}return t}))}const b7=/^\/config\/.*\.oas\.json$/;function x7(){return Ot(fj(e=>{const t=[];for(const n of e.projectTreeNodes)if(n.path&&b7.test(n.path)){const r=e.filesByPath[n.path];r&&t.push(r)}return t}))}function cie(){const e=x7();return h.useMemo(()=>Object.fromEntries(e.flatMap(n=>{try{return[[n.path,JSON.parse(n.content??"{}")]]}catch{return[]}})),[e])}const w7=({account:e,navigateTo:t,project:n,environment:r})=>{const s=Ot(o=>o.projectTreeNodes);return d.jsx(Ql,{heading:"Files",children:s.filter(o=>o.path&&o.type===Qs.File).map(o=>d.jsxs(Xl,{onSelect:()=>t(Zs(`${yr.Code}?path=${o.path}`,{account:e,project:n,environment:r})),children:[d.jsx("div",{className:"mr-3",children:d.jsx(oV,{className:"h-4 w-4 text-neutral-500"})}),d.jsx("span",{className:"line-clamp-1",children:o.path.substring(1)})]},o.path))})};function cs({title:e,className:t}){return d.jsx("div",{className:se("text-2xl font-medium",t),children:e})}var sg={exports:{}};/*!
|
337
|
+
Copyright (c) 2018 Jed Watson.
|
338
|
+
Licensed under the MIT License (MIT), see
|
339
|
+
http://jedwatson.github.io/classnames
|
340
|
+
*/var WE;function _7(){return WE||(WE=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var o="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(o=s(o,r(a)))}return o}function r(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return n.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var a in o)t.call(o,a)&&o[a]&&(i=s(i,a));return i}function s(o,i){return i?o?o+" "+i:o+i:o}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(sg)),sg.exports}var E7=_7();const Fs=Bl(E7),S7=2e3,Op=(e,{showValue:t,onCopy:n,showToast:r=!0}={showValue:!1,showToast:!0,onCopy:()=>{}})=>{const s=typeof e=="string"?()=>e:e,[o,i]=h.useState("idle"),a=h.useRef(),l=ci();h.useEffect(()=>{i("idle")},[e]);const c=()=>{i("copied"),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{i("idle")},S7)};return{copyToClipboard:async()=>{setTimeout(()=>i(p=>p==="idle"?"loading":p),5);const f=await s();try{await navigator.clipboard.writeText(f),c(),n==null||n(),r&&l.success(d.jsxs("div",{className:"flex gap-2 items-center text-xs font-medium",children:[d.jsx(KB,{strokeWidth:2,size:16}),d.jsxs("div",{children:["Copied"," ",t?d.jsxs("span",{className:"font-mono",children:['"',f,'"']}):"to clipboard"]})]}))}catch{i("failed"),l.error("Failed to copy to clipboard")}},state:o}},Jl=({borderPositionAndSize:e,className:t})=>d.jsx("div",{style:{borderTopColor:"transparent"},className:se("border-zuplo-pink",{"border-4":!e,[`${e}`]:e},"border-solid rounded-full animate-spin",t)}),C7=({success:e,className:t})=>e?d.jsx(ia,{className:se("w-5 h-5 text-green-600",t)}):d.jsx(tN,{className:se("w-5 h-5 rotate-90",t),"aria-hidden":"true"}),dh=({textToCopy:e,onClick:t,title:n,className:r,iconClassName:s,showValue:o=!0})=>{const i=Op(e??"",{showValue:o});return d.jsx("button",{disabled:i.state==="copied",onClick:a=>{t==null||t(a),i.copyToClipboard()},type:"button",title:n??"Copy",className:Fs(r,"ml-1 hover:text-gray-800 text-gray-400 cursor-pointer"),children:i.state==="loading"?d.jsx(Jl,{className:"h-4 w-4 border-2"}):d.jsx(C7,{success:i.state==="copied",className:se("w-4 h-4",s)})})},dd=(e=[])=>{const t=sx(),n=Object.keys(t);if(e.some(r=>!n.includes(r)))throw new Error(`${e.join(", ")} are required`);return t},pj=e=>{switch(e){case nr.WORKING_COPY:return"Working Copy";case nr.PRODUCTION:return"Production";case nr.PREVIEW:return"Preview";default:return e}},T7=({env:e})=>pj(e),R7=({env:e,children:t})=>d.jsxs(Ho,{children:[d.jsx(Go,{asChild:!0,children:d.jsx("div",{children:t})}),d.jsxs(Lr,{children:["All Deployments with ",pj(e)," environment"]})]}),N7=Wr("rounded-md border bg-card text-card-foreground shadow-sm",{variants:{variant:{default:"bg-white",muted:"border-gray-300 bg-gray-100",primary:"border-pink-200 bg-zuplo-pink-light",info:"bg-blue-50 border-blue-200",danger:"bg-red-50 border-red-200"},offset:{default:"",md:["px-4","py-4"]}},defaultVariants:{variant:"default",offset:"default"}}),P7=Wr("flex items-center px-6 py-2 border-t rounded-b",{variants:{variant:{default:"bg-white",danger:"bg-red-100 border-red-200",muted:"bg-neutral-100 border-neutral-200"}},defaultVariants:{variant:"default"}}),rn=h.forwardRef(({className:e,variant:t,offset:n,...r},s)=>d.jsx("div",{ref:s,className:se(N7({variant:t,offset:n,className:e})),...r}));rn.displayName="Card";const xs=h.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:se("flex flex-col space-y-1.5 p-6 pb-0 text-lg",e),...t}));xs.displayName="CardHeader";const kx=h.forwardRef(({className:e,...t},n)=>d.jsx("h3",{ref:n,className:se("text-xl text-gray-900 font-semibold leading-none",e),...t}));kx.displayName="CardTitle";const Mp=h.forwardRef(({className:e,...t},n)=>d.jsx("p",{ref:n,className:se("text-sm text-gray-500 py-2",e),...t}));Mp.displayName="CardDescription";const ws=h.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:se("p-6 pt-0",e),...t}));ws.displayName="CardContent";const fd=h.forwardRef(({className:e,variant:t,...n},r)=>d.jsx("div",{ref:r,className:se(P7({variant:t,className:e})),...n}));fd.displayName="CardFooter";const j7=({connected:e})=>d.jsxs(fd,{variant:"muted",className:"text-sm font-medium text-gray-600 h-12 col-span-full",children:["Connected to"," ",e==null?void 0:e.map(t=>d.jsx(R7,{env:t,children:d.jsx(li,{variant:"secondary",className:"ml-2 capitalize",children:d.jsx(T7,{env:t})})},t))]}),A7=({environments:e,name:t})=>{const{account:n,project:r}=dd(["account","project"]);return d.jsxs(rn,{className:"grid grid-cols-subgrid col-span-full",children:[d.jsx(xs,{className:"col-span-full"}),d.jsxs(ws,{className:"grid grid-cols-subgrid col-span-full",children:[d.jsxs("div",{className:"flex flex-row gap-4 items-center",children:[d.jsxs("div",{className:"flex p-1 items-center relative bg-indigo-200 text-indigo-500 border-indigo-500 rounded-lg border",children:[d.jsx(sN,{size:24,strokeWidth:1.25,absoluteStrokeWidth:!0}),d.jsx(CV,{size:22,strokeWidth:1.25,fill:"#fff",className:"absolute -right-2 -bottom-1.5"})]}),d.jsxs("div",{className:"flex flex-col",children:[d.jsx("div",{className:"font-medium text-sm",children:"API Key Service"}),d.jsx("div",{className:"text-sm",children:"Contains API Keys for your users"})]})]}),d.jsxs("div",{className:"flex flex-col gap-1",children:[d.jsx("div",{className:"text-xs",children:"Bucket Name"}),d.jsxs("div",{className:"text-xs font-mono flex items-center",children:[t," ",d.jsx(dh,{textToCopy:t})]})]}),d.jsx(Fe,{variant:"white",asChild:!0,children:d.jsx(od,{to:Zs("/:account/:project/services/keys/:bucketId",{bucketId:t,account:n,project:r}),"data-test":`service-${e==null?void 0:e.join("-")}`,children:"Configure"})})]}),d.jsx(j7,{connected:e})]})},qE=(e,t)=>`z${e}-${t}`.toLowerCase().replaceAll("_","-");function $7(e,t){return`https://dev.zuplo.com/v1/accounts/${e}/key-buckets/${t}`}const D7=e=>[nr.PRODUCTION,nr.WORKING_COPY,nr.PREVIEW].map(n=>({name:qE(e,n),url:$7(e,qE(e,n)),env:n})).sort((n,r)=>r.env.localeCompare(n.env)),k7=({error:e,size:t=24})=>{switch(e.status){case 401:return d.jsx(up,{size:t});case 403:return d.jsx(TB,{size:t});case 404:return d.jsx(kB,{size:t});default:return d.jsx(cp,{size:t})}},O7=({error:e})=>d.jsx("div",{className:"flex items-center gap-2 rounded-full border-2 border-neutral-100 bg-neutral-50 text-neutral-300 p-4",children:d.jsx(k7,{error:e})}),M7=({error:e})=>{switch(e.status){case 401:return d.jsx(xt,{href:"https://zuplo.com/docs/articles/accounts/managing-account-members",children:"Learn more about Managing Account Members"});default:return null}},I7=({error:e,title:t="Unable to access",children:n,className:r})=>d.jsx(Sr,{className:se("w-full",r),children:d.jsxs("div",{className:"flex items-center gap-8 p-2",children:[d.jsx(O7,{error:e}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(yp,{children:t}),d.jsxs(ai,{className:"flex flex-col gap-2",children:[hn(e),d.jsx(M7,{error:e}),n]})]})]})}),ec=(e,t,n)=>ar(ye.environments(e,t),{extractData:!0,...n}),uie=(e,t,n,r={})=>ar(ye.deploymentVersions(e,t,n),{...r,extractData:!0,select:s=>s.map(o=>({...o,stages:[...o.stages].sort((i,a)=>i.stage.localeCompare(a.stage))}))}),HE={BASE_URL:"/",DEV:!1,LOCAL_EDITOR:"true",MODE:"local-editor",PROD:!0,SSR:!1,VITE_CDN_URL:"https://cdn.zuplo.com",VITE_MANAGEMENT_API_URL:"/api",VITE_TEST_API_URL:"/api"},hy=new Map,lf=e=>{const t=hy.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},F7=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=hy.get(n.name);if(r)return{type:"tracked",store:e,...r};const s={connection:t.connect(n),stores:{}};return hy.set(n.name,s),{type:"tracked",store:e,...s}},L7=(e,t={})=>(n,r,s)=>{const{enabled:o,anonymousActionType:i,store:a,...l}=t;let c;try{c=(o??(HE?"local-editor":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return e(n,r,s);const{connection:u,...f}=F7(a,c,l);let p=!0;s.setState=(m,v,b)=>{const x=n(m,v);if(!p)return x;const w=b===void 0?{type:i||"anonymous"}:typeof b=="string"?{type:b}:b;return a===void 0?(u==null||u.send(w,r()),x):(u==null||u.send({...w,type:`${a}/${w.type}`},{...lf(l.name),[a]:s.getState()}),x)};const g=(...m)=>{const v=p;p=!1,n(...m),p=v},y=e(s.setState,r,s);if(f.type==="untracked"?u==null||u.init(y):(f.stores[f.store]=s,u==null||u.init(Object.fromEntries(Object.entries(f.stores).map(([m,v])=>[m,m===f.store?y:v.getState()])))),s.dispatchFromDevtools&&typeof s.dispatch=="function"){let m=!1;const v=s.dispatch;s.dispatch=(...b)=>{(HE?"local-editor":void 0)!=="production"&&b[0].type==="__setState"&&!m&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),m=!0),v(...b)}}return u.subscribe(m=>{var v;switch(m.type){case"ACTION":if(typeof m.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return og(m.payload,b=>{if(b.type==="__setState"){if(a===void 0){g(b.state);return}Object.keys(b.state).length!==1&&console.error(`
|
341
|
+
[zustand devtools middleware] Unsupported __setState action format.
|
342
|
+
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
343
|
+
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
344
|
+
`);const x=b.state[a];if(x==null)return;JSON.stringify(s.getState())!==JSON.stringify(x)&&g(x);return}s.dispatchFromDevtools&&typeof s.dispatch=="function"&&s.dispatch(b)});case"DISPATCH":switch(m.payload.type){case"RESET":return g(y),a===void 0?u==null?void 0:u.init(s.getState()):u==null?void 0:u.init(lf(l.name));case"COMMIT":if(a===void 0){u==null||u.init(s.getState());return}return u==null?void 0:u.init(lf(l.name));case"ROLLBACK":return og(m.state,b=>{if(a===void 0){g(b),u==null||u.init(s.getState());return}g(b[a]),u==null||u.init(lf(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return og(m.state,b=>{if(a===void 0){g(b);return}JSON.stringify(s.getState())!==JSON.stringify(b[a])&&g(b[a])});case"IMPORT_STATE":{const{nextLiftedState:b}=m.payload,x=(v=b.computedStates.slice(-1)[0])==null?void 0:v.state;if(!x)return;g(a===void 0?x:x[a]),u==null||u.send(null,b);return}case"PAUSE_RECORDING":return p=!p}return}}),y},U7=L7,og=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function B7(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var o;const i=l=>l===null?null:JSON.parse(l,void 0),a=(o=n.getItem(s))!=null?o:null;return a instanceof Promise?a.then(i):i(a)},setItem:(s,o)=>n.setItem(s,JSON.stringify(o,void 0)),removeItem:s=>n.removeItem(s)}}const py=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return py(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return py(r)(n)}}}},V7=(e,t)=>(n,r,s)=>{let o={storage:B7(()=>localStorage),partialize:m=>m,version:0,merge:(m,v)=>({...v,...m}),...t},i=!1;const a=new Set,l=new Set;let c=o.storage;if(!c)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...m)},r,s);const u=()=>{const m=o.partialize({...r()});return c.setItem(o.name,{state:m,version:o.version})},f=s.setState;s.setState=(m,v)=>{f(m,v),u()};const p=e((...m)=>{n(...m),u()},r,s);s.getInitialState=()=>p;let g;const y=()=>{var m,v;if(!c)return;i=!1,a.forEach(x=>{var w;return x((w=r())!=null?w:p)});const b=((v=o.onRehydrateStorage)==null?void 0:v.call(o,(m=r())!=null?m:p))||void 0;return py(c.getItem.bind(c))(o.name).then(x=>{if(x)if(typeof x.version=="number"&&x.version!==o.version){if(o.migrate){const w=o.migrate(x.state,x.version);return w instanceof Promise?w.then(_=>[!0,_]):[!0,w]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,x.state];return[!1,void 0]}).then(x=>{var w;const[_,E]=x;if(g=o.merge(E,(w=r())!=null?w:p),n(g,!0),_)return u()}).then(()=>{b==null||b(g,void 0),g=r(),i=!0,l.forEach(x=>x(g))}).catch(x=>{b==null||b(void 0,x)})};return s.persist={setOptions:m=>{o={...o,...m},m.storage&&(c=m.storage)},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>y(),hasHydrated:()=>i,onHydrate:m=>(a.add(m),()=>{a.delete(m)}),onFinishHydration:m=>(l.add(m),()=>{l.delete(m)})},o.skipHydration||y(),g||p},z7=V7,W7=ux()(U7(z7(e=>({setEnvironment:t=>e(n=>({...n,environment:{...t,time:Date.now()}})),setAccount:t=>e(n=>({...n,account:{accountName:t,time:Date.now()}}))}),{name:"mru"}))),q7=()=>{var o;const e=dd([]),{environment:t,setEnvironment:n}=W7(),s=(o=ec((t==null?void 0:t.accountName)??"",(t==null?void 0:t.projectName)??"",{enabled:!!(t!=null&&t.accountName)&&!!t.projectName}).data)==null?void 0:o.find(i=>i.urlParameter===(t==null?void 0:t.environmentName));return e.account!==(t==null?void 0:t.accountName)||e.project!==(t==null?void 0:t.projectName)?{setEnvironment:n}:{setEnvironment:n,account:t==null?void 0:t.accountName,project:t==null?void 0:t.projectName,environment:s?t==null?void 0:t.environmentName:void 0}};localStorage.removeItem("MRU_DATA");const pn=(e=["account","project","environment"])=>{const t=h.useContext(UN);if(!t)throw new Error(`No ApeContext found, but marked as required (${e.join(", ")}) when using the useApeContext hook`);if(e.some(n=>t[n]===void 0))throw new Error(`No "${e.filter(n=>t[n]===void 0).join(", ")}" context set, but marked as required (${e.join(", ")}) when using the useApeContext hook`);return t},H7=()=>{var i;const e=pn(["account","project"]),t=q7(),n=ec(e.account.name,e.project.name),r=D7(e.project.id),s=(i=n.data)==null?void 0:i.find(a=>a.urlParameter===t.environment),o=r.filter(a=>a.env===(s==null?void 0:s.environmentType));return d.jsxs("div",{className:"flex flex-col gap-3 md:gap-6 mb-6",children:[d.jsx(cs,{title:"API Key Consumer"}),d.jsxs(Sr,{variant:"outline",className:"text-sm",children:[d.jsx(SB,{size:20}),d.jsx(yp,{children:"This page has moved"}),d.jsx(ai,{children:"API Key Consumers are stored in buckets. Each bucket is associated with one or more environments. You can find all API Key Services in the Services section."})]}),o.length>0&&d.jsx("div",{className:"font-medium",children:"Most recently used"}),o.map(a=>d.jsx("div",{className:"grid grid-cols-[1fr,1fr,8rem] gap-6",children:d.jsx(A7,{name:a.name,environments:[a.env]})},a.name)),d.jsx(Fe,{variant:"white",className:"self-center",asChild:!0,children:d.jsx(od,{to:`/${e.account.name}/${e.project.name}/services`,children:"Go to Services"})})]})},G7=()=>{const{account:e,project:t}=dd(["account","project"]);return d.jsx(PN,{to:Zs(yr.Environments,{account:e,project:t})})};function K7(){return d.jsx("button",{type:"button",disabled:!0,title:"Locked custom domain",className:"items-center justify-center p-2 hover:bg-gray-100 rounded cursor-pointer",children:d.jsx(up,{className:"h-5 w-5 mx-auto","aria-hidden":"true"})})}const Y7=Wr("",{variants:{variant:{highlight:"text-indigo-600 hover:underline",underline:"underline hover:no-underline",ghost:""}},defaultVariants:{variant:"highlight"}}),my=({className:e,variant:t,...n})=>d.jsx(od,{className:Y7({variant:t,className:e}),...n});function Z7(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Af={exports:{}},Q7=Af.exports,GE;function X7(){return GE||(GE=1,function(e,t){(function(n,r){typeof Z7=="function"?e.exports=r():n.pluralize=r()})(Q7,function(){var n=[],r=[],s={},o={},i={};function a(m){return typeof m=="string"?new RegExp("^"+m+"$","i"):m}function l(m,v){return m===v?v:m===m.toLowerCase()?v.toLowerCase():m===m.toUpperCase()?v.toUpperCase():m[0]===m[0].toUpperCase()?v.charAt(0).toUpperCase()+v.substr(1).toLowerCase():v.toLowerCase()}function c(m,v){return m.replace(/\$(\d{1,2})/g,function(b,x){return v[x]||""})}function u(m,v){return m.replace(v[0],function(b,x){var w=c(v[1],arguments);return l(b===""?m[x-1]:b,w)})}function f(m,v,b){if(!m.length||s.hasOwnProperty(m))return v;for(var x=b.length;x--;){var w=b[x];if(w[0].test(v))return u(v,w)}return v}function p(m,v,b){return function(x){var w=x.toLowerCase();return v.hasOwnProperty(w)?l(x,w):m.hasOwnProperty(w)?l(x,m[w]):f(w,x,b)}}function g(m,v,b,x){return function(w){var _=w.toLowerCase();return v.hasOwnProperty(_)?!0:m.hasOwnProperty(_)?!1:f(_,_,b)===_}}function y(m,v,b){var x=v===1?y.singular(m):y.plural(m);return(b?v+" ":"")+x}return y.plural=p(i,o,n),y.isPlural=g(i,o,n),y.singular=p(o,i,r),y.isSingular=g(o,i,r),y.addPluralRule=function(m,v){n.push([a(m),v])},y.addSingularRule=function(m,v){r.push([a(m),v])},y.addUncountableRule=function(m){if(typeof m=="string"){s[m.toLowerCase()]=!0;return}y.addPluralRule(m,"$0"),y.addSingularRule(m,"$0")},y.addIrregularRule=function(m,v){v=v.toLowerCase(),m=m.toLowerCase(),i[m]=v,o[v]=m},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(m){return y.addIrregularRule(m[0],m[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEach(function(m){return y.addPluralRule(m[0],m[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(m){return y.addSingularRule(m[0],m[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(y.addUncountableRule),y})}(Af)),Af.exports}var J7=X7();const mj=({accountName:e,featureName:t,classNames:n,navigationSource:r})=>d.jsxs(rn,{variant:"default",className:n,children:[d.jsx(xs,{children:"Upgrade Required"}),d.jsx(ws,{className:"flex-1 leading-loose mt-1 text-sm",children:d.jsxs("p",{className:"leading-loose",children:[t," ",J7.isPlural(t)?"are":"is"," not enabled in your current plan. Go to"," ",d.jsx(my,{className:"hover:text-zuplo-pink-hover text-zuplo-pink underline cursor-pointer",to:`${Zs(yr.AccountSettings,{account:e})}/upgrade-billing${r?`?source=${r}`:""}`,children:"Billing"})," ","to upgrade your plan."]})}),d.jsx(fd,{children:d.jsx(Fe,{asChild:!0,variant:"white",size:"sm",children:d.jsx(my,{variant:"highlight",to:`${Zs(yr.AccountSettings,{account:e})}/upgrade-billing${r?`?source=${r}`:""}`,children:"Upgrade Plan"})})})]}),Ip=({message:e})=>d.jsxs("div",{className:"flex flex-row items-center h-12 p-2 text-sm font-medium",children:[d.jsx(Jl,{className:"w-2 h-2 mr-2",borderPositionAndSize:"border-l-2"}),d.jsx("span",{children:e??"Loading"})]});function gj(e){const t=h.useRef({value:e,previous:e});return h.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Fp="Switch",[e9,die]=Vr(Fp),[t9,n9]=e9(Fp),vj=h.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:o,required:i,disabled:a,value:l="on",onCheckedChange:c,form:u,...f}=e,[p,g]=h.useState(null),y=tt(t,w=>g(w)),m=h.useRef(!1),v=p?u||!!p.closest("form"):!0,[b,x]=Ys({prop:s,defaultProp:o??!1,onChange:c,caller:Fp});return d.jsxs(t9,{scope:n,checked:b,disabled:a,children:[d.jsx($e.button,{type:"button",role:"switch","aria-checked":b,"aria-required":i,"data-state":wj(b),"data-disabled":a?"":void 0,disabled:a,value:l,...f,ref:y,onClick:me(e.onClick,w=>{x(_=>!_),v&&(m.current=w.isPropagationStopped(),m.current||w.stopPropagation())})}),v&&d.jsx(xj,{control:p,bubbles:!m.current,name:r,value:l,checked:b,required:i,disabled:a,form:u,style:{transform:"translateX(-100%)"}})]})});vj.displayName=Fp;var yj="SwitchThumb",bj=h.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=n9(yj,n);return d.jsx($e.span,{"data-state":wj(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});bj.displayName=yj;var r9="SwitchBubbleInput",xj=h.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},o)=>{const i=h.useRef(null),a=tt(i,o),l=gj(n),c=uT(t);return h.useEffect(()=>{const u=i.current;if(!u)return;const f=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(f,"checked").set;if(l!==n&&g){const y=new Event("click",{bubbles:r});g.call(u,n),u.dispatchEvent(y)}},[l,n,r]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:a,style:{...s.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});xj.displayName=r9;function wj(e){return e?"checked":"unchecked"}var _j=vj,s9=bj;const Ej=h.forwardRef(({className:e,...t},n)=>d.jsx(_j,{className:se("peer inline-flex h-5 w-9 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",e),...t,ref:n,children:d.jsx(s9,{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")})}));Ej.displayName=_j.displayName;const Sj=({customDomain:e,cname:t})=>d.jsxs("div",{className:"text-left text-sm text-gray-800 whitespace-pre-line w-full mb-2",children:[d.jsx("p",{children:"We've set things up on our end, now you need to configure your DNS with a new entry."}),d.jsx("br",{}),d.jsx(rn,{variant:"muted",className:"font-mono p-4 text-sm",children:d.jsxs("ol",{children:[d.jsx("li",{className:"leading-6",children:"Type: CNAME"}),d.jsxs("li",{className:"leading-6",children:["Name: ",e," ",d.jsx(dh,{textToCopy:e??""})]}),d.jsxs("li",{className:"leading-6",children:["Value: ",t," ",d.jsx(dh,{textToCopy:t??""})]}),d.jsx("li",{className:"leading-6",children:"TTL: 60s or auto"})]})}),d.jsx("br",{}),d.jsx("p",{children:"Note that it does sometimes take a few hours for records to propagate and for the SSL certificate to be created."}),d.jsx("br",{}),d.jsxs("p",{children:["For more information see our"," ",d.jsx(xt,{href:"https://www.zuplo.com/docs/guides/custom-domain-setup",children:"documentation on custom domains"}),"."]})]});var hd=e=>e.type==="checkbox",ki=e=>e instanceof Date,Dn=e=>e==null;const Cj=e=>typeof e=="object";var Bt=e=>!Dn(e)&&!Array.isArray(e)&&Cj(e)&&!ki(e),Tj=e=>Bt(e)&&e.target?hd(e.target)?e.target.checked:e.target.value:e,o9=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Rj=(e,t)=>e.has(o9(t)),i9=e=>{const t=e.constructor&&e.constructor.prototype;return Bt(t)&&t.hasOwnProperty("isPrototypeOf")},Ox=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ln(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(Ox&&(e instanceof Blob||r))&&(n||Bt(e)))if(t=n?[]:{},!n&&!i9(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=ln(e[s]));else return e;return t}var Lp=e=>Array.isArray(e)?e.filter(Boolean):[],Lt=e=>e===void 0,fe=(e,t,n)=>{if(!t||!Bt(e))return n;const r=Lp(t.split(/[,[\].]+?/)).reduce((s,o)=>Dn(s)?s:s[o],e);return Lt(r)||r===e?Lt(e[t])?n:e[t]:r},Yn=e=>typeof e=="boolean",Mx=e=>/^\w*$/.test(e),Nj=e=>Lp(e.replace(/["|']|\]/g,"").split(/\.|\[/)),it=(e,t,n)=>{let r=-1;const s=Mx(t)?[t]:Nj(t),o=s.length,i=o-1;for(;++r<o;){const a=s[r];let l=n;if(r!==i){const c=e[a];l=Bt(c)||Array.isArray(c)?c:isNaN(+s[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=l,e=e[a]}};const fh={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},$r={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ts={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Pj=ce.createContext(null),tc=()=>ce.useContext(Pj),jj=e=>{const{children:t,...n}=e;return ce.createElement(Pj.Provider,{value:n},t)};var Aj=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const i=o;return t._proxyFormState[i]!==$r.all&&(t._proxyFormState[i]=!r||$r.all),n&&(n[i]=!0),e[i]}});return s},gy=e=>Dn(e)||!Cj(e);function Ls(e,t){if(gy(e)||gy(t))return e===t;if(ki(e)&&ki(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const s of n){const o=e[s];if(!r.includes(s))return!1;if(s!=="ref"){const i=t[s];if(ki(o)&&ki(i)||Bt(o)&&Bt(i)||Array.isArray(o)&&Array.isArray(i)?!Ls(o,i):o!==i)return!1}}return!0}const $j=(e,t)=>{const n=h.useRef(t);Ls(t,n.current)||(n.current=t),h.useEffect(e,n.current)};function Dj(e){const t=tc(),{control:n=t.control,disabled:r,name:s,exact:o}=e||{},[i,a]=ce.useState(n._formState),l=ce.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return $j(()=>n._subscribe({name:s,formState:l.current,exact:o,callback:c=>{!r&&a({...n._formState,...c})}}),[s,r,o]),ce.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),ce.useMemo(()=>Aj(i,n,l.current,!1),[i,n])}var rs=e=>typeof e=="string",kj=(e,t,n,r,s)=>rs(e)?(r&&t.watch.add(e),fe(n,e,s)):Array.isArray(e)?e.map(o=>(r&&t.watch.add(o),fe(n,o))):(r&&(t.watchAll=!0),n);function a9(e){const t=tc(),{control:n=t.control,name:r,defaultValue:s,disabled:o,exact:i}=e||{},[a,l]=ce.useState(n._getWatch(r,s));return $j(()=>n._subscribe({name:r,formState:{values:!0},exact:i,callback:c=>!o&&l(kj(r,n._names,c.values||n._formValues,!1,s))}),[r,s,o,i]),ce.useEffect(()=>n._removeUnmounted()),a}function l9(e){const t=tc(),{name:n,disabled:r,control:s=t.control,shouldUnregister:o}=e,i=Rj(s._names.array,n),a=a9({control:s,name:n,defaultValue:fe(s._formValues,n,fe(s._defaultValues,n,e.defaultValue)),exact:!0}),l=Dj({control:s,name:n,exact:!0}),c=ce.useRef(e),u=ce.useRef(s.register(n,{...e.rules,value:a,...Yn(e.disabled)?{disabled:e.disabled}:{}})),f=ce.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!fe(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!fe(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!fe(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!fe(l.validatingFields,n)},error:{enumerable:!0,get:()=>fe(l.errors,n)}}),[l,n]),p=ce.useCallback(v=>u.current.onChange({target:{value:Tj(v),name:n},type:fh.CHANGE}),[n]),g=ce.useCallback(()=>u.current.onBlur({target:{value:fe(s._formValues,n),name:n},type:fh.BLUR}),[n,s._formValues]),y=ce.useCallback(v=>{const b=fe(s._fields,n);b&&v&&(b._f.ref={focus:()=>v.focus(),select:()=>v.select(),setCustomValidity:x=>v.setCustomValidity(x),reportValidity:()=>v.reportValidity()})},[s._fields,n]),m=ce.useMemo(()=>({name:n,value:a,...Yn(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:p,onBlur:g,ref:y}),[n,r,l.disabled,p,g,y,a]);return ce.useEffect(()=>{const v=s._options.shouldUnregister||o;s.register(n,{...c.current.rules,...Yn(c.current.disabled)?{disabled:c.current.disabled}:{}});const b=(x,w)=>{const _=fe(s._fields,x);_&&_._f&&(_._f.mount=w)};if(b(n,!0),v){const x=ln(fe(s._options.defaultValues,n));it(s._defaultValues,n,x),Lt(fe(s._formValues,n))&&it(s._formValues,n,x)}return!i&&s.register(n),()=>{(i?v&&!s._state.action:v)?s.unregister(n):b(n,!1)}},[n,s,i,o]),ce.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),ce.useMemo(()=>({field:m,formState:l,fieldState:f}),[m,l,f])}const Oj=e=>e.render(l9(e));var Mj=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},iu=e=>Array.isArray(e)?e:[e],KE=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}},An=e=>Bt(e)&&!Object.keys(e).length,Ix=e=>e.type==="file",Dr=e=>typeof e=="function",hh=e=>{if(!Ox)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Ij=e=>e.type==="select-multiple",Fx=e=>e.type==="radio",c9=e=>Fx(e)||hd(e),ig=e=>hh(e)&&e.isConnected;function u9(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Lt(e)?r++:e[t[r++]];return e}function d9(e){for(const t in e)if(e.hasOwnProperty(t)&&!Lt(e[t]))return!1;return!0}function qt(e,t){const n=Array.isArray(t)?t:Mx(t)?[t]:Nj(t),r=n.length===1?e:u9(e,n),s=n.length-1,o=n[s];return r&&delete r[o],s!==0&&(Bt(r)&&An(r)||Array.isArray(r)&&d9(r))&&qt(e,n.slice(0,-1)),e}var Fj=e=>{for(const t in e)if(Dr(e[t]))return!0;return!1};function ph(e,t={}){const n=Array.isArray(e);if(Bt(e)||n)for(const r in e)Array.isArray(e[r])||Bt(e[r])&&!Fj(e[r])?(t[r]=Array.isArray(e[r])?[]:{},ph(e[r],t[r])):Dn(e[r])||(t[r]=!0);return t}function Lj(e,t,n){const r=Array.isArray(e);if(Bt(e)||r)for(const s in e)Array.isArray(e[s])||Bt(e[s])&&!Fj(e[s])?Lt(t)||gy(n[s])?n[s]=Array.isArray(e[s])?ph(e[s],[]):{...ph(e[s])}:Lj(e[s],Dn(t)?{}:t[s],n[s]):n[s]=!Ls(e[s],t[s]);return n}var Sc=(e,t)=>Lj(e,t,ph(t));const YE={value:!1,isValid:!1},ZE={value:!0,isValid:!0};var Uj=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Lt(e[0].attributes.value)?Lt(e[0].value)||e[0].value===""?ZE:{value:e[0].value,isValid:!0}:ZE:YE}return YE},Bj=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Lt(e)?e:t?e===""?NaN:e&&+e:n&&rs(e)?new Date(e):r?r(e):e;const QE={isValid:!1,value:null};var Vj=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,QE):QE;function XE(e){const t=e.ref;return Ix(t)?t.files:Fx(t)?Vj(e.refs).value:Ij(t)?[...t.selectedOptions].map(({value:n})=>n):hd(t)?Uj(e.refs).value:Bj(Lt(t.value)?e.ref.value:t.value,e)}var f9=(e,t,n,r)=>{const s={};for(const o of e){const i=fe(t,o);i&&it(s,o,i._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},mh=e=>e instanceof RegExp,Cc=e=>Lt(e)?e:mh(e)?e.source:Bt(e)?mh(e.value)?e.value.source:e.value:e,JE=e=>({isOnSubmit:!e||e===$r.onSubmit,isOnBlur:e===$r.onBlur,isOnChange:e===$r.onChange,isOnAll:e===$r.all,isOnTouch:e===$r.onTouched});const eS="AsyncFunction";var h9=e=>!!e&&!!e.validate&&!!(Dr(e.validate)&&e.validate.constructor.name===eS||Bt(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===eS)),p9=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),tS=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const au=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const o=fe(e,s);if(o){const{_f:i,...a}=o;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],s)&&!r)return!0;if(i.ref&&t(i.ref,i.name)&&!r)return!0;if(au(a,t))break}else if(Bt(a)&&au(a,t))break}}};function nS(e,t,n){const r=fe(e,n);if(r||Mx(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const o=s.join("."),i=fe(t,o),a=fe(e,o);if(i&&!Array.isArray(i)&&n!==o)return{name:n};if(a&&a.type)return{name:o,error:a};s.pop()}return{name:n}}var m9=(e,t,n,r)=>{n(e);const{name:s,...o}=e;return An(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(i=>t[i]===(!r||$r.all))},g9=(e,t,n)=>!e||!t||e===t||iu(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),v9=(e,t,n,r,s)=>s.isOnAll?!1:!n&&s.isOnTouch?!(t||e):(n?r.isOnBlur:s.isOnBlur)?!e:(n?r.isOnChange:s.isOnChange)?e:!0,y9=(e,t)=>!Lp(fe(e,t)).length&&qt(e,t),b9=(e,t,n)=>{const r=iu(fe(e,n));return it(r,"root",t[n]),it(e,n,r),e},$f=e=>rs(e);function rS(e,t,n="validate"){if($f(e)||Array.isArray(e)&&e.every($f)||Yn(e)&&!e)return{type:n,message:$f(e)?e:"",ref:t}}var Ma=e=>Bt(e)&&!mh(e)?e:{value:e,message:""},sS=async(e,t,n,r,s,o)=>{const{ref:i,refs:a,required:l,maxLength:c,minLength:u,min:f,max:p,pattern:g,validate:y,name:m,valueAsNumber:v,mount:b}=e._f,x=fe(n,m);if(!b||t.has(m))return{};const w=a?a[0]:i,_=L=>{s&&w.reportValidity&&(w.setCustomValidity(Yn(L)?"":L||""),w.reportValidity())},E={},S=Fx(i),R=hd(i),C=S||R,N=(v||Ix(i))&&Lt(i.value)&&Lt(x)||hh(i)&&i.value===""||x===""||Array.isArray(x)&&!x.length,k=Mj.bind(null,m,r,E),V=(L,G,$,I=Ts.maxLength,j=Ts.minLength)=>{const F=L?G:$;E[m]={type:L?I:j,message:F,ref:i,...k(L?I:j,F)}};if(o?!Array.isArray(x)||!x.length:l&&(!C&&(N||Dn(x))||Yn(x)&&!x||R&&!Uj(a).isValid||S&&!Vj(a).isValid)){const{value:L,message:G}=$f(l)?{value:!!l,message:l}:Ma(l);if(L&&(E[m]={type:Ts.required,message:G,ref:w,...k(Ts.required,G)},!r))return _(G),E}if(!N&&(!Dn(f)||!Dn(p))){let L,G;const $=Ma(p),I=Ma(f);if(!Dn(x)&&!isNaN(x)){const j=i.valueAsNumber||x&&+x;Dn($.value)||(L=j>$.value),Dn(I.value)||(G=j<I.value)}else{const j=i.valueAsDate||new Date(x),F=Y=>new Date(new Date().toDateString()+" "+Y),O=i.type=="time",U=i.type=="week";rs($.value)&&x&&(L=O?F(x)>F($.value):U?x>$.value:j>new Date($.value)),rs(I.value)&&x&&(G=O?F(x)<F(I.value):U?x<I.value:j<new Date(I.value))}if((L||G)&&(V(!!L,$.message,I.message,Ts.max,Ts.min),!r))return _(E[m].message),E}if((c||u)&&!N&&(rs(x)||o&&Array.isArray(x))){const L=Ma(c),G=Ma(u),$=!Dn(L.value)&&x.length>+L.value,I=!Dn(G.value)&&x.length<+G.value;if(($||I)&&(V($,L.message,G.message),!r))return _(E[m].message),E}if(g&&!N&&rs(x)){const{value:L,message:G}=Ma(g);if(mh(L)&&!x.match(L)&&(E[m]={type:Ts.pattern,message:G,ref:i,...k(Ts.pattern,G)},!r))return _(G),E}if(y){if(Dr(y)){const L=await y(x,n),G=rS(L,w);if(G&&(E[m]={...G,...k(Ts.validate,G.message)},!r))return _(G.message),E}else if(Bt(y)){let L={};for(const G in y){if(!An(L)&&!r)break;const $=rS(await y[G](x,n),w,G);$&&(L={...$,...k(G,$.message)},_($.message),r&&(E[m]=L))}if(!An(L)&&(E[m]={ref:w,...L},!r))return E}}return _(!0),E};const x9={mode:$r.onSubmit,reValidateMode:$r.onChange,shouldFocusError:!0};function w9(e={}){let t={...x9,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Dr(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1};const r={};let s=Bt(t.defaultValues)||Bt(t.values)?ln(t.values||t.defaultValues)||{}:{},o=t.shouldUnregister?{}:ln(s),i={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let f={...u};const p={array:KE(),state:KE()},g=JE(t.mode),y=JE(t.reValidateMode),m=t.criteriaMode===$r.all,v=A=>z=>{clearTimeout(c),c=setTimeout(A,z)},b=async A=>{if(!t.disabled&&(u.isValid||f.isValid||A)){const z=t.resolver?An((await N()).errors):await V(r,!0);z!==n.isValid&&p.state.next({isValid:z})}},x=(A,z)=>{!t.disabled&&(u.isValidating||u.validatingFields||f.isValidating||f.validatingFields)&&((A||Array.from(a.mount)).forEach(Z=>{Z&&(z?it(n.validatingFields,Z,z):qt(n.validatingFields,Z))}),p.state.next({validatingFields:n.validatingFields,isValidating:!An(n.validatingFields)}))},w=(A,z=[],Z,ve,le=!0,ne=!0)=>{if(ve&&Z&&!t.disabled){if(i.action=!0,ne&&Array.isArray(fe(r,A))){const Se=Z(fe(r,A),ve.argA,ve.argB);le&&it(r,A,Se)}if(ne&&Array.isArray(fe(n.errors,A))){const Se=Z(fe(n.errors,A),ve.argA,ve.argB);le&&it(n.errors,A,Se),y9(n.errors,A)}if((u.touchedFields||f.touchedFields)&&ne&&Array.isArray(fe(n.touchedFields,A))){const Se=Z(fe(n.touchedFields,A),ve.argA,ve.argB);le&&it(n.touchedFields,A,Se)}(u.dirtyFields||f.dirtyFields)&&(n.dirtyFields=Sc(s,o)),p.state.next({name:A,isDirty:G(A,z),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else it(o,A,z)},_=(A,z)=>{it(n.errors,A,z),p.state.next({errors:n.errors})},E=A=>{n.errors=A,p.state.next({errors:n.errors,isValid:!1})},S=(A,z,Z,ve)=>{const le=fe(r,A);if(le){const ne=fe(o,A,Lt(Z)?fe(s,A):Z);Lt(ne)||ve&&ve.defaultChecked||z?it(o,A,z?ne:XE(le._f)):j(A,ne),i.mount&&b()}},R=(A,z,Z,ve,le)=>{let ne=!1,Se=!1;const Xe={name:A};if(!t.disabled){if(!Z||ve){(u.isDirty||f.isDirty)&&(Se=n.isDirty,n.isDirty=Xe.isDirty=G(),ne=Se!==Xe.isDirty);const Nt=Ls(fe(s,A),z);Se=!!fe(n.dirtyFields,A),Nt?qt(n.dirtyFields,A):it(n.dirtyFields,A,!0),Xe.dirtyFields=n.dirtyFields,ne=ne||(u.dirtyFields||f.dirtyFields)&&Se!==!Nt}if(Z){const Nt=fe(n.touchedFields,A);Nt||(it(n.touchedFields,A,Z),Xe.touchedFields=n.touchedFields,ne=ne||(u.touchedFields||f.touchedFields)&&Nt!==Z)}ne&&le&&p.state.next(Xe)}return ne?Xe:{}},C=(A,z,Z,ve)=>{const le=fe(n.errors,A),ne=(u.isValid||f.isValid)&&Yn(z)&&n.isValid!==z;if(t.delayError&&Z?(l=v(()=>_(A,Z)),l(t.delayError)):(clearTimeout(c),l=null,Z?it(n.errors,A,Z):qt(n.errors,A)),(Z?!Ls(le,Z):le)||!An(ve)||ne){const Se={...ve,...ne&&Yn(z)?{isValid:z}:{},errors:n.errors,name:A};n={...n,...Se},p.state.next(Se)}},N=async A=>{x(A,!0);const z=await t.resolver(o,t.context,f9(A||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return x(A),z},k=async A=>{const{errors:z}=await N(A);if(A)for(const Z of A){const ve=fe(z,Z);ve?it(n.errors,Z,ve):qt(n.errors,Z)}else n.errors=z;return z},V=async(A,z,Z={valid:!0})=>{for(const ve in A){const le=A[ve];if(le){const{_f:ne,...Se}=le;if(ne){const Xe=a.array.has(ne.name),Nt=le._f&&h9(le._f);Nt&&u.validatingFields&&x([ve],!0);const ht=await sS(le,a.disabled,o,m,t.shouldUseNativeValidation&&!z,Xe);if(Nt&&u.validatingFields&&x([ve]),ht[ne.name]&&(Z.valid=!1,z))break;!z&&(fe(ht,ne.name)?Xe?b9(n.errors,ht,ne.name):it(n.errors,ne.name,ht[ne.name]):qt(n.errors,ne.name))}!An(Se)&&await V(Se,z,Z)}}return Z.valid},L=()=>{for(const A of a.unMount){const z=fe(r,A);z&&(z._f.refs?z._f.refs.every(Z=>!ig(Z)):!ig(z._f.ref))&&Ce(A)}a.unMount=new Set},G=(A,z)=>!t.disabled&&(A&&z&&it(o,A,z),!Ls(M(),s)),$=(A,z,Z)=>kj(A,a,{...i.mount?o:Lt(z)?s:rs(A)?{[A]:z}:z},Z,z),I=A=>Lp(fe(i.mount?o:s,A,t.shouldUnregister?fe(s,A,[]):[])),j=(A,z,Z={})=>{const ve=fe(r,A);let le=z;if(ve){const ne=ve._f;ne&&(!ne.disabled&&it(o,A,Bj(z,ne)),le=hh(ne.ref)&&Dn(z)?"":z,Ij(ne.ref)?[...ne.ref.options].forEach(Se=>Se.selected=le.includes(Se.value)):ne.refs?hd(ne.ref)?ne.refs.length>1?ne.refs.forEach(Se=>(!Se.defaultChecked||!Se.disabled)&&(Se.checked=Array.isArray(le)?!!le.find(Xe=>Xe===Se.value):le===Se.value)):ne.refs[0]&&(ne.refs[0].checked=!!le):ne.refs.forEach(Se=>Se.checked=Se.value===le):Ix(ne.ref)?ne.ref.value="":(ne.ref.value=le,ne.ref.type||p.state.next({name:A,values:ln(o)})))}(Z.shouldDirty||Z.shouldTouch)&&R(A,le,Z.shouldTouch,Z.shouldDirty,!0),Z.shouldValidate&&ee(A)},F=(A,z,Z)=>{for(const ve in z){const le=z[ve],ne=`${A}.${ve}`,Se=fe(r,ne);(a.array.has(A)||Bt(le)||Se&&!Se._f)&&!ki(le)?F(ne,le,Z):j(ne,le,Z)}},O=(A,z,Z={})=>{const ve=fe(r,A),le=a.array.has(A),ne=ln(z);it(o,A,ne),le?(p.array.next({name:A,values:ln(o)}),(u.isDirty||u.dirtyFields||f.isDirty||f.dirtyFields)&&Z.shouldDirty&&p.state.next({name:A,dirtyFields:Sc(s,o),isDirty:G(A,ne)})):ve&&!ve._f&&!Dn(ne)?F(A,ne,Z):j(A,ne,Z),tS(A,a)&&p.state.next({...n}),p.state.next({name:i.mount?A:void 0,values:ln(o)})},U=async A=>{i.mount=!0;const z=A.target;let Z=z.name,ve=!0;const le=fe(r,Z),ne=Se=>{ve=Number.isNaN(Se)||ki(Se)&&isNaN(Se.getTime())||Ls(Se,fe(o,Z,Se))};if(le){let Se,Xe;const Nt=z.type?XE(le._f):Tj(A),ht=A.type===fh.BLUR||A.type===fh.FOCUS_OUT,Pd=!p9(le._f)&&!t.resolver&&!fe(n.errors,Z)&&!le._f.deps||v9(ht,fe(n.touchedFields,Z),n.isSubmitted,y,g),Sa=tS(Z,a,ht);it(o,Z,Nt),ht?(le._f.onBlur&&le._f.onBlur(A),l&&l(0)):le._f.onChange&&le._f.onChange(A);const Ca=R(Z,Nt,ht),cm=!An(Ca)||Sa;if(!ht&&p.state.next({name:Z,type:A.type,values:ln(o)}),Pd)return(u.isValid||f.isValid)&&(t.mode==="onBlur"?ht&&b():ht||b()),cm&&p.state.next({name:Z,...Sa?{}:Ca});if(!ht&&Sa&&p.state.next({...n}),t.resolver){const{errors:uc}=await N([Z]);if(ne(Nt),ve){const Ta=nS(n.errors,r,Z),dc=nS(uc,r,Ta.name||Z);Se=dc.error,Z=dc.name,Xe=An(uc)}}else x([Z],!0),Se=(await sS(le,a.disabled,o,m,t.shouldUseNativeValidation))[Z],x([Z]),ne(Nt),ve&&(Se?Xe=!1:(u.isValid||f.isValid)&&(Xe=await V(r,!0)));ve&&(le._f.deps&&ee(le._f.deps),C(Z,Xe,Se,Ca))}},Y=(A,z)=>{if(fe(n.errors,z)&&A.focus)return A.focus(),1},ee=async(A,z={})=>{let Z,ve;const le=iu(A);if(t.resolver){const ne=await k(Lt(A)?A:le);Z=An(ne),ve=A?!le.some(Se=>fe(ne,Se)):Z}else A?(ve=(await Promise.all(le.map(async ne=>{const Se=fe(r,ne);return await V(Se&&Se._f?{[ne]:Se}:Se)}))).every(Boolean),!(!ve&&!n.isValid)&&b()):ve=Z=await V(r);return p.state.next({...!rs(A)||(u.isValid||f.isValid)&&Z!==n.isValid?{}:{name:A},...t.resolver||!A?{isValid:Z}:{},errors:n.errors}),z.shouldFocus&&!ve&&au(r,Y,A?le:a.mount),ve},M=A=>{const z={...i.mount?o:s};return Lt(A)?z:rs(A)?fe(z,A):A.map(Z=>fe(z,Z))},Q=(A,z)=>({invalid:!!fe((z||n).errors,A),isDirty:!!fe((z||n).dirtyFields,A),error:fe((z||n).errors,A),isValidating:!!fe(n.validatingFields,A),isTouched:!!fe((z||n).touchedFields,A)}),H=A=>{A&&iu(A).forEach(z=>qt(n.errors,z)),p.state.next({errors:A?n.errors:{}})},K=(A,z,Z)=>{const ve=(fe(r,A,{_f:{}})._f||{}).ref,le=fe(n.errors,A)||{},{ref:ne,message:Se,type:Xe,...Nt}=le;it(n.errors,A,{...Nt,...z,ref:ve}),p.state.next({name:A,errors:n.errors,isValid:!1}),Z&&Z.shouldFocus&&ve&&ve.focus&&ve.focus()},ae=(A,z)=>Dr(A)?p.state.subscribe({next:Z=>A($(void 0,z),Z)}):$(A,z,!0),te=A=>p.state.subscribe({next:z=>{g9(A.name,z.name,A.exact)&&m9(z,A.formState||u,ro,A.reRenderRoot)&&A.callback({values:{...o},...n,...z})}}).unsubscribe,Re=A=>(i.mount=!0,f={...f,...A.formState},te({...A,formState:f})),Ce=(A,z={})=>{for(const Z of A?iu(A):a.mount)a.mount.delete(Z),a.array.delete(Z),z.keepValue||(qt(r,Z),qt(o,Z)),!z.keepError&&qt(n.errors,Z),!z.keepDirty&&qt(n.dirtyFields,Z),!z.keepTouched&&qt(n.touchedFields,Z),!z.keepIsValidating&&qt(n.validatingFields,Z),!t.shouldUnregister&&!z.keepDefaultValue&&qt(s,Z);p.state.next({values:ln(o)}),p.state.next({...n,...z.keepDirty?{isDirty:G()}:{}}),!z.keepIsValid&&b()},ue=({disabled:A,name:z})=>{(Yn(A)&&i.mount||A||a.disabled.has(z))&&(A?a.disabled.add(z):a.disabled.delete(z))},ge=(A,z={})=>{let Z=fe(r,A);const ve=Yn(z.disabled)||Yn(t.disabled);return it(r,A,{...Z||{},_f:{...Z&&Z._f?Z._f:{ref:{name:A}},name:A,mount:!0,...z}}),a.mount.add(A),Z?ue({disabled:Yn(z.disabled)?z.disabled:t.disabled,name:A}):S(A,!0,z.value),{...ve?{disabled:z.disabled||t.disabled}:{},...t.progressive?{required:!!z.required,min:Cc(z.min),max:Cc(z.max),minLength:Cc(z.minLength),maxLength:Cc(z.maxLength),pattern:Cc(z.pattern)}:{},name:A,onChange:U,onBlur:U,ref:le=>{if(le){ge(A,z),Z=fe(r,A);const ne=Lt(le.value)&&le.querySelectorAll&&le.querySelectorAll("input,select,textarea")[0]||le,Se=c9(ne),Xe=Z._f.refs||[];if(Se?Xe.find(Nt=>Nt===ne):ne===Z._f.ref)return;it(r,A,{_f:{...Z._f,...Se?{refs:[...Xe.filter(ig),ne,...Array.isArray(fe(s,A))?[{}]:[]],ref:{type:ne.type,name:A}}:{ref:ne}}}),S(A,!1,void 0,ne)}else Z=fe(r,A,{}),Z._f&&(Z._f.mount=!1),(t.shouldUnregister||z.shouldUnregister)&&!(Rj(a.array,A)&&i.action)&&a.unMount.add(A)}}},ke=()=>t.shouldFocusError&&au(r,Y,a.mount),Ze=A=>{Yn(A)&&(p.state.next({disabled:A}),au(r,(z,Z)=>{const ve=fe(r,Z);ve&&(z.disabled=ve._f.disabled||A,Array.isArray(ve._f.refs)&&ve._f.refs.forEach(le=>{le.disabled=ve._f.disabled||A}))},0,!1))},lt=(A,z)=>async Z=>{let ve;Z&&(Z.preventDefault&&Z.preventDefault(),Z.persist&&Z.persist());let le=ln(o);if(p.state.next({isSubmitting:!0}),t.resolver){const{errors:ne,values:Se}=await N();n.errors=ne,le=Se}else await V(r);if(a.disabled.size)for(const ne of a.disabled)it(le,ne,void 0);if(qt(n.errors,"root"),An(n.errors)){p.state.next({errors:{}});try{await A(le,Z)}catch(ne){ve=ne}}else z&&await z({...n.errors},Z),ke(),setTimeout(ke);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:An(n.errors)&&!ve,submitCount:n.submitCount+1,errors:n.errors}),ve)throw ve},lr=(A,z={})=>{fe(r,A)&&(Lt(z.defaultValue)?O(A,ln(fe(s,A))):(O(A,z.defaultValue),it(s,A,ln(z.defaultValue))),z.keepTouched||qt(n.touchedFields,A),z.keepDirty||(qt(n.dirtyFields,A),n.isDirty=z.defaultValue?G(A,ln(fe(s,A))):G()),z.keepError||(qt(n.errors,A),u.isValid&&b()),p.state.next({...n}))},Gn=(A,z={})=>{const Z=A?ln(A):s,ve=ln(Z),le=An(A),ne=le?s:ve;if(z.keepDefaultValues||(s=Z),!z.keepValues){if(z.keepDirtyValues){const Se=new Set([...a.mount,...Object.keys(Sc(s,o))]);for(const Xe of Array.from(Se))fe(n.dirtyFields,Xe)?it(ne,Xe,fe(o,Xe)):O(Xe,fe(ne,Xe))}else{if(Ox&&Lt(A))for(const Se of a.mount){const Xe=fe(r,Se);if(Xe&&Xe._f){const Nt=Array.isArray(Xe._f.refs)?Xe._f.refs[0]:Xe._f.ref;if(hh(Nt)){const ht=Nt.closest("form");if(ht){ht.reset();break}}}}for(const Se of a.mount)O(Se,fe(ne,Se))}o=ln(ne),p.array.next({values:{...ne}}),p.state.next({values:{...ne}})}a={mount:z.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!u.isValid||!!z.keepIsValid||!!z.keepDirtyValues,i.watch=!!t.shouldUnregister,p.state.next({submitCount:z.keepSubmitCount?n.submitCount:0,isDirty:le?!1:z.keepDirty?n.isDirty:!!(z.keepDefaultValues&&!Ls(A,s)),isSubmitted:z.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:le?{}:z.keepDirtyValues?z.keepDefaultValues&&o?Sc(s,o):n.dirtyFields:z.keepDefaultValues&&A?Sc(s,A):z.keepDirty?n.dirtyFields:{},touchedFields:z.keepTouched?n.touchedFields:{},errors:z.keepErrors?n.errors:{},isSubmitSuccessful:z.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Cn=(A,z)=>Gn(Dr(A)?A(o):A,z),cc=(A,z={})=>{const Z=fe(r,A),ve=Z&&Z._f;if(ve){const le=ve.refs?ve.refs[0]:ve.ref;le.focus&&(le.focus(),z.shouldSelect&&Dr(le.select)&&le.select())}},ro=A=>{n={...n,...A}},Nd={control:{register:ge,unregister:Ce,getFieldState:Q,handleSubmit:lt,setError:K,_subscribe:te,_runSchema:N,_getWatch:$,_getDirty:G,_setValid:b,_setFieldArray:w,_setDisabledField:ue,_setErrors:E,_getFieldArray:I,_reset:Gn,_resetDefaultValues:()=>Dr(t.defaultValues)&&t.defaultValues().then(A=>{Cn(A,t.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:L,_disableForm:Ze,_subjects:p,_proxyFormState:u,get _fields(){return r},get _formValues(){return o},get _state(){return i},set _state(A){i=A},get _defaultValues(){return s},get _names(){return a},set _names(A){a=A},get _formState(){return n},get _options(){return t},set _options(A){t={...t,...A}}},subscribe:Re,trigger:ee,register:ge,handleSubmit:lt,watch:ae,setValue:O,getValues:M,reset:Cn,resetField:lr,clearErrors:H,unregister:Ce,setError:K,setFocus:cc,getFieldState:Q};return{...Nd,formControl:Nd}}const _9=typeof window<"u"?ce.useLayoutEffect:ce.useEffect;function zj(e={}){const t=ce.useRef(void 0),n=ce.useRef(void 0),[r,s]=ce.useState({isDirty:!1,isValidating:!1,isLoading:Dr(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:Dr(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...e.formControl?e.formControl:w9(e),formState:r},e.formControl&&e.defaultValues&&!Dr(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions));const o=t.current.control;return o._options=e,_9(()=>{const i=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(a=>({...a,isReady:!0})),o._formState.isReady=!0,i},[o]),ce.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),ce.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode),e.errors&&!An(e.errors)&&o._setErrors(e.errors)},[o,e.errors,e.mode,e.reValidateMode]),ce.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),ce.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==r.isDirty&&o._subjects.state.next({isDirty:i})}},[o,r.isDirty]),ce.useEffect(()=>{e.values&&!Ls(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[o,e.values]),ce.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=Aj(r,o),t.current}const oS=(e,t,n)=>{if(e&&"reportValidity"in e){const r=fe(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Wj=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?oS(r.ref,n,e):r.refs&&r.refs.forEach(s=>oS(s,n,e))}},E9=(e,t)=>{t.shouldUseNativeValidation&&Wj(e,t);const n={};for(const r in e){const s=fe(t.fields,r),o=Object.assign(e[r]||{},{ref:s&&s.ref});if(S9(t.names||Object.keys(e),r)){const i=Object.assign({},fe(n,r));it(i,"root",o),it(n,r,i)}else it(n,r,o)}return n},S9=(e,t)=>e.some(n=>n.startsWith(t+"."));var C9=function(e,t){for(var n={};e.length;){var r=e[0],s=r.code,o=r.message,i=r.path.join(".");if(!n[i])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[i]={message:a.message,type:a.code}}else n[i]={message:o,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(u){return u.errors.forEach(function(f){return e.push(f)})}),t){var l=n[i].types,c=l&&l[r.code];n[i]=Mj(i,t,n,s,c?[].concat(c,r.message):r.message)}e.shift()}return n},T9=function(e,t,n){return n===void 0&&(n={}),function(r,s,o){try{return Promise.resolve(function(i,a){try{var l=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return o.shouldUseNativeValidation&&Wj({},o),{errors:{},values:n.raw?r:c}})}catch(c){return a(c)}return l&&l.then?l.then(void 0,a):l}(0,function(i){if(function(a){return Array.isArray(a==null?void 0:a.errors)}(i))return{values:{},errors:E9(C9(i.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw i}))}catch(i){return Promise.reject(i)}}};const Lx=({error:e,className:t})=>e?d.jsx(Sr,{variant:"destructive",className:se("mb-2",t),children:d.jsx(ai,{children:hn(e)})}):null,qj=h.createContext({});function R9(e){const t=h.useRef(null);return t.current===null&&(t.current=e()),t.current}const Ux=h.createContext(null),Hj=h.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function N9(e=!0){const t=h.useContext(Ux);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=h.useId();h.useEffect(()=>{e&&s(o)},[e]);const i=h.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,i]:[!0]}const Bx=typeof window<"u",P9=Bx?h.useLayoutEffect:h.useEffect,rr=e=>e;let Gj=rr;function Vx(e){let t;return()=>(t===void 0&&(t=e()),t)}const Al=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Us=e=>e*1e3,Bs=e=>e/1e3,j9={useManualTiming:!1};function A9(e){let t=new Set,n=new Set,r=!1,s=!1;const o=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function a(c){o.has(c)&&(l.schedule(c),e()),c(i)}const l={schedule:(c,u=!1,f=!1)=>{const g=f&&r?t:n;return u&&o.add(c),g.has(c)||g.add(c),c},cancel:c=>{n.delete(c),o.delete(c)},process:c=>{if(i=c,r){s=!0;return}r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,s&&(s=!1,l.process(c))}};return l}const cf=["read","resolveKeyframes","update","preRender","render","postRender"],$9=40;function Kj(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=cf.reduce((b,x)=>(b[x]=A9(o),b),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:f,postRender:p}=i,g=()=>{const b=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(b-s.timestamp,$9),1),s.timestamp=b,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),f.process(s),p.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},y=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:cf.reduce((b,x)=>{const w=i[x];return b[x]=(_,E=!1,S=!1)=>(n||y(),w.schedule(_,E,S)),b},{}),cancel:b=>{for(let x=0;x<cf.length;x++)i[cf[x]].cancel(b)},state:s,steps:i}}const{schedule:vt,cancel:Qo,state:cn,steps:ag}=Kj(typeof requestAnimationFrame<"u"?requestAnimationFrame:rr,!0),Yj=h.createContext({strict:!1}),iS={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},$l={};for(const e in iS)$l[e]={isEnabled:t=>iS[e].some(n=>!!t[n])};function D9(e){for(const t in e)$l[t]={...$l[t],...e[t]}}const k9=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function gh(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||k9.has(e)}let Zj=e=>!gh(e);function O9(e){e&&(Zj=t=>t.startsWith("on")?!gh(t):e(t))}try{O9(require("@emotion/is-prop-valid").default)}catch{}function M9(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(Zj(s)||n===!0&&gh(s)||!t&&!gh(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function I9(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const Up=h.createContext({});function Tu(e){return typeof e=="string"||Array.isArray(e)}function Bp(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const zx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Wx=["initial",...zx];function Vp(e){return Bp(e.animate)||Wx.some(t=>Tu(e[t]))}function Qj(e){return!!(Vp(e)||e.variants)}function F9(e,t){if(Vp(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Tu(n)?n:void 0,animate:Tu(r)?r:void 0}}return e.inherit!==!1?t:{}}function L9(e){const{initial:t,animate:n}=F9(e,h.useContext(Up));return h.useMemo(()=>({initial:t,animate:n}),[aS(t),aS(n)])}function aS(e){return Array.isArray(e)?e.join(" "):e}const U9=Symbol.for("motionComponentSymbol");function Ga(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function B9(e,t,n){return h.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ga(n)&&(n.current=r))},[t])}const qx=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),V9="framerAppearId",Xj="data-"+qx(V9),{schedule:Hx}=Kj(queueMicrotask,!1),Jj=h.createContext({});function z9(e,t,n,r,s){var o,i;const{visualElement:a}=h.useContext(Up),l=h.useContext(Yj),c=h.useContext(Ux),u=h.useContext(Hj).reducedMotion,f=h.useRef(null);r=r||l.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:a,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u}));const p=f.current,g=h.useContext(Jj);p&&!p.projection&&s&&(p.type==="html"||p.type==="svg")&&W9(f.current,n,s,g);const y=h.useRef(!1);h.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const m=n[Xj],v=h.useRef(!!m&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,m))&&((i=window.MotionHasOptimisedAnimation)===null||i===void 0?void 0:i.call(window,m)));return P9(()=>{p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),Hx.render(p.render),v.current&&p.animationState&&p.animationState.animateChanges())}),h.useEffect(()=>{p&&(!v.current&&p.animationState&&p.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,m)}),v.current=!1))}),p}function W9(e,t,n,r){const{layoutId:s,layout:o,drag:i,dragConstraints:a,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:eA(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!i||a&&Ga(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}function eA(e){if(e)return e.options.allowProjection!==!1?e.projection:eA(e.parent)}function q9({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var o,i;e&&D9(e);function a(c,u){let f;const p={...h.useContext(Hj),...c,layoutId:H9(c)},{isStatic:g}=p,y=L9(c),m=r(c,g);if(!g&&Bx){G9();const v=K9(p);f=v.MeasureLayout,y.visualElement=z9(s,m,p,t,v.ProjectionNode)}return d.jsxs(Up.Provider,{value:y,children:[f&&y.visualElement?d.jsx(f,{visualElement:y.visualElement,...p}):null,n(s,c,B9(m,y.visualElement,u),m,g,y.visualElement)]})}a.displayName=`motion.${typeof s=="string"?s:`create(${(i=(o=s.displayName)!==null&&o!==void 0?o:s.name)!==null&&i!==void 0?i:""})`}`;const l=h.forwardRef(a);return l[U9]=s,l}function H9({layoutId:e}){const t=h.useContext(qj).id;return t&&e!==void 0?t+"-"+e:e}function G9(e,t){h.useContext(Yj).strict}function K9(e){const{drag:t,layout:n}=$l;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Y9=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Gx(e){return typeof e!="string"||e.includes("-")?!1:!!(Y9.indexOf(e)>-1||/[A-Z]/u.test(e))}function lS(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Kx(e,t,n,r){if(typeof t=="function"){const[s,o]=lS(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=lS(r);t=t(n!==void 0?n:e.custom,s,o)}return t}const vy=e=>Array.isArray(e),Z9=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Q9=e=>vy(e)?e[e.length-1]||0:e,wn=e=>!!(e&&e.getVelocity);function Df(e){const t=wn(e)?e.get():e;return Z9(t)?t.toValue():t}function X9({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,o){const i={latestValues:J9(r,s,o,e),renderState:t()};return n&&(i.onMount=a=>n({props:r,current:a,...i}),i.onUpdate=a=>n(a)),i}const tA=e=>(t,n)=>{const r=h.useContext(Up),s=h.useContext(Ux),o=()=>X9(e,t,r,s);return n?o():R9(o)};function J9(e,t,n,r){const s={},o=r(e,{});for(const p in o)s[p]=Df(o[p]);let{initial:i,animate:a}=e;const l=Vp(e),c=Qj(e);t&&c&&!l&&e.inherit!==!1&&(i===void 0&&(i=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||i===!1;const f=u?a:i;if(f&&typeof f!="boolean"&&!Bp(f)){const p=Array.isArray(f)?f:[f];for(let g=0;g<p.length;g++){const y=Kx(e,p[g]);if(y){const{transitionEnd:m,transition:v,...b}=y;for(const x in b){let w=b[x];if(Array.isArray(w)){const _=u?w.length-1:0;w=w[_]}w!==null&&(s[x]=w)}for(const x in m)s[x]=m[x]}}}return s}const nc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],wa=new Set(nc),nA=e=>t=>typeof t=="string"&&t.startsWith(e),rA=nA("--"),eq=nA("var(--"),Yx=e=>eq(e)?tq.test(e.split("/*")[0].trim()):!1,tq=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,sA=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Xs=(e,t,n)=>n>t?t:n<e?e:n,rc={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ru={...rc,transform:e=>Xs(0,1,e)},uf={...rc,default:1},pd=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),vo=pd("deg"),us=pd("%"),Oe=pd("px"),nq=pd("vh"),rq=pd("vw"),cS={...us,parse:e=>us.parse(e)/100,transform:e=>us.transform(e*100)},sq={borderWidth:Oe,borderTopWidth:Oe,borderRightWidth:Oe,borderBottomWidth:Oe,borderLeftWidth:Oe,borderRadius:Oe,radius:Oe,borderTopLeftRadius:Oe,borderTopRightRadius:Oe,borderBottomRightRadius:Oe,borderBottomLeftRadius:Oe,width:Oe,maxWidth:Oe,height:Oe,maxHeight:Oe,top:Oe,right:Oe,bottom:Oe,left:Oe,padding:Oe,paddingTop:Oe,paddingRight:Oe,paddingBottom:Oe,paddingLeft:Oe,margin:Oe,marginTop:Oe,marginRight:Oe,marginBottom:Oe,marginLeft:Oe,backgroundPositionX:Oe,backgroundPositionY:Oe},oq={rotate:vo,rotateX:vo,rotateY:vo,rotateZ:vo,scale:uf,scaleX:uf,scaleY:uf,scaleZ:uf,skew:vo,skewX:vo,skewY:vo,distance:Oe,translateX:Oe,translateY:Oe,translateZ:Oe,x:Oe,y:Oe,z:Oe,perspective:Oe,transformPerspective:Oe,opacity:Ru,originX:cS,originY:cS,originZ:Oe},uS={...rc,transform:Math.round},Zx={...sq,...oq,zIndex:uS,size:Oe,fillOpacity:Ru,strokeOpacity:Ru,numOctaves:uS},iq={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},aq=nc.length;function lq(e,t,n){let r="",s=!0;for(let o=0;o<aq;o++){const i=nc[o],a=e[i];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(i.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const c=sA(a,Zx[i]);if(!l){s=!1;const u=iq[i]||i;r+=`${u}(${c}) `}n&&(t[i]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Qx(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let i=!1,a=!1;for(const l in t){const c=t[l];if(wa.has(l)){i=!0;continue}else if(rA(l)){s[l]=c;continue}else{const u=sA(c,Zx[l]);l.startsWith("origin")?(a=!0,o[l]=u):r[l]=u}}if(t.transform||(i||n?r.transform=lq(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=o;r.transformOrigin=`${l} ${c} ${u}`}}const cq={offset:"stroke-dashoffset",array:"stroke-dasharray"},uq={offset:"strokeDashoffset",array:"strokeDasharray"};function dq(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?cq:uq;e[o.offset]=Oe.transform(-r);const i=Oe.transform(t),a=Oe.transform(n);e[o.array]=`${i} ${a}`}function dS(e,t,n){return typeof e=="string"?e:Oe.transform(t+n*e)}function fq(e,t,n){const r=dS(t,e.x,e.width),s=dS(n,e.y,e.height);return`${r} ${s}`}function Xx(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:o,pathLength:i,pathSpacing:a=1,pathOffset:l=0,...c},u,f){if(Qx(e,c,f),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:g,dimensions:y}=e;p.transform&&(y&&(g.transform=p.transform),delete p.transform),y&&(s!==void 0||o!==void 0||g.transform)&&(g.transformOrigin=fq(y,s!==void 0?s:.5,o!==void 0?o:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),i!==void 0&&dq(p,i,a,l,!1)}const Jx=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),oA=()=>({...Jx(),attrs:{}}),e0=e=>typeof e=="string"&&e.toLowerCase()==="svg";function iA(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const aA=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function lA(e,t,n,r){iA(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(aA.has(s)?s:qx(s),t.attrs[s])}const vh={};function hq(e){Object.assign(vh,e)}function cA(e,{layout:t,layoutId:n}){return wa.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!vh[e]||e==="opacity")}function t0(e,t,n){var r;const{style:s}=e,o={};for(const i in s)(wn(s[i])||t.style&&wn(t.style[i])||cA(i,e)||((r=n==null?void 0:n.getValue(i))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[i]=s[i]);return o}function uA(e,t,n){const r=t0(e,t,n);for(const s in e)if(wn(e[s])||wn(t[s])){const o=nc.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}function pq(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const fS=["x","y","width","height","cx","cy","r"],mq={useVisualState:tA({scrapeMotionValuesFromProps:uA,createRenderState:oA,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let o=!!e.drag;if(!o){for(const a in s)if(wa.has(a)){o=!0;break}}if(!o)return;let i=!t;if(t)for(let a=0;a<fS.length;a++){const l=fS[a];e[l]!==t[l]&&(i=!0)}i&&vt.read(()=>{pq(n,r),vt.render(()=>{Xx(r,s,e0(n.tagName),e.transformTemplate),lA(n,r)})})}})},gq={useVisualState:tA({scrapeMotionValuesFromProps:t0,createRenderState:Jx})};function dA(e,t,n){for(const r in t)!wn(t[r])&&!cA(r,n)&&(e[r]=t[r])}function vq({transformTemplate:e},t){return h.useMemo(()=>{const n=Jx();return Qx(n,t,e),Object.assign({},n.vars,n.style)},[t])}function yq(e,t){const n=e.style||{},r={};return dA(r,n,e),Object.assign(r,vq(e,t)),r}function bq(e,t){const n={},r=yq(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function xq(e,t,n,r){const s=h.useMemo(()=>{const o=oA();return Xx(o,t,e0(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};dA(o,e.style,e),s.style={...o,...s.style}}return s}function wq(e=!1){return(n,r,s,{latestValues:o},i)=>{const l=(Gx(n)?xq:bq)(r,o,i,n),c=M9(r,typeof n=="string",e),u=n!==h.Fragment?{...c,...l,ref:s}:{},{children:f}=r,p=h.useMemo(()=>wn(f)?f.get():f,[f]);return h.createElement(n,{...u,children:p})}}function _q(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const i={...Gx(r)?mq:gq,preloadedFeatures:e,useRender:wq(s),createVisualElement:t,Component:r};return q9(i)}}function fA(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function zp(e,t,n){const r=e.getProps();return Kx(r,t,n!==void 0?n:r.custom,e)}const Eq=Vx(()=>window.ScrollTimeline!==void 0);class Sq{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(Eq()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,o)=>{s&&s(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class Cq extends Sq{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function n0(e,t){return e?e[t]||e.default||e:void 0}const yy=2e4;function hA(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<yy;)t+=n,r=e.next(t);return t>=yy?1/0:t}function r0(e){return typeof e=="function"}function hS(e,t){e.timeline=t,e.onfinish=null}const s0=e=>Array.isArray(e)&&typeof e[0]=="number",Tq={linearEasing:void 0};function Rq(e,t){const n=Vx(e);return()=>{var r;return(r=Tq[t])!==null&&r!==void 0?r:n()}}const yh=Rq(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),pA=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=e(Al(0,s-1,o))+", ";return`linear(${r.substring(0,r.length-2)})`};function mA(e){return!!(typeof e=="function"&&yh()||!e||typeof e=="string"&&(e in by||yh())||s0(e)||Array.isArray(e)&&e.every(mA))}const zc=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,by={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:zc([0,.65,.55,1]),circOut:zc([.55,0,1,.45]),backIn:zc([.31,.01,.66,-.59]),backOut:zc([.33,1.53,.69,.99])};function gA(e,t){if(e)return typeof e=="function"&&yh()?pA(e,t):s0(e)?zc(e):Array.isArray(e)?e.map(n=>gA(n,t)||by.easeOut):by[e]}const Rr={x:!1,y:!1};function vA(){return Rr.x||Rr.y}function Nq(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let s=document;const o=(r=void 0)!==null&&r!==void 0?r:s.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function yA(e,t){const n=Nq(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function pS(e){return t=>{t.pointerType==="touch"||vA()||e(t)}}function Pq(e,t,n={}){const[r,s,o]=yA(e,n),i=pS(a=>{const{target:l}=a,c=t(a);if(typeof c!="function"||!l)return;const u=pS(f=>{c(f),l.removeEventListener("pointerleave",u)});l.addEventListener("pointerleave",u,s)});return r.forEach(a=>{a.addEventListener("pointerenter",i,s)}),o}const bA=(e,t)=>t?e===t?!0:bA(e,t.parentElement):!1,o0=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,jq=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Aq(e){return jq.has(e.tagName)||e.tabIndex!==-1}const Wc=new WeakSet;function mS(e){return t=>{t.key==="Enter"&&e(t)}}function lg(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const $q=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=mS(()=>{if(Wc.has(n))return;lg(n,"down");const s=mS(()=>{lg(n,"up")}),o=()=>lg(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function gS(e){return o0(e)&&!vA()}function Dq(e,t,n={}){const[r,s,o]=yA(e,n),i=a=>{const l=a.currentTarget;if(!gS(a)||Wc.has(l))return;Wc.add(l);const c=t(a),u=(g,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),!(!gS(g)||!Wc.has(l))&&(Wc.delete(l),typeof c=="function"&&c(g,{success:y}))},f=g=>{u(g,n.useGlobalTarget||bA(l,g.target))},p=g=>{u(g,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",p,s)};return r.forEach(a=>{!Aq(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",i,s),a.addEventListener("focus",c=>$q(c,s),s)}),o}function kq(e){return e==="x"||e==="y"?Rr[e]?null:(Rr[e]=!0,()=>{Rr[e]=!1}):Rr.x||Rr.y?null:(Rr.x=Rr.y=!0,()=>{Rr.x=Rr.y=!1})}const xA=new Set(["width","height","top","left","right","bottom",...nc]);let kf;function Oq(){kf=void 0}const ds={now:()=>(kf===void 0&&ds.set(cn.isProcessing||j9.useManualTiming?cn.timestamp:performance.now()),kf),set:e=>{kf=e,queueMicrotask(Oq)}};function i0(e,t){e.indexOf(t)===-1&&e.push(t)}function a0(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class l0{constructor(){this.subscriptions=[]}add(t){return i0(this.subscriptions,t),()=>a0(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const i=this.subscriptions[o];i&&i(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function wA(e,t){return t?e*(1e3/t):0}const vS=30,Mq=e=>!isNaN(parseFloat(e));class Iq{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const o=ds.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ds.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Mq(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new l0);const r=this.events[t].add(n);return t==="change"?()=>{r(),vt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ds.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>vS)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,vS);return wA(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Nu(e,t){return new Iq(e,t)}function Fq(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Nu(n))}function Lq(e,t){const n=zp(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const i in o){const a=Q9(o[i]);Fq(e,i,a)}}function Uq(e){return!!(wn(e)&&e.add)}function xy(e,t){const n=e.getValue("willChange");if(Uq(n))return n.add(t)}function _A(e){return e.props[Xj]}const EA=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Bq=1e-7,Vq=12;function zq(e,t,n,r,s){let o,i,a=0;do i=t+(n-t)/2,o=EA(i,r,s)-e,o>0?n=i:t=i;while(Math.abs(o)>Bq&&++a<Vq);return i}function md(e,t,n,r){if(e===t&&n===r)return rr;const s=o=>zq(o,0,1,e,n);return o=>o===0||o===1?o:EA(s(o),t,r)}const SA=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,CA=e=>t=>1-e(1-t),TA=md(.33,1.53,.69,.99),c0=CA(TA),RA=SA(c0),NA=e=>(e*=2)<1?.5*c0(e):.5*(2-Math.pow(2,-10*(e-1))),u0=e=>1-Math.sin(Math.acos(e)),PA=CA(u0),jA=SA(u0),AA=e=>/^0[^.\s]+$/u.test(e);function Wq(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||AA(e):!0}const lu=e=>Math.round(e*1e5)/1e5,d0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function qq(e){return e==null}const Hq=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,f0=(e,t)=>n=>!!(typeof n=="string"&&Hq.test(n)&&n.startsWith(e)||t&&!qq(n)&&Object.prototype.hasOwnProperty.call(n,t)),$A=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,i,a]=r.match(d0);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(i),alpha:a!==void 0?parseFloat(a):1}},Gq=e=>Xs(0,255,e),cg={...rc,transform:e=>Math.round(Gq(e))},Oi={test:f0("rgb","red"),parse:$A("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+cg.transform(e)+", "+cg.transform(t)+", "+cg.transform(n)+", "+lu(Ru.transform(r))+")"};function Kq(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const wy={test:f0("#"),parse:Kq,transform:Oi.transform},Ka={test:f0("hsl","hue"),parse:$A("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+us.transform(lu(t))+", "+us.transform(lu(n))+", "+lu(Ru.transform(r))+")"},bn={test:e=>Oi.test(e)||wy.test(e)||Ka.test(e),parse:e=>Oi.test(e)?Oi.parse(e):Ka.test(e)?Ka.parse(e):wy.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Oi.transform(e):Ka.transform(e)},Yq=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Zq(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(d0))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(Yq))===null||n===void 0?void 0:n.length)||0)>0}const DA="number",kA="color",Qq="var",Xq="var(",yS="${}",Jq=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Pu(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const a=t.replace(Jq,l=>(bn.test(l)?(r.color.push(o),s.push(kA),n.push(bn.parse(l))):l.startsWith(Xq)?(r.var.push(o),s.push(Qq),n.push(l)):(r.number.push(o),s.push(DA),n.push(parseFloat(l))),++o,yS)).split(yS);return{values:n,split:a,indexes:r,types:s}}function OA(e){return Pu(e).values}function MA(e){const{split:t,types:n}=Pu(e),r=t.length;return s=>{let o="";for(let i=0;i<r;i++)if(o+=t[i],s[i]!==void 0){const a=n[i];a===DA?o+=lu(s[i]):a===kA?o+=bn.transform(s[i]):o+=s[i]}return o}}const eH=e=>typeof e=="number"?0:e;function tH(e){const t=OA(e);return MA(e)(t.map(eH))}const Xo={test:Zq,parse:OA,createTransformer:MA,getAnimatableNone:tH},nH=new Set(["brightness","contrast","saturate","opacity"]);function rH(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(d0)||[];if(!r)return e;const s=n.replace(r,"");let o=nH.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const sH=/\b([a-z-]*)\(.*?\)/gu,_y={...Xo,getAnimatableNone:e=>{const t=e.match(sH);return t?t.map(rH).join(" "):e}},oH={...Zx,color:bn,backgroundColor:bn,outlineColor:bn,fill:bn,stroke:bn,borderColor:bn,borderTopColor:bn,borderRightColor:bn,borderBottomColor:bn,borderLeftColor:bn,filter:_y,WebkitFilter:_y},h0=e=>oH[e];function IA(e,t){let n=h0(e);return n!==_y&&(n=Xo),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const iH=new Set(["auto","none","0"]);function aH(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!iH.has(o)&&Pu(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=IA(n,s)}const bS=e=>e===rc||e===Oe,xS=(e,t)=>parseFloat(e.split(", ")[t]),wS=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return xS(s[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?xS(o[1],e):0}},lH=new Set(["x","y","z"]),cH=nc.filter(e=>!lH.has(e));function uH(e){const t=[];return cH.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Dl={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:wS(4,13),y:wS(5,14)};Dl.translateX=Dl.x;Dl.translateY=Dl.y;const Ki=new Set;let Ey=!1,Sy=!1;function FA(){if(Sy){const e=Array.from(Ki).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=uH(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,i])=>{var a;(a=r.getValue(o))===null||a===void 0||a.set(i)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Sy=!1,Ey=!1,Ki.forEach(e=>e.complete()),Ki.clear()}function LA(){Ki.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Sy=!0)})}function dH(){LA(),FA()}class p0{constructor(t,n,r,s,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Ki.add(this),Ey||(Ey=!0,vt.read(LA),vt.resolveKeyframes(FA))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let o=0;o<t.length;o++)if(t[o]===null)if(o===0){const i=s==null?void 0:s.get(),a=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),s&&i===void 0&&s.set(t[0])}else t[o]=t[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Ki.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Ki.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const UA=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),fH=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function hH(e){const t=fH.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function BA(e,t,n=1){const[r,s]=hH(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const i=o.trim();return UA(i)?parseFloat(i):i}return Yx(s)?BA(s,t,n+1):s}const VA=e=>t=>t.test(e),pH={test:e=>e==="auto",parse:e=>e},zA=[rc,Oe,us,vo,rq,nq,pH],_S=e=>zA.find(VA(e));class WA extends p0{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),Yx(c))){const u=BA(c,n.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!xA.has(r)||t.length!==2)return;const[s,o]=t,i=_S(s),a=_S(o);if(i!==a)if(bS(i)&&bS(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)Wq(t[s])&&r.push(s);r.length&&aH(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Dl[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const o=n.getValue(r);o&&o.jump(this.measuredOrigin,!1);const i=s.length-1,a=s[i];s[i]=Dl[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{n.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const ES=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Xo.test(e)||e==="0")&&!e.startsWith("url("));function mH(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function gH(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],i=ES(s,t),a=ES(o,t);return!i||!a?!1:mH(e)||(n==="spring"||r0(n))&&r}const vH=e=>e!==null;function Wp(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(vH),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return!o||r===void 0?s[o]:r}const yH=40;class qA{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:i="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ds.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:i,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>yH?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&dH(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=ds.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:o,delay:i,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!gH(t,r,s,o))if(i)this.options.duration=0;else{l&&l(Wp(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,n);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...u},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Ct=(e,t,n)=>e+(t-e)*n;function ug(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function bH({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,i=0;if(!t)s=o=i=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=ug(l,a,e+1/3),o=ug(l,a,e),i=ug(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(i*255),alpha:r}}function bh(e,t){return n=>n>0?t:e}const dg=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},xH=[wy,Oi,Ka],wH=e=>xH.find(t=>t.test(e));function SS(e){const t=wH(e);if(!t)return!1;let n=t.parse(e);return t===Ka&&(n=bH(n)),n}const CS=(e,t)=>{const n=SS(e),r=SS(t);if(!n||!r)return bh(e,t);const s={...n};return o=>(s.red=dg(n.red,r.red,o),s.green=dg(n.green,r.green,o),s.blue=dg(n.blue,r.blue,o),s.alpha=Ct(n.alpha,r.alpha,o),Oi.transform(s))},_H=(e,t)=>n=>t(e(n)),gd=(...e)=>e.reduce(_H),Cy=new Set(["none","hidden"]);function EH(e,t){return Cy.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function SH(e,t){return n=>Ct(e,t,n)}function m0(e){return typeof e=="number"?SH:typeof e=="string"?Yx(e)?bh:bn.test(e)?CS:RH:Array.isArray(e)?HA:typeof e=="object"?bn.test(e)?CS:CH:bh}function HA(e,t){const n=[...e],r=n.length,s=e.map((o,i)=>m0(o)(o,t[i]));return o=>{for(let i=0;i<r;i++)n[i]=s[i](o);return n}}function CH(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=m0(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function TH(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],a=e.indexes[i][s[i]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[o]=l,s[i]++}return r}const RH=(e,t)=>{const n=Xo.createTransformer(t),r=Pu(e),s=Pu(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Cy.has(e)&&!s.values.length||Cy.has(t)&&!r.values.length?EH(e,t):gd(HA(TH(r,s),s.values),n):bh(e,t)};function GA(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Ct(e,t,n):m0(e)(e,t)}const NH=5;function KA(e,t,n){const r=Math.max(t-NH,0);return wA(n-e(r),t-r)}const jt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},TS=.001;function PH({duration:e=jt.duration,bounce:t=jt.bounce,velocity:n=jt.velocity,mass:r=jt.mass}){let s,o,i=1-t;i=Xs(jt.minDamping,jt.maxDamping,i),e=Xs(jt.minDuration,jt.maxDuration,Bs(e)),i<1?(s=c=>{const u=c*i,f=u*e,p=u-n,g=Ty(c,i),y=Math.exp(-f);return TS-p/g*y},o=c=>{const f=c*i*e,p=f*n+n,g=Math.pow(i,2)*Math.pow(c,2)*e,y=Math.exp(-f),m=Ty(Math.pow(c,2),i);return(-s(c)+TS>0?-1:1)*((p-g)*y)/m}):(s=c=>{const u=Math.exp(-c*e),f=(c-n)*e+1;return-.001+u*f},o=c=>{const u=Math.exp(-c*e),f=(n-c)*(e*e);return u*f});const a=5/e,l=AH(s,o,a);if(e=Us(e),isNaN(l))return{stiffness:jt.stiffness,damping:jt.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:i*2*Math.sqrt(r*c),duration:e}}}const jH=12;function AH(e,t,n){let r=n;for(let s=1;s<jH;s++)r=r-e(r)/t(r);return r}function Ty(e,t){return e*Math.sqrt(1-t*t)}const $H=["duration","bounce"],DH=["stiffness","damping","mass"];function RS(e,t){return t.some(n=>e[n]!==void 0)}function kH(e){let t={velocity:jt.velocity,stiffness:jt.stiffness,damping:jt.damping,mass:jt.mass,isResolvedFromDuration:!1,...e};if(!RS(e,DH)&&RS(e,$H))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*Xs(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:jt.mass,stiffness:s,damping:o}}else{const n=PH(e);t={...t,...n,mass:jt.mass},t.isResolvedFromDuration=!0}return t}function YA(e=jt.visualDuration,t=jt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:f,velocity:p,isResolvedFromDuration:g}=kH({...n,velocity:-Bs(n.velocity||0)}),y=p||0,m=c/(2*Math.sqrt(l*u)),v=i-o,b=Bs(Math.sqrt(l/u)),x=Math.abs(v)<5;r||(r=x?jt.restSpeed.granular:jt.restSpeed.default),s||(s=x?jt.restDelta.granular:jt.restDelta.default);let w;if(m<1){const E=Ty(b,m);w=S=>{const R=Math.exp(-m*b*S);return i-R*((y+m*b*v)/E*Math.sin(E*S)+v*Math.cos(E*S))}}else if(m===1)w=E=>i-Math.exp(-b*E)*(v+(y+b*v)*E);else{const E=b*Math.sqrt(m*m-1);w=S=>{const R=Math.exp(-m*b*S),C=Math.min(E*S,300);return i-R*((y+m*b*v)*Math.sinh(C)+E*v*Math.cosh(C))/E}}const _={calculatedDuration:g&&f||null,next:E=>{const S=w(E);if(g)a.done=E>=f;else{let R=0;m<1&&(R=E===0?Us(y):KA(w,E,S));const C=Math.abs(R)<=r,N=Math.abs(i-S)<=s;a.done=C&&N}return a.value=a.done?i:S,a},toString:()=>{const E=Math.min(hA(_),yy),S=pA(R=>_.next(E*R).value,E,30);return E+"ms "+S}};return _}function NS({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:i,min:a,max:l,restDelta:c=.5,restSpeed:u}){const f=e[0],p={done:!1,value:f},g=C=>a!==void 0&&C<a||l!==void 0&&C>l,y=C=>a===void 0?l:l===void 0||Math.abs(a-C)<Math.abs(l-C)?a:l;let m=n*t;const v=f+m,b=i===void 0?v:i(v);b!==v&&(m=b-f);const x=C=>-m*Math.exp(-C/r),w=C=>b+x(C),_=C=>{const N=x(C),k=w(C);p.done=Math.abs(N)<=c,p.value=p.done?b:k};let E,S;const R=C=>{g(p.value)&&(E=C,S=YA({keyframes:[p.value,y(p.value)],velocity:KA(w,C,p.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return R(0),{calculatedDuration:null,next:C=>{let N=!1;return!S&&E===void 0&&(N=!0,_(C),R(C)),E!==void 0&&C>=E?S.next(C-E):(!N&&_(C),p)}}}const OH=md(.42,0,1,1),MH=md(0,0,.58,1),ZA=md(.42,0,.58,1),IH=e=>Array.isArray(e)&&typeof e[0]!="number",FH={linear:rr,easeIn:OH,easeInOut:ZA,easeOut:MH,circIn:u0,circInOut:jA,circOut:PA,backIn:c0,backInOut:RA,backOut:TA,anticipate:NA},PS=e=>{if(s0(e)){Gj(e.length===4);const[t,n,r,s]=e;return md(t,n,r,s)}else if(typeof e=="string")return FH[e];return e};function LH(e,t,n){const r=[],s=n||GA,o=e.length-1;for(let i=0;i<o;i++){let a=s(e[i],e[i+1]);if(t){const l=Array.isArray(t)?t[i]||rr:t;a=gd(l,a)}r.push(a)}return r}function UH(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(Gj(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=LH(t,r,s),l=a.length,c=u=>{if(i&&u<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(u<e[f+1]);f++);const p=Al(e[f],e[f+1],u);return a[f](p)};return n?u=>c(Xs(e[0],e[o-1],u)):c}function BH(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Al(0,t,r);e.push(Ct(n,1,s))}}function VH(e){const t=[0];return BH(t,e.length-1),t}function zH(e,t){return e.map(n=>n*t)}function WH(e,t){return e.map(()=>t||ZA).splice(0,e.length-1)}function xh({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=IH(r)?r.map(PS):PS(r),o={done:!1,value:t[0]},i=zH(n&&n.length===t.length?n:VH(t),e),a=UH(i,t,{ease:Array.isArray(s)?s:WH(t,s)});return{calculatedDuration:e,next:l=>(o.value=a(l),o.done=l>=e,o)}}const qH=e=>{const t=({timestamp:n})=>e(n);return{start:()=>vt.update(t,!0),stop:()=>Qo(t),now:()=>cn.isProcessing?cn.timestamp:ds.now()}},HH={decay:NS,inertia:NS,tween:xh,keyframes:xh,spring:YA},GH=e=>e/100;class g0 extends qA{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:s,keyframes:o}=this.options,i=(s==null?void 0:s.KeyframeResolver)||p0,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new i(o,a,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:i=0}=this.options,a=r0(n)?n:HH[n]||xh;let l,c;a!==xh&&typeof t[0]!="number"&&(l=gd(GH,GA(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});o==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-i})),u.calculatedDuration===null&&(u.calculatedDuration=hA(u));const{calculatedDuration:f}=u,p=f+s,g=p*(r+1)-s;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:f,resolvedDuration:p,totalDuration:g}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:C}=this.options;return{done:!0,value:C[C.length-1]}}const{finalKeyframe:s,generator:o,mirroredGenerator:i,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:f}=r;if(this.startTime===null)return o.next(0);const{delay:p,repeat:g,repeatType:y,repeatDelay:m,onUpdate:v}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const b=this.currentTime-p*(this.speed>=0?1:-1),x=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let w=this.currentTime,_=o;if(g){const C=Math.min(this.currentTime,u)/f;let N=Math.floor(C),k=C%1;!k&&C>=1&&(k=1),k===1&&N--,N=Math.min(N,g+1),!!(N%2)&&(y==="reverse"?(k=1-k,m&&(k-=m/f)):y==="mirror"&&(_=i)),w=Xs(0,1,k)*f}const E=x?{done:!1,value:l[0]}:_.next(w);a&&(E.value=a(E.value));let{done:S}=E;!x&&c!==null&&(S=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const R=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return R&&s!==void 0&&(E.value=Wp(l,this.options,s)),v&&v(E.value),R&&this.finish(),E}get duration(){const{resolved:t}=this;return t?Bs(t.calculatedDuration):0}get time(){return Bs(this.currentTime)}set time(t){t=Us(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Bs(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=qH,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const KH=new Set(["opacity","clipPath","filter","transform"]);function YH(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:i="loop",ease:a="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=gA(a,s);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:s,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:i==="reverse"?"alternate":"normal"})}const ZH=Vx(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),wh=10,QH=2e4;function XH(e){return r0(e.type)||e.type==="spring"||!mA(e.ease)}function JH(e,t){const n=new g0({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let o=0;for(;!r.done&&o<QH;)r=n.sample(o),s.push(r.value),o+=wh;return{times:void 0,keyframes:s,duration:o-wh,ease:"linear"}}const QA={anticipate:NA,backInOut:RA,circInOut:jA};function eG(e){return e in QA}class jS extends qA{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:o}=this.options;this.resolver=new WA(o,(i,a)=>this.onKeyframesResolved(i,a),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:o,type:i,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof o=="string"&&yh()&&eG(o)&&(o=QA[o]),XH(this.options)){const{onComplete:f,onUpdate:p,motionValue:g,element:y,...m}=this.options,v=JH(t,m);t=v.keyframes,t.length===1&&(t[1]=t[0]),r=v.duration,s=v.times,o=v.ease,i="keyframes"}const u=YH(a.owner.current,l,t,{...this.options,duration:r,times:s,ease:o});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(hS(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:f}=this.options;a.set(Wp(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:r,times:s,type:i,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Bs(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Bs(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Us(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return rr;const{animation:r}=n;hS(r,t)}return rr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:o,ease:i,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:f,element:p,...g}=this.options,y=new g0({...g,keyframes:r,duration:s,type:o,ease:i,times:a,isGenerator:!0}),m=Us(this.time);c.setWithVelocity(y.sample(m-wh).value,y.sample(m).value,wh)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:o,damping:i,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=n.owner.getProps();return ZH()&&r&&KH.has(r)&&!l&&!c&&!s&&o!=="mirror"&&i!==0&&a!=="inertia"}}const tG={type:"spring",stiffness:500,damping:25,restSpeed:10},nG=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),rG={type:"keyframes",duration:.8},sG={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oG=(e,{keyframes:t})=>t.length>2?rG:wa.has(e)?e.startsWith("scale")?nG(t[1]):tG:sG;function iG({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:i,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const v0=(e,t,n,r={},s,o)=>i=>{const a=n0(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Us(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{i(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:s};iG(a)||(u={...u,...oG(e,u)}),u.duration&&(u.duration=Us(u.duration)),u.repeatDelay&&(u.repeatDelay=Us(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let f=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(f=!0)),f&&!o&&t.get()!==void 0){const p=Wp(u.keyframes,a);if(p!==void 0)return vt.update(()=>{u.onUpdate(p),u.onComplete()}),new Cq([])}return!o&&jS.supports(u)?new jS(u):new g0(u)};function aG({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function XA(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var o;let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(i=r);const c=[],u=s&&e.animationState&&e.animationState.getState()[s];for(const f in l){const p=e.getValue(f,(o=e.latestValues[f])!==null&&o!==void 0?o:null),g=l[f];if(g===void 0||u&&aG(u,f))continue;const y={delay:n,...n0(i||{},f)};let m=!1;if(window.MotionHandoffAnimation){const b=_A(e);if(b){const x=window.MotionHandoffAnimation(b,f,vt);x!==null&&(y.startTime=x,m=!0)}}xy(e,f),p.start(v0(f,p,g,e.shouldReduceMotion&&xA.has(f)?{type:!1}:y,e,m));const v=p.animation;v&&c.push(v)}return a&&Promise.all(c).then(()=>{vt.update(()=>{a&&Lq(e,a)})}),c}function Ry(e,t,n={}){var r;const s=zp(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const i=s?()=>Promise.all(XA(e,s,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:p}=o;return lG(e,t,u+c,f,p,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[c,u]=l==="beforeChildren"?[i,a]:[a,i];return c().then(()=>u())}else return Promise.all([i(),a(n.delay)])}function lG(e,t,n=0,r=0,s=1,o){const i=[],a=(e.variantChildren.size-1)*r,l=s===1?(c=0)=>c*r:(c=0)=>a-c*r;return Array.from(e.variantChildren).sort(cG).forEach((c,u)=>{c.notify("AnimationStart",t),i.push(Ry(c,t,{...o,delay:n+l(u)}).then(()=>c.notify("AnimationComplete",t)))}),Promise.all(i)}function cG(e,t){return e.sortNodePosition(t)}function uG(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>Ry(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=Ry(e,t,n);else{const s=typeof t=="function"?zp(e,t,n.custom):t;r=Promise.all(XA(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const dG=Wx.length;function JA(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?JA(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<dG;n++){const r=Wx[n],s=e.props[r];(Tu(s)||s===!1)&&(t[r]=s)}return t}const fG=[...zx].reverse(),hG=zx.length;function pG(e){return t=>Promise.all(t.map(({animation:n,options:r})=>uG(e,n,r)))}function mG(e){let t=pG(e),n=AS(),r=!0;const s=l=>(c,u)=>{var f;const p=zp(e,u,l==="exit"?(f=e.presenceContext)===null||f===void 0?void 0:f.custom:void 0);if(p){const{transition:g,transitionEnd:y,...m}=p;c={...c,...m,...y}}return c};function o(l){t=l(e)}function i(l){const{props:c}=e,u=JA(e.parent)||{},f=[],p=new Set;let g={},y=1/0;for(let v=0;v<hG;v++){const b=fG[v],x=n[b],w=c[b]!==void 0?c[b]:u[b],_=Tu(w),E=b===l?x.isActive:null;E===!1&&(y=v);let S=w===u[b]&&w!==c[b]&&_;if(S&&r&&e.manuallyAnimateOnMount&&(S=!1),x.protectedKeys={...g},!x.isActive&&E===null||!w&&!x.prevProp||Bp(w)||typeof w=="boolean")continue;const R=gG(x.prevProp,w);let C=R||b===l&&x.isActive&&!S&&_||v>y&&_,N=!1;const k=Array.isArray(w)?w:[w];let V=k.reduce(s(b),{});E===!1&&(V={});const{prevResolvedValues:L={}}=x,G={...L,...V},$=F=>{C=!0,p.has(F)&&(N=!0,p.delete(F)),x.needsAnimating[F]=!0;const O=e.getValue(F);O&&(O.liveStyle=!1)};for(const F in G){const O=V[F],U=L[F];if(g.hasOwnProperty(F))continue;let Y=!1;vy(O)&&vy(U)?Y=!fA(O,U):Y=O!==U,Y?O!=null?$(F):p.add(F):O!==void 0&&p.has(F)?$(F):x.protectedKeys[F]=!0}x.prevProp=w,x.prevResolvedValues=V,x.isActive&&(g={...g,...V}),r&&e.blockInitialAnimation&&(C=!1),C&&(!(S&&R)||N)&&f.push(...k.map(F=>({animation:F,options:{type:b}})))}if(p.size){const v={};p.forEach(b=>{const x=e.getBaseTarget(b),w=e.getValue(b);w&&(w.liveStyle=!0),v[b]=x??null}),f.push({animation:v})}let m=!!f.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(f):Promise.resolve()}function a(l,c){var u;if(n[l].isActive===c)return Promise.resolve();(u=e.variantChildren)===null||u===void 0||u.forEach(p=>{var g;return(g=p.animationState)===null||g===void 0?void 0:g.setActive(l,c)}),n[l].isActive=c;const f=i(l);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:i,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=AS(),r=!0}}}function gG(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!fA(t,e):!1}function wi(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function AS(){return{animate:wi(!0),whileInView:wi(),whileHover:wi(),whileTap:wi(),whileDrag:wi(),whileFocus:wi(),exit:wi()}}class di{constructor(t){this.isMounted=!1,this.node=t}update(){}}class vG extends di{constructor(t){super(t),t.animationState||(t.animationState=mG(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Bp(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let yG=0;class bG extends di{constructor(){super(...arguments),this.id=yG++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const xG={animation:{Feature:vG},exit:{Feature:bG}};function ju(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function vd(e){return{point:{x:e.pageX,y:e.pageY}}}const wG=e=>t=>o0(t)&&e(t,vd(t));function cu(e,t,n,r){return ju(e,t,wG(n),r)}const $S=(e,t)=>Math.abs(e-t);function _G(e,t){const n=$S(e.x,t.x),r=$S(e.y,t.y);return Math.sqrt(n**2+r**2)}class e${constructor(t,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=hg(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=_G(f.offset,{x:0,y:0})>=3;if(!p&&!g)return;const{point:y}=f,{timestamp:m}=cn;this.history.push({...y,timestamp:m});const{onStart:v,onMove:b}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=fg(p,this.transformPagePoint),vt.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:g,onSessionEnd:y,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=hg(f.type==="pointercancel"?this.lastMoveEventInfo:fg(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(f,v),y&&y(f,v)},!o0(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const i=vd(t),a=fg(i,this.transformPagePoint),{point:l}=a,{timestamp:c}=cn;this.history=[{...l,timestamp:c}];const{onSessionStart:u}=n;u&&u(t,hg(a,this.history)),this.removeListeners=gd(cu(this.contextWindow,"pointermove",this.handlePointerMove),cu(this.contextWindow,"pointerup",this.handlePointerUp),cu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Qo(this.updatePoint)}}function fg(e,t){return t?{point:t(e.point)}:e}function DS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function hg({point:e},t){return{point:e,delta:DS(e,t$(t)),offset:DS(e,EG(t)),velocity:SG(t,.1)}}function EG(e){return e[0]}function t$(e){return e[e.length-1]}function SG(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=t$(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Us(t)));)n--;if(!r)return{x:0,y:0};const o=Bs(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const i={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}const n$=1e-4,CG=1-n$,TG=1+n$,r$=.01,RG=0-r$,NG=0+r$;function or(e){return e.max-e.min}function PG(e,t,n){return Math.abs(e-t)<=n}function kS(e,t,n,r=.5){e.origin=r,e.originPoint=Ct(t.min,t.max,e.origin),e.scale=or(n)/or(t),e.translate=Ct(n.min,n.max,e.origin)-e.originPoint,(e.scale>=CG&&e.scale<=TG||isNaN(e.scale))&&(e.scale=1),(e.translate>=RG&&e.translate<=NG||isNaN(e.translate))&&(e.translate=0)}function uu(e,t,n,r){kS(e.x,t.x,n.x,r?r.originX:void 0),kS(e.y,t.y,n.y,r?r.originY:void 0)}function OS(e,t,n){e.min=n.min+t.min,e.max=e.min+or(t)}function jG(e,t,n){OS(e.x,t.x,n.x),OS(e.y,t.y,n.y)}function MS(e,t,n){e.min=t.min-n.min,e.max=e.min+or(t)}function du(e,t,n){MS(e.x,t.x,n.x),MS(e.y,t.y,n.y)}function AG(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Ct(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Ct(n,e,r.max):Math.min(e,n)),e}function IS(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function $G(e,{top:t,left:n,bottom:r,right:s}){return{x:IS(e.x,n,s),y:IS(e.y,t,r)}}function FS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function DG(e,t){return{x:FS(e.x,t.x),y:FS(e.y,t.y)}}function kG(e,t){let n=.5;const r=or(e),s=or(t);return s>r?n=Al(t.min,t.max-r,e.min):r>s&&(n=Al(e.min,e.max-s,t.min)),Xs(0,1,n)}function OG(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ny=.35;function MG(e=Ny){return e===!1?e=0:e===!0&&(e=Ny),{x:LS(e,"left","right"),y:LS(e,"top","bottom")}}function LS(e,t,n){return{min:US(e,t),max:US(e,n)}}function US(e,t){return typeof e=="number"?e:e[t]||0}const BS=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ya=()=>({x:BS(),y:BS()}),VS=()=>({min:0,max:0}),Ft=()=>({x:VS(),y:VS()});function fr(e){return[e("x"),e("y")]}function s$({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function IG({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function FG(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function pg(e){return e===void 0||e===1}function Py({scale:e,scaleX:t,scaleY:n}){return!pg(e)||!pg(t)||!pg(n)}function Ti(e){return Py(e)||o$(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function o$(e){return zS(e.x)||zS(e.y)}function zS(e){return e&&e!=="0%"}function _h(e,t,n){const r=e-n,s=t*r;return n+s}function WS(e,t,n,r,s){return s!==void 0&&(e=_h(e,s,r)),_h(e,n,r)+t}function jy(e,t=0,n=1,r,s){e.min=WS(e.min,t,n,r,s),e.max=WS(e.max,t,n,r,s)}function i$(e,{x:t,y:n}){jy(e.x,t.translate,t.scale,t.originPoint),jy(e.y,n.translate,n.scale,n.originPoint)}const qS=.999999999999,HS=1.0000000000001;function LG(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,i;for(let a=0;a<s;a++){o=n[a],i=o.projectionDelta;const{visualElement:l}=o.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Qa(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,i$(e,i)),r&&Ti(o.latestValues)&&Qa(e,o.latestValues))}t.x<HS&&t.x>qS&&(t.x=1),t.y<HS&&t.y>qS&&(t.y=1)}function Za(e,t){e.min=e.min+t,e.max=e.max+t}function GS(e,t,n,r,s=.5){const o=Ct(e.min,e.max,s);jy(e,t,n,o,r)}function Qa(e,t){GS(e.x,t.x,t.scaleX,t.scale,t.originX),GS(e.y,t.y,t.scaleY,t.scale,t.originY)}function a$(e,t){return s$(FG(e.getBoundingClientRect(),t))}function UG(e,t,n){const r=a$(e,n),{scroll:s}=t;return s&&(Za(r.x,s.offset.x),Za(r.y,s.offset.y)),r}const l$=({current:e})=>e?e.ownerDocument.defaultView:null,BG=new WeakMap;class VG{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Ft(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=u=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(vd(u).point)},o=(u,f)=>{const{drag:p,dragPropagation:g,onDragStart:y}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=kq(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),fr(v=>{let b=this.getAxisMotionValue(v).get()||0;if(us.test(b)){const{projection:x}=this.visualElement;if(x&&x.layout){const w=x.layout.layoutBox[v];w&&(b=or(w)*(parseFloat(b)/100))}}this.originPoint[v]=b}),y&&vt.postRender(()=>y(u,f)),xy(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},i=(u,f)=>{const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:y,onDrag:m}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:v}=f;if(g&&this.currentDirection===null){this.currentDirection=zG(v),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),m&&m(u,f)},a=(u,f)=>this.stop(u,f),l=()=>fr(u=>{var f;return this.getAnimationState(u)==="paused"&&((f=this.getAxisMotionValue(u).animation)===null||f===void 0?void 0:f.play())}),{dragSnapToOrigin:c}=this.getProps();this.panSession=new e$(t,{onSessionStart:s,onStart:o,onMove:i,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:c,contextWindow:l$(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&vt.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!df(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(i=AG(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&Ga(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=$G(s.layoutBox,n):this.constraints=!1,this.elastic=MG(r),o!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&fr(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=OG(s.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ga(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=UG(r,s.root,this.visualElement.getTransformPagePoint());let i=DG(s.layout.layoutBox,o);if(n){const a=n(IG(i));this.hasMutatedConstraints=!!a,a&&(i=s$(a))}return i}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=fr(u=>{if(!df(u,n,this.currentDirection))return;let f=l&&l[u]||{};i&&(f={min:0,max:0});const p=s?200:1e6,g=s?40:1e7,y={type:"inertia",velocity:r?t[u]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...o,...f};return this.startAxisValueAnimation(u,y)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return xy(this.visualElement,t),r.start(v0(t,r,0,n,this.visualElement,!1))}stopAnimation(){fr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){fr(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){fr(n=>{const{drag:r}=this.getProps();if(!df(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:i,max:a}=s.layout.layoutBox[n];o.set(t[n]-Ct(i,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ga(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};fr(i=>{const a=this.getAxisMotionValue(i);if(a&&this.constraints!==!1){const l=a.get();s[i]=kG({min:l,max:l},this.constraints[i])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),fr(i=>{if(!df(i,t,null))return;const a=this.getAxisMotionValue(i),{min:l,max:c}=this.constraints[i];a.set(Ct(l,c,s[i]))})}addListeners(){if(!this.visualElement.current)return;BG.set(this.visualElement,this);const t=this.visualElement.current,n=cu(t,"pointerdown",l=>{const{drag:c,dragListener:u=!0}=this.getProps();c&&u&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();Ga(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),vt.read(r);const i=ju(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:c})=>{this.isDragging&&c&&(fr(u=>{const f=this.getAxisMotionValue(u);f&&(this.originPoint[u]+=l[u].translate,f.set(f.get()+l[u].translate))}),this.visualElement.render())});return()=>{i(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:i=Ny,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function df(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function zG(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class WG extends di{constructor(t){super(t),this.removeGroupControls=rr,this.removeListeners=rr,this.controls=new VG(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||rr}unmount(){this.removeGroupControls(),this.removeListeners()}}const KS=e=>(t,n)=>{e&&vt.postRender(()=>e(t,n))};class qG extends di{constructor(){super(...arguments),this.removePointerDownListener=rr}onPointerDown(t){this.session=new e$(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:l$(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:KS(t),onStart:KS(n),onMove:r,onEnd:(o,i)=>{delete this.session,s&&vt.postRender(()=>s(o,i))}}}mount(){this.removePointerDownListener=cu(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Of={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function YS(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Tc={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Oe.test(e))e=parseFloat(e);else return e;const n=YS(e,t.target.x),r=YS(e,t.target.y);return`${n}% ${r}%`}},HG={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Xo.parse(e);if(s.length>5)return r;const o=Xo.createTransformer(e),i=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+i]/=a,s[1+i]/=l;const c=Ct(a,l,.5);return typeof s[2+i]=="number"&&(s[2+i]/=c),typeof s[3+i]=="number"&&(s[3+i]/=c),o(s)}};class GG extends h.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;hq(KG),o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Of.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,i=r.projection;return i&&(i.isPresent=o,s||t.layoutDependency!==n||n===void 0?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||vt.postRender(()=>{const a=i.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Hx.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function c$(e){const[t,n]=N9(),r=h.useContext(qj);return d.jsx(GG,{...e,layoutGroup:r,switchLayoutGroup:h.useContext(Jj),isPresent:t,safeToRemove:n})}const KG={borderRadius:{...Tc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Tc,borderTopRightRadius:Tc,borderBottomLeftRadius:Tc,borderBottomRightRadius:Tc,boxShadow:HG};function YG(e,t,n){const r=wn(e)?e:Nu(e);return r.start(v0("",r,t,n)),r.animation}function ZG(e){return e instanceof SVGElement&&e.tagName!=="svg"}const QG=(e,t)=>e.depth-t.depth;class XG{constructor(){this.children=[],this.isDirty=!1}add(t){i0(this.children,t),this.isDirty=!0}remove(t){a0(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(QG),this.isDirty=!1,this.children.forEach(t)}}function JG(e,t){const n=ds.now(),r=({timestamp:s})=>{const o=s-n;o>=t&&(Qo(r),e(o-t))};return vt.read(r,!0),()=>Qo(r)}const u$=["TopLeft","TopRight","BottomLeft","BottomRight"],eK=u$.length,ZS=e=>typeof e=="string"?parseFloat(e):e,QS=e=>typeof e=="number"||Oe.test(e);function tK(e,t,n,r,s,o){s?(e.opacity=Ct(0,n.opacity!==void 0?n.opacity:1,nK(r)),e.opacityExit=Ct(t.opacity!==void 0?t.opacity:1,0,rK(r))):o&&(e.opacity=Ct(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let i=0;i<eK;i++){const a=`border${u$[i]}Radius`;let l=XS(t,a),c=XS(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||QS(l)===QS(c)?(e[a]=Math.max(Ct(ZS(l),ZS(c),r),0),(us.test(c)||us.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=Ct(t.rotate||0,n.rotate||0,r))}function XS(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const nK=d$(0,.5,PA),rK=d$(.5,.95,rr);function d$(e,t,n){return r=>r<e?0:r>t?1:n(Al(e,t,r))}function JS(e,t){e.min=t.min,e.max=t.max}function ur(e,t){JS(e.x,t.x),JS(e.y,t.y)}function e1(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function t1(e,t,n,r,s){return e-=t,e=_h(e,1/n,r),s!==void 0&&(e=_h(e,1/s,r)),e}function sK(e,t=0,n=1,r=.5,s,o=e,i=e){if(us.test(t)&&(t=parseFloat(t),t=Ct(i.min,i.max,t/100)-i.min),typeof t!="number")return;let a=Ct(o.min,o.max,r);e===o&&(a-=t),e.min=t1(e.min,t,n,a,s),e.max=t1(e.max,t,n,a,s)}function n1(e,t,[n,r,s],o,i){sK(e,t[n],t[r],t[s],t.scale,o,i)}const oK=["x","scaleX","originX"],iK=["y","scaleY","originY"];function r1(e,t,n,r){n1(e.x,t,oK,n?n.x:void 0,r?r.x:void 0),n1(e.y,t,iK,n?n.y:void 0,r?r.y:void 0)}function s1(e){return e.translate===0&&e.scale===1}function f$(e){return s1(e.x)&&s1(e.y)}function o1(e,t){return e.min===t.min&&e.max===t.max}function aK(e,t){return o1(e.x,t.x)&&o1(e.y,t.y)}function i1(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function h$(e,t){return i1(e.x,t.x)&&i1(e.y,t.y)}function a1(e){return or(e.x)/or(e.y)}function l1(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class lK{constructor(){this.members=[]}add(t){i0(this.members,t),t.scheduleRender()}remove(t){if(a0(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function cK(e,t,n){let r="";const s=e.x.translate/t.x,o=e.y.translate/t.y,i=(n==null?void 0:n.z)||0;if((s||o||i)&&(r=`translate3d(${s}px, ${o}px, ${i}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:u,rotateX:f,rotateY:p,skewX:g,skewY:y}=n;c&&(r=`perspective(${c}px) ${r}`),u&&(r+=`rotate(${u}deg) `),f&&(r+=`rotateX(${f}deg) `),p&&(r+=`rotateY(${p}deg) `),g&&(r+=`skewX(${g}deg) `),y&&(r+=`skewY(${y}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Ri={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},qc=typeof window<"u"&&window.MotionDebug!==void 0,mg=["","X","Y","Z"],uK={visibility:"hidden"},c1=1e3;let dK=0;function gg(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function p$(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=_A(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",vt,!(s||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&p$(r)}function m$({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(i={},a=t==null?void 0:t()){this.id=dK++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,qc&&(Ri.totalNodes=Ri.resolvedTargetDeltas=Ri.recalculatedProjection=0),this.nodes.forEach(pK),this.nodes.forEach(bK),this.nodes.forEach(xK),this.nodes.forEach(mK),qc&&window.MotionDebug.record(Ri)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=i,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new XG)}addEventListener(i,a){return this.eventHandlers.has(i)||this.eventHandlers.set(i,new l0),this.eventHandlers.get(i).add(a)}notifyListeners(i,...a){const l=this.eventHandlers.get(i);l&&l.notify(...a)}hasListeners(i){return this.eventHandlers.has(i)}mount(i,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=ZG(i),this.instance=i;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(i),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(c||l)&&(this.isLayoutDirty=!0),e){let f;const p=()=>this.root.updateBlockedByResize=!1;e(i,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=JG(p,250),Of.hasAnimatedSinceResize&&(Of.hasAnimatedSinceResize=!1,this.nodes.forEach(d1))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeTargetChanged:g,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||u.getDefaultTransition()||CK,{onLayoutAnimationStart:v,onLayoutAnimationComplete:b}=u.getProps(),x=!this.targetLayout||!h$(this.targetLayout,y)||g,w=!p&&g;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||p&&(x||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,w);const _={...n0(m,"layout"),onPlay:v,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_)}else p||d1(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const i=this.getStack();i&&i.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Qo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(wK),this.animationId++)}getTransformTemplate(){const{visualElement:i}=this.options;return i&&i.getProps().transformTemplate}willUpdate(i=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&p$(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const f=this.path[u];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),i&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(u1);return}this.isUpdating||this.nodes.forEach(vK),this.isUpdating=!1,this.nodes.forEach(yK),this.nodes.forEach(fK),this.nodes.forEach(hK),this.clearAllSnapshots();const a=ds.now();cn.delta=Xs(0,1e3/60,a-cn.timestamp),cn.timestamp=a,cn.isProcessing=!0,ag.update.process(cn),ag.preRender.process(cn),ag.render.process(cn),cn.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Hx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(gK),this.sharedNodes.forEach(_K)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,vt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){vt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const i=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Ft(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,i?i.layoutBox:void 0)}updateScroll(i="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===i&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:i,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const i=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!f$(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,u=c!==this.prevTransformTemplateValue;i&&(a||Ti(this.latestValues)||u)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(i=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return i&&(l=this.removeTransform(l)),TK(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var i;const{visualElement:a}=this.options;if(!a)return Ft();const l=a.measureViewportBox();if(!(((i=this.scroll)===null||i===void 0?void 0:i.wasRoot)||this.path.some(RK))){const{scroll:u}=this.root;u&&(Za(l.x,u.offset.x),Za(l.y,u.offset.y))}return l}removeElementScroll(i){var a;const l=Ft();if(ur(l,i),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:f,options:p}=u;u!==this.root&&f&&p.layoutScroll&&(f.wasRoot&&ur(l,i),Za(l.x,f.offset.x),Za(l.y,f.offset.y))}return l}applyTransform(i,a=!1){const l=Ft();ur(l,i);for(let c=0;c<this.path.length;c++){const u=this.path[c];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Qa(l,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),Ti(u.latestValues)&&Qa(l,u.latestValues)}return Ti(this.latestValues)&&Qa(l,this.latestValues),l}removeTransform(i){const a=Ft();ur(a,i);for(let l=0;l<this.path.length;l++){const c=this.path[l];if(!c.instance||!Ti(c.latestValues))continue;Py(c.latestValues)&&c.updateSnapshot();const u=Ft(),f=c.measurePageBox();ur(u,f),r1(a,c.latestValues,c.snapshot?c.snapshot.layoutBox:void 0,u)}return Ti(this.latestValues)&&r1(a,this.latestValues),a}setTargetDelta(i){this.targetDelta=i,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(i){this.options={...this.options,...i,crossfade:i.crossfade!==void 0?i.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==cn.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(i=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(i||c&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:f,layoutId:p}=this.options;if(!(!this.layout||!(f||p))){if(this.resolvedRelativeTargetAt=cn.timestamp,!this.targetDelta&&!this.relativeTarget){const g=this.getClosestProjectingParent();g&&g.layout&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ft(),this.relativeTargetOrigin=Ft(),du(this.relativeTargetOrigin,this.layout.layoutBox,g.layout.layoutBox),ur(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Ft(),this.targetWithTransforms=Ft()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),jG(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ur(this.target,this.layout.layoutBox),i$(this.target,this.targetDelta)):ur(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const g=this.getClosestProjectingParent();g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?(this.relativeParent=g,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Ft(),this.relativeTargetOrigin=Ft(),du(this.relativeTargetOrigin,this.target,g.target),ur(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}qc&&Ri.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Py(this.parent.latestValues)||o$(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var i;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||!((i=this.parent)===null||i===void 0)&&i.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===cn.timestamp&&(c=!1),c)return;const{layout:u,layoutId:f}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||f))return;ur(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,g=this.treeScale.y;LG(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Ft());const{target:y}=a;if(!y){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(e1(this.prevProjectionDelta.x,this.projectionDelta.x),e1(this.prevProjectionDelta.y,this.projectionDelta.y)),uu(this.projectionDelta,this.layoutCorrected,y,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==g||!l1(this.projectionDelta.x,this.prevProjectionDelta.x)||!l1(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",y)),qc&&Ri.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(i=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),i){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ya(),this.projectionDelta=Ya(),this.projectionDeltaWithTransform=Ya()}setAnimationOrigin(i,a=!1){const l=this.snapshot,c=l?l.latestValues:{},u={...this.latestValues},f=Ya();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=Ft(),g=l?l.source:void 0,y=this.layout?this.layout.source:void 0,m=g!==y,v=this.getStack(),b=!v||v.members.length<=1,x=!!(m&&!b&&this.options.crossfade===!0&&!this.path.some(SK));this.animationProgress=0;let w;this.mixTargetDelta=_=>{const E=_/1e3;f1(f.x,i.x,E),f1(f.y,i.y,E),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(du(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),EK(this.relativeTarget,this.relativeTargetOrigin,p,E),w&&aK(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Ft()),ur(w,this.relativeTarget)),m&&(this.animationValues=u,tK(u,c,this.latestValues,E,x,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=E},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(i){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Qo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=vt.update(()=>{Of.hasAnimatedSinceResize=!0,this.currentAnimation=YG(0,c1,{...i,onUpdate:a=>{this.mixTargetDelta(a),i.onUpdate&&i.onUpdate(a)},onComplete:()=>{i.onComplete&&i.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const i=this.getStack();i&&i.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(c1),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const i=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:u}=i;if(!(!a||!l||!c)){if(this!==i&&this.layout&&c&&g$(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||Ft();const f=or(this.layout.layoutBox.x);l.x.min=i.target.x.min,l.x.max=l.x.min+f;const p=or(this.layout.layoutBox.y);l.y.min=i.target.y.min,l.y.max=l.y.min+p}ur(a,l),Qa(a,u),uu(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(i,a){this.sharedNodes.has(i)||this.sharedNodes.set(i,new lK),this.sharedNodes.get(i).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const i=this.getStack();return i?i.lead===this:!0}getLead(){var i;const{layoutId:a}=this.options;return a?((i=this.getStack())===null||i===void 0?void 0:i.lead)||this:this}getPrevLead(){var i;const{layoutId:a}=this.options;return a?(i=this.getStack())===null||i===void 0?void 0:i.prevLead:void 0}getStack(){const{layoutId:i}=this.options;if(i)return this.root.sharedNodes.get(i)}promote({needsReset:i,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),i&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const i=this.getStack();return i?i.relegate(this):!1}resetSkewAndRotation(){const{visualElement:i}=this.options;if(!i)return;let a=!1;const{latestValues:l}=i;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&gg("z",i,c,this.animationValues);for(let u=0;u<mg.length;u++)gg(`rotate${mg[u]}`,i,c,this.animationValues),gg(`skew${mg[u]}`,i,c,this.animationValues);i.render();for(const u in c)i.setStaticValue(u,c[u]),this.animationValues&&(this.animationValues[u]=c[u]);i.scheduleRender()}getProjectionStyles(i){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return uK;const c={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,c.opacity="",c.pointerEvents=Df(i==null?void 0:i.pointerEvents)||"",c.transform=u?u(this.latestValues,""):"none",c;const f=this.getLead();if(!this.projectionDelta||!this.layout||!f.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=Df(i==null?void 0:i.pointerEvents)||""),this.hasProjected&&!Ti(this.latestValues)&&(m.transform=u?u({},""):"none",this.hasProjected=!1),m}const p=f.animationValues||f.latestValues;this.applyTransformsToTarget(),c.transform=cK(this.projectionDeltaWithTransform,this.treeScale,p),u&&(c.transform=u(p,c.transform));const{x:g,y}=this.projectionDelta;c.transformOrigin=`${g.origin*100}% ${y.origin*100}% 0`,f.animationValues?c.opacity=f===this?(l=(a=p.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:c.opacity=f===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const m in vh){if(p[m]===void 0)continue;const{correct:v,applyTo:b}=vh[m],x=c.transform==="none"?p[m]:v(p[m],f);if(b){const w=b.length;for(let _=0;_<w;_++)c[b[_]]=x}else c[m]=x}return this.options.layoutId&&(c.pointerEvents=f===this?Df(i==null?void 0:i.pointerEvents)||"":"none"),c}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(i=>{var a;return(a=i.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(u1),this.root.sharedNodes.clear()}}}function fK(e){e.updateLayout()}function hK(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:o}=e.options,i=n.source!==e.layout.source;o==="size"?fr(f=>{const p=i?n.measuredBox[f]:n.layoutBox[f],g=or(p);p.min=r[f].min,p.max=p.min+g}):g$(o,n.layoutBox,r)&&fr(f=>{const p=i?n.measuredBox[f]:n.layoutBox[f],g=or(r[f]);p.max=p.min+g,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+g)});const a=Ya();uu(a,r,n.layoutBox);const l=Ya();i?uu(l,e.applyTransform(s,!0),n.measuredBox):uu(l,r,n.layoutBox);const c=!f$(a);let u=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:g}=f;if(p&&g){const y=Ft();du(y,n.layoutBox,p.layoutBox);const m=Ft();du(m,r,g.layoutBox),h$(y,m)||(u=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=y,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function pK(e){qc&&Ri.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function mK(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function gK(e){e.clearSnapshot()}function u1(e){e.clearMeasurements()}function vK(e){e.isLayoutDirty=!1}function yK(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function d1(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function bK(e){e.resolveTargetDelta()}function xK(e){e.calcProjection()}function wK(e){e.resetSkewAndRotation()}function _K(e){e.removeLeadSnapshot()}function f1(e,t,n){e.translate=Ct(t.translate,0,n),e.scale=Ct(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function h1(e,t,n,r){e.min=Ct(t.min,n.min,r),e.max=Ct(t.max,n.max,r)}function EK(e,t,n,r){h1(e.x,t.x,n.x,r),h1(e.y,t.y,n.y,r)}function SK(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const CK={duration:.45,ease:[.4,0,.1,1]},p1=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),m1=p1("applewebkit/")&&!p1("chrome/")?Math.round:rr;function g1(e){e.min=m1(e.min),e.max=m1(e.max)}function TK(e){g1(e.x),g1(e.y)}function g$(e,t,n){return e==="position"||e==="preserve-aspect"&&!PG(a1(t),a1(n),.2)}function RK(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const NK=m$({attachResizeListener:(e,t)=>ju(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),vg={current:void 0},v$=m$({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vg.current){const e=new NK({});e.mount(window),e.setOptions({layoutScroll:!0}),vg.current=e}return vg.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),PK={pan:{Feature:qG},drag:{Feature:WG,ProjectionNode:v$,MeasureLayout:c$}};function v1(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&vt.postRender(()=>o(t,vd(t)))}class jK extends di{mount(){const{current:t}=this.node;t&&(this.unmount=Pq(t,n=>(v1(this.node,n,"Start"),r=>v1(this.node,r,"End"))))}unmount(){}}class AK extends di{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=gd(ju(this.node.current,"focus",()=>this.onFocus()),ju(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function y1(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&vt.postRender(()=>o(t,vd(t)))}class $K extends di{mount(){const{current:t}=this.node;t&&(this.unmount=Dq(t,n=>(y1(this.node,n,"Start"),(r,{success:s})=>y1(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ay=new WeakMap,yg=new WeakMap,DK=e=>{const t=Ay.get(e.target);t&&t(e)},kK=e=>{e.forEach(DK)};function OK({root:e,...t}){const n=e||document;yg.has(n)||yg.set(n,{});const r=yg.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(kK,{root:e,...t})),r[s]}function MK(e,t,n){const r=OK(t);return Ay.set(e,n),r.observe(e),()=>{Ay.delete(e),r.unobserve(e)}}const IK={some:0,all:1};class FK extends di{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,i={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:IK[s]},a=l=>{const{isIntersecting:c}=l;if(this.isInView===c||(this.isInView=c,o&&!c&&this.hasEnteredView))return;c&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",c);const{onViewportEnter:u,onViewportLeave:f}=this.node.getProps(),p=c?u:f;p&&p(l)};return MK(this.node.current,i,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(LK(t,n))&&this.startObserver()}unmount(){}}function LK({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const UK={inView:{Feature:FK},tap:{Feature:$K},focus:{Feature:AK},hover:{Feature:jK}},BK={layout:{ProjectionNode:v$,MeasureLayout:c$}},$y={current:null},y$={current:!1};function VK(){if(y$.current=!0,!!Bx)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>$y.current=e.matches;e.addListener(t),t()}else $y.current=!1}const zK=[...zA,bn,Xo],WK=e=>zK.find(VA(e)),b1=new WeakMap;function qK(e,t,n){for(const r in t){const s=t[r],o=n[r];if(wn(s))e.addValue(r,s);else if(wn(o))e.addValue(r,Nu(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const i=e.getValue(r);i.liveStyle===!0?i.jump(s):i.hasAnimated||i.set(s)}else{const i=e.getStaticValue(r);e.addValue(r,Nu(i!==void 0?i:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const x1=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class HK{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:i},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=p0,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const g=ds.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,vt.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=i;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=Vp(n),this.isVariantNode=Qj(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in p){const y=p[g];l[g]!==void 0&&wn(y)&&y.set(l[g],!1)}}mount(t){this.current=t,b1.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),y$.current||VK(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:$y.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){b1.delete(this.current),this.projection&&this.projection.unmount(),Qo(this.notifyUpdate),Qo(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=wa.has(t),s=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&vt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in $l){const n=$l[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Ft()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<x1.length;r++){const s=x1[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,i=t[o];i&&(this.propEventSubscriptions[s]=this.on(s,i))}this.prevMotionValues=qK(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Nu(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(UA(s)||AA(s))?s=parseFloat(s):!WK(s)&&Xo.test(n)&&(s=IA(t,n)),this.setBaseTarget(t,wn(s)?s.get():s)),wn(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const i=Kx(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);i&&(s=i[t])}if(r&&s!==void 0)return s;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!wn(o)?o:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new l0),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class b$ extends HK{constructor(){super(...arguments),this.KeyframeResolver=WA}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;wn(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function GK(e){return window.getComputedStyle(e)}class KK extends b${constructor(){super(...arguments),this.type="html",this.renderInstance=iA}readValueFromInstance(t,n){if(wa.has(n)){const r=h0(n);return r&&r.default||0}else{const r=GK(t),s=(rA(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return a$(t,n)}build(t,n,r){Qx(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return t0(t,n,r)}}class YK extends b${constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Ft}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(wa.has(n)){const r=h0(n);return r&&r.default||0}return n=aA.has(n)?n:qx(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return uA(t,n,r)}build(t,n,r){Xx(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){lA(t,n,r,s)}mount(t){this.isSVGTag=e0(t.tagName),super.mount(t)}}const ZK=(e,t)=>Gx(e)?new YK(t):new KK(t,{allowProjection:e!==h.Fragment}),QK=_q({...xG,...UK,...PK,...BK},ZK),Hc=I9(QK),bg={width:5,height:5,borderRadius:"50%"},XK=({className:e,color:t="white"})=>d.jsxs(Hc.div,{className:"flex items-center gap-1",initial:"hidden",animate:"visible",variants:{visible:{transition:{staggerChildren:.2}}},children:[d.jsx(Hc.div,{className:se(t==="white"?"bg-white/60":"bg-zuplo-600/60",e),variants:{hidden:{opacity:0,y:3},visible:{opacity:1,y:0,transition:{y:{type:"spring",stiffness:300,damping:10,repeat:1/0,repeatType:"reverse"}}}},style:bg}),d.jsx(Hc.div,{className:se(t==="white"?"bg-white/60":"bg-zuplo-600/60",e),variants:{hidden:{opacity:0,y:3},visible:{opacity:1,y:0,transition:{y:{type:"spring",stiffness:300,damping:10,repeat:1/0,repeatType:"reverse"}}}},style:bg}),d.jsx(Hc.div,{className:se(t==="white"?"bg-white/60":"bg-zuplo-600/60",e),variants:{hidden:{opacity:0,y:3},visible:{opacity:1,y:0,transition:{y:{type:"spring",stiffness:300,damping:10,repeat:1/0,repeatType:"reverse"}}}},style:bg})]}),ir=({children:e,className:t,loading:n,alternative:r,variant:s="default"})=>d.jsxs("div",{className:"relative",children:[d.jsx("div",{className:se(t,"transition-opacity",n&&"opacity-0"),children:e}),d.jsx("div",{className:se("absolute top-1/2 left-1/2 opacity-0 transform -translate-x-1/2 -translate-y-1/2",n&&"opacity-100"),children:r??d.jsx(XK,{color:s==="default"?"white":"primary"})})]});var JK="Label",x$=h.forwardRef((e,t)=>d.jsx($e.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));x$.displayName=JK;var w$=x$;const eY=Wr("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Oo=h.forwardRef(({className:e,...t},n)=>d.jsx(w$,{ref:n,className:se(eY(),e),...t}));Oo.displayName=w$.displayName;const tY=jj,_$=h.createContext({}),ff=({...e})=>d.jsx(_$.Provider,{value:{name:e.name},children:d.jsx(Oj,{...e})}),qp=()=>{const e=h.useContext(_$),t=h.useContext(E$),{getFieldState:n,formState:r}=tc(),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:o}=t;return{id:o,name:e.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},E$=h.createContext({}),Gc=h.forwardRef(({className:e,...t},n)=>{const r=h.useId();return d.jsx(E$.Provider,{value:{id:r},children:d.jsx("div",{ref:n,className:se("space-y-2",e),...t})})});Gc.displayName="FormItem";const nY=h.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:s}=qp();return d.jsx(Oo,{ref:n,className:se(r&&"text-destructive",e),htmlFor:s,...t})});nY.displayName="FormLabel";const rY=h.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:s,formMessageId:o}=qp();return d.jsx(KC,{ref:t,id:r,"aria-describedby":n?`${s} ${o}`:`${s}`,"aria-invalid":!!n,...e})});rY.displayName="FormControl";const sY=h.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=qp();return d.jsx("p",{ref:n,id:r,className:se("text-sm text-muted-foreground",e),...t})});sY.displayName="FormDescription";const Kc=h.forwardRef(({className:e,children:t,...n},r)=>{const{error:s,formMessageId:o}=qp(),i=s?String(s.message):t;return i?d.jsx("p",{ref:r,id:o,className:se("text-sm font-medium text-destructive",e),...n,children:i}):null});Kc.displayName="FormMessage";const oY=Wr("flex h-10 w-full rounded-md border shadow-sm border-gray-200 bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-pink-200 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-red-400"),Jo=h.forwardRef(({className:e,type:t,readOnlyAsDisabled:n=!1,...r},s)=>d.jsx("input",{type:t,className:se(oY({className:e}),n&&"read-only:cursor-not-allowed read-only:opacity-50"),ref:s,...r}));Jo.displayName="InputX";function w1(e,[t,n]){return Math.min(n,Math.max(t,e))}var iY=h.createContext(void 0);function y0(e){const t=h.useContext(iY);return e||t||"ltr"}var aY=[" ","Enter","ArrowUp","ArrowDown"],lY=[" ","Enter"],da="Select",[Hp,Gp,cY]=bp(da),[sc,hie]=Vr(da,[cY,Gl]),Kp=Gl(),[uY,fi]=sc(da),[dY,fY]=sc(da),S$=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:f,disabled:p,required:g,form:y}=e,m=Kp(t),[v,b]=h.useState(null),[x,w]=h.useState(null),[_,E]=h.useState(!1),S=y0(c),[R,C]=Ys({prop:r,defaultProp:s??!1,onChange:o,caller:da}),[N,k]=Ys({prop:i,defaultProp:a,onChange:l,caller:da}),V=h.useRef(null),L=v?y||!!v.closest("form"):!0,[G,$]=h.useState(new Set),I=Array.from(G).map(j=>j.props.value).join(";");return d.jsx(xb,{...m,children:d.jsxs(uY,{required:g,scope:t,trigger:v,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:_,onValueNodeHasChildrenChange:E,contentId:fn(),value:N,onValueChange:k,open:R,onOpenChange:C,dir:S,triggerPointerDownPosRef:V,disabled:p,children:[d.jsx(Hp.Provider,{scope:t,children:d.jsx(dY,{scope:e.__scopeSelect,onNativeOptionAdd:h.useCallback(j=>{$(F=>new Set(F).add(j))},[]),onNativeOptionRemove:h.useCallback(j=>{$(F=>{const O=new Set(F);return O.delete(j),O})},[]),children:n})}),L?d.jsxs(K$,{"aria-hidden":!0,required:g,tabIndex:-1,name:u,autoComplete:f,value:N,onChange:j=>k(j.target.value),disabled:p,form:y,children:[N===void 0?d.jsx("option",{value:""}):null,Array.from(G)]},I):null]})})};S$.displayName=da;var C$="SelectTrigger",T$=h.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,o=Kp(n),i=fi(C$,n),a=i.disabled||r,l=tt(t,i.onTriggerChange),c=Gp(n),u=h.useRef("touch"),[f,p,g]=Z$(m=>{const v=c().filter(w=>!w.disabled),b=v.find(w=>w.value===i.value),x=Q$(v,m,b);x!==void 0&&i.onValueChange(x.value)}),y=m=>{a||(i.onOpenChange(!0),g()),m&&(i.triggerPointerDownPosRef.current={x:Math.round(m.pageX),y:Math.round(m.pageY)})};return d.jsx(wb,{asChild:!0,...o,children:d.jsx($e.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":Y$(i.value)?"":void 0,...s,ref:l,onClick:me(s.onClick,m=>{m.currentTarget.focus(),u.current!=="mouse"&&y(m)}),onPointerDown:me(s.onPointerDown,m=>{u.current=m.pointerType;const v=m.target;v.hasPointerCapture(m.pointerId)&&v.releasePointerCapture(m.pointerId),m.button===0&&m.ctrlKey===!1&&m.pointerType==="mouse"&&(y(m),m.preventDefault())}),onKeyDown:me(s.onKeyDown,m=>{const v=f.current!=="";!(m.ctrlKey||m.altKey||m.metaKey)&&m.key.length===1&&p(m.key),!(v&&m.key===" ")&&aY.includes(m.key)&&(y(),m.preventDefault())})})})});T$.displayName=C$;var R$="SelectValue",N$=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:o,placeholder:i="",...a}=e,l=fi(R$,n),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,f=tt(t,l.onValueNodeChange);return nn(()=>{c(u)},[c,u]),d.jsx($e.span,{...a,ref:f,style:{pointerEvents:"none"},children:Y$(l.value)?d.jsx(d.Fragment,{children:i}):o})});N$.displayName=R$;var hY="SelectIcon",P$=h.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return d.jsx($e.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});P$.displayName=hY;var pY="SelectPortal",j$=e=>d.jsx(td,{asChild:!0,...e});j$.displayName=pY;var fa="SelectContent",A$=h.forwardRef((e,t)=>{const n=fi(fa,e.__scopeSelect),[r,s]=h.useState();if(nn(()=>{s(new DocumentFragment)},[]),!n.open){const o=r;return o?Cr.createPortal(d.jsx($$,{scope:e.__scopeSelect,children:d.jsx(Hp.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),o):null}return d.jsx(D$,{...e,ref:t})});A$.displayName=fa;var Nr=10,[$$,hi]=sc(fa),mY="SelectContentImpl",gY=ea("SelectContent.RemoveScroll"),D$=h.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:m,avoidCollisions:v,...b}=e,x=fi(fa,n),[w,_]=h.useState(null),[E,S]=h.useState(null),R=tt(t,te=>_(te)),[C,N]=h.useState(null),[k,V]=h.useState(null),L=Gp(n),[G,$]=h.useState(!1),I=h.useRef(!1);h.useEffect(()=>{if(w)return ad(w)},[w]),xx();const j=h.useCallback(te=>{const[Re,...Ce]=L().map(ke=>ke.ref.current),[ue]=Ce.slice(-1),ge=document.activeElement;for(const ke of te)if(ke===ge||(ke==null||ke.scrollIntoView({block:"nearest"}),ke===Re&&E&&(E.scrollTop=0),ke===ue&&E&&(E.scrollTop=E.scrollHeight),ke==null||ke.focus(),document.activeElement!==ge))return},[L,E]),F=h.useCallback(()=>j([C,w]),[j,C,w]);h.useEffect(()=>{G&&F()},[G,F]);const{onOpenChange:O,triggerPointerDownPosRef:U}=x;h.useEffect(()=>{if(w){let te={x:0,y:0};const Re=ue=>{var ge,ke;te={x:Math.abs(Math.round(ue.pageX)-(((ge=U.current)==null?void 0:ge.x)??0)),y:Math.abs(Math.round(ue.pageY)-(((ke=U.current)==null?void 0:ke.y)??0))}},Ce=ue=>{te.x<=10&&te.y<=10?ue.preventDefault():w.contains(ue.target)||O(!1),document.removeEventListener("pointermove",Re),U.current=null};return U.current!==null&&(document.addEventListener("pointermove",Re),document.addEventListener("pointerup",Ce,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Re),document.removeEventListener("pointerup",Ce,{capture:!0})}}},[w,O,U]),h.useEffect(()=>{const te=()=>O(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[O]);const[Y,ee]=Z$(te=>{const Re=L().filter(ge=>!ge.disabled),Ce=Re.find(ge=>ge.ref.current===document.activeElement),ue=Q$(Re,te,Ce);ue&&setTimeout(()=>ue.ref.current.focus())}),M=h.useCallback((te,Re,Ce)=>{const ue=!I.current&&!Ce;(x.value!==void 0&&x.value===Re||ue)&&(N(te),ue&&(I.current=!0))},[x.value]),Q=h.useCallback(()=>w==null?void 0:w.focus(),[w]),H=h.useCallback((te,Re,Ce)=>{const ue=!I.current&&!Ce;(x.value!==void 0&&x.value===Re||ue)&&V(te)},[x.value]),K=r==="popper"?Dy:k$,ae=K===Dy?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:f,collisionBoundary:p,collisionPadding:g,sticky:y,hideWhenDetached:m,avoidCollisions:v}:{};return d.jsx($$,{scope:n,content:w,viewport:E,onViewportChange:S,itemRefCallback:M,selectedItem:C,onItemLeave:Q,itemTextRefCallback:H,focusSelectedItem:F,selectedItemText:k,position:r,isPositioned:G,searchRef:Y,children:d.jsx(Cp,{as:gY,allowPinchZoom:!0,children:d.jsx(wp,{asChild:!0,trapped:x.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:me(s,te=>{var Re;(Re=x.trigger)==null||Re.focus({preventScroll:!0}),te.preventDefault()}),children:d.jsx(Wl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:d.jsx(K,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:te=>te.preventDefault(),...b,...ae,onPlaced:()=>$(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:me(b.onKeyDown,te=>{const Re=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!Re&&te.key.length===1&&ee(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let ue=L().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(te.key)&&(ue=ue.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const ge=te.target,ke=ue.indexOf(ge);ue=ue.slice(ke+1)}setTimeout(()=>j(ue)),te.preventDefault()}})})})})})})});D$.displayName=mY;var vY="SelectItemAlignedPosition",k$=h.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,o=fi(fa,n),i=hi(fa,n),[a,l]=h.useState(null),[c,u]=h.useState(null),f=tt(t,R=>u(R)),p=Gp(n),g=h.useRef(!1),y=h.useRef(!0),{viewport:m,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=i,w=h.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&m&&v&&b){const R=o.trigger.getBoundingClientRect(),C=c.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),k=b.getBoundingClientRect();if(o.dir!=="rtl"){const ge=k.left-C.left,ke=N.left-ge,Ze=R.left-ke,lt=R.width+Ze,lr=Math.max(lt,C.width),Gn=window.innerWidth-Nr,Cn=w1(ke,[Nr,Math.max(Nr,Gn-lr)]);a.style.minWidth=lt+"px",a.style.left=Cn+"px"}else{const ge=C.right-k.right,ke=window.innerWidth-N.right-ge,Ze=window.innerWidth-R.right-ke,lt=R.width+Ze,lr=Math.max(lt,C.width),Gn=window.innerWidth-Nr,Cn=w1(ke,[Nr,Math.max(Nr,Gn-lr)]);a.style.minWidth=lt+"px",a.style.right=Cn+"px"}const V=p(),L=window.innerHeight-Nr*2,G=m.scrollHeight,$=window.getComputedStyle(c),I=parseInt($.borderTopWidth,10),j=parseInt($.paddingTop,10),F=parseInt($.borderBottomWidth,10),O=parseInt($.paddingBottom,10),U=I+j+G+O+F,Y=Math.min(v.offsetHeight*5,U),ee=window.getComputedStyle(m),M=parseInt(ee.paddingTop,10),Q=parseInt(ee.paddingBottom,10),H=R.top+R.height/2-Nr,K=L-H,ae=v.offsetHeight/2,te=v.offsetTop+ae,Re=I+j+te,Ce=U-Re;if(Re<=H){const ge=V.length>0&&v===V[V.length-1].ref.current;a.style.bottom="0px";const ke=c.clientHeight-m.offsetTop-m.offsetHeight,Ze=Math.max(K,ae+(ge?Q:0)+ke+F),lt=Re+Ze;a.style.height=lt+"px"}else{const ge=V.length>0&&v===V[0].ref.current;a.style.top="0px";const Ze=Math.max(H,I+m.offsetTop+(ge?M:0)+ae)+Ce;a.style.height=Ze+"px",m.scrollTop=Re-H+m.offsetTop}a.style.margin=`${Nr}px 0`,a.style.minHeight=Y+"px",a.style.maxHeight=L+"px",r==null||r(),requestAnimationFrame(()=>g.current=!0)}},[p,o.trigger,o.valueNode,a,c,m,v,b,o.dir,r]);nn(()=>w(),[w]);const[_,E]=h.useState();nn(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const S=h.useCallback(R=>{R&&y.current===!0&&(w(),x==null||x(),y.current=!1)},[w,x]);return d.jsx(bY,{scope:n,contentWrapper:a,shouldExpandOnScrollRef:g,onScrollButtonChange:S,children:d.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:d.jsx($e.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});k$.displayName=vY;var yY="SelectPopperPosition",Dy=h.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=Nr,...o}=e,i=Kp(n);return d.jsx(_b,{...i,...o,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...o.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)"}})});Dy.displayName=yY;var[bY,b0]=sc(fa,{}),ky="SelectViewport",O$=h.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,o=hi(ky,n),i=b0(ky,n),a=tt(t,o.onViewportChange),l=h.useRef(0);return d.jsxs(d.Fragment,{children:[d.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:r}),d.jsx(Hp.Slot,{scope:n,children:d.jsx($e.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:me(s.onScroll,c=>{const u=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:p}=i;if(p!=null&&p.current&&f){const g=Math.abs(l.current-u.scrollTop);if(g>0){const y=window.innerHeight-Nr*2,m=parseFloat(f.style.minHeight),v=parseFloat(f.style.height),b=Math.max(m,v);if(b<y){const x=b+g,w=Math.min(y,x),_=x-w;f.style.height=w+"px",f.style.bottom==="0px"&&(u.scrollTop=_>0?_:0,f.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});O$.displayName=ky;var M$="SelectGroup",[xY,wY]=sc(M$),_Y=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=fn();return d.jsx(xY,{scope:n,id:s,children:d.jsx($e.div,{role:"group","aria-labelledby":s,...r,ref:t})})});_Y.displayName=M$;var I$="SelectLabel",F$=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=wY(I$,n);return d.jsx($e.div,{id:s.id,...r,ref:t})});F$.displayName=I$;var Eh="SelectItem",[EY,L$]=sc(Eh),U$=h.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:o,...i}=e,a=fi(Eh,n),l=hi(Eh,n),c=a.value===r,[u,f]=h.useState(o??""),[p,g]=h.useState(!1),y=tt(t,x=>{var w;return(w=l.itemRefCallback)==null?void 0:w.call(l,x,r,s)}),m=fn(),v=h.useRef("touch"),b=()=>{s||(a.onValueChange(r),a.onOpenChange(!1))};if(r==="")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 d.jsx(EY,{scope:n,value:r,disabled:s,textId:m,isSelected:c,onItemTextChange:h.useCallback(x=>{f(w=>w||((x==null?void 0:x.textContent)??"").trim())},[]),children:d.jsx(Hp.ItemSlot,{scope:n,value:r,disabled:s,textValue:u,children:d.jsx($e.div,{role:"option","aria-labelledby":m,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:y,onFocus:me(i.onFocus,()=>g(!0)),onBlur:me(i.onBlur,()=>g(!1)),onClick:me(i.onClick,()=>{v.current!=="mouse"&&b()}),onPointerUp:me(i.onPointerUp,()=>{v.current==="mouse"&&b()}),onPointerDown:me(i.onPointerDown,x=>{v.current=x.pointerType}),onPointerMove:me(i.onPointerMove,x=>{var w;v.current=x.pointerType,s?(w=l.onItemLeave)==null||w.call(l):v.current==="mouse"&&x.currentTarget.focus({preventScroll:!0})}),onPointerLeave:me(i.onPointerLeave,x=>{var w;x.currentTarget===document.activeElement&&((w=l.onItemLeave)==null||w.call(l))}),onKeyDown:me(i.onKeyDown,x=>{var _;((_=l.searchRef)==null?void 0:_.current)!==""&&x.key===" "||(lY.includes(x.key)&&b(),x.key===" "&&x.preventDefault())})})})})});U$.displayName=Eh;var Yc="SelectItemText",B$=h.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...o}=e,i=fi(Yc,n),a=hi(Yc,n),l=L$(Yc,n),c=fY(Yc,n),[u,f]=h.useState(null),p=tt(t,b=>f(b),l.onItemTextChange,b=>{var x;return(x=a.itemTextRefCallback)==null?void 0:x.call(a,b,l.value,l.disabled)}),g=u==null?void 0:u.textContent,y=h.useMemo(()=>d.jsx("option",{value:l.value,disabled:l.disabled,children:g},l.value),[l.disabled,l.value,g]),{onNativeOptionAdd:m,onNativeOptionRemove:v}=c;return nn(()=>(m(y),()=>v(y)),[m,v,y]),d.jsxs(d.Fragment,{children:[d.jsx($e.span,{id:l.textId,...o,ref:p}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Cr.createPortal(o.children,i.valueNode):null]})});B$.displayName=Yc;var V$="SelectItemIndicator",z$=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return L$(V$,n).isSelected?d.jsx($e.span,{"aria-hidden":!0,...r,ref:t}):null});z$.displayName=V$;var Oy="SelectScrollUpButton",W$=h.forwardRef((e,t)=>{const n=hi(Oy,e.__scopeSelect),r=b0(Oy,e.__scopeSelect),[s,o]=h.useState(!1),i=tt(t,r.onScrollButtonChange);return nn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollTop>0;o(c)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?d.jsx(H$,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});W$.displayName=Oy;var My="SelectScrollDownButton",q$=h.forwardRef((e,t)=>{const n=hi(My,e.__scopeSelect),r=b0(My,e.__scopeSelect),[s,o]=h.useState(!1),i=tt(t,r.onScrollButtonChange);return nn(()=>{if(n.viewport&&n.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;o(u)};const l=n.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[n.viewport,n.isPositioned]),s?d.jsx(H$,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=n;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});q$.displayName=My;var H$=h.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,o=hi("SelectScrollButton",n),i=h.useRef(null),a=Gp(n),l=h.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return h.useEffect(()=>()=>l(),[l]),nn(()=>{var u;const c=a().find(f=>f.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),d.jsx($e.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:me(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(r,50))}),onPointerMove:me(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),i.current===null&&(i.current=window.setInterval(r,50))}),onPointerLeave:me(s.onPointerLeave,()=>{l()})})}),SY="SelectSeparator",G$=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return d.jsx($e.div,{"aria-hidden":!0,...r,ref:t})});G$.displayName=SY;var Iy="SelectArrow",CY=h.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Kp(n),o=fi(Iy,n),i=hi(Iy,n);return o.open&&i.position==="popper"?d.jsx(Eb,{...s,...r,ref:t}):null});CY.displayName=Iy;var TY="SelectBubbleInput",K$=h.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=h.useRef(null),o=tt(r,s),i=gj(t);return h.useEffect(()=>{const a=s.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&u){const f=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(f)}},[i,t]),d.jsx($e.select,{...n,style:{...xT,...n.style},ref:o,defaultValue:t})});K$.displayName=TY;function Y$(e){return e===""||e===void 0}function Z$(e){const t=qn(e),n=h.useRef(""),r=h.useRef(0),s=h.useCallback(i=>{const a=n.current+i;t(a),function l(c){n.current=c,window.clearTimeout(r.current),c!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=h.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return h.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,o]}function Q$(e,t,n){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=RY(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function RY(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var NY=S$,X$=T$,PY=N$,jY=P$,AY=j$,J$=A$,$Y=O$,eD=F$,tD=U$,DY=B$,kY=z$,nD=W$,rD=q$,sD=G$;const pie="__UNSET",Au=NY,$u=PY,kl=h.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(X$,{ref:r,className:se("flex h-10 w-full hover:bg-accent items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,d.jsx(jY,{asChild:!0,children:d.jsx(lp,{className:"h-4 w-4 flex-shrink-0 opacity-50"})})]}));kl.displayName=X$.displayName;const oD=h.forwardRef(({className:e,...t},n)=>d.jsx(nD,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(UB,{className:"h-4 w-4"})}));oD.displayName=nD.displayName;const iD=h.forwardRef(({className:e,...t},n)=>d.jsx(rD,{ref:n,className:se("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(lp,{className:"h-4 w-4"})}));iD.displayName=rD.displayName;const Ol=h.forwardRef(({className:e,children:t,position:n="popper",...r},s)=>d.jsx(AY,{children:d.jsxs(J$,{ref:s,className:se("relative z-50 max-h-96 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",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[d.jsx(oD,{}),d.jsx($Y,{className:se("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),d.jsx(iD,{})]})}));Ol.displayName=J$.displayName;const OY=h.forwardRef(({className:e,...t},n)=>d.jsx(eD,{ref:n,className:se("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));OY.displayName=eD.displayName;const Yi=h.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(tD,{ref:r,className:se("hover:bg-neutral-100 relative flex w-full cursor-default select-none items-center py-1.5 px-2 text-sm outline-none focus:bg-neutral-100 rounded focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 text-neutral-600 data-[state=checked]:text-neutral-900",e),...n,children:[d.jsx(DY,{children:t}),d.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(kY,{children:d.jsx(ia,{className:"h-4 w-4"})})})]}));Yi.displayName=tD.displayName;const MY=h.forwardRef(({className:e,...t},n)=>d.jsx(sD,{ref:n,className:se("-mx-1 my-1 h-px bg-muted",e),...t}));MY.displayName=sD.displayName;function _1(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function IY(e,t){const n=_1(e),r=_1(t);return+n<+r}const FY=({onSuccess:e}={})=>{const t=It(),{logEvent:n}=ft();return Rt({mutationFn:async s=>(await t.fetch(Mt.accounts.createCustomDomain({accountName:s.accountName,isAlias:s.isAlias,projectName:s.projectName,hostname:s.hostname,deploymentName:s.deploymentName,stage:s.stage}))).json(),onSuccess:s=>{n("account-custom-domain-creation-success",{}),e==null||e(s)},onError:s=>{n("account-custom-domain-creation-failed",{error:s.message})}})},LY=()=>{const e=It();return Rt({mutationFn:async n=>{await e.fetch(Mt.accounts.editCustomDomain({accountName:n.accountName,projectName:n.projectName,hostname:n.hostname,deploymentName:n.deploymentName}))}})},UY=()=>{const e=It();return Rt({mutationFn:async n=>{await e.fetch(Mt.accounts.deleteCustomDomain({accountName:n.accountName,projectName:n.projectName,hostname:n.hostname,deploymentName:n.deploymentName}))}})},BY=(e,t)=>ar(ye.customDomains(e,t),{extractData:!0});var et;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const o={};for(const i of s)o[i]=i;return o},e.getValidEnumValues=s=>{const o=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),i={};for(const a of o)i[a]=s[a];return e.objectValues(i)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const o=[];for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&o.push(i);return o},e.find=(s,o)=>{for(const i of s)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,o=" | "){return s.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(et||(et={}));var Fy;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Fy||(Fy={}));const xe=et.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),$s=e=>{switch(typeof e){case"undefined":return xe.undefined;case"string":return xe.string;case"number":return isNaN(e)?xe.nan:xe.number;case"boolean":return xe.boolean;case"function":return xe.function;case"bigint":return xe.bigint;case"symbol":return xe.symbol;case"object":return Array.isArray(e)?xe.array:e===null?xe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?xe.promise:typeof Map<"u"&&e instanceof Map?xe.map:typeof Set<"u"&&e instanceof Set?xe.set:typeof Date<"u"&&e instanceof Date?xe.date:xe.object;default:return xe.unknown}},re=et.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),VY=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class sr extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},s=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(s);else if(i.code==="invalid_return_type")s(i.returnTypeError);else if(i.code==="invalid_arguments")s(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,l=0;for(;l<i.path.length;){const c=i.path[l];l===i.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(i))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return s(this),r}static assert(t){if(!(t instanceof sr))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,et.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}sr.create=e=>new sr(e);const Ml=(e,t)=>{let n;switch(e.code){case re.invalid_type:e.received===xe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case re.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,et.jsonStringifyReplacer)}`;break;case re.unrecognized_keys:n=`Unrecognized key(s) in object: ${et.joinValues(e.keys,", ")}`;break;case re.invalid_union:n="Invalid input";break;case re.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${et.joinValues(e.options)}`;break;case re.invalid_enum_value:n=`Invalid enum value. Expected ${et.joinValues(e.options)}, received '${e.received}'`;break;case re.invalid_arguments:n="Invalid function arguments";break;case re.invalid_return_type:n="Invalid function return type";break;case re.invalid_date:n="Invalid date";break;case re.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:et.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case re.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case re.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case re.custom:n="Invalid input";break;case re.invalid_intersection_types:n="Intersection results could not be merged";break;case re.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case re.not_finite:n="Number must be finite";break;default:n=t.defaultError,et.assertNever(e)}return{message:n}};let aD=Ml;function zY(e){aD=e}function Sh(){return aD}const Ch=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,o=[...n,...s.path||[]],i={...s,path:o};if(s.message!==void 0)return{...s,path:o,message:s.message};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(i,{data:t,defaultError:a}).message;return{...s,path:o,message:a}},WY=[];function pe(e,t){const n=Sh(),r=Ch({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Ml?void 0:Ml].filter(s=>!!s)});e.common.issues.push(r)}class En{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return Ue;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const o=await s.key,i=await s.value;r.push({key:o,value:i})}return En.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:o,value:i}=s;if(o.status==="aborted"||i.status==="aborted")return Ue;o.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof i.value<"u"||s.alwaysSet)&&(r[o.value]=i.value)}return{status:t.value,value:r}}}const Ue=Object.freeze({status:"aborted"}),Xa=e=>({status:"dirty",value:e}),kn=e=>({status:"valid",value:e}),Ly=e=>e.status==="aborted",Uy=e=>e.status==="dirty",ha=e=>e.status==="valid",Du=e=>typeof Promise<"u"&&e instanceof Promise;function Th(e,t,n,r){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function lD(e,t,n,r,s){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Te;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Te||(Te={}));var Zc,Qc;class vs{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const E1=(e,t)=>{if(ha(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new sr(e.common.issues);return this._error=n,this._error}}};function Ge(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(i,a)=>{var l,c;const{message:u}=e;return i.code==="invalid_enum_value"?{message:u??a.defaultError}:typeof a.data>"u"?{message:(l=u??r)!==null&&l!==void 0?l:a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:(c=u??n)!==null&&c!==void 0?c:a.defaultError}},description:s}}class Ye{get description(){return this._def.description}_getType(t){return $s(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new En,ctx:{common:t.parent.common,data:t.data,parsedType:$s(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Du(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$s(t)},o=this._parseSync({data:t,path:s.path,parent:s});return E1(s,o)}"~validate"(t){var n,r;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$s(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:s});return ha(o)?{value:o.value}:{issues:s.common.issues}}catch(o){!((r=(n=o==null?void 0:o.message)===null||n===void 0?void 0:n.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:s}).then(o=>ha(o)?{value:o.value}:{issues:s.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:$s(t)},s=this._parse({data:t,path:r.path,parent:r}),o=await(Du(s)?s:Promise.resolve(s));return E1(r,o)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,o)=>{const i=t(s),a=()=>o.addIssue({code:re.custom,...r(s)});return typeof Promise<"u"&&i instanceof Promise?i.then(l=>l?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new Ur({schema:this,typeName:Ie.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return fs.create(this,this._def)}nullable(){return ri.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Or.create(this)}promise(){return Fl.create(this,this._def)}or(t){return Iu.create([this,t],this._def)}and(t){return Fu.create(this,t,this._def)}transform(t){return new Ur({...Ge(this._def),schema:this,typeName:Ie.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new zu({...Ge(this._def),innerType:this,defaultValue:n,typeName:Ie.ZodDefault})}brand(){return new x0({typeName:Ie.ZodBranded,type:this,...Ge(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Wu({...Ge(this._def),innerType:this,catchValue:n,typeName:Ie.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return yd.create(this,t)}readonly(){return qu.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const qY=/^c[^\s-]{8,}$/i,HY=/^[0-9a-z]+$/,GY=/^[0-9A-HJKMNP-TV-Z]{26}$/i,KY=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,YY=/^[a-z0-9_-]{21}$/i,ZY=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QY=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,XY=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,JY="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let xg;const eZ=/^(?:(?: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])$/,tZ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,nZ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,rZ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,sZ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,oZ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,cD="((\\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])))",iZ=new RegExp(`^${cD}$`);function uD(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function aZ(e){return new RegExp(`^${uD(e)}$`)}function dD(e){let t=`${cD}T${uD(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function lZ(e,t){return!!((t==="v4"||!t)&&eZ.test(e)||(t==="v6"||!t)&&nZ.test(e))}function cZ(e,t){if(!ZY.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||!s.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function uZ(e,t){return!!((t==="v4"||!t)&&tZ.test(e)||(t==="v6"||!t)&&rZ.test(e))}class kr extends Ye{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==xe.string){const o=this._getOrReturnCtx(t);return pe(o,{code:re.invalid_type,expected:xe.string,received:o.parsedType}),Ue}const r=new En;let s;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:re.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:re.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const i=t.data.length>o.value,a=t.data.length<o.value;(i||a)&&(s=this._getOrReturnCtx(t,s),i?pe(s,{code:re.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&pe(s,{code:re.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")XY.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"email",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")xg||(xg=new RegExp(JY,"u")),xg.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"emoji",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")KY.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"uuid",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")YY.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"nanoid",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")qY.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"cuid",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")HY.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"cuid2",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")GY.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"ulid",code:re.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),pe(s,{validation:"url",code:re.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"regex",code:re.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(s=this._getOrReturnCtx(t,s),pe(s,{code:re.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),pe(s,{code:re.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),pe(s,{code:re.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?dD(o).test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{code:re.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?iZ.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{code:re.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?aZ(o).test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{code:re.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?QY.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"duration",code:re.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?lZ(t.data,o.version)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"ip",code:re.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?cZ(t.data,o.alg)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"jwt",code:re.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?uZ(t.data,o.version)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"cidr",code:re.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?sZ.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"base64",code:re.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?oZ.test(t.data)||(s=this._getOrReturnCtx(t,s),pe(s,{validation:"base64url",code:re.invalid_string,message:o.message}),r.dirty()):et.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:re.invalid_string,...Te.errToObj(r)})}_addCheck(t){return new kr({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Te.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Te.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Te.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Te.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Te.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Te.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Te.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Te.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Te.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Te.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Te.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Te.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Te.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...Te.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Te.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Te.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Te.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Te.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Te.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Te.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Te.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Te.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Te.errToObj(n)})}nonempty(t){return this.min(1,Te.errToObj(t))}trim(){return new kr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new kr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new kr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}kr.create=e=>{var t;return new kr({checks:[],typeName:Ie.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ge(e)})};function dZ(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,o=parseInt(e.toFixed(s).replace(".","")),i=parseInt(t.toFixed(s).replace(".",""));return o%i/Math.pow(10,s)}class ei extends Ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==xe.number){const o=this._getOrReturnCtx(t);return pe(o,{code:re.invalid_type,expected:xe.number,received:o.parsedType}),Ue}let r;const s=new En;for(const o of this._def.checks)o.kind==="int"?et.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),pe(r,{code:re.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),pe(r,{code:re.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),pe(r,{code:re.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?dZ(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),pe(r,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),pe(r,{code:re.not_finite,message:o.message}),s.dirty()):et.assertNever(o);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Te.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Te.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Te.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Te.toString(n))}setLimit(t,n,r,s){return new ei({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Te.toString(s)}]})}_addCheck(t){return new ei({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Te.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Te.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Te.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Te.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Te.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Te.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Te.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Te.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Te.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&et.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}ei.create=e=>new ei({checks:[],typeName:Ie.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Ge(e)});class ti extends Ye{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==xe.bigint)return this._getInvalidInput(t);let r;const s=new En;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),pe(r,{code:re.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),pe(r,{code:re.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),s.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),pe(r,{code:re.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):et.assertNever(o);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return pe(n,{code:re.invalid_type,expected:xe.bigint,received:n.parsedType}),Ue}gte(t,n){return this.setLimit("min",t,!0,Te.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Te.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Te.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Te.toString(n))}setLimit(t,n,r,s){return new ti({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Te.toString(s)}]})}_addCheck(t){return new ti({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Te.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Te.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Te.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Te.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Te.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ti.create=e=>{var t;return new ti({checks:[],typeName:Ie.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Ge(e)})};class ku extends Ye{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==xe.boolean){const r=this._getOrReturnCtx(t);return pe(r,{code:re.invalid_type,expected:xe.boolean,received:r.parsedType}),Ue}return kn(t.data)}}ku.create=e=>new ku({typeName:Ie.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Ge(e)});class pa extends Ye{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==xe.date){const o=this._getOrReturnCtx(t);return pe(o,{code:re.invalid_type,expected:xe.date,received:o.parsedType}),Ue}if(isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return pe(o,{code:re.invalid_date}),Ue}const r=new En;let s;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:re.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),pe(s,{code:re.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):et.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new pa({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Te.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Te.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}pa.create=e=>new pa({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Ie.ZodDate,...Ge(e)});class Rh extends Ye{_parse(t){if(this._getType(t)!==xe.symbol){const r=this._getOrReturnCtx(t);return pe(r,{code:re.invalid_type,expected:xe.symbol,received:r.parsedType}),Ue}return kn(t.data)}}Rh.create=e=>new Rh({typeName:Ie.ZodSymbol,...Ge(e)});class Ou extends Ye{_parse(t){if(this._getType(t)!==xe.undefined){const r=this._getOrReturnCtx(t);return pe(r,{code:re.invalid_type,expected:xe.undefined,received:r.parsedType}),Ue}return kn(t.data)}}Ou.create=e=>new Ou({typeName:Ie.ZodUndefined,...Ge(e)});class Mu extends Ye{_parse(t){if(this._getType(t)!==xe.null){const r=this._getOrReturnCtx(t);return pe(r,{code:re.invalid_type,expected:xe.null,received:r.parsedType}),Ue}return kn(t.data)}}Mu.create=e=>new Mu({typeName:Ie.ZodNull,...Ge(e)});class Il extends Ye{constructor(){super(...arguments),this._any=!0}_parse(t){return kn(t.data)}}Il.create=e=>new Il({typeName:Ie.ZodAny,...Ge(e)});class Zi extends Ye{constructor(){super(...arguments),this._unknown=!0}_parse(t){return kn(t.data)}}Zi.create=e=>new Zi({typeName:Ie.ZodUnknown,...Ge(e)});class Js extends Ye{_parse(t){const n=this._getOrReturnCtx(t);return pe(n,{code:re.invalid_type,expected:xe.never,received:n.parsedType}),Ue}}Js.create=e=>new Js({typeName:Ie.ZodNever,...Ge(e)});class Nh extends Ye{_parse(t){if(this._getType(t)!==xe.undefined){const r=this._getOrReturnCtx(t);return pe(r,{code:re.invalid_type,expected:xe.void,received:r.parsedType}),Ue}return kn(t.data)}}Nh.create=e=>new Nh({typeName:Ie.ZodVoid,...Ge(e)});class Or extends Ye{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==xe.array)return pe(n,{code:re.invalid_type,expected:xe.array,received:n.parsedType}),Ue;if(s.exactLength!==null){const i=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(i||a)&&(pe(n,{code:i?re.too_big:re.too_small,minimum:a?s.exactLength.value:void 0,maximum:i?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(pe(n,{code:re.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(pe(n,{code:re.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>s.type._parseAsync(new vs(n,i,n.path,a)))).then(i=>En.mergeArray(r,i));const o=[...n.data].map((i,a)=>s.type._parseSync(new vs(n,i,n.path,a)));return En.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Or({...this._def,minLength:{value:t,message:Te.toString(n)}})}max(t,n){return new Or({...this._def,maxLength:{value:t,message:Te.toString(n)}})}length(t,n){return new Or({...this._def,exactLength:{value:t,message:Te.toString(n)}})}nonempty(t){return this.min(1,t)}}Or.create=(e,t)=>new Or({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ie.ZodArray,...Ge(t)});function za(e){if(e instanceof _t){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=fs.create(za(r))}return new _t({...e._def,shape:()=>t})}else return e instanceof Or?new Or({...e._def,type:za(e.element)}):e instanceof fs?fs.create(za(e.unwrap())):e instanceof ri?ri.create(za(e.unwrap())):e instanceof ys?ys.create(e.items.map(t=>za(t))):e}class _t extends Ye{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=et.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==xe.object){const c=this._getOrReturnCtx(t);return pe(c,{code:re.invalid_type,expected:xe.object,received:c.parsedType}),Ue}const{status:r,ctx:s}=this._processInputParams(t),{shape:o,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Js&&this._def.unknownKeys==="strip"))for(const c in s.data)i.includes(c)||a.push(c);const l=[];for(const c of i){const u=o[c],f=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new vs(s,f,s.path,c)),alwaysSet:c in s.data})}if(this._def.catchall instanceof Js){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:s.data[u]}});else if(c==="strict")a.length>0&&(pe(s,{code:re.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const f=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new vs(s,f,s.path,u)),alwaysSet:u in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,p=await u.value;c.push({key:f,value:p,alwaysSet:u.alwaysSet})}return c}).then(c=>En.mergeObjectSync(r,c)):En.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Te.errToObj,new _t({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,o,i,a;const l=(i=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,n,r).message)!==null&&i!==void 0?i:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Te.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new _t({...this._def,unknownKeys:"strip"})}passthrough(){return new _t({...this._def,unknownKeys:"passthrough"})}extend(t){return new _t({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new _t({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ie.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new _t({...this._def,catchall:t})}pick(t){const n={};return et.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new _t({...this._def,shape:()=>n})}omit(t){const n={};return et.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new _t({...this._def,shape:()=>n})}deepPartial(){return za(this)}partial(t){const n={};return et.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}),new _t({...this._def,shape:()=>n})}required(t){const n={};return et.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof fs;)o=o._def.innerType;n[r]=o}}),new _t({...this._def,shape:()=>n})}keyof(){return fD(et.objectKeys(this.shape))}}_t.create=(e,t)=>new _t({shape:()=>e,unknownKeys:"strip",catchall:Js.create(),typeName:Ie.ZodObject,...Ge(t)});_t.strictCreate=(e,t)=>new _t({shape:()=>e,unknownKeys:"strict",catchall:Js.create(),typeName:Ie.ZodObject,...Ge(t)});_t.lazycreate=(e,t)=>new _t({shape:e,unknownKeys:"strip",catchall:Js.create(),typeName:Ie.ZodObject,...Ge(t)});class Iu extends Ye{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(o){for(const a of o)if(a.result.status==="valid")return a.result;for(const a of o)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const i=o.map(a=>new sr(a.ctx.common.issues));return pe(n,{code:re.invalid_union,unionErrors:i}),Ue}if(n.common.async)return Promise.all(r.map(async o=>{const i={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(s);{let o;const i=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!o&&(o={result:u,ctx:c}),c.common.issues.length&&i.push(c.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(l=>new sr(l));return pe(n,{code:re.invalid_union,unionErrors:a}),Ue}}get options(){return this._def.options}}Iu.create=(e,t)=>new Iu({options:e,typeName:Ie.ZodUnion,...Ge(t)});const Ns=e=>e instanceof Uu?Ns(e.schema):e instanceof Ur?Ns(e.innerType()):e instanceof Bu?[e.value]:e instanceof ni?e.options:e instanceof Vu?et.objectValues(e.enum):e instanceof zu?Ns(e._def.innerType):e instanceof Ou?[void 0]:e instanceof Mu?[null]:e instanceof fs?[void 0,...Ns(e.unwrap())]:e instanceof ri?[null,...Ns(e.unwrap())]:e instanceof x0||e instanceof qu?Ns(e.unwrap()):e instanceof Wu?Ns(e._def.innerType):[];class Yp extends Ye{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.object)return pe(n,{code:re.invalid_type,expected:xe.object,received:n.parsedType}),Ue;const r=this.discriminator,s=n.data[r],o=this.optionsMap.get(s);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(pe(n,{code:re.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Ue)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const o of n){const i=Ns(o.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of i){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,o)}}return new Yp({typeName:Ie.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...Ge(r)})}}function By(e,t){const n=$s(e),r=$s(t);if(e===t)return{valid:!0,data:e};if(n===xe.object&&r===xe.object){const s=et.objectKeys(t),o=et.objectKeys(e).filter(a=>s.indexOf(a)!==-1),i={...e,...t};for(const a of o){const l=By(e[a],t[a]);if(!l.valid)return{valid:!1};i[a]=l.data}return{valid:!0,data:i}}else if(n===xe.array&&r===xe.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let o=0;o<e.length;o++){const i=e[o],a=t[o],l=By(i,a);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return n===xe.date&&r===xe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Fu extends Ye{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(o,i)=>{if(Ly(o)||Ly(i))return Ue;const a=By(o.value,i.value);return a.valid?((Uy(o)||Uy(i))&&n.dirty(),{status:n.value,value:a.data}):(pe(r,{code:re.invalid_intersection_types}),Ue)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,i])=>s(o,i)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Fu.create=(e,t,n)=>new Fu({left:e,right:t,typeName:Ie.ZodIntersection,...Ge(n)});class ys extends Ye{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.array)return pe(r,{code:re.invalid_type,expected:xe.array,received:r.parsedType}),Ue;if(r.data.length<this._def.items.length)return pe(r,{code:re.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ue;!this._def.rest&&r.data.length>this._def.items.length&&(pe(r,{code:re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((i,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new vs(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(o).then(i=>En.mergeArray(n,i)):En.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new ys({...this._def,rest:t})}}ys.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ys({items:e,typeName:Ie.ZodTuple,rest:null,...Ge(t)})};class Lu extends Ye{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.object)return pe(r,{code:re.invalid_type,expected:xe.object,received:r.parsedType}),Ue;const s=[],o=this._def.keyType,i=this._def.valueType;for(const a in r.data)s.push({key:o._parse(new vs(r,a,r.path,a)),value:i._parse(new vs(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?En.mergeObjectAsync(n,s):En.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Ye?new Lu({keyType:t,valueType:n,typeName:Ie.ZodRecord,...Ge(r)}):new Lu({keyType:kr.create(),valueType:t,typeName:Ie.ZodRecord,...Ge(n)})}}class Ph extends Ye{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.map)return pe(r,{code:re.invalid_type,expected:xe.map,received:r.parsedType}),Ue;const s=this._def.keyType,o=this._def.valueType,i=[...r.data.entries()].map(([a,l],c)=>({key:s._parse(new vs(r,a,r.path,[c,"key"])),value:o._parse(new vs(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of i){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Ue;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of i){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Ue;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}Ph.create=(e,t,n)=>new Ph({valueType:t,keyType:e,typeName:Ie.ZodMap,...Ge(n)});class ma extends Ye{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==xe.set)return pe(r,{code:re.invalid_type,expected:xe.set,received:r.parsedType}),Ue;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(pe(r,{code:re.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(pe(r,{code:re.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const o=this._def.valueType;function i(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Ue;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>o._parse(new vs(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>i(l)):i(a)}min(t,n){return new ma({...this._def,minSize:{value:t,message:Te.toString(n)}})}max(t,n){return new ma({...this._def,maxSize:{value:t,message:Te.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}ma.create=(e,t)=>new ma({valueType:e,minSize:null,maxSize:null,typeName:Ie.ZodSet,...Ge(t)});class ll extends Ye{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.function)return pe(n,{code:re.invalid_type,expected:xe.function,received:n.parsedType}),Ue;function r(a,l){return Ch({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Sh(),Ml].filter(c=>!!c),issueData:{code:re.invalid_arguments,argumentsError:l}})}function s(a,l){return Ch({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Sh(),Ml].filter(c=>!!c),issueData:{code:re.invalid_return_type,returnTypeError:l}})}const o={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Fl){const a=this;return kn(async function(...l){const c=new sr([]),u=await a._def.args.parseAsync(l,o).catch(g=>{throw c.addIssue(r(l,g)),c}),f=await Reflect.apply(i,this,u);return await a._def.returns._def.type.parseAsync(f,o).catch(g=>{throw c.addIssue(s(f,g)),c})})}else{const a=this;return kn(function(...l){const c=a._def.args.safeParse(l,o);if(!c.success)throw new sr([r(l,c.error)]);const u=Reflect.apply(i,this,c.data),f=a._def.returns.safeParse(u,o);if(!f.success)throw new sr([s(u,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ll({...this._def,args:ys.create(t).rest(Zi.create())})}returns(t){return new ll({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ll({args:t||ys.create([]).rest(Zi.create()),returns:n||Zi.create(),typeName:Ie.ZodFunction,...Ge(r)})}}class Uu extends Ye{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}Uu.create=(e,t)=>new Uu({getter:e,typeName:Ie.ZodLazy,...Ge(t)});class Bu extends Ye{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return pe(n,{received:n.data,code:re.invalid_literal,expected:this._def.value}),Ue}return{status:"valid",value:t.data}}get value(){return this._def.value}}Bu.create=(e,t)=>new Bu({value:e,typeName:Ie.ZodLiteral,...Ge(t)});function fD(e,t){return new ni({values:e,typeName:Ie.ZodEnum,...Ge(t)})}class ni extends Ye{constructor(){super(...arguments),Zc.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return pe(n,{expected:et.joinValues(r),received:n.parsedType,code:re.invalid_type}),Ue}if(Th(this,Zc)||lD(this,Zc,new Set(this._def.values)),!Th(this,Zc).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return pe(n,{received:n.data,code:re.invalid_enum_value,options:r}),Ue}return kn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return ni.create(t,{...this._def,...n})}exclude(t,n=this._def){return ni.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Zc=new WeakMap;ni.create=fD;class Vu extends Ye{constructor(){super(...arguments),Qc.set(this,void 0)}_parse(t){const n=et.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==xe.string&&r.parsedType!==xe.number){const s=et.objectValues(n);return pe(r,{expected:et.joinValues(s),received:r.parsedType,code:re.invalid_type}),Ue}if(Th(this,Qc)||lD(this,Qc,new Set(et.getValidEnumValues(this._def.values))),!Th(this,Qc).has(t.data)){const s=et.objectValues(n);return pe(r,{received:r.data,code:re.invalid_enum_value,options:s}),Ue}return kn(t.data)}get enum(){return this._def.values}}Qc=new WeakMap;Vu.create=(e,t)=>new Vu({values:e,typeName:Ie.ZodNativeEnum,...Ge(t)});class Fl extends Ye{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==xe.promise&&n.common.async===!1)return pe(n,{code:re.invalid_type,expected:xe.promise,received:n.parsedType}),Ue;const r=n.parsedType===xe.promise?n.data:Promise.resolve(n.data);return kn(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Fl.create=(e,t)=>new Fl({type:e,typeName:Ie.ZodPromise,...Ge(t)});class Ur extends Ye{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,o={addIssue:i=>{pe(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="preprocess"){const i=s.transform(r.data,o);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return Ue;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?Ue:l.status==="dirty"||n.value==="dirty"?Xa(l.value):l});{if(n.value==="aborted")return Ue;const a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?Ue:a.status==="dirty"||n.value==="dirty"?Xa(a.value):a}}if(s.type==="refinement"){const i=a=>{const l=s.refinement(a,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Ue:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Ue:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(s.type==="transform")if(r.common.async===!1){const i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!ha(i))return i;const a=s.transform(i.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>ha(i)?Promise.resolve(s.transform(i.value,o)).then(a=>({status:n.value,value:a})):i);et.assertNever(s)}}Ur.create=(e,t,n)=>new Ur({schema:e,typeName:Ie.ZodEffects,effect:t,...Ge(n)});Ur.createWithPreprocess=(e,t,n)=>new Ur({schema:t,effect:{type:"preprocess",transform:e},typeName:Ie.ZodEffects,...Ge(n)});class fs extends Ye{_parse(t){return this._getType(t)===xe.undefined?kn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}fs.create=(e,t)=>new fs({innerType:e,typeName:Ie.ZodOptional,...Ge(t)});class ri extends Ye{_parse(t){return this._getType(t)===xe.null?kn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ri.create=(e,t)=>new ri({innerType:e,typeName:Ie.ZodNullable,...Ge(t)});class zu extends Ye{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===xe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}zu.create=(e,t)=>new zu({innerType:e,typeName:Ie.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ge(t)});class Wu extends Ye{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Du(s)?s.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new sr(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new sr(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Wu.create=(e,t)=>new Wu({innerType:e,typeName:Ie.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ge(t)});class jh extends Ye{_parse(t){if(this._getType(t)!==xe.nan){const r=this._getOrReturnCtx(t);return pe(r,{code:re.invalid_type,expected:xe.nan,received:r.parsedType}),Ue}return{status:"valid",value:t.data}}}jh.create=e=>new jh({typeName:Ie.ZodNaN,...Ge(e)});const fZ=Symbol("zod_brand");class x0 extends Ye{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class yd extends Ye{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Ue:o.status==="dirty"?(n.dirty(),Xa(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Ue:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new yd({in:t,out:n,typeName:Ie.ZodPipeline})}}class qu extends Ye{_parse(t){const n=this._def.innerType._parse(t),r=s=>(ha(s)&&(s.value=Object.freeze(s.value)),s);return Du(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}qu.create=(e,t)=>new qu({innerType:e,typeName:Ie.ZodReadonly,...Ge(t)});function S1(e,t){const n=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof n=="string"?{message:n}:n}function hD(e,t={},n){return e?Il.create().superRefine((r,s)=>{var o,i;const a=e(r);if(a instanceof Promise)return a.then(l=>{var c,u;if(!l){const f=S1(t,r),p=(u=(c=f.fatal)!==null&&c!==void 0?c:n)!==null&&u!==void 0?u:!0;s.addIssue({code:"custom",...f,fatal:p})}});if(!a){const l=S1(t,r),c=(i=(o=l.fatal)!==null&&o!==void 0?o:n)!==null&&i!==void 0?i:!0;s.addIssue({code:"custom",...l,fatal:c})}}):Il.create()}const hZ={object:_t.lazycreate};var Ie;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ie||(Ie={}));const pZ=(e,t={message:`Input not instance of ${e.name}`})=>hD(n=>n instanceof e,t),pD=kr.create,mD=ei.create,mZ=jh.create,gZ=ti.create,gD=ku.create,vZ=pa.create,yZ=Rh.create,bZ=Ou.create,xZ=Mu.create,wZ=Il.create,_Z=Zi.create,EZ=Js.create,SZ=Nh.create,CZ=Or.create,TZ=_t.create,RZ=_t.strictCreate,NZ=Iu.create,PZ=Yp.create,jZ=Fu.create,AZ=ys.create,$Z=Lu.create,DZ=Ph.create,kZ=ma.create,OZ=ll.create,MZ=Uu.create,IZ=Bu.create,FZ=ni.create,LZ=Vu.create,UZ=Fl.create,C1=Ur.create,BZ=fs.create,VZ=ri.create,zZ=Ur.createWithPreprocess,WZ=yd.create,qZ=()=>pD().optional(),HZ=()=>mD().optional(),GZ=()=>gD().optional(),KZ={string:e=>kr.create({...e,coerce:!0}),number:e=>ei.create({...e,coerce:!0}),boolean:e=>ku.create({...e,coerce:!0}),bigint:e=>ti.create({...e,coerce:!0}),date:e=>pa.create({...e,coerce:!0})},YZ=Ue;var Rc=Object.freeze({__proto__:null,defaultErrorMap:Ml,setErrorMap:zY,getErrorMap:Sh,makeIssue:Ch,EMPTY_PATH:WY,addIssueToContext:pe,ParseStatus:En,INVALID:Ue,DIRTY:Xa,OK:kn,isAborted:Ly,isDirty:Uy,isValid:ha,isAsync:Du,get util(){return et},get objectUtil(){return Fy},ZodParsedType:xe,getParsedType:$s,ZodType:Ye,datetimeRegex:dD,ZodString:kr,ZodNumber:ei,ZodBigInt:ti,ZodBoolean:ku,ZodDate:pa,ZodSymbol:Rh,ZodUndefined:Ou,ZodNull:Mu,ZodAny:Il,ZodUnknown:Zi,ZodNever:Js,ZodVoid:Nh,ZodArray:Or,ZodObject:_t,ZodUnion:Iu,ZodDiscriminatedUnion:Yp,ZodIntersection:Fu,ZodTuple:ys,ZodRecord:Lu,ZodMap:Ph,ZodSet:ma,ZodFunction:ll,ZodLazy:Uu,ZodLiteral:Bu,ZodEnum:ni,ZodNativeEnum:Vu,ZodPromise:Fl,ZodEffects:Ur,ZodTransformer:Ur,ZodOptional:fs,ZodNullable:ri,ZodDefault:zu,ZodCatch:Wu,ZodNaN:jh,BRAND:fZ,ZodBranded:x0,ZodPipeline:yd,ZodReadonly:qu,custom:hD,Schema:Ye,ZodSchema:Ye,late:hZ,get ZodFirstPartyTypeKind(){return Ie},coerce:KZ,any:wZ,array:CZ,bigint:gZ,boolean:gD,date:vZ,discriminatedUnion:PZ,effect:C1,enum:FZ,function:OZ,instanceof:pZ,intersection:jZ,lazy:MZ,literal:IZ,map:DZ,nan:mZ,nativeEnum:LZ,never:EZ,null:xZ,nullable:VZ,number:mD,object:TZ,oboolean:GZ,onumber:HZ,optional:BZ,ostring:qZ,pipeline:WZ,preprocess:zZ,promise:UZ,record:$Z,set:kZ,strictObject:RZ,string:pD,symbol:yZ,transformer:C1,tuple:AZ,undefined:bZ,union:NZ,unknown:_Z,void:SZ,NEVER:YZ,ZodIssueCode:re,quotelessJson:VY,ZodError:sr});const ZZ=/^(?!https?:\/\/)[a-zA-Z0-9.-]*\.[a-zA-Z]+$/,QZ=Rc.object({hostname:Rc.string().regex(ZZ,"Please enter a valid domain name (e.g. api.example.com)"),environment:Rc.string().min(1),stage:Rc.enum(["api","dev-portal"]),isAlias:Rc.boolean().optional()}),XZ=({account:e,projectName:t,disabled:n=!1})=>{var m;const r=zj({resolver:T9(QZ),defaultValues:{hostname:"",environment:"",stage:"api",isAlias:!1}}),[s,o]=h.useState(!1),[i,a]=r.watch(["isAlias","stage"]),{data:l}=ec(e.name,t),{aliasDomains:c}=e.entitlements,{data:u}=dj(e.name),f=u==null?void 0:u.find(v=>v.name===t),p=f?IY(new Date(parseInt(f.createdOn)),new Date("2025-04-01")):!1,g=l?l.filter(v=>v.environmentType!==nr.WORKING_COPY):[],y=FY({onSuccess:()=>{i&&o(!1)}});return d.jsxs(cd,{open:s,onOpenChange:v=>{if(o(v),!v){if(r.formState.isDirty&&!y.isSuccess&&!window.confirm("Are you sure you want to leave this? Any unsaved changes will be lost.")){o(!0);return}r.reset(),y.isSuccess&&y.reset()}},children:[d.jsx(sj,{asChild:!0,children:d.jsx(Fe,{"data-test":"create-custom-domain-modal-btn",disabled:n,title:n?"You reached the limit of custom domains":"",children:"Add Custom Domain"})}),d.jsxs(Zl,{children:[d.jsx(kp,{children:d.jsx(ud,{children:"Add Custom Domain"})}),d.jsx("div",{className:"space-y-4",children:y.isSuccess?d.jsxs(d.Fragment,{children:[!c&&d.jsx(Sj,{customDomain:r.getValues("hostname"),cname:(m=y.data)==null?void 0:m.cname}),d.jsx("div",{className:"mt-5 sm:mt-4 flex justify-end gap-x-4",children:d.jsx(fy,{asChild:!0,children:d.jsx(Fe,{"data-test":"ok-create-custom-domain-btn",children:"Done"})})})]}):d.jsxs(d.Fragment,{children:[d.jsx(Lx,{error:y.error}),d.jsxs("div",{className:"text-left text-sm text-gray-800 whitespace-pre-line w-full mb-2",children:[g.length>0&&d.jsxs(tY,{...r,children:[p&&d.jsxs(Sr,{variant:"warning",children:[d.jsx(yp,{children:"Preview Notice"}),d.jsxs(ai,{children:["Custom domains for the Dev Portal are currently in preview and only available after the migration to our preview version."," ",d.jsx(xt,{href:"https://zuplo.com/docs/articles/custom-domains",target:"_blank",children:"Learn more"})]})]}),d.jsxs("form",{onSubmit:r.handleSubmit(async v=>{await y.mutateAsync({accountName:e.name,projectName:t,isAlias:v.stage==="dev-portal"?!1:v.isAlias??!1,hostname:v.hostname,deploymentName:v.environment,stage:v.stage})}),children:[d.jsx(ff,{control:r.control,name:"environment",render:({field:v})=>d.jsxs(Gc,{className:"mt-2",children:[d.jsx(Oo,{htmlFor:"environment-field",children:"Which environment do you want to apply your new domain to?"}),d.jsxs(Au,{onValueChange:b=>v.onChange(b),disabled:y.isPending,...v,children:[d.jsx(kl,{children:d.jsx($u,{id:"environment-field","data-test":"environment-field",placeholder:"Select an environment"})}),d.jsx(Ol,{children:g.map(b=>d.jsxs(Yi,{value:b.name,children:[b.branchName," - ",b.name]},b.name))})]}),d.jsx(Kc,{})]})}),d.jsx(ff,{control:r.control,name:"stage",render:({field:v})=>d.jsxs(Gc,{className:"mt-2",children:[d.jsx(Oo,{className:"block",htmlFor:"environment-field",children:"What do you want the custom domain to be assigned to?"}),d.jsxs(Au,{onValueChange:b=>{(b==="api"||b==="dev-portal")&&v.onChange(b)},disabled:y.isPending,...v,children:[d.jsx(kl,{children:d.jsx($u,{placeholder:"Select an environment"})}),d.jsxs(Ol,{children:[d.jsx(Yi,{value:"api",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Zb,{size:16})," Gateway"]})}),d.jsx(Yi,{value:"dev-portal",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(MV,{size:16})," Dev Portal",d.jsx(li,{className:"",variant:"info",children:"New"})]})})]})]}),d.jsx(Kc,{})]})}),d.jsx(ff,{control:r.control,name:"hostname",render:({field:v})=>d.jsxs(Gc,{className:"mt-2",children:[d.jsx(Oo,{htmlFor:"hostname-field",children:"Your custom domain (e.g. example.com or api.example.com)"}),d.jsx(Jo,{type:"text",autoComplete:"off",placeholder:"api.example.com",id:"hostname-field","data-test":"hostname-field",...v,disabled:y.isPending}),d.jsx(Kc,{})]})}),d.jsx(ff,{control:r.control,name:"isAlias",render:({field:v})=>d.jsx(Gc,{className:se((!c||a==="dev-portal")&&"hidden","mt-2"),children:d.jsxs(rn,{className:"p-4 flex items-center gap-3",children:[d.jsxs(Oo,{className:"flex flex-col gap-2",htmlFor:"isAlias",children:["Is this an alias domain?",d.jsxs("span",{className:"text-sm font-normal text-muted-foreground",children:["If your API Gateway is behind a CDN or WAF, your clients may use a different domain. Use an"," ",d.jsx(xt,{href:"https://zuplo.com/docs/articles/custom-domains#alias-domains",target:"_blank",rel:"noreferrer",className:"underline",children:"alias domain"})," ","so public URLs like docs and OpenAPI match the client-facing domain."]})]}),d.jsx(Ej,{className:"mx-3",id:"isAlias","data-test":"isAlias",checked:v.value??!1,onCheckedChange:v.onChange,disabled:y.isPending}),d.jsx(Kc,{})]})})}),d.jsxs("div",{className:"mt-5 sm:mt-4 flex justify-end gap-x-4",children:[d.jsx(fy,{asChild:!0,children:d.jsx(Fe,{type:"button","data-test":"cancel-create-custom-domain-btn",disabled:y.isPending,variant:"secondary",children:"Cancel"})}),d.jsx(Fe,{"data-test":"create-custom-domain-btn",disabled:y.isPending,children:d.jsx(ir,{loading:y.isPending,children:"Create"})})]})]})]}),g.length===0&&d.jsxs(d.Fragment,{children:[d.jsx("p",{children:"Custom domains can only be configured on edge deployment environments and this project only has a working-copy environment."}),d.jsx("br",{}),d.jsxs("p",{children:[" ","For more information on this see our"," ",d.jsx(xt,{href:"https://zuplo.com/docs/articles/environments",children:"documentation on environments"}),"."]})]})]})]})})]})]})},JZ=()=>d.jsxs("div",{className:"text-left text-sm text-gray-800 whitespace-pre-line w-full mb-2",children:[d.jsx("p",{children:"This custom domain is setup with an advanced configuration. In order to make changes to this domain, please contact support."}),d.jsx("br",{}),d.jsxs("p",{children:["For more information see our"," ",d.jsx(xt,{href:"https://www.zuplo.com/docs/guides/custom-domain-setup",children:"documentation on custom domains"}),"."]})]});var eQ=Object.defineProperty,tQ=(e,t,n)=>t in e?eQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wg=(e,t,n)=>(tQ(e,typeof t!="symbol"?t+"":t,n),n);let nQ=class{constructor(){wg(this,"current",this.detect()),wg(this,"handoffState","pending"),wg(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Vs=new nQ,Qt=(e,t)=>{Vs.isServer?h.useEffect(e,t):h.useLayoutEffect(e,t)};function Mr(e){let t=h.useRef(e);return Qt(()=>{t.current=e},[e]),t}function vD(e,t){let[n,r]=h.useState(e),s=Mr(e);return Qt(()=>r(s.current),[s,r,...t]),n}let Ve=function(e){let t=Mr(e);return ce.useCallback((...n)=>t.current(...n),[t])};function rQ(e,t,n){let[r,s]=h.useState(n),o=e!==void 0,i=h.useRef(o),a=h.useRef(!1),l=h.useRef(!1);return o&&!i.current&&!a.current?(a.current=!0,i.current=o,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!o&&i.current&&!l.current&&(l.current=!0,i.current=o,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[o?e:r,Ve(c=>(o||s(c),t==null?void 0:t(c)))]}function Zp(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Br(){let e=[],t={addEventListener(n,r,s,o){return n.addEventListener(r,s,o),t.add(()=>n.removeEventListener(r,s,o))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return Zp(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,s){let o=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:s}),this.add(()=>{Object.assign(n.style,{[r]:o})})},group(n){let r=Br();return n(r),this.add(()=>r.dispose())},add(n){return e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let s of e.splice(r,1))s()}},dispose(){for(let n of e.splice(0))n()}};return t}function ga(){let[e]=h.useState(Br);return h.useEffect(()=>()=>e.dispose(),[e]),e}function sQ(){let e=typeof document>"u";return"useSyncExternalStore"in qs?(t=>t.useSyncExternalStore)(qs)(()=>()=>{},()=>!1,()=>!e):!1}function oc(){let e=sQ(),[t,n]=h.useState(Vs.isHandoffComplete);return t&&Vs.isHandoffComplete===!1&&n(!1),h.useEffect(()=>{t!==!0&&n(!0)},[t]),h.useEffect(()=>Vs.handoff(),[]),e?!1:t}var T1;let _s=(T1=ce.useId)!=null?T1:function(){let e=oc(),[t,n]=ce.useState(e?()=>Vs.nextId():null);return Qt(()=>{t===null&&n(Vs.nextId())},[t]),t!=null?""+t:void 0};function kt(e,t,...n){if(e in t){let s=t[e];return typeof s=="function"?s(...n):s}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(s=>`"${s}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,kt),r}function Qp(e){return Vs.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Vy=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var ji=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(ji||{}),yD=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(yD||{}),oQ=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(oQ||{});function bD(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Vy)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var w0=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(w0||{});function _0(e,t=0){var n;return e===((n=Qp(e))==null?void 0:n.body)?!1:kt(t,{0(){return e.matches(Vy)},1(){let r=e;for(;r!==null;){if(r.matches(Vy))return!0;r=r.parentElement}return!1}})}function gie(e){let t=Qp(e);Br().nextFrame(()=>{t&&!_0(t.activeElement,0)&&Bo(e)})}var iQ=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(iQ||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Bo(e){e==null||e.focus({preventScroll:!0})}let aQ=["textarea","input"].join(",");function lQ(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,aQ))!=null?n:!1}function xD(e,t=n=>n){return e.slice().sort((n,r)=>{let s=t(n),o=t(r);if(s===null||o===null)return 0;let i=s.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function vie(e,t){return fu(bD(),t,{relativeTo:e})}function fu(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:s=[]}={}){let o=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,i=Array.isArray(e)?n?xD(e):e:bD(e);s.length>0&&i.length>1&&(i=i.filter(g=>!s.includes(g))),r=r??o.activeElement;let a=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,i.indexOf(r))-1;if(t&4)return Math.max(0,i.indexOf(r))+1;if(t&8)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=t&32?{preventScroll:!0}:{},u=0,f=i.length,p;do{if(u>=f||u+f<=0)return 0;let g=l+u;if(t&16)g=(g+f)%f;else{if(g<0)return 3;if(g>=f)return 1}p=i[g],p==null||p.focus(c),u+=a}while(p!==o.activeElement);return t&6&&lQ(p)&&p.select(),2}function wD(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function cQ(){return/Android/gi.test(window.navigator.userAgent)}function uQ(){return wD()||cQ()}function hf(e,t,n){let r=Mr(t);h.useEffect(()=>{function s(o){r.current(o)}return document.addEventListener(e,s,n),()=>document.removeEventListener(e,s,n)},[e,n])}function _D(e,t,n){let r=Mr(t);h.useEffect(()=>{function s(o){r.current(o)}return window.addEventListener(e,s,n),()=>window.removeEventListener(e,s,n)},[e,n])}function ED(e,t,n=!0){let r=h.useRef(!1);h.useEffect(()=>{requestAnimationFrame(()=>{r.current=n})},[n]);function s(i,a){if(!r.current||i.defaultPrevented)return;let l=a(i);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let c=function u(f){return typeof f=="function"?u(f()):Array.isArray(f)||f instanceof Set?f:[f]}(e);for(let u of c){if(u===null)continue;let f=u instanceof HTMLElement?u:u.current;if(f!=null&&f.contains(l)||i.composed&&i.composedPath().includes(f))return}return!_0(l,w0.Loose)&&l.tabIndex!==-1&&i.preventDefault(),t(i,l)}let o=h.useRef(null);hf("pointerdown",i=>{var a,l;r.current&&(o.current=((l=(a=i.composedPath)==null?void 0:a.call(i))==null?void 0:l[0])||i.target)},!0),hf("mousedown",i=>{var a,l;r.current&&(o.current=((l=(a=i.composedPath)==null?void 0:a.call(i))==null?void 0:l[0])||i.target)},!0),hf("click",i=>{uQ()||o.current&&(s(i,()=>o.current),o.current=null)},!0),hf("touchend",i=>s(i,()=>i.target instanceof HTMLElement?i.target:null),!0),_D("blur",i=>s(i,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function bd(...e){return h.useMemo(()=>Qp(...e),[...e])}function R1(e){var t;if(e.type)return e.type;let n=(t=e.as)!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function dQ(e,t){let[n,r]=h.useState(()=>R1(e));return Qt(()=>{r(R1(e))},[e.type,e.as]),Qt(()=>{n||t.current&&t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&r("button")},[n,t]),n}let SD=Symbol();function fQ(e,t=!0){return Object.assign(e,{[SD]:t})}function Sn(...e){let t=h.useRef(e);h.useEffect(()=>{t.current=e},[e]);let n=Ve(r=>{for(let s of t.current)s!=null&&(typeof s=="function"?s(r):s.current=r)});return e.every(r=>r==null||(r==null?void 0:r[SD]))?void 0:n}function N1(e){return[e.screenX,e.screenY]}function hQ(){let e=h.useRef([-1,-1]);return{wasMoved(t){let n=N1(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=N1(t)}}}function E0(e,t){let n=h.useRef([]),r=Ve(e);h.useEffect(()=>{let s=[...n.current];for(let[o,i]of t.entries())if(n.current[o]!==i){let a=r(t,s);return n.current=t,a}},[r,...t])}function Ah(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var Ll=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Ll||{}),Mo=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Mo||{});function mn({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:s,visible:o=!0,name:i,mergeRefs:a}){a=a??pQ;let l=CD(t,e);if(o)return pf(l,n,r,i,a);let c=s??0;if(c&2){let{static:u=!1,...f}=l;if(u)return pf(f,n,r,i,a)}if(c&1){let{unmount:u=!0,...f}=l;return kt(u?0:1,{0(){return null},1(){return pf({...f,hidden:!0,style:{display:"none"}},n,r,i,a)}})}return pf(l,n,r,i,a)}function pf(e,t={},n,r,s){let{as:o=n,children:i,refName:a="ref",...l}=_g(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof i=="function"?i(t):i;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(t));let f={};if(t){let p=!1,g=[];for(let[y,m]of Object.entries(t))typeof m=="boolean"&&(p=!0),m===!0&&g.push(y);p&&(f["data-headlessui-state"]=g.join(" "))}if(o===h.Fragment&&Object.keys(zy(l)).length>0){if(!h.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(m=>` - ${m}`).join(`
|
345
|
+
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(m=>` - ${m}`).join(`
|
346
|
+
`)].join(`
|
347
|
+
`));let p=u.props,g=typeof(p==null?void 0:p.className)=="function"?(...m)=>Ah(p==null?void 0:p.className(...m),l.className):Ah(p==null?void 0:p.className,l.className),y=g?{className:g}:{};return h.cloneElement(u,Object.assign({},CD(u.props,zy(_g(l,["ref"]))),f,c,{ref:s(u.ref,c.ref)},y))}return h.createElement(o,Object.assign({},_g(l,["ref"]),o!==h.Fragment&&c,o!==h.Fragment&&f),u)}function pQ(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function CD(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let s in r)s.startsWith("on")&&typeof r[s]=="function"?(n[s]!=null||(n[s]=[]),n[s].push(r[s])):t[s]=r[s];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](s,...o){let i=n[r];for(let a of i){if((s instanceof Event||(s==null?void 0:s.nativeEvent)instanceof Event)&&s.defaultPrevented)return;a(s,...o)}}});return t}function on(e){var t;return Object.assign(h.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function zy(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function _g(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let mQ="div";var Hu=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Hu||{});function gQ(e,t){var n;let{features:r=1,...s}=e,o={ref:t,"aria-hidden":(r&2)===2?!0:(n=s["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return mn({ourProps:o,theirProps:s,slot:{},defaultTag:mQ,name:"Hidden"})}let $h=on(gQ),S0=h.createContext(null);S0.displayName="OpenClosedContext";var dn=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(dn||{});function Xp(){return h.useContext(S0)}function TD({value:e,children:t}){return ce.createElement(S0.Provider,{value:e},t)}function vQ(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}let wo=[];vQ(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&wo[0]!==t.target&&(wo.unshift(t.target),wo=wo.filter(n=>n!=null&&n.isConnected),wo.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function RD(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&yQ(n)?!1:r}function yQ(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}function bQ(e){throw new Error("Unexpected object: "+e)}var Wn=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Wn||{});function xQ(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),s=r??-1;switch(e.focus){case 0:{for(let o=0;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 1:{for(let o=s-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 2:{for(let o=s+1;o<n.length;++o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 3:{for(let o=n.length-1;o>=0;--o)if(!t.resolveDisabled(n[o],o,n))return o;return r}case 4:{for(let o=0;o<n.length;++o)if(t.resolveId(n[o],o,n)===e.id)return o;return r}case 5:return null;default:bQ(e)}}function ND(e={},t=null,n=[]){for(let[r,s]of Object.entries(e))jD(n,PD(t,r),s);return n}function PD(e,t){return e?e+"["+t+"]":t}function jD(e,t,n){if(Array.isArray(n))for(let[r,s]of n.entries())jD(e,PD(t,r.toString()),s);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):ND(n,t,e)}var Gt=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Gt||{});function AD(e,t,n,r){let s=Mr(n);h.useEffect(()=>{e=e??window;function o(i){s.current(i)}return e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r)},[e,t,r])}function xd(){let e=h.useRef(!1);return Qt(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function $D(e){let t=Ve(e),n=h.useRef(!1);h.useEffect(()=>(n.current=!1,()=>{n.current=!0,Zp(()=>{n.current&&t()})}),[t])}var Xc=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Xc||{});function wQ(){let e=h.useRef(0);return _D("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function DD(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}let _Q="div";var kD=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(kD||{});function EQ(e,t){let n=h.useRef(null),r=Sn(n,t),{initialFocus:s,containers:o,features:i=30,...a}=e;oc()||(i=1);let l=bd(n);TQ({ownerDocument:l},!!(i&16));let c=RQ({ownerDocument:l,container:n,initialFocus:s},!!(i&2));NQ({ownerDocument:l,container:n,containers:o,previousActiveElement:c},!!(i&8));let u=wQ(),f=Ve(m=>{let v=n.current;v&&(b=>b())(()=>{kt(u.current,{[Xc.Forwards]:()=>{fu(v,ji.First,{skipElements:[m.relatedTarget]})},[Xc.Backwards]:()=>{fu(v,ji.Last,{skipElements:[m.relatedTarget]})}})})}),p=ga(),g=h.useRef(!1),y={ref:r,onKeyDown(m){m.key=="Tab"&&(g.current=!0,p.requestAnimationFrame(()=>{g.current=!1}))},onBlur(m){let v=DD(o);n.current instanceof HTMLElement&&v.add(n.current);let b=m.relatedTarget;b instanceof HTMLElement&&b.dataset.headlessuiFocusGuard!=="true"&&(OD(v,b)||(g.current?fu(n.current,kt(u.current,{[Xc.Forwards]:()=>ji.Next,[Xc.Backwards]:()=>ji.Previous})|ji.WrapAround,{relativeTo:m.target}):m.target instanceof HTMLElement&&Bo(m.target)))}};return ce.createElement(ce.Fragment,null,!!(i&4)&&ce.createElement($h,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:Hu.Focusable}),mn({ourProps:y,theirProps:a,defaultTag:_Q,name:"FocusTrap"}),!!(i&4)&&ce.createElement($h,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:f,features:Hu.Focusable}))}let SQ=on(EQ),Nc=Object.assign(SQ,{features:kD});function CQ(e=!0){let t=h.useRef(wo.slice());return E0(([n],[r])=>{r===!0&&n===!1&&Zp(()=>{t.current.splice(0)}),r===!1&&n===!0&&(t.current=wo.slice())},[e,wo,t]),Ve(()=>{var n;return(n=t.current.find(r=>r!=null&&r.isConnected))!=null?n:null})}function TQ({ownerDocument:e},t){let n=CQ(t);E0(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Bo(n())},[t]),$D(()=>{t&&Bo(n())})}function RQ({ownerDocument:e,container:t,initialFocus:n},r){let s=h.useRef(null),o=xd();return E0(()=>{if(!r)return;let i=t.current;i&&Zp(()=>{if(!o.current)return;let a=e==null?void 0:e.activeElement;if(n!=null&&n.current){if((n==null?void 0:n.current)===a){s.current=a;return}}else if(i.contains(a)){s.current=a;return}n!=null&&n.current?Bo(n.current):fu(i,ji.First)===yD.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),s.current=e==null?void 0:e.activeElement})},[r]),s}function NQ({ownerDocument:e,container:t,containers:n,previousActiveElement:r},s){let o=xd();AD(e==null?void 0:e.defaultView,"focus",i=>{if(!s||!o.current)return;let a=DD(n);t.current instanceof HTMLElement&&a.add(t.current);let l=r.current;if(!l)return;let c=i.target;c&&c instanceof HTMLElement?OD(a,c)?(r.current=c,Bo(c)):(i.preventDefault(),i.stopPropagation(),Bo(l)):Bo(r.current)},!0)}function OD(e,t){for(let n of e)if(n.contains(t))return!0;return!1}let MD=h.createContext(!1);function PQ(){return h.useContext(MD)}function Wy(e){return ce.createElement(MD.Provider,{value:e.force},e.children)}function jQ(e){let t=PQ(),n=h.useContext(ID),r=bd(e),[s,o]=h.useState(()=>{if(!t&&n!==null||Vs.isServer)return null;let i=r==null?void 0:r.getElementById("headlessui-portal-root");if(i)return i;if(r===null)return null;let a=r.createElement("div");return a.setAttribute("id","headlessui-portal-root"),r.body.appendChild(a)});return h.useEffect(()=>{s!==null&&(r!=null&&r.body.contains(s)||r==null||r.body.appendChild(s))},[s,r]),h.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),s}let AQ=h.Fragment;function $Q(e,t){let n=e,r=h.useRef(null),s=Sn(fQ(u=>{r.current=u}),t),o=bd(r),i=jQ(r),[a]=h.useState(()=>{var u;return Vs.isServer?null:(u=o==null?void 0:o.createElement("div"))!=null?u:null}),l=h.useContext(qy),c=oc();return Qt(()=>{!i||!a||i.contains(a)||(a.setAttribute("data-headlessui-portal",""),i.appendChild(a))},[i,a]),Qt(()=>{if(a&&l)return l.register(a)},[l,a]),$D(()=>{var u;!i||!a||(a instanceof Node&&i.contains(a)&&i.removeChild(a),i.childNodes.length<=0&&((u=i.parentElement)==null||u.removeChild(i)))}),c?!i||!a?null:Cr.createPortal(mn({ourProps:{ref:s},theirProps:n,defaultTag:AQ,name:"Portal"}),a):null}let DQ=h.Fragment,ID=h.createContext(null);function kQ(e,t){let{target:n,...r}=e,s={ref:Sn(t)};return ce.createElement(ID.Provider,{value:n},mn({ourProps:s,theirProps:r,defaultTag:DQ,name:"Popover.Group"}))}let qy=h.createContext(null);function OQ(){let e=h.useContext(qy),t=h.useRef([]),n=Ve(o=>(t.current.push(o),e&&e.register(o),()=>r(o))),r=Ve(o=>{let i=t.current.indexOf(o);i!==-1&&t.current.splice(i,1),e&&e.unregister(o)}),s=h.useMemo(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,h.useMemo(()=>function({children:o}){return ce.createElement(qy.Provider,{value:s},o)},[s])]}let MQ=on($Q),IQ=on(kQ),Hy=Object.assign(MQ,{Group:IQ});function FQ(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const LQ=typeof Object.is=="function"?Object.is:FQ,{useState:UQ,useEffect:BQ,useLayoutEffect:VQ,useDebugValue:zQ}=qs;function WQ(e,t,n){const r=t(),[{inst:s},o]=UQ({inst:{value:r,getSnapshot:t}});return VQ(()=>{s.value=r,s.getSnapshot=t,Eg(s)&&o({inst:s})},[e,r,t]),BQ(()=>(Eg(s)&&o({inst:s}),e(()=>{Eg(s)&&o({inst:s})})),[e]),zQ(r),r}function Eg(e){const t=e.getSnapshot,n=e.value;try{const r=t();return!LQ(n,r)}catch{return!0}}function qQ(e,t,n){return t()}const HQ=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",GQ=!HQ,KQ=GQ?qQ:WQ,YQ="useSyncExternalStore"in qs?(e=>e.useSyncExternalStore)(qs):KQ;function ZQ(e){return YQ(e.subscribe,e.getSnapshot,e.getSnapshot)}function QQ(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(s){return r.add(s),()=>r.delete(s)},dispatch(s,...o){let i=t[s].call(n,...o);i&&(n=i,r.forEach(a=>a()))}}}function XQ(){let e;return{before({doc:t}){var n;let r=t.documentElement;e=((n=t.defaultView)!=null?n:window).innerWidth-r.clientWidth},after({doc:t,d:n}){let r=t.documentElement,s=r.clientWidth-r.offsetWidth,o=e-s;n.style(r,"paddingRight",`${o}px`)}}}function JQ(){return wD()?{before({doc:e,d:t,meta:n}){function r(s){return n.containers.flatMap(o=>o()).some(o=>o.contains(s))}t.microTask(()=>{var s;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let a=Br();a.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>a.dispose()))}let o=(s=window.scrollY)!=null?s:window.pageYOffset,i=null;t.addEventListener(e,"click",a=>{if(a.target instanceof HTMLElement)try{let l=a.target.closest("a");if(!l)return;let{hash:c}=new URL(l.href),u=e.querySelector(c);u&&!r(u)&&(i=u)}catch{}},!0),t.addEventListener(e,"touchstart",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let l=a.target;for(;l.parentElement&&r(l.parentElement);)l=l.parentElement;t.style(l,"overscrollBehavior","contain")}else t.style(a.target,"touchAction","none")}),t.addEventListener(e,"touchmove",a=>{if(a.target instanceof HTMLElement)if(r(a.target)){let l=a.target;for(;l.parentElement&&l.dataset.headlessuiPortal!==""&&!(l.scrollHeight>l.clientHeight||l.scrollWidth>l.clientWidth);)l=l.parentElement;l.dataset.headlessuiPortal===""&&a.preventDefault()}else a.preventDefault()},{passive:!1}),t.add(()=>{var a;let l=(a=window.scrollY)!=null?a:window.pageYOffset;o!==l&&window.scrollTo(0,o),i&&i.isConnected&&(i.scrollIntoView({block:"nearest"}),i=null)})})}}:{}}function eX(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function tX(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Mi=QQ(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Br(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:tX(n)},s=[JQ(),XQ(),eX()];s.forEach(({before:o})=>o==null?void 0:o(r)),s.forEach(({after:o})=>o==null?void 0:o(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Mi.subscribe(()=>{let e=Mi.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",s=n.count!==0;(s&&!r||!s&&r)&&Mi.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Mi.dispatch("TEARDOWN",n)}});function nX(e,t,n){let r=ZQ(Mi),s=e?r.get(e):void 0,o=s?s.count>0:!1;return Qt(()=>{if(!(!e||!t))return Mi.dispatch("PUSH",e,n),()=>Mi.dispatch("POP",e,n)},[t,e]),o}let Sg=new Map,Pc=new Map;function P1(e,t=!0){Qt(()=>{var n;if(!t)return;let r=typeof e=="function"?e():e.current;if(!r)return;function s(){var i;if(!r)return;let a=(i=Pc.get(r))!=null?i:1;if(a===1?Pc.delete(r):Pc.set(r,a-1),a!==1)return;let l=Sg.get(r);l&&(l["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",l["aria-hidden"]),r.inert=l.inert,Sg.delete(r))}let o=(n=Pc.get(r))!=null?n:0;return Pc.set(r,o+1),o!==0||(Sg.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),s},[e,t])}function rX({defaultContainers:e=[],portals:t,mainTreeNodeRef:n}={}){var r;let s=h.useRef((r=n==null?void 0:n.current)!=null?r:null),o=bd(s),i=Ve(()=>{var a,l,c;let u=[];for(let f of e)f!==null&&(f instanceof HTMLElement?u.push(f):"current"in f&&f.current instanceof HTMLElement&&u.push(f.current));if(t!=null&&t.current)for(let f of t.current)u.push(f);for(let f of(a=o==null?void 0:o.querySelectorAll("html > *, body > *"))!=null?a:[])f!==document.body&&f!==document.head&&f instanceof HTMLElement&&f.id!=="headlessui-portal-root"&&(f.contains(s.current)||f.contains((c=(l=s.current)==null?void 0:l.getRootNode())==null?void 0:c.host)||u.some(p=>f.contains(p))||u.push(f));return u});return{resolveContainers:i,contains:Ve(a=>i().some(l=>l.contains(a))),mainTreeNodeRef:s,MainTreeNode:h.useMemo(()=>function(){return n!=null?null:ce.createElement($h,{features:Hu.Hidden,ref:s})},[s,n])}}let C0=h.createContext(()=>{});C0.displayName="StackContext";var Gy=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Gy||{});function sX(){return h.useContext(C0)}function oX({children:e,onUpdate:t,type:n,element:r,enabled:s}){let o=sX(),i=Ve((...a)=>{t==null||t(...a),o(...a)});return Qt(()=>{let a=s===void 0||s===!0;return a&&i(0,n,r),()=>{a&&i(1,n,r)}},[i,n,r,s]),ce.createElement(C0.Provider,{value:i},e)}let FD=h.createContext(null);function LD(){let e=h.useContext(FD);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,LD),t}return e}function iX(){let[e,t]=h.useState([]);return[e.length>0?e.join(" "):void 0,h.useMemo(()=>function(n){let r=Ve(o=>(t(i=>[...i,o]),()=>t(i=>{let a=i.slice(),l=a.indexOf(o);return l!==-1&&a.splice(l,1),a}))),s=h.useMemo(()=>({register:r,slot:n.slot,name:n.name,props:n.props}),[r,n.slot,n.name,n.props]);return ce.createElement(FD.Provider,{value:s},n.children)},[t])]}let aX="p";function lX(e,t){let n=_s(),{id:r=`headlessui-description-${n}`,...s}=e,o=LD(),i=Sn(t);Qt(()=>o.register(r),[r,o.register]);let a={ref:i,...o.props,id:r};return mn({ourProps:a,theirProps:s,slot:o.slot||{},defaultTag:aX,name:o.name||"Description"})}let cX=on(lX),uX=Object.assign(cX,{});var dX=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(dX||{}),fX=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(fX||{});let hX={0(e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Dh=h.createContext(null);Dh.displayName="DialogContext";function wd(e){let t=h.useContext(Dh);if(t===null){let n=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,wd),n}return t}function pX(e,t,n=()=>[document.body]){nX(e,t,r=>{var s;return{containers:[...(s=r.containers)!=null?s:[],n]}})}function mX(e,t){return kt(t.type,hX,e,t)}let gX="div",vX=Ll.RenderStrategy|Ll.Static;function yX(e,t){let n=_s(),{id:r=`headlessui-dialog-${n}`,open:s,onClose:o,initialFocus:i,role:a="dialog",__demoMode:l=!1,...c}=e,[u,f]=h.useState(0),p=h.useRef(!1);a=function(){return a==="dialog"||a==="alertdialog"?a:(p.current||(p.current=!0,console.warn(`Invalid role [${a}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let g=Xp();s===void 0&&g!==null&&(s=(g&dn.Open)===dn.Open);let y=h.useRef(null),m=Sn(y,t),v=bd(y),b=e.hasOwnProperty("open")||g!==null,x=e.hasOwnProperty("onClose");if(!b&&!x)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!b)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!x)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof s!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${s}`);if(typeof o!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${o}`);let w=s?0:1,[_,E]=h.useReducer(mX,{titleId:null,descriptionId:null,panelRef:h.createRef()}),S=Ve(()=>o(!1)),R=Ve(ge=>E({type:0,id:ge})),C=oc()?l?!1:w===0:!1,N=u>1,k=h.useContext(Dh)!==null,[V,L]=OQ(),G={get current(){var ge;return(ge=_.panelRef.current)!=null?ge:y.current}},{resolveContainers:$,mainTreeNodeRef:I,MainTreeNode:j}=rX({portals:V,defaultContainers:[G]}),F=N?"parent":"leaf",O=g!==null?(g&dn.Closing)===dn.Closing:!1,U=k||O?!1:C,Y=h.useCallback(()=>{var ge,ke;return(ke=Array.from((ge=v==null?void 0:v.querySelectorAll("body > *"))!=null?ge:[]).find(Ze=>Ze.id==="headlessui-portal-root"?!1:Ze.contains(I.current)&&Ze instanceof HTMLElement))!=null?ke:null},[I]);P1(Y,U);let ee=N?!0:C,M=h.useCallback(()=>{var ge,ke;return(ke=Array.from((ge=v==null?void 0:v.querySelectorAll("[data-headlessui-portal]"))!=null?ge:[]).find(Ze=>Ze.contains(I.current)&&Ze instanceof HTMLElement))!=null?ke:null},[I]);P1(M,ee),ED($,ge=>{ge.preventDefault(),S()},!(!C||N));let H=!(N||w!==0);AD(v==null?void 0:v.defaultView,"keydown",ge=>{H&&(ge.defaultPrevented||ge.key===Gt.Escape&&(ge.preventDefault(),ge.stopPropagation(),S()))}),pX(v,!(O||w!==0||k),$),h.useEffect(()=>{if(w!==0||!y.current)return;let ge=new ResizeObserver(ke=>{for(let Ze of ke){let lt=Ze.target.getBoundingClientRect();lt.x===0&<.y===0&<.width===0&<.height===0&&S()}});return ge.observe(y.current),()=>ge.disconnect()},[w,y,S]);let[ae,te]=iX(),Re=h.useMemo(()=>[{dialogState:w,close:S,setTitleId:R},_],[w,_,S,R]),Ce=h.useMemo(()=>({open:w===0}),[w]),ue={ref:m,id:r,role:a,"aria-modal":w===0?!0:void 0,"aria-labelledby":_.titleId,"aria-describedby":ae};return ce.createElement(oX,{type:"Dialog",enabled:w===0,element:y,onUpdate:Ve((ge,ke)=>{ke==="Dialog"&&kt(ge,{[Gy.Add]:()=>f(Ze=>Ze+1),[Gy.Remove]:()=>f(Ze=>Ze-1)})})},ce.createElement(Wy,{force:!0},ce.createElement(Hy,null,ce.createElement(Dh.Provider,{value:Re},ce.createElement(Hy.Group,{target:y},ce.createElement(Wy,{force:!1},ce.createElement(te,{slot:Ce,name:"Dialog.Description"},ce.createElement(Nc,{initialFocus:i,containers:$,features:C?kt(F,{parent:Nc.features.RestoreFocus,leaf:Nc.features.All&~Nc.features.FocusLock}):Nc.features.None},ce.createElement(L,null,mn({ourProps:ue,theirProps:c,slot:Ce,defaultTag:gX,features:vX,visible:w===0,name:"Dialog"}))))))))),ce.createElement(j,null))}let bX="div";function xX(e,t){let n=_s(),{id:r=`headlessui-dialog-overlay-${n}`,...s}=e,[{dialogState:o,close:i}]=wd("Dialog.Overlay"),a=Sn(t),l=Ve(u=>{if(u.target===u.currentTarget){if(RD(u.currentTarget))return u.preventDefault();u.preventDefault(),u.stopPropagation(),i()}}),c=h.useMemo(()=>({open:o===0}),[o]);return mn({ourProps:{ref:a,id:r,"aria-hidden":!0,onClick:l},theirProps:s,slot:c,defaultTag:bX,name:"Dialog.Overlay"})}let wX="div";function _X(e,t){let n=_s(),{id:r=`headlessui-dialog-backdrop-${n}`,...s}=e,[{dialogState:o},i]=wd("Dialog.Backdrop"),a=Sn(t);h.useEffect(()=>{if(i.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[i.panelRef]);let l=h.useMemo(()=>({open:o===0}),[o]);return ce.createElement(Wy,{force:!0},ce.createElement(Hy,null,mn({ourProps:{ref:a,id:r,"aria-hidden":!0},theirProps:s,slot:l,defaultTag:wX,name:"Dialog.Backdrop"})))}let EX="div";function SX(e,t){let n=_s(),{id:r=`headlessui-dialog-panel-${n}`,...s}=e,[{dialogState:o},i]=wd("Dialog.Panel"),a=Sn(t,i.panelRef),l=h.useMemo(()=>({open:o===0}),[o]),c=Ve(u=>{u.stopPropagation()});return mn({ourProps:{ref:a,id:r,onClick:c},theirProps:s,slot:l,defaultTag:EX,name:"Dialog.Panel"})}let CX="h2";function TX(e,t){let n=_s(),{id:r=`headlessui-dialog-title-${n}`,...s}=e,[{dialogState:o,setTitleId:i}]=wd("Dialog.Title"),a=Sn(t);h.useEffect(()=>(i(r),()=>i(null)),[r,i]);let l=h.useMemo(()=>({open:o===0}),[o]);return mn({ourProps:{ref:a,id:r},theirProps:s,slot:l,defaultTag:CX,name:"Dialog.Title"})}let RX=on(yX),NX=on(_X),PX=on(SX),jX=on(xX),AX=on(TX),j1=Object.assign(RX,{Backdrop:NX,Panel:PX,Overlay:jX,Title:AX,Description:uX}),A1=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function $1(e){var t,n;let r=(t=e.innerText)!=null?t:"",s=e.cloneNode(!0);if(!(s instanceof HTMLElement))return r;let o=!1;for(let a of s.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))a.remove(),o=!0;let i=o?(n=s.innerText)!=null?n:"":r;return A1.test(i)&&(i=i.replace(A1,"")),i}function $X(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(s=>{let o=document.getElementById(s);if(o){let i=o.getAttribute("aria-label");return typeof i=="string"?i.trim():$1(o).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return $1(e).trim()}function DX(e){let t=h.useRef(""),n=h.useRef("");return Ve(()=>{let r=e.current;if(!r)return"";let s=r.innerText;if(t.current===s)return n.current;let o=$X(r).trim().toLowerCase();return t.current=s,n.current=o,o})}var kX=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(kX||{}),OX=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(OX||{}),MX=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(MX||{}),IX=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.RegisterLabel=7]="RegisterLabel",e))(IX||{});function Cg(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=xD(t(e.options.slice()),o=>o.dataRef.current.domRef.current),s=n?r.indexOf(n):null;return s===-1&&(s=null),{options:r,activeOptionIndex:s}}let FX={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(s=>n(s.dataRef.current.value));return r!==-1&&(t=r),{...e,listboxState:0,activeOptionIndex:t}},2(e,t){var n;if(e.dataRef.current.disabled||e.listboxState===1)return e;let r=Cg(e),s=xQ(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeOptionIndex:s,activationTrigger:(n=t.trigger)!=null?n:1}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),s=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(i=>{var a;return!i.dataRef.current.disabled&&((a=i.dataRef.current.textValue)==null?void 0:a.startsWith(r))}),o=s?e.options.indexOf(s):-1;return o===-1||o===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:o,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=Cg(e,s=>[...s,n]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=Cg(e,r=>{let s=r.findIndex(o=>o.id===t.id);return s!==-1&&r.splice(s,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>({...e,labelId:t.id})},T0=h.createContext(null);T0.displayName="ListboxActionsContext";function _d(e){let t=h.useContext(T0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,_d),n}return t}let R0=h.createContext(null);R0.displayName="ListboxDataContext";function Ed(e){let t=h.useContext(R0);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Ed),n}return t}function LX(e,t){return kt(t.type,FX,e,t)}let UX=h.Fragment;function BX(e,t){let{value:n,defaultValue:r,form:s,name:o,onChange:i,by:a=(H,K)=>H===K,disabled:l=!1,horizontal:c=!1,multiple:u=!1,...f}=e;const p=c?"horizontal":"vertical";let g=Sn(t),[y=u?[]:void 0,m]=rQ(n,i,r),[v,b]=h.useReducer(LX,{dataRef:h.createRef(),listboxState:1,options:[],searchQuery:"",labelId:null,activeOptionIndex:null,activationTrigger:1}),x=h.useRef({static:!1,hold:!1}),w=h.useRef(null),_=h.useRef(null),E=h.useRef(null),S=Ve(typeof a=="string"?(H,K)=>{let ae=a;return(H==null?void 0:H[ae])===(K==null?void 0:K[ae])}:a),R=h.useCallback(H=>kt(C.mode,{1:()=>y.some(K=>S(K,H)),0:()=>S(y,H)}),[y]),C=h.useMemo(()=>({...v,value:y,disabled:l,mode:u?1:0,orientation:p,compare:S,isSelected:R,optionsPropsRef:x,labelRef:w,buttonRef:_,optionsRef:E}),[y,l,u,v]);Qt(()=>{v.dataRef.current=C},[C]),ED([C.buttonRef,C.optionsRef],(H,K)=>{var ae;b({type:1}),_0(K,w0.Loose)||(H.preventDefault(),(ae=C.buttonRef.current)==null||ae.focus())},C.listboxState===0);let N=h.useMemo(()=>({open:C.listboxState===0,disabled:l,value:y}),[C,l,y]),k=Ve(H=>{let K=C.options.find(ae=>ae.id===H);K&&F(K.dataRef.current.value)}),V=Ve(()=>{if(C.activeOptionIndex!==null){let{dataRef:H,id:K}=C.options[C.activeOptionIndex];F(H.current.value),b({type:2,focus:Wn.Specific,id:K})}}),L=Ve(()=>b({type:0})),G=Ve(()=>b({type:1})),$=Ve((H,K,ae)=>H===Wn.Specific?b({type:2,focus:Wn.Specific,id:K,trigger:ae}):b({type:2,focus:H,trigger:ae})),I=Ve((H,K)=>(b({type:5,id:H,dataRef:K}),()=>b({type:6,id:H}))),j=Ve(H=>(b({type:7,id:H}),()=>b({type:7,id:null}))),F=Ve(H=>kt(C.mode,{0(){return m==null?void 0:m(H)},1(){let K=C.value.slice(),ae=K.findIndex(te=>S(te,H));return ae===-1?K.push(H):K.splice(ae,1),m==null?void 0:m(K)}})),O=Ve(H=>b({type:3,value:H})),U=Ve(()=>b({type:4})),Y=h.useMemo(()=>({onChange:F,registerOption:I,registerLabel:j,goToOption:$,closeListbox:G,openListbox:L,selectActiveOption:V,selectOption:k,search:O,clearSearch:U}),[]),ee={ref:g},M=h.useRef(null),Q=ga();return h.useEffect(()=>{M.current&&r!==void 0&&Q.addEventListener(M.current,"reset",()=>{m==null||m(r)})},[M,m]),ce.createElement(T0.Provider,{value:Y},ce.createElement(R0.Provider,{value:C},ce.createElement(TD,{value:kt(C.listboxState,{0:dn.Open,1:dn.Closed})},o!=null&&y!=null&&ND({[o]:y}).map(([H,K],ae)=>ce.createElement($h,{features:Hu.Hidden,ref:ae===0?te=>{var Re;M.current=(Re=te==null?void 0:te.closest("form"))!=null?Re:null}:void 0,...zy({key:H,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:s,disabled:l,name:H,value:K})})),mn({ourProps:ee,theirProps:f,slot:N,defaultTag:UX,name:"Listbox"}))))}let VX="button";function zX(e,t){var n;let r=_s(),{id:s=`headlessui-listbox-button-${r}`,...o}=e,i=Ed("Listbox.Button"),a=_d("Listbox.Button"),l=Sn(i.buttonRef,t),c=ga(),u=Ve(v=>{switch(v.key){case Gt.Space:case Gt.Enter:case Gt.ArrowDown:v.preventDefault(),a.openListbox(),c.nextFrame(()=>{i.value||a.goToOption(Wn.First)});break;case Gt.ArrowUp:v.preventDefault(),a.openListbox(),c.nextFrame(()=>{i.value||a.goToOption(Wn.Last)});break}}),f=Ve(v=>{switch(v.key){case Gt.Space:v.preventDefault();break}}),p=Ve(v=>{if(RD(v.currentTarget))return v.preventDefault();i.listboxState===0?(a.closeListbox(),c.nextFrame(()=>{var b;return(b=i.buttonRef.current)==null?void 0:b.focus({preventScroll:!0})})):(v.preventDefault(),a.openListbox())}),g=vD(()=>{if(i.labelId)return[i.labelId,s].join(" ")},[i.labelId,s]),y=h.useMemo(()=>({open:i.listboxState===0,disabled:i.disabled,value:i.value}),[i]),m={ref:l,id:s,type:dQ(e,i.buttonRef),"aria-haspopup":"listbox","aria-controls":(n=i.optionsRef.current)==null?void 0:n.id,"aria-expanded":i.listboxState===0,"aria-labelledby":g,disabled:i.disabled,onKeyDown:u,onKeyUp:f,onClick:p};return mn({ourProps:m,theirProps:o,slot:y,defaultTag:VX,name:"Listbox.Button"})}let WX="label";function qX(e,t){let n=_s(),{id:r=`headlessui-listbox-label-${n}`,...s}=e,o=Ed("Listbox.Label"),i=_d("Listbox.Label"),a=Sn(o.labelRef,t);Qt(()=>i.registerLabel(r),[r]);let l=Ve(()=>{var u;return(u=o.buttonRef.current)==null?void 0:u.focus({preventScroll:!0})}),c=h.useMemo(()=>({open:o.listboxState===0,disabled:o.disabled}),[o]);return mn({ourProps:{ref:a,id:r,onClick:l},theirProps:s,slot:c,defaultTag:WX,name:"Listbox.Label"})}let HX="ul",GX=Ll.RenderStrategy|Ll.Static;function KX(e,t){var n;let r=_s(),{id:s=`headlessui-listbox-options-${r}`,...o}=e,i=Ed("Listbox.Options"),a=_d("Listbox.Options"),l=Sn(i.optionsRef,t),c=ga(),u=ga(),f=Xp(),p=f!==null?(f&dn.Open)===dn.Open:i.listboxState===0;h.useEffect(()=>{var b;let x=i.optionsRef.current;x&&i.listboxState===0&&x!==((b=Qp(x))==null?void 0:b.activeElement)&&x.focus({preventScroll:!0})},[i.listboxState,i.optionsRef]);let g=Ve(b=>{switch(u.dispose(),b.key){case Gt.Space:if(i.searchQuery!=="")return b.preventDefault(),b.stopPropagation(),a.search(b.key);case Gt.Enter:if(b.preventDefault(),b.stopPropagation(),i.activeOptionIndex!==null){let{dataRef:x}=i.options[i.activeOptionIndex];a.onChange(x.current.value)}i.mode===0&&(a.closeListbox(),Br().nextFrame(()=>{var x;return(x=i.buttonRef.current)==null?void 0:x.focus({preventScroll:!0})}));break;case kt(i.orientation,{vertical:Gt.ArrowDown,horizontal:Gt.ArrowRight}):return b.preventDefault(),b.stopPropagation(),a.goToOption(Wn.Next);case kt(i.orientation,{vertical:Gt.ArrowUp,horizontal:Gt.ArrowLeft}):return b.preventDefault(),b.stopPropagation(),a.goToOption(Wn.Previous);case Gt.Home:case Gt.PageUp:return b.preventDefault(),b.stopPropagation(),a.goToOption(Wn.First);case Gt.End:case Gt.PageDown:return b.preventDefault(),b.stopPropagation(),a.goToOption(Wn.Last);case Gt.Escape:return b.preventDefault(),b.stopPropagation(),a.closeListbox(),c.nextFrame(()=>{var x;return(x=i.buttonRef.current)==null?void 0:x.focus({preventScroll:!0})});case Gt.Tab:b.preventDefault(),b.stopPropagation();break;default:b.key.length===1&&(a.search(b.key),u.setTimeout(()=>a.clearSearch(),350));break}}),y=vD(()=>{var b;return(b=i.buttonRef.current)==null?void 0:b.id},[i.buttonRef.current]),m=h.useMemo(()=>({open:i.listboxState===0}),[i]),v={"aria-activedescendant":i.activeOptionIndex===null||(n=i.options[i.activeOptionIndex])==null?void 0:n.id,"aria-multiselectable":i.mode===1?!0:void 0,"aria-labelledby":y,"aria-orientation":i.orientation,id:s,onKeyDown:g,role:"listbox",tabIndex:0,ref:l};return mn({ourProps:v,theirProps:o,slot:m,defaultTag:HX,features:GX,visible:p,name:"Listbox.Options"})}let YX="li";function ZX(e,t){let n=_s(),{id:r=`headlessui-listbox-option-${n}`,disabled:s=!1,value:o,...i}=e,a=Ed("Listbox.Option"),l=_d("Listbox.Option"),c=a.activeOptionIndex!==null?a.options[a.activeOptionIndex].id===r:!1,u=a.isSelected(o),f=h.useRef(null),p=DX(f),g=Mr({disabled:s,value:o,domRef:f,get textValue(){return p()}}),y=Sn(t,f);Qt(()=>{if(a.listboxState!==0||!c||a.activationTrigger===0)return;let S=Br();return S.requestAnimationFrame(()=>{var R,C;(C=(R=f.current)==null?void 0:R.scrollIntoView)==null||C.call(R,{block:"nearest"})}),S.dispose},[f,c,a.listboxState,a.activationTrigger,a.activeOptionIndex]),Qt(()=>l.registerOption(r,g),[g,r]);let m=Ve(S=>{if(s)return S.preventDefault();l.onChange(o),a.mode===0&&(l.closeListbox(),Br().nextFrame(()=>{var R;return(R=a.buttonRef.current)==null?void 0:R.focus({preventScroll:!0})}))}),v=Ve(()=>{if(s)return l.goToOption(Wn.Nothing);l.goToOption(Wn.Specific,r)}),b=hQ(),x=Ve(S=>b.update(S)),w=Ve(S=>{b.wasMoved(S)&&(s||c||l.goToOption(Wn.Specific,r,0))}),_=Ve(S=>{b.wasMoved(S)&&(s||c&&l.goToOption(Wn.Nothing))}),E=h.useMemo(()=>({active:c,selected:u,disabled:s}),[c,u,s]);return mn({ourProps:{id:r,ref:y,role:"option",tabIndex:s===!0?void 0:-1,"aria-disabled":s===!0?!0:void 0,"aria-selected":u,disabled:void 0,onClick:m,onFocus:v,onPointerEnter:x,onMouseEnter:x,onPointerMove:w,onMouseMove:w,onPointerLeave:_,onMouseLeave:_},theirProps:i,slot:E,defaultTag:YX,name:"Listbox.Option"})}let QX=on(BX),XX=on(zX),JX=on(qX),eJ=on(KX),tJ=on(ZX),jc=Object.assign(QX,{Button:XX,Label:JX,Options:eJ,Option:tJ});function nJ(e=0){let[t,n]=h.useState(e),r=xd(),s=h.useCallback(l=>{r.current&&n(c=>c|l)},[t,r]),o=h.useCallback(l=>!!(t&l),[t]),i=h.useCallback(l=>{r.current&&n(c=>c&~l)},[n,r]),a=h.useCallback(l=>{r.current&&n(c=>c^l)},[n]);return{flags:t,addFlag:s,hasFlag:o,removeFlag:i,toggleFlag:a}}function rJ(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Tg(e,...t){e&&t.length>0&&e.classList.add(...t)}function Rg(e,...t){e&&t.length>0&&e.classList.remove(...t)}function sJ(e,t){let n=Br();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:s}=getComputedStyle(e),[o,i]=[r,s].map(l=>{let[c=0]=l.split(",").filter(Boolean).map(u=>u.includes("ms")?parseFloat(u):parseFloat(u)*1e3).sort((u,f)=>f-u);return c}),a=o+i;if(a!==0){n.group(c=>{c.setTimeout(()=>{t(),c.dispose()},a),c.addEventListener(e,"transitionrun",u=>{u.target===u.currentTarget&&c.dispose()})});let l=n.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),l())})}else t();return n.add(()=>t()),n.dispose}function oJ(e,t,n,r){let s=n?"enter":"leave",o=Br(),i=r!==void 0?rJ(r):()=>{};s==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=kt(s,{enter:()=>t.enter,leave:()=>t.leave}),l=kt(s,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=kt(s,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Rg(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Tg(e,...t.base,...a,...c),o.nextFrame(()=>{Rg(e,...t.base,...a,...c),Tg(e,...t.base,...a,...l),sJ(e,()=>(Rg(e,...t.base,...a),Tg(e,...t.base,...t.entered),i()))}),o.dispose}function iJ({immediate:e,container:t,direction:n,classes:r,onStart:s,onStop:o}){let i=xd(),a=ga(),l=Mr(n);Qt(()=>{e&&(l.current="enter")},[e]),Qt(()=>{let c=Br();a.add(c.dispose);let u=t.current;if(u&&l.current!=="idle"&&i.current)return c.dispose(),s.current(l.current),c.add(oJ(u,r.current,l.current==="enter",()=>{c.dispose(),o.current(l.current)})),c.dispose},[n])}function co(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Jp=h.createContext(null);Jp.displayName="TransitionContext";var aJ=(e=>(e.Visible="visible",e.Hidden="hidden",e))(aJ||{});function lJ(){let e=h.useContext(Jp);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function cJ(){let e=h.useContext(em);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let em=h.createContext(null);em.displayName="NestingContext";function tm(e){return"children"in e?tm(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function UD(e,t){let n=Mr(e),r=h.useRef([]),s=xd(),o=ga(),i=Ve((g,y=Mo.Hidden)=>{let m=r.current.findIndex(({el:v})=>v===g);m!==-1&&(kt(y,{[Mo.Unmount](){r.current.splice(m,1)},[Mo.Hidden](){r.current[m].state="hidden"}}),o.microTask(()=>{var v;!tm(r)&&s.current&&((v=n.current)==null||v.call(n))}))}),a=Ve(g=>{let y=r.current.find(({el:m})=>m===g);return y?y.state!=="visible"&&(y.state="visible"):r.current.push({el:g,state:"visible"}),()=>i(g,Mo.Unmount)}),l=h.useRef([]),c=h.useRef(Promise.resolve()),u=h.useRef({enter:[],leave:[],idle:[]}),f=Ve((g,y,m)=>{l.current.splice(0),t&&(t.chains.current[y]=t.chains.current[y].filter(([v])=>v!==g)),t==null||t.chains.current[y].push([g,new Promise(v=>{l.current.push(v)})]),t==null||t.chains.current[y].push([g,new Promise(v=>{Promise.all(u.current[y].map(([b,x])=>x)).then(()=>v())})]),y==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(y)):m(y)}),p=Ve((g,y,m)=>{Promise.all(u.current[y].splice(0).map(([v,b])=>b)).then(()=>{var v;(v=l.current.shift())==null||v()}).then(()=>m(y))});return h.useMemo(()=>({children:r,register:a,unregister:i,onStart:f,onStop:p,wait:c,chains:u}),[a,i,r,f,p,u,c])}function uJ(){}let dJ=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function D1(e){var t;let n={};for(let r of dJ)n[r]=(t=e[r])!=null?t:uJ;return n}function fJ(e){let t=h.useRef(D1(e));return h.useEffect(()=>{t.current=D1(e)},[e]),t}let hJ="div",BD=Ll.RenderStrategy;function pJ(e,t){var n,r;let{beforeEnter:s,afterEnter:o,beforeLeave:i,afterLeave:a,enter:l,enterFrom:c,enterTo:u,entered:f,leave:p,leaveFrom:g,leaveTo:y,...m}=e,v=h.useRef(null),b=Sn(v,t),x=(n=m.unmount)==null||n?Mo.Unmount:Mo.Hidden,{show:w,appear:_,initial:E}=lJ(),[S,R]=h.useState(w?"visible":"hidden"),C=cJ(),{register:N,unregister:k}=C;h.useEffect(()=>N(v),[N,v]),h.useEffect(()=>{if(x===Mo.Hidden&&v.current){if(w&&S!=="visible"){R("visible");return}return kt(S,{hidden:()=>k(v),visible:()=>N(v)})}},[S,v,N,k,w,x]);let V=Mr({base:co(m.className),enter:co(l),enterFrom:co(c),enterTo:co(u),entered:co(f),leave:co(p),leaveFrom:co(g),leaveTo:co(y)}),L=fJ({beforeEnter:s,afterEnter:o,beforeLeave:i,afterLeave:a}),G=oc();h.useEffect(()=>{if(G&&S==="visible"&&v.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,S,G]);let $=E&&!_,I=_&&w&&E,j=!G||$?"idle":w?"enter":"leave",F=nJ(0),O=Ve(H=>kt(H,{enter:()=>{F.addFlag(dn.Opening),L.current.beforeEnter()},leave:()=>{F.addFlag(dn.Closing),L.current.beforeLeave()},idle:()=>{}})),U=Ve(H=>kt(H,{enter:()=>{F.removeFlag(dn.Opening),L.current.afterEnter()},leave:()=>{F.removeFlag(dn.Closing),L.current.afterLeave()},idle:()=>{}})),Y=UD(()=>{R("hidden"),k(v)},C),ee=h.useRef(!1);iJ({immediate:I,container:v,classes:V,direction:j,onStart:Mr(H=>{ee.current=!0,Y.onStart(v,H,O)}),onStop:Mr(H=>{ee.current=!1,Y.onStop(v,H,U),H==="leave"&&!tm(Y)&&(R("hidden"),k(v))})});let M=m,Q={ref:b};return I?M={...M,className:Ah(m.className,...V.current.enter,...V.current.enterFrom)}:ee.current&&(M.className=Ah(m.className,(r=v.current)==null?void 0:r.className),M.className===""&&delete M.className),ce.createElement(em.Provider,{value:Y},ce.createElement(TD,{value:kt(S,{visible:dn.Open,hidden:dn.Closed})|F.flags},mn({ourProps:Q,theirProps:M,defaultTag:hJ,features:BD,visible:S==="visible",name:"Transition.Child"})))}function mJ(e,t){let{show:n,appear:r=!1,unmount:s=!0,...o}=e,i=h.useRef(null),a=Sn(i,t);oc();let l=Xp();if(n===void 0&&l!==null&&(n=(l&dn.Open)===dn.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=h.useState(n?"visible":"hidden"),f=UD(()=>{u("hidden")}),[p,g]=h.useState(!0),y=h.useRef([n]);Qt(()=>{p!==!1&&y.current[y.current.length-1]!==n&&(y.current.push(n),g(!1))},[y,n]);let m=h.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);h.useEffect(()=>{if(n)u("visible");else if(!tm(f))u("hidden");else{let w=i.current;if(!w)return;let _=w.getBoundingClientRect();_.x===0&&_.y===0&&_.width===0&&_.height===0&&u("hidden")}},[n,f]);let v={unmount:s},b=Ve(()=>{var w;p&&g(!1),(w=e.beforeEnter)==null||w.call(e)}),x=Ve(()=>{var w;p&&g(!1),(w=e.beforeLeave)==null||w.call(e)});return ce.createElement(em.Provider,{value:f},ce.createElement(Jp.Provider,{value:m},mn({ourProps:{...v,as:h.Fragment,children:ce.createElement(VD,{ref:a,...v,...o,beforeEnter:b,beforeLeave:x})},theirProps:{},defaultTag:h.Fragment,features:BD,visible:c==="visible",name:"Transition"})))}function gJ(e,t){let n=h.useContext(Jp)!==null,r=Xp()!==null;return ce.createElement(ce.Fragment,null,!n&&r?ce.createElement(Ky,{ref:t,...e}):ce.createElement(VD,{ref:t,...e}))}let Ky=on(mJ),VD=on(pJ),vJ=on(gJ),hu=Object.assign(Ky,{Child:vJ,Root:Ky});const ic=({children:e,onClose:t,isOpen:n,maxWidth:r="max-w-lg",background:s="bg-white"})=>d.jsx(hu.Root,{show:n,appear:!0,as:"div",children:d.jsx(j1,{as:"div",className:"fixed z-30 inset-0 overflow-y-auto",onClose:()=>{t(!1)},children:d.jsxs("div",{className:"flex items-end justify-center min-h-screen max-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[d.jsx(hu.Child,{as:"div",enter:"ease-out duration-400",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-300",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:d.jsx(j1.Overlay,{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})}),d.jsx("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),d.jsx(hu.Child,{as:h.Fragment,enter:"ease-out duration-400",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-300",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:d.jsxs("div",{className:`inline-block align-bottom ${s} rounded-lg px-4 pt-5 pb-4 text-left shadow-xl transform transition-all sm:my-8 sm:align-middle ${r} sm:w-full sm:p-6 max-h-screen`,children:[d.jsx("div",{className:"hidden sm:block absolute top-0 right-0 pt-4 pr-4",children:d.jsxs("button",{type:"button",className:`${s} rounded-md text-gray-400 hover:text-gray-500`,onClick:()=>t(!1),children:[d.jsx("span",{className:"sr-only",children:"Close"}),d.jsx(aa,{className:"h-6 w-6","aria-hidden":"true"})]})}),e]})})]})})}),yJ=({customDomain:e})=>{const[t,n]=h.useState(void 0),r=()=>{o(),n(void 0)},[s,o]=ls(()=>{var a;return d.jsx(ic,{onClose:r,isOpen:!0,children:d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"text-xl font-medium",children:"Configure your custom domain"}),e.provider==="custom"?d.jsx(JZ,{}):d.jsx(Sj,{customDomain:t==null?void 0:t.hostname,cname:((a=t==null?void 0:t.deployments.at(0))==null?void 0:a.cname)??""})]})})},[t]),i=a=>{n(a),s()};return d.jsx(Fe,{onClick:()=>{i(e)},"data-test":"view-domain-configuration-btn",title:"View Configuration",variant:"ghost",size:"icon",children:d.jsx(hV,{size:18})})},Ul=({message:e,className:t})=>d.jsx(hu,{show:e!==""&&e!==null,enter:"transform ease-out duration-300 transition",enterFrom:"translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2",enterTo:"translate-y-0 opacity-100 sm:translate-x-0",leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",className:Fs("bg-pink-100 rounded-md p-5",t),children:d.jsx("span",{className:"text-sm text-gray-500",children:e})}),bJ=({account:e,currentDomainConfig:t})=>{const{logEvent:n}=ft(),[r,s]=h.useState(""),[o,i]=h.useState(""),a=g=>{const y=g.target.value;s(y)},l=UY(),c=async()=>{var g;try{if(i(""),!t.hostname||t.hostname.trim()===""){i("The current domain configuration does not have a hostname associated with it");return}await l.mutateAsync({accountName:e.name,projectName:t.projectName??"",hostname:t.hostname,deploymentName:(g=t.deployments[0])==null?void 0:g.deploymentName}),n("account-custom-domain-delete-success",{account:e.name}),u()}catch(y){On(y);const m=hn(y);i(m),n("account-custom-domain-delete-failed",{account:e.name,error:m})}},u=()=>{p(),s(""),i("")},[f,p]=ls(()=>d.jsx(ic,{onClose:u,isOpen:!0,maxWidth:"max-w-xl",children:d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"text-xl font-medium",children:"Delete custom domain"}),d.jsx(Ul,{message:o,className:"mb-3"}),d.jsxs("div",{className:"text-sm text-gray-800 whitespace-pre-line w-full mb-2",children:[d.jsxs("div",{className:"relative bg-yellow-100 rounded p-4 text-yellow-900 text-sm whitespace-pre-line w-full mb-2",children:[d.jsxs("div",{className:"flex space-x-2 items-center",children:[d.jsx(cp,{className:"h-5 w-5 text-yellow-900"}),d.jsx("span",{className:"text-sm font-medium antialiased mt-0.5",children:"Caution: Your project will no longer be accessible with this domain."})]}),d.jsxs("p",{className:"px-2 mt-4",children:["You are about to delete the custom domain"," ",d.jsx("span",{className:"font-medium antialiased",children:t.hostname})," ","from your project. Requests using it will no longer reach your zup."]})]}),d.jsx("br",{}),d.jsxs("label",{className:"block mb-2",htmlFor:"hostname-field",children:["Please type"," ",d.jsx("span",{className:"font-medium antialiased",children:t.hostname})," ","to confirm."]}),d.jsx("input",{className:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full text-sm border-gray-300 rounded-md mb-4 placeholder-gray-400 disabled:opacity-50",type:"text",autoComplete:"off",value:r,onChange:a,id:"hostname-field","data-test":"hostname-field"}),d.jsx("div",{className:" text-red-500",children:"I understand the consequences, delete this custom domain"})]}),d.jsxs("div",{className:"mt-5 sm:mt-4 flex justify-end gap-x-4",children:[d.jsx(Fe,{onClick:u,"data-test":"cancel-delete-custom-domain-btn",variant:"white",disabled:l.isPending,children:"Cancel"}),d.jsx(Fe,{"data-test":"delete-custom-domain-btn",onClick:c,disabled:l.isPending||r!==t.hostname,children:d.jsx(ir,{loading:l.isPending,children:"Delete"})})]})]})}),[l.isPending,o,t,r]);return d.jsx(Fe,{type:"button",title:"Delete Custom Domain",onClick:f,"data-test-id":"delete-custom-domain-btn",variant:"ghost",size:"icon-xs",children:d.jsx(ir,{loading:l.isPending,children:d.jsx(dp,{size:18})})})},xJ=/^(?!https?:\/\/)[a-zA-Z0-9.-]*\.[a-zA-Z]+$/,wJ=({account:e,projectName:t,currentDomainConfig:n})=>{var E;const{logEvent:r}=ft(),[s,o]=h.useState(""),[i,a]=h.useState(!1),[l,c]=h.useState((E=n.deployments[0])==null?void 0:E.deploymentName),u=n.hostname,{data:f,error:p}=ec(e.name,t),g=hn(p);h.useEffect(()=>{g&&o(g)},[g]);const y=f?f.filter(S=>S.environmentType!==nr.WORKING_COPY):[],m=LY(),v=async S=>{if(S.preventDefault(),!l||l.trim()===""){o("Please select an environment from the options available");return}if(!u||u.trim()===""){o("Please provide a value on the custom domain field.");return}if(u&&!xJ.test(u)){o("A custom domain value should only be the domain name. It should not start with 'http(s)' and should end with an alpha character.");return}try{o(""),await m.mutateAsync({accountName:e.name,projectName:t,hostname:u,deploymentName:l}),a(!0),r("account-custom-domain-edit-success",{"account-name":e.name})}catch(R){On(R);const C=hn(R);r("account-custom-domain-edit-failed",{"account-name":e.name,error:C}),o(C),a(!1)}},b=()=>{var S;w(),c((S=n.deployments[0])==null?void 0:S.deploymentName),o(""),a(!1)},[x,w]=ls(()=>{var S;return d.jsx(ic,{onClose:b,isOpen:!0,children:d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"text-xl font-medium",children:"Edit your custom domain"}),d.jsx(Ul,{message:s}),d.jsxs("div",{className:"text-left text-sm text-gray-800 whitespace-pre-line w-full mb-2",children:[i===!1&&d.jsxs("form",{onSubmit:v,children:[d.jsx("label",{className:"block mb-2",htmlFor:"environment-field",children:"Which environment do you want to apply your custom domain to ?"}),d.jsxs("select",{className:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full text-sm border-gray-300 rounded-md mb-9 placeholder-gray-400 disabled:opacity-50",value:l,onChange:R=>c(R.target.value),disabled:m.isPending,id:"environment-field","data-test":"environment-field",children:[d.jsx("option",{value:void 0,children:"Select an environment"},"select"),y.map(R=>d.jsxs("option",{value:R.name,selected:R.name===l,children:[R.branchName," - ",R.name]},R.name))]}),d.jsx("label",{className:"block mb-2",htmlFor:"hostname-field",children:"Your custom domain"}),d.jsx("input",{className:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full text-sm border-gray-300 rounded-md mb-9 placeholder-gray-400 disabled:opacity-50",type:"text",autoComplete:"off",placeholder:"api.example.com",id:"hostname-field",value:u,disabled:!0,"data-test":"hostname-field"}),d.jsxs("div",{className:"mt-5 sm:mt-4 flex justify-end gap-x-4",children:[d.jsx(Fe,{variant:"white",type:"button",onClick:b,"data-test":"cancel-edit-custom-domain-btn",disabled:m.isPending,children:"Cancel"}),d.jsx(Fe,{"data-test":"save-edit-custom-domain-btn",type:"submit",disabled:m.isPending||l===((S=n.deployments[0])==null?void 0:S.deploymentName),children:d.jsx(ir,{loading:m.isPending,children:"Save"})})]})]}),i===!0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"text-left text-sm text-gray-800 whitespace-pre-line w-full mb-2",children:d.jsxs("p",{children:["Successfully edited custom domain"," ",d.jsx(xt,{href:`https://${u}`,children:u})," ","to map to deployment ",l]})}),d.jsx("div",{className:"mt-5 sm:mt-4 flex justify-end gap-x-4",children:d.jsx(Fe,{variant:"white",className:"w-24 justify-center",type:"button",onClick:b,"data-test":"ok-edit-custom-domain-btn",disabled:!i,children:"OK"})})]})]})]})})},[y,s]),_=()=>{x()};return d.jsx(Fe,{onClick:()=>_(),title:"Edit Custom Domain","data-test-id":"edit-custom-domain-btn",variant:"ghost",size:"icon-xs",children:d.jsx(ir,{loading:m.isPending,children:d.jsx(rV,{size:18})})})},_J=({classNames:e,projectType:t,feature:n,helpUrl:r})=>{const s=t==="managed-dedicated"?"Managed Dedicated Project":t==="self-hosted"?"Self Hosted Project":"Managed Edge Project",o=t==="managed-dedicated"?"managed dedicated":t==="self-hosted"?"self hosted":"managed edge hosted";return d.jsxs(rn,{variant:"danger",className:e,children:[d.jsx(xs,{children:s}),d.jsx(ws,{className:"flex-1 leading-loose mt-1 text-sm",children:d.jsxs("p",{className:"leading-loose",children:["Your project is running on a ",o," environment. For information on how to setup up ",n,", please refer to"," ",d.jsx(xt,{href:r,children:"the documentation"}),"."]})})]})},EJ=()=>{var a;const e=pn(["account","project"]),{environment:t}=sx(),{account:n}=pn(["account"]),{aliasDomains:r}=n.entitlements,s=BY(e.account.name,e.project.name);if(!s.data)return d.jsx(Ip,{});const o=(a=s.data)==null?void 0:a.filter(l=>l.projectName&&l.projectName===e.project.name&&l.deployments[0]).sort((l,c)=>l.deployments[0].deploymentName.localeCompare(c.deployments[0].deploymentName)),i=e.account.customDomainsInUse>=e.account.entitlements.customDomains;return d.jsxs("div",{className:"flex gap-2 flex-col",children:[d.jsx(cs,{title:"Custom Domains"}),d.jsxs(Sr,{variant:"outline",className:"text-sm",children:[d.jsx(xt,{href:"https://zuplo.com/docs/articles/custom-domains",children:"Custom domains"})," ","allow you to use your own domain name for your API and developer portal. For complex custom domain configurations, please contact us at"," ",d.jsx(xt,{href:`mailto:${Gv}`,children:Gv})," ","or use the chat widget at the bottom right."]}),i&&d.jsx(Sr,{variant:"warning",className:"text-sm",children:"You have reached the limit of custom domains. Please upgrade your account to add more custom domains."}),o.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"my-2 text-sm",children:d.jsxs("p",{children:["This is a list of your deployed environments configured with a custom domain. You can"," ",d.jsx(xt,{href:"https://www.zuplo.com/docs/guides/custom-domain-setup",children:"learn more about custom domains here"}),"."]})}),d.jsxs("div",{className:se("grid text-sm gap-x-6 gap-y-2",r?"grid-cols-[1fr_auto_auto_auto_auto_auto_auto_1fr]":"grid-cols-[1fr_auto_auto_auto_auto_1fr]"),children:[d.jsxs("div",{className:"grid grid-cols-subgrid col-span-full text-muted-foreground border rounded-md p-2 px-4",children:[d.jsx("div",{children:"URL"}),d.jsx("div",{children:"Default"}),r&&d.jsx("div",{children:"Alias"}),d.jsx("div",{children:"Branch"}),d.jsx("div",{children:"Environment"}),d.jsx("div",{children:"Purpose"}),d.jsx("div",{})]}),o.map(l=>{var c,u;return d.jsxs("div",{className:"grid grid-cols-subgrid col-span-full items-center px-4",children:[d.jsx("div",{children:d.jsx(xt,{href:`https://${l.hostname}`,children:l.hostname})}),d.jsx("div",{className:"text-ellipsis overflow-hidden truncate",children:l.deployments[0].isDefault?d.jsx(ia,{size:16}):d.jsx(aa,{size:16})}),r&&d.jsx("div",{className:"text-ellipsis overflow-hidden truncate",children:l.provider==="alias"?d.jsx(ia,{size:16}):d.jsx(aa,{size:16})}),d.jsx("div",{className:"text-ellipsis overflow-hidden truncate",children:(c=l.deployments[0])==null?void 0:c.branch}),d.jsx("div",{className:"text-ellipsis overflow-hidden truncate",children:(u=l.deployments[0])==null?void 0:u.deploymentName}),d.jsx("div",{className:"text-ellipsis overflow-hidden truncate",children:l.deployments[0].stage==="dev-portal"?"Dev Portal":"API"}),d.jsxs("div",{className:"justify-self-end w-max",children:[l.provider!=="alias"&&d.jsx(yJ,{customDomain:l}),l.provider==="custom"?d.jsx(K7,{}):d.jsxs(d.Fragment,{children:[d.jsx(wJ,{account:e.account,projectName:e.project.name,currentDomainConfig:l}),d.jsx(bJ,{account:e.account,currentDomainConfig:l})]})]})]},l.id)})]})]}),e.project.type&&["managed-dedicated","self-hosted"].includes(e.project.type)?d.jsx(_J,{classNames:"mt-5",feature:"custom domains",helpUrl:"https://zuplo.com/docs/dedicated/custom-domains",projectType:e.project.type}):e.account.entitlements.customDomains>0?d.jsx("p",{className:"mt-5",children:d.jsx(XZ,{disabled:i,account:e.account,projectName:e.project.name})}):d.jsx(mj,{accountName:e.account.name,projectName:e.project.name,environmentName:t,featureName:"Custom domains",classNames:"mt-5",navigationSource:"custom-domain"})]})};var Ng={},Pg={},k1;function zD(){return k1||(k1=1,function(e){e.__esModule=!0,e.default=s;var t=/[\u0300-\u036f]/g,n=/ł/g,r=/ñ/g;function s(o){return o.toLowerCase().normalize("NFD").replace(t,"").replace(n,"l").replace(r,"n").trim()}}(Pg)),Pg}var _i={},O1;function M1(){if(O1)return _i;O1=1,_i.__esModule=!0,_i.aggressiveFuzzyMatch=l,_i.createFuzzySearchImpl=p,_i.experimentalSmartFuzzyMatch=c,_i.fuzzyMatchImpl=f;var e=t(zD());function t(g){return g&&g.__esModule?g:{default:g}}var n=Number.MAX_SAFE_INTEGER,r=function(y,m){return y.score-m.score},s=function(y,m){return y[0]-m[0]},o=new Set(` []()-–—'"“”`.split(""));function i(g){return o.has(g)}function a(g,y,m,v,b,x,w){if(g===v)return[0,[[0,g.length-1]]];var _=v.length,E=y.length,S=b.length;if(y===b)return[.1,[[0,E-1]]];if(y.startsWith(b))return[.5,[[0,S-1]]];var R=g.indexOf(v);if(R>-1&&i(g[R-1]))return[.9,[[R,R+_-1]]];var C=y.indexOf(b);if(C>-1&&i(y[C-1]))return[1,[[C,C+_-1]]];var N=x.length;if(N>1&&x.every(function(V){return m.has(V)})){var k=1.5+N*.2;return[k,x.map(function(V){var L=y.indexOf(V);return[L,L+V.length-1]}).sort(s)]}return C>-1?[2,[[C,C+_-1]]]:w==="aggressive"?l(y,b):w==="smart"?c(y,b):null}function l(g,y){for(var m=g.length,v=y.length,b=0,x=y[b],w=[],_=-1,E=-2,S=0;S<m;S+=1)if(g[S]===x){if(S!==E+1&&(_>=0&&w.push([_,E]),_=S),E=S,b+=1,b===v)return w.push([_,E]),u(w,g);x=y[b]}return null}function c(g,y){for(var m=g.length,v=[],b=0,x=y[b],w=-1,_=-2;;){var E=g.indexOf(x,_+1);if(E===-1)break;if(E===0||i(g[E-1]))w=E;else{var S=y.length-b,R=g.length-E,C=Math.min(3,S,R),N=y.slice(b,b+C);if(g.slice(E,E+C)===N)w=E;else{_+=1;continue}}for(_=w;_<m&&g[_]===x;_+=1)b+=1,x=y[b];if(_-=1,v.push([w,_]),b===y.length)return u(v,g)}return null}function u(g,y){var m=2;return g.forEach(function(v){var b=v[0],x=v[1],w=x-b+1,_=b===0||y[b]===" "||y[b-1]===" ",E=x===y.length-1||y[x]===" "||y[x+1]===" ",S=_&&E;S?m+=.2:_?m+=.4:w>=3?m+=.8:m+=1.6}),[m,g]}function f(g,y){var m=(0,e.default)(y),v=m.split(" "),b=(0,e.default)(g),x=new Set(b.split(" ")),w=a(g,b,x,y,m,v,"smart");return w?{item:g,score:w[0],matches:[w[1]]}:null}function p(g,y){var m=y.strategy,v=m===void 0?"aggressive":m,b=y.getText,x=g.map(function(w){var _;if(b)_=b(w);else{var E=y.key?w[y.key]:w;_=[E]}var S=_.map(function(R){var C=R||"",N=(0,e.default)(C),k=new Set(N.split(" "));return[C,N,k]});return[w,S]});return function(w){var _=[],E=(0,e.default)(w),S=E.split(" ");return E.length?(x.forEach(function(R){for(var C=R[0],N=R[1],k=n,V=[],L=0,G=N.length;L<G;L+=1){var $=N[L],I=$[0],j=$[1],F=$[2],O=a(I,j,F,w,E,S,v);O?(k=Math.min(k,O[0]),V.push(O[1])):V.push(null)}k<n&&_.push({item:C,score:k,matches:V})}),_.sort(r),_):[]}}return _i}var I1;function SJ(){return I1||(I1=1,function(e){e.__esModule=!0,e.default=r,e.fuzzyMatch=s;var t=n(zD());e.normalizeText=t.default;function n(o){return o&&o.__esModule?o:{default:o}}function r(o,i){return i===void 0&&(i={}),M1().createFuzzySearchImpl(o,i)}function s(o,i){return M1().fuzzyMatchImpl(o,i)}}(Ng)),Ng}var CJ=SJ();const TJ=Bl(CJ),RJ=(e,t,{getText:n,key:r})=>{const s=TJ([...t],{key:r,getText:n}),o=h.useMemo(()=>e?s(e).map(({item:i})=>i):t,[e,s,t]);return e?o:t},NJ=e=>{const t=document.createRange();return t.selectNodeContents(e),t.getBoundingClientRect().width>e.getBoundingClientRect().width},F1=()=>{const[e,t]=h.useState(!1),n=h.useMemo(()=>{if(!e)return{open:!1}},[e]),r=h.useMemo(()=>({ref:s=>{s&&t(NJ(s))}}),[]);return{tooltipProps:n,triggerProps:r}};function PJ({isSecret:e}){return e?d.jsx(up,{className:"h-4 w-auto"}):d.jsx(Kv,{className:"h-4 w-auto"})}const jJ=tj,AJ=nj,$J=rj,WD=h.forwardRef(({className:e,...t},n)=>d.jsx(jp,{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",e),...t,ref:n}));WD.displayName=jp.displayName;const DJ=Wr("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-75 data-[state=open]:duration-75",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),qD=h.forwardRef(({side:e="right",className:t,children:n,...r},s)=>d.jsxs($J,{children:[d.jsx(WD,{}),d.jsxs(Ap,{ref:s,className:se(DJ({side:e}),t),...r,children:[n,d.jsxs($x,{className:"absolute right-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-secondary",children:[d.jsx(aa,{className:"h-4 w-4"}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));qD.displayName=Ap.displayName;const kJ=h.forwardRef(({className:e,...t},n)=>d.jsx($p,{ref:n,className:se("text-lg font-semibold text-foreground",e),...t}));kJ.displayName=$p.displayName;const OJ=h.forwardRef(({className:e,...t},n)=>d.jsx(Dp,{ref:n,className:se("text-sm text-muted-foreground",e),...t}));OJ.displayName=Dp.displayName;const MJ=({variable:e,asIcon:t=!1})=>d.jsxs(jJ,{children:[d.jsx(AJ,{asChild:!0,children:t?d.jsx(Fe,{variant:"ghost",size:"icon",className:"flex items-center",children:d.jsx(Kv,{className:"w-4 h-4"})}):d.jsxs(Fe,{variant:"secondary",size:"default",className:"flex items-center gap-2",children:[d.jsx(Kv,{className:"w-4 h-4"}),"Get Code Snippet"]})}),d.jsxs(qD,{side:"right",className:"sm:max-w-none w-1/3 min-w-[500px]",children:[d.jsx("div",{className:"text-lg font-semibold border-b",children:"Code Snippets"}),d.jsx("p",{className:"my-2 text-sm",children:"Use this Code Snippet anywhere in your modules to access your environment variable."}),d.jsx(rn,{offset:"md",className:"bg-gray-200 text-xs ",children:d.jsxs("pre",{id:"codePre","data-lang":"typescript",className:"pre font-mono text-gray-900 overflow-x-auto",children:["import ","{"," environment ","}",' from "@zuplo/runtime";',`\r
|
348
|
+
\r
|
349
|
+
`,`const ${e.name} = environment.${e.name};\r
|
350
|
+
`]})})]})]}),IJ={CAUTION:{defaultTitle:"Remove?",buttonVariant:"warn",icon:d.jsx("div",{className:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-yellow-100 sm:mx-0 sm:h-10 sm:w-10",children:d.jsx(cp,{size:18,className:" text-yellow-600","aria-hidden":"true"})})},COMING_SOON:{defaultTitle:"Coming soon",buttonVariant:"default",icon:d.jsx("div",{className:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-gray-100 sm:mx-0 sm:h-10 sm:w-10",children:d.jsx(ZB,{size:18,className:" text-gray-600","aria-hidden":"true"})})},DELETE:{defaultTitle:"Delete",buttonVariant:"danger",icon:d.jsx("div",{className:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10",children:d.jsx(dp,{size:18,className:" text-red-600","aria-hidden":"true"})})},ERROR:{defaultTitle:"Ups, we found an error",buttonVariant:"danger",icon:d.jsx("div",{className:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10",children:d.jsx(VV,{size:18,className:" text-red-600","aria-hidden":"true"})})},REMOVE:{defaultTitle:"Remove?",buttonVariant:"warn",icon:d.jsx("div",{className:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-yellow-100 sm:mx-0 sm:h-10 sm:w-10",children:d.jsx(HB,{size:18,className:" text-yellow-600","aria-hidden":"true"})})}},HD=({alertType:e,bodyElement:t,isOpen:n,children:r,onPrimaryButtonClick:s,onSecondaryButtonClick:o,primaryButtonContent:i,primaryButtonDisabled:a=!1,secondaryButtonDisabled:l=!1,secondaryButtonContent:c,primaryButtonTestID:u="alert-modal-primary-button",secondaryButtonTestID:f="alert-modal-secondary-button",setIsOpen:p,title:g})=>{const{buttonVariant:y,defaultTitle:m,icon:v}=IJ[e],b=Rt({mutationFn:async()=>(await s(),!0)});return d.jsx(cd,{open:n,onOpenChange:p,children:d.jsxs(Zl,{children:[d.jsxs("div",{className:"sm:flex sm:items-start",children:[v,d.jsxs("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[d.jsx(ud,{children:g??m}),d.jsx("div",{className:"mt-2",children:r??t})]})]}),d.jsxs("div",{className:"mt-5 flex gap-2 sm:mt-4 sm:flex sm:flex-row-reverse",children:[d.jsx(Fe,{disabled:a||b.isPending,variant:y,onClick:()=>b.mutate(),"data-test":u,children:d.jsx(ir,{loading:b.isPending,children:i})}),d.jsx(Fe,{disabled:l||b.isPending,variant:"secondary",onClick:o,"data-test":f,children:c})]})]})})},L1=({alertType:e,bodyText:t,hideModal:n,onPrimaryButtonClick:r,onSecondaryButtonClick:s,primaryButtonText:o,secondaryButtonText:i,primaryButtonTestID:a="text-alert-modal-primary-button",secondaryButtonTestID:l="text-alert-modal-secondary-button",title:c})=>{const u=d.jsx("div",{className:"whitespace-pre-line",children:t});return d.jsx(HD,{alertType:e,bodyElement:u,isOpen:!0,onPrimaryButtonClick:r,onSecondaryButtonClick:s,primaryButtonContent:o,secondaryButtonContent:i,primaryButtonTestID:a,secondaryButtonTestID:l,setIsOpen:n,title:c})},nm="__NULL_BRANCH",GD=e=>{const t=[];return e.production&&t.push("production"),e.preview&&t.push("preview"),e.workingCopy&&t.push("working-copy"),t},FJ=({branchOptions:e})=>{const{register:t,watch:n,setValue:r,getValues:s}=tc(),o=n("personalOverride"),i=s(),a=i.production||i.preview||i.workingCopy;return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"mt-5 text-sm",children:"Environment"}),d.jsxs("div",{className:"flex flex-row items-center",children:[d.jsx("input",{id:"production","data-test":"production-checkbox",...t("production"),className:"shadow rounded border border-gray-200 m-2",type:"checkbox"}),d.jsx("label",{htmlFor:"production",children:"Production"})]}),d.jsxs("div",{className:"flex flex-row w-full items-center",children:[d.jsx("input",{id:"preview","data-test":"preview-checkbox",...t("preview"),className:"shadow rounded border border-gray-200 m-2",type:"checkbox"}),d.jsx("label",{htmlFor:"preview",children:"Preview"}),d.jsx("div",{className:"ml-10 w-fit",children:d.jsxs("select",{...t("targetBranch"),className:"w-full truncate rounded shadow border-gray-200 ",disabled:!n("preview"),children:[d.jsx("option",{value:nm,children:"All other environments"}),e.map(l=>d.jsx("option",{value:l,children:l},l))]})})]}),d.jsxs("div",{className:"flex flex-row items-center",children:[d.jsx("input",{id:"workingCopy","data-test":"working-copy-checkbox",...t("workingCopy"),className:"shadow rounded border border-gray-200 m-2",type:"checkbox"}),d.jsx("label",{htmlFor:"workingCopy",children:"Working Copy"}),n("workingCopy")&&d.jsx("button",{type:"button","data-test":"personal-override-button",className:"hover:underline text-zuplo-pink ml-3",onClick:()=>{r("personalOverride",!o,{shouldDirty:!0,shouldTouch:!0})},children:o?"Clear personal override":"Set personal override"})]}),n("personalOverride")&&n("workingCopy")&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"border-t border-gray-300 w-full my-2"}),d.jsxs("div",{className:"flex flex-row items-center space-x-3",children:[d.jsxs("label",{htmlFor:"personal-value",children:[d.jsx("span",{className:"whitespace-nowrap",children:"Personal override"}),d.jsx("div",{className:"text-xs text-gray-300 whitespace-nowrap",children:"(your working copy only)"})]}),d.jsx(Jo,{id:"personal-value","data-test":"personal-override-input",...t("personalValue")})]})]}),!a&&d.jsx(Sr,{children:d.jsx(ai,{children:"You must select at least one environment"})})]})},LJ=({mode:e})=>{var r;const{register:t,formState:n}=tc();return d.jsxs("div",{className:"flex flex-col",children:[d.jsx("span",{className:"text-sm",children:"Name"}),d.jsxs("div",{className:"flex flex-col items-top gap-2",children:[d.jsx(Jo,{id:"name",onInput:s=>{const o=s.target,i=o.selectionStart;o.value=o.value.toUpperCase().replace(/[^A-Z0-9_]/g,"_"),o.setSelectionRange(i,i)},...t("name",{disabled:e==="edit",pattern:{value:/^[^0-9a-z\W][A-Z0-9_]*$/,message:"Name must be SCREAMING_SNAKE_CASE and must start with a letter"}}),title:e==="edit"?"Name cannot be changed, create a new variable instead":"",type:"text","data-test":"variable-name-input"}),((r=n.errors.name)==null?void 0:r.message)&&d.jsx(Sr,{variant:"destructive","data-test":"variable-name-input-error-validation-message",children:d.jsx(ai,{children:n.errors.name.message})})]})]})},KD=({variable:e,branchOptions:t,onClose:n,isSaving:r,error:s,mode:o,onSubmit:i})=>{const a=zj({defaultValues:{preview:e.targets.includes("preview"),production:e.targets.includes("production"),workingCopy:e.targets.includes("working-copy"),name:e.name,isSecret:e.type==="secret",value:o=="edit"&&e.type==="secret"?"*******":e.value??null,personalOverride:e.personalValue!==void 0,personalValue:e.personalValue??null,targetBranch:e.targetBranch??nm},mode:"onChange"}),{getValues:l,control:c,register:u,watch:f}=a,{isValid:p,dirtyFields:g,touchedFields:y}=Dj({control:c}),m=l(),v=m.production||m.preview||m.workingCopy,b=!r&&v&&p,x=()=>{i(l(),g,y)},w=h.useRef(null),_=h.useRef(null);return d.jsx(jj,{...a,children:d.jsx(ic,{isOpen:!0,maxWidth:"max-w-2xl",onClose:n,children:d.jsx("div",{className:"flex flex-col mt-6",children:d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Lx,{error:s}),d.jsx(LJ,{mode:o}),d.jsxs("div",{children:[d.jsx("span",{className:"text-sm",children:"Value"}),d.jsx(Oj,{control:c,name:"value",render:({fieldState:{isDirty:E},field:{value:S,disabled:R,...C}})=>d.jsxs("div",{className:se("rounded border border-gray-200 w-full relative max-h-48",R&&"bg-gray-100"),ref:_,children:[d.jsxs("pre",{className:se("font-mono text-zuplo-pink p-2 overflow-hidden max-h-48 text-sm whitespace-pre",R&&"invisible"),ref:w,children:[[...S??""].map((N,k)=>{switch(N){case`
|
351
|
+
`:return d.jsxs("span",{className:"text-zuplo-pink pl-[0.5px]",children:["↵",`
|
352
|
+
`]},k);case" ":return d.jsx("span",{className:"text-gray-300",children:"␣"},k)}return d.jsx("span",{className:"invisible",children:N},k)}),`
|
353
|
+
`]}),d.jsx("textarea",{onScroll:N=>{var k;N.target instanceof HTMLTextAreaElement&&((k=w.current)==null||k.scrollTo({top:N.target.scrollTop,left:N.target.scrollLeft,behavior:"instant"}))},onFocus:()=>{!E&&f("isSecret")&&C.onChange("")},spellCheck:!1,disabled:R,...C,className:se("absolute top-0 left-0 h-full flex-1 border min-w-0 block p-2 rounded","bg-transparent border-0 w-full font-mono text-sm overflow-auto resize-none outline-none whitespace-pre","disabled:opacity-50 disabled:hover:cursor-not-allowed disabled:cursor-not-allowed"),"data-test":"variable-value-input",value:S??""})]},"value")})]}),d.jsxs("label",{className:se("flex flex-row border rounded bg-blue-50 border-blue-100 p-4 gap-4",o==="edit"&&"bg-gray-100 border-gray-200 opacity-30"),children:[d.jsx("input",{...u("isSecret"),id:"is-secret",disabled:o==="edit",className:"rounded border border-gray-200 shadow mt-0.5",type:"checkbox","data-test":"is-secret-checkbox"}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"is-secret",className:"whitespace-nowrap",children:"Secret"}),d.jsx("div",{className:"text-sm",children:"Secrets are environment variables that are encrypted and not visible after they are set. Secrets are used for storing sensitive information like API keys and auth token."})]})]}),d.jsx(FJ,{branchOptions:t,variable:e}),d.jsxs("div",{className:"flex flex-row space-x-2 mt-3 justify-between",children:[d.jsx(Fe,{onClick:()=>n(),variant:"secondary",children:"Cancel"}),d.jsxs(Fe,{disabled:!b,type:"button","data-test":"save-variable",onClick:x,children:[r&&d.jsx(Jl,{borderPositionAndSize:"w-4 h-4 border-2 border-white mr-2"}),"Save"]})]})]})})})})},UJ=(e,t)=>ar(ye.environmentVariables(e,t),{extractData:!0}),BJ=()=>{const e=It();return Rt({mutationFn:async t=>{await e.fetch(Mt.environmentVariables.updateEnvironmentVariable(t))}})},VJ=()=>{const e=It();return Rt({mutationFn:async n=>{await e.fetch(Mt.environmentVariables.createEnvironmentVariable(n))}})},zJ=()=>{const e=It();return Rt({mutationFn:async n=>{await e.fetch(Mt.environmentVariables.deleteEnvironmentVariable(n))}})};function WJ({variable:e,branchOptions:t,onClose:n,account:r,project:s}){const o=ci(),{logEvent:i}=ft(),a=BJ(),l=(u,f,p)=>{i("env-var-edited",{type:u,targets:f.join(","),personalOverride:`${p}`,account:r,project:s.name});const g=f.filter(m=>m!=="working-copy");s.sourceRepoUrl!=null&&g.length>0&&o.success("Redeploy your project to apply changes.",{title:"Redeploy required",icon:d.jsx(PV,{className:"h-6 w-6"})}),n()},c=(u,f,p)=>{const g=GD(u),y={id:e.id,name:e.name,value:p.value?u.value??void 0:void 0,targets:p.production||p.preview||p.workingCopy?g:void 0};if(f.targetBranch){const m=u.targetBranch;y.targetBranch=m===nm?null:m}p.preview&&u.preview===!1&&(y.targetBranch=null),f.personalOverride&&u.personalOverride&&(y.personalValue=""),f.personalValue&&(y.personalValue=u.personalValue),(f.workingCopy&&u.workingCopy===!1||f.personalOverride&&u.personalOverride===!1)&&(y.personalValue=null),a.mutate({accountName:r,projectName:s.name,variableData:y},{onSuccess:()=>l(y.type??"config",y.targets??e.targets,u.personalOverride),onError:m=>{i("env-var-edit-failed",{account:r,project:s.name,error:m instanceof Error?m.message:""})}})};return d.jsx(KD,{variable:e,branchOptions:t,mode:"edit",onSubmit:c,onClose:n,isSaving:a.isPending,error:a.error})}const qJ=(e,t)=>{const n=[];return e.targets.includes("production")&&n.push(t),e.targets.includes("preview")&&n.push(e.targetBranch??"other"),e.targets.includes("working-copy")&&n.push("working copy"),n.join(", ")};function HJ({variable:e,account:t,project:n,branchOptions:r}){const s=zJ(),{logEvent:o}=ft(),[i,a]=h.useState(),{tooltipProps:l,triggerProps:c}=F1(),{tooltipProps:u,triggerProps:f}=F1(),[p,g]=ls(()=>{const w=async()=>{g(),await s.mutateAsync({accountName:t,projectName:n.name,id:e.id}),o("env-var-deleted",{account:t,project:n.name,id:e.id})};let _="Error deleting Environment Variable",E="We found an error trying to remove the variable.";return i instanceof tr&&(_=i.title??_,E=i.detail??E),d.jsx(L1,{alertType:"ERROR",bodyText:E,onPrimaryButtonClick:w,onSecondaryButtonClick:g,primaryButtonText:"Try again",secondaryButtonText:"Cancel",hideModal:g,title:_})},[e,r,i]),[y,m]=ls(()=>{const w=async()=>{try{await s.mutateAsync({accountName:t,projectName:n.name,id:e.id}),o("env-var-deleted",{account:t,project:n.name,id:e.id}),m()}catch(_){o("env-var-deletion-failed",{account:t,project:n.name,id:e.id}),m(),a(_ instanceof Error?_:new Error(_)),p()}};return d.jsx(L1,{hideModal:m,alertType:"DELETE",bodyText:`Are you sure you want to delete the variable '${e.name}'`,primaryButtonText:"Confirm",secondaryButtonText:"Cancel",onPrimaryButtonClick:w,onSecondaryButtonClick:m,primaryButtonTestID:"confirm-delete-button"})},[e,r]),[v,b]=ls(()=>d.jsx(WJ,{project:n,variable:e,branchOptions:r,onClose:b,account:t}),[e,r]),x=e.personalValue??e.value;return d.jsxs(rn,{className:"grid grid-cols-subgrid col-span-full gap-4 items-center p-4 mt-2",children:[d.jsx("div",{className:"rounded-full border w-10 h-10 flex items-center justify-center",children:d.jsx(PJ,{isSecret:e.type==="secret"})}),d.jsxs("div",{className:"flex flex-row justify-between items-center truncate",children:[d.jsxs("div",{className:"flex flex-col truncate",children:[d.jsxs(Ho,{...u,delayDuration:0,children:[d.jsx(Go,{...f,asChild:!0,children:d.jsx("span",{className:"font-mono text-sm truncate","data-test":"env-variable-name",children:e.name})}),d.jsxs(Lr,{className:"font-mono",children:[d.jsx(hv,{}),e.name]})]}),d.jsx("div",{className:"text-sm text-neutral-500 line-clamp-2",children:qJ(e,n.defaultBranch||"main")})]}),e.personalValue&&d.jsx("div",{className:"bg-zuplo-highlight rounded-full text-2xs text-white px-2 py-1 mx-2 flex-none",children:"PERSONAL"})]}),d.jsx("div",{"data-test":"env-variable-value",className:"truncate flex text-xs font-mono",children:x?d.jsxs(Ho,{...l,children:[d.jsx(Go,{asChild:!0,...c,children:d.jsx("div",{className:"bg-neutral-100 p-1 px-2 rounded max-w-96 truncate",children:e.type==="config"?x:"************"})}),d.jsxs(Lr,{className:"text-xs",children:[d.jsx(hv,{}),x]})]}):d.jsx(li,{variant:"outline",children:"No value"})}),d.jsxs("div",{className:"flex gap-2 justify-end",children:[d.jsx(MJ,{variable:e,asIcon:!0}),d.jsx(Fe,{size:"icon",variant:"ghost",type:"button","data-test":"env-variable-edit",onClick:()=>{v()},children:d.jsx(DV,{size:18})}),d.jsx(Fe,{size:"icon",variant:"ghost","data-test":"env-variable-delete",onClick:()=>{y()},children:s.isPending?d.jsx(Jl,{className:"w-4 h-4",borderPositionAndSize:"border-2"}):d.jsx(dp,{size:18})})]})]},e.name)}const GJ=({branchOptions:e,ape:t,onClose:n})=>{const{logEvent:r}=ft(),s=ci(),o={id:"temp",name:"",type:"config",targets:["production","preview","working-copy"]},i=VJ(),a=(c,u,f)=>{r("env-var-created",{type:c,targets:u.join(","),personalOverride:`${f}`,account:t.account.name,project:t.project.name});const p=u.filter(y=>y!=="working-copy");t.project.sourceRepoUrl!=null&&p.length>0&&s.success("Redeploy your environment to apply changes.",{title:"Environment variable created"}),n()},l=c=>{const u={};u.name=c.name??void 0,u.value=c.value??"",u.type=c.isSecret?"secret":"config",u.targets=GD(c),u.targetBranch=c.preview&&c.targetBranch!==nm?c.targetBranch:void 0,u.personalValue=c.workingCopy&&c.personalOverride?c.personalValue??"":void 0,i.mutate({accountName:t.account.name,projectName:t.project.name,variableData:u},{onSuccess:()=>a(u.type??"config",u.targets??[],c.personalOverride),onError:f=>{r("env-var-creation-failed",{account:t.account.name,project:t.project.name,error:"message"in f?f.message:""})}})};return d.jsx(KD,{variable:o,branchOptions:e,mode:"new",onSubmit:l,onClose:n,isSaving:i.isPending,error:i.error})},uo="___EMPTY___";function KJ(){var E;const e=pn(["account","project"]),{logEvent:t}=ft(),n=UJ(e.account.name,e.project.name),r=!!e.project.sourceRepoUrl,s=ec(e.account.name,e.project.name),o=[{label:"All",value:uo},{label:"Production",value:"production"},{label:"Preview (other branches)",value:"preview"},{label:"Working Copy",value:"working-copy"}],[i,a]=h.useState(uo),[l,c]=h.useState(uo),[u,f]=h.useState(""),g=(((E=s.data)==null?void 0:E.filter(S=>![nr.PRODUCTION,nr.WORKING_COPY].includes(S.environmentType)))??[]).map(S=>S.branchName),y=h.useMemo(()=>[uo,...g],[g]),m=h.useMemo(()=>n.data??[],[n.data]),v=h.useMemo(()=>m.filter(S=>i===uo||S.targets.includes(i)),[m,i]),b=h.useMemo(()=>i!=="preview"||l===uo?v:v.filter(S=>S.targets.includes("preview")&&S.targetBranch===l),[v,i,l]),x=RJ(u,b,{key:"id",getText:S=>[S.name,S.type,S.value,...S.targets,S.targetBranch].filter(Boolean)}),[w,_]=ls(()=>d.jsx(GJ,{ape:e,branchOptions:g,onClose:_}),[g]);return n.isError?d.jsxs(d.Fragment,{children:[d.jsx(cs,{title:"Environment Variables",className:"mb-4"}),d.jsx(I7,{error:n.error})]}):!n.data||r&&!s.data?d.jsxs(d.Fragment,{children:[d.jsx(cs,{title:"Environment Variables",className:"mb-4"}),d.jsx(Ip,{})]}):d.jsxs(d.Fragment,{children:[d.jsx(cs,{title:"Environment Variables"}),d.jsx("p",{className:"text-sm my-1",children:"To provide your environments with environment variables during build and runtime, you can enter them here for your chosen environment."}),d.jsx("p",{className:"text-sm my-1 mt-2",children:"A new deployment is necessary for your changes to take effect."}),d.jsxs("div",{className:"flex flex-col gap-y-2",children:[d.jsx("div",{className:"flex flex-row justify-end gap-x-2",children:d.jsx(Fe,{onClick:w,children:"Add variable"})}),d.jsxs("div",{className:"flex flex-row items-center gap-3",children:[d.jsx(Jo,{type:"search",placeholder:"Search variables",value:u,onChange:S=>{f(S.currentTarget.value),t("env-var-filter-changed",{query:S.currentTarget.value})}}),d.jsxs(Au,{value:i,onValueChange:S=>{a(S),S!=="preview"&&c("")},children:[d.jsx(kl,{className:"w-52","data-test":"env-variable-filter",children:d.jsx($u,{})}),d.jsx(Ol,{className:"w-52",children:o.map((S,R)=>d.jsx(Yi,{value:S.value,"data-test":`env-variable-filter-${R}`,children:S.label},S.value))})]}),i==="preview"?d.jsxs(Au,{value:l,onValueChange:S=>{c(S)},children:[d.jsx(kl,{className:"w-52","data-test":"env-variable-branch-filter",children:d.jsx($u,{})}),d.jsx(Ol,{className:"w-52",children:y.map(S=>d.jsx(Yi,{value:S,children:S===uo?"All branches":S},S))})]}):null]})]}),d.jsx("div",{className:"grid-cols-[min-content,minmax(auto,250px),1fr,auto] grid",children:x.map(S=>d.jsx(HJ,{account:e.account.name,project:e.project,branchOptions:g,variable:S},S.id))}),x.length===0?d.jsx("div",{className:"w-full flex text-center justify-center h-full items-center text-neutral-500 mt-10",children:i===uo&&l===""&&u===""?d.jsxs("div",{children:[d.jsx("span",{className:"text-zuplo-pink cursor-pointer",onClick:w,children:"Create"})," ","an environment variable and it will show up here.",d.jsxs("p",{children:["Not sure where to start?"," ",d.jsx(xt,{href:"https://zuplo.com/docs/deployments/environment-variables",children:"Read the docs"}),"."]})]}):"No variables matching your filter"}):null]})}const YJ=({projectName:e,closeModalAction:t,accountName:n,onFinishDeletion:r})=>{const{logEvent:s}=ft(),[o,i]=h.useState(!1),[a,l]=h.useState(null),c=g=>{i(g.target.value===e)},u=l7(n,e),f=async()=>{try{l(null),await u.mutateAsync(),s("project-deleted",{account:n,project:e}),r==null||r(),t()}catch(g){s("project-deletion-failed",{account:n,project:e,error:g instanceof Error?g.message:"Unknown error"}),On(g),l(hn(g))}},p=g=>{var v,b;const y=g.currentTarget,m=new Range;m.setStart(y,0),m.setEnd(y,1),(v=document.getSelection())==null||v.removeAllRanges(),(b=document.getSelection())==null||b.addRange(m)};return d.jsx(HD,{alertType:"DELETE",isOpen:!0,title:"Delete this Project?",setIsOpen:t,secondaryButtonContent:"Cancel",secondaryButtonTestID:"project-list-close-delete-project-modal",onSecondaryButtonClick:t,primaryButtonTestID:"project-list-delete-project-button",secondaryButtonDisabled:u.isPending,primaryButtonDisabled:!o||u.isPending,primaryButtonContent:"Delete",onPrimaryButtonClick:f,bodyElement:d.jsxs("div",{className:"mt-2",children:[d.jsx(Ul,{message:a}),d.jsx("p",{className:"whitespace-pre-line mt-2 text-sm",children:"This cannot be undone (your GitHub repository will be untouched)"}),d.jsxs("p",{className:"whitespace-pre-line my-3 text-sm",children:["Please type ",d.jsx("strong",{onDoubleClick:p,children:e})," ","to confirm.",d.jsx("input",{disabled:u.isPending,className:"shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block w-full text-sm border-gray-300 rounded-md mb-5",type:"text",autoFocus:!0,autoComplete:"off",onChange:c,"data-test":"project-list-delete-project-input"})]})]})})};function ZJ(){const e=dd(["account","project"]),t=rd(),[n,r]=ls(()=>d.jsx(YJ,{projectName:e.project,accountName:e.account,closeModalAction:r,onFinishDeletion:()=>t("/")}),[]);return d.jsxs(rn,{variant:"danger",children:[d.jsx(xs,{className:"text-red-500",children:"Delete Project"}),d.jsxs(ws,{className:"flex-1 leading-loose mt-1 text-sm",children:[d.jsx("p",{className:"leading-loose",children:"Deleting the project cannot be undone, there is no going back. Please be certain."}),d.jsx("p",{className:"leading-loose",children:"Your GitHub repository will remain untouched."})]}),d.jsx(fd,{variant:"danger",className:"justify-end",children:d.jsx(Fe,{"data-test":"delete-button",variant:"danger",size:"xs",onClick:n,children:"Delete"})})]})}const QJ=({children:e,copyValue:t})=>{const{logEvent:n}=ft();return d.jsxs("div",{className:"mb-2 md:mb-0",children:[e,t&&d.jsx(dh,{className:"relative top-1",onClick:()=>{n("project-information-property-copied",{value:t})},textToCopy:t})]})},XJ=()=>{const{logEvent:e}=ft(),t=pn(["account","project"]);if(!ec(t.account.name,t.project.name).data)return d.jsx("div",{className:"p-6",children:d.jsx(Ip,{})});const r=[];return r.push({label:"Project Name",value:t.project.name}),r.push({label:"Account Name",value:t.account.name}),d.jsxs(rn,{children:[d.jsx(xs,{children:"Project Information"}),d.jsx(ws,{children:d.jsx("div",{className:"grid gap-2 grid-cols-1 md:grid-cols-[150px_1fr] text-sm mt-2",children:r.map(s=>d.jsxs(h.Fragment,{children:[d.jsx("div",{className:"font-medium",children:s.label}),d.jsx(QJ,{copyValue:s.value,children:s.isLink?d.jsx(xt,{href:s.value,onClick:()=>{e("project-information-link-clicked",{label:s.label,value:s.value})},className:"break-all",children:s.value}):s.value})]},s.value))})})]})},JJ=()=>d.jsxs("div",{className:"flex flex-col gap-3 md:gap-6 mb-6",children:[d.jsx(cs,{title:"General"}),d.jsx(XJ,{}),d.jsx(ZJ,{})]}),eee=()=>{const{account:e}=pn(["account"]),[t,n]=h.useState(""),r=It(),s=ci(),o=Rt({onSuccess:()=>{s.success("Account invite sent"),n("")},mutationFn:async({email:i})=>{await r.fetch(Mt.accountInvite.createAccountInvite(e.name,i))}});return e.isSharingEnabled?d.jsxs(d.Fragment,{children:[d.jsx(Lx,{error:o.error}),d.jsxs(rn,{children:[d.jsxs(xs,{children:[d.jsx(kx,{className:"text-md font-medium",children:"Invite to Account"}),d.jsxs(Mp,{children:["This will send an invitation to the email address to join the account ",d.jsx("strong",{children:e.label}),"."]})]}),d.jsxs(ws,{className:"flex gap-2 mt-2",children:[d.jsxs(Oo,{className:"flex flex-col gap-2 w-full",children:["E-Mail",d.jsx(Jo,{disabled:o.isPending,type:"text",name:"invite-email",placeholder:"jace@example.com",value:t,"data-test-id":"invite-email-input",onChange:i=>n(i.target.value)})]}),d.jsxs(Oo,{className:"flex flex-col gap-2",children:["Role",d.jsxs(Ho,{delayDuration:0,children:[d.jsx(Go,{asChild:!0,children:d.jsx("div",{className:"border p-2 rounded-md h-10 flex items-center min-w-40",children:e.entitlements.rbacEnabled?"Member":"Admin"})}),e.entitlements.rbacEnabled?d.jsxs(Lr,{children:["New users will be assigned the member role. ",d.jsx("br",{}),"You can change their role later."]}):d.jsxs(Lr,{children:["New users will be assigned the admin role. ",d.jsx("br",{}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(Yb,{size:16,className:"inline"})," Upgrade to assign other roles."]})]})]})]})]}),d.jsx(fd,{className:"flex justify-end",children:d.jsx(Fe,{type:"button","data-test-id":"account-invite",variant:"white",onClick:()=>{o.mutate({email:t})},disabled:t===""||o.isPending,children:d.jsx(ir,{loading:o.isPending,children:"Invite member"})})})]})]}):null},tee=()=>{const{account:e}=pn(["account"]);return e.entitlements.rbacEnabled?null:d.jsx(Sr,{variant:"info",className:"text-sm",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{children:d.jsx("div",{className:"bg-blue-100 text-blue-500 rounded-full p-2",children:d.jsx(Yb,{size:22})})}),d.jsxs("div",{children:["Role-based access control (RBAC) is not enabled for this account."," ",d.jsx(my,{to:`mailto:${gB}?subject=Fine-grain%20access%20control`,children:"Contact sales"})," ","for more information."]})]})})},YD=["admin","developer","member","no-access"],nee={admin:"Admin",developer:"Developer",member:"Member","no-access":"No Access"},ree=({value:e,roles:t,hiddenRoles:n=[],...r})=>d.jsxs(Au,{...r,value:e,children:[d.jsx(kl,{className:"min-w-40",children:d.jsx($u,{placeholder:"Select a role"})}),d.jsx(Ol,{children:(t??YD).filter(s=>!n.includes(s)).map(s=>d.jsx(Yi,{value:s,children:nee[s]},s))})]}),see=({name:e,sub:t})=>{const{copyToClipboard:n}=Op(t);return d.jsxs(Ho,{children:[d.jsx(Go,{onDoubleClick:()=>{n()},className:"text-left",children:e}),d.jsxs(Lr,{className:"flex items-center gap-2",children:[d.jsx(aV,{size:16})," Sub ",d.jsx(li,{variant:"outline",children:t})]})]})},oee=({date:e,withTime:t})=>d.jsxs("span",{children:[e.toLocaleDateString(),t&&` ${e.toLocaleTimeString()}`]}),iee=({email:e,className:t})=>{const{copyToClipboard:n}=Op(e);return d.jsxs(Ho,{children:[d.jsx(Go,{onDoubleClick:n,className:se("cursor-pointer",t),children:e}),d.jsxs(Lr,{children:["Copy ",d.jsxs("span",{className:"font-mono",children:['"',e,'"']})," to clipboard"]})]})};function ZD(e,t){const n=({className:r,...s})=>h.createElement(e,{...s,className:se(t,r)});return n.displayName=`VariantComponent(${e})`,n}var Mf={exports:{}},aee=Mf.exports,U1;function lee(){return U1||(U1=1,function(e,t){(function(n,r){e.exports=r()})(aee,function(){var n=1e3,r=6e4,s=36e5,o="millisecond",i="second",a="minute",l="hour",c="day",u="week",f="month",p="quarter",g="year",y="date",m="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function($){var I=["th","st","nd","rd"],j=$%100;return"["+$+(I[(j-20)%10]||I[j]||I[0])+"]"}},w=function($,I,j){var F=String($);return!F||F.length>=I?$:""+Array(I+1-F.length).join(j)+$},_={s:w,z:function($){var I=-$.utcOffset(),j=Math.abs(I),F=Math.floor(j/60),O=j%60;return(I<=0?"+":"-")+w(F,2,"0")+":"+w(O,2,"0")},m:function $(I,j){if(I.date()<j.date())return-$(j,I);var F=12*(j.year()-I.year())+(j.month()-I.month()),O=I.clone().add(F,f),U=j-O<0,Y=I.clone().add(F+(U?-1:1),f);return+(-(F+(j-O)/(U?O-Y:Y-O))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:f,y:g,w:u,d:c,D:y,h:l,m:a,s:i,ms:o,Q:p}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},E="en",S={};S[E]=x;var R="$isDayjsObject",C=function($){return $ instanceof L||!(!$||!$[R])},N=function $(I,j,F){var O;if(!I)return E;if(typeof I=="string"){var U=I.toLowerCase();S[U]&&(O=U),j&&(S[U]=j,O=U);var Y=I.split("-");if(!O&&Y.length>1)return $(Y[0])}else{var ee=I.name;S[ee]=I,O=ee}return!F&&O&&(E=O),O||!F&&E},k=function($,I){if(C($))return $.clone();var j=typeof I=="object"?I:{};return j.date=$,j.args=arguments,new L(j)},V=_;V.l=N,V.i=C,V.w=function($,I){return k($,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var L=function(){function $(j){this.$L=N(j.locale,null,!0),this.parse(j),this.$x=this.$x||j.x||{},this[R]=!0}var I=$.prototype;return I.parse=function(j){this.$d=function(F){var O=F.date,U=F.utc;if(O===null)return new Date(NaN);if(V.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var Y=O.match(v);if(Y){var ee=Y[2]-1||0,M=(Y[7]||"0").substring(0,3);return U?new Date(Date.UTC(Y[1],ee,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,M)):new Date(Y[1],ee,Y[3]||1,Y[4]||0,Y[5]||0,Y[6]||0,M)}}return new Date(O)}(j),this.init()},I.init=function(){var j=this.$d;this.$y=j.getFullYear(),this.$M=j.getMonth(),this.$D=j.getDate(),this.$W=j.getDay(),this.$H=j.getHours(),this.$m=j.getMinutes(),this.$s=j.getSeconds(),this.$ms=j.getMilliseconds()},I.$utils=function(){return V},I.isValid=function(){return this.$d.toString()!==m},I.isSame=function(j,F){var O=k(j);return this.startOf(F)<=O&&O<=this.endOf(F)},I.isAfter=function(j,F){return k(j)<this.startOf(F)},I.isBefore=function(j,F){return this.endOf(F)<k(j)},I.$g=function(j,F,O){return V.u(j)?this[F]:this.set(O,j)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(j,F){var O=this,U=!!V.u(F)||F,Y=V.p(j),ee=function(Ce,ue){var ge=V.w(O.$u?Date.UTC(O.$y,ue,Ce):new Date(O.$y,ue,Ce),O);return U?ge:ge.endOf(c)},M=function(Ce,ue){return V.w(O.toDate()[Ce].apply(O.toDate("s"),(U?[0,0,0,0]:[23,59,59,999]).slice(ue)),O)},Q=this.$W,H=this.$M,K=this.$D,ae="set"+(this.$u?"UTC":"");switch(Y){case g:return U?ee(1,0):ee(31,11);case f:return U?ee(1,H):ee(0,H+1);case u:var te=this.$locale().weekStart||0,Re=(Q<te?Q+7:Q)-te;return ee(U?K-Re:K+(6-Re),H);case c:case y:return M(ae+"Hours",0);case l:return M(ae+"Minutes",1);case a:return M(ae+"Seconds",2);case i:return M(ae+"Milliseconds",3);default:return this.clone()}},I.endOf=function(j){return this.startOf(j,!1)},I.$set=function(j,F){var O,U=V.p(j),Y="set"+(this.$u?"UTC":""),ee=(O={},O[c]=Y+"Date",O[y]=Y+"Date",O[f]=Y+"Month",O[g]=Y+"FullYear",O[l]=Y+"Hours",O[a]=Y+"Minutes",O[i]=Y+"Seconds",O[o]=Y+"Milliseconds",O)[U],M=U===c?this.$D+(F-this.$W):F;if(U===f||U===g){var Q=this.clone().set(y,1);Q.$d[ee](M),Q.init(),this.$d=Q.set(y,Math.min(this.$D,Q.daysInMonth())).$d}else ee&&this.$d[ee](M);return this.init(),this},I.set=function(j,F){return this.clone().$set(j,F)},I.get=function(j){return this[V.p(j)]()},I.add=function(j,F){var O,U=this;j=Number(j);var Y=V.p(F),ee=function(H){var K=k(U);return V.w(K.date(K.date()+Math.round(H*j)),U)};if(Y===f)return this.set(f,this.$M+j);if(Y===g)return this.set(g,this.$y+j);if(Y===c)return ee(1);if(Y===u)return ee(7);var M=(O={},O[a]=r,O[l]=s,O[i]=n,O)[Y]||1,Q=this.$d.getTime()+j*M;return V.w(Q,this)},I.subtract=function(j,F){return this.add(-1*j,F)},I.format=function(j){var F=this,O=this.$locale();if(!this.isValid())return O.invalidDate||m;var U=j||"YYYY-MM-DDTHH:mm:ssZ",Y=V.z(this),ee=this.$H,M=this.$m,Q=this.$M,H=O.weekdays,K=O.months,ae=O.meridiem,te=function(ue,ge,ke,Ze){return ue&&(ue[ge]||ue(F,U))||ke[ge].slice(0,Ze)},Re=function(ue){return V.s(ee%12||12,ue,"0")},Ce=ae||function(ue,ge,ke){var Ze=ue<12?"AM":"PM";return ke?Ze.toLowerCase():Ze};return U.replace(b,function(ue,ge){return ge||function(ke){switch(ke){case"YY":return String(F.$y).slice(-2);case"YYYY":return V.s(F.$y,4,"0");case"M":return Q+1;case"MM":return V.s(Q+1,2,"0");case"MMM":return te(O.monthsShort,Q,K,3);case"MMMM":return te(K,Q);case"D":return F.$D;case"DD":return V.s(F.$D,2,"0");case"d":return String(F.$W);case"dd":return te(O.weekdaysMin,F.$W,H,2);case"ddd":return te(O.weekdaysShort,F.$W,H,3);case"dddd":return H[F.$W];case"H":return String(ee);case"HH":return V.s(ee,2,"0");case"h":return Re(1);case"hh":return Re(2);case"a":return Ce(ee,M,!0);case"A":return Ce(ee,M,!1);case"m":return String(M);case"mm":return V.s(M,2,"0");case"s":return String(F.$s);case"ss":return V.s(F.$s,2,"0");case"SSS":return V.s(F.$ms,3,"0");case"Z":return Y}return null}(ue)||Y.replace(":","")})},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(j,F,O){var U,Y=this,ee=V.p(F),M=k(j),Q=(M.utcOffset()-this.utcOffset())*r,H=this-M,K=function(){return V.m(Y,M)};switch(ee){case g:U=K()/12;break;case f:U=K();break;case p:U=K()/3;break;case u:U=(H-Q)/6048e5;break;case c:U=(H-Q)/864e5;break;case l:U=H/s;break;case a:U=H/r;break;case i:U=H/n;break;default:U=H}return O?U:V.a(U)},I.daysInMonth=function(){return this.endOf(f).$D},I.$locale=function(){return S[this.$L]},I.locale=function(j,F){if(!j)return this.$L;var O=this.clone(),U=N(j,F,!0);return U&&(O.$L=U),O},I.clone=function(){return V.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},$}(),G=L.prototype;return k.prototype=G,[["$ms",o],["$s",i],["$m",a],["$H",l],["$W",c],["$M",f],["$y",g],["$D",y]].forEach(function($){G[$[1]]=function(I){return this.$g(I,$[0],$[1])}}),k.extend=function($,I){return $.$i||($(I,L,k),$.$i=!0),k},k.locale=N,k.isDayjs=C,k.unix=function($){return k(1e3*$)},k.en=S[E],k.Ls=S,k.p={},k})}(Mf)),Mf.exports}var cee=lee();const If=Bl(cee);var Ff={exports:{}},uee=Ff.exports,B1;function dee(){return B1||(B1=1,function(e,t){(function(n,r){e.exports=r()})(uee,function(){return function(n,r,s){n=n||{};var o=r.prototype,i={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(c,u,f,p){return o.fromToBase(c,u,f,p)}s.en.relativeTime=i,o.fromToBase=function(c,u,f,p,g){for(var y,m,v,b=f.$locale().relativeTime||i,x=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],w=x.length,_=0;_<w;_+=1){var E=x[_];E.d&&(y=p?s(c).diff(f,E.d,!0):f.diff(c,E.d,!0));var S=(n.rounding||Math.round)(Math.abs(y));if(v=y>0,S<=E.r||!E.r){S<=1&&_>0&&(E=x[_-1]);var R=b[E.l];g&&(S=g(""+S)),m=typeof R=="string"?R.replace("%d",S):R(S,u,E.l,v);break}}if(u)return m;var C=v?b.future:b.past;return typeof C=="function"?C(m):C.replace("%s",m)},o.to=function(c,u){return a(c,u,this,!0)},o.from=function(c,u){return a(c,u,this)};var l=function(c){return c.$u?s.utc():s()};o.toNow=function(c){return this.to(l(this),c)},o.fromNow=function(c){return this.from(l(this),c)}}})}(Ff)),Ff.exports}var fee=dee();const hee=Bl(fee);function pee(e,t){const n=h.createContext(t);function r(o){const{children:i,...a}=o,l=h.useMemo(()=>a,Object.values(a));return d.jsx(n.Provider,{value:l,children:i})}function s(o){const i=h.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",[r,s]}function QD(e,t=[]){let n=[];function r(o,i){const a=h.createContext(i),l=n.length;n=[...n,i];function c(f){const{scope:p,children:g,...y}=f,m=(p==null?void 0:p[e][l])||a,v=h.useMemo(()=>y,Object.values(y));return d.jsx(m.Provider,{value:v,children:g})}function u(f,p){const g=(p==null?void 0:p[e][l])||a,y=h.useContext(g);if(y)return y;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,u]}const s=()=>{const o=n.map(i=>h.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[r,mee(s,...t)]}function mee(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function gee(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function XD(...e){return t=>e.forEach(n=>gee(n,t))}function eo(...e){return h.useCallback(XD(...e),e)}function zs(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}var kh=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},vee=qs.useId||(()=>{}),yee=0;function jg(e){const[t,n]=h.useState(vee());return kh(()=>{n(r=>r??String(yee++))},[e]),e||(t?`radix-${t}`:"")}function va(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function bee({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,s]=xee({defaultProp:t,onChange:n}),o=e!==void 0,i=o?e:r,a=va(n),l=h.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else s(c)},[o,e,s,a]);return[i,l]}function xee({defaultProp:e,onChange:t}){const n=h.useState(e),[r]=n,s=h.useRef(r),o=va(t);return h.useEffect(()=>{s.current!==r&&(o(r),s.current=r)},[r,s,o]),n}var N0=h.forwardRef((e,t)=>{const{children:n,...r}=e,s=h.Children.toArray(n),o=s.find(wee);if(o){const i=o.props.children,a=s.map(l=>l===o?h.Children.count(i)>1?h.Children.only(null):h.isValidElement(i)?i.props.children:null:l);return d.jsx(Yy,{...r,ref:t,children:h.isValidElement(i)?h.cloneElement(i,void 0,a):null})}return d.jsx(Yy,{...r,ref:t,children:n})});N0.displayName="Slot";var Yy=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const s=Eee(n);return h.cloneElement(n,{..._ee(r,n.props),ref:t?XD(t,s):s})}return h.Children.count(n)>1?h.Children.only(null):null});Yy.displayName="SlotClone";var JD=({children:e})=>d.jsx(d.Fragment,{children:e});function wee(e){return h.isValidElement(e)&&e.type===JD}function _ee(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{o(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Eee(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var See=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],to=See.reduce((e,t)=>{const n=h.forwardRef((r,s)=>{const{asChild:o,...i}=r,a=o?N0:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(a,{...i,ref:s})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Cee(e,t){e&&Cr.flushSync(()=>e.dispatchEvent(t))}function Tee(e,t=globalThis==null?void 0:globalThis.document){const n=va(e);h.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ree="DismissableLayer",Zy="dismissableLayer.update",Nee="dismissableLayer.pointerDownOutside",Pee="dismissableLayer.focusOutside",V1,ek=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),tk=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=h.useContext(ek),[u,f]=h.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=h.useState({}),y=eo(t,R=>f(R)),m=Array.from(c.layers),[v]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=m.indexOf(v),x=u?m.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,_=x>=b,E=$ee(R=>{const C=R.target,N=[...c.branches].some(k=>k.contains(C));!_||N||(s==null||s(R),i==null||i(R),R.defaultPrevented||a==null||a())},p),S=Dee(R=>{const C=R.target;[...c.branches].some(k=>k.contains(C))||(o==null||o(R),i==null||i(R),R.defaultPrevented||a==null||a())},p);return Tee(R=>{x===c.layers.size-1&&(r==null||r(R),!R.defaultPrevented&&a&&(R.preventDefault(),a()))},p),h.useEffect(()=>{if(u)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(V1=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),z1(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=V1)}},[u,p,n,c]),h.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),z1())},[u,c]),h.useEffect(()=>{const R=()=>g({});return document.addEventListener(Zy,R),()=>document.removeEventListener(Zy,R)},[]),d.jsx(to.div,{...l,ref:y,style:{pointerEvents:w?_?"auto":"none":void 0,...e.style},onFocusCapture:zs(e.onFocusCapture,S.onFocusCapture),onBlurCapture:zs(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:zs(e.onPointerDownCapture,E.onPointerDownCapture)})});tk.displayName=Ree;var jee="DismissableLayerBranch",Aee=h.forwardRef((e,t)=>{const n=h.useContext(ek),r=h.useRef(null),s=eo(t,r);return h.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),d.jsx(to.div,{...e,ref:s})});Aee.displayName=jee;function $ee(e,t=globalThis==null?void 0:globalThis.document){const n=va(e),r=h.useRef(!1),s=h.useRef(()=>{});return h.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){nk(Nee,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Dee(e,t=globalThis==null?void 0:globalThis.document){const n=va(e),r=h.useRef(!1);return h.useEffect(()=>{const s=o=>{o.target&&!r.current&&nk(Pee,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function z1(){const e=new CustomEvent(Zy);document.dispatchEvent(e)}function nk(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?Cee(s,o):s.dispatchEvent(o)}var Ag="focusScope.autoFocusOnMount",$g="focusScope.autoFocusOnUnmount",W1={bubbles:!1,cancelable:!0},kee="FocusScope",rk=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,l]=h.useState(null),c=va(s),u=va(o),f=h.useRef(null),p=eo(t,m=>l(m)),g=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let m=function(w){if(g.paused||!a)return;const _=w.target;a.contains(_)?f.current=_:yo(f.current,{select:!0})},v=function(w){if(g.paused||!a)return;const _=w.relatedTarget;_!==null&&(a.contains(_)||yo(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&yo(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",v);const x=new MutationObserver(b);return a&&x.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",v),x.disconnect()}}},[r,a,g.paused]),h.useEffect(()=>{if(a){H1.add(g);const m=document.activeElement;if(!a.contains(m)){const b=new CustomEvent(Ag,W1);a.addEventListener(Ag,c),a.dispatchEvent(b),b.defaultPrevented||(Oee(Uee(sk(a)),{select:!0}),document.activeElement===m&&yo(a))}return()=>{a.removeEventListener(Ag,c),setTimeout(()=>{const b=new CustomEvent($g,W1);a.addEventListener($g,u),a.dispatchEvent(b),b.defaultPrevented||yo(m??document.body,{select:!0}),a.removeEventListener($g,u),H1.remove(g)},0)}}},[a,c,u,g]);const y=h.useCallback(m=>{if(!n&&!r||g.paused)return;const v=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,b=document.activeElement;if(v&&b){const x=m.currentTarget,[w,_]=Mee(x);w&&_?!m.shiftKey&&b===_?(m.preventDefault(),n&&yo(w,{select:!0})):m.shiftKey&&b===w&&(m.preventDefault(),n&&yo(_,{select:!0})):b===x&&m.preventDefault()}},[n,r,g.paused]);return d.jsx(to.div,{tabIndex:-1,...i,ref:p,onKeyDown:y})});rk.displayName=kee;function Oee(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(yo(r,{select:t}),document.activeElement!==n)return}function Mee(e){const t=sk(e),n=q1(t,e),r=q1(t.reverse(),e);return[n,r]}function sk(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function q1(e,t){for(const n of e)if(!Iee(n,{upTo:t}))return n}function Iee(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Fee(e){return e instanceof HTMLInputElement&&"select"in e}function yo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Fee(e)&&t&&e.select()}}var H1=Lee();function Lee(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=G1(e,t),e.unshift(t)},remove(t){var n;e=G1(e,t),(n=e[0])==null||n.resume()}}}function G1(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Uee(e){return e.filter(t=>t.tagName!=="A")}var Bee="Portal",ok=h.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,o]=h.useState(!1);kh(()=>o(!0),[]);const i=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?cb.createPortal(d.jsx(to.div,{...r,ref:t}),i):null});ok.displayName=Bee;function Vee(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var rm=e=>{const{present:t,children:n}=e,r=zee(t),s=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),o=eo(r.ref,Wee(s));return typeof n=="function"||r.isPresent?h.cloneElement(s,{ref:o}):null};rm.displayName="Presence";function zee(e){const[t,n]=h.useState(),r=h.useRef({}),s=h.useRef(e),o=h.useRef("none"),i=e?"mounted":"unmounted",[a,l]=Vee(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const c=mf(r.current);o.current=a==="mounted"?c:"none"},[a]),kh(()=>{const c=r.current,u=s.current;if(u!==e){const p=o.current,g=mf(c);e?l("MOUNT"):g==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&p!==g?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),kh(()=>{if(t){const c=f=>{const g=mf(r.current).includes(f.animationName);f.target===t&&g&&Cr.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(o.current=mf(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function mf(e){return(e==null?void 0:e.animationName)||"none"}function Wee(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Dg=0;function qee(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??K1()),document.body.insertAdjacentElement("beforeend",e[1]??K1()),Dg++,()=>{Dg===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Dg--}},[])}function K1(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var ik=Ex(),kg=function(){},sm=h.forwardRef(function(e,t){var n=h.useRef(null),r=h.useState({onScrollCapture:kg,onWheelCapture:kg,onTouchMoveCapture:kg}),s=r[0],o=r[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,f=e.shards,p=e.sideCar,g=e.noIsolation,y=e.inert,m=e.allowPinchZoom,v=e.as,b=v===void 0?"div":v,x=e.gapMode,w=_p(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=p,E=_x([n,t]),S=Dt(Dt({},w),s);return h.createElement(h.Fragment,null,u&&h.createElement(_,{sideCar:ik,removeScrollBar:c,shards:f,noIsolation:g,inert:y,setCallbacks:o,allowPinchZoom:!!m,lockRef:n,gapMode:x}),i?h.cloneElement(h.Children.only(a),Dt(Dt({},S),{ref:E})):h.createElement(b,Dt({},S,{className:l,ref:E}),a))});sm.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};sm.classNames={fullWidth:il,zeroRight:ol};var Qy=!1;if(typeof window<"u")try{var gf=Object.defineProperty({},"passive",{get:function(){return Qy=!0,!0}});window.addEventListener("test",gf,gf),window.removeEventListener("test",gf,gf)}catch{Qy=!1}var Ia=Qy?{passive:!1}:!1,Hee=function(e){return e.tagName==="TEXTAREA"},ak=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Hee(e)&&n[t]==="visible")},Gee=function(e){return ak(e,"overflowY")},Kee=function(e){return ak(e,"overflowX")},Y1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=lk(e,r);if(s){var o=ck(e,r),i=o[1],a=o[2];if(i>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Yee=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Zee=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},lk=function(e,t){return e==="v"?Gee(t):Kee(t)},ck=function(e,t){return e==="v"?Yee(t):Zee(t)},Qee=function(e,t){return e==="h"&&t==="rtl"?-1:1},Xee=function(e,t,n,r,s){var o=Qee(e,window.getComputedStyle(t).direction),i=o*r,a=n.target,l=t.contains(a),c=!1,u=i>0,f=0,p=0;do{var g=ck(e,a),y=g[0],m=g[1],v=g[2],b=m-v-o*y;(y||b)&&lk(e,a)&&(f+=b,p+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&Math.abs(f)<1||!u&&Math.abs(p)<1)&&(c=!0),c},vf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Z1=function(e){return[e.deltaX,e.deltaY]},Q1=function(e){return e&&"current"in e?e.current:e},Jee=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ete=function(e){return`
|
354
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
355
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
356
|
+
`)},tte=0,Fa=[];function nte(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),s=h.useState(tte++)[0],o=h.useState(Sp)[0],i=h.useRef(e);h.useEffect(function(){i.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=wx([e.lockRef.current],(e.shards||[]).map(Q1),!0).filter(Boolean);return m.forEach(function(v){return v.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(m,v){if("touches"in m&&m.touches.length===2)return!i.current.allowPinchZoom;var b=vf(m),x=n.current,w="deltaX"in m?m.deltaX:x[0]-b[0],_="deltaY"in m?m.deltaY:x[1]-b[1],E,S=m.target,R=Math.abs(w)>Math.abs(_)?"h":"v";if("touches"in m&&R==="h"&&S.type==="range")return!1;var C=Y1(R,S);if(!C)return!0;if(C?E=R:(E=R==="v"?"h":"v",C=Y1(R,S)),!C)return!1;if(!r.current&&"changedTouches"in m&&(w||_)&&(r.current=E),!E)return!0;var N=r.current||E;return Xee(N,v,m,N==="h"?w:_)},[]),l=h.useCallback(function(m){var v=m;if(!(!Fa.length||Fa[Fa.length-1]!==o)){var b="deltaY"in v?Z1(v):vf(v),x=t.current.filter(function(E){return E.name===v.type&&(E.target===v.target||v.target===E.shadowParent)&&Jee(E.delta,b)})[0];if(x&&x.should){v.cancelable&&v.preventDefault();return}if(!x){var w=(i.current.shards||[]).map(Q1).filter(Boolean).filter(function(E){return E.contains(v.target)}),_=w.length>0?a(v,w[0]):!i.current.noIsolation;_&&v.cancelable&&v.preventDefault()}}},[]),c=h.useCallback(function(m,v,b,x){var w={name:m,delta:v,target:b,should:x,shadowParent:rte(b)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(_){return _!==w})},1)},[]),u=h.useCallback(function(m){n.current=vf(m),r.current=void 0},[]),f=h.useCallback(function(m){c(m.type,Z1(m),m.target,a(m,e.lockRef.current))},[]),p=h.useCallback(function(m){c(m.type,vf(m),m.target,a(m,e.lockRef.current))},[]);h.useEffect(function(){return Fa.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Ia),document.addEventListener("touchmove",l,Ia),document.addEventListener("touchstart",u,Ia),function(){Fa=Fa.filter(function(m){return m!==o}),document.removeEventListener("wheel",l,Ia),document.removeEventListener("touchmove",l,Ia),document.removeEventListener("touchstart",u,Ia)}},[]);var g=e.removeScrollBar,y=e.inert;return h.createElement(h.Fragment,null,y?h.createElement(o,{styles:ete(s)}):null,g?h.createElement(Cx,{gapMode:e.gapMode}):null)}function rte(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ste=Sx(ik,nte);var uk=h.forwardRef(function(e,t){return h.createElement(sm,Dt({},e,{ref:t,sideCar:ste}))});uk.classNames=sm.classNames;var P0="Dialog",[dk,fk]=QD(P0),[ote,Yr]=dk(P0),hk=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=h.useRef(null),l=h.useRef(null),[c=!1,u]=bee({prop:r,defaultProp:s,onChange:o});return d.jsx(ote,{scope:t,triggerRef:a,contentRef:l,contentId:jg(),titleId:jg(),descriptionId:jg(),open:c,onOpenChange:u,onOpenToggle:h.useCallback(()=>u(f=>!f),[u]),modal:i,children:n})};hk.displayName=P0;var pk="DialogTrigger",mk=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Yr(pk,n),o=eo(t,s.triggerRef);return d.jsx(to.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":$0(s.open),...r,ref:o,onClick:zs(e.onClick,s.onOpenToggle)})});mk.displayName=pk;var j0="DialogPortal",[ite,gk]=dk(j0,{forceMount:void 0}),vk=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,o=Yr(j0,t);return d.jsx(ite,{scope:t,forceMount:n,children:h.Children.map(r,i=>d.jsx(rm,{present:n||o.open,children:d.jsx(ok,{asChild:!0,container:s,children:i})}))})};vk.displayName=j0;var Oh="DialogOverlay",yk=h.forwardRef((e,t)=>{const n=gk(Oh,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Yr(Oh,e.__scopeDialog);return o.modal?d.jsx(rm,{present:r||o.open,children:d.jsx(ate,{...s,ref:t})}):null});yk.displayName=Oh;var ate=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Yr(Oh,n);return d.jsx(uk,{as:N0,allowPinchZoom:!0,shards:[s.contentRef],children:d.jsx(to.div,{"data-state":$0(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ya="DialogContent",bk=h.forwardRef((e,t)=>{const n=gk(ya,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,o=Yr(ya,e.__scopeDialog);return d.jsx(rm,{present:r||o.open,children:o.modal?d.jsx(lte,{...s,ref:t}):d.jsx(cte,{...s,ref:t})})});bk.displayName=ya;var lte=h.forwardRef((e,t)=>{const n=Yr(ya,e.__scopeDialog),r=h.useRef(null),s=eo(t,n.contentRef,r);return h.useEffect(()=>{const o=r.current;if(o)return ad(o)},[]),d.jsx(xk,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:zs(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=n.triggerRef.current)==null||i.focus()}),onPointerDownOutside:zs(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:zs(e.onFocusOutside,o=>o.preventDefault())})}),cte=h.forwardRef((e,t)=>{const n=Yr(ya,e.__scopeDialog),r=h.useRef(!1),s=h.useRef(!1);return d.jsx(xk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((c=n.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),xk=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=Yr(ya,n),l=h.useRef(null),c=eo(t,l);return qee(),d.jsxs(d.Fragment,{children:[d.jsx(rk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:o,children:d.jsx(tk,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":$0(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(dte,{titleId:a.titleId}),d.jsx(hte,{contentRef:l,descriptionId:a.descriptionId})]})]})}),A0="DialogTitle",wk=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Yr(A0,n);return d.jsx(to.h2,{id:s.titleId,...r,ref:t})});wk.displayName=A0;var _k="DialogDescription",Ek=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Yr(_k,n);return d.jsx(to.p,{id:s.descriptionId,...r,ref:t})});Ek.displayName=_k;var Sk="DialogClose",Ck=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=Yr(Sk,n);return d.jsx(to.button,{type:"button",...r,ref:t,onClick:zs(e.onClick,()=>s.onOpenChange(!1))})});Ck.displayName=Sk;function $0(e){return e?"open":"closed"}var Tk="DialogTitleWarning",[ute,Rk]=pee(Tk,{contentName:ya,titleName:A0,docsSlug:"dialog"}),dte=({titleId:e})=>{const t=Rk(Tk),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
357
|
+
|
358
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
359
|
+
|
360
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},fte="DialogDescriptionWarning",hte=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Rk(fte).contentName}}.`;return h.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},pte=hk,mte=mk,gte=vk,vte=yk,yte=bk,bte=wk,xte=Ek,Nk=Ck,Pk="AlertDialog",[wte,yie]=QD(Pk,[fk]),no=fk(),jk=e=>{const{__scopeAlertDialog:t,...n}=e,r=no(t);return d.jsx(pte,{...r,...n,modal:!0})};jk.displayName=Pk;var _te="AlertDialogTrigger",Ak=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=no(n);return d.jsx(mte,{...s,...r,ref:t})});Ak.displayName=_te;var Ete="AlertDialogPortal",$k=e=>{const{__scopeAlertDialog:t,...n}=e,r=no(t);return d.jsx(gte,{...r,...n})};$k.displayName=Ete;var Ste="AlertDialogOverlay",Dk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=no(n);return d.jsx(vte,{...s,...r,ref:t})});Dk.displayName=Ste;var cl="AlertDialogContent",[Cte,Tte]=wte(cl),kk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,o=no(n),i=h.useRef(null),a=eo(t,i),l=h.useRef(null);return d.jsx(ute,{contentName:cl,titleName:Ok,docsSlug:"alert-dialog",children:d.jsx(Cte,{scope:n,cancelRef:l,children:d.jsxs(yte,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:zs(s.onOpenAutoFocus,c=>{var u;c.preventDefault(),(u=l.current)==null||u.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[d.jsx(JD,{children:r}),d.jsx(Nte,{contentRef:i})]})})})});kk.displayName=cl;var Ok="AlertDialogTitle",Mk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=no(n);return d.jsx(bte,{...s,...r,ref:t})});Mk.displayName=Ok;var Ik="AlertDialogDescription",Fk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=no(n);return d.jsx(xte,{...s,...r,ref:t})});Fk.displayName=Ik;var Rte="AlertDialogAction",Lk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=no(n);return d.jsx(Nk,{...s,...r,ref:t})});Lk.displayName=Rte;var Uk="AlertDialogCancel",Bk=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=Tte(Uk,n),o=no(n),i=eo(t,s);return d.jsx(Nk,{...o,...r,ref:i})});Bk.displayName=Uk;var Nte=({contentRef:e})=>{const t=`\`${cl}\` requires a description for the component to be accessible for screen reader users.
|
361
|
+
|
362
|
+
You can add a description to the \`${cl}\` by passing a \`${Ik}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
363
|
+
|
364
|
+
Alternatively, 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 \`${cl}\`. 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.
|
365
|
+
|
366
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Pte=jk,jte=Ak,Ate=$k,Vk=Dk,zk=kk,Wk=Lk,qk=Bk,Hk=Mk,Gk=Fk;const Kk=Pte,Yk=jte,$te=Ate,Zk=h.forwardRef(({className:e,...t},n)=>d.jsx(Vk,{className:se("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Zk.displayName=Vk.displayName;const D0=h.forwardRef(({className:e,...t},n)=>d.jsxs($te,{children:[d.jsx(Zk,{}),d.jsx(zk,{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",e),...t})]}));D0.displayName=zk.displayName;const k0=({className:e,...t})=>d.jsx("div",{className:se("flex flex-col space-y-2 text-center sm:text-left",e),...t});k0.displayName="AlertDialogHeader";const O0=({className:e,...t})=>d.jsx("div",{className:se("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});O0.displayName="AlertDialogFooter";const M0=h.forwardRef(({className:e,...t},n)=>d.jsx(Hk,{ref:n,className:se("text-lg font-semibold",e),...t}));M0.displayName=Hk.displayName;const I0=h.forwardRef(({className:e,...t},n)=>d.jsx(Gk,{ref:n,className:se("text-sm text-muted-foreground",e),...t}));I0.displayName=Gk.displayName;const F0=h.forwardRef(({className:e,variant:t,...n},r)=>d.jsx(Wk,{ref:r,className:se(Kb({variant:t}),e),...n}));F0.displayName=Wk.displayName;const L0=h.forwardRef(({className:e,...t},n)=>d.jsx(qk,{ref:n,className:se(Kb({variant:"ghost"}),"mt-2 sm:mt-0",e),...t}));L0.displayName=qk.displayName;function Dte({accountName:e,invite:t}){const n=ci(),r=o7();return d.jsxs(Kk,{children:[d.jsx(Yk,{asChild:!0,children:d.jsx(Fe,{size:"icon",variant:"ghost",title:"Remove invitation",disabled:r.isPending,children:d.jsx(dp,{size:18})})}),d.jsxs(D0,{children:[d.jsxs(k0,{children:[d.jsx(M0,{children:"Delete account invite"}),d.jsxs(I0,{children:["You are about to delete the account invite sent to ",t.email,". The invitation can no longer be used to join your account."]})]}),d.jsxs(O0,{children:[d.jsx(L0,{children:"Cancel"}),d.jsx(F0,{variant:"danger",onClick:async()=>{try{await r.mutateAsync({accountName:e,inviteId:t.id}),n.success("Invitation was removed")}catch(s){n.error(hn(s))}},children:"Delete invitation"})]})]})]})}function kte({accountName:e,invite:t}){const n=ci(),r=i7();return d.jsxs(Kk,{children:[d.jsxs(Ho,{children:[d.jsx(Go,{asChild:!0,children:d.jsx(Yk,{asChild:!0,children:d.jsx(Fe,{size:"icon",variant:"ghost",disabled:r.isPending,children:d.jsx(mV,{size:18})})})}),d.jsx(Lr,{children:"Resend invitation"})]}),d.jsxs(D0,{children:[d.jsxs(k0,{children:[d.jsx(M0,{children:"Do you want to resend the invitation?"}),d.jsxs(I0,{children:['You are about to resend the account membership invite for "',t.email,'" to join "',e,'".']})]}),d.jsxs(O0,{children:[d.jsx(L0,{children:"Cancel"}),d.jsx(F0,{onClick:async()=>{try{await r.mutateAsync({accountName:e,inviteId:t.id}),n.success("Invitation has been resent")}catch(s){n.error(hn(s))}},children:"Resend invitation"})]})]})]})}If.extend(hee);const Ote=ZD("div","grid grid-cols-subgrid col-span-full w-full border-b px-4 py-3 items-center");function Mte(){const{account:e}=dd(["account"]),n=s7(e).data??[];return d.jsx(d.Fragment,{children:n.map(r=>d.jsxs(Ote,{className:se(If(r.createdOn).isBefore(If().add(5,"minutes"))&&"bg-zuplo-50/50"),children:[d.jsx("div",{className:"text-ellipsis overflow-hidden truncate",children:d.jsxs(Ho,{children:[d.jsx(Go,{children:d.jsxs(li,{variant:"outline",children:["Invited ",If(r.createdOn).fromNow()]})}),d.jsx(Lr,{children:d.jsx(oee,{date:new Date(r.createdOn),withTime:!0})})]})}),d.jsx(iee,{email:r.email,className:"text-left text-ellipsis overflow-hidden truncate"}),d.jsxs("div",{className:"flex justify-end col-span-2",children:[d.jsx(kte,{accountName:e,invite:r}),d.jsx(Dte,{accountName:e,invite:r})]})]},r.id))})}function Ite(){var c,u;const e=pn(["account","project"]),t=ci(),{user:n}=si(),r=It(),s=Rt({mutationFn:({userId:f,role:p})=>r.fetch(Mt.auth.updateUsersRole({accountName:e.account.name,projectName:e.project.name,userId:f,role:p})),onError:f=>t.error(hn(f))}),o=c7(),i=u7(),a=ar(ye.authProjectUsersRoles(e.account.name,e.project.name),{extractData:!0}),l=((c=a==null?void 0:a.error)==null?void 0:c.status)===403;return e.account.isSharingEnabled?d.jsxs("div",{className:"flex gap-2 flex-col text-sm",children:[d.jsx(cs,{title:"Account Members"}),d.jsxs("p",{className:"text-sm",children:["You can add new members to your account. If you have questions about managing access"," ",d.jsx(xt,{href:"https://zuplo.com/docs/articles/add-project-collaborators",children:"check out our docs."})]}),d.jsx(eee,{}),d.jsx(cs,{title:"Project Access",className:"mt-6"}),d.jsx("p",{className:"text-sm",children:"After adding a team member to your account, set their project role to control their access."}),s.isError&&d.jsx(tee,{}),d.jsxs(rn,{className:"grid grid-cols-[auto,auto,auto,auto] gap-x-4 text-sm",children:[d.jsxs(X1,{className:"font-medium",children:[d.jsx("div",{children:"Name"}),d.jsx("div",{className:"row-span-2",children:"Username"})]}),l&&d.jsx("div",{className:"p-4",children:hn(a.error)}),(u=a.data)==null?void 0:u.map(f=>d.jsxs(X1,{children:[d.jsx(see,{name:f.name,sub:f.sub}),d.jsxs("div",{className:"text-ellipsis overflow-hidden truncate",title:f.email,children:[f.email,f.sub===(n==null?void 0:n.sub)&&d.jsx(li,{variant:"outline",className:"ml-4",children:"You"})]}),d.jsx("div",{className:"flex justify-end col-span-2",children:d.jsx("div",{className:"max-w-60 w-full",children:d.jsx(ree,{hiddenRoles:e.account.entitlements.rbacEnabled?[]:["member","developer"],value:f.project.role,disabled:f.sub===(n==null?void 0:n.sub)||!e.account.isSharingEnabled||s.isPending||o.isPending||i.isPending,onValueChange:p=>{if(!YD.includes(p))throw new Error("Invalid role");e.account.entitlements.rbacEnabled?s.mutate({userId:f.id,role:p}):p==="admin"?o.mutate({accountName:e.account.name,projectName:e.project.name,userSub:f.sub}):p==="no-access"&&i.mutate({accountName:e.account.name,projectName:e.project.name,memberId:f.sub})}})})})]},f.sub)),d.jsx(Mte,{})]})]}):d.jsxs(rn,{children:[d.jsx(xs,{children:d.jsx(kx,{children:"Sharing not enabled"})}),d.jsx(ws,{children:d.jsx(mj,{accountName:e.account.name,projectName:e.project.name,featureName:"Project sharing",navigationSource:"share-project"})})]})}const X1=ZD("div","grid grid-cols-subgrid col-span-full w-full border-b px-4 py-3 items-center"),Qk=({showHeader:e})=>d.jsxs(d.Fragment,{children:[e&&d.jsx(cs,{title:"Source Control Settings"}),d.jsxs("div",{role:"status",className:"w-full sm:max-w-md md:max-w-2xl lg:max-w-5xl animate-pulse",children:[e&&d.jsx("div",{className:"h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 mb-9 mt-7 w-650"}),d.jsxs("div",{className:"flex flex-col md:flex-row lg:flex-row sm:gap-4",children:[d.jsx("div",{className:"inline-block w-full max-w-sm md:max-w-xs mr-4 h-10 bg-gray-200 rounded-md dark:bg-gray-700"}),d.jsx("div",{className:"inline-block w-full max-w-sm md:max-w-xs mr-4 h-10 bg-gray-200 rounded-md dark:bg-gray-700"}),d.jsx("div",{className:"inline-block w-full max-w-sm md:max-w-xs right-0 h-10 bg-gray-200 rounded-md dark:bg-gray-700"})]}),d.jsx("div",{className:"h-5 mt-5 mb-3",children:d.jsx("div",{className:"h-2.5 bg-gray-200 rounded-full dark:bg-gray-700 mb-9 mt-7 w-650"})}),d.jsx("div",{className:"mt-5 h-96 relative bg-gray-200 rounded-md dark:bg-gray-700"})]})]}),Fte=({className:e,size:t=24})=>d.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:e,children:d.jsx("path",{d:"M.778 1.211c-.424-.006-.772.334-.778.758 0 .045.002.09.01.134l3.263 19.811c.084.499.515.867 1.022.872H19.95c.382.004.708-.271.77-.646l3.27-20.03c.068-.418-.216-.813-.635-.881-.045-.008-.089-.011-.133-.01L.778 1.211zM14.52 15.528H9.522L8.17 8.464h7.561l-1.211 7.064z"})}),Xy=({className:e,size:t=24})=>d.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:e,children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.477 2 2 6.463 2 11.97c0 4.404 2.865 8.14 6.839 9.458.5.092.682-.216.682-.48 0-.236-.008-.864-.013-1.695-2.782.602-3.369-1.337-3.369-1.337-.454-1.151-1.11-1.458-1.11-1.458-.908-.618.069-.606.069-.606 1.003.07 1.531 1.027 1.531 1.027.892 1.524 2.341 1.084 2.91.828.092-.643.35-1.083.636-1.332-2.22-.251-4.555-1.107-4.555-4.927 0-1.088.39-1.979 1.029-2.675-.103-.252-.446-1.266.098-2.638 0 0 .84-.268 2.75 1.022A9.606 9.606 0 0112 6.82c.85.004 1.705.114 2.504.336 1.909-1.29 2.747-1.022 2.747-1.022.546 1.372.202 2.386.1 2.638.64.696 1.028 1.587 1.028 2.675 0 3.83-2.339 4.673-4.566 4.92.359.307.678.915.678 1.846 0 1.332-.012 2.407-.012 2.734 0 .267.18.577.688.48C19.137 20.107 22 16.373 22 11.969 22 6.463 17.522 2 12 2z"})}),Lte=({className:e,size:t=24})=>d.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:e,children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.65 14.39L12 22.13 1.35 14.39a.84.84 0 0 1-.3-.94l1.22-3.78 2.44-7.51A.42.42 0 0 1 4.82 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.49h8.1l2.44-7.51A.42.42 0 0 1 18.6 2a.43.43 0 0 1 .58 0 .42.42 0 0 1 .11.18l2.44 7.51L23 13.45a.84.84 0 0 1-.35.94z"})});function Mh({providerName:e,className:t,size:n=24}){switch(e==null?void 0:e.toLowerCase()){case"gitlab":return d.jsx(Lte,{className:t,size:n});case"bitbucket":return d.jsx(Fte,{className:t,size:n});default:return d.jsx(Xy,{className:t,size:n})}}const Jy=({selected:e,onChange:t,options:n,listLabel:r,className:s,classNameOptions:o,testId:i,placeholder:a,matchWidth:l=!0,selectorElement:c,disabled:u,labelPrefixElement:f=null,isLoadingData:p=!1})=>d.jsxs(jc,{value:e,onChange:t,disabled:u,children:[r&&d.jsx(jc.Label,{className:"block text-sm font-medium text-gray-700",children:r}),d.jsxs("div",{className:Fs({relative:l},s),children:[d.jsxs(jc.Button,{"data-test":i,className:Fs("relative w-full border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left focus:outline-none focus:ring-1 focus:ring-indigo-500 focus:border-indigo-500 text-sm",u?"bg-gray-200":"bg-white",s),children:[(e==null?void 0:e.icon)&&d.jsx("span",{className:"absolute pr-10",children:p?d.jsx(Jl,{className:"w-4 h-4 mr-2",borderPositionAndSize:"border-l-2"}):e.icon}),d.jsxs("span",{className:Fs("block truncate",{"ml-7":e==null?void 0:e.icon}),children:[f,(e==null?void 0:e.label)??a]}),d.jsx("span",{className:"absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none",children:c??d.jsx(VB,{className:"h-5 w-5 text-gray-400","aria-hidden":"true"})})]}),d.jsx(hu,{as:h.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:d.jsx(jc.Options,{className:Fs("absolute z-20 mt-1 bg-white shadow-lg rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm",o),children:n.map((g,y)=>d.jsx(jc.Option,{"data-test":`${i}-${y}`,className:({active:m})=>Fs(m?"bg-gray-50":"",g.disabled?"cursor-not-allowed":"cursor-pointer","text-gray-900 select-none relative py-2 px-3"),value:g,disabled:g.disabled??!1,children:d.jsx(d.Fragment,{children:g.description?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"font-semibold block text-sm leading-7",children:g.label}),d.jsx("span",{className:"text-xs",children:g.description})]}):d.jsxs("div",{className:"flex flex-row font-normal items-center",children:[g.icon&&d.jsx("div",{children:g.icon})," ",d.jsx("div",{children:g.label}),g.icon&&e&&e.value.toString()===g.value.toString()&&d.jsx("div",{className:"absolute right-0",children:d.jsx(ia,{className:"mr-3 h-5 w-5"})})]})})},`${y}-${g.value}`))})})]})]}),Ute=({accountName:e,projectName:t,orgName:n,repositoryUrl:r,handleErrors:s})=>{const{logEvent:o}=ft(),[i,a]=h.useState(!1),l=f7(e,t),c=()=>{a(!1),f()},[u,f]=ls(()=>d.jsx(ic,{onClose:c,isOpen:!0,maxWidth:"max-w-2xl",children:d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"text-xl font-medium",children:"Connecting project to repository"}),d.jsxs("div",{className:"text-center text-sm text-gray-800 whitespace-pre-line w-full mb-2",children:[d.jsx("p",{children:"The repository you picked is not empty. Connecting will just create an association between this project and the repo. No changes will be pushed or pulled - you must do that manually using the GitHub button."}),d.jsx("br",{}),d.jsx("p",{children:"Do you still want to connect?"})]}),d.jsxs("div",{className:"flex flex-row items-center justify-center space-x-2",children:[d.jsx(Fe,{variant:"white",onClick:c,disabled:l.isPending,children:"Cancel"}),d.jsx(Fe,{"data-test":"connect-non-empty-repo-confirm",onClick:()=>p(n,r,!0),disabled:l.isPending,children:d.jsx(ir,{loading:l.isPending,children:"Connect"})})]})]})}),[l]),p=async(g,y,m)=>{try{if(g===null)throw new Error("Invalid GitHub account/organization selected, please try again.");if(y===null)throw new Error("Invalid repository selected, please try again.");const b=await(await l.mutateAsync({orgName:g,repositoryURL:y,defaultBranch:"main",forceConnect:m},{onError:x=>{const w=hn(x);s(w),o("source-control-repo-connection-failed",{account:e,project:t,org:g,error:w})}})).json();b.connected===!1&&b.emptyRepository===!1?(u(),a(!0)):i&&(a(!1),f()),b.connected&&o("source-control-repo-connected",{account:e,project:t,org:g})}catch(v){On(v);const b=hn(v);o("source-control-repo-connection-failed",{account:e,project:t,org:g,error:b}),s(b),i&&(a(!1),f())}};return d.jsx(Fe,{"data-test":"connect-repo-button",variant:"white",size:"sm",onClick:()=>p(n,r,!1),children:d.jsx(ir,{variant:"primary",loading:l.isPending,children:"Connect"})})},Bte=({installUrl:e,selectedOrg:t,projectName:n,className:r,disabled:s})=>{const{logEvent:o}=ft(),i=u=>{o("source-control-create-repo-continue-clicked",{org:u??"none",project:n});const f=u===null?`https://github.com/new?name=${n}&description=Zuplo%20API%20Gateway`:`https://github.com/organizations/${u}/repositories/new?owner=${u}&name=${n}&description=Zuplo%20API%20Gateway`;window.open(f),c()},a=()=>{c()},[l,c]=ls(()=>d.jsx(ic,{onClose:a,isOpen:!0,maxWidth:"max-w-2xl",children:d.jsxs("div",{className:"space-y-4",children:[d.jsx("div",{className:"text-xl font-medium",children:"Create new repo"}),d.jsxs("div",{className:"text-center text-sm text-gray-800 whitespace-pre-line w-full mb-2",children:[d.jsxs("p",{children:["We're about to help you create a new repo in GitHub. Note, that in order to see the repo in Zuplo when you return you'll need to ensure that the"," ",d.jsx(xt,{href:e,children:"Zuplo GitHub App"})," ","has access to your new repo. Our troubleshooting guide is available"," ",d.jsx(xt,{href:"https://zuplo.com/docs/articles/step-4-deploying-to-the-edge",children:"here"}),"."]}),d.jsx("br",{}),d.jsx("p",{children:"Remember to come back to Zuplo once you've created your repo."})]}),d.jsx("div",{className:"flex flex-row items-center justify-center space-x-2",children:d.jsx(Fe,{"data-test":"navigate-new-gh-repo",onClick:()=>i(t),children:"Continue to GitHub"})})]})}),[t]);return d.jsx(Fe,{"data-test":"connect-repo-button",onClick:()=>{o("source-control-create-repo-clicked",{org:t,project:n}),l()},className:Fs(r),disabled:s,size:"sm",children:"Create new repository"})};function Vte(e,t=500){const[n,r]=h.useState(e);return h.useEffect(()=>{const s=setTimeout(()=>r(e),t);return()=>{clearTimeout(s)}},[e,t]),n}const zte=e=>ar(ye.accountSourceControlRepoList(e)),Wte=e=>ar(ye.accountSourceControlNamespaces(e),{extractData:!0}),qte=(e,t,n,r={})=>{const s=ye.accountSourceControlRepos(e,t,n);return ar(s,{extractData:!0,...r})},Hte=250,Og=5,Gte=({account:e,project:t,sourceControlConfig:n})=>{const{logEvent:r}=ft(),[s,o]=h.useState(""),{data:i,isLoading:a,isFetching:l,error:c}=Wte(e.name),u=hn(c);h.useEffect(()=>{u&&o(u)},[u,o]);const[f,p]=h.useState(null),[g,y]=h.useState(!1),[m,v]=h.useState(),b=h.useRef(null),[x,w]=h.useState(""),_=Vte(x,Hte);h.useEffect(()=>{i&&i.length>0&&(p({label:i[0].name,value:i[0].installationId.toString(),icon:d.jsx(Xy,{})}),y(i[0].isAccessRestricted))},[i]);const{data:E,isLoading:S,isFetching:R,refetch:C,error:N}=qte(e.name,f?f.value:"",_,{enabled:f!==null});h.useEffect(()=>{_&&C()},[C,_]);const k=hn(N);h.useEffect(()=>{k&&(p(null),o(k))},[k]),h.useEffect(()=>{E!=null&&E.repositories&&v(E.repositories)},[E==null?void 0:E.repositories]);const V=j=>{if(j.value==="add-github-account"){r("source-control-add-account-selected",{namespace:j.value,account:e.name,project:t.name,provider:n.provider}),n.installUrl?window.open(n.installUrl):G();return}r("source-control-namespace-selected",{namespace:j.value,account:e.name,project:t.name,provider:n.provider}),s!==""&&o(""),p(j);const F=i==null?void 0:i.filter(O=>O.name===j.label);F&&F.length===1&&y(F[0].isAccessRestricted)},L=()=>{b.current&&(b.current.value="",w(""))},G=()=>{if(n.installUrl)window.open(n.installUrl);else{const j=new Error("Missing installUrl on GitHub Source Control configuration");On(j)}},$=(j,F)=>{let O="Showing ";return j===1?O+="the only repository this account has access to.":j>1&&(O+=`the ${j>=Og?Og:j} most recent repositories from a total of ${F}. `),O},I=[];return i==null||i.forEach(j=>{I.push({label:j.name,value:j.installationId,icon:d.jsx(Xy,{className:"mr-1.5",size:20})})}),I.push({label:"Add GitHub Account",value:"add-github-account",icon:d.jsx(RV,{className:"mr-1.5",size:16})}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsx(Ul,{message:s,className:"w-full"}),d.jsxs("div",{className:"w-full flex items-center text-sm mt-2 gap-2 justify-center",children:[d.jsx("p",{className:"flex-1 hidden md:block",children:"No repository at hand? We can help you create a new one."}),d.jsx(Bte,{installUrl:n.installUrl??"",selectedOrg:(f==null?void 0:f.label)??"",projectName:t.name,className:"w-full md:w-auto"})]}),a&&S&&f===null&&d.jsx(Qk,{showHeader:!1}),!a&&d.jsxs("div",{className:"flex flex-wrap gap-2",children:[d.jsx(Jy,{testId:"namespace-selector",placeholder:"Select GitHub Account",options:I,selected:f,onChange:V,className:"flex-1 items-center min-w-[200px] inline-block w-full h-[42px] text-neutral-600",classNameOptions:"w-full",isLoadingData:l||R}),d.jsxs("div",{className:"flex-[2] min-w-[200px] w-full inline-block border border-gray-300 rounded-md shadow-sm relative overflow-hidden",children:[d.jsx("div",{className:"absolute top-0 left-0 p-2.5 mr-5",children:d.jsx("button",{type:"button",children:d.jsx(AV,{className:"w-4 h-4 text-gray-400"})})}),d.jsx("input",{type:"text",ref:b,value:x,onChange:j=>w(j.target.value),placeholder:"Search",className:"placeholder-gray-400 text-sm h-10 w-full pt-2 ml-5 border-0 focus:outline-0 focus:border-0 focus:ring-0"}),d.jsx("div",{className:"absolute top-0 right-0 p-2.5 w-10",children:x!==""&&d.jsx("button",{type:"button",onClick:L,children:d.jsx(aa,{className:"w-4 h-4"})})})]})]}),d.jsx(rn,{className:"flex flex-col",children:!a&&S?I.length>1?d.jsx("div",{className:"flex flex-row items-center p-2 justify-center align-middle h-80",children:f!==null?d.jsxs(d.Fragment,{children:[d.jsx(Jl,{className:"w-4 h-4 mr-2",borderPositionAndSize:"border-l-2"}),d.jsx("span",{children:"Loading results ..."})]}):d.jsx("p",{className:"mb-4",children:"Make sure to select a Git account or organization on the top left."})}):d.jsxs("div",{className:"flex flex-col text-center items-center justify-center h-80 border-gray-300 text-sm bg-gray-50",children:[d.jsx("h2",{className:"mb-2 text-base",children:"No Results Found"}),d.jsx("p",{className:"mb-4",children:"Make sure to grant Zuplo access to the Git account & its repositories you’d like to connect to."}),d.jsxs("button",{onClick:G,"data-test":"source-control-options",type:"button",className:"border border-gray-300 rounded-md inline-flex items-center justify-center px-4 py-2 text-xs font-medium text-white bg-black hover:text-white hover:bg-gray-800",children:[d.jsx(Mh,{providerName:n.provider}),d.jsxs("span",{className:"pr-1.5 text-sm font-medium whitespace-nowrap flex-none",children:["Configure ",Cu(n.provider)," App"]})]})]}):m&&f&&d.jsxs(d.Fragment,{children:[m.length>0&&m.slice(0,Og).map((j,F)=>d.jsxs("div",{className:Fs("flex flex-row items-center justify-center h-16 border-gray-300 px-5 lg:gap-5 gap-2",{"border-t":F!==0}),children:[d.jsxs("div",{className:"flex text-sm flex-1 gap-1",children:[d.jsxs("div",{className:"flex flex-col flex-1",children:[d.jsx("span",{className:"font-medium line-clamp-1",children:j.name}),d.jsxs("span",{className:"text-gray-400 hidden md:inline-block lg:inline-block",children:["Updated on"," ",new Date(j.updatedAt).toLocaleDateString([],{day:"numeric",month:"short",year:"numeric"})]})]}),j.private&&d.jsxs("div",{className:"flex justify-center items-center text-gray-400 gap-1",children:[d.jsx(up,{className:"h-4 w-4","aria-hidden":"false","aria-label":"Private Git repository"}),d.jsx("span",{className:"hidden lg:block",children:"Private Repository"})]})]}),d.jsx(Ute,{accountName:e.name,projectName:t.name,orgName:f.label,repositoryUrl:j.url,handleErrors:O=>o(O)})]},j.id)),m.length===0&&d.jsxs("div",{className:"flex flex-col text-sm text-center gap-2 items-center justify-center h-80",children:[d.jsx("h2",{className:"text-base",children:"No Results Found"}),x!==""&&d.jsxs("p",{children:['Your search for "',x,'" did not return any results.']}),g||x===""&&d.jsxs(d.Fragment,{children:[d.jsx("p",{children:"Make sure to grant Zuplo access to the Git repositories you’d like to connect to."}),d.jsxs("button",{onClick:G,"data-test":"source-control-options",type:"button",className:"border border-gray-300 rounded-md inline-flex items-center justify-center px-4 py-2 text-xs font-medium text-white bg-black hover:text-white hover:bg-gray-800",children:[d.jsx(Mh,{providerName:n.provider}),d.jsxs("span",{className:"pr-1.5 text-sm font-medium whitespace-nowrap flex-none",children:["Configure"," ",Cu(n.provider)," App"]})]})]}),m.length<5&&d.jsxs("div",{children:[d.jsx("span",{children:"Missing a Git repository?"}),d.jsx(xt,{href:n.installUrl??"",className:"whitespace-pre",children:d.jsx("span",{className:"md:ml-1",children:"Adjust GitHub App Permissions →"})})]})]})]})}),d.jsxs("div",{className:"flex whitespace-pre-line text-gray-500 text-sm justify-between gap-4",children:[E!=null&&E.totalCount&&m?$(m.length,E.totalCount):"Hint: Did you select the right account?",d.jsx(xt,{href:n.installUrl??"",className:"whitespace-pre",children:"Adjust GitHub App Permissions →"})]})]})},Kte="GITLAB",Xk="GITHUB",Jk="BITBUCKET",Ac={label:"Create a new repo",value:"NEW REPO"},Mg={label:"Loading...",value:"loading",disabled:!0},Yte={label:"Select Project",value:"select_project",disabled:!0},Zte=e=>e.replace(/ /g,""),bie=e=>{if(e==null)return typeof e>"u"?"undefined":"null";switch(typeof e){case"bigint":case"boolean":case"number":case"string":return`${e}`;case"object":return JSON.stringify(e,null," ");default:return"Unable to convert input to string"}},Qte=({account:e,project:t,sourceControlConfig:n})=>{const{logEvent:r}=ft(),[s,o]=h.useState(""),i=n.provider===Jk,a=i?null:n.sourceControlUserName,l=i?"Select Project":"Select Org",c=i?"You must select a Project":"You must select an Org",[u,f]=h.useState(a),[p,g]=h.useState(Ac),[y,m]=h.useState(t.name),v=Cu(n.provider),b=d7(e.name),x=zte(e.name),w=hn(x.error);if(w)return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"text-sm mt-5 whitespace-pre-line mb-5 text-neutral-500",children:d.jsx("span",{children:"We ran into an issue with the configuration for this project."})}),d.jsx(Ul,{message:w})]});if(x.isPending)return d.jsx(Ip,{message:"Loading Source Control configuration"});let _=[];const E=new Map;if(x.data||(i?_.push(Yte):_.push({label:n.sourceControlUserName,value:n.sourceControlUserName}),_.push(Mg),E.set(n.sourceControlUserName,[Ac,Mg])),x.data&&x.status==="success"){const N=x.data.data;_=[],Object.entries(N).forEach(([k,V])=>{_.push({label:k,value:k});const L=V.map($=>({label:$.name,value:$.url})),G=[Ac,...L];E.set(k,G)}),!u&&_.length>0&&(f(_[0].value),g(Ac))}const S=N=>{N.value!==u&&(r("source-control-namespace-selected",{org:N.value,account:e.name,project:t.name,provider:n.provider}),f(N.value),g(Ac))},R=N=>{r("source-control-repo-selected",{repo:N.value,account:e.name,project:t.name,provider:n.provider}),g(N)},C=async()=>{o("");try{if(u===null)throw new Error(c);await b.mutateAsync({projectName:t.name,orgName:u,repositoryName:y,defaultBranch:"main"}),r("source-control-repo-created",{repo:y,org:u,account:e.name,project:t.name,provider:n.provider})}catch(N){r("source-control-repo-creation-failed",{repo:y,org:u??"",account:e.name,project:t.name,error:N instanceof Error?N.message:"Unknown error",provider:n.provider}),On(N),o(N instanceof Error?N.message:"Unknown error")}};return d.jsxs("div",{children:[d.jsxs("div",{className:"text-sm mt-5 whitespace-pre-line mb-5 text-neutral-500",children:["Your project is not connected to a ",v," repository yet. You can"," ",d.jsxs(xt,{href:"https://zuplo.com/docs/articles/step-4-deploying-to-the-edge",target:"_blank",rel:"noreferrer",children:["connect your project to a ",v," repository"," "]}),"at anytime."]}),d.jsxs("div",{className:"grid grid-cols-12 gap-4",children:[d.jsx(Ul,{className:"col-span-12",message:s}),d.jsx("div",{className:"col-span-3",children:d.jsx(Jy,{disabled:!x.data&&i,testId:"org-selector",placeholder:l,options:_,selected:u?{label:u,value:u}:Mg,onChange:S})}),d.jsx("div",{className:"col-span-9",children:d.jsx(Jy,{testId:"repo-selector",placeholder:"Select a repository",disabled:!0,options:E.get(u??"")??[],selected:p,onChange:R,classNameOptions:"w-full"})}),d.jsx("div",{className:"col-span-3"}),d.jsx("input",{type:"text","data-test":"repo-name",className:"col-span-9 shadow-sm block w-full text-sm rounded-md border-gray-300 focus:ring-indigo-500 focus:border-indigo-500",value:y,onChange:N=>m(Zte(N.target.value)),"aria-describedby":"project-repository-name"}),d.jsx("div",{className:"col-span-9"}),d.jsx("div",{className:"col-span-10 flex justify-end",children:d.jsx(Fe,{"data-test":"create-repo-button",className:"col-span-3",onClick:C,disabled:!u||b.isPending,children:d.jsx(ir,{loading:b.isPending,children:"Create Repository"})})})]})]})},Xte=({provider:e,url:t,org:n,name:r,children:s})=>d.jsx(rn,{className:"flex gap-2 flex-col",offset:"md",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Mh,{providerName:e}),d.jsx("div",{className:"flex flex-col flex-1",children:d.jsxs("a",{className:"text-sm font-semibold hover:text-zuplo-pink-hover underline flex gap-1 items-center",href:t,target:"_blank",rel:"noopener noreferrer",children:[n,"/",r,d.jsx(nN,{className:"h-4 w-4"})]})}),s]})}),Jte=({account:e,project:t})=>{const{logEvent:n}=ft(),r=pn(["account","project"]);if(!t.sourceRepoUrl)throw new Error(`No sourceRepoUrl on project '${r.account.name}'`);const s=t.sourceRepoUrl.replace(".git",""),o=t.sourceRepoUrl.split("/"),i=o[o.length-2],a=o[o.length-1],l=h7(e.name,t.name),c=async()=>{await l.mutateAsync(),n("source-control-repo-disconnected",{account:r.account.name,project:r.project.name})};return d.jsx(Xte,{org:i,name:a,url:s,provider:t.sourceControlProvider.toLowerCase(),children:d.jsx(Fe,{"data-test":"disconnect-repo-button",onClick:c,variant:"secondary",className:"self-end",disabled:l.isPending,children:d.jsx(ir,{className:"flex items-center gap-1",loading:l.isPending,children:"Disconnect"})})})},ene=({accountName:e,sourceControlConfig:t})=>{const{logEvent:n}=ft(),[r,s]=h.useState(!1),{provider:o}=t,i=(a,l)=>{const{id:c,provider:u,clientId:f,scopes:p,redirectUri:g,providerUrl:y}=l;if(localStorage.removeItem(bm),localStorage.setItem(bm,`${a}::${c}`),s(!0),window.addEventListener("storage",m=>{m.key===bm&&m.oldValue===`${a}::${c}`&&m.newValue===null&&(n("source-control-access-granted",{account:a,provider:l.provider}),s(!1))},!1),u===Xk){const m=p!==""?`https://github.com/login/oauth/authorize?client_id=${f}&scope=${p}`:`https://github.com/login/oauth/authorize?client_id=${f}`;window.open(m)}u===Kte&&window.open(`${y}/oauth/authorize?client_id=${f}&redirect_uri=${g}&response_type=code&scope=${p}`),u===Jk&&window.open(`${y}/site/oauth2/authorize?client_id=${f}&response_type=code`)};return d.jsx("div",{children:d.jsx(Fe,{variant:"white",className:"gap-2",disabled:r,onClick:()=>i(e,t),children:d.jsx(ir,{loading:r,children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Mh,{providerName:o}),d.jsx("span",{children:`Connect to ${Cu(o)}`})]})})})})},tne=({account:e,project:t,sourceControlConfig:n})=>{if(n===null)return d.jsx("div",{className:"text-sm mt-5 whitespace-pre-line",children:d.jsx("span",{children:"This project is currently associated with an account that has not been configured to use any Source Control Provider."})});const r=Cu(n.provider);return!t.sourceRepoUrl&&n.userHasCredentials&&n.provider===Xk&&n.additionalMetadata!==null?d.jsx(Gte,{account:e,project:t,sourceControlConfig:n}):!t.sourceRepoUrl&&n.userHasCredentials?d.jsx(Qte,{account:e,project:t,sourceControlConfig:n}):n.userHasCredentials===!1?d.jsxs(rn,{offset:"md",className:"flex items-center gap-2",children:[d.jsxs("div",{className:"text-sm whitespace-pre-line flex-1 text-gray-500",children:[t.sourceRepoUrl&&d.jsxs("p",{className:"mb-3",children:["This project is currently associated with a ",r," ","repository but you have not connected to your ",r," ","account."]}),d.jsxs("p",{children:["Connect to your ",r," account to enable ",r," ","source control on your project."]})]}),d.jsx(ene,{accountName:e.name,sourceControlConfig:n})]}):d.jsx(Jte,{account:e,project:t})},nne=({accountName:e,projectName:t,sourceRepoUrl:n,defaultBranch:r})=>{const{logEvent:s}=ft(),[o,i]=h.useState(""),[a,l]=h.useState(r),[c,u]=h.useState(!1),f=p7(e,t);h.useEffect(()=>{c||(i(""),l(r))},[c]);const p=n.split("/"),g=p[p.length-2],y=p[p.length-1],m=async()=>{try{if(i(""),!a||a===r){i("Select a new default branch.");return}await f.mutateAsync({defaultBranch:a,sourceRepoUrl:n}),s("project-update-default-branch-success",{account:e}),u(!1)}catch(v){On(v);const b=hn(v);i(b),s("project-update-default-branch-failed",{account:e,error:b})}};return d.jsxs(rn,{children:[d.jsx(xs,{children:"Default Branch"}),d.jsxs(ws,{className:"mt-1 text-sm",children:[d.jsx(Mp,{children:"The default branch is considered the “base” branch in your repository, against which all pull requests and code commits are automatically made. This is the branch used for your project's production deployments."}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Jo,{type:"text",autoComplete:"off",id:"default-branch-field",value:r??"main",disabled:!0,className:"max-w-52","data-test":"default-branch-field"}),d.jsxs(cd,{onOpenChange:v=>u(v),open:c,children:[d.jsx(sj,{children:d.jsx(Fe,{type:"button","data-test":"update-default-branch",variant:"white",children:"Update"})}),d.jsxs(Zl,{children:[d.jsx(kp,{children:d.jsx(ud,{children:"Switch default branch to another branch"})}),d.jsxs("div",{className:"space-y-4",children:[o&&d.jsx(Sr,{variant:"destructive",children:d.jsx(ai,{children:o})}),d.jsxs(ij,{className:"text-neutral-900",children:["Choose another branch in"," ",d.jsxs(xt,{href:n,children:[g,"/",y]})," ","to use as the default branch of the project instead of"," ",r,".",d.jsx(Jo,{type:"text",autoComplete:"off",placeholder:"Type a branch name",id:"default-branch-field",className:"mt-4","data-test":"default-branch-field",value:a,onChange:v=>l(v.target.value)})]})]}),d.jsxs(Dx,{children:[d.jsx(fy,{children:d.jsx(Fe,{"data-test":"cancel-update-default-branch-btn",disabled:f.isPending,variant:"ghost",children:"Cancel"})}),d.jsx(Fe,{"data-test":"update-default-branch-btn",type:"button",onClick:m,disabled:f.isPending,variant:"white",children:d.jsx(ir,{loading:f.isPending,alternative:"Updating...",children:"Switch branch"})})]})]})]})]})]})]})},rne=()=>ar(ye.accountsSourceControlConfigurations()),sne=()=>{const e=pn(["account","project"]),t=rne();if(!t.data)return d.jsx(Qk,{showHeader:!0});const n=UW(e.account.name,t.data);return d.jsxs("div",{className:"flex flex-col gap-3 md:gap-6 mb-6",children:[d.jsx(cs,{title:"Source Control Settings"}),e.project.sourceRepoUrl!==null&&d.jsx(nne,{accountName:e.account.name,projectName:e.project.name,sourceRepoUrl:e.project.sourceRepoUrl,defaultBranch:e.project.defaultBranch??void 0}),d.jsxs(rn,{children:[d.jsx(xs,{children:"Connected Git Repository"}),d.jsxs(ws,{children:[d.jsx(Mp,{children:"Seamlessly create Environments for every branch and deployments for any commits pushed to your Git repository."}),d.jsx(tne,{account:e.account,project:e.project,sourceControlConfig:n})]})]})]})},J1=({to:e})=>{const t=pn(["account"]);return d.jsx(PN,{to:`/accounts/${t.account.name}/settings/${e}`,replace:!0})},one=[{key:"general",group:"project-level",icon:d.jsx(UV,{className:"w-4 h-4"}),name:"General",view:d.jsx(JJ,{}),testID:"settings-general"},{key:"api-key-consumers",group:"project-level",icon:d.jsx(NB,{className:"w-4 h-4"}),name:"API Key Consumers",view:d.jsx(H7,{})},{key:"environment-variables",group:"project-level",icon:d.jsx(FV,{className:"w-4 h-4"}),name:"Environment Variables",view:d.jsx(KJ,{}),testID:"settings-environment-variables"},{key:"share-project",group:"project-level",icon:d.jsx(GV,{className:"w-4 h-4"}),name:"Members",view:d.jsx(Ite,{}),testID:"settings-share-project"},{key:"source-control-settings",group:"project-level",icon:d.jsx(cV,{className:"w-4 h-4"}),name:"Source Control",view:d.jsx(sne,{}),testID:"settings-source-control-settings"},{key:"custom-domain",group:"project-level",icon:d.jsx(yV,{className:"w-4 h-4"}),name:"Custom Domain",view:d.jsx(EJ,{}),testID:"settings-custom-domain"},{key:"upgrade-billing",group:"account-level",icon:d.jsx(Yb,{className:"w-4 h-4"}),name:"Billing",view:d.jsx(J1,{to:"upgrade-billing"}),redirect:!0,testID:"settings-upgrade-billing"},{key:"environments",group:"account-level",redirect:!0,icon:d.jsx(Zb,{className:"h-4 w-4"}),name:"Environments",view:d.jsx(G7,{}),testID:"settings-environments"},{key:"zuplo-api-keys",group:"account-level",redirect:!0,icon:d.jsx(sN,{className:"w-4 h-4"}),name:"Zuplo API Keys",view:d.jsx(J1,{to:"api-keys"}),testID:"settings-zuplo-api-keys"}],ine=({account:e,project:t,environment:n,navigateTo:r})=>!e||!t||!n?null:d.jsx(Ql,{heading:"Settings",children:one.map(s=>d.jsxs(Xl,{onSelect:()=>r(Zs(`${yr.Settings}/${s.key}`,{account:e,project:t})),children:[s.icon,d.jsx("span",{className:"ml-3",children:s.name})]},s.key))}),yf=({path:e,children:t,account:n,project:r,environment:s,navigateTo:o})=>{var i;return d.jsxs(Xl,{onSelect:()=>o(Zs(e,{account:n??null,project:r??null,environment:s??null})),children:[d.jsx("div",{className:"mr-2",children:t??d.jsx(_B,{className:" h-4 w-4"})}),d.jsx("span",{children:(i=Object.entries(yr).find(([,a])=>a===e))==null?void 0:i.at(0)})]})};function ane(){const{account:e,project:t,environment:n}=sx(),r=rd(),s=e&&t&&n,o={account:e,project:t,environment:n},[i,a]=h.useState(""),[l,c]=h.useState(!1);n8("meta+k",()=>{c(!0)});const u=f=>{r(f),c(!1)};return d.jsxs(FW,{open:l,onOpenChange:c,children:[d.jsx(lj,{placeholder:"What do you want to do?",onValueChange:a,className:"text-md"}),d.jsxs(cj,{children:[d.jsx(uj,{children:d.jsxs("div",{className:"text-muted-foreground my-3",children:['No results found "',i,'".']})}),s&&d.jsx(w7,{navigateTo:u,account:e,project:t,environment:n}),e&&t&&n&&d.jsx(ine,{navigateTo:u,...o}),d.jsx(g7,{navigateTo:u}),d.jsxs(Ql,{title:"Zuplo",children:[d.jsx(yf,{path:yr.Profile,navigateTo:u,...o,children:d.jsx(qV,{})}),d.jsx(yf,{path:yr.Logout,navigateTo:u,...o,children:d.jsx(wV,{})}),d.jsx(yf,{path:yr.Settings,navigateTo:u,...o,children:d.jsx(q_,{})}),d.jsx(yf,{path:yr.AccountSettings,navigateTo:u,...o,children:d.jsx(q_,{})})]})]})]})}const eC=Date.now(),lne=5*60*1e3,cne=4*60*60*1e3,une=24*60*60*1e3,dne=async e=>{try{const t=await fetch(e,{method:"HEAD",cache:"no-cache"});if(!t.ok)return!1;const n=t.headers.get("date"),r=t.headers.get("last-modified");if(!n||!r)return!1;const s=new Date(n).getTime(),o=new Date(r).getTime();if(Number.isNaN(s)||Number.isNaN(o))return!1;const i=s-o>=une;return o>eC&&s>eC&&i}catch{return!1}},fne=()=>{const e=h.useRef(0),t=ip(),{data:n}=zh({enabled:!0,refetchInterval:lne,refetchIntervalInBackground:!1,networkMode:"online",retry:!1,queryFn:async()=>{const r=await dne(window.location.href),s=Date.now();return r&&s-e.current>=cne?(e.current=s,t.capture("show-update-toast"),!0):!1},queryKey:["update-check"]});return d.jsxs(gx,{open:n??!1,duration:1/0,className:"data-[state=open]:animate-slideDown data-[state=closed]:animate-slideUp",children:[d.jsxs(fP,{children:[d.jsx(yx,{children:"Update available"}),d.jsx(bx,{children:"A new version of the Zuplo Portal is available. Click to reload."})]}),d.jsx(hP,{altText:"Reload",children:d.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Reload"})}),d.jsx(vx,{})]})},hne=()=>(X6(),d.jsx(BN,{children:d.jsxs(uP,{children:[d.jsx(fne,{}),d.jsx(ane,{}),d.jsx(Q6,{}),d.jsx(ax,{}),d.jsx(dP,{})]})}));function tC(e){return async()=>({Component:(await e()).default})}function pne(){return d.jsx("div",{className:"m-auto",children:d.jsxs("div",{className:"flex flex-col gap-2 my-5",children:[d.jsx("div",{children:d.jsx(li,{variant:"outline",children:"404"})}),d.jsx("span",{className:"text-2xl font-medium",children:"Oops! Page not found."}),d.jsx("span",{children:"Sorry, we could not find the page you were looking for."}),d.jsx("div",{className:"h-2"}),d.jsx(VN,{hasGoHome:!0})]})})}const mne=(e,t="api")=>{var n;return(n=gne(e,t))==null?void 0:n.url},gne=(e,t="api")=>{var n;return(n=e.deploymentVersion)==null?void 0:n.stages.find(r=>r.stage===t)};var Ig="rovingFocusGroup.onEntryFocus",vne={bubbles:!1,cancelable:!0},Sd="RovingFocusGroup",[eb,eO,yne]=bp(Sd),[bne,tO]=Vr(Sd,[yne]),[xne,wne]=bne(Sd),nO=h.forwardRef((e,t)=>d.jsx(eb.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(eb.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(_ne,{...e,ref:t})})}));nO.displayName=Sd;var _ne=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...f}=e,p=h.useRef(null),g=tt(t,p),y=y0(o),[m,v]=Ys({prop:i,defaultProp:a??null,onChange:l,caller:Sd}),[b,x]=h.useState(!1),w=qn(c),_=eO(n),E=h.useRef(!1),[S,R]=h.useState(0);return h.useEffect(()=>{const C=p.current;if(C)return C.addEventListener(Ig,w),()=>C.removeEventListener(Ig,w)},[w]),d.jsx(xne,{scope:n,orientation:r,dir:y,loop:s,currentTabStopId:m,onItemFocus:h.useCallback(C=>v(C),[v]),onItemShiftTab:h.useCallback(()=>x(!0),[]),onFocusableItemAdd:h.useCallback(()=>R(C=>C+1),[]),onFocusableItemRemove:h.useCallback(()=>R(C=>C-1),[]),children:d.jsx($e.div,{tabIndex:b||S===0?-1:0,"data-orientation":r,...f,ref:g,style:{outline:"none",...e.style},onMouseDown:me(e.onMouseDown,()=>{E.current=!0}),onFocus:me(e.onFocus,C=>{const N=!E.current;if(C.target===C.currentTarget&&N&&!b){const k=new CustomEvent(Ig,vne);if(C.currentTarget.dispatchEvent(k),!k.defaultPrevented){const V=_().filter(j=>j.focusable),L=V.find(j=>j.active),G=V.find(j=>j.id===m),I=[L,G,...V].filter(Boolean).map(j=>j.ref.current);oO(I,u)}}E.current=!1}),onBlur:me(e.onBlur,()=>x(!1))})})}),rO="RovingFocusGroupItem",sO=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:o,children:i,...a}=e,l=fn(),c=o||l,u=wne(rO,n),f=u.currentTabStopId===c,p=eO(n),{onFocusableItemAdd:g,onFocusableItemRemove:y,currentTabStopId:m}=u;return h.useEffect(()=>{if(r)return g(),()=>y()},[r,g,y]),d.jsx(eb.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:d.jsx($e.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:me(e.onMouseDown,v=>{r?u.onItemFocus(c):v.preventDefault()}),onFocus:me(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:me(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const b=Cne(v,u.orientation,u.dir);if(b!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let w=p().filter(_=>_.focusable).map(_=>_.ref.current);if(b==="last")w.reverse();else if(b==="prev"||b==="next"){b==="prev"&&w.reverse();const _=w.indexOf(v.currentTarget);w=u.loop?Tne(w,_+1):w.slice(_+1)}setTimeout(()=>oO(w))}}),children:typeof i=="function"?i({isCurrentTabStop:f,hasTabStop:m!=null}):i})})});sO.displayName=rO;var Ene={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Sne(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Cne(e,t,n){const r=Sne(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ene[r]}function oO(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Tne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Rne=nO,Nne=sO,tb=["Enter"," "],Pne=["ArrowDown","PageUp","Home"],iO=["ArrowUp","PageDown","End"],jne=[...Pne,...iO],Ane={ltr:[...tb,"ArrowRight"],rtl:[...tb,"ArrowLeft"]},$ne={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Cd="Menu",[Gu,Dne,kne]=bp(Cd),[_a,aO]=Vr(Cd,[kne,Gl,tO]),om=Gl(),lO=tO(),[One,Ea]=_a(Cd),[Mne,Td]=_a(Cd),cO=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:o,modal:i=!0}=e,a=om(t),[l,c]=h.useState(null),u=h.useRef(!1),f=qn(o),p=y0(s);return h.useEffect(()=>{const g=()=>{u.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>u.current=!1;return document.addEventListener("keydown",g,{capture:!0}),()=>{document.removeEventListener("keydown",g,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),d.jsx(xb,{...a,children:d.jsx(One,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c,children:d.jsx(Mne,{scope:t,onClose:h.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:u,dir:p,modal:i,children:r})})})};cO.displayName=Cd;var Ine="MenuAnchor",U0=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=om(n);return d.jsx(wb,{...s,...r,ref:t})});U0.displayName=Ine;var B0="MenuPortal",[Fne,uO]=_a(B0,{forceMount:void 0}),dO=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,o=Ea(B0,t);return d.jsx(Fne,{scope:t,forceMount:n,children:d.jsx(zr,{present:n||o.open,children:d.jsx(td,{asChild:!0,container:s,children:r})})})};dO.displayName=B0;var _r="MenuContent",[Lne,V0]=_a(_r),fO=h.forwardRef((e,t)=>{const n=uO(_r,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Ea(_r,e.__scopeMenu),i=Td(_r,e.__scopeMenu);return d.jsx(Gu.Provider,{scope:e.__scopeMenu,children:d.jsx(zr,{present:r||o.open,children:d.jsx(Gu.Slot,{scope:e.__scopeMenu,children:i.modal?d.jsx(Une,{...s,ref:t}):d.jsx(Bne,{...s,ref:t})})})})}),Une=h.forwardRef((e,t)=>{const n=Ea(_r,e.__scopeMenu),r=h.useRef(null),s=tt(t,r);return h.useEffect(()=>{const o=r.current;if(o)return ad(o)},[]),d.jsx(z0,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:me(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Bne=h.forwardRef((e,t)=>{const n=Ea(_r,e.__scopeMenu);return d.jsx(z0,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Vne=ea("MenuContent.ScrollLock"),z0=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:g,disableOutsideScroll:y,...m}=e,v=Ea(_r,n),b=Td(_r,n),x=om(n),w=lO(n),_=Dne(n),[E,S]=h.useState(null),R=h.useRef(null),C=tt(t,R,v.onContentChange),N=h.useRef(0),k=h.useRef(""),V=h.useRef(0),L=h.useRef(null),G=h.useRef("right"),$=h.useRef(0),I=y?Cp:h.Fragment,j=y?{as:Vne,allowPinchZoom:!0}:void 0,F=U=>{var te,Re;const Y=k.current+U,ee=_().filter(Ce=>!Ce.disabled),M=document.activeElement,Q=(te=ee.find(Ce=>Ce.ref.current===M))==null?void 0:te.textValue,H=ee.map(Ce=>Ce.textValue),K=ere(H,Y,Q),ae=(Re=ee.find(Ce=>Ce.textValue===K))==null?void 0:Re.ref.current;(function Ce(ue){k.current=ue,window.clearTimeout(N.current),ue!==""&&(N.current=window.setTimeout(()=>Ce(""),1e3))})(Y),ae&&setTimeout(()=>ae.focus())};h.useEffect(()=>()=>window.clearTimeout(N.current),[]),xx();const O=h.useCallback(U=>{var ee,M;return G.current===((ee=L.current)==null?void 0:ee.side)&&nre(U,(M=L.current)==null?void 0:M.area)},[]);return d.jsx(Lne,{scope:n,searchRef:k,onItemEnter:h.useCallback(U=>{O(U)&&U.preventDefault()},[O]),onItemLeave:h.useCallback(U=>{var Y;O(U)||((Y=R.current)==null||Y.focus(),S(null))},[O]),onTriggerLeave:h.useCallback(U=>{O(U)&&U.preventDefault()},[O]),pointerGraceTimerRef:V,onPointerGraceIntentChange:h.useCallback(U=>{L.current=U},[]),children:d.jsx(I,{...j,children:d.jsx(wp,{asChild:!0,trapped:s,onMountAutoFocus:me(o,U=>{var Y;U.preventDefault(),(Y=R.current)==null||Y.focus({preventScroll:!0})}),onUnmountAutoFocus:i,children:d.jsx(Wl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:f,onInteractOutside:p,onDismiss:g,children:d.jsx(Rne,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:r,currentTabStopId:E,onCurrentTabStopIdChange:S,onEntryFocus:me(l,U=>{b.isUsingKeyboardRef.current||U.preventDefault()}),preventScrollOnEntryFocus:!0,children:d.jsx(_b,{role:"menu","aria-orientation":"vertical","data-state":NO(v.open),"data-radix-menu-content":"",dir:b.dir,...x,...m,ref:C,style:{outline:"none",...m.style},onKeyDown:me(m.onKeyDown,U=>{const ee=U.target.closest("[data-radix-menu-content]")===U.currentTarget,M=U.ctrlKey||U.altKey||U.metaKey,Q=U.key.length===1;ee&&(U.key==="Tab"&&U.preventDefault(),!M&&Q&&F(U.key));const H=R.current;if(U.target!==H||!jne.includes(U.key))return;U.preventDefault();const ae=_().filter(te=>!te.disabled).map(te=>te.ref.current);iO.includes(U.key)&&ae.reverse(),Xne(ae)}),onBlur:me(e.onBlur,U=>{U.currentTarget.contains(U.target)||(window.clearTimeout(N.current),k.current="")}),onPointerMove:me(e.onPointerMove,Ku(U=>{const Y=U.target,ee=$.current!==U.clientX;if(U.currentTarget.contains(Y)&&ee){const M=U.clientX>$.current?"right":"left";G.current=M,$.current=U.clientX}}))})})})})})})});fO.displayName=_r;var zne="MenuGroup",W0=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx($e.div,{role:"group",...r,ref:t})});W0.displayName=zne;var Wne="MenuLabel",hO=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx($e.div,{...r,ref:t})});hO.displayName=Wne;var Ih="MenuItem",nC="menu.itemSelect",im=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,o=h.useRef(null),i=Td(Ih,e.__scopeMenu),a=V0(Ih,e.__scopeMenu),l=tt(t,o),c=h.useRef(!1),u=()=>{const f=o.current;if(!n&&f){const p=new CustomEvent(nC,{bubbles:!0,cancelable:!0});f.addEventListener(nC,g=>r==null?void 0:r(g),{once:!0}),ub(f,p),p.defaultPrevented?c.current=!1:i.onClose()}};return d.jsx(pO,{...s,ref:l,disabled:n,onClick:me(e.onClick,u),onPointerDown:f=>{var p;(p=e.onPointerDown)==null||p.call(e,f),c.current=!0},onPointerUp:me(e.onPointerUp,f=>{var p;c.current||(p=f.currentTarget)==null||p.click()}),onKeyDown:me(e.onKeyDown,f=>{const p=a.searchRef.current!=="";n||p&&f.key===" "||tb.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});im.displayName=Ih;var pO=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...o}=e,i=V0(Ih,n),a=lO(n),l=h.useRef(null),c=tt(t,l),[u,f]=h.useState(!1),[p,g]=h.useState("");return h.useEffect(()=>{const y=l.current;y&&g((y.textContent??"").trim())},[o.children]),d.jsx(Gu.ItemSlot,{scope:n,disabled:r,textValue:s??p,children:d.jsx(Nne,{asChild:!0,...a,focusable:!r,children:d.jsx($e.div,{role:"menuitem","data-highlighted":u?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...o,ref:c,onPointerMove:me(e.onPointerMove,Ku(y=>{r?i.onItemLeave(y):(i.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:me(e.onPointerLeave,Ku(y=>i.onItemLeave(y))),onFocus:me(e.onFocus,()=>f(!0)),onBlur:me(e.onBlur,()=>f(!1))})})})}),qne="MenuCheckboxItem",mO=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return d.jsx(xO,{scope:e.__scopeMenu,checked:n,children:d.jsx(im,{role:"menuitemcheckbox","aria-checked":Fh(n)?"mixed":n,...s,ref:t,"data-state":H0(n),onSelect:me(s.onSelect,()=>r==null?void 0:r(Fh(n)?!0:!n),{checkForDefaultPrevented:!1})})})});mO.displayName=qne;var gO="MenuRadioGroup",[Hne,Gne]=_a(gO,{value:void 0,onValueChange:()=>{}}),vO=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,o=qn(r);return d.jsx(Hne,{scope:e.__scopeMenu,value:n,onValueChange:o,children:d.jsx(W0,{...s,ref:t})})});vO.displayName=gO;var yO="MenuRadioItem",bO=h.forwardRef((e,t)=>{const{value:n,...r}=e,s=Gne(yO,e.__scopeMenu),o=n===s.value;return d.jsx(xO,{scope:e.__scopeMenu,checked:o,children:d.jsx(im,{role:"menuitemradio","aria-checked":o,...r,ref:t,"data-state":H0(o),onSelect:me(r.onSelect,()=>{var i;return(i=s.onValueChange)==null?void 0:i.call(s,n)},{checkForDefaultPrevented:!1})})})});bO.displayName=yO;var q0="MenuItemIndicator",[xO,Kne]=_a(q0,{checked:!1}),wO=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,o=Kne(q0,n);return d.jsx(zr,{present:r||Fh(o.checked)||o.checked===!0,children:d.jsx($e.span,{...s,ref:t,"data-state":H0(o.checked)})})});wO.displayName=q0;var Yne="MenuSeparator",_O=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return d.jsx($e.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});_O.displayName=Yne;var Zne="MenuArrow",EO=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=om(n);return d.jsx(Eb,{...s,...r,ref:t})});EO.displayName=Zne;var Qne="MenuSub",[xie,SO]=_a(Qne),Jc="MenuSubTrigger",CO=h.forwardRef((e,t)=>{const n=Ea(Jc,e.__scopeMenu),r=Td(Jc,e.__scopeMenu),s=SO(Jc,e.__scopeMenu),o=V0(Jc,e.__scopeMenu),i=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=o,c={__scopeMenu:e.__scopeMenu},u=h.useCallback(()=>{i.current&&window.clearTimeout(i.current),i.current=null},[]);return h.useEffect(()=>u,[u]),h.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),d.jsx(U0,{asChild:!0,...c,children:d.jsx(pO,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":NO(n.open),...e,ref:Hs(t,s.onTriggerChange),onClick:f=>{var p;(p=e.onClick)==null||p.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:me(e.onPointerMove,Ku(f=>{o.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!i.current&&(o.onPointerGraceIntentChange(null),i.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:me(e.onPointerLeave,Ku(f=>{var g,y;u();const p=(g=n.content)==null?void 0:g.getBoundingClientRect();if(p){const m=(y=n.content)==null?void 0:y.dataset.side,v=m==="right",b=v?-5:5,x=p[v?"left":"right"],w=p[v?"right":"left"];o.onPointerGraceIntentChange({area:[{x:f.clientX+b,y:f.clientY},{x,y:p.top},{x:w,y:p.top},{x:w,y:p.bottom},{x,y:p.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(f),f.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:me(e.onKeyDown,f=>{var g;const p=o.searchRef.current!=="";e.disabled||p&&f.key===" "||Ane[r.dir].includes(f.key)&&(n.onOpenChange(!0),(g=n.content)==null||g.focus(),f.preventDefault())})})})});CO.displayName=Jc;var TO="MenuSubContent",RO=h.forwardRef((e,t)=>{const n=uO(_r,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,o=Ea(_r,e.__scopeMenu),i=Td(_r,e.__scopeMenu),a=SO(TO,e.__scopeMenu),l=h.useRef(null),c=tt(t,l);return d.jsx(Gu.Provider,{scope:e.__scopeMenu,children:d.jsx(zr,{present:r||o.open,children:d.jsx(Gu.Slot,{scope:e.__scopeMenu,children:d.jsx(z0,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:c,align:"start",side:i.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:u=>{var f;i.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),u.preventDefault()},onCloseAutoFocus:u=>u.preventDefault(),onFocusOutside:me(e.onFocusOutside,u=>{u.target!==a.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:me(e.onEscapeKeyDown,u=>{i.onClose(),u.preventDefault()}),onKeyDown:me(e.onKeyDown,u=>{var g;const f=u.currentTarget.contains(u.target),p=$ne[i.dir].includes(u.key);f&&p&&(o.onOpenChange(!1),(g=a.trigger)==null||g.focus(),u.preventDefault())})})})})})});RO.displayName=TO;function NO(e){return e?"open":"closed"}function Fh(e){return e==="indeterminate"}function H0(e){return Fh(e)?"indeterminate":e?"checked":"unchecked"}function Xne(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Jne(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ere(e,t,n){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let i=Jne(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==n));const l=i.find(c=>c.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function tre(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const a=t[o],l=t[i],c=a.x,u=a.y,f=l.x,p=l.y;u>r!=p>r&&n<(f-c)*(r-u)/(p-u)+c&&(s=!s)}return s}function nre(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return tre(n,t)}function Ku(e){return t=>t.pointerType==="mouse"?e(t):void 0}var rre=cO,sre=U0,ore=dO,ire=fO,are=W0,lre=hO,cre=im,ure=mO,dre=vO,fre=bO,hre=wO,pre=_O,mre=EO,gre=CO,vre=RO,am="DropdownMenu",[yre,wie]=Vr(am,[aO]),Mn=aO(),[bre,PO]=yre(am),jO=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:o,onOpenChange:i,modal:a=!0}=e,l=Mn(t),c=h.useRef(null),[u,f]=Ys({prop:s,defaultProp:o??!1,onChange:i,caller:am});return d.jsx(bre,{scope:t,triggerId:fn(),triggerRef:c,contentId:fn(),open:u,onOpenChange:f,onOpenToggle:h.useCallback(()=>f(p=>!p),[f]),modal:a,children:d.jsx(rre,{...l,open:u,onOpenChange:f,dir:r,modal:a,children:n})})};jO.displayName=am;var AO="DropdownMenuTrigger",$O=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,o=PO(AO,n),i=Mn(n);return d.jsx(sre,{asChild:!0,...i,children:d.jsx($e.button,{type:"button",id:o.triggerId,"aria-haspopup":"menu","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":o.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Hs(t,o.triggerRef),onPointerDown:me(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(o.onOpenToggle(),o.open||a.preventDefault())}),onKeyDown:me(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&o.onOpenToggle(),a.key==="ArrowDown"&&o.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});$O.displayName=AO;var xre="DropdownMenuPortal",DO=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Mn(t);return d.jsx(ore,{...r,...n})};DO.displayName=xre;var kO="DropdownMenuContent",OO=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=PO(kO,n),o=Mn(n),i=h.useRef(!1);return d.jsx(ire,{id:s.contentId,"aria-labelledby":s.triggerId,...o,...r,ref:t,onCloseAutoFocus:me(e.onCloseAutoFocus,a=>{var l;i.current||(l=s.triggerRef.current)==null||l.focus(),i.current=!1,a.preventDefault()}),onInteractOutside:me(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;(!s.modal||u)&&(i.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});OO.displayName=kO;var wre="DropdownMenuGroup",MO=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mn(n);return d.jsx(are,{...s,...r,ref:t})});MO.displayName=wre;var _re="DropdownMenuLabel",IO=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mn(n);return d.jsx(lre,{...s,...r,ref:t})});IO.displayName=_re;var Ere="DropdownMenuItem",FO=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mn(n);return d.jsx(cre,{...s,...r,ref:t})});FO.displayName=Ere;var Sre="DropdownMenuCheckboxItem",LO=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mn(n);return d.jsx(ure,{...s,...r,ref:t})});LO.displayName=Sre;var Cre="DropdownMenuRadioGroup",Tre=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mn(n);return d.jsx(dre,{...s,...r,ref:t})});Tre.displayName=Cre;var Rre="DropdownMenuRadioItem",UO=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mn(n);return d.jsx(fre,{...s,...r,ref:t})});UO.displayName=Rre;var Nre="DropdownMenuItemIndicator",BO=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mn(n);return d.jsx(hre,{...s,...r,ref:t})});BO.displayName=Nre;var Pre="DropdownMenuSeparator",VO=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mn(n);return d.jsx(pre,{...s,...r,ref:t})});VO.displayName=Pre;var jre="DropdownMenuArrow",Are=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mn(n);return d.jsx(mre,{...s,...r,ref:t})});Are.displayName=jre;var $re="DropdownMenuSubTrigger",zO=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mn(n);return d.jsx(gre,{...s,...r,ref:t})});zO.displayName=$re;var Dre="DropdownMenuSubContent",WO=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Mn(n);return d.jsx(vre,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});WO.displayName=Dre;var kre=jO,Ore=$O,Mre=DO,qO=OO,Ire=MO,HO=IO,GO=FO,KO=LO,YO=UO,ZO=BO,QO=VO,XO=zO,JO=WO;const Fre=kre,Lre=Ore,_ie=Ire,Ure=h.forwardRef(({className:e,inset:t,children:n,...r},s)=>d.jsxs(XO,{ref:s,className:se("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,d.jsx(FB,{className:"ml-auto h-4 w-4"})]}));Ure.displayName=XO.displayName;const Bre=h.forwardRef(({className:e,...t},n)=>d.jsx(JO,{ref:n,className:se("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...t}));Bre.displayName=JO.displayName;const eM=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>d.jsx(Mre,{children:d.jsx(qO,{ref:r,sideOffset:t,className:se("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",e),...n})}));eM.displayName=qO.displayName;const Vre=h.forwardRef(({className:e,inset:t,...n},r)=>d.jsx(GO,{ref:r,className:se("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Vre.displayName=GO.displayName;const zre=h.forwardRef(({className:e,children:t,checked:n,...r},s)=>d.jsxs(KO,{ref:s,className:se("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(ZO,{children:d.jsx(ia,{className:"h-4 w-4"})})}),t]}));zre.displayName=KO.displayName;const Wre=h.forwardRef(({className:e,children:t,...n},r)=>d.jsxs(YO,{ref:r,className:se("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[d.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:d.jsx(ZO,{children:d.jsx(eV,{className:"h-4 w-4 fill-current"})})}),t]}));Wre.displayName=YO.displayName;const qre=h.forwardRef(({className:e,inset:t,...n},r)=>d.jsx(HO,{ref:r,className:se("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));qre.displayName=HO.displayName;const Hre=h.forwardRef(({className:e,...t},n)=>d.jsx(QO,{ref:n,className:se("-mx-1 my-1 h-px bg-muted",e),...t}));Hre.displayName=QO.displayName;const Gre=({count:e})=>!e||e===0?null:d.jsx("span",{className:"absolute top-1 right-0 h-2 w-2 rounded-full bg-blue-400"}),rC=({children:e,to:t,badgeCount:n,end:r})=>d.jsx(kN,{end:r,to:t,className:({isActive:s,isPending:o})=>se("font-medium relative items-center px-2 py-1 rounded-md text-gray-900 text-sm transition-colors","rounded-md hover:text-zuplo-600",s&&"text-zuplo-700",o&&"text-zuplo-700 animate-pulse"),children:({isActive:s})=>d.jsxs(d.Fragment,{children:[s&&d.jsx(Hc.div,{layoutId:"local-navigation-item-background",transition:{type:"spring",bounce:.1,duration:.4},className:"absolute inset-0 rounded-md -z-10 bg-zuplo-100"}),e,d.jsx(Gre,{count:n})]})}),Kre=()=>d.jsx("div",{className:"w-2 h-2 rounded-full bg-green-500"}),Yre=()=>{const e=pn(),[t,n]=h.useState(!1),r=mne(e.environment),{copyToClipboard:s,state:o}=Op(r??"");return d.jsxs(Fre,{open:t,onOpenChange:n,children:[d.jsx(Lre,{asChild:!0,children:d.jsxs(Fe,{variant:"white",size:"sm",className:"gap-2 flex justify-between h-8 mt-1",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Zb,{size:16}),"Deployment URLs"]}),d.jsx(lp,{size:16})]})}),d.jsx(eM,{className:"divide-y p-0",align:"end",children:r?d.jsxs("div",{className:"p-4",children:[d.jsx("div",{className:"font-medium text-lg",children:"Local Development"}),d.jsx("div",{className:"h-2"}),d.jsxs("div",{children:[d.jsx("div",{className:"uppercase text-muted-foreground font-semibold text-xs",children:"Gateway"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Kre,{}),d.jsx("div",{className:"text-sm max-w-52 truncate break-all",children:d.jsx(xt,{href:r,target:"_blank",variant:"ghost",rel:"noopener noreferrer",className:"hover:underline",children:r})}),d.jsx("button",{type:"button",className:"p-1 hover:bg-muted rounded-md transition-colors",onClick:()=>{s(),n(!1)},children:o==="copied"?d.jsx(ia,{size:16,className:"text-green-500"}):d.jsx(tN,{size:16})})]})]})]}):d.jsxs("div",{className:"w-60 p-5 text-center",children:[d.jsx("div",{className:"text-2xl font-medium",children:"🙈"}),d.jsx("div",{className:"text-md mt-4",children:"Deployment URL not configured. Make sure your local gateway is running."})]})})]})},Zre=()=>d.jsxs("div",{className:"flex flex-row justify-between w-full border-b border-gray-200 bg-white px-4 pb-3 pt-2",children:[d.jsxs("nav",{"aria-label":"Sidebar",className:"flex gap-2 items-center mt-2",children:[d.jsx(rC,{end:!0,to:"/dev/project/local",children:"Project"}),d.jsx(rC,{to:"/dev/project/local/edit",children:"Code"})]}),d.jsx(Yre,{})]}),Qre=()=>d.jsxs("div",{className:"h-screen flex flex-col",children:[d.jsx(Zre,{}),d.jsx(h.Suspense,{fallback:null,children:d.jsx(ax,{})})]}),Xre="You have modified files that are not saved. If you leave before saving you will lose your changes.",Jre=e=>{if(e.toLowerCase().endsWith(".json"))return"json";if(e.toLowerCase().endsWith(".ts"))return"typescript";if(e.toLowerCase().endsWith(".css"))return"css";if(e.toLowerCase().endsWith(".md"))return"markdown"};async function Qi(e,t){const n=await vp(`/deployments/${e}/fs/file?path=${t}`),r=await n.text(),s=n.headers.get("Last-Modified"),o=s?new Date(s).getTime():void 0;return{content:r,path:t,lastModified:o}}async function ese(e,t){const r=await(await vp(`/deployments/${e}/fs/dir?path=${t}&recursive=true`)).json();if(r!=null&&r.result){const s=r.result.map(o=>({path:o[0],saveState:ut.unmodified,type:o[1]}));return s.push({path:"",saveState:ut.unmodified,type:2}),s}else return[]}async function tse(e,t,n){const r={"Content-Type":"text/plain"};t.lastModified&&(r["If-Unmodified-Since"]=new Date(t.lastModified).toUTCString()),r["x-force-save"]="true";const s=await vp(`/deployments/${e}/fs/file?path=${t.path}`,{method:"POST",headers:r,body:t.content??""});if(!s.ok)throw new Error(`Failed to save file: ${s.statusText}`)}const Rd=e=>{const[t,n]=h.useState("idle"),[r,s]=h.useState(),[o,i]=h.useState(null),a=h.useCallback(async(...l)=>{n("loading"),i(null),s(void 0);try{const c=await e(...l);return n("hasValue"),i(c),c}catch(c){throw s(c instanceof Error?c:new Error(c)),n("hasError"),c}},[e]);return{state:t,error:r,execute:a,value:o}},nse=()=>({isReadOnly:pn().environment.environmentType!==nr.WORKING_COPY});function rse(){return new URLSearchParams(Hr().search)}function Eie(e,t){const[n,r]=MN(),s=Object.fromEntries(n);return[n.get(e)??t,o=>r(o===void 0?Object.fromEntries(Object.entries(s).filter(([i])=>i!==e)):{...s,[e]:o})]}function Sie(e,t){const[n,r]=MN();return[n.get(e)?n.getAll(e):t,o=>r({...Object.fromEntries(n),[e]:o})]}var Fg,sC;function sse(){if(sC)return Fg;sC=1,Fg=e;function e(r,s,o){r instanceof RegExp&&(r=t(r,o)),s instanceof RegExp&&(s=t(s,o));var i=n(r,s,o);return i&&{start:i[0],end:i[1],pre:o.slice(0,i[0]),body:o.slice(i[0]+r.length,i[1]),post:o.slice(i[1]+s.length)}}function t(r,s){var o=s.match(r);return o?o[0]:null}e.range=n;function n(r,s,o){var i,a,l,c,u,f=o.indexOf(r),p=o.indexOf(s,f+1),g=f;if(f>=0&&p>0){if(r===s)return[f,p];for(i=[],l=o.length;g>=0&&!u;)g==f?(i.push(g),f=o.indexOf(r,g+1)):i.length==1?u=[i.pop(),p]:(a=i.pop(),a<l&&(l=a,c=p),p=o.indexOf(s,g+1)),g=f<p&&f>=0?f:p;i.length&&(u=[l,c])}return u}return Fg}var Lg,oC;function ose(){if(oC)return Lg;oC=1;var e=sse();Lg=u;var t="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",r="\0CLOSE"+Math.random()+"\0",s="\0COMMA"+Math.random()+"\0",o="\0PERIOD"+Math.random()+"\0";function i(v){return parseInt(v,10)==v?parseInt(v,10):v.charCodeAt(0)}function a(v){return v.split("\\\\").join(t).split("\\{").join(n).split("\\}").join(r).split("\\,").join(s).split("\\.").join(o)}function l(v){return v.split(t).join("\\").split(n).join("{").split(r).join("}").split(s).join(",").split(o).join(".")}function c(v){if(!v)return[""];var b=[],x=e("{","}",v);if(!x)return v.split(",");var w=x.pre,_=x.body,E=x.post,S=w.split(",");S[S.length-1]+="{"+_+"}";var R=c(E);return E.length&&(S[S.length-1]+=R.shift(),S.push.apply(S,R)),b.push.apply(b,S),b}function u(v){return v?(v.substr(0,2)==="{}"&&(v="\\{\\}"+v.substr(2)),m(a(v),!0).map(l)):[]}function f(v){return"{"+v+"}"}function p(v){return/^-?0\d/.test(v)}function g(v,b){return v<=b}function y(v,b){return v>=b}function m(v,b){var x=[],w=e("{","}",v);if(!w)return[v];var _=w.pre,E=w.post.length?m(w.post,!1):[""];if(/\$$/.test(w.pre))for(var S=0;S<E.length;S++){var R=_+"{"+w.body+"}"+E[S];x.push(R)}else{var C=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(w.body),N=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(w.body),k=C||N,V=w.body.indexOf(",")>=0;if(!k&&!V)return w.post.match(/,.*\}/)?(v=w.pre+"{"+w.body+r+w.post,m(v)):[v];var L;if(k)L=w.body.split(/\.\./);else if(L=c(w.body),L.length===1&&(L=m(L[0],!1).map(f),L.length===1))return E.map(function(ae){return w.pre+L[0]+ae});var G;if(k){var $=i(L[0]),I=i(L[1]),j=Math.max(L[0].length,L[1].length),F=L.length==3?Math.abs(i(L[2])):1,O=g,U=I<$;U&&(F*=-1,O=y);var Y=L.some(p);G=[];for(var ee=$;O(ee,I);ee+=F){var M;if(N)M=String.fromCharCode(ee),M==="\\"&&(M="");else if(M=String(ee),Y){var Q=j-M.length;if(Q>0){var H=new Array(Q+1).join("0");ee<0?M="-"+H+M.slice(1):M=H+M}}G.push(M)}}else{G=[];for(var K=0;K<L.length;K++)G.push.apply(G,m(L[K],!1))}for(var K=0;K<G.length;K++)for(var S=0;S<E.length;S++){var R=_+G[K]+E[S];(!b||k||R)&&x.push(R)}}return x}return Lg}var ise=ose();const ase=Bl(ise),lse=1024*64,Lh=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>lse)throw new TypeError("pattern is too long")},cse={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},$c=e=>e.replace(/[[\]\\-]/g,"\\$&"),use=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),iC=e=>e.join(""),dse=(e,t)=>{const n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");const r=[],s=[];let o=n+1,i=!1,a=!1,l=!1,c=!1,u=n,f="";e:for(;o<e.length;){const m=e.charAt(o);if((m==="!"||m==="^")&&o===n+1){c=!0,o++;continue}if(m==="]"&&i&&!l){u=o+1;break}if(i=!0,m==="\\"&&!l){l=!0,o++;continue}if(m==="["&&!l){for(const[v,[b,x,w]]of Object.entries(cse))if(e.startsWith(v,o)){if(f)return["$.",!1,e.length-n,!0];o+=v.length,w?s.push(b):r.push(b),a=a||x;continue e}}if(l=!1,f){m>f?r.push($c(f)+"-"+$c(m)):m===f&&r.push($c(m)),f="",o++;continue}if(e.startsWith("-]",o+1)){r.push($c(m+"-")),o+=2;continue}if(e.startsWith("-",o+1)){f=m,o+=2;continue}r.push($c(m)),o++}if(u<o)return["",!1,0,!1];if(!r.length&&!s.length)return["$.",!1,e.length-n,!0];if(s.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!c){const m=r[0].length===2?r[0].slice(-1):r[0];return[use(m),!1,u-n,!1]}const p="["+(c?"^":"")+iC(r)+"]",g="["+(c?"":"^")+iC(s)+"]";return[r.length&&s.length?"("+p+"|"+g+")":r.length?p:g,a,u-n,!0]},eu=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),fse=new Set(["!","?","+","*","@"]),aC=e=>fse.has(e),hse="(?!\\.\\.?(?:$|/))",Ug="(?!\\.)",pse=new Set(["[","."]),mse=new Set(["..","."]),gse=new Set("().*{}+?[]^$\\!"),vse=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),G0="[^/]",lC=G0+"*?",cC=G0+"+?";var Ht,tn,Ms,yt,Vt,$o,Hi,Do,mr,Gi,Ju,Vh,tM,Vo,Lf,nM;const Nn=class Nn{constructor(t,n,r={}){we(this,Vh);rt(this,"type");we(this,Ht);we(this,tn);we(this,Ms,!1);we(this,yt,[]);we(this,Vt);we(this,$o);we(this,Hi);we(this,Do,!1);we(this,mr);we(this,Gi);we(this,Ju,!1);this.type=t,t&&ie(this,tn,!0),ie(this,Vt,n),ie(this,Ht,T(this,Vt)?T(T(this,Vt),Ht):this),ie(this,mr,T(this,Ht)===this?r:T(T(this,Ht),mr)),ie(this,Hi,T(this,Ht)===this?[]:T(T(this,Ht),Hi)),t==="!"&&!T(T(this,Ht),Do)&&T(this,Hi).push(this),ie(this,$o,T(this,Vt)?T(T(this,Vt),yt).length:0)}get hasMagic(){if(T(this,tn)!==void 0)return T(this,tn);for(const t of T(this,yt))if(typeof t!="string"&&(t.type||t.hasMagic))return ie(this,tn,!0);return T(this,tn)}toString(){return T(this,Gi)!==void 0?T(this,Gi):this.type?ie(this,Gi,this.type+"("+T(this,yt).map(t=>String(t)).join("|")+")"):ie(this,Gi,T(this,yt).map(t=>String(t)).join(""))}push(...t){for(const n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof Nn&&T(n,Vt)===this))throw new Error("invalid part: "+n);T(this,yt).push(n)}}toJSON(){var n;const t=this.type===null?T(this,yt).slice().map(r=>typeof r=="string"?r:r.toJSON()):[this.type,...T(this,yt).map(r=>r.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===T(this,Ht)||T(T(this,Ht),Do)&&((n=T(this,Vt))==null?void 0:n.type)==="!")&&t.push({}),t}isStart(){var n;if(T(this,Ht)===this)return!0;if(!((n=T(this,Vt))!=null&&n.isStart()))return!1;if(T(this,$o)===0)return!0;const t=T(this,Vt);for(let r=0;r<T(this,$o);r++){const s=T(t,yt)[r];if(!(s instanceof Nn&&s.type==="!"))return!1}return!0}isEnd(){var n,r,s;if(T(this,Ht)===this||((n=T(this,Vt))==null?void 0:n.type)==="!")return!0;if(!((r=T(this,Vt))!=null&&r.isEnd()))return!1;if(!this.type)return(s=T(this,Vt))==null?void 0:s.isEnd();const t=T(this,Vt)?T(T(this,Vt),yt).length:0;return T(this,$o)===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){const n=new Nn(this.type,t);for(const r of T(this,yt))n.copyIn(r);return n}static fromGlob(t,n={}){var s;const r=new Nn(null,void 0,n);return We(s=Nn,Vo,Lf).call(s,t,r,0,n),r}toMMPattern(){if(this!==T(this,Ht))return T(this,Ht).toMMPattern();const t=this.toString(),[n,r,s,o]=this.toRegExpSource();if(!(s||T(this,tn)||T(this,mr).nocase&&!T(this,mr).nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;const a=(T(this,mr).nocase?"i":"")+(o?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:t})}toRegExpSource(){var s;if(T(this,Ht)===this&&We(this,Vh,tM).call(this),!this.type){const o=this.isStart()&&this.isEnd(),i=T(this,yt).map(u=>{var m;const[f,p,g,y]=typeof u=="string"?We(m=Nn,Vo,nM).call(m,u,T(this,tn),o):u.toRegExpSource();return ie(this,tn,T(this,tn)||g),ie(this,Ms,T(this,Ms)||y),f}).join("");let a="";if(this.isStart()&&typeof T(this,yt)[0]=="string"&&!(T(this,yt).length===1&&mse.has(T(this,yt)[0]))){const f=pse,p=T(this,mr).dot&&f.has(i.charAt(0))||i.startsWith("\\.")&&f.has(i.charAt(2))||i.startsWith("\\.\\.")&&f.has(i.charAt(4)),g=!T(this,mr).dot&&f.has(i.charAt(0));a=p?hse:g?Ug:""}let l="";return this.isEnd()&&T(T(this,Ht),Do)&&((s=T(this,Vt))==null?void 0:s.type)==="!"&&(l="(?:$|\\/)"),[a+i+l,eu(i),ie(this,tn,!!T(this,tn)),T(this,Ms)]}const t=this.type==="!"?"(?:(?!(?:":"(?:",n=T(this,yt).map(o=>{if(typeof o=="string")throw new Error("string type in extglob ast??");const[i,a,l,c]=o.toRegExpSource();return ie(this,Ms,T(this,Ms)||c),i}).filter(o=>!(this.isStart()&&this.isEnd())||!!o).join("|");if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){const o=this.toString();return ie(this,yt,[o]),this.type=null,ie(this,tn,void 0),[o,eu(this.toString()),!1,!1]}let r="";if(this.type==="!"&&T(this,Ju))r=(this.isStart()&&!T(this,mr).dot?Ug:"")+cC;else{const o=this.type==="!"?"))"+(this.isStart()&&!T(this,mr).dot?Ug:"")+lC+")":this.type==="@"?")":`)${this.type}`;r=t+n+o}return[r,eu(n),ie(this,tn,!!T(this,tn)),T(this,Ms)]}};Ht=new WeakMap,tn=new WeakMap,Ms=new WeakMap,yt=new WeakMap,Vt=new WeakMap,$o=new WeakMap,Hi=new WeakMap,Do=new WeakMap,mr=new WeakMap,Gi=new WeakMap,Ju=new WeakMap,Vh=new WeakSet,tM=function(){if(this!==T(this,Ht))throw new Error("should only call on root");if(T(this,Do))return this;this.toString(),ie(this,Do,!0);let t;for(;t=T(this,Hi).pop();){if(t.type!=="!")continue;let n=t,r=T(n,Vt);for(;r;){for(let s=T(n,$o)+1;!r.type&&s<T(r,yt).length;s++)for(const o of T(t,yt)){if(typeof o=="string")throw new Error("string part in extglob AST??");o.copyIn(T(r,yt)[s])}n=r,r=T(n,Vt)}}return this},Vo=new WeakSet,Lf=function(t,n,r,s){var g,y;let o=!1,i=!1,a=-1,l=!1;if(n.type===null){let m=r,v="";for(;m<t.length;){const b=t.charAt(m++);if(o||b==="\\"){o=!o,v+=b;continue}if(i){m===a+1?(b==="^"||b==="!")&&(l=!0):b==="]"&&!(m===a+2&&l)&&(i=!1),v+=b;continue}else if(b==="["){i=!0,a=m,l=!1,v+=b;continue}if(!s.noext&&aC(b)&&t.charAt(m)==="("){n.push(v),v="";const x=new Nn(b,n);m=We(g=Nn,Vo,Lf).call(g,t,x,m,s),n.push(x);continue}v+=b}return n.push(v),m}let c=r+1,u=new Nn(null,n);const f=[];let p="";for(;c<t.length;){const m=t.charAt(c++);if(o||m==="\\"){o=!o,p+=m;continue}if(i){c===a+1?(m==="^"||m==="!")&&(l=!0):m==="]"&&!(c===a+2&&l)&&(i=!1),p+=m;continue}else if(m==="["){i=!0,a=c,l=!1,p+=m;continue}if(aC(m)&&t.charAt(c)==="("){u.push(p),p="";const v=new Nn(m,u);u.push(v),c=We(y=Nn,Vo,Lf).call(y,t,v,c,s);continue}if(m==="|"){u.push(p),p="",f.push(u),u=new Nn(null,n);continue}if(m===")")return p===""&&T(n,yt).length===0&&ie(n,Ju,!0),u.push(p),p="",n.push(...f,u),c;p+=m}return n.type=null,ie(n,tn,void 0),ie(n,yt,[t.substring(r-1)]),c},nM=function(t,n,r=!1){let s=!1,o="",i=!1;for(let a=0;a<t.length;a++){const l=t.charAt(a);if(s){s=!1,o+=(gse.has(l)?"\\":"")+l;continue}if(l==="\\"){a===t.length-1?o+="\\\\":s=!0;continue}if(l==="["){const[c,u,f,p]=dse(t,a);if(f){o+=c,i=i||u,a+=f-1,n=n||p;continue}}if(l==="*"){r&&t==="*"?o+=cC:o+=lC,n=!0;continue}if(l==="?"){o+=G0,n=!0;continue}o+=vse(l)}return[o,eu(t),!!n,i]},we(Nn,Vo);let Uh=Nn;const yse=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");var Bg={};const zt=(e,t,n={})=>(Lh(t),!n.nocomment&&t.charAt(0)==="#"?!1:new lm(t,n).match(e)),bse=/^\*+([^+@!?\*\[\(]*)$/,xse=e=>t=>!t.startsWith(".")&&t.endsWith(e),wse=e=>t=>t.endsWith(e),_se=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),Ese=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),Sse=/^\*+\.\*+$/,Cse=e=>!e.startsWith(".")&&e.includes("."),Tse=e=>e!=="."&&e!==".."&&e.includes("."),Rse=/^\.\*+$/,Nse=e=>e!=="."&&e!==".."&&e.startsWith("."),Pse=/^\*+$/,jse=e=>e.length!==0&&!e.startsWith("."),Ase=e=>e.length!==0&&e!=="."&&e!=="..",$se=/^\?+([^+@!?\*\[\(]*)?$/,Dse=([e,t=""])=>{const n=rM([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},kse=([e,t=""])=>{const n=sM([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},Ose=([e,t=""])=>{const n=sM([e]);return t?r=>n(r)&&r.endsWith(t):n},Mse=([e,t=""])=>{const n=rM([e]);return t?r=>n(r)&&r.endsWith(t):n},rM=([e])=>{const t=e.length;return n=>n.length===t&&!n.startsWith(".")},sM=([e])=>{const t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},oM=typeof process=="object"&&process?typeof Bg=="object"&&Bg&&Bg.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",uC={win32:{sep:"\\"},posix:{sep:"/"}},Ise=oM==="win32"?uC.win32.sep:uC.posix.sep;zt.sep=Ise;const hr=Symbol("globstar **");zt.GLOBSTAR=hr;const Fse="[^/]",Lse=Fse+"*?",Use="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Bse="(?:(?!(?:\\/|^)\\.).)*?",Vse=(e,t={})=>n=>zt(n,e,t);zt.filter=Vse;const dr=(e,t={})=>Object.assign({},e,t),zse=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return zt;const t=zt;return Object.assign((r,s,o={})=>t(r,s,dr(e,o)),{Minimatch:class extends t.Minimatch{constructor(s,o={}){super(s,dr(e,o))}static defaults(s){return t.defaults(dr(e,s)).Minimatch}},AST:class extends t.AST{constructor(s,o,i={}){super(s,o,dr(e,i))}static fromGlob(s,o={}){return t.AST.fromGlob(s,dr(e,o))}},unescape:(r,s={})=>t.unescape(r,dr(e,s)),escape:(r,s={})=>t.escape(r,dr(e,s)),filter:(r,s={})=>t.filter(r,dr(e,s)),defaults:r=>t.defaults(dr(e,r)),makeRe:(r,s={})=>t.makeRe(r,dr(e,s)),braceExpand:(r,s={})=>t.braceExpand(r,dr(e,s)),match:(r,s,o={})=>t.match(r,s,dr(e,o)),sep:t.sep,GLOBSTAR:hr})};zt.defaults=zse;const iM=(e,t={})=>(Lh(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:ase(e));zt.braceExpand=iM;const Wse=(e,t={})=>new lm(e,t).makeRe();zt.makeRe=Wse;const qse=(e,t,n={})=>{const r=new lm(t,n);return e=e.filter(s=>r.match(s)),r.options.nonull&&!e.length&&e.push(t),e};zt.match=qse;const dC=/[?*]|[+@!]\(.*?\)|\[|\]/,Hse=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class lm{constructor(t,n={}){rt(this,"options");rt(this,"set");rt(this,"pattern");rt(this,"windowsPathsNoEscape");rt(this,"nonegate");rt(this,"negate");rt(this,"comment");rt(this,"empty");rt(this,"preserveMultipleSlashes");rt(this,"partial");rt(this,"globSet");rt(this,"globParts");rt(this,"nocase");rt(this,"isWindows");rt(this,"platform");rt(this,"windowsNoMagicRoot");rt(this,"regexp");Lh(t),n=n||{},this.options=n,this.pattern=t,this.platform=n.platform||oM,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){const t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...o)=>console.error(...o)),this.debug(this.pattern,this.globSet);const r=this.globSet.map(o=>this.slashSplit(o));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let s=this.globParts.map((o,i,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const l=o[0]===""&&o[1]===""&&(o[2]==="?"||!dC.test(o[2]))&&!dC.test(o[3]),c=/^[a-z]:/i.test(o[0]);if(l)return[...o.slice(0,4),...o.slice(4).map(u=>this.parse(u))];if(c)return[o[0],...o.slice(1).map(u=>this.parse(u))]}return o.map(l=>this.parse(l))});if(this.debug(this.pattern,s),this.set=s.filter(o=>o.indexOf(!1)===-1),this.isWindows)for(let o=0;o<this.set.length;o++){const i=this.set[o];i[0]===""&&i[1]===""&&this.globParts[o][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let s=0;s<t[r].length;s++)t[r][s]==="**"&&(t[r][s]="*");const{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let s=r;for(;n[s+1]==="**";)s++;s!==r&&n.splice(r,s-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,s)=>{const o=r[r.length-1];return s==="**"&&o==="**"?r:s===".."&&o&&o!==".."&&o!=="."&&o!=="**"?(r.pop(),r):(r.push(s),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){const o=t[s];s===1&&o===""&&t[0]===""||(o==="."||o==="")&&(n=!0,t.splice(s,1),s--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){const s=t[r-1];s&&s!=="."&&s!==".."&&s!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let s=-1;for(;(s=r.indexOf("**",s+1))!==-1;){let i=s;for(;r[i+1]==="**";)i++;i>s&&r.splice(s+1,i-s);let a=r[s+1];const l=r[s+2],c=r[s+3];if(a!==".."||!l||l==="."||l===".."||!c||c==="."||c==="..")continue;n=!0,r.splice(s,1);const u=r.slice(0);u[s]="**",t.push(u),s--}if(!this.preserveMultipleSlashes){for(let i=1;i<r.length-1;i++){const a=r[i];i===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(i,1),i--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let o=0;for(;(o=r.indexOf("..",o+1))!==-1;){const i=r[o-1];if(i&&i!=="."&&i!==".."&&i!=="**"){n=!0;const l=o===1&&r[o+1]==="**"?["."]:[];r.splice(o-1,2,...l),r.length===0&&r.push(""),o-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){const s=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);s&&(t[n]=s,t[r]=[])}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let s=0,o=0,i=[],a="";for(;s<t.length&&o<n.length;)if(t[s]===n[o])i.push(a==="b"?n[o]:t[s]),s++,o++;else if(r&&t[s]==="**"&&n[o]===t[s+1])i.push(t[s]),s++;else if(r&&n[o]==="**"&&t[s]===n[o+1])i.push(n[o]),o++;else if(t[s]==="*"&&n[o]&&(this.options.dot||!n[o].startsWith("."))&&n[o]!=="**"){if(a==="b")return!1;a="a",i.push(t[s]),s++,o++}else if(n[o]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(a==="a")return!1;a="b",i.push(n[o]),s++,o++}else return!1;return t.length===n.length&&i}parseNegate(){if(this.nonegate)return;const t=this.pattern;let n=!1,r=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){const s=this.options;if(this.isWindows){const m=t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),v=n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]);if(m&&v){const b=t[3],x=n[3];b.toLowerCase()===x.toLowerCase()&&(t[3]=x)}else if(v&&typeof t[0]=="string"){const b=n[3],x=t[0];b.toLowerCase()===x.toLowerCase()&&(n[3]=x,n=n.slice(3))}else if(m&&typeof n[0]=="string"){const b=t[3];b.toLowerCase()===n[0].toLowerCase()&&(n[0]=b,t=t.slice(3))}}const{optimizationLevel:o=1}=this.options;o>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:n}),this.debug("matchOne",t.length,n.length);for(var i=0,a=0,l=t.length,c=n.length;i<l&&a<c;i++,a++){this.debug("matchOne loop");var u=n[a],f=t[i];if(this.debug(n,u,f),u===!1)return!1;if(u===hr){this.debug("GLOBSTAR",[n,u,f]);var p=i,g=a+1;if(g===c){for(this.debug("** at the end");i<l;i++)if(t[i]==="."||t[i]===".."||!s.dot&&t[i].charAt(0)===".")return!1;return!0}for(;p<l;){var y=t[p];if(this.debug(`
|
367
|
+
globstar while`,t,p,n,g,y),this.matchOne(t.slice(p),n.slice(g),r))return this.debug("globstar found match!",p,l,y),!0;if(y==="."||y===".."||!s.dot&&y.charAt(0)==="."){this.debug("dot detected!",t,p,n,g);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(r&&(this.debug(`
|
368
|
+
>>> no match, partial?`,t,p,n,g),p===l))}let m;if(typeof u=="string"?(m=f===u,this.debug("string match",u,f,m)):(m=u.test(f),this.debug("pattern match",u,f,m)),!m)return!1}if(i===l&&a===c)return!0;if(i===l)return r;if(a===c)return i===l-1&&t[i]==="";throw new Error("wtf?")}braceExpand(){return iM(this.pattern,this.options)}parse(t){Lh(t);const n=this.options;if(t==="**")return hr;if(t==="")return"";let r,s=null;(r=t.match(Pse))?s=n.dot?Ase:jse:(r=t.match(bse))?s=(n.nocase?n.dot?Ese:_se:n.dot?wse:xse)(r[1]):(r=t.match($se))?s=(n.nocase?n.dot?kse:Dse:n.dot?Ose:Mse)(r):(r=t.match(Sse))?s=n.dot?Tse:Cse:(r=t.match(Rse))&&(s=Nse);const o=Uh.fromGlob(t,this.options).toMMPattern();return s?Object.assign(o,{test:s}):o}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const t=this.set;if(!t.length)return this.regexp=!1,this.regexp;const n=this.options,r=n.noglobstar?Lse:n.dot?Use:Bse,s=new Set(n.nocase?["i"]:[]);let o=t.map(l=>{const c=l.map(u=>{if(u instanceof RegExp)for(const f of u.flags.split(""))s.add(f);return typeof u=="string"?Hse(u):u===hr?hr:u._src});return c.forEach((u,f)=>{const p=c[f+1],g=c[f-1];u!==hr||g===hr||(g===void 0?p!==void 0&&p!==hr?c[f+1]="(?:\\/|"+r+"\\/)?"+p:c[f]=r:p===void 0?c[f-1]=g+"(?:\\/|"+r+")?":p!==hr&&(c[f-1]=g+"(?:\\/|\\/"+r+"\\/)"+p,c[f+1]=hr))}),c.filter(u=>u!==hr).join("/")}).join("|");const[i,a]=t.length>1?["(?:",")"]:["",""];o="^"+i+o+a+"$",this.negate&&(o="^(?!"+o+").+$");try{this.regexp=new RegExp(o,[...s].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;const r=this.options;this.isWindows&&(t=t.split("\\").join("/"));const s=this.slashSplit(t);this.debug(this.pattern,"split",s);const o=this.set;this.debug(this.pattern,"set",o);let i=s[s.length-1];if(!i)for(let a=s.length-2;!i&&a>=0;a--)i=s[a];for(let a=0;a<o.length;a++){const l=o[a];let c=s;if(r.matchBase&&l.length===1&&(c=[i]),this.matchOne(c,l,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return zt.defaults(t).Minimatch}}zt.AST=Uh;zt.Minimatch=lm;zt.escape=yse;zt.unescape=eu;const Gse=()=>{const e=It();return Rt({mutationFn:async n=>await e.fetch(Mt.directories.createDirectory(n))})},Rie=(e,t)=>ar(ye.file(e,t),{text:!0,enabled:!!e,select:n=>({content:n,contentType:"text/plain",language:Jre(t),path:t})}),Kse=()=>{const e=It();return Rt({mutationFn:async t=>await e.fetch(Mt.fileTransactions.saveFile(t))})},K0=e=>{const t=It();return Rt({mutationFn:async n=>{if(!n.environmentName||!n.files)throw new Error("No environment name or files provided");return await(await t.fetch(await Mt.fileTransactions.saveMultipleFiles(n))).json()},mutationKey:K0.mutationKey,...e})};K0.mutationKey=["saveStatus"];const Yse=()=>{const e=It();return Rt({mutationFn:async n=>await e.fetch(Mt.fileTransactions.deleteFile(n))})},Zse=()=>{const e=It();return Rt({mutationFn:async n=>await e.fetch(Mt.fileTransactions.renameFile(n))})};function Qse(e,t){return h.useCallback(async()=>{const n=await ese(t,"/"),r=e.map(i=>i.fileGlob),s=e.map(i=>{const a=[i.folderName];return i.subdirectoryGlob?a.concat(i.subdirectoryGlob):a}).flat();return n.filter(i=>i.type===Qs.Directory&&s.some(l=>zt(i.path,l))?!0:r.find(l=>zt(i.path,l))!==void 0)},[t])}function Nie(){const{logEvent:e}=ft(),t=ac(),n=hj(),r=Ot(o=>o.showSaveConflict);return K0({onMutate:({files:o})=>{o.forEach(i=>{t({...i,saveState:ut.saving})})},onSuccess:(o,{files:i})=>{i.forEach(a=>{t({...a,saveState:ut.unmodified})})},onError:(o,{files:i})=>{var l;if(o instanceof Error&&"status"in o&&o.status===409){const u=(l=o.body)==null?void 0:l.conflictedFiles;u&&u.length>0&&r(u[0]);return}i.forEach(c=>{t({...c,saveState:ut.modified})}),e("file-save-failed",{fileNames:n.map(c=>c.path).join(", "),error:o instanceof Error?o.message:""})}})}function Pie(){const e=pn(),{logEvent:t}=ft(),n=lM(),r=ac(),s=Yse(),{isReadOnly:o}=nse(),{execute:i}=Rd(async a=>{if(o)return{success:!1,error:new Error("Unable to delete file - environment is read-only")};const l=a.saveState;r({...a,saveState:ut.removing});try{return await s.mutateAsync({environmentName:e.environment.name,filePath:a.path}),n(a.path),t("file-deleted",{fileName:a.path,account:e.account.name,project:e.project.name,environment:e.environment.name}),{success:!0}}catch(c){return t("file-deletion-failed",{message:c instanceof Error?c.message:"Unknown error",account:e.account.name,project:e.project.name,environment:e.environment.name,error:c instanceof Error?c.message:"Unknown error"}),On(c),r({...a,saveState:l}),{success:!1,error:c}}});return i}function jie(){const e=ba(),{logEvent:t}=ft(),n=ac(),r=Ot(a=>a.projectTreeNodes),s=Kse(),o=pn(["account","project","environment"]),{execute:i}=Rd(async(a,l,c,u,f)=>{var _,E;if(!e)return;const p=c??u.defaultFileTemplate,g=u.createExtensions[p],y=a.toLowerCase().endsWith(`.${g}`)||a===((_=u.predefinedTemplateFilename)==null?void 0:_[p])?a:`${a}.${g}`,m=`${l}/${y}`,v=(c&&((E=u.newFileTemplates[c])==null?void 0:E.trimStart()))??f??"",b=r.find(S=>S.path===m);if(b)return b;const x={content:v,path:m},w={saveState:ut.new,type:Qs.File,...x};try{return n(w),e.editor.createModel(x.content??"",void 0,e.Uri.file(m)),await s.mutateAsync({environmentName:o.environment.name,file:x,accountName:o.account.name,projectName:o.project.name}),n({...w,saveState:ut.unmodified}),t("file-added",{fileName:w.path,strategy:u.name,environment:o.environment.name}),x}catch(S){t("file-creation-failed",{environment:o.environment.name,error:S instanceof Error?S.message:""}),On(S),n({...w,saveState:ut.modified});return}});return i}function Aie(e){const t=ba(),{logEvent:n}=ft(),r=ac(),s=lM(),o=Zse(),{execute:i}=Rd(async(a,l)=>{if(t)try{r({...a,saveState:ut.removing}),await o.mutateAsync({environmentName:e,path:a.path,newPath:l}),r({...a,saveState:ut.new,path:l}),t.editor.createModel(a.content??"",void 0,t.Uri.file(l));const c=t.editor.getModel(t.Uri.file(a.path));r({...a,path:l}),c==null||c.dispose(),s(a.path),n("file-renamed",{fileName:a.path,environment:e})}catch(c){n("file-rename-failed",{environment:e,error:c instanceof Error?c.message:""}),On(c),r({...a,saveState:ut.unmodified});return}});return i}function $ie(e){const t=ba(),{logEvent:n}=ft(),r=ac(),s=Gse(),{execute:o}=Rd(async(i,a,l)=>{if(!t)return new Error("Failed to acquire monaco instance. Please refresh the page.");const c=`${a}/${i}`,u={path:c},f={saveState:ut.new,type:Qs.Directory,...u};try{return r(f),await s.mutateAsync({environmentName:e,path:c}),r({...f,saveState:ut.unmodified}),n("directory-added",{fileName:f.path,strategy:l.name,environment:e}),u}catch(p){return n("directory-creation-failed",{environment:e,error:p instanceof Error?p.message:""}),On(p),r({...f,saveState:ut.modified}),p}});return o}function Die(){const e=rse().get("path");return aM(e)}function Xse(){const e=ba(),t=ac();return(n,r=!1,s=ut.modified)=>{if(t({...n,saveState:s}),r&&e){const o=e.editor.getModel(e.Uri.file(n.path));o&&o.setValue(n.content??"")}}}function aM(e){return Ot(t=>e?t.filesByPath[e]:void 0)}function kie(e){const t=Ot(o=>o.projectTreeNodes),n=[],r=Object.values(e);return t.filter(o=>o.type===Qs.Directory).forEach(o=>{const i=r.find(a=>a.folderName===o.path);if(i)return n.push(i)}),r.sort((o,i)=>o.order-i.order)}function Oie(e){return Ot(n=>n.projectTreeNodes).filter(n=>!n.path&&!e.fileGlob?!1:n.type===Qs.Directory&&e.subdirectoryGlob?zt(n.path,e.subdirectoryGlob):zt(n.path,e.fileGlob))}function lM(){const e=ba(),t=Ot(r=>r.removeFile),n=Ot(r=>r.filterProjectTreeNodes);return r=>{var s;e&&((s=e.editor.getModel(e.Uri.file(r)))==null||s.dispose()),t(r),n(o=>o.path!==r)}}function ac(){return Ot(t=>t.updateFile)}const Mie=e=>{const t=Xse(),n=aM(e);return r=>{n&&t(n,!0,r)}},Jse=`{
|
369
|
+
"title": "Person",
|
370
|
+
"type": "object",
|
371
|
+
"properties": {
|
372
|
+
"firstName": {
|
373
|
+
"type": "string",
|
374
|
+
"description": "The person's first name."
|
375
|
+
},
|
376
|
+
"lastName": {
|
377
|
+
"type": "string",
|
378
|
+
"description": "The person's last name."
|
379
|
+
},
|
380
|
+
"favoriteColors": {
|
381
|
+
"description": "The person's favorite colors",
|
382
|
+
"type": "array",
|
383
|
+
"items": {
|
384
|
+
"type": "string"
|
385
|
+
}
|
386
|
+
}
|
387
|
+
},
|
388
|
+
"additionalProperties": false,
|
389
|
+
"required": ["firstName", "lastName"]
|
390
|
+
}`,eoe=`import { describe, it, TestHelper } from "@zuplo/test";
|
391
|
+
import { expect } from "chai";
|
392
|
+
|
393
|
+
// Visit https://zuplo.com/docs/guides/custom-ci-cd for more information on how to write and run tests
|
394
|
+
|
395
|
+
describe("API", () => {
|
396
|
+
it("should have a body", async () => {
|
397
|
+
const response = await fetch(TestHelper.TEST_URL);
|
398
|
+
const result = await response.text();
|
399
|
+
expect(result).to.equal(JSON.stringify("What zup?"));
|
400
|
+
});
|
401
|
+
});`,toe=`import { ZuploContext, ZuploRequest } from "@zuplo/runtime";
|
402
|
+
|
403
|
+
export default async function (request: ZuploRequest, context: ZuploContext) {
|
404
|
+
return "What zup?";
|
405
|
+
}`,bf="",noe=`import {ZuploContext, ZuploRequest} from "@zuplo/runtime";
|
406
|
+
|
407
|
+
type MyPolicyOptionsType = {
|
408
|
+
myOption: any;
|
409
|
+
};
|
410
|
+
|
411
|
+
export default async function policy(
|
412
|
+
request: ZuploRequest,
|
413
|
+
context: ZuploContext,
|
414
|
+
options: MyPolicyOptionsType,
|
415
|
+
policyName: string
|
416
|
+
) {
|
417
|
+
// your policy code goes here, and can use the options to perform any
|
418
|
+
// configuration
|
419
|
+
// See the docs: https://www.zuplo.com/docs/policies/custom-code-inbound
|
420
|
+
|
421
|
+
return request;
|
422
|
+
}
|
423
|
+
`,roe=`import { ZuploContext, ZuploRequest } from "@zuplo/runtime";
|
424
|
+
|
425
|
+
type MyPolicyOptionsType = {
|
426
|
+
myOption: any;
|
427
|
+
};
|
428
|
+
|
429
|
+
export default async function policy(
|
430
|
+
response: Response,
|
431
|
+
request: ZuploRequest,
|
432
|
+
context: ZuploContext,
|
433
|
+
options: MyPolicyOptionsType,
|
434
|
+
policyName: string
|
435
|
+
) {
|
436
|
+
// your policy code goes here, and can use the options to perform any
|
437
|
+
// configuration
|
438
|
+
// See the docs: https://www.zuplo.com/docs/policies/custom-code-inbound
|
439
|
+
|
440
|
+
return response;
|
441
|
+
}`,soe=`{
|
442
|
+
"openapi": "3.1.0",
|
443
|
+
"info": {
|
444
|
+
"title": "My Zuplo API",
|
445
|
+
"version": "1.0.0"
|
446
|
+
},
|
447
|
+
"paths": {}
|
448
|
+
}`,ooe=`import { RuntimeExtensions } from "@zuplo/runtime";
|
449
|
+
|
450
|
+
// For more information on runtime extensions see:
|
451
|
+
// https://zuplo.com/docs/articles/runtime-extensions
|
452
|
+
|
453
|
+
export function runtimeInit(runtime: RuntimeExtensions) {
|
454
|
+
// your extension code goes here
|
455
|
+
}
|
456
|
+
`,cM=()=>({root:{deleteSupported:!1,createSupported:!1,renameSupported:!1,subdirectoryCreateSupported:!1,fileGlob:"/+(package.json)",folderName:"",name:"",order:0},config:{createExtensions:{"OpenAPI Spec":"oas.json"},deleteSupported:!0,createSupported:!0,renameSupported:!0,subdirectoryCreateSupported:!1,fileGlob:"/config/+(routes.json|*.oas.json|policies.json|dev-portal.json)",folderName:"/config",name:"config",newFileTemplates:{"OpenAPI Spec":soe},supportedFileTemplates:["OpenAPI Spec"],order:1,defaultFileTemplate:"OpenAPI Spec",customConfig:{"routes.json":{deleteSupported:!1,renameSupported:!1},"policies.json":{deleteSupported:!1,renameSupported:!1},"dev-portal.json":{deleteSupported:!0,renameSupported:!1}}},modules:{createExtensions:{"Empty Module":"ts","Inbound Policy":"ts","Outbound Policy":"ts","Request Handler":"ts"},predefinedTemplateFilename:{"zuplo.runtime.ts":"zuplo.runtime.ts"},deleteSupported:!0,createSupported:!0,renameSupported:!0,subdirectoryCreateSupported:!0,subdirectoryGlob:"/modules/**",fileGlob:"/modules/**/*.ts",folderName:"/modules",name:"modules",newFileTemplates:{"Empty Module":bf,"Inbound Policy":noe,"zuplo.runtime.ts":ooe,"Outbound Policy":roe,"Request Handler":toe},order:2,supportedFileTemplates:["Inbound Policy","Outbound Policy","zuplo.runtime.ts","Request Handler","Empty Module"],customConfig:{"zuplo.runtime.ts":{deleteSupported:!0,renameSupported:!1}},defaultFileTemplate:"Request Handler"},schemas:{createExtensions:{"Empty Schema":"json",Schema:"json"},deleteSupported:!0,createSupported:!0,renameSupported:!0,subdirectoryCreateSupported:!1,fileGlob:"/schemas/*.json",folderName:"/schemas",name:"schemas",newFileTemplates:{"Empty Schema":bf,Schema:Jse},order:3,supportedFileTemplates:["Empty Schema","Schema"],defaultFileTemplate:"Schema"},tests:{name:"tests",folderName:"/tests",deleteSupported:!0,createSupported:!0,renameSupported:!0,subdirectoryCreateSupported:!1,order:4,defaultFileTemplate:"Code Test",createExtensions:{"Manual Test":"json","Code Test":"test.ts"},fileGlob:"/tests/+(*.json|*.ts)",newFileTemplates:{"Code Test":eoe},supportedFileTemplates:["Code Test"]},docs:{createExtensions:{"Docs Page":"md","MDX Page":"mdx"},deleteSupported:!0,createSupported:!0,renameSupported:!0,subdirectoryCreateSupported:!0,subdirectoryGlob:"/docs/**",fileGlob:"/docs/**",folderName:"/docs",name:"docs",order:4,newFileTemplates:{"Docs Page":bf,"MDX Page":bf},supportedFileTemplates:["Docs Page","MDX Page"],defaultFileTemplate:"Docs Page"}});function Iie(e){const t=cM();return Object.values(t).find(n=>n.createSupported&&zt(e,n.fileGlob))}const ioe=()=>{const e=cM(),t=[e.root,e.config,e.modules,e.schemas,e.docs,e.tests],n=[e.tests];return{strategies:e,editStrategies:t,testStrategies:n}},aoe=(e=!1)=>async({queryKey:t})=>{const[n]=t;if(typeof n!="string")throw new gs({type:"https://zup.fail/invalid-query-key",title:"Invalid query key"});const r=new Request(n);let s;try{s=await fetch(r)}catch(o){throw o instanceof TypeError?new gs({type:"https://zup.fail/api-request-failed",title:"API request failed",status:500,instance:n}):o}if(!s.ok){const o=new tr("Error while making request. Please try again or contact support if the problem persists.");throw await o.tryReadResponse(s),o}try{return await(e?s.clone().json():s.clone().text())}catch(o){const i=await s.clone().text();throw FT(`Failed to parse response of ${n} to JSON. Response: ${i}`,"error"),o}};function lc(e,{json:t,...n}={}){return zh({queryKey:[e.url],queryFn:aoe(t),...n})}const loe=(e={})=>lc(ye.cdnContent("/portal/policies.v4.json?v=2"),{...e,json:!0}),coe=e=>lc(ye.cdnContent("/schemas/routes.json"),{...e}),Fie=e=>lc(ye.cdnContent("/schemas/sidebar.json"),{...e}),uoe=e=>lc(ye.cdnContent("/schemas/openapi-v3.1-zuplo.json"),{...e}),doe=e=>lc(ye.cdnContent("/schemas/openapi-v3.0-zuplo.json"),{...e}),foe=e=>lc(ye.cdnContent("/schemas/policies.json"),{...e}),uM=()=>{const e=ba(),t=pn(["environment"]),n=hj(),{strategies:r}=ioe(),s=Qse(Object.values(r),t.environment.name),[o,i]=h.useState(null),a=Ot(b=>b.setProjectTreeNodes),l=Ot(b=>b.addFile),c=Ot(b=>b.resetStore),{logEvent:u}=ft(),f=coe({enabled:!1}),p=uoe({enabled:!1}),g=doe({enabled:!1}),y=foe({enabled:!1}),m=loe({enabled:!1}),v=Rd(async b=>{if(!e)return;performance.mark("totalTimeStart");const x=`${b.account.name}-${b.project.name}-${b.environment.name}`,w={"project-name":b.project.name};if(o&&o!==x&&e.editor.getModels().length>0){performance.mark("cleanMonacoStart"),c(),e.editor.getModels().forEach(C=>C.dispose());try{w.cleanMonaco=Math.trunc(performance.measure("cleanMonacoTimer","cleanMonacoStart").duration)}catch{w.cleanMonaco=-1}}performance.mark("fileTreeStart");const E=await s();e.editor.getModels().forEach(C=>C.dispose());try{w.fileTreeLoader=Math.trunc(performance.measure("fileTreeTimer","fileTreeStart").duration)}catch{w.fileTreeLoader=-1}performance.mark("loadingFilesStart");const S=E.filter(C=>C.type===Qs.File),R=E.filter(C=>C.type===Qs.Directory);await Promise.allSettled(S.map(async C=>{try{const N=await Qi(b.environment.name,C.path);l({...C,...N,saveState:ut.unmodified});const k=e.Uri.file(N.path),V=e.editor.getModel(k);V?V.setValue(N.content??""):e.editor.createModel(N.content??"",void 0,k)}catch{l({...C,saveState:ut.error})}})),R.forEach(C=>{l({...C,saveState:ut.unmodified})});try{w.loadingFiles=Math.trunc(performance.measure("loadingFilesTimer","loadingFilesStart").duration)}catch{w.loadingFiles=-1}await Promise.allSettled([f.refetch(),p.refetch(),g.refetch(),y.refetch(),m.refetch()]),i(x),a(E);try{w.totalTime=Math.trunc(performance.measure("totalTime","totalTimeStart").duration)}catch{w.totalTime=-1}u("project-loaded",w);try{performance.clearMarks()}catch(C){On(C)}});return{unsavedFiles:n,monaco:e,reloadFiles:v}};function hoe(){const{unsavedFiles:e}=uM(),{isAuthenticated:t}=si();return h.useEffect(()=>{if(e.length===0||!t)return;function n(r){return r.preventDefault(),r.returnValue=Xre,r}return window.addEventListener("beforeunload",n,{capture:!0}),()=>{window.removeEventListener("beforeunload",n,{capture:!0})}},[e,t]),null}const fC=e=>{const t=h.useRef(e);return t.current=e,h.useEffect(()=>{t.current=e},[e]),t},dM=()=>{const[e,t]=h.useState(null),n=Ot(l=>l.updateFile),r=Ot(l=>l.filesByPath),s=h.useCallback(async(l,c)=>{const u=r[l];if(!(u!=null&&u.lastModified))return await c(),!0;try{const f=await Qi("local",l);return f.lastModified?f.lastModified>u.lastModified?(Et.warn(`File ${l} was modified on disk. Showing conflict dialog before save.`),new Promise(p=>{t({filePath:l,localContent:u.content??"",remoteContent:f.content??"",remoteLastModified:f.lastModified,onProceed:async()=>{await c(),p(!0)}})})):(await c(),!0):(await c(),!0)}catch(f){return Et.error("Error checking for conflicts:",f),await c(),!0}},[r]),o=h.useCallback(l=>{Et.info(`Showing conflict dialog for ${l.filePath}`),t(l)},[]),i=h.useCallback(async l=>{if(!e)return;const c=r[e.filePath];if(!c){t(null);return}if(l==="remote")n({...c,content:e.remoteContent,lastModified:e.remoteLastModified,saveState:ut.unmodified}),Et.info(`Using disk version for ${e.filePath}, canceling save`),t(null);else if(Et.info(`User chose local version for ${e.filePath}${e.onProceed?", proceeding with save":", saving to disk"}`),e.onProceed)await e.onProceed(),t(null);else try{const u={path:c.path,content:c.content};await tse("local",u,{forceSave:!0});const f=await Qi("local",e.filePath);n({...c,lastModified:f.lastModified,saveState:ut.unmodified}),Et.info(`Successfully saved local version for ${e.filePath}`),t(null)}catch(u){Et.error(`Error saving local version for ${e.filePath}:`,u),n({...c,saveState:ut.modified})}},[e,r,n]),a=h.useCallback(async()=>{if(!e)return;const l=r[e.filePath];if(l)try{const c=await Qi("local",e.filePath);n({...l,lastModified:c.lastModified}),Et.info(`Conflict dialog canceled for ${e.filePath}, updated lastModified timestamp`)}catch(c){Et.error("Error fetching latest file on cancel:",c)}t(null)},[e,r,n]);return{conflict:e,checkForConflictsBeforeSave:s,showConflict:o,resolveConflict:i,cancelConflict:a}},Vg={".ts":"typescript",".tsx":"typescript",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".json":"json",".html":"html",".htm":"html",".xml":"xml",".svg":"xml",".yaml":"yaml",".yml":"yaml",".md":"markdown",".mdx":"markdown",".css":"css",".scss":"scss",".sass":"sass",".less":"less",".py":"python",".rs":"rust",".go":"go",".java":"java",".c":"c",".cpp":"cpp",".cs":"csharp",".php":"php",".rb":"ruby",".sh":"shell",".bash":"shell",".zsh":"shell",".sql":"sql",".graphql":"graphql",".gql":"graphql",".env":"plaintext",".toml":"toml",".ini":"ini",".properties":"properties",".dockerfile":"dockerfile",Dockerfile:"dockerfile",".makefile":"makefile",Makefile:"makefile"};function poe(e){const t=e.split("/").pop()||"";if(Vg[t])return Vg[t];const n=t.lastIndexOf(".");if(n===-1)return"plaintext";const r=t.slice(n);return Vg[r]||"plaintext"}function fM({open:e,filePath:t,localContent:n,remoteContent:r,onResolve:s,onCancel:o}){const[i,a]=h.useState("local"),l=poe(t);return d.jsx(cd,{open:e,onOpenChange:c=>!c&&o(),children:d.jsxs(Zl,{className:"max-w-7xl max-h-[90vh] p-0",hideClose:!0,children:[d.jsx("div",{className:"p-6 pb-0",children:d.jsxs(kp,{children:[d.jsx(ud,{className:"text-lg font-semibold text-left mb-1",children:"File Conflict Detected"}),d.jsxs("p",{className:"text-sm text-gray-600 text-left",children:[d.jsx("span",{className:"font-mono font-semibold",children:t})," has been modified both locally and on disk"]})]})}),d.jsxs("div",{className:"flex-1 min-h-0 flex flex-col px-6",children:[d.jsxs("div",{className:"grid grid-cols-2 pr-[30px]",children:[d.jsxs("button",{type:"button",className:`flex flex-col py-3 cursor-pointer transition-all border-t-4 border-x ${i==="local"?"border-t-pink-500 border-x-pink-200 bg-pink-50":"border-t-gray-200 border-x-gray-200 bg-gray-50 hover:bg-gray-100"}`,style:{paddingLeft:"26px",paddingRight:"24px"},onClick:()=>a("local"),"aria-pressed":i==="local",children:[d.jsx("div",{className:"font-semibold text-sm",children:"Browser Version"}),d.jsx("div",{className:"text-xs text-gray-500",children:"Current editor content"})]}),d.jsxs("button",{type:"button",className:`flex flex-col px-6 py-3 cursor-pointer transition-all border-t-4 border-x ${i==="remote"?"border-t-pink-500 border-x-pink-200 bg-pink-50":"border-t-gray-200 border-x-gray-200 bg-gray-50 hover:bg-gray-100"}`,onClick:()=>a("remote"),"aria-pressed":i==="remote",children:[d.jsx("div",{className:"font-semibold text-sm",children:"Disk Version"}),d.jsx("div",{className:"text-xs text-gray-500",children:"File on disk"})]})]}),d.jsx("div",{className:"border border-t-0 overflow-hidden shadow-sm flex-1",style:{minHeight:"55vh"},children:d.jsx(EM,{original:n,modified:r,language:l,theme:"vs",options:{readOnly:!0,renderSideBySide:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,fontSize:13,wordWrap:"on"}})})]}),d.jsxs(Dx,{className:"px-6 pb-6 flex-row justify-between items-center",children:[d.jsx("p",{className:"text-sm text-gray-600",children:i==="local"?d.jsx(d.Fragment,{children:"Browser version will be saved to disk"}):d.jsx(d.Fragment,{children:"Disk version will replace browser content"})}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Fe,{variant:"ghost",onClick:o,children:"Cancel"}),d.jsxs(Fe,{variant:"default",onClick:()=>s(i),children:["Apply ",i==="local"?"Browser":"Disk"," Version"]})]})]})]})})}function moe(){const{conflict:e,showConflict:t,resolveConflict:n,cancelConflict:r}=dM(),s=Ot(a=>a.filesByPath),o=Ot(a=>a.saveConflictPath),i=Ot(a=>a.clearSaveConflict);return h.useEffect(()=>{if(o){Et.info(`Save conflict detected for ${o}`);const a=s[o];a?Qi("local",o).then(l=>{t({filePath:o,localContent:a.content??"",remoteContent:l.content??"",remoteLastModified:l.lastModified})}).catch(l=>{Et.error("Error fetching file for conflict dialog:",l)}):Et.warn(`No file model found for ${o}`),i()}},[o,s,i,t]),e?d.jsx(fM,{open:!0,filePath:e.filePath,localContent:e.localContent,remoteContent:e.remoteContent,onResolve:n,onCancel:r}):null}const Y0=Symbol.for("RemoteUi::Retain"),Z0=Symbol.for("RemoteUi::Release"),Bh=Symbol.for("RemoteUi::RetainedBy");class hM{constructor(){this.memoryManaged=new Set}add(t){this.memoryManaged.add(t),t[Bh].add(this),t[Y0]()}release(){for(const t of this.memoryManaged)t[Bh].delete(this),t[Z0]();this.memoryManaged.clear()}}function goe(e){return!!(e&&e[Y0]&&e[Z0])}function hC(e){if(e==null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t==null||t===Object.prototype}const xf="_@f";function voe(e){const t=new Map,n=new Map,r=new Map;return{encode:s,decode:o,async call(i,a){const l=new hM,c=n.get(i);if(c==null)throw new Error("You attempted to call a function that was already released.");try{const u=goe(c)?[l,...c[Bh]]:[l];return await c(...o(a,u))}finally{l.release()}},release(i){const a=n.get(i);a&&(n.delete(i),t.delete(a))},terminate(){t.clear(),n.clear(),r.clear()}};function s(i,a=new Map){if(i==null)return[i];const l=a.get(i);if(l)return l;if(typeof i=="object"){if(Array.isArray(i)){a.set(i,[void 0]);const u=[],p=[i.map(g=>{const[y,m=[]]=s(g,a);return u.push(...m),y}),u];return a.set(i,p),p}if(hC(i)){a.set(i,[void 0]);const u=[],p=[Object.keys(i).reduce((g,y)=>{const[m,v=[]]=s(i[y],a);return u.push(...v),{...g,[y]:m}},{}),u];return a.set(i,p),p}}if(typeof i=="function"){if(t.has(i)){const p=t.get(i),g=[{[xf]:p}];return a.set(i,g),g}const u=e.uuid();t.set(i,u),n.set(u,i);const f=[{[xf]:u}];return a.set(i,f),f}const c=[i];return a.set(i,c),c}function o(i,a){if(typeof i=="object"){if(i==null)return i;if(Array.isArray(i))return i.map(l=>o(l,a));if(xf in i){const l=i[xf];if(r.has(l))return r.get(l);let c=0,u=!1;const f=()=>{c-=1,c===0&&(u=!0,r.delete(l),e.release(l))},p=()=>{c+=1},g=new Set(a),y=(...m)=>{if(u)throw new Error("You attempted to call a function that was already released.");if(!r.has(l))throw new Error("You attempted to call a function that was already revoked.");return e.call(l,m)};Object.defineProperties(y,{[Z0]:{value:f,writable:!1},[Y0]:{value:p,writable:!1},[Bh]:{value:g,writable:!1}});for(const m of g)m.add(y);return r.set(l,y),y}if(hC(i))return Object.keys(i).reduce((l,c)=>({...l,[c]:o(i[c],a)}),{})}return i}}const pC=0,zg=1,mC=2,gC=3,vC=5,Wg=6;function yoe(e,{uuid:t=boe,createEncoder:n=voe,callable:r}={}){let s=!1,o=e;const i=new Map,a=new Map,l=xoe(p,r),c=n({uuid:t,release(m){u(gC,[m])},call(m,v,b){const x=t(),w=g(x,b),[_,E]=c.encode(v);return u(vC,[x,m,_],E),w}});return o.addEventListener("message",f),{call:l,replace(m){const v=o;o=m,v.removeEventListener("message",f),m.addEventListener("message",f)},expose(m){for(const v of Object.keys(m)){const b=m[v];typeof b=="function"?i.set(v,b):i.delete(v)}},callable(...m){if(r!=null)for(const v of m)Object.defineProperty(l,v,{value:p(v),writable:!1,configurable:!0,enumerable:!0})},terminate(){u(mC,void 0),y(),o.terminate&&o.terminate()}};function u(m,v,b){s||o.postMessage(v?[m,v]:[m],b)}async function f(m){const{data:v}=m;if(!(v==null||!Array.isArray(v)))switch(v[0]){case mC:{y();break}case pC:{const b=new hM,[x,w,_]=v[1],E=i.get(w);try{if(E==null)throw new Error(`No '${w}' method is exposed on this endpoint`);const[S,R]=c.encode(await E(...c.decode(_,[b])));u(zg,[x,void 0,S],R)}catch(S){const{name:R,message:C,stack:N}=S;throw u(zg,[x,{name:R,message:C,stack:N}]),S}finally{b.release()}break}case zg:{const[b]=v[1];a.get(b)(...v[1]),a.delete(b);break}case gC:{const[b]=v[1];c.release(b);break}case Wg:{const[b]=v[1];a.get(b)(...v[1]),a.delete(b);break}case vC:{const[b,x,w]=v[1];try{const _=await c.call(x,w),[E,S]=c.encode(_);u(Wg,[b,void 0,E],S)}catch(_){const{name:E,message:S,stack:R}=_;throw u(Wg,[b,{name:E,message:S,stack:R}]),_}break}}}function p(m){return(...v)=>{if(s)return Promise.reject(new Error("You attempted to call a function on a terminated web worker."));if(typeof m!="string"&&typeof m!="number")return Promise.reject(new Error(`Can’t call a symbol method on a remote endpoint: ${m.toString()}`));const b=t(),x=g(b),[w,_]=c.encode(v);return u(pC,[b,m,w],_),x}}function g(m,v){return new Promise((b,x)=>{a.set(m,(w,_,E)=>{if(_==null)b(E&&c.decode(E,v));else{const S=new Error;Object.assign(S,_),x(S)}})})}function y(){var m;s=!0,i.clear(),a.clear(),(m=c.terminate)===null||m===void 0||m.call(c),o.removeEventListener("message",f)}}function boe(){return`${wf()}-${wf()}-${wf()}-${wf()}`}function wf(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)}function xoe(e,t){let n;if(t==null){if(typeof Proxy!="function")throw new Error("You must pass an array of callable methods in environments without Proxies.");const r=new Map;n=new Proxy({},{get(s,o){if(r.has(o))return r.get(o);const i=e(o);return r.set(o,i),i}})}else{n={};for(const r of t)Object.defineProperty(n,r,{value:e(r),writable:!1,configurable:!0,enumerable:!0})}return n}function woe(e){return typeof window>"u"||typeof e!="string"?void 0:new URL(e,window.location.href)}function _oe(e){const t=URL.createObjectURL(new Blob([`importScripts(${JSON.stringify(e.href)})`])),n=new Worker(t),r=n.terminate.bind(n);return n.terminate=()=>{URL.revokeObjectURL(t),r()},n}const Q0=new WeakMap;function Eoe(e){const t=woe(e);function n({createMessenger:r=_oe,...s}={}){if(t){const o=yoe(r(t),s),{call:i}=o;return Q0.set(i,o),i}if(typeof e=="function")return new Proxy({},{get(o,i){return async(...a)=>(await e())[i](...a)}});if(typeof window>"u")return new Proxy({},{get(o,i){return()=>{throw new Error("You can’t call a method on a worker on the server.")}}});throw new Error("Could not create a suitable fallback")}return Reflect.defineProperty(n,"url",{value:t}),n}function Soe(e){const t=Coe(e);return t==null||t.terminate(),Q0.delete(e),t!=null}function Coe(e){return Q0.get(e)}function Toe(e){const[t]=h.useState(e);return h.useRef(t)}function Roe(e,...t){const{current:n}=Toe(()=>e(...t));return h.useEffect(()=>()=>{Soe(n)},[n]),n}const Noe=Eoe(()=>qg(()=>import("./local-worker-CmThaCEP.js"),__vite__mapDeps([0,1,2]),import.meta.url)),Poe=()=>{const e=ba(),t=Roe(Noe),n=h.useRef(null),{conflict:r,showConflict:s,resolveConflict:o,cancelConflict:i}=dM();h.useEffect(()=>{e&&t.ready().catch(l=>{Et.warn("Failed to load local types:",l)})},[t,e]),h.useEffect(()=>{if(!e)return;const l=new EventSource("/api/changes");return n.current=l,l.addEventListener("change",async c=>{try{const u=JSON.parse(c.data),f=u.filePath.startsWith("/")?u.filePath:`/${u.filePath}`,p=Ot.getState().filesByPath,g=Ot.getState().updateFile,y=p[f];if(!y){Et.info(`File ${f} changed but not loaded in editor`);return}if(y.saveState===ut.modified||y.saveState===ut.new){Et.warn(`File ${f} changed on disk but has unsaved changes. Showing conflict dialog.`);const x=await Qi("local",f);s({filePath:f,localContent:y.content??"",remoteContent:x.content??"",remoteLastModified:x.lastModified});return}const m=await Qi("local",f),v=e.Uri.file(f),b=e.editor.getModel(v);b&&m.content!==void 0&&b.setValue(m.content),g({...y,content:m.content,saveState:ut.unmodified,lastModified:m.lastModified})}catch(u){Et.error("Error handling file change event:",u)}}),l.onerror=c=>{l.readyState!==EventSource.CLOSED&&Et.warn("SSE connection error:",c)},()=>{l.close(),n.current=null}},[e,s]);const a=async l=>{if(!r||!e)return;if(l==="remote"){await o(l);return}if(Ot.getState().filesByPath[r.filePath]){const u=e.Uri.file(r.filePath),f=e.editor.getModel(u);f&&f.setValue(r.localContent)}await o(l)};return d.jsx(d.Fragment,{children:r&&d.jsx(fM,{open:!0,filePath:r.filePath,localContent:r.localContent,remoteContent:r.remoteContent,onResolve:a,onCancel:i})})};function joe(){const e=pn(),{monaco:t,reloadFiles:n}=uM(),r=fC(n.execute),s=fC(e),o=e.environment.name,{error:i}=zh({queryKey:["reloadFiles",o],queryFn:async()=>{try{return await r.current(s.current),!0}catch(a){throw Et.error("Failed to reload files:",a),a}},refetchOnWindowFocus:!1,enabled:!!t&&!!o,retry:3,retryDelay:a=>Math.min(1e3*2**a,3e4)});return i?d.jsx("div",{className:"flex items-center justify-center h-full bg-gray-50",children:d.jsxs("div",{className:"text-center p-8 max-w-lg",children:[d.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Failed to Load Files"}),d.jsx("p",{className:"text-gray-600 mb-4",children:"Unable to load project files from the local server. Please check that the dev server is running and try again."}),d.jsx("button",{type:"button",onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:"Retry"})]})}):d.jsxs(d.Fragment,{children:[d.jsx(Poe,{}),d.jsx(moe,{}),d.jsx(hoe,{}),d.jsx(ax,{})]})}const Aoe=TL(r6),$oe=Aoe(D3(d.jsxs(Ci,{path:"/",element:d.jsx(hne,{}),errorElement:d.jsx(A6,{id:"root"}),children:[d.jsx(Ci,{path:"/:account/:project/:environment",element:d.jsx(joe,{}),children:d.jsxs(Ci,{element:d.jsx(Qre,{}),children:[d.jsx(Ci,{index:!0,lazy:tC(()=>qg(()=>import("./LocalProjectPage-BBCigkiz.js"),__vite__mapDeps([3,1,2,4]),import.meta.url))}),d.jsx(Ci,{path:"edit",lazy:tC(()=>qg(()=>import("./LocalEditorPage-CCG4v-Fn.js"),__vite__mapDeps([5,1,2,4,6]),import.meta.url))})]})}),d.jsx(Ci,{path:"*",element:d.jsx(pne,{})})]}))),Doe=({children:e})=>{const[t,n]=h.useState(()=>gE()),[r,s]=h.useState(!0);return h.useEffect(()=>{(async()=>{try{const a=await(await vp("/deployments/local")).json();n(gE(a.deploymentVersion))}catch(i){Et.error("Failed to fetch deployment info:",i)}finally{s(!1)}})()},[]),r?null:d.jsx(R6,{children:d.jsx(UN.Provider,{value:t,children:d.jsx(BN,{children:e})})})},koe=b6({router:$oe,additionalProviders:Doe}),Lie=Object.freeze(Object.defineProperty({__proto__:null,default:koe},Symbol.toStringTag,{value:"Module"}));export{DX as $,ud as A,Fe as B,rn as C,mB as D,xt as E,ij as F,qoe as G,Dx as H,Kv as I,_1 as J,Qt as K,od as L,Qp as M,Sn as N,ED as O,to as P,_0 as Q,Ve as R,N0 as S,w0 as T,on as U,TD as V,kt as W,dn as X,mn as Y,_s as Z,Br as _,QD as a,Sr as a$,gie as a0,Wn as a1,hQ as a2,bd as a3,ga as a4,Xp as a5,Gt as a6,vie as a7,ji as a8,RD as a9,ec as aA,lp as aB,aj as aC,lj as aD,cj as aE,uj as aF,Ql as aG,nr as aH,Xl as aI,LW as aJ,rd as aK,Eie as aL,jC as aM,gj as aN,uT as aO,uie as aP,Ho as aQ,Go as aR,Lr as aS,hv as aT,aa as aU,ar as aV,ye as aW,It as aX,Rt as aY,Mt as aZ,If as a_,dQ as aa,Ll as ab,xQ as ac,xD as ad,Fs as ae,Rie as af,Woe as ag,Gl as ah,Ys as ai,xb as aj,Vr as ak,fn as al,tt as am,$e as an,me as ao,wb as ap,zr as aq,td as ar,ad as as,Cp as at,ea as au,xx as av,wp as aw,Wl as ax,_b as ay,Eb as az,jg as b,Hre as b$,JV as b0,e5 as b1,li as b2,t5 as b3,Xse as b4,yp as b5,ai as b6,ut as b7,tc as b8,ff as b9,j1 as bA,JR as bB,hn as bC,PV as bD,rse as bE,Iie as bF,Die as bG,VW as bH,pB as bI,Fie as bJ,Ip as bK,Fre as bL,Lre as bM,eM as bN,Vre as bO,Gb as bP,x7 as bQ,cie as bR,m6 as bS,IN as bT,ls as bU,Ot as bV,fj as bW,FB as bX,Oo as bY,AV as bZ,Hoe as b_,Gc as ba,nY as bb,rY as bc,Jo as bd,sY as be,Kc as bf,Au as bg,kl as bh,$u as bi,Ol as bj,Yi as bk,pie as bl,UJ as bm,sj as bn,fy as bo,my as bp,a9 as bq,Dj as br,nse as bs,zj as bt,T9 as bu,Rc as bv,jj as bw,aM as bx,ic as by,hV as bz,Be as c,aie as c$,VB as c0,jJ as c1,AJ as c2,qD as c3,fC as c4,cp as c5,Ej as c6,bie as c7,dh as c8,lie as c9,iie as cA,Mie as cB,ci as cC,Sie as cD,qre as cE,_ie as cF,Jy as cG,uoe as cH,doe as cI,foe as cJ,oV as cK,Oie as cL,$ie as cM,Pie as cN,Jl as cO,tr as cP,Uoe as cQ,MN as cR,Aie as cS,Rd as cT,Qs as cU,kie as cV,coe as cW,uM as cX,zh as cY,Nie as cZ,hj as c_,Cr as ca,hu as cb,jie as cc,Xoe as cd,loe as ce,IJ as cf,Zte as cg,L1 as ch,sB as ci,On as cj,noe as ck,roe as cl,cM as cm,Vte as cn,nie as co,dp as cp,DV as cq,Koe as cr,RV as cs,Zoe as ct,Qoe as cu,sx as cv,oie as cw,sie as cx,rie as cy,ioe as cz,zs as d,nN as d0,Lie as d1,bee as e,va as f,kh as g,xs as h,kx as i,ws as j,fd as k,Op as l,se as m,ia as n,ir as o,tN as p,pn as q,ft as r,Mp as s,Zs as t,eo as u,yr as v,mne as w,cd as x,Zl as y,kp as z};
|
457
|
+
//# sourceMappingURL=App-D5-r7r-7.js.map
|