encore-api-services
Advanced tools
Comparing version 2.0.11 to 2.0.12
@@ -8,2 +8,2 @@ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("apiServices",[],e):"object"==typeof exports?exports.apiServices=e():t.apiServices=e()}(window,function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=26)}([function(t,e,n){"use strict";var r=n(2),o=n(9),i=Object.prototype.toString;function u(t){return"[object Array]"===i.call(t)}function s(t){return null!==t&&"object"==typeof t}function a(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!==t&&void 0!==t)if("object"!=typeof t&&(t=[t]),u(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:u,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:s,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:a,isStream:function(t){return s(t)&&a(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";var r=n(0),o=n(11),i={"Content-Type":"application/x-www-form-urlencoded"};function u(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var s={adapter:function(){var t;return"undefined"!=typeof XMLHttpRequest?t=n(3):"undefined"!=typeof process&&(t=n(3)),t}(),transformRequest:[function(t,e){return o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(u(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(u(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(t){s.headers[t]={}}),r.forEach(["post","put","patch"],function(t){s.headers[t]=r.merge(i)}),t.exports=s},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(0),o=n(12),i=n(14),u=n(15),s=n(16),a=n(4),c="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||n(17);t.exports=function(t){return new Promise(function(e,f){var p=t.data,l=t.headers;r.isFormData(p)&&delete l["Content-Type"];var h=new XMLHttpRequest,d="onreadystatechange",y=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in h||s(t.url)||(h=new window.XDomainRequest,d="onload",y=!0,h.onprogress=function(){},h.ontimeout=function(){}),t.auth){var v=t.auth.username||"",g=t.auth.password||"";l.Authorization="Basic "+c(v+":"+g)}if(h.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,h[d]=function(){if(h&&(4===h.readyState||y)&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?u(h.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?h.response:h.responseText,status:1223===h.status?204:h.status,statusText:1223===h.status?"No Content":h.statusText,headers:n,config:t,request:h};o(e,f,r),h=null}},h.onerror=function(){f(a("Network Error",t,null,h)),h=null},h.ontimeout=function(){f(a("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var m=n(18),w=(t.withCredentials||s(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;w&&(l[t.xsrfHeaderName]=w)}if("setRequestHeader"in h&&r.forEach(l,function(t,e){void 0===p&&"content-type"===e.toLowerCase()?delete l[e]:h.setRequestHeader(e,t)}),t.withCredentials&&(h.withCredentials=!0),t.responseType)try{h.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){h&&(h.abort(),f(t),h=null)}),void 0===p&&(p=null),h.send(p)})}},function(t,e,n){"use strict";var r=n(13);t.exports=function(t,e,n,o,i){var u=new Error(t);return r(u,e,n,o,i)}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){t.exports=n(8)},function(t,e,n){"use strict";var r=n(0),o=n(2),i=n(10),u=n(1);function s(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var a=s(u);a.Axios=i,a.create=function(t){return s(r.merge(u,t))},a.Cancel=n(6),a.CancelToken=n(24),a.isCancel=n(5),a.all=function(t){return Promise.all(t)},a.spread=n(25),t.exports=a,t.exports.default=a},function(t,e){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)} | ||
*/ | ||
t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";var r=n(1),o=n(0),i=n(19),u=n(20);function s(t){this.defaults=t,this.interceptors={request:new i,response:new i}}s.prototype.request=function(t){"string"==typeof t&&(t=o.merge({url:arguments[0]},arguments[1])),(t=o.merge(r,{method:"get"},this.defaults,t)).method=t.method.toLowerCase();var e=[u,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},o.forEach(["delete","get","head","options"],function(t){s.prototype[t]=function(e,n){return this.request(o.merge(n||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){s.prototype[t]=function(e,n,r){return this.request(o.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=s},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(4);t.exports=function(t,e,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t}},function(t,e,n){"use strict";var r=n(0);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var u=[];r.forEach(e,function(t,e){null!==t&&void 0!==t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),u.push(o(e)+"="+o(t))}))}),i=u.join("&")}return i&&(t+=(-1===t.indexOf("?")?"?":"&")+i),t}},function(t,e,n){"use strict";var r=n(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,u={};return t?(r.forEach(t.split("\n"),function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(u[e]&&o.indexOf(e)>=0)return;u[e]="set-cookie"===e?(u[e]?u[e]:[]).concat([n]):u[e]?u[e]+", "+n:n}}),u):u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(){this.message="String contains an invalid character"}o.prototype=new Error,o.prototype.code=5,o.prototype.name="InvalidCharacterError",t.exports=function(t){for(var e,n,i=String(t),u="",s=0,a=r;i.charAt(0|s)||(a="=",s%1);u+=a.charAt(63&e>>8-s%1*8)){if((n=i.charCodeAt(s+=.75))>255)throw new o;e=e<<8|n}return u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,u){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===u&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(0);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},function(t,e,n){"use strict";var r=n(0),o=n(21),i=n(5),u=n(1),s=n(22),a=n(23);function c(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return c(t),t.baseURL&&!s(t.url)&&(t.url=a(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||u.adapter)(t).then(function(e){return c(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(c(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(6);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";var r,o,i,u,s;n.r(e),function(t){t.Dev="dev",t.Qa="qa",t.Staging="staging",t.Prod="prod"}(r||(r={})),function(t){t.Collection="collection",t.Postage="postage",t.Eticket="eticket",t.Evoucher="evoucher"}(o||(o={})),function(t){t.Active="active",t.Expired="expired",t.Confirmed="confirmed",t.Cancelled="cancelled"}(i||(i={})),function(t){t.Show="SHW",t.Attraction="ATT",t.Flexitickets="FLX",t.GiftVoucher="GVC",t.Postage="PST"}(u||(u={})),function(t){t.USA="USA",t.UK="GBR",t.Mixed="Mixed"}(s||(s={}));var a,c,f,p,l=n(7),h=n.n(l),d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},y=function(t){var e={baseURL:t},n=h.a.create(e);return n.interceptors.response.use(v,g),n},v=function(t){var e=t.data;return e?d({},t,{data:e.response}):t},g=function(t){var e=t.response;return e?e.data.context.errors:[]},m=((a={})[r.Dev]="https://basket-service.devtixuk.io/api/v1",a[r.Qa]="https://basket-service.qatixuk.io/api/v1",a[r.Staging]="https://basket-service.stagingtixuk.io/api/v1",a[r.Prod]="https://basket-service.tixuk.io/api/v1",a),w=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},b=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},k=function(t){var e=y(m[t]);return{upsertBasket:function(t){return w(void 0,void 0,void 0,function(){var n,r,o,i,u,s,a;return b(this,function(c){switch(c.label){case 0:return n=t.channelId,r=t.coupon,o=t.delivery,i=t.reference,u=t.reservations,s=t.shopperCurrency,a=t.hasFlexiTickets,[4,e.patch("/baskets",{channelId:n,coupon:r,delivery:o,reference:i,reservations:u,shopperCurrency:s,hasFlexiTickets:a})];case 1:return[2,c.sent().data]}})})},getBasket:function(t){return w(void 0,void 0,void 0,function(){var n;return b(this,function(r){switch(r.label){case 0:return n="/baskets/"+t,[4,e.get(n)];case 1:return[2,r.sent().data]}})})},getDeliveries:function(t){return w(void 0,void 0,void 0,function(){var n;return b(this,function(r){switch(r.label){case 0:return n="/baskets/"+t+"/deliveryOptions",[4,e.get(n)];case 1:return[2,r.sent().data.results]}})})},deleteItem:function(t,n){return w(void 0,void 0,void 0,function(){var r;return b(this,function(o){switch(o.label){case 0:return r="/baskets/"+t+"/reservations/"+n,[4,e.delete(r)];case 1:return[2,o.sent().data]}})})}}};!function(t){t.Products="products"}(c||(c={})),function(t){t.Square="square",t.Landscape="landscape",t.Portrait="portrait",t.Default="default"}(f||(f={}));var x,S,P,C,D,A=((p={})[r.Dev]={api:"https://content-service.qatixuk.io/api/v1",images:"https://content-service.devtixuk.com/images"},p[r.Qa]={api:"https://content-service.qatixuk.io/api/v1",images:"https://content-service.qatixuk.com/images"},p[r.Staging]={api:"https://content-service.stagingtixuk.io/api/v1",images:"https://content-service.stagingtixuk.com/images"},p[r.Prod]={api:"https://content-service.tixuk.io/api/v1",images:"https://content-service.tixuk.com/images"},p),T=((x={})[f.Default]=[{screenSize:"xxl",imageSize:80},{screenSize:"xl",imageSize:64},{screenSize:"lg",imageSize:48},{screenSize:"md",imageSize:64},{screenSize:"sm",imageSize:64}],x),I=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},B=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},E=function(t){var e=A[t],n=y(e.api);return{getProduct:function(t){return I(void 0,void 0,void 0,function(){var e;return B(this,function(r){switch(r.label){case 0:return e="/products/"+t,[4,n.get(e)];case 1:return[2,r.sent().data]}})})},getImages:function(t,n,r){return void 0===r&&(r=f.Default),T[r].map(function(o){var i=o.screenSize,u=o.imageSize;return{screenSize:i,url:e.images+"/"+t+"/"+n+"/"+r+"?width="+u}})}}},j=function(){function t(t){var e=t.name,n=t.showType,r=t.venue,o=t.id,i=t.showFaceValue;this.name=e,this.type=n,this.venue=r,this.id=o,this.showFaceValue=i}return t.prototype.getName=function(){return this.name},t.prototype.getType=function(){return this.type},t.prototype.getVenue=function(){return this.venue},t.prototype.needShowFaceValue=function(){return this.showFaceValue},t}(),F=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},R=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},O=function(t){var e=E(t),n=e.getImages,r=e.getProduct;return{getProduct:function(t){return F(void 0,void 0,void 0,function(){var e;return R(this,function(n){switch(n.label){case 0:return[4,r(t)];case 1:return e=n.sent(),[2,new j(e)]}})})},getImages:n}},q={setEnvironment:function(t){S=t},getRepository:function(){if(!S)return null;var t=O(S),e=$(S);return{getShowDetails:t.getProduct,getImages:t.getImages,getDeliveries:e.getDeliveries}}},N=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},U=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},V=function(){function t(t){this.repository=q.getRepository();var e=t.id,n=t.quantity,r=t.productId,o=t.productName,i=t.productType,u=t.faceValueInShopperCurrency,s=t.adjustedSalePriceInShopperCurrency,a=t.salePriceInShopperCurrency,c=t.adjustmentAmountInShopperCurrency,f=t.date,p=t.items,l=t.venueId;this.id=e,this.quantity=n,this.productId=r,this.productName=o,this.productType=i,this.faceValueInShopperCurrency=u,this.adjustedSalePriceInShopperCurrency=s,this.salePriceInShopperCurrency=a,this.adjustmentAmountInShopperCurrency=c,this.date=new Date(f),this.rawDate=f,this.seats=p,this.venueId=l}return t.prototype.getId=function(){return this.id},t.prototype.getQuantity=function(){return this.quantity},t.prototype.getProductId=function(){return this.productId},t.prototype.getProductName=function(){return this.productName},t.prototype.isVoucher=function(){return this.productType===u.GiftVoucher},t.prototype.isPostage=function(){return this.productType===u.Postage},t.prototype.isFlexiticket=function(){return this.productType===u.Flexitickets},t.prototype.isShow=function(){return this.productType===u.Show},t.prototype.isAttraction=function(){return this.productType===u.Attraction},t.prototype.getProductType=function(){return this.productType},t.prototype.getFaceValue=function(){return this.faceValueInShopperCurrency},t.prototype.getSalePrice=function(){return this.adjustedSalePriceInShopperCurrency},t.prototype.getOriginalSalePrice=function(){return this.salePriceInShopperCurrency},t.prototype.getAdjustmentAmount=function(){return this.adjustmentAmountInShopperCurrency},t.prototype.getFaceValueAmount=function(){return this.faceValueInShopperCurrency.value},t.prototype.getSalePriceAmount=function(){return this.adjustedSalePriceInShopperCurrency.value},t.prototype.getOriginalSalePriceAmount=function(){return this.salePriceInShopperCurrency.value},t.prototype.hasDiscount=function(){return this.getFaceValueAmount()>this.getOriginalSalePriceAmount()},t.prototype.getPromotionDiscount=function(){return this.adjustmentAmountInShopperCurrency?this.quantity*this.adjustmentAmountInShopperCurrency.value:0},t.prototype.hasPromotionDiscount=function(){return!!this.getPromotionDiscount()},t.prototype.getDiscount=function(){return this.hasDiscount()?this.quantity*(this.getFaceValueAmount()-this.getOriginalSalePriceAmount()):0},t.prototype.getTotalPrice=function(){return this.quantity*this.getSalePriceAmount()},t.prototype.getTotalPriceWithoutPromotion=function(){return this.quantity*this.getOriginalSalePriceAmount()},t.prototype.getPriceBeforeDiscount=function(){return this.quantity*this.getFaceValueAmount()},t.prototype.getDate=function(){return this.date},t.prototype.getRawDate=function(){return this.rawDate},t.prototype.getSeats=function(){return this.seats},t.prototype.getProductDetails=function(){return N(this,void 0,void 0,function(){return U(this,function(t){return this.isTicket()?(this.productDetails||(this.productDetails=this.repository.getShowDetails(this.getProductId())),[2,this.productDetails]):[2,null]})})},t.prototype.getImages=function(){return this.repository.getImages(c.Products,this.getProductId())},t.prototype.getVenueId=function(){return this.venueId},t.prototype.isTicket=function(){return!this.isFlexiticket()&&!this.isPostage()},t.prototype.isUKShow=function(){return N(this,void 0,void 0,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.getCountryCode()];case 1:return[2,t.sent()===s.UK]}})})},t.prototype.isUSShow=function(){return N(this,void 0,void 0,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.getCountryCode()];case 1:return[2,t.sent()===s.USA]}})})},t.prototype.getCountryCode=function(){return N(this,void 0,void 0,function(){var t;return U(this,function(e){switch(e.label){case 0:return this.isVoucher()?[2,s.UK]:[4,this.getProductDetails()];case 1:return[2,(t=e.sent())?t.getVenue().address.country.isoCode:""]}})})},t}(),L=function(){function t(t){this.items=[],this.items=t.map(function(t){return new V(t)})}return t.prototype.getItems=function(){return this.items.slice()},t.prototype.hasVoucher=function(){return this.items.some(function(t){return t.isVoucher()})},t.prototype.hasPostage=function(){return this.items.some(function(t){return t.isPostage()})},t.prototype.hasFlexiticket=function(){return this.items.some(function(t){return t.isFlexiticket()})},t.prototype.hasShow=function(){return this.items.some(function(t){return t.isShow()})},t.prototype.hasAttraction=function(){return this.items.some(function(t){return t.isAttraction()})},t.prototype.getLength=function(){return this.items.filter(function(t){return!t.isFlexiticket()&&!t.isPostage()}).length},t.prototype.getAttractions=function(){return this.items.filter(function(t){return t.isAttraction()})},t.prototype.getFlexitickets=function(){return this.items.filter(function(t){return t.isFlexiticket()})},t.prototype.getPostage=function(){return this.items.find(function(t){return t.isPostage()})},t.prototype.getTickets=function(){return this.items.filter(function(t){return t.isTicket()})},t}(),z=function(){return(z=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},G=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},M=function(){function t(t){this.repository=q.getRepository(),this.basketData=t;var e=this.basketData,n=e.reservations,r=e.expiredAt,o=e.status,i=e.reference,u=e.checksum;this.itemsCollection=new L(n),this.expiredAt=new Date(this.getFormattedDate(r)),this.status=o,this.reference=i,this.checksum=u}return t.prototype.getExpiredDate=function(){var t=new Date(this.expiredAt),e=60*t.getTimezoneOffset()*1e3;return t.setTime(t.getTime()-e),t},t.prototype.getFormattedDate=function(t){return t.replace("+",".")},t.prototype.isExpired=function(){return this.status===i.Expired||this.getExpiredDate()<new Date},t.prototype.isPaid=function(){return this.status===i.Confirmed},t.prototype.isCancelled=function(){return this.status===i.Cancelled},t.prototype.getReference=function(){return this.reference},t.prototype.getChecksum=function(){return this.checksum},t.prototype.getItemsCollection=function(){return this.itemsCollection},t.prototype.setShopperCurrency=function(t){this.basketData.shopperCurrency=t},t.prototype.getShopperCurrency=function(){return this.basketData.shopperCurrency},t.prototype.setChosenDelivery=function(t){this.basketData.delivery=t},t.prototype.setDeliveries=function(t){this.deliveries=t},t.prototype.getDeliveries=function(){return _(this,void 0,void 0,function(){return G(this,function(t){return this.deliveries||(this.deliveries=this.repository.getDeliveries(this.getReference(),this.getItemsCollection())),[2,this.deliveries]})})},t.prototype.isEmpty=function(){return!this.itemsCollection.getLength()},t.prototype.getTotalPrice=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getTotalPrice()})},t.prototype.getTotalDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getDiscount()})},t.prototype.getTotalPromotionDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getPromotionDiscount()})},t.prototype.getTotalPriceBeforeDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getPriceBeforeDiscount()})},t.prototype.hasDiscount=function(){return this.itemsCollection.getItems().some(function(t){return t.hasDiscount()})},t.prototype.getFlexiticketOptions=function(){return this.basketData.allowFlexiTickets},t.prototype.getBasketData=function(){return this.basketData},t.prototype.getUKShows=function(){var t=this;return this.itemsCollection.getTickets().filter(function(e){return _(t,void 0,void 0,function(){return G(this,function(t){switch(t.label){case 0:return[4,e.getCountryCode()];case 1:return[2,t.sent()===s.UK]}})})})},t.prototype.getUSShows=function(){var t=this;return this.itemsCollection.getTickets().filter(function(e){return _(t,void 0,void 0,function(){return G(this,function(t){switch(t.label){case 0:return[4,e.getCountryCode()];case 1:return[2,t.sent()===s.USA]}})})})},t.prototype.isMixedBasket=function(){return this.basketData.mixed},t.prototype.getAppliedPromotion=function(){return this.basketData.appliedPromotion},t.prototype.getMissedPromotion=function(){return this.basketData.missedPromotions},t.prototype.getCouponForPromotion=function(){return this.basketData.coupon},t.prototype.hasCouponForPromotion=function(){return!!this.getCouponForPromotion()},t.prototype.hasAppliedPromotion=function(){return!!this.getAppliedPromotion()},t.prototype.getPromotionCode=function(){return this.basketData.coupon?this.basketData.coupon.code:null},t.prototype.setChannelId=function(t){this.basketData.channelId=t},t.prototype.prepareBasketData=function(){var t=this.basketData.reservations,e=new L(t).getItems().filter(function(t){return t.isTicket()});return z({},this.basketData,{reservations:this.prepareBasketReservation(e)})},t.prototype.prepareBasketReservation=function(t){return t.map(function(t){var e=t.getSeats().map(function(t){return{aggregateReference:t.aggregateReference}});return{venueId:t.getVenueId(),productId:t.getProductId(),date:t.getRawDate(),quantity:t.getQuantity(),items:e}})},t.prototype.getCountyCodes=function(){return _(this,void 0,void 0,function(){var t,e=this;return G(this,function(n){return t=this.itemsCollection.getItems().map(function(t){return _(e,void 0,void 0,function(){return G(this,function(e){return t.isFlexiticket()||t.isVoucher()||t.isPostage()?[2,s.UK]:[2,t.getCountryCode()]})})}),[2,Promise.all(t)]})})},t.prototype.reduceBasketItemsAmount=function(t){return this.itemsCollection.getItems().reduce(t,0)},t}(),H=((P={})[o.Collection]={name:"Collect at the Box Office",voucherName:"Free postal delivery",attractionName:"Print at home voucher"},P[o.Postage]={name:"By Post – UK Addresses only"},P[o.Eticket]={name:"Print at Home"},P[o.Evoucher]={name:"Print at Home"},P),K=function(){function t(t,e){var n=t.method,r=t.charge;this.amount=r,this.method=n,this.setName(e)}return t.prototype.getAmount=function(){return this.amount},t.prototype.getMethod=function(){return this.method},t.prototype.getName=function(){return this.name},t.prototype.setName=function(t){this.name=this.method===o.Collection?this.getCollectionDeliveryName(t):H[this.method].name},t.prototype.getCollectionDeliveryName=function(t){var e=H[o.Collection];return t.hasVoucher()?e.voucherName:t.hasAttraction()?e.attractionName:e.name},t}(),X=function(){return(X=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Q=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},J=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},$=function(t){var e=k(t);q.setEnvironment(t);return{getBasket:function(t){return Q(void 0,void 0,void 0,function(){var n;return J(this,function(r){switch(r.label){case 0:return[4,e.getBasket(t)];case 1:return n=r.sent(),[2,new M(n)]}})})},createBasket:function(t){return Q(void 0,void 0,void 0,function(){var n;return J(this,function(r){switch(r.label){case 0:return[4,e.upsertBasket(t)];case 1:return n=r.sent(),[2,new M(n)]}})})},getDeliveries:function(t,n){return Q(void 0,void 0,void 0,function(){return J(this,function(r){switch(r.label){case 0:return[4,e.getDeliveries(t)];case 1:return[2,r.sent().map(function(t){return new K(t,n)})]}})})},setSelectedDelivery:function(t,n){return Q(void 0,void 0,void 0,function(){var r,o,i;return J(this,function(u){switch(u.label){case 0:return r=t.getItemsCollection(),(o=t.getBasketData()).delivery=n,o.hasFlexiTickets=r.hasFlexiticket(),o=X({},o,t.prepareBasketData()),[4,e.upsertBasket(o)];case 1:return i=u.sent(),[2,new M(i)]}})})},addItems:function(t,n){return Q(void 0,void 0,void 0,function(){var r,o;return J(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).reservations=r.reservations.concat(n),r=X({},r,t.prepareBasketData()),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})},removeItem:function(t,n){return Q(void 0,void 0,void 0,function(){var r;return J(this,function(o){switch(o.label){case 0:return[4,e.deleteItem(t,n)];case 1:return r=o.sent(),[2,new M(r)]}})})},addPromoCode:function(t,n){return Q(void 0,void 0,void 0,function(){var r,o,i;return J(this,function(u){switch(u.label){case 0:return r=t.getItemsCollection(),(o=t.getBasketData()).coupon={code:n},o.hasFlexiTickets=r.hasFlexiticket(),o=X({},o,t.prepareBasketData()),[4,e.upsertBasket(o)];case 1:return i=u.sent(),[2,new M(i)]}})})},removePromoCode:function(t){return Q(void 0,void 0,void 0,function(){var n,r,o;return J(this,function(i){switch(i.label){case 0:return n=t.getItemsCollection(),(r=t.getBasketData()).coupon=null,r.hasFlexiTickets=n.hasFlexiticket(),r=X({},r,t.prepareBasketData()),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})},setFlexiTicket:function(t,n){return Q(void 0,void 0,void 0,function(){var r,o;return J(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).hasFlexiTickets=n,r=X({},r,t.prepareBasketData()),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})}}};!function(t){t.Negative="negative",t.Positive="positive",t.Neutral="neutral"}(C||(C={}));var W=((D={})[r.Dev]="https://venue-service.devtixuk.io/api/v2",D[r.Qa]="https://venue-service.qatixuk.io/api/v2",D[r.Staging]="https://venue-service.stagingtixuk.io/api/v2",D[r.Prod]="https://venue-service.tixuk.io/api/v2",D),Y=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},Z=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},tt=function(t){var e=y(W[t]);return{getSeatAttributes:function(t){return Y(void 0,void 0,void 0,function(){return Z(this,function(n){switch(n.label){case 0:return[4,e.get("/venues/"+t+"/seats/attributes")];case 1:return[2,n.sent().data]}})})}}},et=function(){function t(t){this.seats=t}return t.prototype.getSeats=function(){return this.seats},t.prototype.getBlockName=function(){var t=this.seats[0];return t?t.area:""},t}(),nt=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},rt=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ot=function(t){var e=tt(t);return{getSeats:function(t){return nt(void 0,void 0,void 0,function(){var n;return rt(this,function(r){switch(r.label){case 0:return[4,e.getSeatAttributes(t)];case 1:return n=r.sent(),[2,new et(n)]}})})}}};n.d(e,"Environment",function(){return r}),n.d(e,"getBasketApi",function(){return k}),n.d(e,"getBasketRepository",function(){return $}),n.d(e,"DeliveryMethod",function(){return o}),n.d(e,"BasketStatus",function(){return i}),n.d(e,"ProductType",function(){return u}),n.d(e,"BasketLocationType",function(){return s}),n.d(e,"Basket",function(){return M}),n.d(e,"Delivery",function(){return K}),n.d(e,"BasketItemsCollection",function(){return L}),n.d(e,"BasketItem",function(){return V}),n.d(e,"getContentServiceRepository",function(){return O}),n.d(e,"getContentServiceApi",function(){return E}),n.d(e,"Product",function(){return j}),n.d(e,"EntityType",function(){return c}),n.d(e,"ImageOrientation",function(){return f}),n.d(e,"getVenueApi",function(){return tt}),n.d(e,"getVenueRepository",function(){return ot}),n.d(e,"SeatsCollection",function(){return et})}])}); | ||
t.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},function(t,e,n){"use strict";var r=n(1),o=n(0),i=n(19),u=n(20);function s(t){this.defaults=t,this.interceptors={request:new i,response:new i}}s.prototype.request=function(t){"string"==typeof t&&(t=o.merge({url:arguments[0]},arguments[1])),(t=o.merge(r,{method:"get"},this.defaults,t)).method=t.method.toLowerCase();var e=[u,void 0],n=Promise.resolve(t);for(this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});e.length;)n=n.then(e.shift(),e.shift());return n},o.forEach(["delete","get","head","options"],function(t){s.prototype[t]=function(e,n){return this.request(o.merge(n||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){s.prototype[t]=function(e,n,r){return this.request(o.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=s},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e){r.forEach(t,function(n,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=n,delete t[r])})}},function(t,e,n){"use strict";var r=n(4);t.exports=function(t,e,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t}},function(t,e,n){"use strict";var r=n(0);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var u=[];r.forEach(e,function(t,e){null!==t&&void 0!==t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),u.push(o(e)+"="+o(t))}))}),i=u.join("&")}return i&&(t+=(-1===t.indexOf("?")?"?":"&")+i),t}},function(t,e,n){"use strict";var r=n(0),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,u={};return t?(r.forEach(t.split("\n"),function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(u[e]&&o.indexOf(e)>=0)return;u[e]="set-cookie"===e?(u[e]?u[e]:[]).concat([n]):u[e]?u[e]+", "+n:n}}),u):u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return!0}},function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(){this.message="String contains an invalid character"}o.prototype=new Error,o.prototype.code=5,o.prototype.name="InvalidCharacterError",t.exports=function(t){for(var e,n,i=String(t),u="",s=0,a=r;i.charAt(0|s)||(a="=",s%1);u+=a.charAt(63&e>>8-s%1*8)){if((n=i.charCodeAt(s+=.75))>255)throw new o;e=e<<8|n}return u}},function(t,e,n){"use strict";var r=n(0);t.exports=r.isStandardBrowserEnv()?{write:function(t,e,n,o,i,u){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===u&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,n){"use strict";var r=n(0);function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},function(t,e,n){"use strict";var r=n(0),o=n(21),i=n(5),u=n(1),s=n(22),a=n(23);function c(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return c(t),t.baseURL&&!s(t.url)&&(t.url=a(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]}),(t.adapter||u.adapter)(t).then(function(e){return c(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(c(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},function(t,e,n){"use strict";var r=n(0);t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,n){"use strict";var r=n(6);function o(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t;return{token:new o(function(e){t=e}),cancel:t}},t.exports=o},function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,n){"use strict";var r,o,i,u,s;n.r(e),function(t){t.Dev="dev",t.Qa="qa",t.Staging="staging",t.Prod="prod"}(r||(r={})),function(t){t.Collection="collection",t.Postage="postage",t.Eticket="eticket",t.Evoucher="evoucher"}(o||(o={})),function(t){t.Active="active",t.Expired="expired",t.Confirmed="confirmed",t.Cancelled="cancelled"}(i||(i={})),function(t){t.Show="SHW",t.Attraction="ATT",t.Flexitickets="FLX",t.GiftVoucher="GVC",t.Postage="PST"}(u||(u={})),function(t){t.USA="USA",t.UK="GBR",t.Mixed="Mixed"}(s||(s={}));var a,c,f,p,l=n(7),h=n.n(l),d=function(){return(d=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},y=function(t){var e={baseURL:t},n=h.a.create(e);return n.interceptors.response.use(v,g),n},v=function(t){var e=t.data;return e?d({},t,{data:e.response}):t},g=function(t){var e=t.response;return e?e.data.context.errors:[]},m=((a={})[r.Dev]="https://basket-service.devtixuk.io/api/v1",a[r.Qa]="https://basket-service.qatixuk.io/api/v1",a[r.Staging]="https://basket-service.stagingtixuk.io/api/v1",a[r.Prod]="https://basket-service.tixuk.io/api/v1",a),w=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},b=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},k=function(t){var e=y(m[t]);return{upsertBasket:function(t){return w(void 0,void 0,void 0,function(){var n,r,o,i,u,s,a;return b(this,function(c){switch(c.label){case 0:return n=t.channelId,r=t.coupon,o=t.delivery,i=t.reference,u=t.reservations,s=t.shopperCurrency,a=t.hasFlexiTickets,[4,e.patch("/baskets",{channelId:n,coupon:r,delivery:o,reference:i,reservations:u,shopperCurrency:s,hasFlexiTickets:a})];case 1:return[2,c.sent().data]}})})},getBasket:function(t){return w(void 0,void 0,void 0,function(){var n;return b(this,function(r){switch(r.label){case 0:return n="/baskets/"+t,[4,e.get(n)];case 1:return[2,r.sent().data]}})})},getDeliveries:function(t){return w(void 0,void 0,void 0,function(){var n;return b(this,function(r){switch(r.label){case 0:return n="/baskets/"+t+"/deliveryOptions",[4,e.get(n)];case 1:return[2,r.sent().data.results]}})})},deleteItem:function(t,n){return w(void 0,void 0,void 0,function(){var r;return b(this,function(o){switch(o.label){case 0:return r="/baskets/"+t+"/reservations/"+n,[4,e.delete(r)];case 1:return[2,o.sent().data]}})})}}};!function(t){t.Products="products"}(c||(c={})),function(t){t.Square="square",t.Landscape="landscape",t.Portrait="portrait",t.Default="default"}(f||(f={}));var x,S,P,C,D,A=((p={})[r.Dev]={api:"https://content-service.qatixuk.io/api/v1",images:"https://content-service.devtixuk.com/images"},p[r.Qa]={api:"https://content-service.qatixuk.io/api/v1",images:"https://content-service.qatixuk.com/images"},p[r.Staging]={api:"https://content-service.stagingtixuk.io/api/v1",images:"https://content-service.stagingtixuk.com/images"},p[r.Prod]={api:"https://content-service.tixuk.io/api/v1",images:"https://content-service.tixuk.com/images"},p),T=((x={})[f.Default]=[{screenSize:"xxl",imageSize:80},{screenSize:"xl",imageSize:64},{screenSize:"lg",imageSize:48},{screenSize:"md",imageSize:64},{screenSize:"sm",imageSize:64}],x),I=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},B=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},E=function(t){var e=A[t],n=y(e.api);return{getProduct:function(t){return I(void 0,void 0,void 0,function(){var e;return B(this,function(r){switch(r.label){case 0:return e="/products/"+t,[4,n.get(e)];case 1:return[2,r.sent().data]}})})},getImages:function(t,n,r){return void 0===r&&(r=f.Default),T[r].map(function(o){var i=o.screenSize,u=o.imageSize;return{screenSize:i,url:e.images+"/"+t+"/"+n+"/"+r+"?width="+u}})}}},j=function(){function t(t){var e=t.name,n=t.showType,r=t.venue,o=t.id,i=t.showFaceValue;this.name=e,this.type=n,this.venue=r,this.id=o,this.showFaceValue=i}return t.prototype.getName=function(){return this.name},t.prototype.getType=function(){return this.type},t.prototype.getVenue=function(){return this.venue},t.prototype.needShowFaceValue=function(){return this.showFaceValue},t}(),F=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},R=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},O=function(t){var e=E(t),n=e.getImages,r=e.getProduct;return{getProduct:function(t){return F(void 0,void 0,void 0,function(){var e;return R(this,function(n){switch(n.label){case 0:return[4,r(t)];case 1:return e=n.sent(),[2,new j(e)]}})})},getImages:n}},q={setEnvironment:function(t){S=t},getRepository:function(){if(!S)return null;var t=O(S),e=$(S);return{getShowDetails:t.getProduct,getImages:t.getImages,getDeliveries:e.getDeliveries}}},N=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},U=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},V=function(){function t(t){this.repository=q.getRepository();var e=t.id,n=t.quantity,r=t.productId,o=t.productName,i=t.productType,u=t.faceValueInShopperCurrency,s=t.adjustedSalePriceInShopperCurrency,a=t.salePriceInShopperCurrency,c=t.adjustmentAmountInShopperCurrency,f=t.date,p=t.items,l=t.venueId;this.id=e,this.quantity=n,this.productId=r,this.productName=o,this.productType=i,this.faceValueInShopperCurrency=u,this.adjustedSalePriceInShopperCurrency=s,this.salePriceInShopperCurrency=a,this.adjustmentAmountInShopperCurrency=c,this.date=new Date(f),this.rawDate=f,this.seats=p,this.venueId=l}return t.prototype.getId=function(){return this.id},t.prototype.getQuantity=function(){return this.quantity},t.prototype.getProductId=function(){return this.productId},t.prototype.getProductName=function(){return this.productName},t.prototype.isVoucher=function(){return this.productType===u.GiftVoucher},t.prototype.isPostage=function(){return this.productType===u.Postage},t.prototype.isFlexiticket=function(){return this.productType===u.Flexitickets},t.prototype.isShow=function(){return this.productType===u.Show},t.prototype.isAttraction=function(){return this.productType===u.Attraction},t.prototype.getProductType=function(){return this.productType},t.prototype.getFaceValue=function(){return this.faceValueInShopperCurrency},t.prototype.getSalePrice=function(){return this.adjustedSalePriceInShopperCurrency},t.prototype.getOriginalSalePrice=function(){return this.salePriceInShopperCurrency},t.prototype.getAdjustmentAmount=function(){return this.adjustmentAmountInShopperCurrency},t.prototype.getFaceValueAmount=function(){return this.faceValueInShopperCurrency.value},t.prototype.getSalePriceAmount=function(){return this.adjustedSalePriceInShopperCurrency.value},t.prototype.getOriginalSalePriceAmount=function(){return this.salePriceInShopperCurrency.value},t.prototype.hasDiscount=function(){return this.getFaceValueAmount()>this.getOriginalSalePriceAmount()},t.prototype.getPromotionDiscount=function(){return this.adjustmentAmountInShopperCurrency?this.quantity*this.adjustmentAmountInShopperCurrency.value:0},t.prototype.hasPromotionDiscount=function(){return!!this.getPromotionDiscount()},t.prototype.getDiscount=function(){return this.hasDiscount()?this.quantity*(this.getFaceValueAmount()-this.getOriginalSalePriceAmount()):0},t.prototype.getTotalPrice=function(){return this.quantity*this.getSalePriceAmount()},t.prototype.getTotalPriceWithoutPromotion=function(){return this.quantity*this.getOriginalSalePriceAmount()},t.prototype.getPriceBeforeDiscount=function(){return this.quantity*this.getFaceValueAmount()},t.prototype.getDate=function(){return this.date},t.prototype.getRawDate=function(){return this.rawDate},t.prototype.getSeats=function(){return this.seats},t.prototype.getProductDetails=function(){return N(this,void 0,void 0,function(){return U(this,function(t){return this.isTicket()?(this.productDetails||(this.productDetails=this.repository.getShowDetails(this.getProductId())),[2,this.productDetails]):[2,null]})})},t.prototype.getImages=function(){return this.repository.getImages(c.Products,this.getProductId())},t.prototype.getVenueId=function(){return this.venueId},t.prototype.isTicket=function(){return!this.isFlexiticket()&&!this.isPostage()},t.prototype.isUKShow=function(){return N(this,void 0,void 0,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.getCountryCode()];case 1:return[2,t.sent()===s.UK]}})})},t.prototype.isUSShow=function(){return N(this,void 0,void 0,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.getCountryCode()];case 1:return[2,t.sent()===s.USA]}})})},t.prototype.getCountryCode=function(){return N(this,void 0,void 0,function(){var t;return U(this,function(e){switch(e.label){case 0:return this.isVoucher()?[2,s.UK]:[4,this.getProductDetails()];case 1:return[2,(t=e.sent())?t.getVenue().address.country.isoCode:""]}})})},t}(),L=function(){function t(t){this.items=[],this.items=t.map(function(t){return new V(t)})}return t.prototype.getItems=function(){return this.items.slice()},t.prototype.hasVoucher=function(){return this.items.some(function(t){return t.isVoucher()})},t.prototype.hasPostage=function(){return this.items.some(function(t){return t.isPostage()})},t.prototype.hasFlexiticket=function(){return this.items.some(function(t){return t.isFlexiticket()})},t.prototype.hasShow=function(){return this.items.some(function(t){return t.isShow()})},t.prototype.hasAttraction=function(){return this.items.some(function(t){return t.isAttraction()})},t.prototype.getLength=function(){return this.items.filter(function(t){return!t.isFlexiticket()&&!t.isPostage()}).length},t.prototype.getAttractions=function(){return this.items.filter(function(t){return t.isAttraction()})},t.prototype.getFlexitickets=function(){return this.items.filter(function(t){return t.isFlexiticket()})},t.prototype.getPostage=function(){return this.items.find(function(t){return t.isPostage()})},t.prototype.getTickets=function(){return this.items.filter(function(t){return t.isTicket()})},t}(),z=function(){return(z=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},_=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},G=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},M=function(){function t(t){this.repository=q.getRepository(),this.basketData=t;var e=this.basketData,n=e.reservations,r=e.expiredAt,o=e.status,i=e.reference,u=e.checksum;this.itemsCollection=new L(n),this.expiredAt=new Date(this.getFormattedDate(r)),this.status=o,this.reference=i,this.checksum=u}return t.prototype.getExpiredDate=function(){var t=new Date(this.expiredAt),e=60*t.getTimezoneOffset()*1e3;return t.setTime(t.getTime()-e),t},t.prototype.getFormattedDate=function(t){return t.replace("+",".")},t.prototype.isExpired=function(){return this.status===i.Expired||this.getExpiredDate()<new Date},t.prototype.isPaid=function(){return this.status===i.Confirmed},t.prototype.isCancelled=function(){return this.status===i.Cancelled},t.prototype.getReference=function(){return this.reference},t.prototype.getChecksum=function(){return this.checksum},t.prototype.getItemsCollection=function(){return this.itemsCollection},t.prototype.setShopperCurrency=function(t){this.basketData.shopperCurrency=t},t.prototype.getShopperCurrency=function(){return this.basketData.shopperCurrency},t.prototype.setChosenDelivery=function(t){this.basketData.delivery=t},t.prototype.setDeliveries=function(t){this.deliveries=t},t.prototype.getDeliveries=function(){return _(this,void 0,void 0,function(){return G(this,function(t){return this.deliveries||(this.deliveries=this.repository.getDeliveries(this.getReference(),this.getItemsCollection())),[2,this.deliveries]})})},t.prototype.isEmpty=function(){return!this.itemsCollection.getLength()},t.prototype.getTotalPrice=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getTotalPrice()})},t.prototype.getTotalDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getDiscount()})},t.prototype.getTotalPromotionDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getPromotionDiscount()})},t.prototype.getTotalPriceBeforeDiscount=function(){return this.reduceBasketItemsAmount(function(t,e){return t+e.getPriceBeforeDiscount()})},t.prototype.hasDiscount=function(){return this.itemsCollection.getItems().some(function(t){return t.hasDiscount()})},t.prototype.getFlexiticketOptions=function(){return this.basketData.allowFlexiTickets},t.prototype.getBasketData=function(){return this.basketData},t.prototype.getUKShows=function(){var t=this;return this.itemsCollection.getTickets().filter(function(e){return _(t,void 0,void 0,function(){return G(this,function(t){switch(t.label){case 0:return[4,e.getCountryCode()];case 1:return[2,t.sent()===s.UK]}})})})},t.prototype.getUSShows=function(){var t=this;return this.itemsCollection.getTickets().filter(function(e){return _(t,void 0,void 0,function(){return G(this,function(t){switch(t.label){case 0:return[4,e.getCountryCode()];case 1:return[2,t.sent()===s.USA]}})})})},t.prototype.isMixedBasket=function(){return this.basketData.mixed},t.prototype.getAppliedPromotion=function(){return this.basketData.appliedPromotion},t.prototype.getMissedPromotion=function(){return this.basketData.missedPromotions},t.prototype.getCouponForPromotion=function(){return this.basketData.coupon},t.prototype.hasCouponForPromotion=function(){return!!this.getCouponForPromotion()},t.prototype.hasAppliedPromotion=function(){return!!this.getAppliedPromotion()},t.prototype.getPromotionCode=function(){return this.basketData.coupon?this.basketData.coupon.code:null},t.prototype.setChannelId=function(t){this.basketData.channelId=t},t.prototype.prepareBasketData=function(){var t=this.basketData.reservations,e=new L(t).getItems().filter(function(t){return t.isTicket()});return z({},this.basketData,{reservations:this.prepareBasketReservation(e)})},t.prototype.prepareBasketReservation=function(t){return t.map(function(t){var e=t.getSeats().map(function(t){return{aggregateReference:t.aggregateReference}});return{venueId:t.getVenueId(),productId:t.getProductId(),date:t.getRawDate(),quantity:t.getQuantity(),items:e}})},t.prototype.getCountyCodes=function(){return _(this,void 0,void 0,function(){var t,e=this;return G(this,function(n){return t=this.itemsCollection.getItems().map(function(t){return _(e,void 0,void 0,function(){return G(this,function(e){return t.isFlexiticket()||t.isVoucher()||t.isPostage()?[2,s.UK]:[2,t.getCountryCode()]})})}),[2,Promise.all(t)]})})},t.prototype.reduceBasketItemsAmount=function(t){return this.itemsCollection.getItems().reduce(t,0)},t}(),H=((P={})[o.Collection]={name:"Collect at the Box Office",voucherName:"Free postal delivery",attractionName:"Print at home voucher"},P[o.Postage]={name:"By Post – UK Addresses only"},P[o.Eticket]={name:"Print at Home"},P[o.Evoucher]={name:"Print at Home E-Voucher"},P),K=function(){function t(t,e){var n=t.method,r=t.charge;this.amount=r,this.method=n,this.setName(e)}return t.prototype.getAmount=function(){return this.amount},t.prototype.getMethod=function(){return this.method},t.prototype.getName=function(){return this.name},t.prototype.setName=function(t){this.name=this.method===o.Collection?this.getCollectionDeliveryName(t):H[this.method].name},t.prototype.getCollectionDeliveryName=function(t){var e=H[o.Collection];return t.hasVoucher()?e.voucherName:t.hasAttraction()?e.attractionName:e.name},t}(),X=function(){return(X=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},Q=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},J=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},$=function(t){var e=k(t);q.setEnvironment(t);return{getBasket:function(t){return Q(void 0,void 0,void 0,function(){var n;return J(this,function(r){switch(r.label){case 0:return[4,e.getBasket(t)];case 1:return n=r.sent(),[2,new M(n)]}})})},createBasket:function(t){return Q(void 0,void 0,void 0,function(){var n;return J(this,function(r){switch(r.label){case 0:return[4,e.upsertBasket(t)];case 1:return n=r.sent(),[2,new M(n)]}})})},getDeliveries:function(t,n){return Q(void 0,void 0,void 0,function(){return J(this,function(r){switch(r.label){case 0:return[4,e.getDeliveries(t)];case 1:return[2,r.sent().map(function(t){return new K(t,n)})]}})})},setSelectedDelivery:function(t,n){return Q(void 0,void 0,void 0,function(){var r,o,i;return J(this,function(u){switch(u.label){case 0:return r=t.getItemsCollection(),(o=t.getBasketData()).delivery=n,o.hasFlexiTickets=r.hasFlexiticket(),o=X({},o,t.prepareBasketData()),[4,e.upsertBasket(o)];case 1:return i=u.sent(),[2,new M(i)]}})})},addItems:function(t,n){return Q(void 0,void 0,void 0,function(){var r,o;return J(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).reservations=r.reservations.concat(n),r=X({},r,t.prepareBasketData()),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})},removeItem:function(t,n){return Q(void 0,void 0,void 0,function(){var r;return J(this,function(o){switch(o.label){case 0:return[4,e.deleteItem(t,n)];case 1:return r=o.sent(),[2,new M(r)]}})})},addPromoCode:function(t,n){return Q(void 0,void 0,void 0,function(){var r,o,i;return J(this,function(u){switch(u.label){case 0:return r=t.getItemsCollection(),(o=t.getBasketData()).coupon={code:n},o.hasFlexiTickets=r.hasFlexiticket(),o=X({},o,t.prepareBasketData()),[4,e.upsertBasket(o)];case 1:return i=u.sent(),[2,new M(i)]}})})},removePromoCode:function(t){return Q(void 0,void 0,void 0,function(){var n,r,o;return J(this,function(i){switch(i.label){case 0:return n=t.getItemsCollection(),(r=t.getBasketData()).coupon=null,r.hasFlexiTickets=n.hasFlexiticket(),r=X({},r,t.prepareBasketData()),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})},setFlexiTicket:function(t,n){return Q(void 0,void 0,void 0,function(){var r,o;return J(this,function(i){switch(i.label){case 0:return(r=t.getBasketData()).hasFlexiTickets=n,r=X({},r,t.prepareBasketData()),[4,e.upsertBasket(r)];case 1:return o=i.sent(),[2,new M(o)]}})})}}};!function(t){t.Negative="negative",t.Positive="positive",t.Neutral="neutral"}(C||(C={}));var W=((D={})[r.Dev]="https://venue-service.devtixuk.io/api/v2",D[r.Qa]="https://venue-service.qatixuk.io/api/v2",D[r.Staging]="https://venue-service.stagingtixuk.io/api/v2",D[r.Prod]="https://venue-service.tixuk.io/api/v2",D),Y=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},Z=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},tt=function(t){var e=y(W[t]);return{getSeatAttributes:function(t){return Y(void 0,void 0,void 0,function(){return Z(this,function(n){switch(n.label){case 0:return[4,e.get("/venues/"+t+"/seats/attributes")];case 1:return[2,n.sent().data]}})})}}},et=function(){function t(t){this.seats=t}return t.prototype.getSeats=function(){return this.seats},t.prototype.getBlockName=function(){var t=this.seats[0];return t?t.area:""},t}(),nt=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function u(t){try{a(r.next(t))}catch(t){i(t)}}function s(t){try{a(r.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(u,s)}a((r=r.apply(t,e||[])).next())})},rt=function(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ot=function(t){var e=tt(t);return{getSeats:function(t){return nt(void 0,void 0,void 0,function(){var n;return rt(this,function(r){switch(r.label){case 0:return[4,e.getSeatAttributes(t)];case 1:return n=r.sent(),[2,new et(n)]}})})}}};n.d(e,"Environment",function(){return r}),n.d(e,"getBasketApi",function(){return k}),n.d(e,"getBasketRepository",function(){return $}),n.d(e,"DeliveryMethod",function(){return o}),n.d(e,"BasketStatus",function(){return i}),n.d(e,"ProductType",function(){return u}),n.d(e,"BasketLocationType",function(){return s}),n.d(e,"Basket",function(){return M}),n.d(e,"Delivery",function(){return K}),n.d(e,"BasketItemsCollection",function(){return L}),n.d(e,"BasketItem",function(){return V}),n.d(e,"getContentServiceRepository",function(){return O}),n.d(e,"getContentServiceApi",function(){return E}),n.d(e,"Product",function(){return j}),n.d(e,"EntityType",function(){return c}),n.d(e,"ImageOrientation",function(){return f}),n.d(e,"getVenueApi",function(){return tt}),n.d(e,"getVenueRepository",function(){return ot}),n.d(e,"SeatsCollection",function(){return et})}])}); |
{ | ||
"name": "encore-api-services", | ||
"version": "2.0.11", | ||
"version": "2.0.12", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
62132