PageSourceSearch

https://rabbitcare.com/_next/static/chunks/pages/web-view/submit-ticket-fd5034f3639f75cc.js

js rabbitcare.com collected 2026-09-26 00:29:01 UTC 48,102 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8449],{35907:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/web-view/submit-ticket",function(){return n(96765)}])},9389:function(e,t,n){"use strict";n.d(t,{g:function(){return s}});var r=n(44037),i=n(49453),a=n.n(i),o=n(73568);let l=["line.me","m.me","messenger.com","wa.me","api.whatsapp.com"];function s(){return(0,o.useEffect)(()=>{let e=e=>{var t,n,r;let i;if(!(void 0!==window.RabbitApp)||e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let a=null===(n=e.target)||void 0===n?void 0:null===(t=n.closest)||void 0===t?void 0:t.call(n,"a"),o=null==a?void 0:a.getAttribute("href");if(!o||/^(tel:|mailto:|rabbitcare:)/i.test(o))return;try{i=new URL(o,window.location.href)}catch(e){return}if("http:"!==i.protocol&&"https:"!==i.protocol||(r=i).origin===window.location.origin&&/(^|\/)web-view(\/|$)/.test(r.pathname)||function(e){let t=e.hostname.toLowerCase();return l.some(e=>t===e||t.endsWith(".".concat(e)))}(i))return;e.preventDefault();let s="http:"===i.protocol?i.href.replace(/^http:/,"https:"):i.href,c=(document.documentElement.lang||"").startsWith("en"),u="rabbitcare://webview?url=".concat(encodeURIComponent(s))+"&title=".concat(encodeURIComponent(c?"Details":"รายละเอียด"));window.location.href=u};return document.addEventListener("click",e,!0),()=>document.removeEventListener("click",e,!0)},[]),(0,r.jsx)(a(),{children:(0,r.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1.0, viewport-fit=cover"})})}},83333:function(e,t,n){"use strict";n.d(t,{Bn:function(){return l},Fj:function(){return m},Og:function(){return s},V7:function(){return c},W1:function(){return a},XC:function(){return o},_K:function(){return d},aF:function(){return v},dY:function(){return u},nQ:function(){return g},nX:function(){return p},og:function(){return y},pl:function(){return x},v4:function(){return b},yx:function(){return f},zM:function(){return h}});var r=n(44037);let i={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"};function a(e){return(0,r.jsxs)("svg",{...i,strokeWidth:2,...e,children:[(0,r.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,r.jsx)("path",{d:"m21 21-4.3-4.3"})]})}function o(e){return(0,r.jsx)("svg",{...i,strokeWidth:2,...e,children:(0,r.jsx)("path",{d:"m9 18 6-6-6-6"})})}function l(e){return(0,r.jsxs)("svg",{...i,viewBox:"3 3 18 17",...e,children:[(0,r.jsx)("path",{d:"M9 14 4 9l5-5"}),(0,r.jsx)("path",{d:"M4 9h11a5 5 0 0 1 0 10h-3"})]})}function s(e){return(0,r.jsx)("svg",{viewBox:"0 0 25 20",fill:"currentColor",...e,children:(0,r.jsx)("path",{d:"M25 7.5V2.5C25 1.1125 23.875 0 22.5 0H2.5C1.125 0 0.0125 1.1125 0.0125 2.5V7.5C1.3875 7.5 2.5 8.625 2.5 10C2.5 11.375 1.3875 12.5 0 12.5V17.5C0 18.875 1.125 20 2.5 20H22.5C23.875 20 25 18.875 25 17.5V12.5C23.625 12.5 22.5 11.375 22.5 10C22.5 8.625 23.625 7.5 25 7.5ZM22.5 5.675C21.0125 6.5375 20 8.1625 20 10C20 11.8375 21.0125 13.4625 22.5 14.325V17.5H2.5V14.325C3.9875 13.4625 5 11.8375 5 10C5 8.15 4 6.5375 2.5125 5.675L2.5 2.5H22.5V5.675ZM11.25 13.75H13.75V16.25H11.25V13.75ZM11.25 8.75H13.75V11.25H11.25V8.75ZM11.25 3.75H13.75V6.25H11.25V3.75Z"})})}function c(e){return(0,r.jsxs)("svg",{...i,viewBox:"4 2 16 20",...e,children:[(0,r.jsx)("path",{d:"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"}),(0,r.jsx)("path",{d:"M14 3v5h5"})]})}function u(e){return(0,r.jsxs)("svg",{...i,viewBox:"2 2 20 20",...e,children:[(0,r.jsx)("path",{d:"M12 20h9"}),(0,r.jsx)("path",{d:"M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z"})]})}function d(e){return(0,r.jsxs)("svg",{...i,viewBox:"2 5 20 14",...e,children:[(0,r.jsx)("rect",{x:"3",y:"6",width:"18",height:"12",rx:"2"}),(0,r.jsx)("path",{d:"M3 10h18"})]})}function h(e){return(0,r.jsxs)("svg",{...i,viewBox:"1 2 22 19",...e,children:[(0,r.jsx)("path",{d:"M12 3 2 20h20z"}),(0,r.jsx)("path",{d:"M12 10v4M12 17h.01"})]})}function p(e){return(0,r.jsxs)("svg",{...i,viewBox:"3 3 18 18",...e,children:[(0,r.jsx)("circle",{cx:"5",cy:"12",r:"1.5"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"1.5"}),(0,r.jsx)("circle",{cx:"19",cy:"12",r:"1.5"})]})}function m(e){return(0,r.jsxs)("svg",{...i,viewBox:"3 1 18 22",...e,children:[(0,r.jsx)("path",{d:"M12 2 4 6v6c0 5 3.4 8.5 8 10 4.6-1.5 8-5 8-10V6z"}),(0,r.jsx)("path",{d:"m9 12 2 2 4-4"})]})}function f(e){return(0,r.jsx)("svg",{viewBox:"0 0 33 26",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...e,children:(0,r.jsx)("path",{d:"M31.327 8.342H28.0753L25.4991 2.73401C24.9414 1.52601 23.7397 0.75 22.4359 0.75H10.1988C8.88711 0.75 7.6854 1.52601 7.13559 2.73401L4.55936 8.342H1.27624C0.985629 8.342 0.75 8.662 0.75 9.054V10.366C0.75 10.718 0.938504 11.022 1.1977 11.07L2.82355 11.39C2.79999 11.526 2.78428 11.67 2.78428 11.822V18.39V23.406C2.78428 24.15 3.37336 24.75 4.10381 24.75H6.23234C6.9628 24.75 7.55187 24.15 7.55187 23.406V20.79H25.0278V23.406C25.0278 24.15 25.6169 24.75 26.3474 24.75H28.4759C29.2063 24.75 29.7954 24.15 29.7954 23.406V11.814C29.7954 11.67 29.7797 11.526 29.7561 11.39L31.4134 11.062C31.6726 11.014 31.8611 10.71 31.8611 10.358V9.04601C31.8611 8.65401 31.6255 8.33401 31.3349 8.33401L31.327 8.342ZM9.09918 3.678C9.29554 3.246 9.71968 2.974 10.1909 2.974H22.428C22.8914 2.974 23.3234 3.254 23.5198 3.678L26.1588 9.414H6.46797L9.10703 3.678H9.09918ZM7.22984 16.606C6.07525 16.606 5.14844 15.654 5.14844 14.486C5.14844 13.318 6.08311 12.366 7.22984 12.366C8.37658 12.366 9.31125 13.318 9.31125 14.486C9.31125 15.654 8.37658 16.606 7.22984 16.606ZM24.6272 16.606C23.4727 16.606 22.5458 15.654 22.5458 14.486C22.5458 13.318 23.4805 12.366 24.6272 12.366C25.774 12.366 26.7087 13.318 26.7087 14.486C26.7087 15.654 25.774 16.606 24.6272 16.606Z"})})}function x(e){return(0,r.jsx)("svg",{...i,...e,children:(0,r.jsx)("path",{d:"M8 3h8v5h5v8h-5v5H8v-5H3V8h5z"})})}function v(e){return(0,r.jsx)("svg",{viewBox:"0 0 26 26",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...e,children:(0,r.jsx)("path",{d:"M21.6428 13.6774C21.5308 13.5655 21.3469 13.5655 21.2349 13.6774L20.4111 14.5012L19.0755 9.44667L22.6025 6.19159C24.1221 4.67203 25.3137 1.83284 24.49 1.00907C23.6662 0.185308 20.739 1.46495 19.3074 2.89654L16.0524 6.42354L10.9978 5.08791L11.8216 4.26414C11.9336 4.15218 11.9336 3.96822 11.8216 3.85625L10.1021 2.13675C9.99011 2.02478 9.80618 2.02478 9.69421 2.13675L8.10265 3.72829C7.95069 3.88024 7.85474 4.05621 7.79875 4.24816L4.64766 3.41639C4.04783 3.28043 3.384 3.48836 2.90414 3.96023L0.904711 5.26386C0.672778 5.49579 0.704782 5.85568 0.968707 6.00764L10.8059 12.1099L7.00696 16.2207L2.7442 15.381C2.60024 15.357 2.46428 15.397 2.36831 15.4849L0.904711 16.5166C0.696771 16.7246 0.784747 17.1005 1.08066 17.2604L4.93556 19.3878C4.83159 19.6757 4.75162 19.9477 4.74362 20.1876C4.72763 20.5075 4.99155 20.7714 5.31146 20.7554C5.54339 20.7474 5.82331 20.6674 6.11123 20.5635L8.23862 24.4184C8.39857 24.7143 8.78246 24.8022 8.9824 24.5943L10.0141 23.1307C10.1101 23.0348 10.1501 22.8988 10.1181 22.7548L9.27831 18.4921L13.3891 14.6932L19.4914 24.5303C19.6434 24.7943 20.0032 24.8262 20.2352 24.5943L21.5388 22.5949C22.0107 22.123 22.2186 21.4512 22.0826 20.8514L21.2509 17.7003C21.4428 17.6443 21.6188 17.5483 21.7707 17.3964L23.3623 15.8048C23.4743 15.6929 23.4743 15.5089 23.3623 15.3969L21.6428 13.6774Z"})})}function b(e){return(0,r.jsx)("svg",{...i,strokeWidth:2,...e,children:(0,r.jsx)("path",{d:"m6 9 6 6 6-6"})})}function g(e){return(0,r.jsx)("svg",{...i,strokeWidth:2,...e,children:(0,r.jsx)("path",{d:"m5 12 5 5L20 7"})})}function y(e){return(0,r.jsx)("svg",{...i,...e,children:(0,r.jsx)("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})})}},96765:function(e,t,n){"use strict";let r,i;n.r(t),n.d(t,{__N_SSG:function(){return eb},default:function(){return eg}});var a=n(44037),o=n(83333),l=n(64597),s=n(73250),c=n.n(s);function u(){let{t:e}=(0,l.Z)("common");return(0,a.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center px-7 py-10 text-center",children:[(0,a.jsx)("span",{className:"mb-4 grid size-[78px] place-items-center rounded-[26px] bg-[#EAF8F2] text-[#16A36A]",children:(0,a.jsx)(o.nQ,{className:"size-[38px]"})}),(0,a.jsx)("h2",{className:"mb-2 text-xl font-bold text-[#003E78]",children:e("info_hub.submit_ticket.submitted_title")}),(0,a.jsx)("p",{className:"mb-5 max-w-[300px] text-sm leading-relaxed text-[#667085]",children:e("info_hub.submit_ticket.submitted_body")}),(0,a.jsx)(c(),{href:"/web-view/faq",className:"flex h-[50px] w-full max-w-[300px] items-center justify-center rounded-2xl bg-primaryColor text-base font-bold text-white shadow-lg",children:e("info_hub.submit_ticket.back_to_support")})]})}var d=n(52538);let h={doc:o.V7,pay:o._K,edit:o.dY,gift:o.Og,return:o.Bn,shield:o.Fj,car:o.yx,alert:o.zM,more:o.nX},p={insuranceType:["motor","pa","ipd_opd","critical_illness","kids","life","other_health","travel","home","pet"],policyholderType:["individual","company"],whoSubmitting:["self","spouse","parent","child","other"],osType:["ios","android"],voucherSource:["car_insurance_purchase","friend_referral"],voucherIssue:["not_received","value_mismatch","redemption_issue"],addRemoveDriver:["yes","no"],changeAccessory:["yes","no"],changePolicyholderName:["yes","no"]},m={insuranceType:{group:"policy",type:"select",options:"insuranceType"},policyholderType:{group:"policy",type:"select",options:"policyholderType"},orderNumber:{group:"policy",type:"text"},insurerName:{group:"policy",type:"insurer"},policyholderName:{group:"policy",type:"text"},licensePlate:{group:"vehicle",type:"text"},registeredProvince:{group:"vehicle",type:"province"},whoSubmitting:{group:"contact",type:"select",options:"whoSubmitting"},relationshipOther:{group:"contact",type:"text"},contactName:{group:"contact",type:"text"},phone:{group:"contact",type:"tel"},email:{group:"contact",type:"email"},replacementProvince:{group:"additional",type:"province"}
1,pickupDetails:{group:"additional",type:"textarea"},returnDetails:{group:"additional",type:"textarea"},rentalDays:{group:"additional",type:"number"},claimDocument:{group:"additional",type:"file"},screenshotPersonalInfo:{group:"additional",type:"file"},screenshotIssue:{group:"additional",type:"file"},appVersion:{group:"additional",type:"text"},osType:{group:"additional",type:"select",options:"osType"},shippingAddress:{group:"additional",type:"textarea"},voucherSource:{group:"additional",type:"select",options:"voucherSource"},referrerPlate:{group:"additional",type:"text"},referredPlate:{group:"additional",type:"text"},voucherValueCommunicated:{group:"additional",type:"number"},voucherIssue:{group:"additional",type:"select",options:"voucherIssue"},voucherValueSales:{group:"additional",type:"text"},voucherValueActual:{group:"additional",type:"text"},redemptionDate:{group:"additional",type:"date"},bigCBranch:{group:"additional",type:"text"},voucherCode:{group:"additional",type:"textarea"},currentInfo:{group:"changes",type:"textarea"},newInfo:{group:"changes",type:"textarea"},addRemoveDriver:{group:"documents",type:"select",options:"addRemoveDriver"},changeAccessory:{group:"documents",type:"select",options:"changeAccessory"},changePolicyholderName:{group:"documents",type:"select",options:"changePolicyholderName"},carRegistration:{group:"documents",type:"file"},policyholderIdCard:{group:"documents",type:"file"},companyAffidavit:{group:"documents",type:"file"},directorIdCard:{group:"documents",type:"file"},driverLicense:{group:"documents",type:"file"},accessoryReceipt:{group:"documents",type:"file"},nameChangeCertificate:{group:"documents",type:"file"}},f=["policy","vehicle","contact","additional","changes","documents"],x=(e,t,n)=>({id:e,required:t,...n?{showIf:n}:{}}),v={field:"insuranceType",equals:"motor"},b=[x("insuranceType",!0),x("policyholderType",!0,v),x("orderNumber",!0),x("insurerName",!0),x("policyholderName",!0),x("licensePlate",!0,v),x("registeredProvince",!0,v),x("whoSubmitting",!0),x("relationshipOther",!0,{field:"whoSubmitting",equals:"other"}),x("contactName",!0),x("phone",!0),x("email",!0)],g=e=>[...b,...e],y=[{id:"physical",icon:"doc",fields:g([x("shippingAddress",!0)]),tipCount:2,instCount:2},{id:"payment",icon:"pay",fields:g([]),tipCount:2,instCount:2},{id:"endorsement",icon:"edit",fields:g([x("currentInfo",!0),x("newInfo",!0),x("carRegistration",!0,v),x("policyholderIdCard",!0,[v,{field:"policyholderType",equals:"individual"}]),x("companyAffidavit",!0,[v,{field:"policyholderType",equals:"company"}]),x("directorIdCard",!0,[v,{field:"policyholderType",equals:"company"}]),x("changePolicyholderName",!0,[v,{field:"policyholderType",equals:"individual"}]),x("nameChangeCertificate",!0,[v,{field:"policyholderType",equals:"individual"},{field:"changePolicyholderName",equals:"yes"}]),x("addRemoveDriver",!0,v),x("driverLicense",!0,[v,{field:"addRemoveDriver",equals:"yes"}]),x("changeAccessory",!0,v),x("accessoryReceipt",!0,[v,{field:"changeAccessory",equals:"yes"}])]),tipCount:2,instCount:1},{id:"voucher",icon:"gift",fields:g([x("voucherSource",!0),x("referrerPlate",!0,{field:"voucherSource",equals:"friend_referral"}),x("referredPlate",!0,{field:"voucherSource",equals:"friend_referral"}),x("voucherValueCommunicated",!0,{field:"voucherSource",equals:"friend_referral"}),x("voucherIssue",!0),x("voucherValueSales",!0,{field:"voucherIssue",equals:"value_mismatch"}),x("voucherValueActual",!0,{field:"voucherIssue",equals:"value_mismatch"}),x("redemptionDate",!0,{field:"voucherIssue",equals:"redemption_issue"}),x("bigCBranch",!0,{field:"voucherIssue",equals:"redemption_issue"}),x("voucherCode",!0,{field:"voucherIssue",equals:"redemption_issue"}),x("screenshotPersonalInfo",!0)]),tipCount:2,instCount:1},{id:"cancellation",icon:"return",fields:[],tipCount:2,instCount:0,cancel:!0},{id:"refund",icon:"return",fields:g([]),tipCount:2,instCount:2},{id:"pdpa",icon:"shield",fields:g([]),tipCount:2,instCount:1},{id:"service",icon:"car",fields:g([x("replacementProvince",!0),x("pickupDetails",!0),x("returnDetails",!0),x("rentalDays",!0),x("claimDocument",!0),x("carRegistration",!0,v),x("policyholderIdCard",!0,[v,{field:"policyholderType",equals:"individual"}]),x("directorIdCard",!0,[v,{field:"policyholderType",equals:"company"}]),x("driverLicense",!0,v)]),tipCount:2,instCount:1},{id:"app",icon:"alert",fields:g([x("screenshotPersonalInfo",!0),x("screenshotIssue",!0),x("appVersion",!0),x("osType",!1)]),tipCount:2,instCount:1},{id:"other",icon:"more",fields:g([x("screenshotPersonalInfo",!0),x("appVersion",!0)]),tipCount:2,instCount:1}],_={policy_document:"physical"};function j(e){return y.find(t=>
1t.id===e)}function C(e,t){return e.fields.filter(e=>!e.showIf||(Array.isArray(e.showIf)?e.showIf:[e.showIf]).every(e=>t[e.field]===e.equals))}let N={physical:"physical_policy_delivery",payment:"payment_and_installment",endorsement:"change_policy_detail",voucher:"follow_the_voucher",refund:"refund",pdpa:"pdpa",service:"car_replacement_service",app:"report_application_issue",other:"other"},k=["jpg","jpeg","png","pdf"];var w=n(1887);let A=[{value:"กรุงเทพมหานคร",en:"Bangkok",th:"กรุงเทพมหานคร"},{value:"กระบี่",en:"Krabi",th:"กระบี่"},{value:"กาญจนบุรี",en:"Kanchanaburi",th:"กาญจนบุรี"},{value:"กาฬสินธุ์",en:"Kalasin",th:"กาฬสินธุ์"},{value:"กำแพงเพชร",en:"Kamphaeng Phet",th:"กำแพงเพชร"},{value:"ขอนแก่น",en:"Khon Kaen",th:"ขอนแก่น"},{value:"จันทบุรี",en:"Chanthaburi",th:"จันทบุรี"},{value:"ฉะเชิงเทรา",en:"Chachoengsao",th:"ฉะเชิงเทรา"},{value:"ชลบุรี",en:"Chon Buri",th:"ชลบุรี"},{value:"ชัยนาท",en:"Chai Nat",th:"ชัยนาท"},{value:"ชัยภูมิ",en:"Chaiyaphum",th:"ชัยภูมิ"},{value:"ชุมพร",en:"Chumphon",th:"ชุมพร"},{value:"เชียงราย",en:"Chiang Rai",th:"เชียงราย"},{value:"เชียงใหม่",en:"Chiang Mai",th:"เชียงใหม่"},{value:"ตรัง",en:"Trang",th:"ตรัง"},{value:"ตราด",en:"Trat",th:"ตราด"},{value:"ตาก",en:"Tak",th:"ตาก"},{value:"นครนายก",en:"Nakhon Nayok",th:"นครนายก"},{value:"นครปฐม",en:"Nakhon Pathom",th:"นครปฐม"},{value:"นครพนม",en:"Nakhon Phanom",th:"นครพนม"},{value:"นครราชสีมา",en:"Nakhon Ratchasima",th:"นครราชสีมา"},{value:"นครศรีธรรมราช",en:"Nakhon Si Thammarat",th:"นครศรีธรรมราช"},{value:"นครสวรรค์",en:"Nakhon Sawan",th:"นครสวรรค์"},{value:"นนทบุรี",en:"Nonthaburi",th:"นนทบุรี"},{value:"นราธิวาส",en:"Narathiwat",th:"นราธิวาส"},{value:"น่าน",en:"Nan",th:"น่าน"},{value:"บึงกาฬ",en:"Bueng Kan",th:"บึงกาฬ"},{value:"บุรีรัมย์",en:"Buri Ram",th:"บุรีรัมย์"},{value:"ปทุมธานี",en:"Pathum Thani",th:"ปทุมธานี"},{value:"ประจวบคีรีขันธ์",en:"Prachuap Khiri Khan",th:"ประจวบคีรีขันธ์"},{value:"ปราจีนบุรี",en:"Prachin Buri",th:"ปราจีนบุรี"},{value:"ปัตตานี",en:"Pattani",th:"ปัตตานี"},{value:"พระนครศรีอยุธยา",en:"Phra Nakhon Si Ayutthaya",th:"พระนครศรีอยุธยา"},{value:"พะเยา",en:"Phayao",th:"พะเยา"},{value:"พังงา",en:"Phang Nga",th:"พังงา"},{value:"พัทลุง",en:"Phatthalung",th:"พัทลุง"},{value:"พิจิตร",en:"Phichit",th:"พิจิตร"},{value:"พิษณุโลก",en:"Phitsanulok",th:"พิษณุโลก"},{value:"เพชรบุรี",en:"Phetchaburi",th:"เพชรบุรี"},{value:"เพชรบูรณ์",en:"Phetchabun",th:"เพชรบูรณ์"},{value:"แพร่",en:"Phrae",th:"แพร่"},{value:"ภูเก็ต",en:"Phuket",th:"ภูเก็ต"},{value:"มหาสารคาม",en:"Maha Sarakham",th:"มหาสารคาม"},{value:"มุกดาหาร",en:"Mukdahan",th:"มุกดาหาร"},{value:"แม่ฮ่องสอน",en:"Mae Hong Son",th:"แม่ฮ่องสอน"},{value:"ยโสธร",en:"Yasothon",th:"ยโสธร"},{value:"ยะลา",en:"Yala",th:"ยะลา"},{value:"ร้อยเอ็ด",en:"Roi Et",th:"ร้อยเอ็ด"},{value:"ระนอง",en:"Ranong",th:"ระนอง"},{value:"ระยอง",en:"Rayong",th:"ระยอง"},{value:"ราชบุรี",en:"Ratchaburi",th:"ราชบุรี"},{value:"ลพบุรี",en:"Lop Buri",th:"ลพบุรี"},{value:"ลำปาง",en:"Lampang",th:"ลำปาง"},{value:"ลำพูน",en:"Lamphun",th:"ลำพูน"},{value:"เลย",en:"Loei",th:"เลย"}
1,{value:"ศรีสะเกษ",en:"Si Sa Ket",th:"ศรีสะเกษ"},{value:"สกลนคร",en:"Sakon Nakhon",th:"สกลนคร"},{value:"สงขลา",en:"Songkhla",th:"สงขลา"},{value:"สตูล",en:"Satun",th:"สตูล"},{value:"สมุทรปราการ",en:"Samut Prakan",th:"สมุทรปราการ"},{value:"สมุทรสงคราม",en:"Samut Songkhram",th:"สมุทรสงคราม"},{value:"สมุทรสาคร",en:"Samut Sakhon",th:"สมุทรสาคร"},{value:"สระแก้ว",en:"Sa Kaeo",th:"สระแก้ว"},{value:"สระบุรี",en:"Saraburi",th:"สระบุรี"},{value:"สิงห์บุรี",en:"Sing Buri",th:"สิงห์บุรี"},{value:"สุโขทัย",en:"Sukhothai",th:"สุโขทัย"},{value:"สุพรรณบุรี",en:"Suphan Buri",th:"สุพรรณบุรี"},{value:"สุราษฎร์ธานี",en:"Surat Thani",th:"สุราษฎร์ธานี"},{value:"สุรินทร์",en:"Surin",th:"สุรินทร์"},{value:"หนองคาย",en:"Nong Khai",th:"หนองคาย"},{value:"หนองบัวลำภู",en:"Nong Bua Lam Phu",th:"หนองบัวลำภู"},{value:"อ่างทอง",en:"Ang Thong",th:"อ่างทอง"},{value:"อำนาจเจริญ",en:"Amnat Charoen",th:"อำนาจเจริญ"},{value:"อุดรธานี",en:"Udon Thani",th:"อุดรธานี"},{value:"อุตรดิตถ์",en:"Uttaradit",th:"อุตรดิตถ์"},{value:"อุทัยธานี",en:"Uthai Thani",th:"อุทัยธานี"},{value:"อุบลราชธานี",en:"Ubon Ratchathani",th:"อุบลราชธานี"}];var L=n(37177);let E={motor:"products/car-insurance",nonMotor:"products/health-insurance"};async function P(){return r||(r=L.Z.get("/api/gff/insurers").then(e=>{var t;let{data:n}=e;return null!==(t=n.insurers)&&void 0!==t?t:[]}).catch(()=>(r=void 0,[]))),r}var S=n(73568);let B="mb-3 rounded-[18px] border border-[#E1E8F2] bg-white p-[18px]",I="h-[46px] w-full rounded-xl border border-[#D8E0EC] bg-white px-3 text-[13.5px] text-[#1A2330] outline-none placeholder:text-[#9AA6B8] focus:border-primaryColor focus:ring-[3px] focus:ring-primaryColor/10",T="border-[#D94B48] focus:border-[#D94B48] focus:ring-[#D94B48]/10";function V(){return(0,a.jsx)("span",{className:"text-[#D94B48]",children:"*"})}function M(e){let{file:t,label:r,fallbackLabel:l}=e,s=(0,S.useRef)(null),[c,u]=(0,S.useState)(!1);return((0,S.useEffect)(()=>{let e,r=!1;return(async()=>{try{var a;let o=await t.arrayBuffer();if(r)return;let l=await (i||(i=Promise.all([n.e(4175),n.e(8063)]).then(n.t.bind(n,32569,23)).then(e=>(e.GlobalWorkerOptions.workerSrc=new n.U(n(88851)).toString(),e))),i);e=await l.getDocument({data:new Uint8Array(o)}).promise;let c=await e.getPage(1),u=s.current,d=null==u?void 0:u.getContext("2d");if(r||!u||!d)return;let h=c.getViewport({scale:1}),p=(null===(a=u.parentElement)||void 0===a?void 0:a.clientWidth)||h.width,m=window.devicePixelRatio||1,f=c.getViewport({scale:p/h.width*m});u.width=Math.floor(f.width),u.height=Math.floor(f.height),u.style.width="100%",u.style.height="auto",await c.render({canvasContext:d,viewport:f}).promise}catch(e){r||u(!0)}})(),()=>{r=!0,null==e||e.destroy()}},[t]),c)?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 rounded-lg border border-[#e2e8f0] bg-white py-4 text-[12px] font-medium text-[#66758b]",children:[(0,a.jsx)(o.og,{className:"size-4"}),l]}):(0,a.jsx)("div",{className:"max-h-64 overflow-y-auto rounded-lg border border-[#e2e8f0] bg-white",children:(0,a.jsx)("canvas",{ref:s,"aria-label":r,className:"block w-full"})})}function D(e){let{file:t,invalid:n,onRemove:r}=e,{t:i}=(0,l.Z)("common"),[o,s]=(0,S.useState)(""),c=i("info_hub.submit_ticket.file_preview"),u=(0,S.useMemo)(()=>(function(e){let t=e.name.toLowerCase();return t.endsWith(".pdf")||e.type.includes("pdf")?"pdf":/\.(jpg|jpeg|png)$/.test(t)||e.type.startsWith("image/")?"image":"other"})(t),[t]);return(0,S.useEffect)(()=>
1{if("image"!==u){s("");return}let e=URL.createObjectURL(t);return s(e),()=>URL.revokeObjectURL(e)},[t,u]),(0,a.jsxs)("div",{className:"overflow-hidden rounded-2xl bg-[#f8fbff] p-2.5 ".concat(n?"border-2 border-solid border-[#D94B48]":"border border-[#d6e0ec]"),children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-[12px] text-[#0b4f93]",children:[(0,a.jsx)("strong",{className:"shrink-0 font-semibold",children:c}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center justify-end gap-2",children:[(0,a.jsx)("span",{className:"min-w-0 truncate font-normal text-[#66758b]",children:t.name}),(0,a.jsx)("span",{className:"shrink-0 font-normal text-[#66758b]",children:function(e){if(e<1024)return"".concat(e," B");if(e<1048576){let t=e/1024;return t>=100?"".concat(Math.round(t)," KB"):"".concat(t.toFixed(1)," KB")}let t=e/1048576;return t>=10?"".concat(Math.round(t)," MB"):"".concat(t.toFixed(1)," MB")}(t.size)}),r?(0,a.jsx)("button",{type:"button",onClick:r,className:"inline-flex min-h-[34px] min-w-[34px] shrink-0 items-center justify-center rounded-lg border border-[#bfc8d8] bg-white text-[#D94B48] transition hover:border-[#D94B48] hover:bg-[#fff5f5] focus:outline-none focus-visible:ring-2 focus-visible:ring-primaryColor/40","aria-label":i("info_hub.submit_ticket.file_delete"),children:(0,a.jsx)(d.XH,{width:"16",height:"18"})}):null]})]}),"image"===u&&o?(0,a.jsx)("img",{src:o,alt:c,className:"block max-h-56 w-full rounded-lg border border-[#e2e8f0] bg-white object-contain"}):null,"pdf"===u?(0,a.jsx)(M,{file:t,label:c,fallbackLabel:i("info_hub.submit_ticket.file_attached_other")}):null,"other"===u?(0,a.jsx)("div",{className:"text-[12px] text-[#66758b]",children:i("info_hub.submit_ticket.file_attached_other")}):null]})}function q(e){let{children:t}=e;return(0,a.jsx)("p",{className:"mb-3 text-[11px] font-bold uppercase tracking-[0.04em] text-primaryColor",children:t})}let R=new Set(["Popular Questions","คำถามยอดนิยม"]);function z(e){let{topicId:t}=e,{t:n}=(0,l.Z)("common");if(!j(t))return null;let r=[];for(let e=0;e<20;e+=1){let i=n("info_hub.submit_ticket.topics.".concat(t,".tips.").concat(e));if(!i||i.includes("info_hub.submit_ticket"))break;r.push(i)}return r.length?(0,a.jsxs)("ul",{className:"mt-3 list-none rounded-[11px] bg-[#E7F1FA] px-[13px] py-[11px] text-[12.5px] leading-relaxed text-[#2F3B55]",children:[(0,a.jsx)("li",{className:"mb-1.5 list-none font-bold text-primaryColor",children:n("info_hub.submit_ticket.speed_title")}),r.map(e=>(0,a.jsx)("li",{className:"ml-[17px] list-disc",children:e.split(/(“[^”]*”|Popular Questions|คำถามยอดนิยม)/g).map((e,t)=>e.startsWith("“")&&e.endsWith("”")||R.has(e)?(0,a.jsx)("strong",{className:"font-semibold",children:e},t):e)},e))]}):null}function H(e){let{topicId:t,onTopicChange:n}=e,{t:r}=(0,l.Z)("common");return(0,a.jsxs)("div",{className:B,children:[(0,a.jsxs)("label",{htmlFor:"topic-select",className:"mb-2 block text-[13px] font-medium text-[#26313f]",children:[r("info_hub.submit_ticket.topic_question")," ",(0,a.jsx)(V,{})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("select",{id:"topic-select",value:t,onChange:e=>n(e.target.value),className:"".concat(I," appearance-none pr-10"),children:[(0,a.jsx)("option",{value:"",children:r("info_hub.submit_ticket.choose_topic")}),["physical","payment","endorsement","voucher","cancellation","refund","pdpa","service","app","other"].map(e=>(0,a.jsx)("option",{value:e,children:r("info_hub.submit_ticket.topics.".concat(e,".label"))},e))]}),(0,a.jsx)(o.v4,{className:"pointer-events-none absolute right-3 top-1/2 size-5 -translate-y-1/2 text-[#9AA6B8]"})]}),t?(0,a.jsx)(z,{topicId:t}):null]})}function Z(e){let{fieldId:t,required:n}=e,{t:r}=(0,l.Z)("common"),i="info_hub.submit_ticket.hints.".concat(t),o=r(i);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("label",{className:"mb-2 block text-[13px] font-medium text-[#26313f]",children:[r("info_hub.submit_ticket.fields.".concat(t)),n&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsx)(V,{})]})]}),o&&o!==i?(0,a.jsx)("p",{className:"-mt-1 mb-2 text-[11.5px] leading-relaxed text-[#6B7688]",children:o}):null]})}function F(e){let{t}=(0,l.Z)("common"),n="info_hub.submit_ticket.placeholders.".concat(e),r=t(n);return r&&r!==n?r:t("info_hub.submit_ticket.fields.".concat(e))}function W(e){let{fieldId:t,required:n,type:r,value:i,error:o,onChange:l,fieldRef:s}=e,c=F(t),u="date"===r,d="tel"===r,h="number"===r,p="email"===r,m=e=>d?l(e.replace(/\D/g,"")):h?l(e.replace(/[^\d.]/g,"")):p?l(e.replace(/[^\x20-\x7E]/g,"")):l(e),f=d?w.THAI_LOCAL_PHONE_MAX_LENGTH:"orderNumber"===t?10:150;return(0,a.jsxs)("div",{className:"mb-3 last:mb-0",children:[(0,a.jsx)(Z,{fieldId:t,required:n}),(0,a.jsxs)("div",{className:u?"relative":"",children:[(0,a.jsx)("input",{ref:s,t
1ype:h?"text":r,value:i,inputMode:d?"tel":h?"numeric":void 0,maxLength:f,placeholder:u?void 0:c,onChange:e=>m(e.target.value),className:"".concat(I," ").concat(u?"appearance-none":""," ").concat(u&&!i?"bg-white text-transparent":""," ").concat(o?T:"")}),u&&!i?(0,a.jsx)("span",{className:"pointer-events-none absolute left-3 top-1/2 z-10 -translate-y-1/2 text-[13.5px] text-[#9AA6B8]",children:c}):null]}),o&&(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[#D94B48]",children:o})]})}function K(e){let{fieldId:t,required:n,value:r,error:i,onChange:o}=e,l=F(t);return(0,a.jsxs)("div",{className:"mb-3 last:mb-0",children:[(0,a.jsx)(Z,{fieldId:t,required:n}),(0,a.jsx)("textarea",{value:r,onChange:e=>o(e.target.value),placeholder:l,maxLength:500,className:"min-h-[80px] w-full resize-y rounded-xl border border-[#D8E0EC] px-3 py-2.5 text-[13.5px] leading-relaxed text-[#1A2330] outline-none placeholder:text-[#9AA6B8] focus:border-primaryColor focus:ring-[3px] focus:ring-primaryColor/10 ".concat(i?T:"")}),i&&(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[#D94B48]",children:i})]})}function O(e){let{fieldId:t,required:n,value:r,error:i,onChange:s}=e,{t:c}=(0,l.Z)("common"),u=m[t].options,d=u?p[u]:[];return(0,a.jsxs)("div",{className:"mb-3 last:mb-0",children:[(0,a.jsx)(Z,{fieldId:t,required:n}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("select",{value:r,onChange:e=>s(e.target.value),className:"".concat(I," appearance-none pr-10 ").concat(r?"":"text-[#9AA6B8]"," ").concat(i?T:""),children:[(0,a.jsx)("option",{value:"",children:c("info_hub.submit_ticket.choose_option")}),d.map(e=>(0,a.jsx)("option",{value:e,className:"text-[#1A2330]",children:c("info_hub.submit_ticket.options.".concat(t,".").concat(e))},e))]}),(0,a.jsx)(o.v4,{className:"pointer-events-none absolute right-3 top-1/2 size-5 -translate-y-1/2 text-[#9AA6B8]"})]}),i&&(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[#D94B48]",children:i})]})}function U(e){let{fieldId:t,required:n,value:r,error:i,locale:s,onChange:c}=e,{t:u}=(0,l.Z)("common");return(0,a.jsxs)("div",{className:"mb-3 last:mb-0",children:[(0,a.jsx)(Z,{fieldId:t,required:n}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("select",{value:r,onChange:e=>c(e.target.value),className:"".concat(I," appearance-none pr-10 ").concat(r?"":"text-[#9AA6B8]"," ").concat(i?T:""),children:[(0,a.jsx)("option",{value:"",children:u("info_hub.submit_ticket.choose_province")}),A.map(e=>(0,a.jsx)("option",{value:e.value,className:"text-[#1A2330]",children:"en"===s?e.en:e.th},e.value))]}),(0,a.jsx)(o.v4,{className:"pointer-events-none absolute right-3 top-1/2 size-5 -translate-y-1/2 text-[#9AA6B8]"})]}),i&&(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[#D94B48]",children:i})]})}function X(e){let{fieldId:t,required:n,value:r,error:i,insuranceType:s,locale:c,onChange:u}=e,{t:d}=(0,l.Z)("common"),[h,p]=(0,S.useState)([]);(0,S.useEffect)(()=>{let e=!0;return P().then(t=>{e&&p(t)}),()=>{e=!1}},[]);let m=(0,S.useMemo)(()=>(function(e,t){let n="motor"===t?E.motor:E.nonMotor;return e.filter(e=>{var t;return null===(t=e.products)||void 0===t?void 0:t.includes(n)})})(h,s).map(e=>({key:e.name,label:"en"===c?e.displayName||e.shortnameEn:e.displayNameTh||e.shortnameTh})).sort((e,t)=>e.label.localeCompare(t.label)),[h,s,c]);return(0,a.jsxs)("div",{className:"mb-3 last:mb-0",children:[(0,a.jsx)(Z,{fieldId:t,required:n}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("select",{value:r,onChange:e=>u(e.target.value),className:"".concat(I," appearance-none pr-10 ").concat(r?"":"text-[#9AA6B8]"," ").concat(i?T:""),children:[(0,a.jsx)("option",{value:"",children:d("info_hub.submit_ticket.choose_option")}),m.map(e=>{let{key:t,label:n}=e;return(0,a.jsx)("option",{value:n,className:"text-[#1A2330]",children:n},t)})]}),(0,a.jsx)(o.v4,{className:"pointer-events-none absolute right-3 top-1/2 size-5 -translate-y-1/2 text-[#9AA6B8]"})]}),i&&(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[#D94B48]",children:i})]})}function G(e){let{fieldId:t,required:n,file:r,error:i,onChange:s}=e,{t:c}=(0,l.Z)("common"),u=(0,S.useRef)(null),d=(0,S.useRef)(null);return(0,a.jsxs)("div",{className:"mb-3 last:mb-0",children:[(0,a.jsx)(Z,{fieldId:t,required:n}),(0,a.jsxs)("label",{className:"flex h-[46px] cursor-pointer items-center justify-center gap-2 rounded-xl border border-[#D8E0EC] px-3 text-sm font-semibold text-primaryColor ".concat(i?T:""),children:[(0,a.jsx)(o.og,{className:"size-[17px]"}),(0,a.jsx)("span",{children:(null==r?void 0:r.name)||c("info_hub.submit_ticket.add_file")}),(0,a.jsx)("input",{ref:u,type:"file",hidden:!0,accept:".pdf,.jpg,.jpeg,.png",onCh
1ange:e=>{var t,n;let r=null!==(n=null===(t=e.target.files)||void 0===t?void 0:t[0])&&void 0!==n?n:null;d.current=r,s(r),r&&ee(r).then(e=>{d.current===r&&s(e)})}})]}),r?(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(D,{file:r,invalid:!!i,onRemove:()=>{d.current=null,s(null),u.current&&(u.current.value="")}},"".concat(r.name,"-").concat(r.size,"-").concat(r.lastModified))}):null,i&&(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[#D94B48]",children:i})]})}function Q(e){let{topic:t}=e,{t:n}=(0,l.Z)("common"),r=h[t.icon];return(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-3 rounded-[14px] bg-gradient-to-r from-[#223C77] to-[#1468AE] p-3.5 text-white",children:[(0,a.jsx)("span",{className:"grid size-10 flex-none place-items-center rounded-full bg-[#3B94D4] text-white",children:(0,a.jsx)(r,{className:"size-5"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("strong",{className:"block text-sm font-bold leading-snug",children:n("info_hub.submit_ticket.topics.".concat(t.id,".label"))}),(0,a.jsx)("span",{className:"mt-0.5 block text-[11px] leading-snug text-white/90",children:n("info_hub.submit_ticket.summary_hint")})]})]})}function Y(e){let{cancelHref:t}=e,{t:n}=(0,l.Z)("common");return(0,a.jsx)("div",{className:"mb-3",children:(0,a.jsx)(c(),{href:t,className:"flex h-[50px] w-full items-center justify-center rounded-2xl bg-primaryColor text-base font-bold text-white shadow-lg",children:n("info_hub.submit_ticket.cancel_open")})})}function $(e){let{topic:t,values:n,fileValues:r,errors:i,description:o,locale:s,onDescriptionChange:c,onValueChange:u,onFileChange:d,firstErrorRef:h}=e,{t:p}=(0,l.Z)("common"),x=f.reduce((e,t)=>(e[t]=[],e),{});C(t,n).forEach(e=>{x[m[e.id].group].push(e)});let v={values:n,fileValues:r,errors:i,locale:s,onValueChange:u,onFileChange:d,errorRefCursor:{assigned:!1},firstErrorRef:h};return(0,a.jsx)(a.Fragment,{children:f.map(e=>{let t=x[e],n="additional"===e;return t.length||n?(0,a.jsxs)("div",{className:B,children:[(0,a.jsx)(q,{children:p("info_hub.submit_ticket.groups.".concat(e))}),function(e,t){let{values:n,fileValues:r,errors:i,locale:o,onValueChange:l,onFileChange:s,errorRefCursor:c,firstErrorRef:u}=t;return e.map(e=>{var t,d,h,p,f,x;let{id:v,required:b}=e,g=m[v],y=i[v],_="file"!==g.type&&"textarea"!==g.type&&"select"!==g.type&&"insurer"!==g.type,j=!c.assigned&&y&&_?(c.assigned=!0,u):void 0,C=e=>l(v,e);if("file"===g.type)return(0,a.jsx)(G,{fieldId:v,required:b,file:r[v],error:y,onChange:e=>s(v,e)},v);if("select"===g.type)return(0,a.jsx)(O,{fieldId:v,required:b,value:null!==(t=n[v])&&void 0!==t?t:"",error:y,onChange:C},v);if("province"===g.type)return(0,a.jsx)(U,{fieldId:v,required:b,value:null!==(d=n[v])&&void 0!==d?d:"",error:y,locale:o,onChange:C},v);if("insurer"===g.type)return(0,a.jsx)(X,{fieldId:v,required:b,value:null!==(h=n[v])&&void 0!==h?h:"",error:y,insuranceType:null!==(p=n.insuranceType)&&void 0!==p?p:"",locale:o,onChange:C},v);if("textarea"===g.type)return(0,a.jsx)(K,{fieldId:v,required:b,value:null!==(f=n[v])&&void 0!==f?f:"",error:y,onChange:C},v);let N="tel"===g.type?"tel":"email"===g.type?"email":"date"===g.type?"date":"number"===g.type?"number":"text";return(0,a.jsx)(W,{fieldId:v,required:b,type:N,value:null!==(x=n[v])&&void 0!==x?x:"",error:y,onChange:C,fieldRef:j},v)})}(t,v),n?(0,a.jsxs)("div",{className:t.length?"mt-3":"",children:[(0,a.jsx)("label",{className:"mb-2 block text-[13px] font-medium text-[#26313f]",children:p("info_hub.submit_ticket.describe")}),(0,a.jsx)("textarea",{value:o,onChange:e=>c(e.target.value),placeholder:p("info_hub.submit_ticket.describe_ph"),maxLength:500,className:"min-h-[88px] w-full resize-y rounded-xl border border-[#D8E0EC] px-3 py-2.5 text-sm leading-relaxed text-[#1A2330] outline-none placeholder:text-[#9AA6B8] focus:border-primaryColor focus:ring-[3px] focus:ring-primaryColor/10"})]}):null]},e):null})})}function J(e){return"".concat(e.name,"-").concat(e.size)}function ee(e){return e.arrayBuffer().then(t=>new File([t],e.name,{type:e.type,lastModified:e.lastModified}))}function et(e){let{files:t,error:n,onChange:r}=e,{t:i}=(0,l.Z)("common"),s=async e=>{var n;let a=Array.from(null!==(n=e.target.files)&&void 0!==n?n:[]);e.target.value="";let o=t.reduce((e,t)=>
1e+t.size,0),l=new Set;a.forEach(e=>{!ei(e,i)&&(o+=e.size)<=10485760&&l.add(e)});let s=await Promise.all(a.map(e=>l.has(e)?ee(e):e)),c=new Set(t.map(J)),u=[...t];s.forEach(e=>{let t=J(e);c.has(t)||(c.add(t),u.push(e))}),r(u)},c=e=>{r(t.filter(t=>J(t)!==e))},u=t.length>0?t.map(e=>e.name).join(", "):i("info_hub.submit_ticket.add_file");return(0,a.jsxs)("div",{className:B,children:[(0,a.jsx)("label",{className:"mb-2 block text-[13px] font-medium text-[#26313f]",children:i("info_hub.submit_ticket.upload_label")}),(0,a.jsxs)("label",{className:"flex h-[46px] cursor-pointer items-center justify-center gap-2 rounded-xl border border-[#D8E0EC] px-3 text-sm font-semibold text-primaryColor ".concat(n&&t.length>0?T:""),children:[(0,a.jsx)(o.og,{className:"size-[17px]"}),(0,a.jsx)("span",{className:"truncate",children:u}),(0,a.jsx)("input",{type:"file",hidden:!0,multiple:!0,accept:".pdf,.jpg,.jpeg,.png",onChange:s})]}),t.length>0?(0,a.jsx)("div",{className:"mt-2 space-y-2",children:t.map(e=>(0,a.jsx)(D,{file:e,invalid:!!n,onRemove:()=>c(J(e))},J(e)))}):null,(0,a.jsx)("p",{className:"mt-2 text-[11px] text-[#A5AEC0]",children:i("info_hub.submit_ticket.file_help")}),n&&t.length>0?(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[#D94B48]",children:n}):null]})}function en(e){let{topicId:t}=e,{t:n}=(0,l.Z)("common"),r=[];for(let e=0;e<20;e+=1){let i=n("info_hub.submit_ticket.topics.".concat(t,".instructions.").concat(e));if(!i||i.includes("info_hub.submit_ticket"))break;r.push(i)}return r.length?(0,a.jsxs)("div",{className:"mb-3 rounded-[14px] border border-[#BFE6D5] bg-[#EAF8F2] px-4 py-3",children:[(0,a.jsx)("p",{className:"mb-1.5 text-[13px] font-bold text-[#0E7A4F]",children:n("info_hub.submit_ticket.next_title")}),(0,a.jsx)("ul",{className:"list-disc pl-4 text-xs leading-relaxed text-[#1f5f45]",children:r.map(e=>(0,a.jsx)("li",{children:e},e))})]}):null}function er(e){let{onClick:t,isSubmitting:n=!1,disabled:r=!1}=e,{t:i}=(0,l.Z)("common");return(0,a.jsx)("button",{type:"button",onClick:t,disabled:r,className:"h-[50px] w-full rounded-[14px] bg-primaryColor text-[15px] font-bold text-white shadow-[0_10px_18px_rgba(0,80,152,0.18)] disabled:cursor-not-allowed disabled:opacity-60",children:i(n?"info_hub.submit_ticket.sending":"info_hub.submit_ticket.send")})}function ei(e,t){var n;if(!e)return;let r=(null===(n=e.name.split(".").pop())||void 0===n?void 0:n.toLowerCase())||"";return k.includes(r)?e.size>10485760?t("info_hub.submit_ticket.error_file_size"):void 0:t("info_hub.submit_ticket.error_file_type")}let ea={contactName:"name",email:"email",policyholderName:"insured_person_name",orderNumber:"policy_number",insurerName:"insurer_name",licensePlate:"license_plate",registeredProvince:"registered_vehicle_province",shippingAddress:"shipping_address",currentInfo:"current_information",newInfo:"new_information",replacementProvince:"replacement_vehicle_using_province",pickupDetails:"replacement_pickup_datetime_location",returnDetails:"replacement_return_datetime_location",rentalDays:"replacement_total_days",appVersion:"mobile_app_version",referrerPlate:"referrer_license_plate",referredPlate:"referred_license_plate",voucherValueCommunicated:"communicated_voucher_value",voucherValueSales:"sales_communicated_voucher_value",voucherValueActual:"actual_voucher_value",redemptionDate:"voucher_redemption_date",bigCBranch:"bigc_branch",voucherCode:"voucher_code_and_value"},eo={insuranceType:"product_type",policyholderType:"policy_holder_type",osType:"operating_system",voucherIssue:"voucher_issue_type",voucherSource:"voucher_source"},el={addRemoveDriver:"named_drivers_change",changeAccessory:"vehicle_accessory_change",changePolicyholderName:"changed_policy_holder_name"},es=(e,t,n)=>e("info_hub.submit_ticket.options.".concat(t,".").concat(n));function ec(e){let t=e.trim();return t?t.startsWith("+66")?"0".concat(t.slice(3)):t.startsWith("66")&&!t.startsWith("0")?"0".concat(t.slice(2)):t:t}async function eu(){try{var e,t,n,r;let{data:i}=await L.Z.get("/api/gff/support/prefill-data"),a=null!==(e=i.account)&&void 0!==e?e:{};return{name:"".concat(a.givenName," ").concat(a.familyName).trim(),email:(null!==(t=a.email)&&void 0!==t?t:"").trim(),phone:(null!==(n=a.phone)&&void 0!==n?n:"").trim(),appVersion:(null!==(r=i.mobileAp
1pVersion)&&void 0!==r?r:"").trim()}}catch(e){return}}async function ed(e,t){let{data:n}=await L.Z.post("/api/gff/support-tickets",e,{onUploadProgress:e=>{var n;let{loaded:r,total:i}=e;null==t||null===(n=t.onUploadProgress)||void 0===n||n.call(t,{loaded:r,total:i,percent:null!=i&&i>0?Math.round(100*r/i):0})}});return n}let eh=new Set(["licensePlate","referrerPlate","referredPlate"]);var ep=n(48054);function em(e){let{locale:t,onSuccess:n}=e,{t:r}=(0,l.Z)("common"),i=(0,ep.useRouter)(),o=(0,S.useRef)(null),[s,c]=(0,S.useState)(""),[u,d]=(0,S.useState)({}),[h,p]=(0,S.useState)({}),[f,x]=(0,S.useState)(""),[v,b]=(0,S.useState)([]),[g,y]=(0,S.useState)({}),[k,A]=(0,S.useState)(),[L,E]=(0,S.useState)(!1),[P,B]=(0,S.useState)();(0,S.useEffect)(()=>{if(!i.isReady)return;let e=function(e){var t;let n=Array.isArray(e)?e[0]:e;return n?null!==(t=_[n])&&void 0!==t?t:n:""}(i.query.topic);e&&c(e);let t=i.query.email,n=i.query.phone;d(e=>({...e,..."string"==typeof t&&t?{email:t}:{},..."string"==typeof n&&n?{phone:ec(n)}:{}}))},[i.isReady,i.query.topic,i.query.email,i.query.phone]),(0,S.useEffect)(()=>{let e=!0;return eu().then(t=>{e&&t&&d(e=>({...e,...t.name&&!e.contactName?{contactName:t.name}:{},...t.email&&!e.email?{email:t.email}:{},...t.phone&&!e.phone?{phone:ec(t.phone)}:{},...t.appVersion&&!e.appVersion?{appVersion:t.appVersion}:{}}))}),()=>{e=!1}},[]),(0,S.useEffect)(()=>{"service"===s&&d(e=>e.insuranceType?e:{...e,insuranceType:"motor"})},[s]);let I=s?j(s):void 0,T=r("info_hub.submit_ticket.error_total_file_size"),V=(e,t)=>{if(!I)return{fieldErrors:{}};let n=C(I,u),i=function(e,t){if(e.reduce((e,t)=>e+t.size,0)>10485760)return t("info_hub.submit_ticket.error_total_file_size")}(function(e,t,n){let r=[...n];return e.forEach(e=>{let{id:n}=e;if("file"!==m[n].type)return;let i=t[n];i&&r.push(i)}),r}(n,e,t),r),a={};return i&&n.forEach(t=>{let{id:n}=t;"file"===m[n].type&&e[n]&&(a[n]=i)}),{totalErr:i,fieldErrors:a}},M=e=>{let t={};return Object.keys(e).forEach(n=>{e[n]!==T&&(t[n]=e[n])}),t},D=async()=>{if(!I)return;let e={};for(let t of(C(I,u).forEach(t=>{var n;let{id:i,required:a}=t;if("file"===m[i].type){let t=h[i];if(a&&!t){e[i]=r("info_hub.submit_ticket.error_required");return}let n=ei(null!=t?t:null,r);n&&(e[i]=n);return}let o=(null!==(n=u[i])&&void 0!==n?n:"").trim();if(a&&!o){e[i]=r("info_hub.submit_ticket.error_required");return}let l=function(e,t){if(!t)return;if(eh.has(e))return t.length<w.MIN_PLATE_LENGTH?"error_plate":void 0;let{type:n}=m[e];return"email"===n?w.EMAIL_PATTERN.test(t)?void 0:"error_email":"tel"===n?w.THAI_LOCAL_PHONE_PATTERN.test(t)?void 0:"error_phone":"number"===n?w.NUMERIC_PATTERN.test(t)?void 0:"error_number":void 0}(i,o);l&&(e[i]=r("info_hub.submit_ticket.".concat(l)))}),v)){let n=ei(t,r);if(n){A(n),y(e);return}}let{totalErr:t,fieldErrors:i}=V(h,v);if(t){A(t),y({...e,...i});return}if(y(e),A(void 0),Object.keys(e).length>0){requestAnimationFrame(()=>{var e;null===(e=o.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center"})});return}E(!0),B(void 0);try{let e=function(e){var t,n,r;let{t:i,topic:a,values:o,fileValues:l,additionalFiles:s,description:c}=e,u=N[a.id];if(!u)throw Error("Unsupported support ticket topic: ".concat(a.id));let d=new FormData;d.append("request_topic",u);let h=C(a,o),p=(null!==(t=o.phone)&&void 0!==t?t:"").trim();p&&(d.append("phone",function(e){let t=e.trim();return!t||t.startsWith("+")?t:t.startsWith("0")?"+66".concat(t.slice(1)):t}(p)),d.append("phone_number",p));let f=(null!==(n=o.whoSubmitting)&&void 0!==n?n:"").trim();if(f){let e="other"===f?(null!==(r=o.relationshipOther)&&void 0!==r?r:"").trim():es(i,"whoSubmitting",f);e&&d.append("relationship",e)}d.append("underage_policy","false"),h.forEach(e=>{var t;let{id:n}=e;if("file"===m[n].type)return;let r=(null!==(t=o[n])&&void 0!==t?t:"").trim();if(!r)return;let a=ea[n];if(a){d.append(a,r);return}let l=eo[n];if(l){d.append(l,es(i,n,r));return}let s=el[n];s&&d.append(s,String("yes"===r))});let x=c.trim();x&&d.append("additional_notes",x);let v=[...s];return h.forEach(e=>{let{id:t}=e;if("file"!==m[t].type)return;let n=l[t];n&&v.push(n)}
1),v.forEach(e=>{d.append("attachments",e)}),d}({t:r,topic:I,values:u,fileValues:h,additionalFiles:v,description:f});if(!(await ed(e)).ticketId){B(r("info_hub.submit_ticket.error_submit_failed"));return}n()}catch(e){B(r("info_hub.submit_ticket.error_submit_failed"))}finally{E(!1)}};return(0,a.jsxs)("div",{className:"px-4 pb-8 pt-1",children:[(0,a.jsx)(H,{topicId:s,onTopicChange:e=>{c(e),y({}),A(void 0)}}),(null==I?void 0:I.cancel)&&(0,a.jsx)(Y,{cancelHref:"/cancellation/submit"}),I&&!I.cancel&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Q,{topic:I}),(0,a.jsx)($,{topic:I,values:u,fileValues:h,errors:g,description:f,locale:t,onDescriptionChange:x,onValueChange:(e,t)=>{d(n=>{let r={...n,[e]:t};return"insuranceType"===e&&n.insurerName&&(r.insurerName=""),r}),y(t=>{let n={...t};return delete n[e],n})},onFileChange:(e,t)=>{let n={...h,[e]:t};p(n),A(void 0);let i=t?ei(t,r):void 0,{totalErr:a,fieldErrors:o}=V(n,v);y(t=>{let n=M(t);return delete n[e],Object.assign(n,o),i&&(n[e]=i),n}),a&&A(a)},firstErrorRef:o}),(0,a.jsx)(et,{files:v,error:k,onChange:e=>{let t;for(let n of(b(e),e)){let e=ei(n,r);if(e){t=e;break}}let{totalErr:n,fieldErrors:i}=V(h,e);y(e=>({...M(e),...i})),A(null!=t?t:n)}}),(0,a.jsx)(en,{topicId:s}),P&&(0,a.jsx)("p",{className:"mb-3 text-center text-sm text-[#C62828]",children:P}),(0,a.jsx)(er,{onClick:D,isSubmitting:L,disabled:L})]})]})}function ef(e){let{backHref:t}=e,{t:n}=(0,l.Z)("common");return(0,a.jsx)("div",{className:"sticky top-0 z-30 bg-primaryColor px-4 pb-4 pt-14",children:(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(c(),{href:t,"aria-label":"Back",className:"grid size-[30px] flex-none place-items-center",children:(0,a.jsx)(o.XC,{className:"size-[24px] rotate-180 text-white"})}),(0,a.jsx)("h1",{className:"text-[24px] font-bold text-white",children:n("info_hub.submit_ticket.title")})]})})}var ex=n(9389),ev=n(11324),eb=!0,eg=function(e){let{locale:t}=e,[n,r]=(0,S.useState)(!1);return(0,a.jsxs)("div",{className:"flex min-h-screen flex-col bg-[#EEF2F8]",style:{fontFamily:ev.fontFamilyMap[t]},children:[(0,a.jsx)(ex.g,{}),(0,a.jsx)(ef,{backHref:"/web-view/faq"}),n?(0,a.jsx)(u,{}):(0,a.jsx)(em,{locale:t,onSuccess:()=>r(!0)})]})}},88851:function(e,t,n){"use strict";e.exports=n.p+"static/media/pdf.worker.min.227170ae.js"}},function(e){e.O(0,[6521,625,3481,2888,9774,179],function(){return e(e.s=35907)}),_N_E=e.O()}]);
2//# sourceMappingURL=submit-ticket-fd5034f3639f75cc.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.