{"version":3,"file":"SaveButton.453c8977.js","sources":["../../app/javascript/app/integrations/NewNetlifySiteModal.vue","../../app/javascript/app/integrations/Netlify.vue","../../app/javascript/app/services/ViewService.js","../../app/javascript/app/views/buttons/BackButton.vue","../../node_modules/emoji-js/lib/emoji.js","../../app/javascript/app/services/PageService.js","../../app/javascript/app/services/ThemeService.js","../../app/javascript/app/views/buttons/SaveButton.vue"],"sourcesContent":["\n\n\n\n","\n\n\n\n\n\n\n\n","import RestService from './RestService'\n\nexport default class ViewService extends RestService {\n constructor() {\n super('views')\n }\n\n getData(view, table, parentDocumentId, relatedField) {\n return new Promise((resolve, reject) => {\n let url = this.baseUrl + '/api/v1/' + this.modelPath + '/data/' + view.id + '.json?t=' + Date.now()\n\n if(parentDocumentId && relatedField) {\n url = url + '&parent_id=' + parentDocumentId + '&related_id=' + relatedField.index\n }\n\n this.http.get(url)\n .set('x-api-token', this.authToken)\n .end((error, response) => {\n if (response.status === 200) {\n const records = JSON.parse(response.text)\n for(let i = 0; i < records.length; i++) {\n records[i].editMode = false\n\n // ensure every field in a record is reactive\n // for very large tables this will have a performance penalty\n // one work around it to save the record with a field value\n // when the field is created.\n for(let j = 0; j < table.fields.length; j++) {\n let field = table.fields[j]\n\n if(records[i][field.index] === undefined) {\n records[i][field.index] = webase.utils.table.initField(field)\n }\n }\n }\n webase.model.documents = records\n resolve(records)\n } else {\n reject(response.statusText)\n }\n })\n })\n }\n}","\n\n\n\n\n","\"use strict\";\n\n;(function() {\n\n\tvar root = this;\n\tvar previous_emoji = root.EmojiConvertor;\n\n\n\t/**\n\t * @global\n\t * @namespace\n\t */\n\n\tvar emoji = function(){\n\n\t\tvar self = this;\n\n\t\t/**\n\t\t * The set of images to use for graphical emoji.\n\t\t *\n\t\t * @memberof emoji\n\t\t * @type {string}\n\t\t */\n\t\tself.img_set = 'apple';\n\n\t\t/**\n\t\t * Configuration details for different image sets. This includes a path to a directory containing the\n\t\t * individual images (`path`) and a URL to sprite sheets (`sheet`). All of these images can be found\n\t\t * in the [emoji-data repository]{@link https://github.com/iamcal/emoji-data}. Using a CDN for these\n\t\t * is not a bad idea.\n\t\t *\n\t\t * @memberof emoji\n\t\t * @type {object}\n\t\t */\n\t\tself.img_sets = {\n\t\t\t'apple' : {'path' : '/emoji-data/img-apple-64/', 'sheet' : '/emoji-data/sheet_apple_64.png', 'sheet_size' : 64, 'mask' : 1},\n\t\t\t'google' : {'path' : '/emoji-data/img-google-64/', 'sheet' : '/emoji-data/sheet_google_64.png', 'sheet_size' : 64, 'mask' : 2},\n\t\t\t'twitter' : {'path' : '/emoji-data/img-twitter-64/', 'sheet' : '/emoji-data/sheet_twitter_64.png', 'sheet_size' : 64, 'mask' : 4},\n\t\t\t'facebook' : {'path' : '/emoji-data/img-facebook-64/', 'sheet' : '/emoji-data/sheet_facebook_64.png', 'sheet_size' : 64, 'mask' : 8},\n\t\t\t'messenger' : {'path' : '/emoji-data/img-messenger-64/', 'sheet' : '/emoji-data/sheet_messenger_64.png', 'sheet_size' : 64, 'mask' : 16},\n\t\t};\n\n\t\t/**\n\t\t * Use a CSS class instead of specifying a sprite or background image for\n\t\t * the span representing the emoticon. This requires a CSS sheet with\n\t\t * emoticon data-uris.\n\t\t *\n\t\t * @memberof emoji\n\t\t * @type bool\n\t\t * @todo document how to build the CSS stylesheet self requires.\n\t\t */\n\t\tself.use_css_imgs = false;\n\n\t\t/**\n\t\t * Instead of replacing emoticons with the appropriate representations,\n\t\t * replace them with their colon string representation.\n\t\t * @memberof emoji\n\t\t * @type bool\n\t\t */\n\t\tself.colons_mode = false;\n\t\tself.text_mode = false;\n\n\t\t/**\n\t\t * If true, sets the \"title\" property on the span or image that gets\n\t\t * inserted for the emoticon.\n\t\t * @memberof emoji\n\t\t * @type bool\n\t\t */\n\t\tself.include_title = false;\n\n\t\t/**\n\t\t * If true, sets the text of the span or image that gets inserted for the\n\t\t * emoticon.\n\t\t * @memberof emoji\n\t\t * @type bool\n\t\t */\n\t\tself.include_text = false;\n\n\t\t/**\n\t\t * If the platform supports native emoticons, use those instead\n\t\t * of the fallbacks.\n\t\t * @memberof emoji\n\t\t * @type bool\n\t\t */\n\t\tself.allow_native = true;\n\n\t\t/**\n\t\t * Wrap native with a to allow styling\n\t\t * @memberof emoji\n\t\t * @type bool\n\t\t */\n\t\tself.wrap_native = false;\n\n\t\t/**\n\t\t * Set to true to use CSS sprites instead of individual images on\n\t\t * platforms that support it.\n\t\t *\n\t\t * @memberof emoji\n\t\t * @type bool\n\t\t */\n\t\tself.use_sheet = false;\n\n\t\t/**\n\t\t *\n\t\t * Set to true to avoid black & white native Windows emoji being used.\n\t\t *\n\t\t * @memberof emoji\n\t\t * @type bool\n\t\t */\n\t\tself.avoid_ms_emoji = true;\n\n\t\t/**\n\t\t *\n\t\t * Set to true to allow :CAPITALIZATION:\n\t\t *\n\t\t * @memberof emoji\n\t\t * @type bool\n\t\t */\n\t\tself.allow_caps = false;\n\n\n\t\t/**\n\t\t *\n\t\t * Suffix to allow for individual image cache busting\n\t\t *\n\t\t * @memberof emoji\n\t\t * @type string\n\t\t */\n\t\tself.img_suffix = '';\n\n\n\t\t// Keeps track of what has been initialized.\n\t\t/** @private */\n\t\tself.inits = {};\n\t\tself.map = {};\n\n\t\t// discover the environment settings\n\t\tself.init_env();\n\n\t\treturn self;\n\t}\n\n\temoji.prototype.noConflict = function(){\n\t\troot.EmojiConvertor = previous_emoji;\n\t\treturn emoji;\n\t}\n\n\n\t/**\n\t * @memberof emoji\n\t * @param {string} str A string potentially containing ascii emoticons\n\t * (ie. `:)`)\n\t *\n\t * @returns {string} A new string with all emoticons in `str`\n\t * replaced by a representatation that's supported by the current\n\t * environtment.\n\t */\n\temoji.prototype.replace_emoticons = function(str){\n\t\tvar self = this;\n\t\tvar colonized = self.replace_emoticons_with_colons(str);\n\t\treturn self.replace_colons(colonized);\n\t};\n\n\t/**\n\t * @memberof emoji\n\t * @param {string} str A string potentially containing ascii emoticons\n\t * (ie. `:)`)\n\t *\n\t * @returns {string} A new string with all emoticons in `str`\n\t * replaced by their colon string representations (ie. `:smile:`)\n\t */\n\temoji.prototype.replace_emoticons_with_colons = function(str){\n\t\tvar self = this;\n\t\tself.init_emoticons();\n\t\tvar _prev_offset = 0;\n\t\tvar emoticons_with_parens = [];\n\t\tvar str_replaced = str.replace(self.rx_emoticons, function(m, $1, emoticon, offset){\n\t\t\tvar prev_offset = _prev_offset;\n\t\t\t_prev_offset = offset + m.length;\n\n\t\t\tvar has_open_paren = emoticon.indexOf('(') !== -1;\n\t\t\tvar has_close_paren = emoticon.indexOf(')') !== -1;\n\n\t\t\t/*\n\t\t\t * Track paren-having emoticons for fixing later\n\t\t\t */\n\t\t\tif ((has_open_paren || has_close_paren) && emoticons_with_parens.indexOf(emoticon) == -1) {\n\t\t\t\temoticons_with_parens.push(emoticon);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Look for preceding open paren for emoticons that contain a close paren\n\t\t\t * This prevents matching \"8)\" inside \"(around 7 - 8)\"\n\t\t\t */\n\t\t\tif (has_close_paren && !has_open_paren) {\n\t\t\t\tvar piece = str.substring(prev_offset, offset);\n\t\t\t\tif (piece.indexOf('(') !== -1 && piece.indexOf(')') === -1) return m;\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * See if we're in a numbered list\n\t\t\t * This prevents matching \"8)\" inside \"7) foo\\n8) bar\"\n\t\t\t */\n\t\t\tif (m === '\\n8)') {\n\t\t\t\tvar before_match = str.substring(0, offset);\n\t\t\t\tif (/\\n?(6\\)|7\\))/.test(before_match)) return m;\n\t\t\t}\n\n\t\t\tvar val = self.data[self.map.emoticons[emoticon]][3][0];\n\t\t\treturn val ? $1+':'+val+':' : m;\n\t\t});\n\n\t\t/*\n\t\t * Come back and fix emoticons we ignored because they were inside parens.\n\t\t * It's useful to do self at the end so we don't get tripped up by other,\n\t\t * normal emoticons\n\t\t */\n\t\tif (emoticons_with_parens.length) {\n\t\t\tvar escaped_emoticons = emoticons_with_parens.map(self.escape_rx);\n\t\t\tvar parenthetical_rx = new RegExp('(\\\\(.+)('+escaped_emoticons.join('|')+')(.+\\\\))', 'g');\n\n\t\t\tstr_replaced = str_replaced.replace(parenthetical_rx, function(m, $1, emoticon, $2) {\n\t\t\t\tvar val = self.data[self.map.emoticons[emoticon]][3][0];\n\t\t\t\treturn val ? $1+':'+val+':'+$2 : m;\n\t\t\t});\n\t\t}\n\n\t\treturn str_replaced;\n\t};\n\n\t/**\n\t * @memberof emoji\n\t * @param {string} str A string potentially containing colon string\n\t * representations of emoticons (ie. `:smile:`)\n\t *\n\t * @returns {string} A new string with all colon string emoticons replaced\n\t * with the appropriate representation.\n\t */\n\temoji.prototype.replace_colons = function(str){\n\t\tvar self = this;\n\t\tself.init_colons();\n\n\t\treturn str.replace(self.rx_colons, function(m){\n\t\t\tvar idx = m.substr(1, m.length-2);\n\t\t\tif (self.allow_caps) idx = idx.toLowerCase();\n\n\t\t\t// special case - an emoji with a skintone modified\n\t\t\tif (idx.indexOf('::skin-tone-') > -1){\n\n\t\t\t\tvar skin_tone = idx.substr(-1, 1);\n\t\t\t\tvar skin_idx = 'skin-tone-'+skin_tone;\n\t\t\t\tvar skin_val = self.map.colons[skin_idx];\n\n\t\t\t\tidx = idx.substr(0, idx.length - 13);\n\n\t\t\t\tvar val = self.map.colons[idx];\n\t\t\t\tif (val){\n\t\t\t\t\treturn self.replacement(val, idx, ':', {\n\t\t\t\t\t\t'idx'\t\t: skin_val,\n\t\t\t\t\t\t'actual'\t: skin_idx,\n\t\t\t\t\t\t'wrapper'\t: ':'\n\t\t\t\t\t});\n\t\t\t\t}else{\n\t\t\t\t\treturn ':' + idx + ':' + self.replacement(skin_val, skin_idx, ':');\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tvar val = self.map.colons[idx];\n\t\t\t\treturn val ? self.replacement(val, idx, ':') : m;\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * @memberof emoji\n\t * @param {string} str A string potentially containing unified unicode\n\t * emoticons. (ie. 😄)\n\t *\n\t * @returns {string} A new string with all unicode emoticons replaced with\n\t * the appropriate representation for the current environment.\n\t */\n\temoji.prototype.replace_unified = function(str){\n\t\tvar self = this;\n\t\tself.init_unified();\n\t\treturn str.replace(self.rx_unified, function(m, p1, p2){\n\n\t\t\tvar val = self.map.unified[p1];\n\t\t\tif (val){\n\t\t\t\tvar idx = null;\n\t\t\t\tif (p2 == '\\uD83C\\uDFFB') idx = '1f3fb';\n\t\t\t\tif (p2 == '\\uD83C\\uDFFC') idx = '1f3fc';\n\t\t\t\tif (p2 == '\\uD83C\\uDFFD') idx = '1f3fd';\n\t\t\t\tif (p2 == '\\uD83C\\uDFFE') idx = '1f3fe';\n\t\t\t\tif (p2 == '\\uD83C\\uDFFF') idx = '1f3ff';\n\t\t\t\tif (idx){\n\t\t\t\t\treturn self.replacement(val, null, null, {\n\t\t\t\t\t\tidx\t: idx,\n\t\t\t\t\t\tactual\t: p2,\n\t\t\t\t\t\twrapper\t: ''\n\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\treturn self.replacement(val);\n\t\t\t}\n\n\t\t\tval = self.map.unified_vars[p1];\n\t\t\tif (val){\n\t\t\t\treturn self.replacement(val[0], null, null, {\n\t\t\t\t\t'idx'\t\t: val[1],\n\t\t\t\t\t'actual'\t: '',\n\t\t\t\t\t'wrapper'\t: '',\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn m;\n\t\t});\n\t};\n\n\temoji.prototype.addAliases = function(map){\n\t\tvar self = this;\n\n\t\tself.init_colons();\n\t\tfor (var i in map){\n\t\t\tself.map.colons[i] = map[i];\n\t\t}\n\t};\n\n\temoji.prototype.removeAliases = function(list){\n\t\tvar self = this;\n\n\t\tfor (var i=0; i'+text+''+extra;\n\t\t\t}else if (self.use_css_imgs){\n\t\t\t\treturn ''+text+''+extra;\n\t\t\t}else{\n\t\t\t\treturn ''+text+''+extra;\n\t\t\t}\n\t\t}\n\t\treturn ''+extra;\n\t};\n\n\t// Wraps the output of a native endpoint, if configured\n\t/** @private */\n\temoji.prototype.format_native = function(native, allow_wrap){\n\t\tvar self = this;\n\n\t\tif (self.wrap_native && allow_wrap){\n\t\t\treturn ''+ native + '';\n\t\t}\n\t\treturn native;\n\t};\n\n\t// Finds the best image to display, taking into account image set precedence and obsoletes\n\t/** @private */\n\temoji.prototype.find_image = function(idx, var_idx){\n\t\tvar self = this;\n\n\t\t// set up some initial state\n\t\tvar out = {\n\t\t\t'path'\t\t: '',\n\t\t\t'sheet'\t\t: '',\n\t\t\t'sheet_size'\t: 0,\n\t\t\t'px'\t\t: self.data[idx][4],\n\t\t\t'py'\t\t: self.data[idx][5],\n\t\t\t'full_idx'\t: idx,\n\t\t\t'is_var'\t: false,\n\t\t\t'unified'\t: self.data[idx][0][0]\n\t\t};\n\t\tvar use_mask = self.data[idx][6];\n\n\t\t// can we use a variation?\n\t\tif (var_idx && self.variations_data[idx] && self.variations_data[idx][var_idx]){\n\t\t\tvar var_data = self.variations_data[idx][var_idx];\n\n\t\t\tout.px = var_data[1];\n\t\t\tout.py = var_data[2];\n\t\t\tout.full_idx = var_data[0];\n\t\t\tout.is_var = true;\n\t\t\tout.unified = var_data[4];\n\t\t\tuse_mask = var_data[3];\n\t\t}\n\n\t\t// this matches `build/build_image.php` `in emoji-data`, so that sheet and images modes always\n\t\t// agree about the image to use.\n\t\tvar try_order = [self.img_set, 'apple', 'google', 'twitter', 'facebook', 'messenger'];\n\n\t\t// for each image set, see if we have the image we need. otherwise check for an obsolete in\n\t\t// that image set\n\t\tfor (var j=0; j/g, '>');\n\n\t\t\tif (!self.map.colons[self.emoticons_data[i]]) continue;\n\n\t\t\tself.map.emoticons[emoticon] = self.map.colons[self.emoticons_data[i]];\n\t\t\ta.push(self.escape_rx(emoticon));\n\t\t}\n\t\tself.rx_emoticons = new RegExp(('(^|\\\\s)('+a.join('|')+')(?=$|[\\\\s|\\\\?\\\\.,!])'), 'g');\n\t};\n\n\t// Initializes the colon string data\n\t/** @private */\n\temoji.prototype.init_colons = function(){\n\t\tvar self = this;\n\t\tif (self.inits.colons) return;\n\t\tself.inits.colons = 1;\n\t\tself.rx_colons = new RegExp('\\:[a-zA-Z0-9-_+]+\\:(\\:skin-tone-[2-6]\\:)?', 'g');\n\t\tself.map.colons = {};\n\t\tfor (var i in self.data){\n\t\t\tfor (var j=0; j