{"version":3,"sources":["app.js","polyfill.js","controller/contact.js","controller/print.js","controller/root.js","filters/distance.js","filters/floor.js","filters/money.js","filters/percent.js","filters/reverse.js","filters/trustedHtml.js","directives/app-banner.js","directives/auto-size-img.js","directives/cart-item-preview.js","directives/categories.js","directives/client-nav-menu.js","directives/editable-input.js","directives/elastic.js","directives/image-preview.js","directives/loader.js","directives/map.js","directives/modal-crop.js","directives/modal-frame-flow.js","directives/modal-image.js","directives/pagination.js","directives/stripe-card.js","directives/template-preview.js","models/address.js","models/api.js","models/apiv2.js","models/base-model.js","models/image.js","models/line-item.js","models/location.js","models/order.js","models/price.js","models/print-service.js","models/product-image.js","models/product-tag.js","models/product.js","models/store.js","services/browser.js","services/cart-image-data.js","services/cart-image.js","services/cart-line-item-page.js","services/cart-line-item.js","services/cart-promo-product-image.js","services/cart-reorder-image.js","services/cart.js","services/config.js","services/crop-helpers.js","services/crop-rect-pos.js","services/debouncer.js","services/exception.js","services/fit-text.js","services/frame-helpers.js","services/gtm.js","services/image-uploader.js","services/locale.js","services/log.js","services/login.js","services/query.js","services/svg.js","services/thumbnailer.js","services/unique.js","services/us-states.js","services/utils.js"],"names":["window","app","angular","module","$window","$q","Promise","$delegate","onUrlChange","$provide","decorator","url","config","$compileProvider","TRANSPARENT_PIXEL","CONFIG","debug","selector","$","adjustCartSize","floor","parent","width","on","evt","preventDefault","href","currentTarget","find","attr","location","String","prototype","startsWith","searchString","position","controller","$scope","name","emailAddress","message","api","log","submitContact","printicular","clientName","contactLoading","data","$event","contactSuccess","contactError","contactMessage","then","response","mapErrors","cart","$rootScope","$interpolate","$sce","$timeout","CartLineItem","gtm","query","deliveryCountry","thanks","orderNumber","get","territories","filter","territory","locale","defaultDeliveryCountry","code","attributes","country_code","addressCountry","deliveryCountries","length","_iteratorNormalCompletion","_didIteratorError","_iteratorError","undefined","_step","_iterator","Symbol","iterator","next","done","value","err","defaultCountry","id","addressTerritoryId","files","displayUploadZone","$watch","verbose","uploadErrors","i","image","push","event","count","duplicateLineItem","lineItem","index","duplicate","product","settings","splice","extend","checkWaitingUpload","updateSummary","currencyCode","getCurrency","purchase","order","getOrderJson","token","actionField","toString","revenue","total","affiliation","placingOrder","shipping","summary","totalUnready","included","type","lineItems","cartLineItem","lineItemKey","product_id","variant","gaProducts","gaProcessOrder","fulfillment","deliveryProducts","store","products","category","category_name","price","unit_price","brand","retailer_id","quantity","_loop","transactionData","tax_total","freight_total","Object","values","orderId","orderValue","Math","round","coupon","couponCode","errors","join","totalPrice","sendOrder","waitingUpload","paymentComplete","onbeforeunload","createToken","result","error","errorMessage","placeOrder","content","key","trustAsHtml","reload","applyCoupon","couponErrors","totalDiscount","shippingDiscount","dryRunErrors","updateCustomer","abTest","browser","lat","lon","login","PrintService","time","US_STATES","cookie","match","showPromo","abSource","promises","productTags","storageSet","hasOwnProperty","printService","e","lang","LANG","Date","getTime","printServices","promo","enabled","from","to","promoContent","banner","concat","tags","findById","setPickupProducts","pickUpPrintServices","deliveryPrintService","setDeliveryProducts","all","$broadcast","reorder","this","open","document","keyCode","$apply","showImageModal","canEnlarge","modalImage","cropLineItem","canCrop","modalCrop","modalFrameFlow","_ref","$on","closeModal","setTimeout","offset","top","animate","scrollTop","gotoNext","nextSection","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","element","is","target","gotoPrevious","_iteratorNormalCompletion3","_didIteratorError3","_iteratorError3","_step3","_iterator3","previousSection","territory_id","amount","meta","distance","currencySymbols","EUR","CRC","GBP","ILS","INR","JPY","KRW","NGN","PHP","PLN","PYG","THB","UAH","VND","ZAR","BRL","currency","currencySymbol","toFixed","showCurrencySuffix","percent","items","slice","reverse","html","directive","template","link","scope","$templateCache","isMobile","isIos","isAndroid","android","disableAppleAppStoreMobileBanner","visible","brandName","appleAppStoreUrl","disableGooglePlayMobileBanner","googlePlayUrl","dismiss","install","restrict","resize","squareImageAutoCrop","getPrintServiceSettings","thumbnail","height","getProductSize","imageRatio","cropOrientation","productSize","productRatio","size","maxHeight","getPreviewHtml","$digest","previewImage","first","el","previewSvg","metaData","frame","getSrc","frameHelpers","render","cropHelpers","file","change","categories","cleanCategoryName","queryCategory","categoryName","queryCategoryName","selected","split","toggleCategory","replace","submit","loading","uid","Unique","inc","state","email","storageGet","apiv2","post","password","deviceId","deviceToken","loginToken","logout","model","editing","required","inputId","random","substr","style","initialHeight","rows","max","pElastic","thumbnailer","canvas","context","getContext","drawImageCover","Debouncer","MARKER_WIDTH","MARKER_HEIGHT","markers","bounds","infoWindow","minZoom","maxZoom","onBoundsChanged","onClickMarker","parseInt","boundsChangeEventDebouncer","maps","boundsChangeExternalDebouncer","google","lng","zoom","markerQueue","markerQueueInterval","processMarkerQueue","clearInterval","_markerQueue$pop","pop","latitude","longitude","iconUrl","Marker","LatLng","icon","getScaledIcon","map","getZoom","markerId","addListener","marker","InfoWindow","scale","scaledSize","Size","origin","Point","anchor","zoomToBox","latitude1","longitude1","latitude2","longitude2","LatLngBounds","points","point","getBounds","contains","getPosition","setVisible","keys","newMarkers","newMarker","setInterval","trigger","apply","_toConsumableArray","setZoom","zoomToFitPoints","fitBounds","setCenter","addMarker","setContent","close","svg","view","isCloseTo","x","y","resizing","movingOffset","cropRectPos","cropRect","aspect","cropRectDebug","cropRectGrid","cropOverlay","cropRectTl","cropRectTr","cropRectBl","cropRectBr","updateCropRect","transformEventPos","draggableRegion","getDraggableRegion","show","getAspectRect","css","transform","floatX","createSVGPoint","originalEvent","touches","fixedX","fixedY","clientY","floatY","matrixTransform","getScreenCTM","inverse","x1","y1","x2","y2","smallestSide","sqrt","pointDistance","endDrag","buttons","which","moving","closest","pointOffset","offsetY","hide","rotation","offsetX","src","productWidth","productHeight","cropWidth","cropHeight","rotate","processedSvg","removeAttr","resetPosition","arguments","remove","append","viewBox","togglePortrait","orientation","updateImage","toggleLandscape","transformOrigin","CropRectPos","ratio","clone","modal","frames","FRAME_FLOW_MODAL","mouseDown","mouseX","mouseY","wrapper","applyImageUpdates","transformBox","getMousePosition","pageX","pageY","CTM","a","f","d","showProductsDraw","getCurrentFrame","rotateFrame","defaults","reset","extractPhotoSvg","selectProduct","setProduct","isPortrait","addImage","getFrames","setImage","setImageUrl","load","getProducts","getAttribute","productImages","img","getPhotoDefaults","button","getAvailableProducts","_getMousePosition","addFile","resized","totalItems","itemsPerPage","scrollTo","page","pages","offsetTop","min","startPage","lastPage","endPage","ceil","updatePages","prevPage","gotoPage","pageNumber","nextPage","stripe","elements","card","create","hidePostalCode","Stripe","language","fontFamily","fontSmoothing","base","color","fontSize","::placeholder","invalid","iconColor","mount","samplePhoto","addClass","svgImage","each","box","appendTo","factory","BaseModel","_BaseModel","Address","_classCallCheck","_possibleConstructorReturn","_getPrototypeOf","_inherits","_createClass","relationships","_get","call","$http","exception","Api","environment","apiUrl","method","_this","resolve","reject","clientId","Authorization","parameters","param","request","results","RegExp","exec","decodeURIComponent","report","majorError","ApiV2","headers","toLowerCase","constructor","toDashCase","relationship","related","createInstance","_this2","Array","isArray","v","isType","_ret","_typeof","modelData","includedData","instance","charAt","Image","Product","LineItem","formatName","findRelated","processedImage","parseFloat","Store","Location","_stores","findAllRelated","Order","address","subtotalDiscount","freight","freightDiscount","Price","_findById","_products","_asyncToGenerator","regeneratorRuntime","mark","_callee","printServiceId","requestOptions","_args","wrap","_context","prev","include","productTag","sent","mapModel","abrupt","stop","_x","ProductImage","meta_data","ProductTag","productTagName","tagName","tag","hasTags","pixel_width","pixel_height","metric","short_description","_prices","_productTags","_productImages","_printServiceSettings","print_service_id","_settings","printServiceSettings","productSettings","autoEnableProducts","minRes","sortOrder","description","_categorySettings","categorySettings","category_id","limit","productId","p","l","_i","_markerIcons","markerIcon","normalizedName","indexOf","storeMarkerIcon","storeAddress1","city","storeCity","postcode","storePostCode","part","productCodes","getPrintServiceProducts","printServiceProduct","product_code","breakpoints","xs","md","lg","validateSize","isIe11","MSInputMethodContext","test","navigator","userAgent","isSafari","isUnsupported","mediaBreakpointUp","innerWidth","mediaBreakpointDown","px","breakpoint","CartImage","_CartImage","CartImageData","upload","started","progress","isCanvas","getWidth","getHeight","CartLineItemPage","templates","alwaysShowLayouts","regions","elementData","input","_ref$product","_ref$quantity","_ref$settings","_previewSvg","getDefaultProduct","maxQuantity","changeQuantity","productName","getImageWidth","getProductMinWidth","getImageHeight","getProductMinHeight","threshold","productAspectRatio","abs","imageAspectRatio","canEdit","getImageId","openModal","isErrored","isReady","lineItemJson","vertical","duplicateImage","image_ids","image_id","prices","flow","getStoreProducts","defaultExistingProduct","set","CartReorderImage","thumbnailUrl","imageId","imageUploader","Locale","updatingPrices","updateSummaryDebounce","validations","Cart","images","pickupProducts","phone","enableSms","addressLine1","addressPostCode","fireEvent","resetDefaultProducts","storeName","storeId","sortProducts","why","hasNoProducts","confirm","defaultProduct","removeLineItem","sortCallback","collator","Intl","Collator","numeric","sort","aPrice","bPrice","b","aSortAttr","bSortAttr","compare","cancel","timer","updateSummaryBounced","bind","defer","promise","updatingSummary","nextId","totalReady","summaryRow","r","productPrice","totalUploadedPercent","validateLineItem","totalQuantity","validate","resolveUpdateSummary","orderJson","serverSummaryRows","productData","fromJsonApi","serverSummaryRow","freight_discount","vendor_discount","subtotal_discount","lineItemErrors","getMaxTotalQuantity","maxTotalQuantity","maxTotalValue","getMaxTotalValue","categoryCounts","_iteratorNormalCompletion4","_didIteratorError4","_iteratorError4","_step4","_iterator4","productCurrencies","getProductCurrencies","getUserCurrency","userCurrency","retailerId","_iteratorNormalCompletion5","_didIteratorError5","_iteratorError5","_step5","_iterator5","_iteratorNormalCompletion6","_didIteratorError6","_iteratorError6","_step6","currencies","_iterator6","getMaxValueByFulfillmentType","pickupMaxTotalQuantity","deliveryMaxTotalQuantity","pickupMaxTotalValue","deliveryMaxTotalValue","pickupValue","deliveryValue","dryRun","validatePhoneNumber","validateEmail","addressCity","addressRegion","phoneNumber","cleanPhoneNumber","stripeToken","addressJson","auto_confirm","coupon_code","version","stripe_token","enable_sms","print_service","line_items","_this3","storeProduct","_this4","_iteratorNormalCompletion7","_didIteratorError7","_iteratorError7","_step7","_iterator7","_this5","getFileKey","mimeType","_this6","md5","Blob","_iteratorNormalCompletion8","_didIteratorError8","_iteratorError8","_step8","_iterator8","isLowRes","_this7","togglePickup","toggleDelivery","_iteratorNormalCompletion9","_didIteratorError9","_iteratorError9","_step9","checksum","_iterator9","Config","currentVersion","storageVersion","localStorage","localStoragePrefix","removeItem","setItem","getStorageKey","prefix","JSON","stringify","storageKey","item","getItem","parse","console","path","CROP_TEMPLATE","minSize","_class","delay","timeout","callback","HOSTNAME_REGEX","UUID_REGEX","DATETIME_REGEX","ISO_DATETIME_REGEX","DATE_REGEX","TIME_REGEX","ORDER_ID_REGEX","DEVICE_TOKEN_REGEX","SHA1_HASH_REGEX","MD5_HASH_REGEX","BEARER_TOKEN_REGEX","hostname","URL_REGEX","matches","dataLayer","msg","normalise","action","label","FitText","boundingBox","lines","align","maxFontSize","firstChild","removeChild","boundingBoxHeight","minFontSize","node","createElementNS","lineText","setAttribute","nodes","getComputedStyle","getBBox","wrapperBox","fixLineHeight","querySelectorAll","previousBox","coverImageThumbnail","windowHeight","preferOrientation","getOrientation","createFrameSvg","windowCenterX","windowCenterY","windowWidth","windowRatio","imageWidth","imageHeight","Gtm","Upload","ImageUploader","uploads","uploadingCount","s3Resource","gets3Resource","_register","_getHash","_upload2","startUpload","maxUploadCount","shift","_callee2","s3","hash","extension","_context2","startTime","applyExifRotation","t0","handleUploadError","t1","t2","convertedFileName","remoteLink","bucket","AWSAccessKeyId","accessKeyId","policy","signature","acl","Content-Type","filename","success","endTime","register","_x2","loaded","_callee3","_context3","reader","FileReader","onerror","onabort","onloadend","readyState","DONE","_x3","_callee4","imageUrl","_context4","device_token","external_url","_x4","_x5","countryToCurrency","AD","AE","AF","AG","AI","AM","AO","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW","countryCode","logger","Log","_len","messages","_key","_len2","_key2","_len3","details","_key3","title","body","Login","isLoggedIn","parseQueryString","obj","qPos","tokens","s","unescape","search","nodeName","setClipPath","setAttributeNS","clipPath","getViewBox","remember","n","entities","quot","lt","gt","scaron","yuml","circ","tilde","ensp","emsp","thinsp","zwnj","zwj","lrm","rlm","ndash","mdash","lsquo","rsquo","sbquo","ldquo","rdquo","bdquo","dagger","permil","lsaquo","rsaquo","euro","fnof","alpha","beta","gamma","delta","epsilon","zeta","eta","theta","iota","kappa","lambda","mu","nu","xi","omicron","pi","rho","sigma","tau","upsilon","phi","chi","psi","omega","sigmaf","thetasym","upsih","piv","bull","hellip","prime","oline","frasl","weierp","real","trade","alefsym","larr","uarr","rarr","darr","harr","crarr","forall","exist","empty","nabla","isin","notin","ni","prod","sum","minus","lowast","radic","prop","infin","ang","and","or","cap","cup","int","there4","sim","cong","asymp","ne","equiv","le","ge","sub","sup","nsub","sube","supe","oplus","otimes","perp","sdot","lceil","rceil","lfloor","rfloor","rang","loz","spades","clubs","hearts","diams","nbsp","iexcl","cent","pound","curren","yen","brvbar","sect","uml","copy","ordf","laquo","not","shy","reg","macr","deg","plusmn","sup2","sup3","acute","micro","para","middot","cedil","sup1","ordm","raquo","frac14","frac12","frac34","iquest","agrave","aacute","acirc","atilde","auml","aring","aelig","ccedil","egrave","eacute","ecirc","euml","igrave","iacute","icirc","iuml","eth","ntilde","ograve","oacute","ocirc","otilde","ouml","times","oslash","ugrave","uacute","ucirc","uuml","yacute","thorn","szlig","divide","convertHtmlEntitiesToXml","string","entity","entityName","templateSvg","cleanXml","xml","makeDataImageUrl","str","svgString","XMLSerializer","serializeToString","decoded","encodeURIComponent","base64","btoa","Thumbnailer","thumbnails","thumbnailCache","thumbnailingCount","startThumbnailing","readFile","loadImage","ready","errorInfo","onload","readAsDataURL","cx","cy","cw","ch","iw","ih","w","h","nw","nh","ar","drawImage","lastModified","cache","number","seperator","calc","indexOfSmallest","array","cleanString"],"mappings":"aAAAA,OAAOC,IAAMC,QAAQC,OAAO,MAAO,CAC/B,iBAIAC,IAAAA,IAAAA,CAAO,UAAWC,KAAlB,SAAAD,EAAAC,GADJD,EAAAE,QAAAD,KAMQE,IAAAA,OAAAA,CAAAA,WAAUC,SAAcC,GAD5BA,EAASC,UAAU,WAAY,CAAC,YAAa,SAAUH,GAAvD,OAGIA,EAAAC,YAA4B,aAA5BD,EAAAI,IAAA,WACI,MAAO,IAJfJ,QAYHN,IAFDW,OAAA,CAAA,mBAAA,SAAAC,GAIAb,EAAOc,iBAAoBC,OAAAC,UAGPC,OAAAA,kBAAU,iFAG9BC,EAAA,QAAMC,QAAc,CAAAF,SAAdE,4BAAN,IAAMA,eAAiB,WAGrBnB,EAAAA,kBAAemB,MAAjB,G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ACvBqiC,EAAA,SAAAA,EAAA5gC,EAAAsS,GAAA,OAAA,GAAAA,EAAAtS,EAAA4gC,EAAAtuB,EAAAtS,EAAAsS,IAAArT,EAAA2hC,EAAArgD,EAAAgS,GAKC,OAAQhS,EAAQ0e,EAAS0hC,EAAapuC,EAAS0M,GAH/C4hC,gBAFD,SAECC,GAOA,OAAOA,EAAMp1B,QAAQ7iB,KAAKoZ,IAAIjI,MAAMnR,KAAMi4C,KAT3CC,YAAA,SAAAhP,GASC,OAAarmB,EAAAA,QAAQ7iB,iBAAA","file":"../app.min.js","sourcesContent":["window.app = angular.module('app', [\n 'ngFileUpload',\n]);\n\napp.run(['$window', '$q', function ($window, $q) {\n $window.Promise = $q;\n}]);\n\napp.config(['$provide', function ($provide) {\n $provide.decorator('$browser', ['$delegate', function ($delegate) {\n $delegate.onUrlChange = function () {\n };\n $delegate.url = function () {\n return '';\n };\n return $delegate;\n }]);\n}]);\n\napp.config(['$compileProvider', function ($compileProvider) {\n $compileProvider.debugInfoEnabled(CONFIG.debug);\n}]);\n\nwindow.TRANSPARENT_PIXEL = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';\n\n// Global jQuery bindings\n$('body').tooltip({ selector: '[data-toggle=\"tooltip\"]' });\n\n\nconst adjustCartSize = () => {\n $('.p-cart-images').width(Math.floor($('.p-cart-images').parent().width() / 90) * 90);\n};\n$(window).resize(adjustCartSize);\n$(adjustCartSize);\nadjustCartSize();\n\n\n// temporary fix for blogs\n$('.p-blog-list-single').on('click', evt => {\n evt.preventDefault();\n\n const href = $(evt.currentTarget).find('.p-blog-list-single-feature').attr('href');\n\n window.location.href = href;\n});\n","if (!String.prototype.startsWith) {\n String.prototype.startsWith = function (searchString, position) {\n position = position || 0;\n return this.indexOf(searchString, position) === position;\n };\n}\n","app.controller('ContactController', [\n '$scope',\n 'config',\n 'api',\n 'log',\n function (\n $scope,\n config,\n api,\n log,\n ) {\n $scope.contactMessage = {\n app: config.api.printicular.clientName,\n name: '',\n emailAddress: '',\n message: '',\n data: {},\n };\n $scope.submitContact = ($event) => {\n $event.preventDefault();\n $scope.contactLoading = true;\n api.post('contact', {\n data: {\n type: 'contact',\n attributes: $scope.contactMessage,\n },\n }).then(() => {\n $scope.contactLoading = false;\n $scope.contactSuccess = 'Successfully sent contact message.';\n }).catch((response) => {\n $scope.contactLoading = false;\n $scope.contactError = 'Failed to send contact message. ' + log.mapErrors(response);\n });\n };\n },\n]);\n","app.controller('PrintController', [\n '$interpolate',\n '$rootScope',\n '$sce',\n '$scope',\n '$timeout',\n 'api',\n 'cart',\n 'CartLineItem',\n 'config',\n 'gtm',\n 'log',\n 'query',\n function (\n $interpolate,\n $rootScope,\n $sce,\n $scope,\n $timeout,\n api,\n cart,\n CartLineItem,\n config,\n gtm,\n log,\n query,\n ) {\n window.PRINT = $scope;\n\n if (query.thanks) {\n cart.orderNumber = 1;\n }\n\n api.get('territories').then((response) => {\n $rootScope.territories = response.data.filter((territory) => {\n if (config.locale.defaultDeliveryCountry && config.locale.defaultDeliveryCountry.code == territory.attributes.country_code) {\n cart.addressCountry = territory;\n }\n if (!config.locale.deliveryCountries || !config.locale.deliveryCountries.length) {\n return true;\n }\n for (const deliveryCountry of config.locale.deliveryCountries) {\n if (deliveryCountry.code == territory.attributes.country_code) {\n return true;\n }\n }\n return false;\n });\n const defaultCountry = $rootScope.territories.find(territory => territory.id == cart.addressTerritoryId);\n if (defaultCountry) {\n cart.addressCountry = defaultCountry;\n }\n });\n\n\n $scope.files = [];\n $scope.displayUploadZone = false;\n\n $scope.$watch('files', (files) => {\n log.verbose('Added files', files.length);\n $rootScope.uploadErrors = [];\n for (let i = 0; i < files.length; i++) {\n const image = cart.addImage(files[i]);\n cart.addLineItem(new CartLineItem({ cart, image }));\n }\n\n if (files.length) {\n gtm.push({\n event: 'Add files',\n count: files.length,\n });\n }\n });\n\n $scope.duplicateLineItem = (lineItem, index) => {\n const duplicate = new CartLineItem({ cart, image: lineItem.image, product: lineItem.product });\n\n if (lineItem.settings) {\n duplicate.settings = $.extend({}, lineItem.settings);\n }\n\n cart.lineItems.splice(index, 0, duplicate);\n cart.updateSummary();\n };\n\n const checkWaitingUpload = () => {\n if (cart.summary.totalUnready > 0) {\n $timeout(checkWaitingUpload, 300);\n return;\n }\n sendOrder();\n };\n\n const gaProcessOrder = (response) => {\n let gaProducts = {};\n let lineItems = response.included.filter(included => included.type == 'line_items');\n for (let i = 0; i < lineItems.length; i++) {\n const lineItem = lineItems[i];\n const cartLineItem = cart.lineItems[i] || null;\n const lineItemKey = lineItem.attributes.product_id + ':' + (cartLineItem ? cartLineItem.variant : 'none');\n if (!gaProducts[lineItemKey]) {\n let product = null;\n if (cart.fulfillment == 'delivery') {\n product = cart.deliveryProducts.find(product => product.id == lineItem.attributes.product_id);\n } else {\n product = cart.store.products.find(product => product.id == lineItem.attributes.product_id);\n }\n gaProducts[lineItemKey] = {\n id: lineItem.attributes.product_id.toString(),\n name: product ? product.attributes.name : null,\n category: product ? product.attributes.category_name : null,\n variant: cartLineItem ? cartLineItem.variant : null,\n price: lineItem.attributes.unit_price,\n quantity: 0,\n brand: cart.store.attributes.retailer_id,\n };\n }\n gaProducts[lineItemKey].quantity += lineItem.attributes.quantity;\n }\n const transactionData = {\n event: 'purchase',\n ecommerce: {\n currencyCode: cart.getCurrency(),\n purchase: {\n actionField: {\n id: response.data.id.toString(),\n revenue: response.data.attributes.total,\n affiliation: cart.store ? cart.store.attributes.name : 'Delivery',\n tax: response.data.attributes.tax_total,\n shipping: response.data.attributes.freight_total,\n coupon: cart.couponCode,\n },\n products: Object.values(gaProducts),\n },\n },\n };\n log.debug('Ecommerce data', transactionData);\n\n gtm.push(transactionData);\n gtm.push({\n event: 'Submit order',\n fulfillment: cart.store ? cart.store.attributes.name : 'Delivery',\n orderId: response.data.id,\n orderValue: Math.round(response.data.attributes.total * 100),\n });\n };\n\n const paymentComplete = (token) => {\n const order = cart.getOrderJson(false, token);\n api.post('users/0/orders?include=store,lineItems', order).then((response) => {\n window.onbeforeunload = null;\n const orderNumber = response.data.id;\n $scope.placingOrder = false;\n cart.orderNumber = orderNumber;\n $(window).scrollTop(0);\n gaProcessOrder(response);\n }).catch((response) => {\n log.debug('Error placing order', response, log.mapErrors(response));\n $scope.placingOrder = false;\n $scope.errors = log.mapErrors(response);\n gtm.push({\n event: 'Submit order failed',\n errorMessage: $scope.errors.join('\\n'),\n fulfillment: cart.store ? cart.store.attributes.name : 'Delivery',\n orderValue: Math.round(cart.summary.totalPrice * 100),\n });\n });\n };\n\n const sendOrder = () => {\n $scope.waitingUpload = false;\n $scope.errors = cart.validate();\n if ($scope.errors.length > 0) {\n gtm.push({\n event: 'Submit order failed',\n errorMessage: $scope.errors.join('\\n'),\n fulfillment: cart.store ? cart.store.attributes.name : 'Delivery',\n orderValue: Math.round(cart.summary.totalPrice * 100),\n });\n return;\n }\n $scope.placingOrder = true;\n\n if (cart.fulfillment == 'pickup') {\n paymentComplete();\n return;\n }\n\n $rootScope.stripe.createToken($rootScope.card).then((result) => {\n if (result.error) {\n $scope.errors = [result.error.message];\n $scope.placingOrder = false;\n gtm.push({\n event: 'Payment failed',\n errorMessage: result.error.message,\n fulfillment: cart.store ? cart.store.attributes.name : 'Delivery',\n orderValue: Math.round(cart.summary.totalPrice * 100),\n });\n } else {\n paymentComplete(result.token.id);\n }\n $scope.$apply();\n });\n };\n\n $scope.placeOrder = ($event) => {\n $event.preventDefault();\n if (cart.summary.totalUnready > 0) {\n $scope.waitingUpload = true;\n $timeout(checkWaitingUpload, 300);\n return;\n }\n sendOrder();\n };\n\n $scope.content = {};\n $scope.$watch('cart.orderNumber', () => {\n for (const key in config.content) {\n $scope.content[key] = $sce.trustAsHtml($interpolate(config.content[key])($scope));\n }\n });\n\n $scope.reload = () => {\n location.reload();\n };\n\n $scope.coupon = {\n code: null,\n };\n $scope.applyCoupon = () => {\n log.debug('Applying coupon', $scope.coupon.code);\n $scope.couponErrors = [];\n\n if (!$scope.coupon.code) {\n $scope.couponErrors = ['Please enter a coupon code.'];\n return;\n }\n cart.couponCode = $scope.coupon.code;\n cart.updateSummary().then(() => {\n if (!cart.summary.couponCode) {\n cart.couponCode = null;\n $scope.couponErrors = cart.dryRunErrors;\n cart.updateSummary();\n gtm.push({\n event: 'Invalid coupon',\n fulfillment: cart.store ? cart.store.attributes.name : 'Delivery',\n orderValue: Math.round(cart.summary.totalPrice * 100),\n couponCode: cart.couponCode,\n });\n } else {\n gtm.push({\n event: 'Apply coupon',\n totalDiscount: Math.round(cart.summary.totalDiscount + cart.summary.shippingDiscount * 100),\n fulfillment: cart.store ? cart.store.attributes.name : 'Delivery',\n orderValue: Math.round(cart.summary.totalPrice * 100),\n couponCode: cart.couponCode,\n });\n }\n });\n };\n\n $scope.removeCoupon = () => {\n cart.couponCode = null;\n cart.updateSummary();\n };\n\n $scope.updateCustomer = () => {\n if (cart.fulfillment == 'delivery') {\n cart.updateSummary();\n }\n };\n },\n]);\n","app.controller('RootController', [\n '$rootScope',\n '$sce',\n 'browser',\n 'cart',\n 'config',\n 'gtm',\n 'log',\n 'login',\n 'PrintService',\n 'query',\n 'US_STATES',\n function (\n $rootScope,\n $sce,\n browser,\n cart,\n config,\n gtm,\n log,\n login,\n PrintService,\n query,\n US_STATES,\n ) {\n window.ROOT = $rootScope;\n\n $rootScope.US_STATES = US_STATES;\n\n const abSource = document.cookie.match(/X-Source=(.*?)(;|$)/);\n log.debug('AB test', abSource);\n if (abSource) {\n gtm.push({\n abTest: abSource[1],\n });\n }\n\n if (query.store) config.storageSet('store', query.store);\n if (query.hasOwnProperty('lat') || query.hasOwnProperty('lon')) {\n config.storageSet('address', {\n lat: query.lat || 0,\n lon: query.lon || 0,\n });\n }\n\n $rootScope.config = config;\n $rootScope.lang = LANG;\n $rootScope.time = new Date().getTime();\n $rootScope.printServices = {};\n $rootScope.login = login;\n $rootScope.uploadErrors = [];\n $rootScope.browser = browser;\n\n $rootScope.showPromo = config.promo.enabled && $rootScope.time >= config.promo.from && $rootScope.time <= config.promo.to;\n $rootScope.promoContent = $sce.trustAsHtml(config.promo.banner);\n\n const promises = [];\n const productTags = (config.promo.productTags || []).concat(CONFIG.api.printicular.tags || []);\n for (const printService of config.api.printicular.pickUpPrintServices) {\n log.debug('Fetching products for print service', printService.id);\n promises.push(PrintService.findById(printService.id, productTags).then((printService) => {\n $rootScope.printServices[printService.id] = printService;\n cart.setPickupProducts(printService.products, printService.id);\n }).catch((e) => {\n log.error('Could not find pick up products for ' + printService.id, e);\n }));\n }\n if (config.api.printicular.deliveryPrintService.id) {\n log.debug('Fetching products for delivery service', config.api.printicular.deliveryPrintService.id);\n promises.push(PrintService.findById(config.api.printicular.deliveryPrintService.id, productTags).then((printService) => {\n $rootScope.printServices[config.api.printicular.deliveryPrintService.id] = printService;\n cart.setDeliveryProducts(printService.products);\n }).catch((e) => {\n log.error('Could not find delivery products.', e);\n }));\n }\n\n Promise.all(promises).finally(() => {\n $rootScope.$broadcast('loadedProducts');\n if (query.reorder) {\n cart.reorder(query.reorder);\n }\n });\n\n $('body').on('click', 'a', function () {\n const href = $(this).attr('href');\n if (href && href[0] !== '#') {\n if (cart.lineItems.length) {\n window.open(href);\n return false;\n }\n }\n });\n\n $(document).on('keydown', (event) => {\n log.verbose('Key press', event.keyCode);\n switch (event.keyCode) {\n case 27:\n $rootScope.$broadcast('escape');\n break;\n }\n $rootScope.$apply();\n });\n\n $(window).resize(() => {\n $rootScope.$broadcast('resize');\n });\n\n $rootScope.showImageModal = (image) => {\n if (!image.canEnlarge()) {\n return false;\n }\n $rootScope.modalImage = image;\n return true;\n };\n\n $rootScope.cropLineItem = (lineItem) => {\n if (!lineItem.canCrop()) {\n return false;\n }\n $rootScope.modalCrop = lineItem;\n return true;\n };\n\n $rootScope.closeModal = () => {\n $rootScope.modalImage = null;\n $rootScope.modalCrop = null;\n $rootScope.modalFrameFlow = null;\n };\n\n $rootScope.openModal = ({ name, lineItem }) => {\n $rootScope.closeModal();\n $rootScope[name] = lineItem;\n };\n\n $rootScope.$on('escape', () => {\n $rootScope.closeModal();\n });\n\n $rootScope.goto = (id) => {\n setTimeout(() => {\n const offset = $(`#${id}`).offset();\n log.verbose('Goto', id, offset, $(`#${id}`));\n if (offset && offset.top) {\n // Scroll after element becomes visible\n $('html, body').animate({\n scrollTop: offset.top,\n }, 500);\n }\n }, 1);\n };\n\n $rootScope.gotoNext = ($event) => {\n let next = false;\n let nextSection = null;\n for (const element of $('.p-btn-next, .p-next-target')) {\n if (next && $(element).is('.p-next-target') && $(element).is(':visible')) {\n nextSection = element;\n break;\n } else if (element == $event.target) {\n next = true;\n }\n }\n if (nextSection) {\n $('html, body').animate({\n scrollTop: $(nextSection).offset().top,\n }, 500);\n }\n };\n\n $rootScope.gotoPrevious = ($event) => {\n let previousSection = null;\n for (const element of $('.p-btn-next, .p-next-target')) {\n if (element == $event.target) {\n break;\n }\n if ($(element).is('.p-next-target') && $(element).is(':visible')) {\n previousSection = element;\n }\n }\n if (previousSection) {\n $('html, body').animate({\n scrollTop: $(previousSection).offset().top,\n }, 500);\n } else {\n $('html, body').animate({\n scrollTop: 0,\n }, 500);\n }\n };\n },\n]);\n","app.filter('distance', [\n '$rootScope',\n function (\n $rootScope,\n ) {\n return function (store) {\n let territory = $rootScope.territories ? $rootScope.territories.find(territory => territory.id == store.attributes.territory_id) : null;\n let amount = store.meta.distance;\n if (amount === null) {\n return '';\n }\n if (territory && territory.attributes.country_code == 'US') {\n switch (Math.round(amount)) {\n case 0:\n return 'less than 1 mile away';\n case 1:\n return '1 mile away';\n }\n return Math.round(amount) + ' miles away';\n }\n amount = amount * 1.609344;\n switch (Math.round(amount)) {\n case 0:\n return 'less than 1 km away';\n case 1:\n return '1 km away';\n }\n return Math.round(amount) + ' km\\'s away';\n };\n },\n]);\n","app.filter('floor', [\n function (\n ) {\n return function (value) {\n return Math.floor(value);\n };\n },\n]);\n","app.filter('money', [\n 'cart',\n 'config',\n function (\n cart,\n config,\n ) {\n const currencySymbols = {\n EUR: '€', // Euro\n CRC: '₡', // Costa Rican Colón\n GBP: '£', // British Pound Sterling\n ILS: '₪', // Israeli New Sheqel\n INR: '₹', // Indian Rupee\n JPY: '¥', // Japanese Yen\n KRW: '₩', // South Korean Won\n NGN: '₦', // Nigerian Naira\n PHP: '₱', // Philippine Peso\n PLN: 'zł', // Polish Zloty\n PYG: '₲', // Paraguayan Guarani\n THB: '฿', // Thai Baht\n UAH: '₴', // Ukrainian Hryvnia\n VND: '₫', // Vietnamese Dong\n ZAR: 'R', // South African Rand\n BRL: 'R$', // Brazilian real\n };\n\n return function (amount) {\n if (amount === null || amount === undefined) {\n amount = 0;\n }\n\n let currency = cart.getCurrency();\n let currencySymbol = '$';\n if (config.locale.currencySymbol) {\n currencySymbol = config.locale.currencySymbol;\n } else if (currencySymbols[currency]) {\n currencySymbol = currencySymbols[currency];\n }\n\n let result = currencySymbol + ' ' + (Math.round(amount * 100) / 100).toFixed(2);\n if (config.locale.showCurrencySuffix) {\n result += ' ' + cart.getCurrency();\n }\n return result;\n };\n },\n]);\n","app.filter('percent', function() {\n return function(percent) {\n return Math.round(percent * 100) + ' %';\n };\n});\n","app.filter('reverse', function () {\n return function (items) {\n return items.slice().reverse();\n };\n});","app.filter('trustedHtml', [\n '$sce',\n function($sce) {\n return function(html) {\n return $sce.trustAsHtml(html);\n };\n },\n]);\n\napp.filter('html', [\n '$sce',\n function($sce) {\n return function(html) {\n return $sce.trustAsHtml(html);\n };\n },\n]);\n","app.directive('pAppBanner', [\n '$templateCache',\n 'browser',\n 'config',\n 'query',\n function (\n $templateCache,\n browser,\n config,\n query,\n ) {\n return {\n template: $templateCache.get('app-banner'),\n link: function (scope) {\n scope.isMobile = browser.isIos || browser.isAndroid;\n scope.isAndroid = browser.isAndroid || !!query.android;\n scope.isIos = browser.isIos || !!query.ios;\n scope.banner = {\n visible: false,\n brand: config.brandName,\n url: null,\n };\n\n if (!query['no-app-banner']) {\n if (scope.isIos && !config.disableAppleAppStoreMobileBanner && config.appleAppStoreUrl) {\n scope.banner.url = config.appleAppStoreUrl;\n scope.banner.visible = true;\n }\n if (scope.isAndroid && !config.disableGooglePlayMobileBanner && config.googlePlayUrl) {\n scope.banner.url = config.googlePlayUrl;\n scope.banner.visible = true;\n }\n }\n\n scope.dismiss = () => {\n scope.banner.visible = false;\n };\n\n scope.install = () => {\n scope.banner.visible = false;\n window.open(scope.banner.url);\n };\n },\n };\n },\n]);\n","app.directive('pAutoSizeImg', [\n 'log',\n 'cart',\n function (\n log,\n cart,\n ) {\n const size = 200;\n return {\n restrict: 'A',\n scope: {\n lineItem: '=pAutoSizeImg',\n },\n link: function (scope, element) {\n const resize = () => {\n const squareImageAutoCrop = cart.getPrintServiceSettings().squareImageAutoCrop || 'landscape';\n const image = scope.lineItem.image.thumbnail && scope.lineItem.image.thumbnail.image;\n const product = scope.lineItem.product;\n\n if (image && product) {\n const imageRatio = scope.lineItem.image.thumbnail.width / scope.lineItem.image.thumbnail.height;\n const productSize = scope.lineItem.product.getProductSize();\n\n let cropOrientation = null;\n if (imageRatio == 1) {\n cropOrientation = squareImageAutoCrop;\n } else if (imageRatio > 1) {\n cropOrientation = 'landscape';\n } else {\n cropOrientation = 'portrait';\n }\n\n if (cropOrientation == 'portrait') {\n // Image is portrait\n const productRatio = productSize.width < productSize.height ? productSize.width / productSize.height : productSize.height / productSize.width;\n log.verbose('Auto cropping portrait', imageRatio, productRatio, size * productRatio);\n element.width(size * productRatio);\n element.height(size);\n } else if (cropOrientation == 'landscape') {\n // Image is landscape\n const productRatio = productSize.width > productSize.height ? productSize.width / productSize.height : productSize.height / productSize.width;\n log.verbose('Auto cropping landscape', imageRatio, productRatio, size / productRatio);\n element.width(size);\n element.height(size / productRatio);\n }\n } else {\n log.verbose('Cannot auto crop, falling back to square', image, product);\n element.width(size);\n element.height(size);\n }\n };\n scope.$watch('[lineItem.product, lineItem.image.thumbnail.image, cart.fulfillment, cart.store]', resize);\n scope.$on('resize', resize);\n resize();\n },\n };\n },\n]);\n","app.directive('pCartItemPreview', [\n 'cropHelpers',\n 'frameHelpers',\n 'cart',\n function (\n cropHelpers,\n frameHelpers,\n cart,\n ) {\n return {\n restrict: 'A',\n scope: {\n lineItem: '=',\n },\n link: function (scope, element) {\n scope.cart = cart;\n\n const maxHeight = element.height();\n\n element.html(getPreviewHtml());\n resize();\n\n scope.$on('resize', () => {\n resize();\n scope.$digest();\n });\n\n scope.$watch('[lineItem.previewSvg, lineItem.image.thumbnail.image.src, lineItem.product, cart.fulfillment, cart.store]', () => {\n setTimeout(() => {\n element.html(getPreviewHtml());\n resize();\n }, 1);\n });\n\n function resize () {\n const el = element.children().first();\n\n if (el.height() > maxHeight) {\n el.height(maxHeight);\n }\n }\n\n function getPreviewHtml () {\n if (scope.lineItem) {\n // Designer prints\n if (scope.lineItem.previewImage) {\n return scope.lineItem.previewImage;\n }\n\n // Framed Products\n if (scope.lineItem.product &&\n scope.lineItem.product.metaData.frame &&\n scope.lineItem.image &&\n scope.lineItem.image.getSrc()) {\n return frameHelpers.render(scope.lineItem);\n }\n\n // Cards, Calendars, Canvas, etc\n if (scope.lineItem.previewSvg) {\n return scope.lineItem.previewSvg;\n }\n\n // Print Products\n if (scope.lineItem.image) {\n // Manually add cart image data\n if (!scope.lineItem.image.file && scope.lineItem.image.data) {\n return scope.lineItem.image.data;\n }\n // Uploaded photo\n if (scope.lineItem.image.getSrc()) {\n return cropHelpers.render(scope.lineItem);\n }\n }\n }\n\n return '
';\n }\n },\n };\n }]);\n","app.directive('pCategories', [\n 'log',\n 'query',\n function (\n log,\n query,\n ) {\n return {\n restrict: 'A',\n scope: {\n categories: '=pCategories',\n change: '&pCategoriesChange',\n },\n template: `\n
\n \n
\n `,\n link: function (scope) {\n const cleanCategoryName = (categoryName) => {\n return categoryName.toLowerCase().replace(/[^a-z0-9]/g, '');\n };\n\n if (query.categories) {\n for (const queryCategory of query.categories.split(',')) {\n const queryCategoryName = cleanCategoryName(queryCategory);\n const category = scope.categories.find(c => cleanCategoryName(c.name) == queryCategoryName);\n if (category) {\n log.debug('Enabling category by query string', queryCategoryName, category);\n category.selected = true;\n } else {\n log.debug('Could not find query category', queryCategoryName);\n }\n }\n }\n\n scope.toggleCategory = (category) => {\n log.debug('Toggling category');\n category.selected = !category.selected;\n scope.change();\n };\n\n scope.change();\n },\n };\n },\n]);\n","app.directive('pClientNavMenu', [\n '$rootScope',\n 'config',\n 'apiv2',\n 'login',\n 'Unique',\n function (\n $rootScope,\n config,\n apiv2,\n login,\n Unique,\n ) {\n return {\n restrict: 'A',\n replace: true,\n scope: {\n },\n template: `\n
  • \n \n Sign In\n {{ login.name }}\n \n \n
    \n \n My Account\n My Orders\n Sign Out\n \n
  • \n `,\n link: function (scope) {\n scope.uid = Unique.inc();\n scope.state = 'logged-out';\n scope.email = config.storageGet('email') || '';\n scope.loading = false;\n scope.error = null;\n scope.login = $rootScope.login;\n\n scope.submit = ($event) => {\n $event.preventDefault();\n scope.loading = true;\n scope.error = null;\n apiv2.post('client/account/login', {\n data: {\n type: 'AccountLogin',\n attributes: {\n emailAddress: scope.email,\n password: scope.password,\n deviceId: config.deviceToken,\n },\n },\n }).then((response) => {\n scope.loading = false;\n login.login(response.data.attributes.loginToken, response.data.attributes.name);\n }).catch((error) => {\n scope.loading = false;\n scope.error = error;\n });\n };\n\n scope.logout = () => {\n login.logout();\n window.location = config.url('/');\n };\n },\n };\n },\n]);\n","app.directive('pEditableInput', function () {\n return {\n restrict: 'EA',\n replace: true,\n scope: {\n model: '=pEditableInput',\n editing: '=?pEditableInputEditing',\n required: '=?pEditableInputRequired',\n label: '@?pEditableInputLabel',\n type: '@?pEditableInputType',\n inputId: '@?pEditableInputId',\n },\n template: `\n \n \n {{ label | trustedHtml }}\n \n \n \n `,\n link: function ($scope) {\n $scope.inputId = $scope.inputId || Math.random().toString(36).substr(2, 9);\n $scope.type = $scope.type || 'text';\n if (typeof $scope.editing === 'undefined') {\n $scope.editing = false;\n }\n if (typeof $scope.required === 'undefined') {\n $scope.required = false;\n }\n },\n };\n});\n","app.directive('pElastic', ['$timeout', function ($timeout) {\n return {\n restrict: 'A',\n link: function link($scope, element, attributes) {\n\n $scope.initialHeight = $scope.initialHeight || element[0].style.height;\n var resize = function resize() {\n element[0].rows = Math.max(attributes.pElastic || 3, element[0].value.split(/\\r*\\n/).length);\n };\n element.on('input change', resize);\n $timeout(resize, 0);\n },\n };\n}]);\n","app.directive('pImagePreview', [\n 'thumbnailer',\n function (\n thumbnailer,\n ) {\n return {\n restrict: 'A',\n replace: true,\n scope: {\n lineItem: '=pImagePreview',\n },\n link: function (scope, element) {\n scope.$watch('lineItem.thumbnail', (thumbnail) => {\n if (!thumbnail || !thumbnail.canvas) {\n return;\n }\n thumbnail.load.then(() => {\n const context = element[0].getContext('2d');\n element[0].width = 80;\n element[0].height = 80;\n thumbnailer.drawImageCover(context, thumbnail.canvas);\n });\n });\n },\n };\n }]);\n","app.directive('pLoader', [\n function () {\n return {\n restrict: 'EA',\n replace: true,\n template: `\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n `,\n };\n },\n]);\n","app.directive('pMap', [\n 'Debouncer',\n 'log',\n function (\n Debouncer,\n log,\n ) {\n const MARKER_WIDTH = 50;\n const MARKER_HEIGHT = 62;\n\n return {\n restrict: 'A',\n scope: {\n markers: '=pMapMarkers',\n bounds: '=pMapBounds',\n infoWindow: '=pMapInfoWindow',\n minZoom: '@pMapMinZoom',\n maxZoom: '@pMapMaxZoom',\n onBoundsChanged: '&pMapOnBoundsChanged',\n onClickMarker: '&pMapOnClickMarker',\n },\n link: function (scope, element) {\n element.height(550);\n scope.minZoom = parseInt(scope.minZoom) || 10;\n scope.maxZoom = parseInt(scope.maxZoom) || 16;\n\n const boundsChangeEventDebouncer = new Debouncer();\n const boundsChangeExternalDebouncer = new Debouncer();\n const map = new google.maps.Map(element.get(0), {\n center: {\n lat: -37.7862694,\n lng: 175.2807603,\n },\n zoom: scope.minZoom,\n minZoom: scope.minZoom,\n maxZoom: scope.maxZoom,\n streetViewControl: false,\n scaleControl: true,\n });\n const markerQueue = [];\n let markerQueueInterval = null;\n function processMarkerQueue() {\n for (let i = 0; i < 10; i++) {\n if (markerQueue.length > 0) {\n const {\n id,\n latitude,\n longitude,\n iconUrl,\n data,\n } = markerQueue.pop();\n if (!markers[id]) {\n markers[id] = new google.maps.Marker({\n position: new google.maps.LatLng(latitude, longitude),\n icon: getScaledIcon(map.getZoom(), iconUrl),\n map,\n data,\n });\n if (scope.infoWindow && scope.infoWindow.markerId == id) {\n infoWindow.open(map, markers[id]);\n }\n google.maps.event.addListener(markers[id], 'click', () => {\n log.verbose('Clicked marker', id, markers[id]);\n scope.onClickMarker({\n id: id,\n marker: markers[id],\n });\n });\n }\n } else {\n clearInterval(markerQueueInterval);\n markerQueueInterval = null;\n return;\n }\n }\n }\n\n // For debugging\n window.MAP = map;\n\n const markers = {};\n const infoWindow = new google.maps.InfoWindow({\n content: '',\n });\n\n google.maps.event.addListener(map, 'bounds_changed', () => {\n log.verbose('Map bounds changed event');\n boundsChangeEventDebouncer.trigger(() => {\n const bounds = map.getBounds();\n\n // Hide markers out of bounds\n for (const markerId in markers) {\n const marker = markers[markerId];\n marker.setVisible(bounds.contains(marker.getPosition()));\n }\n\n log.verbose('Map bounds changed internally', bounds);\n scope.onBoundsChanged({\n bounds: bounds,\n });\n });\n });\n\n google.maps.event.addListener(map, 'zoom_changed', () => {\n for (const markerId in markers) {\n const marker = markers[markerId];\n marker.setIcon(getScaledIcon(map.getZoom(), marker.icon.url));\n }\n });\n\n function getScaledIcon(zoom, url) {\n const scale = zoom / scope.maxZoom;\n return {\n url: url,\n scaledSize: new google.maps.Size(MARKER_WIDTH * scale, MARKER_HEIGHT * scale),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(MARKER_WIDTH * scale / 2, MARKER_HEIGHT * scale),\n };\n }\n\n function addMarker(marker) {\n markerQueue.push(marker);\n if (!markerQueueInterval) {\n markerQueueInterval = setInterval(processMarkerQueue, 1);\n }\n }\n\n function zoomToFitPoints(points) {\n log.verbose('Zooming map to fix points', points);\n var bounds = new google.maps.LatLngBounds();\n for (const point of points) {\n bounds.extend(new google.maps.LatLng(point[0], point[1]));\n }\n map.fitBounds(bounds);\n }\n\n function zoomToBox(latitude1, longitude1, latitude2, longitude2) {\n log.verbose('Zooming map to fix box', latitude1, longitude1, latitude2, longitude2);\n var bounds = new google.maps.LatLngBounds();\n bounds.extend(new google.maps.LatLng(latitude1, longitude1));\n bounds.extend(new google.maps.LatLng(latitude2, longitude2));\n map.fitBounds(bounds);\n }\n\n scope.$watch(() => Object.keys(scope.markers).length, () => {\n log.verbose('Map markers changed', scope.markers);\n const newMarkers = [];\n for (const markerId in scope.markers) {\n const newMarker = addMarker(scope.markers[markerId]);\n if (newMarker) {\n newMarkers.push(newMarker);\n }\n }\n });\n scope.$watch('bounds', () => {\n boundsChangeExternalDebouncer.trigger(() => {\n if (scope.bounds.bounds) {\n log.verbose('Map bounds changed bounds', scope.bounds);\n zoomToBox(...scope.bounds.bounds);\n } else if (scope.bounds.marker) {\n log.verbose('Map bounds changed marker', scope.bounds);\n map.setCenter(markers[scope.bounds.marker].getPosition());\n map.setZoom(scope.maxZoom);\n } else if (scope.bounds.points) {\n log.verbose('Map bounds changed points', scope.bounds);\n zoomToFitPoints(scope.bounds.points);\n } else if (scope.bounds.point) {\n log.verbose('Map bounds changed point', scope.bounds, scope.minZoom + (scope.maxZoom - scope.minZoom) / 2);\n map.setCenter(new google.maps.LatLng(scope.bounds.point[0], scope.bounds.point[1]));\n map.setZoom(Math.round(scope.minZoom + (scope.maxZoom - scope.minZoom) / 2));\n }\n });\n }, true);\n\n scope.$watch('infoWindow', () => {\n log.verbose('Update map info window', scope.infoWindow);\n if (!scope.infoWindow) {\n infoWindow.close();\n return;\n }\n infoWindow.setContent(scope.infoWindow.content);\n if (scope.infoWindow.markerId && markers[scope.infoWindow.markerId]) {\n infoWindow.open(map, markers[scope.infoWindow.markerId]);\n } else {\n infoWindow.close();\n }\n }, true);\n },\n };\n },\n]);\n","app.directive('pModalCrop', [\n '$rootScope',\n 'CropRectPos',\n function (\n $rootScope,\n CropRectPos,\n ) {\n return {\n restrict: 'A',\n scope: {\n },\n template: `\n
    \n
    \n
    \n \n

    Crop Photo

    \n
    \n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n \n
    \n
    \n `,\n link: function (scope, element) {\n scope.lang = $rootScope.lang;\n const svg = element.find('svg');\n const image = svg.find('image');\n\n let view = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n let resizing = false;\n let moving = false;\n let movingOffset = null;\n let cropRectPos = null;\n\n const cropRect = element.find('.p-crop-rect');\n const cropRectDebug = element.find('.p-crop-rect-debug');\n const cropRectGrid = element.find('.p-crop-grid');\n const cropOverlay = element.find('.p-crop-overlay');\n const cropRectTl = element.find('.p-crop-rect-handle-tl');\n const cropRectTr = element.find('.p-crop-rect-handle-tr');\n const cropRectBl = element.find('.p-crop-rect-handle-bl');\n const cropRectBr = element.find('.p-crop-rect-handle-br');\n const updateCropRect = () => {\n cropRectDebug.attr({\n x: cropRectPos.x,\n y: cropRectPos.y,\n width: cropRectPos.width,\n height: cropRectPos.height,\n }).show();\n const aspect = cropRectPos.getAspectRect();\n cropRect.attr({\n x: aspect.x,\n y: aspect.y,\n width: aspect.width,\n height: aspect.height,\n });\n cropRectGrid.css({\n transform: `translate(${aspect.x}px, ${aspect.y}px) scale(${aspect.width / 100}, ${aspect.height / 100})`,\n });\n const handleSize = 25;\n const padding = 7;\n cropRectTl.css({\n transform: `translate(${aspect.x - padding}px, ${aspect.y - padding}px) scaleX(1)`,\n });\n cropRectTr.css({\n transform: `translate(${aspect.x + aspect.width - handleSize + padding}px, ${aspect.y - padding}px) scaleX(-1)`,\n });\n cropRectBl.css({\n transform: `translate(${aspect.x - padding}px, ${aspect.y + aspect.height - handleSize + padding}px) scaleY(-1)`,\n });\n cropRectBr.css({\n transform: `translate(${aspect.x + aspect.width - handleSize + padding}px, ${aspect.y + aspect.height - handleSize + padding}px) scaleX(-1) scaleY(-1)`,\n });\n };\n\n const transformEventPos = (e) => {\n const point = svg[0].createSVGPoint();\n if (e.originalEvent.touches) {\n point.x = e.originalEvent.touches[0].clientX;\n point.y = e.originalEvent.touches[0].clientY;\n } else {\n point.x = e.clientX;\n point.y = e.clientY;\n }\n return point.matrixTransform(svg[0].getScreenCTM().inverse());\n };\n\n const pointDistance = (x1, y1, x2, y2) => {\n return Math.sqrt((x2 -= x1) * x2 + (y2 -= y1) * y2);\n };\n\n const isCloseTo = (x1, y1, x2, y2, smallestSide) => {\n const distance = pointDistance(x1, y1, x2, y2);\n const percent = distance / smallestSide;\n return percent < 0.25;\n };\n\n const getDraggableRegion = (point) => {\n const aspect = cropRectPos.getAspectRect();\n const smallestSide = aspect.width > aspect.height ? aspect.height : aspect.width;\n\n if (isCloseTo(point.x, point.y, aspect.x, aspect.y, smallestSide)) {\n return 'top-left';\n }\n if (isCloseTo(point.x, point.y, aspect.x + aspect.width, aspect.y, smallestSide)) {\n return 'top-right';\n }\n if (isCloseTo(point.x, point.y, aspect.x, aspect.y + aspect.height, smallestSide)) {\n return 'bottom-left';\n }\n if (isCloseTo(point.x, point.y, aspect.x + aspect.width, aspect.y + aspect.height, smallestSide)) {\n return 'bottom-right';\n }\n if (point.x >= aspect.x &&\n point.y >= aspect.y &&\n point.x <= aspect.x + aspect.width &&\n point.y <= aspect.y + aspect.height) {\n return 'center';\n }\n\n return null;\n };\n\n svg.on('mousedown touchstart', (e) => {\n if (e.type != 'touchstart' && e.which != 1) {\n return;\n }\n const point = transformEventPos(e);\n const draggableRegion = getDraggableRegion(point);\n\n switch (draggableRegion) {\n case 'center':\n moving = true;\n movingOffset = {\n x: (cropRectPos.width) / 2 - (point.x - cropRectPos.x),\n y: (cropRectPos.height) / 2 - (point.y - cropRectPos.y),\n };\n break;\n case 'top-left':\n resizing = true;\n cropRectPos.fixedX = cropRectPos.x + cropRectPos.width;\n cropRectPos.fixedY = cropRectPos.y + cropRectPos.height;\n cropRectPos.floatX = point.x;\n cropRectPos.floatY = point.y;\n updateCropRect();\n break;\n case 'top-right':\n resizing = true;\n cropRectPos.fixedX = cropRectPos.x;\n cropRectPos.fixedY = cropRectPos.y + cropRectPos.height;\n cropRectPos.floatX = point.x;\n cropRectPos.floatY = point.y;\n updateCropRect();\n break;\n case 'bottom-left':\n resizing = true;\n cropRectPos.fixedX = cropRectPos.x + cropRectPos.width;\n cropRectPos.fixedY = cropRectPos.y;\n cropRectPos.floatX = point.x;\n cropRectPos.floatY = point.y;\n updateCropRect();\n break;\n case 'bottom-right':\n resizing = true;\n cropRectPos.fixedX = cropRectPos.x;\n cropRectPos.fixedY = cropRectPos.y;\n cropRectPos.floatX = point.x;\n cropRectPos.floatY = point.y;\n updateCropRect();\n break;\n default:\n if (point.x > view.x && point.y > view.y && point.x < view.x + view.width && point.y < view.y + view.height) {\n resizing = true;\n cropRectPos.fixedX = point.x;\n cropRectPos.fixedY = point.y;\n cropRectPos.floatX = point.x + 1;\n cropRectPos.floatY = point.y + 1;\n updateCropRect();\n }\n break;\n }\n });\n\n const endDrag = () => {\n if (resizing) {\n const aspect = cropRectPos.getAspectRect();\n cropRectPos.fixedX = aspect.x;\n cropRectPos.fixedY = aspect.y;\n cropRectPos.floatX = aspect.x + aspect.width;\n cropRectPos.floatY = aspect.y + aspect.height;\n updateCropRect();\n }\n moving = false;\n resizing = false;\n cropRectDebug.hide();\n };\n\n $('.p-modal-crop').on('mousemove touchmove', (e) => {\n if (e.buttons !== undefined && e.buttons !== 1 && e.type != 'touchmove') {\n endDrag();\n }\n const point = transformEventPos(e);\n const draggableRegion = getDraggableRegion(point);\n switch (draggableRegion) {\n case 'center':\n svg.css('cursor', 'move');\n break;\n case 'top-left':\n svg.css('cursor', 'nwse-resize');\n break;\n case 'top-right':\n svg.css('cursor', 'nesw-resize');\n break;\n case 'bottom-left':\n svg.css('cursor', 'nesw-resize');\n break;\n case 'bottom-right':\n svg.css('cursor', 'nwse-resize');\n break;\n default:\n if ($(e.target).closest('.p-crop-image, .p-crop-ui').length) {\n svg.css('cursor', 'crosshair');\n } else {\n svg.css('cursor', '');\n }\n break;\n }\n\n if (moving) {\n const pointOffset = {\n x: point.x + movingOffset.x,\n y: point.y + movingOffset.y,\n };\n const aspect = cropRectPos.getAspectRect();\n const offsetX = aspect.width / 2;\n const offsetY = aspect.height / 2;\n cropRectPos.fixedX = pointOffset.x - offsetX;\n cropRectPos.fixedY = pointOffset.y - offsetY;\n cropRectPos.floatX = pointOffset.x + offsetX;\n cropRectPos.floatY = pointOffset.y + offsetY;\n if (cropRectPos.fixedX < view.x) {\n cropRectPos.floatX = view.x + aspect.width;\n cropRectPos.fixedX = view.x;\n }\n if (cropRectPos.fixedY < view.y) {\n cropRectPos.floatY = view.y + aspect.height;\n cropRectPos.fixedY = view.y;\n }\n if (cropRectPos.floatX > view.x + view.width) {\n cropRectPos.fixedX = view.x + view.width - aspect.width;\n cropRectPos.floatX = view.x + view.width;\n }\n if (cropRectPos.floatY > view.y + view.height) {\n cropRectPos.fixedY = view.y + view.height - aspect.height;\n cropRectPos.floatY = view.y + view.height;\n }\n updateCropRect();\n } else if (resizing) {\n if (point.x < view.x) {\n point.x = view.x;\n }\n if (point.y < view.y) {\n point.y = view.y;\n }\n if (point.x > view.x + view.width) {\n point.x = view.x + view.width;\n }\n if (point.y > view.y + view.height) {\n point.y = view.y + view.height;\n }\n cropRectPos.floatX = point.x;\n cropRectPos.floatY = point.y;\n updateCropRect();\n }\n });\n\n $(document).on('mouseup touchend', endDrag);\n\n scope.rotate = () => {\n cropRectPos.rotate();\n scope.updateImage(true);\n };\n\n scope.updateImage = (resetPosition = false) => {\n if (cropRectPos.rotation == 1 || cropRectPos.rotation == 3) {\n view.width = scope.lineItem.image.thumbnail.height;\n view.height = scope.lineItem.image.thumbnail.width;\n } else {\n view.width = scope.lineItem.image.thumbnail.width;\n view.height = scope.lineItem.image.thumbnail.height;\n }\n view.x = -view.width / 2;\n view.y = -view.height / 2;\n svg.attr({\n viewBox: `${view.x} ${view.y} ${view.width} ${view.height}`,\n width: view.width,\n height: view.height,\n });\n cropOverlay.attr({\n x: view.x,\n y: view.y,\n width: view.width,\n height: view.height,\n });\n image.attr({\n 'xlink:href': scope.lineItem.image.thumbnail.image.src,\n width: scope.lineItem.image.thumbnail.width,\n height: scope.lineItem.image.thumbnail.height,\n }).css({\n transformOrigin: `${scope.lineItem.image.thumbnail.width / 2}px ${scope.lineItem.image.thumbnail.height / 2}px`,\n transform: `translate(-${scope.lineItem.image.thumbnail.width / 2}px, -${scope.lineItem.image.thumbnail.height / 2}px) rotate(${cropRectPos.rotation * 90}deg)`,\n });\n\n cropRectPos.productSize = scope.lineItem.product.getProductSize();\n let cropWidth = view.width;\n let cropHeight = view.height;\n const ratio = view.width / view.height;\n const productRatio = cropRectPos.productWidth / cropRectPos.productHeight;\n if (ratio < productRatio) {\n cropHeight = cropRectPos.productHeight / cropRectPos.productWidth * view.width;\n } else {\n cropWidth = cropRectPos.productWidth / cropRectPos.productHeight * view.height;\n }\n if (resetPosition || (!cropRectPos.fixedX && !cropRectPos.fixedY && !cropRectPos.floatX && !cropRectPos.floatY)) {\n cropRectPos.fixedX = -cropWidth / 2;\n cropRectPos.fixedY = -cropHeight / 2;\n cropRectPos.floatX = cropRectPos.fixedX + cropWidth;\n cropRectPos.floatY = cropRectPos.fixedY + cropHeight;\n }\n updateCropRect();\n };\n\n scope.apply = () => {\n const aspect = cropRectPos.getAspectRect();\n let processedSvg = svg.clone();\n processedSvg.removeAttr('width');\n processedSvg.removeAttr('height');\n processedSvg.attr('viewBox', `${aspect.x} ${aspect.y} ${aspect.width} ${aspect.height}`);\n processedSvg.find('.p-crop-ui').remove();\n processedSvg = $('
    ').append(processedSvg).html();\n processedSvg = processedSvg.replace(/\\s+/g, ' ');\n scope.lineItem.svg = processedSvg;\n scope.lineItem.previewSvg = processedSvg;\n scope.lineItem.cropRectPos = cropRectPos;\n scope.closeModal();\n };\n\n scope.closeModal = () => {\n $rootScope.modalCrop = null;\n $rootScope.modalFrameFlow = null;\n };\n\n scope.togglePortrait = () => {\n cropRectPos.orientation = 'portrait';\n scope.updateImage(true);\n };\n\n scope.toggleLandscape = () => {\n cropRectPos.orientation = 'landscape';\n scope.updateImage(true);\n };\n\n $rootScope.$watch('modalCrop', (lineItem) => {\n scope.lineItem = lineItem;\n if (lineItem) {\n cropRectPos = scope.lineItem.cropRectPos || new CropRectPos();\n scope.cropRectPos = cropRectPos;\n if (!cropRectPos.orientation) {\n if (scope.lineItem.image.thumbnail.width > scope.lineItem.image.thumbnail.height) {\n cropRectPos.orientation = 'landscape';\n } else {\n cropRectPos.orientation = 'portrait';\n }\n }\n scope.updateImage();\n element.modal('show');\n } else {\n element.modal('hide');\n }\n });\n },\n };\n },\n]);\n","app.directive('pModalFrameFlow', [\n '$rootScope',\n 'cart',\n 'svg',\n 'frameHelpers',\n function (\n $rootScope,\n cart,\n svg,\n frameHelpers,\n ) {\n return {\n restrict: 'A',\n scope: {\n },\n template: window.appTemplates.FRAME_FLOW_MODAL,\n link: function (scope, element) {\n scope.lineItem = null;\n scope.file = null;\n scope.showProductsDraw = false;\n scope.frames = [];\n scope.products = [];\n\n scope.rotate = function () {\n if (scope.lineItem.settings.rotate === 360) {\n scope.lineItem.settings.rotate = 90;\n } else {\n scope.lineItem.settings.rotate += 90;\n }\n\n applyImageUpdates();\n };\n\n scope.rotateFrame = function (orientation) {\n const frame = frameHelpers.getCurrentFrame(scope.lineItem, orientation);\n\n if (! frame || frame.orientation == scope.lineItem.settings.orientation) {\n return;\n }\n\n scope.lineItem.settings.orientation = frame.orientation;\n wrapper.html(frameHelpers.render(scope.lineItem));\n };\n\n scope.reset = function () {\n scope.lineItem.settings.x = scope.defaults.x;\n scope.lineItem.settings.y = scope.defaults.y;\n scope.lineItem.settings.width = scope.defaults.width;\n scope.lineItem.settings.height = scope.defaults.height;\n scope.lineItem.settings.scale = scope.defaults.scale;\n scope.lineItem.settings.rotate = scope.defaults.rotate;\n applyImageUpdates();\n };\n\n scope.close = function close() {\n let frame = frameHelpers.getCurrentFrame(scope.lineItem);\n let processedSvg = frameHelpers.extractPhotoSvg(wrapper.find('svg'), frameHelpers.getCurrentFrame(scope.lineItem));\n processedSvg = processedSvg.replace(/\\s+/g, ' ');\n scope.lineItem.previewSvg = frameHelpers.render(scope.lineItem);\n scope.lineItem.svg = processedSvg;\n // FIX: make sure orientation is correct when sent to server\n scope.lineItem.cropRectPos = {\n orientation: frame.isPortrait ? 'portrait' : 'landscape',\n };\n $rootScope.closeModal();\n };\n\n scope.selectProduct = function (product) {\n scope.lineItem.setProduct(product);\n scope.frames = frameHelpers.getFrames(scope.lineItem);\n\n wrapper.html(frameHelpers.render(scope.lineItem));\n };\n\n scope.$watch('lineItem.settings.scale', () => {\n applyImageUpdates();\n });\n\n scope.$watch('file', file => {\n if (!file) return;\n\n const image = cart.addImage(file);\n\n scope.lineItem.loading = true;\n scope.lineItem.setImage(image);\n image.thumbnail.load.then(() => {\n scope.lineItem.loading = false;\n svg.setImageUrl(wrapper.find('[data-element=photo]'), scope.lineItem.image.getSrc());\n scope.reset();\n });\n });\n\n $rootScope.$watch('modalFrameFlow', lineItem => {\n if (! lineItem) {\n scope.lineItem = null;\n element.modal('hide');\n return;\n }\n\n element.modal('show');\n scope.products = getProducts(lineItem);\n scope.frames = frameHelpers.getFrames(lineItem);\n scope.defaults = frameHelpers.getPhotoDefaults(frameHelpers.getCurrentFrame(lineItem), lineItem.image);\n scope.lineItem = lineItem;\n\n wrapper.html(frameHelpers.render(lineItem));\n });\n\n let mouseDown, mouseX, mouseY, offset, wrapper;\n\n $(document).on('mouseup touchend', () => {\n mouseDown = false;\n });\n wrapper = $('#p-frame-editor-wrapper');\n wrapper.on('mousedown touchstart', evt => {\n if (('which' in evt && evt.which == 1) || evt.button == 1 || evt.originalEvent.touches[0]) {\n if (evt.target.getAttribute('data-element') == 'photo') {\n evt.preventDefault();\n mouseDown = true;\n\n offset = getMousePosition(evt);\n\n offset.x -= scope.lineItem.settings.x;\n offset.y -= scope.lineItem.settings.y;\n }\n }\n });\n wrapper.on('mousemove touchmove', evt => {\n if (mouseDown) {\n evt.preventDefault();\n const { x, y } = getMousePosition(evt);\n\n scope.lineItem.settings.x = (x - offset.x);\n scope.lineItem.settings.y = (y - offset.y);\n\n applyImageUpdates();\n }\n });\n\n function getProducts (lineItem) {\n return lineItem.getAvailableProducts().filter(product => {\n return product.productImages.filter(img => img.metaData.frame).length > 0;\n });\n }\n\n function applyImageUpdates() {\n wrapper.find('svg [data-element=photo]').css({\n transformOrigin: 'center center',\n transformBox: 'fill-box',\n transform: `\n translate(${scope.lineItem.settings.x}px, ${scope.lineItem.settings.y}px)\n scale(${scope.lineItem.settings.scale})\n rotate(${scope.lineItem.settings.rotate}deg)\n `,\n });\n }\n\n function getMousePosition(evt) {\n mouseX = evt.pageX || evt.originalEvent.touches[0].pageX;\n mouseY = evt.pageY || evt.originalEvent.touches[0].pageY;\n\n const CTM = wrapper.find('svg')[0].getScreenCTM();\n\n return {\n x: (mouseX - CTM.e) / CTM.a,\n y: (mouseY - CTM.f) / CTM.d,\n };\n }\n },\n };\n },\n]);\n\n","app.directive('pModalImage', [\n 'thumbnailer',\n function (\n thumbnailer,\n ) {\n return {\n restrict: 'A',\n replace: true,\n scope: {\n image: '=pModalImage',\n },\n link: function (scope, element) {\n scope.$watch('image', (image) => {\n element.hide();\n if (!image) {\n return;\n }\n let resized = thumbnailer.addFile(image.file);\n resized.load.then(() => {\n let width = resized.width;\n let height = resized.height;\n if (resized.width > 800) {\n height = (height / width) * 800;\n width = 800;\n }\n if (resized.height > 800) {\n width = (width / height) * 800;\n height = 800;\n }\n const context = element[0].getContext('2d');\n element[0].width = width;\n element[0].height = height;\n thumbnailer.drawImageCover(context, resized.canvas);\n element.show();\n });\n });\n },\n };\n },\n]);\n","app.directive('pPagination', [\n 'log',\n function (\n log,\n ) {\n return {\n restrict: 'A',\n scope: {\n page: '=pPagination',\n totalItems: '=pPaginationTotalItems',\n itemsPerPage: '=pPaginationItemsPerPage',\n scrollTo: '=pPaginationScrollTo',\n change: '&pPaginationChange',\n },\n template: `\n
      1\">\n
    • \n Previous\n
    • \n
    • \n {{ p }}\n
    • \n
    • \n Next\n
    • \n
    \n `,\n link: function (scope) {\n scope.page = scope.page || 1;\n\n const updatePages = () => {\n log.debug('Updating pagination', scope.totalItems, scope.itemsPerPage, scope.page, scope.scrollTo);\n scope.pages = [];\n let startPage = Math.max(1, scope.page - 2);\n const endPage = Math.min(startPage + 4, scope.lastPage);\n if (endPage >= scope.lastPage - 1) {\n startPage = Math.max(1, endPage - 4);\n }\n for (let i = startPage; i <= endPage; i++) {\n scope.pages.push(i);\n }\n if (scope.scrollTo) {\n const offsetTop = $(scope.scrollTo).offset().top - 30;\n if ($('html').scrollTop() > offsetTop) {\n $('html').scrollTop(offsetTop);\n }\n }\n };\n\n scope.$watch('page', () => {\n updatePages();\n });\n\n scope.$watch('totalItems', () => {\n scope.lastPage = Math.ceil(scope.totalItems / scope.itemsPerPage);\n updatePages();\n });\n\n scope.gotoPage = (pageNumber) => {\n scope.page = pageNumber;\n updatePages();\n };\n\n scope.nextPage = () => {\n if (scope.page == scope.lastPage) return;\n scope.page += 1;\n updatePages();\n };\n\n scope.prevPage = () => {\n if (scope.page == 1) return;\n scope.page -= 1;\n updatePages();\n };\n },\n };\n },\n]);\n","app.directive('pStripeCard', [\n 'config',\n '$rootScope',\n function (\n config,\n $rootScope\n ) {\n return {\n restrict: 'A',\n scope: {\n },\n link: function () {\n if (config.api.stripe.key) {\n $rootScope.stripe = Stripe(config.api.stripe.key);\n const elements = $rootScope.stripe.elements({\n locale: config.language,\n });\n $rootScope.card = elements.create('card', {\n hidePostalCode: true,\n style: {\n base: {\n color: '#32325d',\n fontFamily: '\"Helvetica Neue\", Helvetica, sans-serif',\n fontSmoothing: 'antialiased',\n fontSize: '16px',\n '::placeholder': {\n color: '#aab7c4',\n },\n },\n invalid: {\n color: '#fa755a',\n iconColor: '#fa755a',\n },\n },\n });\n $rootScope.card.mount('#card-element');\n }\n },\n };\n },\n]);\n","app.directive('pTemplatePreview', [\n 'svg',\n function (\n svg,\n ) {\n return {\n restrict: 'A',\n scope: {\n svg: '=pTemplatePreview',\n samplePhoto: '=pTemplatePreviewSamplePhoto',\n },\n link: function (scope, element) {\n element\n .addClass('p-template-preview')\n .html(scope.svg);\n if (scope.samplePhoto) {\n element.find('.p-template-image').each(function () {\n const data = $(this).data('region');\n const svgImage = svg('image')\n .attr(data.box)\n .attr('preserveAspectRatio', 'xMidYMid slice')\n .appendTo(this);\n svg.setImageUrl(svgImage, scope.samplePhoto);\n });\n }\n },\n };\n },\n]);\n","app.factory('Address', [\n 'BaseModel',\n function (\n BaseModel,\n ) {\n return class Address extends BaseModel {\n static isType(type) {\n return type == 'addresses' || type == 'address';\n }\n\n static createInstance(id, type, attributes, relationships, included, meta) {\n return super.createInstance(id, type, attributes, relationships, included, meta);\n }\n };\n },\n]);\n","app.factory('api', [\n '$rootScope',\n '$q',\n '$http',\n 'config',\n 'log',\n 'exception',\n function (\n $rootScope,\n $q,\n $http,\n config,\n log,\n exception,\n ) {\n return new class Api {\n constructor() {\n if (config.api.printicular.environment == 'production') {\n this.apiUrl = 'https://api.printicular.com/';\n } else if (config.api.printicular.environment == 'production-cache') {\n this.apiUrl = 'https://capi.printicular.com/';\n } else if (config.api.printicular.environment == 'staging') {\n this.apiUrl = 'https://stagingapi.printicular.com/';\n } else if (config.api.printicular.environment == 'staging-cache') {\n this.apiUrl = 'https://stagingcapi.printicular.com/';\n } else {\n this.apiUrl = config.api.printicular.url;\n }\n this.apiUrl += 'api/1.0/';\n log.verbose('API URL', config.api.printicular.environment, this.apiUrl);\n }\n\n request(method, url, data) {\n return $q((resolve, reject) => {\n log.verbose('API request', method, this.apiUrl + url, data);\n $http({\n method: method,\n url: this.apiUrl + url,\n data: data,\n headers: {\n Authorization: 'Bearer ' + config.api.printicular.clientId,\n },\n }).then((response) => {\n if (response.data && response.data.error) {\n log.verbose('API error', method, this.apiUrl + url, data, response);\n reject(response.data.error);\n return;\n }\n log.verbose('API response', method, this.apiUrl + url, data, response);\n resolve(response.data);\n }, (response) => {\n log.verbose('API failure', method, this.apiUrl + url, data, response);\n if (response.data && response.data.error) {\n reject(response.data.error);\n } else {\n reject(response);\n }\n });\n });\n }\n\n get(url, parameters) {\n if (parameters) {\n url += '?' + $.param(parameters);\n }\n return this.request('get', url);\n }\n\n post(url, data) {\n return this.request('post', url, data);\n }\n\n put(url, data) {\n return this.request('put', url, data);\n }\n\n patch(url, data) {\n return this.request('patch', url, data);\n }\n\n param(name) {\n name = name.replace(/[[\\]]/g, '\\\\$&');\n const url = window.location.href;\n const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)');\n const results = regex.exec(url);\n if (!results) {\n return null;\n }\n if (!results[2]) {\n return '';\n }\n return decodeURIComponent(results[2].replace(/\\+/g, ' '));\n }\n\n gets3Resource() {\n log.verbose('Get S3 resource');\n return this.get('users/0/s3Resource?deviceToken=' + config.deviceToken, null).catch(error => {\n const message = 'Could not get upload token, please try reloading the page.';\n\n exception.report(message, error);\n\n $rootScope.majorError = message;\n });\n }\n };\n },\n]);\n","app.factory('apiv2', [\n '$q',\n '$http',\n 'config',\n 'log',\n 'login',\n function (\n $q,\n $http,\n config,\n log,\n login,\n ) {\n return new class ApiV2 {\n constructor() {\n if (config.api.printicular.environment == 'production') {\n this.apiUrl = 'https://api.printicular.com/';\n } else if (config.api.printicular.environment == 'production-cache') {\n this.apiUrl = 'https://capi.printicular.com/';\n } else if (config.api.printicular.environment == 'staging') {\n this.apiUrl = 'https://stagingapi.printicular.com/';\n } else if (config.api.printicular.environment == 'staging-cache') {\n this.apiUrl = 'https://stagingcapi.printicular.com/';\n } else {\n this.apiUrl = config.api.printicular.url;\n }\n this.apiUrl += 'api/v2/';\n log.debug('APIv2 URL', config.api.printicular.environment, this.apiUrl);\n\n if (login.loginToken) {\n this.post('client/account/resume', {\n data: {\n type: 'ResumeLogin',\n attributes: {\n deviceId: config.deviceToken,\n },\n },\n }).then(() => {\n // Success, do nothing\n }).catch((error) => {\n log.debug(error);\n login.loginToken = null;\n });\n }\n }\n\n request(method, url, data) {\n return $q((resolve, reject) => {\n const loginToken = login.loginToken || config.api.printicular.clientId;\n const headers = {\n Authorization: 'Bearer ' + loginToken,\n };\n log.debug('APIv2 request', method, this.apiUrl + url, data);\n $http({\n method: method,\n url: this.apiUrl + url,\n data: data,\n headers: headers,\n }).then((response) => {\n if (response.data && response.data.error) {\n log.debug('APIv2 error', method, this.apiUrl + url, data, response);\n reject(response.data.error);\n return;\n }\n log.debug('APIv2 response', method, this.apiUrl + url, data, response);\n resolve(response.data);\n }, (response) => {\n log.debug('APIv2 failure', method, this.apiUrl + url, data, response);\n if (response.data && response.data.error) {\n reject(response.data.error);\n } else {\n reject(response);\n }\n });\n });\n }\n\n get(url, parameters) {\n if (parameters) {\n url += '?' + $.param(parameters);\n }\n return this.request('get', url);\n }\n\n post(url, data) {\n return this.request('post', url, data);\n }\n };\n },\n]);\n","app.factory('BaseModel', [\n 'log',\n function (\n log,\n ) {\n const toCamelCase = (name) => {\n return name.charAt(0).toLowerCase() + name.slice(1);\n };\n\n const toSpaceCase = (name) => {\n return name.replace(/(?:^|\\.?)([A-Z])/g, (x, y) => ' ' + y.toLowerCase()).replace(/^ /, '');\n };\n\n const toDashCase = (name) => {\n return name.replace(/(?:^|\\.?)([A-Z])/g, (x, y) => '-' + y.toLowerCase()).replace(/^-/, '');\n };\n\n const BaseModel = class {\n constructor() {\n this.type = this.constructor.type;\n this.attributes = {};\n this.relationships = {};\n this.meta = {};\n this.included = [];\n }\n\n static fromJsonApi(modelData, includedData) {\n const model = new this();\n model.id = modelData.id;\n model.attributes = modelData.attributes;\n model.relationships = modelData.relationships;\n model.meta = includedData.meta;\n model.included = includedData.included;\n return model;\n }\n\n static get camelCase() {\n return toCamelCase(this.type);\n }\n\n static get spaceCase() {\n return toSpaceCase(this.type);\n }\n\n static get dashCase() {\n return toDashCase(this.type);\n }\n\n static get paramName() {\n return this.dashCase;\n }\n\n static mapModel(response) {\n if (!response) {\n log.debug('Tried to map a model to a null response', response);\n return null;\n }\n if (Array.isArray(response.data)) {\n if (!response.data.length) {\n return null;\n }\n const result = [];\n for (const data of response.data) {\n result.push(this.createInstance(data.id, data.type, data.attributes, data.relationships, response.included, data.meta));\n }\n return result;\n }\n return this.createInstance(response.data.id, response.data.type, response.data.attributes, response.data.relationships, response.included, response.data.meta);\n }\n\n static createInstance(id, type, attributes, relationships, included, meta) {\n const instance = new this();\n instance.id = id;\n instance.type = type;\n instance.attributes = attributes;\n instance.relationships = relationships;\n instance.included = included;\n instance.meta = meta;\n return instance;\n }\n\n findRelated(relationship, model) {\n if (!this.included || !this.relationships[relationship] || !this.relationships[relationship].data || !this.relationships[relationship].data.id) {\n return null;\n }\n const data = this.included.find((included) => {\n return included.id == this.relationships[relationship].data.id && model.isType(included.type.toLowerCase());\n });\n if (!data) {\n return null;\n }\n return model.createInstance(data.id, data.type, data.attributes, data.relationships, this.included, data.meta);\n }\n\n findAllRelated(relationships, model) {\n if (!Array.isArray(relationships)) {\n relationships = [relationships];\n }\n for (const relationship of relationships) {\n if (!this.included || !this.relationships || !this.relationships[relationship] || !this.relationships[relationship].data || !this.relationships[relationship].data.length) {\n continue;\n }\n return this.included.filter((included) => {\n return model.isType(included.type.toLowerCase()) && this.relationships[relationship].data.find(related => related.id == included.id && model.isType(related.type.toLowerCase()));\n }).map((data) => {\n return model.createInstance(data.id, data.type, data.attributes, data.relationships, this.included, data.meta);\n });\n }\n return [];\n }\n };\n\n return BaseModel;\n },\n]);\n","app.factory('Image', [\n 'BaseModel',\n function (\n BaseModel,\n ) {\n return class Image extends BaseModel {\n static isType(type) {\n return type == 'images' || type == 'image';\n }\n\n static createInstance(id, type, attributes, relationships, included, meta) {\n const image = super.createInstance(id, type, attributes, relationships, included, meta);\n return image;\n }\n };\n },\n]);\n","app.factory('LineItem', [\n 'BaseModel',\n 'Product',\n 'Image',\n function (\n BaseModel,\n Product,\n Image,\n ) {\n return class LineItem extends BaseModel {\n static isType(type) {\n return type == 'line_items' || type == 'lineitem';\n }\n\n static createInstance(id, type, attributes, relationships, included, meta) {\n const lineItem = super.createInstance(id, type, attributes, relationships, included, meta);\n lineItem.product = lineItem.findRelated('product', Product);\n lineItem.processedImage = lineItem.findRelated('processedImage', Image);\n lineItem.attributes.total = parseFloat(lineItem.attributes.total);\n return lineItem;\n }\n\n formatName() {\n return this.product ? this.product.formatName() : 'Line Item #' + this.id;\n }\n };\n },\n]);\n","app.factory('Location', [\n 'BaseModel',\n 'Store',\n function (\n BaseModel,\n Store,\n ) {\n return class Location extends BaseModel {\n static isType(type) {\n return type == 'Location';\n }\n\n get stores() {\n if (!this._stores) {\n this._stores = this.findAllRelated('stores', Store);\n }\n return this._stores;\n }\n };\n },\n]);\n","app.factory('Order', [\n 'BaseModel',\n 'Address',\n 'LineItem',\n 'Store',\n function (\n BaseModel,\n Address,\n LineItem,\n Store,\n ) {\n return class Order extends BaseModel {\n static isType(type) {\n return type == 'orders' || type == 'order';\n }\n\n static createInstance(id, type, attributes, relationships, included, meta) {\n const order = super.createInstance(id, type, attributes, relationships, included, meta);\n order.store = order.findRelated('store', Store);\n order.address = order.findRelated('address', Address);\n order.lineItems = order.findAllRelated('lineItems', LineItem);\n order.attributes.total = parseFloat(order.attributes.total);\n order.attributes.subtotalDiscount = parseFloat(order.attributes.subtotalDiscount);\n order.attributes.freight = parseFloat(order.attributes.freight);\n order.attributes.freightDiscount = parseFloat(order.attributes.freightDiscount);\n return order;\n }\n };\n },\n]);\n","app.factory('Price', [\n 'BaseModel',\n function (\n BaseModel,\n ) {\n return class Price extends BaseModel {\n static isType(type) {\n return type == 'prices' || type == 'price';\n }\n };\n },\n]);\n","app.factory('PrintService', [\n '$q',\n '$http',\n 'api',\n 'Product',\n 'BaseModel',\n 'log',\n function (\n $q,\n $http,\n api,\n Product,\n BaseModel,\n log,\n ) {\n return class PrintService extends BaseModel {\n static isType(type) {\n return type == 'print_services' || type == 'printservice';\n }\n\n static async findById(printServiceId, productTags = null) {\n const requestOptions = {\n include: 'products.prices',\n };\n\n // Check for product tags\n if (productTags && productTags.length) {\n productTags = productTags.map(productTag => productTag.name);\n productTags.push('null');\n\n requestOptions['filter[tags]'] = productTags.join(',');\n }\n\n const response = await api.get(\n `clients/this/printServices/${printServiceId}`,\n requestOptions\n );\n\n const printService = PrintService.mapModel(response);\n if (!printService) {\n log.error('Could not find print service: ' + printServiceId);\n return;\n }\n\n return printService;\n }\n\n get products() {\n if (!this._products) {\n this._products = this.findAllRelated('products', Product);\n }\n return this._products;\n }\n };\n },\n]);\n","app.factory('ProductImage', [\n 'BaseModel',\n function (\n BaseModel,\n ) {\n return class ProductImage extends BaseModel {\n static isType(type) {\n return type == 'product_images' || type == 'productimage';\n }\n\n get metaData() {\n return this.attributes.meta_data || {};\n }\n };\n },\n]);\n","app.factory('ProductTag', [\n 'BaseModel',\n function (\n BaseModel,\n ) {\n return class ProductTag extends BaseModel {\n static isType(type) {\n return type == 'product_tags' || type == 'producttag';\n }\n };\n },\n]);\n","app.factory('Product', [\n 'BaseModel',\n 'Price',\n 'ProductTag',\n 'ProductImage',\n 'config',\n function (\n BaseModel,\n Price,\n ProductTag,\n ProductImage,\n config,\n ) {\n return class Product extends BaseModel {\n static isType(type) {\n return type == 'products' || type == 'product';\n }\n\n get prices() {\n if (!this._prices) {\n this._prices = this.findAllRelated('prices', Price);\n }\n return this._prices;\n }\n\n get productTags() {\n if (!this._productTags) {\n this._productTags = this.findAllRelated(['product_tags', 'productTags'], ProductTag);\n }\n return this._productTags;\n }\n\n get productImages() {\n if (!this._productImages) {\n this._productImages = this.findAllRelated(['product_images', 'productImages'], ProductImage);\n }\n return this._productImages;\n }\n\n hasTags(tags) {\n if (!this.productTags || !this.productTags.length) {\n return false;\n }\n\n for (const productTag of this.productTags) {\n let productTagName = productTag.attributes.name.toLowerCase();\n for (const tag of tags) {\n let tagName = tag.attributes ? tagName.attributes.name : tag.name;\n if (!tagName) {\n continue;\n }\n tagName = tagName.toLowerCase();\n\n if (productTagName === tagName) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n isPromoProduct() {\n return this.hasTags(config.promo.productTags);\n }\n\n getRelatedProducts(products) {\n return products.filter(product => {\n return product.formatName() === this.formatName();\n });\n }\n\n getProductSize() {\n let width = null;\n let height = null;\n let ratio = null;\n if (this.attributes.pixel_width && this.attributes.pixel_height) {\n width = this.attributes.pixel_width;\n height = this.attributes.pixel_height;\n } else if (this.attributes.metric && this.attributes.width && this.attributes.height) {\n width = (this.attributes.width / 25.4) * 300;\n height = (this.attributes.height / 25.4) * 300;\n } else if (this.attributes.width && this.attributes.height) {\n width = this.attributes.width * 300;\n height = this.attributes.height * 300;\n }\n\n ratio = width < height ? width / height : height / width;\n\n return {\n width,\n height,\n ratio,\n };\n }\n\n get printServiceSettings() {\n if (!this._printServiceSettings) {\n if (config.api.printicular.deliveryPrintService.id == this.attributes.print_service_id) {\n this._printServiceSettings = config.api.printicular.deliveryPrintService;\n } else {\n this._printServiceSettings = config.api.printicular.pickUpPrintServices.find(printService => printService.id == this.attributes.print_service_id);\n }\n if (!this._printServiceSettings) {\n this._printServiceSettings = {};\n }\n }\n return this._printServiceSettings;\n }\n\n get settings() {\n if (!this._settings) {\n this._settings = {};\n if (this.printServiceSettings && this.printServiceSettings.productSettings) {\n this._settings = this.printServiceSettings.productSettings[this.id] || {};\n }\n }\n return this._settings;\n }\n\n formatName() {\n return this.settings.name || this.attributes.short_description || this.attributes.name;\n }\n\n get enabled() {\n if (this.printServiceSettings.autoEnableProducts) {\n return true;\n }\n return this.settings.enabled;\n }\n\n get minRes() {\n return this.settings.minRes;\n }\n\n get sortOrder() {\n return this.settings.sortOrder;\n }\n\n get description() {\n return this.settings.description;\n }\n\n get categorySettings() {\n if (!this._categorySettings) {\n this._categorySettings = {};\n if (this.printServiceSettings && this.printServiceSettings.categorySettings) {\n this._categorySettings = this.printServiceSettings.categorySettings[this.attributes.category_id] || {};\n }\n }\n return this._categorySettings;\n }\n\n get limit() {\n return this.categorySettings.limit;\n }\n\n get categoryName() {\n return this.categorySettings.name || this.attributes.category_name;\n }\n\n get metaData() {\n return this.attributes.meta_data ? this.attributes.meta_data : {};\n }\n };\n },\n]);\n","app.factory('Store', [\n 'BaseModel',\n 'Product',\n 'cart',\n function (\n BaseModel,\n Product,\n cart,\n ) {\n return class Store extends BaseModel {\n static isType(type) {\n return type == 'stores' || type == 'store';\n }\n\n get products() {\n if (!this._products) {\n if (this.attributes.productCodes) {\n this._products = cart.getPrintServiceProducts().filter((printServiceProduct) => {\n return this.attributes.productCodes.indexOf(printServiceProduct.attributes.product_code) !== -1;\n });\n } else {\n this._products = this.findAllRelated('products', Product);\n }\n }\n return this._products;\n }\n\n hasCartProducts() {\n for (const productId of cart.lineItems.map(l => l.product.id)) {\n if (!productId) {\n continue;\n }\n if (!this.products.find(p => p.id == productId)) {\n return false;\n }\n }\n return true;\n }\n\n get printServiceId() {\n return this.attributes.print_service_id || this.relationships.printService.data.id;\n }\n\n createMapMarker() {\n // Hard code marker images because we don't have data to detect this currently\n let storeMarkerIcon = 'red';\n const markerIcons = [\n 'bartell',\n 'cvs',\n 'duane-reade',\n 'longs-drugs',\n 'navarro',\n 'target',\n 'walgreens-flag',\n 'walgreens',\n 'warehouse-stationery',\n ];\n for (const markerIcon of markerIcons) {\n const normalizedName = markerIcon.replace(/-/g, ' ');\n if (this.attributes.name.toLowerCase().indexOf(normalizedName) !== -1) {\n storeMarkerIcon = markerIcon;\n break;\n }\n }\n const iconUrl = `images/markers/${storeMarkerIcon}.png`;\n\n return {\n id: 'store-' + this.id,\n latitude: this.attributes.latitude,\n longitude: this.attributes.longitude,\n iconUrl,\n data: {\n store: this,\n },\n };\n }\n\n formatAddress() {\n const result = [];\n result.push(this.attributes.address || this.attributes.storeAddress1 || '');\n result.push('\\n');\n result.push(this.attributes.city || this.attributes.storeCity || '');\n result.push(this.attributes.postcode || this.attributes.storePostCode || '');\n return result.filter(part => part != '').join(' ');\n }\n };\n },\n]);\n","const breakpoints = {\n xs: [0, 575],\n sm: [576, 767],\n md: [768, 991],\n lg: [992],\n};\n\nfunction validateSize (size) {\n if (!breakpoints[size]) {\n throw new Error('Invaild breakpoint given. Valid sizes are ' + Object.keys(breakpoints).join(', '));\n }\n}\n\nconst browser = {\n isIe11: !!window.MSInputMethodContext && !!document['documentMode'],\n isSafari: /^((?!chrome|android).)*safari/i.test(navigator.userAgent),\n isAndroid: (navigator.userAgent.toLowerCase().indexOf('android') > -1),\n isIos: /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream,\n isSupported () {\n return !this.isUnsupported();\n },\n isUnsupported () {\n return (\n this.isIe11\n );\n },\n mediaBreakpointUp (size) {\n validateSize(size);\n return window.innerWidth >= breakpoints[size][0];\n },\n mediaBreakpointDown (size) {\n validateSize(size);\n const px = breakpoints[size][1] || breakpoints[size][0];\n return window.innerWidth < px;\n },\n\n breakpoint () {\n for (let key of Object.keys(breakpoints).reverse()) {\n if (this.mediaBreakpointUp(key)) {\n return key;\n }\n }\n\n return 'xl';\n },\n};\n\n\napp.factory('browser', [function () {\n return browser;\n}]);\n","app.factory('CartImageData', [\n 'CartImage',\n function (\n CartImage,\n ) {\n return class CartImageData extends CartImage {\n constructor(key, data, upload) {\n super(key, null, upload, null);\n this.data = data;\n }\n\n isErrored() {\n return this.upload.error;\n }\n };\n },\n]);\n","app.factory('CartImage', [\n function (\n ) {\n return class CartImage {\n constructor(key, file, upload, thumbnail) {\n this.key = key;\n this.file = file;\n this.upload = upload;\n this.thumbnail = thumbnail;\n }\n\n isReady() {\n if (this.upload.image && this.upload.image.data.id) {\n return true;\n }\n return false;\n }\n\n isStarted() {\n return this.upload.started;\n }\n\n isErrored() {\n return this.thumbnail.error || this.upload.error;\n }\n\n getProgress() {\n return this.upload.progress;\n }\n\n isCanvas() {\n return this.thumbnail.canvas ? true : false;\n }\n\n getSrc() {\n if (!this.thumbnail.image) {\n return null;\n }\n return this.thumbnail.image.src;\n }\n\n getWidth () {\n if (this.thumbnail && this.thumbnail.image) {\n return this.thumbnail.image.width || 0;\n }\n\n return 0;\n }\n\n getHeight () {\n if (this.thumbnail && this.thumbnail.image) {\n return this.thumbnail.image.height || 0;\n }\n\n return 0;\n }\n\n getImageId() {\n return this.upload.image.data.id;\n }\n\n getType() {\n if (this.file && this.file.type) {\n return this.file.type;\n }\n return 'image/jpeg';\n }\n\n canEnlarge() {\n return this.isCanvas() || this.getSrc();\n }\n\n getOrientation () {\n return this.getWidth() > this.getHeight() ? 'landscape' : 'portrait';\n }\n };\n },\n]);\n","app.factory('CartLineItemPage', [\n '$http',\n '$q',\n 'log',\n function (\n $http,\n $q,\n log,\n ) {\n return class CartLineItemPage {\n constructor({ name, icon, template, templates, alwaysShowLayouts }) {\n this.name = name;\n this.icon = icon;\n this.template = template;\n this.templates = templates;\n this.alwaysShowLayouts = alwaysShowLayouts;\n this.svg = null;\n this.loading = false;\n this.data = {};\n this.regions = {};\n }\n\n load() {\n log.debug('Loading page template', this.template);\n\n return $q((resolve, reject) => {\n if (this.template.svg) {\n resolve(this.template.svg);\n return;\n }\n\n this.loading = true;\n $http.get(this.template.url).then((response) => {\n this.loading = false;\n this.template.svg = response.data;\n\n\n resolve(this.template.svg);\n }, (error) => {\n this.loading = false;\n log.error('Failed to load page template.', error);\n reject(error);\n });\n });\n }\n\n setTemplate(template) {\n this.template = template;\n\n return this.load();\n }\n\n getRegion(element) {\n const elementData = $(element).data('region');\n if (!this.regions[elementData.id]) {\n this.regions[elementData.id] = elementData.input;\n }\n elementData.input = this.regions[elementData.id];\n return elementData;\n }\n\n get vertical() {\n return this.template.orientation == 'portrait';\n }\n };\n },\n]);\n","app.factory('CartLineItem', [\n '$rootScope',\n 'browser',\n 'config',\n 'gtm',\n 'log',\n 'Unique',\n function (\n $rootScope,\n browser,\n config,\n gtm,\n log,\n Unique,\n ) {\n return class CartLineItem {\n constructor({ cart, image, product = null, quantity = 1, settings = {}}) {\n this.id = Unique.inc('line-item');\n this.cart = cart;\n this.image = image;\n this.product = product;\n this.quantity = quantity;\n this.settings = settings;\n this._previewSvg = null;\n\n if (!this.product) {\n this.product = this.getDefaultProduct();\n }\n }\n\n get previewSvg () {\n return this._previewSvg || this.svg;\n }\n\n set previewSvg (svg) {\n this._previewSvg = svg;\n }\n\n changeQuantity() {\n if (this.quantity > config.maxQuantity) {\n this.quantity = config.maxQuantity;\n }\n if (this.quantity < 0) {\n this.quantity = 0;\n }\n this.cart.updateSummary();\n }\n\n increaseQuantity() {\n if (this.quantity < config.maxQuantity) {\n this.quantity++;\n }\n this.changeQuantity();\n }\n\n decreaseQuantity() {\n if (this.quantity > 0) {\n this.quantity--;\n }\n this.changeQuantity();\n }\n\n setProduct(product) {\n if (this.product && this.product.id == product.id) {\n return false;\n }\n log.debug('Setting product to ' + product.formatName());\n this.product = product;\n this.cropRectPos = null;\n this.svg = null;\n this._previewSvg = null;\n this.settings = {};\n\n if (product) {\n gtm.push({\n event: 'Select size',\n productName: product.formatName(),\n productId: product.id,\n });\n }\n this.cart.updateSummary();\n $rootScope.$broadcast('changeProduct');\n return true;\n }\n\n setImage(image) {\n this.image = image;\n }\n\n isLowRes() {\n if (!this.image || !this.image.thumbnail || !this.image.thumbnail.image || !this.product) {\n return;\n }\n if (this.getImageWidth() < this.getProductMinWidth() || this.getImageHeight() < this.getProductMinHeight()) {\n return true;\n }\n return false;\n }\n\n getProductMinWidth() {\n let threshold = this.product.minRes;\n if (!threshold) {\n return '?';\n }\n threshold = threshold / 100;\n const productSize = this.product.getProductSize();\n return Math.max(productSize.width, productSize.height) * threshold;\n }\n\n getProductMinHeight() {\n let threshold = this.product.minRes;\n if (!threshold) {\n return;\n }\n threshold = threshold / 100;\n const productSize = this.product.getProductSize();\n return Math.min(productSize.width, productSize.height) * threshold;\n }\n\n getProductWidth() {\n const productSize = this.product.getProductSize();\n return Math.max(productSize.width, productSize.height);\n }\n\n getProductHeight() {\n const productSize = this.product.getProductSize();\n return Math.min(productSize.width, productSize.height);\n }\n\n getImageWidth() {\n if (this.cropRectPos) {\n return Math.round(Math.max(this.cropRectPos.width, this.cropRectPos.height));\n }\n return Math.max(this.image.thumbnail.image.width, this.image.thumbnail.image.height);\n }\n\n getImageHeight() {\n if (this.cropRectPos) {\n return Math.round(Math.min(this.cropRectPos.width, this.cropRectPos.height));\n }\n return Math.min(this.image.thumbnail.image.width, this.image.thumbnail.image.height);\n }\n\n isAutoCropped() {\n if (this.cropRectPos || !this.product || !this.canCrop() || !this.image.thumbnail) {\n return false;\n }\n const productSize = this.product.getProductSize();\n const imageAspectRatio = this.image.thumbnail.width < this.image.thumbnail.height ? this.image.thumbnail.width / this.image.thumbnail.height : this.image.thumbnail.height / this.image.thumbnail.width;\n const productAspectRatio = productSize.width < productSize.height ? productSize.width / productSize.height : productSize.height / productSize.width;\n\n return Math.abs(imageAspectRatio - productAspectRatio) > 0.01;\n }\n\n canCrop() {\n if (browser.isIe11) {\n return false;\n }\n\n if (this.canEdit()) {\n return false;\n }\n\n return this.product ? true : false;\n }\n\n getImageType() {\n if (this.svg) {\n return 'svg';\n }\n if (this.image.isCanvas()) {\n return 'canvas';\n }\n return 'img';\n }\n\n getImageId() {\n return this.image.getImageId();\n }\n\n canChangeProduct() {\n return true;\n }\n\n canDuplicate() {\n return true;\n }\n\n canEdit() {\n return this.product.productImages.filter(img => !!img.attributes.meta_data.frame).length > 0;\n }\n\n edit() {\n if (this.canEdit()) {\n return $rootScope.openModal({\n name: 'modalFrameFlow',\n lineItem: this,\n });\n }\n\n if (this.canCrop()) {\n return $rootScope.cropLineItem(this);\n }\n }\n\n isErrored() {\n if (this.image && this.image.isErrored()) {\n return true;\n }\n return false;\n }\n\n isReady() {\n if (this.image && this.image.isReady()) {\n return true;\n }\n return false;\n }\n\n getOrderJson() {\n if (!this.quantity || !this.product || this.isErrored()) {\n return null;\n }\n let lineItemJson = {\n type: 'line_items',\n attributes: {\n product_id: this.product ? this.product.id : null,\n quantity: Math.min(this.quantity, config.maxQuantity),\n vertical: this.cropRectPos && this.cropRectPos.orientation == 'portrait' ? true : false,\n },\n };\n if (this.product.metaData.frame && this.product.metaData.frame.duplicateImage) {\n lineItemJson.attributes.image_ids = [\n this.getImageId(),\n this.getImageId(),\n ];\n } else if (this.getImageId()) {\n lineItemJson.attributes.image_id = this.getImageId();\n }\n\n if (this.svg) {\n lineItemJson.attributes.svg = this.svg.replace(/xlink:href=\".*?\"/, 'xlink:href=\"\"');\n }\n\n return lineItemJson;\n }\n\n getAvailableProducts() {\n const filter = (product) => {\n if (!product.enabled) {\n return false;\n }\n if (!product.prices.length) {\n return false;\n }\n return true;\n };\n if (this.cart.fulfillment === 'pickup' && config.flow !== 'products-first' && this.cart.store) {\n return this.cart.getStoreProducts()\n .filter(filter);\n }\n // Delivery or product first flow\n return this.cart.getPrintServiceProducts()\n .filter(filter);\n }\n\n getDefaultProduct() {\n const products = this.getAvailableProducts();\n if (this.product) {\n const defaultExistingProduct = products.find((product) => {\n return this.product.attributes.name == product.attributes.name;\n });\n if (defaultExistingProduct) {\n return defaultExistingProduct;\n }\n }\n for (const product of products) {\n return product;\n }\n log.debug('Could not find default product', this);\n }\n };\n },\n]);\n","// app.factory('CartPromoProductImage', [\n// function (\n// ) {\n// return class CartPromoProductImage {\n// constructor(key, product) {\n// this.key = key;\n// this.product = product;\n// }\n\n// isReady() {\n// return true;\n// }\n\n// isStarted() {\n// return true;\n// }\n\n// isErrored() {\n// return false;\n// }\n\n// getProgress() {\n// return 1;\n// }\n\n// isCanvas() {\n// return false;\n// }\n\n// isPromoProduct() {\n// return true;\n// }\n\n// canEnlarge() {\n// return true;\n// }\n\n// getImageId() {\n// return null;\n// }\n\n// getProductImageUrl() {\n// for (const productImage of this.product.productImages){\n// return productImage.attributes.thumbnail;\n// }\n// }\n// };\n// },\n// ]);\n","app.factory('CartReorderImage', [\n function (\n ) {\n return class CartReorderImage {\n constructor(key, thumbnailUrl, imageId) {\n this.key = key;\n this.thumbnailUrl = thumbnailUrl;\n this.imageId = imageId;\n }\n\n isReady() {\n return true;\n }\n\n isStarted() {\n return true;\n }\n\n isErrored() {\n return false;\n }\n\n getProgress() {\n return 1;\n }\n\n isCanvas() {\n return false;\n }\n\n isUpload() {\n return false;\n }\n\n canEnlarge() {\n return false;\n }\n\n getImageId() {\n return this.imageId;\n }\n\n getSrc() {\n return this.thumbnailUrl;\n }\n };\n },\n]);\n","app.factory('cart', [\n '$q',\n '$rootScope',\n '$timeout',\n 'api',\n 'CartImage',\n 'CartImageData',\n 'CartLineItem',\n 'CartReorderImage',\n 'config',\n 'gtm',\n 'imageUploader',\n 'Locale',\n 'log',\n 'Product',\n 'thumbnailer',\n function (\n $q,\n $rootScope,\n $timeout,\n api,\n CartImage,\n CartImageData,\n CartLineItem,\n CartReorderImage,\n config,\n gtm,\n imageUploader,\n Locale,\n log,\n Product,\n thumbnailer,\n ) {\n let nextId = 1;\n\n const Cart = class {\n constructor() {\n this.lineItems = [];\n this.images = {};\n this.summary = {};\n this.store = null;\n this.deliveryProducts = null;\n this.pickupProducts = {};\n this.name = config.storageGet('name') || '';\n this.email = config.storageGet('email') || '';\n this.phone = config.storageGet('phone') || '';\n this.enableSms = config.storageGet('enableSms') !== false;\n this.addressLine1 = config.storageGet('addressLine1') || '';\n this.addressCity = config.storageGet('addressCity') || '';\n this.addressTerritoryId = config.storageGet('addressTerritoryId');\n this.addressRegion = config.storageGet('addressRegion') || '';\n this.addressPostCode = config.storageGet('addressPostCode') || '';\n this.orderNumber = null;\n this.updatingPrices = false;\n this.couponCode = null;\n this.updateSummaryDebounce = null;\n this.validations = {};\n\n this.fulfillment = config.storageGet('fulfillment') || 'pickup';\n if (!config.api.printicular.deliveryPrintService.id) {\n this.fulfillment = 'pickup';\n }\n }\n\n addLineItem(cartLineItem) {\n log.verbose('Add line item', cartLineItem);\n this.lineItems.push(cartLineItem);\n $rootScope.$broadcast('changeProduct');\n this.updateSummary();\n }\n\n removeLineItem(lineItem) {\n const index = this.lineItems.indexOf(lineItem);\n if (index !== -1) {\n this.lineItems.splice(index, 1);\n $rootScope.$broadcast('changeProduct');\n this.updateSummary();\n }\n }\n\n hasLineItems () {\n return this.lineItems.length > 0;\n }\n\n setStore(store, fireEvent = true) {\n log.verbose('Set store', store);\n this.currency = null;\n this.store = store;\n if (store) {\n config.storageSet('store', store.id);\n if (fireEvent) {\n gtm.push({\n event: 'Select store',\n storeName: store.attributes.name,\n storeId: store.id,\n });\n }\n }\n this.resetDefaultProducts('set store');\n this.updateSummary();\n }\n\n getAllProducts() {\n if (this.fulfillment === 'pickup' && config.flow !== 'products-first' && this.store) {\n return this.getStoreProducts();\n }\n // Delivery or product first flow\n return this.getPrintServiceProducts();\n }\n\n setPickupProducts(pickupProducts, printServiceId) {\n this.pickupProducts[printServiceId] = this.sortProducts(pickupProducts);\n log.debug('Available pickup products', this.pickupProducts);\n }\n\n setDeliveryProducts(deliveryProducts) {\n this.deliveryProducts = this.sortProducts(deliveryProducts);\n log.debug('Available delivery products', this.deliveryProducts);\n }\n\n resetDefaultProducts(why) {\n log.debug('Reset default products ' + why);\n for (const lineItem of this.lineItems) {\n if (!lineItem.getDefaultProduct() && !this.hasNoProducts()) {\n if (!confirm('Are you sure you want to do this, this will remove items from your cart?')) {\n return false;\n }\n break;\n }\n }\n for (const lineItem of this.lineItems) {\n const defaultProduct = lineItem.getDefaultProduct();\n if (defaultProduct) {\n lineItem.setProduct(defaultProduct);\n } else if (!this.hasNoProducts()) {\n this.removeLineItem(lineItem);\n }\n }\n return true;\n }\n\n hasNoProducts() {\n return (\n this.store &&\n this.fulfillment == 'pickup' &&\n this.store.products.length < 1\n );\n }\n\n sortProducts(products, sortCallback) {\n let collator = null;\n try {\n collator = new Intl.Collator(undefined, {\n numeric: true,\n sensitivity: 'base',\n });\n } catch (e) {\n // Ignore\n }\n const currency = this.getCurrency();\n products.sort((a, b) => {\n // Sort by cheapest first (or override sort order in config)\n let aPrice = a.prices.find(price => price.attributes.currency === currency);\n aPrice = aPrice && aPrice.attributes.total ? aPrice.attributes.total : 100000;\n if (a.sortOrder) {\n aPrice = -a.sortOrder;\n }\n let bPrice = b.prices.find(price => price.attributes.currency === currency);\n bPrice = bPrice && bPrice.attributes.total ? bPrice.attributes.total : 100000;\n if (b.sortOrder) {\n bPrice = -b.sortOrder;\n }\n if (aPrice != bPrice) {\n return aPrice - bPrice;\n }\n if (!collator) {\n return 0;\n }\n // Sort by name if price is the same\n const aSortAttr = sortCallback ? sortCallback(a) : a.attributes.name;\n const bSortAttr = sortCallback ? sortCallback(b) : b.attributes.name;\n return collator.compare(aSortAttr, bSortAttr);\n\n });\n return products;\n }\n\n updateSummary() {\n if (this.updateSummaryDebounce) {\n $timeout.cancel(this.updateSummaryDebounce.timer);\n this.updateSummaryDebounce.timer = $timeout(this.updateSummaryBounced.bind(this), 300);\n } else {\n const defer = $q.defer();\n this.updateSummaryDebounce = {\n timer: $timeout(this.updateSummaryBounced.bind(this), 300),\n defer: defer,\n };\n }\n return this.updateSummaryDebounce.defer.promise;\n }\n\n updateSummaryBounced() {\n log.verbose('Update summary');\n nextId++;\n const updatingSummary = nextId;\n let totalQuantity = 0;\n let totalReady = 0;\n let totalUnready = 0;\n const currency = this.getCurrency();\n this.summary = {\n rows: [],\n };\n for (const lineItem of this.lineItems) {\n if (lineItem.isErrored()) {\n continue;\n }\n if (lineItem.product) {\n const name = lineItem.product.formatName();\n let summaryRow = this.summary.rows.find(r => r.name == name);\n if (!summaryRow) {\n summaryRow = {\n name: name,\n product: lineItem.product,\n quantity: 0,\n price: 0,\n };\n this.summary.rows.push(summaryRow);\n }\n summaryRow.quantity += lineItem.quantity;\n\n let price = 0;\n if (lineItem.product) {\n let productPrice = lineItem.product.prices.find(p => p.attributes.currency == currency);\n if (productPrice) {\n price = productPrice.attributes.total * summaryRow.quantity;\n }\n }\n summaryRow.price += price;\n }\n if (lineItem.isReady()) {\n totalReady++;\n } else {\n totalUnready++;\n }\n\n totalQuantity += lineItem.quantity;\n }\n\n this.summary.totalPrice = null;\n this.summary.totalQuantity = totalQuantity;\n this.summary.totalUnready = totalUnready;\n this.summary.totalReady = totalReady;\n this.summary.totalUploadedPercent = 1;\n\n this.validateLineItem();\n\n if (totalReady + totalUnready > 0) {\n this.summary.totalUploadedPercent = Math.max(totalReady / (totalReady + totalUnready), 0.1);\n }\n\n if (this.summary.totalQuantity && !this.orderNumber) {\n window.onbeforeunload = () => true;\n } else {\n window.onbeforeunload = null;\n }\n\n log.verbose('Cart summary', this.summary);\n\n if (this.summary.totalQuantity > 0 && this.summary.totalUnready == 0) {\n if (this.fulfillment == 'delivery') {\n this.dryRunErrors = this.validate(true);\n if (this.dryRunErrors.length) {\n this.resolveUpdateSummary();\n return;\n }\n }\n const orderJson = this.getOrderJson(true);\n if (orderJson) {\n this.updatingPrices = true;\n api.post('users/0/orders?include=store,lineItems,products', orderJson).then((response) => {\n if (updatingSummary != nextId) {\n return;\n }\n this.updatingPrices = false;\n const serverSummaryRows = [];\n for (let i = 0; i < response.included.length; i++) {\n if (response.included[i].type == 'line_items') {\n const productId = response.included[i].attributes.product_id;\n const productData = response.included.find(i => i.type == 'products' && i.id == productId);\n if (productData) {\n const product = Product.fromJsonApi(productData, response.included);\n const name = product.formatName();\n let serverSummaryRow = serverSummaryRows.find(r => r.name == name);\n if (!serverSummaryRow) {\n serverSummaryRow = {\n name: name,\n product: product,\n quantity: 0,\n price: 0,\n };\n serverSummaryRows.push(serverSummaryRow);\n }\n serverSummaryRow.price += response.included[i].attributes.total;\n serverSummaryRow.quantity += response.included[i].attributes.quantity;\n }\n }\n }\n this.summary.rows = serverSummaryRows;\n this.summary.shipping = response.data.attributes.freight_total;\n this.summary.shippingDiscount = response.data.attributes.freight_discount;\n this.summary.totalPrice = response.data.attributes.total;\n this.summary.totalDiscount = response.data.attributes.vendor_discount || response.data.attributes.subtotal_discount;\n this.summary.couponCode = this.couponCode;\n this.validateLineItem();\n this.resolveUpdateSummary();\n }).catch((response) => {\n this.updatingPrices = false;\n this.dryRunErrors = log.mapErrors(response);\n log.debug('Dry run error', response, this.dryRunErrors);\n this.validateLineItem();\n this.resolveUpdateSummary();\n });\n return;\n } else {\n log.verbose('Not fetching prices, order JSON empty', orderJson);\n }\n }\n this.resolveUpdateSummary();\n }\n\n resolveUpdateSummary() {\n if (this.updateSummaryDebounce) {\n this.updateSummaryDebounce.defer.resolve();\n this.updateSummaryDebounce = null;\n }\n }\n\n validateLineItem() {\n let lineItemErrors = [];\n\n const maxTotalQuantity = this.getMaxTotalQuantity();\n if (maxTotalQuantity && this.summary.totalQuantity && this.summary.totalQuantity > maxTotalQuantity) {\n lineItemErrors.push(`The maximum number of items per order is ${maxTotalQuantity}. Please remove ${this.summary.totalQuantity - maxTotalQuantity} to continue.`);\n }\n\n const maxTotalValue = this.getMaxTotalValue();\n if (maxTotalValue && this.summary.totalPrice && this.summary.totalPrice > maxTotalValue) {\n lineItemErrors.push(`The maximum order value is $ ${maxTotalValue}. Please remove some items to continue.`);\n }\n\n const categoryCounts = {};\n for (const lineItem of this.lineItems) {\n if (!lineItem.product || !(lineItem.product.limit > 0)) {\n continue;\n }\n if (!categoryCounts[lineItem.product.attributes.category_id]) {\n categoryCounts[lineItem.product.attributes.category_id] = {\n id: lineItem.product.attributes.category_id,\n name: lineItem.product.categoryName,\n count: 0,\n limit: lineItem.product.limit,\n };\n }\n categoryCounts[lineItem.product.attributes.category_id].count += lineItem.quantity;\n }\n for (const id in categoryCounts) {\n if (categoryCounts[id].count > categoryCounts[id].limit) {\n lineItemErrors.push(`The maximum number of ${categoryCounts[id].name} per order is ${categoryCounts[id].limit}. Please remove ${categoryCounts[id].count - categoryCounts[id].limit} to continue.`);\n }\n }\n\n for (const key in this.validations) {\n this.validations[key](lineItemErrors);\n }\n\n this.lineItemErrors = lineItemErrors;\n }\n\n getPostCodeType() {\n if (this.store) {\n let territory = $rootScope.territories ? $rootScope.territories.find(territory => territory.id == this.store.attributes.territory_id) : null;\n if (territory && territory.attributes.country_code == 'US') {\n return 'zip';\n }\n }\n if (this.addressCountry && this.addressCountry.attributes.country_code == 'US') {\n return 'zip';\n }\n return 'postcode';\n }\n\n getCurrency() {\n if (this.currency) {\n return this.currency;\n }\n const productCurrencies = this.getProductCurrencies();\n const userCurrency = this.getUserCurrency(productCurrencies);\n\n if (userCurrency) {\n log.verbose('Using user currency', userCurrency);\n this.currency = userCurrency;\n return this.currency;\n }\n\n if (productCurrencies[0]) {\n log.verbose('Using common product currency', productCurrencies);\n this.currency = productCurrencies[0];\n return this.currency;\n }\n\n if (config.locale.currency) {\n log.verbose('Using config currency', config.locale.currency);\n this.currency = config.locale.currency;\n return this.currency;\n }\n\n log.error('Could not get currency from products or config, defaulting to USD');\n this.currency = 'USD';\n return this.currency;\n }\n\n getUserCurrency(productCurrencies) {\n if (!this.addressCountry || !this.addressCountry.attributes.country_code) {\n return null;\n }\n const userCurrency = Locale.getCountryCurrency(this.addressCountry.attributes.country_code);\n if (productCurrencies.indexOf(userCurrency) !== -1) {\n return userCurrency;\n }\n return null;\n }\n\n getProductCurrencies() {\n const currencies = {};\n let retailerId = null;\n if (this.store && this.store.attributes.retailer_id) {\n retailerId = this.store.attributes.retailer_id || null;\n }\n log.verbose('Store retailer', retailerId, this.store);\n for (const lineItem of this.lineItems) {\n if (!lineItem.product) {\n continue;\n }\n for (const price of lineItem.product.prices) {\n if (retailerId != (price.attributes.retailer_id || null) || !price.attributes.currency) {\n continue;\n }\n if (!currencies[price.attributes.currency]) {\n currencies[price.attributes.currency] = 0;\n }\n currencies[price.attributes.currency]++;\n }\n }\n log.verbose('Currencies', currencies);\n return Object.keys(currencies).sort((a, b) => currencies[a] - currencies[b]);\n }\n\n getMaxTotalQuantity() {\n return this.getMaxValueByFulfillmentType(config.pickupMaxTotalQuantity, config.deliveryMaxTotalQuantity);\n }\n\n getMaxTotalValue() {\n return this.getMaxValueByFulfillmentType(config.pickupMaxTotalValue, config.deliveryMaxTotalValue);\n }\n\n getMaxValueByFulfillmentType(pickupValue, deliveryValue) {\n if (this.fulfillment == 'pickup' && pickupValue) {\n return pickupValue;\n }\n if (this.fulfillment == 'delivery' && deliveryValue) {\n return deliveryValue;\n }\n return false;\n }\n\n validate(dryRun = false) {\n const errors = [];\n if (this.summary.totalQuantity == 0) {\n errors.push('You must have at least 1 print to continue.');\n }\n if (!dryRun && !this.name) {\n errors.push('Your full name is required.');\n }\n if (!dryRun) {\n if (!this.phone) {\n errors.push('Your phone number is required.');\n } else {\n if (!this.validatePhoneNumber(this.phone)) {\n errors.push('Your phone number is invalid.');\n }\n }\n }\n if (!dryRun) {\n if (!this.email) {\n errors.push('Your email address is required.');\n } else {\n if (!this.validateEmail(this.email)) {\n errors.push('Your email is invalid.');\n }\n }\n }\n if (this.fulfillment == 'delivery') {\n if (!this.addressLine1) {\n errors.push('Your shipping address is required.');\n }\n if (!this.addressCity) {\n errors.push('Your shipping address city is required.');\n }\n if (!this.addressPostCode) {\n errors.push('Your shipping address postcode is required.');\n }\n if (!this.addressRegion) {\n errors.push('Your shipping address state/region is required.');\n }\n if (!this.addressCountry || !this.addressCountry.id) {\n errors.push('Your shipping address country is required.');\n }\n }\n log.verbose('Cart validation', errors);\n return errors;\n }\n\n validateEmail(email) {\n var re = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email);\n }\n\n validatePhoneNumber(phoneNumber) {\n return this.cleanPhoneNumber(phoneNumber).length > 4;\n }\n\n cleanPhoneNumber(phoneNumber) {\n return phoneNumber.replace(/[^0-9]+/g, '');\n }\n\n getOrderJson(dryRun = true, stripeToken) {\n if (this.fulfillment == 'pickup' && !this.store) {\n log.verbose('No store when pickup, cant make order JSON');\n return null;\n }\n\n config.storageSet('name', this.name);\n config.storageSet('email', this.email);\n config.storageSet('phone', this.phone);\n config.storageSet('enableSms', this.enableSms);\n config.storageSet('addressLine1', this.addressLine1);\n // config.storageSet('addressLine2', this.addressLine2);\n config.storageSet('addressCity', this.addressCity);\n config.storageSet('addressTerritoryId', this.addressCountry ? this.addressCountry.id : null);\n config.storageSet('addressRegion', this.addressRegion);\n config.storageSet('addressPostCode', this.addressPostCode);\n const addressJson = {\n phone: dryRun ? '1234567890' : this.cleanPhoneNumber(this.phone),\n email: dryRun ? 'dryrun@example.com' : this.email,\n name: dryRun ? 'Dry Run' : this.name,\n };\n if (this.fulfillment == 'delivery') {\n addressJson.line_1 = this.addressLine1;\n addressJson.city = this.addressCity;\n addressJson.state = this.addressRegion && this.addressRegion.code ? this.addressRegion.code : this.addressRegion;\n addressJson.postcode = this.addressPostCode;\n addressJson.territory_id = this.addressCountry ? this.addressCountry.id : null;\n }\n const meta = {\n device_token: config.deviceToken,\n dryrun: dryRun,\n auto_confirm: !dryRun,\n };\n if (this.couponCode) {\n meta.coupon_code = this.couponCode;\n }\n const order = {\n meta: meta,\n data: {\n type: 'orders',\n attributes: {\n client_version: config.version.toString(),\n client_name: config.api.printicular.clientName,\n currency: this.getCurrency(),\n stripe_token: stripeToken,\n enable_sms: this.enableSms && this.getPrintServiceSettings().enableSms,\n },\n relationships: {\n print_service: {\n data: {\n id: this.fulfillment == 'pickup' ? this.store.printServiceId : config.api.printicular.deliveryPrintService.id,\n type: 'print_services',\n },\n },\n line_items: {\n data: this.lineItems\n .map(lineItem => lineItem.getOrderJson())\n .filter(lineItem => lineItem != null),\n },\n address: {\n data: {\n type: 'addresses',\n attributes: addressJson,\n },\n },\n },\n },\n };\n if (this.fulfillment == 'pickup' && this.store) {\n order.data.relationships.store = {\n data: {\n type: 'stores',\n id: this.store.id,\n },\n };\n }\n if (!order.data.relationships.line_items.data || !order.data.relationships.line_items.data.length) {\n log.verbose('No line item data, cant make order JSON');\n return null;\n }\n return order;\n }\n\n togglePickup() {\n if (this.fulfillment === 'pickup') {\n return;\n }\n this.currency = null;\n this.fulfillment = 'pickup';\n if (!this.resetDefaultProducts('toggle pickup')) {\n this.fulfillment = 'delivery';\n return;\n }\n config.storageSet('fulfillment', this.fulfillment);\n }\n\n toggleDelivery() {\n if (this.fulfillment === 'delivery') {\n return;\n }\n this.currency = null;\n this.fulfillment = 'delivery';\n if (!this.resetDefaultProducts('toggle delivery')) {\n this.fulfillment = 'pickup';\n return;\n }\n config.storageSet('fulfillment', this.fulfillment);\n }\n\n getStoreProducts() {\n return this.pickupProducts[this.store.printServiceId].filter((printServiceProduct) => {\n return this.store.products.find(storeProduct => storeProduct.id == printServiceProduct.id);\n });\n }\n\n getPrintServiceSettings() {\n if (this.fulfillment == 'delivery') {\n return config.api.printicular.deliveryPrintService;\n }\n if (config.api.printicular.pickUpPrintServices.length == 1) {\n return config.api.printicular.pickUpPrintServices[0];\n }\n if (this.store) {\n return config.api.printicular.pickUpPrintServices.find(printService => printService.id == this.store.printServiceId);\n }\n }\n\n getPrintServiceProducts() {\n if (this.fulfillment === 'pickup') {\n for (const printServiceId in this.pickupProducts) {\n return this.pickupProducts[printServiceId];\n }\n log.debug('Could not find print service products', this.pickupProducts);\n return [];\n }\n return this.deliveryProducts;\n }\n\n getLineItemCount() {\n let count = 0;\n for (const lineItem of this.lineItems) {\n if (!lineItem.isErrored()) {\n count++;\n }\n }\n return count;\n }\n\n addImage(file) {\n if (!file.type.startsWith('image/')) {\n $rootScope.uploadErrors.push('Could not upload ' + file.name + ' because it is not a supported image type.');\n return false;\n }\n const key = thumbnailer.getFileKey(file);\n if (this.images[key] && this.images[key].isErrored()) {\n delete this.images[key];\n }\n if (!this.images[key]) {\n this.images[key] = new CartImage(key, file, imageUploader.addFile(file), thumbnailer.addFile(file));\n this.images[key].upload.load.finally(() => {\n this.updateSummary();\n });\n }\n return this.images[key];\n }\n\n addImageData(data, name, mimeType) {\n const key = md5(data);\n if (this.images[key] && this.images[key].isErrored()) {\n delete this.images[key];\n }\n if (!this.images[key]) {\n const file = new Blob([data], {\n type: mimeType,\n lastModified: new Date(),\n });\n file.name = name;\n this.images[key] = new CartImageData(key, data, imageUploader.addFile(file));\n this.images[key].upload.load.finally(() => {\n this.updateSummary();\n });\n }\n return this.images[key];\n }\n\n removeImage(image) {\n delete this.images[image.key];\n this.lineItems = this.lineItems.filter(lineItem => lineItem.image && lineItem.image.key != image.key);\n this.updateSummary();\n }\n\n getLowResCount() {\n let count = 0;\n for (const lineItem of this.lineItems) {\n if (lineItem.isLowRes()) {\n count++;\n }\n }\n return count;\n }\n\n reorder(orderId) {\n const order = config.storageGet('reorder');\n if (order.id != orderId) {\n return;\n }\n const pickupPrintService = config.api.printicular.pickUpPrintServices.find(printService => printService.id == order.printServiceId);\n if (pickupPrintService) {\n this.togglePickup();\n }\n if (order.printServiceId == config.api.printicular.deliveryPrintService.id) {\n this.toggleDelivery();\n }\n this.name = order.name || this.name;\n this.email = order.emailAddress || this.email;\n this.phone = order.phoneNumber || this.phone;\n for (const lineItem of order.lineItems) {\n const key = lineItem.checksum;\n if (!this.images[key]) {\n this.images[key] = new CartReorderImage(key, lineItem.thumbnail, lineItem.imageId);\n }\n let product = this.getPrintServiceProducts().find((product) => {\n return product.id == lineItem.productId;\n });\n if (!product) {\n continue;\n }\n this.lineItems.push(new CartLineItem({\n cart,\n product,\n image: this.images[key],\n quantity: lineItem.quantity,\n }));\n }\n $rootScope.$broadcast('changeProduct');\n this.updateSummary();\n }\n };\n\n const cart = new Cart();\n $rootScope.cart = cart;\n window.CART = cart;\n return cart;\n },\n]);\n","app.factory('config', [\n 'log',\n function (\n log,\n ) {\n return new class Config {\n constructor() {\n log.debug('Config', CONFIG);\n for (const key in CONFIG) {\n this[key] = CONFIG[key];\n }\n\n const currentVersion = this.api.printicular.clientId + ' ' + this.version;\n const storageVersion = this.storageGet('version');\n if (!storageVersion || storageVersion !== currentVersion) {\n for (let i = 0; i < localStorage.length; i++) {\n let key = localStorage.key(i);\n if (key.indexOf(this.localStoragePrefix + '_') === 0) {\n localStorage.removeItem(key);\n }\n }\n this.storageSet('version', currentVersion);\n }\n\n this.deviceToken = this.storageGet('deviceToken');\n if (!this.deviceToken) {\n this.deviceToken = [\n Math.random().toString(36).substr(2, 9),\n Math.random().toString(36).substr(2, 9),\n Math.random().toString(36).substr(2, 9),\n Math.random().toString(36).substr(2, 9),\n ].join('-');\n this.storageSet('deviceToken', this.deviceToken);\n }\n }\n\n storageSet(key, data, prefix = true) {\n if (data === undefined) {\n data = null;\n }\n localStorage.setItem(this.getStorageKey(key, prefix), JSON.stringify(data));\n }\n\n storageGet(key, prefix = true) {\n const storageKey = this.getStorageKey(key, prefix);\n try {\n const item = localStorage.getItem(storageKey);\n if (item === undefined) {\n return null;\n }\n return JSON.parse(item);\n } catch (e) {\n console.error('Failed to parse storage item', storageKey); /* eslint-disable-line no-console */\n console.error(e); /* eslint-disable-line no-console */\n localStorage.removeItem(storageKey);\n return null;\n }\n }\n\n storageRemove(key, prefix = true) {\n localStorage.removeItem(this.getStorageKey(key, prefix));\n }\n\n getStorageKey(key, prefix = true) {\n return (prefix ? this.localStoragePrefix + '_' : '') + key;\n }\n\n url(path) {\n path = path.replace(/^\\/+/, '');\n return $('base').attr('href') + path;\n }\n };\n },\n]);\n","app.factory('cropHelpers', [\n 'Unique',\n 'CropRectPos',\n function (\n Unique,\n CropRectPos,\n ) {\n const CROP_TEMPLATE = `\n \n \n \n `;\n return {\n render (lineItem) {\n const html = $('
    ').append($.parseHTML(CROP_TEMPLATE));\n const svg = html.find('svg');\n const image = html.find('.p-crop-image');\n const cropRectPos = lineItem.CropRectPos || new CropRectPos();\n let view = {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n\n if (!cropRectPos.orientation) {\n cropRectPos.orientation = (lineItem.image.thumbnail.width > lineItem.image.thumbnail.height)\n ? 'landscape'\n : 'portait';\n }\n\n if (cropRectPos.rotation == 1 || cropRectPos.rotation == 3) {\n view.width = lineItem.image.thumbnail.height;\n view.height = lineItem.image.thumbnail.width;\n } else {\n view.width = lineItem.image.thumbnail.width;\n view.height = lineItem.image.thumbnail.height;\n }\n view.x = -view.width / 2;\n view.y = -view.height / 2;\n\n svg.attr({\n viewBox: `${view.x} ${view.y} ${view.width} ${view.height}`,\n width: view.width,\n height: view.height,\n });\n\n image.attr({\n 'xlink:href': lineItem.image.thumbnail.image.src,\n width: lineItem.image.thumbnail.width,\n height: lineItem.image.thumbnail.height,\n }).css({\n transformOrigin: `${lineItem.image.thumbnail.width / 2}px ${lineItem.image.thumbnail.height / 2}px`,\n transform: `translate(-${lineItem.image.thumbnail.width / 2}px, -${lineItem.image.thumbnail.height / 2}px) rotate(${cropRectPos.rotation * 90}deg)`,\n });\n\n cropRectPos.productSize = lineItem.product.getProductSize();\n let cropWidth = view.width;\n let cropHeight = view.height;\n const ratio = view.width / view.height;\n const productRatio = cropRectPos.productWidth / cropRectPos.productHeight;\n if (ratio < productRatio) {\n cropHeight = cropRectPos.productHeight / cropRectPos.productWidth * view.width;\n } else {\n cropWidth = cropRectPos.productWidth / cropRectPos.productHeight * view.height;\n }\n if (!cropRectPos.fixedX && !cropRectPos.fixedY && !cropRectPos.floatX && !cropRectPos.floatY) {\n cropRectPos.fixedX = -cropWidth / 2;\n cropRectPos.fixedY = -cropHeight / 2;\n cropRectPos.floatX = cropRectPos.fixedX + cropWidth;\n cropRectPos.floatY = cropRectPos.fixedY + cropHeight;\n }\n\n const aspect = cropRectPos.getAspectRect();\n svg.removeAttr('width');\n svg.removeAttr('height');\n svg.attr('viewBox', `${aspect.x} ${aspect.y} ${aspect.width} ${aspect.height}`);\n\n return $('
    ').append(svg).html();\n },\n };\n },\n]);\n","app.factory('CropRectPos', [function () {\n return class CropRectPos {\n constructor() {\n this.fixedX = null;\n this.fixedY = null;\n this.floatX = null;\n this.floatY = null;\n this.rotation = 0;\n this.productSize = null;\n this.orientation = null;\n }\n get x() {\n return Math.min(this.fixedX, this.floatX);\n }\n\n get y() {\n return Math.min(this.fixedY, this.floatY);\n }\n\n get width() {\n return Math.abs(this.fixedX - this.floatX);\n }\n\n get height() {\n return Math.abs(this.fixedY - this.floatY);\n }\n\n get productWidth() {\n if (!this.productSize) {\n return null;\n }\n if (this.orientation == 'landscape') {\n return this.productSize.width > this.productSize.height ? this.productSize.width : this.productSize.height;\n }\n return this.productSize.width > this.productSize.height ? this.productSize.height : this.productSize.width;\n }\n\n get productHeight() {\n if (!this.productSize) {\n return null;\n }\n if (this.orientation == 'landscape') {\n return this.productSize.width > this.productSize.height ? this.productSize.height : this.productSize.width;\n }\n return this.productSize.width > this.productSize.height ? this.productSize.width : this.productSize.height;\n }\n\n getAspectRect() {\n let x, y, width, height;\n width = this.width;\n height = this.height;\n const minSize = 20;\n if (width < minSize) {\n width = minSize;\n }\n if (height < minSize) {\n height = minSize;\n }\n\n const ratio = width / height;\n const productRatio = this.productWidth / this.productHeight;\n if (ratio < productRatio) {\n height = this.productHeight / this.productWidth * width;\n } else {\n width = this.productWidth / this.productHeight * height;\n }\n\n if (this.fixedX < this.floatX) {\n x = this.fixedX;\n } else {\n x = this.fixedX - width;\n }\n\n if (this.fixedY < this.floatY) {\n y = this.fixedY;\n } else {\n y = this.fixedY - height;\n }\n\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n };\n }\n\n rotate() {\n this.rotation++;\n if (this.rotation > 3) {\n this.rotation = 0;\n }\n }\n };\n}]);\n","app.factory('Debouncer', [\n '$timeout',\n function (\n $timeout,\n ) {\n return class {\n constructor(delay = 100) {\n this.timeout = null;\n this.delay = delay;\n }\n trigger(callback) {\n if (this.timeout) {\n $timeout.cancel(this.timeout);\n }\n this.timeout = $timeout(() => {\n this.timeout = null;\n callback();\n }, this.delay);\n }\n };\n },\n]);\n","app.factory('exception', [\n 'utils',\n function (\n utils,\n ) {\n const HOSTNAME_REGEX = /http[s]*:\\/\\/[^/]+.*?/ig;\n const URL_REGEX = /http[s]?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)/ig;\n const UUID_REGEX = /[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}/g;\n const DATETIME_REGEX = /[0-9]{4}_[0-9]{2}_[0-9]{2}_[0-9]{6}/g;\n const ISO_DATETIME_REGEX = /[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]{3})?Z?/g;\n const DATE_REGEX = /[0-9]{4}-[0-9]{2}-[0-9]{2}/g;\n const TIME_REGEX = /[0-9]{2}:[0-9]{2}:[0-9]{2}/g;\n const ORDER_ID_REGEX = /\\b[0-9][0-9][0-9][0-9]+/g;\n const DEVICE_TOKEN_REGEX = /[a-zA-Z0-9]{9}-[a-zA-Z0-9]{9}-[a-zA-Z0-9]{9}-[a-zA-Z0-9]{9}/ig;\n const SHA1_HASH_REGEX = /\\b[a-f0-9]{40}\\b/ig;\n const MD5_HASH_REGEX = /\\b[a-f0-9]{32}\\b/ig;\n const BEARER_TOKEN_REGEX = /\\bBearer\\s[a-z0-9.-]+/gi;\n\n return {\n normalise (message) {\n message = message.replace(UUID_REGEX, '(uuid)');\n message = message.replace(DATETIME_REGEX, '(date/time)');\n message = message.replace(ISO_DATETIME_REGEX, '(iso-date/time)');\n message = message.replace(DATE_REGEX, '(date)');\n message = message.replace(TIME_REGEX, '(time)');\n message = message.replace(DEVICE_TOKEN_REGEX, '(device_token)');\n message = message.replace(SHA1_HASH_REGEX, '(sha1_hash)');\n message = message.replace(MD5_HASH_REGEX, '(md5_hash)');\n message = message.replace(ORDER_ID_REGEX, '#');\n message = message.replace(BEARER_TOKEN_REGEX, '(bearer_token)');\n message = message.replace(URL_REGEX, (matches) => {\n const path = matches.replace(HOSTNAME_REGEX, '');\n const hostname = matches.replace(path, '/(url)');\n return hostname;\n });\n\n return utils.cleanString(message);\n },\n\n report (msg, error) {\n if (typeof error !== 'string') {\n error = JSON.stringify(error);\n }\n\n dataLayer.push({\n event: 'Unhandled error',\n action: msg + ':' + this.normalise(error),\n label: msg + ':' + error,\n });\n },\n };\n },\n]);\n","app.factory('FitText', [\n 'log',\n 'svg',\n function (\n log,\n svg,\n ) {\n return class FitText {\n static fitText(wrapper, boundingBox, maxFontSize, lines, align = 'center') {\n log.verbose('Fit text', wrapper, boundingBox, maxFontSize, lines, align);\n if (!lines || !lines.length) {\n return;\n }\n if (!wrapper) {\n log.error('Text wrapper is not ready');\n return {};\n }\n while (wrapper.firstChild) {\n wrapper.removeChild(wrapper.firstChild);\n }\n\n let offsetX = 0;\n if (align == 'center') {\n offsetX = boundingBox.width / 2;\n } else if (align == 'left') {\n offsetX = 0;\n } else if (align == 'right') {\n offsetX = boundingBox.width;\n }\n let offsetY = 0;\n const boundingBoxHeight = boundingBox.height;\n log.verbose('Fit text offset', offsetX, offsetY);\n let nodes = [];\n let minFontSize = 100000;\n for (let i = 0; i < lines.length; i++) {\n let node = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n let lineText = lines[i] || '\\xa0';\n log.verbose('Fit line', lineText, boundingBox, offsetX, offsetY);\n node.textContent = lineText;\n node.setAttribute('class', 'p-fit-text-line-' + (i + 1));\n node.setAttribute('x', boundingBox.x + offsetX);\n node.setAttribute('y', boundingBox.y + offsetY);\n node.setAttribute('style', 'font-size: ' + Math.min(maxFontSize, boundingBoxHeight / lines.length) + 'px');\n nodes.push(node);\n wrapper.append(node);\n let fontSize = parseInt(getComputedStyle(node).fontSize);\n\n minFontSize = Math.min(minFontSize, fontSize);\n let box = svg.getBBox(node);\n while (box.height > boundingBoxHeight / lines.length || box.width > boundingBox.width) {\n fontSize--;\n node.style.fontSize = fontSize + 'px';\n minFontSize = Math.min(minFontSize, fontSize);\n if (fontSize <= 2) {\n log.verbose('Min font size reached');\n break;\n }\n box = svg.getBBox(node);\n }\n\n offsetY += box.height;\n }\n for (var i = 0; i < nodes.length; i++) {\n nodes[i].style.fontSize = minFontSize + 'px';\n }\n let wrapperBox = svg.getBBox(wrapper);\n wrapper.style.transform = `translate(0, ${(boundingBox.height / 2) - (wrapperBox.height / 2)}px)`;\n FitText.fixLineHeight(wrapper);\n return {\n nodes,\n minFontSize,\n };\n }\n\n static fixLineHeight(wrapper) {\n const nodes = wrapper.querySelectorAll('text');\n for (let i = 1; i < nodes.length; i++) {\n let previousBox = svg.getBBox(nodes[i - 1]);\n let box = svg.getBBox(nodes[i]);\n let gap = box.y - (previousBox.y + previousBox.height);\n if (gap > 50) {\n nodes[i].setAttribute('y', previousBox.y + previousBox.height + 50);\n }\n }\n }\n };\n },\n]);\n","app.factory('frameHelpers', [\n 'Unique',\n function (\n Unique,\n ) {\n function createFrameSvg(lineItem, frame) {\n const uid = Unique.random();\n const src = lineItem.image.coverImageThumbnail || lineItem.image.getSrc();\n\n return `\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `;\n }\n\n return {\n getFrames (lineItem) {\n return lineItem.product.productImages\n .filter(img => !!img.metaData.frame)\n .map(img => {\n img.metaData.frame.isPortrait = img.metaData.frame.height > img.metaData.frame.width;\n img.metaData.frame.orientation = img.metaData.frame.isPortrait ? 'portrait' : 'landscape';\n img.metaData.frame.src = img.attributes.thumbnail;\n return img.metaData.frame;\n });\n },\n\n getCurrentFrame(lineItem, preferOrientation) {\n if (! lineItem.settings) {\n lineItem.settings = {};\n }\n\n const frames = this.getFrames(lineItem);\n const orientation = preferOrientation || lineItem.settings.orientation || lineItem.image.orientation || lineItem.image.getOrientation();\n\n return frames.find(frame => frame.orientation === orientation) || frames[0];\n },\n\n extractPhotoSvg(svg, frame) {\n const clone = $(svg).clone();\n clone.attr({ 'viewBox': `${frame.window.x} ${frame.window.y} ${frame.window.width} ${frame.window.height}` });\n clone.find('[data-element=frame]').parent().remove();\n\n return $('
    ').append(clone).html();\n },\n\n getPhotoDefaults(frame, image) {\n const windowCenterX = frame.window.x + (frame.window.width / 2);\n const windowCenterY = frame.window.y + (frame.window.height / 2);\n const windowWidth = frame.window.width;\n const windowHeight = frame.window.height;\n const windowRatio = windowWidth / windowHeight;\n\n let width = 0;\n let height = 0;\n\n const imageWidth = image.width || image.getWidth();\n const imageHeight = image.height || image.getHeight();\n const imageRatio = imageWidth / imageHeight;\n\n if (windowRatio > imageRatio) {\n width = windowWidth;\n height = (windowWidth / imageWidth) * imageHeight;\n } else {\n width = (windowHeight / imageHeight) * imageWidth;\n height = windowHeight;\n }\n\n return {\n width,\n height,\n scale: 1,\n rotate: 0,\n x: windowCenterX - (width / 2),\n y: windowCenterY - (height / 2),\n };\n },\n\n render (lineItem) {\n if (! lineItem.settings) {\n lineItem.settings = {};\n }\n\n const frame = this.getCurrentFrame(lineItem);\n\n if (! lineItem.settings.x) {\n const defaults = this.getPhotoDefaults(frame, lineItem.image);\n\n lineItem.settings.x = defaults.x;\n lineItem.settings.y = defaults.y;\n lineItem.settings.width = defaults.width;\n lineItem.settings.height = defaults.height;\n lineItem.settings.scale = defaults.scale;\n lineItem.settings.rotate = defaults.rotate;\n\n const svg = createFrameSvg(lineItem, frame);\n lineItem.svg = this.extractPhotoSvg(svg, frame);\n // FIX: make sure orientation is correct when sent to server\n lineItem.cropRectPos = {\n orientation: frame.isPortrait ? 'portrait' : 'landscape',\n };\n return svg;\n }\n\n return createFrameSvg(lineItem, frame);\n },\n };\n },\n]);\n","app.factory('gtm', [\n 'log',\n function (\n log,\n ) {\n return new class Gtm {\n constructor() {\n this.data = [];\n }\n\n push(data) {\n this.data.push(data);\n dataLayer.push(data);\n log.verbose('GTM count', this.data.length, dataLayer.length);\n }\n };\n },\n]);\n","app.factory('imageUploader', [\n '$q',\n '$rootScope',\n 'api',\n 'config',\n 'gtm',\n 'log',\n 'Upload',\n function (\n $q,\n $rootScope,\n api,\n config,\n gtm,\n log,\n Upload,\n ) {\n return new class ImageUploader {\n constructor() {\n this.uploads = [];\n this.uploadingCount = 0;\n this.s3Resource = api.gets3Resource();\n }\n\n addFile(file) {\n const defer = $q.defer();\n const upload = {\n file: file,\n progress: null,\n image: null,\n load: defer.promise,\n defer: defer,\n };\n this.uploads.push(upload);\n this.startUpload();\n return upload;\n }\n\n startUpload() {\n log.verbose('Start upload', this.uploads, this.uploadingCount, config.maxUploadCount);\n if (this.uploads.length > 0 && this.uploadingCount < config.maxUploadCount) {\n const upload = this.uploads.shift();\n this.uploadingCount++;\n setTimeout(() => {\n this.upload(upload);\n }, this.uploadingCount * 10);\n }\n }\n\n async upload(upload) {\n upload.progress = 0;\n upload.started = true;\n upload.startTime = new Date();\n\n log.verbose('Apply EXIF rotation', file);\n\n let file = null;\n try {\n file = await Upload.applyExifRotation(upload.file);\n } catch (error) {\n this.handleUploadError('Failed to apply rotation', error, upload, file, null);\n return;\n }\n\n let s3 = null;\n try {\n s3 = await this.s3Resource;\n } catch (error) {\n this.handleUploadError('Failed to get S3 resource', error, upload, file, null);\n return;\n }\n\n let hash = null;\n try {\n hash = await this.getHash(file);\n } catch (error) {\n this.handleUploadError('Failed to get file hash', error, upload, file, null);\n return;\n }\n\n const extension = file.name.replace(/.*\\./, '');\n const key = `${s3.location}${hash}-${file.size}.${extension}`;\n upload.convertedFileName = `${hash}-${file.size}.${extension}`;\n upload.remoteLink = 'https://' + s3.bucket + '.s3.amazonaws.com:443/' + key;\n upload.key = key;\n\n log.verbose('Uploading', file);\n Upload.upload({\n url: 'https://' + s3.bucket + '.s3-accelerate.amazonaws.com:443/',\n method: 'POST',\n data: {\n key: upload.key,\n AWSAccessKeyId: s3.accessKeyId,\n policy: s3.policy,\n signature: s3.signature,\n acl: 'public-read',\n 'Content-Type': file.type != '' ? file.type : 'application/octet-stream',\n filename: upload.convertedFileName,\n name: '',\n file: file,\n },\n }).then(async (response) => {\n log.verbose('Upload complete', response);\n upload.success = response;\n upload.endTime = new Date();\n\n try {\n await this.register(upload, upload.remoteLink);\n } catch (error) {\n this.handleUploadError('Register image error', error, upload, file, null);\n return;\n }\n log.verbose('Register image complete');\n upload.defer.resolve();\n\n this.uploadingCount--;\n this.startUpload();\n\n gtm.push({\n event: 'Image uploaded',\n time: upload.endTime - upload.startTime,\n });\n }, (response) => {\n this.handleUploadError('Upload failure', null, upload, file, response);\n }, (evt) => {\n upload.progress = evt.loaded / evt.total;\n });\n }\n\n handleUploadError(message, error, upload, file, response) {\n log.debug('Failed to upload image', message, error, upload, file, response);\n log.error('Failed to upload image', message, error, upload.key ? upload.key : '(unknown key)', file && file.type ? file.type : '(unknown file type)');\n upload.error = 'Failed to upload image \"' + (file && file.name ? file.name : 'unknown file name') + '\", please try uploading again.';\n $rootScope.uploadErrors.push('Failed to upload image \"' + (file && file.name ? file.name : 'unknown file name') + '\", please try uploading again.');\n upload.defer.reject();\n this.uploadingCount--;\n this.startUpload();\n }\n\n async getHash(file) {\n return $q((resolve, reject) => {\n const reader = new FileReader();\n reader.onerror = () => {\n reject('Error reading file.');\n };\n reader.onabort = () => {\n reject('Aborted reading file.');\n };\n reader.onloadend = (event) => {\n if (event.target.readyState == FileReader.DONE) {\n resolve(md5(event.target.result));\n }\n };\n reader.readAsArrayBuffer(file);\n });\n }\n\n async register(upload, imageUrl) {\n return api.post('users/0/images', {\n meta: {\n device_token: config.deviceToken,\n },\n data: {\n type: 'images',\n attributes: {\n external_url: imageUrl,\n },\n },\n }).then((response) => {\n upload.image = response;\n });\n }\n };\n },\n]);\n","app.factory('Locale', [\n function (\n ) {\n const countryToCurrency = {\n AD: 'EUR',\n AE: 'AED',\n AF: 'AFN',\n AG: 'XCD',\n AI: 'XCD',\n AL: 'ALL',\n AM: 'AMD',\n AO: 'AOA',\n AR: 'ARS',\n AS: 'USD',\n AT: 'EUR',\n AU: 'AUD',\n AW: 'AWG',\n AX: 'EUR',\n AZ: 'AZN',\n BA: 'BAM',\n BB: 'BBD',\n BD: 'BDT',\n BE: 'EUR',\n BF: 'XOF',\n BG: 'BGN',\n BH: 'BHD',\n BI: 'BIF',\n BJ: 'XOF',\n BL: 'EUR',\n BM: 'BMD',\n BN: 'BND',\n BO: 'BOB',\n BQ: 'USD',\n BR: 'BRL',\n BS: 'BSD',\n BT: 'BTN',\n BV: 'NOK',\n BW: 'BWP',\n BY: 'BYR',\n BZ: 'BZD',\n CA: 'CAD',\n CC: 'AUD',\n CD: 'CDF',\n CF: 'XAF',\n CG: 'XAF',\n CH: 'CHF',\n CI: 'XOF',\n CK: 'NZD',\n CL: 'CLP',\n CM: 'XAF',\n CN: 'CNY',\n CO: 'COP',\n CR: 'CRC',\n CU: 'CUP',\n CV: 'CVE',\n CW: 'ANG',\n CX: 'AUD',\n CY: 'EUR',\n CZ: 'CZK',\n DE: 'EUR',\n DJ: 'DJF',\n DK: 'DKK',\n DM: 'XCD',\n DO: 'DOP',\n DZ: 'DZD',\n EC: 'USD',\n EE: 'EUR',\n EG: 'EGP',\n EH: 'MAD',\n ER: 'ERN',\n ES: 'EUR',\n ET: 'ETB',\n FI: 'EUR',\n FJ: 'FJD',\n FK: 'FKP',\n FM: 'USD',\n FO: 'DKK',\n FR: 'EUR',\n GA: 'XAF',\n GB: 'GBP',\n GD: 'XCD',\n GE: 'GEL',\n GF: 'EUR',\n GG: 'GBP',\n GH: 'GHS',\n GI: 'GIP',\n GL: 'DKK',\n GM: 'GMD',\n GN: 'GNF',\n GP: 'EUR',\n GQ: 'XAF',\n GR: 'EUR',\n GS: 'GBP',\n GT: 'GTQ',\n GU: 'USD',\n GW: 'XOF',\n GY: 'GYD',\n HK: 'HKD',\n HM: 'AUD',\n HN: 'HNL',\n HR: 'HRK',\n HT: 'HTG',\n HU: 'HUF',\n ID: 'IDR',\n IE: 'EUR',\n IL: 'ILS',\n IM: 'GBP',\n IN: 'INR',\n IO: 'USD',\n IQ: 'IQD',\n IR: 'IRR',\n IS: 'ISK',\n IT: 'EUR',\n JE: 'GBP',\n JM: 'JMD',\n JO: 'JOD',\n JP: 'JPY',\n KE: 'KES',\n KG: 'KGS',\n KH: 'KHR',\n KI: 'AUD',\n KM: 'KMF',\n KN: 'XCD',\n KP: 'KPW',\n KR: 'KRW',\n KW: 'KWD',\n KY: 'KYD',\n KZ: 'KZT',\n LA: 'LAK',\n LB: 'LBP',\n LC: 'XCD',\n LI: 'CHF',\n LK: 'LKR',\n LR: 'LRD',\n LS: 'LSL',\n LT: 'LTL',\n LU: 'EUR',\n LV: 'EUR',\n LY: 'LYD',\n MA: 'MAD',\n MC: 'EUR',\n MD: 'MDL',\n ME: 'EUR',\n MF: 'EUR',\n MG: 'MGA',\n MH: 'USD',\n MK: 'MKD',\n ML: 'XOF',\n MM: 'MMK',\n MN: 'MNT',\n MO: 'MOP',\n MP: 'USD',\n MQ: 'EUR',\n MR: 'MRO',\n MS: 'XCD',\n MT: 'EUR',\n MU: 'MUR',\n MV: 'MVR',\n MW: 'MWK',\n MX: 'MXN',\n MY: 'MYR',\n MZ: 'MZN',\n NA: 'NAD',\n NC: 'XPF',\n NE: 'XOF',\n NF: 'AUD',\n NG: 'NGN',\n NI: 'NIO',\n NL: 'EUR',\n NO: 'NOK',\n NP: 'NPR',\n NR: 'AUD',\n NU: 'NZD',\n NZ: 'NZD',\n OM: 'OMR',\n PA: 'PAB',\n PE: 'PEN',\n PF: 'XPF',\n PG: 'PGK',\n PH: 'PHP',\n PK: 'PKR',\n PL: 'PLN',\n PM: 'EUR',\n PN: 'NZD',\n PR: 'USD',\n PS: 'ILS',\n PT: 'EUR',\n PW: 'USD',\n PY: 'PYG',\n QA: 'QAR',\n RE: 'EUR',\n RO: 'RON',\n RS: 'RSD',\n RU: 'RUB',\n RW: 'RWF',\n SA: 'SAR',\n SB: 'SBD',\n SC: 'SCR',\n SD: 'SDG',\n SE: 'SEK',\n SG: 'SGD',\n SH: 'SHP',\n SI: 'EUR',\n SJ: 'NOK',\n SK: 'EUR',\n SL: 'SLL',\n SM: 'EUR',\n SN: 'XOF',\n SO: 'SOS',\n SR: 'SRD',\n SS: 'SSP',\n ST: 'STD',\n SV: 'USD',\n SX: 'ANG',\n SY: 'SYP',\n SZ: 'SZL',\n TC: 'USD',\n TD: 'XAF',\n TF: 'EUR',\n TG: 'XOF',\n TH: 'THB',\n TJ: 'TJS',\n TK: 'NZD',\n TL: 'USD',\n TM: 'TMT',\n TN: 'TND',\n TO: 'TOP',\n TR: 'TRY',\n TT: 'TTD',\n TV: 'AUD',\n TW: 'TWD',\n TZ: 'TZS',\n UA: 'UAH',\n UG: 'UGX',\n UM: 'USD',\n US: 'USD',\n UY: 'UYU',\n UZ: 'UZS',\n VA: 'EUR',\n VC: 'XCD',\n VE: 'VEF',\n VG: 'USD',\n VI: 'USD',\n VN: 'VND',\n VU: 'VUV',\n WF: 'XPF',\n WS: 'WST',\n XK: 'EUR',\n YE: 'YER',\n YT: 'EUR',\n ZA: 'ZAR',\n ZM: 'ZMK',\n ZW: 'ZWL',\n };\n\n return class Locale {\n static getCountryCurrency(countryCode) {\n return countryToCurrency[countryCode] || null;\n }\n };\n },\n]);\n","app.factory('log', [\n 'exception',\n function (\n exception,\n ) {\n const logger = console;\n\n return new class Log {\n debug(...messages) {\n if (CONFIG.debug) {\n logger.log('DEBUG', ...messages);\n }\n }\n\n verbose(...messages) {\n if (CONFIG.verbose) {\n logger.log('VERBOSE', ...messages);\n }\n }\n\n error(message, ...details) {\n logger.error('ERROR', message, ...details);\n\n exception.report(message, details);\n }\n\n mapErrors(response) {\n if (response.message) {\n return [response.message];\n }\n if (response.data && response.data.errors) {\n return response.data.errors.map(error => error.title);\n }\n if (response.data && response.data.body && response.data.body.errors) {\n return response.data.body.errors.map(error => error.title);\n }\n return [];\n }\n };\n },\n]);\n","app.factory('login', [\n 'config',\n function (\n config,\n ) {\n return new class Login {\n constructor() {\n this.loginToken = config.storageGet('loginToken');\n this.isLoggedIn = !!this.loginToken;\n this.name = config.storageGet('loginName') || 'My Account';\n }\n\n login(loginToken, name) {\n this.isLoggedIn = true;\n\n config.storageSet('loginToken', loginToken);\n this.loginToken = loginToken;\n\n config.storageSet('loginName', name);\n this.name = name || 'My Account';\n }\n\n logout() {\n this.isLoggedIn = false;\n\n config.storageSet('loginToken', null);\n this.loginToken = null;\n\n config.storageSet('loginName', null);\n this.name = null;\n }\n\n setName(name) {\n config.storageSet('loginName', name);\n this.name = name || 'My Account';\n }\n\n check() {\n const loginToken = config.storageGet('loginToken');\n if (!loginToken) {\n window.location = config.url('sign-in/');\n return;\n }\n return loginToken;\n }\n };\n },\n]);\n","app.factory('query', [\n function (\n ) {\n const parseQueryString = (query) => {\n const obj = {};\n const qPos = query.indexOf('?');\n const tokens = query.substr(qPos + 1).split('&');\n let i = tokens.length - 1;\n if (qPos !== -1 || query.indexOf('=') !== -1) {\n for (; i >= 0; i--) {\n var s = tokens[i].split('=');\n obj[unescape(s[0])] = s.hasOwnProperty(1) ? unescape(s[1]) : null;\n }\n }\n return obj;\n };\n\n return parseQueryString(window.location.search);\n },\n]);\n","app.factory('svg', [\n 'cart',\n 'log',\n function (\n cart,\n log,\n ) {\n const svg = (nodeName) => {\n return $(document.createElementNS('http://www.w3.org/2000/svg', nodeName));\n };\n\n svg.setImageUrl = (element, url) => {\n element.each(function () {\n this.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', url);\n });\n };\n\n svg.setClipPath = (element, id) => {\n element.each(function () {\n this.style.clipPath = `url(#${id})`;\n this.style.webkitClipPath = `url(#${id})`;\n });\n };\n\n svg.getBBox = (node) => {\n try {\n return node.getBBox();\n } catch (exception) {\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n };\n }\n };\n\n svg.getViewBox = (element, remember = false) => {\n if (element.data('viewBox')) {\n return element.data('viewBox').split(' ').map(n => parseFloat(n));\n }\n const viewBox = element.attr('viewBox').split(' ').map(n => parseFloat(n));\n if (remember) {\n element.attr('data-view-box', viewBox.join(' '));\n }\n return viewBox;\n };\n\n const entities = {\n quot: '"',\n amp: '&',\n lt: '<',\n gt: '>',\n oelig: 'Œ',\n scaron: 'Š',\n yuml: 'Ÿ',\n circ: 'ˆ',\n tilde: '˜',\n ensp: ' ',\n emsp: ' ',\n thinsp: ' ',\n zwnj: '‌',\n zwj: '‍',\n lrm: '‎',\n rlm: '‏',\n ndash: '–',\n mdash: '—',\n lsquo: '‘',\n rsquo: '’',\n sbquo: '‚',\n ldquo: '“',\n rdquo: '”',\n bdquo: '„',\n dagger: '†',\n permil: '‰',\n lsaquo: '‹',\n rsaquo: '›',\n euro: '€',\n fnof: 'ƒ',\n alpha: 'Α',\n beta: 'Β',\n gamma: 'Γ',\n delta: 'Δ',\n epsilon: 'Ε',\n zeta: 'Ζ',\n eta: 'Η',\n theta: 'Θ',\n iota: 'Ι',\n kappa: 'Κ',\n lambda: 'Λ',\n mu: 'Μ',\n nu: 'Ν',\n xi: 'Ξ',\n omicron: 'Ο',\n pi: 'Π',\n rho: 'Ρ',\n sigma: 'Σ',\n tau: 'Τ',\n upsilon: 'Υ',\n phi: 'Φ',\n chi: 'Χ',\n psi: 'Ψ',\n omega: 'Ω',\n sigmaf: 'ς',\n thetasym: 'ϑ',\n upsih: 'ϒ',\n piv: 'ϖ',\n bull: '•',\n hellip: '…',\n prime: '′',\n oline: '‾',\n frasl: '⁄',\n weierp: '℘',\n image: 'ℑ',\n real: 'ℜ',\n trade: '™',\n alefsym: 'ℵ',\n larr: '←',\n uarr: '↑',\n rarr: '→',\n darr: '↓',\n harr: '↔',\n crarr: '↵',\n forall: '∀',\n part: '∂',\n exist: '∃',\n empty: '∅',\n nabla: '∇',\n isin: '∈',\n notin: '∉',\n ni: '∋',\n prod: '∏',\n sum: '∑',\n minus: '−',\n lowast: '∗',\n radic: '√',\n prop: '∝',\n infin: '∞',\n ang: '∠',\n and: '∧',\n or: '∨',\n cap: '∩',\n cup: '∪',\n int: '∫',\n there4: '∴',\n sim: '∼',\n cong: '≅',\n asymp: '≈',\n ne: '≠',\n equiv: '≡',\n le: '≤',\n ge: '≥',\n sub: '⊂',\n sup: '⊃',\n nsub: '⊄',\n sube: '⊆',\n supe: '⊇',\n oplus: '⊕',\n otimes: '⊗',\n perp: '⊥',\n sdot: '⋅',\n lceil: '⌈',\n rceil: '⌉',\n lfloor: '⌊',\n rfloor: '⌋',\n lang: '〈',\n rang: '〉',\n loz: '◊',\n spades: '♠',\n clubs: '♣',\n hearts: '♥',\n diams: '♦',\n nbsp: ' ',\n iexcl: '¡',\n cent: '¢',\n pound: '£',\n curren: '¤',\n yen: '¥',\n brvbar: '¦',\n sect: '§',\n uml: '¨',\n copy: '©',\n ordf: 'ª',\n laquo: '«',\n not: '¬',\n shy: '­',\n reg: '®',\n macr: '¯',\n deg: '°',\n plusmn: '±',\n sup2: '²',\n sup3: '³',\n acute: '´',\n micro: 'µ',\n para: '¶',\n middot: '·',\n cedil: '¸',\n sup1: '¹',\n ordm: 'º',\n raquo: '»',\n frac14: '¼',\n frac12: '½',\n frac34: '¾',\n iquest: '¿',\n agrave: 'À',\n aacute: 'Á',\n acirc: 'Â',\n atilde: 'Ã',\n auml: 'Ä',\n aring: 'Å',\n aelig: 'Æ',\n ccedil: 'Ç',\n egrave: 'È',\n eacute: 'É',\n ecirc: 'Ê',\n euml: 'Ë',\n igrave: 'Ì',\n iacute: 'Í',\n icirc: 'Î',\n iuml: 'Ï',\n eth: 'Ð',\n ntilde: 'Ñ',\n ograve: 'Ò',\n oacute: 'Ó',\n ocirc: 'Ô',\n otilde: 'Õ',\n ouml: 'Ö',\n times: '×',\n oslash: 'Ø',\n ugrave: 'Ù',\n uacute: 'Ú',\n ucirc: 'Û',\n uuml: 'Ü',\n yacute: 'Ý',\n thorn: 'Þ',\n szlig: 'ß',\n divide: '÷',\n };\n\n svg.convertHtmlEntitiesToXml = (string) => {\n return string.replace(/&([a-z][a-z0-9]+?);/ig, (entity, entityName) => {\n return entities[entityName] || entity;\n });\n };\n\n svg.cleanSvg = (templateSvg) => {\n const wrapper = $('
    ').html(templateSvg);\n log.verbose('Replacing SVG images', wrapper.find('[data-image-key]'));\n wrapper.find('[data-image-key]').each(function () {\n svg.setImageUrl($(this), cart.images[$(this).data('imageKey')].upload.remoteLink);\n });\n wrapper.find('.p-template-ui').remove();\n return wrapper;\n };\n\n svg.cleanXml = (xml) => {\n if (xml) {\n xml = '' + xml;\n xml = svg.convertHtmlEntitiesToXml(xml);\n }\n\n return xml;\n };\n\n svg.makeDataImageUrl = (str) => {\n var svgString = new XMLSerializer().serializeToString($(str)[0]);\n var decoded = unescape(encodeURIComponent(svgString));\n var base64 = btoa(decoded);\n\n return `data:image/svg+xml;base64,${base64}`;\n };\n\n svg.safe = (string) => {\n return svg.cleanXml(\n $('
    ').append(string).html()\n );\n };\n\n return svg;\n },\n]);\n","app.factory('thumbnailer', [\n '$q',\n 'log',\n 'Upload',\n function (\n $q,\n log,\n Upload,\n ) {\n const size = 800;\n return new class Thumbnailer {\n constructor() {\n this.thumbnails = [];\n this.thumbnailCache = {};\n this.thumbnailingCount = 0;\n }\n\n addFile(file) {\n const defer = $q.defer();\n const thumbnail = {\n file: file,\n load: defer.promise,\n defer: defer,\n };\n this.thumbnails.push(thumbnail);\n this.startThumbnailing();\n return thumbnail;\n }\n\n startThumbnailing() {\n if (this.thumbnails.length > 0 && this.thumbnailingCount < 1) {\n const thumbnail = this.thumbnails.shift();\n this.thumbnail(thumbnail);\n }\n }\n\n thumbnail(thumbnail) {\n this.thumbnailingCount++;\n\n const file = thumbnail.file;\n const key = this.getFileKey(file);\n log.verbose('Thumbnailing', key, thumbnail);\n if (this.thumbnailCache[key]) {\n log.verbose('Thumbnail cached', key);\n thumbnail.url = this.thumbnailCache[key];\n this.thumbnailingCount--;\n this.startThumbnailing();\n return;\n }\n\n if (!file.type.startsWith('image/')) {\n log.verbose('Cant thumbnail, not image', file.type, key, thumbnail);\n this.thumbnailingCount--;\n this.startThumbnailing();\n return;\n }\n\n let width = size;\n let height = size;\n Upload.resize(file, {\n width,\n height,\n }).then((file) => {\n return Upload.applyExifRotation(file);\n }).then((file) => {\n return this.readFile(file);\n }).then((url) => {\n return this.loadImage(url);\n }).then((image) => {\n thumbnail.image = image;\n thumbnail.width = image.width;\n thumbnail.height = image.height;\n thumbnail.ready = true;\n }).catch((error) => {\n thumbnail.error = true;\n thumbnail.errorInfo = error;\n log.error(error);\n }).finally(() => {\n this.thumbnailingCount--;\n this.startThumbnailing();\n thumbnail.defer.resolve();\n });\n }\n\n readFile(file) {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = (e) => {\n resolve(e.target.result);\n };\n reader.onerror = (e) => {\n log.error('Failed to read file', e);\n reject();\n };\n reader.readAsDataURL(file);\n });\n }\n\n loadImage(imageUrl) {\n return new Promise((resolve, reject) => {\n const image = new Image();\n image.onload = () => {\n resolve(image);\n };\n image.onerror = (e) => {\n log.error('Failed to thumbnail image', e, e.message);\n reject();\n };\n image.src = imageUrl;\n });\n }\n\n drawImageCover(context, image) {\n if (!image) {\n return;\n }\n\n let x = 0;\n let y = 0;\n let w = context.canvas.width;\n let h = context.canvas.height;\n let offsetX = 0.5;\n let offsetY = 0.5;\n\n // keep bounds [0.0, 1.0]\n if (offsetX < 0) offsetX = 0;\n if (offsetY < 0) offsetY = 0;\n if (offsetX > 1) offsetX = 1;\n if (offsetY > 1) offsetY = 1;\n\n var iw = image.width,\n ih = image.height,\n r = Math.min(w / iw, h / ih),\n nw = iw * r, // new prop. width\n nh = ih * r, // new prop. height\n cx, cy, cw, ch, ar = 1;\n\n // decide which gap to fill\n if (nw < w) ar = w / nw;\n if (Math.abs(ar - 1) < 1e-14 && nh < h) ar = h / nh; // updated\n nw *= ar;\n nh *= ar;\n\n // calc source rectangle\n cw = iw / (nw / w);\n ch = ih / (nh / h);\n\n cx = (iw - cw) * offsetX;\n cy = (ih - ch) * offsetY;\n\n // make sure source rectangle is valid\n if (cx < 0) cx = 0;\n if (cy < 0) cy = 0;\n if (cw > iw) cw = iw;\n if (ch > ih) ch = ih;\n\n // fill image in dest. rectangle\n context.drawImage(image, cx, cy, cw, ch, x, y, w, h);\n }\n\n getFileKey(file) {\n return [file.name, file.size, file.lastModified].join(':');\n }\n };\n },\n]);\n","app.factory('Unique', [\n function (\n ) {\n const cache = {};\n return {\n random: (prefix = 'uid') => {\n let uid;\n do {\n const number = Math.random().toString().replace(/0\\./, '');\n uid = prefix + '-' + number;\n } while (cache[uid]);\n cache[uid] = true;\n return uid;\n },\n\n inc: (prefix = 'uid') => {\n let nextId = 0;\n do {\n nextId++;\n } while (cache[prefix + '-' + nextId]);\n cache[prefix + '-' + nextId] = true;\n return prefix + '-' + nextId;\n },\n };\n },\n]);\n","\napp.factory('US_STATES', [\n function (\n ) {\n return [\n { code: 'AL', name: 'ALABAMA' },\n { code: 'AK', name: 'ALASKA' },\n { code: 'AS', name: 'AMERICAN SAMOA' },\n { code: 'AZ', name: 'ARIZONA' },\n { code: 'AR', name: 'ARKANSAS' },\n { code: 'CA', name: 'CALIFORNIA' },\n { code: 'CO', name: 'COLORADO' },\n { code: 'CT', name: 'CONNECTICUT' },\n { code: 'DE', name: 'DELAWARE' },\n { code: 'DC', name: 'DISTRICT OF COLUMBIA' },\n { code: 'FM', name: 'FEDERATED STATES OF MICRONESIA' },\n { code: 'FL', name: 'FLORIDA' },\n { code: 'GA', name: 'GEORGIA' },\n { code: 'GU', name: 'GUAM GU' },\n { code: 'HI', name: 'HAWAII' },\n { code: 'ID', name: 'IDAHO' },\n { code: 'IL', name: 'ILLINOIS' },\n { code: 'IN', name: 'INDIANA' },\n { code: 'IA', name: 'IOWA' },\n { code: 'KS', name: 'KANSAS' },\n { code: 'KY', name: 'KENTUCKY' },\n { code: 'LA', name: 'LOUISIANA' },\n { code: 'ME', name: 'MAINE' },\n { code: 'MH', name: 'MARSHALL ISLANDS' },\n { code: 'MD', name: 'MARYLAND' },\n { code: 'MA', name: 'MASSACHUSETTS' },\n { code: 'MI', name: 'MICHIGAN' },\n { code: 'MN', name: 'MINNESOTA' },\n { code: 'MS', name: 'MISSISSIPPI' },\n { code: 'MO', name: 'MISSOURI' },\n { code: 'MT', name: 'MONTANA' },\n { code: 'NE', name: 'NEBRASKA' },\n { code: 'NV', name: 'NEVADA' },\n { code: 'NH', name: 'NEW HAMPSHIRE' },\n { code: 'NJ', name: 'NEW JERSEY' },\n { code: 'NM', name: 'NEW MEXICO' },\n { code: 'NY', name: 'NEW YORK' },\n { code: 'NC', name: 'NORTH CAROLINA' },\n { code: 'ND', name: 'NORTH DAKOTA' },\n { code: 'MP', name: 'NORTHERN MARIANA ISLANDS' },\n { code: 'OH', name: 'OHIO' },\n { code: 'OK', name: 'OKLAHOMA' },\n { code: 'OR', name: 'OREGON' },\n { code: 'PW', name: 'PALAU' },\n { code: 'PA', name: 'PENNSYLVANIA' },\n { code: 'PR', name: 'PUERTO RICO' },\n { code: 'RI', name: 'RHODE ISLAND' },\n { code: 'SC', name: 'SOUTH CAROLINA' },\n { code: 'SD', name: 'SOUTH DAKOTA' },\n { code: 'TN', name: 'TENNESSEE' },\n { code: 'TX', name: 'TEXAS' },\n { code: 'UT', name: 'UTAH' },\n { code: 'VT', name: 'VERMONT' },\n { code: 'VI', name: 'VIRGIN ISLANDS' },\n { code: 'VA', name: 'VIRGINIA' },\n { code: 'WA', name: 'WASHINGTON' },\n { code: 'WV', name: 'WEST VIRGINIA' },\n { code: 'WI', name: 'WISCONSIN' },\n { code: 'WY', name: 'WYOMING' },\n { code: 'AE', name: 'ARMED FORCES AFRICA / CANADA / EUROPE / MIDDLE EAST' },\n { code: 'AA', name: 'ARMED FORCES AMERICA (EXCEPT CANADA)' },\n { code: 'AP', name: 'ARMED FORCES PACIFIC' },\n ];\n },\n]);\n","app.factory('utils', [function () {\n return {\n getAspectRatio(width, height, seperator = ':') {\n const calc = (a, b) => (b == 0) ? a : calc(b, a % b);\n const ratio = calc(width, height);\n\n return (width / ratio) + seperator + (height / ratio);\n },\n\n indexOfSmallest(array) {\n return array.indexOf(Math.min.apply(Math, array));\n },\n\n cleanString (s) {\n /* eslint-disable-next-line */\n return s.replace(/[^\\x00-\\x7F]+/g, '');\n },\n };\n}]);\n"]}