@yoast/ai-insights-client 1.2.6 → 1.2.7
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.
|
@@ -21,7 +21,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
21
21
|
http://jedwatson.github.io/classnames
|
|
22
22
|
*/var pg;function cO(){return pg||(pg=1,function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n})()}(du)),du.exports}var uO=cO();const Se=Wp(uO);var Sd;function dO(e){var t=Sd;Sd=e,t!==e&&typeof window!="undefined"&&window.dispatchEvent(new CustomEvent("api-config-changed",{detail:{previousUrl:t,newUrl:e}}))}function Bv(){return Sd||void 0||"http://localhost:8000"}function zo(e){"@babel/helpers - typeof";return zo=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},zo(e)}function Ho(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n=typeof Symbol=="function"?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(h,g,m,p){var v=g&&g.prototype instanceof a?g:a,b=Object.create(v.prototype);return Ht(b,"_invoke",function(w,S,x){var P,C,O,_=0,k=x||[],$=!1,j={p:0,n:0,v:e,a:Q,f:Q.bind(e,4),d:function(L,D){return P=L,C=0,O=e,j.n=D,o}};function Q(I,L){for(C=I,O=L,t=0;!$&&_&&!D&&t<k.length;t++){var D,F=k[t],oe=j.p,ge=F[2];I>3?(D=ge===L)&&(O=F[(C=F[4])?5:(C=3,3)],F[4]=F[5]=e):F[0]<=oe&&((D=I<2&&oe<F[1])?(C=0,j.v=L,j.n=F[1]):oe<ge&&(D=I<3||F[0]>L||L>ge)&&(F[4]=I,F[5]=L,j.n=ge,C=0))}if(D||I>1)return o;throw $=!0,L}return function(I,L,D){if(_>1)throw TypeError("Generator is already running");for($&&L===1&&Q(L,D),C=L,O=D;(t=C<2?e:O)||!$;){P||(C?C<3?(C>1&&(j.n=-1),Q(C,O)):j.n=O:j.v=O);try{if(_=2,P){if(C||(I="next"),t=P[I]){if(!(t=t.call(P,O)))throw TypeError("iterator result is not an object");if(!t.done)return t;O=t.value,C<2&&(C=0)}else C===1&&(t=P.return)&&t.call(P),C<2&&(O=TypeError("The iterator does not provide a '"+I+"' method"),C=1);P=e}else if((t=($=j.n<0)?O:w.call(S,j))!==o)break}catch(F){P=e,C=1,O=F}finally{_=1}}return{value:t,done:$}}}(h,m,p),!0),b}var o={};function a(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Ht(t={},r,function(){return this}),t),d=c.prototype=a.prototype=Object.create(u);function f(h){return Object.setPrototypeOf?Object.setPrototypeOf(h,c):(h.__proto__=c,Ht(h,i,"GeneratorFunction")),h.prototype=Object.create(d),h}return l.prototype=c,Ht(d,"constructor",c),Ht(c,"constructor",l),l.displayName="GeneratorFunction",Ht(c,i,"GeneratorFunction"),Ht(d),Ht(d,i,"Generator"),Ht(d,r,function(){return this}),Ht(d,"toString",function(){return"[object Generator]"}),(Ho=function(){return{w:s,m:f}})()}function Ht(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(s){i=0}Ht=function(o,a,l,c){if(a)i?i(o,a,{value:l,enumerable:!c,configurable:!c,writable:!c}):o[a]=l;else{var u=function(f,h){Ht(o,f,function(g){return this._invoke(f,h,g)})};u("next",0),u("throw",1),u("return",2)}},Ht(e,t,n,r)}function vg(e,t,n,r,i,s,o){try{var a=e[s](o),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function qv(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var s=e.apply(t,n);function o(l){vg(s,r,i,o,a,"next",l)}function a(l){vg(s,r,i,o,a,"throw",l)}o(void 0)})}}function bg(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 Ln(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bg(Object(n),!0).forEach(function(r){fO(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fO(e,t,n){return(t=hO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hO(e){var t=gO(e,"string");return zo(t)=="symbol"?t:t+""}function gO(e,t){if(zo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(zo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yO(e,t){return bO(e)||vO(e,t)||pO(e,t)||mO()}function mO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
23
23
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pO(e,t){if(e){if(typeof e=="string")return xg(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)?xg(e,t):void 0}}function xg(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 vO(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 bO(e){if(Array.isArray(e))return e}function xO(e){var t;if(typeof document!="undefined"){var n="; ".concat(document.cookie),r=n.split("; ".concat(e,"="));if(r.length===2)return(t=r.pop())===null||t===void 0?void 0:t.split(";").shift()}}var zv=function(){var e=Ze.create({withCredentials:!0,baseURL:"".concat(Bv(),"/api/v1")});return e.interceptors.request.use(function(t){var n=xO("XSRF-TOKEN"),r=n?decodeURIComponent(n):void 0;return r&&(t.headers["X-XSRF-TOKEN"]=r),t}),e}();function wO(e){zv.defaults.baseURL="".concat(e,"/api/v1")}var Cd=new Set,ct={refreshing:!1,ready:!1},Qa,_d="yst-insights-token-exp",Ko=void 0,Hv="env";function SO(e){e&&e.trim()&&(Ko=e.trim(),Hv="prop")}function CO(){return{token:Ko,source:Hv}}function Ql(){Cd.forEach(function(e){return e(ct)})}function _O(e){return Cd.add(e),e(ct),function(){Cd.delete(e)}}function Ya(){return ct}function kO(e){if(e)try{var t=e.split("."),n=yO(t,2),r=n[1],i=atob(r.replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(decodeURIComponent(escape(i)))}catch(s){return}}function OO(){Qa&&window.clearTimeout(Qa);var e=ct.expiresAt;if(e){var t=Date.now(),n=2*60*1e3,r=e-t-n,i=Math.max(r,5e3);r<=0?Qa=window.setTimeout(function(){return void Uo()},1e3):Qa=window.setTimeout(function(){return void Uo()},i)}}function Yl(e,t){e?localStorage.setItem(Wo,e):(localStorage.removeItem(Wo),sessionStorage.removeItem(_d));var n=kO(e),r=n!=null&&n.exp?n.exp*1e3:void 0,i=t||r;i&&sessionStorage.setItem(_d,String(i)),ct=Ln(Ln({},ct),{},{token:e,decoded:n,expiresAt:i}),e?Ms.defaults.headers.common.Authorization="Bearer ".concat(e):delete Ms.defaults.headers.common.Authorization,OO(),Ql()}function Uo(){return kd.apply(this,arguments)}function kd(){return kd=qv(Ho().m(function e(){var t,n,r,i,s,o,a,l,c;return Ho().w(function(u){for(;;)switch(u.p=u.n){case 0:if(!ct.refreshing){u.n=1;break}return u.a(2,ct.token);case 1:if(ct=Ln(Ln({},ct),{},{refreshing:!0,error:void 0}),Ql(),u.p=2,Ko){u.n=3;break}throw new Error("Missing MyYoast access token (env or prop)");case 3:return u.n=4,zv.post("/users/getToken",{},{headers:{Authorization:"Bearer ".concat(Ko)}});case 4:if(n=u.v,r=n.data,i=r.plainTextToken,i){u.n=5;break}throw new Error("Token endpoint missing plainTextToken field");case 5:return o=(t=r.accessToken)===null||t===void 0?void 0:t.expires_at,o&&(typeof o=="number"?s=o>1e10?o:o*1e3:typeof o=="string"&&(a=Date.parse(o),Number.isNaN(a)||(s=a))),Yl(i,s),u.a(2,i);case 6:return u.p=6,c=u.v,l=c instanceof Error?c:new Error("Unknown token error"),ct=Ln(Ln({},ct),{},{error:l}),Yl(void 0),u.a(2,void 0);case 7:return u.p=7,ct=Ln(Ln({},ct),{},{refreshing:!1,ready:!0}),Ql(),u.f(7);case 8:return u.a(2)}},e,null,[[2,6,7,8]])})),kd.apply(this,arguments)}function EO(){return Od.apply(this,arguments)}function Od(){return Od=qv(Ho().m(function e(){var t,n,r,i;return Ho().w(function(s){for(;;)switch(s.n){case 0:if(t=localStorage.getItem(Wo),!t){s.n=1;break}return n=sessionStorage.getItem(_d),r=n?Number(n):void 0,Yl(t,r&&!Number.isNaN(r)?r:void 0),ct=Ln(Ln({},ct),{},{ready:!0}),Ql(),i=ct.expiresAt?ct.expiresAt-Date.now():void 0,(!i||i<=2*60*1e3)&&Uo(),s.a(2);case 1:return s.n=2,Uo();case 2:return s.a(2)}},e)})),Od.apply(this,arguments)}window.addEventListener("storage",function(e){e.key===Wo&&e.newValue!==ct.token&&Yl(e.newValue||void 0)});function Xa(e,t){return MO(e)||TO(e,t)||PO(e,t)||AO()}function AO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
24
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PO(e,t){if(e){if(typeof e=="string")return wg(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)?wg(e,t):void 0}}function wg(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 TO(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 MO(e){if(Array.isArray(e))return e}var Wo="yst-insights-token",$O=function(){var t=K.useState(Ya().ready),n=Xa(t,2),r=n[0],i=n[1],s=K.useState(Ya().error),o=Xa(s,2),a=o[0],l=o[1],c=K.useState(Ya().expiresAt),u=Xa(c,2),d=u[0],f=u[1],h=K.useState(Ya().refreshing),g=Xa(h,2),m=g[0],p=g[1],v=CO(),b=v.source;K.useEffect(function(){var x=_O(function(P){i(P.ready),l(P.error),f(P.expiresAt),p(P.refreshing)});return EO(),function(){return x()}},[]);var w=d?Math.max(0,d-Date.now()):void 0,S=w?Math.floor(w/6e4):void 0;return r?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"yst-space-y-2 yst-p-4",children:[a&&y.jsxs(E.Alert,{appearance:"danger",children:["Auth error: ",a.message," ",y.jsx("button",{type:"button",onClick:function(){return Uo()},className:"yst-text-blue-600 hover:yst-underline",children:"Retry"})]}),!a&&y.jsxs(E.Alert,{appearance:"success",children:["Session active",S!==void 0&&" – expires in ~".concat(S,"m")," ","(source: ",b,")",m&&y.jsx(E.Spinner,{className:"yst-ml-2 yst-inline"})]})]}),y.jsx(pc,{})]}):y.jsx("div",{className:"yst-p-4",children:y.jsxs(E.Alert,{appearance:"info",className:"yst-mb-4",children:[y.jsx(E.Spinner,{className:"yst-mr-2 yst-inline"})," Initializing secure session..."]})})},jO=function(){localStorage.removeItem(Wo),delete Ze.defaults.headers.common.Authorization},DO=function(){var t=ur(),n=wk({mutation:{onSettled:function(){jO(),t("/"),window.location.reload()}}});return n};function LO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"}))}const RO=M.forwardRef(LO);function IO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"}))}const FO=M.forwardRef(IO);function NO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const BO=M.forwardRef(NO);function qO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"}))}const zO=M.forwardRef(qO);function HO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))}const KO=M.forwardRef(HO);function UO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}const WO=M.forwardRef(UO);function VO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"}))}const GO=M.forwardRef(VO);function QO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"}))}const YO=M.forwardRef(QO);function XO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))}const JO=M.forwardRef(XO);function ZO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))}const eE=M.forwardRef(ZO);function tE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"}))}const nE=M.forwardRef(tE);function rE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}const iE=M.forwardRef(rE);function sE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))}const Ed=M.forwardRef(sE);function oE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))}const aE=M.forwardRef(oE);function lE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"}))}const cE=M.forwardRef(lE);function uE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))}const dE=M.forwardRef(uE);function fE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"}))}const Kv=M.forwardRef(fE);function hE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))}const xf=M.forwardRef(hE);function gE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const yE=M.forwardRef(gE);var mE=function(){return[{label:"Brand analysis",href:"/",Icon:cE,isActive:function(n){return n.startsWith("/setup")||n==="/"},showInMenu:!0},{label:"Settings",href:"/settings",Icon:WO,isActive:function(n){return n.startsWith("/settings")},showInMenu:!0},{label:"Query history",href:"/query-history",Icon:RO,isActive:function(n){return n.startsWith("/query-history")},showInMenu:!0}]},Sg;function pE(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Cg=function(t){var n=t.className,r=dn(),i=r.pathname,s=mE();return y.jsx("div",{className:Se("yst-flex yst-flex-col yst-gap-10",n),children:y.jsx(E.SidebarNavigation.Sidebar,{children:y.jsx(E.SidebarNavigation.List,{className:"yst-space-y-2",children:s.filter(function(o){return o.showInMenu!==!1}).map(function(o){var a=o.isActive?o.isActive(i):!1;return y.jsx(E.SidebarNavigation.SubmenuItem,{className:Se("yst-flex yst-gap-x-3",{"yst-sidebar-navigation__item--active":a}),href:o.href,to:o.href,as:Kr,label:y.jsxs(y.Fragment,{children:[y.jsx(o.Icon,{className:Se(Sg||(Sg=pE(["yst-sidebar-navigation__icon yst-h-6 yst-w-6"])))}),o.label]})},o.label)})})})})};const vE="data:image/svg+xml,%3csvg%20width='96'%20height='42'%20viewBox='0%200%2096%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M31.6517%2010.1419C24.3001%2010.1419%2021.3588%2015.0112%2021.3588%2020.4319C21.3588%2025.8525%2024.2564%2030.9356%2031.6517%2030.9356C39.0469%2030.9356%2041.9256%2025.8375%2041.9123%2020.7619C41.8952%2014.58%2038.7258%2010.14%2031.6517%2010.14V10.1419ZM27.1978%2020.7394C27.3764%2013.485%2033.0235%2013.4925%2034.9104%2016.0912C36.63%2018.4594%2036.9815%2026.5556%2031.6536%2026.4975C29.1986%2026.4712%2027.2719%2024.8344%2027.1997%2020.7394H27.1978ZM91.2791%2025.905V15.3956H95.0869V10.8337H91.2791V5.32312H85.3982V10.8337H82.415V15.3956H85.3982V25.3087C85.3982%2030.9431%2089.3789%2034.2919%2093.5801%2034.9856L95.3358%2030.3206C92.8866%2030.015%2091.3019%2028.2075%2091.2791%2025.9069V25.905ZM61.6088%2024.2419V16.3425C61.6088%2016.0537%2061.5898%2015.7837%2061.5613%2015.5194C61.0521%209.13687%2051.8669%209.15%2044.7529%2011.6006L46.8089%2015.6844C51.4413%2013.5131%2054.2136%2014.0737%2055.1826%2015.1425C55.2073%2015.1706%2055.232%2015.1969%2055.2548%2015.2269C55.2567%2015.2306%2055.2605%2015.2344%2055.2624%2015.2381C55.7565%2015.8962%2055.6387%2016.935%2055.6387%2017.7525C49.5849%2017.7525%2043.1416%2018.5456%2043.1416%2025.0969C43.1416%2030.0769%2049.4652%2033.2812%2056.0738%2028.5337L57.0542%2030.8681H62.7185C62.2131%2028.1269%2061.6069%2025.7794%2061.6069%2024.2419H61.6088ZM55.6843%2024.1987C51.0271%2029.3419%2046.7613%2024.5006%2051.1297%2022.3894C52.4161%2021.9562%2054.1604%2021.9375%2055.6843%2021.9375V24.1987ZM70.6477%2015.9169C70.6477%2013.9706%2073.8037%2013.0612%2078.7839%2015.3037L80.5054%2011.1769C73.8037%209.17812%2064.6509%208.99812%2064.592%2015.9169C64.5635%2019.2319%2066.7182%2021.015%2069.8211%2022.1531C71.9701%2022.9406%2075.073%2023.3494%2075.0635%2025.0387C75.0521%2027.2456%2070.241%2027.5831%2065.8632%2024.615L64.0942%2029.0906C70.0662%2032.0231%2081.1705%2032.1056%2081.1116%2024.7556C81.0527%2017.4881%2070.6457%2018.735%2070.6457%2015.9169H70.6477ZM18.8734%200.1875L10.3495%2023.5519L6.26617%2010.935H0.195312L6.99391%2028.1644C7.57346%2029.6312%207.57346%2031.2594%206.99391%2032.7262C6.23387%2034.6481%204.97029%2036.2944%201.88831%2036.7031V41.8106C7.88886%2041.8106%2011.1324%2038.1712%2014.0262%2030.1931L25.368%200.1875H18.8734Z'%20fill='%23A61E69'/%3e%3c/svg%3e";var bE=function(t){var n=t.className,r=dn(),i=r.pathname,s=Iv({query:{select:function(h){var g=h.data;return g==null?void 0:g.data}}}),o=s.data,a=s.isLoading,l=DO(),c=l.mutate,u=l.isPending,d=function(h){if(h.preventDefault(),!u)return c()};return y.jsxs("div",{className:Se("ystaii-sidemenu"),children:[y.jsx("div",{className:"ystaii-mobile-menu lg:yst-hidden",children:y.jsx(E.SidebarNavigation,{activePath:i,children:y.jsx(E.SidebarNavigation.Mobile,{closeButtonScreenReaderText:"Close sidebar",openButtonScreenReaderText:"Open sidebar",children:y.jsx(Cg,{})})})}),y.jsxs("div",{className:Se("ystaii-menuHeader","yst-mb-6 yst-mt-10 yst-flex yst-flex-row yst-items-center yst-justify-between yst-px-4","lg:yst-flex-col lg:yst-items-start lg:yst-space-y-12"),children:[y.jsx(E.Title,{children:y.jsx(Kr,{className:Se("yst-outline-none"),to:"/",children:y.jsx("img",{src:vE,alt:"Yoast",className:"yst-inline-block yst-h-8"})})}),y.jsxs("div",{className:Se("ystaii-userInfoContainer","yst-flex yst-flex-col"),children:[y.jsx("div",{children:y.jsx("b",{children:(o==null?void 0:o.displayName)||y.jsx(E.SkeletonLoader,{children:"Display name"})})}),y.jsx("div",{children:(o==null?void 0:o.email)||y.jsx(E.SkeletonLoader,{children:"loading-email@address.com"})}),y.jsx("div",{children:y.jsx(E.Link,{variant:"primary",className:"yst-no-underline",onClick:d,children:a?y.jsxs(E.SkeletonLoader,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"→"})]}):u?y.jsx(y.Fragment,{children:"Signing out..."}):y.jsxs(y.Fragment,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"→"})]})})})]})]}),y.jsx("div",{className:Se("ystaii-desktopMenu","yst-hidden","lg:yst-mb-0 lg:yst-block lg:yst-w-full lg:yst-shrink-0"),children:y.jsx(E.SidebarNavigation,{activePath:i,children:y.jsx(Cg,{className:n})})})]})},Uv=Nx.a.withConfig({displayName:"SkipLink",componentId:"sc-40h6pc-0"})(["position:absolute;top:-1000em;left:10px;z-index:100000;display:block;height:48px;min-width:150px;padding:0 15px;font-size:14px;line-height:48px;background:var(--bg-color-white);border-radius:3px;box-shadow:0px 2px 2px 2px rgba(0,0,0,0.1);text-decoration:underline;text-align:center;outline:none;&:focus{top:10px;color:var(--text-color-blue);}"]);Uv.defaultProps={href:"#content"};function fu(e){var t=e.children,n=e.disable,r=n===void 0?!1:n,i=e.hideNav,s=i===void 0?!1:i,o=e.DebugInfo;return r?t:y.jsxs("div",{className:Se("ystaii-layout","yst-block","lg:yst-flex lg:yst-min-h-full lg:yst-overflow-visible"),children:[y.jsx(Uv,{children:"Skip to main content"}),!s&&y.jsxs("div",{className:Se("ystaii-sidebar","yst-overflow-hidden","lg:yst-flex-grow-1 lg:yst-max-w-[300px] lg:yst-flex-shrink-0 lg:yst-basis-[300px] lg:yst-overflow-visible lg:yst-pl-4"),children:[y.jsx(bE,{}),o&&y.jsx(o,{})]}),y.jsx("main",{className:Se("ystaii-main","yst-mx-4 yst-my-0 yst-flex yst-min-w-0 yst-shrink yst-grow yst-basis-auto yst-px-0 yst-py-6","lg:yst-ml-12 lg:yst-mr-6"),children:y.jsx("div",{className:Se("ystaii-main-content","yst-mx-auto yst-flex yst-flex-col yst-gap-8","lg:yst-w-full lg:yst-flex-row"),children:y.jsx("div",{className:"yst-layout-root yst-mx-auto yst-w-full yst-max-w-[1200px] yst-flex-1",children:t})})})]})}function jc(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(E.Paper.Header,{children:[r&&y.jsx(E.Title,{className:Se({"yst-mb-3":n||t}),children:r}),n&&(typeof n=="string"?y.jsx("p",{children:n}):n),t]})}var xE={HOME:"/"},wE=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo,a=dn(),l=ur(),c={disable:s,hideNav:r},u=Wr(),d=u.brandId,f=$c(),h=f.setBrandId,g=Pa({query:{refetchOnReconnect:!1,refetchOnWindowFocus:!1,select:function(O){var _;return O==null||(_=O.data)===null||_===void 0?void 0:_.brands}}}),m=g.data,p=g.isLoading,v=g.error,b=g.refetch,w=K.useRef(!1),S=K.useMemo(function(){return m==null?void 0:m.find(function(C){return C.id===d})},[m,d]);K.useEffect(function(){var C;if(!(m===void 0||d)){var O=(C=m[0])===null||C===void 0?void 0:C.id;O&&h(O)}},[m,d,h,l,a.pathname]),K.useEffect(function(){!d||w.current||(w.current=!0)},[S,d,l,a.pathname,m]);var x=K.useCallback(function(){b()},[b]),P=["Loading your brands...","Preparing your dashboard...","Checking analysis status...","Almost ready!"];return a.pathname!==xE.HOME&&p?y.jsx(fu,{...c,children:y.jsxs(E.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(jc,{title:y.jsx(E.SkeletonLoader,{className:"yst-h-12 yst-w-36"}),description:y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-3/4"})}),y.jsx(E.Paper.Content,{children:y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-start yst-justify-center",children:y.jsx("div",{className:"yst-w-full yst-space-y-4",children:y.jsx("div",{className:"yst-space-y-4",children:P.map(function(C,O){return y.jsx(E.SkeletonLoader,{children:C},O)})})})})})]})}):v?y.jsx(fu,{...c,children:y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-space-y-4 yst-text-center",children:[y.jsx("div",{className:"yst-mb-4 yst-text-6xl yst-text-red-600",children:"⚠️"}),y.jsx("h2",{className:"yst-text-xl yst-font-semibold yst-text-slate-900",children:"Something went wrong"}),y.jsx("p",{className:"yst-text-slate-600",children:"We couldn't load your Brand Analysis. Please try again shortly."}),y.jsx(E.Button,{variant:"primary",onClick:x,children:"Retry"})]})})}):y.jsx(fu,{DebugInfo:o,...c,children:y.jsx(pc,{})})};function SE(){K.useEffect(function(){var e=function(){var r=Bv();Ze.get("".concat(r,"/sanctum/csrf-cookie"),{withCredentials:!0}).catch(function(i){console.error("Failed to fetch CSRF cookie:",i)})};e();var t=function(){e()};return window.addEventListener("api-config-changed",t),function(){window.removeEventListener("api-config-changed",t)}},[])}function CE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M14.707 12.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l2.293-2.293a1 1 0 011.414 0z",clipRule:"evenodd"}))}const _E=M.forwardRef(CE);function kE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))}const OE=M.forwardRef(kE);function EE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M5.293 7.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L6.707 7.707a1 1 0 01-1.414 0z",clipRule:"evenodd"}))}const AE=M.forwardRef(EE);function PE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))}const Wv=M.forwardRef(PE);function TE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),M.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))}const ME=M.forwardRef(TE);function $E(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",clipRule:"evenodd"}))}const jE=M.forwardRef($E);function Vo(e){"@babel/helpers - typeof";return Vo=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},Vo(e)}var DE=["children","as","startColor","endColor","angle","disabled","style","className"];function _g(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 kg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_g(Object(n),!0).forEach(function(r){LE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_g(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LE(e,t,n){return(t=RE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RE(e){var t=IE(e,"string");return Vo(t)=="symbol"?t:t+""}function IE(e,t){if(Vo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FE(e,t){if(e==null)return{};var n,r,i=NE(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function NE(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var wf=function(t){var n=t.children,r=t.as,i=r===void 0?"span":r,s=t.startColor,o=s===void 0?"#A61E69":s,a=t.endColor,l=a===void 0?"#6366F1":a,c=t.angle,u=c===void 0?102:c,d=t.disabled,f=d===void 0?!1:d,h=t.style,g=h===void 0?{}:h,m=t.className,p=m===void 0?"":m,v=FE(t,DE),b=kg(f?{display:"inline-block"}:{background:"linear-gradient(".concat(u,"deg, ").concat(o,", ").concat(l,")"),WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",display:"inline-block"},g);return y.jsx(i,{className:p,style:b,...v,children:n})};function Sf(e){var t=e.children,n=e.nestedInPaperContent,r=n===void 0?!1:n,i=e.className;return y.jsx("div",{className:Se("yst-mt-8 yst-flex yst-items-center yst-justify-end yst-gap-6 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",{"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem]":r},i),children:t})}var BE=function(){var t=ur();return y.jsx("form",{onSubmit:function(){return t("/setup")},children:y.jsxs(E.Paper,{className:"yst-mx-auto yst-flex yst-max-w-2xl",children:[y.jsx(E.Paper.Header,{children:y.jsxs(E.Title,{size:"1",children:["Welcome to ",y.jsx(wf,{children:"Yoast AI Brand Insights"}),"!"]})}),y.jsxs(E.Paper.Content,{className:"yst-space-y-8",children:[y.jsxs("div",{className:"yst-space-y-4 *:yst-text-tiny",children:[y.jsx("p",{children:"See how your brand is represented in AI answers"}),y.jsxs("p",{children:[y.jsx("b",{className:"yst-font-medium yst-text-slate-800",children:"Yoast AI Brand Insights"})," ","shows how often your brand appears, how it's described, and how it compares to competitors in tools like ChatGPT and Perplexity."]}),y.jsx("p",{children:"It only takes three simple steps to get your brand insights:"})]}),y.jsx("div",{className:"yst-flex yst-flex-col yst-items-stretch yst-justify-stretch yst-gap-4 yst-pb-8",children:[{title:"1. ADD BRAND INFO",description:"Tell us about your brand and where it's active so we can customize your analysis."},{title:"2. REVIEW QUERIES",description:"Edit or approve the queries generated from your input."},{title:"3. RUN ANALYSIS",description:"Run your queries through relevant AI models to see how your brand shows up."}].map(function(n,r,i){return y.jsxs("div",{className:"yst-relative yst-flex yst-flex-col yst-items-stretch",children:[y.jsxs("div",{className:"yst-flex yst-flex-row yst-items-center yst-justify-stretch yst-gap-6",children:[y.jsx(E.Stepper.Step,{isActive:!0,isComplete:!1}),y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-gap-2 yst-rounded yst-border yst-border-slate-200 yst-p-6",children:[y.jsx(E.Title,{size:"3",className:"yst-font-semibold yst-uppercase",children:n.title}),y.jsx("p",{children:n.description})]})]}),r<i.length-1&&y.jsx("div",{className:"yst-absolute yst-left-[-2px] yst-top-1/2 yst-my-0 yst-ml-[13px] yst-h-full yst-border-l-2 yst-border-l-primary-600"})]},n.title)})})]}),y.jsx(Sf,{className:"yst-justify-end",children:y.jsxs(E.Button,{variant:"primary",onClick:function(){return t("/setup")},className:"yst-gap-1.5",children:["Start your first analysis ",y.jsx(OE,{})]})})]})})};function Vv(e){return typeof e!="number"?{}:{"yst-text-green-600":e>0,"yst-text-red-600":e<0,"yst-text-gray-400":e===0}}function Ta(e){var t=e.score,n=e.total,r=e.suffix,i=e.isLoading,s=i===void 0?!1:i,o=e.className,a=e.hideTotal,l=a===void 0?!1:a,c=e.delta,u=e.deltaFormat,d=u===void 0?"absolute":u,f=e.deltaSuffix,h=e.scoreFormat,g=h===void 0?"absolute":h;return y.jsxs("div",{className:Se(o,"yst-font-medium"),children:[y.jsxs("span",{className:"yst-mr-1 yst-text-xl yst-font-bold yst-text-slate-900",children:[s||t===void 0||t===null?"—":t,!s&&t!==void 0&&t!==null&&g==="percentage"?"%":""]}),!l&&n&&n!==0&&n!=="0"&&y.jsxs("span",{className:"yst-text-slate-500",children:["/ ",s?"—":n]}),r&&y.jsxs("span",{className:"yst-text-slate-500",children:[" ",r]}),typeof c=="number"&&!isNaN(c)&&y.jsxs("span",{className:Se("yst-ml-2",Vv(c)),children:[c>-1&&"+",c,d==="percentage"&&"%"," ",f]})]})}var qE=["Icon","className","children","placement","id"];function zE(e,t){return WE(e)||UE(e,t)||KE(e,t)||HE()}function HE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
24
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PO(e,t){if(e){if(typeof e=="string")return wg(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)?wg(e,t):void 0}}function wg(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 TO(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 MO(e){if(Array.isArray(e))return e}var Wo="yst-insights-token",$O=function(){var t=K.useState(Ya().ready),n=Xa(t,2),r=n[0],i=n[1],s=K.useState(Ya().error),o=Xa(s,2),a=o[0],l=o[1],c=K.useState(Ya().expiresAt),u=Xa(c,2),d=u[0],f=u[1],h=K.useState(Ya().refreshing),g=Xa(h,2),m=g[0],p=g[1],v=CO(),b=v.source;K.useEffect(function(){var x=_O(function(P){i(P.ready),l(P.error),f(P.expiresAt),p(P.refreshing)});return EO(),function(){return x()}},[]);var w=d?Math.max(0,d-Date.now()):void 0,S=w?Math.floor(w/6e4):void 0;return r?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"yst-space-y-2 yst-p-4",children:[a&&y.jsxs(E.Alert,{appearance:"danger",children:["Auth error: ",a.message," ",y.jsx("button",{type:"button",onClick:function(){return Uo()},className:"yst-text-blue-600 hover:yst-underline",children:"Retry"})]}),!a&&y.jsxs(E.Alert,{appearance:"success",children:["Session active",S!==void 0&&" – expires in ~".concat(S,"m")," ","(source: ",b,")",m&&y.jsx(E.Spinner,{className:"yst-ml-2 yst-inline"})]})]}),y.jsx(pc,{})]}):y.jsx("div",{className:"yst-p-4",children:y.jsxs(E.Alert,{appearance:"info",className:"yst-mb-4",children:[y.jsx(E.Spinner,{className:"yst-mr-2 yst-inline"})," Initializing secure session..."]})})},jO=function(){localStorage.removeItem(Wo),delete Ze.defaults.headers.common.Authorization},DO=function(){var t=ur(),n=wk({mutation:{onSettled:function(){jO(),t("/"),window.location.reload()}}});return n};function LO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4"}))}const RO=M.forwardRef(LO);function IO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"}))}const FO=M.forwardRef(IO);function NO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const BO=M.forwardRef(NO);function qO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"}))}const zO=M.forwardRef(qO);function HO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"}))}const KO=M.forwardRef(HO);function UO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))}const WO=M.forwardRef(UO);function VO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 15l-2 5L9 9l11 4-5 2zm0 0l5 5M7.188 2.239l.777 2.897M5.136 7.965l-2.898-.777M13.95 4.05l-2.122 2.122m-5.657 5.656l-2.12 2.122"}))}const GO=M.forwardRef(VO);function QO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"}))}const YO=M.forwardRef(QO);function XO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"}))}const JO=M.forwardRef(XO);function ZO(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"}))}const eE=M.forwardRef(ZO);function tE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"}))}const nE=M.forwardRef(tE);function rE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}))}const iE=M.forwardRef(rE);function sE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z"}))}const Ed=M.forwardRef(sE);function oE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"}))}const aE=M.forwardRef(oE);function lE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4h16v12a1 1 0 01-1 1H5a1 1 0 01-1-1V4z"}))}const cE=M.forwardRef(lE);function uE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01"}))}const dE=M.forwardRef(uE);function fE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"}))}const Kv=M.forwardRef(fE);function hE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"}))}const xf=M.forwardRef(hE);function gE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2,stroke:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"}))}const yE=M.forwardRef(gE);var mE=function(){return[{label:"Brand analysis",href:"/",Icon:cE,isActive:function(n){return n.startsWith("/setup")||n==="/"},showInMenu:!0},{label:"Settings",href:"/settings",Icon:WO,isActive:function(n){return n.startsWith("/settings")},showInMenu:!0},{label:"Query history",href:"/query-history",Icon:RO,isActive:function(n){return n.startsWith("/query-history")},showInMenu:!0}]},Sg;function pE(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Cg=function(t){var n=t.className,r=dn(),i=r.pathname,s=mE();return y.jsx("div",{className:Se("yst-flex yst-flex-col yst-gap-10",n),children:y.jsx(E.SidebarNavigation.Sidebar,{children:y.jsx(E.SidebarNavigation.List,{className:"yst-space-y-2",children:s.filter(function(o){return o.showInMenu!==!1}).map(function(o){var a=o.isActive?o.isActive(i):!1;return y.jsx(E.SidebarNavigation.SubmenuItem,{className:Se("yst-flex yst-gap-x-3",{"yst-sidebar-navigation__item--active":a}),href:o.href,to:o.href,as:Kr,label:y.jsxs(y.Fragment,{children:[y.jsx(o.Icon,{className:Se(Sg||(Sg=pE(["yst-sidebar-navigation__icon yst-h-6 yst-w-6"])))}),o.label]})},o.label)})})})})};const vE="data:image/svg+xml,%3csvg%20width='96'%20height='42'%20viewBox='0%200%2096%2042'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M31.6517%2010.1419C24.3001%2010.1419%2021.3588%2015.0112%2021.3588%2020.4319C21.3588%2025.8525%2024.2564%2030.9356%2031.6517%2030.9356C39.0469%2030.9356%2041.9256%2025.8375%2041.9123%2020.7619C41.8952%2014.58%2038.7258%2010.14%2031.6517%2010.14V10.1419ZM27.1978%2020.7394C27.3764%2013.485%2033.0235%2013.4925%2034.9104%2016.0912C36.63%2018.4594%2036.9815%2026.5556%2031.6536%2026.4975C29.1986%2026.4712%2027.2719%2024.8344%2027.1997%2020.7394H27.1978ZM91.2791%2025.905V15.3956H95.0869V10.8337H91.2791V5.32312H85.3982V10.8337H82.415V15.3956H85.3982V25.3087C85.3982%2030.9431%2089.3789%2034.2919%2093.5801%2034.9856L95.3358%2030.3206C92.8866%2030.015%2091.3019%2028.2075%2091.2791%2025.9069V25.905ZM61.6088%2024.2419V16.3425C61.6088%2016.0537%2061.5898%2015.7837%2061.5613%2015.5194C61.0521%209.13687%2051.8669%209.15%2044.7529%2011.6006L46.8089%2015.6844C51.4413%2013.5131%2054.2136%2014.0737%2055.1826%2015.1425C55.2073%2015.1706%2055.232%2015.1969%2055.2548%2015.2269C55.2567%2015.2306%2055.2605%2015.2344%2055.2624%2015.2381C55.7565%2015.8962%2055.6387%2016.935%2055.6387%2017.7525C49.5849%2017.7525%2043.1416%2018.5456%2043.1416%2025.0969C43.1416%2030.0769%2049.4652%2033.2812%2056.0738%2028.5337L57.0542%2030.8681H62.7185C62.2131%2028.1269%2061.6069%2025.7794%2061.6069%2024.2419H61.6088ZM55.6843%2024.1987C51.0271%2029.3419%2046.7613%2024.5006%2051.1297%2022.3894C52.4161%2021.9562%2054.1604%2021.9375%2055.6843%2021.9375V24.1987ZM70.6477%2015.9169C70.6477%2013.9706%2073.8037%2013.0612%2078.7839%2015.3037L80.5054%2011.1769C73.8037%209.17812%2064.6509%208.99812%2064.592%2015.9169C64.5635%2019.2319%2066.7182%2021.015%2069.8211%2022.1531C71.9701%2022.9406%2075.073%2023.3494%2075.0635%2025.0387C75.0521%2027.2456%2070.241%2027.5831%2065.8632%2024.615L64.0942%2029.0906C70.0662%2032.0231%2081.1705%2032.1056%2081.1116%2024.7556C81.0527%2017.4881%2070.6457%2018.735%2070.6457%2015.9169H70.6477ZM18.8734%200.1875L10.3495%2023.5519L6.26617%2010.935H0.195312L6.99391%2028.1644C7.57346%2029.6312%207.57346%2031.2594%206.99391%2032.7262C6.23387%2034.6481%204.97029%2036.2944%201.88831%2036.7031V41.8106C7.88886%2041.8106%2011.1324%2038.1712%2014.0262%2030.1931L25.368%200.1875H18.8734Z'%20fill='%23A61E69'/%3e%3c/svg%3e";var bE=function(t){var n=t.className,r=dn(),i=r.pathname,s=Iv({query:{select:function(h){var g=h.data;return g==null?void 0:g.data}}}),o=s.data,a=s.isLoading,l=DO(),c=l.mutate,u=l.isPending,d=function(h){if(h.preventDefault(),!u)return c()};return y.jsxs("div",{className:Se("ystaii-sidemenu"),children:[y.jsx("div",{className:"ystaii-mobile-menu lg:yst-hidden",children:y.jsx(E.SidebarNavigation,{activePath:i,children:y.jsx(E.SidebarNavigation.Mobile,{closeButtonScreenReaderText:"Close sidebar",openButtonScreenReaderText:"Open sidebar",children:y.jsx(Cg,{})})})}),y.jsxs("div",{className:Se("ystaii-menuHeader","yst-mb-6 yst-mt-10 yst-flex yst-flex-row yst-items-center yst-justify-between yst-px-4","lg:yst-flex-col lg:yst-items-start lg:yst-space-y-12"),children:[y.jsx(E.Title,{children:y.jsx(Kr,{className:Se("yst-outline-none"),to:"/",children:y.jsx("img",{src:vE,alt:"Yoast",className:"yst-inline-block yst-h-8"})})}),y.jsxs("div",{className:Se("ystaii-userInfoContainer","yst-flex yst-flex-col"),children:[y.jsx("div",{children:y.jsx("b",{children:(o==null?void 0:o.displayName)||y.jsx(E.SkeletonLoader,{children:"Display name"})})}),y.jsx("div",{children:(o==null?void 0:o.email)||y.jsx(E.SkeletonLoader,{children:"loading-email@address.com"})}),y.jsx("div",{children:y.jsx(E.Link,{variant:"primary",className:"yst-no-underline",onClick:d,children:a?y.jsxs(E.SkeletonLoader,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"→"})]}):u?y.jsx(y.Fragment,{children:"Signing out..."}):y.jsxs(y.Fragment,{children:["Sign out ",y.jsx("span",{"aria-hidden":"true",children:"→"})]})})})]})]}),y.jsx("div",{className:Se("ystaii-desktopMenu","yst-hidden","lg:yst-mb-0 lg:yst-block lg:yst-w-full lg:yst-shrink-0"),children:y.jsx(E.SidebarNavigation,{activePath:i,children:y.jsx(Cg,{className:n})})})]})},Uv=Nx.a.withConfig({displayName:"SkipLink",componentId:"sc-40h6pc-0"})(["position:absolute;top:-1000em;left:10px;z-index:100000;display:block;height:48px;min-width:150px;padding:0 15px;font-size:14px;line-height:48px;background:var(--bg-color-white);border-radius:3px;box-shadow:0px 2px 2px 2px rgba(0,0,0,0.1);text-decoration:underline;text-align:center;outline:none;&:focus{top:10px;color:var(--text-color-blue);}"]);Uv.defaultProps={href:"#content"};function fu(e){var t=e.children,n=e.disable,r=n===void 0?!1:n,i=e.hideNav,s=i===void 0?!1:i,o=e.DebugInfo;return r?t:y.jsxs("div",{className:Se("ystaii-layout","yst-block","lg:yst-flex lg:yst-min-h-full lg:yst-overflow-visible"),children:[y.jsx(Uv,{children:"Skip to main content"}),!s&&y.jsxs("div",{className:Se("ystaii-sidebar","yst-overflow-hidden","lg:yst-flex-grow-1 lg:yst-max-w-[300px] lg:yst-flex-shrink-0 lg:yst-basis-[300px] lg:yst-overflow-visible lg:yst-pl-4"),children:[y.jsx(bE,{}),o&&y.jsx(o,{})]}),y.jsx("main",{className:Se("ystaii-main","yst-mx-4 yst-my-0 yst-flex yst-min-w-0 yst-shrink yst-grow yst-basis-auto yst-px-0 yst-py-6","lg:yst-ml-12 lg:yst-mr-6"),children:y.jsx("div",{className:Se("ystaii-main-content","yst-mx-auto yst-flex yst-flex-col yst-gap-8","lg:yst-w-full lg:yst-flex-row"),children:y.jsx("div",{className:"yst-layout-root yst-mx-auto yst-w-full yst-max-w-[1200px] yst-flex-1",children:t})})})]})}function jc(e){var t=e.children,n=e.description,r=e.title;return y.jsxs(E.Paper.Header,{children:[r&&y.jsx(E.Title,{className:Se({"yst-mb-3":n||t}),children:r}),n&&(typeof n=="string"?y.jsx("p",{children:n}):n),t]})}var xE={HOME:"/"},wE=function(t){var n=t.hideNav,r=n===void 0?!1:n,i=t.disableLayout,s=i===void 0?!1:i,o=t.DebugInfo,a=dn(),l=ur(),c={disable:s,hideNav:r},u=Wr(),d=u.brandId,f=$c(),h=f.setBrandId,g=Pa({query:{refetchOnReconnect:!1,refetchOnWindowFocus:!1,select:function(O){var _;return O==null||(_=O.data)===null||_===void 0?void 0:_.brands}}}),m=g.data,p=g.isLoading,v=g.error,b=g.refetch,w=K.useRef(!1),S=K.useMemo(function(){return m==null?void 0:m.find(function(C){return C.id===d})},[m,d]);K.useEffect(function(){var C;if(!(m===void 0||d)){var O=(C=m[0])===null||C===void 0?void 0:C.id;O&&h(O)}},[m,d,h,l,a.pathname]),K.useEffect(function(){!d||w.current||(w.current=!0)},[S,d,l,a.pathname,m]);var x=K.useCallback(function(){b()},[b]),P=["Loading your brands...","Preparing your dashboard...","Checking analysis status...","Almost ready!"];return a.pathname!==xE.HOME&&p?y.jsx(fu,{...c,children:y.jsxs(E.Paper,{className:"yst-mx-auto yst-max-w-2xl",children:[y.jsx(jc,{title:y.jsx(E.SkeletonLoader,{className:"yst-h-12 yst-w-36"}),description:y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-3/4"})}),y.jsx(E.Paper.Content,{children:y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-start yst-justify-center",children:y.jsx("div",{className:"yst-w-full yst-space-y-4",children:y.jsx("div",{className:"yst-space-y-4",children:P.map(function(C,O){return y.jsx(E.SkeletonLoader,{children:C},O)})})})})})]})}):v?y.jsx(fu,{...c,children:y.jsx("div",{className:"yst-flex yst-min-h-screen yst-items-center yst-justify-center",children:y.jsxs("div",{className:"yst-space-y-4 yst-text-center",children:[y.jsx("div",{className:"yst-mb-4 yst-text-6xl yst-text-red-600",children:"⚠️"}),y.jsx("h2",{className:"yst-text-xl yst-font-semibold yst-text-slate-900",children:"Something went wrong"}),y.jsx("p",{className:"yst-text-slate-600",children:"We couldn't load your Brand Analysis. Please try again shortly."}),y.jsx(E.Button,{variant:"primary",onClick:x,children:"Retry"})]})})}):y.jsx(fu,{DebugInfo:o,...c,children:y.jsx(pc,{})})};function SE(){K.useEffect(function(){var e=function(){var r=Bv().replace("/api/v1","");console.log("Api base URL for CSRF cookie fetch:",r),Ze.get("".concat(r,"/sanctum/csrf-cookie"),{withCredentials:!0}).catch(function(i){console.error("Failed to fetch CSRF cookie:",i)})};e();var t=function(){e()};return window.addEventListener("api-config-changed",t),function(){window.removeEventListener("api-config-changed",t)}},[])}function CE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M14.707 12.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 14.586V3a1 1 0 012 0v11.586l2.293-2.293a1 1 0 011.414 0z",clipRule:"evenodd"}))}const _E=M.forwardRef(CE);function kE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z",clipRule:"evenodd"}))}const OE=M.forwardRef(kE);function EE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M5.293 7.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L6.707 7.707a1 1 0 01-1.414 0z",clipRule:"evenodd"}))}const AE=M.forwardRef(EE);function PE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"}))}const Wv=M.forwardRef(PE);function TE(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{d:"M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"}),M.createElement("path",{d:"M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z"}))}const ME=M.forwardRef(TE);function $E(e,t){return M.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:t},e),M.createElement("path",{fillRule:"evenodd",d:"M2 5a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2V5zm14 1a1 1 0 11-2 0 1 1 0 012 0zM2 13a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 01-2 2H4a2 2 0 01-2-2v-2zm14 1a1 1 0 11-2 0 1 1 0 012 0z",clipRule:"evenodd"}))}const jE=M.forwardRef($E);function Vo(e){"@babel/helpers - typeof";return Vo=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},Vo(e)}var DE=["children","as","startColor","endColor","angle","disabled","style","className"];function _g(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 kg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_g(Object(n),!0).forEach(function(r){LE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_g(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LE(e,t,n){return(t=RE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RE(e){var t=IE(e,"string");return Vo(t)=="symbol"?t:t+""}function IE(e,t){if(Vo(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Vo(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function FE(e,t){if(e==null)return{};var n,r,i=NE(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function NE(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var wf=function(t){var n=t.children,r=t.as,i=r===void 0?"span":r,s=t.startColor,o=s===void 0?"#A61E69":s,a=t.endColor,l=a===void 0?"#6366F1":a,c=t.angle,u=c===void 0?102:c,d=t.disabled,f=d===void 0?!1:d,h=t.style,g=h===void 0?{}:h,m=t.className,p=m===void 0?"":m,v=FE(t,DE),b=kg(f?{display:"inline-block"}:{background:"linear-gradient(".concat(u,"deg, ").concat(o,", ").concat(l,")"),WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",backgroundClip:"text",display:"inline-block"},g);return y.jsx(i,{className:p,style:b,...v,children:n})};function Sf(e){var t=e.children,n=e.nestedInPaperContent,r=n===void 0?!1:n,i=e.className;return y.jsx("div",{className:Se("yst-mt-8 yst-flex yst-items-center yst-justify-end yst-gap-6 yst-rounded-bl-lg yst-rounded-br-lg yst-border-t yst-border-slate-200 yst-bg-slate-50 yst-px-8 yst-py-6",{"yst-mb-[-2rem] yst-ml-[-2rem] yst-mr-[-2rem]":r},i),children:t})}var BE=function(){var t=ur();return y.jsx("form",{onSubmit:function(){return t("/setup")},children:y.jsxs(E.Paper,{className:"yst-mx-auto yst-flex yst-max-w-2xl",children:[y.jsx(E.Paper.Header,{children:y.jsxs(E.Title,{size:"1",children:["Welcome to ",y.jsx(wf,{children:"Yoast AI Brand Insights"}),"!"]})}),y.jsxs(E.Paper.Content,{className:"yst-space-y-8",children:[y.jsxs("div",{className:"yst-space-y-4 *:yst-text-tiny",children:[y.jsx("p",{children:"See how your brand is represented in AI answers"}),y.jsxs("p",{children:[y.jsx("b",{className:"yst-font-medium yst-text-slate-800",children:"Yoast AI Brand Insights"})," ","shows how often your brand appears, how it's described, and how it compares to competitors in tools like ChatGPT and Perplexity."]}),y.jsx("p",{children:"It only takes three simple steps to get your brand insights:"})]}),y.jsx("div",{className:"yst-flex yst-flex-col yst-items-stretch yst-justify-stretch yst-gap-4 yst-pb-8",children:[{title:"1. ADD BRAND INFO",description:"Tell us about your brand and where it's active so we can customize your analysis."},{title:"2. REVIEW QUERIES",description:"Edit or approve the queries generated from your input."},{title:"3. RUN ANALYSIS",description:"Run your queries through relevant AI models to see how your brand shows up."}].map(function(n,r,i){return y.jsxs("div",{className:"yst-relative yst-flex yst-flex-col yst-items-stretch",children:[y.jsxs("div",{className:"yst-flex yst-flex-row yst-items-center yst-justify-stretch yst-gap-6",children:[y.jsx(E.Stepper.Step,{isActive:!0,isComplete:!1}),y.jsxs("div",{className:"yst-flex yst-flex-1 yst-flex-col yst-gap-2 yst-rounded yst-border yst-border-slate-200 yst-p-6",children:[y.jsx(E.Title,{size:"3",className:"yst-font-semibold yst-uppercase",children:n.title}),y.jsx("p",{children:n.description})]})]}),r<i.length-1&&y.jsx("div",{className:"yst-absolute yst-left-[-2px] yst-top-1/2 yst-my-0 yst-ml-[13px] yst-h-full yst-border-l-2 yst-border-l-primary-600"})]},n.title)})})]}),y.jsx(Sf,{className:"yst-justify-end",children:y.jsxs(E.Button,{variant:"primary",onClick:function(){return t("/setup")},className:"yst-gap-1.5",children:["Start your first analysis ",y.jsx(OE,{})]})})]})})};function Vv(e){return typeof e!="number"?{}:{"yst-text-green-600":e>0,"yst-text-red-600":e<0,"yst-text-gray-400":e===0}}function Ta(e){var t=e.score,n=e.total,r=e.suffix,i=e.isLoading,s=i===void 0?!1:i,o=e.className,a=e.hideTotal,l=a===void 0?!1:a,c=e.delta,u=e.deltaFormat,d=u===void 0?"absolute":u,f=e.deltaSuffix,h=e.scoreFormat,g=h===void 0?"absolute":h;return y.jsxs("div",{className:Se(o,"yst-font-medium"),children:[y.jsxs("span",{className:"yst-mr-1 yst-text-xl yst-font-bold yst-text-slate-900",children:[s||t===void 0||t===null?"—":t,!s&&t!==void 0&&t!==null&&g==="percentage"?"%":""]}),!l&&n&&n!==0&&n!=="0"&&y.jsxs("span",{className:"yst-text-slate-500",children:["/ ",s?"—":n]}),r&&y.jsxs("span",{className:"yst-text-slate-500",children:[" ",r]}),typeof c=="number"&&!isNaN(c)&&y.jsxs("span",{className:Se("yst-ml-2",Vv(c)),children:[c>-1&&"+",c,d==="percentage"&&"%"," ",f]})]})}var qE=["Icon","className","children","placement","id"];function zE(e,t){return WE(e)||UE(e,t)||KE(e,t)||HE()}function HE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
25
25
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KE(e,t){if(e){if(typeof e=="string")return Og(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)?Og(e,t):void 0}}function Og(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 UE(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 WE(e){if(Array.isArray(e))return e}function VE(e,t){if(e==null)return{};var n,r,i=GE(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function GE(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Cf(e){var t=e.Icon,n=t===void 0?iE:t,r=e.className,i=r===void 0?"":r,s=e.children,o=e.placement,a=o===void 0?"top":o,l=e.id,c=l===void 0?"":l,u=VE(e,qE),d=K.useState(!1),f=zE(d,2),h=f[0],g=f[1];return s?y.jsxs("div",{className:i||"yst-relative",onMouseEnter:function(){return g(!0)},onMouseLeave:function(){return g(!1)},"aria-describedby":c?"tooltip-button-id":"tooltip-button",...u,children:[y.jsx(n,{className:"yst-relative yst-h-6 yst-w-6 yst-text-slate-400"}),h&&y.jsx(E.Tooltip,{placement:a,id:c||"tooltip-button",children:s})]}):null}var Hs=function(t){var n=t.title,r=t.tooltip,i=t.size,s=i===void 0?"3":i,o=t.className,a=o===void 0?"":o,l=function(d){var f=typeof d=="string"?d:"tooltip";return"tooltip-".concat(f.toLowerCase().replace(/\s+/g,"-"))},c=l(n);return y.jsxs("div",{className:"yst-flex yst-items-center yst-justify-between ".concat(a),children:[y.jsx(E.Title,{size:s,children:n}),y.jsx(Cf,{id:c,children:r})]})},Eg=function(t){var n=t.keywords,r=t.badgeClassName;return y.jsx("div",{className:"yst-flex yst-flex-wrap yst-gap-2",children:n.map(function(i){return i&&y.jsx(E.Badge,{className:r,children:i},i)})})},Gv=function(t){var n,r,i,s,o=t.title,a=o===void 0?"Sentiment":o,l=t.tooltip,c=l===void 0?"":l,u=t.data,d=u==null?void 0:u.brandName,f=u==null||(n=u.positivityPercentage)===null||n===void 0?void 0:n.value,h=u==null||(r=u.positivityPercentage)===null||r===void 0||(r=r.previous)===null||r===void 0?void 0:r.difference,g=[u==null||(i=u.keywords)===null||i===void 0?void 0:i.positive],m=[u==null||(s=u.keywords)===null||s===void 0?void 0:s.negative],p=!u||f===void 0&&h===void 0;return y.jsx(E.Card,{className:"yst-overflow-visible",children:y.jsxs(E.Card.Content,{className:"yst-space-y-8",children:[y.jsxs("div",{className:"yst-space-y-3",children:[y.jsx(Hs,{title:a,tooltip:c}),y.jsx("p",{children:d||y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-20"})}),y.jsxs("div",{children:[y.jsx("div",{className:"yst-inline-flex",children:y.jsx(Ta,{className:"yst-mb-1.5",score:f,scoreFormat:"percentage",suffix:"positive",delta:h})}),y.jsx(E.ProgressBar,{max:100,min:0,progress:f||0,className:Se({"yst-bg-red-500":f},"[&>*]:yst-bg-green-500")})]})]}),p&&y.jsx(E.Alert,{variant:"info",children:"The selected AI model returned no brand sentiment data for your queries. This can happen with some queries or models."}),!!g&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(E.Title,{as:"h5",size:"5",children:"Positive keywords"}),y.jsx(Eg,{keywords:g||[],badgeClassName:"yst-bg-green-100 yst-text-green-800"})]}),!!m&&y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(E.Title,{as:"h5",size:"5",children:"Negative keywords"}),y.jsx(Eg,{keywords:m||[],badgeClassName:"yst-bg-red-100 yst-text-red-800"})]})]})})};function Go(e){"@babel/helpers - typeof";return Go=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},Go(e)}var QE=["data"];function Ag(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 YE(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ag(Object(n),!0).forEach(function(r){XE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ag(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function XE(e,t,n){return(t=JE(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JE(e){var t=ZE(e,"string");return Go(t)=="symbol"?t:t+""}function ZE(e,t){if(Go(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Go(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function e3(e,t){if(e==null)return{};var n,r,i=t3(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function t3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var ji=function(t,n,r){var i=Wr(),s=i.brandId,o=i.analysisId,a=i.model,l=s,c=o,u=a,d=Mc(l,c,{query:{enabled:!!l&&!!c,select:function(p){var v=p.data;return v==null?void 0:v.analysis}}}),f=d.data,h=e3(d,QE),g=K.useMemo(function(){if(!f||!u)return null;var m=f.scans||[];return m.find(function(p){return String(p.aiProvider)===String(u)})||null},[f,u]);return YE({data:g},h)};function n3(){var e,t=ji(),n=t.data;return y.jsx(Gv,{title:"Brand Sentiment",data:n==null||(e=n.sentiment)===null||e===void 0?void 0:e.own,tooltip:"Percentage of positive versus negative keywords in your query results related to your brand."})}var r3=["children","as","className"];function i3(e,t){if(e==null)return{};var n,r,i=s3(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function s3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ma=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var s=t.reduce(function(o,a,l){return o+a+(r[l]||"")},"");return function(o){var a=o.children,l=o.as,c=l===void 0?"div":l,u=o.className,d=u===void 0?"":u,f=i3(o,r3);return y.jsx(c,{className:Se(s.trim(),d),...f,children:a})}},hu=[{bg:"yst-bg-blue-200",text:"yst-text-blue-900"},{bg:"yst-bg-green-200",text:"yst-text-green-900"},{bg:"yst-bg-purple-200",text:"yst-text-purple-900"},{bg:"yst-bg-pink-200",text:"yst-text-pink-900"},{bg:"yst-bg-yellow-200",text:"yst-text-yellow-900"},{bg:"yst-bg-indigo-200",text:"yst-text-indigo-900"},{bg:"yst-bg-red-200",text:"yst-text-red-900"},{bg:"yst-bg-orange-200",text:"yst-text-orange-900"},{bg:"yst-bg-teal-200",text:"yst-text-teal-900"},{bg:"yst-bg-cyan-200",text:"yst-text-cyan-900"},{bg:"yst-bg-lime-200",text:"yst-text-lime-900"},{bg:"yst-bg-emerald-200",text:"yst-text-emerald-900"},{bg:"yst-bg-sky-200",text:"yst-text-sky-900"},{bg:"yst-bg-violet-200",text:"yst-text-violet-900"},{bg:"yst-bg-fuchsia-200",text:"yst-text-fuchsia-900"},{bg:"yst-bg-rose-200",text:"yst-text-rose-900"},{bg:"yst-bg-amber-200",text:"yst-text-amber-900"}],Pg=function(t){if(!t)return hu[0];if(t.toLowerCase()==="other")return{bg:"yst-bg-slate-200",text:"yst-text-slate-900"};for(var n=0,r=0;r<t.length;r++){var i=t.charCodeAt(r);n=(n<<5)-n+i,n=n&n}var s=Math.abs(n)%hu.length;return hu[s]},Tg;function o3(e){return c3(e)||l3(e)||Qv(e)||a3()}function a3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
26
26
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l3(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c3(e){if(Array.isArray(e))return Ad(e)}function u3(e,t){return h3(e)||f3(e,t)||Qv(e,t)||d3()}function d3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
27
27
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qv(e,t){if(e){if(typeof e=="string")return Ad(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)?Ad(e,t):void 0}}function Ad(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 f3(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 h3(e){if(Array.isArray(e))return e}function g3(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ja=Ma(Tg||(Tg=g3(["md:yst-hidden yst-mr-2 yst-font-medium yst-text-slate-400 yst-inline-flex yst-w-20"]))),Mg=function(t){var n=t.data,r=t.isLoading,i=r===void 0?!1:r,s=i||!n,o=n||{},a=o.rank,l=o.url,c=o.root_domain,u=o.category,d=o.impact,f=o.mentions;return y.jsxs("tr",{className:"yst-flex yst-flex-col md:yst-table-row",children:[y.jsx(E.Table.Cell,{className:"yst-pb-1 md:yst-pb-2",children:s?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-full"}):y.jsxs("div",{className:"yst-flex yst-items-center yst-gap-2",children:[y.jsxs("span",{className:"yst-text-slate-400",children:[a!=null?a:"—","."]}),y.jsxs(E.Link,{className:"yst-flex yst-items-center yst-gap-1 yst-font-medium",href:l||"#",rel:"nofollow noreferrer",children:[y.jsx("span",{children:l!=null?l:"—"})," ",y.jsx(ME,{})]})]})}),y.jsxs(E.Table.Cell,{className:"yst-ml-2 yst-py-1 yst-font-medium md:yst-ml-0 md:yst-p-2",children:[y.jsx(Ja,{as:"span",children:"Domain:"}),s?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium yst-text-slate-900",children:c!=null?c:"—"})]}),y.jsxs(E.Table.Cell,{className:"yst-ml-2 yst-py-1 md:yst-ml-0 md:yst-p-2",children:[y.jsx(Ja,{as:"span",children:"Category:"}),s?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-16"}):y.jsx(E.Badge,{className:Se(Pg(u||"").bg,Pg(u||"").text),children:u!=null?u:"—"})]}),y.jsxs(E.Table.Cell,{className:Se("yst-ml-2 yst-py-0 md:yst-ml-0 md:yst-p-2","yst-font-medium",{"yst-text-green-600":d==="High","yst-text-yellow-600":d==="Medium","yst-text-red-600":d==="Low"}),children:[y.jsx(Ja,{as:"span",children:"Impact:"}),s?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-12"}):d!=null?d:"—"]}),y.jsxs(E.Table.Cell,{className:"yst-ml-2 yst-pt-1 md:yst-ml-0 md:yst-p-2 md:yst-text-right",children:[y.jsx(Ja,{as:"span",children:"Mentions:"}),s?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-8"}):f||"—"]})]},s?void 0:l)},y3=function(){var t,n,r,i,s=K.useState("all"),o=u3(s,2),a=o[0],l=o[1],c=ji(),u=c.data,d=c.isLoading,f=c.isRefetching,h=u==null?void 0:u.citations,g=h==null||(t=h.list)===null||t===void 0?void 0:t.filter(function(m){return a==="all"?!0:m.category===a});return y.jsx(E.Card,{className:"yst-overflow-visible md:yst-col-span-2",children:y.jsxs(E.Card.Content,{className:"yst-flex yst-flex-col yst-gap-6",children:[y.jsxs("div",{className:"yst-space-y-4",children:[y.jsx(Hs,{title:"Citations",tooltip:"Sources the AI used to support brand mentions in the results."}),y.jsx("p",{children:"This table highlights the most important sources where your brand was cited."}),y.jsx(Ta,{score:h==null||(n=h.total)===null||n===void 0?void 0:n.value,suffix:"citations",delta:h==null||(r=h.total)===null||r===void 0||(r=r.previous)===null||r===void 0?void 0:r.difference,deltaSuffix:"since last scan",isLoading:d,hideTotal:!0})]}),(h==null||(i=h.list)===null||i===void 0?void 0:i.length)===0&&!d&&!f?y.jsx(E.Alert,{children:"The selected AI model returned no citations for your queries. This can happen with some queries or models."}):y.jsx(y.Fragment,{children:y.jsxs("div",{children:[y.jsx(E.Select,{className:"yst-mb-4 md:yst-max-w-sm",label:"Filter categories",value:a,onChange:function(m){l(m)},id:"citation-category-filter",options:[{value:"all",label:"All categories"}].concat(o3(h!=null&&h.categories?h.categories.map(function(m){return{value:m,label:m}}):[]))}),y.jsxs(E.Table,{variant:"minimal",children:[y.jsx(E.Table.Head,{className:"yst-font-semibold",children:y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{className:"yst yst-hidden yst-text-slate-900 md:yst-table-cell",children:y.jsx("span",{className:"yst-hidden md:yst-inline",children:"URL"})}),y.jsx(E.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Root domain"}),y.jsx(E.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Category"}),y.jsx(E.Table.Cell,{className:"yst-hidden yst-text-slate-900 md:yst-table-cell",children:"Impact"}),y.jsx(E.Table.Cell,{className:"yst-hidden yst-text-right yst-text-slate-900 md:yst-table-cell",children:"Mentions"})]})}),y.jsx(E.Table.Body,{children:d||f?Array.from({length:5}).map(function(m,p){return y.jsx(Mg,{isLoading:!0},"skeleton-".concat(p))}):g&&g.length>0?g.map(function(m){return y.jsx(Mg,{data:m},m.url)}):y.jsx(E.Table.Row,{children:y.jsxs(E.Table.Cell,{colSpan:5,className:"yst-py-8 yst-text-center yst-text-slate-500",children:[a==="all"?"No citations found.":'No citations found for the "'.concat(a,'" category.')," ",y.jsx(E.Link,{onClick:function(){return l("all")},children:"Show all categories."})]})},"no-results")})]})]})})]})})},$g=function(t){var n,r=t.data,i=t.isLoading,s=i===void 0?!1:i,o=s||!r,a=r||{},l=a.rank,c=a.brand;return y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{children:o?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-8"}):y.jsx("span",{className:"yst-inline-flex yst-gap-2 yst-font-medium",children:y.jsxs("span",{className:"yst-text-slate-500",children:["# ",y.jsx("span",{className:"yst-text-slate-900",children:l==null?void 0:l.value})]})})}),y.jsx(E.Table.Cell,{children:o?y.jsx(E.SkeletonLoader,{className:"yst-h-6 yst-w-24"}):y.jsx("span",{className:"yst-font-medium",children:c!=null&&c.isSelf?y.jsx(wf,{children:c==null?void 0:c.name}):(n=c==null?void 0:c.name)!==null&&n!==void 0?n:"—"})})]},o||l==null?void 0:l.value)},m3=function(t){var n,r=t.className,i=K.useRef(null),s=ji(),o=s.data,a=s.isLoading,l=s.isRefetching,c=o==null||(n=o.rankings)===null||n===void 0?void 0:n.list;return y.jsx(E.Card,{ref:i,className:Se("yst-overflow-visible",r),children:y.jsxs(E.Card.Content,{className:"yst-mt-0 yst-space-y-6",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsx(Hs,{title:"Competitor ranking",tooltip:"How often competitors are mentioned in your submitted queries."}),y.jsx("p",{children:"Brands with the most mentions for your prompts."})]}),!a&&!l&&(!c||c.length===0)?y.jsx(E.Alert,{variant:"info",children:"The selected AI model returned no brands for your queries. This can happen with some queries or models."}):y.jsxs(E.Table,{variant:"minimal",children:[y.jsx(E.Table.Head,{children:y.jsxs(E.Table.Row,{children:[y.jsx(E.Table.Cell,{children:"Rank"}),y.jsx(E.Table.Cell,{children:"Brand"})]})}),y.jsx(E.Table.Body,{children:c&&Array.isArray(c)&&c.length>0?c.map(function(u){var d;return y.jsx($g,{data:u},"rank-row-".concat((d=u.rank)===null||d===void 0?void 0:d.value))}):a||l?Array.from({length:5}).map(function(u,d){return y.jsx($g,{isLoading:!0},"skeleton-".concat(d))}):null})]})]})})},p3=function(){var t,n=ji(),r=n.data,i=r==null||(t=r.sentiment)===null||t===void 0?void 0:t.topCompetitor;return y.jsx(Gv,{title:"Competitor sentiment",data:i,tooltip:"Percentage of positive versus negative keywords in your query results related to your competitor's brand."})},v3=function(t){var n=t.brand,r=ur(),i=$c(),s=i.setBrandId;return(n==null?void 0:n.setupStatus)==="pendingQuerySelection"?y.jsx(E.Alert,{className:"yst-mt-0",children:y.jsxs("div",{className:"yst-max-w-xl yst-space-y-4",children:[y.jsxs("div",{className:"yst-space-y-2",children:[y.jsxs("h3",{className:"yst-font-medium",children:["Finish your analysis for ",(n==null?void 0:n.name)||"Brand ".concat(n==null?void 0:n.id)]}),y.jsx("p",{children:"Your brand is saved, but you haven’t completed the analysis yet. Review your queries and run the analysis to get your brand insights!"})]}),y.jsxs("div",{className:"yst-flex yst-justify-start yst-gap-6",children:[y.jsx(E.Link,{onClick:function(){n.id?(s(n.id),r("/setup/".concat(n.id,"/queries"))):console.error("Brand ID is missing.")},children:"Review queries"}),y.jsx(E.Link,{onClick:function(){},children:"Dismiss"})]})]})}):null},_f=function(t){var n=t.isOpen,r=t.onClose,i=t.onConfirm,s=t.isLoading,o=s===void 0?!1:s,a=t.title,l=t.description,c=t.disabled,u=c===void 0?!1:c,d=t.confirmText,f=d===void 0?"Yes, delete":d,h=t.cancelText,g=h===void 0?"No, go back":h,m=t.className;return y.jsx(E.Modal,{isOpen:n,onClose:r,position:"center",as:"div",className:m,children:y.jsxs(E.Modal.Panel,{children:[y.jsxs("div",{className:"yst-flex yst-items-start yst-justify-stretch yst-gap-4",children:[y.jsx("div",{children:y.jsx("span",{className:"yst-inline-flex yst-h-10 yst-w-10 yst-items-center yst-justify-center yst-rounded-full yst-bg-red-100",children:y.jsx(JO,{className:"yst-h-6 yst-w-6 yst-text-red-600"})})}),y.jsxs("div",{className:"yst-flex-1",children:[y.jsx(E.Modal.Container.Header,{className:"yst-mb-3 yst-w-full",children:y.jsx(E.Modal.Title,{as:"h3",className:"yst-text-lg yst-font-medium",children:a})}),y.jsx(E.Modal.Container.Content,{className:"yst-mb-4 yst-space-y-3",children:typeof l=="string"?y.jsx("p",{children:l}):l})]})]}),y.jsxs(E.Modal.Container.Footer,{className:"yst-mt-3 yst-flex yst-justify-end yst-gap-2",children:[y.jsx(E.Button,{variant:"secondary",onClick:r,children:g}),y.jsx(E.Button,{variant:"error",onClick:i,isLoading:o,disabled:u,children:f})]})]})})},Za={exports:{}},el={exports:{}},Ne={};/** @license React v16.13.1
|
|
@@ -9285,8 +9285,8 @@ var t3 = {
|
|
|
9285
9285
|
function r3() {
|
|
9286
9286
|
ht(function() {
|
|
9287
9287
|
var e = function() {
|
|
9288
|
-
var r = mb();
|
|
9289
|
-
it.get("".concat(r, "/sanctum/csrf-cookie"), {
|
|
9288
|
+
var r = mb().replace("/api/v1", "");
|
|
9289
|
+
console.log("Api base URL for CSRF cookie fetch:", r), it.get("".concat(r, "/sanctum/csrf-cookie"), {
|
|
9290
9290
|
withCredentials: !0
|
|
9291
9291
|
}).catch(function(i) {
|
|
9292
9292
|
console.error("Failed to fetch CSRF cookie:", i);
|