1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1275,7022],{1275:(e,t,o)=>{o.d(t,{o:()=>n.toast}),o(95155);var n=o(18720)},9130:(e,t,o)=>{o.d(t,{RH:()=>m,__:()=>c});var n=o(41444);let i={google_shopping:{displayName:"Google Shopping",domain:"shopping.google.com",faviconUrl:"https://www.google.com/s2/favicons?domain=google.com&sz=64"},amazon:{displayName:"Amazon",domain:"amazon.com",faviconUrl:"https://www.google.com/s2/favicons?domain=amazon.com&sz=64"},"amazon.com":{displayName:"Amazon",domain:"amazon.com",faviconUrl:"https://www.google.com/s2/favicons?domain=amazon.com&sz=64"},"amazon.com.tr":{displayName:"Amazon",domain:"amazon.com.tr",faviconUrl:"https://www.google.com/s2/favicons?domain=amazon.com.tr&sz=64"},"amazon.de":{displayName:"Amazon DE",domain:"amazon.de",faviconUrl:"https://www.google.com/s2/favicons?domain=amazon.de&sz=64"},"amazon.co.uk":{displayName:"Amazon UK",domain:"amazon.co.uk",faviconUrl:"https://www.google.com/s2/favicons?domain=amazon.co.uk&sz=64"},trendyol:{displayName:"Trendyol",domain:"trendyol.com",faviconUrl:"https://www.google.com/s2/favicons?domain=trendyol.com&sz=64"},"trendyol.com":{displayName:"Trendyol",domain:"trendyol.com",faviconUrl:"https://www.google.com/s2/favicons?domain=trendyol.com&sz=64"},hepsiburada:{displayName:"Hepsiburada",domain:"hepsiburada.com",faviconUrl:"https://www.google.com/s2/favicons?domain=hepsiburada.com&sz=64"},"hepsiburada.com":{displayName:"Hepsiburada",domain:"hepsiburada.com",faviconUrl:"https://www.google.com/s2/favicons?domain=hepsiburada.com&sz=64"},n11:{displayName:"n11",domain:"n11.com",faviconUrl:"https://www.google.com/s2/favicons?domain=n11.com&sz=64"},"n11.com":{displayName:"n11",domain:"n11.com",faviconUrl:"https://www.google.com/s2/favicons?domain=n11.com&sz=64"},"migros.com.tr":{displayName:"Migros",domain:"migros.com.tr",faviconUrl:"https://www.google.com/s2/favicons?domain=migros.com.tr&sz=64"},walmart:{displayName:"Walmart",domain:"walmart.com",faviconUrl:"https://www.google.com/s2/favicons?domain=walmart.com&sz=64"},"walmart.com":{displayName:"Walmart",domain:"walmart.com",faviconUrl:"https://www.google.com/s2/favicons?domain=walmart.com&sz=64"},ebay:{displayName:"eBay",domain:"ebay.com",faviconUrl:"https://www.google.com/s2/favicons?domain=ebay.com&sz=64"},"ebay.com":{displayName:"eBay",domain:"ebay.com",faviconUrl:"https://www.google.com/s2/favicons?domain=ebay.com&sz=64"},bestbuy:{displayName:"Best Buy",domain:"bestbuy.com",faviconUrl:"https://www.google.com/s2/favicons?domain=bestbuy.com&sz=64"},"bestbuy.com":{displayName:"Best Buy",domain:"bestbuy.com",faviconUrl:"https://www.google.com/s2/favicons?domain=bestbuy.com&sz=64"},target:{displayName:"Target",domain:"target.com",faviconUrl:"https://www.google.com/s2/favicons?domain=target.com&sz=64"},"target.com":{displayName:"Target",domain:"target.com",faviconUrl:"https://www.google.com/s2/favicons?domain=target.com&sz=64"},aliexpress:{displayName:"AliExpress",domain:"aliexpress.com",faviconUrl:"https://www.google.com/s2/favicons?domain=aliexpress.com&sz=64"},"aliexpress.com":{displayName:"AliExpress",domain:"aliexpress.com",faviconUrl:"https://www.google.com/s2/favicons?domain=aliexpress.com&sz=64"}};function a(e){return e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}function s(e){let t=[];for(let o of e.split(/\n(?=- \*\*)/)){let e,n=o.match(/^-\s+\*\*(.+?)\*\*\s*\((\d+)\):\s*(.+?)(?:\n|$)/);if(!n)continue;let i=[],a=/^\s{2,}-\s+"?(.+?)"?\s*$/gm;for(;null!==(e=a.exec(o));){let t=e[1].trim().replace(/^"|"$/g,"");t&&i.push({text:t})}t.push({highlight_short_name:n[1].trim(),highlight_name:n[1].trim(),highlight_description:n[3].trim(),mention_count:parseInt(n[2]),comments:i})}return t}function r(e){return null==e?null:"string"==typeof e?function(e){let t={},o=e.match(/^\*\*Model Response\*\*:\s*([\s\S]*?)(?=\n\nSentiment Distribution:|$)/i),n=o?o[1].trim():e.trim(),i=e.match(/Sentiment Counts[\s\S]*?-\s*Positive:\s*(\d+)/i),a=e.match(/Sentiment Counts[\s\S]*?-\s*Negative:\s*(\d+)/i),r=e.match(/Sentiment Counts[\s\S]*?-\s*Neutral:\s*(\d+)/i);(i||a||r)&&(t.sentiment_counts={positive:i?parseInt(i[1]):0,negative:a?parseInt(a[1]):0,neutral:r?parseInt(r[1]):0});let l=e.match(/([\d.]+)%\s*positive/i),c=e.match(/([\d.]+)%\s*negative/i),m=e.match(/([\d.]+)%\s*neutral/i);(l||c||m)&&(t.sentiment_distribution={positive:l?parseFloat(l[1])/100:0,negative:c?parseFloat(c[1])/100:0,neutral:m?parseFloat(m[1])/100:0});let d=e.match(/Prominent Topics in \*\*Positive\*\* Reviews?:([\s\S]*?)(?=\nProminent Topics in \*\*Negative\*\*|\nThis product|$)/i);d&&(t.positive_highlights=s(d[1]));let u=e.match(/Prominent Topics in \*\*Negative\*\* Reviews?:([\s\S]*?)(?=\nCritical Issues|\nThis product|$)/i);u&&(t.negative_highlights=s(u[1]));let p=e.match(/Critical Issues?:([\s\S]*?)(?=\nThis product|$)/i);p&&(t.critical_issues=function(e){let t,o=[],n=/^-\s+\*\*(.+?)\*\*:\s*([\s\S]+?)(?=\n-\s+\*\*|\n\n\n|$)/gm;
1for(;null!==(t=n.exec(e));)o.push({issue_name:t[1].trim(),issue_description:t[2].trim()});return o}(p[1]));let g=e.match(/suitable for the following user profiles?:([\s\S]*?)$/i);return g&&(t.suitable_user_profiles=function(e){let t,o=[],n=/^-\s+\*\*(.+?)\*\*:\s*([\s\S]+?)(?=\n-\s+\*\*|\n\n\n|$)/gm;for(;null!==(t=n.exec(e));)o.push({user_profile_group_name:t[1].trim(),description:t[2].trim()});return o}(g[1])),{attributes:t,main_response:n}}(e):"object"==typeof e?e:null}function l(e){return e&&Array.isArray(e)&&e.find(e=>{let t=r(null==e?void 0:e.model_response),o=null==t?void 0:t.attributes;return(null==o?void 0:o.sentiment_counts)||(null==o?void 0:o.sentiment_distribution)})||null}function c(e,t,o){var s,c,m,d,u,p,g,h;let f,v,w;n.v.log("[mapSummaryToAnalysis] responses:",(e.responses||[]).map(e=>({input_type:e.input_type,model_name:e.model_name,model_response_type:typeof e.model_response,model_response_is_null:null===e.model_response,model_response_preview:"string"==typeof e.model_response?e.model_response.slice(0,120):e.model_response})));let _=l(e.responses||[]);if(n.v.log("[mapSummaryToAnalysis] findSentimentResponse result:",_?"found":"null"),_){let e=r(_.model_response),t=null==e?void 0:e.attributes;f=null==t?void 0:t.sentiment_counts,v=null==t?void 0:t.sentiment_distribution}let y=function(e){let t=null==e?void 0:e.debug_info,o=null==t?void 0:t.product_marketplace_info;return o?o.reduce((e,t)=>e+(t.number_of_comments||0),0):0}(e),b=function(e,t){if(e){let t=e.positive||0,o=t+(e.neutral||0)+(e.negative||0);return 0===o?0:Math.round(t/o*100)}return(null==t?void 0:t.positive)!==void 0?Math.round(100*t.positive):0}(f,v),R=function(e,t){let o=l(e);if(!o)return t;let n=r(o.model_response),i=null==n?void 0:n.attributes;return(null==i?void 0:i.short_product_name)||t}(e.responses||[],t),N=(null==(s=e.product_info)?void 0:s.map(e=>e.image_url).filter(e=>e).slice(0,4))||[],U=_?null==(c=r(_.model_response))?void 0:c.attributes:null,A=f,S={positive:(null==A?void 0:A.positive)||0,neutral:(null==A?void 0:A.neutral)||0,negative:(null==A?void 0:A.negative)||0},T=((null==U?void 0:U.positive_highlights)||[]).map((e,t)=>({id:"pos-".concat(t),text:e.highlight_short_name||e.highlight_name||"",count:e.mention_count||0,sampleQuotes:(e.comments||[]).map(e=>({text:e.text||"",lang:e.lang||void 0})).filter(e=>e.text)})),z=((null==U?void 0:U.negative_highlights)||[]).map((e,t)=>({id:"neg-".concat(t),text:e.highlight_short_name||e.highlight_name||"",count:e.mention_count||0,sampleQuotes:(e.comments||[]).map(e=>({text:e.text||"",lang:e.lang||void 0})).filter(e=>e.text)})),E=((null==U?void 0:U.critical_issues)||[]).map((e,t)=>({id:"issue-".concat(t),title:e.issue_name||"",description:e.issue_description||"",severity:"high"})),x=((null==U?void 0:U.suitable_user_profiles)||[]).map(e=>({title:e.user_profile_group_name||"",description:e.description||""})),O=(null==(m=e.product_info)?void 0:m.map((e,t)=>{var o,n,s;let r=function(e,t){let o=e.toLowerCase().trim(),n=i[o];if(n)return{displayName:n.displayName,faviconUrl:n.faviconUrl};if(t){let o=function(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch(e){return null}}(t);if(o){let t=i[o.toLowerCase()];return t?{displayName:t.displayName,faviconUrl:t.faviconUrl}:{displayName:a(e),faviconUrl:"https://www.google.com/s2/favicons?domain=".concat(o,"&sz=64")}}}let s=o.includes(".")?o:"".concat(o,".com");return{displayName:a(e),faviconUrl:"https://www.google.com/s2/favicons?domain=".concat(s,"&sz=64")}}(e.marketplace||"",e.url||"");return{id:"platform-".concat(t),platform:r.displayName,url:e.url||"",price:parseFloat(((null==(o=e.price)?void 0:o.amount)||"0").replace(/,/g,"")),currency:(null==(n=e.price)?void 0:n.currency)||"TL",logo:r.faviconUrl,isAd:null!=(s=e.is_ad)&&s}}))||[];if(e.reviewed_youtube_urls&&e.reviewed_youtube_urls.length>0){let t=(h=e.responses||[],Array.isArray(h))&&h.find(e=>{let t="video"===e.input_type,o=!!e.model_response;return t&&o})||null,o=t?null==(p=r(t.model_response))?void 0:p.attributes:null;if(o){let t=(o.positive_highlights||[]).map((e,t)=>({id:"yt-pos-".concat(t),text:e.highlight_short_name||e.highlight_name||"",count:e.mention_count||0,description:e.highlight_description||void 0,comments:(e.comments||[]).map(e=>({text:e.text||"",date:e.date||null,marketplace:e.marketplace||null,lang:e.lang||void 0})).filter(e=>e.text)})),n=(o.negative_highlights||[]).map((e,t)=>({id:"yt-neg-".concat(t),text:e.highlight_short_name||e.highlight_name||"",count:e.mention_count||0,description:e.highlight_description||void 0,comments:(e.comments||[]).map(e=>({text:e.text||"",date:e.date||null,marketplace:e.marketplace||null,lang:e.lang||void 0})).filter(e=>e.text)}));w={videoData:e.reviewed_youtube_urls,positiveHighlights:t,negativeHighlights:n}}}return{id:o,productId:o,productName:R,productImages:N,sentiment:{percentage:b,label:b>=60?"positive":"negative",totalReviews:y},bestFor:x,overallScore:b/10,completedAt:null!=(g=null==(d=e.timing_info)?void 0:d["01_request_started"])?g:new Date().toISOString(),completionTime:"0secs",reviewBreakdown:S,positiveHighlights:T,negativeHighlights:z,criticalIssues:E,availableOn:O,videoInsights:w,pros:T.map(e=>e.text).slice(0,4),cons:z.map(e=>e.text).slice(0,3),summary:(null==(u=r(_?_.model_response:null))?void 0:u.main_response)||"Analysis completed successfully."}}function m(e){let t=Math.floor(e/1e3),o=Math.floor(t/60),n=t%60;return o>0?"".concat(o,"min").concat(n>0?" ".concat(n,"secs"):""):"".concat(t,"secs")}},15528:(e,t,o)=>{o.d(t,{Cl:()=>a,E5:()=>s});var n=o(44525);async function i(e,t){throw Error((await e.json().catch(()=>({}))).error||t)}async function a(e,t){let o=await (0,n.z)(),a=await fetch(e,{method:"POST",headers:o,...void 0!==t&&{body:JSON.stringify(t)}});return a.ok||await i(a,"Request to ".concat(e," failed")),a.json()}async function s(e){let t=await (0,n.z)(),o=await fetch(e,{method:"GET",headers:t});return o.ok||await i(o,"Request to ".concat(e," failed")),o.json()}},41444:(e,t,o)=>{o.d(t,{v:()=>n});let n={log:function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o]},error:function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o]},warn:function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o]},info:function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o]},debug:function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o]}}},44525:(e,t,o)=>{o.d(t,{z:()=>i});var n=o(41444);async function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{includeContentType:t=!0}=e,i={};t&&(i["Content-Type"]="application/json");try{let{getSession:e}=await Promise.resolve().then(o.t.bind(o,36489,23)),t=await e();(null==t?void 0:t.accessToken)&&!(null==t?void 0:t.error)&&(i.Authorization="Bearer ".concat(t.accessToken))}catch(e){throw n.v.error("Failed to get session token:",e),Error("Authentication failed. Please log in again.")}return i}},63119:(e,t,o)=>{o.d(t,{RP:()=>s,bW:()=>r,lR:()=>a});var n=o(69582),i=o(41444);
1class a extends Error{constructor({code:e,message:t,retryable:o}){super(t),this.name="AuthError",this.code=e,this.retryable=o}}async function s(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"tr";try{let s=await fetch((0,n.e)("/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({login_type:"phone_number",phone_number:e,dest_lang:o,"g-recaptcha-response":t})});if(401===s.status)throw new a({code:"RECAPTCHA_FAILED",message:"Security check failed. Please retry.",retryable:!0});if(503===s.status)throw new a({code:"RECAPTCHA_UNAVAILABLE",message:"Security service unavailable. Try later.",retryable:!1});if(404===s.status)throw i.v.log("\uD83D\uDCDD [API] User not found (404), needs registration"),new a({code:"USER_NOT_FOUND",message:"User not found. Registering...",retryable:!0});if(400===s.status){let e=await s.json().catch(()=>({}));i.v.log("\uD83D\uDCDD [API] Login 400 response:",e);let t=(e.message||e.error||"").toLowerCase();if(t.includes("not found")||t.includes("does not exist")||t.includes("not exist"))throw i.v.log("\uD83D\uDCDD [API] User not found (400), needs registration"),new a({code:"USER_NOT_FOUND",message:"User not found. Registering...",retryable:!0});throw new a({code:"NETWORK_ERROR",message:e.message||e.error||"Login failed. Please try again.",retryable:!0})}if(!s.ok)throw new a({code:"NETWORK_ERROR",message:"An unexpected error occurred. Please try again.",retryable:!0});return await s.json()}catch(e){if(e instanceof a)throw e;throw new a({code:"NETWORK_ERROR",message:"Connection failed. Please check your network.",retryable:!0})}}async function r(e,t){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"tr";try{let s=await fetch((0,n.e)("/register"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({login_type:"phone_number",phone_number:e,dest_lang:o,"g-recaptcha-response":t})});if(401===s.status)throw new a({code:"RECAPTCHA_FAILED",message:"Security check failed. Please retry.",retryable:!0});if(503===s.status)throw new a({code:"RECAPTCHA_UNAVAILABLE",message:"Security service unavailable. Try later.",retryable:!1});if(409===s.status)throw i.v.log("\uD83D\uDCDD [API] User already exists (409), needs login"),new a({code:"USER_EXISTS",message:"User already exists. Logging in...",retryable:!0});if(400===s.status){let e=await s.json().catch(()=>({}));i.v.log("\uD83D\uDCDD [API] Register 400 response:",e);let t=(e.message||e.error||"").toLowerCase();if(t.includes("exist")||t.includes("already")||t.includes("registered"))throw i.v.log("\uD83D\uDCDD [API] User already exists, needs login"),new a({code:"USER_EXISTS",message:"User already exists. Logging in...",retryable:!0});throw new a({code:"NETWORK_ERROR",message:e.message||e.error||"Registration failed. Please try again.",retryable:!0})}if(!s.ok)throw new a({code:"NETWORK_ERROR",message:"An unexpected error occurred. Please try again.",retryable:!0});return await s.json()}catch(e){if(e instanceof a)throw e;throw new a({code:"NETWORK_ERROR",message:"Connection failed. Please check your network.",retryable:!0})}}},69582:(e,t,o)=>{o.d(t,{e:()=>n});function n(e){let t="https://beefair.ai/api";return t.startsWith("http://")||t.startsWith("https://"),"".concat(t).concat(e)}},90360:(e,t,o)=>{o.d(t,{Oj:()=>c,Ub:()=>s,cs:()=>i,eh:()=>m,es:()=>a,fP:()=>n,pq:()=>l,wx:()=>r});let n={NON_PRODUCT:0,GENERAL_PRODUCT:1,SPECIFIC_PRODUCT:2,COMPARISON_OR_LIST:4,IRRELEVANT_OR_CHAT:5,FORBIDDEN_POLICY:6,OUT_OF_SCOPE:7,PRODUCT_LIST:8},i=3,a=5e3,s=240,r=0,l="beefair_chat_messages",c="ANALYSIS_RESULT_",m="ANALYSIS_RESULTS_KEYS"}}]);
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.