PageSourceSearch

https://www.turconyc.com/_nuxt/BFaiWyW_.js

js turconyc.com collected 2026-10-08 05:48:34 UTC 8,288 bytes, 1 lines download raw bytes

1import{C as j,o as s,c as r,a1 as n,ax as G,h as J,v as W,ab as X,l as Q,K as t,a2 as w,J as c,au as E,av as $,a6 as p,I as v,ag as Z,r as y,aD as ee,aC as te,aE as oe,al as ne,aj as ae,d as _,bl as se,aF as T,bt as re,aI as ie,bu as le,bv as ce,bw as de}from"./DUW55w0f.js";import{u as ue,_ as me}from"./CM1T9YOX.js";import{_ as fe}from"./CiBTczK1.js";import{b as ge}from"./CuunLbk0.js";(function(){try{var d=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};d.SENTRY_RELEASE={id:"e61f9ba40f6c9f323ca507e3481c5c01202f2b66"};var f=new d.Error().stack;f&&(d._sentryDebugIds=d._sentryDebugIds||{},d._sentryDebugIds[f]="e4c00fd3-58ee-43ac-a6a6-3a22c10ccf3c",d._sentryDebugIdIdentifier="sentry-dbid-e4c00fd3-58ee-43ac-a6a6-3a22c10ccf3c")}catch{}})();const be=["fill"],pe=j({__name:"RatingStar",props:{filled:{type:Boolean},size:{}},setup(d){return(f,b)=>(s(),r("svg",{viewBox:"0 0 24 24","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:G([d.size??"size-9",d.filled?"text-amber-500":"text-zinc-300"]),fill:d.filled?"currentColor":"none",stroke:"currentColor"},[...b[0]||(b[0]=[n("path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"},null,-1)])],10,be))}}),xe=Object.assign(pe,{__name:"ReviewRatingStar"}),ve={class:"border-b border-default"},ye={class:"flex items-center justify-center px-4 py-4"},_e=["src","alt"],ke={class:"mx-auto max-w-md px-4 pt-10 pb-24"},he={key:0,class:"text-center"},we={class:"mx-auto flex size-16 items-center justify-center rounded-full bg-green-100"},Ce={key:1,class:"text-center"},Se={key:2,class:"text-center"},ze={key:3},Re={class:"text-center"},Ee={class:"mt-8 border border-default p-4",style:{"border-radius":"var(--ui-corner-radius)"}},$e={class:"flex items-center gap-1"},Te={key:0,class:"mt-3 text-sm text-(--ui-color-on-background) whitespace-pre-wrap"},je={class:"mt-3 text-xs text-(--ui-muted-color-on-background)"},Ae={key:4},Ie={class:"mt-3 flex items-center gap-2"},Le=["aria-label","aria-pressed","onClick","onMouseenter"],Ve={class:"flex items-center justify-end text-xs text-(--ui-muted-color-on-background)"},De={key:0,class:"text-sm text-red-500"},x=2e3,Fe=j({__name:"[token]",setup(d){J({title:"Rate your order"}),ge();const f=W(),{backgroundColor:b}=X(),{chainName:A,chainLogo:C}=Q(),I=_(()=>{const o=f.params.token;return Array.isArray(o)?o[0]??"":o??""}),L=_(()=>{const o=f.query.sentiment;if(o==="positive"||o==="negative")return o}),k=y(null),h=y(!1),S=y(null),i=y(null),m=ee({rating:0,comment:""}),V=te({rating:T(de(),ce(1,"Please select a rating"),le(5)),comment:T(ie(),re(x,`Keep your comment under ${x} characters`))}),{formRef:D,validateOn:N,enableValidation:B,onError:M}
1=ue(()=>m),U=_(()=>x-m.comment.length),F=_(()=>{const o=k.value??m.rating;return[1,2,3,4,5].map(e=>({value:e,filled:e<=o}))});function Y(o){m.rating=o}async function O(o){h.value=!0,i.value=null;try{const e=await $fetch("/api/reviews/submit",{method:"POST",body:{token:I.value,rating:o.data.rating,comment:o.data.comment.trim(),sentiment_at_click:L.value}});S.value=e.data}catch(e){i.value=H(e)}finally{h.value=!1}}function H(o){if(typeof o!="object"||o===null)return{kind:"field",general:"Something went wrong. Please try again."};const e=se(o)??500,a="data"in o&&typeof o.data=="object"?o.data??{}:{},g=typeof a.error_code=="string"?a.error_code:void 0;if(e===404||g==="review.token.invalid")return{kind:"invalid"};if(g==="review.token.expired")return{kind:"expired"};if(g==="review.already_submitted"&&typeof a.review=="object"&&a.review)return{kind:"duplicate",review:a.review};const u={};return Array.isArray(a.rating)&&typeof a.rating[0]=="string"&&(u.rating=a.rating[0]),Array.isArray(a.comment)&&typeof a.comment[0]=="string"&&(u.comment=a.comment[0]),!u.rating&&!u.comment&&(u.general=typeof a.message=="string"&&a.message?a.message:"Unable to submit review."),{kind:"field",...u}}function P(o){try{return new Date(o).toLocaleString()}catch{return o}}return(o,e)=>{const a=ne,g=ae,u=xe,z=me,q=fe,K=oe;return s(),r("div",{class:"min-h-screen",style:Z({backgroundColor:t(b)})},[n("header",ve,[n("div",ye,[t(C)?(s(),r("img",{key:0,src:t(C),alt:t(A),class:"h-10 max-w-[60vw] object-contain"},null,8,_e)):w("",!0)])]),n("main",ke,[t(S)?(s(),r("section",he,[n("div",we,[c(a,{name:"i-lucide-check",class:"size-8 text-green-600"})]),e[2]||(e[2]=n("h2",{class:"mt-4 font-heading text-2xl text-(--ui-color-on-background)"}," Thanks for your feedback ",-1)),e[3]||(e[3]=n("p",{class:"mt-2 text-sm text-(--ui-muted-color-on-background)"}," We've received your review. Your input helps us improve. ",-1)),c(g,{label:"Back to homepage",color:"primary",size:"lg",to:"/",class:"mt-8"})])):t(i)?.kind==="invalid"?(s(),r("section",Ce,[c(a,{name:"i-lucide-circle-x",class:"mx-auto size-10 text-red-400"}),e[4]||(e[4]=n("h2",{class:"mt-4 font-heading text-2xl text-(--ui-color-on-background)"},"Link not valid",-1)),e[5]||(e[5]=n("p",{class:"mt-2 text-sm text-(--ui-muted-color-on-background)"}," This review link isn't valid. It may have already been used or doesn't exist. ",-1))])):t(i)?.kind==="expired"?(s(),r("section",Se,[c(a,{name:"i-lucide-clock",class:"mx-auto size-10 text-amber-500"}),e[6]||(e[6]=n("h2",{class:"mt-4 font-heading text-2xl text-(--ui-color-on-background)"},"Link expired",-1)),e[7]||(e[7]=n("p",{class:"mt-2 text-sm text-(--ui-muted-color-on-background)"}," This review link has expired. Reviews can be submitted within 30 days of your order. ",-1))])):t(i)?.kind==="duplicate"?(s(),r("section",ze,[n("div",Re,[c(a,{name:"i-lucide-info",class:"mx-auto size-10 text-(--ui-muted-color-on-background)"}),e[8]||(e[8]=n("h2",{class:"mt-4 font-heading text-2xl text-(--ui-color-on-background)"}," Review already submitted ",-1)),e[9]||(e[9]=n("p",{class:"mt-2 text-sm text-(--ui-muted-color-on-background)"}," You've already shared your feedback for this order — here's what you said. ",-1))]),n("div",Ee,[n("div",$e,[(s(),r(E,null,$([1,2,3,4,5],l=>c(u,{key:l,filled:l<=t(i).review.rating,size:"size-5"},null,8,["filled"])),64))]),t(i).review.comment?(s(),r("p",Te,p(t(i).review.comment),1)):w("",!0),n("p",je,p(P(t(i).review.created_at)),1)])])):(s(),r("section",Ae,[e[10]||(e[10]=n("h2",{class:"font-heading text-3xl text-(--ui-color-on-background)"},"How was your order?",-1)),e[11]||(e[11]=n("p",{class:"mt-2 text-sm text-(--ui-muted-color-on-background)"}," Your feedback helps us serve you better next time. ",-1)),c(K,{ref_key:"formRef",ref:D,schema:t(V),state:t(m),"validate-on":t(N),class:"space-y-8",onSubmit:O,onError:t(M)},{default:v(()=>[c(z,{label:"Your rating",name:"rating",required:"","eager-validation":"",class:"mt-8",ui:{label:"text-sm font-bold-body text-(--ui-color-on-background)"}},{default:v(()=>[n("div",Ie,[(s(!0),r(E,null,$(t(F),l=>(s(),r("button",{key:l.value,type:"button",class:"rounded p-1 transition-transform hover:scale-110 focus:outline-none focus-visible:ring-2 focus-visible:ring-primary","aria-label":`${l.value} star${l.value===1?"":"s"}`,"aria-pressed":t(m).rating===l.value,onClick:R=>Y(l.value),onMouseenter:R=>k.value=l.value,onMouseleave:e[0]||(e[0]=R=>k.value=null)},[c(u,{filled:l.filled},null,8,["filled"])],40,Le))),128))])]),_:1}),c(z,{label:"Comments (optional)",name:"comment","eager-validation":"",ui:{label:"text-sm font-bold-body text-(--ui-color-on-background)"}},{help:v(()=>[n("div",Ve,[n("span",null,p(t(U))+" / "+p(x),1)])]),default:v(()=>[c(q,{id:"review-comment",modelValue:t(m).comment,"onUpdate:modelValue":e[1]||(e[1]=l=>t(m).comment=l),maxlength:x,rows:5,autoresize:"",placeholder:"Tell us more about your experience…",class:"mt-3 w-full"},null,8,["modelValue"])]),_:1}),t(i)?.kind==="field"&&t(i).general?(s(),r("p",De,p(t(i).general),1)):w("",!0),c(g,{type:"submit",label:"Submit review",color:"primary",size:"lg",block:"",loading:t(h),onClick:t(B)},null,8,["loading","onClick"])]),_:1},8,["schema","state","validate-on","onError"])]))])],4)}}});
1export{Fe as default};

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