1import{h as i}from"./vehicleNavigationOverlay.700ee384.js";import{l as c,a as f}from"./vendor.3765fd31.js";const d={methods:{getAssetUrl(r){return new URL(r,import.meta.url).href},getUrlWithPlatformParam(r){if(i.methods.isWebPlatform()||this.isExternalUrl(r))return r;const e=i.methods.getPlatform();try{const n=new URL(r,this.$inertia.page.props.appUrl);return n.searchParams.set("platform",e),n.toString()}catch{const[t,s=""]=r.split("?"),a=new URLSearchParams(s);a.set("platform",e);const o=a.toString();return o?`${t}?${o}`:t}},isExternalUrl(r){return!r.startsWith(this.$inertia.page.props.appUrl)},isFullPageMenuLink(r){var e,n,t;return r.name==="logout"?i.methods.isWebPlatform():Boolean(((e=r.attributes)==null?void 0:e.isExternal)||((n=r.attributes)==null?void 0:n.isDisabled)||((t=r.attributes)==null?void 0:t.notInertia))},addParametersToUrl(r,e,n=!0){const t=new URL(r);return t.search=this.combineSearchParameters(t.searchParams,e,n).toString(),t.toString()},normalizeSortValue(r){var t,s;if(r==null||r==="")return null;let e=typeof r=="object"?(s=(t=r.id)!=null?t:r.value)!=null?s:null:String(r);if(!e)return null;let n=!1;return e.startsWith("-")&&(e=e.substring(1),n=!e.endsWith("-desc")),n?e+"-desc":e},buildUrlParametersForSearchResult(r,e,n=null,t=null){var l,h;const s=this.normalizeSortValue((h=(l=t==null?void 0:t.options)==null?void 0:l.defaultSort)!=null?h:"created_at-desc"),a=this.normalizeSortValue(e),o=c.exports.cloneDeep(r!=null?r:{});delete o.sort;let u="";return a&&a!==s&&(u="sort="+encodeURIComponent(a)),this.buildUrlParametersForForm(o,u,n,t)},buildUrlParametersForForm(r,e="",n=null,t=null){var s;return(s=t==null?void 0:t.options)!=null&&s.omitDefaultValues?this.buildUrlParameters(this.omitDefaultFormValues(r,t),this.omitDefaultAdditionalParameters(e,t.options.defaultSort),n):this.buildUrlParameters(r,e,n)},collectFormElementDefaults(r){const e={};return r!=null&&r.sections&&r.sections.forEach(n=>{var t;(t=n.items)==null||t.forEach(s=>{this.collectFormElementDefault(s,e)})}),e},collectFormElementDefault(r,e){var n,t;(r==null?void 0:r.name)&&((n=r.options)==null?void 0:n.defaultValue)!==void 0&&((t=r.options)==null?void 0:t.defaultValue)!==null&&(e[r.name]=r.options.defaultValue),(r==null?void 0:r.type)==="Repeater"&&r.items&&r.items.forEach(s=>{this.collectFormElementDefault(s,e)}),((r==null?void 0:r.type)==="ComboSelect"||(r==null?void 0:r.type)==="RangeSelect")&&r.values&&Object.values(r.values).forEach(s=>{this.collectFormElementDefault(s,e)})},omitDefaultFormValues(r,e){if(!r)return r;const n=c.exports.cloneDeep(r),t=this.collectFormElementDefaults(e);return Object.keys(t).forEach(s=>{Object.prototype.hasOwnProperty.call(n,s)&&n[s]===t[s]&&delete n[s]}),n},omitDefaultAdditionalParameters(r,e){if(!r||!e)return r!=null?r:"";const n=new URLSearchParams(r.replace(/^[?&]+/,"")),t=this.normalizeSortValue(e),s=this.normalizeSortValue(n.get("sort"));s&&t&&s===t&&n.delete("sort");const a=n.toString();return a?r.trim().startsWith("&")?"&"+a:a:""},buildUrlParameters(r,e="",n=null){let t=e===""?"":e+"&";return r&&Object.keys(r).forEach(s=>{!c.exports.isNull(r[s])&&typeof r[s]=="object"?Object.keys(r[s]).forEach(a=>{var o,u;if(Array.isArray(r[s][a]))r[s][a].forEach(l=>{l&&l!=="null"&&(t+=s+"["+a+"][]="+l+"&")});else{const l=(u=(o=r[s][a])==null?void 0:o.id)!=null?u:r[s][a];l&&l!=="null"&&(t+=s+"["+a+"]="+l+"&")}}):r[s]&&r[s]!=="null"&&(t+=s+"="+r[s]+"&")}),t+=this.getMeasurementUnitsParameter(r,n),t.substring(-1)==="&"?t.slice(0,-1):t},getMeasurementUnitsParameter(r,e){let n="";if(e==null)return n;const t="measurement_unit";return Object.keys(e).forEach(s=>{for(const[a,o]of Object.entries(r))if(a&&o&&a.includes("["+s+"]"))return n+=`${t}[${s}]=${e[s]}&`,n}),n},combineSearchParameters(r,e,n=!1){const t=new URLSearchParams(r),s=new URLSearchParams(e);for(const[a,o]of s.entries())t.get(a)!=null?n&&(t.delete(a),t.append(a,o)):t.append(a,o);return t},isCurrentLink(r){const e=new URL(this.$page.props.currentSite.rootUrl),n=new URL(this.$page.url,e.origin),t=new URL(r);return t.hostname!==e.hostname?!1:n.pathname===t.pathname},fetchData(r){return f.get(r,{withCredentials:!0,headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/json","request-made-by":i.methods.isWebPlatform()?this.$inertia.page.props.appUrl:i.consts.hostUrl}}).then(e=>e.data)},getCurrentSiteAndLanguagePrefix(){return this.$page.props.currentSite.id+"-"+this.$page.props.currentLanguage.code},isChosenMenuItem(r){return r.find(e=>this.isCurrentLink(e.url))}}};export{d as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.