1import{_ as A,I as B,R as F,as as V,aW as N,E as g,k as r,m as n,p as t,F as k,r as w,l as S,w as x,G as v,t as m,v as I,z as p,y as h,C as _,am as P,B as j}from"./entry-client-6684a004.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="fd37872d-112a-4153-a0b6-4ac660739c2f",s._sentryDebugIdIdentifier="sentry-dbid-fd37872d-112a-4153-a0b6-4ac660739c2f")}catch{}})();const D={name:"ProductSearchFeedbackForm",components:{SmallRoundButton:B,RoundButton:F,IconicTextarea:V},props:{evaluationId:{type:[Number,String],required:!0},defaultScore:{type:Number,default:null},endpoint:{type:String,default:"/api/open-ai/product-search/feedback"}},emits:["submitted"],data(){return{scores:[1,2,3,4,5],suggestionTags:["ì íí´ì","ì¶ì²ì´ ë¶ì¡±í´ì","ë무 ëë ¤ì","ìíë ì¹´í
ê³ ë¦¬ê° ìëìì"],form:{satisfaction_score:this.defaultScore,feedback:"",tags:[],evaluation_id:this.evaluationId},submitting:!1,successMessage:"",errorMessage:""}},watch:{evaluationId(s){this.form.evaluation_id=s,this.resetState()}},methods:{setScore(s){this.form.satisfaction_score=s},toggleTag(s){const e=[...this.form.tags],i=e.indexOf(s);i>=0?e.splice(i,1):e.push(s),this.form.tags=e},isTagActive(s){return this.form.tags.includes(s)},async submit(){var s,e;if(!this.form.satisfaction_score){this.errorMessage="ë§ì¡±ë를 먼ì ì íí´ì£¼ì¸ì.";return}this.submitting=!0,this.errorMessage="",this.successMessage="";try{const i={evaluation_id:this.form.evaluation_id,satisfaction_score:this.form.satisfaction_score,feedback:this.form.feedback||null,tags:this.form.tags},{data:c}=await N.post(this.endpoint,i);this.successMessage=c.message||"ìì¤í ì견 ê°ì¬í©ëë¤.",this.$emit("submitted",c.evaluation)}catch(i){this.errorMessage=((e=(s=i.response)==null?void 0:s.data)==null?void 0:e.message)||"í¼ëë°±ì ì ì¡íì§ ëª»íìµëë¤. ì ì í ë¤ì ìëí´ì£¼ì¸ì."}finally{this.submitting=!1}},resetState(){this.form.satisfaction_score=this.defaultScore,this.form.feedback="",this.form.tags=[],this.successMessage="",this.errorMessage=""}}},z={class:"bg-white rounded-lg shadow p-4 space-y-4"},L={class:"flex items-center space-x-2"},$={class:"flex flex-wrap gap-2"},q={class:"flex flex-col space-y-2"},E={key:0,class:"text-sm text-green-600"},H={key:1,class:"text-sm text-red-600"};function O(s,e,i,c,o,d){const b=g("small-round-button"),u=g("iconic-textarea"),a=g("round-button");return r(),n("div",z,[e[2]||(e[2]=t("header",null,[t("h3",{class:"text-lg font-semibold text-gray-900"}," ê²ì ê²°ê³¼ë ë§ì¡±ì¤ë¬ì°ì
¨ëì? "),t("p",{class:"text-sm text-gray-500"}," ë³ì ì ì ííê³ ì¶ê° ìê²¬ì´ ìë¤ë©´ ìë ¤ì£¼ì¸ì. ë ëì ì¶ì² íì§ì í° ëìì´ ë©ëë¤. ")],-1)),t("div",L,[(r(!0),n(k,null,w(o.scores,l=>(r(),S(b,{key:l,type:"button",class:I(["rounded-full border px-3 py-1 text-sm font-semibold transition",l===o.form.satisfaction_score?"bg-indigo-600 text-white border-indigo-600":"border-gray-300 text-gray-600 hover:bg-gray-50"]),onClick:y=>d.setScore(l)},{default:x(()=>[v(m(l)+"ì ",1)]),_:2},1032,["class","onClick"]))),128))]),t("div",null,[e[1]||(e[1]=t("label",{class:"block text-sm font-medium text-gray-700 mb-1",for:"product-search-feedback-textarea"}," ì¶ê° í¼ëë°± (ì í) ",-1)),p(u,{id:"product-search-feedback-textarea",modelValue:o.form.feedback,"onUpdate:modelValue":e[0]||(e[0]=l=>o.form.feedback=l),modelModifiers:{trim:!0},rows:"3",class:"w-full form-textarea",placeholder:"ì¶ì² ê²°ê³¼ìì ì¢ìë ì , ê°ì ì´ íìí ì ë±ì ìì ë¡ê² ì
ë ¥í´ì£¼ì¸ì."},null,8,["modelValue"])]),t("div",$,[(r(!0),n(k,null,w(o.suggestionTags,l=>(r(),S(a,{key:l,type:"button",class:I(["px-3 py-1 rounded-full border text-xs",d.isTagActive(l)?"bg-indigo-50 border-indigo-300 text-indigo-700":"border-gray-300 text-gray-600 hover:bg-gray-50"]),onClick:y=>d.toggleTag(l)},{default:x(()=>[v(m(l),1)]),_:2},1032,["class","onClick"]))),128))]),t("footer",q,[p(a,{primary:"",disabled:o.submitting||!o.form.satisfaction_score,onClick:d.submit},{default:x(()=>[v(m(o.submitting?"ì ì¡ ì¤...":"í¼ëë°± ë³´ë´ê¸°"),1)]),_:1},8,["disabled","onClick"]),o.successMessage?(r(),n("p",E,m(o.successMessage),1)):h("",!0),o.errorMessage?(r(),n("p",H,m(o.errorMessage),1)):h("",!0)])])}const R=A(D,[["render",O],["__scopeId","data-v-ef87f0c9"]]),U={class:"lg:max-w-5xl mx-auto"},G={key:0},J={key:1},W={key:0,class:"text-red-600 bg-red-50 p-4 rounded-md text-center"},K={id:"result-container",class:"mt-6 p-6 border border-gray-200 rounded-lg bg-white min-h-[150px] flex items-center justify-center"}
1,Q={key:0,class:"flex flex-col items-center text-gray-500"},X={key:1,class:"text-gray-700 whitespace-pre-wrap"},Y={class:"flex flex-row items-start gap-4 justify-between"},Z={class:"w-full"},ee={class:"font-medium w-full"},te=["innerHTML"],se={key:2,class:"text-gray-500 text-center"},ae={__name:"AiProductSearch",setup(s){const e=_(""),i=_([]),c=_(!1),o=_(""),d=_({}),b=async()=>{if(e.value.trim()){c.value=!0,o.value="",i.value=[];try{const u=await fetch("/api/open-ai/product-search",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({query:e.value})}),a=await u.json();if(u.status===422){o.value=a.message||"ì¶ì²ì ë°ìì¬ ì ììµëë¤.";return}i.value=a.products||[],d.value=a.evaluation||{}}catch(u){o.value=u.message||"ì¶ì²ì ë°ìì¬ ì ììµëë¤."}finally{c.value=!1}}};return(u,a)=>{var M;const l=g("iconic-input"),y=g("round-button");return r(),n("div",U,[a[5]||(a[5]=t("h1",{class:"text-3xl font-bold text-gray-800 mb-6 text-center"}," AI ìí ê²ì ",-1)),t("form",{class:"flex flex-col sm:flex-row gap-3 mb-6",onSubmit:P(b,["prevent"])},[a[1]||(a[1]=t("label",{for:"product-search",class:"sr-only"},"ìí ê²ì",-1)),p(l,{id:"product-search",value:e.value,"onUpdate:value":a[0]||(a[0]=f=>e.value=f),type:"text",placeholder:"ì°¾ê³ ìë ìíì ì¤ëª í´ì£¼ì¸ì. (ì: íë¼ ìºë¤ì ì í©í ìì¤)",disabled:c.value},null,8,["value","disabled"]),p(y,{primary:"",type:"submit",class:"whitespace-nowrap min-w-[120px] flex-shrink-0",disabled:c.value||!e.value.trim(),onClick:b},{default:x(()=>[c.value?(r(),n("span",G,"ê²ì ì¤...")):(r(),n("span",J,"ì¶ì²ë°ê¸°"))]),_:1},8,["disabled"])],32),o.value?(r(),n("div",W,[t("p",null,m(o.value),1)])):h("",!0),t("div",K,[c.value?(r(),n("div",Q,a[2]||(a[2]=[t("svg",{class:"animate-spin h-8 w-8 text-stone-600 mb-2",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},[t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),t("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1),t("span",null,"AIê° ìíì ì°¾ê³ ììµëë¤...",-1)]))):i.value.length?(r(),n("div",X,[a[3]||(a[3]=t("h2",{class:"text-xl font-semibold text-gray-800 mb-3"}," AI ì¶ì² ìí ",-1)),(r(!0),n(k,null,w(i.value,(f,T)=>{var C;return r(),n("div",{key:T,class:"mb-4 last:mb-0"},[t("div",Y,[p(j,{product:f.product,class:"max-w-[200px] w-full"},null,8,["product"]),t("div",Z,[t("p",ee," ⢠"+m(f.recommendation),1),t("p",{class:"flex flex-col gap-1 p-2 bg-stone-50 rounded my-2",innerHTML:(C=f==null?void 0:f.product)==null?void 0:C.it_spec},null,8,te)])])])}),128))])):(r(),n("div",se,a[4]||(a[4]=[t("p",null,"ê¶ê¸í ìíì ëí´ ì§ë¬¸íìë©´",-1),t("p",null,"AIê° ì ì í ìíì ì¶ì²í´ ë립ëë¤.",-1)])))]),(M=d.value)!=null&&M.id?(r(),S(R,{key:1,"evaluation-id":d.value.id},null,8,["evaluation-id"])):h("",!0)])}}},oe={class:"container mx-auto p-4 space-y-8 my-8 min-h-[80vh]"},ne={__name:"AiSearchPage",setup(s){return(e,i)=>(r(),n("div",oe,[p(ae)]))}};export{ne as default}; 2//# sourceMappingURL=AiSearchPage-51ae9bbf.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.