var Resources,__extends,Langtons;(function(n){var t;(function(t){var r,i;(function(n){n.AuctionCataloguePdfUrl="/auctionsalecatalogues/{id}/pdfs/false";n.BalanceMilestone=1e5;n.BaseUrl="/api";n.BatchingEnabled=!1;n.CacheEnabled=!0;n.DatePickerDateFormat="dd/MM/yyyy HH:mm PP";n.DatePickerDateOnlyFormat="dd/MM/yyyy";n.DefaultListSize=20;n.MaximumQuantity=60;n.MinimumSpend=100;n.MomentDateFormat="DD/MM/YYYY hh:mm A";n.MultiStepKeyName="MultiStepKey";n.MultiStepSessionKeyName="MultiStepSession";n.ProductDescriptionMaxWords=20;n.RecommendedProductsTermKeyword="RecommendedProducts";n.RemberLoginDetailsKeyName="LP25C";n.ServerDateFormat="YYYY-MM-DDTHH:mm:ss";n.ServerDateRegex=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/g;n.SessionDebugEnabled=!0;n.SessionEndPoint=n.BaseUrl+"/sessions";n.SessionExpiryNotification=2;n.SessionExpiryTime=30;n.SessionKeyName="P25 Website Session";n.SliAuth="bGFuZ3RvbnM6c2FyaXRhaXQ=";n.SliUrl="https://langtons.resultspage.com/search?w={query}&ts=json-full&cnt=300";n.NO_CC_SET="NoCreditCard";n.NO_CC_SET_DLG_TITLE="No Credit Card set";n.NO_CC_SET_DLG_BODY='You do not have a valid Credit Card on record.<br/>Please <a href="/my-account/credit-cards" target="_self">update your credit card details<\/a> to bid on an item.';n.NO_BILLING_ADDR_SET="NoBillingAddress";n.NO_BILLING_ADDR_SET_DLG_TITLE="No Billing Address set";n.NO_BILLING_ADDR_SET_DLG_BODY='You do not have a billing address on record.<br/>Please <a href="/my-account/billing-address" target="_self">add a billing address<\/a> to bid on an item.';n.NO_DELIVERY_ADDR_SET="NoDeliveryAddress";n.NO_DELIVERY_ADDR_SET_DLG_TITLE="No Delivery Address set";n.NO_DELIVERY_ADDR_SET_DLG_BODY='You do not have a default delivery address on record.<br/>Please <a href="/myaccount/deliveryaddress" target="_self">add a delivery address<\/a> to bid on an item.';n.ACCOUNT_FROZEN="Account is frozen";n.ACCOUNT_FROZEN_DLG_TITLE="Your account has been frozen";n.ACCOUNT_FROZEN_DLG_BODY="Your account has been frozen. ";n.BID_ON_VENDOR_OWN_PROD="Vendor cannot bid on own product";n.BID_ON_VENDOR_OWN_PROD_DLG_TITLE="Vendor cannot bid on own product";n.BID_ON_VENDOR_OWN_PROD_DLG_BODY="Vendor cannot bid on own product.";n.NON_INTERNET_BID="Members cannot place non-internet bids.";n.NON_INTERNET_BID_DLG_TITLE="Members cannot place non-internet bids";n.NON_INTERNET_BID_DLG_BODY="Members cannot place non-internet bids.";n.DEFAULT_BID_ERROR_DLG_TITLE="Could not place bid";n.DEFAULT_BID_ERROR_DLG_BODY="An error has occured please try again later"})(r=t.Configuration||(t.Configuration={}));i=function(){function i(){}return i.getHashCode=function(n){var t=0,i,r;if(n.length==0)return t;for(i=0;i<n.length;i++)r=n.charCodeAt(i),t=(t<<5)-t+r|0;return t},i.toArray=function(n){return n=ko.utils.unwrapObservable(n),$.map(n,function(n){return n})},i.capitaliseFirstLetter=function(n){return n.charAt(0).toUpperCase()+n.slice(1)},i.isNullOrEmpty=function(n){return n==null||n==""},i.isFunction=function(n){return typeof n=="function"},i.isArray=function(n){return Array.isArray?Array.isArray(n):toString.call(n)=="[object Array]"},i.generateDeviceToken=function(){var t="",i;if(t+=navigator.appName||"",t+=navigator.appCodeName||"",t+=navigator.appVersion||"",t+=navigator.appMinorVersion||"",t+=navigator.vendor||"",t+=navigator.browserLanguage||"",t+=navigator.systemLanguage||"",t+=navigator.userLanguage||"",t+=navigator.cpuClass||"",navigator.mimeTypes)for(i=0;i<navigator.mimeTypes.length;i++)t+=navigator.mimeTypes[i].description||i;return t+=navigator.msManipulationViewsEnabled||"",t+=navigator.platform||"",n.Global.Utils.getHashCode(t).toString()},i.HashCode=function(n){var t=0,i,r,u;if(n.length==0)return t;for(i=0,u=n.length;i<u;i++)r=n.charCodeAt(i),t=(t<<5)-t+r|0;return t},i.GenerateGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=Math.random()*16|0,i=n=="x"?t:t&3|8;return i.toString(16)})},i.LimitWordCount=function(n,t){if(n==null)return n;var i=n.split(" ");return i.length>t?i.slice(0,t).join(" ")+"...":n},i.SetContainsSum=function(n,t){for(var e,r,f=n.length,u=[[],[]],o=[],i=0;i<=f;i++)u[0][i]=!0;for(e=_.reduce(n,function(n,t){return n+t},0),i=1;i<=e;i++)for(u[i]=[!1],o[i]=!1,r=1;r<=f;r++)u[i][r]=u[i][r-1],i>=n[r-1]&&(u[i][r]=u[i][r]||u[i-n[r-1]][r-1]),u[i][r]===!0&&(o[i]=!0);return t>e?!1:u[t][f]},i.GetSubsetSums=function(n,t){for(var r,e=n.length,u=[[],[]],f=[],o=[],i=0;i<=e;i++)u[0][i]=!0;for(t=Math.min(_.reduce(n,function(n,t){return n+t},0),t),i=1;i<=t;i++)for(u[i]=[!1],f[i]=!1,r=1;r<=e;r++)u[i][r]=u[i][r-1],i>=n[r-1]&&(u[i][r]=u[i][r]||u[i-n[r-1]][r-1]),u[i][r]===!0&&f[i]===!1&&(f[i]=!0,o.push(i));return o},i.GetSubsetMultipleSums=function(n,i){for(var r,o=n.length,e,u,f=0;f<o;f++)for(e=n[f],r=2;r<i;r++){if(u=e*r,u>i)break;n.push(u)}return t.Utils.GetSubsetSums(n,i)},i.getDialogContentFromBidErrors=function(t){var r="",i="",u;if(t!=null&&t.length>0)for(u=0;u<t.length;u++)switch(t[u]){case n.Global.Configuration.NO_CC_SET:r+=(i.length==0?"":", ")+n.Global.Configuration.NO_CC_SET_DLG_TITLE;i+=(i.length==0?"":"<\/br><\/br>")+n.Global.Configuration.NO_CC_SET_DLG_BODY;break;case n.Global.Configuration.NO_BILLING_ADDR_SET:r+=(i.length==0?"":", ")+n.Global.Configuration.NO_BILLING_ADDR_SET_DLG_TITLE;i+=(i.length==0?"":"<\/br><\/br>")+n.Global.Configuration.NO_BILLING_ADDR_SET_DLG_BODY;break;case n.Global.Configuration.NO_DELIVERY_ADDR_SET:r+=(i.length==0?"":", ")+n.Global.Configuration.NO_DELIVERY_ADDR_SET_DLG_TITLE;i+=(i.length==0?"":"<\/br><\/br>")+n.Global.Configuration.NO_DELIVERY_ADDR_SET_DLG_BODY;break;case n.Global.Configuration.ACCOUNT_FROZEN:r+=(i.length==0?"":", ")+n.Global.Configuration.ACCOUNT_FROZEN_DLG_TITLE;i+=(i.length==0?"":"<\/br><\/br>")+n.Global.Configuration.ACCOUNT_FROZEN_DLG_BODY;break;case n.Global.Configuration.BID_ON_VENDOR_OWN_PROD:r+=(i.length==0?"":", ")+n.Global.Configuration.BID_ON_VENDOR_OWN_PROD_DLG_TITLE;i+=(i.length==0?"":"<\/br><\/br>")+n.Global.Configuration.BID_ON_VENDOR_OWN_PROD_DLG_BODY;break;case n.Global.Configuration.NON_INTERNET_BID:r+=(i.length==0?"":", ")+n.Global.Configuration.NON_INTERNET_BID_DLG_TITLE;i+=(i.length==0?"":"<\/br><\/br>")+n.Global.Configuration.NON_INTERNET_BID_DLG_BODY;break;default:r+=(i.length==0?"":", ")+n.Global.Configuration.DEFAULT_BID_ERROR_DLG_TITLE;i+=(i.length==0?"":"<\/br><\/br>")+n.Global.Configuration.DEFAULT_BID_ERROR_DLG_BODY}return{dlgTitle:r,dlgBody:i}},i}();t.Utils=i})(t=n.Global||(n.Global={}))})(Langtons||(Langtons={})),function(n){var t=function(){function t(){}return t.AddCacheRules=function(){var i=60,t=3600,r,u;n.Api.Cache.AddRule(n.Api.Resources.Term,n.Api.CacheType.ALL,null,2*t);r=new n.Api.Context(null,null,[new n.Api.QueryParameter("filter",n.Global.Configuration.RecommendedProductsTermKeyword)]);n.Api.Cache.AddRule(n.Api.Resources.Term,n.Api.CacheType.ALL,r,15);n.Api.Cache.AddRule(n.Api.Resources.Winery,n.Api.CacheType.ALL,null,24*t);n.Api.Cache.AddRule(n.Api.Resources.BottleSize,n.Api.CacheType.ALL,null,72*t);n.Api.Cache.AddRule(n.Api.Resources.Classification,n.Api.CacheType.ALL,null,72*t);n.Api.Cache.AddRule(n.Api.Resources.Product,n.Api.CacheType.SINGLE,null,24*t);n.Api.Cache.AddRule(n.Api.Resources.ProductCategory,n.Api.CacheType.ALL,null,24*t);n.Api.Cache.AddRule(n.Api.Resources.ProductType,n.Api.CacheType.ALL,null,24*t);n.Api.Cache.AddRule(n.Api.Resources.ProductVariety,n.Api.CacheType.ALL,null,24*t);n.Api.Cache.AddRule(n.Api.Resources.Country,n.Api.CacheType.ALL,null,48*t);n.Api.Cache.AddRule(n.Api.Resources.Region,n.Api.CacheType.ALL,null,48*t);n.Api.Cache.AddRule(n.Api.Resources.State,n.Api.CacheType.ALL,null,48*t);u=new n.Api.Context([new n.Api.TextRouteSegment("bidlist")],"auctions");n.Api.Cache.AddRule(n.Api.Resources.Auction,n.Api.CacheType.ALL,u,15);n.Api.Cache.AddRule(n.Api.Resources.Auction,n.Api.CacheType.SINGLE,null,15*i);n.Api.Cache.AddRule(n.Api.Resources.PriceGuide,n.Api.CacheType.ALL,null,30*i);n.Api.Cache.AddRule(n.Api.Resources.BasketPricePoint,n.Api.CacheType.ALL,null,1*t);n.Api.Cache.AddRule(n.Api.Resources.WineryReview,n.Api.CacheType.ALL,null,48*t);n.Api.Cache.AddRule(n.Api.Resources.TastingNote,n.Api.CacheType.ALL,null,48*t)},t.SetupEventNotifications=function(){n.Api.Events.Subscribe(n.Api.EventType.SESSION_WILL_EXPIRE,function(){window.alert("Your Langton's session is about to expire.");n.Api.Session.ExtendExpiry()});n.Api.Events.Subscribe(n.Api.EventType.SESSION_EXPIRED,function(){})},t.Init=function(){var u,i,r;if(n.Api.Session.Init(),n.Api.Cache.Init(),n.Global.Configuration.CacheEnabled||n.Api.Cache.Disable(),t.AddCacheRules(),n.Api.Bidding.Init(),t.SetupEventNotifications(),u=n.Api.Storage.Get(n.Global.Configuration.MultiStepKeyName),!_.isEmpty(u)&&u!=window.location.pathname&&(n.Api.Storage.DeleteByKey(n.Global.Configuration.MultiStepKeyName),History.replaceState(null,null,""),i=_.keys(n.Api.Storage.Get(n.Global.Configuration.MultiStepSessionKeyName,{},n.Api.StorageType.Session)),i.length>0)){for(r=0;r<i.length;r++)n.Api.Storage.DeleteByKey(i[r],n.Api.StorageType.Session);n.Api.Storage.DeleteByKey(n.Global.Configuration.MultiStepSessionKeyName,n.Api.StorageType.Session)}},t}();n.Startup=t}(Langtons||(Langtons={})),function(n){var t;(function(n){var t;(function(n){n.Shipping=15;n.Insurance=16})(t=n.CartItemType||(n.CartItemType={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={})),function(n){var t;(function(n){(function(n){n[n.Session=0]="Session";n[n.Local=1]="Local"})(n.StorageType||(n.StorageType={}));var t=n.StorageType,i=function(){function n(){}return n.Set=function(n,i,r,u){u===void 0&&(u=t.Local);var f={};r==null||isNaN(r)||(f.expires=r*1e3);u==t.Session?amplify.store(n,i,f):amplify.store(n,i,f)},n.Get=function(n,i,r){return r===void 0&&(r=t.Local),r==t.Session?amplify.store(n)||i:amplify.store(n)||i},n.GetAll=function(n){return n===void 0&&(n=t.Local),n==t.Session?amplify.store():amplify.store()},n.DeleteByKey=function(n,i){i===void 0&&(i=t.Local);i==t.Session?amplify.store(n,null):amplify.store(n,null)},n}();n.Storage=i})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={})),function(n){var t;(function(t){var i=function(){function i(){}return i.prototype.DisplayName=function(){return i.Current()?i.Current().DisplayName:null},i.prototype.SessionToken=function(){return i.Current()?i.Current().SessionToken:null},i.prototype.ContactId=function(){return i.Current()?i.Current().ContactId:null},i.prototype.MemberType=function(){return i.Current()?i.Current().MemberType:null},i.Init=function(){},i.Current=function(){if(i.CurrentSession==null){var r=amplify.store(n.Global.Configuration.SessionKeyName);r!=null&&(i.CurrentSession=new t.Resources.Session(r))}return i.CurrentSession},i.ImpersonatedName=function(){return this.Current().Name.split("->")[1]},i.Save=function(t){i.CurrentSession!==t&&(i.CurrentSession=t,amplify.store(n.Global.Configuration.SessionKeyName,t,{expires:72e5}),i.ResetTimer(i.MillisecondsToExpiryWarning()),i.CurrentSession==null&&t!=null&&n.Api.Events.Trigger(n.Api.EventType.SESSION_CREATED),n.Api.Events.Trigger(n.Api.EventType.SESSION_CHANGE))},i.Clear=function(t){(t===void 0&&(t=!1),i.CurrentSession!=null)&&(i.CurrentSession=null,amplify.store(n.Global.Configuration.SessionKeyName,null),t||(n.Api.Events.Trigger(n.Api.EventType.SESSION_REMOVED),n.Api.Events.Trigger(n.Api.EventType.SESSION_CHANGE)))},i.ExtendExpiry=function(){i.Current()&&(i.Log("Session::ExtendExpiry() - Making request."),i.Current().Save(function(n){i.Current().ExpiryDate=n.ExpiryDate;i.ResetTimer(i.MillisecondsToExpiryWarning());i.Log("Session::ExtendExpiry() - Updated session.")},function(){i.Log("Session::ExtendExpiry() - Denied. Expiring session.");i.Expire()}))},i.Expire=function(){i.Current()&&(i.Log("Session::Expire() - Session expired, clearing."),i.Clear(),n.Api.Events.Trigger(t.EventType.SESSION_EXPIRED))},i.DurationTilExpire=function(n,t){return moment.duration(moment(n).diff(t))},i.RefreshExpiry=function(){var t=this;(i.Log("Session::RefreshExpiry() called"),i.Current()!=null)&&i.ApiFacade.RefreshExpiry(JSON.stringify(i.Current()),function(r){var u;if(i.Current()!=null)if(u=r,r.ExpiryDate=moment().add("minutes",n.Global.Configuration.SessionExpiryTime).toDate(),u!=null){i.Log("Session::RefreshExpiry() - Updating session expiry from "+moment(i.Current().ExpiryDate).format("DD/MM/YYYY hh:mm")+" to "+moment(u.ExpiryDate).format("DD/MM/YYYY hh:mm"));i.Current().ExpiryDate=u.ExpiryDate;var o=t.DurationTilExpire(n.Api.Session.Current().ExpiryDate,moment()),f=o.asMinutes(),e=n.Global.Configuration.SessionExpiryNotification;f<0?(i.Log("Session::RefreshExpiry() - Session has expired."),i.Clear()):f<e?(i.Log("Session::RefreshExpiry() - Session expiry imminent."),n.Api.Events.Trigger(n.Api.EventType.SESSION_WILL_EXPIRE,e),i.ResetTimer(i.MillisecondsToExpiry())):(i.Log("Session::RefreshExpiry() - Session expiry extended."),i.ResetTimer(i.MillisecondsToExpiryWarning()))}else i.Clear()},function(){i.Log("Session::RefreshExpiry() - Session not found, clearing.");i.Clear()})},i.StopTimer=function(){i.ExpiryTimer!=null&&window.clearTimeout(i.ExpiryTimer)},i.ResetTimer=function(n){i.Log("Session::ResetTimer("+moment.duration(n).asMinutes().toFixed(2)+" min)");i.StopTimer();i.ExpiryTimer=window.setTimeout(_.bind(i.RefreshExpiry,i),n)},i.MillisecondsToExpiry=function(){var t=this.DurationTilExpire(n.Api.Session.Current().ExpiryDate,moment());return t.asMilliseconds()},i.MillisecondsToExpiryWarning=function(){var t=moment.duration(moment(n.Api.Session.Current().ExpiryDate).add("minutes",-1*n.Global.Configuration.SessionExpiryNotification).diff(moment()));return t.asMilliseconds()},i.Log=function(){},i.ExpiryTimer=-1,i.EnableDebug=n.Global.Configuration.SessionDebugEnabled,i.ApiFacade=new n.Utilities.ApiFacade,i}();t.Session=i})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));amplify.subscribe("ampLogoutEvent",function(){Langtons.Api.Session.Clear();window.location.pathname!="/"&&window.location.assign("/")}),function(n){var t;(function(n){var t,i,r,u;(function(n){n[n.SINGLE=0]="SINGLE";n[n.RANGE=1]="RANGE";n[n.ALL=2]="ALL"})(n.CacheType||(n.CacheType={}));t=n.CacheType;i=function(){function n(n,t,i,r,u){this.resourceType=n;this.cacheType=t;this.context=i;this.ttl=r;this.Hash=u||function(n,t,i){var r=n.TypeName;return t!=null&&(r+=":"+t),i!=null&&(r+=i.toString()+i.GetQueryString()),r};this.IsMatch=function(n,t,i,r){var u=t.TypeName;return i!=null&&(u+=":"+i),r!=null&&(u+=r.toString()+r.GetQueryString()),n.indexOf(u)===0}}return n}();n.CacheRule=i;r=function(){function n(){this.hits=0;this.misses=0;this.addedItems=0;this.addedRanges=0}return n}();u=function(){function u(){}return u.GetCacheRuleIndex=function(n,t){return(t!=null?t.toString()+t.GetQueryString():"")+n.TypeName},u.ItemExists=function(n){return u.s_cacheItemIndexes[n]!=null},u.AddCacheIndex=function(n){u.ItemExists(n)||(u.s_cacheItemIndexes.push(n),u.SaveCacheIndexes())},u.LoadCacheIndexes=function(){u.s_cacheItemIndexes=n.Storage.Get(u.s_cacheIndexesKey,[])},u.SaveCacheIndexes=function(){n.Storage.Set(u.s_cacheIndexesKey,u.s_cacheItemIndexes)},u.FindRule=function(n,t){var i=u.s_cacheRules[u.GetCacheRuleIndex(n,t)];return i==null&&(i=u.s_cacheRules[u.GetCacheRuleIndex(n)]),i},u.FindItem=function(t,i,r){var e=u.FindRule(t,r),f;return e==null?null:(f=n.Storage.Get(e.Hash(t,i,r)),u.s_statsEnabled&&(f!=null?u.s_cacheStats.hits++:u.s_cacheStats.misses++),f!=null&&u.s_loggingEnabled&&console.log("Cache hit: "+e.Hash(t,i,r)),f)},u.FlushAllOfType=function(t,i){for(var r=u.s_cacheItemIndexes.length,f=0;r--;)t.IsMatch(u.s_cacheItemIndexes[r],i)&&(n.Storage.DeleteByKey(u.s_cacheItemIndexes[r]),u.s_cacheItemIndexes.splice(r,1),f++);return f},u.FlushIdsOfType=function(t,i,r){for(var f=u.s_cacheItemIndexes.length,o=0,e;f--;)for(e=0;e<r.length;e++)t.IsMatch(u.s_cacheItemIndexes[f],i,r[e])&&(n.Storage.DeleteByKey(u.s_cacheItemIndexes[f]),u.s_cacheItemIndexes.splice(f,1),o++);return o},u.Init=function(){u.Enable();u.LoadCacheIndexes();u.s_cacheStats=new r},u.Enable=function(){u.s_enabled=!0},u.Disable=function(){u.s_enabled=!1},u.AddRule=function(n,t,r,f,e){u.s_cacheRules[u.GetCacheRuleIndex(n,r)]=new i(n,t,r,f,e)},u.InsertRange=function(i,r,f){var e,o;r==null||r.to===0||r.HasMore()||(e=u.FindRule(i,f),e!=null&&e.cacheType==t.ALL?(o=e.Hash(i,"[range]",f),u.AddCacheIndex(o),n.Storage.Set(o,r,e.ttl),u.s_statsEnabled&&u.s_cacheStats.addedRanges++,u.s_loggingEnabled&&console.log("Cache: Added "+e.Hash(i,"[range]",f))):u.s_loggingEnabled&&console.log("Cache: No rule for "+i.TypeName))},u.InsertItem=function(i,r,f){var e,o;r!=null&&(e=u.FindRule(i,f),e!=null&&(e.cacheType==t.SINGLE||e.cacheType==t.ALL)?(o=e.Hash(i,r.Id,f),u.AddCacheIndex(o),n.Storage.Set(o,r,e.ttl),u.s_statsEnabled&&u.s_cacheStats.addedItems++,u.s_loggingEnabled&&console.log("Cache: Added "+e.Hash(i,r.Id,f))):u.s_loggingEnabled&&console.log("Cache: No rule for "+i.TypeName))},u.GetRange=function(t,i,r,f,e){if(u.s_enabled===!1)return null;var o=u.FindItem(t,"[range]",e);return o==null?null:(u.s_statsEnabled&&u.s_cacheStats.hits++,new n.Collections.Collection(o.type,o.context,o.items,o.from,o.to,o.total))},u.GetItem=function(n,t,i){return u.s_enabled===!1?null:u.FindItem(n,t,i)},u.FlushAll=function(){u.LoadCacheIndexes();for(var t=0;t<u.s_cacheItemIndexes.length;t++)n.Storage.DeleteByKey(u.s_cacheItemIndexes[t]);console.log("Cache::FlushAll(): Flushed "+u.s_cacheItemIndexes.length+" items from cache");u.s_cacheItemIndexes=[]},u.Flush=function(n,t){var i,r;if(n==null)throw"Cache::Flush(): Parameter 'resourceType' must be specified";if(u.LoadCacheIndexes(),i=u.FindRule(n),i==null){console.warn("Cache::Flush(): No rule found for resource type: "+n.TypeName);return}r=_.isArray(t)?u.FlushIdsOfType(i,n,t):u.FlushAllOfType(i,n);u.SaveCacheIndexes();console.log("Cache::Flush(): Flushed "+r+" items from cache")},u.Stats=function(){var n="Indexes: \t"+u.s_cacheItemIndexes.length;return u.s_statsEnabled&&(n+="\n-- This page --\nHits: \t\t"+u.s_cacheStats.hits+"\nMisses: \t\t"+u.s_cacheStats.misses+"\nAdded ranges: \t"+u.s_cacheStats.addedRanges+"\nAdded items: \t"+u.s_cacheStats.addedItems),n},u.s_cacheIndexesKey="[CacheItems]",u.s_cacheRules={},u.s_cacheItemIndexes=[],u.s_enabled=!1,u.s_loggingEnabled=!1,u.s_statsEnabled=!0,u}();n.Cache=u})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={})),function(n){var t;(function(n){(function(n){n[n.SESSION_CHANGE=0]="SESSION_CHANGE";n[n.SESSION_CREATED=1]="SESSION_CREATED";n[n.SESSION_REMOVED=2]="SESSION_REMOVED";n[n.SESSION_WILL_EXPIRE=3]="SESSION_WILL_EXPIRE";n[n.SESSION_EXPIRED=4]="SESSION_EXPIRED";n[n.MODAL_PROMPT=5]="MODAL_PROMPT";n[n.ADDED_TO_CART=6]="ADDED_TO_CART";n[n.CART_REFRESHED=7]="CART_REFRESHED"})(n.EventType||(n.EventType={}));var i=n.EventType,t=function(){function n(){}return n.GetEventString=function(t){return n.s_EventPrefix+t.toString()},n.Subscribe=function(t,i,r){if(i==null||!_.isFunction(i))throw"'callback' parameter function must be specified.";r?amplify.subscribe(n.GetEventString(t),r,i):amplify.subscribe(n.GetEventString(t),null,i)},n.Unsubscribe=function(t,i){amplify.unsubscribe(n.GetEventString(t),i)},n.Trigger=function(t){for(var r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];return r.length>0?amplify.publish.apply(amplify,[n.GetEventString(t)].concat(r)):amplify.publish(n.GetEventString(t))},n.s_EventPrefix="langtons_event_",n}();n.Events=t})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={})),function(n){var t;(function(t){var i=function(){function n(n,t,i,r,u){this.AuctionId=n;this.LotNo=t;this.Done=i;this.Fail=r;this.CallbackContext=u}return n}(),r=function(){function r(){}return r.RemoveDuplicateRequests=function(){r.s_requestQueue=_.unique(r.s_requestQueue,function(n){return n.AuctionId+","+n.LotNo})},r.ServiceRequest=function(i){var r=new t.Context([new n.Api.TextRouteSegment("auctions",i.AuctionId),new n.Api.TextRouteSegment("lots",i.LotNo),new n.Api.TextRouteSegment("bids")],"status");n.Api.Resources.Resource.Get(n.Api.Resources.BidStatus,null,r,function(n){typeof i.Done=="function"&&i.Done(n)},i.Fail)},r.SendRequests=function(){if(r.StopTimer(),r.s_requestQueue!=null&&r.s_requestQueue.length!=0){r.RemoveDuplicateRequests();var i=new t.Context([new n.Api.TextRouteSegment("bids")],"status"),u=function(n){for(var i=r.s_requestQueue.length,t;i--;)t=r.s_requestQueue[i],t.AuctionId==n.AuctionId.toString()&&t.LotNo==n.LotNo.toString()&&(n.Success===!0?typeof t.Done=="function"&&t.Done(n.Status):typeof t.Fail=="function"&&t.Fail(null,null,null),r.s_requestQueue.splice(i,1))};$.ajax({url:n.Api.Client.BuildUrl(n.Api.Resources.BidStatus,null,i),type:"POST",dataType:"json",contentType:"application/json",data:JSON.stringify(r.s_requestQueue),success:function(n){if(!_.isArray(n)){console.error("Bidding: Result is not an array");return}for(var t=0;t<n.length;t++)u(n[t])},error:function(){}})}},r.StopTimer=function(){r.s_purgeTimer!=null&&window.clearTimeout(r.s_purgeTimer)},r.ResetTimer=function(n){n===void 0&&(n=r.s_purgeTimeout);r.StopTimer();r.s_purgeTimer=window.setTimeout(_.bind(r.SendRequests,r),n*1e3)},r.Init=function(){n.Api.Events.Subscribe(n.Api.EventType.SESSION_CHANGE,function(){r.ResetTimer(.5)})},r.GetStatus=function(n,t,u,f,e){r.s_requestQueue.push(new i(n,t,u,f,e));r.ResetTimer()},r.Trigger=function(){r.StopTimer();r.SendRequests()},r.s_purgeTimeout=2,r.s_requestQueue=[],r}();t.Bidding=r})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={})),function(n){var t;(function(t){var i=function(){function n(n,t,i,r,u,f){this.method=n;this.url=t;this.data=i;this.headers=r||{};this.done=u;this.fail=f}return n.prototype.setRequestHeader=function(n,t){this.headers[n]=t},n}(),r=function(){function t(){}return t.Init=function(){},t.AddRequest=function(n,r,u,f,e,o){var s=new i(n,r.replace("//","/"),u,f,e,o);t.AddRequestHeaders(s);t.s_PendingRequests.push(s);t.ResetTimer(t.s_PendingTimeout)},t.SendRequests=function(){var u;if(t.StopTimer(),t.s_PendingRequests.length!=0){var f="",r=t.s_PendingRequests.splice(0),i=n.Global.Utils.GenerateGuid();for(u=0;u<r.length;u++)f+=t.CreateRequestBlock(r[u],i);f+="--"+i+"--\r\n";$.ajax("/api/$batch",{type:"POST",contentType:'multipart/mixed; boundary="'+i+'"',data:f,success:function(n){var u,f;for(i=new RegExp("^--([a-f0-9-]*)").exec(n)[1],u=_.filter(n.split("--"+i+"\r\nContent-Type: application/http; msgtype=response\r\n\r\n"),function(n){return!_.isEmpty(n)}),u.length>0&&(u[u.length-1]=u[u.length-1].split("--"+i+"--")[0]),f=0;f<u.length;f++)t.ProcessResponse(u[f],i,r[f])},error:function(n,t,i){for(var u=0;u<r.length;u++)_.isFunction(r[u].fail)&&r[u].fail(n,t,i)}})}},t.CreateRequestBlock=function(n,t){var i="",r;i+="--"+t+"\r\n";i+="Content-Type: application/http; msgtype=request\r\n\r\n";i+=n.method+" "+n.url+" HTTP/1.1\r\n";i+="Host: "+window.location.host+"\r\n";for(r in n.headers)i+=r+": "+n.headers[r]+"\r\n";return i+"\r\n\r\n"},t.AddRequestHeaders=function(n){n.headers.Accept==null&&(n.headers.Accept=t.s_AcceptHeader);n.headers["Accept-Encoding"]==null&&(n.headers["Accept-Encoding"]=t.s_AcceptEncodingHeader);n.headers["Accept-Language"]==null&&(n.headers["Accept-Language"]=t.s_AcceptLanguageHeader);n.headers["User-Agent"]=navigator.userAgent;_.isFunction($.ajaxSetup(null).beforeSend)&&$.ajaxSetup(null).beforeSend(n)},t.StopTimer=function(){t.s_PendingTimer!=null&&window.clearTimeout(t.s_PendingTimer)},t.ResetTimer=function(n){t.StopTimer();t.s_PendingTimer=window.setTimeout(_.bind(t.SendRequests,t),n)},t.ProcessResponse=function(n,i,r){var u=t.s_RequestBlockRegex.exec(n),f=parseInt(u[1]),e=u[2],c=t.ParseHeaders(u[3]),o=u[4],s=t.CreateJqXHR(c,u[3],f,e),h;if(!_.isEmpty(o))try{h=$.ajaxSetup(null).converters["text json"]||JSON.parse;f>=200&&f<300||f===304?r.done(h(o),e,s):r.fail(s,e,"")}catch(l){console.log("Response processing error: "+l.message)}},t.ParseHeaders=function(n){for(var r,i=n.split("\r\n"),u={},t=0;t<i.length-1;t++){if(_.isEmpty(i[t]))break;r=i[t].split(":");u[r[0]]=r[1]}return u},t.CreateJqXHR=function(n,t,i){var r={};return r.getResponseHeader=function(t){return n[t]},r.getAllResponseHeaders=function(){return t},r.status=i,r},t.s_PendingRequests=[],t.s_PendingTimeout=500,t.s_RequestBlockRegex=/[A-Z0-9.\/]+ (\d+) ([\w ]+)\r\n((?:.|\r\n)+)\r\n\r\n(.*)/m,t.s_AcceptHeader="application/json, text/javascript, */*; q=0.01",t.s_AcceptEncodingHeader="deflate,sdch",t.s_AcceptLanguageHeader="en-GB,en-US;q=0.8,en;q=0.6",t}();t.RequestBatcher=r})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));$.ajaxSetup({beforeSend:function(n){var t=Langtons.Api.Session.Current();t&&(n.setRequestHeader("auth-scheme","token"),n.setRequestHeader("auth-param",t.SessionToken),n.setRequestHeader("device-token",Langtons.Global.Utils.generateDeviceToken()),n.setRequestHeader("idle-operation","true"))},converters:{"text json":function(n){var t,n=JSON.parse(n,function(n,i){return typeof i=="string"&&Langtons.Global.Configuration.ServerDateRegex.test(i)===!0&&(t=moment(i,Langtons.Global.Configuration.ServerDateFormat))&&t.isValid()?t.toDate():i});return n}}}),function(n){var i,t;(function(t){var u=function(){function n(n,t,i){this.type=n;this.endpointName=t;this.parents=i}return n}(),i,r;t.ResourceMapping=u;i=function(){function n(n,t,i,r){n===void 0&&(n=0);t===void 0&&(t=0);i===void 0&&(i=0);r===void 0&&(r=!1);this.from=n;this.to=t;this.total=i;this.more=r}return n}();t.HttpRange=i;r=function(){function r(){}return r.ParseRange=function(n){var e,r;if(!n)return new i(0,0,0,!0);if(e=/x-entity (?:(\d+)-)?(\d+)\/(\d+|\*)/,r=n.match(e),!r)return new i;var h=r[1],c=r[2],o=r[3],f=!1,t=Number(c),s=Number(h),u=Number(o);return isNaN(u)||isNaN(t)?o!=="*"||isNaN(t)||t===s||(f=!0):t<u?f=!0:t=u,new i(s,t,u,f)},r.GetRangeHeader=function(n,t){return"x-entity="+n.toString()+"-"+t.toString()},r.BuildUrl=function(t,i,r){if(t==null)return"";var u=n.Global.Configuration.BaseUrl;return r==null||_.isEmpty(r.toString())||(u+="/"+r.toString()),r!=null&&r.HasEndpoint()||(u+="/"+t.TypeName),i!=null&&(u+="/"+i.toString()),r!=null&&(u+=r.GetQueryString()),u},r.Get=function(i,r,u,f,e){var o,s;if(i==null)throw"Parameter 'type' cannot be null in Client::Get(). The resource type file may be missing.";if(o=n.Api.Cache.GetItem(i,r,u),o!=null){f(o,null);return}s=function(t,r,e){t!=null&&(t.Id!=undefined&&(t.Id=t.Id.toString()),t.context=u,t=new i(t),n.Api.Cache.InsertItem(i,t,u));n.Global.Utils.isFunction(f)&&f(t,e)};n.Global.Configuration.BatchingEnabled?t.RequestBatcher.AddRequest("GET",this.BuildUrl(i,r,u),null,null,s,e):$.ajax(this.BuildUrl(i,r,u),{type:"GET",dataType:"json"}).done(s).fail(e||function(){})},r.GetRange=function(i,r,u,f,e,o,s){var a=this,h,c,l;if(u===void 0&&(u=!1),i==null)throw"Parameter 'type' cannot be null in Client::GetRange(). The resource type file may be missing.";if(u==!0&&(h=n.Api.Cache.GetRange(i,null,null,u,r),h!=null)){o(h,null,null,null,null);return}u==!1&&(c={Range:this.GetRangeHeader(f,e)});l=function(f,e,s){var h=a.ParseRange(s.getResponseHeader("Content-Range")),c,l;if(u&&(h.to=h.total=f.length),_.isArray(f)){for(c=0;c<f.length;c++)f[c].Id=f[c].Id.toString(),f[c].context=r,f[c]=new i(f[c]);l=new t.Collections.Collection(i,r,f,h.from,h.to,h.total);u===!0&&n.Api.Cache.InsertRange(i,l,r);n.Global.Utils.isFunction(o)&&o(l,h.from,h.to,h.total,s)}};n.Global.Configuration.BatchingEnabled?t.RequestBatcher.AddRequest("GET",this.BuildUrl(i,null,r),null,c,l,s||function(){}):$.ajax(this.BuildUrl(i,null,r),{type:"GET",dataType:"json",headers:c}).done(l).fail(s||function(){})},r.GetRangeDictionary=function(n,t,i,r,u,f,e){var o=this;if(i===void 0&&(i=!1),n==null)throw"Parameter 'type' cannot be null in Client::GetRangeDictionary()";$.ajax(this.BuildUrl(n,null,t),{type:"GET",dataType:"json",contentType:"application/json",headers:{Range:i?"":this.GetRangeHeader(r,u),"x-list-type":"dictionary"}}).done(function(n,t,i){var r=o.ParseRange(i.getResponseHeader("Content-Range"));f(n,r.from,r.to,r.total,i)}).fail(e||function(){})},r.Post=function(n,t,i,r,u,f){var e=this;if(n==null)throw"Parameter 'type' cannot be null in Client::Post()";if(t==null)throw"Parameter 'entity' cannot be null in Client::Post()";$.ajax(this.BuildUrl(n,null,i),{type:"POST",dataType:"json",contentType:"application/json",data:JSON.stringify(t)}).always(function(i,o,s){typeof s=="object"?e.always(s,n,t,r,u,f):e.always(i,n,null,r,u,f)})},r.Put=function(n,t,i,r,u,f){var e=this;if(n==null)throw"Parameter 'type' cannot be null in Client::Put()";if(t==null)throw"Parameter 'entity' cannot be null in Client::Put()";$.ajax(this.BuildUrl(n,t.Id,i),{type:"PUT",dataType:"json",contentType:"application/json",data:JSON.stringify(t)}).always(function(i,o,s){typeof s=="object"?e.always(s,n,t,r,u,f):e.always(i,n,null,r,u,f)})},r.always=function(n,t,i,r,u,f){switch(n.status){case 200:case 201:case 202:case 204:r(i,n);break;case 409:n.responseText&&(!f||f(JSON.parse(n.responseText)));break;case 500:default:u(n,n.statusText,n.responseText)}},r.Delete=function(t,i,r,u,f){if(t==null)throw"Parameter 'type' cannot be null in Client::Delete()";$.ajax(this.BuildUrl(t,i.Id,r),{type:"DELETE",dataType:"json",contentType:"application/json"}).done(function(t,i,r){n.Global.Utils.isFunction(u)&&u(r)}).fail(f||function(){})},r.Patch=function(t,i,r,u,f,e){if(t==null)throw"Parameter 'type' cannot be null in Client::Patch()";$.ajax(this.BuildUrl(t,i.Id,u),{type:"PATCH",dataType:"json",contentType:"application/json",data:JSON.stringify(r)}).done(function(t,i,r){n.Global.Utils.isFunction(f)&&f(t,r)}).fail(e||function(){})},r.Head=function(t,i,r,u,f){if(t==null)throw"Parameter 'type' cannot be null in Client::Head()";var e=$.ajax(this.BuildUrl(t,i?i.Id:null,r),{type:"HEAD",dataType:"json",contentType:"application/json"}).done(function(t,i,r){n.Global.Utils.isFunction(u)&&u(r)}).fail(f||function(){})},r.Validate=function(t,i,r,u,f){if(t==null)throw"Parameter 'type' cannot be null in Client::Validate()";if(i==null)throw"Parameter 'entity' cannot be null in Client::Validate()";var e=JSON.stringify(i),o=$.ajax(this.BuildUrl(t,i.Id,r),{type:"VALIDATE",dataType:"json",data:e,contentType:"application/json"}).done(function(t,i,r){n.Global.Utils.isFunction(u)&&u(t,r)}).fail(f||function(){})},r}();t.Client=r})(i=n.Api||(n.Api={}));t=function(){function n(){}return n.OpenModal=function(n,t,i){var r=$("#modal-prompt");r.children(".langtons-modal-title").first().text(n);r.children(".langtons-modal-inner").first().html(t);r.modal({show:!0}).on("hidden",function(){i&&i()})},n}();n.Dialogue=t}(Langtons||(Langtons={})),function(n){var t;(function(t){var f=function(){function n(n,t){this.Type=n;this.Id=t}return n.prototype.toString=function(){return this.Type.TypeName+(this.Id!=null?"/"+this.Id:"")},n}(),r,i,u;t.TypeRouteSegment=f;r=function(){function n(n,t){this.Type=n;this.Id=t}return n.prototype.toString=function(){return this.Type+(this.Id!=null?"/"+this.Id:"")},n}();t.TextRouteSegment=r;i=function(){function n(n,t){this.Name=n;this.Value=t}return n.GetQueryString=function(n){var i="",t;if(n!=null&&n.length>0)for(t=0;t<n.length;t++)t!=0&&(i+="&"),i+=n[t].Name+"="+n[t].Value;return i},n}();t.QueryParameter=i;u=function(){function t(n,t,i){this.segments=n;this.endpoint=t;this.queryParams=i}return t.prototype.HasEndpoint=function(){return this.endpoint!=null},t.prototype.GetSegments=function(){return this.segments},t.prototype.GetQueryParameters=function(){return this.queryParams},t.prototype.SetQueryParameters=function(n){this.queryParams=n},t.prototype.GetQueryString=function(){var t=i.GetQueryString(this.queryParams);return n.Global.Utils.isNullOrEmpty(t)||(t="?"+t),t},t.prototype.toString=function(){var t=this,n="";return this.segments!=null&&_.each(this.segments,function(i){n+=(i!=t.segments[0]?"/":"")+i.toString()}),this.endpoint!=null&&(n+=(this.segments!=null?"/":"")+this.endpoint),n},t}();t.Context=u})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(n){for(var t in n)this[t]=n[t]}return t.Get=function(t,i,r,u,f){n.Api.Client.Get(t,i,r,u,f)},t.prototype.Get=function(t,i){n.Api.Client.Get(this.constructor,this.Id,this.context,t,i)},t.prototype.Save=function(t,i,r){this.Id!=null?n.Api.Client.Put(this.constructor,this,this.context,t,i,r):n.Api.Client.Post(this.constructor,this,this.context,t,i,r)},t.prototype.Patch=function(t,i,r){n.Api.Client.Patch(this.constructor,this,t,this.context,i,r)},t.prototype.Delete=function(t,i){n.Api.Client.Delete(this.constructor,this,this.context,t,i)},t.prototype.Validate=function(t,i){n.Api.Client.Post(this.constructor,this,this.context,function(n,i){t(n,i)},i)},t}();t.Resource=i})(i=t.Resources||(t.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));Resources=Langtons.Api.Resources,function(n){var t;(function(t){var i;(function(i){var r=function(){function i(n,t,i,r,u,f){this.items=[];this.total=0;this.from=0;this.to=0;this.more=!0;this.type=n;this.context=t;this.items=i||[];this.from=r||0;this.to=u||0;this.total=f||0;this.more=this.to<this.total||this.total==0}return i.GetRange=function(n,i,r,u,f,e,o){r===void 0&&(r=!1);t.Client.GetRange(n,i,r,u,f,function(n,t,i,r,u){_.isFunction(e)&&e(n,t,i,r,u)},o)},i.prototype.GetItems=function(){return this.items},i.prototype.GetCount=function(){return this.items==null?0:this.items.length},i.prototype.SetQueryParameters=function(n){this.context==null&&(this.context=new t.Context);this.context.SetQueryParameters(n)},i.prototype.SetContext=function(n){this.context=n},i.prototype.GetContext=function(){return this.context},i.prototype.HasMore=function(){return this.more},i.prototype.Clear=function(){this.items=[];this.from=this.to=this.total=0;this.more=!0},i.prototype.Create=function(n,i,r){t.Client.Post(this.type,n,this.context,i,r)},i.prototype.GetAll=function(n,i){var r=this;this.HasMore()===!1&&this.total>0||t.Client.GetRange(this.type,this.context,!0,this.from,this.to,function(t,i,u,f,e){r.Clear();r.items=t.GetItems();r.from=0;r.to=u;r.total=f;r.more=isNaN(f)?u>0:r.to<r.total-1;t.more=r.more;_.isFunction(n)&&n(r,i,u,f,e)},i)},i.prototype.Get=function(i,r,u){var f=this;(i=i||n.Global.Configuration.DefaultListSize,this.HasMore()!==!1)&&t.Client.GetRange(this.type,this.context,!1,this.GetCount(),this.GetCount()+i,function(n,t,u,e,o){f.items.push.apply(f.items,n.GetItems());f.to=u;f.total=e;f.more=isNaN(e)?n.GetItems().length>=i:f.to<f.total-1;n.more=f.more;_.isFunction(r)&&r(n,t,u,e,o)},u)},i.prototype.Delete=function(n,i,r){t.Client.Delete(this.type,n,this.context,i,r)},i}();i.Collection=r})(i=t.Collections||(t.Collections={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={})),function(n){var t;(function(t){var i=function(){function i(){var i=this;this.EmptyCart=function(){$.ajax({url:"/api/Cart/clear",type:"DELETE",dataType:"json",contentType:"application/json"}).done(function(){i.collection.Clear()}).fail(function(){alert("Could not empty cart. Please try again.")})};this.collection=new t.Collections.Collection(n.Api.Resources.CartItem)}return i.prototype.GetCount=function(){return this.collection.GetCount()},i.prototype.AddDelegate=function(t,i,r,u){var f=this;u===void 0&&(u=!1);this.collection.Create(t,function(){f.RefreshCart(function(t){u||n.Api.Events.Trigger(n.Api.EventType.ADDED_TO_CART,t)});_.isFunction(i)&&i()},r)},i.prototype.AddBasketItem=function(t,i,r,u,f){f===void 0&&(f=!1);var e=new n.Api.Resources.CartItem;e.BasketId=t;e.Quantity=i;this.AddDelegate(e,r,u,f)},i.prototype.AddDualListedItem=function(t,i,r,u,f,e,o){o===void 0&&(o=!1);var s=new n.Api.Resources.CartItem;s.ProductId=t;s.BottleSizeId=r;s.Vintage=i;s.Quantity=u;this.AddDelegate(s,f,e,o)},i.prototype.AddEventItem=function(t,i,r,u){u===void 0&&(u=!1);var f=new n.Api.Resources.CartItem;f.EventDocumentNo=t;this.AddDelegate(f,i,r,u)},i.prototype.AddEventItemFromTransactionsPage=function(t,i,r,u,f,e){e===void 0&&(e=!1);var o=new n.Api.Resources.CartItem;o.EventDocumentNo=t;o.ToPay=i;o.ToShip=r;this.AddDelegate(o,u,f,e)},i.prototype.AddEventDocumentItem=function(t,i,r,u){u===void 0&&(u=!1);var f=new n.Api.Resources.CartItem;f.EventDocumentItemId=t;this.AddDelegate(f,i,r,u)},i.prototype.AddAllInvoices=function(t,i){$.ajax(n.Global.Configuration.BaseUrl+"/cart/AddOutstandingInvoices",{type:"PUT",dataType:"json",contentType:"application/json"}).done(function(n){_.isFunction(t)&&t(n)}).fail(i||function(){})},i.prototype.RefreshCart=function(){var t=this,i;this.collection.Clear();i={url:"/api/ShoppingCart/MyItems",type:"GET"};$.ajax(i).done(function(i){t.collection.items=i.Items;n.Api.Events.Trigger(n.Api.EventType.CART_REFRESHED,t.collection)}).fail()},i.prototype.DeleteFromCart=function(n,t,i){this.collection.Delete(n,t,i)},i}();t.CartManager=i})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={})),function(n){var t;(function(t){var i=function(){function t(t,i,r){var u=this;i===void 0&&(i="...");this.loadAll=!1;this.cache=ko.observable();this.lookupRequests={};this.defaultValue=i;this.type=t;this.context=r;this.collection=new n.Api.Collections.Collection(t,r);this.cache.subscribe(function(n){_.each(n,function(n){u.lookupRequests[n.Id]||(u.lookupRequests[n.Id]={});for(var t in n)u.lookupRequests[n.Id][t]||(u.lookupRequests[n.Id][t]=ko.observable(i)),u.lookupRequests[n.Id][t](n[t])})})}return t.prototype.AddToLookupRequests=function(n,t,i){var r=!i?ko.observable(this.defaultValue):i;return this.lookupRequests[n]||(this.lookupRequests[n]={}),this.lookupRequests[n][t]=r,r},t.prototype.GetItem=function(t){var i=this;n.Api.Resources.Resource.Get(this.type,t,this.context,function(n){i.cache([n])})},t.prototype.LoadAll=function(n,t){var i=this;this.loadAll=!0;this.collection.GetAll(function(t){i.cache(t.GetItems());_.isFunction(n)&&n(i.cache.peek())},t)},t.prototype.GetAll=function(){return this.cache},t.prototype.GetDefaultValue=function(){return this.defaultValue},t.prototype.GetPropertyAsComputed=function(n,t,i){var r=this;return i===void 0&&(i=", "),ko.computed(function(){var u=[];for(var o in n)u.push(r.GetPropertyAsObservable(n[o],t));var f="",e=0,s=u.length-1;return ko.utils.arrayForEach(u,function(n){f+=n();e!==s&&(f+=i);e++}),f})},t.prototype.LoadIntoObservable=function(n,t,i){this.AddToLookupRequests(n,t,i);this.GetItem(n)},t.prototype.GetPropertyAsObservable=function(n,t){if(n==null)return ko.observable();if(this.lookupRequests[n]&&this.lookupRequests[n][t])return this.lookupRequests[n][t];var i=this.AddToLookupRequests(n,t);return this.loadAll||this.GetItem(n),i},t}();t.Lookup2=i})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));ko.bindingHandlers.productQuantityText={update:function(n,t){var f=t(),i=ko.utils.unwrapObservable(f),e=i.singleText,r=i.quantity,u="";u=r==1?"Per "+e:"In "+r.toString();$(n).text(u+":")}};ko.bindingHandlers.volumeAsML={update:function(n,t){var i=t(),r=ko.utils.unwrapObservable(i);$(n).text(parseFloat(r)*1e3+"ml")}};ko.bindingHandlers.viewModelForm={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t,i,r,u){var f=t();ko.renderTemplate(ko.utils.unwrapObservable(f),u,{afterRender:function(){r.AfterRender($("form",n))}},n)}};ko.bindingHandlers.dateText={update:function(n,t,i){var u=t(),f=i(),r=ko.utils.unwrapObservable(u),e=f.datePattern||Langtons.Global.Configuration.MomentDateFormat;$(n).text(r&&moment(r)!==null?moment(r).format(e):"")}};ko.bindingHandlers.dateformat={update:function(n,t){var i=t();i.format==undefined||i.format==null?$(n).text("Date format not supplied"):$(n).text(moment(i.date).format(i.format))}};ko.bindingHandlers.currencyText={update:function(n,t,i){var s=t(),h=i(),u={p:2,d:".",s:","},f=h.ct_opts,e,r,o;(f!=undefined||f!=null)&&(u=f);e=ko.utils.unwrapObservable(s);r=parseFloat(e);isNaN(r)?$(n).text("NaN"):(o=r<0?"-$":"$",r=r<0?-r:r,$(n).text(o+r.formatMoney(u.p,u.d,u.s)))}};Number.prototype.formatMoney=function(n,t,i){var u=this,n=isNaN(n=Math.abs(n))?2:n,t=t==undefined?".":t,i=i==undefined?",":i,e=u<0?"-":"",f=parseInt(u=Math.abs(+u||0).toFixed(n))+"",r=(r=f.length)>3?r%3:0;return e+(r?f.substr(0,r)+i:"")+f.substr(r).replace(/(\d{3})(?=\d)/g,"$1"+i)+(n?t+Math.abs(u-f).toFixed(n).slice(2):"")};ko.bindingHandlers.dateValue={init:function(n,t,i){var r=t(),u=i().datePattern||Langtons.Global.Configuration.MomentDateFormat,e=Langtons.convertMomentToDatePickerFormat(u),o=$(n).parent().data("datetimepicker"),f;if(!o)$(n).parent().datetimepicker({language:"en",format:e,pick12HourFormat:!0}).on("hide",function(n){$(n.target).find("input").change()});f=ko.computed({read:function(){return r()?moment(r()).format(u):""},write:function(n){var i=r(),t=n?moment(n,u).toDate():null;if(moment(i)===null&&moment(t)!==null||moment(t)===null&&moment(i)!==null){r(t);return}moment(i)!==null&&moment(t)!==null&&(moment(i).format(u)!==moment(t).format(u)?r(t):n!==moment(i).format(u)&&r.valueHasMutated())}});ko.applyBindingsToNode(n,{value:f})},update:function(n){$(n).trigger("change")}};ko.bindingHandlers.popoverNote={init:function(n,t){var i=t();$(n).popover({placement:"top",container:"body",content:function(){return i}})}};ko.bindingHandlers.executeOnEnter={init:function(n,t,i,r){var u=i();$(n).keypress(function(t){var i=t.which?t.which:t.keyCode;return i===13?($(n).blur(),u.executeOnEnter.call(r),!1):!0})}};ko.bindingHandlers.truncateText={update:function(n,t,i){var r=ko.utils.unwrapObservable(t()),u=r,f,e;_.isEmpty(r)||(f=i().maxWords,e=i().maxLength,e==null||isNaN(e)?f==null||isNaN(f)||(u=Langtons.Global.Utils.LimitWordCount(r,f)):(u=r.substr(0,Math.min(r.length,e)),u.length<r.length&&(u+="...")),$(n).text(u))}};ko.bindingHandlers.fadeVisible={init:function(n,t){var i=t();$(n).toggle(ko.utils.unwrapObservable(i))},update:function(n,t){var i=t();ko.utils.unwrapObservable(i)?$(n).fadeIn():$(n).hide()}};ko.bindingHandlers.checkedRadioToBool={init:function(n,t){var i=t(),r=ko.computed({read:function(){return i().toString()},write:function(n){i(n==="true")},owner:this});ko.applyBindingsToNode(n,{checked:r})}};ko.bindingHandlers.bootstrapButtonLoadingValue={init:function(n,t,i){var r=i().loadingText||"Loading...";$(n).attr("data-loading-text",r)},update:function(n,t){ko.utils.unwrapObservable(t())?$(n).button("loading"):$(n).button("reset")}};ko.bindingHandlers.DOB={init:function(){},update:function(n,t,i,r){var s,o;!!r.DOBState||(r.DOBState={binding:ko.observable(),dSet:!1,mSet:!1,ySet:!1});var l=i.get("options"),h=i(),f=t(),e=h.DOBBindingProp,c=h.DOBProp,u=null;if(!_.isEmpty(l)){if(!!f()[e])switch(c){case"day":u=f()[e].getDate();console.log("day",u);r.DOBState.dSet=u;break;case"month":u=f()[e].getMonth();console.log("month",u);r.DOBState.mSet=u;break;case"year":u=f()[e].getFullYear();console.log("year",u);r.DOBState.ySet=u}s={value:ko.observable(u)};ko.applyBindingsToNode(n,s);r.DOBState.dSet!==!1&&r.DOBState.mSet!==!1&&r.DOBState.ySet!==!1&&(o=new Date,o.setFullYear(r.DOBState.ySet),o.setMonth(r.DOBState.mSet),o.setDate(r.DOBState.dSet),f()[e]=o,r.DOBState.binding(o));s.value.subscribe(function(n){switch(c){case"day":r.DOBState.dSet=n;break;case"month":r.DOBState.mSet=n;break;case"year":r.DOBState.ySet=n}if(r.DOBState.dSet!==!1&&r.DOBState.mSet!==!1&&r.DOBState.ySet!==!1){var t=new Date;t.setFullYear(r.DOBState.ySet);t.setMonth(r.DOBState.mSet);t.setDate(r.DOBState.dSet);f()[e]=t;r.DOBState.binding(t)}})}}};ko.bindingHandlers.formValidator={init:function(n,t,i,r){$(n).unbind("submit");r.SetValidation($(n))}};ko.bindingHandlers.visibleFadeOut={init:function(n,t){ko.utils.unwrapObservable(t())==!1&&$(n).hide()},update:function(n,t,i){var u=$(n),r;ko.utils.unwrapObservable(t())==!0?u.show():(r=ko.utils.unwrapObservable(i()).fadeDuration,r!=undefined&&(r=1e3),u.fadeOut(r))}};ko.bindingHandlers.loadImage={init:function(){},update:function(n,t){var e=$(n),i=e.find(".product-image"),o=i.find("img"),u=e.find(".image-loader"),f=ko.utils.unwrapObservable(t()),r;f!=null&&f!="null"&&(i.hide(),u.show(),o.attr("src",""),r=new Image,r.onload=function(){o.attr("src",this.src);u.hide();Modernizr.cssanimations?i.show():i.fadeIn()},r.onerror=function(){u.hide();i.hide()},setTimeout(function(){r.src=f},0))}};ko.bindingHandlers.imageOrDefault={init:function(){},update:function(n,t){var i=ko.unwrap(t());i.pre=i.pre||"";i.post=i.post||"";n.onerror=function(){n.src="/api/binaries/1"+i.post};n.src=i.pre+""+i.path+""+i.post}};ko.bindingHandlers.jCarousel={init:function(n,t,i,r,u){ko.bindingHandlers.foreach.init(n,function(){return[]},i,r,u);var f=$(n).parent();f.jcarousel({animation:"slow"});f.parent().find(".jcarousel-next").on("click",function(){f.jcarousel("scroll","+=1")});f.parent().find(".jcarousel-prev").on("click",function(){f.jcarousel("scroll","-=1")})},update:function(n,t,i,r,u){var e=t(),f;ko.bindingHandlers.foreach.update(n,function(){return ko.utils.unwrapObservable(e.data)},i,r,u);f=$(n).parent();f.jcarousel("reload",{animation:"slow"})}};ko.bindingHandlers.returnKey={init:function(n,t,i,r){ko.utils.registerEventHandler(n,"keydown",function(n){console.log("");n.keyCode===13&&(n.preventDefault(),n.target.blur(),t().call(r))})}};ko.pauseableDependentObservable=function(n,t){var r="",u=ko.observable(!1),i=ko.dependentObservable(function(){return u()?r:n.call(t)},t);return i.reevaluatedCount=ko.observable(0),i.subscribe(function(){this.reevaluatedCount(this.reevaluatedCount()+1)},i),i.pause=function(){r=this();u(!0)}.bind(i),i.resume=function(){r="";u(!1)},i};__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.Create=function(n){var i=new t(n);return i.Id=i.Id||null,i.UserName=i.UserName||null,i.MemberNo=i.MemberNo||null,i.Password=i.Password||null,i.FirstName=i.FirstName||null,i.LastName=i.LastName||null,i.Comment=i.Comment||null,i.Phone=i.Phone||null,i.MobilePhone=i.MobilePhone||null,i.Email=i.Email||null,i.BusinessName=i.BusinessName||null,i.ABN=i.ABN||null,i.BillingStreet1=i.BillingStreet1||null,i.BillingStreet2=i.BillingStreet2||null,i.BillingSuburb=i.BillingSuburb||null,i.BillingState=i.BillingState||null,i.BillingPostCode=i.BillingPostCode||null,i.BillingCountryID=i.BillingCountryID||null,i.BillingCountry=i.BillingCountry||null,i.DateOfBirth=i.DateOfBirth||null,i.JoinedOn=i.JoinedOn||null,i.SubscriptionExpiry=i.SubscriptionExpiry||null,i.HandlingCharge=i.HandlingCharge||null,i.GSTApplicableVendorFlag=i.GSTApplicableVendorFlag||null,i.VendorPayoutMethodId=i.VendorPayoutMethodId||null,i.PaymentTo=i.PaymentTo||null,i.BSB=i.BSB||null,i.AccountNumber=i.AccountNumber||null,i.CommissionPercent1=i.CommissionPercent1||null,i.CommissionPercent2=i.CommissionPercent2||null,i.CommissionPercent3=i.CommissionPercent3||null,i.BPayRefNo=i.BPayRefNo||null,i.NotifyStatementsByEmail=i.NotifyStatementsByEmail||null,i.NotifyHighlightsByEmail=i.NotifyHighlightsByEmail||null,i.NotifyBrokerageOffers=i.NotifyBrokerageOffers||null,i.NotifyOutbidByEmail=i.NotifyOutbidByEmail||null,i.NotifyNewsletterByEmail=i.NotifyNewsletterByEmail||null,i.NotifyByMail=i.NotifyByMail||null,i.FirstBidNotification=i.FirstBidNotification||null,i.IsFullMember=i.IsFullMember||null,i.IsLifeMember=i.IsLifeMember||null,i.CanAccessPlatinum=i.CanAccessPlatinum||null,i.CanAccessCenturion=i.CanAccessCenturion||null,i.CanRequestTransfer=i.CanRequestTransfer||null,i.CanShipBeforePayment=i.CanShipBeforePayment||null,i.CanCreateContra=i.CanCreateContra||null,i.ShipFirst=i.ShipFirst||null,i.CreditLimitInDays=i.CreditLimitInDays||null,i.CreditLimitInDollars=i.CreditLimitInDollars||null,i.ChangePasswordCode=i.ChangePasswordCode||null,i.PasswordExpiryDate=i.PasswordExpiryDate||null,i.ReadAuctionTerms=i.ReadAuctionTerms||null,i.WelcomeMessage=i.WelcomeMessage||null,i.ItemsPerPage=i.ItemsPerPage||null,i.Disabled=i.Disabled||null,i.EnteredBy=i.EnteredBy||null,i.StaffId=i.StaffId||null,i.BrokerageSegmentationId=i.BrokerageSegmentationId||null,i.LeadSourceId=i.LeadSourceId||null,i.EventId=i.EventId||null,i.EventTypeId=i.EventTypeId||null,i.IsIconic=i.IsIconic||null,i.UseWineWalletFirst=i.UseWineWalletFirst||null,i.MYOB_Reference_Number=i.MYOB_Reference_Number||null,i.CODDispatch=i.CODDispatch||null,i.Fax=i.Fax||null,i.URL=i.URL||null,i.WineryID=i.WineryID||null,i.ContactCategoryId=i.ContactCategoryId||null,i.CustomerRef=i.CustomerRef||null,i.Phone2=i.Phone2||null,i.PhoneHome=i.PhoneHome||null,i.PhoneWork=i.PhoneWork||null,i.Notes=i.Notes||null,i.History=i.History||null,i.LastOrderDate=i.LastOrderDate||null,i.DeliveryCompany=i.DeliveryCompany||null,i.DeliveryStreet1=i.DeliveryStreet1||null,i.DeliveryStreet2=i.DeliveryStreet2||null,i.DeliverySuburb=i.DeliverySuburb||null,i.DeliveryState=i.DeliveryState||null,i.DeliveryPostcode=i.DeliveryPostcode||null,i.DeliveryNotes=i.DeliveryNotes||null,i.DeliveryCountryId=i.DeliveryCountryId||null,i.StorageStreet1=i.StorageStreet1||null,i.StorageStreet2=i.StorageStreet2||null,i.StorageSuburb=i.StorageSuburb||null,i.StorageState=i.StorageState||null,i.StoragePostcode=i.StoragePostcode||null,i.StoragePhone=i.StoragePhone||null,i.StorageAccount=i.StorageAccount||null,i.StorageType=i.StorageType||null,i.StorageCapacity=i.StorageCapacity||null,i.LastUpdatedDate=i.LastUpdatedDate||null,i.LastUpdatedByStaffId=i.LastUpdatedByStaffId||null,i.LocationId=i.LocationId||null,i.AllowBrokerToBidOnBehalf=i.AllowBrokerToBidOnBehalf||null,i.AssisstedAuctionOptinList=i.AssisstedAuctionOptinList||null,i.ContactTypeId=i.ContactTypeId||null,i.IsPersonal=i.IsPersonal||null,i.SalutationId=i.SalutationId||null,i.InvoiceEmail=i.InvoiceEmail||null,i.EParcelId=i.EParcelId||null,i.EParcelServiceType=i.EParcelServiceType||null,i.EParcelInsuranceTypeId=i.EParcelInsuranceTypeId||null,i.EParcelDeliveryTypeId=i.EParcelDeliveryTypeId||null,i.EParcelChargeCode=i.EParcelChargeCode||null,i.PreferredContactTime=i.PreferredContactTime||null,i.BillingAddressSameAsDefaultDeliveryAddress=i.BillingAddressSameAsDefaultDeliveryAddress||null,i.PasswordResetToken=i.PasswordResetToken||null,i.PasswordResetTokenExpiry=i.PasswordResetTokenExpiry||null,i.FreezeAccount=i.FreezeAccount||null,i.VendorCode=i.VendorCode||null,i.IsTradeCustomer=i.IsTradeCustomer||null,i.HardBounce=i.HardBounce||null,i.AutoShip=i.AutoShip||null,i.AutoShipDeliveryGuarantee=i.AutoShipDeliveryGuarantee||null,i},t.TypeName="Members",t}(n.Resource);n.Contact=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t);this.ddState=ko.observable("");this.txtState=ko.observable("");this.ObsCountryId=ko.observable()}return __extends(t,n),t.Create=function(n){var i=new t(n);return i.Id=i.Id||null,i.Street1=i.Street1||null,i.Street2=i.Street2||null,i.Suburb=i.Suburb||null,i.State=i.State||null,i.ddState=ko.observable(i.State),i.ddState.subscribe(function(n){i.State=n},this),i.txtState=ko.observable(i.State),i.txtState.subscribe(function(n){i.State=n},this),i.PostCode=i.PostCode||null,i.CountryId=i.CountryId||null,i.ObsCountryId=ko.observable(i.CountryId),i.ObsCountryId.subscribe(function(n){i.CountryId==2&&n!=2&&i.txtState("");i.CountryId=n},this),i.InvoiceEmail=i.InvoiceEmail||null,i.EnteredBy=i.EnteredBy||null,i.IsDefault=i.IsDefault||null,i},t.TypeName="BillingAddresses",t}(n.Resource);n.BillingAddress=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="Sessions",t}(n.Resource);n.Session=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="CartItems",t}(n.Resource);n.CartItem=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="ShoppingCart",t}(n.Resource);n.ShoppingCart=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="Terms",t}(n.Resource);n.Term=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="Products",t}(n.Resource);n.Product=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="ProductCategories",t}(n.Resource);n.ProductCategory=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="ProductTypes",t}(n.Resource);n.ProductType=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="ProductVarieties",t}(n.Resource);n.ProductVariety=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="Stock",t}(n.Resource);n.Stock=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="Countries",t}(n.Resource);n.Country=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="Regions",t}(n.Resource);n.Region=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="States",t}(n.Resource);n.State=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="Wineries",t}(n.Resource);n.Winery=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="Bids",t}(n.Resource);n.Bid=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="BidStatus",t}(n.Resource);n.BidStatus=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="Auctions",t}(n.Resource);n.Auction=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="Baskets",t}(n.Resource);n.Basket=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="BasketItems",t}(n.Resource);n.BasketItem=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="BasketSegments",t}(n.Resource);n.BasketSegment=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="BasketPricePoints",t}(n.Resource);n.BasketPricePoint=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t);this.TimeToAuctionClose=ko.observable("0d:0h:0m:0s")}return __extends(t,n),t.TypeName="BidListItems",t}(n.Resource);n.BidListItem=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="CatalogueDescriptions",t}(n.Resource);n.CatalogueDescription=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="Classifications",t}(n.Resource);n.Classification=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="BottleSizes",t}(n.Resource);n.BottleSize=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="ProductReviews",t}(n.Resource);n.ProductReview=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="WineryReviews",t}(n.Resource);n.WineryReview=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="TastingNotes",t}(n.Resource);n.TastingNote=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="CreditCardTypes",t}(n.Resource);n.CreditCardType=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="PriceGuides",t}(n.Resource);n.PriceGuide=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){n.call(this,t)}return __extends(t,n),t.TypeName="ValidationTests",t}(n.Resource);n.ValidationTest=t})(t=n.Resources||(n.Resources={}))})(t=n.Api||(n.Api={}))}(Langtons||(Langtons={}))