1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,334521,e=>{"use strict";var t=e.i(843476),n=e.i(271645),l=e.i(948148);let i=(0,e.i(456420).default)("user-round-pen",[["path",{d:"M2 21a8 8 0 0 1 10.821-7.487",key:"1c8h7z"}],["path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1817ys"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}]]);var r=e.i(132689),a=e.i(110482),s=e.i(75080),o=e.i(17431),c=e.i(470125),d=e.i(573798),u=e.i(796420),h=e.i(427038),m=e.i(667310);e.i(475110);var f=e.i(61358),p=e.i(301739),g=e.i(334300),x=e.i(471390),y=e.i(594128);function v(){return(0,t.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M15 18l-6-6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function b(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 5v14M5 12h14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function j({channelId:e,locale:i,onClose:r,onSelect:a,onNew:s}){let o=(0,l.useTranslations)("AdminProductos.coursePreview"),[c,d]=(0,n.useState)(null),[u,h]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let t=!0;return(async()=>{try{let n=await fetch(`/api/hosted/conversations?channelId=${e}`);if(!n.ok)throw Error("load_failed");let l=await n.json(),r=Date.now(),a=(Array.isArray(l.conversations)?l.conversations:[]).map(e=>({...e,dateLabel:function(e,t){let n=Math.max(0,Math.floor((t-new Date(e).getTime())/1e3));if(n<60)return o("relNow");let l=Math.floor(n/60);if(l<60)return o("relMinutes",{n:l});let r=Math.floor(l/60);if(r<24)return o("relHours",{n:r});let a=Math.floor(r/24);return a<7?o("relDays",{n:a}):new Date(e).toLocaleDateString("en"===i?"en":"es")}(e.lastMessageAt,r)}));t&&d(a)}catch{t&&h(!0)}})(),()=>{t=!1}},[e]),(0,t.jsxs)("div",{className:"clonify-history",children:[(0,t.jsxs)("div",{className:"clonify-historyHeader",children:[(0,t.jsx)("button",{type:"button",className:"clonify-historyBack",onClick:r,"aria-label":o("historyBack"),title:o("historyBack"),children:(0,t.jsx)(v,{})}),(0,t.jsx)("div",{className:"clonify-historyTitle",children:o("historyTitle")})]}),(0,t.jsxs)("button",{type:"button",className:"clonify-historyNew",onClick:s,children:[(0,t.jsx)(b,{}),(0,t.jsx)("span",{children:o("newConversation")})]}),(0,t.jsx)("div",{className:"clonify-historyList",children:u?(0,t.jsx)("div",{className:"clonify-historyEmpty",children:o("historyError")}):null===c?(0,t.jsx)("div",{className:"clonify-historyEmpty",children:o("historyLoading")}):0===c.length?(0,t.jsx)("div",{className:"clonify-historyEmpty",children:o("historyEmpty")}):c.map(e=>{let n=e.preview?.trim()||e.title?.trim()||o("historyUntitled");return(0,t.jsxs)("button",{type:"button",className:"clonify-historyItem",onClick:()=>a(e.id),children:[(0,t.jsx)("div",{className:"clonify-historyItemPreview",children:n}),(0,t.jsx)("div",{className:"clonify-historyItemMeta",children:e.dateLabel})]},e.id)})})]})}var w=e.i(652086),k=e.i(918093),N=e.i(81971);let C=/\n?\[\[__msg_id:(\d+)__\]\]\s*$/,M=/\n?\[\[__winner:([a-z_]+)__\]\]\s*$/,I=/\[\[product:(\d+)\]\]/g,L=/\[\[asset:(\d+)\]\]/g,S=/\[\[video:([^\]]+)\]\]/g,B=/\[\[link:([^\]]+)\]\]/g,T=/\[\[form:(\d+)\]\]/g,E="[[edit_learning_profile]]";function U(e){let t=(0,r.extractEntregable)(e);null!==t&&(e=(0,r.stripEntregable)(e));let n=[],l=[],i=[],a=[],s=new Set;for(let t of e.matchAll(I)){let e=Number.parseInt(t[1],10);Number.isInteger(e)&&!s.has(e)&&(s.add(e),n.push(e))}let o=new Set;for(let t of e.matchAll(L)){let e=Number.parseInt(t[1],10);Number.isInteger(e)&&!o.has(e)&&(o.add(e),l.push(e))}let c=new Set;for(let t of e.matchAll(S)){let e=t[1].trim();e.length>0&&!c.has(e)&&(c.add(e),i.push(e))}let d=new Set;for(let t of e.matchAll(B)){let e=t[1],n=e.indexOf("|"),l=-1===n?e.trim():e.slice(0,n).trim(),i=-1===n?null:e.slice(n+1).trim()||null;l.length>0&&!d.has(l)&&(d.add(l),a.push({url:l,label:i}))}let u=[],h=new Set;for(let t of e.matchAll(T)){let e=Number.parseInt(t[1],10);Number.isInteger(e)&&!h.has(e)&&(h.add(e),u.push(e))}let m=e.includes("[[escalate_offer]]"),f=e.includes("[[coupon_offer]]"),p=e.includes(E);return{text:e.replace(I,"").replace(L,"").replace(S,"").replace(B,"").replace(T,"").replace(E,"").replace(/\[\[[^\]]+\]\]/g,"").replace(/\[\[[^\]]*$/,"").trim(),productIds:n,assetIds:l,videoUrls:i,linkButtons:a,formIds:u,hasEscalate:m,couponOffered:f,hasLearningProfileAction:p,entregable:t}}function $(e){return"application/pdf"===e.type||/\.pdf$/i.test(e.name)}
1function A(e){return new Promise(t=>{let n=URL.createObjectURL(e),l=new Image;l.onload=()=>{URL.revokeObjectURL(n);let e=Math.min(1,1568/Math.max(l.width,l.height)),i=Math.max(1,Math.round(l.width*e)),r=Math.max(1,Math.round(l.height*e)),a=document.createElement("canvas");a.width=i,a.height=r;let s=a.getContext("2d");if(!s)return void t(null);s.drawImage(l,0,0,i,r);let o=a.toDataURL("image/jpeg",.85),c=o.indexOf(",");t({id:crypto.randomUUID(),mediaType:"image/jpeg",dataBase64:c>=0?o.slice(c+1):o,previewUrl:o})},l.onerror=()=>{URL.revokeObjectURL(n),t(null)},l.src=n})}function R(){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function P(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function W(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function D(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function _(){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 19V5M5 12l7-7 7 7",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function O(){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0,t.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5",fill:"currentColor"}),(0,t.jsx)("path",{d:"M21 15l-5-5L5 21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function F(){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M14 3v5h5",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"})]})}function H(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 5v14M5 12h14",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function z(){return(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M4 3.5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v18l-2.5-1.5L15 21.5 12.5 20 10 21.5 7.5 20 5 21.5v-18z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M9 8h6M9 12h6M9 16h3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function V(){return(0,t.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M15 18l-6-6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function K(){return(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M3 3v5h5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M3.05 13A9 9 0 1 0 6 5.3L3 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M12 7v5l3 2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function J(){return(0,t.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",stroke:"currentColor",strokeWidth:"2"}),(0,t.jsx)("path",{d:"M9 3v18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"m14 9 3 3-3 3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function q(){return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M19 10a7 7 0 0 1-14 0M12 19v3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function G(){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("polyline",{points:"20 6 9 17 4 12",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function X(){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M7 22V11M2 13v7a2 2 0 0 0 2 2h2v-9H4a2 2 0 0 0-2 2zM21.4 11.4l-1.3 7A2 2 0 0 1 18.1 20H10V11l3.5-8a1.5 1.5 0 0 1 3 0v6h4.4a2 2 0 0 1 2 2.4z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Q(){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M17 2v11M22 11V4a2 2 0 0 0-2-2h-2v9h2a2 2 0 0 0 2-2zM2.6 12.6l1.3-7A2 2 0 0 1 5.9 4H14v9l-3.5 8a1.5 1.5 0 0 1-3 0v-6H3.1a2 2 0 0 1-2-2.4z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Y(){return(0,t.jsx)("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10zM12 7v6M9 10h6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Z({content:e,channelId:n,conversationId:s,thinkingLabel:m,onFormSubmitted:f,onFormCloneReply:p,onFormConversationCreated:g,learningProfileHref:x}){let y=(0,l.useTranslations)("AdminProductos.coursePreview"),v=U(e),b=null!==v.entregable||v.productIds.length>0||v.assetIds.length>0||v.videoUrls.length>0||v.linkButtons.length>0||v.formIds.length>0||v.hasLearningProfileAction&&!!x;return 0!==v.text.length||b?(0,t.jsxs)("div",{className:"clonify-turn",children:[v.text.length>0?(0,t.jsx)("div",{className:"clonify-msg assistant",children:(0,t.jsx)(r.ChatMarkdown,{content:v.text})}):null,b?(0,t.jsxs)("div",{className:"flex flex-col gap-2 w-full",children:[null!==v.entregable?(0,t.jsx)(a.EntregableBlock,{body:v.entregable.body,streaming:v.entregable.o
1pen}):null,v.productIds.map(e=>(0,t.jsx)(o.ProductCard,{productId:e,channelId:n,conversationId:s,couponOffered:v.couponOffered},`p${e}`)),v.assetIds.map(e=>(0,t.jsx)(c.AssetTile,{assetId:e,metadataUrl:`/api/hosted/assets/${e}?channelId=${n}`},`a${e}`)),v.videoUrls.map(e=>(0,t.jsx)(d.EmbeddedVideo,{url:e},`v${e}`)),v.linkButtons.map(e=>(0,t.jsx)(u.LinkButton,{url:e.url,label:e.label},`l${e.url}`)),v.formIds.map(e=>(0,t.jsx)(h.FormBlock,{formId:e,channelId:n,conversationId:s??null,onSubmitted:f,onCloneReply:p,onConversationCreated:g},`f${e}`)),v.hasLearningProfileAction&&x?(0,t.jsxs)("a",{href:x,className:"self-start inline-flex items-center justify-center gap-2 rounded-[var(--radius)] bg-[var(--accent)] px-4 py-2.5 text-sm font-semibold text-[var(--accent-fg)] no-underline transition-opacity hover:opacity-90",children:[(0,t.jsx)(i,{size:16,"aria-hidden":!0}),y("updateLearningProfile")]}):null]}):null]}):(0,t.jsxs)("div",{className:"clonify-thinking",children:[(0,t.jsx)("span",{className:"clonify-thinkingLabel",children:m}),(0,t.jsxs)("span",{className:"clonify-thinkingDots",children:[(0,t.jsx)("span",{className:"clonify-dot"}),(0,t.jsx)("span",{className:"clonify-dot"}),(0,t.jsx)("span",{className:"clonify-dot"})]})]})}function ee({thumb:e,sent:n,onThumb:i,onAskCreator:r}){let a=(0,l.useTranslations)("AdminProductos.coursePreview");return(0,t.jsxs)("div",{className:"clonify-feedbackRow",children:[(0,t.jsx)("button",{type:"button",className:`clonify-thumb up${"positive"===e?" active":""}`,onClick:()=>i("positive"),"aria-label":a("feedbackHelpful"),title:a("feedbackHelpful"),children:(0,t.jsx)(X,{})}),(0,t.jsx)("button",{type:"button",className:`clonify-thumb down${"negative"===e?" active":""}`,onClick:()=>i("negative"),"aria-label":a("feedbackNotHelpful"),title:a("feedbackNotHelpful"),children:(0,t.jsx)(Q,{})}),(0,t.jsx)("span",{className:"clonify-fbDot",children:"·"}),n?(0,t.jsxs)("span",{className:"clonify-askCreatorSent",children:[(0,t.jsx)(G,{}),(0,t.jsx)("span",{children:a("feedbackSentShort")})]}):(0,t.jsxs)("button",{type:"button",className:"clonify-askCreator",onClick:r,title:a("feedbackCta"),children:[(0,t.jsx)(Y,{}),(0,t.jsx)("span",{children:a("feedbackCta")})]})]})}function et({account:e,locale:n,accountHref:i,onClose:r}){let a=(0,l.useTranslations)("AdminProductos.coursePreview"),s=e?.bag??null,o=e?.purchases??[],c=s&&s.total>0?Math.max(0,Math.min(100,s.remaining/s.total*100)):0;return(0,t.jsxs)("div",{className:"clonify-acct",children:[(0,t.jsxs)("div",{className:"clonify-historyHeader",children:[(0,t.jsx)("button",{type:"button",className:"clonify-historyBack",onClick:r,"aria-label":a("accountClose"),title:a("accountClose"),children:(0,t.jsx)(V,{})}),(0,t.jsx)("div",{className:"clonify-historyTitle",children:a("accountTitle")})]}),(0,t.jsx)("div",{className:"clonify-acctList",children:null===e?(0,t.jsx)("div",{className:"clonify-historyEmpty",children:a("accountError")}):(0,t.jsxs)(t.Fragment,{children:[s?(0,t.jsxs)("div",{className:"clonify-acctBag",children:[(0,t.jsx)("div",{className:"clonify-acctBagNum",children:s.remaining}),(0,t.jsxs)("div",{className:"clonify-acctBagLabel",children:[a("accountBagLabel")," ·"," ",a("accountBagOf",{total:s.total})]}),(0,t.jsx)("div",{className:"clonify-acctBar",children:(0,t.jsx)("div",{className:"clonify-acctBarFill",style:{width:`${c}%`}})}),(0,t.jsx)("div",{className:"clonify-acctBagNote",children:a("accountBagSpendNote")})]}):null,e.freeUsage?(0,t.jsx)("div",{className:"clonify-acctFree",children:a("accountFreeLine",{used:e.freeUsage.used,max:e.freeUsage.max})}):null,i?(0,t.jsx)("a",{className:"clonify-acctAllLink",href:i,children:a("accountAllLink")}):0!==o.length||s?o.map((e,l)=>{let i=(0,k.formatPrice)(e.amountCents/100,e.currency.toUpperCase()),r=new Date(e.createdAt).toLocaleDateString(n);return(0,t.jsxs)("div",{className:"clonify-acctItem",children:[(0,t.jsxs)("div",{className:"clonify-acctItemMain",children:[(0,t.jsx)("div",{className:"clonify-acctItemTitle",children:e.title}),(0,t.jsx)("div",{className:"clonify-acctItemMeta",children:i?`${i} \xb7 ${r}`:r})]}),e.receiptUrl?(0,t.jsx)("a",{className:"clonify-acctReceipt",href:e.receiptUrl,target:"_blank",rel:"noopener noreferrer",children:a("accountReceipt")}):null]},l)}):(0,t.jsx)("div",{className:"clonify-historyEmpty",children:a("accountEmpty")})]})})]})}e.s(["CampusCloneBubble",0,function({channelId:e,creatorName:i,creatorPictureUrl:r,starterSuggestions:a,startGreeting:o=null,locale:c,acceptsImages:d=!1,acceptsFiles:u=!1,escalationEnabled:h=!1,escalationMessage:v="",escalationButtonLabel:b="",verifiedEmail:k=null,verifiedName:I=null,initialMessages:L=[],initialConversationId:S=null,voiceCallAvailable:B=!1,voiceMiniMode:T=!1,basePath:E="",courseTitle:V="",display:X="bubble",railStart:Q="open",sessionWebinarId:Y=null,blocked:en=!1,blockedMessage:el="",blockedProductId:ei=null,accountHref:er=null,learningProfileHref:ea=null,bubble:es=null}){var eo;let ec,ed,eu=(0,p.useVoiceCallSession)(),eh="bubble"===X&&eu?.minimized===!0,em=(0,l.useTranslations)("AdminProductos.coursePreview"),ef=(0,y.useActiveLesson)(),[ep,eg]=(0,n.use
1State)(!1),ex=(0,n.useRef)(null);(0,n.useEffect)(()=>{if("tab"===X||!es||!0!==es.nudge)return;let t=`clonify_nudge_seen_${e}`;if(ep){try{window.localStorage.setItem(t,"1")}catch{}return}try{if(window.localStorage.getItem(t))return}catch{}let n=()=>{let e=ex.current;e&&(e.classList.add("clonify-nudge-wiggle"),window.setTimeout(()=>{e.classList.remove("clonify-nudge-wiggle")},1150))},l="once"===es.nudgeMode?1e3*(es.nudgeDelaySec||5):4e3,i=window.setTimeout(n,l),r=null;if("once"!==es.nudgeMode){let e=1e3*(es.nudgeIntervalSec||30);r=window.setInterval(n,e)}return()=>{window.clearTimeout(i),null!==r&&window.clearInterval(r)}},[X,es,ep,e]);let[ey,ev]=(0,n.useState)(!1),[eb,ej]=(0,n.useState)(!1),ew=()=>{try{window.localStorage.setItem(ek,"1")}catch{}},ek=`clonify_pill_visto_${e}_${function(e,t){let n=`${e??""}|${t??""}`,l=5381;for(let e=0;e<n.length;e++)l=(33*l^n.charCodeAt(e))>>>0;return l.toString(36)}(es?.title,es?.subtitle)}`,eN=()=>{null!==es&&(ew(),ej(!1),ev(!0))};(0,n.useEffect)(()=>{if("tab"===X||!es||!0!==es.collapse||ey)return;let e=!1;try{e=null!==window.localStorage.getItem(ek)}catch{}if("click"===es.collapseMode&&!e)return;let t=window.setTimeout(()=>ej(!0),e?0:1e3*(es.collapseAfterSec||8));return()=>window.clearTimeout(t)},[X,es,ey,ek]),(0,n.useEffect)(()=>{if(!eb)return;let e=window.setTimeout(()=>{ev(!0)},320);return()=>window.clearTimeout(e)},[eb]);let[eC,eM]=(0,n.useState)(!1),[eI,eL]=(0,n.useState)(!1),[eS,eB]=(0,n.useState)("collapsed"!==Q),[eT,eE]=(0,n.useState)([]),[eU,e$]=(0,n.useState)(()=>L.map(e=>({id:`srv-${e.messageId}`,role:e.role,content:e.content,serverId:e.messageId,thumb:e.thumb,images:e.images.length>0?e.images:void 0}))),[eA,eR]=(0,n.useState)(""),[eP,eW]=(0,n.useState)(!1),[eD,e_]=(0,n.use
1State)(null),[eO,eF]=(0,n.useState)(S),[eH,ez]=(0,n.useState)(!1),[eV,eK]=(0,n.useState)(()=>en&&el.trim().length>0?el.trim()+(ei?` 2 3[[product:${ei}]]`:""):null),eJ=null!==eV,[eq,eG]=(0,n.useState)([]),[eX,eQ]=(0,n.useState)(null),[eY,eZ]=(0,n.useState)(null),[e0,e1]=(0,n.useState)(!1),[e2,e3]=(0,n.useState)(0),[e4,e8]=(0,n.useState)(!1),[e6,e5]=(0,n.useState)(null),[e7,e9]=(0,n.useState)(""),[te,tt]=(0,n.useState)(!1),[tn,tl]=(0,n.useState)(()=>new Set(L.filter(e=>e.escalated).map(e=>e.messageId))),[ti,tr]=(0,n.useState)(null),[ta,ts]=(0,n.useState)(!1),to=(0,n.useCallback)(()=>{fetch(`/api/hosted/account?channelId=${e}`).then(e=>e.ok?e.json():null).then(e=>{e&&tr(e)}).catch(()=>{})},[e]);(0,n.useEffect)(()=>{k&&to()},[k,to]);let tc=null!==ti&&(ti.purchases.length>0||null!==ti.bag),td=ti&&ti.bag?(ti.freeUsage?Math.max(0,ti.freeUsage.max-ti.freeUsage.used):0)+ti.bag.remaining:null,{contenedorRef:tu,colchonRef:th,anclarEn:tm,soltar:tf,ajustar:tp,alHacerScroll:tg}=(0,s.useAnclaDeLectura)(),tx=(0,n.useRef)(null),ty=(0,n.useRef)(null),tv=(0,n.useRef)(null),tb=(0,n.useRef)(null),tj=(0,n.useRef)(null),tw=(0,n.useRef)(null),tk=(0,n.useRef)(null),tN=(0,n.useRef)(null);function tC(){tk.current?.abort(),tN.current=null,tw.current?.cancel(),tw.current=null,e$([]),eR(""),tf(),eF(null),ez(!0),eG([]),eQ(null),e_(null),eW(!1),eL(!1)}(0,n.useEffect)(()=>()=>{tk.current?.abort(),tw.current?.cancel(),tw.current=null,null!==tj.current&&clearTimeout(tj.current)},[]);let tM=(0,n.useCallback)(async()=>{if("tab"===X)try{let t=await fetch(`/api/hosted/conversations?channelId=${e}`);if(!t.ok)return;let n=await t.json();eE(n.conversations??[])}catch{}},[e,X]);async function tI(e){tk.current?.abort(),tN.current=null,tw.current?.cancel(),tw.current=null,eW(!1),eL(!1);try{let t=await fetch(`/api/hosted/conversations/${e}`);if(!t.ok)return;let n=(await t.json()).messages??[];tf(),e$(n.map(e=>({id:`srv-${e.messageId}`,role:e.role,content:e.content,serverId:e.messageId,thumb:e.thumb,images:e.images.length>0?e.images:void 0}))),tl(new Set(n.filter(e=>e.escalated).map(e=>e.messageId))),eF(e),eR(""),eG([]),eQ(null),e_(null)}catch{}}function tL(e){eZ(e),null!==tj.current&&clearTimeout(tj.current),tj.current=setTimeout(()=>eZ(null),2700)}(0,n.useEffect)(()=>{tM()},[tM,eO]);let tS=(0,x.useTailCapturedRecording)({endpoint:"/api/hosted/transcribe",extraBody:{channelId:String(e)},onTranscribed:e=>{eR(t=>{let n=t.trim();return n.length>0?n+" "+e:e}),setTimeout(()=>{tx.current?.focus(),tA()},0)},onError:e=>{"permission_denied"===e?tL(em("voiceErrorPermission")):"unsupported"===e||"recorder_failed"===e?tL(em("voiceErrorUnsupported")):"audio_too_large"===e?tL(em("voiceErrorTooLong")):"empty_transcription"===e?tL(em("voiceErrorEmpty")):tL(em("voiceErrorGeneric"))}});(0,n.useEffect)(()=>{if(e0)return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)};function e(e){let t=e.target;t instanceof Node&&tb.current?.contains(t)||e1(!1)}function t(e){"Escape"===e.key&&e1(!1)}},[e0]),(0,n.useEffect)(()=>{tp(eU.length>0)},[eU,ep,tp]),(0,n.useEffect)(()=>{if(!eP)return void e3(0);if(e4)return;let e=setInterval(()=>e3(e=>(e+1)%3),2e3);return()=>clearInterval(e)},[eP,e4]);let tB=e4?em("thinkingReadingDocument"):0===e2?em("thinkingPensando"):1===e2?em("thinkingRazonando"):em("thinkingRedactando"),tT=o?.trim()??"",tE=tT.length>0?tT:ef&&ef.title.trim().length>0?em("emptyIntroLesson",{lesson:ef.title.trim()}):em("emptyIntroCourse"),tU=i.trim().charAt(0).toUpperCase()||"?",t$=i.trim().split(/\s+/).map(e=>e.charAt(0)).slice(0,2).join("").toUpperCase()||"?";function tA(){let e=tx.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,96)}px`)}async function tR(e){let t=Array.from(e.target.files??[]);e.target.value="";let n=3-eq.length,l=t.filter(e=>e.type.startsWith("image/")).slice(0,Math.max(0,n));if(0===l.length)return;let i=(await Promise.all(l.map(A))).filter(e=>null!==e);i.length>0&&eG(e=>[...e,...i].slice(0,3))}async function tP(e){let t=e?Array.from(e):[];if(tv.current&&(tv.current.value=""),0===t.length)return;let n=t.find($)??t[0];if(!$(n))return void tL(em("onlyPdf"));if(n.size>0xf00000)return void tL(em("docTooLarge"));let l=await new Promise(e=>{let t=new FileReader;t.onerror=()=>e(null),t.onload=()=>{let n=t.result;if("string"!=typeof n)return e(null);e(n.split(",")[1]||null)}
3,t.readAsDataURL(n)});l&&eQ({filename:n.name||em("documentName"),mediaType:"application/pdf",base64:l})}async function tW(e,t,n){if(null===eO)return!1;try{return(await fetch("/api/hosted/feedback",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({conversationId:eO,messageId:e,kind:t,note:n})})).ok}catch{return!1}}async function tD(){if(null===e6||te)return;tt(!0);let e=e7.trim(),t=await tW(e6,"escalate",e.length>0?e:null);tt(!1),e5(null),t?(tl(e=>new Set(e).add(e6)),tL(em("feedbackSent"))):tL(em("feedbackSendFailed"))}async function t_(t,n){let l=n?.fromInteraction===!0;if(eJ&&!l)return;let i=(t??eA).trim(),r=void 0===t?eq:[],a=void 0===t?eX:null;if(!l&&!i&&0===r.length&&!a||eP)return;let s=tN.current;null!==s&&e$(e=>e.map(e=>e.id===s?{...e,interrupted:"cancelled",serverId:null}:e)),tk.current?.abort(),tw.current?.cancel();let o=new AbortController;tk.current=o,e_(null),!l&&ti&&ti.bag&&tr(e=>e&&e.bag?e.freeUsage&&e.freeUsage.used<e.freeUsage.max?{...e,freeUsage:{...e.freeUsage,used:e.freeUsage.used+1}}:e.bag.remaining<=0?e:{...e,bag:{...e.bag,remaining:e.bag.remaining-1,spent:e.bag.spent+1}}:e);let d=crypto.randomUUID();tN.current=d;let u=crypto.randomUUID();e$(e=>[...e,...l?[]:[{id:u,role:"user",content:i,images:r.length>0?r.map(e=>e.previewUrl):void 0,documents:a?[{filename:a.filename}]:void 0}],{id:d,role:"assistant",content:""}]),tm(l?d:u),l||eR(""),eG([]),a&&eQ(null),e8(null!==a),tx.current&&(tx.current.style.height="auto"),eW(!0),eH&&ez(!1);try{let t=await fetch("/api/hosted/chat",{method:"POST",signal:o.signal,headers:{"content-type":"application/json"},body:JSON.stringify({channelId:e,conversationId:n?.conversationId??eO??void 0,startNew:!l&&eH||void 0,fromInteraction:l||void 0,locale:c,userMessage:i,lessonUnitId:ef?.unitId??void 0,sessionWebinarId:Y??void 0,images:r.length>0?r.map(e=>({mediaType:e.mediaType,dataBase64:e.dataBase64})):void 0,documents:a?[{filename:a.filename,mediaType:a.mediaType,dataBase64:a.base64}]:void 0,learningProfileActionAvailable:!!ea||void 0})});if(o.signal.aborted)return;if(!t.ok||!t.body){e$(e=>e.filter(e=>e.id!==d));let e=!1;if(403===t.status)try{let n=await t.json();"cap_reached"===n.error&&"string"==typeof n.wallContent&&n.wallContent.trim().length>0?(eK(n.wallContent.trim()),l||(e$(e=>e.filter(e=>e.id!==u)),eR(i)),"number"==typeof n.conversationId&&n.conversationId>0&&eF(n.conversationId),e=!0):"team_required"===n.error&&(e_(em("cloneTeamOnly")),e=!0)}catch{}e||e_(em("cloneError")),eW(!1);return}let s=t.headers.get("X-Conversation-Id");if(s){let e=Number.parseInt(s,10);Number.isFinite(e)&&e>0&&eF(e)}let m=!1,f=!1,p=!1,x=(0,g.createChatStreamTypewriter)({parseTarget:e=>{let t=null,n=e.replace(M,""),l=n.match(C);if(l){let e=Number.parseInt(l[1],10);Number.isFinite(e)&&e>0&&(t=e),n=n.replace(C,"")}return m&&!p&&(n=n.replace(/\[\[entregable\]\]\n?[\s\S]*?\[\[\/entregable\]\]/g,"").replace(/\[\[entregable\]\]\n?[\s\S]*$/,"").replace(/\[\[[^\]]+\]\]/g,"")),{prose:n=n.replace(/\[\[[^\]]*$/,""),meta:{serverId:t}}},onPaint:e=>{e$(t=>t.map(t=>t.id===d?{...t,content:e}:t))},onFinalize:({displayed:e,meta:t})=>{o.signal.aborted||(tw.current===x&&(tw.current=null),tN.current=null,e$(n=>n.map(n=>n.id===d?{...n,content:e,serverId:t.serverId}:n)))}});tw.current=x;let y=t.body.getReader(),v=new TextDecoder,b="",j=!1,w=!1;function h(){let e;for(;-1!==(e=b.indexOf("\n\n"));){let t=b.slice(0,e);b=b.slice(e+2);let n="",l=null;for(let e of t.split("\n")){if(0===e.length||e.startsWith(":")||!e.startsWith("data:"))continue;let t=e.slice(5).trimStart();if(0!==t.length)try{let e=JSON.parse(t);if("string"==typeof e.e){w=!0;continue}"pending"===e.completion?(m=!0,f=!1):"done"===e.completion&&(f=!0),"string"==typeof e.r?l=e.r:"string"==typeof e.t&&(n+=e.t)}catch{}}null!==l?(x.replaceTarget(l),j||(j=!0,eW(!1))):n.length>0&&(x.pushTarget(n),j||(j=!0,eW(!1)))}}for(;;){let{done:e,value:t}=await y.read();if(o.signal.aborted)return;if(e)break;let n=v.decode(t,{stream:!0});0!==n.length&&(b+=n,h())}let k=v.decode();k.length>0&&(b+=k,h()),w||m&&!f?(x.cancel(),tw.current=null,tN.current=null,e$(e=>e.map(e=>e.id===d?{...e,interrupted:"error",serverId:null}:e))):(p=!0,x.finishServer()),eW(!1)}catch{if(o.signal.aborted)return;tw.current?.cancel(),tw.current=null,tN.current=null,e$(e=>e.map(e=>e.id===d?{...e,interrupted:"error",serverId:null}:e)),eW(!1)}}let tO=r?(0,t.jsx)("img",{src:r,alt:""}):tU;return(0,t.jsxs)("div",{className:`clonify-root${"tab"===X?" clonify-mode-inline":""}${eh?" clonify-callMinimized":""}`,"data-clonify-floating-clone":"bubble"===X?"":void 0,children:["tab"===X?null:(0,t.jsxs)(t.Fragment,{children:[null===es||ep||ey?null:(0,t.jsxs)("div",{ref:ex,role:"button",tabIndex:0,className:`clonify-bubbleMsg${eb?" clonify-collapsing":""}`,onClick:()=>{eN(),eg(!0)},onKeyDown:e=>
3{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),eN(),eg(!0))},style:{background:es.color,color:(0,N.textOn)(es.color),borderColor:"#ffffff"===(0,N.textOn)(es.color)?"rgba(255,255,255,.22)":"rgba(0,0,0,.14)"},children:[i.trim()?(0,t.jsxs)("span",{className:"clonify-bubbleMsgWho",children:[(0,t.jsx)("span",{className:"clonify-bubbleMsgWhoDot","aria-hidden":!0}),(0,t.jsx)("b",{title:i,children:i}),(0,t.jsxs)("span",{className:"clonify-bubbleMsgWhoStatus",children:["· ",em("bubbleOnline")]})]}):null,(0,t.jsxs)("span",{className:"clonify-bubbleMsgText",children:[(0,t.jsx)("span",{className:"clonify-bubbleMsgTitle",children:es.title}),es.subtitle?(0,t.jsx)("span",{className:"clonify-bubbleMsgSub",children:es.subtitle}):null]}),(0,t.jsx)("button",{type:"button",className:"clonify-bubbleMsgClose","aria-label":em("closeMessage"),title:em("closeMessage"),onClick:e=>{e.stopPropagation(),ew(),ej(!0)},children:(0,t.jsx)("svg",{viewBox:"0 0 24 24","aria-hidden":!0,focusable:"false",children:(0,t.jsx)("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round"})})}),(0,t.jsx)("span",{className:"clonify-bubbleMsgTail","aria-hidden":!0})]}),(0,t.jsx)("button",{type:"button",className:"clonify-bubble",onClick:()=>{ep||eN(),eg(e=>!e)},"aria-label":em("chatBubble"),children:r?(0,t.jsx)("img",{src:r,alt:""}):(0,t.jsx)(R,{})}),(0,t.jsx)("span",{className:"clonify-presence-dot","aria-hidden":!0})]}),"tab"===X&&eS?(0,t.jsx)(w.ConversationRail,{conversations:eT,activeConversationId:eO,contextLabels:{},onClose:()=>eB(!1),onStartNewConversation:tC,onSwitchConversation:e=>void tI(e)}):null,(0,t.jsxs)("div",{className:`clonify-panel${ep||"tab"===X?"":" clonify-hidden"}${eC?" clonify-expanded":""}`,children:[(0,t.jsxs)("div",{className:"clonify-header",children:["tab"!==X||eS?null:(0,t.jsx)("button",{type:"button",className:"clonify-iconBtn",onClick:()=>eB(!0),"aria-label":em("showConversations"),title:em("showConversations"),children:(0,t.jsx)(J,{})}),(0,t.jsxs)("div",{className:"clonify-avatarWrap",children:[(0,t.jsx)("div",{className:"clonify-avatar",children:tO}),(0,t.jsx)("span",{className:"clonify-avatarDot"})]}),(0,t.jsxs)("div",{className:"clonify-headerText",children:[(0,t.jsx)("span",{className:"clonify-name",children:i}),V.trim()?(0,t.jsx)("span",{className:"clonify-context",children:em("headerCourseContext",{title:V.trim()})}):null]}),(0,t.jsxs)("div",{className:"clonify-actions",children:["tab"===X?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"clonify-iconBtn clonify-iconBtn-tabmovil",onClick:tC,"aria-label":em("newConversation"),title:em("newConversation"),children:(0,t.jsx)(H,{})}),(0,t.jsx)("button",{type:"button",className:"clonify-iconBtn clonify-iconBtn-tabmovil",onClick:()=>eL(!0),"aria-label":em("historyOpen"),title:em("historyOpen"),children:(0,t.jsx)(K,{})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"clonify-iconBtn",onClick:tC,"aria-label":em("newConversation"),title:em("newConversation"),children:(0,t.jsx)(H,{})}),(0,t.jsx)("button",{type:"button",className:"clonify-iconBtn",onClick:()=>eL(!0),"aria-label":em("historyOpen"),title:em("historyOpen"),children:(0,t.jsx)(K,{})}),tc?(0,t.jsx)("button",{type:"button",className:"clonify-iconBtn",onClick:()=>{eL(!1),ts(!0),to()},"aria-label":em("accountTitle"),title:em("accountTitle"),children:(0,t.jsx)(z,{})}):null]}),B?(0,t.jsx)(f.VoiceCallTrigger,{channelId:e,creatorName:i,creatorPictureUrl:r,initials:t$,basePath:E,verifiedEmail:k,verifiedName:I,variant:"icon",persistent:T}):null,"tab"===X?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"clonify-iconBtn",onClick:()=>eM(e=>!e),"aria-label":eC?em("reduce"):em("expand"),title:eC?em("reduce"):em("expand"),children:eC?(0,t.jsx)(D,{}):(0,t.jsx)(W,{})}),(0,t.jsx)("button",{type:"button",className:"clonify-iconBtn",onClick:()=>eg(!1),"aria-label":em("close"),title:em("close"),children:(0,t.jsx)(P,{})})]})]})]}),eI&&"tab"!==X?(0,t.jsx)(j,{channelId:e,locale:c,onClose:()=>eL(!1),onSelect:e=>void tI(e),onNew:tC}):null,ta&&"tab"!==X?(0,t.jsx)(et,{account:ti,locale:c,accountHref:er,onClose:()=>ts(!1)}):null,(0,t.jsxs)("div",{ref:tu,onScroll:tg,className:"clonify-body",children:[0!==eU.length||eJ?eU.map(l
3=>{if("user"!==l.role){let i=l.serverId??null,r=null!==i&&h&&U(l.content).hasEscalate;return(0,t.jsxs)(n.Fragment,{children:[l.content||!l.interrupted?(0,t.jsx)(Z,{content:l.content,channelId:e,conversationId:eO,thinkingLabel:tB,learningProfileHref:ea,onFormCloneReply:e=>void t_("",{fromInteraction:!0,conversationId:e??void 0}),onFormConversationCreated:e=>eF(e)}):null,"error"===l.interrupted?(0,t.jsx)("div",{className:"clonify-msg error",role:"alert",children:em("cloneInterrupted")}):null,r?(0,t.jsx)(m.EscalateBlock,{channelId:e,conversationId:eO,verifiedEmail:k,verifiedName:I,escalationMessage:v,escalationButtonLabel:b}):null,null!==i?(0,t.jsx)(ee,{thumb:l.thumb??null,sent:tn.has(i),onThumb:e=>{e$(t=>t.map(t=>t.serverId===i?{...t,thumb:t.thumb===e?null:e}:t)),tW(i,e,null)},onAskCreator:()=>{e5(i),e9("")}}):null]},l.id)}return(0,t.jsxs)("div",{"data-ancla":l.id,className:"clonify-msg user",children:[l.images&&l.images.length>0?(0,t.jsx)("div",{className:"clonify-img-preview",style:{padding:0,marginBottom:l.content?"6px":"0"},children:l.images.map((e,n)=>(0,t.jsx)("div",{className:"clonify-img-thumb",children:(0,t.jsx)("img",{src:e,alt:""})},n))}):null,l.documents&&l.documents.length>0?(0,t.jsx)("div",{className:"clonify-doc-preview",style:{padding:0,marginBottom:l.content?"6px":"0"},children:l.documents.map((e,n)=>(0,t.jsxs)("div",{className:"clonify-doc-chip",children:[(0,t.jsx)("span",{children:(0,t.jsx)(F,{})}),(0,t.jsx)("span",{className:"clonify-doc-name",children:e.filename})]},n))}):null,l.content]},l.id)}):(0,t.jsxs)("div",{className:"clonify-emptyState",children:[(0,t.jsx)("div",{className:"clonify-emptyAvatar",children:tO}),(0,t.jsx)("div",{className:"clonify-emptyName",children:i}),(0,t.jsx)("div",{className:"clonify-emptyContext",children:tE}),a.length>0?(0,t.jsx)("div",{className:"clonify-suggestions",children:a.slice(0,4).map(e=>(0,t.jsx)("button",{type:"button",className:"clonify-chip",onClick:()=>void t_(e),children:e},e))}):null]}),eJ?(0,t.jsx)(Z,{content:eV??"",channelId:e,conversationId:eO,thinkingLabel:"",learningProfileHref:ea,onFormSubmitted:()=>eK(null),onFormCloneReply:e=>void t_("",{fromInteraction:!0,conversationId:e??void 0}),onFormConversationCreated:e=>eF(e)}):null,eD?(0,t.jsx)("div",{className:"clonify-msg error",children:eD}):null,eY?(0,t.jsx)("div",{className:"clonify-fbToast",children:eY}):null,(0,t.jsx)("div",{ref:th,"aria-hidden":!0,className:"clonify-colchon"})]}),(0,t.jsxs)("div",{className:"clonify-footer",children:[null!==td&&td>0?(0,t.jsx)("button",{type:"button",className:"clonify-bagPill clonify-on",onClick:()=>{ts(!0),to()},children:em("accountPillLabel",{n:td})}):null,d&&eq.length>0?(0,t.jsx)("div",{className:"clonify-img-preview",children:eq.map(e=>(0,t.jsxs)("div",{className:"clonify-img-thumb",children:[(0,t.jsx)("img",{src:e.previewUrl,alt:""}),(0,t.jsx)("button",{type:"button",className:"clonify-img-remove",onClick:()=>eG(t=>t.filter(t=>t.id!==e.id)),"aria-label":em("removeImage"),children:(0,t.jsx)(P,{})})]},e.id))}):null,u&&eX?(0,t.jsx)("div",{className:"clonify-doc-preview",children:(0,t.jsxs)("div",{className:"clonify-doc-chip",children:[(0,t.jsx)("span",{children:(0,t.jsx)(F,{})}),(0,t.jsx)("span",{className:"clonify-doc-name",children:eX.filename}),(0,t.jsx)("button",{type:"button",className:"clonify-doc-remove",onClick:()=>eQ(null),"aria-label":em("removeDocument"),children:(0,t.jsx)(P,{})})]})}):null,(0,t.jsxs)("div",{className:`clonify-form${"recording"===tS.micState?" clonify-recording":"transcribing"===tS.micState?" clonify-transcribing":""}`,children:[(0,t.jsx)("button",{type:"button",className:"clonify-cancel",onClick:tS.cancel,"aria-label":em("cancelRecording"),title:em("cancelRecording"),children:(0,t.jsx)(P,{})}),(0,t.jsx)("textarea",{ref:tx,className:"clonify-input",value:eA,rows:1,disabled:eJ,onChange:e=>{eR(e.target.value),tA()},onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),t_())},placeholder:em("chatPlaceholder")}),(0,t.jsxs)("div",{className:"clonify-form-rec",children:[(0,t.jsx)("span",{className:"clonify-rec-dot"}),(0,t.jsx)("span",{className:"clonify-rec-time",children:(ec=Math.floor((eo=tS.micDuration)/60),ed=eo%60,`${ec}:${ed<10?"0":""}${ed}`)}),300-tS.micDuration<=30?(0,t.jsx)("span",{className:"clonify-rec-remaining",style:{display:"inline"},children:em("secondsRemaining",{seconds:Math.max(0,300-tS.micDuration)})}):null]}),(0,t.jsx)("button",{type:"button",className:"clonify-send-rec",onClick:tS.stop,"aria-label":em("stopRecording"),title:em("stopRecording"),children:(0,t.jsx)(G,{})}),(0,t.jsxs)("div",{className:"clonify-form-trans",children:[(0,t.jsx)("span",{className:"clonify-trans-spin"}),(0,t.jsx)("span",{className:"clonify-trans-label",children:em("transcribing")})]}),!eJ&&"idle"===tS.micState&&d&&u?(0,t.jsxs)("div",{className:"clonify-attach-wrap",ref:tb,children:[(0,t.jsx)("button",{type:"button",className:"clonify-attach",onClick:()=>e1(e=>!e),disabled:eP,"aria-label":em("attachFile"),title:em("attachFile"),children:(0,t.jsx)(H,{})}),e0?(0,t.jsxs)("div",{className:"clonify-attach-menu",children:[(0,t.jsxs)("button",{type:"button",className:"clonify-attach-menu-item",onClick:()=>{e1(!1),eq.length<3&&ty.current?.click()},children:[(0,t.jsx)(O,{}),(0,t.jsx)("span",{children:em("attachImageOption")})]}),(0,t.jsxs)("button",{type:"button",className:"clonify-attach-menu-item",onClick:()=>{e1(!1),eX||tv.current?.click()},children:[(0,t.jsx)(F,{}),(0,t.jsx)("span",{children:em("attachDocumentOption")})]})]}):null]}):!eJ&&"idle"===tS.micState&&d?(0,t.jsx)("button",{type:"button",className:"clonify-attach",onClick:()=>ty.current?.click(),disabled:eP||eq.length>=3,"aria-label":em("attachImage"),title:em("attachImage"),children:(0,t.jsx)(O,{})}):!eJ&&"idle"===tS.micState&&u?(0,t.jsx)("button",{type:"button",className:"clonify-attach",onClick:()=>tv.current?.click(),disabled:eP||null!==eX,"aria-label":em("attachDocument"),title:em("attachDocument"),children:(0,t.jsx)(F,{})}):null,!eJ&&tS.micSupported?(0,t.jsx)("button",{type:"button",className:"clonify-mic",onClick:function(){"idle"!==tS.micState||!tS.micSupported||eP||eJ||(e_(null),t
3S.start())},disabled:eP,"aria-label":em("recordVoiceNote"),title:em("recordVoiceNote"),children:(0,t.jsx)(q,{})}):null,(0,t.jsx)("button",{type:"button",className:"clonify-send",onClick:()=>void t_(),disabled:eJ||eP||0===eA.trim().length&&0===eq.length&&null===eX,"aria-label":em("cloneSend"),children:(0,t.jsx)(_,{})})]}),(0,t.jsxs)("div",{className:"clonify-disclaimer",children:[em("cloneDisclaimerText")," ",(0,t.jsx)("a",{href:"https://clonify.com",target:"_blank",rel:"noreferrer noopener",children:em("poweredByClonify")})]}),d?(0,t.jsx)("input",{ref:ty,type:"file",accept:"image/*",multiple:!0,onChange:tR,style:{display:"none"}}):null,u?(0,t.jsx)("input",{ref:tv,type:"file",accept:"application/pdf,.pdf",onChange:e=>{tP(e.target.files)},style:{display:"none"}}):null]}),null!==e6?(0,t.jsx)("div",{className:"clonify-fbModal",onClick:e=>{e.target===e.currentTarget&&e5(null)},children:(0,t.jsxs)("div",{className:"clonify-fbModalCard",children:[(0,t.jsx)("div",{className:"clonify-fbModalTitle",children:em("feedbackModalTitle")}),(0,t.jsx)("div",{className:"clonify-fbModalHint",children:em("feedbackModalHint")}),(0,t.jsx)("textarea",{className:"clonify-fbModalTextarea",value:e7,onChange:e=>e9(e.target.value),placeholder:em("feedbackModalPlaceholder"),rows:3,autoFocus:!0}),(0,t.jsxs)("div",{className:"clonify-fbModalActions",children:[(0,t.jsx)("button",{type:"button",className:"clonify-fbModalBtn secondary",onClick:()=>e5(null),disabled:te,children:em("feedbackCancel")}),(0,t.jsx)("button",{type:"button",className:"clonify-fbModalBtn primary",onClick:()=>void tD(),disabled:te,children:em("feedbackSubmit")})]})]})}):null]})]})}],334521)}]);
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.