{"version":3,"sources":["webpack:///webpack/bootstrap a24abb8c6a3a252a12bb","webpack:///./src/index.js","webpack:///./src/util/datastore.js","webpack:///./src/constants.js","webpack:///./src/factory.js","webpack:///./src/button.js","webpack:///./src/util/template.js","webpack:///./src/theme/templates.js","webpack:///./src/util/dynamic.js","webpack:///./src/util/images.js","webpack:///./src/util/checkout-config.js","webpack:///./src/util/locale.js","webpack:///./src/util/assign.js","webpack:///./src/util/shim.js","webpack:///./src/util/array/index.js","webpack:///./src/util/array/map.js","webpack:///./src/util/array/indexOf.js","webpack:///./~/browserlib/index.js","webpack:///./~/browserlib/lib/css.js","webpack:///./~/browserlib/lib/events.js","webpack:///./~/browserlib/lib/storage.js","webpack:///./src/form.js","webpack:///./src/qr.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAmC,SAAS;AAC5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,E;;;;;;AChEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAuC,SAAS;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA,4B;;;;;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAiC,MAAM;AACvC,2BAA0B,KAAK;AAC/B,uBAAsB,KAAK,4BAA4B,IAAI,UAAU,QAAQ,SAAS,KAAK;AAC3F;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACrRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA,iDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,+EAA8E;AAC9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;ACjKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,uDAAsD,sBAAsB,sBAAsB,wBAAwB,wBAAwB;AAClJ,MAAK;AACL;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA,2CAA0C,SAAS;AACnD,oCAAmC,SAAS;;AAE5C;AACA,8CAA6C,SAAS;;AAEtD;;AAEA;AACA,gCAA+B,SAAS;AACxC;;AAEA,sCAAqC,SAAS;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,G;;;;;;AC1GA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,E;;;;;;ACbA,8BAA6B,yBAAyB,YAAY,cAAc,cAAc,cAAc,cAAc,cAAc,GAAG,yBAAyB,eAAe,qBAAqB,uDAAuD,gCAAgC,SAAS;AACxS;AACA;AACA;AACA;AACA;AACA,0BAAyB,YAAY,cAAc,cAAc,cAAc,cAAc,cAAc,GAAG;AAC9G,6DAA4D;AAC5D;AACA,kEAAiE,gCAAgC;AACjG;AACA,GAAE,IAAI,mBAAmB,gBAAgB,qCAAqC,SAAS,gBAAgB,iBAAiB,gEAAgE,aAAa,uCAAuC,8WAA8W;AAC1lB;AACA;AACA;AACA;AACA,0BAAyB,YAAY,cAAc,cAAc,cAAc,cAAc,cAAc,GAAG;AAC9G,6DAA4D;AAC5D;AACA,kEAAiE,gCAAgC;AACjG;AACA,GAAE,IAAI,mEAAmE,mBAAmB,4BAA4B,yBAAyB,gEAAgE,kBAAkB,oGAAoG,mCAAmC,gEAAgE,yCAAyC,SAAS,OAAO,uCAAuC,wEAAwE,EAAE,yFAAyF,aAAa,GAAG,OAAO,4GAA4G,EAAE,qBAAqB,EAAE,OAAO,0EAA0E,EAAE,GAAG,yCAAyC;AACx8B;AACA;AACA;AACA,yDAAwD;AACxD;AACA;AACA;AACA,4FAA2F,0BAA0B,6BAA6B,sFAAsF,8BAA8B,gCAAgC,uCAAuC,qFAAqF,+BAA+B,+CAA+C,mDAAmD,2HAA2H,gDAAgD,yFAAyF,iCAAiC,mCAAmC,0EAA0E,EAAE;AACv7B;AACA,uB;;;;;;AC/BA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAe,gBAAgB;AAC/B;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,gBAAe,mBAAmB;AAClC;AACA;AACA;AACA;AACA,gBAAe,sBAAsB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;ACxEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,G;;;;;;ACnCA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,wDAAuD,SAAS;AAChE;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6B;;;;;;ACjEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;;AAEA,4B;;;;;;ACxBA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAgB,oBAAoB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA,yB;;;;;;ACpBA;;AAEA;AACA;;AAEA,yB;;;;;;ACLA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,E;;;;;;ACbA;AACA;AACA;AACA;AACA,iBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA,G;;;;;;ACVA;AACA,iBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA,G;;;;;;ACPA;;;AAGA;AACA;AACA;AACA;AACA,G;;;;;;ACPA;;AAEA;;;;AAIA;AACA;;AAEA,eAAc,cAAc;;AAE5B;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA,eAAc,cAAc;;AAE5B;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA,eAAc,cAAc;;AAE5B;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;;;;;;;ACzDA;;;AAGA;;AAEA;;;AAGA;AACA;AACA;AACA,gCAA+B;AAC/B;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;;AAEA,+CAA8C,mBAAmB;;AAEjE;AACA;AACA,cAAa;;AAEb;AACA;;AAEA,4BAA2B,SAAS;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,cAAa;;AAEb;AACA;;AAEA,4BAA2B,SAAS;AACpC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,EAAC,oG;;;;;;ACtFD;;;AAGA;AACA;AACA;AACA;;;AAGA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;;;;;;;ACvDA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,yBAAwB,KAAK;;AAE7B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,G;;;;;;ACtBA;;AAEA;AACA;;AAEA;AACA,mBAAkB;;AAElB;AACA;AACA;AACA;;AAEA;AACA;AACA,yBAAwB,KAAK;AAC7B;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,cAAa,KAAK;AAClB,cAAa,IAAI;AACjB,cAAa,QAAQ;AACrB,cAAa,KAAK;;;AAGlB;AACA","file":"button.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap a24abb8c6a3a252a12bb\n **/","'use strict';\nvar DataStore = require('./util/datastore'),\n factory = require('./factory'),\n constants = require('./constants'),\n app = {};\napp.counter = {\n buynow: 0,\n cart: 0,\n donate: 0,\n subscribe: 0,\n checkout: 0\n};\napp.create = function (business, data, config, parent) {\n var result = factory(business, data, config, parent);\n if (result) {\n // Log how many buttons were created\n app.counter[result.label] += 1;\n // Add it to the page\n if (parent) {\n parent.appendChild(result.el);\n }\n }\n return result;\n};\napp.process = function (el) {\n var nodes = el.getElementsByTagName('script'),\n node, data, business, i, len;\n for (i = 0, len = nodes.length; i < len; i++) {\n node = nodes[i];\n if (!node || !node.src) {\n continue;\n }\n data = new DataStore();\n data.parse(node);\n \n // If there's a merchant ID attached then it's a button of interest\n if ((business = data.pluck('merchant') || node.src.split('?merchant=')[1])) {\n app.create(business, data, {\n type: data.pluck('type'),\n label: data.pluck('button'),\n size: data.pluck('size'),\n style: data.pluck('style'),\n host: data.pluck('host'),\n shape: data.pluck('shape'),\n buttonId: data.pluck('button-id'),\n buttonType: data.pluck('button-type'),\n buttonDisabled: data.pluck('button-disabled')\n }, node.parentNode);\n // Clean up\n node.parentNode.removeChild(node);\n }\n }\n};\n// Support node and the browser\nif (typeof window === 'undefined') {\n module.exports = app;\n} else {\n // Make the API available\n if (!window.paypal) {\n window.paypal = {};\n }\n window.paypal.button = app;\n // Bind to existing scripts\n window.paypal.button.process(document);\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/index.js\n ** module id = 1\n ** module chunks = 0\n **/","'use strict';\nvar constants = require('../constants');\n\nfunction DataStore() {\n this.items = {};\n}\nDataStore.prototype.add = function addData(key, val) {\n // Remap nice values\n key = constants.PRETTY_PARAMS[key] || key;\n // Wrap strings in the value object\n if (typeof val === 'string') {\n val = {\n value: val\n };\n }\n this.items[key] = {\n label: val.label || '',\n value: val.value || '',\n editable: !!val.editable\n };\n};\nDataStore.prototype.get = function getData(key) {\n var item = this.items[key];\n return item && item.value;\n};\nDataStore.prototype.remove = function removeData(key) {\n delete this.items[key];\n};\nDataStore.prototype.pluck = function pluckData(key) {\n var val = this.get(key);\n this.remove(key);\n return val;\n};\nDataStore.prototype.parse = function parseData(el) {\n var attrs, attr, matches, key, label, value, editable, len, i;\n if ((attrs = el.attributes)) {\n for (i = 0, len = attrs.length; i < len; i++) {\n attr = attrs[i];\n if ((matches = attr.name.match(/^data-([a-z0-9_]+)(-editable)?/i))) {\n key = matches[1];\n editable = !!matches[2];\n value = attr.value;\n if (key.indexOf('option') === 0) {\n value = value.split('=');\n label = value[0];\n value = value[1].split(',');\n }\n this.add(key, {\n label: label,\n value: value,\n editable: editable\n });\n }\n }\n }\n};\nmodule.exports = DataStore;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/datastore.js\n ** module id = 2\n ** module chunks = 0\n **/","'use strict';\nvar PRIMARY = '$WORDMARK_PRIMARY$',\n VECTOR_PRIMARY = '$VECTOR_WORDMARK_PRIMARY$',\n CHECKOUT_LOGO = '$CHECKOUT_PRIMARY$',\n VECTOR_CHECKOUT_LOGO = '$VECTOR_CHECKOUT_PRIMARY$',\n CHECKOUT_REVERSE_LOGO = '$CHECKOUT_REVERSE$',\n CREDIT_LOGO = '$QUATERNARY_PRIMARY$',\n VECTOR_CREDIT_LOGO = '$VECTOR_QUATERNARY_PRIMARY$',\n VECTOR_CHECKOUT_REVERSE_LOGO = '$VECTOR_CHECKOUT_REVERSE$';\nmodule.exports = {\n BN_CODE: 'JavaScriptButtons_{label}',\n PAYPAL_URL: 'https://{host}/cgi-bin/webscr',\n QR_URL: 'https://{host}/webapps/ppint/qrcode?data={url}&pattern={pattern}&height={size}',\n QR_PATTERN: 13,\n QR_SIZE: 250,\n LIMITS: {\n width: {\n min: 100,\n max: 500\n },\n height: {\n min: 24,\n max: 100\n },\n length: {\n max: 60\n },\n length_with_wordmark: {\n max: 40\n }\n },\n PRETTY_PARAMS: {\n name: 'item_name',\n number: 'item_number',\n locale: 'lc',\n currency: 'currency_code',\n recurrence: 'p3',\n period: 't3',\n callback: 'notify_url',\n button_id: 'hosted_button_id'\n },\n WIDGET_NAME: 'paypal-button-widget',\n DEFAULT_HOST: 'www.paypal.com',\n DEFAULT_TYPE: 'button',\n DEFAULT_LABEL: 'buynow',\n DEFAULT_SIZE: 'large',\n DEFAULT_STYLE: 'primary',\n DEFAULT_LOCALE: 'en_US',\n DEFAULT_ENV: 'www',\n STRINGS: '$STRINGS$',\n STYLES: '$STYLES$',\n LOGO: '$LOGO$',\n VECTOR_LOGO: '$VECTOR_LOGO$',\n WORDMARK: {\n primary: PRIMARY,\n secondary: '$WORDMARK_SECONDARY$',\n tertiary: '$PP_LEGACY_LOGO_2X$',\n quaternary: CREDIT_LOGO,\n vector_primary: VECTOR_PRIMARY,\n vector_secondary: '$VECTOR_WORDMARK_SECONDARY$',\n vector_tertiary: '$VECTOR_PP_LEGACY_LOGO_2X$',\n vector_quaternary: VECTOR_CREDIT_LOGO,\n checkout: CHECKOUT_LOGO,\n vector_checkout: VECTOR_CHECKOUT_LOGO,\n checkout_reverse: CHECKOUT_REVERSE_LOGO,\n vector_checkout_reverse: VECTOR_CHECKOUT_REVERSE_LOGO\n },\n CHECKOUT_COLORS: ['gold', 'silver', 'blue'],\n DEFAULT_CHECKOUT_COLOR: 'gold',\n BUTTON_SHAPES: ['pill', 'rect'],\n DEFAULT_SHAPE: 'pill',\n CHECKOUT_NEW_UNSUPPORTED_LOCALES: [],\n SUPPORTED_LOCALES: ['en_AD', 'es_AD', 'fr_AD', 'zh_AD',\n 'ar_AE', 'en_AE', 'es_AE', 'fr_AE', 'zh_AE',\n 'en_AG', 'es_AG', 'fr_AG', 'zh_AG',\n 'en_AI', 'es_AI', 'fr_AI', 'zh_AI',\n 'en_AL',\n 'en_AM', 'es_AM', 'fr_AM', 'zh_AM',\n 'en_AN', 'es_AN', 'fr_AN', 'zh_AN',\n 'en_AO', 'es_AO', 'fr_AO', 'zh_AO',\n 'en_AR', 'es_AR',\n 'en_AT', 'de_AT',\n 'en_AU',\n 'en_AW', 'es_AW', 'fr_AW', 'zh_AW',\n 'en_AZ', 'es_AZ', 'fr_AZ', 'zh_AZ',\n 'en_BA',\n 'en_BB', 'es_BB', 'fr_BB', 'zh_BB',\n 'en_BE', 'fr_BE', 'nl_BE',\n 'en_BF', 'es_BF', 'fr_BF', 'zh_BF',\n 'en_BG',\n 'ar_BH', 'en_BH', 'es_BH', 'fr_BH', 'zh_BH',\n 'en_BI', 'es_BI', 'fr_BI', 'zh_BI',\n 'en_BJ', 'es_BJ', 'fr_BJ', 'zh_BJ',\n 'en_BM', 'es_BM', 'fr_BM', 'zh_BM',\n 'en_BN',\n 'en_BO', 'es_BO', 'fr_BO', 'zh_BO',\n 'pt_BR',\n 'en_BS', 'es_BS', 'fr_BS', 'zh_BS',\n 'en_BT',\n 'en_BW', 'es_BW', 'fr_BW', 'zh_BW',\n 'en_BY',\n 'en_BZ', 'es_BZ', 'fr_BZ', 'zh_BZ',\n 'en_C2', 'zh_C2',\n 'fr_CA',\n 'en_CD', 'es_CD', 'fr_CD', 'zh_CD',\n 'en_CG', 'es_CG', 'fr_CG', 'zh_CG',\n 'de_CH', 'en_CH', 'fr_CH',\n 'en_CI', 'fr_CI',\n 'en_CK', 'es_CK', 'fr_CK', 'zh_CK',\n 'en_CL', 'es_CL', 'fr_CL', 'zh_CL',\n 'en_CM', 'fr_CM',\n 'zh_CN',\n 'en_CO', 'es_CO', 'fr_CO', 'zh_CO',\n 'en_CR', 'es_CR', 'fr_CR', 'zh_CR',\n 'en_CV', 'es_CV', 'fr_CV', 'zh_CV',\n 'en_CY',\n 'en_CZ', 'es_CZ', 'fr_CZ', 'zh_CZ',\n 'de_DE',\n 'en_DJ', 'es_DJ', 'fr_DJ', 'zh_DJ',\n 'da_DK',\n 'en_DM', 'es_DM', 'fr_DM', 'zh_DM',\n 'en_DO', 'es_DO', 'fr_DO', 'zh_DO',\n 'ar_DZ', 'en_DZ', 'es_DZ', 'fr_DZ', 'zh_DZ',\n 'en_EC', 'es_EC', 'fr_EC', 'zh_EC',\n 'en_EE', 'es_EE', 'fr_EE', 'ru_EE', 'zh_EE',\n 'ar_EG', 'en_EG', 'es_EG', 'fr_EG', 'zh_EG',\n 'en_ER', 'es_ER', 'fr_ER', 'zh_ER',\n 'es_ES',\n 'en_ET', 'es_ET', 'fr_ET', 'zh_ET',\n 'en_FI', 'es_FI', 'fr_FI', 'zh_FI',\n 'en_FJ', 'es_FJ', 'fr_FJ', 'zh_FJ',\n 'en_FK', 'es_FK', 'fr_FK', 'zh_FK',\n 'en_FM',\n 'da_FO', 'en_FO', 'es_FO', 'fr_FO', 'zh_FO',\n 'fr_FR',\n 'en_GA', 'es_GA', 'fr_GA', 'zh_GA',\n 'en_GB',\n 'en_GD', 'es_GD', 'fr_GD', 'zh_GD',\n 'en_GE', 'es_GE', 'fr_GE', 'zh_GE',\n 'en_GF', 'es_GF', 'fr_GF', 'zh_GF',\n 'en_GI', 'es_GI', 'fr_GI', 'zh_GI',\n 'da_GL', 'en_GL', 'es_GL', 'fr_GL', 'zh_GL',\n 'en_GM', 'es_GM', 'fr_GM', 'zh_GM',\n 'en_GN', 'es_GN', 'fr_GN', 'zh_GN',\n 'en_GP', 'es_GP', 'fr_GP', 'zh_GP',\n 'en_GR', 'es_GR', 'fr_GR', 'zh_GR',\n 'en_GT', 'es_GT', 'fr_GT', 'zh_GT',\n 'en_GW', 'es_GW', 'fr_GW', 'zh_GW',\n 'en_GY', 'es_GY', 'fr_GY', 'zh_GY',\n 'zh_HK',\n 'en_HN', 'es_HN', 'fr_HN', 'zh_HN',\n 'en_HR',\n 'en_HU', 'es_HU', 'fr_HU', 'zh_HU',\n 'id_ID',\n 'en_IE', 'es_IE', 'fr_IE', 'zh_IE',\n 'he_IL',\n 'en_IN',\n 'en_IS',\n 'it_IT',\n 'en_JM', 'es_JM', 'fr_JM', 'zh_JM',\n 'ar_JO', 'en_JO', 'es_JO', 'fr_JO', 'zh_JO',\n 'ja_JP',\n 'en_KE', 'es_KE', 'fr_KE', 'zh_KE',\n 'en_KG', 'es_KG', 'fr_KG', 'zh_KG',\n 'en_KH',\n 'en_KI', 'es_KI', 'fr_KI', 'zh_KI',\n 'en_KM', 'es_KM', 'fr_KM', 'zh_KM',\n 'en_KN', 'es_KN', 'fr_KN', 'zh_KN',\n 'en_KR', 'ko_KR',\n 'ar_KW', 'en_KW', 'es_KW', 'fr_KW', 'zh_KW',\n 'en_KY', 'es_KY', 'fr_KY', 'zh_KY',\n 'en_KZ', 'es_KZ', 'fr_KZ', 'zh_KZ',\n 'en_LA',\n 'en_LC', 'es_LC', 'fr_LC', 'zh_LC',\n 'en_LI', 'es_LI', 'fr_LI', 'zh_LI',\n 'en_LK',\n 'en_LS', 'es_LS', 'fr_LS', 'zh_LS',\n 'en_LT', 'es_LT', 'fr_LT', 'ru_LT', 'zh_LT',\n 'de_LU', 'en_LU', 'es_LU', 'fr_LU', 'zh_LU',\n 'en_LV', 'es_LV', 'fr_LV', 'ru_LV', 'zh_LV',\n 'ar_MA', 'en_MA', 'es_MA', 'fr_MA', 'zh_MA',\n 'en_MC', 'fr_MC',\n 'en_MD',\n 'en_ME',\n 'en_MG', 'es_MG', 'fr_MG', 'zh_MG',\n 'en_MH', 'es_MH', 'fr_MH', 'zh_MH',\n 'en_MK',\n 'en_ML', 'es_ML', 'fr_ML', 'zh_ML',\n 'en_MN',\n 'en_MQ', 'es_MQ', 'fr_MQ', 'zh_MQ',\n 'en_MR', 'es_MR', 'fr_MR', 'zh_MR',\n 'en_MS', 'es_MS', 'fr_MS', 'zh_MS',\n 'en_MT',\n 'en_MU', 'es_MU', 'fr_MU', 'zh_MU',\n 'en_MV',\n 'en_MW', 'es_MW', 'fr_MW', 'zh_MW',\n 'en_MX', 'es_MX',\n 'en_MY',\n 'en_MZ', 'es_MZ', 'fr_MZ', 'zh_MZ',\n 'en_NA', 'es_NA', 'fr_NA', 'zh_NA',\n 'en_NC', 'es_NC', 'fr_NC', 'zh_NC',\n 'en_NE', 'es_NE', 'fr_NE', 'zh_NE',\n 'en_NF', 'es_NF', 'fr_NF', 'zh_NF',\n 'en_NG',\n 'en_NI', 'es_NI', 'fr_NI', 'zh_NI',\n 'nl_NL',\n 'no_NO',\n 'en_NP',\n 'en_NR', 'es_NR', 'fr_NR', 'zh_NR',\n 'en_NU', 'es_NU', 'fr_NU', 'zh_NU',\n 'en_NZ', 'es_NZ', 'fr_NZ', 'zh_NZ',\n 'ar_OM', 'en_OM', 'es_OM', 'fr_OM', 'zh_OM',\n 'en_PA', 'es_PA', 'fr_PA', 'zh_PA',\n 'en_PE', 'es_PE', 'fr_PE', 'zh_PE',\n 'en_PF', 'es_PF', 'fr_PF', 'zh_PF',\n 'en_PG', 'es_PG', 'fr_PG', 'zh_PG',\n 'en_PH',\n 'pl_PL',\n 'en_PM', 'es_PM', 'fr_PM', 'zh_PM',\n 'en_PN', 'es_PN', 'fr_PN', 'zh_PN',\n 'pt_PT',\n 'en_PW', 'es_PW', 'fr_PW', 'zh_PW',\n 'en_PY', 'es_PY',\n 'ar_QA', 'en_QA', 'es_QA', 'fr_QA', 'zh_QA',\n 'en_RE', 'es_RE', 'fr_RE', 'zh_RE',\n 'en_RO', 'es_RO', 'fr_RO', 'zh_RO',\n 'en_RS', 'es_RS', 'fr_RS', 'zh_RS',\n 'ru_RU',\n 'en_RW', 'es_RW', 'fr_RW', 'zh_RW',\n 'ar_SA', 'en_SA', 'es_SA', 'fr_SA', 'zh_SA',\n 'en_SB', 'es_SB', 'fr_SB', 'zh_SB',\n 'en_SC', 'es_SC', 'fr_SC', 'zh_SC',\n 'sv_SE',\n 'en_SG',\n 'en_SH', 'es_SH', 'fr_SH', 'zh_SH',\n 'en_SI', 'es_SI', 'fr_SI', 'zh_SI',\n 'en_SJ', 'es_SJ', 'fr_SJ', 'zh_SJ',\n 'en_SK', 'es_SK', 'fr_SK', 'zh_SK',\n 'en_SL', 'es_SL', 'fr_SL', 'zh_SL',\n 'en_SM', 'es_SM', 'fr_SM', 'zh_SM',\n 'en_SN', 'es_SN', 'fr_SN', 'zh_SN',\n 'en_SO', 'es_SO', 'fr_SO', 'zh_SO',\n 'en_SR', 'es_SR', 'fr_SR', 'zh_SR',\n 'en_ST', 'es_ST', 'fr_ST', 'zh_ST',\n 'en_SV', 'es_SV', 'fr_SV', 'zh_SV',\n 'en_SZ', 'es_SZ', 'fr_SZ', 'zh_SZ',\n 'en_TC', 'es_TC', 'fr_TC', 'zh_TC',\n 'en_TD', 'es_TD', 'fr_TD', 'zh_TD',\n 'en_TG', 'es_TG', 'fr_TG', 'zh_TG',\n 'th_TH',\n 'en_TJ', 'es_TJ', 'fr_TJ', 'zh_TJ',\n 'en_TM', 'es_TM', 'fr_TM', 'zh_TM',\n 'ar_TN', 'en_TN', 'es_TN', 'fr_TN', 'zh_TN',\n 'en_TO',\n 'tr_TR',\n 'en_TT', 'es_TT', 'fr_TT', 'zh_TT',\n 'en_TV', 'es_TV', 'fr_TV', 'zh_TV',\n 'zh_TW',\n 'en_TZ', 'es_TZ', 'fr_TZ', 'zh_TZ',\n 'en_UA', 'es_UA', 'fr_UA', 'ru_UA', 'zh_UA',\n 'en_UG', 'es_UG', 'fr_UG', 'zh_UG',\n 'en_US', 'es_US', 'fr_US', 'zh_US',\n 'en_UY', 'es_UY', 'fr_UY', 'zh_UY',\n 'en_VA', 'es_VA', 'fr_VA', 'zh_VA',\n 'en_VC', 'es_VC', 'fr_VC', 'zh_VC',\n 'en_VE', 'es_VE', 'fr_VE', 'zh_VE',\n 'en_VG', 'es_VG', 'fr_VG', 'zh_VG',\n 'en_VN',\n 'en_VU', 'es_VU', 'fr_VU', 'zh_VU',\n 'en_WF', 'es_WF', 'fr_WF', 'zh_WF',\n 'en_WS',\n 'ar_YE', 'en_YE', 'es_YE', 'fr_YE', 'zh_YE',\n 'en_YT', 'es_YT', 'fr_YT', 'zh_YT',\n 'en_ZA', 'es_ZA', 'fr_ZA', 'zh_ZA',\n 'en_ZM', 'es_ZM', 'fr_ZM', 'zh_ZM',\n 'en_ZW'],\n CHECKOUT_SIZES: ['tiny', 'small', 'medium']\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/constants.js\n ** module id = 3\n ** module chunks = 0\n **/","'use strict';\nvar DataStore = require('./util/datastore'),\n constants = require('./constants'),\n button = require('./button'),\n css = require('browserlib').css,\n form = require('./form'),\n QR = require('./qr'),\n dynamic = require('./util/dynamic'),\n assign = require('./util/assign'),\n checkoutConfig = require('./util/checkout-config'),\n hasCss = false;\n\nfunction sanitizeNumber(obj) {\n return !isNaN(parseFloat(obj)) && parseFloat(obj);\n}\n\nfunction solveConstraints(data, attrName) {\n if (data.get(attrName)) {\n var attrNum = sanitizeNumber(data.pluck(attrName)),\n min = constants.LIMITS[attrName].min,\n max = constants.LIMITS[attrName].max;\n return Math.min(Math.max(attrNum, max), min);\n }\n}\nmodule.exports = function factory(business, raw, config, parent) {\n var data, wrapper, html, key, label, type;\n var buttonEl, requestedHeight, requestedWidth, finalHeight, finalWidth, renderedWidth, heightWidthRatio,\n dynamicCssModel, tagLineEl, tagLineHeight, locale;\n if (!business) {\n return false;\n }\n\n // Normalize incoming data if needed\n if (raw.items) {\n data = raw;\n } else {\n data = new DataStore();\n for (key in raw) {\n if (raw.hasOwnProperty(key)) {\n data.add(key, raw[key]);\n }\n }\n }\n // sanitize and validate length and width\n requestedWidth = solveConstraints(data, 'width');\n requestedHeight = solveConstraints(data, 'height');\n // Defaults\n config = config || {};\n label = config.label || constants.DEFAULT_LABEL;\n type = config.type || constants.DEFAULT_TYPE;\n locale = data.get('lc') || constants.DEFAULT_LOCALE;\n \n //special case labels\n switch (label) {\n case 'checkout':\n assign(config, checkoutConfig.getConfig(label, data, config, locale));\n break;\n case 'credit':\n config.style = 'quaternary';\n break;\n default:\n if (config.style === 'checkout') {\n assign(config, checkoutConfig.getConfig(label, data, config, locale));\n }\n break;\n }\n //special case button types\n var specials = ['cart', 'donate', 'subscribe'];\n switch (type) {\n case 'cart':\n data.add('cmd', '_cart');\n data.add('add', true);\n break;\n case 'donate':\n data.add('cmd', '_donations');\n break;\n case 'subscribe':\n data.add('cmd', '_xclick-subscriptions');\n if (data.get('amount') && !data.get('a3')) {\n data.add('a3', data.pluck('amount'));\n }\n break;\n default:\n break;\n }\n\n if (specials.indexOf(type) === -1) {\n // Buy Now\n if (data.get('hosted_button_id')) {\n data.add('cmd', '_s-xclick');\n } else {\n data.add('cmd', '_xclick');\n }\n }\n // Add common data\n data.add('business', business);\n data.add('bn', constants.BN_CODE.replace(/\\{label\\}/, label));\n // Inject the CSS onto the page\n if (!hasCss) {\n hasCss = true;\n css.inject(document.getElementsByTagName('head')[0], constants.STYLES);\n }\n // If there is *either* a custom width or height,\n // then set the size to large and calculate an approximate ratio\n // first with the given label\n if (type !== 'qr' && (requestedHeight || requestedWidth)) {\n config.size = 'large'; // baseline for ratio\n wrapper = document.createElement('span');\n wrapper.className = constants.WIDGET_NAME;\n wrapper.innerHTML = button(label, data, config, locale);\n wrapper.style.visibility = 'hidden';\n parent.appendChild(wrapper);\n buttonEl = wrapper.children[0];\n heightWidthRatio = (buttonEl.offsetHeight - 2) / buttonEl.offsetWidth; // -2 because borders\n tagLineEl = wrapper.querySelectorAll('paypal-button-tag-content');\n tagLineHeight = tagLineEl[0] ? tagLineEl[0].offsetHeight : 0;\n parent.removeChild(wrapper);\n // now, if the height is not given, we calculate an optimal height given the width\n // otherwise we just use the supplied height\n finalHeight = requestedHeight || Math.floor(requestedWidth * heightWidthRatio);\n data.add('height', finalHeight.toString());\n // the width is either what's specified or interpolated\n finalWidth = requestedWidth || Math.floor(finalHeight / heightWidthRatio);\n data.add('width', finalWidth.toString());\n //Base on product requirement, dimensions of checkout buttons are fixed (doesn't allow dynamic changes)\n if (label !== 'checkout' && config.style !== 'checkout') {\n // we generate some dynamic CSS largely based on the height\n dynamicCssModel = dynamic.cssModelUsing(finalHeight, finalWidth, tagLineHeight);\n css.inject(document.getElementsByTagName('head')[0], dynamic.generateCssUsing(dynamicCssModel));\n // we again re-insert the element to determine the actual width\n wrapper.innerHTML = button(label, data, config, locale);\n parent.appendChild(wrapper);\n buttonEl = wrapper.children[0];\n renderedWidth = buttonEl.offsetWidth;\n parent.removeChild(wrapper);\n // if the final result is not as long as requested, we pad it\n if (requestedWidth && requestedWidth > renderedWidth) {\n dynamicCssModel.contentPaddingRight = dynamicCssModel.contentPaddingRight + Math.floor((finalWidth - renderedWidth) / 2);\n dynamicCssModel.contentPaddingLeft = dynamicCssModel.contentPaddingLeft + Math.ceil((finalWidth - renderedWidth) / 2);\n }\n // we are done, and inject the corrected CSS\n css.inject(document.getElementsByTagName('head')[0], dynamic.generateCssUsing(dynamicCssModel));\n }\n }\n // Build the UI components\n if (type === 'qr') {\n html = QR(data, config);\n } else if (type === 'button') {\n html = button(label, data, config, locale);\n } else {\n html = form(label, data, config);\n }\n // Wrap it up all nice and neat and return it\n wrapper = document.createElement('span');\n wrapper.className = constants.WIDGET_NAME;\n wrapper.innerHTML = html;\n return {\n label: label,\n type: type,\n el: wrapper\n };\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/factory.js\n ** module id = 4\n ** module chunks = 0\n **/","'use strict';\nvar template = require('./util/template'),\n dynamic = require('./util/dynamic'),\n constants = require('./constants'),\n images = require('./util/images'),\n assign = require('./util/assign'),\n getLocale = require('./util/locale'),\n checkoutConfig = require('./util/checkout-config');\n\n//shim a few things into arrays for IE<8\nif (!Array.prototype.indexOf) {\n require('./util/shim');\n}\n\nfunction setDefaultLabel(locale, label) {\n return constants.STRINGS[locale][label];\n}\n\nfunction createSpan(txt) {\n return (txt.length > 0) ? '' + txt + '' : '';\n}\n\nmodule.exports = function button(label, data, config, locale) {\n var model, style, wordmarkData, logoData, labelLimit, tagBorder = false,\n hasTag;\n\n config = config || {};\n locale = getLocale(locale, data.get('lc'));\n style = config.style || constants.DEFAULT_STYLE;\n\n // if a custom height or width is specified\n if (data.get('height') || data.get('width')) {\n config.size = 'custom-' + data.get('width') + '-' + data.get('height');\n }\n\n wordmarkData = images.getWordmark(label, style, data.get('color'), locale);\n logoData = images.getLogo(label, style);\n\n switch (label) {\n case 'checkout':\n assign(config, checkoutConfig.getConfig(label, data, config, locale));\n break;\n case 'credit':\n assign(config, checkoutConfig.getConfig(label, data, config, locale));\n break;\n default:\n break;\n }\n \n if (data.get('id')) {\n config.buttonId = data.get('id');\n }\n if (data.get('button_disabled') === 'true') {\n config.buttonDisabled = true;\n }\n if (data.get('button_type')) {\n config.buttonType = data.get('button_type');\n }\n\n // if a custom label is defined, use it\n if (data.get('label')) {\n // escape to be safe\n label = data.get('label').replace(/&/g, '&').replace(//g, '>').replace(/'/g, '"').replace(/'/g, ''');\n } else {\n if (data.get('wordmark') === 'false') {\n label = label + '_nowordmark';\n }\n if (label === 'checkout') {\n label = checkoutConfig.getLabel(config.size, data) || setDefaultLabel(locale, label);\n } else {\n label = setDefaultLabel(locale, label);\n }\n }\n\n // sanitize the length of the label\n labelLimit = label && label.indexOf('{wordmark}') !== -1 ? constants.LIMITS.length_with_wordmark.max : constants.LIMITS.length.max;\n label = dynamic.magicTrimmer('{wordmark}', labelLimit, label);\n\n //add span element for text styling purpose\n var labelParts = (label && label.split('{wordmark}')) || [];\n\n label = createSpan(labelParts[0]);\n\n if (labelParts.length > 1) {\n label = label.concat('{wordmark}', createSpan(labelParts[1]));\n }\n\n label = label && label.replace('{wordmark}', '\"PayPal\"');\n\n model = {\n style: style,\n color: config.color || undefined,\n size: config.size || constants.DEFAULT_SIZE,\n logo: logoData,\n label: label,\n hasTagline: hasTag,\n tagLabel: config.tagLabel,\n tagBorder: tagBorder,\n locale: locale,\n shape: config.shape || constants.DEFAULT_SHAPE,\n buttonId: config.buttonId,\n buttonType: config.buttonType,\n disabled: config.buttonDisabled\n };\n\n return template('button', model);\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/button.js\n ** module id = 5\n ** module chunks = 0\n **/","'use strict';\n\nvar templates = require('../theme/templates');\n\nmodule.exports = function template(templateName, data) {\n return templates[templateName](data);\n};\n\n// Workaround for IE 8's lack of support\nif (!String.prototype.trim) {\n String.prototype.trim = function () {\n return this.replace(/^\\s+|\\s+$/g, '');\n };\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/template.js\n ** module id = 6\n ** module chunks = 0\n **/","function encodeHTMLSource() { var encodeHTMLRules = { \"&\": \"&\", \"<\": \"<\", \">\": \">\", '\"': '"', \"'\": ''', \"/\": '/' }, matchHTML = /&(?!#?w+;)|<|>|\"|'|\\//g; return function() { return this ? this.replace(matchHTML, function(m) {return encodeHTMLRules[m] || m;}) : this; };};\nString.prototype.encodeHTML=encodeHTMLSource();\nvar tmpl = {};\n tmpl['button']=function anonymous(it\n/**/) {\nvar encodeHTML = typeof _encodeHTML !== 'undefined' ? _encodeHTML : (function (doNotSkipEncoded) {\n\t\tvar encodeHTMLRules = { \"&\": \"&\", \"<\": \"<\", \">\": \">\", '\"': \""\", \"'\": \"'\", \"/\": \"/\" },\n\t\t\tmatchHTML = doNotSkipEncoded ? /[&<>\"'\\/]/g : /&(?!#?\\w+;)|<|>|\"|'|\\//g;\n\t\treturn function(code) {\n\t\t\treturn code ? code.toString().replace(matchHTML, function(m) {return encodeHTMLRules[m] || m;}) : \"\";\n\t\t};\n\t}());var out='';return out;\n};\n tmpl['form']=function anonymous(it\n/**/) {\nvar encodeHTML = typeof _encodeHTML !== 'undefined' ? _encodeHTML : (function (doNotSkipEncoded) {\n\t\tvar encodeHTMLRules = { \"&\": \"&\", \"<\": \"<\", \">\": \">\", '\"': \""\", \"'\": \"'\", \"/\": \"/\" },\n\t\t\tmatchHTML = doNotSkipEncoded ? /[&<>\"'\\/]/g : /&(?!#?\\w+;)|<|>|\"|'|\\//g;\n\t\treturn function(code) {\n\t\t\treturn code ? code.toString().replace(matchHTML, function(m) {return encodeHTMLRules[m] || m;}) : \"\";\n\t\t};\n\t}());var out='
'; var optionIdx = 0; for (var key in it.data) { var item = it.data[key];var renderable = (item.editable || item.value instanceof Array); if (renderable) { out+='

'; } else { out+=''; } } out+=''+encodeHTML(it.button)+'
';return out;\n};\n tmpl['qr']=function anonymous(it\n/**/) {\nvar out='\" alt=\"PayPal QR code\" />';return out;\n};\n tmpl['dynamic']=function anonymous(it\n/**/) {\nvar out='.paypal-button.paypal-size-custom-<%= width %>-<%= height %> .paypal-button-logo {width: <%= logoWidth %>px;height: <%= logoHeight %>px;}.paypal-button.paypal-size-custom-<%= width %>-<%= height %> .paypal-button-logo img {width: <%= logo_imgWidth %>px;height: <%= logo_imgHeight %>px;margin: <%= logo_marginTop %>px 0 0 0;}.paypal-button.paypal-size-custom-<%= width %>-<%= height %> .paypal-button-content {height: <%= contentHeight %>px;font-size: <%= contentFontSize %>px !important;line-height: <%= contentLineHeight %>px !important;padding: <%= contentPaddingTop %>px <%= contentPaddingRight %>px <%= contentPaddingBottom %>px <%= contentPaddingLeft %>px;min-width: <%= contentMinWidth %>px !important;}.paypal-button.paypal-size-custom-<%= width %>-<%= height %> .paypal-button-content img {width: <%= content_imgWidth %>px;height: <%= content_imgHeight %>px;margin: <%= content_imgMarginTop %>px 0 0 <%= content_imgMarginLeft %>px;}';return out;\n};\nmodule.exports = tmpl;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/theme/templates.js\n ** module id = 7\n ** module chunks = 0\n **/","'use strict';\nvar template = require('./template'),\n constants = require('../constants');\n\nfunction cssModelUsing(height, width, tagLineHeight) {\n var dynamicCssModel, h, w, totalH;\n tagLineHeight = tagLineHeight || 0;\n totalH = parseFloat(height);\n h = totalH - tagLineHeight;\n w = parseFloat(width);\n dynamicCssModel = {\n width: w,\n height: totalH,\n logoWidth: h,\n logoHeight: h - 2,\n logo_imgWidth: h - 1 - 2 * Math.floor((h - 6) / 6),\n logo_imgHeight: h - 1 - 2 * Math.floor((h - 6) / 6),\n logo_marginTop: Math.floor((h - 6) / 6),\n contentHeight: Math.floor((h + 8) / 2),\n contentFontSize: Math.floor((h + 36) / 6),\n contentLineHeight: Math.floor((h + 8) / 2),\n contentPaddingTop: Math.floor((h - 8) / 4) - 1,\n contentPaddingRight: Math.floor((5 * h + 24) / 18),\n contentPaddingBottom: h - Math.floor((h + 8) / 2) - Math.floor((h - 8) / 4) - 1,\n contentPaddingLeft: Math.floor((5 * h + 24) / 18),\n contentMinWidth: 0,\n content_imgWidth: Math.floor((11 * h + 96) / 6),\n content_imgHeight: Math.floor((h + 8) / 2),\n content_imgMarginTop: Math.floor((h + 8) / 20),\n content_imgMarginLeft: Math.floor((h + 8) / 20)\n };\n return dynamicCssModel;\n}\n\nfunction generateCssUsing(cssModel) {\n return template('dynamic', cssModel);\n}\n\nfunction longestIndexFirst(arr) {\n var indexes = [],\n i;\n for (i = 0; i < arr.length; i += 1) {\n indexes[i] = i;\n }\n indexes.sort(function reverseLengthSort(a, b) {\n return (arr[b].length - arr[a].length) || (b - a);\n });\n return indexes;\n}\n\nfunction magicTrimmer(symbol, limit, text) {\n var tokens = text && text.split(symbol),\n total = 0,\n removeCount, i, tIdx, trimOrder, amtToRemove;\n total = 0;\n for (i = 0; i < tokens.length; i += 1) {\n total += tokens[i].length;\n }\n removeCount = Math.max(0, total - limit);\n trimOrder = longestIndexFirst(tokens);\n for (i = 0; i < trimOrder.length; i += 1) {\n tIdx = trimOrder[i];\n amtToRemove = Math.min(removeCount, tokens[tIdx].length);\n tokens[tIdx] = tokens[tIdx].slice(0, tokens[tIdx].length - amtToRemove);\n removeCount -= amtToRemove;\n }\n return tokens.join(symbol);\n}\nmodule.exports = {\n cssModelUsing: cssModelUsing,\n generateCssUsing: generateCssUsing,\n magicTrimmer: magicTrimmer\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/dynamic.js\n ** module id = 8\n ** module chunks = 0\n **/","'use strict';\nvar constants = require('../constants'),\n checkoutConfig = require('./checkout-config');\nvar svgSupported = document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#Image', '1.1');\n\nfunction getWordmark(label, style, color, locale) {\n var wordmarkData;\n if (label === 'checkout' && checkoutConfig.getStyle(color, locale) === 'checkout') {\n if (color && color === 'blue') {\n style = 'checkout_reverse';\n } else {\n style = 'checkout';\n }\n }\n if (label === 'credit') {\n style = 'quaternary';\n }\n wordmarkData = constants.WORDMARK[style];\n // prefer SVG logo if supported\n if (svgSupported) {\n wordmarkData = constants.WORDMARK['vector_' + style];\n }\n return wordmarkData;\n}\n\nfunction getLogo() {\n var logoData = constants.LOGO;\n if (svgSupported) {\n logoData = constants.VECTOR_LOGO;\n }\n return logoData;\n}\nmodule.exports = {\n getWordmark: getWordmark,\n getLogo: getLogo\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/images.js\n ** module id = 9\n ** module chunks = 0\n **/","'use strict';\nvar constants = require('../constants'),\n getLocale = require('./locale');\n\nfunction hasColor(color) {\n return (constants.CHECKOUT_COLORS.indexOf(color) > -1);\n}\n\nfunction localeSupported(loc) {\n return (constants.CHECKOUT_NEW_UNSUPPORTED_LOCALES.indexOf(loc) === -1);\n}\n\nfunction hasShape(shape) {\n return (constants.BUTTON_SHAPES.indexOf(shape) > -1);\n}\n\nfunction getStyle(color, locale) {\n return (localeSupported(locale)) ? 'checkout' : 'tertiary';\n}\n\nfunction getColor(color, locale) {\n if (!color && getStyle(color, locale) === 'checkout') {\n return constants.DEFAULT_CHECKOUT_COLOR;\n }\n if (!color) {\n return undefined;\n }\n color = color.toLowerCase();\n return (hasColor(color)) ? color : constants.DEFAULT_CHECKOUT_COLOR;\n}\n\nfunction getSize(dataSize, locale) {\n var defaultSize = 'small',\n lowerSize = (localeSupported(locale) && dataSize) ? dataSize.toLowerCase() : defaultSize,\n hasSize = (constants.CHECKOUT_SIZES.indexOf(lowerSize) > -1);\n return hasSize ? lowerSize : defaultSize;\n}\n\nfunction getLabel(size, data) {\n var newLabel = (size.toLowerCase() === 'tiny') ? '{wordmark}' : data.get('label');\n return newLabel;\n}\n\nfunction getShape(shape) {\n shape = shape && shape.toLowerCase();\n return (hasShape(shape)) ? shape : constants.DEFAULT_SHAPE;\n}\n\nfunction getConfig(label, data, config, locale) {\n var color = data.get('color'),\n buttonSize = data.get('size') || config.size,\n shape = data.get('shape') || config.shape,\n loc = getLocale(locale, data.get('lc'));\n var configUpdate = {\n size: getSize(buttonSize, locale),\n style: getStyle(color, loc),\n color: getColor(color, loc),\n shape: getShape(shape),\n tagLabel: (data.get('tagline') === 'false') ? '' : constants.STRINGS[loc][label + '_tag']\n };\n return configUpdate;\n}\nexports.getConfig = getConfig;\nexports.getStyle = getStyle;\nexports.localeSupported = localeSupported;\nexports.getLabel = getLabel;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/checkout-config.js\n ** module id = 10\n ** module chunks = 0\n **/","'use strict';\n\nvar constants = require('../constants');\n\nfunction lower(word) {\n return word.toLowerCase();\n}\n\nfunction matchLowers(dataLocale) {\n return constants.SUPPORTED_LOCALES.map(lower).indexOf(dataLocale.toLowerCase()) > -1;\n}\n\nfunction getLocale(locale, dataLocale) {\n var loc = locale || constants.DEFAULT_LOCALE;\n if (dataLocale) {\n if (matchLowers(dataLocale)) {\n loc = dataLocale;\n } else {\n loc = constants.DEFAULT_LOCALE;\n }\n }\n return loc;\n}\n\nmodule.exports = getLocale;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/locale.js\n ** module id = 11\n ** module chunks = 0\n **/","'use strict';\n\nfunction assign(target/*, sources*/) {\n\tif (!target) {\n\t\tthrow new Error('cannot assign to null/undefined!');\n\t}\n\tvar sources = Array.prototype.slice.call(arguments, 1);\n\tvar source;\n\tfor (var x = 0; x < sources.length; x++) {\n\t\tsource = sources[x];\n\t\tfor (var key in source) {\n\t\t\tif (source.hasOwnProperty(key)) {\n\t\t\t\ttarget[key] = source[key];\n\t\t\t}\n\t\t}\n\t}\n\treturn target;\n}\n\n\nmodule.exports = assign;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/assign.js\n ** module id = 12\n ** module chunks = 0\n **/","'use strict';\n\n// require any browser shims,\n// polyfills, and any other junk here.\n\nrequire('./array/');\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/shim.js\n ** module id = 13\n ** module chunks = 0\n **/","var map = require('./map'),\n indexOf = require('./indexOf');\n\nif (!Array.prototype.indexOf) {\n Array.prototype.indexOf = function (item) {\n return indexOf(item, this);\n };\n}\n\nif (!Array.prototype.map) {\n Array.prototype.map = function (iterator) {\n return map(iterator, this);\n };\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/array/index.js\n ** module id = 14\n ** module chunks = 0\n **/","module.exports = function map(iterator, arr) {\n\t//shim for Array.prototype.map\n\tvar results = [];\n\tresults.length = arr.length;\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (arr[i] !== undefined) {\n\t\t\tresults[i] = iterator(arr[i], i, arr);\n\t\t}\n\t}\n\treturn results;\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/array/map.js\n ** module id = 15\n ** module chunks = 0\n **/","module.exports = function indexOf(item, arr) {\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tif (arr[i] === item) {\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/util/array/indexOf.js\n ** module id = 16\n ** module chunks = 0\n **/","'use strict';\n\n\nmodule.exports = {\n\tcss: require('./lib/css'),\n\tevents: require('./lib/events'),\n\tStorage: require('./lib/storage')\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/browserlib/index.js\n ** module id = 17\n ** module chunks = 0\n **/","/* jshint quotmark:double */\n\n\"use strict\";\n\n\n\nmodule.exports.add = function add(el, str) {\n var re;\n\n if (!el) { return false; }\n\n if (el && el.classList && el.classList.add) {\n el.classList.add(str);\n } else {\n re = new RegExp(\"\\\\b\" + str + \"\\\\b\");\n\n if (!re.test(el.className)) {\n el.className += \" \" + str;\n }\n }\n};\n\n\nmodule.exports.remove = function remove(el, str) {\n var re;\n\n if (!el) { return false; }\n\n if (el.classList && el.classList.remove) {\n el.classList.remove(str);\n } else {\n re = new RegExp(\"\\\\b\" + str + \"\\\\b\");\n\n if (re.test(el.className)) {\n el.className = el.className.replace(re, \"\");\n }\n }\n};\n\n\nmodule.exports.inject = function inject(el, str) {\n var style;\n\n if (!el) { return false; }\n\n if (str) {\n style = document.createElement(\"style\");\n style.type = \"text/css\";\n\n if (style.styleSheet) {\n style.styleSheet.cssText = str;\n } else {\n style.appendChild(document.createTextNode(str));\n }\n\n el.appendChild(style);\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/browserlib/lib/css.js\n ** module id = 18\n ** module chunks = 0\n **/","'use strict';\n\n\nmodule.exports = (function (window, document) {\n\n var cache = [];\n\n\n // NOOP for Node\n if (!document) {\n return {\n add: function () {},\n remove: function () {}\n };\n // Non-IE events\n } else if (document.addEventListener) {\n return {\n\n add: function (obj, type, fn, scope) {\n scope = scope || obj;\n\n var wrappedFn = function (e) { fn.call(scope, e); };\n\n obj.addEventListener(type, wrappedFn, false);\n cache.push([obj, type, fn, wrappedFn]);\n },\n\n remove: function (obj, type, fn) {\n var wrappedFn, item, len = cache.length, i;\n\n for (i = 0; i < len; i++) {\n item = cache[i];\n\n if (item[0] === obj && item[1] === type && item[2] === fn) {\n wrappedFn = item[3];\n\n if (wrappedFn) {\n obj.removeEventListener(type, wrappedFn, false);\n delete cache[i];\n }\n }\n }\n }\n };\n\n // IE events\n } else if (document.attachEvent) {\n return {\n\n add: function (obj, type, fn, scope) {\n scope = scope || obj;\n\n var wrappedFn = function () {\n var e = window.event;\n e.target = e.target || e.srcElement;\n\n e.preventDefault = function () {\n e.returnValue = false;\n };\n\n fn.call(scope, e);\n };\n\n obj.attachEvent('on' + type, wrappedFn);\n cache.push([obj, type, fn, wrappedFn]);\n },\n\n remove: function (obj, type, fn) {\n var wrappedFn, item, len = cache.length, i;\n\n for (i = 0; i < len; i++) {\n item = cache[i];\n\n if (item[0] === obj && item[1] === type && item[2] === fn) {\n wrappedFn = item[3];\n\n if (wrappedFn) {\n obj.detachEvent('on' + type, wrappedFn);\n delete cache[i];\n }\n }\n }\n }\n };\n }\n\n})(typeof window === 'undefined' ? null : window, typeof document === 'undefined' ? null : document);\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/browserlib/lib/events.js\n ** module id = 19\n ** module chunks = 0\n **/","'use strict';\n\n\nvar Storage = module.exports = function Storage(name, duration) {\n this._name = name;\n this._duration = duration || 30;\n};\n\n\nvar proto = Storage.prototype;\n\n\nproto.load = function () {\n if (typeof window === 'object' && window.localStorage) {\n var data = window.localStorage.getItem(this._name), today, expires;\n\n if (data) {\n data = JSON.parse(decodeURIComponent(data));\n }\n\n if (data && data.expires) {\n today = new Date();\n expires = new Date(data.expires);\n\n if (today > expires) {\n this.destroy();\n return;\n }\n }\n\n return data && data.value;\n }\n};\n\n\nproto.save = function (data) {\n if (typeof window === 'object' && window.localStorage) {\n var expires = new Date(), wrapped;\n\n expires.setTime(expires.getTime() + this._duration * 24 * 60 * 60 * 1000);\n\n wrapped = {\n value: data,\n expires: expires.toGMTString()\n };\n\n window.localStorage.setItem(this._name, encodeURIComponent(JSON.stringify(wrapped)));\n }\n};\n\n\nproto.destroy = function () {\n if (typeof window === 'object' && window.localStorage) {\n window.localStorage.removeItem(this._name);\n }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./~/browserlib/lib/storage.js\n ** module id = 20\n ** module chunks = 0\n **/","'use strict';\n\nvar constants = require('./constants'),\n template = require('./util/template'),\n button = require('./button');\n\nmodule.exports = function form(type, data, config) {\n var model, btn, url, locale;\n\n btn = button(type, data, config);\n locale = data.get('lc') || constants.DEFAULT_LOCALE;\n url = constants.PAYPAL_URL;\n url = url.replace('{host}', config.host || constants.DEFAULT_HOST);\n\n model = {\n data: data.items,\n button: btn,\n url: url,\n content: constants.STRINGS[locale]\n };\n\n return template('form', model);\n};\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/form.js\n ** module id = 21\n ** module chunks = 0\n **/","'use strict';\n\nvar constants = require('./constants'),\n template = require('./util/template');\n\nmodule.exports = function Qr(data, config) {\n var model = {}, url, key;\n \n // Defaults\n config = config || {};\n config.size = config.size || constants.QR_SIZE;\n config.host = config.host || constants.DEFAULT_HOST;\n\n // Construct URL\n url = constants.PAYPAL_URL;\n url = url.replace('{host}', config.host);\n url = url + '?';\n\n for (key in data.items) {\n if (data.items.hasOwnProperty(key)) {\n url += key + '=' + encodeURIComponent(data.get(key)) + '&';\n }\n }\n\n url = encodeURIComponent(url);\n\n // Render\n model.url = constants.QR_URL\n\t\t.replace('{host}', config.host)\n\t\t.replace('{url}', url)\n\t\t.replace('{pattern}', constants.QR_PATTERN)\n\t\t.replace('{size}', config.size);\n\n\n return template('qr', model);\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/qr.js\n ** module id = 22\n ** module chunks = 0\n **/"],"sourceRoot":""}