PageSourceSearch

https://magicmind.com/a/account/_next/static/chunks/8122.1cf81d1a2d28d0e3.js

js magicmind.com collected 2026-09-24 19:03:19 UTC 12,587 bytes, 27 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8122],{2526:(e,t,i)=>{i.d(t,{av:()=>s,uA:()=>n});let n={SKIP:"skip",PAUSE:"pause"};Object.values(n);let s={SHOWN:"shown",ANSWERED:"answered",DISMISSED:"dismissed"}},26655:(e,t,i)=>{i.d(t,{C:()=>u,z:()=>l});var n=i(77571),s=i(56149),r=i(63859),o=i(73822),a=i(34713);function l(e){let t,i,r,l,u=(0,s.c)(8);return u[0]!==e?({className:t,...i}=e,u[0]=e,u[1]=t,u[2]=i):(t=u[1],i=u[2]),u[3]!==t?(r=(0,o.cx)("grid grid-cols-1 gap-3",t),u[3]=t,u[4]=r):r=u[4],u[5]!==i||u[6]!==r?(l=(0,n.jsx)(a.bL,{"data-slot":"radio-group",className:r,...i}),u[5]=i,u[6]=r,u[7]=l):l=u[7],l}function u(e){let t,i,l,u,c,d=(0,s.c)(9);return d[0]!==e?({className:t,...i}=e,d[0]=e,d[1]=t,d[2]=i):(t=d[1],i=d[2]),d[3]!==t?(l=(0,o.cx)("border-input text-text-heading focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),d[3]=t,d[4]=l):l=d[4],d[5]===Symbol.for("react.memo_cache_sentinel")?(u=(0,n.jsx)(a.C1,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:(0,n.jsx)(r.A,{className:"fill-primary absolute size-2"})}),d[5]=u):u=d[5],d[6]!==i||d[7]!==l?(c=(0,n.jsx)(a.q7,{"data-slot":"radio-group-item",className:l,...i,children:u}),d[6]=i,d[7]=l,d[8]=c):c=d[8],c}},28684:(e,t,i)=>{i.d(t,{h:()=>l});var n=i(77571),s=i(56149),r=i(18142),o=i(26655),a=i(73822);function l(e){let t,i,l,u,c,d,p,v=(0,s.c)(23),{id:y,value:f,checked:b,onChange:m,className:h,children:x,disabled:g,belowContent:j}=e;return v[0]!==h||v[1]!==g?(t=(0,a.cx)("bg-white border-cpv3 border-border-primary rounded-border-radius block",{"opacity-50 pointer-events-none cursor-not-allowed":g},h),v[0]=h,v[1]=g,v[2]=t):t=v[2],v[3]!==b||v[4]!==g||v[5]!==y||v[6]!==m||v[7]!==f?(i=(0,n.jsx)(o.C,{value:f,id:y,disabled:g,checked:b,onChange:m,className:"w-5 h-5 rounded-full border-cpv3 border-border-primary mt-0.5"}),v[3]=b,v[4]=g,v[5]=y,v[6]=m,v[7]=f,v[8]=i):i=v[8],v[9]!==x?(l=(0,n.jsx)("div",{className:"flex-1",children:x}),v[9]=x,v[10]=l):l=v[10],v[11]!==i||v[12]!==l?(u=(0,n.jsxs)("div",{className:"flex items-start gap-3 p-4",children:[i,l]}),v[11]=i,v[12]=l,v[13]=u):u=v[13],v[14]!==y||v[15]!==u?(c=(0,n.jsx)(r.J,{htmlFor:y,className:"cursor-pointer block",children:u}),v[14]=y,v[15]=u,v[16]=c):c=v[16],v[17]!==j?(d=j?(0,n.jsx)("div",{className:"px-4 pb-4",children:j}):null,v[17]=j,v[18]=d):d=v[18],v[19]!==t||v[20]!==c||v[21]!==d?(p=(0,n.jsxs)("div",{className:t,children:[c,d]}),v[19]=t,v[20]=c,v[21]=d,v[22]=p):p=v[22],p}},33859:(e,t,i)=>{i.d(t,{F:()=>b});var n=i(24163),s=i(26999);function r(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function o({canonicalEnglish:e,locale:t,translations:i}){let n=t?.trim();if(!n)return e;let s=r(i)?Object.fromEntries(Object.entries(i).filter(e=>{var t;return r(t=e.at(1))&&"string"==typeof t.value&&"string"==typeof t.source})):{},o=[n],a=n.split("-").at(0);for(let t of(a&&a!==n&&o.push(a),o)){let i=function({canonicalEnglish:e,locale:t,translations:i}){let n=i[t];return!n||0===n.value.trim().length||function({canonicalEnglish:e,translation:t}){return t.source!==e}({canonicalEnglish:e,translation:n})?null:n}({canonicalEnglish:e,locale:t,translations:s});if(i)return i.value}return e}var a=i(6844),l=i(3555),u=i(91536);let c=(0,u.J1)`
2    query storefrontSurveyForType($siteId: uuid!, $surveyType: String!) {
3  Survey(where: {siteId: {_eq: $siteId}, type: {_eq: $surveyType}}) {
4    id
5    question
6    questionTranslations
7    type
8    SurveyOptions(order_by: {order: asc}) {
9      id
10      label
11      labelTranslations
12    }
13  }
14}
15    `;var d=i(28402),p=i(14323),v=function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function y({siteId:e,surveyType:t}){return["survey-for-action",e,t]}function f(e,t){let i=null==e?void 0:e.Survey.at(0);return i&&0!==i.SurveyOptions.length?{id:i.id,type:i.type,canonicalQuestion:i.question,question:o({canonicalEnglish:i.question,locale:t,translations:i.questionTranslations}),SurveyOptions:i.SurveyOptions.map(e=>({id:e.id,canonicalLabel:e.label,label:o({canonicalEnglish:e.label,locale:t,translations:e.labelTranslations})}))}:null}function b({surveyType:e,enabled:t=!0}){let i=(0,s.m)(),r=(0,a.useQueryClient)(),{siteId:o,isLoading:u}=(0,p.A)(),{locale:b}=(0,d.B)(),m=!!o&&!u,h=(0,n.useCallback)(()=>v(this,void 0,void 0,function*(){let t=yield i.query({query:c,variables:{siteId:null!=o?o:"",surveyType:e},fetchPolicy:"no-cache"});if(t.error)throw t.error;return t.data}),[i,o,e]),{data:x}=(0,l.useQuery)({queryKey:y({siteId:o,surveyType:e}),queryFn:h,staleTime:6e5,enabled:t&&m}),g=(0,n.useCallback)(()=>v(this,void 0,void 0,function*(){if(!m)return null;try{return f((yield r.ensureQueryData({queryKey:y({siteId:o,surveyType:e}),queryFn:h,staleTime:6e5})),b)}catch(e){return null}}),[m,b,r,h,o,e]);return{survey:f(x,b),resolveSurvey:g}}},86306:(e,t,i)=>{i.d(t,{r:()=>q});var n=i(77571),s=i(56149),r=i(24163),o=i(2526),a=i(46567),l=i(28684),u=i(26655),c=i(47719),d=i(35703),p=i(73822),v=i(21372);function y(e){let t,i,o,a,y,f,b,m,h,x,g,j,S,k,_,w=(0,s.c)(48),{confirmation:N,question:q,options:O,submitLabel:C,closeLabel:I,isSubmitting:$,onSubmit:E,onClose:A,className:z}=e,D=void 0!==$&&$,[R,F]=(0,r.useState)(null);if(w[0]!==O||w[1]!==R){let e;w[3]!==R?(e=e=>e.id===R,w[3]=R,w[4]=e):e=w[4],t=O.find(e),w[0]=O,w[1]=R,w[2]=t}else t=w[2];let P=t;w[5]!==P||w[6]!==R?(i=()=>{null!==R&&void 0===P&&F(null)},o=[P,R],w[5]=P,w[6]=R,w[7]=i,w[8]=o):(i=w[7],o=w[8]),(0,r.useEffect)(i,o),w[9]!==E||w[10]!==P?(a=function(){P&&E(P)},w[9]=E,w[10]=P,w[11]=a):a=w[11];let T=a;w[12]===Symbol.for("react.memo_cache_sentinel")?(y=(0,n.jsx)("span",{className:"flex size-5 shrink-0 items-center justify-center rounded-full bg-success-solid text-fg-white",children:(0,n.jsx)(v.J,{className:"size-3.5","aria-hidden":"true"})}),w[12]=y):y=w[12],w[13]!==N?(f=(0,n.jsxs)("div",{role:"status",className:"flex items-center gap-2 rounded-xl bg-success-50 p-3 pr-10","data-skio-name":"post-action-survey-confirmation","data-skio-type":"post-action-survey-confirmation",children:[y,(0,n.jsx)("p",{className:"text-sm font-semibold text-success",children:N})]}),w[13]=N,w[14]=f):f=w[14],w[15]!==q?(b=(0,n.jsx)(c.rQ,{title:q}),w[15]=q,w[16]=b):b=w[16],w[17]!==z?(m=(0,p.cx)("flex flex-col gap-5 overflow-y-auto",z),w[17]=z,w[18]=m):m=w[18];let L=P?.id??"";if(w[19]!==O||w[20]!==P?.id){let e;w[22]!==P?.id?(e=e=>(0,n.jsx)(l.h,{"data-skio-name":"post-action-survey-option",value:e.id,id:`post-action-survey-option-${e.id}`,checked:P?.id===e.id,children:(0,n.jsx)("p",{className:"text-sm text-text-general font-medium",children:e.label})}
15,e.id),w[22]=P?.id,w[23]=e):e=w[23],h=O.map(e),w[19]=O,w[20]=P?.id,w[21]=h}else h=w[21];w[24]!==q||w[25]!==L||w[26]!==h?(x=(0,n.jsx)(u.z,{"data-skio-name":"post-action-survey-radio-group","aria-label":q,value:L,onValueChange:F,children:h}),w[24]=q,w[25]=L,w[26]=h,w[27]=x):x=w[27],w[28]!==x||w[29]!==m?(g=(0,n.jsx)(c.$m,{className:m,children:x}),w[28]=x,w[29]=m,w[30]=g):g=w[30],w[31]!==I||w[32]!==D||w[33]!==A?(j=(0,n.jsx)(d.$,{"data-skio-name":"post-action-survey-dismiss-button",size:"md",className:"w-full",color:"support",onClick:A,isDisabled:D,children:I}),w[31]=I,w[32]=D,w[33]=A,w[34]=j):j=w[34];let J=!P;return w[35]!==T||w[36]!==D||w[37]!==C||w[38]!==J?(S=(0,n.jsx)(d.$,{"data-skio-name":"post-action-survey-submit-button",size:"md",className:"w-full",color:"primary",onClick:T,isDisabled:J,isLoading:D,children:C}),w[35]=T,w[36]=D,w[37]=C,w[38]=J,w[39]=S):S=w[39],w[40]!==j||w[41]!==S?(k=(0,n.jsxs)(c.jl,{children:[j,S]}),w[40]=j,w[41]=S,w[42]=k):k=w[42],w[43]!==g||w[44]!==k||w[45]!==f||w[46]!==b?(_=(0,n.jsxs)(n.Fragment,{children:[f,b,g,k]}),w[43]=g,w[44]=k,w[45]=f,w[46]=b,w[47]=_):_=w[47],_}var f=i(67114),b=i(28402),m=i(75865),h=i(46299),x=i(48725),g=i(91536),j=i(44146);let S={},k=(0,g.J1)`
16    mutation storefrontInsertSurveyResponse($object: SurveyResponse_insert_input!) {
17  insert_SurveyResponse_one(object: $object) {
18    id
19  }
20}
21    `,_=(0,g.J1)`
22    mutation storefrontUpdateSurveyResponse($id: uuid!, $set: SurveyResponse_set_input!) {
23  update_SurveyResponse_by_pk(pk_columns: {id: $id}, _set: $set) {
24    id
25  }
26}
27    `;var w=i(14323),N=function(e,t,i,n){return new(i||(i=Promise))(function(s,r){function o(e){try{l(n.next(e))}catch(e){r(e)}}function a(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof i?t:new i(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};function q(e){let t,i,l,u,c,d,p,v,g,q,C,I,$,E=(0,s.c)(44),{survey:A,surveyType:z,subscriptionId:D,onDone:R}=e,{t:F}=(0,b.B)(),{showToast:P}=(0,a.d)(),{recordShown:T,recordAnswered:L,recordDismissed:J,isSubmittingResponse:Q}=function(){let{siteId:e}=(0,w.A)(),[t]=function(e){let t=Object.assign(Object.assign({},S),void 0);return j.n(k,t)}(),[i]=function(e){let t=Object.assign(Object.assign({},S),void 0);return j.n(_,t)}(),n=(0,r.useRef)(null),{mutateAsync:s}=(0,x.useMutation)({mutationFn:i=>N(this,[i],void 0,function*({survey:i,subscriptionId:n,surveyType:s}){var r,a,l;try{return null!=(l=null==(a=null==(r=(yield t({variables:{object:{siteId:e,subscriptionId:n,surveyId:i.id,surveyType:s,question:i.canonicalQuestion,status:o.av.SHOWN}}})).data)?void 0:r.insert_SurveyResponse_one)?void 0:a.id)?l:null}catch(e){return(0,h.Pz)({message:"Failed to record survey response as shown",data:{subscriptionId:n,surveyId:i.id,surveyType:s,error:(0,m.u1)(e)}}),null}})}),{mutateAsync:a,isPending:l}=(0,x.useMutation)({mutationFn:e=>N(this,[e],void 0,function*({status:e,option:t}){var s;let r=yield n.current;if(r)try{yield i({variables:{id:r,set:Object.assign({status:e},t?{optionId:t.id,optionLabel:t.label}:{})}})}catch(i){(0,h.Pz)({message:`Failed to record survey response as ${e}`,data:{responseId:r,optionId:null!=(s=null==t?void 0:t.id)?s:"",error:(0,m.u1)(i)}})}})}),u=(0,r.useCallback)(t=>{!n.current&&e&&(n.current=s(t))},[s,e]);return{recordShown:u,recordAnswered:(0,r.useCallback)(e=>N(this,[e],void 0,function*({option:e}){return a({status:o.av.ANSWERED,option:e})}),[a]),recordDismissed:(0,r.useCallback)(()=>N(this,void 0,void 0,function*(){return a({status:o.av.DISMISSED})}),[a]),isSubmittingResponse:l}}(),K=r.useRef(!1);E[0]!==T||E[1]!==D||E[2]!==A||E[3]!==z?(t=()=>{T({survey:A,subscriptionId:D,surveyType:z})},i=[T,A,D,z],E[0]=T,E[1]=D,E[2]=A,E[3]=z,E[4]=t,E[5]=i):(t=E[4],i=E[5]),r.useEffect(t,i),E[6]!==R||E[7]!==L||E[8]!==P||E[9]!==A.SurveyOptions||E[10]!==F?(l=async function(e){if(K.current)return;let t=A.SurveyOptions.find(t=>t.id===e.id);t&&(K.current=!0,await L({option:{id:t.id,label:t.canonicalLabel}}),P({title:F("cpv3.subscriptions.survey.submitted.toast"),type:"success"}),R())},E[6]=R,E[7]=L,E[8]=P,E[9]=A.SurveyOptions,E[10]=F,E[11]=l):l=E[11];let M=l;E[12]!==R||E[13]!==J?(u=function(){K.current||(J(),R())},E[12]=R,E[13]=J,E[14]=u):u=E[14];let W=u;E[15]!==F?(c=F("common.close"),E[15]=F,E[16]=c):c=E[16],E[17]!==W||E[18]!==Q||E[19]!==c?(d=(0,n.jsx)(f.J,{size:"lg",label:c,className:"absolute top-2 right-2 z-10",onClick:W,isDisabled:Q,"data-skio-name":"post-action-survey-dismiss-icon-button","data-skio-type":"post-action-survey-dismiss-icon-button"}),E[17]=W,E[18]=Q,E[19]=c,E[20]=d):d=E[20];let B=z===o.uA.SKIP?"cpv3.subscriptions.survey.skip.title":"cpv3.subscriptions.survey.pause.title";E[21]!==F||E[22]!==B?(p=F(B),E[21]=F,E[22]=B,E[23]=p):p=E[23];let H=A.question;return E[24]!==A.SurveyOptions?(v=A.SurveyOptions.map(O),E[24]=A.SurveyOptions,E[25]=v):v=E[25],E[26]!==F?(g=F("cpv3.subscriptions.survey.submit.button"),E[26]=F,E[27]=g):g=E[27],E[28]!==F?(q=F("common.close"),E[28]=F,E[29]=q):q=E[29],E[30]!==M?(C=e=>{M(e)},E[30]=M,E[31]=C):C=E[31],E[32]!==W||E[33]!==Q||E[34]!==A.question||E[35]!==v||E[36]!==g||E[37]!==q||E[38]!==C||E[39]!==p?(I=(0,n.jsx)(y,{confirmation:p,question:H,options:v,submitLabel:g,closeLabel:q,isSubmitting:Q,onSubmit:C,onClose:W}),E[32]=W,E[33]=Q,E[34]=A.question,E[35]=v,E[36]=g,E[37]=q,E[38]=C,E[39]=p,E[40]=I):I=E[40],E[41]!==I||E[42]!==d?($=(0,n.jsxs)(n.Fragment,{children:[d,I]}),E[41]=I,E[42]=d,E[43]=$):$=E[43],$}function O(e){return{id:e.id,label:e.label}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.