1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9809],{93825:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/opinia/[token]",function(){return s(87198)}])},87198:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return x}});var n=s(85893),a=s(67294),i=s(11163),r=s(9008),o=s.n(r),l=s(92729);let c="/api";function d(e){let{rating:t,setRating:s,disabled:i}=e,[r,o]=(0,a.useState)(0),l=r||t;return(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"flex gap-1 justify-center mb-2",children:[1,2,3,4,5].map(e=>{let t=e-.5,a=l>=e;return(0,n.jsxs)("div",{className:"relative ".concat(i?"cursor-default":"cursor-pointer"),onMouseLeave:()=>!i&&o(0),style:{width:44,height:44},children:[(0,n.jsx)("svg",{width:"44",height:"44",viewBox:"0 0 24 24",className:"absolute inset-0",fill:"none",stroke:"#D1D5DB",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})}),a&&(0,n.jsx)("svg",{width:"44",height:"44",viewBox:"0 0 24 24",className:"absolute inset-0",fill:"#efbf38",stroke:"#efbf38",strokeWidth:"1.5",children:(0,n.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})}),l>=t&&!a&&(0,n.jsxs)("svg",{width:"44",height:"44",viewBox:"0 0 24 24",className:"absolute inset-0",stroke:"#efbf38",strokeWidth:"1.5",children:[(0,n.jsx)("defs",{children:(0,n.jsx)("clipPath",{id:"half-".concat(e),children:(0,n.jsx)("rect",{x:"0",y:"0",width:"12",height:"24"})})}),(0,n.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",fill:"#efbf38",clipPath:"url(#half-".concat(e,")")}),(0,n.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",fill:"none"})]}),(0,n.jsx)("div",{className:"absolute left-0 top-0 w-1/2 h-full z-10",onMouseEnter:()=>!i&&o(t),onClick:()=>!i&&s(t)}),(0,n.jsx)("div",{className:"absolute right-0 top-0 w-1/2 h-full z-10",onMouseEnter:()=>!i&&o(e),onClick:()=>!i&&s(e)})]},e)})}),l>0&&(0,n.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,n.jsx)("span",{className:"text-lg font-bold text-[#1C1C1C] font-heading",children:l}),(0,n.jsx)("span",{className:"text-xs text-gray-400",children:{.5:"Bardzo sÅabo",1:"Bardzo sÅabo",1.5:"SÅabo",2:"SÅabo",2.5:"PrzeciÄtnie",3:"Årednio",3.5:"Dobrze",4:"Dobrze",4.5:"Bardzo dobrze",5:"Åwietnie!"}[l]||""})]})]})}function x(){var e;let{token:t}=(0,i.useRouter)().query,[s,r]=(0,a.useState)(null),[x,m]=(0,a.useState)(0),[h,u]=(0,a.useState)(""),[j,f]=(0,a.useState)("loading"),[p,b]=(0,a.useState)(!1),[y,g]=(0,a.useState)(null);(0,a.useEffect)(()=>{t&&l.Z.get(c+"/reviews/form/"+t).then(e=>{r(e.data),f("ready")}).catch(e=>{var t,s;(null===(t=e.response)||void 0===t?void 0:t.status)===410?f("expired"):(null===(s=e.response)||void 0===s?void 0:s.status)===409?(g(e.response.data),f("already_submitted")):f("error")})},[t]);let w=async e=>{if(e.preventDefault(),0!==x){b(!0);try{await l.Z.post(c+"/reviews/form/"+t,{rating:x,comment:h}),f("submitted")}catch(e){f("error")}finally{b(!1)}}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(o(),{children:[(0,n.jsx)("title",{children:(null==s?void 0:s.companyName)?"Opinia - ".concat(s.companyName):"Opinia o usÅudze"}),(0,n.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1"}),(0,n.jsx)("meta",{name:"robots",content:"noindex, nofollow"})]}),(0,n.jsx)("div",{className:"min-h-screen bg-[#EFF1F5] flex items-center justify-center p-4",children:(0,n.jsxs)("div",{className:"w-full max-w-md",children:[("ready"===j||"submitted"===j)&&s&&(0,n.jsxs)("div",{className:"text-center mb-6",children:[s.logoUrl?(0,n.jsx)("div",{className:"w-20 h-20 mx-auto mb-3 rounded-2xl overflow-hidden bg-white border border-gray-200 shadow-sm flex items-center justify-center",children:(0,n.jsx)("img",{src:s.logoUrl,alt:"",className:"w-full h-full object-contain"})}):(0,n.jsx)("div",{className:"w-20 h-20 mx-auto mb-3 rounded-2xl bg-[#1A94FF] flex items-center justify-center text-white font-extrabold text-2xl font-heading shadow-sm",children:(s.companyName||"TF").charAt(0)}),(0,n.jsx)("h1",{className:"text-xl font-bold text-[#1C1C1C] font-heading",children:s.companyName})]}),(0,n.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg border border-gray-100 overflow-hidden",children:["loading"===j&&(0,n.jsxs)("div",{className:"p-10 text-center",children:[(0,n.jsx)("div",{className:"w-10 h-10 border-3 border-gray-200 border-t-[#1A94FF] rounded-full animate-spin mx-auto mb-3"}),(0,n.jsx)("p",{className:"text-sm text-gray-400",children:"Åadowanie formularza..."})]}),"ready"===j&&s&&(0,n.jsxs)("form",{onSubmit:w,children:[(0,n.jsxs)("div",{className:"p-6 pb-4",children:[(0,n.jsxs)("div",{className:"text-center mb-6",children:[(0,n.jsx)("h2",{className:"text-lg font-bold text-[#1C1C1C] font-heading mb-1",children:"DziÄkujemy za skorzystanie z naszych usÅug!"}),(0,n.jsx)("p",{className:"text-sm text-gray-500",children:"Prosimy o kr\xf3tkÄ
opiniÄ dotyczÄ
cÄ
wykonanej usÅugi. Twoja ocena pomoże nam siÄ rozwijaÄ."})]}),(0,n.jsxs)("div",{className:"bg-[#F8F9FA] rounded-xl p-3.5 mb-6",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,n.jsx)("span",{className:"text-gray-500",children:"UsÅuga"}),(0,n.jsx)("span",{className:"font-medium text-[#1C1C1C]",children:s.serviceName||"SprzÄ
tanie"})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm mt-1.5",children:[(0,n.jsx)("span",{className:"text-gray-500",children:"Data"}),(0,n.jsx)("span",{className:"font-medium text-[#1C1C1C]",children:(e=s.jobDate)?new Date(e).toLocaleDateString("pl-PL",{day:"numeric",month:"long",year:"numeric"}):""})]})]}),(0,n.jsxs)("div",{className:"text-center mb-6",children:[(0,n.jsx)("label",{className:"text-sm font-semibold text-[#1C1C1C] block mb-3",children:"Jak oceniasz wykonanÄ
usÅugÄ?"}),(0,n.jsx)(d,{rating:x,setRating:m})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-sm font-semibold text-[#1C1C1C] block mb-2",children:"Komentarz (opcjonalnie)"}),(0,n.jsx)("textarea",{value:h,onChange:e=>u(e.target.value),placeholder:"Powiedz nam co myÅlisz o wykonanej usÅudze...",rows:3,maxLength:1e3,className:"w-full bg-[#F8F9FA] border border-gray-200 rounded-xl px-4 py-3 text-sm outline-none focus:border-[#1A94FF] focus:ring-2 focus:ring-[#1A94FF]/10 resize-none transition-all"})]})]}),(0,n.jsx)("div",{className:"px-6 pb-6",children:(0,n.jsxs)("button",{type:"submit",disabled:0===x||p,className:"w-full py-3.5 rounded-xl font-semibold text-sm transition-all flex items-center justify-center gap-2 ".concat(0===x?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-[#1A94FF] hover:bg-[#0D7AE0] text-white shadow-md hover:shadow-lg active:scale-[0.98]"," ").concat(p?"o
1pacity-70":""),children:[p&&(0,n.jsx)("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),p?"WysyÅanie...":"WyÅlij opiniÄ"]})})]}),"submitted"===j&&(0,n.jsxs)("div",{className:"p-8 text-center",children:[(0,n.jsx)("div",{className:"w-16 h-16 bg-[#F0FDF4] rounded-full flex items-center justify-center mx-auto mb-4",children:(0,n.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#22C55E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"20 6 9 17 4 12"})})}),(0,n.jsx)("h2",{className:"text-xl font-bold text-[#1C1C1C] font-heading mb-2",children:"DziÄkujemy za opiniÄ!"}),(0,n.jsxs)("p",{className:"text-sm text-gray-500 mb-1",children:["Twoja ocena (",x,"/5) zostaÅa zapisana."]}),(0,n.jsx)("p",{className:"text-sm text-gray-400",children:"Doceniamy Tw\xf3j czas i pomoc w doskonaleniu naszych usÅug."})]}),"already_submitted"===j&&(0,n.jsxs)("div",{className:"p-8 text-center",children:[(0,n.jsx)("div",{className:"w-16 h-16 bg-[#E8F4FF] rounded-full flex items-center justify-center mx-auto mb-4",children:(0,n.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#1A94FF",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,n.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),(0,n.jsx)("h2",{className:"text-xl font-bold text-[#1C1C1C] font-heading mb-2",children:"Opinia już wysÅana"}),(0,n.jsxs)("p",{className:"text-sm text-gray-500",children:["DziÄkujemy - Twoja opinia (",null==y?void 0:y.rating,"/5) zostaÅa już wczeÅniej zapisana."]})]}),"expired"===j&&(0,n.jsxs)("div",{className:"p-8 text-center",children:[(0,n.jsx)("div",{className:"w-16 h-16 bg-[#FFF8E1] rounded-full flex items-center justify-center mx-auto mb-4",children:(0,n.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#E0A800",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("polyline",{points:"12 6 12 12 16 14"})]})}),(0,n.jsx)("h2",{className:"text-xl font-bold text-[#1C1C1C] font-heading mb-2",children:"Link wygasÅ"}),(0,n.jsx)("p",{className:"text-sm text-gray-500",children:"Ten link do opinii nie jest już aktywny. Skontaktuj siÄ z firmÄ
, aby otrzymaÄ nowy link."})]}),"error"===j&&(0,n.jsxs)("div",{className:"p-8 text-center",children:[(0,n.jsx)("div",{className:"w-16 h-16 bg-[#FEF2F2] rounded-full flex items-center justify-center mx-auto mb-4",children:(0,n.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"#EF4444",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,n.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})}),(0,n.jsx)("h2",{className:"text-xl font-bold text-[#1C1C1C] font-heading mb-2",children:"WystÄ
piÅ bÅÄ
d"}),(0,n.jsx)("p",{className:"text-sm text-gray-500",children:"Nie udaÅo siÄ zaÅadowaÄ formularza. Sprawdź link i spr\xf3buj ponownie."})]})]}),(0,n.jsx)("div",{className:"text-center mt-5",children:(0,n.jsxs)("p",{className:"text-[11px] text-gray-400",children:[(0,n.jsx)("a",{href:"https://www.twojafirma.pro",target:"_blank",rel:"noopener noreferrer",className:"font-semibold hover:text-[#1A94FF] transition-colors",children:"Twoja Firma"})," | email: [email protected] | Tel: +48 534 00 8282"]})})]})})]})}},9008:function(e,t,s){e.exports=s(23867)}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=93825)}),_N_E=e.O()}]);
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.