
(function(name,definition){if(typeof module!='undefined'&&module.exports)module.exports=definition()
else if(typeof define=='function'&&define.amd)define(definition)
else this[name]=definition()})('$script',function(){var doc=document,head=doc.getElementsByTagName('head')[0],s='string',f=false,push='push',readyState='readyState',onreadystatechange='onreadystatechange',list={},ids={},delay={},scripts={},scriptpath,urlArgs
function every(ar,fn){for(var i=0,j=ar.length;i<j;++i)if(!fn(ar[i]))return f
return 1}
function each(ar,fn){every(ar,function(el){return!fn(el)})}
function $script(paths,idOrDone,optDone){paths=paths[push]?paths:[paths]
var idOrDoneIsDone=idOrDone&&idOrDone.call,done=idOrDoneIsDone?idOrDone:optDone,id=idOrDoneIsDone?paths.join(''):idOrDone,queue=paths.length
function loopFn(item){return item.call?item():list[item]}
function callback(){if(!--queue){list[id]=1
done&&done()
for(var dset in delay){every(dset.split('|'),loopFn)&&!each(delay[dset],loopFn)&&(delay[dset]=[])}}}
setTimeout(function(){each(paths,function loading(path,force){if(path===null)return callback()
path=!force&&path.indexOf('.js')===-1&&!/^https?:\/\//.test(path)&&scriptpath?scriptpath+path+'.js':path
if(scripts[path]){if(id)ids[id]=1
return(scripts[path]==2)?callback():setTimeout(function(){loading(path,true)},0)}
scripts[path]=1
if(id)ids[id]=1
create(path,callback)})},0)
return $script}
function create(path,fn){var el=doc.createElement('script'),loaded
el.onload=el.onerror=el[onreadystatechange]=function(){if((el[readyState]&&!(/^c|loade/.test(el[readyState])))||loaded)return;el.onload=el[onreadystatechange]=null
loaded=1
scripts[path]=2
fn()}
el.async=1
el.src=urlArgs?path+(path.indexOf('?')===-1?'?':'&')+urlArgs:path;head.insertBefore(el,head.lastChild)}
$script.get=create
$script.order=function(scripts,id,done){(function callback(s){s=scripts.shift()
!scripts.length?$script(s,id,done):$script(s,callback)}())}
$script.path=function(p){scriptpath=p}
$script.urlArgs=function(str){urlArgs=str;}
$script.ready=function(deps,ready,req){deps=deps[push]?deps:[deps]
var missing=[];!each(deps,function(dep){list[dep]||missing[push](dep);})&&every(deps,function(dep){return list[dep]})?ready():!function(key){delay[key]=delay[key]||[]
delay[key][push](ready)
req&&req(missing)}(deps.join('|'))
return $script}
$script.done=function(idOrDone){$script([null],idOrDone)}
return $script});
if(typeof JSON!=='object'){JSON={};}
(function(){'use strict';function f(n){return n<10?'0'+n:n;}
if(typeof Date.prototype.toJSON!=='function'){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+'-'+f(this.getUTCMonth()+1)+'-'+f(this.getUTCDate())+'T'+f(this.getUTCHours())+':'+f(this.getUTCMinutes())+':'+f(this.getUTCSeconds())+'Z':null;};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf();};}
var cx,escapable,gap,indent,meta,rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';}
function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==='object'&&typeof value.toJSON==='function'){value=value.toJSON(key);}
if(typeof rep==='function'){value=rep.call(holder,key,value);}
switch(typeof value){case'string':return quote(value);case'number':return isFinite(value)?String(value):'null';case'boolean':case'null':return String(value);case'object':if(!value){return'null';}
gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==='[object Array]'){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||'null';}
v=partial.length===0?'[]':gap?'[\n'+gap+partial.join(',\n'+gap)+'\n'+mind+']':'['+partial.join(',')+']';gap=mind;return v;}
if(rep&&typeof rep==='object'){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==='string'){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?': ':':')+v);}}}}
v=partial.length===0?'{}':gap?'{\n'+gap+partial.join(',\n'+gap)+'\n'+mind+'}':'{'+partial.join(',')+'}';gap=mind;return v;}}
if(typeof JSON.stringify!=='function'){escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};JSON.stringify=function(value,replacer,space){var i;gap='';indent='';if(typeof space==='number'){for(i=0;i<space;i+=1){indent+=' ';}}else if(typeof space==='string'){indent=space;}
rep=replacer;if(replacer&&typeof replacer!=='function'&&(typeof replacer!=='object'||typeof replacer.length!=='number')){throw new Error('JSON.stringify');}
return str('',{'':value});};}
if(typeof JSON.parse!=='function'){cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==='object'){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v;}else{delete value[k];}}}}
return reviver.call(holder,key,value);}
text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);});}
if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;}
throw new SyntaxError('JSON.parse');};}}());
var TSOTranslations = {"vehicleInStock":"1 vehicle in stock","locationsOverview":"All locations at a glance","VAT":"{0} VAT","paint":"Paint","homePage":"Home","totalPriceVATOnlyLabel":"(gross)","firstRegistration":"FR","allin":"All in","generalError":"Please note the error message in the fields marked red and fill these fields out correctly. ","gfzNumber":"UVID","isPriceReduced":"Quote","truckletterFooter":"Yes, I agree that the TruckLetter will be sent to me via E-Mail. You choose which content we send you, and how often: New vehicles in stock, Leasing or Financing. I have read the <a href='https://www.truckstore.com/about-truckstore/privacy-statement.html'>Privacy Statement</a> and agree to my personal data being processed and used. It is possible to unsubscribe at any time by clicking on a link at the bottom of the TruckLetter.","last_nameRequired":"Please enter your last name.","warranty":"TruckStore Warranty","sortBy":"Sort by","finalInstallment":"Final Installment","fax":"Fax","contactByOption":"You have not consented as to whether or not you wish to be contacted. Being able to contact you will enable us to address your future needs even better.","lastSearch":"Last search","additonalInformation":"Additional Information","suspension":"Suspension","sales_messageMaxLength":"The maximum number of characters for the message is {maxLength}.","detailsDisclaimer":"This quote is not binding. Subject to errors and sale. Quoted foreign currency prices are based on the current exchange rate. The currency of the vehicle location applies.","images":"Images","financeCalculatorTitle":"Mercedes-Benz Bank","truckPurchasePrivacyHead":"Note","reservedVehiclePrimaryImage":"RESERVED","printDisclaimer":"Non-binding vehicle quote","vehicleNotFoundBreadcrumb":"No vehicle found","searchSwipeHint":"You can swipe to show/hide filters ","detailviewReservedSimilarVehiclesHeadline":"Similar vehicles","yourContactPerson":"Your Contact","accept":"Accept","leasing_service":"Leasing","businessAndContactours":"Opening hours and telephone availability","financeCalculatorDescription":"<p>Notice: Mercedes-Benz Bank offers its financial services only established in Germany.</p><p>*  Monatliche Rate. <strong>Diese Beispielkalkulation der Mercedes-Benz Bank AG, Siemensstraße 7, 70469 Stuttgart</strong> gilt für eine Finanzierung bei einem festgesetzten effektiven Jahreszins, einer Anzahlung von 15, 97 % des Kaufpreises und einer Laufzeit von 36 Monaten. Ist der Darlehensnehmer Verbraucher, besteht nach Vertragsschluss ein gesetzliches Widerrufsrecht nach §495 BGB.</p>","wheelbase":"Wheelbase","searchExcludeVat":"* excluding VAT","searchVehiclesPlural":"{0} that match your criteria","lastsearches_title":"Last searches","truckPurchasePrivacyDesc1":"We would like to provide you with customised information and advice. We therefore ask you to agree to the use of your details. We will treat these in confidence and handle them with the utmost care.","truckPurchasePrivacyDesc2":"I have read the data privacy agreement and agree to my personal data being processed and used. You can contact me as follows:","emailRequired":"Please enter your e-mail address.","aprEffective":"APR Effective","contactFormTitle":"Your message to TruckStore","totalPrice":"Total price","privacyFormTitle":"Note","filterTrucks":"Filter vehicles","cabin":"Cab","locationOfVehicles":"Vehicle location","cookieNoticeContent":"Daimler uses cookies to optimize the design of this website and make continuous improvements.<br/>By continuing your visit the website, you consent to the use of cookies.<br/><br/><a href='/~country~/~language~/about-truckstore/cookies.html'>Further details can be found in the 'Cookies'</a>","vehicle":"Vehicle","financing":"Financing","totalPriceWithoutVAT":"(net)","vehiclesInStock":"{0} vehicles in stock","term":"Term","currency":"Currency","reservedVehicleSearch":"Find similar vehicles from our range.","map":"Map","close":"Close","kilometersIncluded":"Kilometrage","email":"Email","yourRepresentativeForThisTruck":"Your contact person for this vehicle","vehicleNotFoundDescription":"We recommend that you make contact with a salesperson in your nearest TruckStore. Our sales staff will be happy to help you search for a suitable vehicle.","question":"Inquiry","languages":"Languages","first_nameRequired":"Please enter your first name.","bookmarked":"Bookmarked","change":"Change","businessHours":"Business Hours","salesFormTitle":"Request quote","services":"Services","captchaRequired":"Please confirm.","truckletterNewsletterSelected":"Please select at least one Truck offer.","call":"Call","reservedVehiclePartnerTitle":"Your contact person at the nearest TruckStore","locationsHeaderCountries":"Countries","sortByList":"Relevance, First registration - ascending|dateOfRegistration|asc, First registration - descending|dateOfRegistration|desc, Kilometrage - ascending|km|asc, Kilometrage - descending|km|desc, Price - ascending|priceNet|asc, Price - descending|priceNet|desc","centerTelephoneHours":"By telephone","vehicleNotFoundTitle":"No vehicle found","offerPrice":"Quoted Price","xxlImages":"XXL images","truckletterSelectionText":"Please send me these Truck offers in future:","searchGoldSilverBronze":"Gold/Silver/Bronze","informationNoticeTitle":"INFORMATION NOTICE ON PROCESSING PERSONAL DATA","phoneRequired":"Please enter your phone number.","locationsHeaderCenters":"{0} TruckStore centers in {1} countries","informationReadStatement":"Read information notice","leasing":"Leasing","searchNoResultsSubTitle":" match your criteria","truckletterSuccess":"You must now confirm your subscription request.<br/><br/>This is done as follows:<br/>We have just sent an e-mail to the following address:<br/><b>~truckletterEmail~</b><br/><br/>Please open the e-mail and click on the confirmation link. You will then receive the ordered TruckLetter as from this time.<br/><br/>Thank you for your interest in our TruckLetter.","salesFormSuccess":"We have received your message. We will call you during our office hours in order to provide you with further information on the vehicle which you have selected.","payload":"Payload","continue":"Next","contact":"Contact","informationNoticeStatement":"<p>Your personal data will be processed for the purpose of creating customer record and in this regard, for offering our Company products and services to your part upon customization based on your interest, user habits and requirements and operating sales and marketing activities in accordance with Mercedes-Benz Türk Anonim Sirketi Data Protection and Processing Policy and the scope of this Information Notice.</p><p><b>a) Data Controller and its Representative</b><br>Pursuant to the Law on Protection of Personal Data with number 6698 (“the Law”), your personal data can be processed by Mercedes-Benz Türk Anonim Sirketi (“Company” or “MBT”) who acts as data controller in line within the following scope.</p><p><b>b) Purposes of Processing Personal Data</b><br>Your collected personal data may be processed as regards to the purposes for which you disclosed your personal data to us, namely for conducting the marketing activities and managing customer affairs; also for ensuring business units conduct necessary works in a manner enabling you to benefit from products and services offered by our Company; offering products and services of our Company upon customization based on your interests, user habits and requirements; providing legal and commercial safety of our Company and our business partners; and determining and implementing trade and business strategies of our Company in accordance with the circumstances specified in the Articles 5 and 6 of Law. No 6698 relating to the terms and purposes of processing of personal data.You may find detailed information about purposes of data processing activities of our Company on Mercedes-Benz Türk Anonim Sirketi Data Protection and Processing Policy which is available at <a href='http://www.mercedes-benz.com.tr'>www.mercedes-benz.com.tr</a>.</p><p><b>c) Purposes of Transferring Processed Personal Data and Recipient Parties</b><br>Your collected personal data can be transferred to our business partners, suppliers, shareholders, subsidiaries, public institutions and organizations and private persons authorized by law, for the purpose of operating marketing activities; ensuring business units conduct necessary works in a manner enabling you to benefit from products and services offered by our Company; offering products and services of our Company upon customization based on your interest, user habits and requirements; providing legal and commercial safety of our Company and our business partners; determining and implementing trade and business strategies of our Company in accordance with the circumstances specified in the Articles 8 and 9 of the Law within the scope limited  as per Mercedes-Benz Türk Anonim Sirketi Data Protection and Processing Policy disclosed to public on the Internet address of  <a href='http://www.mercedes-benz.com.tr'>www.mercedes-benz.com.tr</a>.</p><p><b>d) Methods and Legal Grounds of Personal Data Collection</b><br>Your personal data shall be collected by our Company through different channels and based on various legal grounds; to improve our products and services and perform our commercial activities. Within this period your personal data is collected in physically or on Internet environments through our Internet site channels, for the legal grounds of operating marketing activities and fulfilling our obligations to obtain you approval. You collected data can also be processed and transferred for the purposes stated in (b) and (c) of this Information Notice and limited with the circumstances listed in Article 5 and Article 6 of the Law.</p><p><b>e) Rights of Personal Data Owners Stipulated under Article 11 of the Law No. 6698</b><br>If you forward your request via methods stated under Mercedes-Benz Türk Anonim Sirketi Data Protection and Processing Policy which is available at <a href='http://www.mercedes-benz.com.tr'>www.mercedes-benz.com.tr</a>, MBT, shall finalize the request free of charge within the shortest time possible and no later than thirty (30) days depending on the content of the request. However, if the access request incurs additional cost, the price stated by the Personal Data Protection Board may be collected. In that regard, data subjects have the right to;<br><ul><li>Learn whether their personal data is processed or not;</li><li>Request further information if their personal data have been processed;</li><li>Learn the purpose of processing personal data, and whether the data are being processed in compliance with such purpose or not;</li><li>Learn the third-party recipients to whom the data are transferred within the country or abroad;</li><li>Request rectification of the processed personal data which is incomplete or inaccurate, and request notification of the third persons to whom the personal data are transferred, </li><li>Request erasure or destruction of personal data when the personal data processing purposes no longer exist, although personal data was processed in accordance with the Law no.6698 and other related laws and regulations, and request notification of such action to third party recipients, </li><li>Object to negative consequences about themselves that are concluded upon analysis of the processed personal data by solely automatic means, </li><li>Request compensation for the damages they suffer because of an unlawful personal data processing.</li></ul></p>","export":"Export","messageMaxLength":"The maximum number of characters for the message is {maxLength}.","showVehicles":"Show vehicles","centerNamePrefix":"TruckStore","months":"Months","returnToList":"List","searchVehiclesSingular":"{0} matches your criteria","searchNoResultsTitle":"No vehicles","equipment":"Equipment features","privacyFormReadTerms":"Read data privacy agreement","telephone":"Telephone","bookmark":"Bookmark","recipientRequired":"Please choose a recipient.","abort":"Cancel","salesRepButton":"Sales team","vehicleDetailViewPS":"HP","page":"Page","sales_phoneRequired":"Please enter your phone number.","send":"Send","bookmarkList":"Bookmarks","next":"Next","backToTop":"Back to top","color":"Color","searchExclusive":"","purchasePrivacyStatementHead":"Declaration of Consent according to Privacy Law","financial":"Financing","cargoSpace":"Loading space (L/W/H)","line":"Equipment line","salesFormTitleSuccess":"Request successfully sent to TruckStore {0}","privacyFormDescription":"We would like to provide you with customised information and advice. We therefore ask you to agree to the use of your details. We will treat these in confidence and handle them with the utmost care.","vehicles":"Vehicles","truckPurchasePrivacyLink":"Read data privacy agreement","reservedVehicleSearchButton":"Show similar vehicles","reservedVehiclePartner":"Our sales staff will be happy to help you search for a suitable vehicle.","specialPayment":"Special Payment","emailValid":"Please enter a valid e-mail address.","vehicle_typeRequired":"Please enter the vehicle type.","monthlyLeasingRate":"Leasing rate","truckletterTitle":"Subscribe to TruckLetter","purchasePrivacyStatement":"I agree that my contact details, vehicle data, and information about services used may be processed and used by Daimler AG and its authorized sales and service partners to inform and advise me about products and services of Daimler AG and its affiliated companies as well as for market research. The data may be passed to Daimler AG, selected dealers/service partners within the Daimler sales and service organization, and market research institutes for these purposes.<br/><br/>If you would prefer us not to process and use your information, we regret that, for legal reasons, we will be unable to keep you informed of our products and services. If you subsequently change your mind and wish to withdraw your consent, please contact Daimler AG: TruckStore Daten, HPC Z800, 70564 Stuttgart, Germany.<br/><br/>If you wish never to be contacted by us again, you can refuse consent for your data to be used to inform you about products and services or for market research. Please contact Daimler AG: TruckStore Daten, HPC Z800, 70564 Stuttgart, Germany. However, we regret that this will limit our ability to advise and inform you.","monthlyFinancingRate":"Monthly installment","vehicleSearch":"Vehicle search","truckData":"Vehicle data","privacyFormAcceptance":"I have read the data privacy agreement and agree to my personal data being processed and used. You can contact me as follows:","searchNoResultsDescription":"We recommend that you carry out a less restricted search or that you contact one of our sales staff. Our sales staff will be glad to help you search for a suitable vehicle.","truckPurchaseFormTitle":"Or send us details of your truck and we will contact you","allVehicles":"All vehicles","vehicle_commentsMaxLength":"The maximum number of characters for vehicle comments is {maxLength}.","previous":"Previous","logisticDesign":"Logistics provider design","nameRequired":"Please enter your name.","totalPriceVAT":"(gross, incl. {0} VAT)","mobile":"Mobile","clear":"Clear","cookieNoticeHead":"Use of cookies","steering":"Steering","numberOfPreviousOwners":"Previous owners","isNew":"New","any":"Any","viewVehicles":"Show vehicles","searchHeaderPlaceholder":"Search","phoneValid":"Please enter a valid phone number.","salesFormDescription":"We will call you during our office hours in order to provide you with further information on the vehicle which you have selected.","print":"Print","truckPurchaseVehicleTitleBreak":"Vehicle data","application":"Application area","productGroup":"Product group","totalWeight":"GWR","until":"to","detailviewReservedBreadcrumb":"Vehicle no longer available","category":"Category","privacyStatementLink":"<a href\=\"javascript\:void(0)\" onClick\=\"window.open('https://www.truckstore.com/about-truckstore/privacy-statement.html')\">Privacy Statement</a>","downpayment":"Downpayment"}
var app=angular.module("app",["ngRoute","ngResource","angular-cache","ngCookies","ngTouch","ui.bootstrap","infinite-scroll","jkuri.gallery","angular-uuid","fs-calculation-module"]);app.config(["$routeProvider","$locationProvider","CacheFactoryProvider",function(t,e,r){angular.extend(r.defaults,{maxAge:9e5}),window.history&&window.history.pushState&&e.html5Mode({enabled:!1,requireBase:!1,rewriteLinks:!1})}]),app.run(["$rootScope",function(t){t.tsoI18n=TSOTranslations,t.htmlDirection=TSO.Helpers.htmlDirection()}]),app.filter("numberDotted",function(){return function(t,e){return null==t?"":t.toString().replace(/\B(?=(\d{3})+(?!\d))/g,e)}}),app.filter("sanitize",["$sce",function(t){return function(e){return t.trustAsHtml(e)}}]),app.filter("stringFormat",function(){function t(t,e,r){for(var n="",i=0;;){var o=e.indexOf("{",i),a=e.indexOf("}",i);if(o<0&&a<0){n+=e.slice(i);break}if(a>0&&(a<o||o<0)){if("}"!==e.charAt(a+1))throw new Error("format stringFormatBraceMismatch");n+=e.slice(i,a+1),i=a+2}else if(n+=e.slice(i,o),i=o+1,"{"!==e.charAt(i)){if(a<0)throw new Error("format stringFormatBraceMismatch");var u=e.substring(i,a),c=u.indexOf(":"),l=parseInt(c<0?u:u.substring(0,c),10);if(isNaN(l))throw new Error("format stringFormatInvalid");var s=c<0?"":u.substring(c+1),f=r[l];void 0!==f&&null!==f||(f=""),f.toFormattedString?n+=f.toFormattedString(s):t&&f.localeFormat?n+=f.localeFormat(s):f.format?n+=f.format(s):n+=f.toString(),i=a+1}else n+="{",i++}return n}return function(e,r){return r&&r.length&&e?t(!1,e,r):e}}),$(document).ready(function(){$(".mega-menu-language").hover(function(){TSO.Helpers.isDesktopSize()&&($(".mega-menu-language").find(".mega-menu-category").each(function(t){$(this).height($(this).height())}),setTimeout(function(){$(".tso-mega-menu-wrapper").masonry({itemSelector:".mega-menu-category",columnWidth:120,transitionDuration:0})},50))})}),$(document).click(function(t){if(!document.activeElement.type||"search"!=document.activeElement.type){var e=$(t.target),r=$(".navbar-collapse");!0!==r.hasClass("in")||e.hasClass("navbar-toggle")||r.collapse("hide")}}),app.directive("htmlRender",["$compile",function(t){return{restrict:"A",scope:{html:"@"},link:function(e,r){e.$watch("html",function(n){if(n){var i=t(n)(e);r.append(i)}})}}}]),String.prototype.replaceAll=function(t,e){return this.replace(new RegExp(t,"g"),e)},Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){for(var r=e||0,n=this.length;r<n;r++)if(this[r]===t)return r;return-1});
var TSO={ServicePath:function(){return"sto"==TSO.Helpers.getPlatform()?"test"==TSO.Helpers.getEnvironment()||"localhost"==document.location.hostname?"https://proxytest.sto-aws.com/tsoApp/":"int"==TSO.Helpers.getEnvironment()?"https://proxyint.sto-aws.com/tsoApp/":(TSO.Helpers.getEnvironment(),"https://proxyprod.sto-aws.com/tsoApp/"):"tza"==TSO.Helpers.getPlatform()?"int"==TSO.Helpers.getEnvironment()?"https://proxyintza.tso-aws.com/tsoApp/":(TSO.Helpers.getEnvironment(),"https://proxyprodza.tso-aws.com/tsoApp/"):"test"==TSO.Helpers.getEnvironment()||"localhost"==document.location.hostname?"https://proxytest.tso-aws.com/tsoApp/":"int"==TSO.Helpers.getEnvironment()?"https://proxyint.tso-aws.com/tsoApp/":(TSO.Helpers.getEnvironment(),"https://proxyprod.tso-aws.com/tsoApp/")},MapsApiKey:function(){return"sto"==TSO.Helpers.getPlatform()?"test"==TSO.Helpers.getEnvironment()||"localhost"==document.location.hostname?"AIzaSyBwUDyOI_GwOwTn01cHr9oVGl415I4dGEk":"int"==TSO.Helpers.getEnvironment()?"AIzaSyD-FMRoQFHKYW3TuecSWG7F5ktHLTIkGBM":(TSO.Helpers.getEnvironment(),"AIzaSyC1gVk8L7m1X8HLRMohjcw1X9yt9Jb-428"):"tza"==TSO.Helpers.getPlatform()?"test"==TSO.Helpers.getEnvironment()||"localhost"==document.location.hostname?"AIzaSyBwUDyOI_GwOwTn01cHr9oVGl415I4dGEk":"int"==TSO.Helpers.getEnvironment()?"AIzaSyCCL5uhVTRt3EX_N_KPXJ283dtI0-d6Pz8":(TSO.Helpers.getEnvironment(),"AIzaSyBvztXdxt2EEvs904RM7AgSLHYKs1ZGQuI"):"test"==TSO.Helpers.getEnvironment()||"localhost"==document.location.hostname?"AIzaSyA4xUzqqjJr1amJcQ0AG-VuIU41UKjRqDg":"int"==TSO.Helpers.getEnvironment()?"AIzaSyCCL5uhVTRt3EX_N_KPXJ283dtI0-d6Pz8":(TSO.Helpers.getEnvironment(),"AIzaSyBvztXdxt2EEvs904RM7AgSLHYKs1ZGQuI")},Helpers:{language:function(){return $('meta[name="language"]').attr("content")},getEnvironment:function(){return $('meta[name="environment"]').attr("content")},getPlatform:function(){return void 0==$('meta[name="platform"]').attr("content")?"tso":$('meta[name="platform"]').attr("content")},uvid:function(){var e=window.location.pathname;e=e.replace(".html","").replace(/\/$/,"");for(var t=e.split(/[\/]|[\.]/),n=0;n<t.length;n++)if(("detail"===t[n]||"print"===t[n])&&n+1<t.length)return t[n+1];return t[t.length-1]},centerId:function(){var e=window.location.pathname;e=e.replace(".html","").replace(/\/$/,"");for(var t=e.split(/[\/]|[]/),n=0;n<t.length;n++)if("site"===t[n]&&n+1<t.length)return t[n+1];return t[t.length-1]},country:function(){var e=$('meta[name="country"]').attr("content");return""!=e&&"INT"!=e||(e="EN"),e},currency:function(){return $('meta[name="currency"]').attr("content")},culture:function(){return TSO.Helpers.language()+"_"+TSO.Helpers.country()},culturePath:function(){return"EN"==TSO.Helpers.country()?"en"==TSO.Helpers.language()?"/":"/"+TSO.Helpers.language()+"/":"/"+TSO.Helpers.country()+"/"+TSO.Helpers.language()+"/"},siteURL:function(e,t){return this.culturePath()+"site/"+e+"/"+encodeURIComponent(t)+".html"},pageType:function(){return $('meta[name="pageType"]').attr("content")},isMobile:function(){return!(!TSO.Helpers.isDevice()||!$("body").hasClass("tso-responsive-mobile-size"))},binaryStringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(e.charCodeAt(n));return t},binaryBytesToString:function(e){return e.map(function(e){return String.fromCharCode(e)}).join("")},stringToBytes:function(e){return TSO.Helpers.binaryStringToBytes(unescape(encodeURIComponent(e)))},formatAmount:function(e){return e.toString().replace(".",",").replace(/\B(?=(\d{3})+(?!\d))/g,".")},isTablet:function(){return!(!TSO.Helpers.isDevice||!$("body").hasClass("tso-responsive-tablet-size"))},isMobileOnly:function(){return!(!bowser.hasOwnProperty("mobile")||!bowser.mobile)},isDevice:function(){return!!(bowser.hasOwnProperty("tablet")&&bowser.tablet||bowser.hasOwnProperty("mobile")&&bowser.mobile)},isDesktopSize:function(){return $("body").hasClass("tso-responsive-desktop-size")},htmlDirection:function(){return $("html").attr("dir")},siteOnResize:function(){$(".tso-responsive-desktop-size-override").is(":visible")?$("body").addClass("tso-responsive-desktop-size"):$("body").removeClass("tso-responsive-desktop-size"),$(".tso-responsive-tablet-size-override").is(":visible")?$("body").addClass("tso-responsive-tablet-size"):$("body").removeClass("tso-responsive-tablet-size"),$(".tso-responsive-mobile-size-override").is(":visible")?$("body").addClass("tso-responsive-mobile-size"):$("body").removeClass("tso-responsive-mobile-size");var e=0;$(".max-height-list").each(function(){var t=$(this).find("li");t.height("");var n=0;t.each(function(){var t=$(this),r=$(this).height();r>n&&(n=r);var o=0;if($(".tso-responsive-mobile-size-override").is(":visible")){var s=t.find("img:visible").first();s&&(o=s.height())}else o=t.outerHeight()-t.find(".tso-block-small-description").outerHeight();var a=t.find(".tso-block-small-head");t.find(".tso-home-gmap").length>0&&0!=e?$(".tso-home-gmap").height(e-15):e=o,a.length>0&&a.css("top",e-a.outerHeight()+"px")}),t.each(function(e){2!=e&&$(this).height(n)})})},initCardEvents:function(){$(window).resize(function(){TSO.Helpers.resizeCards()}),$(window).on("load",function(){TSO.Helpers.resizeCards()})},resizeCards:function(){var e=$(".tso-card"),t=-1;e.each(function(){var e=$(this),n=parseFloat(e.css("padding-top"))||0,r=parseFloat(e.css("padding-bottom"))||0,o=parseFloat(e.css("border-top-width"))||0,s=parseFloat(e.css("border-bottom-width"))||0;$(this).removeAttr("style");var a=$(this).outerHeight()-n-r-o-s;a>t&&(t=a)}),e.height(t)},hashCode:function(e){var t,n,r,o=0;if(0==e.length)return o;for(t=0,r=e.length;t<r;t++)n=e.charCodeAt(t),o=(o<<5)-o+n,o|=0;return o},getUrlParameter:function(e,t){var n=decodeURIComponent(window.location.search.substring(1));null!=t&&""!=t&&(n=t);var r,o,s=n.split("&");for(o=0;o<s.length;o++)if(r=s[o].split("="),r[0]===e)return void 0!==r[1]&&r[1]},removeURLParameter:function(e,t){for(var n=encodeURIComponent(t)+"=",r=e.split(/[&;]/g),o=r.length;o-- >0;)-1!==r[o].lastIndexOf(n,0)&&r.splice(o,1);return e=r.join("&")},parseTruckTitleUrl:function(e){return encodeURIComponent(e).replace(/\s/g,"-").replace(/\//g,"").replace(/\./g,"").replace(/[^\w\s]/gi,"").substring(0,20)},getHash:function(){return TSO.Helpers.cleanupHash(window.location.hash)},cleanupHash:function(e){return e.replace("##","").replace("#/","").replace("/#","").replace("#","")},changeHash:function(e){e=e.replaceAll(" ","%20"),window.location.hash!=e&&(location.replace(e),$(".tso-header-menu-language [data-language-uid]").each(function(){var t=$(this).attr("href"),n=t.indexOf("#");n>=0&&(t=t.substr(0,n)),$(this).attr("href",t+e)}))},loadUserlikChat:function(){var e="";if("de"==TSO.Helpers.language())e="//userlike-cdn-widgets.s3-eu-west-1.amazonaws.com/55a6dc9423edd250d1099983d9d5a7477da7ad05974f16085fc69f4302536bee.js";else{if("en"!=TSO.Helpers.language())return;e="//userlike-cdn-widgets.s3-eu-west-1.amazonaws.com/03444cc4848995df212ea12b977d389ac5d9deabcf0d64c74a0320cb38b4d9b9.js"}var t=document.querySelector("script[src*='"+e+"']");if(!t){var n=document.getElementsByTagName("body");if(n&&n.length){var r=n[0];r&&(t=document.createElement("script"),t.setAttribute("src",e),t.setAttribute("type","text/javascript"),t.id="userlikeChatTool",t.setAttribute("charset","utf-8"),r.appendChild(t))}}var o=document.getElementById("userlike");o&&o.removeAttribute("hidden")},unloadUserlikChat:function(){var e=document.getElementById("userlikeChatTool");e&&e.remove();var t=document.getElementById("userlike");t&&t.setAttribute("hidden",!0)},validation:{emailValid:"^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$",valueRequired:"^(?!\\s*$).+",phoneValid:"([^-\\s\\d.()+])",validateFormElement:function(e,t){var n="";if("captcha"==e.type)e.text=grecaptcha.getResponse(),n=e.text;else if("email"==e.type){var r=new RegExp(TSO.Helpers.validation.emailValid);if((n=$.trim(e.text||""))&&!r.test(n))return{message:t.emailValid,type:"invalidEmail"}}else if("phone"==e.type){var r=new RegExp(TSO.Helpers.validation.phoneValid);if((n=$.trim(e.text||""))&&r.test(n))return{message:t.phoneValid,type:"invalidPhone"}}else n="options"==e.type?void 0!=e.selectedOption&&null!=e.selectedOption?e.selectedOption.toString():"":"dropdown"==e.type?e.selectedOption.valid?e.selectedOption:"":e.text;if(e.required&&!n)return"email"==e.type||"phone"==e.type||"captcha"==e.type?{message:t[e.type+"Required"],type:"required"}:{message:t[e.name.toLowerCase()+"Required"],type:"required"};if(e.required&&"checkbox"==e.type&&!e.selected)return{message:t[e.type+"Required"],type:"required"};if(e.maxLength&&n&&n.length>e.maxLength){var o=t[e.name.toLowerCase()+"MaxLength"]||"";return o=o.replace(/\{maxLength\}/g,e.maxLength),{message:o,type:"maxLength"}}return null}}}};
app.directive("ngEnter",function(){return function(e,t,o){t.bind("keydown keypress",function(t){13===t.which&&(e.$apply(function(){e.$eval(o.ngEnter)}),t.preventDefault())})}}),app.directive("tsoResponsive",["$compile","$rootScope",function(e,t){return{restrict:"A",link:function(e,t,o){bowser.hasOwnProperty("tablet")&&bowser.tablet?document.body.className="tso-responsive-device tso-responsive-tablet tso-reponsive-tablet-mobile":bowser.hasOwnProperty("mobile")&&bowser.mobile?document.body.className="tso-responsive-device tso-responsive-mobile tso-reponsive-tablet-mobile":document.body.className="tso-responsive-desktop",TSO.Helpers.siteOnResize(),setTimeout(function(){TSO.Helpers.siteOnResize()},500),$(document).ready(function(){$(window).resize(function(){setTimeout(function(){TSO.Helpers.siteOnResize()},50)})})}}}]),app.directive("tsoMenu",function(){return function(e,t,o){$(t).find("h4 a").click(function(){var e=$(this);setTimeout(function(){$("body").hasClass("tso-responsive-desktop-size")||$("html, body").animate({scrollTop:e.offset().top+"px"},"fast")},50)})}});
app.directive("truckTiles",["$compile","$rootScope","truckTilesRepository","$location",function(e,t,s,r){return{restrict:"A",templateUrl:"/typo3conf/ext/truckstore_template/Resources/Public/Src/components/truck-tiles/truck-tiles.html",link:function(e,c,u){e.title=u.title,e.platform=TSO.Helpers.getPlatform(),e.tilesSize=0,e.filterMapping={TRACTOR:0,TRUCKWITHBODY:1,TIPPER:5,CADDY:2,TRAILER:4,TRANSPORTER:3},e.lastSearchesTile=null;var o=!1;if(TSO.Helpers.getUrlParameter("debug"))e.trucks=TSODebugJSON_Tiles;else{for(var i=u.tiles.split(","),l="",p=0;p<i.length;p++)"LAST5SEARCHES"!==i[p]?(l.length>0&&(l+=","),l+=i[p]):(o=!0,e.lastSearchesTile={img:"/typo3conf/ext/truckstore_template/Resources/Public/Images/sizeL_Last_searches.png",imgTablet:"/typo3conf/ext/truckstore_template/Resources/Public/Images/sizeL_Last_searches.png",imgMobile:"/typo3conf/ext/truckstore_template/Resources/Public/Images/sizeL_Last_searches.png",title:t.tsoI18n.lastsearches_title,count:"-1"});s.getTiles(l).$promise.then(function(t){if(e.trucks=t.List,null!=e.trucks&&e.trucks.length>0)for(var s=0;s<e.trucks.length;s++)if(null!=e.trucks[s].type){var r=e.trucks[s].type[0].replace(",","").replace("/","");e.trucks[s].title=e.trucks[s].title.replace("/","/<br/>"),"tso"==e.platform?(e.trucks[s].img="/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/sizeL_"+r+".png",e.trucks[s].imgTablet="/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/sizeL_"+r+".png",e.trucks[s].imgMobile="/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/sizeL_"+r+".png"):(e.trucks[s].img="/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size1_"+r+".png",e.trucks[s].imgTablet="/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size2_"+r+".png",e.trucks[s].imgMobile="/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size3_"+r+".png")}e.tilesSize=e.trucks.length})}if(e.getSearchPageURL=function(e){return 0===e.count?"":-1==e.count?"search/last-searches":"search/#/vehicleType="+e.type.join(",").replaceAll(" ","%20")},TSO.Helpers.getUrlParameter("debug")){var a=r.url().split("debugtiles="),g=0;g=a.length>1?parseInt(a[1]):6,e.trucks=TSODebugJSON_Tiles.slice(0,g)}e.getTilesNumber=function(){return o?e.tilesSize+1:e.tilesSize}}}}]);var TSODebugJSON_Tiles=[{img:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size1_tractor.png",imgTablet:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size2_tractor.png",imgMobile:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size3_tractor.png",title:"Sattelzugmaschine",count:"1418"},{img:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size1_truckwithbody.png",imgTablet:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size2_truckwithbody.png",imgMobile:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size3_truckwithbody.png",title:"Lkw mit Aufbau",count:"1418"},{img:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size1_dump_truck.png",imgTablet:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size2_dump_truck.png",imgMobile:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size3_dump_truck.png",title:"Kipper",count:"544"},{img:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size1_demoutable.png",imgTablet:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size2_demoutable.png",imgMobile:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size3_demoutable.png",title:"Wechselrahmen / Fahrgestell",count:"245"},{img:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size1_trailer.png",imgTablet:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size2_trailer.png",imgMobile:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size3_trailer.png",title:"Anhanger / Sattelauflieger",count:"105"},{img:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size1_van.png",imgTablet:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size2_van.png",imgMobile:"/typo3conf/ext/truckstore_template/Resources/Public/Images/truck-types/size3_van.png",title:"Transporter",count:"306"}];
app.factory("truckTilesRepository",["$resource",function(e){return{getTiles:function(t){return e(TSO.ServicePath()+"widget/truck/countTypes/"+TSO.Helpers.culture()+"?tileType="+t).get()}}}]);
app.directive("truckNvis",["$compile","$rootScope","truckNvisRepository","$location",function(o,e,i,t){return{restrict:"A",link:function(o,e,t){i.getNewVehiclesInStock().$promise.then(function(e){o.count=e.count}),o.loadSearchPageIsNew=function(o){window.location="search/##isNew=isNew"}}}}]);
app.factory("truckNvisRepository",["$resource",function(e){return{getNewVehiclesInStock:function(){return e(TSO.ServicePath()+"widget/truck/new/"+TSO.Helpers.culture()).get()}}}]);
// Lazy loading of Google Map API
app.service("loadGoogleMapsAPI",["$window","$q",function(e,t){var o=t.defer();return e.initMaps=function(){o.resolve()},function(){var e=document.createElement("script");e.src="//maps.googleapis.com/maps/api/js?key="+TSO.MapsApiKey()+"&language="+TSO.Helpers.culture()+"&callback=initMaps",document.body.appendChild(e)}(),o.promise}]),app.directive("truckLocation",["$compile","$rootScope","truckLocationRepository","loadGoogleMapsAPI","$location","CacheFactory",function(e,t,o,a,r,s){return{restrict:"A",link:function(e,r,n){var i,l=[];e.truckStoreList={},TSOLocationResize.setupRefresh(t,e),e.renderMarkers=function(o){if(e.clearMarkers(),e.truckStoreCount>1||!e.hasLoc){$("#truck-location-title-count").html(e.truckStoreCount);for(var a=new google.maps.LatLngBounds,s={url:"/typo3conf/ext/truckstore_template/Resources/Public/Icons/svgs/location-pin.svg",size:new google.maps.Size(30,40),scaledSize:new google.maps.Size(30,40)},i=0;i<e.truckStoreCount;i++){var c=e.truckStoreList[i],d=new google.maps.LatLng(c.address.latitude,c.address.longtitude),u=new google.maps.Marker({map:o,draggable:!1,icon:s,optimized:!1,animation:google.maps.Animation.DROP,position:{lat:c.address.latitude,lng:c.address.longtitude}});a.extend(d),l.push(u)}o.fitBounds(a)}else{var c=e.truckStoreList[0],s={url:"/typo3conf/ext/truckstore_template/Resources/Public/Icons/svgs/location-pin.svg",size:new google.maps.Size(30,40),scaledSize:new google.maps.Size(30,40)};if($("#truck-location-title").html(n.centerfoundtext),null!=c){var g=TSO.Helpers.siteURL(c.centerId,c.name);null!=c.fax&&""==c.fax?$("#truck-location-subtitle").html('<a class="tso-block-small-link" href="'+g+'"><h3>'+t.tsoI18n.centerNamePrefix+" "+c.name+"</h3><p>"+c.address.streetName+" "+c.address.streetNumber+"</p><table class='tso-location-address-left-table'><tr><td>"+c.address.postalCode+" "+c.address.cityName+"</td></tr><tr><td>"+c.address.country+"</td></tr></table><table class='tso-location-address-right-table'><tr><td>T: "+c.phone1+"</td></tr></table></a>"):$("#truck-location-subtitle").html('<a class="tso-block-small-link" href="'+g+'"><h3>'+t.tsoI18n.centerNamePrefix+" "+c.name+"</h3><p>"+c.address.streetName+" "+c.address.streetNumber+"</p><table class='tso-location-address-left-table'><tr><td>"+c.address.postalCode+" "+c.address.cityName+"</td></tr><tr><td>"+c.address.country+"</td></tr></table><table class='tso-location-address-right-table'><tr><td>T: "+c.phone1+"</td></tr><tr><td>F: "+c.fax+"</td></tr></table></a>"),$(r).children("a").attr("href",g);var u=new google.maps.Marker({map:o,draggable:!1,icon:s,optimized:!1,animation:google.maps.Animation.DROP,position:{lat:c.address.latitude,lng:c.address.longtitude}});o.setCenter(u.position),l.push(u)}o.setZoom(10)}},e.clearMarkers=function(){for(var e=0;e<l.length;e++)l[e].setMap(null);l.length=0},e.geolocFail=function(){e.country||o.getNearest().$promise.then(function(t){e.truckStoreCount=t.List.length,e.truckStoreList=t.List,e.renderMarkers(i)})},e.initializeWidget=function(){if(i=new google.maps.Map($(".tso-home-gmap")[0],{center:{lat:47.6815813,lng:11.5663035},draggable:!1,scrollwheel:!1,disableDefaultUI:!0}),navigator.geolocation){var t=setTimeout(e.geolocFail,6e3);e.hasLoc=!1,navigator.geolocation.getCurrentPosition(function(a){clearTimeout(t),e.lat=a.coords.latitude,e.long=a.coords.longitude;var r=new google.maps.Geocoder,n={lat:e.lat,lng:e.long};r.geocode({location:n},function(t,a){if(a===google.maps.GeocoderStatus.OK){var r=t[1];if(r)for(var n=0;n<=r.address_components.length;n++)if(r.address_components[n]&&r.address_components[n].types)for(var l=0;l<=r.address_components[n].types.length;l++)"country"==r.address_components[n].types[l]&&(e.country=r.address_components[n].short_name,TSOCache.setItem(s,TSOCache.keys.SearchCountryIso(),e.country))}o.getNearest(e.lat,e.long,e.country).$promise.then(function(t){e.hasLoc=!0,e.truckStoreCount=t.List.length,e.truckStoreList=t.List,e.renderMarkers(i)})})},function(a){clearTimeout(t),e.country||o.getNearest().$promise.then(function(t){e.truckStoreCount=t.List.length,e.truckStoreList=t.List,e.renderMarkers(i)})},{enableHighAccuracy:!1,timeout:5e3,maximumAge:0})}else o.getNearest().$promise.then(function(t){e.hasLoc=!1,e.truckStoreCount=t.length,e.truckStoreList=t.List,e.renderMarkers(i)})},a.then(function(){e.initializeWidget()},function(){console.warn("Unable to load google maps...")})}}}]);
var TSOLocationResize={setupRefresh:function(i,e){$(window).resize(function(){setTimeout(function(){e.initializeWidget()},100)})}};
app.factory("truckLocationRepository",["$resource",function(e){return{getNearest:function(t,r,u){return u||(u=TSO.Helpers.country()),t||r?e(TSO.ServicePath()+"widget/location/culture/"+TSO.Helpers.culture()+"?country="+u+"&latitude="+t+"&longitude="+r).get():e(TSO.ServicePath()+"widget/location/culture/"+TSO.Helpers.culture()+"?country="+u).get()}}}]);
app.directive("truckLetter",["$compile","$rootScope","$sce","truckLetterRepository","$location",function(e,t,r,o,n){return{restrict:"A",templateUrl:"/typo3conf/ext/truckstore_template/Resources/Public/Src/components/truck-letter/truck-letter.html",link:function(e,n,s){var i="";e.$rootScope=t,e.truckletterResponse={},e.isOpened=!1,e.selectedCenters=[],e.centerSelectionOpen=!1,e.centerFilters=[],e.centerDirty=!1,e.isLoading=!0,e.successfulSubscription=!1,e.emailSent="",e.successMessage="",e.validationNewsletter="",e.scrollPosition=document.documentElement.scrollTop,e.loadTruckletter=function(){e.isLoading=!0,o.getForm().$promise.then(function(r){e.validationNewsletter="",e.truckletterResponse=r,e.fixFormObject(),e.isLoading=!1,setTimeout(function(){$("#truckletter-email").focus(),i=t.tsoI18n.truckletterSuccess,e.resetBodyHeight()},100)})},e.renderHtml=function(e){return r.trustAsHtml(e)},e.submitForm=function(){e.isLoading=!0;var t=e.fixRequest(e.truckletterResponse);if(null==t)return e.isLoading=!1,void setTimeout(function(){$("#truckletter-email").focus(),e.resetBodyHeight()},200);o.submitForm(angular.toJson(t)).$promise.then(function(t){t.hasErrors?(e.centerFilters=[],e.truckletterResponse.List=t.List,e.fixFormObject(),e.isLoading=!1,setTimeout(function(){$("#truckletter-email").focus(),e.resetBodyHeight()},200)):(e.successfulSubscription=!0,e.successMessage=i.replace("~truckletterEmail~",e.emailSent),e.validationNewsletter="")})},e.fixRequest=function(r){var o=jQuery.extend(!0,{},r),n=!0;e.validationNewsletter="";for(var s in o.List)o.List[s].hasOwnProperty("formElements")&&o.List[s].formElements[0].hasOwnProperty("options")&&delete o.List[s].formElements[0].selectedOption;for(var s in r.List)if("EMAIL"==r.List[s].name){r.List[s].message="";var i=TSO.Helpers.validation.validateFormElement(r.List[s],t.tsoI18n);i&&(r.List[s].message=i.message||" ",e.hasErrors=!0,n=!1),e.emailSent=r.List[s].text}else if("USER_CONSENT"==r.List[s].name){var i=TSO.Helpers.validation.validateFormElement(r.List[s],t.tsoI18n);r.List[s].message="",i&&(r.List[s].message=i.message||" ",e.hasErrors=!0,n=!1)}var l=0;for(var s in r.List)"checkbox"==r.List[s].type&&"CONTINENT"!=r.List[s].name&&"USER_CONSENT"!=r.List[s].name&&r.List[s].selected&&l++;return 0==l&&(e.validationNewsletter=t.tsoI18n.truckletterNewsletterSelected,n=!1),n?o:null},e.fixFormObject=function(){e.centerFilters=[];for(var t in e.truckletterResponse.List){var r=e.truckletterResponse.List[t];if("CONTINENT"==r.name)e.centerFilters.push(r);else if(r.hasOwnProperty("formElements")&&r.formElements[0].hasOwnProperty("options"))for(var o=0;o<r.formElements[0].options.length;o++)r.formElements[0].options[o].selected&&(r.formElements[0].selectedOption=r.formElements[0].options[o])}e.hasErrors=e.truckletterResponse.hasErrors,e.refreshSelected()},e.changeOptions=function(e,t){for(var r in t)t[r].selected=!1;e.selected=!0},e.toggleCenterSelection=function(){e.centerSelectionOpen=!e.centerSelectionOpen,e.centerSelectionOpen&&e.loadCountries()},e.toggleFormElement=function(e){e.selected=!e.selected},e.toggleInformationNoticeModal=function(){e.isInformationNoticeModalOpened=!e.isInformationNoticeModalOpened,e.sfScrollPosition=(window.pageYOffset||document.documentElement.scrollTop)+20},e.loadCountries=function(){e.refreshSelected()},t.toggleTruckletterInit=function(){e.scrollPosition=$(window).scrollTop(),TSO.Helpers.isMobile()||(e.scrollPosition+=50),e.initMobileHeightWatch(),t.toggleTruckLetterPopup()},e.initMobileHeightWatch=function(){e.$watch("isOpened",function(t,r){0==t&&e.resetBodyHeight()})},e.resetBodyHeight=function(){},t.toggleTruckLetterPopup=function(){e.isOpened=!e.isOpened,e.isOpened&&(e.successfulSubscription=!1,e.loadTruckletter(),e.centerSelectionOpen=!1,e.hasErrors=!1)},e.stopToggle=function(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e.cancelBubble=!0,e.returnValue=!1},e.saveCenters=function(){e.centerDirty=!1,e.centerSelectionOpen=!1,e.refreshSelected()},e.selectContinent=function(t,r){r.stopPropagation(),t.selected=!t.selected;for(var o in t.formElements){t.formElements[o].selected=t.selected;for(var n in t.formElements[o].formElements)t.formElements[o].formElements[n].selected=t.selected}e.centerDirty=!0,e.refreshSelected()},e.selectCountry=function(t,r,o){o.stopPropagation(),r.selected&&(t.selected=!1),r.selected=!r.selected;for(var n in r.formElements)r.formElements[n].selected=r.selected;e.centerDirty=!0,e.refreshSelected()},e.selectCity=function(t,r,o,n){n.stopPropagation(),o.selected&&(t.selected=!1,r.selected=!1),o.selected=!o.selected,e.centerDirty=!0,e.refreshSelected()},e.refreshSelected=function(){e.selectedCenters=[];for(var t=e.centerFilters,r=[],o=0;o<t.length;o++){if(!t[o].selected){for(var n=0,s=0;s<t[o].formElements.length;s++){for(var i=0,l=t[o].formElements[s],c=[],u=0;u<l.formElements.length;u++)l.formElements[u].selected&&(i++,c.push(l.formElements[u].title));i==l.formElements.length||l.selected?(l.selected=!0,r.push(l.title),n++):r=r.concat(c)}e.selectedCenters=e.selectedCenters.concat(r)}(n==t[o].formElements.length||t[o].selected)&&(e.selectedCenters.push(t[o].title),t[o].selected=!0)}}}}}]),app.directive("truckLetterButton",["$compile","$rootScope",function(e,t){return{restrict:"A",link:function(e,r,o){e.toggleTruckLetter=function(){console.log("truckletter trigger"),t.toggleTruckletterInit()}}}}]),app.directive("truckLetterConfirm",["$compile","truckLetterRepository","$rootScope",function(e,t,r){return{restrict:"A",link:function(e,r,o){var n=TSO.Helpers.getUrlParameter("uid");console.log(n),t.confirm(n)}}}]),app.directive("truckLetterUnsubscribe",["$compile","truckLetterRepository","$rootScope",function(e,t,r){return{restrict:"A",link:function(e,r,o){var n=TSO.Helpers.getUrlParameter("uid"),s=TSO.Helpers.getUrlParameter("typeLetter");t.unsubscribe(n,s)}}}]);
app.factory("truckLetterRepository",["$resource",function(e){return{getForm:function(){return e(TSO.ServicePath()+"widget/truck/letter/register/"+TSO.Helpers.culture()).get()},submitForm:function(t){return e(TSO.ServicePath()+"widget/truck/letter/register/"+TSO.Helpers.culture()).save(t)},confirm:function(t){return e(TSO.ServicePath()+"widget/truck/letter/confirm/"+TSO.Helpers.culture()).get({uid:t})},unsubscribe:function(t,r){return e(TSO.ServicePath()+"widget/truck/letter/unsubscribe/"+TSO.Helpers.culture()).get({uid:t,type:r})}}}]);
app.directive("truckCard",["$compile","$rootScope","$sce","$location",function(o,t,e,l){return{restrict:"C",templateUrl:"/typo3conf/ext/truckstore_template/Resources/Public/Src/components/truck-card/truck-card.html",scope:{truckCard:"&"},link:function(o,e,l){o.$rootScope=t,null==t.truckCards&&(t.truckCards=[]),o.truckCard={location:null==l.location?"":l.location.toString(),locationFlag:null==l.locationFlag?"":l.locationFlag.toString(),employeeName:null==l.employeeName?"":l.employeeName.toString(),subName:null==l.subName?"":l.subName.toString(),telephone:null==l.telephone?"":l.telephone.toString(),mobile:null==l.mobile?"":l.mobile.toString(),fax:null==l.fax?"":l.fax.toString(),employeeImg:null==l.employeeImg?"":l.employeeImg.toString(),position:null==l.position?"":l.position.toString()}}}}]);
app.directive("truckCookies",["$compile","$rootScope","$sce","$cookies","$location",function(e,o,t,c,n){return{restrict:"A",templateUrl:"/typo3conf/ext/truckstore_template/Resources/Public/Src/components/truck-cookies/truck-cookies.html",link:function(e,n,r){e.cookiesOpened=!1;var a="";null==c.get("tso_cookie_acceptance_"+TSO.Helpers.language().toLowerCase())&&(e.cookiesOpened=!0),o.$watch("tsoI18n",function(c,n){null!=o.tsoI18n&&null!=o.tsoI18n.cookieNoticeContent&&(a=o.tsoI18n.cookieNoticeContent,"EN"==TSO.Helpers.country()?(a=a.replace("/~country~/","/"),"en"==TSO.Helpers.language()&&(a=a.replace("/~language~/","/"))):a=a.replace("~country~",TSO.Helpers.country()),a=a.replace("~language~",TSO.Helpers.language()),e.cookieContent=t.trustAsHtml("<p>"+a+"</p>"))}),e.toggleCookiePopup=function(){var o=new Date;o.setDate(o.getDate()+365),c.put("tso_cookie_acceptance_"+TSO.Helpers.language().toLowerCase(),1,{expires:o,path:"/"}),e.cookiesOpened=!1}}}}]);
app.factory("autoCompleteDataService",["$rootScope","$resource","$window",function(e,t,a){return{getUvidsURL:function(){return TSO.ServicePath()+"widget/truck/search/suggest/"+TSO.Helpers.language()+"?type=uvid&term="},getManufacturersURL:function(){return TSO.ServicePath()+"widget/truck/search/suggest/"+TSO.Helpers.language()+"?type=manufacturer&term="},getModelsURL:function(){return TSO.ServicePath()+"widget/truck/search/suggest/"+TSO.Helpers.language()+"?type=model&term="},getTypesURL:function(){return TSO.ServicePath()+"widget/truck/search/suggest/"+TSO.Helpers.language()+"?type=type&term="},getVehicleTypesURL:function(){return TSO.ServicePath()+"widget/truck/search/suggest/"+TSO.Helpers.language()+"?type=vehicleType&term="},getBodyGroupURL:function(){return TSO.ServicePath()+"widget/truck/search/suggest/"+TSO.Helpers.language()+"?type=bodyGroup&term="},getBodyURL:function(){return TSO.ServicePath()+"widget/truck/search/suggest/"+TSO.Helpers.language()+"?type=body&term="},getEmissionStandardURL:function(){return TSO.ServicePath()+"widget/truck/search/suggest/"+TSO.Helpers.language()+"?type=emissionStandard&term="},getCabinTypeURL:function(){return TSO.ServicePath()+"widget/truck/search/suggest/"+TSO.Helpers.language()+"?type=cabinType&term="},getVehicleDetails:function(e){a.location.href=TSO.Helpers.culturePath()+"detail/"+e+".html"},getManufacturerSearch:function(e){a.location=TSO.Helpers.culturePath()+"search/#/manufacturer="+e,-1!=a.location.pathname.search("search.html")||-1!=a.location.pathname.search("search")&&a.location.reload()},getModelSearch:function(e){a.location=TSO.Helpers.culturePath()+"search/#/modelName="+e,-1!=a.location.pathname.search("search.html")||-1!=a.location.pathname.search("search")&&a.location.reload()},getTypeSearch:function(e){a.location=TSO.Helpers.culturePath()+"search/#/type="+e,-1!=a.location.pathname.search("search.html")||-1!=a.location.pathname.search("search")&&a.location.reload()},getVehicleTypeSearch:function(e){a.location=TSO.Helpers.culturePath()+"search/#/vehicleType="+e,-1!=a.location.pathname.search("search.html")||-1!=a.location.pathname.search("search")&&a.location.reload()},getBodyGroupSearch:function(e){a.location=TSO.Helpers.culturePath()+"search/#/bodyGroup="+e,-1!=a.location.pathname.search("search.html")||-1!=a.location.pathname.search("search")&&a.location.reload()},getBodySearch:function(e){a.location=TSO.Helpers.culturePath()+"search/#/body="+e,-1!=a.location.pathname.search("search.html")||-1!=a.location.pathname.search("search")&&a.location.reload()},getEmissionStandardSearch:function(e){a.location=TSO.Helpers.culturePath()+"search/#/emmissionsStandard="+e,-1!=a.location.pathname.search("search.html")||-1!=a.location.pathname.search("search")&&a.location.reload()},getCabinTypeSearch:function(e){a.location=TSO.Helpers.culturePath()+"search/#/cab="+e,-1!=a.location.pathname.search("search.html")||-1!=a.location.pathname.search("search")&&a.location.reload()}}}]),app.directive("autoCompleteField",["$rootScope","autoCompleteDataService",function(e,t){return{restrict:"A",templateUrl:"/typo3conf/ext/truckstore_template/Resources/Public/Src/components/truck-search-header/truck-search-header.html"}}]),app.directive("autoComplete",["$rootScope","autoCompleteDataService",function(e,t){return{restrict:"A",requre:"^^tsoI18n",link:function(a,r,c){r.typeahead({minLength:1,maxItem:8,order:"asc",hint:!0,dynamic:!0,mustSelectItem:!0,group:{key:"name"},display:["text"],maxItemPerGroup:5,highlight:!0,source:{vehicles:{ajax:function(e){return{url:t.getUvidsURL()+e}}},manufacturers:{ajax:function(e){return{url:t.getManufacturersURL()+e}}},models:{ajax:function(e){return{url:t.getModelsURL()+e}}},types:{ajax:function(e){return{url:t.getTypesURL()+e}}},vehicleTypes:{ajax:function(e){return{url:t.getVehicleTypesURL()+e}}},bodyGroup:{ajax:function(e){return{url:t.getBodyGroupURL()+e}}},body:{ajax:function(e){return{url:t.getBodyURL()+e}}},emissionStandard:{ajax:function(e){return{url:t.getEmissionStandardURL()+e}}},cabinType:{ajax:function(e){return{url:t.getCabinTypeURL()+e}}}},callback:{onClick:function(e,r,c,n){a.itemType=c.type,a.itemValue=c.defaultText,"uvid"==c.type?t.getVehicleDetails(a.itemValue):"manufacturer"==c.type?t.getManufacturerSearch(a.itemValue):"model"==c.type?t.getModelSearch(a.itemValue):"type"==c.type?t.getTypeSearch(a.itemValue):"vehicleType"==c.type?t.getVehicleTypeSearch(a.itemValue):"bodyGroup"==c.type?t.getBodyGroupSearch(a.itemValue):"body"==c.type?t.getBodySearch(a.itemValue):"emissionStandard"==c.type?t.getEmissionStandardSearch(a.itemValue):"cabinType"==c.type&&t.getCabinTypeSearch(a.itemValue)}}}),a.submitSearch=function(){a.itemValue&&""!=a.itemValue.trim()&&("uvid"==a.itemType?t.getVehicleDetails(a.itemValue):"manufacturer"==a.itemType?t.getManufacturerSearch(a.itemValue):"model"==a.itemType?t.getModelSearch(a.itemValue):"type"==a.itemType?t.getTypeSearch(a.itemValue):"vehicleType"==a.itemType?t.getVehicleTypeSearch(a.itemValue):"bodyGroup"==a.itemType?t.getBodyGroupSearch(a.itemValue):"body"==a.itemType?t.getBodySearch(a.itemValue):"emissionStandard"==a.itemType?t.getEmissionStandardSearch(a.itemValue):"cabinType"==a.itemType&&t.getCabinTypeSearch(a.itemValue))},a.placeholder=e.tsoI18n.searchHeaderPlaceholder}}}]);
app.directive("tsoFavoritesHeader",["$compile","$rootScope","truckFavoritesRepository","CacheFactory","uuid",function(e,t,o,r,a){return{restrict:"E",templateUrl:"/typo3conf/ext/truckstore_template/Resources/Public/Src/components/truck-favorites-header/truck-favorites-header.html",link:function(e,n,i){e.favoritesCount=0,e.favoritesLink=TSO.Helpers.culturePath()+"favourites.html";var s=TSOCache.getItemFromInfiniteCache(r,TSOCache.keys.UserUUID());s||(TSOCache.setItemInInfiniteCache(r,TSOCache.keys.UserUUID(),a.v4()),s=TSOCache.getItemFromInfiniteCache(r,TSOCache.keys.UserUUID())),e.favoritesText=t.tsoI18n.bookmarkList,e.$on("favoritesCountLoaded",function(t,o){e.favoritesCount=o}),e.$on("addToFavourites",function(t){t.defaultPrevented||(e.favoritesCount++,t.preventDefault())}),e.$on("removeFromFavourites",function(t){t.defaultPrevented||(e.favoritesCount--,t.preventDefault())}),e.$on("removeAllFromFavourites",function(t){t.defaultPrevented||(e.favoritesCount=0,t.preventDefault())}),e.favoritesCount=o.getFavoritesCount(s)}}}]);
app.factory("truckFavoritesRepository",["$resource","$rootScope",function(e,t){var r=null;return{getFavoritesCount:function(u){if(null!=r)return r;r=0,e(TSO.ServicePath()+"widget/favourites/count?uuid="+u,null,{post:{method:"POST"}}).post().$promise.then(function(e){e.value&&(r=e.value,t.$broadcast("favoritesCountLoaded",e.value))})},getFavoriteVehicles:function(t){return e(TSO.ServicePath()+"widget/favourites/list/"+TSO.Helpers.culture()+"?uuid="+t).get()},putVehicleToFavorites:function(t,r){return e(TSO.ServicePath()+"widget/favourites/add?uuid="+t+"&uvid="+r,null,{update:{method:"PUT"}}).update()},removeVehicleFromFavorites:function(t,r){return e(TSO.ServicePath()+"widget/favourites/remove?uuid="+t+"&uvid="+r).remove()},removeAllVehiclesFromFavorites:function(t){return e(TSO.ServicePath()+"widget/favourites/remove/all?uuid="+t).remove()}}}]);
app.directive("truckPurchase",["$compile","$rootScope","$sce","truckPurchaseRepository","$location",function(e,o,r,t,s){return{restrict:"A",templateUrl:"/typo3conf/ext/truckstore_template/Resources/Public/Src/components/truck-purchase/truck-purchase.html",link:function(e,s,n){var a="";e.purchaseForm={},e.purchasePopupOpened=!1,e.recaptchaKey="",e.breakPoints=["RECIPIENT","FIRST_REGISTRATION","VEHICLE_COMMENTS","reCAPTCHA"],e.popupPoints=["BY_TELEPHONE","BY_ELECTRONIC_POST","BY_POST"],e.vehicleTitleBreak="RECIPIENT",t.getForm().$promise.then(function(o){e.purchaseForm=o.List,e.fixRequestPurchase()}),t.getEmployees().$promise.then(function(o){e.purchaseEmployees=o.List,setTimeout(function(){TSO.Helpers.resizeCards()},0)}),e.submitPurchaseForm=function(){var r=!1;for(var s in e.purchaseForm){if("captcha"==e.purchaseForm[s].type)e.recaptchaKey=$("#g-recaptcha-response").val();else if($.inArray(e.purchaseForm[s].name,e.popupPoints)>=0)continue;var a=TSO.Helpers.validation.validateFormElement(e.purchaseForm[s],o.tsoI18n);e.purchaseForm[s].message="",a&&(e.purchaseForm[s].message=a.message||" ",r=!0)}r||t.saveForm(e.preRequestFormat()).$promise.then(function(o){o.hasErrors?(e.purchaseForm=o.form,e.fixRequestPurchase()):n.successUrl?window.location=n.successUrl:window.location=TSO.Helpers.culturePath()+"home.html"})},e.openPurchase=function(){var r=!1;for(var t in e.purchaseForm){if("captcha"==e.purchaseForm[t].type)e.recaptchaKey=$("#g-recaptcha-response").val();else if($.inArray(e.purchaseForm[t].name,e.popupPoints)>=0)continue;var s=TSO.Helpers.validation.validateFormElement(e.purchaseForm[t],o.tsoI18n);e.purchaseForm[t].message="",s&&(e.purchaseForm[t].message=s.message||" ",r=!0)}r||(e.purchasePopupOpened=!0,e.purchaseScrollPosition=$(document).scrollTop()+25)},e.togglePurchasePopup=function(){e.purchasePopupOpened=!e.purchasePopupOpened},e.togglePurchasePrivacyPopup=function(){e.purchasePopupPrivacyOpened=!e.purchasePopupPrivacyOpened},e.toggleFormElement=function(e){e.selected=!e.selected},e.renderHtml=function(e){return r.trustAsHtml(e)},e.toggleInformationNoticeModal=function(){e.isInformationNoticeModalOpened=!e.isInformationNoticeModalOpened,e.sfScrollPosition=(window.pageYOffset||document.documentElement.scrollTop)+20},e.preRequestFormat=function(){var o=e.purchaseForm;for(var r in o){if("group"==o[r].type)for(var t in o[r].formElements)delete o[r].formElements[t].message;"captcha"==o[r].type&&(o[r].text=e.recaptchaKey),delete o[r].message}return o=JSON.parse(angular.toJson(o)),{List:o}},e.purchaseRadioOption=function(e,o){for(var r in o.options)o.options[r].selected=!1;o.options[e].selected=!0,o.selectedOption=e},e.fixRequestPurchase=function(){for(var o in e.purchaseForm){var r=e.purchaseForm[o];if("dropdown"==r.type)for(var t in r.options)r.options[t].selected&&(r.selectedOption=r.options[t]);else if("group"==r.type)for(var t in r.formElements)for(var s in r.formElements[t].options)r.formElements[t].options[s].selected&&(r.formElements[t].selectedOption=r.formElements[t].options[s]);else if("options"==r.type){r.selectedOption="";for(var t in r.options)r.options[t].selected&&(r.selectedOption=t)}else"captcha"==r.type&&(a=r.siteKey,$.getScript("https://www.google.com/recaptcha/api.js?hl="+TSO.Helpers.language(),function(e,o,r){setTimeout(function(){grecaptcha.render("recaptcha-purchase",{sitekey:a})},1e3)}))}setTimeout(function(){for(var e=$(".RECIPIENT-formElement").find("select").find("option"),o=0;o<e.length;o++)e[o].label.indexOf("--")>-1&&(e[o].disabled=!0)},100)},TSO.Helpers.initCardEvents()}}}]);
app.factory("truckPurchaseRepository",["$resource",function(e){return{getForm:function(){return e(TSO.ServicePath()+"widget/purchases/purchase/"+TSO.Helpers.culture()).get()},saveForm:function(r,t){return e(TSO.ServicePath()+"widget/purchases/purchase/"+TSO.Helpers.culture()).save(r)},getEmployees:function(){return e(TSO.ServicePath()+"widget/employee/"+TSO.Helpers.culture()).get({purchase:!0})}}}]);