2 lines
108 KiB
JavaScript
2 lines
108 KiB
JavaScript
function e({routing:e={},sender:o={},creationDateTime:a,bodId:t}={}){const d={Sender:{Component:o.component??"Rome",Task:o.task??"CU",ReferenceId:o.referenceId??"Query",CreatorNameCode:o.creator??"RCI",SenderNameCode:o.senderName??"RCI"},CreationDateTime:a??(new Date).toISOString().replace(/\.\d{3}Z$/,"Z"),BODId:t??k(),Destination:{DestinationNameCode:"RR",DealerNumber:e.dealerNumber||"",StoreNumber:e.storeNumber||"",AreaNumber:e.areaNumber||""}},r={bod:"{{#BODId}}<BODId>{{BODId}}</BODId>{{/BODId}}",creation:"<CreationDateTime>{{CreationDateTime}}</CreationDateTime>",sender:"\n <Sender>\n <Component>{{Sender.Component}}</Component>\n <Task>{{Sender.Task}}</Task>\n {{#Sender.ReferenceId}}<ReferenceId>{{Sender.ReferenceId}}</ReferenceId>{{/Sender.ReferenceId}}\n {{#Sender.CreatorNameCode}}<CreatorNameCode>{{Sender.CreatorNameCode}}</CreatorNameCode>{{/Sender.CreatorNameCode}}\n {{#Sender.SenderNameCode}}<SenderNameCode>{{Sender.SenderNameCode}}</SenderNameCode>{{/Sender.SenderNameCode}}\n </Sender>".trim(),dest:"\n <Destination>\n <DestinationNameCode>{{Destination.DestinationNameCode}}</DestinationNameCode>\n {{#Destination.DealerNumber}}<DealerNumber>{{Destination.DealerNumber}}</DealerNumber>{{/Destination.DealerNumber}}\n {{#Destination.StoreNumber}}<StoreNumber>{{Destination.StoreNumber}}</StoreNumber>{{/Destination.StoreNumber}}\n {{#Destination.AreaNumber}}<AreaNumber>{{Destination.AreaNumber}}</AreaNumber>{{/Destination.AreaNumber}}\n </Destination>".trim()},i=`<ApplicationArea>\n${["bod","creation","sender","dest"].map(e=>r[e]).join("\n")}\n</ApplicationArea>`;return L.render(i,d).trim()}function o(e,o=2){const a=" ".repeat(o);return String(e).split("\n").map(e=>e.length?a+e:e).join("\n")}function a(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function t(e,o){if(null==e)return null;if(Array.isArray(e)){for(const a of e){const e=t(a,o);if(null!=e)return e}return null}if("object"!=typeof e)return null;for(const[a,d]of Object.entries(e)){if(o(a,d))return d;const e=t(d,o);if(null!=e)return e}return null}function d(e,o,a=[]){if(null==e)return a;if(Array.isArray(e)){for(const t of e)d(t,o,a);return a}if("object"!=typeof e)return a;for(const[t,r]of Object.entries(e))o(t,r)&&a.push(r),d(r,o,a);return a}function r(e){return null==e?[]:Array.isArray(e)?e:[e]}function i(e,o){if(e&&"object"==typeof e)return function(e){if(null!=e)return"string"==typeof e||"number"==typeof e||"boolean"==typeof e?String(e):"object"==typeof e&&"#text"in e?String(e["#text"]):void 0}(e[o])}function s(e,o){const a=i(e,o);if(J(a))return a;const t=function(e,o){if(e&&"object"==typeof e)return e.$&&J(e.$[o])?e.$[o]:J(e[`@_${o}`])?e[`@_${o}`]:J(e[`@${o}`])?e[`@${o}`]:e._attributes&&J(e._attributes[o])?e._attributes[o]:e.attributes&&J(e.attributes[o])?e.attributes[o]:void 0}(e,o);return J(t)?t:void 0}function l(e,o){if(e&&"object"==typeof e)return null!=e[`@_${o}`]?e[`@_${o}`]:void 0}function n(e){if(null!=e){if("string"==typeof e)return e;if("number"==typeof e)return String(e);if("object"==typeof e){if(null!=e._)return String(e._);if(null!=e["#text"])return String(e["#text"]);if(null!=e.text)return String(e.text)}}}function c(e){return d(e,e=>/(GenTransStatus|TransStatus)$/i.test(e)).flatMap(r)[0]}function p(e){if(e)return{status:(l(e,"Status")||e.Status||n(e)||"").toString().trim()||void 0,statusCode:(l(e,"StatusCode")||e.StatusCode||"").toString().trim()||void 0,message:e.Message&&n(e.Message)||e.GenTransStatus&&n(e.GenTransStatus)||e.TransStatus&&n(e.TransStatus)||n(e)||void 0}}function y(e){if(e)return{status:(l(e,"Status")||e.Status||n(e)||"").toString().trim()||void 0,date:(l(e,"Date")||e.Date||"").toString().trim()||void 0,time:(l(e,"Time")||e.Time||"").toString().trim()||void 0,outsdRoNo:(l(e,"OutsdRoNo")||e.OutsdRoNo||"").toString().trim()||void 0,dmsRoNo:(l(e,"DMSRoNo")||e.DMSRoNo||"").toString().trim()||void 0,errorMessage:(l(e,"ErrorMessage")||e.ErrorMessage||"").toString().trim()||void 0}}function u(e){const o=e?.rey_RomeCustServVehCombRes??e?.rey_RomeCustServVehCombReq??e?.rey_RomeCustServVehComb??e??{};return r(o?.CustServVehComb??o?.CustServVehCombRes??o?.CustServVehCombReq??o).map(e=>{const o=e?.NameContactId??void 0,a=o?.NameId??void 0,t=a?.IndName?j(a.IndName):void 0,d=a?.BusName?j(a.BusName):void 0,i=o&&{NameId:a&&{...j(a)||{},...t?{IndName:t}:{},...d?{BusName:d}:{}},Address:r(o?.Address).map(e=>j(e)||{}),ContactOptions:r(o?.ContactOptions).map(e=>j(e)||{}),Phone:r(o?.Phone).map(e=>j(e)||{}),Email:r(o?.Email).map(e=>j(e)||{})},s=r(e?.ServVehicle).map(e=>{const o=e?.Vehicle,a=o?.VehicleDetail,t=o&&{...j(o)||{},...a?{VehicleDetail:j(a)||{}}:{}},d=e?.VehicleServInfo,i=d?.VehExtWarranty,s=d?.Advisor,l=s?.ContactInfo;let n;s&&(n={...j(s)||{},...l?{ContactInfo:j(l)||{}}:{}});const c=d&&{...j(d)||{},...i?{VehExtWarranty:j(i)||{}}:{},...n?{Advisor:n}:{},...d?.VehServComments?{VehServComments:r(d.VehServComments).map(e=>Q(e)).filter(e=>null!=e&&""!==String(e).trim())}:{}};return{...t?{Vehicle:t}:{},...c?{VehicleServInfo:c}:{}}}),l=r(e?.Message).map(e=>{const o=Q(e);return{...j(e)||{},...null!=o&&""!==String(o).trim()?{Text:o}:{}}}).filter(e=>Object.keys(e).length>0),n={};return i&&(n.NameContactId=i),s.length&&(n.ServVehicle=s),l.length&&(n.Message=l),n})}function m(e,o){if(null!=e)return String("string"==typeof e||"number"==typeof e?e:e[o]||"")}function T(e){return String(e??"").trim()||void 0}function C(e,...o){if(e)for(const a of o){if(e.$&&null!=e.$[a])return e.$[a];if(null!=e[`@_${a}`])return e[`@_${a}`];if(null!=e[a]&&"object"!=typeof e[a])return e[a]}}function R(e){const o=function(e){const o=t(e,e=>"rey_RomeCustomerResponse"===e||e.endsWith(":rey_RomeCustomerResponse"));return o?d(o,e=>"TransStatus"===e||e.endsWith(":TransStatus")).flatMap(r)[0]:void console.log("No rey_RomeCustomerResponse found in root")}(e);if(!o)return{dmsRecKey:void 0};const a=C(o,"DMSRecKey");return{dmsRecKey:null!=a?String(a):void 0,status:C(o,"Status"),statusCode:C(o,"StatusCode")}}function g(e){if(null==e)return;const o=String(e).toUpperCase().replace(/[^A-Z0-9 ]+/g,"");if(!o)throw new K(`Invalid string: ${e}. Must contain A-Z, 0-9, or space`);return o}function N(e){return e?String(e).toUpperCase():void 0}function b(e={}){const o=N(e.ibFlag)||(e.firstName?"I":"B");if("I"!==o&&"B"!==o)throw new K("ibFlag must be 'I' or 'B'");const a=e.lastName||e.customerName;if(!a)throw new K("lastName or customerName required");if("I"===o&&!e.firstName)throw new K("firstName required when ibFlag='I'");const t=N(e.customerType),d="RETAIL"===t?"R":"WHOLESALE"===t?"W":"INTERNAL"===t?"I":t;if(d&&!["R","W","I"].includes(d))throw new K("customerType must be 'R', 'W', 'I', Retail, Wholesale, or Internal");const r=(e.addresses||[]).map(e=>{const o={Type:N(e.type)||"P",Addr1:e.line1?String(e.line1):void 0,Addr2:e.line2?String(e.line2):void 0,City:e.city?String(e.city):void 0,State:e.state?String(e.state):void 0,Zip:e.postalCode?String(e.postalCode):void 0,County:e.county?String(e.county):void 0,Country:e.country?String(e.country):void 0};if(!o.Addr1)throw new K("Address requires line1");return o}),i=(e.phones||[]).map(e=>{const o={Type:N(e.type)||"H",Num:e.number?String(e.number):void 0,Ext:e.extension?String(e.extension):void 0};if(!o.Num)throw new K("Phone requires number");return o}),s=e.emails?.[0]?.address?{MailTo:String(e.emails[0].address)}:void 0,l=e.personal,n=l?{Gender:N(l.gender),OtherName:g(l.otherName),AnniversaryDate:l.anniversaryDate?String(l.anniversaryDate):void 0,EmployerName:g(l.employerName),EmployerPhone:l.employerPhone?String(l.employerPhone):void 0,Occupation:g(l.occupation),OptOut:l.optOut?String(l.optOut):void 0,OptOutUse:l.optOutUse?String(l.optOutUse):void 0,BirthDates:(l.birthDates||[]).map(e=>({Type:N(e.type)||"P",date:e.date?String(e.date):void 0})).filter(e=>e.date),SSNs:(l.ssns||[]).map(e=>({Type:N(e.type)||"P",ssn:e.ssn?String(e.ssn):void 0})).filter(e=>e.ssn),DriverInfo:l.driver?[{Type:N(l.driver.type)||"P",LicNum:l.driver.licenseNumber?String(l.driver.licenseNumber):void 0,LicState:l.driver.licenseState?String(l.driver.licenseState):void 0,LicExpDate:l.driver.licenseExpDate?String(l.driver.licenseExpDate):void 0}].filter(e=>e.LicNum):void 0,CustChildren:(l.children||[]).map(e=>({ChildName:g(e.name)})).filter(e=>e.ChildName)}:void 0,c=e.dms,p=c?{TaxExemptNum:c.taxExemptNum?String(c.taxExemptNum):void 0,SalesTerritory:c.salesTerritory?String(c.salesTerritory):void 0,DeliveryRoute:c.deliveryRoute?String(c.deliveryRoute):void 0,SalesmanNum:c.salesmanNum?String(c.salesmanNum):void 0,LastContactMethod:c.lastContactMethod?String(c.lastContactMethod):void 0,Followups:(c.followups||[]).map(e=>({Type:N(e.type),Value:N(e.value)})).filter(e=>e.Type&&e.Value)}:void 0;return{custCateg:d||"R",createdBy:e.createdBy?String(e.createdBy):void 0,contactInfo:{IBFlag:o,LastName:g(a),FirstName:g(e.firstName),MidName:g(e.midName),Salut:g(e.salut),Suffix:g(e.suffix),Addresses:r,Phones:i,Email:s},custPersonal:n,dmsCustInfo:p}}function S(e){const o=t(e,e=>"rey_RomeServVehicleInsertResponse"===e||e.endsWith(":rey_RomeServVehicleInsertResponse"))||e,a=t(o,e=>"GenTransStatus"===e||e.endsWith(":GenTransStatus"));return{status:a?s(a,"Status"):void 0,statusCode:a?s(a,"StatusCode"):void 0}}function f(e){if(!e)return;let o;if(e instanceof Date)o=e;else if("string"==typeof e){const a=e.trim();if(/^\d{1,2}\/\d{1,2}\/\d{4}$/.test(a))return a;if(/^\d{4}-\d{2}-\d{2}/.test(a)){const[e,t,d]=a.split("T")[0].split("-");o=new Date(Number(e),Number(t)-1,Number(d))}else o=new Date(a)}else o=new Date(e);if(isNaN(o?.getTime()))throw new K(`Invalid date provided: ${e}`);return`${String(o.getMonth()+1).padStart(2,"0")}/${String(o.getDate()).padStart(2,"0")}/${o.getFullYear()}`}function h(e,o){const a=Array.isArray(o)?o.map(e=>e.toLowerCase()):[String(o).toLowerCase()],t=[e];for(;t.length;){const e=t.pop();if($(e))for(const o of Object.keys(e)){const d=e[o],r=q(o).toLowerCase();if(a.includes(r))return d;if($(d))t.push(d);else if(Array.isArray(d))for(const e of d)$(e)&&t.push(e)}}}function x(e,o){if(e&&$(e)){if(null!=e.$?.[o])return e.$[o];if(null!=e[`@${o}`])return e[`@${o}`];if(null!=e[`@_${o}`])return e[`@_${o}`]}}function A(e){if(null!=e){if("string"==typeof e)return e;if("number"==typeof e)return String(e);if($(e)){if(null!=e._)return String(e._);if(null!=e["#text"])return String(e["#text"]);if(null!=e.text)return String(e.text)}}}function P(e){const o=h(e,["CreateBSMRepairOrderResp","UpdateBSMRepairOrderResp"])||e,a=h(o,"RoRecordStatus")||{};return{status:x(a,"Status")||A(h(a,"Status")),date:x(a,"Date")||A(h(a,"Date")),time:x(a,"Time")||A(h(a,"Time")),outsdRoNo:x(a,"OutsdRoNo")||A(h(a,"OutsdRoNo")),dmsRoNo:x(a,"DMSRoNo")||A(h(a,"DMSRoNo")),errorMessage:x(a,"ErrorMessage")||A(h(a,"ErrorMessage"))}}function F(o={},a={}){const t=function(e){if(!e)throw new Error("department is required (S, P, B, SERVICE, PARTS, BODY)");const o=String(e).trim().toUpperCase();if("S"===o||"P"===o||"B"===o)return o;if("SERVICE"===o)return"S";if("PART"===o||"PARTS"===o)return"P";if("BODY"===o||"BODYSHOP"===o||"BODY SHOP"===o)return"B";throw new Error(`Invalid department: ${e}. Must be S, P, B, SERVICE, PARTS, BODY, BODYSHOP, or BODY SHOP`)}(o.department),d=o.advisorNumber?String(o.advisorNumber).trim():void 0,r=e({routing:a.routing,sender:a?.envelope?.sender,creationDateTime:a?.envelope?.creationDateTime,bodId:a?.envelope?.bodId});return{starXml:L.render('\n<rey_RomeGetAdvisorsReq xmlns="http://www.starstandards.org/STAR" revision="1.0">\n {{{ApplicationArea}}}\n <GetAdvisors>\n <AdvisorInfo DepartmentType="{{DepartmentType}}"{{#AdvisorNumber}} AdvisorNumber="{{AdvisorNumber}}"{{/AdvisorNumber}}/>\n </GetAdvisors>\n</rey_RomeGetAdvisorsReq>\n',{ApplicationArea:r,DepartmentType:t,AdvisorNumber:d}),routing:a.routing,envelope:a.envelope,xsdFilename:"rey_RomeGetAdvisorsReq.xsd",elementName:"rey_RomeGetAdvisorsReq",postParse:e=>function(e,o={}){const a=o?.department;var t;return(e=>{const o=e?.Advisor;return o?Array.isArray(o)?o:[o]:[]})((t=e,t?.rey_RomeGetAdvisorsResp??t??{})).map(e=>({advisorId:X(e,"AdvisorNumber"),firstName:X(e,"FirstName"),lastName:X(e,"LastName"),department:a}))}(e,{department:t})}}function v(e){return null==e?void 0:String(e)}function M(e,o){if(e)return null!=e[o]?"object"!=typeof e[o]?v(e[o]):v(e[o]["#text"]):null!=e[`@_${o}`]?v(e[`@_${o}`]):void 0}function O(e){const o=e?.meta?.statusBlocks?.transaction?.message;if(o)return String(o);return String((e?.meta?.status?.Message??e?.meta?.status?.message)||e?.message||"")}function I(e,o){return Math.min(1e4,e*Math.pow(2,o))}function V(e){return e+Math.floor(250*Math.random())}function D(e){return new Promise(o=>setTimeout(o,e))}function w(e){return/lock|in use|record.*busy/i.test(String(e||""))}function E(e,o="****"){if(!e||"string"!=typeof e)return e;let a=e;return a=a.replace(/(<wsse:Username[^>]*>)([^<]*)(<\/wsse:Username>)/gi,`$1${o}$3`),a=a.replace(/(<wsse:Password\b[^>]*>)([^<]*)(<\/wsse:Password>)/gi,`$1${o}$3`),a}import L from"mustache";import{v4 as k}from"uuid";import{create as B}from"xmlbuilder2";import G from"axios";import{XMLParser as H}from"fast-xml-parser";class W extends Error{constructor(e,o={}){super(e),this.name="RRTransportError",this.meta=o}}class U extends Error{constructor(e,o={}){super(e),this.name="RRVendorStatusError",this.meta=o,this.retryable=!!o.retryable}}class K extends Error{constructor(e,o={}){super(e),this.name="RRValidationError",this.meta=o}}const Z=Object.freeze({__proto__:null,RRTransportError:W,RRVendorStatusError:U,RRValidationError:K}),Y={info:(...e)=>console.log("[rr-rome]",...e),warn:(...e)=>console.warn("[rr-rome]",...e),error:(...e)=>console.error("[rr-rome]",...e),debug:(...e)=>{process.env.RR_DEBUG&&console.log("[rr-rome][debug]",...e)}},J=e=>null!=e&&""!==String(e).trim(),_=new H({ignoreAttributes:!1,attributeNamePrefix:"@_",parseAttributeValue:!1,parseTagValue:!1,isArray:e=>["Advisor"].includes(e)}),j=e=>{if(!e||"object"!=typeof e)return;const o={};for(const[a,t]of Object.entries(e))a.startsWith("@_")&&(o[a.slice(2)]=t);return Object.keys(o).length?o:void 0},Q=e=>{if(null!=e)return"string"==typeof e?e:e["#text"]},q=e=>{if("string"!=typeof e)return"";let o=e.includes("}")?e.split("}").pop():e;return o=o.includes(":")?o.split(":").pop():o,o.startsWith("rey_")&&(o=o.slice(4)),o},$=e=>e&&"object"==typeof e&&!Array.isArray(e),X=(e,o)=>((e,o)=>e?.[`@_${o}`])(e,o)??i(e,o);class z{constructor(e){if(!e?.baseUrl)throw new Error("RRClient requires baseUrl");if(!e?.username)throw new Error("RRClient requires username");if(!e?.password)throw new Error("RRClient requires password");this.cfg={wssePasswordType:"Text",timeoutMs:3e4,logger:Y,retries:{max:3},...e},this.mask={password:!0}}async _send(e){const{starXml:t,routing:i,envelope:s,postParse:u}=e,m=this.cfg.logger||Y,{bodId:T,creationDateTime:C,sender:R}=function(e){return{bodId:e?.bodId||k(),creationDateTime:e?.creationDateTime||new Date,sender:e?.sender||{}}}(s),g=function({username:e,password:t,wssePasswordType:d="Text",starContentXml:r,normalize:i=!0,normalizeOptions:s}={}){const l=function(e){return`\n <ProcessMessage xmlns="http://www.starstandards.org/webservices/2005/10/transport">\n <payload>\n <content id="content0">\n${o(e,10)}\n </content>\n </payload>\n </ProcessMessage>\n `.trim()}(r),n=`\n <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">\n <soapenv:Header>\n${o(function(e,o,t){const d="Digest"===t?' Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest"':' Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"';return`\n <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">\n <wsse:UsernameToken>\n <wsse:Username>${a(e)}</wsse:Username>\n <wsse:Password${d}>${a(o)}</wsse:Password>\n </wsse:UsernameToken>\n </wsse:Security>\n `.trim()}(e,t,d),8)}\n </soapenv:Header>\n <soapenv:Body>\n${o(l,8)}\n </soapenv:Body>\n </soapenv:Envelope>\n `.trim();return i?function(e,{prettyPrint:o=!0}={}){if(!e||"string"!=typeof e)return e;try{return B(e).end({prettyPrint:o,width:0,indent:" ",newline:"\n"}).trim()}catch(o){return String(e).trim()}}(n,s):n}({username:this.cfg.username,password:this.cfg.password,wssePasswordType:this.cfg.wssePasswordType||"Text",routing:i,sender:R,creationDateTime:(b=C,"string"==typeof b?b:(b instanceof Date?b:new Date).toISOString().replace(/\.\d{3}Z$/,"Z")),bodId:T,starContentXml:t}),N=E(g);var b;"1"===process.env.RR_DUMP_ENVELOPE&&console.log(`[rr] Soap envelope about to send (${e?.elementName}): \n`+N+"\n");const S=async()=>{const o=await async function({baseUrl:e,envelopeXml:o,timeoutMs:a=3e4,logger:t}){try{const t=await G.post(e,o,{timeout:a,headers:{"Content-Type":"text/xml; charset=utf-8",SOAPAction:"http://www.starstandards.org/webservices/2005/10/transport/ProcessMessage"},responseType:"text",validateStatus:()=>!0});if(t.status>=200&&t.status<300)return String(t.data??"");throw new W(`HTTP ${t.status}: ${function(e){const o=String(e??"");return o.length>1024?o.slice(0,1024)+"…":o}(t.data)}`,{status:t.status,body:t.data})}catch(e){if(G.isAxiosError(e))throw new W(`Network error: ${e.message}`,{cause:e});throw e}}({baseUrl:this.cfg.baseUrl,envelopeXml:g,timeoutMs:this.cfg.timeoutMs,logger:m}),a=function(e){const o=_.parse(e),a=o?.Envelope||o?.["soapenv:Envelope"]||o,t=a?.Body||a?.["soapenv:Body"]||a?.["S:Body"]||a?.["soap:Body"],d=t?.ProcessMessageResponse||t?.["ns2:ProcessMessageResponse"]||t?.["trans:ProcessMessageResponse"]||t,r=d?.payload||d?.["ns2:payload"]||d;return r?.content||r?.["ns2:content"]||r}(o),t=E(o),i=function(e){const o=c(e),a=d(e,e=>/RoRecordStatus$/i.test(e)).flatMap(r)[0];return{transaction:p(o),roRecord:y(a)}}(a),s=function(e){const o=String("ApplicationArea").toLowerCase(),a=[e];for(;a.length;){const e=a.pop();if(e&&"object"==typeof e)for(const[t,d]of Object.entries(e)){if(t.toLowerCase().endsWith(o))return d;d&&"object"==typeof d&&a.push(d)}}}(a),{status:T,norm:C}=function(e){const o=c(e)||d(e,e=>/Status$/i.test(e)).flatMap(r)[0]||{},a=(l(o,"Status")||o.Status||"").toString().trim();let t=(l(o,"StatusCode")||o.StatusCode||"").toString().trim();const i=o.Message&&n(o.Message)||n(o)||"";!t&&/success/i.test(a)&&(t="0");const s=Number(t);let p="FAIL";return/success/i.test(a)||0===s?p="SUCCESS":2!==s&&213!==s||(p="NO_MATCH"),{status:{Status:a,StatusCode:t,Message:i},norm:{kind:p,code:Number.isFinite(s)?s:void 0,message:i}}}(a);if("1"===process.env.RR_DUMP_STATUS&&(console.log("[rr] Status blocks:"),console.dir(i,{depth:null,colors:!0})),"1"===process.env.RR_DUMP_APPLICATION&&(console.log("[rr] ApplicationArea:"),console.dir(s,{depth:null,colors:!0})),"FAIL"===C.kind){const e=T?.StatusCode;throw new U(`Vendor status failure: ${e??""} ${T?.Message||T?.["#text"]||""}`.trim(),{status:T,reqXml:N,requestXml:N,resXml:t})}const R={success:"SUCCESS"===C.kind||"NO_MATCH"===C.kind,statusBlocks:i,applicationArea:s,xml:{request:N,response:t},parsed:a};if("function"==typeof u)try{R.data=u(a)}catch(e){m?.warn?.(`postParse failed: ${e?.message||e}`)}return"1"===process.env.RR_DUMP_XML&&console.log(`[rr] Full response XML (${e?.elementName}):\n`+t+"\n"),R?.data&&"1"===process.env.RR_DUMP_DATA&&(console.log(`[rr] Parsed response data (${e?.elementName}):\n`),console.dir(R.data,{depth:null,colors:!0})),R};try{return await async function(e,{max:o=3,logger:a}){let t,d=0;for(;d<o;)try{return await e()}catch(e){t=e;const r=O(e);if(d++,!(e instanceof W||e instanceof U&&(e.retryable||w(r)))||d>=o)break;const i=V(I(400,d));a?.warn?.(`Retrying attempt ${d}/${o} in ${i}ms: ${e.message}`),await D(i)}throw t}(S,{max:this.cfg.retries?.max??3,logger:m})}catch(e){if(e instanceof W||e instanceof U)throw e;throw new W(`Unexpected error: ${e?.message||e}`,{cause:e})}}async combinedSearch(o,a){return this._send(function(o={},a={}){if(!o||"object"!=typeof o)throw new K("combinedSearch requires a query object");const t=function(e){if(!e)return"";const o=String(e).trim().toLowerCase();return"telephone"===o?"phone":"lic"===o||"plate"===o?"license":"vin"===o||"partvin"===o?"vin":"name"===o?"name":"namerecid"===o||"custid"===o?"nameRecId":"stkno"===o||"stock"===o?"stkNo":o}(o.kind),d={MaxRecs:Math.min(Number(o.maxResults||o.maxRecs||50),50)};if("phone"===t){const e=m(o.phone,"phone");if(!e)throw new K("combinedSearch phone value missing");d.Phone=e}else if("license"===t){const e=m(o.license,"license");if(!e)throw new K("combinedSearch license value missing");d.LicenseNum=e}else if("vin"===t){const e=m(o.vin,"vin");if(!e)throw new K("combinedSearch vin value missing");d.PartVIN=e}else if("name"===t){const e=o.name;if("string"==typeof e){const o=e.trim();if(!o)throw new K("combinedSearch name string is empty");d.LName=o}else{if(!e||"object"!=typeof e)throw new K("combinedSearch name requires { fname/lname/mname } object or a last-name string");{const o=T(e.fname),a=T(e.mname),t=T(e.lname),r=!o&&!a&&!t&&T(e.name);if(o||a||t)d.FullName={FName:o,MName:a,LName:t};else{if(!r)throw new K("combinedSearch name requires string last name, or object with any of { fname, lname, mname }");d.LName=r}}}}else if("nameRecId"===t){const e=m(o.nameRecId??o.custId,"custId");if(!e)throw new K("combinedSearch nameRecId value missing");d.NameRecId=e}else{if("stkNo"!==t)throw new K(`Unsupported CombinedSearch kind: ${o.kind}`);{const e=m(o.stkNo??o.stock,"stkNo");if(!e)throw new K("combinedSearch stkNo value missing");d.StkNo=e}}if(1!==[d.Phone,d.LicenseNum,d.PartVIN,d.LName,d.FullName,d.NameRecId,d.StkNo].filter(Boolean).length)throw new K("combinedSearch requires exactly one search criterion");const r=T(o.make),i=T(o.model),s=T(o.year);(r||i||s)&&(d.VehData={MakePfx:r,Model:i,Year:s});const l=e({routing:a.routing,sender:{component:"Rome",task:"CVC",referenceId:"Query",creator:"RCI",senderName:"RCI"},order:"creation-bod-sender-destination"});return{starXml:L.render('\n<rey_RomeCustServVehCombReq xmlns="http://www.starstandards.org/STAR" revision="1.0">\n {{{ApplicationArea}}}\n <CustServVehCombReq>\n <QueryData{{#MaxRecs}} MaxRecs="{{MaxRecs}}"{{/MaxRecs}}>\n {{#Phone}}<Phone Num="{{Phone}}"/>{{/Phone}}\n {{#PartVIN}}<PartVIN Vin="{{PartVIN}}"/>{{/PartVIN}}\n {{#LicenseNum}}<LicenseNum LicNo="{{LicenseNum}}"/>{{/LicenseNum}}\n {{#LName}}<LName Name="{{LName}}"/>{{/LName}}\n {{#FullName}}\n <FullName{{#FullName.FName}} FName="{{FullName.FName}}"{{/FullName.FName}}{{#FullName.MName}} MName="{{FullName.MName}}"{{/FullName.MName}}{{#FullName.LName}} LName="{{FullName.LName}}"{{/FullName.LName}}/>\n {{/FullName}}\n {{#NameRecId}}<NameRecId CustIdStart="{{NameRecId}}"/>{{/NameRecId}}\n {{#StkNo}}<StkNo VehId="{{StkNo}}"/>{{/StkNo}}\n </QueryData>\n {{#VehData}}\n <VehData{{#MakePfx}} MakePfx="{{MakePfx}}"{{/MakePfx}}{{#Model}} Model="{{Model}}"{{/Model}}{{#Year}} Year="{{Year}}"{{/Year}}/>\n {{/VehData}}\n </CustServVehCombReq>\n</rey_RomeCustServVehCombReq>\n',{ApplicationArea:l,...d}),routing:a.routing,envelope:a.envelope,elementName:"rey_RomeCustServVehCombReq",xsdFilename:"rey_RomeCustServVehCombReq.xsd",postParse:u}}(o,a))}async insertCustomer(o,a){return this._send(function(o,a){if(!a?.routing?.dealerNumber)throw new K("routing.dealerNumber required");const t=b(o),d=e({routing:a.routing,sender:{component:"Rome",task:"CU",referenceId:"Insert"},order:"sender-creation-bod-destination"});return{starXml:L.render('\n<rey_RomeCustomerInsertReq xmlns="http://www.starstandards.org/STAR" revision="1.0">\n {{{ApplicationArea}}}\n <CustRecord{{#C.custCateg}} CustCateg="{{C.custCateg}}"{{/C.custCateg}}{{#C.createdBy}} CreatedBy="{{C.createdBy}}"{{/C.createdBy}}>\n <ContactInfo IBFlag="{{C.contactInfo.IBFlag}}"{{#C.contactInfo.LastName}} LastName="{{C.contactInfo.LastName}}"{{/C.contactInfo.LastName}}{{#C.contactInfo.FirstName}} FirstName="{{C.contactInfo.FirstName}}"{{/C.contactInfo.FirstName}}{{#C.contactInfo.MidName}} MidName="{{C.contactInfo.MidName}}"{{/C.contactInfo.MidName}}{{#C.contactInfo.Salut}} Salut="{{C.contactInfo.Salut}}"{{/C.contactInfo.Salut}}{{#C.contactInfo.Suffix}} Suffix="{{C.contactInfo.Suffix}}"{{/C.contactInfo.Suffix}}>\n {{#C.contactInfo.Addresses}}\n <Address{{#Type}} Type="{{Type}}"{{/Type}}{{#Addr1}} Addr1="{{Addr1}}"{{/Addr1}}{{#Addr2}} Addr2="{{Addr2}}"{{/Addr2}}{{#City}} City="{{City}}"{{/City}}{{#State}} State="{{State}}"{{/State}}{{#Zip}} Zip="{{Zip}}"{{/Zip}}{{#County}} County="{{County}}"{{/County}}{{#Country}} Country="{{Country}}"{{/Country}}/>\n {{/C.contactInfo.Addresses}}\n {{#C.contactInfo.Phones}}\n <Phone{{#Type}} Type="{{Type}}"{{/Type}}{{#Num}} Num="{{Num}}"{{/Num}}{{#Ext}} Ext="{{Ext}}"{{/Ext}}/>\n {{/C.contactInfo.Phones}}\n {{#C.contactInfo.Email}}\n <Email{{#MailTo}} MailTo="{{MailTo}}"{{/MailTo}}/>\n {{/C.contactInfo.Email}}\n </ContactInfo>\n {{#C.custPersonal}}\n <CustPersonal{{#Gender}} Gender="{{Gender}}"{{/Gender}}{{#OtherName}} OtherName="{{OtherName}}"{{/OtherName}}{{#AnniversaryDate}} AnniversaryDate="{{AnniversaryDate}}"{{/AnniversaryDate}}{{#EmployerName}} EmployerName="{{EmployerName}}"{{/EmployerName}}{{#EmployerPhone}} EmployerPhone="{{EmployerPhone}}"{{/EmployerPhone}}{{#Occupation}} Occupation="{{Occupation}}"{{/Occupation}}{{#OptOut}} OptOut="{{OptOut}}"{{/OptOut}}{{#OptOutUse}} OptOutUse="{{OptOutUse}}"{{/OptOutUse}}>\n {{#BirthDates}}\n <BirthDate{{#Type}} Type="{{Type}}"{{/Type}}{{#date}} date="{{date}}"{{/date}}/>\n {{/BirthDates}}\n {{#SSNs}}\n <SSNum{{#Type}} Type="{{Type}}"{{/Type}}{{#ssn}} ssn="{{ssn}}"{{/ssn}}/>\n {{/SSNs}}\n {{#DriverInfo}}\n <DriverInfo{{#Type}} Type="{{Type}}"{{/Type}}{{#LicNum}} LicNum="{{LicNum}}"{{/LicNum}}{{#LicState}} LicState="{{LicState}}"{{/LicState}}{{#LicExpDate}} LicExpDate="{{LicExpDate}}"{{/LicExpDate}}/>\n {{/DriverInfo}}\n {{#CustChildren}}\n <CustChild{{#ChildName}} ChildName="{{ChildName}}"{{/ChildName}}/>\n {{/CustChildren}}\n </CustPersonal>\n {{/C.custPersonal}}\n {{#C.dmsCustInfo}}\n <DMSCustInfo{{#TaxExemptNum}} TaxExemptNum="{{TaxExemptNum}}"{{/TaxExemptNum}}{{#SalesTerritory}} SalesTerritory="{{SalesTerritory}}"{{/SalesTerritory}}{{#DeliveryRoute}} DeliveryRoute="{{DeliveryRoute}}"{{/DeliveryRoute}}{{#SalesmanNum}} SalesmanNum="{{SalesmanNum}}"{{/SalesmanNum}}{{#LastContactMethod}} LastContactMethod="{{LastContactMethod}}"{{/LastContactMethod}}>\n {{#Followups}}\n <Followup{{#Type}} Type="{{Type}}"{{/Type}}{{#Value}} Value="{{Value}}"{{/Value}}/>\n {{/Followups}}\n </DMSCustInfo>\n {{/C.dmsCustInfo}}\n </CustRecord>\n</rey_RomeCustomerInsertReq>\n',{ApplicationArea:d,C:t}),routing:a.routing,envelope:a.envelope,postParse:R,xsdFilename:"rey_RomeCustomerInsertReq.xsd",elementName:"rey_RomeCustomerInsertReq"}}(o,a))}async updateCustomer(o,a){return this._send(function(o,a){if(!a?.routing?.dealerNumber)throw new K("routing.dealerNumber required");if(!o.nameRecId)throw new K("nameRecId or customerId required");const t=N(o.ibFlag);if("I"!==t&&"B"!==t)throw new K("ibFlag required ('I' or 'B')");const d=b(o);d.contactInfo.NameRecId=String(o.nameRecId);const r=e({routing:a.routing,sender:{component:"Rome",task:"CU",referenceId:"Update"},order:"sender-creation-bod-destination"});return{starXml:L.render('\n<rey_RomeCustomerUpdateReq xmlns="http://www.starstandards.org/STAR" revision="1.0">\n {{{ApplicationArea}}}\n <CustRecord{{#C.custCateg}} CustCateg="{{C.custCateg}}"{{/C.custCateg}}{{#C.createdBy}} CreatedBy="{{C.createdBy}}"{{/C.createdBy}}>\n <ContactInfo NameRecId="{{C.contactInfo.NameRecId}}" IBFlag="{{C.contactInfo.IBFlag}}"{{#C.contactInfo.LastName}} LastName="{{C.contactInfo.LastName}}"{{/C.contactInfo.LastName}}{{#C.contactInfo.FirstName}} FirstName="{{C.contactInfo.FirstName}}"{{/C.contactInfo.FirstName}}{{#C.contactInfo.MidName}} MidName="{{C.contactInfo.MidName}}"{{/C.contactInfo.MidName}}{{#C.contactInfo.Salut}} Salut="{{C.contactInfo.Salut}}"{{/C.contactInfo.Salut}}{{#C.contactInfo.Suffix}} Suffix="{{C.contactInfo.Suffix}}"{{/C.contactInfo.Suffix}}>\n {{#C.contactInfo.Addresses}}\n <Address{{#Type}} Type="{{Type}}"{{/Type}}{{#Addr1}} Addr1="{{Addr1}}"{{/Addr1}}{{#Addr2}} Addr2="{{Addr2}}"{{/Addr2}}{{#City}} City="{{City}}"{{/City}}{{#State}} State="{{State}}"{{/State}}{{#Zip}} Zip="{{Zip}}"{{/Zip}}{{#County}} County="{{County}}"{{/County}}{{#Country}} Country="{{Country}}"{{/Country}}/>\n {{/C.contactInfo.Addresses}}\n {{#C.contactInfo.Phones}}\n <Phone{{#Type}} Type="{{Type}}"{{/Type}}{{#Num}} Num="{{Num}}"{{/Num}}{{#Ext}} Ext="{{Ext}}"{{/Ext}}/>\n {{/C.contactInfo.Phones}}\n {{#C.contactInfo.Email}}\n <Email{{#MailTo}} MailTo="{{MailTo}}"{{/MailTo}}/>\n {{/C.contactInfo.Email}}\n </ContactInfo>\n {{#C.custPersonal}}\n <CustPersonal{{#Gender}} Gender="{{Gender}}"{{/Gender}}{{#OtherName}} OtherName="{{OtherName}}"{{/OtherName}}{{#AnniversaryDate}} AnniversaryDate="{{AnniversaryDate}}"{{/AnniversaryDate}}{{#EmployerName}} EmployerName="{{EmployerName}}"{{/EmployerName}}{{#EmployerPhone}} EmployerPhone="{{EmployerPhone}}"{{/EmployerPhone}}{{#Occupation}} Occupation="{{Occupation}}"{{/Occupation}}{{#OptOut}} OptOut="{{OptOut}}"{{/OptOut}}{{#OptOutUse}} OptOutUse="{{OptOutUse}}"{{/OptOutUse}}>\n {{#BirthDates}}\n <BirthDate{{#Type}} Type="{{Type}}"{{/Type}}{{#date}} date="{{date}}"{{/date}}/>\n {{/BirthDates}}\n {{#SSNs}}\n <SSNum{{#Type}} Type="{{Type}}"{{/Type}}{{#ssn}} ssn="{{ssn}}"{{/ssn}}/>\n {{/SSNs}}\n {{#DriverInfo}}\n <DriverInfo{{#Type}} Type="{{Type}}"{{/Type}}{{#LicNum}} LicNum="{{LicNum}}"{{/LicNum}}{{#LicState}} LicState="{{LicState}}"{{/LicState}}{{#LicExpDate}} LicExpDate="{{LicExpDate}}"{{/LicExpDate}}/>\n {{/DriverInfo}}\n {{#CustChildren}}\n <CustChild{{#ChildName}} ChildName="{{ChildName}}"{{/ChildName}}/>\n {{/CustChildren}}\n </CustPersonal>\n {{/C.custPersonal}}\n {{#C.dmsCustInfo}}\n <DMSCustInfo{{#TaxExemptNum}} TaxExemptNum="{{TaxExemptNum}}"{{/TaxExemptNum}}{{#SalesTerritory}} SalesTerritory="{{SalesTerritory}}"{{/SalesTerritory}}{{#DeliveryRoute}} DeliveryRoute="{{DeliveryRoute}}"{{/DeliveryRoute}}{{#SalesmanNum}} SalesmanNum="{{SalesmanNum}}"{{/SalesmanNum}}{{#LastContactMethod}} LastContactMethod="{{LastContactMethod}}"{{/LastContactMethod}}>\n {{#Followups}}\n <Followup{{#Type}} Type="{{Type}}"{{/Type}}{{#Value}} Value="{{Value}}"{{/Value}}/>\n {{/Followups}}\n </DMSCustInfo>\n {{/C.dmsCustInfo}}\n </CustRecord>\n</rey_RomeCustomerUpdateReq>\n',{ApplicationArea:r,C:d}),routing:a.routing,envelope:a.envelope,postParse:R,xsdFilename:"rey_RomeCustomerUpdateReq.xsd",elementName:"rey_RomeCustomerUpdateReq"}}(o,a))}async insertServiceVehicle(o,a){return this._send(function(o={},a={}){if(!a?.routing?.dealerNumber)throw new K("routing.dealerNumber is required");const t=e({routing:a.routing,sender:a?.envelope?.sender??{component:"Rome",task:"SV",referenceId:"Insert"},creationDateTime:a?.envelope?.creationDateTime,bodId:a?.envelope?.bodId}),d=function(e={}){const o=e.vin;if(!o)throw new K("insertServiceVehicle: vin is required");const a=e.vehicleServInfo?.customerNo;if(!a)throw new K("insertServiceVehicle: vehicleServInfo.customerNo (or customerNo) is required");return{VIN:String(o).toUpperCase(),VehicleMake:e.vehicleMake||e.make,VehicleYear:String(e.year).slice(-2),MdlNo:e.mdlNo||e.modelCode||"P",ModelDesc:e.modelDesc,Carline:e.carline,ExtClrDesc:e.extClrDesc,AccentClr:e.accentClr,Aircond:e.aircond??"Y",Pwrstr:e.pwrstr??"Y",Transm:e.transm??"A",Turbo:e.turbo?"Y":"N",EngineConfig:e.engineConfig,Trim:e.trim,LicNo:e.licNo,StockID:e.stockId,CustomerNo:String(a),vehicleServInfo:{salesmanNo:e.vehicleServInfo?.salesmanNo,inServiceDate:e.vehicleServInfo?.inServiceDate?f(e.vehicleServInfo?.inServiceDate):void 0,mileage:e.vehicleServInfo?.mileage,teamCode:e.vehicleServInfo?.teamCode,productionDate:e?.productionDate?f(e.productionDate):void 0,modelMaintCode:e.modelMaintCode,vehExtWarranty:(()=>{const o=e.vehicleServInfo?.vehExtWarranty;if(!o)return;const a={contractNumber:o.contractNumber,expirationDate:o?.expirationDate?f(o.expirationDate):void 0,expirationMileage:o.expirationMileage};return Object.values(a).some(e=>null!=e&&""!==e)?a:void 0})(),advisor:(()=>{const o=e.vehicleServInfo?.advisor,a=o?.contactInfo?.nameRecId;return a?{contactInfo:{nameRecId:String(a)}}:void 0})()}}}(o);return{starXml:L.render('\n<rey_RomeServVehicleInsert xmlns="http://www.starstandards.org/STAR" revision="1.0">\n {{{ApplicationArea}}}\n\n <Vehicle\n Vin="{{V.VIN}}"\n VehicleMake="{{V.VehicleMake}}"\n VehicleYear="{{V.VehicleYear}}"\n MdlNo="{{V.MdlNo}}"\n {{#V.ModelDesc}}ModelDesc="{{.}}"{{/V.ModelDesc}}\n {{#V.Carline}}Carline="{{.}}"{{/V.Carline}}\n {{#V.ExtClrDesc}}ExtClrDesc="{{.}}"{{/V.ExtClrDesc}}\n {{#V.AccentClr}}AccentClr="{{.}}"{{/V.AccentClr}}\n >\n <VehicleDetail\n Aircond="{{V.Aircond}}"\n Pwrstr="{{V.Pwrstr}}"\n Transm="{{V.Transm}}"\n {{#V.Turbo}}Turbo="{{.}}"{{/V.Turbo}}\n {{#V.EngineConfig}}EngineConfig="{{.}}"{{/V.EngineConfig}}\n {{#V.Trim}}Trim="{{.}}"{{/V.Trim}}\n {{#V.LicNo}}LicNo="{{.}}"{{/V.LicNo}}\n />\n </Vehicle>\n\n <VehicleServInfo\n CustomerNo="{{V.CustomerNo}}"\n StockID="{{V.StockID}}"\n {{#V.vehicleServInfo.salesmanNo}}SalesmanNo="{{.}}"{{/V.vehicleServInfo.salesmanNo}}\n {{#V.vehicleServInfo.inServiceDate}}InServiceDate="{{.}}"{{/V.vehicleServInfo.inServiceDate}}\n {{#V.vehicleServInfo.modelMaintCode}}ModelMaintCode="{{.}}"{{/V.vehicleServInfo.modelMaintCode}}\n {{#V.vehicleServInfo.productionDate}}ProductionDate="{{.}}"{{/V.vehicleServInfo.productionDate}}\n >\n {{#V.vehicleServInfo.vehExtWarranty}}\n <VehExtWarranty\n {{#contractNumber}}ContractNo="{{.}}"{{/contractNumber}}\n {{#expirationDate}}ExpirationDate="{{.}}"{{/expirationDate}}\n {{#expirationMileage}}ExpirationOdom="{{.}}"{{/expirationMileage}}\n />\n {{/V.vehicleServInfo.vehExtWarranty}}\n\n {{#V.vehicleServInfo.advisor}}\n <Advisor>\n <ContactInfo NameRecId="{{contactInfo.nameRecId}}"/>\n </Advisor>\n {{/V.vehicleServInfo.advisor}}\n </VehicleServInfo>\n</rey_RomeServVehicleInsert>\n',{ApplicationArea:t,V:d}),routing:a.routing,envelope:a.envelope,postParse:S,xsdFilename:"rey_RomeServVehicleInsertReq.xsd",elementName:"rey_RomeServVehicleInsertReq"}}(o,a))}async getAdvisors(e,o){return this._send(F(e,o))}async createRepairOrder(o,a){return this._send(function(o={},a={}){if(!a?.routing?.dealerNumber)throw new K("routing.dealerNumber required");if(!o?.customerNo)throw new K("customerNo (CustNo) required");if(!o?.departmentType)throw new K("departmentType (DeptType) required");if(!o?.vin)throw new K("vin (Vin) required");if(!o?.outsdRoNo)throw new K("outsdRoNo required");const t={customerNo:o.customerNo,advisorNo:o.advisorNo,tagNo:o.tagNo,outsdRoNo:o.outsdRoNo,departmentType:o.departmentType,vin:o.vin,mileageIn:o.mileageIn,roComment:o.roComment,estimate:o.estimate?{parts:o.estimate.parts,labor:o.estimate.labor,total:o.estimate.total}:void 0,tax:o.tax?{payType:o.tax.payType,taxCode:o.tax.taxCode,txblGrossAmt:o.tax.txblGrossAmt,grossTaxAmt:o.tax.grossTaxAmt}:void 0,rolabor:o.rolabor?{ops:o.rolabor.ops?.map(e=>({opCode:e.opCode,jobNo:e.jobNo,custPayTypeFlag:e.custPayTypeFlag,custTxblNtxblFlag:e.custTxblNtxblFlag,warrPayTypeFlag:e.warrPayTypeFlag,warrTxblNtxblFlag:e.warrTxblNtxblFlag,intrPayTypeFlag:e.intrPayTypeFlag,intrTxblNtxblFlag:e.intrTxblNtxblFlag,vlrCode:e.vlrCode,bill:e.bill?{payType:e.bill.payType,jobTotalHrs:e.bill.jobTotalHrs,billTime:e.bill.billTime,billRate:e.bill.billRate}:void 0,ccc:e.ccc?{cause:e.ccc.cause,complaint:e.ccc.complaint,correction:e.ccc.correction}:void 0,amount:e.amount?{payType:e.amount.payType,amtType:e.amount.amtType,custPrice:e.amount.custPrice,totalAmt:e.amount.totalAmt}:void 0}))}:void 0,ropart:o.ropart?{jobs:o.ropart.jobs?.map(e=>({opCode:e.opCode,jobNo:e.jobNo,lines:e.lines?.map(e=>({partNo:e.partNo,partNoDesc:e.partNoDesc,qtyOrd:e.partQty,sale:e.sale,cost:e.cost,addDeleteFlag:e.addDeleteFlag}))}))}:void 0,rogg:o.rogg?{roNo:o.rogg.roNo,ops:o.rogg.ops?.map(e=>({opCode:e.opCode,jobNo:e.jobNo,lines:e.lines?.map(e=>({breakOut:e.breakOut,itemType:e.itemType,itemDesc:e.itemDesc,custQty:e.custQty,warrQty:e.warrQty,intrQty:e.intrQty,custPayTypeFlag:e.custPayTypeFlag,warrPayTypeFlag:e.warrPayTypeFlag,intrPayTypeFlag:e.intrPayTypeFlag,custTxblNtxblFlag:e.custTxblNtxblFlag,warrTxblNtxblFlag:e.warrTxblNtxblFlag,intrTxblNtxblFlag:e.intrTxblNtxblFlag,amount:e.amount?{payType:e.amount.payType,amtType:e.amount.amtType,custPrice:e.amount.custPrice,dlrCost:e.amount.dlrCost}:void 0}))}))}:void 0,romisc:o.romisc?{roNo:o.romisc.roNo,ops:o.romisc.ops?.map(e=>({opCode:e.opCode,jobNo:e.jobNo,lines:e.lines?.map(e=>({miscCode:e.miscCode,custPayTypeFlag:e.custPayTypeFlag,warrPayTypeFlag:e.warrPayTypeFlag,intrPayTypeFlag:e.intrPayTypeFlag,custTxblNtxblFlag:e.custTxblNtxblFlag,warrTxblNtxblFlag:e.warrTxblNtxblFlag,intrTxblNtxblFlag:e.intrTxblNtxblFlag,codeAmt:e.codeAmt}))}))}:void 0};if(t.tax?.payType&&!["All","Cust","Intr","Warr"].includes(t.tax.payType))throw new K("tax.payType must be one of: All, Cust, Intr, Warr");if(t.rolabor?.ops?.some(e=>e.custTxblNtxblFlag&&!["T","N"].includes(e.custTxblNtxblFlag)||e.warrTxblNtxblFlag&&!["T","N"].includes(e.warrTxblNtxblFlag)||e.intrTxblNtxblFlag&&!["T","N"].includes(e.intrTxblNtxblFlag)))throw new K("Taxable flags (CustTxblNTxblFlag, WarrTxblNTxblFlag, IntrTxblNTxblFlag) must be 'T' or 'N'");if(t.rogg?.ops?.some(e=>e.lines?.some(e=>e.itemType&&!["G","P","S","F"].includes(e.itemType))))throw new K("rogg.ops.lines.itemType must be one of: G, P, S, F");const d={...a?.envelope||{},sender:{component:a?.envelope?.sender?.component??"Rome",task:a?.envelope?.sender?.task??"BSMRO",referenceId:a?.envelope?.sender?.referenceId??"Insert",creatorNameCode:a?.envelope?.sender?.creatorNameCode??"RCI",senderNameCode:a?.envelope?.sender?.senderNameCode??"RCI"}},r=e({routing:a.routing,sender:d.sender,creationDateTime:d.creationDateTime,bodId:d.bodId});return{starXml:L.render('\n<rey_RomeCreateBSMRepairOrderReq xmlns="http://www.starstandards.org/STAR" revision="1.0">\n {{{ApplicationArea}}}\n <RoRecord>\n <Rogen\n {{#RO.customerNo}}CustNo="{{RO.customerNo}}"{{/RO.customerNo}}\n {{#RO.advisorNo}}AdvNo="{{RO.advisorNo}}"{{/RO.advisorNo}}\n {{#RO.tagNo}}TagNo="{{RO.tagNo}}"{{/RO.tagNo}}\n {{#RO.outsdRoNo}}OutsdRoNo="{{RO.outsdRoNo}}"{{/RO.outsdRoNo}}\n {{#RO.departmentType}}DeptType="{{RO.departmentType}}"{{/RO.departmentType}}\n {{#RO.vin}}Vin="{{RO.vin}}"{{/RO.vin}}\n {{#RO.mileageIn}}MileageIn="{{RO.mileageIn}}"{{/RO.mileageIn}}\n >\n {{#RO.roComment}}\n <RoCommentInfo RoComment="{{RO.roComment}}"/>\n {{/RO.roComment}}\n\n {{#RO.estimate}}\n <EstimateInfo\n {{#RO.estimate.parts}}EstPartsAmt="{{RO.estimate.parts}}"{{/RO.estimate.parts}}\n {{#RO.estimate.labor}}EstLaborAmt="{{RO.estimate.labor}}"{{/RO.estimate.labor}}\n {{#RO.estimate.total}}EstTotalAmt="{{RO.estimate.total}}"{{/RO.estimate.total}}\n />\n {{/RO.estimate}}\n\n {{#RO.tax}}\n <TaxCodeInfo\n {{#RO.tax.payType}}PayType="{{RO.tax.payType}}"{{/RO.tax.payType}}\n {{#RO.tax.taxCode}}TaxCode="{{RO.tax.taxCode}}"{{/RO.tax.taxCode}}\n {{#RO.tax.txblGrossAmt}}TxblGrossAmt="{{RO.tax.txblGrossAmt}}"{{/RO.tax.txblGrossAmt}}\n {{#RO.tax.grossTaxAmt}}GrossTaxAmt="{{RO.tax.grossTaxAmt}}"{{/RO.tax.grossTaxAmt}}\n />\n {{/RO.tax}}\n </Rogen>\n\n {{#RO.rolabor}}\n <Rolabor>\n {{#RO.rolabor.ops}}\n <OpCodeLaborInfo\n {{#opCode}}OpCode="{{opCode}}"{{/opCode}}\n {{#jobNo}}JobNo="{{jobNo}}"{{/jobNo}}\n {{#custPayTypeFlag}}CustPayTypeFlag="{{custPayTypeFlag}}"{{/custPayTypeFlag}}\n {{#warrPayTypeFlag}}WarrPayTypeFlag="{{warrPayTypeFlag}}"{{/warrPayTypeFlag}}\n {{#intrPayTypeFlag}}IntrPayTypeFlag="{{intrPayTypeFlag}}"{{/intrPayTypeFlag}}\n {{#custTxblNtxblFlag}}CustTxblNTxblFlag="{{custTxblNtxblFlag}}"{{/custTxblNtxblFlag}}\n {{#warrTxblNtxblFlag}}WarrTxblNTxblFlag="{{warrTxblNtxblFlag}}"{{/warrTxblNtxblFlag}}\n {{#intrTxblNtxblFlag}}IntrTxblNTxblFlag="{{intrTxblNtxblFlag}}"{{/intrTxblNtxblFlag}}\n {{#vlrCode}}VLRCode="{{vlrCode}}"{{/vlrCode}}\n >\n {{#bill}}\n <BillTimeRateHrs\n {{#payType}}PayType="{{payType}}"{{/payType}}\n {{#jobTotalHrs}}JobTotalHrs="{{jobTotalHrs}}"{{/jobTotalHrs}}\n {{#billTime}}BillTime="{{billTime}}"{{/billTime}}\n {{#billRate}}BillRate="{{billRate}}"{{/billRate}}\n />\n {{/bill}}\n\n {{#ccc}}\n <CCCStmts\n {{#cause}}Cause="{{cause}}"{{/cause}}\n {{#complaint}}Complaint="{{complaint}}"{{/complaint}}\n {{#correction}}Correction="{{correction}}"{{/correction}}\n />\n {{/ccc}}\n\n {{#amount}}\n <RoAmts\n {{#payType}}PayType="{{payType}}"{{/payType}}\n {{#amtType}}AmtType="{{amtType}}"{{/amtType}}\n {{#custPrice}}CustPrice="{{custPrice}}"{{/custPrice}}\n {{#totalAmt}}TotalAmt="{{totalAmt}}"{{/totalAmt}}\n {{#totalAmt}}TotalAmt="{{totalAmt}}"{{/totalAmt}}\n />\n {{/amount}}\n </OpCodeLaborInfo>\n {{/RO.rolabor.ops}}\n </Rolabor>\n {{/RO.rolabor}}\n\n {{#RO.ropart}}\n <Ropart>\n {{#RO.ropart.jobs}}\n <PartInfoByJob\n {{#opCode}}OpCode="{{opCode}}"{{/opCode}}\n {{#jobNo}}JobNo="{{jobNo}}"{{/jobNo}}\n >\n {{#lines}}\n <OSDPartDetail\n {{#partNo}}PartNo="{{partNo}}"{{/partNo}}\n {{#partNoDesc}}PartNoDesc="{{partNoDesc}}"{{/partNoDesc}}\n {{#qtyOrd}}QtyOrd="{{qtyOrd}}"{{/qtyOrd}}\n {{#sale}}Sale="{{sale}}"{{/sale}}\n {{#cost}}Cost="{{cost}}"{{/cost}}\n {{#addDeleteFlag}}AddDeleteFlag="{{addDeleteFlag}}"{{/addDeleteFlag}}\n />\n {{/lines}}\n </PartInfoByJob>\n {{/RO.ropart.jobs}}\n </Ropart>\n {{/RO.ropart}}\n\n {{#RO.rogg}}\n <Rogog {{#RO.rogg.roNo}}RoNo="{{RO.rogg.roNo}}"{{/RO.rogg.roNo}}>\n {{#RO.rogg.ops}}\n <AllGogOpCodeInfo\n {{#opCode}}OpCode="{{opCode}}"{{/opCode}}\n {{#jobNo}}JobNo="{{jobNo}}"{{/jobNo}}\n >\n {{#lines}}\n <AllGogLineItmInfo\n {{#breakOut}}BreakOut="{{breakOut}}"{{/breakOut}}\n {{#itemType}}ItemType="{{itemType}}"{{/itemType}}\n {{#itemDesc}}ItemDesc="{{itemDesc}}"{{/itemDesc}}\n {{#custQty}}CustQty="{{custQty}}"{{/custQty}}\n {{#warrQty}}WarrQty="{{warrQty}}"{{/warrQty}}\n {{#intrQty}}IntrQty="{{intrQty}}"{{/intrQty}}\n {{#custPayTypeFlag}}CustPayTypeFlag="{{custPayTypeFlag}}"{{/custPayTypeFlag}}\n {{#warrPayTypeFlag}}WarrPayTypeFlag="{{warrPayTypeFlag}}"{{/warrPayTypeFlag}}\n {{#intrPayTypeFlag}}IntrPayTypeFlag="{{intrPayTypeFlag}}"{{/intrPayTypeFlag}}\n {{#custTxblNtxblFlag}}CustTxblNTxblFlag="{{custTxblNtxblFlag}}"{{/custTxblNtxblFlag}}\n {{#warrTxblNtxblFlag}}WarrTxblNTxblFlag="{{warrTxblNtxblFlag}}"{{/warrTxblNtxblFlag}}\n {{#intrTxblNtxblFlag}}IntrTxblNTxblFlag="{{intrTxblNtxblFlag}}"{{/intrTxblNtxblFlag}}\n >\n {{#amount}}\n <RoAmts\n {{#payType}}PayType="{{payType}}"{{/payType}}\n {{#amtType}}AmtType="{{amtType}}"{{/amtType}}\n {{#custPrice}}CustPrice="{{custPrice}}"{{/custPrice}}\n {{#totalAmt}}TotalAmt="{{totalAmt}}"{{/totalAmt}}\n {{#dlrCost}}DlrCost="{{dlrCost}}"{{/dlrCost}}\n />\n {{/amount}}\n </AllGogLineItmInfo>\n {{/lines}}\n </AllGogOpCodeInfo>\n {{/RO.rogg.ops}}\n </Rogog>\n {{/RO.rogg}}\n\n {{#RO.romisc}}\n <Romisc {{#RO.romisc.roNo}}RoNo="{{RO.romisc.roNo}}"{{/RO.romisc.roNo}}>\n {{#RO.romisc.ops}}\n <MiscOpCodeInfo\n {{#opCode}}OpCode="{{opCode}}"{{/opCode}}\n {{#jobNo}}JobNo="{{jobNo}}"{{/jobNo}}\n >\n {{#lines}}\n <MiscLineItmInfo\n {{#miscCode}}MiscCode="{{miscCode}}"{{/miscCode}}\n {{#custPayTypeFlag}}CustPayTypeFlag="{{custPayTypeFlag}}"{{/custPayTypeFlag}}\n {{#warrPayTypeFlag}}WarrPayTypeFlag="{{warrPayTypeFlag}}"{{/warrPayTypeFlag}}\n {{#intrPayTypeFlag}}IntrPayTypeFlag="{{intrPayTypeFlag}}"{{/intrPayTypeFlag}}\n {{#custTxblNtxblFlag}}CustTxblNTxblFlag="{{custTxblNtxblFlag}}"{{/custTxblNtxblFlag}}\n {{#warrTxblNtxblFlag}}WarrTxblNTxblFlag="{{warrTxblNtxblFlag}}"{{/warrTxblNtxblFlag}}\n {{#intrTxblNtxblFlag}}IntrTxblNTxblFlag="{{intrTxblNtxblFlag}}"{{/intrTxblNtxblFlag}}\n {{#codeAmt}}CodeAmt="{{codeAmt}}"{{/codeAmt}}\n />\n {{/lines}}\n </MiscOpCodeInfo>\n {{/RO.romisc.ops}}\n </Romisc>\n {{/RO.romisc}}\n </RoRecord>\n</rey_RomeCreateBSMRepairOrderReq>\n',{ApplicationArea:r,RO:t}),routing:a.routing,envelope:d,postParse:P,xsdFilename:"rey_RomeCreateBSMRepairOrderReq.xsd"}}(o,a))}async updateRepairOrder(o,a){return this._send(function(o={},a={}){if(!a?.routing?.dealerNumber)throw new K("routing.dealerNumber required");if(!o?.finalUpdate)throw new K("finalUpdate (FinalUpdate) required");if(!["Y","N"].includes(o.finalUpdate))throw new K("finalUpdate must be 'Y' or 'N'");if(!o?.outsdRoNo)throw new K(" outsdRoNo");const t={finalUpdate:o.finalUpdate||"N",roNo:o.roNo,customerNo:o.customerNo,tagNo:o.tagNo,outsdRoNo:o.outsdRoNo,departmentType:o.departmentType,vin:o.vin,mileageIn:o.mileageIn,mileageOut:o.mileageOut,roComment:o.roComment,estimate:o.estimate?{estimateType:o.estimate.estimateType}:void 0,tax:o.tax?{payType:o.tax.payType,taxCode:o.tax.taxCode,txblGrossAmt:o.tax.txblGrossAmt,grossTaxAmt:o.tax.grossTaxAmt}:void 0,rolabor:o.rolabor?{ops:o.rolabor.ops?.map(e=>({opCode:e.opCode,jobNo:e.jobNo,custPayTypeFlag:e.custPayTypeFlag,custTxblNtxblFlag:e.custTxblNtxblFlag,warrPayTypeFlag:e.warrPayTypeFlag,warrTxblNtxblFlag:e.warrTxblNtxblFlag,intrPayTypeFlag:e.intrPayTypeFlag,intrTxblNtxblFlag:e.intrTxblNtxblFlag,vlrCode:e.vlrCode,bill:e.bill?{payType:e.bill.payType,jobTotalHrs:e.bill.jobTotalHrs,billTime:e.bill.billTime,billRate:e.bill.billRate}:void 0,ccc:e.ccc?{cause:e.ccc.cause,complaint:e.ccc.complaint,correction:e.ccc.correction}:void 0,amount:e.amount?{payType:e.amount.payType,amtType:e.amount.amtType,custPrice:e.amount.custPrice,totalAmt:e.amount.totalAmt}:void 0}))}:void 0,ropart:o.ropart?{jobs:o.ropart.jobs?.map(e=>({opCode:e.opCode,jobNo:e.jobNo,lines:e.lines?.map(e=>({partNo:e.partNo,partNoDesc:e.partNoDesc,qtyOrd:e.partQty,sale:e.sale,cost:e.cost,addDeleteFlag:e.addDeleteFlag}))}))}:void 0,rogg:o.rogg?{roNo:o.rogg.roNo,ops:o.rogg.ops?.map(e=>({opCode:e.opCode,jobNo:e.jobNo,lines:e.lines?.map(e=>({breakOut:e.breakOut,itemType:e.itemType,itemDesc:e.itemDesc,custQty:e.custQty,warrQty:e.warrQty,intrQty:e.intrQty,custPayTypeFlag:e.custPayTypeFlag,warrPayTypeFlag:e.warrPayTypeFlag,intrPayTypeFlag:e.intrPayTypeFlag,custTxblNtxblFlag:e.custTxblNtxblFlag,warrTxblNtxblFlag:e.warrTxblNtxblFlag,intrTxblNtxblFlag:e.intrTxblNtxblFlag,amount:e.amount?{payType:e.amount.payType,amtType:e.amount.amtType,custPrice:e.amount.custPrice,dlrCost:e.amount.dlrCost}:void 0}))}))}:void 0,romisc:o.romisc?{roNo:o.romisc.roNo,ops:o.romisc.ops?.map(e=>({opCode:e.opCode,jobNo:e.jobNo,lines:e.lines?.map(e=>({miscCode:e.miscCode,custPayTypeFlag:e.custPayTypeFlag,warrPayTypeFlag:e.warrPayTypeFlag,intrPayTypeFlag:e.intrPayTypeFlag,custTxblNtxblFlag:e.custTxblNtxblFlag,warrTxblNtxblFlag:e.warrTxblNtxblFlag,intrTxblNtxblFlag:e.intrTxblNtxblFlag,codeAmt:e.codeAmt}))}))}:void 0};if(t.tax?.payType&&!["All","Cust","Intr","Warr"].includes(t.tax.payType))throw new K("tax.payType must be one of: All, Cust, Intr, Warr");if(t.rolabor?.ops?.some(e=>e.custTxblNtxblFlag&&!["T","N"].includes(e.custTxblNtxblFlag)||e.warrTxblNtxblFlag&&!["T","N"].includes(e.warrTxblNtxblFlag)||e.intrTxblNtxblFlag&&!["T","N"].includes(e.intrTxblNtxblFlag)))throw new K("Taxable flags (CustTxblNTxblFlag, WarrTxblNTxblFlag, IntrTxblNTxblFlag) must be 'T' or 'N'");if(t.rogg?.ops?.some(e=>e.lines?.some(e=>e.itemType&&!["G","P","S","F"].includes(e.itemType))))throw new K("rogg.ops.lines.itemType must be one of: G, P, S, F");const d={...a?.envelope||{},sender:{component:a?.envelope?.sender?.component??"Rome",task:a?.envelope?.sender?.task??"BSMRO",referenceId:a?.envelope?.sender?.referenceId??"Update",creatorNameCode:a?.envelope?.sender?.creatorNameCode??"RCI",senderNameCode:a?.envelope?.sender?.senderNameCode??"RCI"}},r=e({routing:a.routing,sender:d.sender,creationDateTime:d.creationDateTime,bodId:d.bodId});return{starXml:L.render('\n<rey_RomeUpdateBSMRepairOrderReq xmlns="http://www.starstandards.org/STAR" revision="1.0">\n {{{ApplicationArea}}}\n <RoRecord{{#RO.finalUpdate}} FinalUpdate="{{RO.finalUpdate}}"{{/RO.finalUpdate}}{{^RO.finalUpdate}} FinalUpdate="N"{{/RO.finalUpdate}}>\n <Rogen\n {{#RO.roNo}}RoNo="{{RO.roNo}}"{{/RO.roNo}}\n {{#RO.customerNo}}CustNo="{{RO.customerNo}}"{{/RO.customerNo}}\n {{#RO.tagNo}}TagNo="{{RO.tagNo}}"{{/RO.tagNo}}\n {{#RO.outsdRoNo}}OutsdRoNo="{{RO.outsdRoNo}}"{{/RO.outsdRoNo}}\n {{^RO.outsdRoNo}}{{#RO.repairOrderNumber}}OutsdRoNo="{{RO.repairOrderNumber}}"{{/RO.repairOrderNumber}}{{/RO.outsdRoNo}}\n {{#RO.departmentType}}DeptType="{{RO.departmentType}}"{{/RO.departmentType}}\n {{#RO.vin}}Vin="{{RO.vin}}"{{/RO.vin}}\n {{#RO.mileageIn}}MileageIn="{{RO.mileageIn}}"{{/RO.mileageIn}}\n {{#RO.mileageOut}}MileageOut="{{RO.mileageOut}}"{{/RO.mileageOut}}\n >\n {{#RO.roComment}}\n <RoCommentInfo RoComment="{{RO.roComment}}"/>\n {{/RO.roComment}}\n\n {{#RO.estimate}}\n <EstimateInfo\n {{#RO.estimate.estimateType}}EstimateType="{{RO.estimate.estimateType}}"{{/RO.estimate.estimateType}}\n />\n {{/RO.estimate}}\n\n {{#RO.tax}}\n <TaxCodeInfo\n {{#RO.tax.payType}}PayType="{{RO.tax.payType}}"{{/RO.tax.payType}}\n {{#RO.tax.taxCode}}TaxCode="{{RO.tax.taxCode}}"{{/RO.tax.taxCode}}\n {{#RO.tax.txblGrossAmt}}TxblGrossAmt="{{RO.tax.txblGrossAmt}}"{{/RO.tax.txblGrossAmt}}\n {{#RO.tax.grossTaxAmt}}GrossTaxAmt="{{RO.tax.grossTaxAmt}}"{{/RO.tax.grossTaxAmt}}\n />\n {{/RO.tax}}\n </Rogen>\n\n {{#RO.rolabor}}\n <Rolabor>\n {{#RO.rolabor.ops}}\n <OpCodeLaborInfo\n {{#opCode}}OpCode="{{opCode}}"{{/opCode}}\n {{#jobNo}}JobNo="{{jobNo}}"{{/jobNo}}\n {{#custPayTypeFlag}}CustPayTypeFlag="{{custPayTypeFlag}}"{{/custPayTypeFlag}}\n {{#warrPayTypeFlag}}WarrPayTypeFlag="{{warrPayTypeFlag}}"{{/warrPayTypeFlag}}\n {{#intrPayTypeFlag}}IntrPayTypeFlag="{{intrPayTypeFlag}}"{{/intrPayTypeFlag}}\n {{#custTxblNtxblFlag}}CustTxblNTxblFlag="{{custTxblNtxblFlag}}"{{/custTxblNtxblFlag}}\n {{#warrTxblNtxblFlag}}WarrTxblNTxblFlag="{{warrTxblNtxblFlag}}"{{/warrTxblNtxblFlag}}\n {{#intrTxblNtxblFlag}}IntrTxblNTxblFlag="{{intrTxblNtxblFlag}}"{{/intrTxblNtxblFlag}}\n {{#vlrCode}}VLRCode="{{vlrCode}}"{{/vlrCode}}\n >\n {{#bill}}\n <BillTimeRateHrs\n {{#payType}}PayType="{{payType}}"{{/payType}}\n {{#jobTotalHrs}}JobTotalHrs="{{jobTotalHrs}}"{{/jobTotalHrs}}\n {{#billTime}}BillTime="{{billTime}}"{{/billTime}}\n {{#billRate}}BillRate="{{billRate}}"{{/billRate}}\n />\n {{/bill}}\n\n {{#ccc}}\n <CCCStmts\n {{#cause}}Cause="{{cause}}"{{/cause}}\n {{#complaint}}Complaint="{{complaint}}"{{/complaint}}\n {{#correction}}Correction="{{correction}}"{{/correction}}\n />\n {{/ccc}}\n\n {{#amount}}\n <RoAmts\n {{#payType}}PayType="{{payType}}"{{/payType}}\n {{#amtType}}AmtType="{{amtType}}"{{/amtType}}\n {{#custPrice}}CustPrice="{{custPrice}}"{{/custPrice}}\n {{#totalAmt}}TotalAmt="{{totalAmt}}"{{/totalAmt}}\n />\n {{/amount}}\n </OpCodeLaborInfo>\n {{/RO.rolabor.ops}}\n </Rolabor>\n {{/RO.rolabor}}\n\n {{#RO.ropart}}\n <Ropart>\n {{#RO.ropart.jobs}}\n <PartInfoByJob\n {{#opCode}}OpCode="{{opCode}}"{{/opCode}}\n {{#jobNo}}JobNo="{{jobNo}}"{{/jobNo}}\n >\n {{#lines}}\n <OSDPartDetail\n {{#partNo}}PartNo="{{partNo}}"{{/partNo}}\n {{#partNoDesc}}PartNoDesc="{{partNoDesc}}"{{/partNoDesc}}\n {{#qtyOrd}}QtyOrd="{{qtyOrd}}"{{/qtyOrd}}\n {{#sale}}Sale="{{sale}}"{{/sale}}\n {{#cost}}Cost="{{cost}}"{{/cost}}\n {{#addDeleteFlag}}AddDeleteFlag="{{addDeleteFlag}}"{{/addDeleteFlag}}\n />\n {{/lines}}\n </PartInfoByJob>\n {{/RO.ropart.jobs}}\n </Ropart>\n {{/RO.ropart}}\n\n {{#RO.rogg}}\n <Rogog {{#RO.rogg.roNo}}RoNo="{{RO.rogg.roNo}}"{{/RO.rogg.roNo}}>\n {{#RO.rogg.ops}}\n <AllGogOpCodeInfo\n {{#opCode}}OpCode="{{opCode}}"{{/opCode}}\n {{#jobNo}}JobNo="{{jobNo}}"{{/jobNo}}\n >\n {{#lines}}\n <AllGogLineItmInfo\n {{#breakOut}}BreakOut="{{breakOut}}"{{/breakOut}}\n {{#itemType}}ItemType="{{itemType}}"{{/itemType}}\n {{#itemDesc}}ItemDesc="{{itemDesc}}"{{/itemDesc}}\n {{#custQty}}CustQty="{{custQty}}"{{/custQty}}\n {{#warrQty}}WarrQty="{{warrQty}}"{{/warrQty}}\n {{#intrQty}}IntrQty="{{intrQty}}"{{/intrQty}}\n {{#custPayTypeFlag}}CustPayTypeFlag="{{custPayTypeFlag}}"{{/custPayTypeFlag}}\n {{#warrPayTypeFlag}}WarrPayTypeFlag="{{warrPayTypeFlag}}"{{/warrPayTypeFlag}}\n {{#intrPayTypeFlag}}IntrPayTypeFlag="{{intrPayTypeFlag}}"{{/intrPayTypeFlag}}\n {{#custTxblNtxblFlag}}CustTxblNTxblFlag="{{custTxblNtxblFlag}}"{{/custTxblNtxblFlag}}\n {{#warrTxblNtxblFlag}}WarrTxblNTxblFlag="{{warrTxblNtxblFlag}}"{{/warrTxblNtxblFlag}}\n {{#intrTxblNtxblFlag}}IntrTxblNTxblFlag="{{intrTxblNtxblFlag}}"{{/intrTxblNtxblFlag}}\n >\n {{#amount}}\n <RoAmts\n {{#payType}}PayType="{{payType}}"{{/payType}}\n {{#amtType}}AmtType="{{amtType}}"{{/amtType}}\n {{#custPrice}}CustPrice="{{custPrice}}"{{/custPrice}}\n {{#totalAmt}}TotalAmt="{{totalAmt}}"{{/totalAmt}}\n {{#dlrCost}}DlrCost="{{dlrCost}}"{{/dlrCost}}\n />\n {{/amount}}\n </AllGogLineItmInfo>\n {{/lines}}\n </AllGogOpCodeInfo>\n {{/RO.rogg.ops}}\n </Rogog>\n {{/RO.rogg}}\n\n {{#RO.romisc}}\n <Romisc {{#RO.romisc.roNo}}RoNo="{{RO.romisc.roNo}}"{{/RO.romisc.roNo}}>\n {{#RO.romisc.ops}}\n <MiscOpCodeInfo\n {{#opCode}}OpCode="{{opCode}}"{{/opCode}}\n {{#jobNo}}JobNo="{{jobNo}}"{{/jobNo}}\n >\n {{#lines}}\n <MiscLineItmInfo\n {{#miscCode}}MiscCode="{{miscCode}}"{{/miscCode}}\n {{#custPayTypeFlag}}CustPayTypeFlag="{{custPayTypeFlag}}"{{/custPayTypeFlag}}\n {{#warrPayTypeFlag}}WarrPayTypeFlag="{{warrPayTypeFlag}}"{{/warrPayTypeFlag}}\n {{#intrPayTypeFlag}}IntrPayTypeFlag="{{intrPayTypeFlag}}"{{/intrPayTypeFlag}}\n {{#custTxblNtxblFlag}}CustTxblNTxblFlag="{{custTxblNtxblFlag}}"{{/custTxblNtxblFlag}}\n {{#warrTxblNtxblFlag}}WarrTxblNTxblFlag="{{warrTxblNtxblFlag}}"{{/warrTxblNtxblFlag}}\n {{#intrTxblNtxblFlag}}IntrTxblNTxblFlag="{{intrTxblNtxblFlag}}"{{/intrTxblNtxblFlag}}\n {{#codeAmt}}CodeAmt="{{codeAmt}}"{{/codeAmt}}\n />\n {{/lines}}\n </MiscOpCodeInfo>\n {{/RO.romisc.ops}}\n </Romisc>\n {{/RO.romisc}}\n </RoRecord>\n</rey_RomeUpdateBSMRepairOrderReq>\n',{ApplicationArea:r,RO:t}),routing:a.routing,envelope:d,postParse:P,xsdFilename:"rey_RomeUpdateBSMRepairOrderReq.xsd",elementName:"rey_RomeUpdateBSMRepairOrderReq"}}(o,a))}async getParts(o,a){return this._send(function(o={},a={}){const t=o.roNumber?String(o.roNumber).trim():void 0;if(!t)throw new K("getParts: roNumber required");const d=e({routing:a.routing,sender:{component:"Rome",task:"RCT",referenceId:"Query",creator:"RCI",senderName:"RCI"}});return{starXml:L.render('\n<rey_RomeGetPartsReq xmlns="http://www.starstandards.org/STAR" revision="1.0">\n {{{ApplicationArea}}}\n <RoInfo RoNumber="{{RoNumber}}"/>\n</rey_RomeGetPartsReq>\n',{ApplicationArea:d,RoNumber:t}),routing:a.routing,envelope:a.envelope,xsdFilename:"rey_RomeGetPartsReq.xsd",elementName:"rey_RomeGetPartsReq",postParse:e=>function(e){return e?.rey_RomeGetPartsResp?.RoParts?.map(e=>({partNumber:M(e,"PartNumber"),partDescription:M(e,"PartDescription"),quantityOrdered:M(e,"QuantityOrdered"),quantityShipped:M(e,"QuantityShipped"),price:M(e,"Price"),cost:M(e,"Cost"),processedFlag:M(e,"ProcessedFlag"),addOrDelete:M(e,"AddOrDelete")}))||[]}(e)}}(o,a))}}const ee=[{code:"A1",display:"Anker Craft"},{code:"A2",display:"Autocar"},{code:"A3",display:"Angler"},{code:"A4",display:"Automotive Rebuilders"},{code:"A5",display:"Alphenite"},{code:"A6",display:"Aerbus"},{code:"A7",display:"Aerolite"},{code:"A8",display:"American Star"},{code:"A9",display:"Aristocrat"},{code:"AA",display:"Alumalite"},{code:"AB",display:"Aurora"},{code:"AC",display:"Acura"},{code:"ACG",display:"American Custom Golf Cars"},{code:"ACP",display:"Keystone"},{code:"ACS",display:"Access (motor home)"},{code:"AD",display:"Aro"},{code:"AD6",display:"Anderson 6 Ton Trailer"},{code:"ADL",display:"Admiral (motor home)"},{code:"ADM",display:"Adam Trailers"},{code:"ADT",display:"Advantage Trailer"},{code:"ADV",display:"Adventurous"},{code:"ADY",display:"Adly"},{code:"AE",display:"Aeromat"},{code:"AF",display:"Alfa"},{code:"AG",display:"AM General"},{code:"AH",display:"American Coach"},{code:"AI",display:"Airstream"},{code:"AJ",display:"Aljo"},{code:"AK",display:"Arrow"},{code:"AL",display:"Allegro"},{code:"ALB",display:"Albemarle"},{code:"ALI",display:"Alliance RV"},{code:"ALO",display:"Aoha (boat)"},{code:"ALS",display:"Alumascape (travel trailer)"},{code:"ALU",display:"Aluma (trailer)"},{code:"AM",display:"American Motors"},{code:"AMC",display:"Ameri-Camp (trailer)"},{code:"AN",display:"American by Cobra"},{code:"AO",display:"Apollo"},{code:"AP",display:"Alphine Light"},{code:"APP",display:"Appalachian"},{code:"AQ",display:"Augusta (airplane)"},{code:"AR",display:"Alfa Romeo"},{code:"ARG",display:"Argo"},{code:"AS",display:"Aston Martin"},{code:"ASP",display:"Aspect (motor home)"},{code:"ASV",display:"ASV"},{code:"AT",display:"Arctic Cat (ATV)"},{code:"AU",display:"Audi"},{code:"AUG",display:"Augusta (RV)"},{code:"AUW",display:"Autowares"},{code:"AV",display:"Avanti"},{code:"AVN",display:"Adventurer (motor home)"},{code:"AW",display:"Atwood"},{code:"AX",display:"Airex"},{code:"AY",display:"American Flyer"},{code:"AZ",display:"Avion"},{code:"AZU",display:"AZURE (boats)"},{code:"AZZ",display:"Avalanche"},{code:"B1",display:"Starcraft Motor Home"},{code:"B2",display:"Bicycle"},{code:"B3",display:"Big Foot"},{code:"B4",display:"Brockway Truck"},{code:"B5",display:"Beaver"},{code:"B6",display:"Shelby"},{code:"B7",display:"American Eagle"},{code:"B8",display:"Bluebird (bus)"},{code:"B9",display:"Budd Trailer"},{code:"BA",display:"Baron"},{code:"BAC",display:"Briggs Automotive Company"},{code:"BAY",display:"Bayridge"},{code:"BB",display:"Southland Rebuilders"},{code:"BBR",display:"Big Bear (motorcycle)"},{code:"BC",display:"BMW Motorcycles"},{code:"BCR",display:"Braxton Creek"},{code:"BCT",display:"Back Country"},{code:"BD",display:"Snowbird"},{code:"BE",display:"Bentley"},{code:"BEE",display:"Bee (trailer)"},{code:"BF",display:"BMW Sav"},{code:"BFE",display:"Bedford"},{code:"BG",display:"Bering Truck"},{code:"BGC",display:"Big Country (RV)"},{code:"BGH",display:"Big Horn (RV)"},{code:"BGM",display:"Barnes Distribution General Motors Dealer Equipment (GMDE)"},{code:"BGS",display:"Big Sky"},{code:"BH",display:"Boston Whaler"},{code:"BIN",display:"Bintelli"},{code:"BJ",display:"Baja"},{code:"BK",display:"Baretta (boat)"},{code:"BKN",display:"Bricklin"},{code:"BKS",display:"Black Series"},{code:"BL",display:"Bolens"},{code:"BLD",display:"Black Diamond (travel trailer)"},{code:"BLI",display:"Blizzard Manufacturing"},{code:"BLR",display:"Black Rock"},{code:"BLZ",display:"Blazer"},{code:"BM",display:"BMW"},{code:"BMC",display:"Belmont Machine (trailer)"},{code:"BN",display:"Bonnavilla"},{code:"BNC",display:"Bennche ATV"},{code:"BO",display:"Bounder"},{code:"BOB",display:"Bobcat"},{code:"BOL",display:"Bollinger Motors"},{code:"BOS",display:"Boss Hoss (motorcycle)"},{code:"BP",display:"BrightDrop"},{code:"BQ",display:"Bear Trailer"},{code:"BR",display:"Basstream"},{code:"BRK",display:"Brinkley RV"},{code:"BRS",display:"Branson"},{code:"BRU",display:"Brutus"},{code:"BRY",display:"Bryant Boats"},{code:"BS",display:"Bass Tracker"},{code:"BSP",display:"Boss Snow Plows"},{code:"BT",display:"Bertone"},{code:"BTK",display:"Buick Truck (truck)"},{code:"BU",display:"Buick"},{code:"BUG",display:"Bugatti (automobile)"},{code:"BV",display:"Beaver Coach"},{code:"BVO",display:"Bravo (electric vehicle)"},{code:"BW",display:"Bowman"},{code:"BX",display:"Boulton (power boat)"},{code:"BY",display:"Bayliner"},{code:"BZ",display:"Automate"},{code:"BZZ",display:"Berkshire"},{code:"C1",display:"Colt"},{code:"C2",display:"Companion"},{code:"C3",display:"Crestliner Boat"},{code:"C4",display:"Cobra"},{code:"C5",display:"Cordova"},{code:"C6",display:"Cruise Air"},{code:"C7",display:"Chief"},{code:"C8",display:"Challenger"},{code:"C9",display:"Conquest"},{code:"CA",display:"Caterpillar"},{code:"CAL",display:"Carrlite (Camper)"},{code:"CAM",display:"C&M"},{code:"CAZ",display:"Cazador"},{code:"CB",display:"Chalet Pop"},{code:"CC",display:"Citation"},{code:"CCI",display:"Cruise Car Inc."},{code:"CCL",display:"CT Coachworks LLC (RV)"},{code:"CD",display:"Cadillac"},{code:"CDA",display:"Coda"},{code:"CDR",display:"Crusader"},{code:"CE",display:"Chateau"},{code:"CEN",display:"Centurian"},{code:"CF",display:"Capri"},{code:"CFM",display:"CFMOTO"},{code:"CG",display:"Camplight"},{code:"CGM",display:"Campagna Motors"},{code:"CH",display:"Chrysler"},{code:"CHA",display:"Chariot (RV)"},{code:"CHI",display:"Chironex"},{code:"CIT",display:"Citroen"},{code:"CJ",display:"Coronado"},{code:"CJA",display:"CJAY"},{code:"CK",display:"Chinook"},{code:"CKM",display:"Checkmate"},{code:"CL",display:"Chilton Trailers"},{code:"CM",display:"Coachment"},{code:"CMR",display:"Cimarron"},{code:"CMT",display:"CM Trailers"},{code:"CN",display:"Catalina"},{code:"CNA",display:"CAN-AM (ATV)"},{code:"CNC",display:"C&C (horse trailer)"},{code:"CNQ",display:"Chongquing"},{code:"CO",display:"Coleman"},{code:"CP",display:"Champion"},{code:"CPN",display:"Capone (motorcycle)"},{code:"CQ",display:"Curtis Industries"},{code:"CR",display:"Cavalier Motor Home"},{code:"CRC",display:"Cricket Cart"},{code:"CRD",display:"Carado RV"},{code:"CRS",display:"Creek Side"},{code:"CRU",display:"Cruiser RV"},{code:"CRV",display:"Carver (boat)"},{code:"CS",display:"Circle J"},{code:"CSE",display:"Case"},{code:"CT",display:"Chevrolet Truck"},{code:"CTR",display:"Citecar"},{code:"CU",display:"Cummins"},{code:"CV",display:"Chevrolet"},{code:"CW",display:"Chevrolet"},{code:"CX",display:"Chapparal"},{code:"CY",display:"Celebrity"},{code:"CYA",display:"Cyclone (RV)"},{code:"CYC",display:"Cyclone"},{code:"CZ",display:"Chris Craft"},{code:"CZY",display:"Cozy Traveler"},{code:"D1",display:"Dorsey Trailer"},{code:"D2",display:"Conestoga"},{code:"D3",display:"Dreamer (5th wheel trailer)"},{code:"D4",display:"Diplomat (RV)"},{code:"D5",display:"Daewoo"},{code:"D6",display:"Ducati (motorcycle)"},{code:"D7",display:"Desperado"},{code:"D8",display:"Donzi"},{code:"D9",display:"Surf Side"},{code:"DA",display:"Daihatsu"},{code:"DAL",display:"Dallara"},{code:"DB",display:"Dazon (scooter)"},{code:"DC",display:"Cherokee"},{code:"DCM",display:"Dixie Chopper (motorcycle)"},{code:"DD",display:"Detroit Diesel"},{code:"DE",display:"Delorean"},{code:"DF",display:"Desert Fox (RV)"},{code:"DFN",display:"Defender"},{code:"DG",display:"SDG (scooter)"},{code:"DH",display:"Dynasty"},{code:"DI",display:"Discovery"},{code:"DIA",display:"Diamondback"},{code:"DIS",display:"Discover Canada"},{code:"DIV",display:"Dively"},{code:"DJ",display:"Doubletree (trailer)"},{code:"DK",display:"Duracraft (boat)"},{code:"DL",display:"Dolphin"},{code:"DLT",display:"Delta (Utility and Horse trailer)"},{code:"DM",display:"Damon"},{code:"DN",display:"Dunes Trailer"},{code:"DO",display:"Dodge"},{code:"DP",display:"Dutch Pop"},{code:"DQ",display:"Double Tree (RV)"},{code:"DR",display:"Dutch Star"},{code:"DRX",display:"Duruxx"},{code:"DS",display:"Datsun"},{code:"DT",display:"Dodge Truck"},{code:"DTM",display:"De Tomaso"},{code:"DTR",display:"Dump Trailer"},{code:"DU",display:"Dutchmen"},{code:"DUR",display:"Duroboat (boat)"},{code:"DV",display:"Dodge Van"},{code:"DW",display:"Sundowner (trailer)"},{code:"DX",display:"Dynamax"},{code:"DY",display:"Daybreak"},{code:"DYM",display:"Dymac (electric vehicle)"},{code:"DYQ",display:"Dynaquest (motor home)"},{code:"DZ",display:"Century"},{code:"E1",display:"Exiss (trailer)"},{code:"E2",display:"Bumble Bee"},{code:"E3",display:"American Trailer"},{code:"E4",display:"Clenet"},{code:"E5",display:"Coyote"},{code:"E6",display:"E-Ton"},{code:"E7",display:"Excursion (RV)"},{code:"E8",display:"Everest (RV)"},{code:"E9",display:"Chateausport"},{code:"EA",display:"Eagle"},{code:"EAR",display:"Earthbound RV"},{code:"EB",display:"Electric Bicycle"},{code:"EBB",display:"Ebbtide"},{code:"EC",display:"Executive"},{code:"ECH",display:"ECHO (ATV/util trailer)"},{code:"ECO",display:"Eco"},{code:"ED",display:"Emerald (boat)"},{code:"EDG",display:"Edge"},{code:"EE",display:"Excell (cargo trailer)"},{code:"EEE",display:"Triple E"},{code:"EF",display:"Georgetown"},{code:"EG",display:"EV Global Motors"},{code:"EGO",display:"EGO"},{code:"EH",display:"Easy Hauler"},{code:"EI",display:"express (boat)"},{code:"EJ",display:"E-Z-Go (golf cart)"},{code:"EK",display:"Elkhorn"},{code:"EL",display:"Eldorado"},{code:"ELA",display:"Electra (RV)"},{code:"ELM",display:"ELectric Last Mile Solutions Inc."},{code:"ELS",display:"Elite Suite (travel trailer)"},{code:"EM",display:"Monon"},{code:"EM",display:"Ember RV"},{code:"EN",display:"Encounter (RV)"},{code:"ENC",display:"Encore RV"},{code:"ENT",display:"Entegra RV"},{code:"ENU",display:"Endura RV"},{code:"EO",display:"Aerostar (RV)"},{code:"EP",display:"Expedition"},{code:"EPC",display:"Epic"},{code:"EQ",display:"Elite Trailer"},{code:"EQS",display:"Equispirit"},{code:"ER",display:"Raven"},{code:"ES",display:"Establishment"},{code:"ESP",display:"Eurospeed"},{code:"ET",display:"Eagle Trailer"},{code:"ETW",display:"East to West"},{code:"EU",display:"Ultra Sport"},{code:"EV",display:"Evinrude"},{code:"EVG",display:"Evergreen RV"},{code:"EVL",display:"Evolution RV"},{code:"EW",display:"EV Warrior"},{code:"EX",display:"Excalibur"},{code:"EXP",display:"Explorer (motor home)"},{code:"EY",display:"Windsong"},{code:"EZ",display:"EZ Loader"},{code:"EZG",display:"EZ GO"},{code:"EZL",display:"Ezloader (trailer)"},{code:"EZZ",display:"Elipse"},{code:"F1",display:"Flair"},{code:"F2",display:"Fold Down"},{code:"F3",display:"Flagstaff"},{code:"F4",display:"Four Seasons"},{code:"F5",display:"Fishrite"},{code:"F6",display:"4-Star (trailer)"},{code:"F7",display:"Formula"},{code:"F8",display:"Fountain"},{code:"F9",display:"Fisher"},{code:"FA",display:"Falcon"},{code:"FB",display:"Fireball (RV)"},{code:"FBC",display:"Fibro Concept"},{code:"FC",display:"Ford Commerical"},{code:"FD",display:"Ford HD Truck"},{code:"FE",display:"Ferrari"},{code:"FED",display:"Federal"},{code:"FF",display:"Fruehauf Trailer"},{code:"FG",display:"Firan (RV)"},{code:"FH",display:"Featherlite (trailer)"},{code:"FI",display:"Fiat"},{code:"FIS",display:"Fisker"},{code:"FJ",display:"Fred Jones"},{code:"FK",display:"Fifth Avenue (RV)"},{code:"FL",display:"Fleetwood (RV)"},{code:"FLO",display:"Floe (trailer)"},{code:"FM",display:"Fiberform"},{code:"FN",display:"Fan"},{code:"FNL",display:"Finish Line"},{code:"FNM",display:"Funmover"},{code:"FO",display:"Ford"},{code:"FOP",display:"Ford of Puerto Rico"},{code:"FOR",display:"Forester (motor home)"},{code:"FOX",display:"Fox Mountain RV"},{code:"FP",display:"Ford Racing Technologies"},{code:"FQ",display:"Forest River (trailer)"},{code:"FR",display:"Freightliner"},{code:"FS",display:"Fiesta"},{code:"FT",display:"Ford Truck"},{code:"FU",display:"Frontier (RV)"},{code:"FUR",display:"Fusion"},{code:"FUS",display:"Fuso"},{code:"FUT",display:"Futura"},{code:"FV",display:"Forest River"},{code:"FW",display:"Ford Wind"},{code:"FX",display:"Four Winns"},{code:"FY",display:"Felling (trailer)"},{code:"FZ",display:"Foretravel (RV)"},{code:"G1",display:"Gindy Trailer"},{code:"G2",display:"Glastron"},{code:"G3",display:"Brown Trailer"},{code:"G4",display:"Bass Cat"},{code:"G5",display:"Generation"},{code:"G6",display:"Morgan Trailers"},{code:"G7",display:"Glacier Bay"},{code:"G8",display:"Global Electric Motorcars"},{code:"G9",display:"Capacity"},{code:"GA",display:"Great Dane Trailer"},{code:"GAR",display:"Garia"},{code:"GB",display:"Georgie Boy (RV)"},{code:"GC",display:"GMC"},{code:"GCH",display:"Grech RV"},{code:"GCI",display:"Greenkraft Inc."},{code:"GD",display:"GPD - East"},{code:"GE",display:"Geo"},{code:"GEC",display:"General Coach"},{code:"GEN",display:"Hyundai"},{code:"GES",display:"Genesis Supreme RV"},{code:"GF",display:"Glendale"},{code:"GG",display:"Cameo Carriage (RV)"},{code:"GH",display:"Macgregor (sailboat)"},{code:"GI",display:"Carriage (RV)"},{code:"GJ",display:"Stellar (travel trailer)"},{code:"GJN",display:"Grand Junction"},{code:"GK",display:"Gekko"},{code:"GL",display:"Gambler"},{code:"GN",display:"Generac"},{code:"GO",display:"Grumman"},{code:"GOR",display:"Gorilla"},{code:"GP",display:"GPD - West"},{code:"GQ",display:"Trailerman (trailer)"},{code:"GR",display:"Gravely"},{code:"GRD",display:"Grand Design RV"},{code:"GS",display:"Gulfstream"},{code:"GST",display:"Grandsport (motor home)"},{code:"GT",display:"Geo Truck"},{code:"GU",display:"Malaguti (motorcycle)"},{code:"GV",display:"Godfrey (boat)"},{code:"GW",display:"White GMC Truck"},{code:"GX",display:"Great West"},{code:"GY",display:"Gindy Trailer"},{code:"GZ",display:"Gazelle"},{code:"H1",display:"Hurricane"},{code:"H2",display:"Honey"},{code:"H3",display:"Heil Trailer"},{code:"H4",display:"Coach House (RV)"},{code:"H5",display:"Harney Coachworks"},{code:"H6",display:"Hawk"},{code:"H7",display:"Hydrocat"},{code:"H8",display:"Haulmark (RV)"},{code:"H9",display:"Holmes (trailer)"},{code:"HA",display:"Hi-Light"},{code:"HAT",display:"Honda ATV"},{code:"HAU",display:"Haulin Trailer"},{code:"HB",display:"Husaberg"},{code:"HBU",display:"Hitch Buddy (towing unit)"},{code:"HC",display:"Hornet"},{code:"HD",display:"Harley Davidson"},{code:"HDO",display:"Hideout"},{code:"HE",display:"Hummer"},{code:"HF",display:"Harney Co. Operations"},{code:"HG",display:"Heritage"},{code:"HH",display:"Hino"},{code:"HHT",display:"H&H Trailer"},{code:"HI",display:"Hilo"},{code:"HJ",display:"New Holland (tractor)"},{code:"HK",display:"Hitckhiker"},{code:"HL",display:"Honda"},{code:"HLR",display:"Haul Rite"},{code:"HM",display:"Honda Motorcycle"},{code:"HMD",display:"Homemade"},{code:"HMS",display:"Homestead"},{code:"HMV",display:"Honda Multipurpose Utility Vehicle"},{code:"HN",display:"Honda Motorcycle"},{code:"HO",display:"Honda"},{code:"HOL",display:"Holland Trailer"},{code:"HOS",display:"Hoosier"},{code:"HP",display:"Honda"},{code:"HQ",display:"Hy-Line (trailer)"},{code:"HR",display:"Holiday Rambler"},{code:"HRG",display:"Highland Ridge"},{code:"HS",display:"Hydra-Sport Boats"},{code:"HSN",display:"Hisun"},{code:"HT",display:"Honda Truck"},{code:"HTG",display:"Hartland Greystone"},{code:"HTI",display:"Hitachi"},{code:"HU",display:"Husqvarna"},{code:"HUL",display:"Hull"},{code:"HV",display:"Hummer (GM Vehicle)"},{code:"HW",display:"Hawker (airplane)"},{code:"HWN",display:"Huawin"},{code:"HX",display:"Hewes (boat)"},{code:"HY",display:"Hyundai"},{code:"HYM",display:"Hymer"},{code:"HYO",display:"Hyosung Motors"},{code:"HYP",display:"Hyundai of Puerto Rico (automobile)"},{code:"HZ",display:"Horizon"},{code:"I2",display:"Clark Industrial Truck"},{code:"I3",display:"Royal International (RV)"},{code:"I4",display:"Mida Motorhome (RV)"},{code:"I5",display:"Independence (motorcycle)"},{code:"I6",display:"Sportsmaster"},{code:"I7",display:"Extreme Mega Lite (RV)"},{code:"I8",display:"Legends"},{code:"I9",display:"Pilgrim Lite (RV)"},{code:"IA",display:"Itasca"},{code:"IB",display:"Big Dog"},{code:"IC",display:"Camper"},{code:"ICA",display:"ICAMP (trailer)"},{code:"ICN",display:"Icon"},{code:"ID",display:"Indian"},{code:"IE",display:"Interstate Trailer"},{code:"IF",display:"Itasca-C"},{code:"IG",display:"Itasca-Diesel"},{code:"IH",display:"American Iron Horse"},{code:"IJ",display:"Italjet USA"},{code:"IK",display:"Innsbruck (RV)"},{code:"IL",display:"International"},{code:"IM",display:"Impulse"},{code:"IMT",display:"Iron Mountain"},{code:"IN",display:"Infiniti"},{code:"INT",display:"InTech"},{code:"INV",display:"INV1"},{code:"IO",display:"Isata (motor home)"},{code:"IP",display:"International Powersports"},{code:"IQ",display:"Sceptor (RV)"},{code:"IR",display:"Invader"},{code:"IRH",display:"Iron Horse (boat)"},{code:"IS",display:"Isuzu"},{code:"ISP",display:"Imperial Supplies"},{code:"IT",display:"Isuzu Truck"},{code:"IU",display:"Skamper Ultra (RV)"},{code:"IV",display:"Iveco"},{code:"IW",display:"W-W (trailer)"},{code:"IX",display:"Maxlite (RV)"},{code:"IY",display:"Infinity (motor home)"},{code:"IZ",display:"Zepplin (RV)"},{code:"J1",display:"Johnson (boat)"},{code:"J2",display:"Charger"},{code:"J3",display:"Charmac"},{code:"J4",display:"Jazz (motor home)"},{code:"J5",display:"Jet Trailer"},{code:"J6",display:"Tiffin (RV)"},{code:"J7",display:"JV Manufacturing (trailer)"},{code:"J8",display:"Rebel (RV)"},{code:"J9",display:"Estate (RV)"},{code:"JA",display:"Jaguar"},{code:"JB",display:"Jamboree"},{code:"JC",display:"Jetcraft"},{code:"JCL",display:"JCL"},{code:"JD",display:"John Deere"},{code:"JE",display:"Jeep"},{code:"JF",display:"Forklift (Forklift, generic)"},{code:"JG",display:"Tail-Gator (RV)"},{code:"JH",display:"Jensen-HL"},{code:"JI",display:"J.I. Case"},{code:"JJ",display:"Attitude (RV)"},{code:"JK",display:"Timberlodge (RV)"},{code:"JL",display:"Javelin"},{code:"JM",display:"Jamee"},{code:"JN",display:"Tuscany (RV)"},{code:"JNP",display:"Johnnypag (motorcycle)"},{code:"JO",display:"Sandstorm (RV)"},{code:"JP",display:"Jag (scooter)"},{code:"JQ",display:"QianJiang (scooter)"},{code:"JR",display:"Jerrdan"},{code:"JRN",display:"Journey (motor home)"},{code:"JS",display:"S&S Campers"},{code:"JT",display:"Jeep Truck"},{code:"JU",display:"Trailrider (RV)"},{code:"JV",display:"JVS (ATV)"},{code:"JW",display:"Willy (Jeep Vehicle)"},{code:"JX",display:"Extreme RV (RV)"},{code:"JY",display:"Jayco"},{code:"K-Z",display:"K-Z (trailer)"},{code:"K1",display:"Kia"},{code:"K2",display:"Kidron Trailer"},{code:"K3",display:"Kountry Comfort"},{code:"K4",display:"KTM"},{code:"K5",display:"Kountry Star"},{code:"K6",display:"Kenner"},{code:"K7",display:"Key West"},{code:"K8",display:"Kasea (minibikes)"},{code:"K9",display:"TM"},{code:"KA",display:"Kawasaki"},{code:"KAK",display:"K&K (trailer)"},{code:"KAL",display:"Kalmar Ottawa"},{code:"KAR",display:"Karma"},{code:"KAY",display:"Kayo"},{code:"KB",display:"Kubota (tractor)"},{code:"KC",display:"Cato"},{code:"KD",display:"Kodiak"},{code:"KDK",display:"Kaddy Kruiser"},{code:"KDN",display:"Kendon"},{code:"KE",display:"Skeeter"},{code:"KEV",display:"Kia EV"},{code:"KEY",display:"Keystone Autoway"},{code:"KF",display:"Kiefer (trailer)"},{code:"KG",display:"Kar Products"},{code:"KH",display:"Kachina"},{code:"KI",display:"Kit"},{code:"KIM",display:"Kimble (trailer)"},{code:"KIO",display:"Kioti"},{code:"KJ",display:"Cajun"},{code:"KK",display:"Carrera Boots"},{code:"KL",display:"Kymco (motor scooter)"},{code:"KM",display:"Komfort"},{code:"KMS",display:"Komatsu"},{code:"KMW",display:"Kimball Midwest"},{code:"KN",display:"Kountry Aire"},{code:"KND",display:"Kandi"},{code:"KNP",display:"Knapheide"},{code:"KO",display:"Koremoto (motorcycle)"},{code:"KOE",display:"Koenigsegg"},{code:"KP",display:"Composite"},{code:"KQ",display:"KZ Inc. (RV)"},{code:"KR",display:"King of the Road"},{code:"KRI",display:"Kristi (trailer)"},{code:"KRY",display:"Krystal (motor home)"},{code:"KS",display:"Kwikee Step"},{code:"KT",display:"Karavan Trailers"},{code:"KU",display:"Kent Automotive (parts master)"},{code:"KV",display:"Knight (RV)"},{code:"KW",display:"Kenworth/Peterbilt"},{code:"KWK",display:"Kwik Load"},{code:"KX",display:"Cross Country (RV)"},{code:"KY",display:"Keystone"},{code:"KYN",display:"Keystone Northpark"},{code:"KYV",display:"Keystone Vantage"},{code:"KZ",display:"Kells (sailboat)"},{code:"L1",display:"Lake Raider (RV)"},{code:"L2",display:"Load Trailer"},{code:"L3",display:"Limited"},{code:"L4",display:"Lincoln Truck"},{code:"L5",display:"Laredo"},{code:"L6",display:"Landau (boat)"},{code:"L7",display:"Laforza"},{code:"L8",display:"Lexington (motor home)"},{code:"L9",display:"Leprechaun (RV)"},{code:"LA",display:"Lancia"},{code:"LB",display:"Lawn Boy"},{code:"LBT",display:"Lambretta"},{code:"LBX",display:"Link Belt Excavators"},{code:"LC",display:"Collins (RV)"},{code:"LD",display:"Lazy Days"},{code:"LE",display:"Lexus"},{code:"LF",display:"Laforze"},{code:"LG",display:"Cross Lander (Brazil car)"},{code:"LGC",display:"Logan Coach"},{code:"LH",display:"Shore Land'r"},{code:"LI",display:"Lincoln"},{code:"LIB",display:"Liberty Outdoors"},{code:"LID",display:"Lider"},{code:"LJ",display:"Loadrite (trailer)"},{code:"LK",display:"Lufkin"},{code:"LKA",display:"Lakota"},{code:"LL",display:"Lear (airplane)"},{code:"LM",display:"Lamborghini"},{code:"LN",display:"Lance"},{code:"LND",display:"Landini"},{code:"LNH",display:"Linhai"},{code:"LNM",display:"LandMark RV"},{code:"LO",display:"Lotus"},{code:"LP",display:"Lawson Products (factory master)"},{code:"LQ",display:"Qvale"},{code:"LR",display:"Land Rover"},{code:"LRV",display:"Lifestyle Luxury RV"},{code:"LS",display:"Larson"},{code:"LSF",display:"Leisure Freedom"},{code:"LST",display:"LS Tractor"},{code:"LT",display:"Leland Trailers"},{code:"LTG",display:"Little Guy"},{code:"LTR",display:"Little River"},{code:"LU",display:"Lund"},{code:"LUC",display:"LUCID"},{code:"LV",display:"Leisure Van"},{code:"LW",display:"Lowe"},{code:"LX",display:"Las Brisas"},{code:"LY",display:"Layton"},{code:"LZ",display:"Lifan (motorcycle scooter)"},{code:"M1",display:"Moutainaire"},{code:"M2",display:"Mastercraft"},{code:"M3",display:"Mirage"},{code:"M4",display:"Marmon"},{code:"M5",display:"Monterey"},{code:"M6",display:"Mako"},{code:"M7",display:"Montana"},{code:"M8",display:"Mercedes Light Truck"},{code:"M9",display:"Malibu"},{code:"MA",display:"Mazda"},{code:"MAC",display:"Maclander"},{code:"MAD",display:"Midwest Automotive Design"},{code:"MAF",display:"Massey Ferguson (tractor/truck)"},{code:"MAG",display:"MAG (truck & van)"},{code:"MAH",display:"Mahindra"},{code:"MAR",display:"Marada (boat)"},{code:"MAS",display:"MASEA (scooter)"},{code:"MAY",display:"May (trailer)"},{code:"MB",display:"Mercedes-Benz"},{code:"MBG",display:"Modbug"},{code:"MBI",display:"Mobi"},{code:"MBS",display:"MB Sport"},{code:"MC",display:"McCulloch"},{code:"MCI",display:"Motor Coach Industries"},{code:"MCL",display:"McLaren"},{code:"MCT",display:"Mac Trailer"},{code:"MD",display:"Magirus-Deutz"},{code:"ME",display:"Mercury Truck"},{code:"MET",display:"Metropolitan"},{code:"MF",display:"Marlette"},{code:"MFM",display:"Misfit Motorcycles"},{code:"MG",display:"MG"},{code:"MGC",display:"Magic"},{code:"MH",display:"Mitsubishi Truck"},{code:"MI",display:"Mitsubishi"},{code:"MIE",display:"Miles Electric (auto)"},{code:"MJ",display:"Mobile Travel"},{code:"MK",display:"Mack Truck"},{code:"MKE",display:"Moke"},{code:"ML",display:"Mcclane"},{code:"MM",display:"Maxim"},{code:"MMR",display:"Motor Morini"},{code:"MN",display:"Montego"},{code:"MNG",display:"Mengdeli"},{code:"MNR",display:"Mountaineer"},{code:"MNT",display:"Mintaro"},{code:"MO",display:"Monaco"},{code:"MOK",display:"Moke International"},{code:"MP",display:"Markson Products"},{code:"MPR",display:"Mazda of Puerto Rico (auto)"},{code:"MQ",display:"Max"},{code:"MR",display:"Mercury"},{code:"MRL",display:"Marlon"},{code:"MS",display:"Maserati"},{code:"MSR",display:"Marshell"},{code:"MSV",display:"Mercedes Benz Van"},{code:"MT",display:"Mercedes Truck"},{code:"MTF",display:"Motofino"},{code:"MU",display:"Merkur"},{code:"MUL",display:"Mullen"},{code:"MV",display:"Mountain View"},{code:"MV1",display:"MV1"},{code:"MVA",display:"Monte Vista"},{code:"MVP",display:"MVP RV"},{code:"MW",display:"Mariah"},{code:"MX",display:"Mallard"},{code:"MXT",display:"Maxey Trailer"},{code:"MY",display:"Midas"},{code:"MYE",display:"Myers Motors (electric scooter)"},{code:"MZ",display:"Mazda Truck"},{code:"N1",display:"Country Coach (RV)"},{code:"N2",display:"Northland"},{code:"N3",display:"New Vision"},{code:"N4",display:"Newell"},{code:"N5",display:"Northern Lite"},{code:"N6",display:"Nash (RV)"},{code:"N7",display:"Northstar"},{code:"N8",display:"Alpen Coach"},{code:"N9",display:"Nitro"},{code:"NA",display:"Navistar Intl MPV"},{code:"NB",display:"MB Cruiser (RV)"},{code:"NBL",display:"Noble"},{code:"NC",display:"Motorcycle Stuff"},{code:"NCR",display:"Nucamp RV"},{code:"NCV",display:"Nissan Commercial Vehicles"},{code:"NCY",display:"North Country"},{code:"ND",display:"Nissan Diesel"},{code:"NE",display:"Neptune (RV)"},{code:"NEX",display:"Nexus RV"},{code:"NF",display:"Nitrous (RV)"},{code:"NFL",display:"New Flyer"},{code:"NG",display:"Twist - N - Go (moped)"},{code:"NH",display:"Nissan Hawaii"},{code:"NHL",display:"Nitrous Hyperlite (RV)"},{code:"NI",display:"Nissan"},{code:"NJ",display:"NRG (trailer)"},{code:"NK",display:"CornPro (trailer)"},{code:"NL",display:"National"},{code:"NLV",display:"Next Level (travel trailer)"},{code:"NM",display:"Newmar"},{code:"NML",display:"Ness Motorcycles LLC"},{code:"NN",display:"Caribbean (RV)"},{code:"NO",display:"Nomad"},{code:"NP",display:"Sandpiper"},{code:"NQ",display:"Nissan"},{code:"NR",display:"Northwood"},{code:"NRT",display:"Nortek Boats"},{code:"NS",display:"Nissan Truck"},{code:"NT",display:"Navistar Intl Truck"},{code:"NTM",display:"Norton Motorcyles"},{code:"NTR",display:"North Trail (snowmobile trailer)"},{code:"NU",display:"Newmans (trailer)"},{code:"NV",display:"VR1 (RV)"},{code:"NVN",display:"Navion"},{code:"NW",display:"Nuwa"},{code:"NX",display:"Exiss (trailer)"},{code:"NY",display:"Nicky"},{code:"NZ",display:"WVZZI (motorcycle)"},{code:"O1",display:"Contender (boat)"},{code:"O2",display:"SOA (RV)"},{code:"O3",display:"Clipper (RV)"},{code:"O4",display:"Motorrad (motorcycle)"},{code:"O5",display:"PGO (moped)"},{code:"O6",display:"Host (camper)"},{code:"O7",display:"Land Roamer (RV)"},{code:"O8",display:"Motocross (motorcycle)"},{code:"O9",display:"Aliner (RV)"},{code:"OA",display:"Catalina SOA (RV)"},{code:"OAS",display:"Oasis"},{code:"OB",display:"Brougham"},{code:"OC",display:"Columbus Motor Home"},{code:"OD",display:"Odyssey"},{code:"ODE",display:"Odes"},{code:"OE",display:"Eclipse Trailer (RV)"},{code:"OF",display:"Cypress (RV)"},{code:"OG",display:"Goshen (Truck Chassis)"},{code:"OH",display:"Honda Watercraft (watercraft)"},{code:"OI",display:"Optima (trailer)"},{code:"OK",display:"Hyundai Tire"},{code:"OL",display:"Oldsmobile"},{code:"OLK",display:"Outlook (motor home)"},{code:"OLW",display:"Outlaw (RV)"},{code:"OM",display:"Outboard Marine Corporation"},{code:"OME",display:"Omega"},{code:"ON",display:"Onan"},{code:"OP",display:"Opel"},{code:"OPE",display:"Open Range (RV)"},{code:"OPR",display:"Outpost (RV)"},{code:"OQ",display:"Lem USA (dirt bike)"},{code:"OR",display:"Open Road"},{code:"ORV",display:"Outdoor RV"},{code:"OS",display:"Oshkosh Truck"},{code:"OT",display:"Oldsmobile Truck"},{code:"OU",display:"Outback (RV)"},{code:"OUT",display:"Outcast (trailer)"},{code:"OV",display:"Lapalma Diesel (RV)"},{code:"OW",display:"Owens"},{code:"OX",display:"MotoX (motorcycle manuf.)"},{code:"OY",display:"Bad Boy (ATV)"},{code:"OZ",display:"Doolittle (trailer)"},{code:"P1",display:"Park Model"},{code:"P2",display:"Pinnacle"},{code:"P3",display:"Phantom"},{code:"P4",display:"Polini (motorcycle)"},{code:"P5",display:"Pioneeer (RV)"},{code:"P6",display:"American Performance Cycle (motorcycle)"},{code:"P7",display:"Procraft Bass Boat"},{code:"P8",display:"Playcraft (boat)"},{code:"P9",display:"Panzer (motorcycle)"},{code:"PA",display:"Pace Arrow"},{code:"PAC",display:"Pacifica (RV)"},{code:"PAG",display:"Pagani"},{code:"PAL",display:"Palomino"},{code:"PB",display:"Peterbilt"},{code:"PC",display:"Pace American"},{code:"PCE",display:"Peace"},{code:"PCT",display:"Princecraft"},{code:"PCW",display:"Pacific Coachworks"},{code:"PD",display:"Progressive Dynamic"},{code:"PDM",display:"Paradigm"},{code:"PE",display:"Peugeot"},{code:"PEV",display:"Pure EV"},{code:"PF",display:"Peak"},{code:"PFS",display:"Profusion"},{code:"PG",display:"Pug"},{code:"PH",display:"Phasar"},{code:"PHG",display:"Power House Genset"},{code:"PI",display:"Pininfarina"},{code:"PIT",display:"Pitster Pro"},{code:"PJ",display:"Pilgrim"},{code:"PJT",display:"PJ Trailers"},{code:"PK",display:"Pontiac Truck"},{code:"PKD",display:"Packard (automobile)"},{code:"PL",display:"Plymouth"},{code:"PLT",display:"Platinum Trailers"},{code:"PM",display:"Palamino"},{code:"PN",display:"Pontiac"},{code:"PNT",display:"Pontoon (boat)"},{code:"PNV",display:"Pronovost"},{code:"PO",display:"Porsche"},{code:"POG",display:"Polaris (GEM)"},{code:"POL",display:"Polestar"},{code:"POS",display:"Polaris (Snowmobile)"},{code:"PP",display:"Patriot Racing (monster trucks)"},{code:"PQ",display:"Parker (car)"},{code:"PR",display:"Prowler"},{code:"PRC",display:"Pierce Manufacturing (truck)"},{code:"PRE",display:"Prevost (motor home)"},{code:"PRL",display:"Presidential (travel trailer)"},{code:"PRQ",display:"PowerQuest"},{code:"PS",display:"Polaris"},{code:"PSI",display:"Peterson Industries"},{code:"PSP",display:"Passport (RV)"},{code:"PT",display:"Plymouth Truck"},{code:"PTM",display:"Primetime RV"},{code:"PU",display:"Pursuit"},{code:"PV",display:"Pace Vision"},{code:"PW",display:"Pleasure Way"},{code:"PWR",display:"Powerline (hauling trailer)"},{code:"PX",display:"Phoenix (RV)"},{code:"PXU",display:"Phoenix USA RV"},{code:"PY",display:"Piaggio (scooter)"},{code:"PZ",display:"Panoz"},{code:"QIY",display:"QIYE"},{code:"QLK",display:"Qlink Motor"},{code:"QS",display:"Quicksilver"},{code:"R1",display:"Radco"},{code:"R2",display:"Stingray"},{code:"R3",display:"Rollsair"},{code:"R4",display:"Coast RV"},{code:"R5",display:"Sunrader"},{code:"R6",display:"RC Willet (RV)"},{code:"R7",display:"Renegade"},{code:"R8",display:"Regal"},{code:"R9",display:"Rinker"},{code:"RA",display:"Rallye"},{code:"RAM",display:"RAM"},{code:"RB",display:"Caribou"},{code:"RC",display:"RR Custom Coach Works"},{code:"RCT",display:"Raycraft"},{code:"RD",display:"Red Max"},{code:"RDC",display:"Road Clipper (trailer)"},{code:"RDV",display:"Ridge View"},{code:"RDW",display:"Redwood"},{code:"RE",display:"Renault"},{code:"REI",display:"Reinell"},{code:"REL",display:"Redline (trailer)"},{code:"REM",display:"Remeq"},{code:"REV",display:"REV Renegade LLC"},{code:"RF",display:"Refuge"},{code:"RG",display:"Ranger"},{code:"RGY",display:"Regency"},{code:"RH",display:"Robinhood"},{code:"RI",display:"Rialta"},{code:"RIV",display:"Rivian"},{code:"RJ",display:"R-Vision"},{code:"RK",display:"Road King"},{code:"RL",display:"Read Screen-All"},{code:"RM",display:"Richmond Boats"},{code:"RN",display:"Residency"},{code:"RNT",display:"Ruff and Tuff (electric vehicle)"},{code:"RO",display:"Ranger Rover"},{code:"ROD",display:"Roadster"},{code:"ROK",display:"ROKETA (motorcycle)"},{code:"RP",display:"Revolution (RV)"},{code:"RPD",display:"R POD"},{code:"RQ",display:"Riata"},{code:"RR",display:"Rolls Royce"},{code:"RS",display:"Storm"},{code:"RSD",display:"Residence"},{code:"RSN",display:"Rossion"},{code:"RT",display:"Roadtrek"},{code:"RTR",display:"Retreat"},{code:"RTT",display:"Riverside"},{code:"RU",display:"Spectrum"},{code:"RUE",display:"Ruesch"},{code:"RV",display:"Recreational Vehicle"},{code:"RW",display:"Rockwood"},{code:"RX",display:"Rexhall"},{code:"RY",display:"Rexair RXA"},{code:"RZ",display:"Rendezvous"},{code:"RZR",display:"Razor (RV)"},{code:"S0",display:"Snow Brothers"},{code:"S1",display:"Suncrest"},{code:"S2",display:"S2 Yachts"},{code:"S3",display:"Salem"},{code:"S4",display:"Sierra"},{code:"S5",display:"Starcraft"},{code:"S6",display:"Seven Seas"},{code:"S7",display:"Shur Flo"},{code:"S8",display:"Sealand"},{code:"S9",display:"Sunchaser"},{code:"SA",display:"Saab"},{code:"SAN",display:"Sanger"},{code:"SAV",display:"Savoy (travel trailer)"},{code:"SB",display:"Sebring"},{code:"SC",display:"Sportscoach"},{code:"SCE",display:"Sceptor (RV)"},{code:"SCH",display:"Schwinn (scooter)"},{code:"SD",display:"Seabreeze"},{code:"SDN",display:"Sundance (RV)"},{code:"SE",display:"Sea-Doo"},{code:"SEA",display:"Seavee"},{code:"SEB",display:"Sea Boss (boat)"},{code:"SEF",display:"Sea Fox"},{code:"SEP",display:"Sea Pro"},{code:"SES",display:"Seaswirl (boat)"},{code:"SF",display:"Safari"},{code:"SG",display:"Silver Eagle"},{code:"SH",display:"Stihl"},{code:"SHL",display:"Show Hauler (RV)"},{code:"SI",display:"Simplicity"},{code:"SJ",display:"Sea Ray"},{code:"SJS",display:"Shejang Jmstar Shenke"},{code:"SK",display:"Ski-Doo"},{code:"SKE",display:"Skeuter (electric scooter)"},{code:"SL",display:"Sterling"},{code:"SLA",display:"Solera"},{code:"SLD",display:"Shorelander (trailer)"},{code:"SLK",display:"Sleek"},{code:"SM",display:"Suzuki"},{code:"SMC",display:"SmartCar (electric veh)"},{code:"SN",display:"Snapper"},{code:"SNU",display:"Saturn US"},{code:"SNV",display:"Sun Valley"},{code:"SO",display:"Sportsmen"},{code:"SP",display:"Suzuki MPV"},{code:"SPC",display:"Sport Chassis"},{code:"SPF",display:"Superperformance"},{code:"SPK",display:"SPYKER (sports car)"},{code:"SQ",display:"Sea Nymph"},{code:"SR",display:"Saturn"},{code:"SRS",display:"Sunray Smokey RV"},{code:"SRV",display:"Snowriver"},{code:"SS",display:"Shasta"},{code:"SSA",display:"Suckerpunch Sallys (motorcycle)"},{code:"SSR",display:"Sightseer (motor home)"},{code:"SST",display:"Slingshot"},{code:"ST",display:"Suzuki Truck"},{code:"STO",display:"Storyteller Overland"},{code:"STP",display:"Sampede (motorcycle)"},{code:"SU",display:"Subaru"},{code:"SV",display:"Sunline"},{code:"SVD",display:"Silverado"},{code:"SVL",display:"Sliver Lite (RV trailer)"},{code:"SW",display:"Southwind"},{code:"SX",display:"Starfire"},{code:"SY",display:"Skyline"},{code:"SYM",display:"SYM"},{code:"SYO",display:"Sanyo"},{code:"SZ",display:"Suzuki Motorcycle"},{code:"SZP",display:"Suzuki of Puerto Rico"},{code:"SZZ",display:"Shadow Trailer"},{code:"T1",display:"Trailmobile Trailer"},{code:"T2",display:"Trans2"},{code:"T3",display:"Tie Down"},{code:"T4",display:"Tour Master"},{code:"T5",display:"Sylvan"},{code:"T6",display:"Travel Supreme"},{code:"T7",display:"Travel Express"},{code:"T8",display:"Trade Winds"},{code:"T9",display:"Tango Boats"},{code:"TA",display:"Tiara"},{code:"TAB",display:"Tab (RV)"},{code:"TAI",display:"Taiwan (motorcycle)"},{code:"TAT",display:"Tamarack Trail"},{code:"TB",display:"Toro"},{code:"TC",display:"Travelcraft"},{code:"TD",display:"Tracker Evinrude"},{code:"TDC",display:"Tidecraft"},{code:"TE",display:"Teton"},{code:"TES",display:"Tesla"},{code:"TF",display:"Travelaire"},{code:"TFM",display:"Three Feathers Manufacturing"},{code:"TG",display:"Tioga"},{code:"TGB",display:"Taiwan Golden Bee (motorcycle)"},{code:"TH",display:"Theurer Trailer"},{code:"THR",display:"Thor Motor Coach"},{code:"TI",display:"Thor Industry"},{code:"TIG",display:"TIGE (boat)"},{code:"TIR",display:"Timber Ridge"},{code:"TJ",display:"Trail-Lite (RV)"},{code:"TJN",display:"Trojan (boat)"},{code:"TJP",display:"TJ Powersports"},{code:"TK",display:"Cadillac Truck"},{code:"TK3",display:"Take 3"},{code:"TL",display:"Tropi-Cal"},{code:"TM",display:"Travel Master"},{code:"TMC",display:"Tomcar"},{code:"TMG",display:"TMG Group"},{code:"TMS",display:"Thomas"},{code:"TMT",display:"Trailmaster (trailer)"},{code:"TN",display:"Tracker Marine"},{code:"TNG",display:"TNG"},{code:"TNK",display:"Tank (motorcycle)"},{code:"TO",display:"Toyota"},{code:"TOM",display:"Tomberlin (motor home)"},{code:"TOU",display:"Tour (motor home)"},{code:"TP",display:"Tropica"},{code:"TPT",display:"TransSport (trailer)"},{code:"TQ",display:"Tahoe Lite (GM Vehicle)"},{code:"TR",display:"Triumph"},{code:"TRA",display:"Trailer"},{code:"TRW",display:"Trail West"},{code:"TRX",display:"T-REX"},{code:"TS",display:"Tigershark"},{code:"TT",display:"Toyota Truck"},{code:"TTD",display:"Tennessee Tandem (trailer)"},{code:"TU",display:"Tradewinds"},{code:"TUN",display:"Tundra (RV)"},{code:"TV",display:"Transvan"},{code:"TW",display:"Towlt"},{code:"TX",display:"Texson"},{code:"TY",display:"Terry"},{code:"TZ",display:"Titan"},{code:"TZI",display:"Tiziani"},{code:"U1",display:"USA Motorhome"},{code:"U2",display:"Ural"},{code:"U3",display:"Ultrastar"},{code:"U4",display:"Caroline Skiff (RV)"},{code:"U5",display:"Sugar Sands"},{code:"U6",display:"Cub Cadet"},{code:"U7",display:"American Cruiser (RV)"},{code:"U8",display:"Alumaweld"},{code:"U9",display:"Toyota Marine (boat)"},{code:"UA",display:"UD"},{code:"UB",display:"Club Car (by Ingersoll Rand)"},{code:"UC",display:"Sunstar (boat)"},{code:"UD",display:"Universal Datsun"},{code:"UE",display:"Elite Motor Homes (RV)"},{code:"UF",display:"Wildcat (RV)"},{code:"UG",display:"Universal Manufacturing"},{code:"UH",display:"Heartland (Fifth Wheel)"},{code:"UI",display:"Cirrus (travel trailer)"},{code:"UJ",display:"Baxley (travel trailer)"},{code:"UK",display:"Tuckrucky"},{code:"UL",display:"Ultra"},{code:"UM",display:"Utility Master"},{code:"UN",display:"Sunrise"},{code:"UNI",display:"United Trailer"},{code:"UNM",display:"United Motors"},{code:"UO",display:"US Cargo (trailer)"},{code:"UP",display:"Parts Unlimited"},{code:"UQ",display:"Valencia (RV)"},{code:"UR",display:"Surveyor"},{code:"US",display:"Sunstream"},{code:"UT",display:"UMC Truck"},{code:"UU",display:"Sunrunner"},{code:"UV",display:"Suntracker"},{code:"UW",display:"Sunvoyager"},{code:"UX",display:"Sidekicks"},{code:"UY",display:"Sooner"},{code:"UZ",display:"Suite"},{code:"V1",display:"Caravell"},{code:"V2",display:"Sunsport (RV)"},{code:"V3",display:"Correctcraft (ski boat)"},{code:"V4",display:"Sutphen (racing boat)"},{code:"V5",display:"Bimota (motorcycle)"},{code:"V6",display:"Apache"},{code:"V7",display:"Alaskan (RV)"},{code:"V8",display:"Carrilite (RV)"},{code:"V9",display:"Ram-Lin"},{code:"VA",display:"Savanna"},{code:"VAL",display:"Valley (trailer)"},{code:"VB",display:"Vagabond"},{code:"VC",display:"Cushman"},{code:"VD",display:"Bounder Diesel"},{code:"VDH",display:"Vanderhall"},{code:"VE",display:"Vectra"},{code:"VEC",display:"Vectrix (electric vehicle)"},{code:"VEN",display:"Venture (boat)"},{code:"VF",display:"Golden Falcon"},{code:"VFS",display:"Vinfast"},{code:"VG",display:"Avenger"},{code:"VH",display:"Austin Healey"},{code:"VHP",display:"Vehicle Production Group (VPG)"},{code:"VI",display:"Vision"},{code:"VIE",display:"View (motor home)"},{code:"VIV",display:"Viva (motorcycle)"},{code:"VJ",display:"Arrow Voyager"},{code:"VK",display:"Viking"},{code:"VL",display:"Verilight"},{code:"VM",display:"Victory"},{code:"VN",display:"Spartan"},{code:"VNG",display:"Vanguard (trailer)"},{code:"VO",display:"Volvo"},{code:"VP",display:"Viper"},{code:"VPG",display:"VHPG"},{code:"VQ",display:"Coral (boat)"},{code:"VR",display:"Roseair"},{code:"VRV",display:"Vanleigh RV"},{code:"VS",display:"Seaview"},{code:"VT",display:"Volvo Truck"},{code:"VTG",display:"Vantage"},{code:"VTM",display:"Vista (motor home)"},{code:"VU",display:"Seacraft"},{code:"VV",display:"VIP (boats)"},{code:"VW",display:"Volkswagen"},{code:"VX",display:"Vespa (scooter)"},{code:"VY",display:"Voyager"},{code:"VYE",display:"Voyage (motor home)"},{code:"VZ",display:"Vogue"},{code:"W1",display:"Western Star Trucks"},{code:"W2",display:"Washbash Trailer"},{code:"W3",display:"Cascade"},{code:"W4",display:"California Motorcycle"},{code:"W5",display:"Western Recreational (RV)"},{code:"W6",display:"Weekender"},{code:"W7",display:"Windsport (RV)"},{code:"W8",display:"American White Water"},{code:"W9",display:"Weekend Warrior"},{code:"WA",display:"Wrangler"},{code:"WAA",display:"Wuxi Angell Autocycle"},{code:"WB",display:"Wet Bikes"},{code:"WC",display:"Wells Cargo"},{code:"WCC",display:"West Coast Choppers"},{code:"WD",display:"Wildwood"},{code:"WE",display:"Westport"},{code:"WF",display:"Star Flyte (RV)"},{code:"WFP",display:"Wolf Pack"},{code:"WG",display:"Wurth West (factory master)"},{code:"WGN",display:"Wagoneer"},{code:"WH",display:"White"},{code:"WHE",display:"Wheego"},{code:"WI",display:"Winnebago"},{code:"WIL",display:"Wildfire (scooter)"},{code:"WIN",display:"Winnebago of Indiana, LLC"},{code:"WIR",display:"Wind River"},{code:"WJ",display:"Wet Jets"},{code:"WK",display:"Crow (boat)"},{code:"WL",display:"Wellcraft"},{code:"WM",display:"Wanderer Trail"},{code:"WN",display:"Wilderness"},{code:"WNC",display:"Winner's Circle"},{code:"WO",display:"Walker (trailer)"},{code:"WP",display:"Honda Power Equipment"},{code:"WQ",display:"Timber Wolf (trailer)"},{code:"WR",display:"Windjammer"},{code:"WS",display:"Western Star"},{code:"WSF",display:"Westfalia"},{code:"WSP",display:"Western Snow Plows"},{code:"WT",display:"Volkswagen Truck"},{code:"WU",display:"Winzer"},{code:"WV",display:"Worldwide Volkswagen"},{code:"WW",display:"Blue Water"},{code:"WWR",display:"Warrior"},{code:"WX",display:"Watercraft"},{code:"WY",display:"Kings Highway (RV)"},{code:"WZ",display:"Whizzer"},{code:"XA",display:"Acura Service Center"},{code:"XG",display:"Genesis/Hyundai"},{code:"XH",display:"Honda Service Senter"},{code:"XI",display:"Ineos"},{code:"XLR",display:"XLR"},{code:"XWF",display:"X Wolf"},{code:"Y1",display:"Arctic Cat (Snowmobile)"},{code:"Y2",display:"American Clipper"},{code:"Y3",display:"Stoughton"},{code:"Y4",display:"Stoughton Trailer"},{code:"Y5",display:"Utility Trailer"},{code:"Y6",display:"Summerwind"},{code:"Y7",display:"Snugtop"},{code:"Y8",display:"Cigarette"},{code:"Y9",display:"Triton"},{code:"YA",display:"Yamaha"},{code:"YB",display:"Skamper"},{code:"YC",display:"Scenic Cruiser"},{code:"YD",display:"Shadow Cruiser"},{code:"YE",display:"Studebaker"},{code:"YF",display:"Sportscraft"},{code:"YG",display:"Bombardier"},{code:"YH",display:"Sea Hunt"},{code:"YI",display:"Timpte"},{code:"YJ",display:"Mobile Scout (RV)"},{code:"YK",display:"Workhorse"},{code:"YL",display:"Yacht Club Trailer"},{code:"YM",display:"Commander (boat)"},{code:"YN",display:"Aquatron"},{code:"YO",display:"Aero"},{code:"YP",display:"Banda (scooter)"},{code:"YQ",display:"Tab (trailer)"},{code:"YR",display:"Robin"},{code:"YS",display:"Yellowstone"},{code:"YT",display:"Tracker"},{code:"YU",display:"Yugo"},{code:"YV",display:"Twin Vee"},{code:"YW",display:"World Cat"},{code:"YX",display:"Mountain High Coachworks"},{code:"YY",display:"SS"},{code:"YZ",display:"Transcraft"},{code:"Z1",display:"Craig Catamaran"},{code:"Z2",display:"Sportsmobile"},{code:"Z3",display:"Crown Line"},{code:"Z4",display:"Ski Centurion"},{code:"Z5",display:"Aro (Automobile)"},{code:"Z6",display:"Alpha Gold (5th wheel trailer)"},{code:"Z7",display:"Cobalt"},{code:"Z8",display:"Supra"},{code:"Z9",display:"Skamper Lite (trailer)"},{code:"ZA",display:"Stealth"},{code:"ZAA",display:"DeSoto"},{code:"ZAP",display:"Zap (electric scooter)"},{code:"ZB",display:"Mercury"},{code:"ZC",display:"Smoker Craft"},{code:"ZD",display:"Springdale"},{code:"ZE",display:"Alpine Coach"},{code:"ZEN",display:"ZENN (cars)"},{code:"ZF",display:"Monark"},{code:"ZG",display:"Harriskayot"},{code:"ZGR",display:"Zinger"},{code:"ZH",display:"Seahwak"},{code:"ZI",display:"Zimmer"},{code:"ZJ",display:"Cedar Creek"},{code:"ZK",display:"Kenworth"},{code:"ZL",display:"Marlin (motor home)"},{code:"ZM",display:"Zieman (trailer)"},{code:"ZN",display:"Sprinter"},{code:"ZNG",display:"Zingo (motorcycle)"},{code:"ZNS",display:"Zongshen"},{code:"ZO",display:"Tahoe (GM Vehicle)"},{code:"ZOM",display:"Zoom"},{code:"ZP",display:"Campion"},{code:"ZQ",display:"Aztec"},{code:"ZR",display:"Cardinal"},{code:"ZRO",display:"Zero Motorcyles"},{code:"ZS",display:"Steiner"},{code:"ZT",display:"Concourse"},{code:"ZU",display:"Ski Supreme"},{code:"ZV",display:"Miscellaneous"},{code:"ZW",display:"Miscellaneous W"},{code:"ZX",display:"Miscellaneous X"},{code:"ZY",display:"Miscellaneous Y"},{code:"ZZ",display:"Other Make"},{code:"ZZA",display:"Autumn Ridge"},{code:"ZZL",display:"DRV Luxury Suites"},{code:"ZZS",display:"Shockwave Toy Hauler"},{code:"ZZV",display:"VIA"},{code:"ZZX",display:"Four Winds"},{code:"ZZY",display:"TOPO"},{code:"ZZZ",display:"Alpine"}],oe=(e="")=>String(e).toLowerCase().replace(/[^a-z0-9]+/g," ").trim(),ae=e=>{if(!e)return null;const o=oe(e);return o.includes("truck")?"truck":o.includes("van")?"van":o.includes("rv")||o.includes("motor home")||o.includes("motorhome")||o.includes("coach")?"rv":o.includes("trailer")||o.includes("5th wheel")||o.includes("fifth wheel")?"trailer":o.includes("scooter")?"scooter":o.includes("motorcycle")||o.includes("bike")?"motorcycle":o.includes("atv")?"atv":o.includes("snowmobile")?"snowmobile":o.includes("boat")||o.includes("watercraft")?"boat":o},te=ee.map(e=>{const{base:o,typeHint:a}=(e=>{const o=e.match(/^(.+?)\s*\((.+)\)\s*$/);return o?{base:oe(o[1]),typeHint:o[2]}:{base:oe(e),typeHint:null}})(e.display);return{...e,_base:o,_normType:ae(a)}}),de=new Map;for(const e of te){const o=de.get(e._base)||[];o.push(e),de.set(e._base,o)}const re=e=>{const o=oe(e);if(!o)return null;const a=de.get(o);if(a&&a.length)return(e=>{if(!e||!e.length)return null;let o=e.find(e=>!e._normType);return o||(o=e.find(e=>"rv"===e._normType),o||e[0])})(a);let t=null;for(const e of te){const a=e._base;if(a===o)return e;(a.startsWith(o)||o.startsWith(a))&&(!t||a.length<t._base.length)&&(t=e)}return t},ie=[{make:"Ford",type:"truck",code:"FT"},{make:"Ford",type:"pickup",code:"FT"},{make:"Ford",type:"hd truck",code:"FD"},{make:"Ford",type:"heavy duty",code:"FD"},{make:"Ford",type:"commercial",code:"FC"},{make:"Ford",type:"racing",code:"FP"},{make:"Chevrolet",type:"truck",code:"CT"},{make:"Chevy",type:"truck",code:"CT"},{make:"Dodge",type:"truck",code:"DT"},{make:"Ram",type:"truck",code:"RAM"},{make:"Nissan",type:"truck",code:"NS"},{make:"Nissan",type:"diesel",code:"ND"},{make:"Nissan",type:"commercial",code:"NCV"},{make:"Toyota",type:"truck",code:"TT"},{make:"Volkswagen",makeAlt:["VW"],type:"truck",code:"WT"},{make:"Mazda",type:"truck",code:"MZ"},{make:"Mercedes-Benz",makeAlt:["Mercedes"],type:"truck",code:"MT"},{make:"Mercedes-Benz",makeAlt:["Mercedes"],type:"light truck",code:"M8"},{make:"Mercedes-Benz",makeAlt:["Mercedes"],type:"van",code:"MSV"},{make:"Honda",type:"truck",code:"HT"},{make:"Honda",type:"motorcycle",code:"HM"},{make:"Honda",type:"bike",code:"HM"},{make:"Honda",type:"atv",code:"HAT"},{make:"Honda",type:"watercraft",code:"OH"},{make:"Honda",type:"power equip",code:"WP"},{make:"Isuzu",type:"truck",code:"IT"},{make:"Jeep",type:"truck",code:"JT"},{make:"Pontiac",type:"truck",code:"PK"},{make:"Cadillac",type:"truck",code:"TK"},{make:"Volvo",type:"truck",code:"VT"},{make:"Forest River",type:"rv",code:"FV"},{make:"Forest River",type:"trailer",code:"FQ"}],se=(e,o)=>{if(!e)return null;const a=oe(e),t=oe(o),d=o?((e,o)=>{const a=oe(e),t=oe(o);return a&&t&&ie.find(e=>{const o=[e.make,...e.makeAlt||[]].filter(Boolean).some(e=>oe(e)===a),d=oe(e.type)===t;return o&&d})||null})(e,o):null;if(d){const e=ne(d.code);if(e)return e}if(t){const e=ie.find(e=>oe(e.make)===a&&oe(e.type)===t);if(e)return ne(e.code)}if(t){const a=re(`${e} ${o}`);if(a)return a;const t=re(`${o} ${e}`);if(t)return t}return re(e)},le=(e,o)=>{if(!e)return null;if("string"==typeof e){const a=e;return o?se(a,o):re(a)}if("object"==typeof e){const{make:o,type:a}=e;return o?a?se(o,a):re(o):null}return null},ne=e=>{if(!e)return null;const o=e.toUpperCase();return te.find(e=>e.code===o)||null};export{te as ENTRIES,ee as RAW_ENTRIES,z as RRClient,Z as errors,ne as getEntryByCode,re as lookupByMake,se as lookupByMakeAndType,le as lookupVehicleMake};
|