PageSourceSearch

https://www.trybased.com/static/js/2023.7396651f.chunk.js

js trybased.com collected 2026-10-02 01:48:30 UTC 28,351 bytes, 3 lines download raw bytes

1/*! For license information please see 2023.7396651f.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkknowledge_base_saas=self.webpackChunkknowledge_base_saas||[]).push([[2023],{52023(e,t,s){s.r(t),s.d(t,{default:()=>F});var a=s(53986),n=s(5544),r=s(89379),l=s(65043),o=s(52395),i=s(94805),d=s(22024),c=s(14939),m=s(88693),u=s(92339),x=s(38288);const h=[x.qN.EMBED,x.qN.SHARED_SEARCH,x.qN.SHARED_DOCS,x.qN.FAQ_WIDGET],p=["identity","style","lexicon","whenWrong","registerShift","example"],g={identity:{label:"IDENTITY",hint:"One sentence north star \u2014 who is speaking, in plain terms.",rows:2},style:{label:"STYLE",hint:"Formality, sentence length, contractions, emoji and exclamation policy.",rows:3},lexicon:{label:"LEXICON",hint:"Words/phrases to prefer; words/phrases to avoid (including punctuation bans).",rows:3},whenWrong:{label:"WHEN THINGS GO WRONG",hint:"How this voice apologizes, handles frustration, and says \u201cI don\u2019t have that\u201d without going cold. About how things are said \u2014 never what gets committed to.",rows:4},registerShift:{label:"REGISTER SHIFT",hint:"Optional. When to drop the default voice (complaints, refunds, safety, upset customers).",rows:3,optional:!0},example:{label:"EXAMPLE",hint:"One neutral sentence rewritten in this voice (before \u2192 after). Highest-leverage line.",rows:2}},b=/^(IDENTITY|STYLE|LEXICON|WHEN THINGS GO WRONG|REGISTER SHIFT|EXAMPLE):\s*/im,y={IDENTITY:"identity",STYLE:"style",LEXICON:"lexicon","WHEN THINGS GO WRONG":"whenWrong","REGISTER SHIFT":"registerShift",EXAMPLE:"example"},f=Object.fromEntries(p.map(e=>[e,""])),v={professional:{id:"professional",label:"Professional",description:"Precise \u2014 insurance, legal, finance, B2B",sections:{identity:"A seasoned advisor at a firm that has done this for decades. Calm, exact, never salesy.",style:"Plain professional English. Medium sentences. Contractions fine. No emoji. No exclamation points.",lexicon:'Prefer "coverage", "policy", "we recommend". Avoid hype words like "amazing", "awesome", "super easy".',whenWrong:"Acknowledge the concern in one sentence, then give the concrete next step. Do not over-apologize or speculate. If you do not have the detail, say so and offer to connect them with the team.",registerShift:"",example:'Neutral: "We don\'t cover that." \u2192 Voice: "That isn\'t included in this policy. Here\'s what is, and I can have someone walk you through options."'}},warm:{id:"warm",label:"Warm",description:"Human \u2014 wellness, local service, healthcare-adjacent",sections:{identity:"A knowledgeable person who happens to work here and genuinely wants to help. Friend, not a FAQ.",style:"Casual but clear. Short sentences. Contractions always. One emoji at most, and only when the moment is light. Exclamation points sparingly.",lexicon:'Prefer "you", "let\'s", "happy to". Avoid "kindly", "as per", "we regret to inform".',whenWrong:'Lead with empathy in real words ("That sounds frustrating, let\'s sort it out"), then the answer. Never robotic, never gushing.',registerShift:"",example:'Neutral: "Your appointment is confirmed." \u2192 Voice: "You\'re all set for Tuesday. Anything else you\'d like to handle before then?"'}},playful:{id:"playful",label:"Playful",description:"Energetic \u2014 experiential, DTC, consumer (with guardrails)",sections:{identity:"Upbeat and a little witty, like the most fun person on the team.",style:"Short, punchy lines. Contractions always. Emoji okay when the topic is fun. Wordplay welcome.",lexicon:"Prefer vivid, specific verbs. Avoid corporate filler.",whenWrong:"",registerShift:"Drop the playfulness entirely for complaints, refunds, safety, or an upset customer. There, be plain, sincere, and fast. Humor in those moments reads as not listening.",example:'Neutral: "Here is the schedule." \u2192 Voice: "Here\'s the lineup so you can plan your day."'}}};function w(e){const t=(0,r.A)((0,r.A)({},f),e),s=[];return t.identity.trim()&&s.push("IDENTITY: ".concat(t.identity.trim())),t.style.trim()&&s.push("STYLE: ".concat(t.style.trim())),t.lexicon.trim()&&s.push("LEXICON: ".concat(t.lexicon.trim())),t.whenWrong.trim()&&s.push("WHEN THINGS GO WRONG: ".concat(t.whenWrong.trim())),t.registerShift.trim()&&s.push("REGISTER SHIFT: ".concat(t.registerShift.trim())),t.example.trim()&&s.push("EXAMPLE: ".concat(t.example.trim())),s.join("\n")}function j(e){const t=(0,r.A)({},f);if(!e||!String(e).trim())return t;const s=String(e).trim(),a=s.split(/\n(?=(?:IDENTITY|STYLE|LEXICON|WHEN THINGS GO WRONG|REGISTER SHIFT|EXAMPLE):)/i);if(1===a.length&&!b.test(s))return t.identity=s,t;for(const n of a){const e=n.trim();if(!e)continue;const s=e.match(/^([A-Z ]+):\s*([\s\S]*)$/i);if(!s)continue;const a=y[s[1].trim().toUpperCase()];a&&(t[a]=s[2].trim())}return t}function N(e){return h.includes(e)}function A(e){return e===x.qN.INTERNAL_AGENT}var k=s(77819),S=s(56099),E=s(15711),C=s(92382),T=s(70579);function G(e){let t=e.onClick,s=e.disabled,a=e.label,n=void 0===a?"Clear":a;return(0,T.jsx)("button",{type:"button",onClick:t,disabled:s,className:"text-xs text-gray-500 hover:text-gray-800 disabled:opacity-40",children:n})}function P(e){let t=e.surfaceId,s=e.value,a=e.onChange,o=e.onReset,i=e.disabled,d=void 0!==i&&i,c=e.applyToAllPublic,m=void 0!==c&&c,u=e.onApplyToAllPublicChange,x=e.hasSharedPersona,h=void 0!==x&&x,b=e.hasSurfaceOverride,y=void 0!==b&&b;const f=(0,l.useState)(()=>j(s)),P=(0,n.A)(f,2),M=P[0],I=P[1],O=(0,l.useState)(!1),q=(0,n.A)(O,2),R=q[0],F=q[1],W=(0,l.useState)(!1),H=(0,n.A)(W,2),L=H[0],D=H[1],_=(0,l.useState)({brandSentence:"",tone:"warm",soundsLike:"",neverWords:""}),B=(0,n.A)(_,2),Q=B[0],Y=B[1],V=A(t),X=N(t);(0,l.useEffect)(()=>{I(j(s))},[s,t]);const z=(0,l.useMemo)(()=>w(M),[M]),U=(0,l.useMemo)(()=>{return(e=z)&&String(e).trim()?String(e).trim().split(/\s+/).filter(
2Boolean).length:0;var e},[z]),K=U>500,Z=(0,l.useCallback)(e=>{I(e),a(w(e))},[a]);return V?(0,T.jsx)("div",{className:"rounded-lg border border-amber-200 bg-amber-50/80 p-4",children:(0,T.jsxs)("div",{className:"flex gap-2",children:[(0,T.jsx)(k.A,{className:"h-5 w-5 shrink-0 text-amber-700","aria-hidden":!0}),(0,T.jsxs)("div",{className:"text-sm text-amber-900",children:[(0,T.jsx)("p",{className:"font-medium",children:"No brand voice on Internal Agent / FAB"}),(0,T.jsx)("p",{className:"mt-1 text-amber-800/90",children:"Keep personality empty here. The internal agent needs speed and direct answers with source brackets \u2014 not customer-facing brand softening. Brand voice applies to public surfaces via shared settings below."})]})]})}):(0,T.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-gray-50/50 p-4 space-y-4",children:[(0,T.jsx)("div",{children:(0,T.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("h4",{className:"text-sm font-semibold text-gray-900",children:"Personality prompt"}),(0,T.jsx)("p",{className:"mt-1 text-xs text-gray-600 max-w-2xl",children:"Observable behavior, not adjectives. This layers on tone and voice only \u2014 it cannot override grounding, facts, or \u201cI don\u2019t have that\u201d honesty. Avoid promises like \u201calways make the customer happy\u201d that fight the guardrails."})]}),(0,T.jsx)(G,{onClick:o,disabled:d,label:"Reset to default"})]})}),X&&u&&(0,T.jsxs)("label",{className:"flex items-start gap-2 rounded-md border border-blue-100 bg-blue-50/60 px-3 py-2 text-sm text-gray-800",children:[(0,T.jsx)("input",{type:"checkbox",className:"mt-0.5",checked:m,onChange:e=>u(e.target.checked),disabled:d}),(0,T.jsxs)("span",{children:[(0,T.jsx)("span",{className:"font-medium",children:"Apply to all public surfaces"}),(0,T.jsxs)("span",{className:"block text-xs text-gray-600 mt-0.5",children:["Saves to shared defaults (embed, shared search, shared docs, FAQ). Per-surface overrides still win when set.",h&&m&&" Shared voice is active.",y&&!m&&" This surface has its own override."]})]})]}),(0,T.jsxs)("div",{children:[(0,T.jsx)("p",{className:"text-xs font-medium text-gray-700 mb-2",children:"Start from a preset (editable)"}),(0,T.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.values(v).map(e=>(0,T.jsxs)("button",{type:"button",disabled:d,onClick:()=>(e=>{const t=v[e];t&&Z((0,r.A)({},t.sections))})(e.id),className:"rounded-md border border-gray-300 bg-white px-3 py-1.5 text-left text-sm hover:border-gray-400 hover:bg-gray-50 disabled:opacity-50",children:[(0,T.jsx)("span",{className:"font-medium text-gray-900",children:e.label}),(0,T.jsx)("span",{className:"block text-xs text-gray-500",children:e.description})]},e.id))})]}),(0,T.jsxs)("div",{className:"border border-gray-200 rounded-md bg-white overflow-hidden",children:[(0,T.jsxs)("button",{type:"button",onClick:()=>D(e=>!e),className:"flex w-full items-center justify-between px-3 py-2 text-sm font-medium text-gray-800 hover:bg-gray-50",children:[(0,T.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,T.jsx)(S.A,{className:"h-4 w-4 text-indigo-600"}),"Quick build from four answers"]}),L?(0,T.jsx)(E.A,{className:"h-4 w-4"}):(0,T.jsx)(C.A,{className:"h-4 w-4"})]}),L&&(0,T.jsxs)("div",{className:"border-t border-gray-100 px-3 py-3 space-y-3 bg-white",children:[(0,T.jsxs)("label",{className:"block text-xs text-gray-700",children:["Describe the brand in one sentence",(0,T.jsx)("input",{type:"text",value:Q.brandSentence,onChange:e=>Y(t=>(0,r.A)((0,r.A)({},t),{},{brandSentence:e.target.value})),className:"mt-1 block w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm",placeholder:"e.g. A family-owned HVAC company that's been in town 40 years"})]}),(0,T.jsxs)("label",{className:"block text-xs text-gray-700",children:["Tone",(0,T.jsxs)("select",{value:Q.tone,onChange:e=>Y(t=>(0,r.A)((0,r.A)({},t),{},{tone:e.target.value})),className:"mt-1 block w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm",children:[(0,T.jsx)("option",{value:"professional",children:"Formal / professional"}),(0,T.jsx)("option",{value:"warm",children:"Warm / human"}),(0,T.jsx)("option",{value:"playful",children:"Playful / energetic"})]})]}),(0,T.jsxs)("label",{className:"block text-xs text-gray-700",children:["Name a brand you sound like (optional)",(0,T.jsx)("input",{type:"text",value:Q.soundsLike,onChange:e=>Y(t=>(0,r.A)((0,r.A)({},t),{},{soundsLike:e.target.value})),className:"mt-1 block w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm",placeholder:"e.g. how Mint used to write help articles"})]}),(0,T.jsxs)("label",{className:"block text-xs text-gray-700",children:["Two words a customer should never hear from you",(0,T.jsx)("input",{type:"text",value:Q.neverWords,onChange:e=>Y(t=>(0,r.A)((0,r.A)({},t),{},{neverWords:e.target.value})),className:"mt-1 block w-full rounded-md border border-gray-300 px-2 py-1.5 text-sm",placeholder:'e.g. "kindl
2y", corporate jargon'})]}),(0,T.jsx)("button",{type:"button",onClick:()=>{const e=function(e){const t=(e.brandSentence||"").trim(),s=(e.tone||"balanced").trim().toLowerCase(),a=(e.soundsLike||"").trim(),n=(e.neverWords||"").trim();let r=v.warm.sections;"formal"!==s&&"professional"!==s||(r=v.professional.sections),"playful"!==s&&"casual-energetic"!==s||(r=v.playful.sections);const l=t?t.endsWith(".")?t:"".concat(t,"."):r.identity;let o=r.style;a&&(o="".concat(o," Sound similar in register to: ").concat(a,"."));let i=r.lexicon;return n&&(i="".concat(i," Never use: ").concat(n,".")),{identity:l,style:o,lexicon:i,whenWrong:r.whenWrong,registerShift:r.registerShift,example:r.example}}(Q);Z(e),D(!1)},className:"text-sm font-medium text-blue-700 hover:text-blue-800",children:"Fill structured fields"})]})]}),R?(0,T.jsx)("textarea",{rows:14,value:z,onChange:e=>{return t=e.target.value,a(t),void I(j(t));var t},disabled:d,className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm font-mono"}):(0,T.jsx)("div",{className:"space-y-3",children:p.map(e=>{const t=g[e];return(0,T.jsxs)("div",{children:[(0,T.jsxs)("label",{className:"block text-xs font-semibold uppercase tracking-wide text-gray-700 mb-0.5",children:[t.label,t.optional?(0,T.jsx)("span",{className:"ml-1 font-normal normal-case text-gray-500",children:"(optional)"}):null]}),(0,T.jsx)("p",{className:"text-xs text-gray-500 mb-1",children:t.hint}),(0,T.jsx)("textarea",{rows:t.rows,value:M[e]||"",onChange:t=>((e,t)=>{Z((0,r.A)((0,r.A)({},M),{},{[e]:t}))})(e,t.target.value),disabled:d,className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm disabled:bg-gray-100"})]},e)})}),(0,T.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs",children:[(0,T.jsx)("button",{type:"button",onClick:()=>F(e=>!e),className:"text-blue-700 hover:text-blue-800 font-medium",children:R?"Edit structured sections":"Edit as plain text"}),(0,T.jsxs)("span",{className:K?"text-amber-700 font-medium":"text-gray-500",children:[U," words",K&&" \u2014 consider trimming (best personas are ~150\u2013350 words)"]})]})]})}const M=["personaPrompt"],I=[{key:"searchLimit",label:"Search limit",min:1,max:100,step:1},{key:"scoreThreshold",label:"Score threshold",min:0,max:1,step:.05},{key:"maxContextTokens",label:"Max context tokens",min:500,max:32e3,step:100},{key:"maxContextChunks",label:"Max context chunks",min:1,max:50,step:1},{key:"answerMaxTokens",label:"Answer max tokens",min:100,max:16e3,step:100},{key:"answerTemperature",label:"Answer temperature",min:0,max:2,step:.05}],O=[{key:"generalInstructionPrompt",label:"Guardrail prompt (general)",rows:10},{key:"groundingDisclaimer",label:"Off-document disclaimer",rows:2},{key:"groundingStrictNoAnswerMessage",label:"Strict no-answer reply (shown when Strict + no matching documents)",rows:3}];function q(e){const t=Number(e)||0;return t<=33?"Strict \u2014 documents only":t<=66?"Blended \u2014 documents first, then general knowledge":"Open \u2014 general knowledge when docs lack detail"}function R(e){let t=e.onClick,s=e.disabled;return(0,T.jsxs)("button",{type:"button",onClick:t,disabled:s,className:"inline-flex items-center gap-1 text-xs text-gray-500 hover:text-gray-800 disabled:opacity-40",title:"Reset to built-in default",children:[(0,T.jsx)(i.A,{className:"h-3 w-3"}),"Default"]})}function F(){var e,t,s,i,h,p,g,b;const y=(0,l.useState)(!0),f=(0,n.A)(y,2),v=f[0],w=f[1],j=(0,l.useState)(!1),k=(0,n.A)(j,2),S=k[0],E=k[1],C=(0,l.useState)(null),G=(0,n.A)(C,2),F=G[0],W=G[1],H=(0,l.useState)({}),L=(0,n.A)(H,2),D=L[0],_=L[1],B=(0,l.useState)(x.qV[0]),Q=(0,n.A)(B,2),Y=Q[0],V=Q[1],X=(0,l.useState)({}),z=(0,n.A)(X,2),U=z[0],K=z[1],Z=(0,l.useState)({}),$=(0,n.A)(Z,2),J=$[0],ee=$[1],te=(0,l.useState)(!0),se=(0,n.A)(te,2),ae=se[0],ne=se[1],re=(0,l.useCallback)(async()=>{w(!0);try{const e=(0,o.httpsCallable)((0,o.getFunctions)(),"getRagSettings"),t=(await e()).data||{};W(t.defaults||null),_(t.stored||{})}catch(e){u.Ay.error((null===e||void 0===e?void 0:e.message)||"Failed to load RAG settings")}finally{w(!1)}},[]);(0,l.useEffect)(()=>{re()},[re]);const le=(0,l.useMemo)(()=>{var e;return F&&(null===(e=F.surfaces)||void 0===e?void 0:e[Y])||{}},[F,Y]);(0,l.useEffect)(()=>{var e,t;if(!F)return;K(function(e,t,s){var a,n;const l=(0,r.A)({},(null===e||void 0===e||null===(a=e.surfaces)||void 0===a?void 0:a[s])||{});return null!==t&&void 0!==t&&t.shared&&"object"===typeof t.shared&&Object.assign(l,t.shared),null!==t&&void 0!==t&&null!==(n=t.surfaces)&&void 0!==n&&n[s]&&"object"===typeof t.surfaces[s]&&Object.assign(l,t.surfaces[s]),l}(F,D,Y)),ee(function(e,t){return(0,r.A)((0,r.A)({},(null===e||void 0===e?void 0:e.faqGeneration)||{}),(null===t||void 0===t?void 0:t.faqGeneration)||{})}(F,D));const s=null===D||void 0===D||null===(e=D.surfaces)||void 0===e||null===(t=e[Y])||void 0===t?void 0:t.personaPrompt;ne(N(Y)&&void 0===s)},[F,D,Y]);const oe=Boolean(null===D||void 0===D||null===(e=D.shared)||void 0===e||null===(t=e.personaPrompt)||void 0===t?void 0:t.trim()),ie=void 0!==(null===D||void 0===D||null===(s=D.surfaces)||void 0===s||null===(i=s[Y])||void 0===i?void 0:i.personaPrompt),de=(e,t)=>{K(s=>(0,r.A)((0,r.A)({},s),{},{[e]:t}))},ce=e=>{le&&de(e,le[e])},me=(e,t)=>
2{ee(s=>(0,r.A)((0,r.A)({},s),{},{[e]:t}))},ue=e=>{null!==F&&void 0!==F&&F.faqGeneration&&me(e,F.faqGeneration[e])};return v||!F?(0,T.jsxs)("div",{className:"flex items-center justify-center py-16 text-gray-500 gap-2",children:[(0,T.jsx)(d.A,{className:"h-5 w-5 animate-spin"}),"Loading RAG settings\u2026"]}):(0,T.jsxs)("div",{className:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:[(0,T.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,T.jsx)("div",{className:"p-2 rounded-lg bg-indigo-50 text-indigo-600",children:(0,T.jsx)(c.A,{className:"h-6 w-6"})}),(0,T.jsxs)("div",{children:[(0,T.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:"AI / Chatbot (RAG)"}),(0,T.jsx)("p",{className:"text-sm text-gray-600",children:"Per-surface defaults for public chatbots, the internal agent/FAB, and partner Test AI preview. Personality prompts are additive; guardrails stay in effect."})]})]}),(0,T.jsxs)("section",{className:"mb-10 rounded-xl border border-gray-200 bg-white p-6 shadow-sm",children:[(0,T.jsxs)("div",{className:"flex flex-wrap items-end justify-between gap-4 mb-6",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("label",{htmlFor:"rag-surface-select",className:"block text-sm font-medium text-gray-700 mb-1",children:"Surface"}),(0,T.jsx)("select",{id:"rag-surface-select",value:Y,onChange:e=>V(e.target.value),className:"rounded-md border border-gray-300 px-3 py-2 text-sm min-w-[240px]",children:x.qV.map(e=>(0,T.jsx)("option",{value:e,children:x.v1[e]||e},e))})]}),(0,T.jsxs)("button",{type:"button",onClick:async()=>{E(!0);try{var e;const s=(0,o.httpsCallable)((0,o.getFunctions)(),"updateRagSettings"),n=U.personaPrompt,r=(0,a.A)(U,M),l=(null===D||void 0===D||null===(e=D.surfaces)||void 0===e?void 0:e[Y])||{},i=e=>Object.prototype.hasOwnProperty.call(l,e),d={},c=[];for(const e of Object.keys(r)){const t=r[e];void 0!==t&&(t!==le[e]?d[e]=t:i(e)&&c.push(e))}const m={},h={};if(!A(Y)){const e=n||"";if(ae&&N(Y)){var t;e?m.shared={personaPrompt:e}:void 0!==(null===D||void 0===D||null===(t=D.shared)||void 0===t?void 0:t.personaPrompt)&&(h.shared=["personaPrompt"]),i("personaPrompt")&&c.push("personaPrompt")}else{e!==(le.personaPrompt||"")?d.personaPrompt=e:i("personaPrompt")&&c.push("personaPrompt")}}if(Object.keys(d).length&&(m.surfaces={[Y]:d}),c.length&&(h.surfaces={[Y]:[...new Set(c)]}),Object.keys(h).length&&(m.resets=h),!m.surfaces&&!m.shared&&!m.resets)return void u.Ay.success("No changes to save");await s(m),u.Ay.success("Saved ".concat(x.v1[Y]||Y," settings")),await re()}catch(s){u.Ay.error((null===s||void 0===s?void 0:s.message)||"Failed to save settings")}finally{E(!1)}},disabled:S,className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",children:[S?(0,T.jsx)(d.A,{className:"h-4 w-4 animate-spin"}):(0,T.jsx)(m.A,{className:"h-4 w-4"}),"Save surface settings"]})]}),(0,T.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-4",children:"Answering (RAG)"}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-6",children:[(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,T.jsx)("label",{htmlFor:"answerModel",className:"text-sm font-medium text-gray-700",children:"Answer model"}),(0,T.jsx)(R,{onClick:()=>ce("answerModel"),disabled:S})]}),(0,T.jsx)("input",{id:"answerModel",type:"text",value:U.answerModel||"",onChange:e=>de("answerModel",e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm"})]}),(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,T.jsx)("label",{htmlFor:"rewriteModel",className:"text-sm font-medium text-gray-700",children:"Rewrite model"}),(0,T.jsx)(R,{onClick:()=>ce("rewriteModel"),disabled:S})]}),(0,T.jsx)("input",{id:"rewriteModel",type:"text",value:U.rewriteModel||"",onChange:e=>de("rewriteModel",e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm"})]}),I.map(e=>{var t;let s=e.key,a=e.label,n=e.min,r=e.max,l=e.step;return(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,T.jsx)("label",{htmlFor:s,className:"text-sm font-medium text-gray-700",children:a}),(0,T.jsx)(R,{onClick:()=>ce(s),disabled:S})]}),(0,T.jsx)("input",{id:s,type:"number",min:n,max:r,step:l,value:null!==(t=U[s])&&void 0!==t?t:"",onChange:e=>de(s,Number(e.target.value)),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm"})]},s)}),(0,T.jsx)("div",{className:"sm:col-span-2",children:(0,T.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700",children:[(0,T.jsx)("input",{type:"checkbox",checked:!!U.rewriteEnabled,onChange:e=>de("rewriteEnabled",e.target.checked)}),"Enable query rewrite"]})})]}),(0,T.jsxs)("div",{className:"mb-6 p-4 rounded-lg bg-gray-50 border border-gray-100",children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,T.jsxs)("label",{htmlFor:"groundingOpenness",className:"text-sm font-medium text-gray-900",children:["Grounding openness (",null!==(h=U.groundingOpenness)&&void 0!==h?h:0,")"]}),(0,T.jsx)(R,{onClick:()=>ce("groundingOpenness"),disabled:S})]}),(0,T.jsx)("input",{id:"groundingOpenness",type:"range",min:0,max:100,step:1,value:null!==(p=U.groundingOpenness)&&void 0!==p?p:0,onChange:e=>de("groundingOpenness",Number(e.target.value)),className:"w-full"}),(0,T.jsx)("p",{className:"mt-2 text-sm text-gray-600",children:q(U.groundingOpenness)}),(0,T.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:"0\u201333 Strict \xb7 34\u201366 Blended \xb7 67\u2013100 Open. Strict is enforced server-side: when no documents match, the model is skipped and the strict no-answer reply is returned. Blended/Open off-document answers use the disclaimer below."})]}),(0,T.jsx)("div",{className:"space-y-4 mb-6",children:O.map(e=>{let t=e.key,s=e.label,a=e.rows;return(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,T.jsx)("label",{htmlFor:t,className:"text-sm font-medium text-gray-700",children:s}),(0,T.jsx)(R,{onClick:()=>ce(t),disabled:S})]}),(0,T.jsx)("textarea",{id:t,rows:a,value:U[t]||"",onChange:e=>de(t,e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm font-mono"})]},t)})}),(0,T.jsx)(P,{surfaceId:Y,value:U.personaPrompt||"",onChange:e=>de("personaPrompt",e),onReset:()=>ce("personaPrompt"),disabled:S,applyToAllPublic:ae,onApplyToAllPublicChange:ne,hasSharedPersona:oe,hasSurfaceOverride:ie})]}),(0,T.jsxs)("section",{className:"rounded-xl border border-gray-200 bg-white p-6 shadow-sm",children:[(0,T.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 mb-4",children:[(0,T.jsxs)("div",{children:[(0,T.jsx)("h3",{className:"text-sm font-semibold text-gray-900",children:"FAQ question generation"}),(0,T.jsx)("p",{className:"text-xs text-gray-500 mt-1",children:"Controls getFAQData (suggested questions), not answer behavior."})]}),(0,T.jsxs)("button",{type:"button",onClick:async()=>{E(!0);try{const e=(0,o.httpsCallable)((0,o.getFunctions)(),"updateRagSettings");await e({faqGeneration:J}),u.Ay.success("Saved FAQ question-generation settings"),await re()}catch(e){u.Ay.error((null===e||void 0===e?void 0:e.message)||"Failed to save FAQ settings")}finally{E(!1)}},disabled:S,className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md hover:bg-blue-700 disabled:opacity-50",children:[S?(0,T.jsx)(d.A,{className:"h-4 w-4 animate-spin"}):(0,T.jsx)(m.A,{className:"h-4 w-4"}),"Save FAQ generation"]})]}),(0,T.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4",children:[(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,T.jsx)("label",{htmlFor:"faqGenerationModel",className:"text-sm font-medium text-gray-700",children:"Model"}),(0,T.jsx)(R,{onClick:()=>ue("faqGenerationModel"),disabled:S})]}),(0,T.jsx)("input",{id:"faqGenerationModel",type:"text",value:J.faqGenerationModel||"",onChange:e=>me("faqGenerationModel",e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm"})]}),(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,T.jsx)("label",{htmlFor:"faqGenerationTemperature",className:"text-sm font-medium text-gray-700",children:"Temperature"}),(0,T.jsx)(R,{onClick:()=>ue("faqGenerationTemperature"),disabled:S})]}),(0,T.jsx)("input",{id:"faqGenerationTemperature",type:"number",min:0,max:2,step:.05,value:null!==(g=J.faqGenerationTemperature)&&void 0!==g?g:"",onChange:e=>me("faqGenerationTemperature",Number(e.target.value)),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm"})]}),(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,T.jsx)("label",{htmlFor:"faqGenerationMaxTokens",className:"text-sm font-medium text-gray-700",children:"Max tokens"}),(0,T.jsx)(R,{onClick:()=>ue("faqGenerationMaxTokens"),disabled:S})]}),(0,T.jsx)("input",{id:"faqGenerationMaxTokens",type:"number",min:100,max:4e3,step:50,value:null!==(b=J.faqGenerationMaxTokens)&&void 0!==b?b:"",onChange:e=>me("faqGenerationMaxTokens",Number(e.target.value)),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm"})]})]}),(0,T.jsxs)("div",{className:"mb-4",children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,T.jsx)("label",{htmlFor:"faqGenerationSystemPrompt",className:"text-sm font-medium text-gray-700",children:"System prompt"}),(0,T.jsx)(R,{onClick:()=>ue("faqGenerationSystemPrompt"),disabled:S})]}),(0,T.jsx)("textarea",{id:"faqGenerationSystemPrompt",rows:3,value:J.faqGenerationSystemPrompt||"",onChange:e=>me("faqGenerationSystemPrompt",e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm font-mono"})]}),(0,T.jsxs)("div",{children:[(0,T.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,T.jsx)("label",{htmlFor:"faqGenerationPrompt",className:"text-sm font-medium text-gray-700",children:"User prompt template"}),(0,T.jsx)(R,{onClick:()=>ue("faqGenerationPrompt"),disabled:S})]}),(0,T.jsx)("textarea",{id:"faqGenerationPrompt",rows:12,value:J.faqGenerationPrompt||"",onChange:e=>me("faqGenerationPrompt",e.target.value),className:"w-full rounded-md border border-gray-300 px-3 py-2 text-sm font-mono"}),(0,T.jsxs)("p",{className:"mt-1 text-xs text-gray-500",children:["Placeholders: ","{{count}}",", ","{{documents}}"]})]})]})]})}}
2,38288(e,t,s){s.d(t,{qN:()=>a,qV:()=>r,v1:()=>n});const a={EMBED:"embed",SHARED_SEARCH:"sharedSearch",SHARED_DOCS:"sharedDocs",FAQ_WIDGET:"faqWidget",INTERNAL_AGENT:"internalAgent",PARTNER_PREVIEW:"partnerPreview",MASCOT:"mascot"},n={[a.EMBED]:"Embed chat widget",[a.SHARED_SEARCH]:"Shared search view",[a.SHARED_DOCS]:"Shared documents view",[a.FAQ_WIDGET]:"FAQ widget",[a.INTERNAL_AGENT]:"Internal Agent/FAB",[a.PARTNER_PREVIEW]:"Partner console \u2014 Test AI",[a.MASCOT]:"Talking mascot (spoken answers)"},r=Object.values(a)},94805(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},88693(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},56099(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])}}]);
3//# sourceMappingURL=2023.7396651f.chunk.js.map

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.