1234567891011121314151617181920212223242526272829303132333435363738394041 |
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2281],{62034:function(e,t,s){var r=s(65067),a=s(95882);e.exports=function e(t,s,n,i,o){var l=-1,c=t.length;for(n||(n=a),o||(o=[]);++l<c;){var d=t[l];s>0&&n(d)?s>1?e(d,s-1,n,i,o):r(o,d):i||(o[o.length]=d)}return o}},95882:function(e,t,s){var r=s(50857),a=s(79631),n=s(86152),i=r?r.isConcatSpreadable:void 0;e.exports=function(e){return n(e)||a(e)||!!(i&&e&&e[i])}},35676:function(e,t,s){var r=s(62034);e.exports=function(e){return(null==e?0:e.length)?r(e,1):[]}},31458:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/project/[ref]/settings/general",function(){return s(89068)}])},74178:function(e,t,s){"use strict";s.d(t,{CG:function(){return x},FW:function(){return d},I7:function(){return m},Lc:function(){return p},Wv:function(){return v},_S:function(){return u},g$:function(){return f},gW:function(){return y},jX:function(){return h},q7:function(){return c},tM:function(){return j},tU:function(){return l},ur:function(){return g}});var r=s(52322),a=s(2784),n=s(54383);let i="mx-auto w-full max-w-[1600px]",o="px-6 lg:px-14 xl:px-24 2xl:px-32",l=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("header",{...a,ref:t,className:(0,n.cn)("w-full","flex-col gap-3 py-6",s)})}),c=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("h1",{ref:t,...a,className:(0,n.cn)("text-2xl",s)})}),d=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("span",{ref:t,...a,className:(0,n.cn)("text-sm text-foreground-light",s)})}),u=a.forwardRef((e,t)=>{let{className:s,bottomPadding:a,...l}=e;return(0,r.jsx)("div",{ref:t,...l,className:(0,n.cn)(i,o,a&&"pb-16",s)})}),m=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)("w-full h-px bg-border",s)})}),h=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)("flex flex-col gap-3 py-6","lg:grid md:grid-cols-12 lg:py-12",s)})}),x=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)("flex flex-col gap-3","min-w-[420px]",s)})}),f=a.forwardRef((e,t)=>{let{className:s,children:a,title:i,...o}=e;return(0,r.jsxs)("div",{ref:t,...o,className:(0,n.cn)("col-span-4 xl:col-span-5 prose text-sm",s),children:[i&&(0,r.jsx)("h2",{children:i}),a]})}),p=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)("col-span-8 xl:col-span-7","flex flex-col gap-6",s)})}),j=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)("flex flex-col gap-3 items-center",s)})}),v=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)("flex w-full items-center",s)})}),g=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)("flex flex-row gap-3",s)})}),y=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)(i,o,"my-8 flex flex-col gap-8",s)})});l.displayName="ScaffoldHeader",c.displayName="ScaffoldTitle",d.displayName="ScaffoldDescription",u.displayName="ScaffoldContainer",m.displayName="ScaffoldDivider",h.displayName="ScaffoldSection",x.displayName="ScaffoldColumn",f.displayName="ScaffoldSectionDetail",p.displayName="ScaffoldSectionContent",j.displayName="ScaffoldFilterAndContent",v.displayName="ScaffoldActionsContainer",g.displayName="ScaffoldActionsGroup",y.displayName="ScaffoldContainerLegacy"},6554:function(e,t,s){"use strict";s.d(t,{i:function(){return n}});var r=s(52322),a=s(32079);let n=e=>{let{form:t,hasChanges:s,handleReset:n,helper:i,disabled:o=!1,isSubmitting:l,submitText:c="Save"}=e,d=l||o||!s&&void 0!==s;return(0,r.jsxs)("div",{className:["flex w-full items-center gap-2",i?"justify-between":"justify-end"].join(" "),children:[i&&(0,r.jsx)("span",{className:"text-sm text-foreground-lighter",children:i}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(a.z,{disabled:d,type:"default",htmlType:"reset",onClick:()=>n(),children:"Cancel"}),(0,r.jsx)(a.z,{form:t,type:"primary",htmlType:"submit",disabled:d,loading:l,children:c})]})]})}},70987:function(e,t,s){"use strict";s.d(t,{p:function(){return u}});var r=s(52322),a=s(17172),n=s(39097),i=s.n(n),o=s(14048),l=s(80435),c=s(54383),d=s(32079);let u=e=>{let{title:t,description:s,docsUrl:n,actions:u,className:m}=e;return(0,r.jsxs)("div",{className:(0,c.cn)("mb-6 flex items-center justify-between ".concat(m)),children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("h3",{className:"text-foreground text-xl",children:(0,r.jsx)(o.D,{unwrapDisallowed:!0,disallowedElements:["p"],children:t})}),s&&(0,r.jsx)(l.U,{content:s,className:"max-w-full"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-x-2",children:[void 0!==n&&(0,r.jsx)(d.z,{asChild:!0,type:"default",icon:(0,r.jsx)(a.Z,{}),children:(0,r.jsx)(i(),{href:n,target:"_blank",rel:"noreferrer",children:"Documentation"})}),u]})]})}},67873:function(e,t,s){"use strict";s.d(t,{DO:function(){return c},Tq:function(){return o},by:function(){return i},iL:function(){return l},m9:function(){return d}});var r=s(52322),a=s(2784),n=s(54383);let i=e=>{let{children:t,header:s,footer:a}=e;return(0,r.jsxs)(o,{children:[s&&(0,r.jsx)(l,{children:s}),(0,r.jsx)(c,{className:"divide-y",children:t}),a&&(0,r.jsx)(d,{children:a})]})},o=(0,a.forwardRef)((e,t)=>{let{children:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)("bg-surface-100 border overflow-hidden rounded-md shadow",a.className),children:s})});o.displayName=o.displayName;let l=(0,a.forwardRef)((e,t)=>{let{children:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)("border-default border-b px-8 py-4",a.className),children:s})});l.displayName=l.displayName;let c=(0,a.forwardRef)((e,t)=>{let{children:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)("divide-border flex flex-col gap-0",a.className),children:s})});c.displayName=c.displayName;let d=(0,a.forwardRef)((e,t)=>{let{children:s,...a}=e;return(0,r.jsx)("div",{ref:t,...a,className:(0,n.cn)("border-t",a.className),children:s})});d.displayName=d.displayName},4787:function(e,t,s){"use strict";s.d(t,{B4:function(){return l},S0:function(){return i},hj:function(){return n}});var r=s(52322),a=s(2784);let n=e=>{let{children:t,id:s,header:a,disabled:n,className:i}=e;return(0,r.jsxs)("div",{id:s,className:["grid grid-cols-12 gap-6 px-8 py-8","".concat(n?" opacity-30":" opacity-100"),"".concat(i)].join(" "),children:[a,t]})},i=e=>{let{children:t,className:s="",description:a}=e;return void 0!==a?(0,r.jsxs)("div",{className:"flex flex-col space-y-2 col-span-12 lg:col-span-5 ".concat(s),children:[(0,r.jsx)("label",{className:"text-foreground text-sm",children:t}),a]}):(0,r.jsx)("label",{className:"text-foreground col-span-12 text-sm lg:col-span-5 ".concat(s),children:t})},o=()=>(0,r.jsxs)("div",{className:"flex w-full flex-col gap-2",children:[(0,r.jsx)("div",{className:"shimmering-loader h-2 w-1/3 rounded"}),(0,r.jsx)("div",{className:"flex flex-col justify-between space-y-2",children:(0,r.jsx)("div",{className:"shimmering-loader h-[34px] w-2/3 rounded"})})]}),l=e=>{let{children:t,loading:s=!0,fullWidth:n,className:i}=e;return(0,r.jsx)("div",{className:"\n relative col-span-12 flex flex-col gap-6 lg:col-span-7\n ".concat(n&&"!col-span-12","\n ").concat(i,"\n "),children:s?a.Children.map(t,()=>(0,r.jsx)(o,{})):t})}},81073:function(e,t,s){"use strict";s.d(t,{y:function(){return c}});var r=s(52322),a=s(17172),n=s(69513),i=s(95492),o=s(32079),l=s(64725);let c={"vercel-marketplace":"Vercel Marketplace","aws-marketplace":"AWS Marketplace"};t.Z=function(e){var t,s;let{partner:d,resource:u,cta:m}=e,h=void 0!==m,{data:x,isLoading:f,isError:p}=(0,n.s)({installationId:null==m?void 0:m.installationId},{enabled:h}),j=(null!==(t=null==x?void 0:x.url)&&void 0!==t?t:"")+(null!==(s=null==m?void 0:m.path)&&void 0!==s?s:"");return(0,r.jsxs)(i.bZ,{className:"flex flex-col items-center gap-4",children:[(0,r.jsx)(l.Z,{organization:{managed_by:d},showTooltip:!1,size:"large"}),(0,r.jsxs)(i.Cd,{className:"text-lg",children:[u," are managed by ",c[d],"."]}),h&&(0,r.jsx)(o.z,{asChild:!0,iconRight:(0,r.jsx)(a.Z,{}),disabled:f||p,children:(0,r.jsx)("a",{href:j,target:"_blank",rel:"noopener noreferrer",children:m.message||"View ".concat(u," on ").concat(c[d])})})]})}},75716:function(e,t,s){"use strict";var r=s(52322),a=s(59491),n=s(39097),i=s.n(n),o=s(93463),l=s(87175),c=s(89823),d=s(26211),u=s(75939),m=s(54383),h=s(32079),x=s(44778);t.Z=e=>{var t,s,n;let{icon:f,primaryText:p,secondaryText:j,addon:v,buttonText:g,disabled:y=!1}=e,b=(0,d.V)(),N=(0,c.l)(),{data:w}=(0,o.Gl)({orgSlug:null==N?void 0:N.slug}),C=null==w?void 0:null===(t=w.plan)||void 0===t?void 0:t.id,k=(0,l.Xo)(a.KA.BILLING_WRITE,"stripe.subscriptions"),S=(0,u.P)("disableProjectCreationAndUpdate");return(0,r.jsx)("div",{className:(0,m.cn)("block w-full rounded border border-opacity-20 py-4 px-6","border-overlay bg-surface-200"),children:(0,r.jsxs)("div",{className:"flex gap-x-3",children:[f&&(0,r.jsx)("div",{className:"mt-1",children:f}),(0,r.jsxs)("div",{className:"flex w-full items-center justify-between gap-x-32",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("p",{className:"text-sm",children:p}),(0,r.jsx)("div",{children:(0,r.jsx)("p",{className:"text-sm text-foreground-light",children:j})})]}),!k||S?(0,r.jsx)(x.u,{disabled:!0,type:"primary",tooltip:{content:{side:"bottom",text:S?"Subscription changes are currently disabled, our engineers are working on a fix":k?void 0:"You need additional permissions to amend subscriptions"}},children:"Reset database password"}):(0,r.jsx)(h.z,{asChild:!0,type:"primary",disabled:!k||S||y,children:(0,r.jsx)(i(),{href:"free"===C?"/org/".concat(null!==(s=null==N?void 0:N.slug)&&void 0!==s?s:"_","/billing?panel=subscriptionPlan"):"/project/".concat(null!==(n=null==b?void 0:b.ref)&&void 0!==n?n:"_","/settings/addons?panel=").concat(v),children:g||("free"===C?"Upgrade to Pro":"Enable add on")})})]})]})})}},69513:function(e,t,s){"use strict";s.d(t,{s:function(){return o}});var r=s(36492),a=s(31696),n=s(90301);async function i(e,t){let{installationId:s}=e;if(!s)throw Error("installationId is required");let{data:r,error:n}=await (0,a.U2)("/platform/vercel/redirect/{installation_id}",{params:{path:{installation_id:s}},signal:t});return n&&(0,a.S3)(n),r}let o=function(e){let{installationId:t}=e,{enabled:s=!0,...a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.a)(n.F.vercelRedirect(t),e=>{let{signal:s}=e;return i({installationId:t},s)},{enabled:s&&void 0!==t,...a})}},89091:function(e,t,s){"use strict";s.d(t,{D:function(){return o}});var r=s(48228),a=s(56958),n=s(31696);async function i(e){let{ref:t,identifier:s}=e,r={};void 0!==s&&(r.database_identifier=s);let{data:a,error:i}=await (0,n.v_)("/platform/projects/{ref}/restart",{params:{path:{ref:t}},body:r});return i&&(0,n.S3)(i),a}let o=function(){let{onSuccess:e,onError:t,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.D)(e=>i(e),{async onSuccess(t,s,r){await (null==e?void 0:e(t,s,r))},async onError(e,s,r){void 0===t?a.Am.error("Failed to restart project: ".concat(e.message)):t(e,s,r)},...s})}},89068:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return e1}});var r=s(52322),a=s(59491),n=s(52006),i=s(91179),o=s(69767),l=s(39097),c=s.n(l),d=s(56958),u=s(27570),m=s(6554),h=s(67873),x=s(4787),f=s(64306),p=s(41679),j=s(85945),v=s(48228),g=s(88354),y=s(99248),b=s(27181);async function N(e){let{ref:t,name:s}=e,r=await (0,g.r$)("".concat(y.T5,"/projects/").concat(t),{name:s});if(r.error)throw r.error;return r}let w=function(){let{onSuccess:e,onError:t,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(0,j.NL)();return(0,v.D)(e=>N(e),{async onSuccess(t,s,a){let{ref:n}=s;await Promise.all([r.invalidateQueries(b.i.list()),r.invalidateQueries(b.i.detail(n))]),await (null==e?void 0:e(t,s,a))},async onError(e,s,r){void 0===t?d.Am.error("Failed to update project: ".concat(e.message)):t(e,s,r)},...s})};var C=s(87175),k=s(89823),S=s(26211),_=s(75939),Z=s(95492),A=s(37970),z=s(62277),T=s(750),P=s(55283),D=s(32079),R=s(46145);/**
- * @license lucide-react v0.436.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */let E=(0,R.Z)("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);var L=s(5632),F=s(2784),M=s(44778),q=s(31696);async function O(e){let{ref:t}=e,{data:s,error:r}=await (0,q.v_)("/platform/projects/{ref}/pause",{params:{path:{ref:t}}});return r&&(0,q.S3)(r),s}let W=function(){let{onSuccess:e,onError:t,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,v.D)(e=>O(e),{async onSuccess(t,s,r){await (null==e?void 0:e(t,s,r))},async onError(e,s,r){void 0===t?d.Am.error("Failed to pause project: ".concat(e.message)):t(e,s,r)},...s})};var Y=s(26198),I=s(93463),U=s(74138),X=()=>{var e;let t=(0,L.useRouter)(),s=(0,j.NL)(),{project:n}=(0,u.d2)(),i=(0,k.l)(),o=(0,u.gY)(),[l,c]=(0,F.useState)(!1),m=null!==(e=null==n?void 0:n.ref)&&void 0!==e?e:"",h=(null==n?void 0:n.status)===y.S.INACTIVE,x=(0,C.Xo)(a.KA.INFRA_EXECUTE,"queue_jobs.projects.pause"),{data:f}=(0,I.Gl)({orgSlug:null==i?void 0:i.slug}),p=(null==f?void 0:f.plan.id)==="free",{mutate:v,isLoading:g}=W({onSuccess:(e,r)=>{(0,Y.k7)(s,r.ref,y.S.PAUSING),d.Am.success("Pausing project..."),t.push("/project/".concat(m))}});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.u,{type:"default",icon:(0,r.jsx)(E,{}),onClick:()=>c(!0),loading:g,disabled:!p||void 0===n||h||!x||!o,tooltip:{content:{side:"bottom",text:h?"Your project is already paused":x?o?p?void 0:"Projects on a paid plan will always be running":"Unable to pause project as project is not active":"You need additional permissions to pause this project"}},children:"Pause project"}),(0,r.jsx)(U.Z,{variant:"destructive",visible:l,loading:g,title:"Pause this project?",confirmLabel:"Pause project",confirmLabelLoading:"Pausing project",onCancel:()=>c(!1),onConfirm:()=>{if(!x)return d.Am.error("You do not have the required permissions to pause this project");v({ref:m})},children:(0,r.jsx)("p",{className:"text-foreground-light text-sm",children:"Are you sure you want to pause this project? It will not be accessible until you unpause it."})})]})},V=s(89091);async function B(e){let{ref:t,region:s,services:r=["postgresql"],source_notification_id:a}=e,{data:n,error:i}=await (0,q.v_)("/platform/projects/{ref}/restart-services",{params:{path:{ref:t}},body:{restartRequest:{region:s,services:r,source_notification_id:a}}});return i&&(0,q.S3)(i),n}let G=function(){let{onSuccess:e,onError:t,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,v.D)(e=>B(e),{async onSuccess(t,s,r){await (null==e?void 0:e(t,s,r))},async onError(e,s,r){void 0===t?d.Am.error("Failed to restart project: ".concat(e.message)):t(e,s,r)},...s})};var Q=s(78232),H=s(2322),K=s(34503),J=s(73831),$=()=>{var e,t;let s=(0,L.useRouter)(),n=(0,j.NL)(),{project:i}=(0,u.d2)(),o=(0,u.gY)(),[l,c]=(0,F.useState)(),m=null!==(e=null==i?void 0:i.ref)&&void 0!==e?e:"",h=null!==(t=null==i?void 0:i.region)&&void 0!==t?t:"",x=(0,_.P)("disableProjectRestarts"),f=(0,C.Xo)(a.KA.INFRA_EXECUTE,"reboot"),{mutate:p,isLoading:v}=(0,V.D)({onSuccess:()=>{k()},onError:e=>{w(e,"project")}}),{mutate:g,isLoading:y}=G({onSuccess:()=>{k()},onError:e=>{w(e,"database")}}),b=()=>{if(!f)return d.Am.error("You do not have the required permissions to restart this project");p({ref:m})},N=async()=>{if(!f)return d.Am.error("You do not have the required permissions to restart this project");g({ref:m,region:h,services:["postgresql"]})},w=(e,t)=>{d.Am.error("Unable to restart ".concat(t,": ").concat(e.message)),c(void 0)},k=()=>{(0,Y.k7)(n,m,"RESTARTING"),d.Am.success("Restarting server..."),s.push("/project/".concat(m)),c(void 0)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(H.u,{children:[(0,r.jsx)(H.aJ,{asChild:!0,children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(D.z,{type:"default",className:"px-3 ".concat(f&&o?"rounded-r-none":""),disabled:void 0===i||!f||!o||x,onClick:()=>c("project"),children:"Restart project"}),f&&o&&!x&&(0,r.jsxs)(K.h_,{children:[(0,r.jsx)(K.$F,{asChild:!0,children:(0,r.jsx)(D.z,{type:"default",className:"rounded-l-none px-[4px] py-[5px]",icon:(0,r.jsx)(Q.Z,{}),disabled:!f})}),(0,r.jsx)(K.AW,{align:"end",side:"bottom",children:(0,r.jsx)(K.Xi,{disabled:v||y,onClick:()=>{c("database")},children:(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("p",{className:"block text-foreground",children:"Fast database reboot"}),(0,r.jsx)("p",{className:"block text-foreground-light",children:"Restarts only the database - faster but may not be able to recover from all failure modes"})]})},"database")})]})]})}),(void 0!==i&&(!f||!o)||x)&&(0,r.jsx)(H._v,{side:"bottom",children:x?"Project restart is currently disabled":f?o?"":"Unable to restart project as project is not active":"You need additional permissions to restart this project"})]}),(0,r.jsx)(J.Z,{danger:!0,visible:void 0!==l,title:"Restart ".concat(l),description:(0,r.jsxs)(r.Fragment,{children:["Are you sure you want to restart the"," ",(0,r.jsx)("span",{className:"text-foreground",children:l}),"? There will be a few minutes of downtime."]}),buttonLabel:"Restart",buttonLoadingLabel:"Restarting",onSelectCancel:()=>c(void 0),onSelectConfirm:async()=>{"project"===l?await b():"database"===l&&await N()}})]})},ee=()=>{var e,t,s,l;let{project:j}=(0,u.d2)(),v=(0,k.l)(),g=(0,_.P)("v2AnnouncementUrl"),y=null==j?void 0:j.v2MaintenanceWindow,b=(null==y?void 0:y.start)?new Date(y.start).toUTCString().slice(0,16):void 0,N=null==y?void 0:null===(e=y.start)||void 0===e?void 0:e.substring(11,16),R=null==y?void 0:null===(t=y.end)||void 0===t?void 0:t.substring(11,16),E=(0,S.N)(null==j?void 0:j.parent_project_ref),L=void 0!==E,F="project-general-settings",M={name:null!==(s=null==j?void 0:j.name)&&void 0!==s?s:"",ref:null!==(l=null==j?void 0:j.ref)&&void 0!==l?l:""},q=(0,C.Xo)(a.KA.UPDATE,"projects",{resource:{project_id:null==j?void 0:j.id}}),{mutate:O,isLoading:W}=w(),Y=async(e,t)=>{let{resetForm:s}=t;if(!(null==j?void 0:j.ref))return console.error("Ref is required");O({ref:j.ref,name:e.name.trim()},{onSuccess:e=>{let{name:t}=e;s({values:{name:t},initialValues:{name:t}}),d.Am.success("Successfully saved settings")}})};return(0,r.jsxs)("div",{children:[L&&(0,r.jsxs)(Z.bZ,{variant:"default",className:"mb-6",children:[(0,r.jsx)(A.aN,{}),(0,r.jsx)(Z.Cd,{children:"You are currently on a preview branch of your project"}),(0,r.jsxs)(Z.X,{children:["Certain settings are not available while you're on a preview branch. To adjust your project settings, you may return to your"," ",(0,r.jsx)(c(),{href:"/project/".concat(E.ref,"/settings/general"),className:"text-brand",children:"main branch"}),"."]})]}),void 0===j?(0,r.jsx)(p.A,{}):(0,r.jsx)(z.Z,{id:F,initialValues:M,onSubmit:Y,children:e=>{let{handleReset:t,values:s,initialValues:a}=e,n=JSON.stringify(s)!==JSON.stringify(a);return(0,r.jsx)(h.by,{disabled:!q,footer:(0,r.jsx)("div",{className:"flex py-4 px-8",children:(0,r.jsx)(m.i,{form:F,isSubmitting:W,hasChanges:n,handleReset:t,helper:q?void 0:"You need additional permissions to manage this project's settings"})}),children:(0,r.jsx)(x.hj,{header:(0,r.jsx)(x.S0,{children:"General settings"}),children:(0,r.jsxs)(x.B4,{loading:!1,children:[(0,r.jsx)(T.Z,{id:"name",size:"small",label:"Project name",disabled:L||!q}),(0,r.jsx)(T.Z,{copy:!0,disabled:!0,id:"ref",size:"small",label:"Reference ID"})]})})})}}),!L&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mt-6",id:"restart-project",children:(0,r.jsxs)(h.by,{children:[(0,r.jsxs)("div",{className:"flex flex-col px-8 py-4",children:[N&&R&&"https://"!==g&&(0,r.jsxs)(Z.bZ,{variant:"warning",className:"mb-4",children:[(0,r.jsx)(n.Z,{strokeWidth:2}),(0,r.jsx)(Z.Cd,{children:"Upcoming project restart scheduled"}),(0,r.jsxs)(Z.X,{className:"flex flex-col gap-3",children:["This project will automatically restart on ",b," between"," ",N," and ",R," UTC, which will cause up to a few minutes of downtime.",(0,r.jsxs)(P.zF,{children:[(0,r.jsxs)(P.wy,{className:"text-foreground-light transition-all [&[data-state=open]&_svg]:rotate-90 hover:text-foreground data-[state=open]:text-foreground flex items-center gap-x-2 w-full",children:[(0,r.jsx)(i.Z,{className:"transition-transform",strokeWidth:1.5,size:14}),"Why this time?"]}),(0,r.jsx)(P.Fw,{children:"Your project has historically had the least database queries across the previous 10 weeks during this 30 minute window."})]}),"You may also manually restart this project anytime before"," ",b," ",N," UTC at a time that is convenient for you.",(0,r.jsx)("br",{}),(0,r.jsx)("br",{}),(0,r.jsxs)("em",{children:[(0,r.jsx)("a",{href:g,target:"_blank",rel:"noreferrer",className:"underline",children:"Find out more"})," ","about our v2 platform architecture migration."]})]})]}),(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm",children:"Restart project"}),(0,r.jsx)("div",{className:"max-w-[420px]",children:(0,r.jsx)("p",{className:"text-sm text-foreground-light",children:"Your project will not be available for a few minutes."})})]}),(0,r.jsx)($,{})]})]}),(0,r.jsxs)("div",{className:"flex w-full items-center justify-between px-8 py-4",id:"pause-project",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm",children:"Pause project"}),(0,r.jsx)("div",{className:"max-w-[420px]",children:(0,r.jsx)("p",{className:"text-sm text-foreground-light",children:"Your project will not be accessible while it is paused."})})]}),(0,r.jsx)(X,{})]})]})}),(0,r.jsx)("div",{className:"mt-6",children:(0,r.jsx)(f.Z,{children:(0,r.jsx)(f.Z.Content,{children:(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)("div",{className:"flex space-x-4",children:[(0,r.jsx)(o.Z,{strokeWidth:2}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm",children:"Project usage statistics has been moved"}),(0,r.jsx)("p",{className:"text-foreground-light text-sm",children:"You may view your project's usage under your organization's settings"})]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(D.z,{asChild:!0,type:"default",children:(0,r.jsx)(c(),{href:"/org/".concat(null==v?void 0:v.slug,"/usage?projectRef=").concat(null==j?void 0:j.ref),children:"View project usage"})})})]})})})})]})]})},et=s(99959),es=s(70987),er=s(75716),ea=s(53535),en=s(22721);async function ei(e){let{domain:t}=e,s=await fetch("https://1.1.1.1/dns-query?name=".concat(t,"&type=CNAME"),{method:"GET",headers:{accept:"application/dns-json"}}),r=await s.json();if(void 0===r.Answer)throw Error("Your CNAME record for ".concat(t," cannot be found - if you've just added the record, do check back in a bit."));return r.Answer.some(e=>5===e.type)}let eo=function(){let{onSuccess:e,onError:t,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,v.D)(e=>ei(e),{async onSuccess(t,s,r){await (null==e?void 0:e(t,s,r))},async onError(e,s,r){void 0===t?d.Am.error("Failed to check CNAME record: ".concat(e.message)):t(e,s,r)},...s})};var el=s(42282);async function ec(e){let{projectRef:t}=e,{data:s,error:r}=await (0,q.v_)("/v1/projects/{ref}/custom-hostname/activate",{params:{path:{ref:t}}});return r&&(0,q.S3)(r),s}let ed=function(){let{onSuccess:e,onError:t,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(0,j.NL)();return(0,v.D)(e=>ec(e),{async onSuccess(t,s,a){let{projectRef:n}=s;await r.invalidateQueries(el.A.list(n)),await (null==e?void 0:e(t,s,a))},async onError(e,s,r){void 0===t?d.Am.error("Failed to activate custom domain: ".concat(e.message)):t(e,s,r)},...s})};async function eu(e){let{projectRef:t}=e,{data:s,error:r}=await (0,q.IV)("/v1/projects/{ref}/custom-hostname",{params:{path:{ref:t}}});return r&&(0,q.S3)(r),s}let em=function(){let{onSuccess:e,onError:t,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(0,j.NL)();return(0,v.D)(e=>eu(e),{async onSuccess(t,s,a){let{projectRef:n}=s;r.setQueriesData(el.A.list(n),()=>({customDomain:null,status:"0_no_hostname_configured"})),await (null==e?void 0:e(t,s,a))},async onError(e,s,r){void 0===t?d.Am.error("Failed to delete custom domain: ".concat(e.message)):t(e,s,r)},...s})};var eh=s(17172),ex=e=>{let{projectRef:t,customDomain:s}=e,[a,i]=(0,F.useState)(!1),{data:o}=(0,ea.q)({projectRef:t}),{mutate:l,isLoading:u}=eo(),{mutate:m,isLoading:h}=ed({onSuccess:()=>{d.Am.success("Successfully activated custom domain"),i(!1)}}),{mutate:x,isLoading:p}=em(),j=null==o?void 0:o.autoApiService.endpoint,v=async()=>{if(!t)return console.error("Project ref is required");l({domain:s.hostname},{onSuccess:()=>m({projectRef:t})})},g=async()=>{if(!t)return console.error("Project ref is required");x({projectRef:t})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex flex-col items-start",children:[(0,r.jsxs)(f.Z.Content,{children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsxs)("h4",{className:"text-foreground",children:["Setup complete! Press activate to enable the custom domain"," ",(0,r.jsx)("code",{className:"text-sm",children:s.hostname})," for this project."]}),(0,r.jsx)("span",{className:"text-sm text-foreground-light",children:"We recommend that you schedule a downtime window of 20 - 30 minutes for your application, as you will need to update any services that need to know about your custom domain (e.g client side code or OAuth providers)"})]}),(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsxs)(Z.bZ,{children:[(0,r.jsx)(n.Z,{className:"text-foreground-light",strokeWidth:1.5}),(0,r.jsx)(Z.Cd,{children:"Remember to restore the original CNAME record from the first step before activating"}),(0,r.jsx)(Z.X,{children:(0,r.jsxs)("p",{className:"col-span-12 text-sm lg:col-span-7 leading-6",children:["Set up a CNAME record for ",(0,r.jsx)("code",{className:"text-xs",children:s.hostname}),", resolving to"," ",j?(0,r.jsx)("code",{className:"text-xs",children:j}):"your project's API URL",", with as low a TTL as possible. If you're using Cloudflare as your DNS provider, disable the proxy option."]})})]})})]}),(0,r.jsx)("div",{className:"w-full border-t border-muted"}),(0,r.jsx)(f.Z.Content,{className:"w-full",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(D.z,{asChild:!0,type:"default",icon:(0,r.jsx)(eh.Z,{}),children:(0,r.jsx)(c(),{href:"https://supabase.com/docs/guides/platform/custom-domains",target:"_blank",rel:"noreferrer",children:"Documentation"})}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(D.z,{type:"default",onClick:g,loading:p,disabled:p,className:"self-end",children:"Cancel"}),(0,r.jsx)(D.z,{icon:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1,stroke:"currentColor",className:"w-4 h-4",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75z"})}),disabled:p,onClick:()=>i(!0),className:"self-end",children:"Activate"})]})]})})]}),(0,r.jsx)(U.Z,{size:"small",loading:u||h,visible:a,title:(0,r.jsxs)(r.Fragment,{children:["Are you sure you want to activate the custom domain"," ",(0,r.jsx)("code",{className:"text-sm",children:s.hostname})," for the project?"]}),confirmLabel:"Activate",confirmLabelLoading:"Activating",onCancel:()=>i(!1),onConfirm:v,children:(0,r.jsxs)("p",{className:"text-sm",children:["This will activate the custom domain ",(0,r.jsx)("code",{children:s.hostname}),". Your project's Supabase domain will also remain active."]})})]})},ef=s(3536),ep=e=>{let{projectRef:t,customDomain:s}=e,[a,n]=(0,F.useState)(!1),{mutate:i}=em({onSuccess:()=>{d.Am.success("Successfully deleted custom domain"),n(!1)}}),o=async()=>{if(!t)return console.error("Project ref is required");i({projectRef:t})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(f.Z.Content,{children:(0,r.jsxs)("div",{className:"w-full space-y-2",children:[(0,r.jsx)("p",{className:"text-xs text-foreground-light",children:"Active custom domain:"}),(0,r.jsx)("div",{className:"flex items-center space-x-2",children:(0,r.jsxs)("code",{className:"text-lg mx-0 flex items-center space-x-2",children:[(0,r.jsx)("div",{className:"h-2 w-2 rounded-full bg-brand"}),(0,r.jsx)("span",{children:s.hostname})]})}),(0,r.jsx)("p",{className:"text-sm text-foreground-light",children:"Your custom domain is currently active and is serving traffic"})]})}),(0,r.jsx)("div",{className:"w-full border-t border-muted"}),(0,r.jsx)(f.Z.Content,{className:"w-full",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(D.z,{asChild:!0,type:"default",icon:(0,r.jsx)(eh.Z,{}),children:(0,r.jsx)(c(),{href:"https://supabase.com/docs/guides/platform/custom-domains",target:"_blank",rel:"noreferrer",children:"Documentation"})}),(0,r.jsx)(D.z,{type:"danger",icon:(0,r.jsx)(ef.Z,{}),onClick:()=>n(!0),children:"Delete Custom Domain"})]})}),(0,r.jsx)(J.Z,{danger:!0,visible:a,title:(0,r.jsxs)("div",{children:["Are you sure you want to delete the custom domain"," ",(0,r.jsx)("code",{className:"text-sm",children:s.hostname})," for the project?"]}),description:"Your custom domain will be deactivated. You will need to re-verify your domain if you want to use it again.",buttonLabel:"Delete",buttonLoadingLabel:"Deleting",onSelectCancel:()=>n(!1),onSelectConfirm:o})]})};async function ej(e){let{projectRef:t}=e,{data:s,error:r}=await (0,q.v_)("/v1/projects/{ref}/custom-hostname/reverify",{params:{path:{ref:t}}});return r&&(0,q.S3)(r),s}let ev=function(){let{onSuccess:e,onError:t,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(0,j.NL)();return(0,v.D)(e=>ej(e),{async onSuccess(t,s,a){let{projectRef:n}=s;await r.invalidateQueries(el.A.list(n)),await (null==e?void 0:e(t,s,a))},async onError(e,s,r){void 0===t?d.Am.error("Failed to reverify custom domain: ".concat(e.message)):t(e,s,r)},...s})};var eg=e=>{let{type:t,name:s,value:a}=e;return(0,r.jsxs)("div",{className:"flex gap-4 items-center",children:[(0,r.jsx)("div",{className:"w-[50px]",children:(0,r.jsx)("p",{className:"font-mono text-base",children:t.toUpperCase()})}),(0,r.jsx)(T.Z,{readOnly:!0,copy:!0,disabled:!0,className:"input-mono flex-1",value:s,layout:"vertical"}),(0,r.jsx)(T.Z,{readOnly:!0,copy:!0,disabled:!0,className:"input-mono flex-1",value:a,layout:"vertical"})]})},ey=s(78976),eb=s(44446),eN=e=>{var t,s,a,i,o;let{projectRef:l,customDomain:d,settings:u}=e,[m,h]=(0,F.useState)(!1),{mutate:x,isLoading:p}=ev({onSuccess:e=>{"2_initiated"===e.status&&h(!0)}}),{mutate:j,isLoading:v}=em(),g=null===(t=d.ssl.validation_errors)||void 0===t?void 0:t.reduce((e,t)=>e||t.message.includes("caa_error"),!1),y=async()=>{if(!l)return console.error("Project ref is required");j({projectRef:l})};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(f.Z.Content,{className:"space-y-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("h4",{className:"text-foreground mb-2",children:["Configure TXT verification for your custom domain"," ",(0,r.jsx)("code",{className:"text-sm",children:d.hostname})]}),(0,r.jsx)("p",{className:"text-sm text-foreground-light",children:"Set the following TXT record(s) in your DNS provider, then click verify to confirm your control over the domain."}),(0,r.jsx)("p",{className:"text-sm text-foreground-light",children:"Records which have been successfully verified will be removed from this list below."}),(0,r.jsx)("div",{className:"mt-4 mb-2",children:(0,r.jsxs)(Z.bZ,{variant:"default",children:[m?(0,r.jsx)(n.Z,{className:"text-foreground-light",strokeWidth:1.5}):(0,r.jsx)(ey.Z,{className:"text-foreground-light",strokeWidth:1.5}),(0,r.jsx)(Z.Cd,{children:m?"Unable to verify records from DNS provider yet.":"Please note that it may take up to 24 hours for the DNS records to propagate."}),(0,r.jsx)(Z.X,{children:m?(0,r.jsxs)("div",{className:"mt-2",children:[(0,r.jsx)("p",{children:"Please check again soon. Note that it may take up to 24 hours for changes in DNS records to propagate."}),(0,r.jsxs)("p",{children:["You may also visit"," ",(0,r.jsx)(c(),{href:"https://whatsmydns.net/#TXT/".concat(d.hostname),className:"text-brand",children:"here"})," ","to check if your DNS has been propagated successfully before clicking verify."]}),(0,r.jsx)("p",{children:"Some registrars will require you to remove the domain name when creating DNS records. As an example, to create a record for `foo.app.example.com`, you would need to create an entry for `foo.app`."})]}):(0,r.jsxs)("p",{children:["You may also visit"," ",(0,r.jsx)(c(),{href:"https://whatsmydns.net/#TXT/".concat(d.hostname),className:"text-brand",children:"here"})," ","to check if your DNS has been propagated successfully before clicking verify."]})})]})})]}),g&&(0,r.jsxs)(Z.bZ,{children:[(0,r.jsx)(A.aN,{}),(0,r.jsx)(Z.Cd,{children:"Certificate Authority Authentication (CAA) error"}),(0,r.jsxs)(Z.X,{children:['Please add a CAA record allowing "digicert.com" to issue certificates for'," ",(0,r.jsx)("code",{className:"text-xs",children:d.hostname}),". For example:"," ",(0,r.jsx)("code",{className:"text-xs",children:'0 issue "digicert.com"'})]})]}),"validation_timed_out"===d.ssl.status?(0,r.jsxs)(Z.bZ,{children:[(0,r.jsx)(A.aN,{}),(0,r.jsx)(Z.Cd,{children:"Validation timed out"}),(0,r.jsx)(Z.X,{children:'Please click "Verify" again to retry the validation of the records'})]}):(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsx)("div",{className:"w-[50px]",children:(0,r.jsx)("p",{className:"text-foreground-light text-sm",children:"Type"})}),(0,r.jsx)("div",{className:"text-sm grid gap-2 md:grid md:grid-cols-12 md:gap-x-4 input-mono flex-1",children:(0,r.jsx)("div",{className:"flex flex-row space-x-2 justify-between col-span-12",children:(0,r.jsx)("label",{className:"block text-foreground-light text-sm break-all",children:"Name"})})}),(0,r.jsx)("div",{className:"text-sm grid gap-2 md:grid md:grid-cols-12 md:gap-x-4 input-mono flex-1",children:(0,r.jsx)("div",{className:"flex flex-row space-x-2 justify-between col-span-12",children:(0,r.jsx)("label",{className:"block text-foreground-light text-sm break-all",children:"Content"})})})]}),(null===(s=d.verification_errors)||void 0===s?void 0:s.includes("custom hostname does not CNAME to this zone."))&&(0,r.jsx)(eg,{type:"CNAME",name:d.hostname,value:null!==(a=null==u?void 0:u.autoApiService.endpoint)&&void 0!==a?a:"Loading..."}),d.ownership_verification&&(0,r.jsx)(eg,{type:d.ownership_verification.type,name:d.ownership_verification.name,value:d.ownership_verification.value}),"pending_validation"===d.ssl.status&&(0,r.jsx)(eg,{type:"TXT",name:null!==(i=d.ssl.txt_name)&&void 0!==i?i:"Loading...",value:null!==(o=d.ssl.txt_value)&&void 0!==o?o:"Loading..."}),"pending_deployment"===d.ssl.status&&(0,r.jsxs)("div",{className:"flex items-center justify-center space-x-2 py-8",children:[(0,r.jsx)(n.Z,{size:16,strokeWidth:1.5}),(0,r.jsx)("p",{className:"text-sm text-foreground-light",children:"SSL certificate is being deployed. Please wait a few minutes and try again."})]})]}),(0,r.jsxs)("div",{className:"!mt-4",children:[(0,r.jsxs)("p",{className:"text-sm text-foreground-light",children:["One of the records requires you to"," ",(0,r.jsx)("span",{className:"text-foreground-light",children:"replace"})," the CNAME record set up in the first step with a TXT record."]}),(0,r.jsx)("p",{className:"text-sm text-foreground-light",children:"You'll be able to restore it back to the CNAME after the verification process has been completed."})]})]}),(0,r.jsx)("div",{className:"border-t border-muted"}),(0,r.jsx)(f.Z.Content,{children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(D.z,{asChild:!0,type:"default",icon:(0,r.jsx)(eh.Z,{}),children:(0,r.jsx)(c(),{href:"https://supabase.com/docs/guides/platform/custom-domains",target:"_blank",rel:"noreferrer",children:"Documentation"})}),(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,r.jsx)(D.z,{type:"default",onClick:y,loading:v,disabled:v||p,className:"self-end",children:"Cancel"}),(0,r.jsx)(D.z,{icon:(0,r.jsx)(eb.Z,{}),onClick:()=>{if(!l)return console.error("Project ref is required");x({projectRef:l})},loading:p,disabled:v||p,className:"self-end",children:"Verify"})]})]})})]})},ew=s(48601);async function eC(e){let{projectRef:t,customDomain:s}=e,{data:r,error:a}=await (0,q.v_)("/v1/projects/{ref}/custom-hostname/initialize",{params:{path:{ref:t}},body:{custom_hostname:s}});return a&&(0,q.S3)(a),r}let ek=function(){let{onSuccess:e,onError:t,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(0,j.NL)();return(0,v.D)(e=>eC(e),{async onSuccess(t,s,a){let{projectRef:n}=s;await r.invalidateQueries(el.A.list(n)),await (null==e?void 0:e(t,s,a))},async onError(e,s,r){void 0===t?d.Am.error("Failed to create custom domain: ".concat(e.message)):t(e,s,r)},...s})},eS=ew.object({domain:ew.string().required("A value for your custom domain is required")});var e_=()=>{let{ref:e}=(0,et.UO)(),{project:t}=(0,u.d2)(),{mutate:s,isLoading:n}=eo(),{mutate:i,isLoading:o}=ek(),{data:l}=(0,ea.q)({projectRef:e}),d="custom-domains-form",f=null==l?void 0:l.autoApiService.endpoint,p=(0,C.Xo)(a.KA.UPDATE,"projects",{resource:{project_id:null==t?void 0:t.id}}),j=async t=>{if(!e)return console.error("Project ref is required");s({domain:t.domain},{onSuccess:()=>{i({projectRef:e,customDomain:t.domain})}})};return(0,r.jsx)(z.Z,{id:d,initialValues:{domain:""},validationSchema:eS,onSubmit:j,children:e=>{let{handleReset:t,values:s,initialValues:a}=e,i=JSON.stringify(s)!==JSON.stringify(a);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(h.by,{disabled:!p,footer:(0,r.jsx)("div",{className:"flex py-4 px-8",children:(0,r.jsx)(m.i,{form:d,isSubmitting:n||o,submitText:"Add",hasChanges:i,handleReset:t,disabled:!1,helper:p?(0,r.jsx)(D.z,{asChild:!0,type:"default",icon:(0,r.jsx)(eh.Z,{}),children:(0,r.jsx)(c(),{href:"https://supabase.com/docs/guides/platform/custom-domains",target:"_blank",rel:"noreferrer",children:"Documentation"})}):"You need additional permissions to update your project's custom domain settings"})}),children:[(0,r.jsx)(x.hj,{header:(0,r.jsx)(x.S0,{children:"Add a custom domain"}),children:(0,r.jsx)(x.B4,{loading:!1,children:(0,r.jsx)(T.Z,{id:"domain",disabled:!p,className:"w-full",type:"text",name:"domain",placeholder:"subdomain.example.com"})})}),(0,r.jsx)(x.hj,{header:(0,r.jsx)(x.S0,{children:"Configure a CNAME record"}),children:(0,r.jsxs)("p",{className:"col-span-12 text-sm lg:col-span-7 leading-6",children:["Set up a CNAME record for"," ",s.domain?(0,r.jsx)("code",{className:"text-xs",children:s.domain}):"your custom domain",", resolving to"," ",f?(0,r.jsx)("code",{className:"text-xs",children:f}):"your project's API URL",", with as low a TTL as possible. If you're using Cloudflare as your DNS provider, disable the proxy option."]})})]})})}})},eZ=()=>(0,r.jsxs)("div",{className:"grid grid-cols-12 gap-6 px-8 py-8",children:[(0,r.jsx)("div",{className:"col-span-12 lg:col-span-5",children:(0,r.jsx)("div",{className:"h-6 w-1/3 bg-foreground-lighter rounded shimmering-loader"})}),(0,r.jsx)("div",{className:"col-span-12 lg:col-span-7",children:(0,r.jsx)("div",{className:"h-[38px] w-full bg-foreground-lighter rounded shimmering-loader"})})]}),eA=()=>{var e;let{ref:t}=(0,et.UO)(),s=(0,k.l)(),a=(0,_.P)("customDomainsDisabledDueToQuota"),{data:i}=(0,I.Gl)({orgSlug:null==s?void 0:s.slug}),o=null==i?void 0:null===(e=i.plan)||void 0===e?void 0:e.id,{isLoading:l,data:d}=(0,ea.q)({projectRef:t}),{isLoading:u,isError:m,isSuccess:h,data:x}=(0,en.z)({projectRef:t});return(0,r.jsxs)("section",{id:"custom-domains",children:[(0,r.jsx)(es.p,{title:"Custom Domains",description:"Present a branded experience to your users"}),l||u?(0,r.jsx)(f.Z,{children:(0,r.jsx)(f.Z.Content,{className:"space-y-6",children:(0,r.jsx)(eZ,{})})}):m?(0,r.jsx)(f.Z,{children:(0,r.jsx)(f.Z.Content,{className:"space-y-6",children:(0,r.jsxs)("div",{className:"flex items-center justify-center space-x-2 py-8",children:[(0,r.jsx)(n.Z,{size:16,strokeWidth:1.5}),(0,r.jsxs)("p",{className:"text-sm text-foreground-light",children:["Failed to retrieve custom domain configuration. Please try again later or"," ",(0,r.jsx)(c(),{href:"/support/new?ref=".concat(t,"&category=sales"),className:"underline",children:"contact support"}),"."]})]})})}):(null==x?void 0:x.status)==="0_no_hostname_configured"?(0,r.jsx)(e_,{}):(null==x?void 0:x.status)==="0_not_allowed"?(0,r.jsx)(er.Z,{icon:(0,r.jsx)(n.Z,{size:18,strokeWidth:1.5}),primaryText:a?"New custom domains are temporarily disabled":"Custom domains are a Pro Plan add-on",secondaryText:a?"We are working with our upstream DNS provider before we are able to sign up new custom domains. Please check back in a few hours.":"free"===o?"To configure a custom domain for your project, please upgrade to the Pro Plan with the custom domains add-on selected":"To configure a custom domain for your project, please enable the add-on",addon:"customDomain",disabled:a}):(0,r.jsx)(f.Z,{children:h&&(0,r.jsxs)("div",{className:"flex flex-col",children:[("1_not_started"===x.status||"2_initiated"===x.status||"3_challenge_verified"===x.status)&&(0,r.jsx)(eN,{projectRef:t,customDomain:x.customDomain,settings:d}),"4_origin_setup_completed"===x.status&&(0,r.jsx)(ex,{projectRef:t,customDomain:x.customDomain}),"5_services_reconfigured"===x.status&&(0,r.jsx)(ep,{projectRef:t,customDomain:x.customDomain})]})})]})},ez=s(88137),eT=e=>{let{type:t="danger"}=e,{project:s}=(0,u.d2)(),[n,i]=(0,F.useState)(!1),o=(0,C.Xo)(a.KA.UPDATE,"projects",{resource:{project_id:null==s?void 0:s.id}});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.u,{type:t,disabled:!o,onClick:()=>i(!0),tooltip:{content:{side:"bottom",text:"You need additional permissions to delete this project"}},children:"Delete project"}),(0,r.jsx)(ez.Z,{visible:n,onClose:()=>i(!1)})]})},eP=s(81073),eD=()=>{let e=(0,k.l)(),{project:t}=(0,u.d2)();return void 0===t?null:(0,r.jsxs)("section",{id:"delete-project",children:[(0,r.jsx)(es.p,{title:"Delete Project",description:""}),(0,r.jsx)(f.Z,{children:(0,r.jsx)(f.Z.Content,{children:(null==e?void 0:e.managed_by)!=="vercel-marketplace"?(0,r.jsxs)(Z.bZ,{variant:"destructive",children:[(0,r.jsx)(A.ku,{}),(0,r.jsx)(Z.Cd,{children:"Deleting this project will also remove your database."}),(0,r.jsx)(Z.X,{children:"Make sure you have made a backup if you want to keep your data."}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(eT,{})})]}):(0,r.jsx)(eP.Z,{partner:"vercel-marketplace",resource:"Projects",cta:{installationId:null==e?void 0:e.partner_id,message:"Delete project in Vercel Marketplace"}})})})]})},eR=s(31310);async function eE(e){let{projectRef:t,targetOrganizationSlug:s}=e;if(!t)throw Error("projectRef is required");if(!s)throw Error("targetOrganizationSlug is required");let r=await (0,g.v_)("".concat(y.T5,"/projects/").concat(t,"/transfer"),{target_organization_slug:s});if(r.error)throw r.error;return r}let eL=function(){let{onSuccess:e,onError:t,...s}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(0,j.NL)();return(0,v.D)(e=>eE(e),{async onSuccess(t,s,a){let{projectRef:n,targetOrganizationSlug:i}=s;await Promise.all([r.invalidateQueries(b.i.projectTransferPreview(n,i)),r.invalidateQueries(b.i.detail(n)),r.invalidateQueries(b.i.list())]),await (null==e?void 0:e(t,s,a))},async onError(e,s,r){void 0===t?d.Am.error("Failed to transfer project: ".concat(e.message)):t(e,s,r)},...s})};var eF=s(36492);async function eM(e,t){let{projectRef:s,targetOrganizationSlug:r}=e;if(!s)throw Error("projectRef is required");if(!r)throw Error("targetOrganizationSlug is required");let a=await (0,g.v_)("".concat(y.T5,"/projects/").concat(s,"/transfer/preview"),{target_organization_slug:r},{signal:t});if(a.error)throw a.error;return a}let eq=function(e){let{projectRef:t,targetOrganizationSlug:s}=e,{enabled:r=!0,...a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,eF.a)(b.i.projectTransferPreview(t,s),e=>{let{signal:r}=e;return eM({projectRef:t,targetOrganizationSlug:s},r)},{enabled:r&&void 0!==t&&void 0!==s,...a,retry:(e,t)=>("object"!=typeof t||null===t||!("code"in t)||400!==t.code)&&e<3})};var eO=s(6838),eW=s(72583),eY=s(19615);/**
- * @license lucide-react v0.436.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */let eI=(0,R.Z)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);var eU=s(83690),eX=s(62284),eV=s(55446),eB=s(48869),eG=()=>{let e=(0,S.V)(),t=null==e?void 0:e.ref,s=null==e?void 0:e.organization_id,{data:n}=(0,eR.tl)(),i=(0,_.P)("disableProjectTransfer"),o=(n||[]).filter(e=>e.id!==s),[l,u]=(0,F.useState)(!1),[m,h]=(0,F.useState)(),{mutate:x,error:f,isLoading:p}=eL({onSuccess:()=>{d.Am.success("Successfully transferred project ".concat(null==e?void 0:e.name,".")),u(!1)}}),{data:j,error:v,isLoading:g,remove:y}=eq({projectRef:t,targetOrganizationSlug:m},{enabled:!p&&l});(0,F.useEffect)(()=>{l?h(void 0):y()},[l]);let b=(0,C.Xo)(a.KA.UPDATE,"organizations"),N=()=>{u(!l)};async function w(){void 0!==e&&void 0!==m&&x({projectRef:t,targetOrganizationSlug:m})}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M.u,{type:"default",onClick:N,disabled:!b||i,tooltip:{content:{side:"bottom",text:b?"Project transfers are temporarily disabled, please try again later.":"You need additional permissions to transfer this project"}},children:"Transfer project"}),(0,r.jsxs)(eU.Z,{onCancel:()=>N(),visible:l,loading:p,size:"xlarge",header:"Transfer project ".concat(null==e?void 0:e.name),customFooter:(0,r.jsxs)("div",{className:"flex items-center space-x-2 justify-end",children:[(0,r.jsx)(D.z,{type:"default",onClick:()=>u(!1),children:"Cancel"}),(0,r.jsx)(D.z,{onClick:()=>w(),disabled:!j||!j.valid||p||!m,children:"Transfer Project"})]}),children:[(0,r.jsxs)(eU.Z.Content,{className:"text-foreground-light",children:[(0,r.jsxs)("p",{className:"text-sm",children:["To transfer projects, the owner must be a member of both the source and target organizations. For further information see our"," ",(0,r.jsx)(c(),{href:"https://supabase.com/docs/guides/platform/project-transfer",className:"text-brand hover:underline",target:"_blank",rel:"noreferrer",children:"Documentation"}),"."]}),(0,r.jsx)("p",{className:"mt-6 text-sm",children:"Transferring considerations:"}),(0,r.jsxs)("ul",{className:"mt-4 space-y-5 text-sm",children:[(0,r.jsxs)("li",{className:"flex gap-4",children:[(0,r.jsx)("span",{className:"shrink-0 mt-1",children:(0,r.jsx)(eO.Z,{})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-bold",children:"Possible downtime"}),(0,r.jsx)("p",{children:"There might be a short downtime when transferring projects from a paid to a free organization."})]})]}),(0,r.jsxs)("li",{className:"flex gap-4",children:[(0,r.jsx)("span",{className:"shrink-0 mt-1",children:(0,r.jsx)(eW.Z,{})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-bold",children:"Permissions"}),(0,r.jsx)("p",{children:"Depending on your role in the target organization, your level of permissions may change after transfer."})]})]}),(0,r.jsxs)("li",{className:"flex gap-4",children:[(0,r.jsx)("span",{className:"shrink-0 mt-1",children:(0,r.jsx)(eY.Z,{size:14,className:"flex-shrink-0"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-bold",children:"Features"}),(0,r.jsx)("p",{children:"Moving your project to an organization with a smaller subscription plan may result in the loss of certain features (i.e. image transformations)."})]})]})]})]}),(0,r.jsx)(eU.Z.Separator,{}),(0,r.jsx)(eU.Z.Content,{children:o&&(0,r.jsx)("div",{className:"space-y-2",children:0===o.length?(0,r.jsxs)("div",{className:"flex items-center gap-3 bg-surface-200 p-3 text-sm rounded-md border",children:[(0,r.jsx)(A.sz,{})," You do not have any organizations with an organization-based subscription."]}):(0,r.jsxs)(eX.Z,{label:"Select Target Organization",layout:"vertical",value:m,onChange:e=>h(e),placeholder:"Select Organization",children:[(0,r.jsx)(eX.Z.Option,{disabled:!0,label:"Select Organization",value:"",children:"Select Organization"},"no-results"),o.map(e=>(0,r.jsx)(eX.Z.Option,{label:e.name,value:e.slug,addOnBefore:()=>(0,r.jsx)(eI,{}),children:e.name},e.id))]})})}),(0,r.jsx)(eV.Z,{active:void 0!==m&&g,children:(0,r.jsxs)(eU.Z.Content,{children:[j&&j.warnings.length>0&&(0,r.jsx)(eB.b,{withIcon:!0,variant:"warning",title:"Warnings for project transfer",className:"mt-3",children:(0,r.jsx)("div",{className:"space-y-1",children:j.warnings.map(e=>(0,r.jsx)("p",{children:e.message},e.key))})}),j&&j.errors.length>0&&(0,r.jsxs)(eB.b,{withIcon:!0,variant:"danger",title:"Project cannot be transferred",children:[(0,r.jsx)("div",{className:"space-y-1",children:j.errors.map(e=>(0,r.jsx)("p",{children:e.message},e.key))}),j.members_exceeding_free_project_limit.length>0&&(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("p",{className:"text-sm text-foreground-light",children:"These members have reached their maximum limits for the number of active Free plan projects within organizations where they are an administrator or owner:"}),(0,r.jsx)("ul",{className:"pl-5 text-sm list-disc text-foreground-light",children:(j.members_exceeding_free_project_limit||[]).map((e,t)=>(0,r.jsxs)("li",{children:[e.name," (Limit: ",e.limit," free projects)"]},"member-".concat(t)))}),(0,r.jsx)("p",{className:"text-sm text-foreground-light",children:"These members will need to either delete, pause, or upgrade one or more of their projects before you can downgrade this project."})]})]}),v&&!f&&(0,r.jsx)(eB.b,{withIcon:!0,variant:"danger",title:"Project cannot be transferred",children:(0,r.jsx)("p",{children:v.message})}),f&&(0,r.jsx)(eB.b,{withIcon:!0,variant:"danger",title:"Project cannot be transferred",children:(0,r.jsx)("p",{children:f.message})})]})})]})]})};/**
- * @license lucide-react v0.436.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */let eQ=(0,R.Z)("Truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);var eH=()=>void 0===(0,S.V)()?(0,r.jsx)(r.Fragment,{}):(0,r.jsxs)("section",{id:"transfer-project",children:[(0,r.jsx)(es.p,{title:"Transfer Project",description:"Transfer your project to a different organization."}),(0,r.jsx)(f.Z,{children:(0,r.jsx)(f.Z.Content,{children:(0,r.jsxs)("div",{className:"flex justify-between items-center gap-8",children:[(0,r.jsxs)("div",{className:"flex space-x-4",children:[(0,r.jsx)(eQ,{className:"mt-1"}),(0,r.jsxs)("div",{className:"space-y-1 xl:max-w-lg",children:[(0,r.jsx)("p",{className:"text-sm",children:"Transfer project to another organization"}),(0,r.jsx)("p",{className:"text-sm text-foreground-light",children:"To transfer projects, the owner must be a member of both the source and target organizations."})]})]}),(0,r.jsx)("div",{children:(0,r.jsx)(eG,{})})]})})})]}),eK=s(79067),eJ=s(74178),e$=s(40654);let e0=()=>{let{project:e}=(0,u.d2)(),t=!!(null==e?void 0:e.parent_project_ref),{projectsTransfer:s}=(0,e$.N)(["projects:transfer"]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eJ._S,{children:(0,r.jsx)(eJ.tU,{children:(0,r.jsx)(eJ.q7,{children:"Project Settings"})})}),(0,r.jsxs)(eJ._S,{className:"flex flex-col gap-10",bottomPadding:!0,children:[(0,r.jsx)(ee,{}),t?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eA,{}),s&&(0,r.jsx)(eH,{}),(0,r.jsx)(eD,{})]})]})]})};e0.getLayout=e=>(0,r.jsx)(eK.Z,{title:"General",children:e});var e1=e0},69767:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
- * @license lucide-react v0.436.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */let r=(0,s(46145).Z)("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]])},82137:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
- * @license lucide-react v0.436.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */let r=(0,s(46145).Z)("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},85563:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
- * @license lucide-react v0.436.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */let r=(0,s(46145).Z)("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]])},44446:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
- * @license lucide-react v0.436.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */let r=(0,s(46145).Z)("RefreshCw",[["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"}]])},72583:function(e,t,s){"use strict";s.d(t,{Z:function(){return r}});/**
- * @license lucide-react v0.436.0 - ISC
- *
- * This source code is licensed under the ISC license.
- * See the LICENSE file in the root directory of this source tree.
- */let r=(0,s(46145).Z)("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]])},74138:function(e,t,s){"use strict";var r=s(52322),a=s(2784),n=s(41909),i=s(54383),o=s(32079),l=s(71550);let c=(0,a.forwardRef)((e,t)=>{let{title:s,size:c="small",visible:d,onCancel:u,onConfirm:m,loading:h=!1,cancelLabel:x="Cancel",confirmLabel:f="Submit",confirmLabelLoading:p,alert:j,children:v,variant:g="default",disabled:y,...b}=e;(0,a.useEffect)(()=>{d&&w(!1)},[d]),(0,a.useEffect)(()=>{w(h)},[h]);let[N,w]=(0,a.useState)(!1);return(0,r.jsx)(n.Vq,{open:d,...b,onOpenChange:()=>{d&&u()},children:(0,r.jsxs)(n.cZ,{ref:t,className:"p-0 gap-0 pb-5 !block",size:c,children:[(0,r.jsx)(n.fK,{className:(0,i.cn)("border-b"),padding:"small",children:(0,r.jsx)(n.$N,{className:"",children:s})}),j&&(0,r.jsx)(l.J,{type:g,label:j.title,description:j.description,className:"border-r-0 border-l-0 rounded-none -mt-px [&_svg]:ml-0.5 mb-0",...null==j?void 0:j.base}),v&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.VO,{padding:"small",children:v}),(0,r.jsx)(n.P3,{})]}),(0,r.jsxs)("div",{className:"flex gap-2 px-5 pt-5",children:[(0,r.jsx)(o.z,{size:"medium",block:!0,type:"default",disabled:N,onClick:()=>u(),children:x}),(0,r.jsx)(o.z,{block:!0,size:"medium",type:"destructive"===g?"danger":"warning"===g?"warning":"primary",htmlType:"submit",loading:N,disabled:N||y,onClick:e=>{e.preventDefault(),e.stopPropagation(),w(!0),m()},className:"truncate",children:f})]})]})})});c.displayName="ConfirmationModal",t.Z=c},48869:function(e,t,s){"use strict";s.d(t,{b:function(){return m}});var r=s(52322),a=s(2784),n=s(46318),i=s(85563),o=s(38187),l=s(67815),c=s(82137),d=s(8609);let u={danger:(0,r.jsx)(i.Z,{strokeWidth:1.5,size:18}),success:(0,r.jsx)(o.Z,{strokeWidth:1.5,size:18}),warning:(0,r.jsx)(l.Z,{strokeWidth:1.5,size:18}),info:(0,r.jsx)(c.Z,{strokeWidth:1.5,size:18}),neutral:(0,r.jsx)(r.Fragment,{})};function m(e){let{variant:t="neutral",className:s,title:i,withIcon:o,closable:l,children:c,icon:m,actions:h}=e,x=(0,n.Z)("alert"),[f,p]=(0,a.useState)(!0),j=[x.base];j.push(x.variant[t].base),s&&j.push(s);let v=[x.description,x.variant[t].description],g=[x.close];return(0,r.jsx)(r.Fragment,{children:f&&(0,r.jsxs)("div",{className:j.join(" "),children:[o?(0,r.jsx)("div",{className:x.variant[t].icon,children:o&&u[t]}):null,m&&m,(0,r.jsxs)("div",{className:"flex flex-1 items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:[x.variant[t].header,x.header].join(" "),children:i}),(0,r.jsx)("div",{className:v.join(" "),children:c})]}),h]}),l&&(0,r.jsx)("button",{"aria-label":"Close alert",onClick:()=>p(!1),className:g.join(" "),children:(0,r.jsx)(d.Z,{strokeWidth:2,size:16})})]})})}},62284:function(e,t,s){"use strict";s.d(t,{Z:function(){return j}});var r=s(52322),a=s(40538),n=s(35676),i=s.n(n),o=s(2784),l=s(25001),c=s(71653),d=s(67440),u=s(46318),m=s(54383),h=s(70780);let x=(0,o.createContext)({onChange:e=>{},selected:void 0});var f=s(76141);function p(e){let{children:t,className:s,buttonClassName:n,descriptionText:f,error:p,icon:j,id:v="",name:g="",label:y,labelOptional:b,layout:N,value:w,onChange:C,onFocus:k,onBlur:S,style:_,size:Z="medium",defaultValue:A,validation:z,disabled:T,optionsWidth:P}=e,[D,R]=(0,o.useState)(void 0),[E,L]=(0,o.useState)({}),F=(0,u.Z)("listbox"),M=(0,o.useRef)(null),{formContextOnChange:q,values:O,errors:W,handleBlur:Y,touched:I,fieldLevelValidation:U}=(0,h.G)();O&&!w&&(w=O[v||g],A=O[v||g]),p||(W&&!p&&(p=W[v||g]),p=I&&I[v||g]?p:void 0),(0,o.useEffect)(()=>{void 0!==w&&R(w)},[w]),(0,o.useEffect)(()=>{function e(){var e;document.documentElement.style.setProperty("--width-listbox","".concat(P||(null===(e=M.current)||void 0===e?void 0:e.offsetWidth),"px"))}return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),(0,o.useEffect)(()=>{var e;let s=i()(t);function r(e){return s.find(t=>t.props.value===e)}if(w){R(w);let e=r(w);L((null==e?void 0:e.props)?e.props:void 0);return}if(D){let e=r(D);L((null==e?void 0:e.props)?e.props:void 0);return}if(A){R(A);let e=r(D);L((null==e?void 0:e.props)?e.props:void 0);return}L(null===(e=s[0])||void 0===e?void 0:e.props)},[D]);let X=[F.container,F.base,n],V=[F.addOnBefore];return p&&X.push(F.variants.error),p||X.push(F.variants.standard),j&&V.push(F.with_icon),Z&&X.push(F.size[Z]),T&&X.push(F.disabled),(0,r.jsx)(l.l,{label:y,labelOptional:b,layout:N,id:v,error:p,descriptionText:f,className:s,style:_,size:Z,children:(0,r.jsxs)(a.fC,{children:[(0,r.jsx)(a.xz,{asChild:!0,disabled:T,children:(0,r.jsxs)("button",{"data-size":Z,ref:M,className:(0,m.cn)(X),onBlur:function(e){Y&&Y(e),S&&S(e)},onFocus:k,name:g,id:v,children:[(0,r.jsxs)("span",{className:(0,m.cn)(V),children:[j&&(0,r.jsx)(d.Z,{size:Z,icon:j}),(null==E?void 0:E.addOnBefore)&&(0,r.jsx)(E.addOnBefore,{}),(0,r.jsx)("span",{className:F.label,children:null==E?void 0:E.label})]}),(0,r.jsx)("span",{className:F.chevron_container,children:(0,r.jsx)("svg",{className:F.chevron,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",clipRule:"evenodd"})})}),p&&(0,r.jsx)("div",{className:F.actions_container,children:p&&(0,r.jsx)(c.Z,{size:Z})})]})}),(0,r.jsx)(a.VY,{sideOffset:6,loop:!0,side:"bottom",align:"center",className:F.options_container,children:(0,r.jsx)("div",{children:(0,r.jsx)(x.Provider,{value:{onChange:function(e){C&&C(e),R(e);let t={};t.target={type:"select",name:g,id:v,value:e,checked:void 0},q&&q(t),z&&U(v,z(e))},selected:D},children:t})})})]})})}p.Option=function(e){let{id:t,value:s,label:n,disabled:i=!1,children:o,className:l="",addOnBefore:c}=e,d=(0,u.Z)("listbox");return(0,r.jsx)(x.Consumer,{children:e=>{let{onChange:n,selected:u}=e,h=u===s;return(0,r.jsxs)(a.ck,{className:(0,m.cn)(d.option,h?d.option_active:" ",i?d.option_disabled:" ",l),onSelect:()=>i?{}:n(s),children:[(0,r.jsxs)("div",{className:d.option_inner,children:[c&&c({active:h,selected:u}),(0,r.jsx)("span",{children:"function"==typeof o?o({active:h,selected:u}):o})]}),h?(0,r.jsx)("span",{className:(0,m.cn)(d.option_check,h?d.option_check_active:""),children:(0,r.jsx)(f.Z,{className:d.option_check_icon,"aria-hidden":"true"})}):null]},t)}})};var j=p},55283:function(e,t,s){"use strict";s.d(t,{Fw:function(){return i},wy:function(){return n},zF:function(){return a}});var r=s(69557);let a=r.fC,n=r.wy,i=r.Fw},69557:function(e,t,s){"use strict";s.d(t,{Fw:function(){return b},VY:function(){return S},fC:function(){return C},p_:function(){return f},wy:function(){return g},xz:function(){return k}});var r=s(7896),a=s(2784),n=s(17998),i=s(92211),o=s(87695),l=s(61644),c=s(62656),d=s(72714),u=s(79616),m=s(23372);let h="Collapsible",[x,f]=(0,i.b)(h),[p,j]=x(h),v=(0,a.forwardRef)((e,t)=>{let{__scopeCollapsible:s,open:n,defaultOpen:i,disabled:l,onOpenChange:c,...u}=e,[h=!1,x]=(0,o.T)({prop:n,defaultProp:i,onChange:c});return(0,a.createElement)(p,{scope:s,disabled:l,contentId:(0,m.M)(),open:h,onOpenToggle:(0,a.useCallback)(()=>x(e=>!e),[x])},(0,a.createElement)(d.WV.div,(0,r.Z)({"data-state":w(h),"data-disabled":l?"":void 0},u,{ref:t})))}),g=(0,a.forwardRef)((e,t)=>{let{__scopeCollapsible:s,...i}=e,o=j("CollapsibleTrigger",s);return(0,a.createElement)(d.WV.button,(0,r.Z)({type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":w(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled},i,{ref:t,onClick:(0,n.M)(e.onClick,o.onOpenToggle)}))}),y="CollapsibleContent",b=(0,a.forwardRef)((e,t)=>{let{forceMount:s,...n}=e,i=j(y,e.__scopeCollapsible);return(0,a.createElement)(u.z,{present:s||i.open},({present:e})=>(0,a.createElement)(N,(0,r.Z)({},n,{ref:t,present:e})))}),N=(0,a.forwardRef)((e,t)=>{let{__scopeCollapsible:s,present:n,children:i,...o}=e,u=j(y,s),[m,h]=(0,a.useState)(n),x=(0,a.useRef)(null),f=(0,c.e)(t,x),p=(0,a.useRef)(0),v=p.current,g=(0,a.useRef)(0),b=g.current,N=u.open||m,C=(0,a.useRef)(N),k=(0,a.useRef)();return(0,a.useEffect)(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,l.b)(()=>{let e=x.current;if(e){k.current=k.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();p.current=t.height,g.current=t.width,C.current||(e.style.transitionDuration=k.current.transitionDuration,e.style.animationName=k.current.animationName),h(n)}},[u.open,n]),(0,a.createElement)(d.WV.div,(0,r.Z)({"data-state":w(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!N},o,{ref:f,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style}}),N&&i)});function w(e){return e?"open":"closed"}let C=v,k=g,S=b}},function(e){e.O(0,[8421,8183,6334,5746,1357,2474,5590,6128,6875,6749,2569,8601,8507,9428,5029,6860,9067,2888,9774,179],function(){return e(e.s=31458)}),_N_E=e.O()}]);
|