
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="cdf2bb36-4c97-5ec6-a03f-0a0f5e7f0e35")}catch(e){}}();
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2586],{502586:(e,t,s)=>{"use strict";s.d(t,{m:()=>ep,b:()=>ef});var i=s(766633),l=s(382813),n=s(713072),a=s(691212),r=s(893614),d=s(714173),o=s(284804),u=s(439012),c=s(873099),p=s(186259),f=s(897595),x=s(835295),_=s(195930),v=s(371593),h=s(358323),b=s(295811),y=s.n(b);function E(e){let{currentStep:t,steps:s,className:a}=e,r=(0,l.useRef)(null),[d,u]=(0,l.useState)({top:0,left:0});return(0,l.useEffect)(()=>{r.current&&u({top:r.current.offsetTop,left:r.current.offsetLeft})},[t]),(0,i.jsxs)(o.K,{className:(0,n.W)(a,y()["step-indicator"]),direction:"row",gap:1,children:[(0,i.jsx)("span",{"aria-hidden":!0,className:(0,n.W)(y().circle,y().current),style:d}),s.map((e,s)=>(0,i.jsx)("span",{"aria-hidden":!0,className:y().circle,ref:s===t?r:void 0},e.key)),(0,i.jsxs)("span",{className:"geist-sr-only",children:["Step ",t+1," of ",s.length]})]})}var m=s(868921);let S=(0,l.createContext)({accountId:void 0,cancel:()=>void 0,dataTestIdContext:[],dispatch:()=>void 0,hasMultipleSteps:!1,invalidFields:[],originalSteps:[],setInvalidFields:()=>void 0,setStatus:()=>void 0,status:"idle",submit:()=>Promise.resolve(),surveyState:null,team:null,updateCookie:()=>void 0,user:null});var k=s(618742),I=s(29675),g=s.n(I);function T(e){let{id:t,onAction:s,surveyName:n,updateCookie:a}=e,r=(0,f.useToasts)(),d=()=>{r.removeToastByKey(t)};(0,l.useEffect)(()=>{x.co.track(_.X.SURVEY_TOAST_SHOWN,{surveyName:n})},[n]);let p=()=>{x.co.track(_.X.SURVEY_TOAST_DISMISSED,{surveyName:n}),a(),d()};return(0,i.jsxs)(o.K,{className:g().prompt,gap:4,children:[(0,i.jsxs)(o.K,{direction:"row",children:[(0,i.jsx)(u.x,{as:"h1",size:16,weight:500,children:"Help us improve your Vercel experience"}),(0,i.jsx)(c.Button,{"aria-label":"dismiss",className:g()["close-button"],onClick:p,svgOnly:!0,variant:"unstyled",children:(0,i.jsx)(k.X,{weight:"bold"})})]}),(0,i.jsx)(u.x,{className:g().description,children:"Please help us better understand how we can improve your Vercel experience with this 2 minute survey."}),(0,i.jsxs)(o.K,{direction:"row",gap:2,justify:"end",children:[(0,i.jsx)(c.Button,{onClick:p,size:"small",type:"secondary",children:"No Thanks"}),(0,i.jsx)(c.Button,{onClick:()=>{s(),d()},size:"small",children:"Start"})]})]})}var j=s(747106),F=s.n(j),N=s(614616),D=s(204941);function q(e){for(var t=arguments.length,s=Array(t>1?t-1:0),i=1;i<t;i++)s[i-1]=arguments[i];return(0,N.s)("survey-modal",e,...s)}function C(e){if("checkbox"!==e.as)throw Error(`Expected a checkbox select list, but got a ${e.as} select list instead.`);return e}let L=e=>{let t=[],s={},i=[],l={},{surveyName:n,surveySlug:a,surveySteps:r}=e,d=0;for(let e=0;e<r.length;e++){let n=r[e];for(let a of(i[e]={title:n.title,description:n.description,start:d,end:d+1},n.fields))if("select"===a.type){switch(a.as){case"dropdown":l[a.id]={as:"dropdown",id:a.id,start:d,end:d+1,label:a.label};break;case"combobox":l[a.id]={as:"combobox",id:a.id,start:d,end:d+1,label:a.label,placeholder:a.placeholder??null};break;default:l[a.id]={as:a.as??"checkbox",id:a.id,start:d,end:d+1,label:a.label,selectMultiple:!!a.selectMultiple}}for(let n of a.options){let r=`${e}-${a.id}-${n.id}`,o={fqid:r,stepIndex:e,inputId:n.id,selectListId:a.id,label:n.label,selected:!!n.selected,type:"option",reveals:n.reveals?{fqid:`${r}-${n.reveals.id}`,stepIndex:e,inputId:n.reveals.id,label:n.reveals.label??"",value:n.reveals.value??"",size:n.reveals.size??"short",validationRegex:n.reveals.validationRegex,validationErrorMessage:n.reveals.validationErrorMessage,inputTypeName:n.reveals.inputTypeName,type:"text"}:void 0};t.push(o),s[r]=d,i[e].end=d+1,l[a.id].end=d+1,d++}}else{let l=`${e}-${a.id}`,n={fqid:l,stepIndex:e,inputId:a.id,label:a.label,instructions:a.instructions,value:a.value||"",size:a.size||"short",validationRegex:a.validationRegex,validationErrorMessage:a.validationErrorMessage,inputTypeName:a.inputTypeName,type:"text"};t.push(n),s[l]=d,i[e].end=d+1,d++}}return{surveyName:n,surveySlug:a,fields:t,fieldLookup:s,stepLookup:i,selectListLookup:l,currentStep:0,previousStep:null,lastStep:r.length-1,isFirstStep:!0,isLastStep:r.length-1==0}},w=e=>{let{enableSkip:t=!1}=e;return{...L(e.surveyInfo),focusedItem:null,focusedField:null,focusedNestedField:null,focusedButton:null,backButtonExists:!1,skipButtonExists:t,submitButtonExists:!0,enableSkip:t}},O=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];var U=s(257081),P=s.n(U),B=s(574088),R=s(195398),M=s(154162),A=s.n(M),G=s(684948),K=s.n(G),$=s(367875),W=s(749677);function V(e){let{type:t,optionFqid:s,field:n,className:a,"data-testid":r,showLabel:d,...o}=e,{setInvalidFields:c,invalidFields:p,surveyState:f,dispatch:x}=(0,l.useContext)(S),{fqid:_,inputId:v,inputTypeName:h,label:b,size:y="short",value:E,validationErrorMessage:k,validationRegex:I}=n,{focusedField:g,focusedNestedField:T}=f,j=(0,l.useRef)(null),N=(0,l.useRef)(null),[D,q]=(0,l.useState)(!1);(0,l.useEffect)(()=>{p.includes(_)?D||c(p.filter(e=>e!==_)):D&&c([...p,_])},[D,_,c]),(0,l.useEffect)(()=>{("top-level"===t?g?.fqid===_:T?.fqid===_)&&(j.current??N.current)?.focus()},[g?.fqid,T?.fqid,_,t]);let C=()=>{"top-level"===t&&g?.fqid!==_?x({type:"SET_FOCUSED_FIELD",fqid:_}):"nested"===t&&T?.fqid!==_&&x({type:"SET_FOCUSED_NESTED_FIELD",optionFqid:s})},L=e=>{"nested"===t?x({type:"UPDATE_NESTED_TEXT_FIELD",optionFqid:s,value:e.target.value}):x({type:"UPDATE_TEXT_FIELD",fqid:_,value:e.target.value}),E?U(e.target.value):q(!1)},w=e=>{let i=e.target;"nested"===t?x({type:"UPDATE_NESTED_TEXT_FIELD",optionFqid:s,value:e.target.value}):x({type:"UPDATE_TEXT_FIELD",fqid:_,value:e.target.value}),D&&U(i.value)},O=k??(h?({email:"Please enter a valid email.",url:"Please enter a valid URL."})[h]:void 0),U=e=>{let t;if(I&&k)t=I;else switch(h){case"email":t=/^\S+@\S+\.\S+$/;break;case"url":q(!K()(e));return}t&&q(!t.test(e))},P=n.instructions?(0,i.jsx)(u.x,{className:F().instructions,size:16,children:(0,m.t)(n.instructions)}):null;return"short"===y?(0,i.jsxs)(i.Fragment,{children:[P,(0,i.jsx)($.Input,{"aria-label":b,autoComplete:"off",className:a,"data-testid":r,id:v,label:d?b:void 0,maxLength:256,onBlur:L,onChange:w,onFocus:C,placeholder:d?void 0:b||"Add your answer...",...o,error:D?O:void 0,ref:j,typeName:h,value:E})]}):(0,i.jsxs)(i.Fragment,{children:[P,(0,i.jsx)(W.g,{"aria-label":b,className:a,"data-testid":r,id:v,label:d?b:void 0,maxLength:4e3,onBlur:L,onChange:w,onFocus:C,placeholder:d?void 0:b||"Add your answer...",rows:3,...o,error:D?O:void 0,ref:N,value:E})]})}function X(e){let{index:t,listId:s,option:d,dataTestIdContext:c=[]}=e,[p,{height:f}]=(0,a.Z)(),x=(0,l.useRef)(null),{surveyState:_,dispatch:v}=(0,l.useContext)(S),{focusedField:h,focusedNestedField:b,selectListLookup:y}=_,{selectMultiple:E}=C(y[d.selectListId]),m=d.selected&&d.reveals,k=!!d.reveals,I=h?.fqid===d.fqid,g="30px";(0,l.useEffect)(()=>{I&&null===b&&x.current?.focus()},[b,I,d.fqid]);let[T,j]=(0,r.useSpring)(()=>({config:{...r.config.default,clamp:!0},height:m?`${f}px`:g}),[m]);return(0,l.useEffect)(()=>{m?j.start({height:`${f}px`,onStart:()=>{v({type:"SET_FOCUSED_NESTED_FIELD",optionFqid:d.fqid})}}):k&&j.start({height:g,onStart:()=>{v({type:"SET_FOCUSED_FIELD",fqid:d.fqid})}})},[k,v,f,m,I,d.fqid,j]),(0,i.jsxs)("li",{"aria-checked":d.selected,"aria-labelledby":d.inputId,"aria-selected":d.selected,className:(0,n.W)(A().option,{[A().selected]:d.selected}),"data-testid":q("form-input",s,"checkbox",d.inputId,...c),id:O[t],onClick:e=>{I||v({type:"SET_FOCUSED_FIELD",fqid:d.fqid});let t=e.target;t.dataset.reveal&&t.focus(),"INPUT"!==t.tagName&&v({type:"TOGGLE_OPTION",fqid:d.fqid})},onFocus:()=>{I||v({type:"SET_FOCUSED_FIELD",fqid:d.fqid})},onKeyDown:void 0,ref:x,role:"option",tabIndex:0,value:d.inputId,children:[E?(0,i.jsx)("input",{"aria-readonly":!0,checked:d.selected,className:A().input,"data-list-id":s,id:d.inputId,readOnly:!0,type:"checkbox",value:d.label||""}):(0,i.jsx)("input",{checked:d.selected,className:A().input,"data-list-id":s,id:d.inputId,readOnly:!0,type:"radio",value:d.label||""}),(0,i.jsx)(r.animated.div,{style:void 0,children:(0,i.jsxs)(o.K,{gap:3,ref:p,children:[(0,i.jsxs)("div",{className:A().heading,children:[(0,i.jsx)(R.T,{"aria-hidden":!0,className:A().keyboard,children:O[t]}),(0,i.jsx)(u.x,{weight:500,children:(0,i.jsx)("label",{htmlFor:d.inputId,children:d.label})}),d.selected?(0,i.jsx)("span",{"aria-hidden":!0,className:A()["selected-icon"],children:(0,i.jsx)(B.I,{color:"var(--geist-success)",fill:!0})}):null]}),d.reveals?(0,i.jsx)("div",{className:(0,n.W)({[A().hidden]:!d.selected}),"data-testid":q("form-input-wrapper",s,"checkbox",d.inputId,"revealed-textbox",...c),children:(0,i.jsx)(V,{"data-testid":q("form-input",s,"checkbox",d.inputId,"revealed-textbox",...c),field:d.reveals,optionFqid:d.fqid,type:"nested"})}):null]})})]},d.inputId)}function z(e){let{id:t,options:s,selectMultiple:n,dataTestIdContext:a=[]}=e,{surveyState:r,dispatch:d}=(0,l.useContext)(S),{focusedField:u,focusedNestedField:c,selectListLookup:p}=r,{label:f}=C(p[s[0].selectListId]),x=(0,l.useCallback)(e=>{let t=s.findIndex(e=>e.fqid===u?.fqid),i=null!==c;switch(e.key){case"ArrowUp":e.preventDefault(),-1===t?d({type:"SET_FOCUSED_FIELD",fqid:s[0].fqid}):d({type:"SET_FOCUSED_FIELD",fqid:s.at(t-1)?.fqid??null});break;case"ArrowDown":e.preventDefault(),-1===t?d({type:"SET_FOCUSED_FIELD",fqid:s[0].fqid}):d({type:"SET_FOCUSED_FIELD",fqid:s.at(t+1)?.fqid??s.at(0)?.fqid??null});break;case" ":if(-1===t||i)return;e.preventDefault(),d({type:"TOGGLE_OPTION",fqid:s[t].fqid});break;default:if(O.includes(e.key)){if(i)return;let t=s[O.indexOf(e.key)]?.fqid;t&&(d({type:"TOGGLE_OPTION",fqid:t}),d({type:"SET_FOCUSED_FIELD",fqid:t}))}}},[s,c,u?.fqid,d]);return(0,i.jsx)(o.K,{"aria-label":f,"aria-multiselectable":n,as:"ul",className:P().list,"data-testid":q("form-input",t,...a),gap:2,onKeyDown:x,role:"listbox",children:s.map((e,s)=>(0,i.jsx)(X,{dataTestIdContext:a,index:s,listId:t,option:e},e.inputId))})}var Y=s(990950);function H(e){let{id:t,options:s,dataTestIdContext:n=[]}=e,{surveyState:a,dispatch:r}=(0,l.useContext)(S),{selectListLookup:d}=a,u=function(e){if("dropdown"!==e.as)throw Error(`Expected a dropdown select list, but got a ${e.as} select list instead.`);return e}(d[s[0].selectListId]),{label:c}=u,p=(0,l.useMemo)(()=>s.find(e=>e.selected),[s]);return(0,i.jsxs)(o.K,{gap:4,role:"group",children:[(0,i.jsx)(Y.Select,{"aria-label":c,"data-testid":q("form-input",t,...n),defaultValue:p?.inputId,id:u.id,onChange:e=>{let t=c?e.target.selectedIndex-1:e.target.selectedIndex;r({type:"TOGGLE_OPTION",fqid:s[t].fqid}),r({type:"SET_FOCUSED_FIELD",fqid:s[t].fqid})},onFocus:()=>{r({type:"SET_FOCUSED_FIELD",fqid:p?.fqid??s[0].fqid})},placeholder:c,value:p?.inputId,children:s.map(e=>(0,i.jsx)("option",{"aria-selected":e.selected,selected:e.selected,value:e.inputId,children:e.label},e.inputId))}),p?.reveals?(0,i.jsx)(V,{"data-testid":q("form-input",u.id,"dropdown",p.inputId,"revealed-textbox",...n),field:p.reveals,optionFqid:p.fqid,type:"nested"}):null]})}var Z=s(620703),Q=s(305126);function J(e){let{id:t,options:s,dataTestIdContext:n=[]}=e,{surveyState:a,dispatch:r}=(0,l.useContext)(S),{selectListLookup:d}=a,u=function(e){if("combobox"!==e.as)throw Error(`Expected a combobox select list, but got a ${e.as} select list instead.`);return e}(d[s[0].selectListId]),{label:c,placeholder:p}=u,f=(0,l.useMemo)(()=>s.find(e=>e.selected),[s]);return(0,i.jsxs)(o.K,{gap:2,children:[(0,i.jsxs)(Z.y,{"aria-label":c,"data-testid":q("form-input",t,...n),disableFocusStylingOnContainerDiv:!0,onChange:e=>{if(!e){f&&r({type:"TOGGLE_OPTION",fqid:f.fqid});return}let t=s.findIndex(t=>t.inputId===e),i=s[t];f?.fqid!==i.fqid&&(f&&r({type:"TOGGLE_OPTION",fqid:f.fqid}),i.reveals&&r({type:"SET_FOCUSED_NESTED_FIELD",optionFqid:i.fqid}),r({type:"TOGGLE_OPTION",fqid:s[t].fqid}))},placeholder:p??c,value:f?.inputId,children:[(0,i.jsx)(Q._,{value:c}),(0,i.jsx)(Z.y.Input,{}),(0,i.jsx)(Z.y.List,{children:s.map(e=>(0,i.jsx)(Z.y.Option,{"aria-selected":e.selected,value:e.inputId,children:e.label},e.inputId))})]}),f?.reveals?(0,i.jsx)(V,{"data-testid":q("form-input",u.id,"combobox",f.inputId,"revealed-textbox",...n),field:f.reveals,optionFqid:f.fqid,type:"nested"}):null]})}function ee(e){let{showInputLabels:t,dataTestIdContext:s=[]}=e,{surveyState:n}=(0,l.useContext)(S),{fields:a,selectListLookup:r,stepLookup:d,currentStep:u}=n,{start:c,end:p}=d[u],f=a.slice(c,p),x=[];for(let e=0;e<f.length;e++){let t=f[e];if("text"===t.type&&x.push(t),"option"===t.type){let{start:s,end:i}=r[t.selectListId],l=a.slice(s,i);x.push(l),e=i-c-1}}return(0,i.jsx)(o.K,{gap:6,children:x.map(e=>{if(Array.isArray(e)){let t=r[e[0].selectListId].as,l="checkbox"===t?r[e[0].selectListId].selectMultiple:void 0;return"dropdown"===t?(0,i.jsx)("div",{children:(0,i.jsx)(H,{dataTestIdContext:s,id:e[0].selectListId,options:e})},e[0].selectListId):"combobox"===t?(0,i.jsx)("div",{children:(0,i.jsx)(J,{id:e[0].selectListId,options:e})},e[0].selectListId):(0,i.jsx)("div",{children:(0,i.jsx)(z,{dataTestIdContext:s,id:e[0].selectListId,options:e,selectMultiple:l})},e[0].selectListId)}return(0,i.jsx)("div",{children:(0,i.jsx)(V,{"data-testid":q("form-input",e.inputId,...s),field:e,showLabel:t,type:"top-level"},e.inputId)},e.inputId)})})}var et=s(251881),es=s.n(et),ei=s(350947);let el=(0,s(621191).ZP)((e,t)=>{switch(t.type){case"RESET_SURVEY_INFO":return{...L(t.surveyInfo),focusedItem:null,focusedField:null,focusedNestedField:null,focusedButton:null,backButtonExists:!1,skipButtonExists:e.enableSkip,submitButtonExists:!0,enableSkip:e.enableSkip};case"TOGGLE_SKIP_ENABLED":e.enableSkip=t.enableSkip;break;case"SET_FOCUSED_BUTTON":e.focusedItem={type:"button",buttonId:t.buttonId};break;case"SET_FOCUSED_FIELD":e.focusedItem=t.fqid?{type:"field",fqid:t.fqid}:null;break;case"SET_FOCUSED_NESTED_FIELD":{let s=e.fields[e.fieldLookup[t.optionFqid]];"option"===s.type&&s.reveals&&(e.focusedItem={type:"nested-field",optionFqid:t.optionFqid,nestedFqid:s.reveals.fqid});break}case"INCREMENT_STEP":e.currentStep<e.lastStep&&(e.previousStep=e.currentStep,e.currentStep++,e.focusedItem={type:"survey"});break;case"DECREMENT_STEP":e.currentStep>0&&(e.previousStep=e.currentStep,e.currentStep--,e.focusedItem={type:"survey"});break;case"SET_STEP":t.to>=0&&t.to<=e.lastStep&&(e.previousStep=e.currentStep,e.currentStep=t.to,e.focusedItem={type:"survey"});break;case"UPDATE_TEXT_FIELD":{let s=e.fields[e.fieldLookup[t.fqid]];"text"===s.type&&(s.value=t.value);break}case"UPDATE_NESTED_TEXT_FIELD":{let s=e.fields[e.fieldLookup[t.optionFqid]];"option"===s.type&&s.reveals&&(s.reveals.value=t.value);break}case"TOGGLE_OPTION":{let s=e.fields[e.fieldLookup[t.fqid]];if("option"===s.type){let t=e.selectListLookup[s.selectListId],{start:i,end:l}=t;if("checkbox"===t.as&&t.selectMultiple)s.selected=!s.selected;else{let t=s.selected;for(let t of e.fields.slice(i,l))"option"===t.type&&t.selectListId===s.selectListId&&(t.selected=!1);s.selected=!t}}break}default:(0,D.exhaustivenessCheck)(t)}switch(e.isFirstStep=0===e.currentStep,e.isLastStep=e.currentStep===e.lastStep,e.skipButtonExists=e.isFirstStep&&e.enableSkip,e.backButtonExists=!e.isFirstStep,e.focusedItem?.type){case"field":e.focusedField=e.fields[e.fieldLookup[e.focusedItem.fqid]],e.focusedNestedField=null,e.focusedButton=null;break;case"nested-field":{let t=e.fields[e.fieldLookup[e.focusedItem.optionFqid]];"option"===t.type&&t.reveals&&(e.focusedField=t,e.focusedNestedField=t.reveals,e.focusedButton=null);break}case"button":e.focusedField=null,e.focusedNestedField=null,e.focusedButton=e.focusedItem.buttonId;break;case"survey":case void 0:e.focusedField=null,e.focusedNestedField=null,e.focusedButton=null;break;default:(0,D.exhaustivenessCheck)(e.focusedItem)}});function en(e){let{children:t,...s}=e,{dataTestIdContext:n=[],showThankYouToast:a=!0,onDismiss:r=es(),onSubmit:d,overrideTeamId:o,surveyInfo:u,submitOnSkip:c}=s,{surveySteps:p}=u,v=p.length>1,[b,y]=(0,l.useReducer)(el,w(s)),{surveyName:E,surveySlug:m,isLastStep:k,fields:I}=b,[g,T]=(0,l.useState)("idle"),[j,F]=(0,l.useState)([]),{team:N,teams:q,user:C}=(0,ei.m)(),L=(0,l.useMemo)(()=>q?.find(e=>e.id===o)??N,[o,N,q]),O=L?.id,U=C?.uid,P=O??U,B=(0,f.useToasts)(),R=(0,h.ej)(m),M=!!U&&R?.includes(U),A=(0,l.useCallback)(()=>{U&&(R?M||(0,h.d8)(m,`${R},${U}`):(0,h.d8)(m,U))},[M,R,m,U]),G=(0,l.useCallback)(()=>{x.co.track(_.X.SURVEY_EXITED,{surveyName:E}),r()},[r,E]),K=(0,l.useCallback)(async()=>{if(!(k||c))return;T("submitting"),x.co.track(_.X.SURVEY_SUBMITTED,{surveyName:E});let e=I.some(e=>{switch(e.type){case"option":if(e.selected)return!0;return!1;case"text":if(e.value)return!0;return!1;default:return(0,D.exhaustivenessCheck)(e)}});e||x.co.track(_.X.SURVEY_SUBMITTED_EMPTY,{surveyName:E}),A();try{let t=function(e){let{fields:t,stepLookup:s,selectListLookup:i}=e,l=Object.values(s).map(e=>({title:e.title,description:e.description,fields:[]}));for(let e=0;e<t.length;e++){let s=t[e];switch(s.type){case"text":l[s.stepIndex].fields.push({...s,id:s.inputId});break;case"option":{let n=i[s.selectListId],{start:a,end:r}=n,d=t.slice(a,r).map(e=>{if("text"===e.type)throw Error("Somehow, a text field was added to an option list. This is likely a developer error.");let t={id:e.inputId,label:e.label,selected:e.selected};return e.reveals&&(t.reveals={id:e.reveals.inputId,...e.reveals}),t}),o={type:"select",id:s.selectListId,label:n.label,options:d};"checkbox"===n.as&&(o.selectMultiple=n.selectMultiple),l[s.stepIndex].fields.push(o),e=r-1}break;default:(0,D.exhaustivenessCheck)(s)}}return l}(b);await d({surveyName:E,surveySlug:m,user:C??void 0,team:L??void 0,surveySteps:t,hasResponses:e,get fields(){return t.flatMap(e=>e.fields)}})}finally{T("idle"),a&&B.success({text:"Thank you for your feedback."})}},[k,E,I,A,b,d,c,m,C,L,a,B]);return(0,i.jsx)(S.Provider,{value:{accountId:P,cancel:G,dataTestIdContext:n,dispatch:y,hasMultipleSteps:v,invalidFields:j,originalSteps:p,setInvalidFields:F,setStatus:T,status:g,submit:K,surveyState:b,team:L,updateCookie:A,user:C},children:t})}var ea=s(654527),er=s.n(ea);function ed(e){let{onAction:t,title:s="Help Shape the Future of\xa0Vercel",ctaText:l="Get Started",description:n="Please help us better understand how we can improve your Vercel experience with this 2 minute survey."}=e;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.u.Body,{children:(0,i.jsxs)(o.K,{gap:6,children:[(0,i.jsx)(p.u.Title,{children:s}),(0,i.jsx)(u.x,{align:"left",className:er().text,size:16,children:n})]})}),(0,i.jsx)(p.u.Actions,{children:(0,i.jsx)(p.u.Action,{fullWidth:!0,onClick:t,children:l})})]})}function eo(e){let{isModal:t=!1,externalProps:s}=e,{dispatch:d,submit:c,surveyState:f,team:h,user:b,invalidFields:y}=(0,l.useContext)(S),{className:E,dataTestIdContext:k=[],enableSkip:I=!1,noPadding:g=!1,onSkip:T,onSubmitted:j,showInputLabels:N=!1,stackButtons:D=!1,submitButtonText:C="Submit"}=s,{currentStep:L,focusedField:w,focusedItem:O,isLastStep:U,previousStep:P,stepLookup:B,surveyName:R}=f,{surveySteps:M}=function(e,t){if(t&&1!==e.surveySteps.length)throw Error(`Can only stack buttons for single-step surveys. Your survey has ${e.surveySteps.length} steps.'`);return e}(s.surveyInfo,D),{title:A,description:G}=B[L];(0,l.useEffect)(()=>{d({type:"TOGGLE_SKIP_ENABLED",enableSkip:I})},[d,I]),(0,l.useEffect)(()=>{d({type:"RESET_SURVEY_INFO",surveyInfo:s.surveyInfo})},[d,s.surveyInfo]);let K=b?.uid,$=h?.id;(0,l.useEffect)(()=>{(K||$)&&(x.co.track(_.X.SURVEY_STARTED,{surveyName:R,teamId:$,userId:K}),d({type:"SET_STEP",to:0}))},[d,R,$,K]);let W=(0,l.useRef)(null);(0,l.useEffect)(()=>{let e=e=>{W.current&&!W.current.contains(e.target)&&d({type:"SET_FOCUSED_FIELD",fqid:null})};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[d]),(0,l.useEffect)(()=>{null===O?document.activeElement?.blur():"survey"===O.type&&W.current?.focus()},[O]);let[V,X]=(0,l.useState)();(0,l.useEffect)(()=>{let e=new Set;M.forEach(t=>{t.fields.forEach(t=>{if(e.has(t.id)&&X(`Duplicate top-level field id: ${t.id}`),e.add(t.id),"options"in t){let e=new Set;t.options.forEach(t=>{e.has(t.id)&&X(`Duplicate option id: ${t.id}`),e.add(t.id)})}})})},[M]);let z=(0,l.useCallback)(function(e){if(W.current?.contains(e.target))switch(e.key){case"Enter":if(!(0,v.x)(e)||y.length>0)return;U?c():(e.preventDefault(),d({type:"INCREMENT_STEP"}));break;case"ArrowRight":w?.type!=="text"&&d({type:"INCREMENT_STEP"});break;case"ArrowLeft":w?.type!=="text"&&d({type:"DECREMENT_STEP"})}},[d,w?.type,y.length,U,c]);(0,l.useEffect)(()=>(window.addEventListener("keydown",z),()=>window.removeEventListener("keydown",z)),[z]),(0,l.useEffect)(()=>{null!==P&&x.co.track(_.X.SURVEY_MODAL_STEP_CHANGED,{startIndex:P,endIndex:L,surveyName:R})},[L,R]);let[Y,{height:H}]=(0,a.Z)(),[Z,Q]=(0,r.useSpring)(()=>({config:{...r.config.default,clamp:!0},height:void 0}),[L]);return(0,l.useEffect)(()=>{H&&Q.start({height:`${H}px`})},[L,Q,H]),(0,i.jsxs)(o.K,{"aria-label":R,className:(0,n.W)(F().survey,E,{[F()["no-padding"]]:g,[F().modal]:t}),"data-testid":q("wrapper",...k),gap:8,ref:W,tabIndex:-1,children:[(0,i.jsx)(r.animated.div,{style:t?void 0:Z,children:(0,i.jsxs)("form",{"data-testid":q("form",...k),onSubmit:e=>{e.preventDefault()},title:R,children:[(0,i.jsx)("h1",{className:"geist-sr-only",children:R}),(0,i.jsxs)("fieldset",{children:[(0,i.jsxs)("legend",{className:"geist-sr-only",children:["Step ",L+1]}),(0,i.jsxs)(o.K,{gap:6,ref:Y,children:[A||G?(0,i.jsx)(o.K,{gap:2,children:t?(0,i.jsxs)(i.Fragment,{children:[A?(0,i.jsx)(p.u.Title,{children:A}):void 0,G?(0,i.jsx)(p.u.Subtitle,{children:"string"==typeof G?(0,m.t)(G):G}):null]}):(0,i.jsxs)(i.Fragment,{children:[A?(0,i.jsx)(u.x,{as:"h1",className:F().title,children:A}):void 0,G?(0,i.jsx)(u.x,{children:"string"==typeof G?(0,m.t)(G):G}):null]})}):null,(0,i.jsx)(ee,{dataTestIdContext:k,showInputLabels:N})]})]})]})}),null,t?null:(0,i.jsx)(eu,{onSkip:T,onSubmitted:j,stack:D,submitButtonText:C})]})}function eu(e){let{onSkip:t,onSubmitted:s,stack:a,submitButtonText:r}=e,{cancel:p,dataTestIdContext:f,dispatch:x,invalidFields:_,originalSteps:v,status:h,submit:b,surveyState:y,hasMultipleSteps:m}=(0,l.useContext)(S),{backButtonExists:k,currentStep:I,fields:g,focusedButton:T,focusedField:j,isLastStep:N,selectListLookup:D,skipButtonExists:C,stepLookup:L}=y,w=(0,l.useRef)(null),O=(0,l.useRef)(null),U=(0,l.useRef)(null);(0,l.useEffect)(()=>{switch(T){case"back":w.current?.focus();break;case"skip":O.current?.focus();break;case"submit":U.current?.focus()}},[T]);let P=j?.type==="option"&&"checkbox"===D[j.selectListId].as,B=m&&!P,R=(0,l.useMemo)(()=>v.map((e,t)=>({key:g[L[t].start].fqid})),[g,v,L]);return(0,i.jsxs)(o.K,{align:"center","aria-label":"Survey navigation controls",className:F().footer,direction:"row",gap:4,justify:k?"space-between":"flex-end",role:"group",children:[k?(0,i.jsx)(c.Button,{"aria-label":"Back to previous step",className:(0,n.W)(F()["back-button"]),"data-testid":q("back-button",...f),onClick:()=>x({type:"DECREMENT_STEP"}),onFocus:()=>{"back"!==T&&x({type:"SET_FOCUSED_BUTTON",buttonId:"back"})},ref:w,svgOnly:!0,type:"tertiary",typeName:"button",children:(0,i.jsx)(d.X,{"aria-label":"left-facing arrow",size:24})}):null,(0,i.jsxs)(o.K,{align:"center",className:(0,n.W)(F().info,{[F()["align-left"]]:!m||C&&P}),justify:"center",children:[(0,i.jsx)(u.x,{className:(0,n.W)(F().tip,{[F().hidden]:!P}),color:"gray-900",weight:500,children:"Press a key to select or ↑↓ to navigate"}),(0,i.jsx)(E,{className:(0,n.W)(F()["step-indicator"],{[F().hidden]:!B,[F().single]:!m}),currentStep:I,steps:R})]}),(0,i.jsxs)(o.K,{className:(0,n.W)(F().buttons,{[F().stacked]:a&&!m}),gap:4,children:[C?(0,i.jsx)(c.Button,{className:(0,n.W)(F()["skip-button"]),"data-testid":q("skip-button",...f),onClick:()=>{t?.(),p()},onFocus:()=>{"skip"!==T&&x({type:"SET_FOCUSED_BUTTON",buttonId:"skip"})},ref:O,type:"secondary",children:"Skip"}):null,(0,i.jsx)(c.Button,{"aria-label":N?"Submit survey":"Continue to next step",className:(0,n.W)(F()["submit-button"]),"data-testid":q(N?"submit-button":"next-button",...f),disabled:_.length>0,loading:N?"submitting"===h:void 0,onClick:()=>{N?b().then(s):x({type:"INCREMENT_STEP"})},onFocus:()=>{"submit"!==T&&x({type:"SET_FOCUSED_BUTTON",buttonId:"submit"})},ref:U,children:N?r:"Next"})]})]})}function ec(e){let{externalProps:t}=e,{active:s,dataTestIdContext:n=[],enableSkip:a=!1,hideIfAlreadySeen:r,onSkip:d,onSubmitted:o,prompt:u,promptWithToast:c,setActive:x,stackButtons:_=!1,submitButtonText:v="Submit",surveyInfo:b,submitOnSkip:y}=t,{surveySlug:E,surveyName:m}=b,{dispatch:k,user:I,updateCookie:g,cancel:j,submit:F}=(0,l.useContext)(S),[N,D]=(0,l.useState)(u),C=(0,f.useToasts)(),L=(0,h.ej)(E),w=!!I?.uid&&L?.includes(I.uid),O=(0,l.useCallback)(()=>{x(!0)},[x]);(0,l.useEffect)(()=>{c&&C.loaded&&!w&&C.message({preserve:!0,text:(0,i.jsx)(T,{id:E,onAction:O,surveyName:m,updateCookie:g}),key:E})},[L,c,m,E,C,w,O,g]);let U=()=>{void 0===d?x(!1):d(),y&&F()},P=()=>{void 0===o?(x(!1),D(u)):o()},B=(0,l.useCallback)(e=>{let t=e?.target;(!t||t.offsetParent?.id!=="cconsent-bar")&&a&&(y&&F(),x(!1),j())},[j,a,x,y,F]);return(0,i.jsxs)(p.u.Modal,{active:(!r||!w)&&s,"data-testid":q("modal",...n),drawerHeight:"auto",enableSkip:a,onAnimationDone:()=>{k({type:"SET_STEP",to:0})},onClickOutside:B,width:520,children:[s&&N?(0,i.jsx)(ed,{onAction:()=>D(!1)}):null,s&&!N?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(p.u.Body,{padding:!1,children:(0,i.jsx)(eo,{externalProps:{onSkip:U,onSubmitted:P,...t},isModal:!0})}),(0,i.jsx)(p.u.Actions,{children:(0,i.jsx)(eu,{onSkip:U,onSubmitted:P,stack:_,submitButtonText:v})})]}):null]})}function ep(e){return(0,i.jsx)(en,{...e,children:(0,i.jsx)(eo,{externalProps:e})})}function ef(e){return(0,i.jsx)(en,{...e,children:(0,i.jsx)(ec,{externalProps:e})})}},868921:(e,t,s)=>{"use strict";function i(e){let t=e.lastIndexOf(" ");return -1===t?e:`${e.substring(0,t)}\u00A0${e.substring(t+1)}`}s.d(t,{t:()=>i})},371593:(e,t,s)=>{"use strict";s.d(t,{x:()=>l});var i=s(937248);let l=e=>(0,i.ad)()?e.metaKey:e.ctrlKey},749677:(e,t,s)=>{"use strict";s.d(t,{g:()=>h});var i=s(766633),l=s(382813),n=s(713072),a=s(48146),r=s(614616),d=s(268674),o=s(305126),u=s(200569),c=s(686186),p=s(461800),f=s(506642),x=s.n(f),_=s(782236),v=s.n(_);let h=(0,l.forwardRef)((e,t)=>{let{bypassLabelCasing:s=!1,disabled:l,label:f,resize:_,width:h,error:y,type:E,size:m,className:S,wrapperClassName:k,showOutline:I=!0,spellCheck:g=!1,autoCapitalize:T="off",autoComplete:j="off",autoCorrect:F="off",rounded:N,...D}=e,{focusProps:q,isFocusVisible:C}=(0,a.Fx)({isTextInput:!0}),L=f?o._:"label",w={...f?{value:f,withInput:!0,wrapperClassName:k,bypassCasing:s}:{className:k}},O=(0,d.B)()||l,U=(0,c.M)("textarea-");E=y?"error":E;let P=(0,p.o)(E);return(0,i.jsxs)(L,{"data-version":"v1",...w,children:[(0,i.jsx)("div",{className:(0,n.W)(v().container,P,{[String(x().error)]:y,[String(x().keyboardFocus)]:C,[String(v().rounded)]:N,[String(v().noOutline)]:!I}),"data-geist-textarea-wrapper":"",children:(0,i.jsx)("textarea",{...q,autoCapitalize:T,autoComplete:j,autoCorrect:F,className:(0,n.W)(v().textarea,P,{[String(v().large)]:"large"===m,[String(v().small)]:"small"===m,[String(x().keyboardFocus)]:C},S),disabled:O,ref:t,spellCheck:g,style:{...D.style,resize:_,width:h},...D,onBlur:e=>{q.onBlur?.(e),D.onBlur?.(e)},onFocus:e=>{q.onFocus?.(e),D.onFocus?.(e)}})}),y?(0,i.jsx)(u.j,{"data-testid":D["data-testid"]?(0,r.s)(D["data-testid"],"error"):void 0,error:y,id:`${U}-error`,size:b[m||"small"],style:{width:h,marginTop:"var(--geist-gap-quarter)"}}):null]})});h.displayName="Textarea";let b={xSmall:"small",small:"small",mediumSmall:"small",large:"large"}},295811:e=>{e.exports={"step-indicator":"step-indicator_step-indicator__bdpwv",circle:"step-indicator_circle__psPR3",current:"step-indicator_current__WmVfj"}},154162:e=>{e.exports={option:"checkbox-option_option__5wdaU",input:"checkbox-option_input__Khsdd",hidden:"checkbox-option_hidden__j0nbW",heading:"checkbox-option_heading__ZFzPX",keyboard:"checkbox-option_keyboard__0Gomj","selected-icon":"checkbox-option_selected-icon__peBbP",selected:"checkbox-option_selected__krkmf"}},257081:e=>{e.exports={list:"checkbox-select_list__qqnB9"}},29675:e=>{e.exports={prompt:"survey-prompt-toast_prompt__WqnnC","close-button":"survey-prompt-toast_close-button__vYpY_",description:"survey-prompt-toast_description__7LiDm"}},654527:e=>{e.exports={text:"survey-prompt_text__VaPyd"}},747106:e=>{e.exports={survey:"survey_survey___qD1O","no-padding":"survey_no-padding__uzYoR",modal:"survey_modal__Dpx0S",instructions:"survey_instructions__LO4iD",header:"survey_header__zNWRJ",title:"survey_title__sXZS_",footer:"survey_footer__hfArp",buttons:"survey_buttons__ehsQm",stacked:"survey_stacked__8mnYe","back-button":"survey_back-button__5U9mT",info:"survey_info__gMmNV","align-left":"survey_align-left__r6838",tip:"survey_tip__rzOie",fadeIn:"survey_fadeIn__i0Y9T",hidden:"survey_hidden__T_a0b","step-indicator":"survey_step-indicator__Wo2YU",single:"survey_single__VTV3m","skip-button":"survey_skip-button__gw76J","skip-text":"survey_skip-text__tFdNp","submit-button":"survey_submit-button__emPKt"}},782236:e=>{e.exports={container:"textarea_container__HyiqI input_container__jQS33",textarea:"textarea_textarea__w2boO input_input__qqGLC",error:"textarea_error__m2GSm input_error__vJAEv",rounded:"textarea_rounded__6HyQR",noOutline:"textarea_noOutline__cN99s",small:"textarea_small__fQDmZ",large:"textarea_large__5r957"}}}]);
//# debugId=cdf2bb36-4c97-5ec6-a03f-0a0f5e7f0e35
