{"version":3,"sources":["vendd.globalHelpers.js","postMessages.js","functions.js","localstorage.js","scriptsActivator.js","vendd.service.js","recipe.library.js","callbacks.js","init.js"],"names":["venddSetCookie","cname","cvalue","exdays","d","Date","setTime","getTime","expires","toUTCString","document","cookie","venddGetCookie","name","ca","split","i","length","c","charAt","substring","indexOf","toArrayBuffer","buf","ab","ArrayBuffer","view","Uint8Array","decodeEntities","element","createElement","str","replace","innerHTML","textContent","allowOnlyNumbersInput","$container","$","keyup","value","this","stringToNumber","returnValue","currency","decimal","val","LhApp","Context","Currency","Symbol","DecimalSeparator","trim","parseFloat","toFixed","numberToString","addCurrency","clearZeros","fractional","RegExp","test","PostMessages","intervalId","lastHash","attachedCallback","window","receiveMessage","callback","sourceOrigin","e","origin","Object","prototype","toString","call","clearInterval","setInterval","hash","location","re","data","message","Action","Vendd","MessageBus","publishAsync","UserSelect","Messages","SubmitSetInterfaceUserInlineAdmin","LoginName","UserEmail","RedirectToAccount","OrderId","InLineAdminEndpoint","Function","Url","QueryString","String","Tracking","Actions","ActionsType","ORDER_COMPLETION","StorageType","SESSION","PERSISTENT","CROSS_TABS_SESSION","Counter","actionsType","storageType","actionIdentifier","storekey","storage","localStorage","sessionStorage","action","getCount","store","JSON","parse","getItem","parseInt","increment","setItem","stringify","reset","undefined","updateTrackingData","updateData","TrackingData","extend","ga","canTrack","InitGoogleAnalytics","apply","arguments","cookieType","Consents","ConsentsManager","CheckoutConsentsManager","cookiesStatus","IsConsentsEnabled","getTrackingModel","trackingModel","IsTrackingEnabled","getTracker","trackerCode","tracker","Trackers","toLowerCase","Properties","getFeedItemId","product","datasource","FeedCodes","FeedCodeField","productId","colorId","sizeId","dim3Id","dim4Id","dim5Id","dim6Id","merchantId","ParentProductId","colors","Dimensions","find","IsColor","sizes","IsSize","dim3s","IsDim3","dim4s","IsDim4","dim5s","IsDim5","dim6s","IsDim6","merchants","IsMerchant","color","Versions","ProductId","SelectedProductId","size","dim3","dim4","dim5","dim6","merchant","VersionId","ColorId","SizeId","Dim3Id","Dim4Id","Dim5Id","Dim6Id","MerchantId","SplitFeedBySize","SplitFeedByDim3","SplitFeedByDim4","SplitFeedByDim5","SplitFeedByDim6","SplitFeedByMerchant","gtag","dataLayer","push","InitGoogleTagManager","tagManagerCode","GoogleTagManagerCode","googleTagManagerInitialized","consentsManager","LoadTagManagerWhenConsentsGranted","marketingCookies","statisticCookies","functionalityCookies","EnableGoogleTagManagerConsents","ad_storage","analytics_storage","functionality_storage","w","s","l","gtm.start","event","f","getElementsByTagName","j","async","src","parentNode","insertBefore","consentsCookie","Cookies","getJSON","functionalityCookiesEnabled","marketingCookiesEnabled","statisticCookiesEnabled","userHasSetCookies","CookiesDefaultActive","analyticsCode","GoogleAnalyticsCode","googleAnalyticsInitialized","o","r","q","a","m","getServiceEndpoint","url","rewritedUrl","Request","BaseUrl","unescape","FriendlyUrl","queryString","initialQueryString","iid","getValueOf","RawUrl","Item","Id","domainUrl","qsrt","qArray","qparts","qpart","qparams","parts","pName","decodeURIComponent","pValue","parameterKey","parameterValue","href","parameters","pair","setParameterValue","setParameterValueOnUrl","hasQueryString","join","removeParameter","parameterKeys","removeParametersFromUrl","removeParameterFromUrl","removeParameters","newUrl","each","index","splice","getText","key","Text","match","resource","getTranslatableTextFromServer","result","ajax","type","dataType","contentType","ContentType","success","response","isEmail","text","isAlphaNumeric","initVisitorState","cookieValue","get","checkAndUpdateVisitorState","Service","onSuccess","res","oldUrl","cookieValueAsUrl","removeClass","removeAttr","oldLanguageCode","newLanguageCode","set","secure","IsSecure","samesite","oldCountryCode","newCountryCode","oldCurrencyCode","newCurrencyCode","hideExpandables","wrapper","item","$expandable","bindUndropables","$wrapper","on","preventDefault","bindExpandables","click","stopPropagation","triggerValue","$expandableContainer","$triggers","unbind","wItem","wItemContainer","hasClass","addClass","EventManager","trigger","isButtonDisabled","buttonWrapper","isDisabled","tagName","is","$internalButton","bindHrefButtons","bindScrollable","$this","time","offset","animate","scrollTop","height","top","bindLazyLoadableImages","innerWrapper","$innerWrapper","$lazyLoadOptions","opts","defOptions","effect","$images","fn","lazyload","remove","inArray","events","bind","PageTrackingRequest","dataItem","querystring","query","cookies","Name","Value","Expires","Path","MailChimpEcommerce360Tracking","oId","cId","eId","orderId","campaignId","emailId","applyExchangeRate","price","applyExchangeRateExtended","ExchangeRate","rate","showProductWishlists","MultipleWishlistsEnabled","$wishlistsWrapper","model","UserWishlist","GetClientModel","Product","html","Handlebars","bindProductWishlists","show","closest","$wrper","qs","id","skuId","path","qty","listId","currentListId","Wishlist","Add","Widget","OpenWidget","WishlistWidget","hideAllProductWishlists","el","hide","RenderPrice","renderPriceExtended","RenderPriceExtended","isShopDefaultCurrency","separatorSymbol","prefixSymbol","suffixSymbol","renderPrice","symbol","numberOfDigits","NumberOfDigits","symbolShownFirst","SymbolShownFirst","doShowSymbol","DoShowSymbol","ShopDefaultCurrency","formatedPrice","RenderPointsPrice","pointsPrice","renderPointsPriceExtended","RenderPointsPriceExtended","commaSymbol","innerSuffixSymbol","validateClientModel","LangCode","Language","ReplacePrices","obj","itemId","attr","itemData","filter","DeletedPrice","Price","TotalPointsPrice","TotalPointsGain","PointsPrice","PointsGain","ReplaceAvailabilities","cartEnabled","CanBuy","CanBuyWithPoints","CanAddToList","validateTaxIdentifier","isInvoice","countryCode","taxIdentifier","isNaN","arrTaxId","map","Math","pow","pauseScroll","init","scroll","disqus_config","page","identifier","replaceIframe","idFrame","originalFrame","getElementById","newFrame","getAttribute","width","style","display","replaceChild","convertToGreek","toUpperCase","newstr","len","convertCharacters","convertToUppercase","character","removeItem","Storage","_setItem","ready","ScriptsActivator","funcLoaded","markLoaded","statLoaded","loadScripts","scripts","keys","skey","ss","loadFunctionalityScripts","funcFn","loadMarketingScripts","markFn","loadStatisticsScripts","statFn","loadAllScripts","func","mark","stat","removeScriptsElements","script","_recipes","returnResponse","recipeId","statusCode","errorCode","status","ErrorCode","getRecipe","recipeModel","testModel","recipe","_","isArray","first","x","RecipeId","TotalCount","getTotalQuantity","ingredientId","items","RecipeItems","IngredientId","reduce","memo","Quantity","getGroupQuantity","group","GroupId","RecipeLibrary","DeclareState","isValid","GetModel","InitRecipe","force","AFirstInclusion","Ingredients","Groups","Categories","indexCategory","category","indexGroup","VisualGroups","visualgroup","groupItems","vg","sum","IsMultiSelect","MinQuantity","MaxQuantity","DefaultQuantities","sampleOptionItemNone","CanRemove","Category","DefaultQuantity","DeletedPriceText","PriceText","PriceWithoutVat","PriceWithoutVatText","Weight","OrderNumber","Quanta","QuantaText","RecipeGroupId","RecipeGroupName","Stock","TaxClassId","VariantId","IsNullable","Items","unshift","indexItem","HasValidDefaultValues","IsMandatory","Disabled","Checked","IsDefault","ingredient","CategoryCode","ManufacturerProductCode","ProductItemCode","RecipeItemCode","ProductItemId","RecipeItemId","TotalPrice","TotalPriceWithoutVat","IsStandard","SubRecipeId","SubRecipeCode","SubRecipe","HashCode","getRecipeItemsHashCode","ResetRecipe","AddIngredient","quantity","isTotal","g","isCompatible","CheckIncompatibles","responsePrerequisites","CheckPrerequisites","successPrerequisites","BothPrerequisite","recipeIngredient","CheckPrerequisitesAnyOfSet","totalIngredientQuantity","round","priceWithoutVat","ParentRecipeId","parentModel","ParentRecipeItemId","parentIngredient","max","RemoveIngredient","recursive","ingredientsToBeRemoved","Prerequisites","some","ChangeIngredient","ingredientIdFrom","ingredientIdTo","groupFrom","ingredientFrom","GetFullRecipeItems","recipeItems","concat","GetRecipeItems","GetOneDealerData","ManufacturerName","ProductCode","ManufacturerCode","Series","Guid","Prices","OptionalTotalPrice","FixJSFloatBug","OptionalTotalPriceWithoutVat","StandardTotalPrice","StandardTotalPriceWithoutVat","InitialPrice","InitialPriceWithoutVat","ModelImageAbsoluteUrl","ProductImageUrl","cartTypeCode","Attributes","Code","CarTypeCode","fuelTypeCode","FuelTypeCode","attributes","AttributeCode","Type","ValueType","ItemCode","IsPackage","ParentPackageCode","OptionType","SetRecipeItems","GetCheckedRecipeItems","forceOptional","checkedRecipeItems","optionalTotalPrice","optionalTotalItems","standardTotalPrice","standardTotalItems","optionalTotalPriceWithoutVat","standardTotalPriceWithoutVat","indexInArray","groupQuantity","isChecked","selectedItems","isStandard","totalPrice","totalPriceWithoutVat","ImageUrl","subCheckedRecipeItems","CheckedRecipeItems","uncheckedRecipeItems","reject","checked","CheckedItemsOptionalTotal","CheckedItemsStandardTotal","UncheckedRecipeItems","UnitPrice","UnitPriceWithoutVat","GetPrices","prices","ri","defaultQuantity","initialPrice","initialPriceWithoutVat","optionalQuantity","subPrices","GetWeight","weightObj","InitialWeight","OptionalTotalWeight","GetEnabledItems","EnabledItems","DisableItems","GroupErrors","Errors","totalQuantity","extraQuantity","ExtraQuantity","disableAllGroup","indexVisualGroup","visualGroup","canAdd","canRemove","checkIncompatibles","isEnabledIncompatible","BothSelected","checkPrerequisites","isEnabledPrerequisites","checkPrerequisitesAnyOfSet","CanAdd","Incompatibles","MissingPrerequisites","MissingAnyOfPrerequisites","groupErrorCode","CategoryName","incompatibles","missingPrerequisites","bothPrerequisite","hasMissingAnyOfPrerequisites","RequiresAnyOfSet","requiredSetItems","RequiresAnyOfItems","missingAnyOfPrerequisites","IsValid","IngredientsErrors","errorCodes","ErrorCodes","CompareModels","savedModel","ingedientsSavedModel","sortBy","ingedientsSavedModelHashCode","ingedientsModel","ingedientsModelHashCode","groupsSavedModel","savedGroupsModelHashCode","groupsModel","groupsModelHashCode","savedModelHashCode","MaxFreeQuantity","MaxReplaceQuantity","modelHashCode","IngredientsWarnings","savedIngredient","validatedModel","GenerateGlobalId","config","_def","Deferred","defaultConfiguration","Force","FriendlyName","Vin","PartnerId","serviceurl","GlobalId","SavedGlobalIdToLocal","SaveGlobalIdToLocal","SaveRecipeItemsToLocal","resolve","onError","currentHashCode","savedHashCode","GetLocalStorageRecipeItemsHashCode","HtmlData","Body","jsonData","ConvertToSavedModel","requestData","ConfigurationJson","ProductIdentifier","IsShare","error","promise","AssignConfigurationToUser","LoadFromGlobalId","Html","Pdf","compareResult","subrecipeCompareResults","SubRecipes","subrecipeData","globalId","dataLocalStorage","LoadFromLocalRecipeItems","Recipe","ClearLocalStorage","converModelToSaveDataModel","converGroupsToSaveDataModel","converIngedientToSaveDataModel","groups","ingredients","Tests","0","console","log","1","2","options","defOpts","serviceUrl","onErrorInternal","method","rawdata","servicenamespace","onFailure","err","onUnauthenticated","Error","protocol","host","locationQueryParams","serviceQueryParams","_query","_data","param","ex","responseJSON","ExceptionType","pop","Message","failure","recaptchaLoaded","recaptchaMessagePublished","callback_recaptcha","checkAsyncLoad","googleMapsLoaded","googleMapsMessagePublished","callback_googlemaps","venddLoaded","callback_vendd","Plugins","RecaptcaLoaded","GoogleMapsLoaded","checkout_callback_googlemaps","angular","scope","Control","SetMap","Scripts"],"mappings":"AAAA,SAAAA,eAAAC,MAAAC,OAAAC,QACA,IAAAC,EAAA,IAAAC,KACAD,EAAAE,QAAAF,EAAAG,UAAA,GAAAJ,OAAA,GAAA,GAAA,KACA,IAAAK,QAAA,WAAAJ,EAAAK,cACAC,SAAAC,OAAAV,MAAA,IAAAC,OAAA,KAAAM,QAAA,WAGA,SAAAI,eAAAX,OAGA,IAFA,IAAAY,KAAAZ,MAAA,IACAa,GAAAJ,SAAAC,OAAAI,MAAA,KACAC,EAAA,EAAAA,EAAAF,GAAAG,OAAAD,IAAA,CAEA,IADA,IAAAE,EAAAJ,GAAAE,GACA,KAAAE,EAAAC,OAAA,IAAAD,EAAAA,EAAAE,UAAA,GACA,GAAA,GAAAF,EAAAG,QAAAR,MAAA,OAAAK,EAAAE,UAAAP,KAAAI,OAAAC,EAAAD,QAEA,MAAA,GAGA,SAAAK,cAAAC,KAGA,IAFA,IAAAC,GAAA,IAAAC,YAAAF,IAAAN,QACAS,KAAA,IAAAC,WAAAH,IACAR,EAAA,EAAAA,EAAAO,IAAAN,SAAAD,EACAU,KAAAV,GAAAO,IAAAP,GAEA,OAAAQ,GAGA,IAAAI,eAAA,WACA,IAAAC,QAAAnB,SAAAoB,cAAA,OAcA,OAZA,SAAAC,K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EAqc,UAAA,GC3nDA+T,iBAAA,EACAC,2BAAA,EACAC,mBAAA,WACAF,iBAAA,EACAG,kBAGAC,kBAAA,EACAC,4BAAA,EACAC,oBAAA,WACAF,kBAAA,EACAD,kBAGAI,aAAA,EACAC,eAAA,WACAD,aAAA,EACAJ,kBAGAA,eAAA,WACAI,cAGAP,kBAAAC,4BACArwB,MAAAC,WAAAC,aAAA,iBAAA,IAAAF,MAAA6wB,QAAAzwB,SAAA0wB,gBACAT,2BAAA,GAGAG,mBAAAC,6BACAzwB,MAAAC,WAAAC,aAAA,iBAAA,IAAAF,MAAA6wB,QAAAzwB,SAAA2wB,kBACAN,4BAAA,KAKA,SAAAO,+BAEAC,QAAAt0B,QAAA,oBAAA2d,MAAA,WACAnd,EAAA,oBAAA+zB,SAAA/zB,EAAA,oBAAA+zB,QAAAC,SAAA,mBAAAh0B,EAAA,oBAAA+zB,QAAAC,QAAA,QACAh0B,EAAA,oBAAA+zB,QAAAC,QAAAC,QAAA,KCxCAj0B,EAAA3B,UAAA8e,MAAA,WAEAta,OAAAA,MAAAqxB,SAAA,mBAAArxB,MAAAqxB,QAAAxY,OAEA7Y,MAAAqxB,QAAAxY,OAEAjb,OAAAA,MAAAib,MAAA,mBAAAjb,MAAAib,MACAjb,MAAAib","file":"vendd.global.min.js","sourcesContent":["function venddSetCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n var expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \"; \" + expires + \"; \" + \"path=/\";\n}\n\nfunction venddGetCookie(cname) {\n var name = cname + \"=\";\n var ca = document.cookie.split(';');\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n while (c.charAt(0) == ' ') c = c.substring(1);\n if (c.indexOf(name) == 0) return c.substring(name.length, c.length);\n }\n return \"\";\n}\n\nfunction toArrayBuffer(buf) {\n\tvar ab = new ArrayBuffer(buf.length);\n\tvar view = new Uint8Array(ab);\n\tfor (var i = 0; i < buf.length; ++i) {\n\t\tview[i] = buf[i];\n\t}\n\treturn ab;\n}\n\nvar decodeEntities = (function() {\n var element = document.createElement('div');\n \n function decodeHTMLEntities (str) {\n if(str && typeof str === 'string') {\n str = str.replace(/]*>([\\S\\s]*?)<\\/script>/gmi, '');\n str = str.replace(/<\\/?\\w(?:[^\"'>]|\"[^\"]*\"|'[^']*')*>/gmi, '');\n element.innerHTML = str;\n str = element.textContent;\n element.textContent = '';\n }\n \n return str;\n }\n \n return decodeHTMLEntities;\n })();\n\nfunction allowOnlyNumbersInput($container) {\n\n if (!$container || $container.length < 0) $container = $('html');\n\n $('*[data-only-numbers=\"true\"]', $container).keyup(function () {\n var value = this.value.replace(/[^0-9\\.,]/g, '');\n\n if (this.value != value) {\n this.value = value;\n }\n });\n}\n\nfunction stringToNumber(value) {\n\n var returnValue, currency, decimal, val = \"\" + value;\n\n currency = LhApp.Context.Currency.Symbol;\n decimal = LhApp.Context.Currency.DecimalSeparator;\n returnValue = val.replace(currency, '').replace(decimal, '.').trim();\n\n return parseFloat(returnValue).toFixed(2);\n}\n\nfunction numberToString(value, addCurrency, clearZeros) {\n var returnValue, currency, decimal, fractional, val = \"\" + value;\n\n currency = LhApp.Context.Currency.Symbol;\n decimal = LhApp.Context.Currency.DecimalSeparator;\n returnValue = val.replace(currency, '').replace('.', decimal).trim();\n\n\n if (clearZeros) {\n fractional = returnValue.split(decimal);\n \n if (fractional.length > 1) {\n if (new RegExp(\"^[0\\0]+$\").test(fractional[1])) {\n returnValue = fractional[0];\n }\n } \n }\n \n if (addCurrency)\n returnValue += \" \" + currency;\n\n return returnValue;\n}","var PostMessages = function () {\n\n var intervalId,\n lastHash,\n attachedCallback,\n window = this;\n\n return {\n receiveMessage: function (callback, sourceOrigin) {\n\n if (window['postMessage']) {\n if (callback) {\n attachedCallback = function (e) {\n if ((typeof sourceOrigin === 'string' && e.origin !== sourceOrigin)\n || (Object.prototype.toString.call(sourceOrigin) === \"[object Function]\" && sourceOrigin(e.origin) === !1)) {\n return !1;\n }\n callback(e);\n };\n }\n if (window['addEventListener']) {\n window[callback ? 'addEventListener' : 'removeEventListener']('message', attachedCallback, !1);\n } else {\n window[callback ? 'attachEvent' : 'detachEvent']('onmessage', attachedCallback);\n }\n } else {\n intervalId && clearInterval(intervalId);\n intervalId = null;\n\n if (callback) {\n intervalId = setInterval(function () {\n var hash = document.location.hash,\n re = /^#?\\d+&/;\n if (hash !== lastHash && re.test(hash)) {\n lastHash = hash;\n callback({ data: hash.replace(re, '') });\n }\n }, 100);\n }\n }\n }\n };\n}();\n\nPostMessages.receiveMessage(function (message) {\n\n if (message.data.Action === 'SetUser') {\n Vendd.MessageBus.publishAsync(Vendd.UserSelect, new Vendd.UserSelect.Messages.SubmitSetInterfaceUserInlineAdmin({ 'LoginName': message.data.UserEmail.trim(), 'RedirectToAccount': message.data.RedirectToAccount }));\n }\n\n if (message.data.Action === 'SetOrder') {\n Vendd.MessageBus.publishAsync(Vendd.UserSelect, new Vendd.UserSelect.Messages.SubmitSetInterfaceUserInlineAdmin({ 'LoginName': message.data.UserEmail.trim(), 'RedirectToAccount': message.data.RedirectToAccount, 'OrderId': message.data.OrderId }));\n }\n\n}, LhApp.Context.InLineAdminEndpoint);\n\n","LhApp = LhApp || {};\n\nLhApp.Function = {};\n\nLhApp.Function.Url = {};\nLhApp.Function.QueryString = {};\nLhApp.Function.String = {};\nLhApp.Function.Tracking = {};\nLhApp.Function.Actions = {};\n\n\nLhApp.Function.Actions.ActionsType = { ORDER_COMPLETION: 0 };\nLhApp.Function.Actions.StorageType = { SESSION: 0, PERSISTENT: 1, CROSS_TABS_SESSION: 2 }; /* CROSS_TABS_SESSION : currently unsupported - custom implementation */\nLhApp.Function.Actions.Counter = function (actionsType, storageType, actionIdentifier) {\n var storekey = 'Vendd:Actions.Counter';\n var storage = storageType == LhApp.Function.Actions.ActionsType.PERSISTENT ? localStorage : sessionStorage;\n var action = actionsType + (actionIdentifier ? ':' + actionIdentifier : actionIdentifier);\n\n this.getCount = function () {\n var store = JSON.parse(storage.getItem(storekey)) || {};\n return parseInt(store[action] || 0);\n }\n this.increment = function () {\n var store = JSON.parse(storage.getItem(storekey)) || {};\n store[action] = (parseInt(store[action]) || 0) + 1;\n storage.setItem(storekey, JSON.stringify(store));\n }\n this.reset = function () {\n var store = JSON.parse(storage.getItem(storekey)) || {};\n store[action] = undefined;\n storage.setItem(storekey, JSON.stringify(store));\n }\n}\n\nLhApp.Function.Tracking.updateTrackingData = function (updateData) {\n window.TrackingData = $.extend(true, {}, window.TrackingData, updateData);\n}\n\n//custom ga in\nLhApp.Function.Tracking.ga = function () {\n\n if (!LhApp.Function.Tracking.canTrack('statisticCookies'))\n return false;\n\n if (!LhApp.Function.Tracking.InitGoogleAnalytics())\n return false;\n\n if (typeof (ga) == 'undefined')\n return false;\n\n ga.apply(null, arguments);\n\n return true;\n}\n\nLhApp.Function.Tracking.canTrack = function (cookieType) {\n var Consents = (typeof (ConsentsManager) != \"undefined\" && ConsentsManager) || (typeof (CheckoutConsentsManager) != \"undefined\" && CheckoutConsentsManager);\n if (!Consents)\n return false;\n\n if (!cookieType)\n cookieType = 'marketingCookies';\n\n if (Consents.cookiesStatus[cookieType] === undefined)\n return false;\n\n if (!LhApp.Context.IsConsentsEnabled)\n return true;\n\n return Consents.cookiesStatus[cookieType];\n}\n\nLhApp.Function.Tracking.getTrackingModel = function () {\n var trackingModel = window.TrackingData;\n if (!trackingModel || !trackingModel.IsTrackingEnabled)\n return null;\n\n return JSON.parse(JSON.stringify(trackingModel));//retunr cloned object\n}\n\nLhApp.Function.Tracking.getTracker = function (trackerCode, trackingModel) { \n if (!trackingModel || !trackingModel.IsTrackingEnabled)\n return null;\n\n var tracker = trackingModel.Trackers[trackerCode.toLowerCase()]; // if available than IsActive = 1 in DB\n if (!tracker)\n return null;\n\n if (!tracker.Properties)\n return null;\n\n return tracker;\n}\n\nLhApp.Function.Tracking.getFeedItemId = function (product, datasource, tracker) { \n if (product.FeedCodes && product.FeedCodes[tracker.FeedCodeField])\n return product.FeedCodes[tracker.FeedCodeField];\n\n var productId, colorId, sizeId, dim3Id, dim4Id, dim5Id, dim6Id, merchantId;\n\n if (datasource == 'ProductChanged') {\n productId = product.ParentProductId;\n\n var colors = product.Dimensions.find(function (i) { return i.IsColor });\n var sizes = product.Dimensions.find(function (i) { return i.IsSize });\n var dim3s = product.Dimensions.find(function (i) { return i.IsDim3 });\n var dim4s = product.Dimensions.find(function (i) { return i.IsDim4 });\n var dim5s = product.Dimensions.find(function (i) { return i.IsDim5 });\n var dim6s = product.Dimensions.find(function (i) { return i.IsDim6 });\n var merchants = product.Dimensions.find(function (i) { return i.IsMerchant });\n\n var color = colors && colors.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var size = sizes && sizes.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var dim3 = dim3s && dim3s.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var dim4 = dim4s && dim4s.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var dim5 = dim5s && dim5s.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var dim6 = dim6s && dim6s.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n var merchant = merchants && merchants.Versions.find(function (i) { return i.ProductId == product.SelectedProductId })\n\n colorId = color && color.VersionId;\n sizeId = size && size.VersionId;\n dim3Id = dim3 && dim3.VersionId;\n dim4Id = dim4 && dim4.VersionId;\n dim5Id = dim5 && dim5.VersionId;\n dim6Id = dim6 && dim6.VersionId;\n merchantId = merchant && merchant.VersionId;\n }\n else {\n productId = product.ProductId;\n\n colorId = product.ColorId;\n sizeId = product.SizeId;\n dim3Id = product.Dim3Id;\n dim4Id = product.Dim4Id;\n dim5Id = product.Dim5Id;\n dim6Id = product.Dim6Id;\n merchantId = product.MerchantId;\n }\n\n if (colorId && parseInt(colorId) > 0) {\n productId += \"-\" + colorId;\n }\n if (tracker.SplitFeedBySize && sizeId && parseInt(sizeId) > 0) {\n productId += \"-\" + sizeId;\n }\n if (tracker.SplitFeedByDim3 && dim3Id && parseInt(dim3Id) > 0) {\n productId += \"-\" + dim3Id;\n }\n if (tracker.SplitFeedByDim4 && dim4Id && parseInt(dim4Id) > 0) {\n productId += \"-\" + dim4Id;\n }\n if (tracker.SplitFeedByDim5 && dim5Id && parseInt(dim5Id) > 0) {\n productId += \"-\" + dim5Id;\n }\n if (tracker.SplitFeedByDim6 && dim6Id && parseInt(dim6Id) > 0) {\n productId += \"-\" + dim6Id;\n }\n if (tracker.SplitFeedByMerchant && merchantId && parseInt(merchantId) > 0) {\n productId += \"-M\" + merchantId;\n }\n\n return productId;\n}\n\n//used for tag manager. keep in mind even though can be used for gtag.js vendd does not include gtag.js tags\nLhApp.Function.Tracking.gtag = function () {\n window.dataLayer = window.dataLayer || [];\n dataLayer.push(arguments);\n}\n\nLhApp.Function.Tracking.InitGoogleTagManager = function (tagManagerCode) {\n\n var trackingModel = LhApp.Function.Tracking.getTrackingModel();\n\n if (tagManagerCode === undefined) // if not defined tag manager code\n {\n if (!trackingModel || !trackingModel.GoogleTagManagerCode)\n return false;\n tagManagerCode = trackingModel.GoogleTagManagerCode;\n }\n\n if (!tagManagerCode)\n return false;\n\n //initialization check\n if (window.googleTagManagerInitialized)\n return true;\n\n var consentsManager = window.ConsentsManager || window.CheckoutConsentsManager;\n var cookiesStatus = consentsManager && consentsManager.cookiesStatus;\n\n if (trackingModel.LoadTagManagerWhenConsentsGranted) {\n //if all cookie consents are required to load tag manager\n if (!(cookiesStatus && cookiesStatus.marketingCookies && cookiesStatus.statisticCookies && cookiesStatus.functionalityCookies)){\n return false;\n }\n }\n\n if (trackingModel.EnableGoogleTagManagerConsents) {\n //init consents before tag manager initiation\n LhApp.Function.Tracking.gtag('consent', 'default', {\n 'ad_storage': cookiesStatus && cookiesStatus.marketingCookies ? 'granted' : 'denied',\n 'analytics_storage': cookiesStatus && cookiesStatus.statisticCookies ? 'granted' : 'denied',\n 'functionality_storage': cookiesStatus && cookiesStatus.functionalityCookies ? 'granted' : 'denied'\n });\n } \n\n //init tag manager\n (function (w, d, s, l, i) {\n w[l] = w[l] || [];\n w[l].push({\n 'gtm.start': new Date().getTime(),\n event: 'gtm.js'\n });\n var f = d.getElementsByTagName(s)[0],\n j = d.createElement(s),\n dl = l != 'dataLayer' ? '&l=' + l : '';\n j.async = true;\n j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;\n f.parentNode.insertBefore(j, f);\n })(window, document, 'script', 'dataLayer', tagManagerCode);\n //mark tag manager as initialized\n window.googleTagManagerInitialized = true;\n\n /*--DEPRICATED-- Expose Cookie Consents to Data Layer*/\n var consentsCookie = Cookies.getJSON('ConsentChecked');\n if (consentsCookie) {\n window.dataLayer.push({ 'functionalityCookiesEnabled': consentsCookie.functionalityCookies, 'marketingCookiesEnabled': consentsCookie.marketingCookies, 'statisticCookiesEnabled': consentsCookie.statisticCookies });\n }\n\n //custom tag manager event when consents are ready (default active or user has set options in a previous page)\n if (cookiesStatus && (consentsManager.cookiesStatus.userHasSetCookies || LhApp.Context.CookiesDefaultActive)) {\n dataLayer.push({ 'event': 'vendd_consents_ready' });\n }\n\n return true;\n}\n\nLhApp.Function.Tracking.InitGoogleAnalytics = function (analyticsCode) {\n if (analyticsCode === undefined) // if not defined\n {\n var trackingModel = LhApp.Function.Tracking.getTrackingModel();\n if (!trackingModel || !trackingModel.GoogleAnalyticsCode)\n return false;\n analyticsCode = trackingModel.GoogleAnalyticsCode;\n }\n\n if (!analyticsCode)\n return false;\n\n //initialization check\n if (window.googleAnalyticsInitialized)\n return true;\n window.googleAnalyticsInitialized = true;\n\n (function (i, s, o, g, r, a, m) {\n i['GoogleAnalyticsObject'] = r;\n i[r] = i[r] || function () {\n (i[r].q = i[r].q || []).push(arguments)\n }, i[r].l = 1 * new Date();\n a = s.createElement(o),\n m = s.getElementsByTagName(o)[0];\n a.async = 1;\n a.src = g;\n m.parentNode.insertBefore(a, m)\n })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');\n\n ga(\"create\", analyticsCode, 'auto');\n\n return true;\n}\n\nLhApp.Function.Url.getServiceEndpoint = function (url) {\n var rewritedUrl = LhApp.Context.Request.BaseUrl + '/services/';\n\n rewritedUrl += url;\n\n if (unescape(LhApp.Context.Request.FriendlyUrl).indexOf('?') != -1) {\n\n var queryString = '';\n var initialQueryString = unescape(LhApp.Context.Request.FriendlyUrl).substring(unescape(LhApp.Context.Request.FriendlyUrl).indexOf('?') + 1);\n\n var iid = LhApp.Function.QueryString.getValueOf('iid', unescape(LhApp.Context.Request.RawUrl));\n if (iid != '') queryString = 'iid=' + iid;\n else if (LhApp.Context.Item && LhApp.Context.Item.Id)\n queryString = 'iid=' + LhApp.Context.Item.Id;\n if (rewritedUrl.indexOf(initialQueryString) == -1) {\n\n if (initialQueryString.length > 0) queryString += '&' + initialQueryString;\n\n if (rewritedUrl.indexOf('?') == -1)\n queryString = '?' + queryString;\n else\n queryString = '&' + queryString;\n }\n rewritedUrl += queryString;\n }\n\n rewritedUrl = rewritedUrl.replace(\"?&\", \"?\");\n var domainUrl = rewritedUrl.split('?');\n var qsrt = \"\";\n if (domainUrl.length > 1) {\n \tvar q = domainUrl[1];\n \tvar qArray = q.split('&');\n \tvar operator = '?';\n \tfor (i = 0; i < qArray.length; i++) {\n \t\tif (qArray[i] != \"\" && qArray[i] != \"\" && qsrt.indexOf(qArray[i]) == -1) {\n \t\t\tif (i == 0) {\n \t\t\t\toperator = '?';\n \t\t\t} else {\n \t\t\t\toperator = '&';\n \t\t\t}\n \t\t\tqsrt += operator + qArray[i];\n \t\t}\n \t}\n }\n return domainUrl[0] + qsrt;\n};\n\nLhApp.Function.QueryString.parse = function (url) {\n var qparams = {},\n parts = (url || '').split('?'),\n qparts, qpart,\n i = 0;\n\n if (parts.length <= 1) {\n return qparams;\n } else {\n qparts = parts[1].split('&');\n for (i in qparts) {\n qpart = qparts[i].split('=');\n var pName = decodeURIComponent(qpart[0]).toLowerCase();\n var pValue = decodeURIComponent(qpart[1] || '');\n qparams[pName] = pValue;\n }\n }\n\n return qparams;\n};\n\nLhApp.Function.QueryString.getValueOf = function (parameterKey, url) {\n\n url = url || window.location.href;\n var parameterValue = '';\n\n var queryString = '';\n var hasQueryString = (url.indexOf('?') > -1);\n\n if (hasQueryString) {\n queryString = url.substring(url.indexOf('?') + 1);\n }\n\n var parameters = queryString.split(\"&\");\n\n if (queryString.indexOf(parameterKey) >= 0) {\n\n for (var i = 0; i < parameters.length; i++) {\n var pair = parameters[i].split(\"=\");\n if (pair[0] == parameterKey) {\n parameterValue = pair[1];\n }\n }\n }\n\n return parameterValue;\n};\n\nLhApp.Function.Url.setParameterValue = function (parameterKey, parameterValue) {\n\n var url = window.location.href;\n\n return this.setParameterValueOnUrl(url, parameterKey, parameterValue);\n};\n\nLhApp.Function.Url.setParameterValueOnUrl = function (url, parameterKey, parameterValue) {\n\n var newUrl;\n\n var queryString = '';\n var hasQueryString = (url.indexOf('?') > -1);\n\n if (hasQueryString) {\n queryString = url.substring(url.indexOf('?') + 1);\n }\n\n var parameters = queryString.split(\"&\");\n\n if (queryString.indexOf(parameterKey) >= 0) {\n\n for (var i = 0; i < parameters.length; i++) {\n var pair = parameters[i].split(\"=\");\n if (pair[0] == parameterKey) {\n parameters[i] = pair[0] + \"=\" + parameterValue;\n }\n }\n\n queryString = parameters.join(\"&\");\n\n } else {\n if (hasQueryString) {\n queryString += '&' + parameterKey + '=' + parameterValue;\n } else {\n queryString += '?' + parameterKey + '=' + parameterValue;\n }\n }\n\n if (hasQueryString) {\n newUrl = url.substring(0, url.indexOf('?') + 1) + queryString;\n } else {\n newUrl = url + queryString;\n }\n\n return newUrl;\n};\n\nLhApp.Function.Url.removeParameter = function (parameterKey) {\n\n var url = window.location.href;\n var parameterKeys = [parameterKey];\n\n return this.removeParametersFromUrl(url, parameterKeys);\n};\n\nLhApp.Function.Url.removeParameterFromUrl = function (url, parameterKey) {\n var parameterKeys = [parameterKey];\n\n return this.removeParametersFromUrl(url, parameterKeys);\n};\n\nLhApp.Function.Url.removeParameters = function (parameterKeys) {\n\n var url = window.location.href;\n\n return this.removeParametersFromUrl(url, parameterKeys);\n};\n\nLhApp.Function.Url.removeParametersFromUrl = function (url, parameterKeys) {\n\n var newUrl = url;\n\n $.each(parameterKeys, function (index, parameterKey) {\n\n var queryString = '';\n var hasQueryString = (newUrl.indexOf('?') > -1);\n\n if (hasQueryString) {\n queryString = newUrl.substring(newUrl.indexOf('?') + 1);\n\n var parameters = queryString.split(\"&\");\n\n if (queryString.indexOf(parameterKey) >= 0) {\n\n for (var i = 0; i < parameters.length; i++) {\n var pair = parameters[i].split(\"=\");\n if (pair[0] == parameterKey) {\n parameters.splice(i, 1);\n }\n }\n\n queryString = parameters.join(\"&\");\n if (queryString != \"\")\n newUrl = newUrl.substring(0, newUrl.indexOf('?') + 1) + queryString;\n else\n newUrl = newUrl.substring(0, newUrl.indexOf('?')) + queryString;\n }\n }\n });\n\n return newUrl;\n};\n\nLhApp.Function.getText = function (key) {\n\n if (typeof LhApp.Text == 'undefined')\n return '';\n\n var match = LhApp.Text[key];\n if (match === undefined) {\n var resource = LhApp.Function.getTranslatableTextFromServer(key);\n LhApp.Text[key] = resource;\n match = resource;\n }\n\n return match || '';\n};\n\nLhApp.Function.getTranslatableTextFromServer = function (key) {\n var result = key;\n $.ajax({\n async: false,\n type: 'POST',\n dataType: 'json',\n contentType: 'application/json; charset=UTF-8',\n ContentType: 'application/json; charset=UTF-8',\n url: LhApp.Function.Url.getServiceEndpoint('commonservice.svc/GetTranslatableResource'),\n data: JSON.stringify({\n key: key\n }),\n success: function (response) {\n result = response.d;\n }\n });\n\n return result;\n};\n\nLhApp.Function.String.isEmail = function(text) {\n var re = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,20}|^$/i;\n return re.test(text);\n};\n\nLhApp.Function.String.isAlphaNumeric = function (text) {\n var letterNumber = /^[0-9a-zA-Z]+$/;\n return text.match(letterNumber) || false;\n};\n\nLhApp.Function.initVisitorState = function () {\n\n var cookieValue = Cookies.get(\"VisitorState\");\n if (cookieValue) {\n\n LhApp.Function.checkAndUpdateVisitorState(cookieValue);\n\n } else {\n\n Vendd.Service.call({\n url: 'CmsService.svc/InitVisitorState',\n data: null,\n onSuccess: function (res) {\n\n cookieValue = Cookies.get(\"VisitorState\");\n if (res.success && cookieValue) {\n LhApp.Function.checkAndUpdateVisitorState(cookieValue);\n }\n }\n });\n }\n};\n\nLhApp.Function.checkAndUpdateVisitorState = function (cookieValue) {\n\n if (cookieValue) {\n\n var oldUrl = window.location.href;\n var cookieValueAsUrl = \"?\" + cookieValue;\n\n $('body').removeClass('x-checking-visitor-state').removeAttr('x-checking-visitor-state');\n\n // 1. Checks to update cookie values from querystring\n var oldLanguageCode = LhApp.Function.QueryString.getValueOf(\"languageCode\", cookieValueAsUrl).toLowerCase();\n var newLanguageCode = LhApp.Function.QueryString.getValueOf(\"lang\", oldUrl).toLowerCase();\n\n if (newLanguageCode != '' && newLanguageCode != oldLanguageCode) {\n cookieValue = LhApp.Function.Url.setParameterValueOnUrl(cookieValueAsUrl, \"languageCode\", newLanguageCode).replace(\"?\", \"\");\n Cookies.set(\"VisitorState\", cookieValue, { secure: LhApp.Context.Request.IsSecure, samesite: 'Lax' });\n cookieValueAsUrl = \"?\" + cookieValue;\n }\n\n var oldCountryCode = LhApp.Function.QueryString.getValueOf(\"countryCode\", cookieValueAsUrl).toLowerCase();\n var newCountryCode = LhApp.Function.QueryString.getValueOf(\"country\", oldUrl).toLowerCase();\n\n if (newCountryCode != '' && newCountryCode != oldCountryCode) {\n cookieValue = LhApp.Function.Url.setParameterValueOnUrl(cookieValueAsUrl, \"countryCode\", newCountryCode).replace(\"?\", \"\");\n Cookies.set(\"VisitorState\", cookieValue, { secure: LhApp.Context.Request.IsSecure, samesite: 'Lax' });\n cookieValueAsUrl = \"?\" + cookieValue;\n }\n\n var oldCurrencyCode = LhApp.Function.QueryString.getValueOf(\"currencyCode\", cookieValueAsUrl).toLowerCase();\n var newCurrencyCode = LhApp.Function.QueryString.getValueOf(\"currency\", oldUrl).toLowerCase();\n\n if (newCurrencyCode != '' && newCurrencyCode != oldCurrencyCode) {\n cookieValue = LhApp.Function.Url.setParameterValueOnUrl(cookieValueAsUrl, \"currencyCode\", newCurrencyCode).replace(\"?\", \"\");\n Cookies.set(\"VisitorState\", cookieValue, { secure: LhApp.Context.Request.IsSecure, samesite: 'Lax' });\n cookieValueAsUrl = \"?\" + cookieValue;\n }\n }\n};\n\nLhApp.Function.hideExpandables = function (wrapper) {\n var $expandables = $('*[data-expandablecontainer].x-expanded:not(.x-loading)', $(wrapper));\n $expandables.each(function (i, item) {\n var $expandable = $(item);\n $expandable.removeClass('x-expanded');\n $('*[data-expandabletrigger=\"' + $expandable.data('expandablecontainer') + '\"].x-open', $(wrapper)).removeClass('x-open');\n });\n};\n\nLhApp.Function.bindUndropables = function (wrapper) {\n var $wrapper = $(wrapper);\n\n var $undropableElements = $('*[data-undropable]', $wrapper);\n $undropableElements.on('drop', function (e) {\n if (typeof (e.preventDefault) === 'function')\n e.preventDefault();\n });\n};\n\nLhApp.Function.bindExpandables = function (wrapper) {\n var $wrapper = $(wrapper);\n\n var $expandableContainers = $('*[data-expandablecontainer]', $wrapper);\n $expandableContainers.click(function (e) {\n e.stopPropagation();\n });\n\n var $triggers = $('*[data-expandabletrigger]', $wrapper);\n $triggers.each(function (i, item) {\n var $trigger = $(item);\n\n var triggerValue = $trigger.data('expandabletrigger');\n var $expandableContainer = $('*[data-expandablecontainer=\"' + triggerValue + '\"]', $wrapper);\n\n var $triggers = $('*[data-expandabletrigger=\"' + triggerValue + '\"]', $wrapper);\n\n if ($expandableContainer.length > 0) {\n $triggers.unbind('click');\n $triggers.click(function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n $('*[data-expandablecontainer].x-expanded').each(function (w, wItem) {\n var wItemContainer = $(wItem).data('expandablecontainer');\n if (wItemContainer != triggerValue) {\n $(wItem).removeClass('x-expanded');\n $('*[data-expandabletrigger=\"' + wItemContainer + '\"].x-open').removeClass('x-open');\n }\n });\n\n if ($expandableContainer.hasClass('x-expanded')) {\n $expandableContainer.removeClass('x-expanded');\n $triggers.removeClass('x-open');\n } else {\n $expandableContainer.addClass('x-expanded');\n $triggers.addClass('x-open');\n\n EventManager.trigger('lazyload');\n }\n });\n }\n });\n};\n\nLhApp.Function.isButtonDisabled = function (buttonWrapper) {\n var isDisabled = false;\n\n if ($(buttonWrapper).get(0).tagName.toLowerCase() == 'input') {\n if ($(buttonWrapper).is(':disabled'))\n isDisabled = true;\n }\n else {\n var $internalButton = $(buttonWrapper).find('input:button');\n if ($internalButton.length > 0) {\n if ($internalButton.is(':disabled'))\n isDisabled = true;\n }\n else if ($(buttonWrapper).hasClass('x-disabled')) {\n isDisabled = true;\n }\n }\n\n return isDisabled;\n};\n\nLhApp.Function.bindHrefButtons = function (wrapper) {\n $('*[data-href]', $(wrapper)).click(function (e) {\n if (e !== undefined && typeof (e.preventDefault) == 'function')\n e.preventDefault();\n\n var isDisabled = LhApp.Function.isButtonDisabled(this);\n if (isDisabled) {\n e.preventDefault();\n }\n else {\n document.location = $(this).data('href');\n }\n });\n};\n\nLhApp.Function.bindScrollable = function (wrapper) {\n $('*[data-scroll-to]', $(wrapper)).click(function () {\n var $this = $(this),\n element = $this.data('scroll-to'), time = $this.data('scroll-time'), offset = $this.data('scroll-offset'),\n time = (typeof time == \"undefined\" || time == \"\") ? 600 : time,\n offset = (typeof offset == \"undefined\" || offset == \"\") ? -10 : offset;\n\n if (element == \"\")\n return;\n\n if (element == \"top\") {\n $('html, body').animate({\n scrollTop: 0\n }, time);\n }\n if (element == \"bottom\") {\n $('html, body').animate({\n scrollTop: $('body').height()\n }, time);\n }\n if ($(element).length > 0) {\n $('html, body').animate({\n scrollTop: $(element).offset().top + offset\n }, time);\n }\n });\n};\n\nLhApp.Function.bindLazyLoadableImages = function (wrapper) {\n\n var $selectedWrapper;\n if ($(wrapper).data('lazy-load-init')) {\n $selectedWrapper = $(wrapper);\n } else {\n $selectedWrapper = $('*[data-lazy-load-init]', $(wrapper));\n }\n\n $selectedWrapper.each(function (i, innerWrapper) {\n\n var $innerWrapper = $(innerWrapper);\n var $lazyLoadOptions = $('*[data-input=\"lazy-load-options\"]', $innerWrapper);\n var initLazyLoad = $innerWrapper.data('lazy-load-init');\n\n if (initLazyLoad) {\n\n var opts = {};\n var defOptions = {\n effect: \"fadeIn\"\n };\n\n if ($lazyLoadOptions.length == 1) {\n $.extend(true, opts, defOptions, JSON.parse($lazyLoadOptions.val()));\n } else {\n $.extend(true, opts, defOptions);\n }\n\n var $images = $(\"img[data-lazyload]\", $innerWrapper);\n if ($images.length > 0 && typeof $.fn.lazyload === \"function\") {\n $($images, $innerWrapper).lazyload(opts);\n }\n\n }\n\n if ($lazyLoadOptions.length > 0) {\n $lazyLoadOptions.remove();\n }\n\n });\n\n if ($.inArray('lazyload', EventManager.events) == -1) {\n EventManager.bind('lazyload', function () {\n $(window).trigger('lazyload');\n });\n }\n\n};\n\nLhApp.Function.PageTrackingRequest = function () {\n var url = decodeURIComponent(LhApp.Context.Request.RawUrl);\n var qstr = url.substring(url.indexOf('?') + 1);\n var dataItem = {\n querystring: qstr,\n cookie: document.cookie\n };\n\n Vendd.Service.call({\n url: 'MarkService.svc/PageTracking',\n data: { query: dataItem },\n onSuccess: function (res) {\n\n var cookies = res;\n for (var i = 0; i < cookies.length; i++) {\n document.cookie = cookies[i].Name + \"=\" + cookies[i].Value + \"; expires=\" + (new Date(cookies[i].Expires)).toUTCString() + \"; path=\" + cookies[i].Path;\n }\n }\n });\n};\n\nLhApp.Function.MailChimpEcommerce360Tracking = function (oId, cId, eId) {\n\n Vendd.Service.call({\n url: 'MarkService.svc/MailChimpEcommerce360Tracking',\n data: { orderId: oId, campaignId: cId, emailId: eId }\n });\n};\n\nLhApp.Function.applyExchangeRate = function (price) {\n return LhApp.Function.applyExchangeRateExtended(price, LhApp.Context.Currency.ExchangeRate);\n};\n\nLhApp.Function.applyExchangeRateExtended = function (price, rate) {\n return price * rate;\n};\n\n// multiple wishlists\nLhApp.Function.showProductWishlists = function($wrapper, product) {\n if (!LhApp.Context.MultipleWishlistsEnabled || $wrapper.length == 0)\n return;\n\n $wrapper.addClass('x-loading');\n\n var $wishlistsWrapper = $('.js-wishlist-lists', $wrapper);\n\n var model = Vendd.UserWishlist.GetClientModel();\n model = $.extend({}, model, { Product: product });\n\n var html = Vendd.Handlebars.parse(\"productWishlists\", model);\n $wishlistsWrapper.html(html);\n LhApp.Function.bindProductWishlists($wrapper);\n $wishlistsWrapper.show();\n\n $wrapper.removeClass('x-loading');\n};\n\nLhApp.Function.bindProductWishlists = function ($wrapper) {\n if (!LhApp.Context.MultipleWishlistsEnabled)\n return;\n\n var $lists = $('.js-list-select', $wrapper);\n $lists.on('click', function() {\n var $this = $(this);\n\n var $wishlistsWrapper = $this.closest('.js-product-wishlists');\n var $wrper = $this.closest('.product-wishlist');\n\n var qs = LhApp.Function.QueryString.getValueOf('list');\n\n var id = $wishlistsWrapper.data('id'),\n skuId = $wishlistsWrapper.data('skuid'),\n path = $wishlistsWrapper.data('path'),\n qty = $wishlistsWrapper.data('qty'),\n extraAttributes = [],\n bundleItems = [],\n listId = $wrper.data('list-id'),\n currentListId = qs ? parseInt(qs) || 0 : 0;\n\n Vendd.MessageBus.publishAsync($wrapper.get(0), new Vendd.Wishlist.Messages.Add(id, skuId, path, qty, extraAttributes, bundleItems, listId, currentListId));\n Vendd.MessageBus.publishAsync($wrapper.get(0), new Vendd.Widget.Messages.OpenWidget(Vendd.Widget.WishlistWidget, false));\n LhApp.Function.hideAllProductWishlists();\n });\n\n $wrapper.on('click', '.js-close-product-wishlists', function (e) {\n\t\te.preventDefault();\n\t\tLhApp.Function.hideAllProductWishlists();\n\t});\n};\n\nLhApp.Function.hideAllProductWishlists = function () {\n if (!LhApp.Context.MultipleWishlistsEnabled)\n return;\n\n $.each($('.js-wishlist-lists'), function (i, el) {\n $(el).html(\"\");\n $(el).hide();\n });\n};\n// multiple wishlists\n\nvar RenderPrice = function (price) {\n return LhApp.Function.renderPriceExtended(price, false, ' ', '', '');\n};\n\nvar RenderPriceExtended = function (price, isShopDefaultCurrency, separatorSymbol, prefixSymbol, suffixSymbol) {\n return LhApp.Function.renderPriceExtended(price, isShopDefaultCurrency, separatorSymbol, prefixSymbol, suffixSymbol);\n};\n\nLhApp.Function.renderPrice = function (price) {\n return LhApp.Function.renderPriceExtended(price, false, ' ', '', '');\n};\n\nLhApp.Function.renderPriceExtended = function (price, isShopDefaultCurrency, separatorSymbol, prefixSymbol, suffixSymbol) {\n\n var symbol = LhApp.Context.Currency.Symbol;\n var numberOfDigits = LhApp.Context.Currency.NumberOfDigits;\n var symbolShownFirst = LhApp.Context.Currency.SymbolShownFirst;\n var doShowSymbol = LhApp.Context.Currency.DoShowSymbol;\n\n if (isShopDefaultCurrency) {\n symbol = LhApp.Context.ShopDefaultCurrency.Symbol;\n numberOfDigits = LhApp.Context.ShopDefaultCurrency.NumberOfDigits;\n symbolShownFirst = LhApp.Context.ShopDefaultCurrency.SymbolShownFirst;\n doShowSymbol = LhApp.Context.ShopDefaultCurrency.DoShowSymbol;\n }\n\n var formatedPrice = price.toFixed(numberOfDigits).replace('.', ',');\n\n if (doShowSymbol) {\n if (!symbolShownFirst) {\n formatedPrice = formatedPrice + separatorSymbol + symbol;\n } else {\n formatedPrice = symbol + separatorSymbol + formatedPrice;\n }\n }\n\n if (prefixSymbol != '') {\n formatedPrice = prefixSymbol + separatorSymbol + formatedPrice;\n }\n\n if (suffixSymbol != '') {\n formatedPrice = formatedPrice + separatorSymbol + suffixSymbol;\n }\n\n return formatedPrice;\n};\n\nvar RenderPointsPrice = function (pointsPrice) {\n return LhApp.Function.renderPointsPriceExtended(pointsPrice, ',', ' ', '', '');\n};\n\nvar RenderPointsPriceExtended = function (pointsPrice, commaSymbol, separatorSymbol, prefixSymbol, suffixSymbol) {\n return LhApp.Function.renderPointsPriceExtended(pointsPrice, commaSymbol, prefixSymbol, suffixSymbol);\n};\n\nLhApp.Function.renderPointsPriceExtended = function (pointsPrice, commaSymbol, separatorSymbol, prefixSymbol, suffixSymbol) {\n\n if (suffixSymbol == '') {\n suffixSymbol = pointsPrice === 1 ? 'point' : 'points';\n }\n\n var innerSuffixSymbol = suffixSymbol.length > 1 ? ' ' + LhApp.Function.getText('Common:PointsPriceSymbol_' + suffixSymbol) : suffixSymbol;\n\n var formatedPrice = pointsPrice.toFixed(2).replace('.00', '').replace('.', commaSymbol);\n\n if (prefixSymbol != '') {\n formatedPrice = prefixSymbol + separatorSymbol + formatedPrice;\n }\n\n if (innerSuffixSymbol != '') {\n formatedPrice = formatedPrice + separatorSymbol + innerSuffixSymbol;\n }\n\n return formatedPrice;\n};\n\nLhApp.Function.validateClientModel = function(model) {\n if (!model) return false;\n\n if (!model.LangCode || model.LangCode != LhApp.Context.Language) return false;\n\n return true;\n}\n\nvar ReplacePrices = function (obj) {\n $('.x-product-box[data-productid]').each(function (i, el) {\n var itemId = parseInt($(el).attr('data-productid'));\n\n var itemData = obj.filter(function (a) { return a.Id === itemId })[0]\n\n var DeletedPrice = parseFloat(itemData.DeletedPrice);\n var Price = parseFloat(itemData.Price);\n var TotalPointsPrice = parseFloat(itemData.TotalPointsPrice);\n var TotalPointsGain = parseFloat(itemData.TotalPointsGain);\n var PointsPrice = parseFloat(itemData.PointsPrice);\n var PointsGain = parseFloat(itemData.PointsGain);\n\n // hide all\n $('.prices', el).addClass('hide');\n $('.deleted-price-container', el).addClass('hide');\n $('.current-price-container', el).addClass('hide');\n $('.current-point-price-container.1', el).addClass('hide');\n $('.current-point-price-container.2', el).addClass('hide');\n $('.current-point-price-container.3', el).addClass('hide');\n $('.current-point-price-container.4', el).addClass('hide');\n\n if (DeletedPrice > 0 || Price > 0 || TotalPointsPrice > 0 || TotalPointsGain > 0 || PointsPrice > 0 || PointsGain > 0) {\n $('.prices', el).removeClass('hide');\n\n if ((DeletedPrice > 0) && (DeletedPrice > Price)) {\n $('.deleted-price-container', el).removeClass('hide');\n $('.deleted-price', el).text(RenderPrice(itemData.DeletedPrice));\n }\n\n if (Price > 0) {\n $('.current-price-container', el).removeClass('hide');\n $('.current-price', el).text(RenderPrice(itemData.Price));\n }\n\n if (PointsPrice > 0 && PointsPrice != TotalPointsPrice) {\n $('.current-point-price-container.1', el).removeClass('hide');\n $('.current-point-price-container.1 .points-price', el).text(RenderPointsPrice(PointsPrice));\n }\n\n if (TotalPointsGain > 0) {\n $('.current-point-price-container.2', el).removeClass('hide');\n $('.current-point-price-container.2 .points-gain', el).text(RenderPointsPrice(TotalPointsGain));\n }\n\n if (PointsGain > 0 && TotalPointsGain === 0) {\n $('.current-point-price-container.3', el).removeClass('hide');\n $('.current-point-price-container.3 .points-gain', el).text(RenderPointsPrice(PointsGain));\n }\n\n if (TotalPointsPrice > 0) {\n $('.current-point-price-container.4', el).removeClass('hide');\n $('.current-point-price-container.4 .points-price', el).text(RenderPointsPrice(TotalPointsPrice));\n }\n }\n });\n}\n\nvar ReplaceAvailabilities = function (obj) {\n $('.x-product-box[data-productid]').each(function (i, el) {\n var itemId = parseInt($(el).attr('data-productid'));\n var itemData = obj.filter(function (a) { return a.Id === itemId })[0]\n\n var cartEnabled = itemData.CanBuy === true || itemData.CanBuyWithPoints === true;\n var wishlistEnabled = itemData.CanAddToList === true;\n\n if ($('.buttons .add-to-cart').length > 0 && $('.buttons .add-to-cart input').length > 0) {\n $('.buttons .add-to-cart').addClass('x-disabled');\n $('.buttons .add-to-cart input').attr('disabled', 'disabled');\n\n if (cartEnabled === true) {\n $('.buttons .add-to-cart').removeClass('x-disabled');\n $('.buttons .add-to-cart input').removeAttr('disabled', 'disabled');\n }\n }\n\n //if ($('.buttons .add-to-wishlist').length > 0 && $('.buttons .add-to-wishlist input').length > 0) {\n //$('.buttons .add-to-wishlist').addClass('x-disabled');\n //$('.buttons .add-to-wishlist input').attr('disabled', 'disabled');\n\n //if (wishlistEnabled === true) {\n //$('.buttons .add-to-wishlist').removeClass('x-disabled');\n //$('.buttons .add-to-wishlist input').removeAttr('disabled', 'disabled');\n //}\n //}\n });\n}\n\nLhApp.Function.validateTaxIdentifier = function (isInvoice, countryCode, taxIdentifier) {\n if (isInvoice === true && taxIdentifier.length > 0) {\n if (countryCode === 'GR') {\n if (!isNaN(parseInt(taxIdentifier)) && taxIdentifier.length === 9) {\n var result = 0;\n var arrTaxId = taxIdentifier.split(\"\").map(function (item) {\n return parseInt(item);\n });\n\n for (var i = arrTaxId.length - 2; i >= 0 ; i--) {\n result = result + arrTaxId[i] * Math.pow(2, (8 - i));\n }\n\n if ((result % 11) % 10 === arrTaxId[8]) {\n return true;\n } else {\n return false;\n }\n }\n }\n else\n return true;\n }\n\n return false;\n};\n\nLhApp.pauseScroll = false;\n\nLhApp.init = function () {\n\n LhApp.Function.bindScrollable($('body').get(0));\n LhApp.Function.bindExpandables($('body').get(0));\n LhApp.Function.bindHrefButtons($('body').get(0));\n LhApp.Function.bindUndropables($('body').get(0));\n //LhApp.Function.bindLazyLoadableImages($('body').get(0)); \n\n $('body').click(function (e) {\n LhApp.Function.hideExpandables(this);\n });\n\n $(document).scroll(function (e) {\n if (!LhApp.pauseScroll)\n LhApp.Function.hideExpandables($('body').get(0));\n });\n};\n\nvar disqus_config = function () {\n\n if (LhApp.Context.Item.Id && LhApp.Context.Request.FriendlyUrl) {\n\n this.page.url = LhApp.Context.Request.BaseUrl + LhApp.Context.Request.FriendlyUrl;\n this.page.identifier = LhApp.Context.Item.Id;\n\n }\n};\n\nvar replaceIframe = function (idFrame, url) {\n var originalFrame = document.getElementById(idFrame);\n var newFrame = document.createElement(\"iframe\");\n newFrame.id = originalFrame.getAttribute(\"id\");\n newFrame.width = originalFrame.getAttribute(\"width\");\n newFrame.height = originalFrame.getAttribute(\"height\");\n newFrame.style.display = \"none\";\n newFrame.src = url;\n var parent = originalFrame.parentNode;\n parent.replaceChild(newFrame, originalFrame);\n};\n\nvar convertToGreek = function () {\n $(\"input[type='text'].js-convert-to-greek\").keyup(function () {\n if ($(this).closest('.form-row').find('.js-disable-conversion').is(':checked')) return;\n var str = $(this).val().toUpperCase();\n var newstr = [];\n for (var i = 0, len = str.length; i < len; i++) {\n newstr[i] = convertCharacters(str[i]);\n }\n $(this).val(newstr.join(\"\"));\n $(this).trigger(\"input\"); //just to let angular know\n });\n};\n\nvar convertToUppercase = function () {\n $(\"input[type='text'].js-convert-to-uppercase\").keyup(function () {\n if ($(this).closest('.form-row').find('.js-disable-conversion').is(':checked')) return;\n //convert letter to uppercase\n var str = $(this).val().toUpperCase();\n //remove accents \n str = str.replace(/Ά/g, 'Α')\n .replace(/Έ/g, 'Ε')\n .replace(/Ή/g, 'Η')\n .replace(/Ί/g, 'Ι')\n .replace(/Ό/g, 'Ο')\n .replace(/Ύ/g, 'Υ')\n .replace(/Ώ/g, 'Ω');\n\n $(this).val(str);\n $(this).trigger(\"input\"); //just to let angular know\n });\n};\n\nvar convertCharacters = function(character) {\n switch (character) {\n case \"A\":\n character = 'Α';\n break;\n case \"B\":\n character = 'Β';\n break;\n case \"C\":\n character = 'Ψ';\n break;\n case \"D\":\n character = 'Δ';\n break;\n case \"E\":\n character = 'Ε';\n break;\n case \"F\":\n character = 'Φ';\n break;\n case \"G\":\n character = 'Γ';\n break;\n case \"H\":\n character = 'Η';\n break;\n case \"I\":\n character = 'Ι';\n break;\n case \"J\":\n character = 'Ξ';\n break;\n case \"K\":\n character = 'Κ';\n break;\n case \"L\":\n character = 'Λ';\n break;\n case \"M\":\n character = 'Μ';\n break;\n case \"N\":\n character = 'Ν';\n break;\n case \"O\":\n character = 'Ο';\n break;\n case \"P\":\n character = 'Π';\n break;\n case \"Q\":\n character = 'Κ';\n break;\n case \"R\":\n character = 'Ρ';\n break;\n case \"S\":\n character = 'Σ';\n break;\n case \"T\":\n character = 'Τ';\n break;\n case \"U\":\n character = 'Θ';\n break;\n case \"V\":\n character = 'Ω';\n break;\n case \"W\":\n character = 'Σ';\n break;\n case \"X\":\n character = 'Χ';\n break;\n case \"Y\":\n character = 'Υ';\n break;\n case \"Z\":\n character = 'Ζ';\n break;\n }\n return character;\n}","if (typeof localStorage === 'object') {\n\ttry {\n\t\tlocalStorage.setItem('localStorage', 1);\n\t\tlocalStorage.removeItem('localStorage');\n\t} catch (e) {\n\t\tStorage.prototype._setItem = Storage.prototype.setItem;\n\t\tStorage.prototype.setItem = function () { };\n\t}\n}","$(document).ready(function() {\n\n window.ScriptsActivator.funcLoaded = false;\n window.ScriptsActivator.markLoaded = false;\n window.ScriptsActivator.statLoaded = false;\n\n window.ScriptsActivator.loadScripts = function (scripts) {\n if (Object.keys(scripts).length === 0)\n return;\n\n for (var key in scripts) {\n var s = scripts[key];\n if (typeof s === \"function\") {\n s.call();\n } else {\n for (var skey in s) {\n var ss = s[skey];\n if (typeof ss === \"function\") {\n ss.call();\n }\n }\n }\n }\n }\n\n window.ScriptsActivator.loadFunctionalityScripts = function () {\n this.loadScripts(window.ScriptsActivator.funcFn);\n this.funcLoaded = true;\n };\n\n window.ScriptsActivator.loadMarketingScripts = function () {\n this.loadScripts(window.ScriptsActivator.markFn);\n this.markLoaded = true;\n };\n\n window.ScriptsActivator.loadStatisticsScripts = function () {\n this.loadScripts(window.ScriptsActivator.statFn);\n this.statLoaded = true;\n };\n\n window.ScriptsActivator.loadAllScripts = function (func, mark, stat) {\n if (func && !this.funcLoaded)\n this.loadFunctionalityScripts();\n\n if (mark && !this.markLoaded)\n this.loadMarketingScripts();\n\n if (stat && !this.statLoaded)\n this.loadStatisticsScripts();\n }\n\n window.ScriptsActivator.removeScriptsElements = function() {\n $(\"script[data-script]\").each(function(a,script) {\n if (script) {\n $(script).remove();\n }\n });\n }\n\n window.ScriptsActivator.removeScriptsElements();\n});\n","var Vendd = (function (Vendd) {\n 'use strict';\n\n Vendd.Service = (function (Service) {\n\n Service.call = function (options) {\n var defOpts, opts, serviceUrl, onErrorInternal;\n\n defOpts = {\n async: true,\n method: options.method || 'POST',\n url: '#',\n data: {},\n rawdata: false,\n servicenamespace: options.servicenamespace || 'services',\n onSuccess: function (response) {\n },\n onFailure: function (err) {\n throw err;\n },\n onUnauthenticated: function (url) {\n throw new Error('not implemented: onUnauthenticated(url)');\n }\n };\n\n opts = _.extend(defOpts, options);\n\n serviceUrl = /^([^:]+:)?\\/\\//.test(opts.url) ? // is it an absolute url? dont't touch it\n opts.url :\n document.location.protocol.toLowerCase()\n + '//' + document.location.host.toLowerCase()\n + (opts.servicenamespace ? '/' + opts.servicenamespace : '')\n + '/' + opts.url;\n\n serviceUrl = serviceUrl.split('?')[0];\n\n var locationQueryParams = LhApp.Function.QueryString.parse(window.location.href);\n\n var serviceQueryParams = LhApp.Function.QueryString.parse(opts.url);\n\n ///force current page language in every service request\n if (!serviceQueryParams['lang']) {\n serviceQueryParams['lang'] = (locationQueryParams['lang'] || LhApp.Context.Language).toLowerCase();;\n }\n ///force country in every service request IF PRESENT in current url\n if (!serviceQueryParams['country'] && locationQueryParams['country']) {\n serviceQueryParams['country'] = locationQueryParams['country'].toLowerCase();\n }\n ///force currency in every service request IF PRESENT in current url\n if (!serviceQueryParams['currency'] && locationQueryParams['currency']) {\n serviceQueryParams['currency'] = locationQueryParams['currency'].toLowerCase();\n }\n \n var _data = {};\n var _query;\n //if is get request the data will be posted as query. any key present in queryparams will be overriten by the value of the same key (if exists) in data\n if ((options.method || 'POST').toUpperCase() == 'GET') {\n _.each(opts.data, function (val, key) {\n _data[key.toLowerCase()] = val;\n });\n _data = _.extend(serviceQueryParams, opts.data);\n }\n else {\n _data = opts.data;\n _query = $.param(serviceQueryParams).toString();\n }\n\n if (_query)\n serviceUrl += '?' + _query; \n\n onErrorInternal = function (ex) {\n if (ex && ex.responseJSON && ex.responseJSON.ExceptionType) {\n var typeName = ex.responseJSON.ExceptionType.split('.').pop();\n\n if (typeName === 'AuthenticationServiceException') {\n if (typeof (opts.onUnauthenticated) === 'function') {\n opts.onUnauthenticated(ex.responseJSON.Message);\n }\n else {\n throw ex;\n }\n }\n else {\n if (typeof (opts.onFailure) === 'function') {\n opts.onFailure(ex);\n }\n else {\n throw ex;\n }\n }\n }\n else {\n if (typeof (opts.onFailure) === 'function') {\n opts.onFailure(ex);\n }\n else {\n throw ex;\n }\n }\n };\n\n $.ajax({\n async: opts.async || true,\n type: opts.method,\n dataType: opts.rawdata ? 'text' : 'json',\n contentType: opts.rawdata ? '' : 'application/json; charset=UTF-8',\n ContentType: opts.rawdata ? '' : 'application/json; charset=UTF-8',\n url: serviceUrl,\n data: (opts.method == 'GET') ? _data : opts.rawdata ? _data : JSON.stringify(_data),\n success: function (response) {\n\n var obj = response;\n\n if (response.d)\n obj = response.d;\n\n if (typeof obj === 'string' || obj instanceof String)\n obj = JSON.parse(obj);\n\n if (typeof (opts.onSuccess) === 'function') {\n opts.onSuccess(obj);\n }\n },\n failure: function (ex) {\n onErrorInternal(ex);\n },\n error: function (ex) {\n onErrorInternal(ex);\n }\n });\n };\n\n return Service;\n\n })(Vendd.Service || {});\n\n return Vendd;\n\n})(Vendd || {});","var Vendd = (function (Vendd) {\n 'use strict';\n /*\n * ERROR CODE\n * ---------------\n * 1000 INVALID CONFIGURATOR ITEM ID\n * 1001 CONFIGURATOR NOT FOUND / INITIALIZED\n * 1002 INVALID CONFIGURATOR MODEL DATA\n * 1003 INVALID OPTIONAL ITEM ID\n * 1004 INVALID CONFIGURATOR VALUES \n * 1010 MIN QUANTITY OF OPTIONAL ITEM\n * 1011 MAX QUANTITY OF OPTIONAL ITEM\n * 1012 DEFAULT OPTIONAL ITEM CAN NOT REMOVE\n * 1020 MIN QUANTITY FOR GROUP OF OPTIONAL ITEMS\n * 1021 MAX QUANTITY FOR GROUP OF OPTIONAL ITEMS\n * 1040 MIN QUANTITY FOR ALL ITEMS\n * 1041 MAX QUANTITY FOR ALL ITEMS\n * 1030 INCOMATIBLE OPTIONAL ITEM\n * 1031 PREREQUISITES FOR OPTIONAL ITEM NOT EXIST\n * 1032 ERROR CODE 1030 & ERROR CODE 1031\n * 1033 NOT EXISTS ANY OF REQUIRED INGREDIENTS\n * 1034 INGREDIENT DISABLED FROM SELECTED SUBRECIPE\n * 1035 INGREDIENT DISABLED FROM MASTER RECIPE\n * 1050 NO LOCAL STORAGE CONFIGURATOR MODEL SAVED\n * 1060 ERROR SAVING DATA\n * 1061 ERROR SAVING DATA - NOT SET CONFIGURATOR ITEM ID\n * 1070 OUTDATED LOADED DATA\n * 1071 ERROR LOADING DATA - NOT GLOBALID SET\n * 1072 ERROR LOADING DATA - SAVED INGREDIENT DOES NOT EXISTS ANY MORE\n * 1073 ERROR LOADING DATA - SAVED INGREDIENT CHANGE PRICE\n * 1074 ERROR LOADING DATA - SAVED INGREDIENT CHANGE INCOMPATIBLES\n * 1075 ERROR LOADING DATA - SAVED INGREDIENT CHANGE PREREQUISITES\n * */\n var _recipes = {};\n var _recipesOld = {};\n var returnResponse = function (recipeId, statusCode, errorCode, data) {\n\n\n return {\n success: statusCode === 200,\n data: data || {},\n status: {\n statusCode: statusCode,\n recipeId: recipeId,\n ErrorCode: errorCode || 0\n }\n }\n };\n\n var getRecipe = function (model, recipeId) {\n\n var recipeModel = model ? model : testModel,\n recipe = _.isArray(recipeModel) ? _.first(_.filter(recipeModel, function (x) { return x.RecipeId === recipeId && x.TotalCount > 0; })) : recipeModel;\n\n return $.extend(true, {}, recipe);\n };\n\n var getTotalQuantity = function (model, ingredientId) {\n var items = _.filter(model.RecipeItems, function (item) { return item.IngredientId !== ingredientId; });\n return _.reduce(items, function (memo, item) { return memo + (item.Quantity || 0); }, 0);\n }\n\n var getGroupQuantity = function (model, group, ingredientId) {\n var items = _.filter(model.RecipeItems, function (item) { return item.GroupId === group.Id && item.IngredientId !== ingredientId; });\n return _.reduce(items, function (memo, item) { return memo + (item.Quantity || 0); }, 0);\n }\n\n var getTotalWeight = function (model, ingredientId) {\n var items = _.filter(model.RecipeItems, function (item) { return item.IngredientId !== ingredientId; });\n return _.reduce(items, function (memo, item) { return memo + (item.Weight || 0); }, 0);\n }\n Vendd.RecipeLibrary = Vendd.RecipeLibrary || {};\n\n Vendd.RecipeLibrary.DeclareState = function (model, recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n _recipes[recipeId] = model;\n var data = {};\n data.recipe = $.extend(true, {}, model);\n data.isValid = checkRestrictions(model);\n return returnResponse(recipeId, 200, 0, data);\n };\n\n Vendd.RecipeLibrary.GetModel = function (recipeId) {\n\n if (!_recipes[recipeId]) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n return returnResponse(recipeId, 200, 0, _recipes[recipeId]);\n };\n\n Vendd.RecipeLibrary.InitRecipe = function (model, recipeId, force) {\n force = force || false;\n if (_recipes[recipeId] && !force) {\n return returnResponse(recipeId, 500, 1000);\n }\n var recipe = getRecipe(model, recipeId);\n if (!recipe) {\n return returnResponse(recipeId, 500, 1001);\n }\n _recipes[recipeId] = recipe;\n _recipes[recipeId].AFirstInclusion = 1;\n\n _recipes[recipeId].Ingredients = [];\n _recipes[recipeId].Groups = [];\n _recipes[recipeId].RecipeItems = [];\n\n $.each(recipe.Categories, function (indexCategory, category) {\n $.each(category.Groups, function (indexGroup, group) {\n $.each(group.VisualGroups, function (indexGroup, visualgroup) {\n var groupItems = _.reduce(visualgroup, function (vg, sum) { return vg.length + sum; });\n group.IsMultiSelect = !(group.MinQuantity <= 1 && group.MaxQuantity === 1 && groupItems > 1);\n group.DefaultQuantities = 0;\n\n if (!group.IsMultiSelect && group.MinQuantity === 0) {\n var sampleOptionItemNone = {\n CanRemove: true,\n Category: category.Category,\n DefaultQuantity: 0,\n DeletedPrice: 0,\n DeletedPriceText: \"\",\n Price: 0,\n PriceText: \"\",\n PriceWithoutVat: 0,\n PriceWithoutVatText: \"\",\n MinQuantity: 0,\n MaxQuantity: 1,\n Weight: 0,\n Name: \"None of below\",\n OrderNumber: 0,\n Quanta: 1,\n QuantaText: \"\",\n RecipeGroupId: group.Id,\n RecipeGroupName: group.Name,\n IngredientId: 0,\n Stock: 1,\n TaxClassId: 0,\n VariantId: 0,\n IsNullable: true\n };\n visualgroup.Items.unshift(sampleOptionItemNone);\n }\n\n $.each(visualgroup.Items, function (indexItem, item) {\n //fix wrong default value from min-max item quantity\n group.DefaultQuantities += item.DefaultQuantity;\n item.HasValidDefaultValues = item.MinQuantity <= item.DefaultQuantity && item.MaxQuantity >= item.DefaultQuantity;\n item.DefaultQuantity = item.MinQuantity > item.DefaultQuantity ? item.MinQuantity : item.MaxQuantity < item.DefaultQuantity ? item.MaxQuantity : item.DefaultQuantity;\n item.IsMandatory = item.MinQuantity === item.DefaultQuantity || !item.CanRemove;\n item.Disabled = (item.MinQuantity === item.DefaultQuantity && item.MaxQuantity === item.DefaultQuantity && item.DefaultQuantity > 0) || !item.CanRemove;\n item.Checked = item.IsDefault;\n var ingredient = item;\n ingredient.GroupId = group.Id;\n _recipes[recipeId].Ingredients.push(ingredient);\n if (item.Price <= 0) {\n item.Price = 0;\n item.PriceText = \"\";\n }\n if (ingredient.DefaultQuantity > 0) {\n _recipes[recipeId].RecipeItems.push({\n RecipeId: recipeId,\n Category: ingredient.Category,\n CategoryCode: ingredient.CategoryCode,\n ManufacturerProductCode: ingredient.ManufacturerProductCode,\n GroupId: group.Id,\n IngredientId: ingredient.IngredientId,\n ProductItemCode: ingredient.RecipeItemCode,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n Name: ingredient.Name || \"\",\n Quantity: ingredient.DefaultQuantity,\n Price: 0,//(Math.round(ingredient.Price * 100) / 100) * ingredient.DefaultQuantity,\n PriceWithoutVat: 0,\n TotalPrice: 0,\n TotalPriceWithoutVat: 0,\n Weight: ingredient.Weight || 0,\n IsStandard: ingredient.DefaultQuantity > 0,\n SubRecipeId: ingredient.SubRecipeId,\n SubRecipeCode: ingredient.SubRecipeCode\n });\n }\n });\n group.HasValidDefaultValues = group.MinQuantity <= group.DefaultQuantities && group.MaxQuantity >= group.DefaultQuantities;\n if (!group.IsMultiSelect && group.DefaultQuantities === 0 && group.MinQuantity === 0) {\n var defaultItem = visualgroup.Items[0];\n defaultItem.Checked = true;\n }\n _recipes[recipeId].Groups.push(group);\n });\n });\n });\n\n $.each(_.filter(recipe.Ingredients, function (i) { return i.SubRecipeId && i.SubRecipe; }) || []\n , function (i, s) {\n Vendd.RecipeLibrary.InitRecipe(s.SubRecipe, s.RecipeItemId, force);\n });\n\n _recipes[recipeId].HashCode = getRecipeItemsHashCode(recipeId);\n\n if (localStorage.getItem(\"globalId_\" + recipeId) !== null) {\n localStorage.removeItem(\"globalId_\" + recipeId);\n }\n\n return Vendd.RecipeLibrary.DeclareState(recipe, recipeId);\n };\n\n Vendd.RecipeLibrary.ResetRecipe = function (model, recipeId) {\n\n if (!_recipes[recipeId]) {\n return returnResponse(recipeId, 500, 1000);\n }\n var recipe = getRecipe(model, recipeId);\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1001);\n }\n //reinitialize\n delete _recipes[recipeId];\n _recipes[recipeId] = recipe;\n\n if (localStorage.getItem(\"globalId_\" + recipeId) !== null) {\n localStorage.removeItem(\"globalId_\" + recipeId);\n }\n return Vendd.RecipeLibrary.DeclareState(model, recipeId);\n };\n\n Vendd.RecipeLibrary.AddIngredient = function (model, recipeId, ingredientId, quantity, isTotal) {\n var recipe = _recipes[recipeId];\n\n if (!_recipes[recipeId]) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1001);\n }\n\n var group = null;\n var ingredient = _.find(model.Ingredients, function (i) { return i.IngredientId === ingredientId; });\n if (ingredient) group = _.find(model.Groups, function (g) { return g.Id === ingredient.GroupId; });\n\n if (!(ingredient && group)) {\n return returnResponse(recipeId, 500, 1003);\n }\n\n var isCompatible = (Vendd.RecipeLibrary.CheckIncompatibles(recipeId, ingredientId)).success;\n var responsePrerequisites = (Vendd.RecipeLibrary.CheckPrerequisites(recipeId, ingredientId));\n var successPrerequisites = responsePrerequisites.success || (!responsePrerequisites.success && responsePrerequisites.data.BothPrerequisite);\n\n var recipeIngredient = _.first(_.filter(model.RecipeItems, function (x) { return x.IngredientId === ingredientId && x.RecipeId === recipeId; }));\n if (!isCompatible || !successPrerequisites) {\n var errorCode = !isCompatible && !successPrerequisites ? 1032 : !isCompatible ? 1030 : 1031;\n return returnResponse(recipeId, 500, errorCode);\n }\n\n var hasPrerequisitesAnyOfSet = (Vendd.RecipeLibrary.CheckPrerequisitesAnyOfSet(recipeId, ingredientId)).success;\n if (!hasPrerequisitesAnyOfSet) {\n return returnResponse(recipeId, 500, 1033);\n }\n var totalIngredientQuantity = isTotal ? quantity : ((recipeIngredient || {}).Quantity || 0) + quantity;\n totalIngredientQuantity = totalIngredientQuantity > 0 ? totalIngredientQuantity : 0;\n\n if (ingredient.MinQuantity && totalIngredientQuantity < ingredient.MinQuantity) {\n return returnResponse(recipeId, 500, 1010);\n }\n if (ingredient.MaxQuantity && totalIngredientQuantity > ingredient.MaxQuantity) {\n return returnResponse(recipeId, 500, 1011);\n }\n var maxGroupQuantity = group.MaxQuantity || 0;\n var groupQuantity = getGroupQuantity(model, group, ingredientId);\n\n if (maxGroupQuantity < groupQuantity + totalIngredientQuantity) {\n return returnResponse(recipeId, 500, 1021);\n }\n var maxQuantity = recipe.MaxQuantity || 0;\n var totalQuantity = getTotalQuantity(model, ingredientId);\n\n if (maxQuantity < totalQuantity + totalIngredientQuantity) {\n return returnResponse(recipeId, 500, 1041);\n }\n\n var price = (Math.round(ingredient.Price * 100) / 100);//* totalIngredientQuantity;\n var priceWithoutVat = (Math.round(ingredient.PriceWithoutVat * 100) / 100);//* totalIngredientQuantity;\n\n\n if (model.ParentRecipeId > 0) {\n var parentModel = Vendd.RecipeLibrary.GetModel(model.ParentRecipeItemId) || {};\n var parentIngredient = _.find(parentModel.Ingredients, function (i) { return i.VariantId === ingredient.VariantId; }) || {};\n if ((parentIngredient.IngredientId || 0) > 0) {\n var recipeAddResult = Vendd.RecipeLibrary.AddIngredient(parentModel, model.ParentRecipeItemId, parentIngredient.IngredientId, ingredient.Quantity, true);\n if (!recipeAddResult.success) {\n return returnResponse(recipeId, 500, 1034);\n };\n }\n }\n\n if (recipeIngredient) {\n recipeIngredient.Quantity = totalIngredientQuantity;\n recipeIngredient.Price = price;\n recipeIngredient.PriceWithoutVat = priceWithoutVat;\n } else {\n model.RecipeItems.push({\n RecipeId: recipeId,\n Category: ingredient.Category,\n CategoryCode: ingredient.CategoryCode,\n ManufacturerProductCode: ingredient.ManufacturerProductCode,\n GroupId: group.Id,\n IngredientId: ingredient.IngredientId,\n ProductItemCode: ingredient.RecipeItemCode,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n Name: ingredient.Name || \"\",\n Quantity: quantity,\n Price: price,\n PriceWithoutVat: priceWithoutVat,\n TotalPrice: Math.max(totalIngredientQuantity - ingredient.DefaultQuantity, 0) * price,\n TotalPriceWithoutVat: Math.max(totalIngredientQuantity - ingredient.DefaultQuantity, 0) * priceWithoutVat,\n Weight: ingredient.Weight,\n IsStandard: ingredient.DefaultQuantity > 0,\n SubRecipeId: ingredient.SubRecipeId,\n SubRecipeCode: ingredient.SubRecipeCode\n });\n }\n\n model.HashCode = getRecipeItemsHashCode(recipeId);\n\n //if (ingredient.SubRecipeId > 0) {\n // var subRecipeModel = Vendd.RecipeLibrary.GetModel(ingredient.RecipeItemId) || {};\n // _.each(subRecipeModel.RecipeItems || [], function (si) {\n // var subRecipeIngredient = _.find(model.Ingredients, function (i) { return i.VariantId == si.VariantId; }) || {};\n // if ((subRecipeIngredient.IngredientId || 0) > 0) {\n // var subRecipeGroup = _.find(model.Groups, function (g) { return subRecipeIngredient.GroupId == g.Id; });\n // var recipeAddResult;\n // if (subRecipeGroup.IsMultiSelect) {\n // recipeAddResult = Vendd.RecipeLibrary.AddIngredient(model, recipeId, subRecipeIngredient.IngredientId, subRecipeIngredient.Quantity, true);\n // } else {\n // var ingredientIdFrom = (_.find(model.RecipeItems, function (i) { return subRecipeIngredient.GroupId == i.GroupId; }) || {}).IngredientId || 0;\n // if (ingredientIdFrom > 0) {\n // recipeAddResult = Vendd.RecipeLibrary.ChangeIngredient(model, recipeId, ingredientIdFrom, subRecipeIngredient.IngredientId);\n // } else {\n // recipeAddResult = Vendd.RecipeLibrary.AddIngredient(model, recipeId, subRecipeIngredient.IngredientId, subRecipeIngredient.Quantity, true);\n // }\n // }\n // if (!recipeAddResult.success) {\n // var subRecipeRemoveResult = Vendd.RecipeLibrary.RemoveIngredient(subRecipeModel, ingredient.RecipeItemId, si.IngredientId, 0, true, true);\n // //Vendd.RecipeLibrary.DeclareState(subRecipeModel, ingredient.RecipeItemId);\n // }\n // }\n // });\n //}\n\n return Vendd.RecipeLibrary.DeclareState(model, recipeId);\n };\n\n Vendd.RecipeLibrary.RemoveIngredient = function (model, recipeId, ingredientId, quantity, recursive, force) {\n force = force === undefined ? true : force;\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1001);\n }\n\n var group = null;\n var ingredient = _.find(model.Ingredients, function (i) { return i.IngredientId === ingredientId; });\n if (ingredient) group = _.find(model.Groups, function (g) { return g.Id === ingredient.GroupId; });\n\n if (!(ingredient && group)) {\n return returnResponse(recipeId, 500, 1003);\n }\n\n var recipeIngredient = _.first(_.filter(model.RecipeItems, function (x) { return x.IngredientId === ingredientId && x.RecipeId === recipeId; }));\n\n var totalIngredientQuantity = recursive ? 0 : ((recipeIngredient || {}).Quantity || 0) - quantity;\n totalIngredientQuantity = totalIngredientQuantity > 0 ? totalIngredientQuantity : 0;\n\n if (ingredient.MinQuantity && totalIngredientQuantity < ingredient.MinQuantity) {\n return returnResponse(recipeId, 500, 1010);\n }\n\n var minGroupQuantity = group.MinQuantity || 0;\n var groupQuantity = getGroupQuantity(model, group, ingredientId);\n\n if (minGroupQuantity > groupQuantity + totalIngredientQuantity && !force) {\n return returnResponse(recipeId, 500, 1020);\n }\n var minQuantity = recipe.MinQuantity || 0;\n var totalQuantity = getTotalQuantity(model, ingredientId);\n\n if (minQuantity > totalQuantity + totalIngredientQuantity && !force) {\n return returnResponse(recipeId, 500, 1040);\n }\n\n if (recipeIngredient && totalIngredientQuantity > 0) {\n recipeIngredient.Quantity = totalIngredientQuantity;\n recipeIngredient.Price = price;\n } else {\n model.RecipeItems = _.filter(model.RecipeItems, function (x) { return x.IngredientId !== ingredientId; });\n }\n\n var ingredientsToBeRemoved = _.filter(model.Ingredients,\n function (i) {\n return i.Prerequisites && i.Prerequisites.indexOf(ingredientId) > -1 && model.RecipeItems.some(function (item) { return item.IngredientId === i.IngredientId });\n });\n\n for (var i = 0; i < ingredientsToBeRemoved.length; i++) {\n Vendd.RecipeLibrary.RemoveIngredient(model, recipeId, ingredientsToBeRemoved[i].IngredientId, null, true, true);\n }\n\n model.HashCode = getRecipeItemsHashCode(recipeId);\n\n return Vendd.RecipeLibrary.DeclareState(model, recipeId);\n\n };\n\n Vendd.RecipeLibrary.ChangeIngredient = function (model, recipeId, ingredientIdFrom, ingredientIdTo) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1001);\n }\n\n var groupFrom = null;\n var ingredientFrom = _.find(model.Ingredients, function (i) { return i.IngredientId === ingredientIdFrom; });\n if (ingredientFrom) groupFrom = _.find(model.Groups, function (g) { return g.Id === ingredientFrom.GroupId; });\n\n if (!(ingredientFrom && groupFrom)) {\n return returnResponse(recipeId, 500, 1003);\n }\n\n var recipeIngredientFrom = _.first(_.filter(model.RecipeItems, function (x) { return x.IngredientId === ingredientIdFrom && x.RecipeId === recipeId; }));\n\n if (!recipeIngredientFrom) {\n return returnResponse(recipeId, 500, 1002);\n }\n var totalQuantity = 1;\n\n model.RecipeItems = _.filter(model.RecipeItems, function (x) { return x.IngredientId !== ingredientIdFrom; });\n\n var ingredientsToBeRemoved = _.filter(model.Ingredients,\n function (i) {\n return i.Prerequisites && i.Prerequisites.indexOf(ingredientIdFrom) > -1 && model.RecipeItems.some(function (item) { return item.IngredientId === i.IngredientId; });\n });\n\n var prerequisitesResult = [];\n\n for (var i = 0; i < ingredientsToBeRemoved.length; i++) {\n prerequisitesResult = Vendd.RecipeLibrary.RemoveIngredient(model, recipeId, ingredientsToBeRemoved[i].IngredientId, null, true, true);\n }\n\n var result = Vendd.RecipeLibrary.AddIngredient(model, recipeId, ingredientIdTo, 1, true);\n\n model.HashCode = getRecipeItemsHashCode(recipeId);\n\n if (result.success) return result;\n\n return Vendd.RecipeLibrary.DeclareState(model, recipeId);\n\n };\n\n Vendd.RecipeLibrary.GetFullRecipeItems = function (recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var recipeItems = recipe.RecipeItems || [];\n _.each(\n _.filter(recipe.Ingredients, function (item) {\n return item.SubRecipeId && (_.find(recipeItems, function (i) { return i.IngredientId === item.IngredientId; }) !== undefined);\n }), function (item) {\n if (!item.IsStandard) {\n _.each(_recipes[item.RecipeItemId].RecipeItems, function (ingredient) { ingredient.IsStandard = false; });\n }\n recipeItems = recipeItems.concat(_recipes[item.RecipeItemId].RecipeItems);\n });\n var data = {};\n data.RecipeItems = recipeItems || [];\n return returnResponse(recipeId, 200, 0, data);\n };\n\n Vendd.RecipeLibrary.GetRecipeItems = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n var data = {};\n data.RecipeItems = recipe.RecipeItems || [];\n return returnResponse(recipeId, 200, 0, data);\n };\n\n Vendd.RecipeLibrary.GetOneDealerData = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n var data = {};\n\n data.ManufacturerName = recipe.ManufacturerName || \"\";\n data.ProductCode = recipe.ManufacturerProductCode || \"\";\n data.ManufacturerCode = recipe.ManufacturerCode || \"\";\n data.Series = recipe.CategoryCode || \"\";\n data.Name = recipe.Name || \"\";\n data.Guid = localStorage.getItem(\"globalId_\" + recipeId);\n\n data.Prices = {};\n data.Prices.OptionalTotalPrice = FixJSFloatBug(recipe.Prices.OptionalTotalPriceWithoutVat);\n data.Prices.StandardTotalPrice = FixJSFloatBug(recipe.Prices.StandardTotalPriceWithoutVat);\n data.Prices.InitialPrice = FixJSFloatBug(recipe.Prices.InitialPriceWithoutVat);\n data.Prices.TotalPrice = FixJSFloatBug(recipe.Prices.TotalPriceWithoutVat);\n\n data.ModelImageAbsoluteUrl = recipe.ProductImageUrl;\n\n var cartTypeCode = _.find(recipe.Attributes, function (i) { return i.Code === \"CarTypeCode\"; }) || {};\n data.CarTypeCode = (cartTypeCode.Value || \"Car\");\n var fuelTypeCode = _.find(recipe.Attributes, function (i) { return i.Code === \"FuelTypeCode\"; }) || {};\n data.FuelTypeCode = (fuelTypeCode.Value || \"\");\n var attributes = _.filter(recipe.Attributes, function (i) { return i.Code !== \"CarTypeCode\" && i.Code !== \"FuelTypeCode\"; }) || [];\n data.Attributes = _.map(attributes, function (i) {\n var item = {};\n item.AttributeCode = i.Code;\n item.Value = i.Value;\n item.Type = i.ValueType;\n return item;\n });\n var recipeItems = recipe.RecipeItems || [];\n _.each(\n _.filter(recipe.Ingredients, function (item) {\n return item.SubRecipeId && (_.find(recipeItems, function (i) { return i.IngredientId === item.IngredientId; }) !== undefined);\n }), function (item) {\n if (!item.IsStandard) {\n _.each(_recipes[item.RecipeItemId].RecipeItems, function (ingredient) { ingredient.IsStandard = false; ingredient.SubRecipeCode = item.ManufacturerProductCode; });\n }\n recipeItems = recipeItems.concat(_recipes[item.RecipeItemId].RecipeItems);\n });\n\n data.RecipeItems = _.map(recipeItems || [], function (i) {\n var item = {};\n item.CategoryCode = i.CategoryCode || \"\";\n item.Name = i.Name;\n item.Quantity = i.Quantity;\n //item.Price = i.Price;\n item.Price = i.PriceWithoutVat;\n item.ItemCode = i.ManufacturerProductCode || \"\";\n item.IsPackage = (i.SubRecipeId || 0) > 0;\n item.ParentPackageCode = i.SubRecipeCode || \"\";\n item.OptionType = i.IsStandard ? 0 : 1;\n return item;\n });\n return returnResponse(recipeId, 200, 0, data);\n };\n\n Vendd.RecipeLibrary.SetRecipeItems = function (recipeId, recipeItems) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n recipe.RecipeItems = recipeItems || [];\n\n return Vendd.RecipeLibrary.DeclareState(recipe, recipeId);\n };\n\n Vendd.RecipeLibrary.GetCheckedRecipeItems = function (recipeId, forceOptional) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n forceOptional = forceOptional !== undefined ? forceOptional : false;\n //var checkedItems = _.filter(recipe.Ingredients, function (item) { return item.DefaultQuantity > 0; });\n\n //var checkedRecipeItems = _.filter(recipe.RecipeItems, function (item) { return item.Quantity > 0; });\n\n var checkedRecipeItems = [];\n var optionalTotalPrice = 0;\n var optionalTotalItems = 0;\n var standardTotalPrice = 0;\n var standardTotalItems = 0;\n var optionalTotalPriceWithoutVat = 0;\n var standardTotalPriceWithoutVat = 0;\n\n //var deafaultItems = _.filter(recipe.Ingredients, function (item) { return item.DefaultQuantity > 0; });\n $.each(recipe.Ingredients, function (indexInArray, ingredient) {\n var item = _.find(recipe.RecipeItems, function (i) { return i.IngredientId === ingredient.IngredientId && i.Quantity > 0; });\n var groupQuantity = getGroupQuantity(recipe, { Id: ingredient.GroupId }, ingredient.IngredientId);\n var isMultiSelect = (_.find(recipe.Groups, function (group) { return ingredient.GroupId === group.Id; }) || {}).IsMultiSelect;\n var isChecked = item;\n if (!isMultiSelect) {\n var selectedItems = _.filter(recipe.RecipeItems, function (i) { return i.GroupId === ingredient.GroupId; }) || [];\n if (selectedItems.length > 1) {\n isChecked = isChecked && (selectedItems[0].IngredientId === ingredient.IngredientId);\n }\n }\n var isStandard = forceOptional ? false : (ingredient.IsNullable ? false : ingredient.DefaultQuantity > 0);\n if (isChecked) {\n var price = Math.round(ingredient.Price * 100) / 100;\n var totalPrice = ingredient.DefaultQuantity > 0 ?\n ((item.Quantity || 0) - (ingredient.DefaultQuantity || 0)) * price :\n (item.Quantity || 0) * price;\n var priceWithoutVat = Math.round(ingredient.PriceWithoutVat * 100) / 100;\n var totalPriceWithoutVat = ingredient.DefaultQuantity > 0 ?\n ((item.Quantity || 0) - (ingredient.DefaultQuantity || 0)) * priceWithoutVat :\n (item.Quantity || 0) * priceWithoutVat;\n checkedRecipeItems.push({\n RecipeItemId: recipeId,\n ImageUrl: ingredient.ImageUrl,\n Category: ingredient.Category,\n GroupId: ingredient.GroupId,\n IngredientId: ingredient.IngredientId,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n Name: ingredient.Name || \"\",\n //ParentProductId: recipeId,\n Quantity: item.Quantity,\n Price: price,\n PriceWithoutVat: priceWithoutVat,\n TotalPriceWithoutVat: totalPriceWithoutVat,\n Weight: ingredient.Weight,\n IsStandard: isStandard\n });\n if (isStandard) {\n standardTotalPrice += totalPrice;\n standardTotalPriceWithoutVat += totalPriceWithoutVat;\n standardTotalItems++;\n } else {\n optionalTotalPrice += totalPrice;\n optionalTotalPriceWithoutVat += totalPriceWithoutVat;\n optionalTotalItems++;\n }\n }\n if (ingredient.IsNullable) {\n if (groupQuantity === 0) {\n checkedRecipeItems.push({\n RecipeItemId: recipeId,\n ImageUrl: ingredient.ImageUrl,\n Category: ingredient.Category,\n GroupId: ingredient.GroupId,\n IngredientId: ingredient.IngredientId,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n Name: ingredient.Name || \"\",\n //ParentProductId: recipeId,\n Quantity: 1,\n Price: 0,\n PriceWithoutVat: 0,\n TotalPrice: 0,\n TotalPriceWithoutVat: 0,\n Weight: 0,\n IsStandard: isStandard\n });\n }\n }\n\n if (item && (item.Quantity || 0) > 0 && ingredient.SubRecipe) {\n var subCheckedRecipeItems = Vendd.RecipeLibrary.GetCheckedRecipeItems(ingredient.RecipeItemId, !isStandard) || {};\n if (subCheckedRecipeItems.success) {\n item.TotalPrice = subCheckedRecipeItems.data.Prices.TotalPrice;\n item.TotalPriceWithoutVat = subCheckedRecipeItems.data.Prices.TotalPriceWithoutVat;\n checkedRecipeItems = (checkedRecipeItems || []).concat(subCheckedRecipeItems.data.CheckedRecipeItems || []);\n //checkedRecipeItems = _.extend([], checkedRecipeItems, subCheckedRecipeItems.data.CheckedRecipeItems);\n }\n }\n });\n\n var uncheckedRecipeItems = _.reject(recipe.Ingredients, function (item) { return _.find(checkedRecipeItems, function (checked) { return item.IngredientId === checked.IngredientId; }); });\n\n var data = {};\n data.CheckedItemsOptionalTotal = optionalTotalItems;\n data.CheckedItemsStandardTotal = standardTotalItems;\n data.CheckedRecipeItems = checkedRecipeItems;\n data.UncheckedRecipeItems = uncheckedRecipeItems;\n data.Prices = {};\n data.Prices.OptionalTotalPrice = optionalTotalPrice;\n data.Prices.OptionalTotalPriceWithoutVat = optionalTotalPriceWithoutVat;\n data.Prices.StandardTotalPrice = standardTotalPrice;\n data.Prices.StandardTotalPriceWithoutVat = standardTotalPriceWithoutVat;\n data.Prices.InitialPrice = recipe.UnitPrice;\n data.Prices.InitialPriceWithoutVat = recipe.UnitPriceWithoutVat;\n data.Prices.TotalPrice = optionalTotalPrice + standardTotalPrice + recipe.UnitPrice;\n data.Prices.TotalPriceWithoutVat = optionalTotalPriceWithoutVat + standardTotalPriceWithoutVat + recipe.UnitPriceWithoutVat;\n recipe.Prices = data.Prices;\n\n return returnResponse(recipeId, 200, 0, data);\n\n };\n\n Vendd.RecipeLibrary.GetPrices = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var prices = {};\n prices.OptionalTotalPrice = 0;\n prices.StandardTotalPrice = 0;\n prices.OptionalTotalPriceWithoutVat = 0;\n prices.StandardTotalPriceWithoutVat = 0;\n _.each(recipe.RecipeItems, function (ri) {\n var ingredient = _.find(recipe.Ingredients, function (i) { return i.IngredientId === ri.IngredientId; }) || {};\n var defaultQuantity = ingredient.DefaultQuantity || 0;\n var initialPrice = Math.round((ingredient.Price || 0) * 100) / 100;\n var initialPriceWithoutVat = Math.round((ingredient.PriceWithoutVat || 0) * 100) / 100;\n var optionalQuantity = Math.max(ri.Quantity - defaultQuantity);\n var optionalTotalPrice = initialPrice * optionalQuantity;\n var optionalTotalPriceWithoutVat = initialPriceWithoutVat * optionalQuantity;\n var standardTotalPrice = 0;//defaultQuantity > 0 ? initialPrice * defaultQuantity : 0;\n var standardTotalPriceWithoutVat = 0;//defaultQuantity > 0 ? initialPrice * defaultQuantity : 0;\n if (ingredient.SubRecipe && ri.Quantity > 0) {\n var subPrices = Vendd.RecipeLibrary.GetPrices(ingredient.RecipeItemId) || {};\n optionalTotalPrice += (subPrices.OptionalTotalPrice || 0);\n optionalTotalPriceWithoutVat += (subPrices.OptionalTotalPriceWithoutVat || 0);\n standardTotalPrice += (subPrices.StandardTotalPrice || 0);\n standardTotalPriceWithoutVat += (subPrices.StandardTotalPriceWithoutVat || 0);\n }\n prices.OptionalTotalPrice += optionalTotalPrice;\n prices.StandardTotalPrice += standardTotalPrice;\n prices.OptionalTotalPriceWithoutVat += optionalTotalPriceWithoutVat;\n prices.StandardTotalPriceWithoutVat += standardTotalPriceWithoutVat;\n });\n prices.InitialPrice = recipe.UnitPrice;\n prices.InitialPriceWithoutVat = recipe.UnitPriceWithoutVat;\n prices.TotalPrice = prices.OptionalTotalPrice + prices.StandardTotalPrice + prices.InitialPrice;\n prices.TotalPriceWithoutVat = prices.OptionalTotalPriceWithoutVat + prices.StandardTotalPriceWithoutVat + prices.InitialPriceWithoutVat;\n recipe.Prices = prices;\n return prices;\n };\n\n Vendd.RecipeLibrary.GetWeight = function (recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n var weightObj = {};\n weightObj.InitialWeight = recipe.Weight || 0;\n weightObj.OptionalTotalWeight = getTotalWeight(recipe, recipeId);\n return weightObj;\n\n };\n\n Vendd.RecipeLibrary.GetEnabledItems = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var data = {};\n data.EnabledItems = [];\n data.DisableItems = [];\n\n data.GroupErrors = [];\n\n data.Errors = [];\n\n var totalQuantity = getTotalQuantity(recipe);\n var extraQuantity = 0;\n var errorCode = 0;\n if (totalQuantity < recipe.MinQuantity) {\n errorCode = 1042;\n extraQuantity = recipe.MinQuantity - totalQuantity;\n }\n else if (totalQuantity > recipe.MaxQuantity) {\n errorCode = 1043;\n extraQuantity = totalQuantity - recipe.MaxQuantity;\n }\n if (errorCode > 0) {\n data.Errors.push({\n RecipeId: recipeId,\n ErrorCode: errorCode,\n ExtraQuantity: extraQuantity,\n MinQuantity: recipe.MinQuantity,\n MaxQuantity: recipe.MaxQuantity,\n Quantity: totalQuantity\n });\n }\n\n //var subRecipeIngredientIds = [];\n\n\n //var subRecipes = _.filter(recipe.Ingredients, function (i) {\n // if (i.SubRecipeId == 0) return false;\n // return recipe.RecipeItems.some(function (r) { return r.VariantId === i.VariantId; });\n //}) || [];\n //_.each(subRecipes, function (sr) {\n // var subRecipe = Vendd.RecipeLibrary.GetModel(sr.RecipeItemId) || {};\n // _.each(subRecipe.Ingredients || [], function (i) {\n // if (i.VariantId > 0) {\n // var i_group = _.find(recipe.Groups, function (g) {\n // return g.Items.some(function (i_g) { return i.VariantId === i_g.VariantId; });\n // });\n // if (i_group.IsMultiSelect) {\n\n // //var ingredients = recipe.Ingredients.filter(function (item) { return item.VariantId === i.VariantId; });\n // var ingredients = _.map(\n // recipe.Ingredients.filter(function (item) { return item.VariantId === i.VariantId; }),\n // function (x) { return x.IngredientId; });\n // } else {\n // //var ingredients = i_group.Items;\n // var ingredients = _.map(i_group.Items, function (item) {\n // return item.IngredientId;\n // });\n // }\n // subRecipeIngredientIds = _.uniq(_.union(subRecipeIngredientIds, ingredients));\n // }\n // });\n //});\n\n $.each(recipe.Categories, function (indexCategory, category) {\n $.each(category.Groups, function (indexGroup, group) {\n //group.IsMultiSelect = !(group.MinQuantity <= 1 && group.MaxQuantity == 1 && group.Items.length > 1);\n var groupQuantity = getGroupQuantity(recipe, group);\n var disableAllGroup = _.filter(recipe.Ingredients, function (i) { return i.GroupId === group.Id && !i.CanRemove && !group.IsMultiSelect; }).length > 0;\n $.each(group.VisualGroups, function (indexVisualGroup, visualGroup) {\n $.each(visualGroup.Items, function (indexItem, ingredient) {\n var recipeIngredient = _.first(_.filter(recipe.RecipeItems, function (x) { return x.IngredientId === ingredient.IngredientId && x.RecipeId === recipeId; })) || {};\n var quantity = recipeIngredient.Quantity || 0;\n //einai project specific gia bjt, prepei na allaxei se general\n var isDisableFromSubRecipe = false; //subRecipeIngredientIds.some(function (x) { return x == ingredient.IngredientId; });\n var isDisabled = !ingredient.CanRemove ||\n (ingredient.MaxQuantity <= quantity && ingredient.MinQuantity > quantity) ||\n //(group.MinQuantity >= groupQuantity && quantity > 0) ||\n (group.MaxQuantity <= groupQuantity && quantity === 0) ||\n //(recipe.MinQuantity >= totalQuantity && quantity > 0) ||\n (recipe.MaxQuantity <= totalQuantity && quantity === 0)\n ;\n var canAdd = ingredient.MaxQuantity > quantity && group.MaxQuantity > groupQuantity;\n var canRemove = ingredient.MinQuantity < quantity && ingredient.CanRemove;\n var isChecked = quantity > 0;\n var checkIncompatibles = (Vendd.RecipeLibrary.CheckIncompatibles(recipeId, ingredient.IngredientId));\n var isEnabledIncompatible = checkIncompatibles.success || (!checkIncompatibles.success && checkIncompatibles.data.BothSelected);\n var checkPrerequisites = (Vendd.RecipeLibrary.CheckPrerequisites(recipeId, ingredient.IngredientId));\n var isEnabledPrerequisites = checkPrerequisites.success || (!checkPrerequisites.success && checkPrerequisites.data.BothPrerequisite);\n var checkPrerequisitesAnyOfSet = (Vendd.RecipeLibrary.CheckPrerequisitesAnyOfSet(recipeId, ingredient.IngredientId));\n var errorCode = 0;\n if (!disableAllGroup && ((!group.IsMultiSelect || !isDisabled) && (isEnabledIncompatible && isEnabledPrerequisites && checkPrerequisitesAnyOfSet.success && !isDisableFromSubRecipe) || ingredient.IsNullable)) {\n if (isDisabled && ingredient.DefaultQuantity > 0 && ingredient.MinQuantity === ingredient.DefaultQuantity) errorCode = 1012;\n else if (!checkIncompatibles.success) errorCode = checkIncompatibles.status.ErrorCode;\n else if (!checkPrerequisites.success) errorCode = checkPrerequisites.status.ErrorCode;\n else if (!checkPrerequisitesAnyOfSet.success) errorCode = checkPrerequisitesAnyOfSet.status.ErrorCode;\n data.EnabledItems.push({\n RecipeId: recipeId,\n GroupId: group.Id,\n IngredientId: ingredient.IngredientId,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n ErrorCode: errorCode,\n CanAdd: canAdd,\n canRemove: canRemove,\n Incompatibles: checkIncompatibles.data.Incompatibles,\n MissingPrerequisites: checkPrerequisites.data.MissingPrerequisites,\n MissingAnyOfPrerequisites: checkPrerequisitesAnyOfSet.data.MissingAnyOfPrerequisites,\n });\n } else {\n var disableIncompatibles = true;\n if (isDisabled && ingredient.DefaultQuantity > 0 && ingredient.MinQuantity === ingredient.DefaultQuantity) errorCode = 1012;\n //else if (group.MinQuantity >= groupQuantity && group.IsMultiSelect && isChecked) errorCode = 1020;\n else if (group.MaxQuantity <= groupQuantity && group.IsMultiSelect && !isChecked) errorCode = 1021;\n else if (disableAllGroup) errorCode = 1021;\n //else if (recipe.MinQuantity >= totalQuantity && group.IsMultiSelect && isChecked) errorCode = 1040;\n else if (recipe.MaxQuantity <= totalQuantity && group.IsMultiSelect && !isChecked) errorCode = 1041;\n else if (ingredient.MinQuantity > quantity && group.IsMultiSelect && isChecked) errorCode = 1010;\n else if (ingredient.MaxQuantity <= quantity && group.IsMultiSelect && !isChecked) errorCode = 1011;\n else if (!checkIncompatibles.success) errorCode = 1030;\n else if (!checkPrerequisites.success) errorCode = 1031;\n else if (!checkPrerequisitesAnyOfSet.success) errorCode = 1033;\n else if (isDisableFromSubRecipe) errorCode = 1034;\n if (errorCode > 0) {\n data.DisableItems.push({\n RecipeId: recipeId,\n GroupId: group.Id,\n IngredientId: ingredient.IngredientId,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n ErrorCode: errorCode,\n CanAdd: canAdd,\n canRemove: canRemove,\n Incompatibles: checkIncompatibles.data.Incompatibles,\n MissingPrerequisites: checkPrerequisites.data.MissingPrerequisites,\n MissingAnyOfPrerequisites: checkPrerequisitesAnyOfSet.data.MissingAnyOfPrerequisites,\n\n });\n }\n }\n });\n });\n var groupErrorCode = 0;\n var extraQuantity = 0;\n if (groupQuantity < group.MinQuantity) {\n groupErrorCode = 1022;\n extraQuantity = group.MinQuantity - groupQuantity;\n }\n else if (groupQuantity > group.MaxQuantity) {\n groupErrorCode = 1023;\n extraQuantity = groupQuantity - group.MaxQuantity;\n }\n if (groupErrorCode > 0) {\n data.GroupErrors.push({\n Id: group.Id,\n RecipeId: recipeId,\n ErrorCode: groupErrorCode,\n ExtraQuantity: extraQuantity,\n MinQuantity: group.MinQuantity,\n MaxQuantity: group.MaxQuantity,\n Quantity: groupQuantity,\n Name: group.Name,\n CategoryName: category.Category\n });\n }\n });\n });\n\n return returnResponse(recipeId, 200, 0, data);\n };\n\n Vendd.RecipeLibrary.CheckIncompatibles = function (recipeId, ingredientId) {\n\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var ingredient = _.find(recipe.Ingredients, function (i) { return i.IngredientId === ingredientId; });\n var recipeIngredient = _.first(_.filter(recipe.RecipeItems, function (x) { return x.IngredientId === ingredient.IngredientId; })) || {};\n\n if (!ingredient) {\n return returnResponse(recipeId, 500, 1002);\n }\n\n var data = {};\n var incompatibles = _.filter(ingredient.Incompatibles,\n function (i) {\n return recipe.RecipeItems.some(function (item) { return item.IngredientId === i; });\n }) || [];\n\n if (incompatibles.length > 0) {\n data.Incompatibles = _.filter(recipe.Ingredients, function (item) { return incompatibles.some(function (i) { return item.IngredientId === i; }) });\n data.BothSelected = (recipeIngredient.Quantity || 0) > 0;\n return returnResponse(recipeId, 500, 1030, data);\n }\n\n return returnResponse(recipeId, 200);\n }\n\n Vendd.RecipeLibrary.CheckPrerequisites = function (recipeId, ingredientId) {\n\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var ingredient = _.find(recipe.Ingredients, function (i) { return i.IngredientId === ingredientId });\n\n if (!ingredient) {\n return returnResponse(recipeId, 500, 1002);\n }\n\n var data = {};\n var missingPrerequisites = _.filter(ingredient.Prerequisites,\n function (i) {\n return !recipe.RecipeItems.some(function (item) { return item.IngredientId === i; });\n }) || [];\n\n if (missingPrerequisites.length > 0) {\n data.MissingPrerequisites = _.filter(recipe.Ingredients, function (item) { return missingPrerequisites.some(function (i) { return item.IngredientId === i; }) });\n var bothPrerequisite = _.filter(data.MissingPrerequisites,\n function (i) {\n return i.Prerequisites.length > 0 && i.Prerequisites.some(function (item) { return item === ingredient.IngredientId; });\n }) || [];\n data.BothPrerequisite = bothPrerequisite.length > 0;\n return returnResponse(recipeId, 500, 1031, data);\n }\n\n return returnResponse(recipeId, 200);\n }\n\n Vendd.RecipeLibrary.CheckPrerequisitesAnyOfSet = function (recipeId, ingredientId) {\n\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var ingredient = _.find(recipe.Ingredients, function (i) { return i.IngredientId === ingredientId });\n\n if (!ingredient) {\n return returnResponse(recipeId, 500, 1002);\n }\n\n var data = {};\n data.MissingAnyOfPrerequisites = [];\n var hasMissingAnyOfPrerequisites = false;\n for (var i = 0; i < (ingredient.RequiresAnyOfSet || []).length; i++) {\n var requiredSetItems = ingredient.RequiresAnyOfSet[i].RequiresAnyOfItems || [];\n var anyOfIngredient = _.filter(requiredSetItems,\n function (i) {\n return recipe.RecipeItems.some(function (item) { return item.IngredientId === i; });\n }) || [];\n\n if (anyOfIngredient.length === 0 && requiredSetItems.length > 0) {\n hasMissingAnyOfPrerequisites = true;\n var missingAnyOfPrerequisites = _.filter(recipe.Ingredients, function (item) { return requiredSetItems.some(function (i) { return item.IngredientId === i; }); });\n data.MissingAnyOfPrerequisites.push(missingAnyOfPrerequisites);\n }\n }\n if (hasMissingAnyOfPrerequisites)\n return returnResponse(recipeId, 500, 1033, data);\n\n return returnResponse(recipeId, 200);\n }\n\n Vendd.RecipeLibrary.IsValid = function (recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n var data = {};\n data.Errors = [];\n data.GroupErrors = [];\n data.IngredientsErrors = [];\n\n var totalQuantity = getTotalQuantity(recipe, recipeId);\n var extraQuantity = 0;\n var errorCode = 0;\n if (totalQuantity < recipe.MinQuantity) {\n errorCode = 1042;\n extraQuantity = recipe.MinQuantity - totalQuantity;\n }\n else if (totalQuantity > recipe.MaxQuantity) {\n errorCode = 1043;\n extraQuantity = totalQuantity - recipe.MaxQuantity;\n }\n if (errorCode > 0) {\n data.Errors.push({\n ParentProductId: recipeId,\n ErrorCode: errorCode,\n ExtraQuantity: extraQuantity,\n MinQuantity: recipe.MinQuantity,\n MaxQuantity: recipe.MaxQuantity,\n Quantity: totalQuantity\n });\n }\n\n $.each(recipe.Categories, function (indexCategory, category) {\n $.each(category.Groups, function (indexGroup, group) {\n var groupErrorCode = 0;\n var extraQuantity = 0;\n var groupQuantity = getGroupQuantity(recipe, group);\n if (groupQuantity < group.MinQuantity) {\n groupErrorCode = 1022;\n extraQuantity = group.MinQuantity - groupQuantity;\n }\n else if (groupQuantity > group.MaxQuantity) {\n groupErrorCode = 1023;\n extraQuantity = groupQuantity - group.MaxQuantity;\n }\n if (groupErrorCode > 0) {\n data.GroupErrors.push({\n Id: group.Id,\n RecipeId: recipeId,\n ErrorCode: groupErrorCode,\n ExtraQuantity: extraQuantity,\n MinQuantity: group.MinQuantity,\n MaxQuantity: group.MaxQuantity,\n Quantity: groupQuantity,\n Name: group.Name,\n CategoryName: category.Category\n });\n }\n $.each(group.VisualGroups, function (indexVisualGroup, visualGroup) {\n $.each(visualGroup.Items, function (indexItem, ingredient) {\n var recipeIngredient = _.first(_.filter(recipe.RecipeItems, function (x) { return x.IngredientId === ingredient.IngredientId; })) || _.find(recipe.RecipeItems, function (i) { return ingredient.RecipeItemId === i.RecipeItemId; }) || {};\n var quantity = recipeIngredient.Quantity || 0;\n var checkIncompatibles = (Vendd.RecipeLibrary.CheckIncompatibles(recipeId, ingredient.IngredientId));\n var checkPrerequisites = (Vendd.RecipeLibrary.CheckPrerequisites(recipeId, ingredient.IngredientId));\n var checkPrerequisitesAnyOfSet = (Vendd.RecipeLibrary.CheckPrerequisitesAnyOfSet(recipeId, ingredient.IngredientId));\n var errorCodes = [];\n if (ingredient.MinQuantity > quantity) errorCodes.push(1010);\n else if (ingredient.MaxQuantity < quantity) errorCodes.push(1011);\n else if (!checkIncompatibles.success && quantity > 0) errorCodes.push(1030);\n else if (!checkPrerequisites.success && quantity > 0) errorCodes.push(1031);\n else if (!checkPrerequisitesAnyOfSet.success && quantity > 0) errorCodes.push(1033);\n if (errorCodes.length > 0) {\n data.IngredientsErrors.push({\n RecipeId: recipeId,\n GroupId: group.Id,\n IngredientId: ingredient.IngredientId,\n ErrorCodes: errorCodes,\n Incompatibles: checkIncompatibles.data.Incompatibles || [],\n MissingPrerequisites: checkPrerequisites.data.MissingPrerequisites || [],\n MissingAnyOfPrerequisites: checkPrerequisitesAnyOfSet.data.MissingAnyOfPrerequisites || [],\n Name: ingredient.Name || \"\",\n Price: ingredient.Price,\n PriceWithoutVat: ingredient.PriceWithoutVat,\n PriceText: ingredient.PriceText,\n PriceWithoutVatText: ingredient.PriceWithoutVatText,\n TotalPrice: ingredient.TotalPrice,\n TotalPriceWithoutVat: ingredient.TotalPriceWithoutVat\n\n });\n }\n });\n });\n });\n });\n data.IsValid = data.Errors.length === 0 && data.GroupErrors.length === 0 && data.IngredientsErrors.length === 0;\n return data;\n }\n\n Vendd.RecipeLibrary.CompareModels = function (recipeId, savedModel) {\n\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n //ingredients hash code\n var ingedientsSavedModel = _.sortBy(savedModel.Ingredients, function (i) { return i.IngredientId; });\n var ingedientTemplate = \"{0}_{1}_{2}_{3}_{4}\";\n var ingedientsSavedModelHashCode = _.map(ingedientsSavedModel,\n function (i) {\n return ingedientTemplate\n .replace(\"{0}\", i.IngredientId || \"\")\n .replace(\"{1}\", i.GroupId || \"\")\n .replace(\"{2}\", i.Price || \"\")\n .replace(\"{3}\", (i.Incompatibles || []).join(\",\"))\n .replace(\"{4}\", (i.Prerequisites || []).join(\",\"));\n }).join(\"|\");\n var ingedientsModel = _.sortBy(recipe.Ingredients, function (i) { return i.IngredientId; });\n var ingedientsModelHashCode = _.map(ingedientsModel,\n function (i) {\n return ingedientTemplate\n .replace(\"{0}\", i.IngredientId || \"\")\n .replace(\"{1}\", i.GroupId || \"\")\n .replace(\"{2}\", i.Price || \"\")\n .replace(\"{3}\", (i.Incompatibles || []).join(\",\"))\n .replace(\"{4}\", (i.Prerequisites || []).join(\",\"));\n }).join(\"|\");\n\n //groups hash code\n var groupTemplate = \"{0}_{1}\";\n var groupsSavedModel = _.sortBy(savedModel.Groups, function (i) { return i.Id; });\n var savedGroupsModelHashCode = _.map(groupsSavedModel,\n function (i) {\n return groupTemplate\n .replace(\"{0}\", i.MinQuantity || 0)\n .replace(\"{1}\", i.MaxQuantity || 0);\n }).join(\"|\");\n var groupsModel = _.sortBy(recipe.Groups, function (i) { return i.Id; });\n var groupsModelHashCode = _.map(groupsModel,\n function (i) {\n return groupTemplate\n .replace(\"{0}\", i.MinQuantity || 0)\n .replace(\"{1}\", i.MaxQuantity || 0);\n }).join(\"|\");\n\n //models hash code\n var modelTemplate = \"{0}_{1}_{2}_{3}\";\n var savedModelHashCode = modelTemplate\n .replace(\"{0}\", savedModel.MinQuantity || 0)\n .replace(\"{1}\", savedModel.MaxQuantity || 0)\n .replace(\"{2}\", savedModel.MaxFreeQuantity || 0)\n .replace(\"{3}\", savedModel.MaxReplaceQuantity || 0);\n var modelHashCode = modelTemplate\n .replace(\"{0}\", recipe.MinQuantity || 0)\n .replace(\"{1}\", recipe.MaxQuantity || 0)\n .replace(\"{2}\", recipe.MaxFreeQuantity || 0)\n .replace(\"{3}\", recipe.MaxReplaceQuantity || 0);\n\n //modelHashCode = \"\"; //<----remove this , is test data and only\n if (ingedientsSavedModelHashCode === ingedientsModelHashCode && groupsModelHashCode === savedGroupsModelHashCode && savedModelHashCode === modelHashCode)\n return returnResponse(recipeId, 200);\n\n var recipeItems = [];\n var IngredientsErrors = [];\n var IngredientsWarnings = [];\n var data = {};\n _.each(savedModel.RecipeItems, function (r) {\n var ingredient = _.find(recipe.Ingredients, function (i) { return r.IngredientId === i.IngredientId; }) || _.find(recipe.Ingredients, function (i) { return r.RecipeItemId === i.RecipeItemId; });\n var savedIngredient = _.find(savedModel.Ingredients, function (i) { return r.IngredientId === i.IngredientId; }) || _.find(savedModel.Ingredients, function (i) { return r.RecipeItemId === i.RecipeItemId; });\n if (ingredient === null) {\n IngredientsErrors.push({\n IngredientId: savedIngredient.IngredientId,\n Name: savedIngredient.Name,\n Price: savedIngredient.Price,\n Incompatibles: savedIngredient.Incompatibles,\n Prerequisites: savedIngredient.Prerequisites,\n ErrorCodes: [1072]\n });\n return;\n }\n if (ingredient.Price !== savedIngredient.Price) {\n IngredientsWarnings.push({\n IngredientId: savedIngredient.IngredientId,\n Name: savedIngredient.Name,\n Price: savedIngredient.Price,\n Incompatibles: savedIngredient.Incompatibles,\n Prerequisites: savedIngredient.Prerequisites,\n ErrorCodes: [1073]\n });\n }\n recipeItems.push({\n RecipeId: recipeId,\n Category: ingredient.Category,\n CategoryCode: ingredient.CategoryCode,\n GroupId: ingredient.GroupId,\n IngredientId: ingredient.IngredientId,\n ProductItemCode: ingredient.RecipeItemCode,\n ProductItemId: ingredient.RecipeItemId,\n VariantId: ingredient.VariantId,\n Name: ingredient.Name || \"\",\n Quantity: (savedIngredient.Quantity || 1),\n Price: savedIngredient.Price,\n TotalPrice: Math.max((savedIngredient.Quantity || 1) - ingredient.DefaultQuantity, 0) * savedIngredient.Price,\n Weight: ingredient.Weight,\n IsStandard: ingredient.DefaultQuantity > 0,\n SubRecipeId: ingredient.SubRecipeId,\n SubRecipeCode: ingredient.SubRecipeCode\n });\n });\n\n var checkModel = $.extend({}, recipe);\n recipe.RecipeItems = _.reject(recipeItems, function (r) { return IngredientsErrors.some(function (i) { return i.IngredientId === r.IngredientId; }); });\n\n var validatedModel = Vendd.RecipeLibrary.IsValid(recipeId);\n\n data.IngredientsErrors = validatedModel.IngredientsErrors.concat(IngredientsErrors);\n data.IngredientsWarnings = IngredientsWarnings;\n\n data = $.extend({}, validatedModel, data || {});\n if (!data.IsValid || data.IngredientsErrors.length > 0 || data.GroupErrors.length > 0 || data.Errors.length > 0) {\n return returnResponse(recipeId, 500, 1004, data);\n }\n return returnResponse(recipeId, 200);\n }\n /*\n * GET GLOBAL ID CONFIGURATION\n * RecipeId the receipe identifier\n * Force if true, although that mighth be cached global id , it will create a new one - default value:false,\n * FriendlyName a friendly name for saving - default value: empty,\n * Vin the vin number - default value: empty,\n * PartnerId the vin number - default value: empty,\n * serviceurl the url service - default value: '/services/api/Product/SaveRecipeConfiguration',\n * onSuccess the function of success saving global identifier,\n * onError the function of error saving global identifier,\n */\n Vendd.RecipeLibrary.GenerateGlobalId = function (config) {\n\n var _def = $.Deferred();\n var data = {};\n\n var defaultConfiguration = {\n Force: false,\n FriendlyName: \"\",\n Vin: \"\",\n PartnerId: \"\",\n serviceurl: \"/services/api/Product/SaveRecipeConfiguration\"\n };\n\n defaultConfiguration.onSuccess = function (response) {\n if (!response.success || !response.data || !response.data.GlobalId) {\n config.onError(response);\n return;\n }\n data.GlobalId = response.data.GlobalId;\n data.SavedGlobalIdToLocal = (Vendd.RecipeLibrary.SaveGlobalIdToLocal(config.RecipeId, data.GlobalId)).success;\n data.SaveRecipeItemsToLocal = (Vendd.RecipeLibrary.SaveRecipeItemsToLocal(config.RecipeId, data.GlobalId)).success;\n data.HashCode = getRecipeItemsHashCode(config.RecipeId, recipe.RecipeItems);\n _recipes[config.RecipeId].HashCode = data.HashCode;\n _def.resolve(returnResponse(config.RecipeId, 200, 0, data));\n };\n defaultConfiguration.onError = function (response) {\n _def.reject(returnResponse(config.RecipeId, 500, 1060, response));\n };\n\n config = $.extend({}, defaultConfiguration, config || {});\n\n if (!config.RecipeId) {\n _def.resolve(returnResponse(null, 500, 1061));\n return;\n }\n var recipe = _recipes[config.RecipeId];\n if (!recipe) {\n _def.resolve(returnResponse(config.RecipeId, 500, 1000));\n return;\n }\n\n var currentHashCode = getRecipeItemsHashCode(config.RecipeId);\n var savedHashCode = Vendd.RecipeLibrary.GetLocalStorageRecipeItemsHashCode(config.RecipeId);\n config.HtmlData.Body = \"\";\n\n if (!config.Force && localStorage.getItem(\"globalId_\" + config.RecipeId) !== null && currentHashCode === savedHashCode) {\n data.GlobalId = localStorage.getItem(\"globalId_\" + config.RecipeId);\n data.HashCode = currentHashCode;\n _recipes[config.RecipeId].HashCode = currentHashCode;\n _def.resolve(returnResponse(config.RecipeId, 200, 0, data));\n } else {\n var jsonData = (Vendd.RecipeLibrary.ConvertToSavedModel(config.RecipeId) || {}).data || {};\n var requestData = JSON.stringify({\n FriendlyName: config.FriendlyName,\n ConfigurationJson: JSON.stringify(jsonData),\n ProductItemId: config.RecipeId,\n ProductIdentifier: config.Vin,\n PartnerId: config.PartnerId !== \"\" ? config.PartnerId : null,\n Url: window.location.href,\n HtmlData: config.HtmlData,\n IsShare: !config.Force\n });\n $.ajax({\n type: \"POST\",\n dataType: 'json',\n contentType: 'application/json; charset=UTF-8',\n url: config.serviceurl,\n async: true,\n data: requestData,\n error: config.onError,\n success: config.onSuccess\n });\n }\n\n return _def.promise();\n };\n\n Vendd.RecipeLibrary.AssignConfigurationToUser = function (config) {\n\n var _def = $.Deferred();\n var data = {};\n\n var defaultConfiguration = {\n serviceurl: \"/services/api/Product/SaveRecipeConfiguration\"\n };\n\n defaultConfiguration.onSuccess = function (response) {\n if (!response.success) {\n config.onError(response);\n return;\n }\n _def.resolve(returnResponse(config.RecipeId, 200, 0, data));\n };\n defaultConfiguration.onError = function (response) {\n _def.reject(returnResponse(config.RecipeId, 500, 1060, response));\n };\n\n config = $.extend({}, defaultConfiguration, config || {});\n\n var requestData = JSON.stringify({\n GlobalId: config.GlobalId || \"\",\n FriendlyName: \"Update User\",\n ConfigurationJson: JSON.stringify({}),\n ProductItemId: config.RecipeItemId,\n Url: window.location.href,\n });\n $.ajax({\n type: \"POST\",\n dataType: 'json',\n contentType: 'application/json; charset=UTF-8',\n url: config.serviceurl,\n async: true,\n data: requestData,\n error: config.onError,\n success: config.onSuccess\n });\n\n return _def.promise();\n };\n\n Vendd.RecipeLibrary.LoadFromGlobalId = function (config) {\n var _def = $.Deferred();\n var data = {};\n\n var defaultConfiguration = {\n serviceurl: \"/services/api/Product/GetRecipeConfiguration\"\n };\n\n defaultConfiguration.onSuccess = function (response) {\n if (!response.success || !response.data || !response.data.GlobalId) {\n config.onError(data);\n return;\n }\n data = JSON.parse(response.data.ConfigurationJson || \"{}\");\n data.GlobalId = response.data.GlobalId;\n data.HtmlData = JSON.parse(response.data.Html || \"{}\");\n data.Pdf = response.data.Pdf || \"\";\n data.IsValid = true;\n data.Errors = [];\n data.GroupErrors = [];\n data.IngredientsErrors = [];\n data.IngredientsWarnings = [];\n\n recipe.RecipeItems = data.RecipeItems;\n var compareResult = Vendd.RecipeLibrary.CompareModels(config.RecipeId, data);\n var subrecipeCompareResults = _.map(data.SubRecipes || [], function (subrecipeData) {\n Vendd.RecipeLibrary.SetRecipeItems(subrecipeData.RecipeItemId, subrecipeData.RecipeItems);\n return Vendd.RecipeLibrary.CompareModels(subrecipeData.RecipeItemId, subrecipeData);\n });\n //console.log(\"compareResult:\", compareResult);\n if (!compareResult.success || subrecipeCompareResults.some(function (r) { return !r.success; })) {\n recipe.IsValid = false;\n recipe.IngredientsErrors = compareResult.data.IngredientsErrors;\n recipe.IngredientsWarnings = compareResult.data.IngredientsWarnings;\n recipe.Errors = compareResult.data.Errors;\n recipe.GroupErrors = compareResult.data.GroupErrors;\n //data.RecipeItems = recipe.RecipeItems;\n _def.resolve(returnResponse(config.RecipeId, 200, 1070, recipe));\n return;\n }\n\n recipe.GlobalId = data.GlobalId;\n recipe.Pdf = data.Pdf;\n recipe.IsValid = data.IsValid;\n recipe.Errors = data.Errors;\n recipe.IngredientsErrors = data.IngredientsErrors;\n recipe.IngredientsWarnings = data.IngredientsWarnings;\n\n _def.resolve(returnResponse(config.RecipeId, 200, 0, recipe));\n return;\n };\n defaultConfiguration.onError = function (data) {\n _def.reject(returnResponse(config.RecipeId, 500, 1070, data));\n return;\n };\n\n config = $.extend({}, defaultConfiguration, config || {});\n\n var recipe = _recipes[config.RecipeId];\n if (!recipe) {\n _def.resolve(returnResponse(config.RecipeId, 500, 1000));\n return;\n }\n\n if ((config.GlobalId || 0) === 0) {\n _def.resolve(returnResponse(config.RecipeId, 500, 1071));\n return;\n }\n\n var requestData = JSON.stringify({\n GlobalId: config.GlobalId\n });\n $.ajax({\n type: \"POST\",\n dataType: 'json',\n contentType: 'application/json; charset=UTF-8',\n url: config.serviceurl,\n async: true,\n data: requestData,\n error: config.onError,\n success: config.onSuccess\n });\n\n return _def.promise();\n };\n\n Vendd.RecipeLibrary.SaveGlobalIdToLocal = function (recipeId, globalId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n\n localStorage.setItem(\"globalId_\" + recipeId, globalId);\n\n return returnResponse(recipeId, 200, 0);\n };\n\n Vendd.RecipeLibrary.SaveRecipeItemsToLocal = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n var recipeItemsData = Vendd.RecipeLibrary.GetFullRecipeItems(recipeId);\n var recipeItems = recipeItemsData.RecipeItems;\n var currentHashCode = getRecipeItemsHashCode(recipeId, recipeItems);\n var savedHashCode = Vendd.RecipeLibrary.GetLocalStorageRecipeItemsHashCode(recipeId);\n if (currentHashCode === savedHashCode) {\n return returnResponse(recipeId, 200);\n }\n\n var dataLocalStorage = {\n RecipeItems: recipe.RecipeItems,\n HashCode: currentHashCode\n };\n\n localStorage.setItem(\"configurator_\" + recipeId, JSON.stringify(dataLocalStorage, null, 2));\n\n return returnResponse(recipeId, 200);\n };\n\n Vendd.RecipeLibrary.LoadFromLocalRecipeItems = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n if (localStorage.getItem(\"configurator_\" + recipeId) === null) {\n return returnResponse(recipeId, 500, 1050);\n }\n //var savedData = $.cookie(\"model_recipe_\" + recipeId) || [];\n var dataLocalStorage = JSON.parse(localStorage.getItem(\"configurator_\" + recipeId) || \"{}\");\n recipe.RecipeItems = dataLocalStorage.RecipeItems;\n recipe.HashCode = dataLocalStorage.HashCode;\n\n var data = {};\n data.Recipe = recipe;\n data.GlobalId = \"\";\n return returnResponse(recipeId, 200, 0, data);\n };\n\n var getRecipeItemsHashCode = function (recipeId, items) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return null;\n }\n var recipeItems = items || ((Vendd.RecipeLibrary.GetFullRecipeItems(recipeId) || {}).data || {}).RecipeItems;\n var hashCode = recipeId +\n (recipeItems.length > 0\n ? \"_\" + (_.map(_.sortBy(recipeItems, \"IngredientId\"), function (i) { return i.IngredientId + \"_\" + i.Quantity; }) || []).join(\"_\")\n : \"\");\n return hashCode;\n };\n\n Vendd.RecipeLibrary.GetLocalStorageRecipeItemsHashCode = function (recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return null;\n }\n if (localStorage.getItem(\"configurator_\" + recipeId) === null) {\n return null;\n }\n var dataLocalStorage = JSON.parse(localStorage.getItem(\"configurator_\" + recipeId) || \"{}\");\n return dataLocalStorage.HashCode;\n }\n\n Vendd.RecipeLibrary.ClearLocalStorage = function (recipeId) {\n var recipe = _recipes[recipeId];\n if (!recipe) {\n return false;\n }\n if (localStorage.getItem(\"configurator_\" + recipeId) !== null) {\n localStorage.removeItem(\"configurator_\" + recipeId);\n }\n if (localStorage.getItem(\"globalId_\" + recipeId) !== null) {\n localStorage.removeItem(\"globalId_\" + recipeId);\n }\n return true;\n }\n\n Vendd.RecipeLibrary.ConvertToSavedModel = function (recipeId) {\n var recipe = _recipes[recipeId];\n\n if (!recipe) {\n return returnResponse(recipeId, 500, 1000);\n }\n var data = {};\n data = converModelToSaveDataModel(recipe) || {};\n data.Groups = converGroupsToSaveDataModel(recipe.Groups) || [];\n data.Ingredients = converIngedientToSaveDataModel(recipe.Ingredients) || [];\n data.RecipeItems = Vendd.RecipeLibrary.GetRecipeItems(recipeId).data.RecipeItems || [];\n data.SubRecipes = _.map(\n _.filter(recipe.RecipeItems, function (r) { return r.SubRecipeId > 0 && _recipes[r.ProductItemId]; }) || [],\n function (ri) {\n return (Vendd.RecipeLibrary.ConvertToSavedModel(ri.ProductItemId) || {}).data || {};\n }) || [];\n return returnResponse(recipeId, 200, 0, data);\n };\n\n var converModelToSaveDataModel = function (m) {\n return {\n RecipeId: m.RecipeId,\n RecipeItemId: m.RecipeItemId,\n MinQuantity: m.MinQuantity,\n MaxQuantity: m.MaxQuantity,\n MaxFreeQuantity: m.MaxFreeQuantity,\n MaxReplaceQuantity: m.MaxReplaceQuantity,\n UnitPrice: m.UnitPrice\n };\n };\n\n var converGroupsToSaveDataModel = function (groups) {\n var model = _.map(groups, function (g) {\n return {\n Id: g.Id,\n MinQuantity: g.MinQuantity,\n MaxQuantity: g.MaxQuantity,\n };\n });\n return model;\n };\n\n var converIngedientToSaveDataModel = function (ingredients) {\n var model = _.map(ingredients, function (i) {\n return {\n IngredientId: i.IngredientId,\n Name: i.Name,\n GroupId: i.GroupId,\n Price: i.Price,\n Incompatibles: i.Incompatibles || [],\n Prerequisites: i.Prerequisites || [],\n };\n });\n return model;\n };\n\n function checkRestrictions(recipe) {\n return true;\n };\n\n function FixJSFloatBug(price) {\n return parseFloat((price || 0).toFixed(2));\n }\n\n Vendd.RecipeLibrary.Tests = {\n 0: function () {\n var _rec = 2;\n console.log(Vendd.RecipeLibrary.InitRecipe(null, _rec));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, _rec, 88694, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, _rec, 88691, 1));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, _rec, 88691, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, _rec, 88691, 2, true));\n console.log(Vendd.RecipeLibrary.RemoveIngredient(null, _rec, 88694));\n console.log(Vendd.RecipeLibrary.DeclareState(null, _rec));\n return \"success\";\n },\n 1: function () {\n console.log(Vendd.RecipeLibrary.InitRecipe(null, 1));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88691, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 1));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 2, true));\n console.log(Vendd.RecipeLibrary.RemoveIngredient(null, 1, 88691));\n console.log(Vendd.RecipeLibrary.DeclareState(null, 1));\n return \"success\";\n },\n 2: function () {\n console.log(Vendd.RecipeLibrary.InitRecipe(null, 1));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 1));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88691, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 2));\n console.log(Vendd.RecipeLibrary.AddIngredient(null, 1, 88694, 2, true));\n console.log(Vendd.RecipeLibrary.RemoveIngredient(null, 1, 88691));\n console.log(Vendd.RecipeLibrary.DeclareState(null, 1));\n return \"success\";\n }\n };\n return Vendd;\n\n})(Vendd || {});\n\nvar testModel = {};\n","var recaptchaLoaded = false;\nvar recaptchaMessagePublished = false;\nvar callback_recaptcha = function () {\n recaptchaLoaded = true;\n checkAsyncLoad();\n};\n\nvar googleMapsLoaded = false;\nvar googleMapsMessagePublished = false;\nvar callback_googlemaps = function () {\n googleMapsLoaded = true;\n checkAsyncLoad();\n};\n\nvar venddLoaded = false;\nvar callback_vendd = function () {\n venddLoaded = true;\n checkAsyncLoad();\n};\n\nvar checkAsyncLoad = function () {\n if (!venddLoaded) \n return;\n\n if (recaptchaLoaded && !recaptchaMessagePublished) {\n Vendd.MessageBus.publishAsync('checkAsyncLoad', new Vendd.Plugins.Messages.RecaptcaLoaded());\n recaptchaMessagePublished = true;\n }\n \n if (googleMapsLoaded && !googleMapsMessagePublished) {\n Vendd.MessageBus.publishAsync('checkAsyncLoad', new Vendd.Plugins.Messages.GoogleMapsLoaded());\n googleMapsMessagePublished = true;\n }\n\n};\n\nfunction checkout_callback_googlemaps() {\n\n angular.element(\".x-checkoutstore\").ready(function () {\n if ($('.x-checkoutstore').scope() && $('.x-checkoutstore').scope().Control && typeof ($('.x-checkoutstore').scope().Control.SetMap) === 'function') {\n $('.x-checkoutstore').scope().Control.SetMap(true);\n }\n }); \n\n}","$(document).ready(function () {\n\n if (Vendd && Vendd.Scripts && (typeof Vendd.Scripts.init === 'function')) {\n\n Vendd.Scripts.init();\n\n if (LhApp && LhApp.init && (typeof LhApp.init === 'function'))\n LhApp.init();\n } \n});"]}