PageSourceSearch

https://zaher.ai/assets/QueryLab-DrSNOsXB.js

js zaher.ai collected 2026-10-05 13:22:13 UTC 22,812 bytes, 7 lines download raw bytes

1import{d as fe,u as E,j as e,S as J,L as W,X as qe,c as y,x as ge,a1 as ee,Z,b as de,e as Ne,m as ke,h as we}from"./index-BgyAUjrd.js";import{r as q,a as Se}from"./react-vendor-DMqmElJU.js";import{F as Fe}from"./FeatureLockedCard-BhoGroi0.js";import{C as ne}from"./chart-line-p45xwlnn.js";import{T as Le}from"./triangle-alert-BIkqK1Ig.js";import{I as oe}from"./info-CdDiB8OA.js";import{u as se}from"./useMutation-BDi89mVb.js";import{Z as le}from"./zap-DH1jhF3o.js";import{S as Q}from"./square-check-big-C1s4dAih.js";import{S as ie}from"./sparkles-DNhtE_wG.js";import{C as Ce}from"./clock-CxGayeJ8.js";import{P as Te}from"./plus-Iij0mJqX.js";import{L as Oe}from"./lock-CVtWiZur.js";import{R as ue}from"./refresh-cw-BdYk957o.js";import{T as ze}from"./trash-2-BuaB9bTh.js";import{u as Ee,i as Ae}from"./useIntegrationsSummary-BGci4-8j.js";import{D as Me}from"./download-BKX1hf4Y.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Pe=fe("Tags",[["path",{d:"m15 5 6.3 6.3a2.4 2.4 0 0 1 0 3.4L17 19",key:"1cbfv1"}],["path",{d:"M9.586 5.586A2 2 0 0 0 8.172 5H3a1 1 0 0 0-1 1v5.172a2 2 0 0 0 .586 1.414L8.29 18.29a2.426 2.426 0 0 0 3.42 0l3.58-3.58a2.426 2.426 0 0 0 0-3.42z",key:"135mg7"}],["circle",{cx:"6.5",cy:"9.5",r:".5",fill:"currentColor",key:"5pm5xn"}]]);function $e({hasSearchSource:s,profilePath:t}){const{t:a}=E("queryLab"),i=[{key:"volume",label:a("discovery.kpiVolume"),est:!0},{key:"appear",label:a("discovery.kpiAppear"),est:!1},{key:"sov",label:a("discovery.kpiSov"),est:!1},{key:"untracked",label:a("discovery.kpiUntracked"),est:!1}];return e.jsxs("div",{className:"ql-pane active",id:"qlPane-discovery",children:[e.jsxs("div",{className:"card empty-state",style:{textAlign:"start",alignItems:"flex-start"},children:[e.jsx("div",{className:"empty-state-icon","aria-hidden":!0,children:e.jsx(J,{size:20})}),e.jsx("div",{className:"empty-state-title",children:a("discovery.comingSoon")}),e.jsx("div",{className:"empty-state-sub",children:a(s?"discovery.comingSoonSub":"discovery.needsSources")})]}),e.jsx("div",{className:"ql-kpis",children:i.map(l=>e.jsxs("div",{className:"ql-kpi",children:[e.jsxs("div",{className:"ql-kpi-lbl",children:[l.label,l.est?e.jsx("span",{className:"ql-est",title:a("discovery.estNote"),children:"est"}):null]}),e.jsx("div",{className:"ql-kpi-val",children:a("discovery.kpiEmpty")}),e.jsx("div",{className:"ql-kpi-sub",children:a("discovery.kpiPending")})]},l.key))}),e.jsx("div",{className:"card",children:e.jsxs("div",{className:"card-head",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"card-title",children:[e.jsx(Pe,{size:14,"aria-hidden":!0}),e.jsx("span",{children:a("discovery.topicCoverage")})]}),e.jsx("div",{className:"card-sub",children:a("discovery.topicCoverageSub")})]}),e.jsx(W,{className:"btn btn--secondary btn--sm",to:t,children:a("discovery.editTopics")})]})}),e.jsxs("div",{className:"ql-table-wrap",children:[e.jsx("div",{className:"ql-table-head",children:e.jsxs("div",{className:"ql-table-title",children:[e.jsx(ne,{size:14,"aria-hidden":!0}),e.jsx("span",{children:a("discovery.topicsTitle")})]})}),e.jsx("div",{className:"empty-state",style:{padding:"28px 16px"},children:e.jsx("div",{className:"empty-state-sub",children:a("discovery.topicsEmpty")})})]}),e.jsxs("div",{className:"ql-gap-note",children:[e.jsx(Le,{"aria-hidden":!0}),e.jsxs("span",{children:[e.jsxs("b",{children:[a("discovery.gapsTitle"),"."]})," ",a("discovery.gapsEmpty")]})]}),e.jsxs("div",{className:"ql-table-wrap",children:[e.jsx("div",{className:"ql-table-head",children:e.jsxs("div",{className:"ql-table-title",children:[e.jsx(ne,{size:14,"aria-hidden":!0}),e.jsx("span",{children:a("discovery.queryDemand")})]})}),e.jsx("div",{className:"empty-state",style:{padding:"28px 16px"},children:e.jsx("div",{className:"empty-state-sub",children:a("discovery.queryDemandEmpty")})})]}),e.jsxs("div",{className:"ql-notice",children:[e.jsx(oe,{"aria-hidden":!0}),e.jsx("span",{children:a("discovery.estNote")})]})]})}function Be({open:s,query:t,stage:a,onClose:i}){const{t:l}=E("queryLab");if(!s||!t||!a)return null;const n=(t.language||"").toUpperCase(),h=a==="TOF"?"ql-stage--tof":a==="MOF"?"ql-stage--mof":"ql-stage--bof";return e.jsxs("div",{className:y("drawer ql-drawer",s&&"open"),role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:"drawer-backdrop",onClick:i}),e.jsxs("div",{className:"drawer-panel",children:[e.jsxs("div",{className:"drawer-head",children:[e.jsxs("div",{children:[e.jsx("div",{className:"ql-dw-lbl",style:{marginBottom:5},children:l("drawer.title")}),e.jsx("div",{className:"ql-dw-q",children:t.query})]}),e.jsx("button",{type:"button",className:"btn btn--ghost btn--icon",onClick:i,"aria-label":l("drawer.close"),children:e.jsx(qe,{size:16,"aria-hidden":!0})})]}),e.jsxs("div",{className:"drawer-body",children:[e.jsx("div",{className:"ql-dw-sec",children:e.jsxs("div",{className:"ql-dw-grid",children:[e.jsxs("div",{className:"ql-dw-stat",children:[e.jsx("div",{className:"ql-dw-stat-l",children:l("drawer.stage")}),e.jsx("div",{className:"ql-dw-stat-v",children:e.jsx("span",{className:y("ql-stage",h),children:a})})]}),e.jsxs("div",{className:"ql-dw-stat",children:[e.jsx("div",{className:"ql-dw-stat-l",children:l("drawer.language")}),e.jsx("div",{className:"ql-dw-stat-v",children:n?e.jsx("span",{className:y("ql-lang",n==="AR"&&"ql-lang--ar"),children:n}):"—"})]}),e.jsxs("div",{className:"ql-dw-stat",children:[e.jsx("div",{className:"ql-dw-stat-l",children:t.editable?l("drawer.editable"):l("drawer.locked")}),e.jsx("div",{className:"ql-dw-stat-v",children:t.editable?l("drawer.yes"):l("drawer.no")})]})]})}),e.jsx("div",{className:"ql-dw-sec",children:e.jsx("p",{className:"muted sm",children:l("drawer.noVolume")})})]})]})]})}function Qe({gscConnected:s,bingConnected:t,gscSyncedAt:a,bingSyncedAt:i,settingsPath:l}){const{t:n,i18n:h}=E("queryLab"),x=c=>{if(!c)return n("sources.connected");try{const d=new Date(c);return Number.isNaN(d.getTime())?n("sources.connected"):n("sources.synced",{when:d.toLocaleStr
6ing(h.language==="ar"?"ar":"en",{dateStyle:"medium",timeStyle:"short"})})}catch{return n("sources.connected")}},u=[{key:"gsc",label:n("sources.gsc"),on:s,meta:s?x(a):n("sources.notConnected"),connectHref:s?void 0:l},{key:"bing",label:n("sources.bing"),on:t,meta:t?x(i):n("sources.notConnected"),connectHref:t?void 0:l},{key:"zaher",label:n("sources.zaher"),on:!0,meta:n("sources.alwaysOn")},{key:"copilot",label:n("sources.copilot"),on:!1,connectHref:l}];return e.jsx("div",{className:"ql-sources",children:u.map(c=>e.jsxs("div",{className:y("ql-src",c.on?"ql-src--on":"ql-src--off"),children:[e.jsx("span",{className:"ql-src-dot"}),e.jsx("span",{children:c.label}),c.meta?e.jsx("small",{children:c.meta}):null,c.connectHref?e.jsx(W,{to:c.connectHref,className:"ql-src-connect",children:n("sources.connect")}):null]},c.key))})}const C=["TOF","MOF","BOF"],De={TOF:"awareness",MOF:"consideration",BOF:"decision"};function V(s){return["/api/query-lab",s]}function Ue(){return{TOF:[],MOF:[],BOF:[]}}function _(s){return/[\u0600-\u06FF]/.test(s)?"AR":"EN"}function me(s){return C.reduce((t,a)=>{var i;return t+(((i=s[a])==null?void 0:i.length)??0)},0)}function Re(s,t=!0){return ge({queryKey:V(s),queryFn:async()=>{const a=await Z("GET",`/api/query-lab/${s}`);if(!a)throw new Error("Failed to load Query Lab");return a.json()},enabled:!!s&&t,staleTime:60*1e3})}function He(s){const t=ee();return se({mutationFn:async a=>{if(!s)throw new Error("Missing site");const i=await Z("PUT",`/api/query-lab/${s}/tracked`,{tracked:a});if(!i)throw new Error("Failed to save Query Lab");return i.json()},onSuccess:a=>{s&&t.setQueryData(V(s),i=>i?{...i,quota:a.quota,tracked:a.tracked}:{siteId:s,quota:a.quota,tracked:a.tracked})}})}function Ge(s){const t=ee();return se({mutationFn:async a=>{if(!s)throw new Error("Missing site");const l=await Z("POST",`/api/query-lab/${s}/generate${a?"?regenerate=1":""}`,{});if(!l)throw new Error("Failed to generate queries");return l.json()},onSuccess:async()=>{s&&await t.invalidateQueries({queryKey:V(s)})}})}function Ke(s){const t=ee();return se({mutationFn:async a=>{if(!s)throw new Error("Missing site");const i=await Z("POST",`/api/query-lab/${s}/regenerate-query`,{funnelStage:De[a.stage],stage:a.stage,index:a.index});if(!i)throw new Error("Failed to regenerate query");return i.json()},onSuccess:async()=>{s&&await t.invalidateQueries({queryKey:V(s)})}})}function _e(s){const t={TOF:[],MOF:[],BOF:[]};for(const a of C)t[a]=(s[a]??[]).map((i,l)=>({...i,index:i.index??l,localId:`${a}-${i.index??l}`}));return t}function We(s){return{TOF:s.TOF.map(t=>({...t})),MOF:s.MOF.map(t=>({...t})),BOF:s.BOF.map(t=>({...t}))}}function Ze({tracked:s,quota:t,search:a,langFilter:i,billingPath:l,generating:n,regeneratingKey:h,onChange:x,onGenerate:u,onRegenerate:c,onOpenDetail:d}){const{t:o}=E("queryLab"),{toast:g}=de(),[A,X]=q.useState("TOF"),[D,w]=q.useState({TOF:"",MOF:"",BOF:""}),U=q.useMemo(()=>_e(s),[s]),j=me(s),R=Math.max(1,t.max||1),M=Math.min(100,Math.round(j/R*100)),S=M>=100?"ql-quota-fill--crit":M>=85?"ql-quota-fill--warn":"",N=Math.max(0,j-(t.editableUsed??0)),H=r=>!(a&&!r.query.toLowerCase().includes(a.toLowerCase())||i!=="all"&&(r.language||_(r.query)).toUpperCase()!==i.toUpperCase()),T=(r,f)=>{x({...s,[r]:f.map((v,b)=>({...v,index:b,funnelStage:r}))})},P=r=>{const f=(D[r]||"").trim();if(!f)return;if(j>=t.max){g({title:o("tracked.quotaFull"),variant:"destructive"});return}if(C.some(b=>s[b].some(k=>k.query.trim().toLowerCase()===f.toLowerCase()))){g({title:o("tracked.duplicate"),variant:"destructive"});return}T(r,[...s[r],{index:s[r].length,query:f,editable:!0,language:_(f),funnelStage:r}]),w(b=>({...b,[r]:""}))};return j===0?e.jsxs("div",{className:"ql-pane active",id:"qlPane-tracked",children:[e.jsx("div",{className:"card",children:e.jsxs("div",{className:"ql-quota",children:[e.jsxs("div",{className:"ql-quota-main",children:[e.jsxs("div",{className:"ql-quota-row",children:[e.jsx("span",{className:"ql-quota-lbl",children:o("tracked.quotaLabel")}),e.jsxs("span",{className:"ql-quota-n",children:[e.jsx("b",{children:"0"})," / ",e.jsx("span",{children:t.max})]})]}),e.jsx("div",{className:"ql-quota-bar",children:e.jsx("div",{className:"ql-quota-fill",style:{width:"0%"}})})]}),e.jsxs(W,{className:"btn btn--secondary btn--sm",to:l,children:[e.jsx(le,{size:14,"aria-hidden":!0}),o("tracked.increaseQuota")]})]})}),e.jsxs("div",{className:"card empty-state",children:[e.jsx("div",{className:"empty-state-icon","aria-hidden":!0,
6children:e.jsx(Q,{size:20})}),e.jsx("div",{className:"empty-state-title",children:o("tracked.generateHint")}),e.jsxs("button",{type:"button",className:"btn btn--primary",disabled:n,onClick:u,children:[e.jsx(ie,{size:14,"aria-hidden":!0}),o(n?"tracked.generating":"tracked.generate")]})]})]}):e.jsxs("div",{className:"ql-pane active",id:"qlPane-tracked",children:[e.jsx("div",{className:"card",children:e.jsxs("div",{className:"ql-quota",children:[e.jsxs("div",{className:"ql-quota-main",children:[e.jsxs("div",{className:"ql-quota-row",children:[e.jsx("span",{className:"ql-quota-lbl",children:o("tracked.quotaLabel")}),e.jsxs("span",{className:"ql-quota-n",children:[e.jsx("b",{children:j})," / ",e.jsx("span",{children:t.max})]})]}),e.jsx("div",{className:"ql-quota-bar",children:e.jsx("div",{className:y("ql-quota-fill",S),style:{width:`${M}%`}})}),e.jsx("div",{className:"ql-quota-hint",children:o("tracked.quotaHint",{editable:t.editableUsed,locked:N})})]}),e.jsxs(W,{className:"btn btn--secondary btn--sm",to:l,children:[e.jsx(le,{size:14,"aria-hidden":!0}),o("tracked.increaseQuota")]})]})}),e.jsxs("div",{className:"ql-notice",children:[e.jsx(Ce,{"aria-hidden":!0}),e.jsx("span",{children:o("tracked.nextAudit")})]}),e.jsxs("div",{className:"card",children:[e.jsx("div",{className:"ql-fun-tabs",role:"tablist",children:C.map(r=>e.jsxs("button",{type:"button",role:"tab","aria-selected":A===r,className:y("ql-fun-tab",A===r&&"active"),onClick:()=>X(r),children:[e.jsx("span",{children:o(`tracked.funnel.${r}`)}),e.jsx("span",{className:"ql-fun-tab-stage",children:r}),e.jsx("span",{className:"ql-fun-tab-count",children:s[r].length})]},r))}),C.map(r=>{const v=U[r].filter(H),b=v.filter(m=>m.editable),k=v.filter(m=>!m.editable),G=A===r;return e.jsxs("div",{className:y("ql-fun-panel",G&&"active"),id:`qlFun-${r}`,hidden:!G,children:[e.jsxs("div",{className:y("ql-fun-intro",`ql-fun-intro--${r}`),children:[e.jsx("div",{className:"ql-fun-intro-ico",children:r==="TOF"?e.jsx(oe,{size:15,"aria-hidden":!0}):r==="MOF"?e.jsx(Q,{size:15,"aria-hidden":!0}):e.jsx(ie,{size:15,"aria-hidden":!0})}),e.jsxs("div",{style:{flex:1},children:[e.jsx("div",{className:"ql-fun-intro-title",children:o(`tracked.intro.${r}.title`)}),e.jsx("div",{className:"ql-fun-intro-desc",children:o(`tracked.intro.${r}.desc`)})]})]}),v.length?e.jsxs(e.Fragment,{children:[b.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"q-section-head",children:[e.jsx("span",{className:"q-section-label",children:o("tracked.editableSection")}),e.jsx("span",{className:"q-section-count",children:b.length})]}),b.map((m,F)=>e.jsx(ce,{n:F+1,query:m,regenerating:h===`${r}:${m.index}`,onOpen:()=>d(r,m),onEdit:L=>{const K=s[r].map(O=>O.index===m.index?{...O,query:L,language:_(L)}:O);T(r,K)},onRegen:()=>c(r,m.index),onRemove:()=>{T(r,s[r].filter(L=>L.index!==m.index))}},m.localId))]}),k.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"q-section-head",style:{marginTop:b.length?18:0},children:[e.jsx("span",{className:"q-section-label",children:o("tracked.lockedSection")}),e.jsx("span",{className:"q-section-count",children:k.length})]}),k.map((m,F)=>e.jsx(ce,{n:b.length+F+1,query:m,regenerating:!1,onOpen:()=>d(r,m)},m.localId))]})]}):e.jsxs("div",{className:"empty-state",children:[e.jsx("div",{className:"empty-state-title",children:o("tracked.emptyStage")}),e.jsx("div",{className:"empty-state-sub",children:o("tracked.emptyStageSub")})]}),e.jsxs("div",{className:"ql-add-row",style:{opacity:j>=t.max?.45:1},children:[e.jsx("input",{className:"input",type:"text",value:D[r],placeholder:o("tracked.addPlaceholder",{stage:o(`tracked.funnel.${r}`).toLowerCase()}),onChange:m=>w(F=>({...F,[r]:m.target.value})),onKeyDown:m=>{m.key==="Enter"&&P(r)},disabled:j>=t.max}),e.jsxs("button",{type:"button",className:"btn btn--primary btn--sm",style:{height:36},disabled:j>=t.max,onClick:()=>P(r),children:[e.jsx(Te,{size:14,"aria-hidden":!0}),o("tracked.add")]})]})]},r)})]})]})}function ce({n:s,query:t,regenerating:a,onOpen:i,onEdit:l,onRegen:n,onRemove:h}){const{t:x}=E("queryLab"),u=(t.language||_(t.query)).toUpperCase(),c=!t.editable;return e.jsxs("div",{className:y("ql-trk-row",c&&"ql-trk-row--locked"),children:[e.jsx("span",{className:"ql-trk-num",children:s}),e.jsx("span",{className:"ql-trk-main",children:c||!l?e.jsxs("button",{type:"button",className:"ql-trk-text",style:{background:"none",border:"none",textAlign:"start",cursor:"pointer",width:"100%",font:"inherit"},onClick:i,children:[t.query,e.jsx("span",{className:y("ql-lang",u==="AR"&&"ql-lang--ar"),children:u})]}):e.jsx("input",{className:"ql-trk-input",type:"text",value:t.query,onChange:d=>l(d.target.value),onDoubleClick:i})}),c?e.jsx("span",{className:"ql-trk-act",title:x("tracked.lockedTitle"),style:{cursor:"default"},children:e.jsx(Oe,{size:13,"aria-hidden":!0})}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"ql-trk-act",title:x("tracked.regen"),disabled:a,onClick:d=>{d.stopPropagation(),n==null||n()}
6,children:e.jsx(ue,{size:13,"aria-hidden":!0,className:a?"animate-spin":void 0})}),e.jsx("button",{type:"button",className:"ql-trk-act ql-trk-act--del",title:x("tracked.remove"),onClick:d=>{d.stopPropagation(),h==null||h()},children:e.jsx(ze,{size:13,"aria-hidden":!0})})]})]})}function Ve(s){return s==="tracked"?"tracked":"discovery"}function Xe(s,t){return C.every(a=>{const i=s[a]??[],l=t[a]??[];return i.length!==l.length?!1:i.every((n,h)=>{var x,u,c;return n.query===((x=l[h])==null?void 0:x.query)&&!!n.editable==!!((u=l[h])!=null&&u.editable)&&(n.language||"")===(((c=l[h])==null?void 0:c.language)||"")})})}function Ye(s,t){const a=[["stage","query","language","editable","domain"]];for(const x of C)for(const u of s[x]??[]){const c=u.language||"";a.push([x,`"${String(u.query).replace(/"/g,'""')}"`,c,u.editable?"true":"false",t])}const i=new Blob([a.map(x=>x.join(",")).join(`
7`)],{type:"text/csv;charset=utf-8"}),l=URL.createObjectURL(i),n=document.createElement("a"),h=new Date().toISOString().slice(0,10);n.href=l,n.download=`zaher-query-lab-${h}.csv`,n.click(),URL.revokeObjectURL(l)}function ps(){const{t:s}=E("queryLab"),{toast:t}=de(),{pathname:a}=Ne(),[i,l]=ke(),{currentClient:n,tabAccess:h,isLoading:x}=we(),u=(n==null?void 0:n.siteId)??null,c=(h==null?void 0:h.queryLab)??!1,{data:d,isLoading:o}=Ee(c?u:null),{data:g,isLoading:A,isError:X,refetch:D}=Re(u,c&&!!u),w=He(u),U=Ge(u),j=Ke(u),[R,M]=q.useState(null),[S,N]=q.useState(null),[H,T]=q.useState(""),[P,Y]=q.useState("all"),[r,f]=q.useState(null),v=Ve(i.get("tab")),b=p=>{l(B=>{const z=new URLSearchParams(B);return p==="discovery"?z.delete("tab"):z.set("tab",p),z},{replace:!0})},k=a==="/ar"||a.startsWith("/ar/"),G=Ae(a),m=k?"/ar/app/billing":"/app/billing",F=k?"/ar/business-profile?tab=topics":"/business-profile?tab=topics",L=(n==null?void 0:n.domain)||(n==null?void 0:n.name)||s("filterbar.workspaceFallback"),K=(d==null?void 0:d.providers.gsc.connected)??!1,O=(d==null?void 0:d.providers.bing.connected)??!1,he=K||O,ae=(g==null?void 0:g.tracked)??Ue(),I=S??ae,te=S!=null&&!Xe(S,ae),re=me(I);q.useEffect(()=>{M(document.getElementById("query-lab-filterbar"))},[]),q.useEffect(()=>{N(null),f(null)},[u]);const xe=(g==null?void 0:g.quota)??{used:re,max:0,editableUsed:0,editableMax:0},pe=q.useMemo(()=>!j.isPending||!j.variables?null:`${j.variables.stage}:${j.variables.index}`,[j.isPending,j.variables]),je=()=>{T(""),Y("all")},be=async()=>{if(S)try{await w.mutateAsync(S),t({title:s("toast.saved")}),N(null)}catch(p){t({title:s("errors.save"),description:p instanceof Error?p.message:void 0,variant:"destructive"})}},ve=async()=>{try{await U.mutateAsync(!1),N(null),t({title:s("toast.generated")})}catch(p){t({title:s("errors.generate"),description:p instanceof Error?p.message:void 0,variant:"destructive"})}},ye=async(p,B)=>{try{await j.mutateAsync({stage:p,index:B}),N(null),t({title:s("toast.regenerated")})}catch(z){t({title:s("errors.regen"),description:z instanceof Error?z.message:void 0,variant:"destructive"})}},$=R&&Se.createPortal(e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"filter-left",children:[e.jsx("span",{className:"chip chip--workspace",children:L}),v==="tracked"?e.jsx(e.Fragment,{children:e.jsxs("select",{className:"chip-select",value:P,onChange:p=>Y(p.target.value),title:s("filterbar.allLanguages"),children:[e.jsx("option",{value:"all",children:s("filterbar.allLanguages")}),e.jsx("option",{value:"EN",children:s("filterbar.langEn")}),e.jsx("option",{value:"AR",children:s("filterbar.langAr")})]})}):null,e.jsxs("span",{className:"input-group input-group--icon",style:{minWidth:160,maxWidth:230},children:[e.jsx("span",{className:"input-leading",children:e.jsx(J,{size:13,"aria-hidden":!0})}),e.jsx("input",{className:"input",type:"search",value:H,placeholder:s("filterbar.search"),onChange:p=>T(p.target.value),style:{height:32,fontSize:12}})]}),e.jsxs("button",{type:"button",className:"filterbar-reset",onClick:je,children:[e.jsx(ue,{size:12,"aria-hidden":!0}),s("filterbar.reset")]})]}),e.jsx("div",{className:"filter-right",children:e.jsxs("button",{type:"button",className:"btn btn--ghost btn--sm",onClick:()=>{Ye(I,L),t({title:s("filterbar.exportDone")})},children:[e.jsx(Me,{size:14,"aria-hidden":!0}),s("filterbar.export")]})})]}),R);return x?e.jsxs("div",{className:"zaher-query-lab-page",children:[$,e.jsx("div",{className:"card empty-state",children:e.jsx("p",{className:"muted sm",children:s("loading")})})]}):c?o||A?e.jsxs("div",{className:"zaher-query-lab-page",children:[$,e.jsx("div",{className:"card empty-state",children:e.jsx("p",{className:"muted sm",children:s("loading")})})]}):X?e.jsxs("div",{className:"zaher-query-lab-page",children:[$,e.jsxs("div",{className:"card empty-state",children:[e.jsx("p",{className:"muted sm",children:s("errors.load")}),e.jsx("button",{type:"button",className:"btn btn--secondary btn--sm",onClick:()=>D(),children:s("errors.retry")})]})]}):e.jsxs("div",{className:y("zaher-query-lab-page",te&&"ql-dirty"),children:[$,e.jsxs("div",{className:"ql-head",children:[e.jsxs("div",{children:[e.jsx("h1",{children:s("title")}),e.jsx("p",{children:s("subtitle")})]}),e.jsx("div",{className:"ql-head-actions",children:e.jsxs("button",{type:"button",className:"btn btn--primary btn--sm",onClick:()=>b("tracked"),children:[e.jsx(Q,{size:14,"aria-hidden":!0}),s("manageTracked")]})})]}),e.jsx(Qe,{gscConnected:K,bingConnected:O,gscSyncedAt:d==null?void 0:d.providers.gsc.lastSyncedAt,bingSyncedAt:d==null?void 0:d.providers.bing.lastSyncedAt,settingsPath:G}),e.jsxs("div",{className:"ql-tabs",role:"tablist",children:[e.jsxs("button",{type:"button",role:"tab","aria-selected":v==="discovery",className:y("ql-tab",v==="discovery"&&"active"),onClick:()=>b("discovery"),children:[e.jsx(J,{size:15,"aria-hidden":!0}),e.jsx("span",{children:s("tabs.discovery")}),e.jsx("span",{className:"ql-tab-count",children:"—"})]}),e.jsxs("button",{type:"button",role:"tab","aria-selected":v==="tracked",className:y("ql-tab",v==="tracked"&&"active"),onClick:()=>b("tracked"),children:[e.jsx(Q,{size:15,"aria-hidden":!0}),e.jsx("span",{children:s("tabs.tracked")}),e.jsx("span",{className:"ql-tab-count",children:re})]})]}),v==="discovery"?e.jsx($e,{hasSearchSource:he,profilePath:F}):e.jsx(Ze,{tracked:I,quota:xe,search:H,langFilter:P,billingPath:m,generating:U.isPending,regeneratingKey:pe,onChange:p=>N(We(p)),onGenerate:ve,onRegenerate:ye,onOpenDetail:(p,B)=>f({stage:p,query:B})}),te?e.jsxs("div",{className:"ql-save-bar",style:{display:"flex"},children:[e.jsx("span",{className:"ql-save-bar-txt",children:s("saveBar.unsaved")}),e.jsx("button",{type:"button",className:"btn btn--ghost",onClick:()=>N(null),disabled:w.isPending,children:s("saveBar.discard")}),e.jsxs("button",{type:"button",className:"btn btn--primary",onClick:be,disabled:w.isPending,children:[e.jsx(Q,{size:14,"aria-hidden":!0}),w.isPending?s("saveBar.saving"):s("saveBar.save")]})]}):null,e.jsx(Be,{open:!!r,query:(r==null?void 0:r.query)??null,stage:(r==null?void 0:r.stage)??null,onClose:()=>f(null)})]}):e.jsxs("div",{className:"zaher-query-lab-page",children:[$,e.jsx(Fe,{title:s("locked.title"),description:s("locked.description"),planRequired:"Discovery"})]})}
7export{ps as default};

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