@yoast/ai-insights-client 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1286,8 +1286,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1286
1286
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gR(e,t){if(e){if(typeof e=="string")return dp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dp(e,t):void 0}}function dp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function mR(e){if(Array.isArray(e))return e}var pR=function(t){var n=t.isOpen,r=t.brandId,i=t.onClose,s=t.brandName,o=Ei(),a=W.useState(""),l=fR(a,2),c=l[0],u=l[1],d=Bk({mutation:{onSuccess:function(){o.invalidateQueries({queryKey:gf()}),console.log("Brand data deleted"),i()}}}),f=d.mutate,h=d.isPending;return W.useEffect(function(){n&&u("")},[n]),y.jsx(vf,{isOpen:n,onClose:i,onConfirm:function(){if(!s){console.error("Brand name is required for deletion confirmation");return}f({brandId:r})},isLoading:h,disabled:c.toLowerCase()!==(s==null?void 0:s.toLowerCase()),title:"Delete brand?",description:y.jsxs(y.Fragment,{children:[y.jsx("p",{children:"This will permanently delete all data associated with this brand, including past analyses and query history."}),y.jsx("p",{children:"This action cannot be undone."}),y.jsx(O.TextField,{id:"delete-modal-brand-name-confirmation",label:"To confirm, please type your brand name ".concat(s,":"),value:c,onChange:function(g){return u(g.target.value)}}),y.jsx("p",{children:y.jsx("em",{children:"This is to make sure you understand this action is permanent."})})]}),confirmText:"Yes, delete brand",cancelText:"No, go back"})},fp,hp,gp;function Lu(e,t){return wR(e)||xR(e,t)||vR(e,t)||bR()}function bR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1287
1287
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vR(e,t){if(e){if(typeof e=="string")return yp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?yp(e,t):void 0}}function yp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function wR(e){if(Array.isArray(e))return e}function oh(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var mp=Fs(fp||(fp=oh(["xl:yst-w-1/3"]))),pp=Fs(hp||(hp=oh(["xl:yst-w-2/3"]))),bp=Fs(gp||(gp=oh(["yst-flex yst-flex-col yst-gap-8 xl:yst-flex-row"]))),SR=function(){var t=W.useState(!1),n=Lu(t,2),r=n[0],i=n[1],s=W.useState(!1),o=Lu(s,2),a=o[0],l=o[1],c=W.useState(null),u=Lu(c,2),d=u[0],f=u[1],h=kc({query:{select:function(b){var v,S=b.data;return S==null||(v=S.data)===null||v===void 0?void 0:v.brands}}}),g=h.data,m=g==null?void 0:g.find(function(p){return p.id===d});return y.jsxs("form",{children:[y.jsxs(O.Card,{children:[y.jsx(zv,{title:"Settings"}),y.jsxs(O.Card.Content,{children:[y.jsxs(bp,{children:[y.jsxs(mp,{className:"yst-space-y-2",children:[y.jsx(O.Title,{size:"4",children:"Brands"}),y.jsx("p",{children:"Manage your brands. You can edit analysis preferences per brand or delete a brand and its data."})]}),y.jsxs(pp,{children:[g&&g.length===0&&y.jsxs("p",{className:"yst-text-slate-500",children:["No brands found. Please"," ",y.jsx(O.Link,{as:Hr,to:"/setup",children:"add a brand"})," ","to start analyzing."]}),(g||[{id:"loading",name:"Loading..."}]).map(function(p,b,v){return y.jsxs("div",{className:Se("yst-flex yst-flex-col yst-items-start yst-items-center yst-justify-between yst-gap-2 yst-py-4 lg:yst-flex-row",{"yst-border-b-[1px] yst-border-b-slate-200":b!==v.length-1}),children:[y.jsx("div",{className:"yst-font-medium",children:p.id==="loading"?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):p.name}),y.jsxs("div",{className:"yst-flex yst-flex-col yst-items-start yst-justify-start yst-gap-2 lg:yst-flex-row lg:yst-items-center",children:[p.id==="loading"?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-32"}):y.jsxs(O.Button,{size:"small",variant:"secondary",className:"yst-gap-1",disabled:p.id==="loading",children:[y.jsx($b,{})," Edit analysis preferences"]}),p.id==="loading"?y.jsx(O.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsxs(O.Button,{size:"small",variant:"tertiary",className:"yst-gap-1 yst-text-red-600 *:hover:yst-text-red-700",onClick:function(){p.id&&(f(p.id),i(!0))},disabled:p.id==="loading",children:[y.jsx(Cd,{})," Delete brand"]})]})]},p.id)})]})]}),y.jsx(Oa,{}),y.jsxs(bp,{children:[y.jsxs(mp,{className:"yst-space-y-2",children:[y.jsx(O.Title,{size:"4",children:"Delete all data"}),y.jsx("p",{children:"Permanently delete all brands, analysis results, and query history from your account."})]}),y.jsxs(pp,{className:"yst-space-y-4",children:[y.jsxs(O.Button,{variant:"error",onClick:function(){l(!0)},children:[y.jsx(Cd,{})," Delete all data"]}),y.jsx("p",{children:y.jsxs("i",{children:[y.jsx("b",{children:"Note:"})," This will erase everything and cannot be reversed."]})})]})]})]})]}),y.jsx(pR,{isOpen:r,onClose:function(){i(!1),f(null)},brandId:d,brandName:m==null?void 0:m.name}),y.jsx(dR,{isOpen:a,onClose:function(){l(!1)}})]})};const CR=Object.freeze(Object.defineProperty({__proto__:null,default:SR},Symbol.toStringTag,{value:"Module"}));function _R(){var e=dn(),t=[{path:"/setup",id:1,title:"Brand & location info",description:"Enter a few basic details about your brand so we can generate relevant queries people might use in AI models like ChatGPT and Perplexity. This helps us analyze how visible your brand is in their responses."},{path:"/setup/queries",id:2,title:"Queries",description:"Review the queries we've generated from your brand info. These are phrases people might type into AI models that could trigger your brand to appear."},{path:"/setup/analysis",id:3,title:"Analysis",description:"We're checking how your brand shows up in AI. Your queries will now be tested in ChatGPT and Perplexity. This process should take around 5 minutes."}],n=function(){return t.find(function(s){return s.path===e.pathname})||t[0]},r=n();return y.jsxs(O.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(mf,{title:y.jsxs("span",{className:"yst-inline-flex yst-flex-row yst-gap-4",children:[y.jsxs("span",{className:"yst-tracking-[.2em] yst-text-slate-400",children:[y.jsx("span",{className:"yst-text-slate-900",children:r.id}),"/",t.length]}),y.jsx("span",{children:r.title})]}),description:r.description}),y.jsx(O.Paper.Content,{children:y.jsx(dc,{})})]})}const kR=Object.freeze(Object.defineProperty({__proto__:null,default:_R},Symbol.toStringTag,{value:"Module"}));var Cx=function(t){var n=t.sparkCost,r=n===void 0?0:n,i=t.onBack,s=t.variant,o=s===void 0?"ai":s,a=t.buttonText,l=t.onButtonClick,c=t.isButtonDisabled,u=c===void 0?!1:c,d=t.isLoading,f=d===void 0?!1:d;return y.jsx(bf,{nestedInPaperContent:!0,children:y.jsxs("div",{className:Se({"yst-flex yst-flex-1 yst-flex-col yst-items-start yst-justify-between yst-gap-4 md:yst-flex-row md:yst-items-center md:yst-justify-between":i}),children:[i&&y.jsx(O.Button,{variant:"tertiary",onClick:i,className:"yst-no-underline",children:"← Back"}),y.jsxs("div",{className:Se("yst-flex yst-flex-col yst-items-stretch yst-gap-4 md:yst-flex-row md:yst-items-center md:yst-justify-end"),children:[r>0&&y.jsx(qb,{cost:r}),y.jsxs(O.Button,{onClick:l,variant:o==="ai"?"primary":o,className:"yst-gap-1.5",style:o==="ai"?{background:"linear-gradient(102deg, #A61E69 0%, #6366F1 100%)",color:"#fff"}:{},disabled:u,type:"submit",isLoading:f,children:[o==="ai"&&y.jsx(Ec,{}),a]})]})]})})},ER=[{value:"US",label:"United States"},{value:"GB",label:"United Kingdom"},{value:"CA",label:"Canada"},{value:"AU",label:"Australia"},{value:"DE",label:"Germany"},{value:"FR",label:"France"},{value:"NL",label:"Netherlands"}],OR=[{value:"AR",label:"Argentina"},{value:"BE",label:"Belgium"},{value:"BR",label:"Brazil"},{value:"CN",label:"China"},{value:"EG",label:"Egypt"},{value:"ID",label:"Indonesia"},{value:"IE",label:"Ireland"},{value:"IL",label:"Israel"},{value:"IN",label:"India"},{value:"IT",label:"Italy"},{value:"JP",label:"Japan"},{value:"KR",label:"South Korea"},{value:"MX",label:"Mexico"},{value:"NG",label:"Nigeria"},{value:"PL",label:"Poland"},{value:"RU",label:"Russia"},{value:"SA",label:"Saudi Arabia"},{value:"SE",label:"Sweden"},{value:"ES",label:"Spain"},{value:"TH",label:"Thailand"},{value:"TR",label:"Turkey"},{value:"TW",label:"Taiwan"},{value:"ZA",label:"South Africa"}],pl=[].concat(ER,OR,[{value:"OTHER",label:"Other"}]),AR=[{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"zh",label:"Chinese (Mandarin)"},{value:"ja",label:"Japanese"}],TR=[{value:"ar",label:"Arabic"},{value:"da",label:"Danish"},{value:"nl",label:"Dutch"},{value:"fi",label:"Finnish"},{value:"hi",label:"Hindi"},{value:"it",label:"Italian"},{value:"ko",label:"Korean"},{value:"no",label:"Norwegian"},{value:"pl",label:"Polish"},{value:"pt",label:"Portuguese"},{value:"ru",label:"Russian"},{value:"sv",label:"Swedish"},{value:"th",label:"Thai"},{value:"tr",label:"Turkish"}],PR=[].concat(AR,TR),vp=["Software","SaaS","Mobile Apps","Web Development","Cybersecurity","AI/Machine Learning","Cloud Computing","Data Analytics","IT Services","Gaming","E-commerce","Online Retail","Fashion Retail","Electronics Retail","Home Goods","Sporting Goods","Jewelry","Beauty Products","Automotive Parts","Books & Media","Consulting","Legal Services","Accounting","Marketing Agency","Public Relations","HR Services","Business Coaching","Financial Advisory","Real Estate","Insurance","Healthcare","Dental","Mental Health","Fitness","Spa & Wellness","Nutrition","Medical Device","Pharmacy","Veterinary","Alternative Medicine","Photography","Graphic Design","Video Production","Marketing","Advertising","Content Creation","Music","Art & Design","Entertainment","Publishing","Restaurant","Cafe","Food Delivery","Catering","Bakery","Brewery","Wine","Food Production","Grocery","Food Truck","Education","Online Learning","Training","Coaching","Tutoring","Language Learning","Professional Development","Childcare","University","Certification","Manufacturing","Construction","Engineering","Automotive","Aerospace","Chemical","Textile","Furniture","Packaging","Industrial Equipment","Travel","Hotel","Tourism","Event Planning","Transportation","Airline","Cruise","Car Rental","Vacation Rental","Adventure Tours","Non-Profit","Charity","Government","Religious Organization","Community Service","Environmental","Political","Social Services","Foundation","Advocacy"];function oa(e){"@babel/helpers - typeof";return oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oa(e)}function xp(e){return jR(e)||$R(e)||kx(e)||MR()}function MR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1288
1288
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $R(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jR(e){if(Array.isArray(e))return Jd(e)}function wp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wp(Object(n),!0).forEach(function(r){_x(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function _x(e,t,n){return(t=DR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DR(e){var t=LR(e,"string");return oa(t)=="symbol"?t:t+""}function LR(e,t){if(oa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(oa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Iu(e,t){return FR(e)||RR(e,t)||kx(e,t)||IR()}function IR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1289
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kx(e,t){if(e){if(typeof e=="string")return Jd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jd(e,t):void 0}}function Jd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function RR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function FR(e){if(Array.isArray(e))return e}var NR=function(){var t,n,r=zr(),i=yf(),s=Ei(),o=W.useState({name:"",url:"",industry:"",language:"en",isLocal:!1,country:"",region:""}),a=Iu(o,2),l=a[0],c=a[1],u=W.useState(vp),d=Iu(u,2),f=d[0],h=d[1],g=jk({mutation:{onSuccess:function(x){var _,C=(_=x.data)===null||_===void 0||(_=_.data)===null||_===void 0?void 0:_.id;console.log("Brand created successfully",C),s.invalidateQueries({queryKey:[kb(),gf()]}),i.setBrandId(C),x!=null&&x.status&&x.status>=200&&x.status<300&&C&&(i.setBrandId(C),r("/setup/queries"))},onError:function(x){console.log("Error creating brand:",x)}}}),m=g.mutate,p=g.isPending,b=g.error,v=function(x,_){c(function(C){return Sp(Sp({},C),{},_x({},x,_))})},S=function(x){x.preventDefault();var _=l.url;_&&!/^https?:\/\//i.test(_)&&(_="https://".concat(_)),m({data:{name:l.name,url:_,industry:l.industry,focusLanguage:l.language,isLocalFocus:l.isLocal,country:String(l.country),regionOrCity:String(l.region)}})};return y.jsxs("form",{onSubmit:S,children:[y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(O.Title,{size:"2",children:"Brand info"}),!!b&&y.jsx(O.Alert,{variant:"error",title:"Error",isVisible:!!b,children:y.jsx("ul",{children:b!=null&&(t=b.response)!==null&&t!==void 0&&(t=t.data)!==null&&t!==void 0&&t.error?Object.entries(b.response.data.error).flatMap(function(w){var x=Iu(w,2),_=x[0],C=x[1];return Array.isArray(C)?C.map(function(A,k){return y.jsx("li",{children:A},"".concat(_,"-").concat(k))}):null}):"There was an error creating the brand."})}),y.jsx(O.TextField,{id:"name",label:"Brand name",value:l.name,onChange:function(w){return v("name",w.target.value)}}),y.jsx(O.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:l.url,onChange:function(w){return v("url",w.target.value)}}),y.jsxs(O.Autocomplete,{className:"yst-max-w-sm",clearButtonScreenReaderText:"Clear selection",id:"industry",label:"Industry",labelProps:{className:"yst-text-slate-800 yst-font-medium"},nullable:!0,onChange:function(w){return v("industry",w)},onQueryChange:function(w){h([w.target.value].concat(xp(vp.filter(function(x){return x.toLowerCase().includes(w.target.value.toLowerCase())}))))},placeholder:"Select or type your industry...",selectedLabel:l.industry,value:l.industry,children:[!f.find(function(w){return w===l.industry})&&l.industry&&y.jsx(O.Autocomplete.Option,{value:l.industry,children:l.industry}),f.map(function(w){return y.jsx(O.Autocomplete.Option,{value:w,children:w},w)})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(O.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:l.language,onChange:function(w){return v("language",w)},options:PR.map(function(w){return{label:w.label,value:w.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(Oa,{}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(O.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"You can specify a location to help focus the analysis."}),y.jsx(O.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target country (optional)",value:l.country,placeholder:"Select...",onChange:function(w){return v("country",w)},options:[{label:"Select...",value:"none"}].concat(xp(pl)).map(function(w){return{label:w.label,value:w.value}})}),y.jsxs(O.Autocomplete,{className:"yst-hidden yst-max-w-sm",clearButtonScreenReaderText:"Clear selection",id:"country",label:"Which country do you operate in?",nullable:!0,onChange:function(w){return v("country",w)},onQueryChange:function(w){return v("country",w.target.value)},placeholder:"Select or type your country...",selectedLabel:((n=pl.find(function(w){return w.value===l.country}))===null||n===void 0?void 0:n.label)||l.country,value:l.country,children:[!pl.find(function(w){return w.value===l.country})&&l.country&&y.jsx(O.Autocomplete.Option,{value:l.country,children:l.country}),pl.map(function(w){return y.jsx(O.Autocomplete.Option,{value:w.value,children:w.label},w.value)})]}),l.country&&y.jsx(O.TextField,{id:"region",label:"Target city, state, or region (optional)",value:l.region,onChange:function(w){return v("region",w.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
1289
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kx(e,t){if(e){if(typeof e=="string")return Jd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jd(e,t):void 0}}function Jd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function RR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function FR(e){if(Array.isArray(e))return e}var NR=function(){var t,n,r=zr(),i=yf(),s=Ei(),o=W.useState({name:"",url:"",industry:"",language:"en",isLocal:!1,country:"",region:""}),a=Iu(o,2),l=a[0],c=a[1],u=W.useState(vp),d=Iu(u,2),f=d[0],h=d[1],g=jk({mutation:{onSuccess:function(x){var _,C=(_=x.data)===null||_===void 0?void 0:_.id;console.log("Brand created successfully",C),s.invalidateQueries({queryKey:[kb(),gf()]}),i.setBrandId(C),x!=null&&x.status&&x.status>=200&&x.status<300&&C&&(i.setBrandId(C),r("/setup/queries"))},onError:function(x){console.log("Error creating brand:",x)}}}),m=g.mutate,p=g.isPending,b=g.error,v=function(x,_){c(function(C){return Sp(Sp({},C),{},_x({},x,_))})},S=function(x){x.preventDefault();var _=l.url;_&&!/^https?:\/\//i.test(_)&&(_="https://".concat(_)),m({data:{name:l.name,url:_,industry:l.industry,focusLanguage:l.language,isLocalFocus:l.isLocal,country:String(l.country),regionOrCity:String(l.region)}})};return y.jsxs("form",{onSubmit:S,children:[y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(O.Title,{size:"2",children:"Brand info"}),!!b&&y.jsx(O.Alert,{variant:"error",title:"Error",isVisible:!!b,children:y.jsx("ul",{children:b!=null&&(t=b.response)!==null&&t!==void 0&&(t=t.data)!==null&&t!==void 0&&t.error?Object.entries(b.response.data.error).flatMap(function(w){var x=Iu(w,2),_=x[0],C=x[1];return Array.isArray(C)?C.map(function(A,k){return y.jsx("li",{children:A},"".concat(_,"-").concat(k))}):null}):"There was an error creating the brand."})}),y.jsx(O.TextField,{id:"name",label:"Brand name",value:l.name,onChange:function(w){return v("name",w.target.value)}}),y.jsx(O.TextField,{id:"url",label:"Website URL (optional)",placeholder:"Example: https://yourwebsite.com",value:l.url,onChange:function(w){return v("url",w.target.value)}}),y.jsxs(O.Autocomplete,{className:"yst-max-w-sm",clearButtonScreenReaderText:"Clear selection",id:"industry",label:"Industry",labelProps:{className:"yst-text-slate-800 yst-font-medium"},nullable:!0,onChange:function(w){return v("industry",w)},onQueryChange:function(w){h([w.target.value].concat(xp(vp.filter(function(x){return x.toLowerCase().includes(w.target.value.toLowerCase())}))))},placeholder:"Select or type your industry...",selectedLabel:l.industry,value:l.industry,children:[!f.find(function(w){return w===l.industry})&&l.industry&&y.jsx(O.Autocomplete.Option,{value:l.industry,children:l.industry}),f.map(function(w){return y.jsx(O.Autocomplete.Option,{value:w,children:w},w)})]}),y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(O.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target language",value:l.language,onChange:function(w){return v("language",w)},options:PR.map(function(w){return{label:w.label,value:w.value}})}),y.jsx("p",{children:"The main language your brand uses to communicate or create content."})]})]}),y.jsx(Oa,{}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(O.Title,{size:"2",children:"Location info"}),y.jsx("p",{children:"You can specify a location to help focus the analysis."}),y.jsx(O.Select,{className:"yst-max-w-sm",id:"language-select",label:"Target country (optional)",value:l.country,placeholder:"Select...",onChange:function(w){return v("country",w)},options:[{label:"Select...",value:"none"}].concat(xp(pl)).map(function(w){return{label:w.label,value:w.value}})}),y.jsxs(O.Autocomplete,{className:"yst-hidden yst-max-w-sm",clearButtonScreenReaderText:"Clear selection",id:"country",label:"Which country do you operate in?",nullable:!0,onChange:function(w){return v("country",w)},onQueryChange:function(w){return v("country",w.target.value)},placeholder:"Select or type your country...",selectedLabel:((n=pl.find(function(w){return w.value===l.country}))===null||n===void 0?void 0:n.label)||l.country,value:l.country,children:[!pl.find(function(w){return w.value===l.country})&&l.country&&y.jsx(O.Autocomplete.Option,{value:l.country,children:l.country}),pl.map(function(w){return y.jsx(O.Autocomplete.Option,{value:w.value,children:w.label},w.value)})]}),l.country&&y.jsx(O.TextField,{id:"region",label:"Target city, state, or region (optional)",value:l.region,onChange:function(w){return v("region",w.target.value)},description:`Enter a city, state, or region to narrow down the analysis. For
1290
1290
  example: California, Bavaria, or Paris.`})]}),y.jsx(Cx,{sparkCost:1,onBack:function(){return r(-1)},buttonText:"Generate queries",isButtonDisabled:p,isLoading:p})]})};const BR=Object.freeze(Object.defineProperty({__proto__:null,default:NR},Symbol.toStringTag,{value:"Module"}));function aa(e){"@babel/helpers - typeof";return aa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},aa(e)}function qR(e){return UR(e)||HR(e)||Ex(e)||zR()}function zR(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1291
1291
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HR(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UR(e){if(Array.isArray(e))return Zd(e)}function Cp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Fi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Cp(Object(n),!0).forEach(function(r){KR(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cp(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function KR(e,t,n){return(t=WR(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WR(e){var t=VR(e,"string");return aa(t)=="symbol"?t:t+""}function VR(e,t){if(aa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(aa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ru(e,t){return YR(e)||QR(e,t)||Ex(e,t)||GR()}function GR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1292
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ex(e,t){if(e){if(typeof e=="string")return Zd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zd(e,t):void 0}}function Zd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function QR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function YR(e){if(Array.isArray(e))return e}var Ox=5,Ax="Generating...",XR="Re-generating...",JR=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],ZR=Array.from({length:Ox},function(e,t){return{id:"query-".concat(t),text:Ax,isRegenerating:!0}}),e9=function(){var t=zt(),n=t.brandId,r=zr(),i=W.useState(ZR),s=Ru(i,2),o=s[0],a=s[1],l=W.useState(!1),c=Ru(l,2),u=c[0],d=c[1],f=W.useState([]),h=Ru(f,2),g=h[0],m=h[1],p=g.length||Ox,b=Vk(n||"",{quantity:p},{query:{enabled:!!n}}),v=b.data,S=b.isRefetching,w=b.refetch,x=Hk({mutation:{onSuccess:function(N){N!=null&&N.status&&N.status>=200&&N.status<300&&r("/setup/analysis")},onError:function(N){console.error("Error saving queries:",N)}}}),_=x.mutate,C=x.isPending;W.useEffect(function(){var q;v!=null&&(q=v.data)!==null&&q!==void 0&&q.data&&Array.isArray(v.data.data)&&o.every(function(N){return N.text===Ax})&&a(v.data.data.map(function(N,L){return{id:"query-".concat(L),text:N,isRegenerating:!1}}))},[v,o]),W.useEffect(function(){var q;if(v!=null&&(q=v.data)!==null&&q!==void 0&&q.data&&Array.isArray(v.data.data)&&!S&&g.length>0){var N=v.data.data,L=g.map(Number);a(function(F){return F.map(function(se,de){var R=L.indexOf(de);return Fi(Fi({},se),{},{text:R>=0&&N[R]?N[R]:se.text,isRegenerating:!1})})})}},[v,S,g]);var A=W.useMemo(function(){return S||o.length===0},[S,o.length]),k=W.useCallback(function(q){var N=q.toString();m(function(L){return L.includes(N)?L.filter(function(F){return F!==N}):[].concat(qR(L),[N])})},[]),P=W.useCallback(function(q,N){a(function(L){return L.map(function(F,se){return se===q?Fi(Fi({},F),{},{text:N}):F})})},[]),$=function(){d(!u),m([])},j=W.useCallback(function(){S||g.length===0||(a(function(q){return q.map(function(N,L){return Fi(Fi({},N),{},{isRegenerating:g.includes(L.toString())})})}),w())},[S,g,w]),Z=W.useCallback(function(q){q.preventDefault(),n&&_({brandId:n,data:o.map(function(N){return N.text})})},[n,o,_]);return y.jsxs("form",{onSubmit:Z,children:[y.jsxs("div",{className:"yst-mb-8",children:[y.jsx(O.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),y.jsx("div",{className:Se("yst-flex yst-gap-3",u?"yst-justify-end":"yst-justify-start"),children:u?y.jsxs(y.Fragment,{children:[y.jsx(O.Button,{size:"small",variant:"secondary",onClick:$,children:"Cancel"}),y.jsxs(O.Button,{size:"small",onClick:j,className:"yst-gap-1.5",isLoading:S,disabled:S||g.length===0,children:[y.jsx(Ec,{}),"Re-generate selected prompts"]})]}):y.jsxs(O.Button,{size:"small",variant:"secondary",onClick:$,className:"yst-gap-1.5",children:[y.jsx(RE,{}),"Select prompts to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:o.length===0?JR.map(function(q,N){return y.jsx("div",{className:Se("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors","yst-bg-white"),children:y.jsx(O.SkeletonLoader,{children:q||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(N))}):o.map(function(q,N){var L=q.isRegenerating?XR:q.text;return y.jsx("div",{className:Se("yst-mb-4"),children:y.jsxs("div",{className:"yst-flex yst-gap-2",children:[u&&y.jsx("div",{className:"yst-flex yst-items-center",children:y.jsx(O.Checkbox,{id:"query-regenerate-".concat(N),name:"query-regenerate-".concat(N),value:N.toString(),checked:g.includes(N.toString()),onChange:function(){return k(N)},disabled:S})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsxs(O.Label,{htmlFor:"query-text-".concat(N),className:"yst-mb-2 yst-block yst-text-sm yst-font-medium yst-text-slate-700",children:["Prompt ",N+1]}),y.jsx(O.TextInput,{id:"query-text-".concat(N),type:"text",value:L,onChange:function(F){q.isRegenerating||P(N,F.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:q.isRegenerating})]})]})},q.id)})}),y.jsx(Cx,{sparkCost:1,buttonText:"Start analysis (~ 5 minutes)",isButtonDisabled:A,isLoading:C})]})};const t9=Object.freeze(Object.defineProperty({__proto__:null,default:e9},Symbol.toStringTag,{value:"Module"}));var Ni=[{label:"Getting started",threshold:20},{label:"Building analysis",threshold:97},{label:"Finalizing",threshold:100}],Tx=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var c=0;c<Ni.length;c++)if(r<=Ni[c].threshold)return Ni[c].label;return Ni[Ni.length-1].label},a=o();return y.jsxs("div",{className:Se("yst-font-medium yst-text-slate-800",s),children:[y.jsxs("span",{className:"yst-text-sm yst-font-medium yst-italic",children:[a,"..."]}),y.jsx(O.ProgressBar,{className:"yst-mt-3",progress:r,min:0,max:100}),y.jsx("div",{className:"yst-mt-3 yst-flex yst-justify-between yst-text-xs",children:Ni.slice(0,-1).map(function(l){return y.jsx("span",{children:y.jsx(pf,{disabled:a!==l.label,children:l.label})},l.label)})})]})};Tx.propTypes={progress:kd.number,className:kd.string};function n9(e,t){return o9(e)||s9(e,t)||i9(e,t)||r9()}function r9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1292
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ex(e,t){if(e){if(typeof e=="string")return Zd(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Zd(e,t):void 0}}function Zd(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function QR(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function YR(e){if(Array.isArray(e))return e}var Ox=5,Ax="Generating...",XR="Re-generating...",JR=["******************************","***********************","*******************************************************","***********************************************","***************************************************************","*******************************************************","*******************************************************","***********************************************"],ZR=Array.from({length:Ox},function(e,t){return{id:"query-".concat(t),text:Ax,isRegenerating:!0}}),e9=function(){var t=zt(),n=t.brandId,r=zr(),i=W.useState(ZR),s=Ru(i,2),o=s[0],a=s[1],l=W.useState(!1),c=Ru(l,2),u=c[0],d=c[1],f=W.useState([]),h=Ru(f,2),g=h[0],m=h[1],p=g.length||Ox,b=Vk(n||"",{quantity:p},{query:{enabled:!!n}}),v=b.data,S=b.isRefetching,w=b.refetch,x=Hk({mutation:{onSuccess:function(N){N!=null&&N.status&&N.status>=200&&N.status<300&&r("/setup/analysis")},onError:function(N){console.error("Error saving queries:",N)}}}),_=x.mutate,C=x.isPending;W.useEffect(function(){var q;v!=null&&(q=v.data)!==null&&q!==void 0&&q.queries&&Array.isArray(v.data.queries)&&o.every(function(N){return N.text===Ax})&&a(v.data.queries.map(function(N,L){return{id:"query-".concat(L),text:N,isRegenerating:!1}}))},[v,o]),W.useEffect(function(){var q;if(v!=null&&(q=v.data)!==null&&q!==void 0&&q.queries&&Array.isArray(v.data.queries)&&!S&&g.length>0){var N=v.data.queries,L=g.map(Number);a(function(F){return F.map(function(se,de){var R=L.indexOf(de);return Fi(Fi({},se),{},{text:R>=0&&N[R]?N[R]:se.text,isRegenerating:!1})})})}},[v,S,g]);var A=W.useMemo(function(){return S||o.length===0},[S,o.length]),k=W.useCallback(function(q){var N=q.toString();m(function(L){return L.includes(N)?L.filter(function(F){return F!==N}):[].concat(qR(L),[N])})},[]),P=W.useCallback(function(q,N){a(function(L){return L.map(function(F,se){return se===q?Fi(Fi({},F),{},{text:N}):F})})},[]),$=function(){d(!u),m([])},j=W.useCallback(function(){S||g.length===0||(a(function(q){return q.map(function(N,L){return Fi(Fi({},N),{},{isRegenerating:g.includes(L.toString())})})}),w())},[S,g,w]),Z=W.useCallback(function(q){q.preventDefault(),n&&_({brandId:n,data:o.map(function(N){return N.text})})},[n,o,_]);return y.jsxs("form",{onSubmit:Z,children:[y.jsxs("div",{className:"yst-mb-8",children:[y.jsx(O.Title,{size:"2",className:"yst-mb-2",children:"Your queries"}),y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx("p",{children:"You can edit your queries or regenerate new ones with AI."}),y.jsx("div",{className:Se("yst-flex yst-gap-3",u?"yst-justify-end":"yst-justify-start"),children:u?y.jsxs(y.Fragment,{children:[y.jsx(O.Button,{size:"small",variant:"secondary",onClick:$,children:"Cancel"}),y.jsxs(O.Button,{size:"small",onClick:j,className:"yst-gap-1.5",isLoading:S,disabled:S||g.length===0,children:[y.jsx(Ec,{}),"Re-generate selected prompts"]})]}):y.jsxs(O.Button,{size:"small",variant:"secondary",onClick:$,className:"yst-gap-1.5",children:[y.jsx(RE,{}),"Select prompts to regenerate"]})})]})]}),y.jsx("div",{className:"yst-mb-8",children:o.length===0?JR.map(function(q,N){return y.jsx("div",{className:Se("yst-mb-4 yst-cursor-pointer yst-rounded yst-border yst-border-slate-300 yst-p-3 yst-transition-colors","yst-bg-white"),children:y.jsx(O.SkeletonLoader,{children:q||"Example placeholder query for demonstration purposes."})},"placeholder-query-".concat(N))}):o.map(function(q,N){var L=q.isRegenerating?XR:q.text;return y.jsx("div",{className:Se("yst-mb-4"),children:y.jsxs("div",{className:"yst-flex yst-gap-2",children:[u&&y.jsx("div",{className:"yst-flex yst-items-center",children:y.jsx(O.Checkbox,{id:"query-regenerate-".concat(N),name:"query-regenerate-".concat(N),value:N.toString(),checked:g.includes(N.toString()),onChange:function(){return k(N)},disabled:S})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsxs(O.Label,{htmlFor:"query-text-".concat(N),className:"yst-mb-2 yst-block yst-text-sm yst-font-medium yst-text-slate-700",children:["Prompt ",N+1]}),y.jsx(O.TextInput,{id:"query-text-".concat(N),type:"text",value:L,onChange:function(F){q.isRegenerating||P(N,F.target.value)},placeholder:"Enter your query...",className:"yst-w-full",disabled:q.isRegenerating})]})]})},q.id)})}),y.jsx(Cx,{sparkCost:1,buttonText:"Start analysis (~ 5 minutes)",isButtonDisabled:A,isLoading:C})]})};const t9=Object.freeze(Object.defineProperty({__proto__:null,default:e9},Symbol.toStringTag,{value:"Module"}));var Ni=[{label:"Getting started",threshold:20},{label:"Building analysis",threshold:97},{label:"Finalizing",threshold:100}],Tx=function(t){var n=t.progress,r=n===void 0?0:n,i=t.className,s=i===void 0?"":i,o=function(){for(var c=0;c<Ni.length;c++)if(r<=Ni[c].threshold)return Ni[c].label;return Ni[Ni.length-1].label},a=o();return y.jsxs("div",{className:Se("yst-font-medium yst-text-slate-800",s),children:[y.jsxs("span",{className:"yst-text-sm yst-font-medium yst-italic",children:[a,"..."]}),y.jsx(O.ProgressBar,{className:"yst-mt-3",progress:r,min:0,max:100}),y.jsx("div",{className:"yst-mt-3 yst-flex yst-justify-between yst-text-xs",children:Ni.slice(0,-1).map(function(l){return y.jsx("span",{children:y.jsx(pf,{disabled:a!==l.label,children:l.label})},l.label)})})]})};Tx.propTypes={progress:kd.number,className:kd.string};function n9(e,t){return o9(e)||s9(e,t)||i9(e,t)||r9()}function r9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1293
1293
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i9(e,t){if(e){if(typeof e=="string")return _p(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_p(e,t):void 0}}function _p(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function s9(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,i=u}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}function o9(e){if(Array.isArray(e))return e}var a9=function(){var t=zt(),n=t.brandId,r=W.useState(10),i=n9(r,2),s=i[0],o=i[1],a=[{title:"SEO Fundamentals: A Complete Guide",url:"https://yoast.com/seo-fundamentals/",image:"https://images.unsplash.com/photo-1460925895917-afdab827c52f?w=400&h=200&fit=crop"},{title:"Content Marketing Best Practices",url:"https://yoast.com/content-marketing/",image:"https://images.unsplash.com/photo-1552664730-d307ca884978?w=400&h=200&fit=crop"}],l=_b(n,{query:{enabled:!!n}}),c=l.data,u=l.isFetched,d=dk({mutation:{onSuccess:function(w){console.log("Analysis started successfully",w),o(33)},onError:function(w){console.error("Error starting analysis:",w)}}}),f=d.mutate,h=Rk(n,{query:{enabled:!!n,select:function(w){var x=w.data;return x}}}),g=h.data,m=zn(n,"latest",{query:{enabled:s>=60&&!!n&&u,select:function(w){var x,_=w.data;return(_==null||(x=_.data)===null||x===void 0||(x=x.mentions)===null||x===void 0?void 0:x.list)||[]}}}),p=m.data;W.useEffect(function(){if(n&&c&&u){var S;(c==null||(S=c.data)===null||S===void 0||(S=S.data)===null||S===void 0?void 0:S.length)===0?(f({brandId:n,data:{}}),o(66)):o(100)}},[c,n,u,f]);var b="/brand-list";console.log("brandData",g);var v=[];return y.jsxs("div",{className:"yst-space-y-12",children:[y.jsxs(O.Paper,{children:[y.jsxs(O.Paper.Header,{children:[y.jsx(O.Title,{size:"1",className:"yst-mb-2",children:"Analyzing..."}),y.jsx("p",{children:"This process should take around 5 minutes."})]}),y.jsxs(O.Paper.Content,{className:"yst-space-y-8",children:[y.jsx(Tx,{progress:s}),y.jsx(Oa,{}),y.jsx("div",{className:"yst-space-y-4",children:v.map(function(S){var w,x=S.query,_=S.id,C=p==null||(w=p.find(function(A){return A.queryId===_}))===null||w===void 0?void 0:w.found;return y.jsxs("div",{className:Se("yst-flex yst-items-center yst-justify-between yst-gap-2"),children:[C===!0?y.jsx(Mb,{className:"yst-h-5 yst-w-5 yst-text-green-600"}):C===!1?y.jsx(jb,{className:"yst-h-5 yst-w-5 yst-text-red-600"}):y.jsx(O.Spinner,{}),y.jsx("span",{className:"yst-flex-1 yst-text-sm",children:x}),y.jsx(O.Badge,{className:"yst-ml-4",children:C?"Found":"Not found"})]},_)})})]}),y.jsx(O.Paper.Content,{className:"yst-flex yst-justify-end yst-gap-4 yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",children:y.jsx(O.Button,{as:Hr,to:b,children:"Continue →"})})]}),y.jsxs("div",{className:"yst-space-y-6",children:[y.jsx(O.Title,{size:"2",children:"Want to read while you wait? Based on your input, we think you'll like these articles:"}),y.jsx("div",{className:"yst-flex yst-flex-col yst-gap-6 md:yst-flex-row",children:a.map(function(S,w){return y.jsxs(O.Card,{className:"yst-overflow-hidden yst-shadow-md md:yst-w-1/3",children:[S.image&&y.jsx(O.Card.Header,{className:"min-h-[12rem] bg-cover bg-center bg-no-repeat",style:{backgroundImage:"url(".concat(S.image,")")},children:y.jsx("span",{className:"yst-hidden",children:"Article preview image"})}),y.jsxs(O.Card.Content,{className:"yst-mb-2",children:[y.jsx(O.Title,{size:"2",className:"yst-mb-4",children:S.title}),y.jsx("p",{className:"yst-text-right",children:y.jsx(O.Link,{href:S.url,className:"yst-text-right",target:"_blank",rel:"noopener noreferrer",children:y.jsx("span",{children:"Read article »"})})})]})]},w)})})]})]})};const l9=Object.freeze(Object.defineProperty({__proto__:null,default:a9},Symbol.toStringTag,{value:"Module"}));exports.AIInsightsClient=k$;exports.setApiBaseUrl=J_;
@@ -31503,7 +31503,7 @@ var p8 = function() {
31503
31503
  }), a = od(o, 2), l = a[0], c = a[1], u = Le(K0), d = od(u, 2), f = d[0], h = d[1], g = fE({
31504
31504
  mutation: {
31505
31505
  onSuccess: function(w) {
31506
- var _, C = (_ = w.data) === null || _ === void 0 || (_ = _.data) === null || _ === void 0 ? void 0 : _.id;
31506
+ var _, C = (_ = w.data) === null || _ === void 0 ? void 0 : _.id;
31507
31507
  console.log("Brand created successfully", C), s.invalidateQueries({
31508
31508
  queryKey: [nv(), qf()]
31509
31509
  }), i.setBrandId(C), w != null && w.status && w.status >= 200 && w.status < 300 && C && (i.setBrandId(C), r("/setup/queries"));
@@ -31757,9 +31757,9 @@ var ix = 5, sx = "Generating...", P8 = "Re-generating...", T8 = ["**************
31757
31757
  }), _ = w.mutate, C = w.isPending;
31758
31758
  mt(function() {
31759
31759
  var j;
31760
- v != null && (j = v.data) !== null && j !== void 0 && j.data && Array.isArray(v.data.data) && o.every(function(B) {
31760
+ v != null && (j = v.data) !== null && j !== void 0 && j.queries && Array.isArray(v.data.queries) && o.every(function(B) {
31761
31761
  return B.text === sx;
31762
- }) && a(v.data.data.map(function(B, I) {
31762
+ }) && a(v.data.queries.map(function(B, I) {
31763
31763
  return {
31764
31764
  id: "query-".concat(I),
31765
31765
  text: B,
@@ -31768,8 +31768,8 @@ var ix = 5, sx = "Generating...", P8 = "Re-generating...", T8 = ["**************
31768
31768
  }));
31769
31769
  }, [v, o]), mt(function() {
31770
31770
  var j;
31771
- if (v != null && (j = v.data) !== null && j !== void 0 && j.data && Array.isArray(v.data.data) && !S && g.length > 0) {
31772
- var B = v.data.data, I = g.map(Number);
31771
+ if (v != null && (j = v.data) !== null && j !== void 0 && j.queries && Array.isArray(v.data.queries) && !S && g.length > 0) {
31772
+ var B = v.data.queries, I = g.map(Number);
31773
31773
  a(function(N) {
31774
31774
  return N.map(function(ie, ue) {
31775
31775
  var F = I.indexOf(ue);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yoast/ai-insights-client",
3
3
  "private": false,
4
- "version": "1.1.0",
4
+ "version": "1.1.1",
5
5
  "type": "module",
6
6
  "description": "A React component library for AI-powered brand analysis and insights",
7
7
  "keywords": [